From alpt@freaknet.org Sat Jan 1 01:10:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Jan 2005 01:10:27 -0800 (PST) Received: from darkalpt.dyndns.org (host111-78.pool82104.interbusiness.it [82.104.78.111]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0199wZ3013031 for ; Sat, 1 Jan 2005 01:10:19 -0800 Received: (qmail 6179 invoked by uid 1000); 31 Dec 2004 23:31:12 +0100 Date: Fri, 31 Dec 2004 23:31:12 +0100 From: Alpt To: netdev@oss.sgi.com Subject: Ipv6 and the lost broadcast Message-ID: <20041231223112.GA6134@darkalpt> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qDbXVdCdHGoSgWSk" Content-Disposition: inline User-Agent: Mutt/1.5.6i X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13313 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: alpt@freaknet.org Precedence: bulk X-list: netdev --qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Once upon a time in the ip protocol there was INADDR_BROADCAST, and all seemed happy. =66rom "man ipv6": " IPv6 supports several address types: unicast to address a single host, multicast to address a group of hosts, anycast to address the nearest member of a group of hosts (not implemented in Linux), IPv4-on-IPv6 to address a IPv4 host, and other reserved address types." =66rom net/ipv6/tcp_ipv6.c +582: =2E.. /* * connect() to INADDR_ANY means loopback (BSD'ism). */ =09 if(ipv6_addr_any(&usin->sin6_addr)) usin->sin6_addr.s6_addr[15] =3D 0x1;=20 =2E.. Why it isn't supported? Is there a particular reason to follow this BSD'ism?=20 Is it possible to achieve the same result of INADDR_BROADCAST with multicast? The propagation has to be restricted only to the neighbour nodes. Best Regards --=20 :wq! "I don't know nothing" The One Who reached the Thinking Matter '.' [ Alpt --- Freaknet Medialab ] [ GPG Key ID 441CF0EE ] [ Key fingerprint =3D 8B02 26E8 831A 7BB9 81A9 5277 BFF8 037E 441C F0EE ] --qDbXVdCdHGoSgWSk Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFB1dMwv/gDfkQc8O4RApdjAJ45hCKiV9673qrR0n/cUZFYAybqHQCgp/MA lqc74S9l3p60u1r3SmHPywE= =qMh9 -----END PGP SIGNATURE----- --qDbXVdCdHGoSgWSk-- From tgraf@suug.ch Sat Jan 1 04:02:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Jan 2005 04:02:17 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j01C1ltk019233 for ; Sat, 1 Jan 2005 04:02:08 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 0C8EDF; Sat, 1 Jan 2005 13:09:58 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 77D251C0EA; Sat, 1 Jan 2005 13:10:41 +0100 (CET) Date: Sat, 1 Jan 2005 13:10:41 +0100 From: Thomas Graf To: jamal Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PKT_SCHED]: Allow using nfmark as key in U32 classifier. Message-ID: <20050101121041.GR32419@postel.suug.ch> References: <20041229150140.GJ32419@postel.suug.ch> <1104335620.1025.22.camel@jzny.localdomain> <20041230174313.GB32419@postel.suug.ch> <1104469111.1049.219.camel@jzny.localdomain> <20041231110836.GD32419@postel.suug.ch> <1104505142.1048.262.camel@jzny.localdomain> <20041231153930.GN32419@postel.suug.ch> <1104511494.1048.303.camel@jzny.localdomain> <20041231181153.GP32419@postel.suug.ch> <1104526311.1047.379.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1104526311.1047.379.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13314 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1104526311.1047.379.camel@jzny.localdomain> 2004-12-31 15:51 > On Fri, 2004-12-31 at 13:11, Thomas Graf wrote: > > * jamal <1104511494.1048.303.camel@jzny.localdomain> 2004-12-31 11:44 > > > Agreed I just don't get the reason for the PID. tc is usually called as > > a new process instance when dumping. > > Indeed. A new instance of tc should be able to delete or understand > what an old instance with different process ID installed. > The P in pid here stands for "program" not "process". Looking at it from > another angle it is the "owner" of that rule. Ahh, now this makes sense. Sorry, I misunderstood you all the time. > > u16 handle > > u16 matchID > > u16 kind > > u8 flags > > u8 pad > > We need to know who installed the rule so we can intepret what the ID in > the match is. Yes but this should go into the selector header. > You may actually need those Ts enumerated as if they are array > indices. Look at the way i transfer actions using "order" Right, order would be N-2. I don't see any reason for storing it, I didn't had need for it in EGP and I used exactly the same techniques as in the action code. > My view was length is also a common field. Theres also another reason > why you want length viewable in a dumb way: > --> you dont really wanna force people to write dumpers for these > ematchers (goal: keep this interface as simple as it can be); i.e dont > need any pretty formater in the kernel. > If you have a length then you can reconstruct the TCA_EMATCH easily > without caring about the content. This is the path i started taking in > eactions. Refer to my notes i sent earlier on the mythical one page > ematch/eaction. > If someone wants funky stuff - write a classifier. Very simple ematches will only require a struct for configuration so the dumping is not more than 5 lines of code. The length can be calculated via RTA_PAYLOAD(ematch_tlv) - sizeof(ematch_hdr). This of course requires the struct to be aligned to RTA_ALIGN but that's generally not a problem at all. I understand your concern but I also want to allow a little bit more complicated ematches such as KMP or later a very simple regular expression implementation. Here's some code from the simple_cmp key of EGP giving a good idea how a simple ematch will look like: static int sc_match(struct egp_cls *cls, struct egp_key *k) { struct egp_key_sc *sc = k->data; u32 lvalue = cls->ops->read(cls, &sc->left); u32 rvalue = cls->ops->read(cls, &sc->right); switch (sc->op) { #define SC(a, b) case EGP_OP_##a: return b SC(NONE, 0); SC(EQ, lvalue == rvalue); SC(NE, lvalue != rvalue); SC(LT, lvalue < rvalue); SC(LE, lvalue <= rvalue); SC(GT, lvalue > rvalue); SC(GE, lvalue >= rvalue); #undef SC } BUG(); return 0; } static int sc_validate(struct egp_config *conf, struct egp_ops *ops, void *d, size_t len) { int err; struct egp_key_sc *sc = d; if (len != sizeof(*sc) || sc->op > EGP_OP_MAX) return -EINVAL; return 0; } static int sc_replace(struct egp_cls *cls, struct egp_key *k, void *d, size_t len) { k->data = kmalloc(len, GFP_KERNEL); if (NULL == k->data) return -ENOBUFS; memcpy(k->data, d, len); return 0; } static int sc_dump(struct egp_cls *cls, struct sk_buff *skb, struct egp_key *k) { struct egp_key_sc *sc = k->data; RTA_PUT(skb, TCA_EGP_KEY_DATA, sizeof(*sc), sc); return 0; rtattr_failure: return -1; } static void sc_free_data(struct egp_cls *cls, struct egp_key *k) { if (k->data) kfree(k->data); } OTOH, on more complex ematches data might be nested TLVs with optional parameters. etc. > Stats are the other thing that adds complexity to the API. If you can > make it optional then that would be best - I was thinking to not even > have it in. It's probably enough to allow optional generic hits/success stats per match. > I thought we already agreed on the layout: > SEL2- which may nest E/MATCHEs TLVs. Sel2 not being very different from > original selector. May be i didnt follow. You did follow but I made the existing u32 match a ematch as well. Things like the program ID goes into the selector header T=1 and classifier specific selector bits such as the hashing bits goes into T=2. Thinking of it it's probably cleaner to put things like hmark, hoff into its own TLV. So the selector TLV contains the selector header at T=1 and nested ematch TLVs at T=2..T=N. I think we're mostly in sync so I'll start working on it and we can review again. From tgraf@suug.ch Sat Jan 1 04:13:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Jan 2005 04:13:33 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j01CCstU020370 for ; Sat, 1 Jan 2005 04:13:15 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 0E8E5F; Sat, 1 Jan 2005 13:21:07 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 82BD81C0EA; Sat, 1 Jan 2005 13:21:50 +0100 (CET) Date: Sat, 1 Jan 2005 13:21:50 +0100 From: Thomas Graf To: "David S. Miller" Cc: Jamal Hadi Salim , Patrick McHardy , netdev@oss.sgi.com Subject: [FINAL RESEND 2/9] PKT_SCHED: tc filter extension API Message-ID: <20050101122150.GS32419@postel.suug.ch> References: <20041230122652.GM32419@postel.suug.ch> <20041230123023.GO32419@postel.suug.ch> <20041230163359.GA32419@postel.suug.ch> <20041231141249.GK32419@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041231141249.GK32419@postel.suug.ch> X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13315 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev The tcf_exts API abstracts extensions such as actions/policers into a generic layer and reduces the knowledge inside classifiers to the minimum required. It isolates the validation code into its own function to allow classifiers to validate all input data before making changes and thus avoids the need to undo changes if a extension configuration request cannot be fullfilled. Adds missing locking when adding a action/police extension to an already existing filter. Acquiring dev->queue_lock makes sure we don't change the action/police in the middle of a classification. Noted by Patrick McHardy. As a nice side effect, using this API removes the existing ifdef clutter. Usage: The classifier holds struct tcf_exts which may be empty if no extensions are compiled in. It then calls tcf_exts_validate when a new change request was received and provides a temporary tcf_exts copy to store the change requests. Given it succeeded the classifier may change its own parameters and at the end call tcf_exts_change to commit the changes and replace the existing extension configuration with the new one. The classifier is responsible to destroy his temporary copy if any of its own validation checks fail. The classifier specific TLV types must be exported to the extensions API via tcf_ext_map. Destroying the extensions is as easy as calling tcf_exts_destroy. The extensions are executed by the classifier by calling tcf_exts_exec which must be done as the last thing after making sure the filter matches. Note: A classifier might take further actions after the execution to tcf_exts_exec such as correcting its own cache to avoid caching results which could have been influenced by the extensions. tcf_exts_exec returns a negative error code if the filter must be considered unmatched, 0 on normal execution or a positive classifier return code (TC_ACT_*) which must be returned to the underlying layer as-is. Signed-off-by: Thomas Graf --- linux-2.6.10-bk2.orig/include/net/pkt_cls.h 2004-12-31 14:10:54.000000000 +0100 +++ linux-2.6.10-bk2/include/net/pkt_cls.h 2004-12-30 17:17:56.000000000 +0100 @@ -62,6 +62,93 @@ tp->q->ops->cl_ops->unbind_tcf(tp->q, cl); } +struct tcf_exts +{ +#ifdef CONFIG_NET_CLS_ACT + struct tc_action *action; +#elif defined CONFIG_NET_CLS_POLICE + struct tcf_police *police; +#endif +}; + +/* Map to export classifier specific extension TLV types to the + * generic extensions API. Unsupported extensions must be set to 0. + */ +struct tcf_ext_map +{ + int action; + int police; +}; + +/** + * tcf_exts_is_predicative - check if a predicative extension is present + * @exts: tc filter extensions handle + * + * Returns 1 if a predicative extension is present, i.e. an extension which + * might cause further actions and thus overrule the regular tcf_result. + */ +static inline int +tcf_exts_is_predicative(struct tcf_exts *exts) +{ +#ifdef CONFIG_NET_CLS_ACT + return !!exts->action; +#elif defined CONFIG_NET_CLS_POLICE + return !!exts->police; +#else + return 0; +#endif +} + +/** + * tcf_exts_is_available - check if at least one extension is present + * @exts: tc filter extensions handle + * + * Returns 1 if at least one extension is present. + */ +static inline int +tcf_exts_is_available(struct tcf_exts *exts) +{ + /* All non-predicative extensions must be added here. */ + return tcf_exts_is_predicative(exts); +} + +/** + * tcf_exts_exec - execute tc filter extensions + * @skb: socket buffer + * @exts: tc filter extensions handle + * @res: desired result + * + * Executes all configured extensions. Returns 0 on a normal execution, + * a negative number if the filter must be considered unmatched or + * a positive action code (TC_ACT_*) which must be returned to the + * underlying layer. + */ +static inline int +tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts, + struct tcf_result *res) +{ +#ifdef CONFIG_NET_CLS_ACT + if (exts->action) + return tcf_action_exec(skb, exts->action, res); +#elif defined CONFIG_NET_CLS_POLICE + if (exts->police) + return tcf_police(skb, exts->police); +#endif + + return 0; +} + +extern int tcf_exts_validate(struct tcf_proto *tp, struct rtattr **tb, + struct rtattr *rate_tlv, struct tcf_exts *exts, + struct tcf_ext_map *map); +extern void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts); +extern void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst, + struct tcf_exts *src); +extern int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts, + struct tcf_ext_map *map); +extern int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts, + struct tcf_ext_map *map); + #ifdef CONFIG_NET_CLS_ACT static inline int tcf_change_act_police(struct tcf_proto *tp, struct tc_action **action, --- linux-2.6.10-bk2.orig/net/sched/cls_api.c 2004-12-31 19:31:07.000000000 +0100 +++ linux-2.6.10-bk2/net/sched/cls_api.c 2004-12-31 19:26:59.000000000 +0100 @@ -439,6 +439,154 @@ return skb->len; } +void +tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts) +{ +#ifdef CONFIG_NET_CLS_ACT + if (exts->action) { + tcf_action_destroy(exts->action, TCA_ACT_UNBIND); + exts->action = NULL; + } +#elif defined CONFIG_NET_CLS_POLICE + if (exts->police) { + tcf_police_release(exts->police, TCA_ACT_UNBIND); + exts->police = NULL; + } +#endif +} + + +int +tcf_exts_validate(struct tcf_proto *tp, struct rtattr **tb, + struct rtattr *rate_tlv, struct tcf_exts *exts, + struct tcf_ext_map *map) +{ + memset(exts, 0, sizeof(*exts)); + +#ifdef CONFIG_NET_CLS_ACT + int err; + struct tc_action *act; + + if (map->police && tb[map->police-1] && rate_tlv) { + act = tcf_action_init_1(tb[map->police-1], rate_tlv, "police", + TCA_ACT_NOREPLACE, TCA_ACT_BIND, &err); + if (act == NULL) + return err; + + act->type = TCA_OLD_COMPAT; + exts->action = act; + } else if (map->action && tb[map->action-1] && rate_tlv) { + act = tcf_action_init(tb[map->action-1], rate_tlv, NULL, + TCA_ACT_NOREPLACE, TCA_ACT_BIND, &err); + if (act == NULL) + return err; + + exts->action = act; + } +#elif defined CONFIG_NET_CLS_POLICE + if (map->police && tb[map->police-1] && rate_tlv) { + struct tcf_police *p; + + p = tcf_police_locate(tb[map->police-1], rate_tlv); + if (p == NULL) + return -EINVAL; + + exts->police = p; + } else if (map->action && tb[map->action-1]) + return -EOPNOTSUPP; +#else + if ((map->action && tb[map->action-1]) || + (map->police && tb[map->police-1])) + return -EOPNOTSUPP; +#endif + + return 0; +} + +void +tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst, + struct tcf_exts *src) +{ +#ifdef CONFIG_NET_CLS_ACT + if (src->action) { + struct tc_action *act; + tcf_tree_lock(tp); + act = xchg(&dst->action, src->action); + tcf_tree_unlock(tp); + if (act) + tcf_action_destroy(act, TCA_ACT_UNBIND); + } +#elif defined CONFIG_NET_CLS_POLICE + if (src->police) { + struct tcf_police *p; + tcf_tree_lock(tp); + p = xchg(&dst->police, src->police); + tcf_tree_unlock(tp); + if (p) + tcf_police_release(p, TCA_ACT_UNBIND); + } +#endif +} + +int +tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts, + struct tcf_ext_map *map) +{ +#ifdef CONFIG_NET_CLS_ACT + if (map->action && exts->action) { + /* + * again for backward compatible mode - we want + * to work with both old and new modes of entering + * tc data even if iproute2 was newer - jhs + */ + struct rtattr * p_rta = (struct rtattr*) skb->tail; + + if (exts->action->type != TCA_OLD_COMPAT) { + RTA_PUT(skb, map->action, 0, NULL); + if (tcf_action_dump(skb, exts->action, 0, 0) < 0) + goto rtattr_failure; + p_rta->rta_len = skb->tail - (u8*)p_rta; + } else if (map->police) { + RTA_PUT(skb, map->police, 0, NULL); + if (tcf_action_dump_old(skb, exts->action, 0, 0) < 0) + goto rtattr_failure; + p_rta->rta_len = skb->tail - (u8*)p_rta; + } + } +#elif defined CONFIG_NET_CLS_POLICE + if (map->police && exts->police) { + struct rtattr * p_rta = (struct rtattr*) skb->tail; + + RTA_PUT(skb, map->police, 0, NULL); + + if (tcf_police_dump(skb, exts->police) < 0) + goto rtattr_failure; + + p_rta->rta_len = skb->tail - (u8*)p_rta; + } +#endif + return 0; +rtattr_failure: __attribute__ ((unused)) + return -1; +} + +int +tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts, + struct tcf_ext_map *map) +{ +#ifdef CONFIG_NET_CLS_ACT + if (exts->action) + if (tcf_action_copy_stats(skb, exts->action) < 0) + goto rtattr_failure; +#elif defined CONFIG_NET_CLS_POLICE + if (exts->police) + if (tcf_police_dump_stats(skb, exts->police) < 0) + goto rtattr_failure; +#endif + return 0; +rtattr_failure: __attribute__ ((unused)) + return -1; +} static int __init tc_filter_init(void) { @@ -461,3 +609,8 @@ EXPORT_SYMBOL(register_tcf_proto_ops); EXPORT_SYMBOL(unregister_tcf_proto_ops); +EXPORT_SYMBOL(tcf_exts_validate); +EXPORT_SYMBOL(tcf_exts_destroy); +EXPORT_SYMBOL(tcf_exts_change); +EXPORT_SYMBOL(tcf_exts_dump); +EXPORT_SYMBOL(tcf_exts_dump_stats); From kaber@trash.net Sat Jan 1 08:04:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Jan 2005 08:04:20 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j01G3qNb028448 for ; Sat, 1 Jan 2005 08:04:12 -0800 Received: from eru.coreworks.de ([172.16.0.2] helo=trash.net) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CklrN-0006fw-RW; Sat, 01 Jan 2005 17:12:11 +0100 Message-ID: <41D6CB87.8040205@trash.net> Date: Sat, 01 Jan 2005 17:10:47 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5 X-Accept-Language: en MIME-Version: 1.0 To: hadi@cyberus.ca CC: "David S. Miller" , netdev@oss.sgi.com, Wichert Akkerman Subject: Re: patch: tunnels not setting inputdev References: <1104513392.1048.316.camel@jzny.localdomain> <41D5941C.8060001@trash.net> <1104523892.1047.338.camel@jzny.localdomain> In-Reply-To: <1104523892.1047.338.camel@jzny.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13316 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev jamal wrote: >>For the remaining changes, why not simply set >>input_dev in netif_receive_skb before the call to ing_filter ? > > You want to be able to filter on indev at ingress - it is safer for > whoever calls netif_rx() to do the setting. The packet could be looped > from egress multiple times as well (redirected). Currently input_dev is set in eth_type_trans, ppp_generic and the mirred action. With your patch we have a couple of drivers more, but this still leaves lots of non-ethernet drivers that don't set input_dev. A centralized solutions seems much better to me than adding this to every single driver. I can't see the problem with redirected packets, just set skb->input_dev = skb->dev in netif_receive_skb, this should have exactly the same effect as setting it in the drivers or the mirred action. Regards Patrick From tgraf@suug.ch Sat Jan 1 10:23:56 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Jan 2005 10:24:03 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j01INZ7O002637 for ; Sat, 1 Jan 2005 10:23:56 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id B429AF; Sat, 1 Jan 2005 19:31:47 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 32BA31C0EA; Sat, 1 Jan 2005 19:32:30 +0100 (CET) Date: Sat, 1 Jan 2005 19:32:30 +0100 From: Thomas Graf To: jamal Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PKT_SCHED]: Allow using nfmark as key in U32 classifier. Message-ID: <20050101183230.GT32419@postel.suug.ch> References: <20041229150140.GJ32419@postel.suug.ch> <1104335620.1025.22.camel@jzny.localdomain> <20041230174313.GB32419@postel.suug.ch> <1104469111.1049.219.camel@jzny.localdomain> <20041231110836.GD32419@postel.suug.ch> <1104505142.1048.262.camel@jzny.localdomain> <20041231153930.GN32419@postel.suug.ch> <1104511494.1048.303.camel@jzny.localdomain> <20041231181153.GP32419@postel.suug.ch> <1104526311.1047.379.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1104526311.1047.379.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13317 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1104526311.1047.379.camel@jzny.localdomain> 2004-12-31 15:51 > > T=1 generic selector header > > > > T=2 classifier specific selector header (u32 hashsing stuff goes here) > > T=3 ematch 1 > > T=N ematch N > > I thought we already agreed on the layout: > SEL2- which may nest E/MATCHEs TLVs. Sel2 not being very different from > original selector. May be i didnt follow. OK, I changed my mind while implementing it and a selector now looks like this: Selector TLV: +----------------------------+ | TCA_EMATCH_TREE_HDR | +----------------------------+ | TCA_EMATCH_TREE_LIST | | +------------------------+ | | | T=1 Match 1 | | | +------------------------+ | | | T=2 Match 2 | | | +------------------------+ | | | T=N Match N | | | +------------------------+ | +----------------------------+ So we can put more into the selector if needed without breaking compatibility. TCA_EMATCH_TREE_HDR currently contains `nmatches' specifying N and progid holding the PID you talked about. The match TLVs must have a continous numbering because I don't want to define limits as done in the action code. I'll post an RFC patch tomorrow implementing the API and a simple ematch. From ahu@outpost.ds9a.nl Sat Jan 1 12:55:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Jan 2005 12:55:45 -0800 (PST) Received: from outpost.ds9a.nl (postfix@outpost.ds9a.nl [213.244.168.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j01KtGxi009506 for ; Sat, 1 Jan 2005 12:55:37 -0800 Received: by outpost.ds9a.nl (Postfix, from userid 1000) id 2322E3FDD; Sat, 1 Jan 2005 22:03:48 +0100 (CET) Date: Sat, 1 Jan 2005 22:03:47 +0100 From: bert hubert To: Shekhar Kshirsagar Cc: Networking Team , jmorris@redhat.com Subject: ipsec null encryption slower than AES / was Re: 2.6 IPSec Throughput puzzle Message-ID: <20050101210347.GA4713@outpost.ds9a.nl> Mail-Followup-To: bert hubert , Shekhar Kshirsagar , Networking Team , jmorris@redhat.com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13318 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ahu@ds9a.nl Precedence: bulk X-list: netdev [added James Morris, resident crypto api guru, to the CC list] On Wed, Dec 29, 2004 at 03:50:34PM -0800, Shekhar Kshirsagar wrote: > I played with oprofile for a while, and it seems that in case of null > encryption, scatterwalk related code takes most of the cpu cycles. Odd - the 'scatterlist' is what people were most proud of in the ipsec work in 2.6. I recall that it was implemented as a natural way to represent the encryption needs of ipsec. From your numbers below it is clear all ipsec benchmarks have maxed out your CPU, but aes/sha1 still has some hits in default_idle. Is this an SMP system? scatterwalk_done consists of crypto_kunmap, which in turn calls kunmap_atomic (inline), which is defined as nothing sometimes and as a real function otherwise which is not likely to be inlined, so should show up in the profile if it were a large load. The other part of scatterwalk_done is scatterwalk_page_done, which looks like it could cause further (inlined) work. But, in the end, I can't really help you further. All this scatterlist stuff looks like something is really badly tuned for null-encryption and well-tuned for encryption. > Is there any place where I can find documentation about what exactly > scatterwalk does? http://www.certconf.org/presentations/2004/Tuesday/TS2.pdf - the concept is called 'the scatterlist'. http://lwn.net/Articles/14010/?format=printable is also nice. Good luck! -- http://www.PowerDNS.com Open source, database driven DNS Software http://lartc.org Linux Advanced Routing & Traffic Control HOWTO From hadi@cyberus.ca Sat Jan 1 15:21:18 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Jan 2005 15:21:25 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j01NKvwF012593 for ; Sat, 1 Jan 2005 15:21:18 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1Cksgg-0004ZM-BP for netdev@oss.sgi.com; Sat, 01 Jan 2005 18:29:34 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Cksgb-0004Ah-DA; Sat, 01 Jan 2005 18:29:29 -0500 Subject: Re: [PKT_SCHED]: Allow using nfmark as key in U32 classifier. From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <20050101121041.GR32419@postel.suug.ch> References: <20041229150140.GJ32419@postel.suug.ch> <1104335620.1025.22.camel@jzny.localdomain> <20041230174313.GB32419@postel.suug.ch> <1104469111.1049.219.camel@jzny.localdomain> <20041231110836.GD32419@postel.suug.ch> <1104505142.1048.262.camel@jzny.localdomain> <20041231153930.GN32419@postel.suug.ch> <1104511494.1048.303.camel@jzny.localdomain> <20041231181153.GP32419@postel.suug.ch> <1104526311.1047.379.camel@jzny.localdomain> <20050101121041.GR32419@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1104622164.1048.444.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 01 Jan 2005 18:29:25 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13319 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Sat, 2005-01-01 at 07:10, Thomas Graf wrote: > * jamal <1104526311.1047.379.camel@jzny.localdomain> 2004-12-31 15:51 > > We need to know who installed the rule so we can intepret what the ID in > > the match is. > > Yes but this should go into the selector header. > Agreed - PID needs to go into selector. The other ID is per match. > > You may actually need those Ts enumerated as if they are array > > indices. Look at the way i transfer actions using "order" > > Right, order would be N-2. I don't see any reason for storing it, I > didn't had need for it in EGP and I used exactly the same techniques > as in the action code. > If youve done it on EGP then go ahead and use that scheme since you are comfortable with it. > > My view was length is also a common field. Theres also another reason > > why you want length viewable in a dumb way: > > --> you dont really wanna force people to write dumpers for these > > ematchers (goal: keep this interface as simple as it can be); i.e dont > > need any pretty formater in the kernel. > > If you have a length then you can reconstruct the TCA_EMATCH easily > > without caring about the content. This is the path i started taking in > > eactions. Refer to my notes i sent earlier on the mythical one page > > ematch/eaction. > > If someone wants funky stuff - write a classifier. > > Very simple ematches will only require a struct for configuration > so the dumping is not more than 5 lines of code. The length can be > calculated via RTA_PAYLOAD(ematch_tlv) - sizeof(ematch_hdr). This > of course requires the struct to be aligned to RTA_ALIGN but > that's generally not a problem at all. Does the ematch API include a dump()? I dont think it should - thats the point i was making. Should be simple. > I understand your concern but I also want to allow a little bit > more complicated ematches such as KMP or later a very simple > regular expression implementation. > > Here's some code from the simple_cmp key of EGP giving a good > idea how a simple ematch will look like: > > static int > sc_match(struct egp_cls *cls, struct egp_key *k) > { > struct egp_key_sc *sc = k->data; > u32 lvalue = cls->ops->read(cls, &sc->left); > u32 rvalue = cls->ops->read(cls, &sc->right); > > switch (sc->op) { > #define SC(a, b) case EGP_OP_##a: return b > SC(NONE, 0); > SC(EQ, lvalue == rvalue); > SC(NE, lvalue != rvalue); > SC(LT, lvalue < rvalue); > SC(LE, lvalue <= rvalue); > SC(GT, lvalue > rvalue); > SC(GE, lvalue >= rvalue); > #undef SC > } > > BUG(); > return 0; > } > nice and valid for API. > static int > sc_validate(struct egp_config *conf, struct egp_ops *ops, void *d, size_t len) > { > int err; > struct egp_key_sc *sc = d; > > if (len != sizeof(*sc) || sc->op > EGP_OP_MAX) > return -EINVAL; > return 0; > } > Even this is too much for a simple ematch. Validation should happen in user space or maybe at the mother clasifier. maybe a maxsize,minsize attribute is needed in the ematch struct. > static int > sc_replace(struct egp_cls *cls, struct egp_key *k, void *d, size_t len) > { > k->data = kmalloc(len, GFP_KERNEL); > if (NULL == k->data) > return -ENOBUFS; > memcpy(k->data, d, len); > return 0; > } Equivalent of this should be done by the mother classifier. All it needs to know is the length (and no other details). And the length is known from the L in TLV. > static int > sc_dump(struct egp_cls *cls, struct sk_buff *skb, struct egp_key *k) > { > struct egp_key_sc *sc = k->data; > RTA_PUT(skb, TCA_EGP_KEY_DATA, sizeof(*sc), sc); > return 0; > > rtattr_failure: > return -1; > } > Again if you store length, you dont need this. Mother classifier can do it. > static void > sc_free_data(struct egp_cls *cls, struct egp_key *k) > { > if (k->data) > kfree(k->data); > } Dont need this either; mother classifier can handle it. > OTOH, on more complex ematches data might be nested TLVs with > optional parameters. etc. > > > Stats are the other thing that adds complexity to the API. If you can > > make it optional then that would be best - I was thinking to not even > > have it in. > > It's probably enough to allow optional generic hits/success stats > per match. Even at the moment classifiers dont have stats. If you want stats you could add a simple gact accept action. Note also: think of the 100K rules being added and amount of RAM used; > > I thought we already agreed on the layout: > > SEL2- which may nest E/MATCHEs TLVs. Sel2 not being very different from > > original selector. May be i didnt follow. > > You did follow but I made the existing u32 match a ematch as well. > Things like the program ID goes into the selector header T=1 and > classifier specific selector bits such as the hashing bits goes > into T=2. Thinking of it it's probably cleaner to put things like > hmark, hoff into its own TLV. So the selector TLV contains the > selector header at T=1 and nested ematch TLVs at T=2..T=N. > Note that the ematch is supposed to be a very very simple thing... Something a fireman who has implemented a iptables target can whip in an hour. Keep in mind that design goal. Non trivial coding needed or poor usability is the major problem with tc in general. Avoid that theme. An ematch _needs_ a mother classifier such as u32. u32 has a very nice and very flexible layout - it can be trained to build any sort of tree. Maybe the first step should be to not even have u32 as an ematch .. > I think we're mostly in sync so I'll start working on it and > we can review again. Maybe i will wait for the code. cheers, jamal From hadi@cyberus.ca Sat Jan 1 15:25:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Jan 2005 15:25:32 -0800 (PST) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j01NP40I013117 for ; Sat, 1 Jan 2005 15:25:25 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.30) id 1Ckskc-0001WZ-KJ for netdev@oss.sgi.com; Sat, 01 Jan 2005 18:33:38 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CkskV-0004gd-1u; Sat, 01 Jan 2005 18:33:31 -0500 Subject: Re: patch: tunnels not setting inputdev From: jamal Reply-To: hadi@cyberus.ca To: Patrick McHardy Cc: "David S. Miller" , netdev@oss.sgi.com, Wichert Akkerman In-Reply-To: <41D6CB87.8040205@trash.net> References: <1104513392.1048.316.camel@jzny.localdomain> <41D5941C.8060001@trash.net> <1104523892.1047.338.camel@jzny.localdomain> <41D6CB87.8040205@trash.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1104622406.1049.450.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 01 Jan 2005 18:33:27 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13320 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Sat, 2005-01-01 at 11:10, Patrick McHardy wrote: > jamal wrote: > > >>For the remaining changes, why not simply set > >>input_dev in netif_receive_skb before the call to ing_filter ? > > > > You want to be able to filter on indev at ingress - it is safer for > > whoever calls netif_rx() to do the setting. The packet could be looped > > from egress multiple times as well (redirected). > > Currently input_dev is set in eth_type_trans, ppp_generic and the > mirred action. With your patch we have a couple of drivers more, I want to understand the repurcasssions instead of blindly setting. Let users complain, thats why the printk exists. For example what does input_dev mean for netbios or a 802.3ad interface? You already saw one, xfrm, where there was no need to reset. > but this still leaves lots of non-ethernet drivers that don't set > input_dev. A centralized solutions seems much better to me than > adding this to every single driver. Ethernet like, ppp-like and now tunnel-like. If you note on my email with the patch i said: "A lot of the stuff the tunnels do is very similar, so maybe wiser to have something like tunnel_type_trans()." This includes things like nf_reset(skb) which is done by that family of devices that may need centralizing. If you want to create such a patch go ahead and i will hold mine. > I can't see the problem with > redirected packets, just set skb->input_dev = skb->dev in > netif_receive_skb, this should have exactly the same effect as > setting it in the drivers or the mirred action. > in some cases the pointers are swapped. You cant just blindly set skb->input_dev = skb->dev at the input - that would be violating the intent; think reinjecting packets (and look at mirred as a sample of apps to come that do this). cheers, jamal From hadi@cyberus.ca Sat Jan 1 15:34:06 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Jan 2005 15:34:13 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j01NXk3l013695 for ; Sat, 1 Jan 2005 15:34:06 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1Ckst2-0008Lx-Tk for netdev@oss.sgi.com; Sat, 01 Jan 2005 18:42:20 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Ckst0-000661-Oj; Sat, 01 Jan 2005 18:42:19 -0500 Subject: Re: [PKT_SCHED]: Allow using nfmark as key in U32 classifier. From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <20050101183230.GT32419@postel.suug.ch> References: <20041229150140.GJ32419@postel.suug.ch> <1104335620.1025.22.camel@jzny.localdomain> <20041230174313.GB32419@postel.suug.ch> <1104469111.1049.219.camel@jzny.localdomain> <20041231110836.GD32419@postel.suug.ch> <1104505142.1048.262.camel@jzny.localdomain> <20041231153930.GN32419@postel.suug.ch> <1104511494.1048.303.camel@jzny.localdomain> <20041231181153.GP32419@postel.suug.ch> <1104526311.1047.379.camel@jzny.localdomain> <20050101183230.GT32419@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1104622934.1047.460.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 01 Jan 2005 18:42:14 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13321 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Sat, 2005-01-01 at 13:32, Thomas Graf wrote: > OK, I changed my mind while implementing it and a selector now looks > like this: > > Selector TLV: > > +----------------------------+ > | TCA_EMATCH_TREE_HDR | > +----------------------------+ > | TCA_EMATCH_TREE_LIST | > | +------------------------+ | > | | T=1 Match 1 | | > | +------------------------+ | > | | T=2 Match 2 | | > | +------------------------+ | > | | T=N Match N | | > | +------------------------+ | > +----------------------------+ > what happened to the good old SEL TLV (which i believe we called SEL2 now); or maybe thats what contains this TLV? > So we can put more into the selector if needed without breaking > compatibility. TCA_EMATCH_TREE_HDR currently contains `nmatches' > specifying N and progid holding the PID you talked about. Ok, so i think you may be saying the old selector stays intact then (sans the matches)? Why do you need to specify "nmatches". You know exactly where each one starts and ends (from the TLVs). What is TCA_EMATCH_TREE_LIST for? Looks like another TLV nesting. Not needed, you just plumb the T=1,..T=N right after the header. > The match TLVs must have a continous numbering because I don't > want to define limits as done in the action code. I think the way you have it is fine - and believe it is the way the action code has it for the list. > I'll post an RFC patch tomorrow implementing the API and a > simple ematch. Nice. I have started implementing the eaction code but too obsessed with this other thing i am working on - hopefully i will get to it before my vacation expires. cheers, jamal From tgraf@suug.ch Sat Jan 1 15:57:39 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Jan 2005 15:57:47 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j01NvIm0014428 for ; Sat, 1 Jan 2005 15:57:39 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id CA041F; Sun, 2 Jan 2005 01:05:30 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 942A91C0EA; Sun, 2 Jan 2005 01:06:12 +0100 (CET) Date: Sun, 2 Jan 2005 01:06:12 +0100 From: Thomas Graf To: jamal Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PKT_SCHED]: Allow using nfmark as key in U32 classifier. Message-ID: <20050102000612.GU32419@postel.suug.ch> References: <20041230174313.GB32419@postel.suug.ch> <1104469111.1049.219.camel@jzny.localdomain> <20041231110836.GD32419@postel.suug.ch> <1104505142.1048.262.camel@jzny.localdomain> <20041231153930.GN32419@postel.suug.ch> <1104511494.1048.303.camel@jzny.localdomain> <20041231181153.GP32419@postel.suug.ch> <1104526311.1047.379.camel@jzny.localdomain> <20050101121041.GR32419@postel.suug.ch> <1104622164.1048.444.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1104622164.1048.444.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13322 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1104622164.1048.444.camel@jzny.localdomain> 2005-01-01 18:29 > Does the ematch API include a dump()? I dont think it should - thats the > point i was making. Should be simple. Yes, although simple ematches are not required to implement dump. > > [validate] > Even this is too much for a simple ematch. Validation should happen in > user space or maybe at the mother clasifier. maybe a maxsize,minsize > attribute is needed in the ematch struct. > > [replace] > Equivalent of this should be done by the mother classifier. > All it needs to know is the length (and no other details). And the > length is known from the L in TLV. I merged validate/replace into change which takes a unsigned long for storage and a data/len parameter. It's up to the ematch what he does with it, data may contain a u32 directly and the ematch might save it in the unsigned long or a ematch may allocate a structure. Why are you focused on hiding so much? I'd rather try to make it simple but still allow more complex ematches to exist. Have a look at http://people.suug.ch/~tgr/tmp/ematch.diff I broke the API down to: change match destroy (optional, only for complex ematches) dump (optional, only for complex ematches) > Even at the moment classifiers dont have stats. If you want stats > you could add a simple gact accept action. > Note also: think of the 100K rules being added and amount of RAM used; Agreed, I didn't add them so far, it's up to the ematch whether it wants to maintain stats or not. > Note that the ematch is supposed to be a very very simple thing... > Something a fireman who has implemented a iptables target can whip in an > hour. Keep in mind that design goal. Non trivial coding needed or poor > usability is the major problem with tc in general. Avoid that theme. > An ematch _needs_ a mother classifier such as u32. u32 has a very nice > and very flexible layout - it can be trained to build any sort of tree. > Maybe the first step should be to not even have u32 as an ematch .. I understand your point but I want to at least be able to implement some more complex stuff. Hiding too much can be bad too. Having only 2 functions to implement is really easy, the rest can be done the LinuxWay(tm) ;-> Have a look at the code and tell me what you think. Here's an example ematch, I find this quite simple already. static in foo_change(struct tcf_proto *tp, void *data, int len, struct tcf_ematch *m) { if (len != sizeof(u32)) return -EINVAL; m->data = *(u32*)data; return 0; } static int foo_match(struct sk_buff *skb, struct tcf_ematch *m) { return skb->security == m->data; } static struct tcf_ematch_ops foo_ops = { .kind = 111, .change = foo_change, .match = foo_match, .owner = THIS_MODULE, .link = LIST_HEAD_INIT(foo_ops.link) } static int __init foo_init(void) { return tcf_ematch_register(&foo_ops); } static void __exit foo_exit(void) { return tcf_ematch_unregister(&foo_ops); } module_init(init_foo); module_exit(exit_foo); From tgraf@suug.ch Sat Jan 1 16:05:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Jan 2005 16:05:10 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0204gZi015018 for ; Sat, 1 Jan 2005 16:05:03 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 3F70EF; Sun, 2 Jan 2005 01:12:55 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 5AFCF1C0EA; Sun, 2 Jan 2005 01:13:38 +0100 (CET) Date: Sun, 2 Jan 2005 01:13:38 +0100 From: Thomas Graf To: jamal Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PKT_SCHED]: Allow using nfmark as key in U32 classifier. Message-ID: <20050102001338.GV32419@postel.suug.ch> References: <20041230174313.GB32419@postel.suug.ch> <1104469111.1049.219.camel@jzny.localdomain> <20041231110836.GD32419@postel.suug.ch> <1104505142.1048.262.camel@jzny.localdomain> <20041231153930.GN32419@postel.suug.ch> <1104511494.1048.303.camel@jzny.localdomain> <20041231181153.GP32419@postel.suug.ch> <1104526311.1047.379.camel@jzny.localdomain> <20050101183230.GT32419@postel.suug.ch> <1104622934.1047.460.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1104622934.1047.460.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13323 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1104622934.1047.460.camel@jzny.localdomain> 2005-01-01 18:42 > what happened to the good old SEL TLV (which i believe we called SEL2 > now); or maybe thats what contains this TLV? Please look at the patch I posted in the other post. I think we missudnerstand each other. > > So we can put more into the selector if needed without breaking > > compatibility. TCA_EMATCH_TREE_HDR currently contains `nmatches' > > specifying N and progid holding the PID you talked about. > > Ok, so i think you may be saying the old selector stays intact then > (sans the matches)? Right, old selector TLV statys as-is. Although I have to look u32 closely before I can make final statements. > Why do you need to specify "nmatches". It's mainly a shortcut to validate precedence jumps so I can avoid traversing the RTA chain twice. It could be avoided but is quite handy to speed things up and also acts for validation purposes to check consistency of the match list. > What is TCA_EMATCH_TREE_LIST for? Looks like another TLV nesting. Not > needed, you just plumb the T=1,..T=N right after the header. No, what if we need some more stuff in the selector TLV? We can't modify the header TLV w/o breaking backwards compatibility. Adding this addtional nesting allows to simply add stuff after TREE_LIST TLV. > I think the way you have it is fine - and believe it is the way the > action code has it for the list. You're using a maximum prio aren't you? I use a RTA_OK() loop supporting unlimited number of matches without the need to allocate rtattr pointer array. From kaber@trash.net Sat Jan 1 16:17:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Jan 2005 16:17:42 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j020HBC1015722 for ; Sat, 1 Jan 2005 16:17:35 -0800 Received: from eru.coreworks.de ([172.16.0.2] helo=trash.net) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CktYo-0006yJ-Jr; Sun, 02 Jan 2005 01:25:31 +0100 Message-ID: <41D73F28.3090206@trash.net> Date: Sun, 02 Jan 2005 01:24:08 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5 X-Accept-Language: en MIME-Version: 1.0 To: hadi@cyberus.ca CC: "David S. Miller" , netdev@oss.sgi.com, Wichert Akkerman Subject: Re: patch: tunnels not setting inputdev References: <1104513392.1048.316.camel@jzny.localdomain> <41D5941C.8060001@trash.net> <1104523892.1047.338.camel@jzny.localdomain> <41D6CB87.8040205@trash.net> <1104622406.1049.450.camel@jzny.localdomain> In-Reply-To: <1104622406.1049.450.camel@jzny.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13324 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev jamal wrote: > I want to understand the repurcasssions instead of blindly setting. Let > users complain, thats why the printk exists. For example what does > input_dev mean for netbios or a 802.3ad interface? You already saw one, > xfrm, where there was no need to reset. What's special about netbios ? For 802.3ad, I would expect input_dev to hold the virtual device through which the packet entered the stack, just what iptables -i would match. For xfrm - there is no need but its also not wrong. >>I can't see the problem with >>redirected packets, just set skb->input_dev = skb->dev in >>netif_receive_skb, this should have exactly the same effect as >>setting it in the drivers or the mirred action. > > in some cases the pointers are swapped. You cant just blindly > set skb->input_dev = skb->dev at the input - that would be violating the > intent; think reinjecting packets (and look at mirred as a sample of > apps to come that do this). I don't know your intent, but I assumed it was to match the incoming interface as the networking stack sees it. Why would the pointers be swapped ? Please give me an example. mirred does: skb2->dev = dev; skb2->input_dev = skb->dev; So on input input_dev is the incoming interface of the original packet, on output it is the outgoing interface of the original packet. Doesn't make much sense to me, the original packet came the same way both times. Regards Patrick From y030729@njupt.edu.cn Sat Jan 1 18:15:39 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Jan 2005 18:15:45 -0800 (PST) Received: from njupt.edu.cn (em.njupt.edu.cn [202.119.230.11]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j022FH0I021906 for ; Sat, 1 Jan 2005 18:15:38 -0800 Received: (eyou send program); Sun, 02 Jan 2005 11:17:09 +0800 Message-ID: <304635829.27548@njupt.edu.cn> Received: from 10.10.136.115 by em.njupt.edu.cn with HTTP; Sun, 02 Jan 2005 11:17:09 +0800 X-WebMAIL-MUA: [10.10.136.115] From: "Zhenyu Wu" To: netdev@oss.sgi.com Cc: lartc@mailman.ds9a.nl, tgraf@suug.ch Date: Sun, 02 Jan 2005 11:17:09 +0800 Reply-To: "Zhenyu Wu" X-Priority: 3 Subject: A Question On CBQ Content-Type: text/plain X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13325 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: y030729@njupt.edu.cn Precedence: bulk X-list: netdev Hello, As it is well know that CBQ is the class based queue. But i am confused on the word "class" now, especially it is used in Diffserv. IMO, different classes should mean that there are different kinds of traffics, so the class should be difined by the parameters (such as bandwidth, priority..) the traffic wanted. That is, using cbq we can define different kinds of traffics which need different bandwidth at the gateway, am i right?? Then, in diffserv the traffic is identified by the DSCP, right? From Floyd's paper Link-sharing and Resource Management Models for Packet Networks, we can see if there are two classes of traffic such as class A and class B, and each of them has traffics video and ftp, then how the two different FTP are identified in diffserv, by their DSCP? IMO, at first, according to the bandwidth the traffic needed, the traffic is classified into class A or class B, then at each class the traffic is identified by their DSCP. Eagerly waiting for your reply! Happy New Year! From mgalgoci@parcelfarce.linux.theplanet.co.uk Sat Jan 1 22:04:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Jan 2005 22:04:36 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j02644De030495 for ; Sat, 1 Jan 2005 22:04:27 -0800 Received: from [127.0.0.1] (helo=localhost) by www.linux.org.uk with esmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1Ckyyk-0003Fo-Uj for netdev@oss.sgi.com; Sun, 02 Jan 2005 06:12:39 +0000 Date: Sun, 2 Jan 2005 06:12:38 +0000 (GMT) From: Matthew J Galgoci To: netdev@oss.sgi.com Subject: 2.6.10-bk4 ip_conntrack oops fix Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13326 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mgalgoci@parcelfarce.linux.theplanet.co.uk Precedence: bulk X-list: netdev I stumbled onto an annoying oops in 2.6.10-bk4. Here is how to cause the oops. load ip_conntrack remove ip_conntrack ls /proc/net/stat boom Here is what I think the fix is: --- linux-2.6.10-bk4/net/ipv4/netfilter/ip_conntrack_standalone.c.orig 2005-01-01 23:44:42.000000000 -0500 +++ linux-2.6.10-bk4/net/ipv4/netfilter/ip_conntrack_standalone.c 2005-01-02 00:57:20.000000000 -0500 @@ -820,7 +820,7 @@ nf_unregister_hook(&ip_conntrack_defrag_ops); cleanup_proc_stat: #ifdef CONFIG_PROC_FS - proc_net_remove("ip_conntrack_stat"); + remove_proc_entry("ip_conntrack", proc_net_stat); cleanup_proc_exp: proc_net_remove("ip_conntrack_expect"); cleanup_proc: From shekhark@juniper.net Sat Jan 1 22:43:05 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 01 Jan 2005 22:43:12 -0800 (PST) Received: from kremlin.juniper.net (kremlin.juniper.net [207.17.137.120]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j026gj9a031878 for ; Sat, 1 Jan 2005 22:43:05 -0800 Received: from unknown (HELO gamma.jnpr.net) (172.24.245.25) by kremlin.juniper.net with ESMTP; 01 Jan 2005 22:51:15 -0800 X-BrightmailFiltered: true X-Ironport-AV: i="3.88,96,1102320000"; d="scan'208"; a="86393475:sNHT19204476" Received: from gluon.jnpr.net ([172.24.15.23]) by gamma.jnpr.net with Microsoft SMTPSVC(6.0.3790.211); Sat, 1 Jan 2005 22:51:14 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Subject: RE: ipsec null encryption slower than AES / was Re: 2.6 IPSec Throughput puzzle Date: Sat, 1 Jan 2005 22:51:13 -0800 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: ipsec null encryption slower than AES / was Re: 2.6 IPSec Throughput puzzle Thread-Index: AcTwRXsiJ+Iw7jziRpSFpNj9LgAvnAATxiJX From: "Shekhar Kshirsagar" To: "bert hubert" Cc: "Networking Team" , X-OriginalArrivalTime: 02 Jan 2005 06:51:14.0798 (UTC) FILETIME=[73DFA0E0:01C4F097] X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j026gj9a031878 X-archive-position: 13327 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shekhark@juniper.net Precedence: bulk X-list: netdev > From your numbers below it is clear all ipsec benchmarks have maxed out your > CPU, but aes/sha1 still has some hits in default_idle. Is this an SMP > system? No, it is not running SMP kernel. (The system is SMP). About little time being sent in default_idle, I think,it was because I was little late in performing dump. I redid the test and the CPU was maxed out even in aes/sha1 case. > http://www.certconf.org/presentations/2004/Tuesday/TS2.pdf - the concept is > called 'the scatterlist'. > http://lwn.net/Articles/14010/?format=printable is also nice. Thanks, for the pointers. I will see, if I can isolate the problem. Shekhar From pb@bieringer.de Sun Jan 2 00:53:12 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 02 Jan 2005 00:53:19 -0800 (PST) Received: from smtp2.aerasec.de (gromit.aerasec.de [195.226.187.57]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j028qpUg006071 for ; Sun, 2 Jan 2005 00:53:12 -0800 Received: from localhost (localhost [127.0.0.1]) by smtp2.aerasec.de (Postfix) with SMTP id 07BA7137F1; Sun, 2 Jan 2005 10:01:24 +0100 (CET) X-AV-Checked: Sun Jan 2 10:01:24 2005 smtp2.aerasec.de Received: from [192.168.1.2] (pD9E4EFC7.dip.t-dialin.net [217.228.239.199]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client did not present a certificate) by smtp2.aerasec.de (Postfix) with ESMTP id 63403137EA; Sun, 2 Jan 2005 10:01:22 +0100 (CET) Date: Sun, 02 Jan 2005 10:01:20 +0100 From: Peter Bieringer To: Patrick McHardy Cc: USAGI core , Maillist netdev , Harald Welte , Netfilter development mailing list Subject: Re: ip6tables: accept of IPv6 transport esp packages not possible - no rule matches Message-ID: <85346B5DA83795C08812E782@worker.muc.bieringer.de> In-Reply-To: <41CD8B4F.6010402@trash.net> References: <019064D0423CE6C823CBF476@t1mobil.muc.aerasec.de> <5F6ACA5CEF52DBFBF11FBF94@t1mobil.muc.aerasec.de> <41CD8B4F.6010402@trash.net> X-Mailer: Mulberry/3.1.6 (Linux/x86) X-URL: http://www.bieringer.de/pb/ X-OS: Linux MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13328 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pb@bieringer.de Precedence: bulk X-list: netdev Hi, --On Saturday, December 25, 2004 04:46:23 PM +0100 Patrick McHardy wrote: > Peter Bieringer wrote: >> Looks like there is something going wrong in the protocol matching >> algorithm in netfilter6. > > Does this patch fix the problem ? > > Regards > Patrick Yes, this patch fix the problem on the incoming side: I ping6 to a remote host via IPsec in transport mode: IPv6 INPUT chain: 0 0 ACCEPT icmpv6 * * ::/0 ::/0 ipv6-icmp type 128 0 0 ACCEPT icmpv6 * * ::/0 ::/0 ipv6-icmp type 129 1 156 ACCEPT esp * * remote/128 local/128 0 0 ACCEPT all * * remote/128 local/128 So the proper chain matches. But I wonder a little bit because of the result of the OUTPUT chain: 0 0 ACCEPT icmpv6 * * ::/0 ::/0 ipv6-icmp type 129 1 104 ACCEPT icmpv6 * * ::/0 ::/0 ipv6-icmp type 128 0 0 ACCEPT esp * * local/128 remote/128 0 0 ACCEPT all * * local/128 remote/128 Here, the ICMPv6 rule matches. This means for me that the traffic goes like this: OUTPUT: ping6 -> netfilter -> encryption -> ESP INPUT : ESP -> netfilter -> decryption -> ping6 Is this logical? BTW: how to filter incoming traffic after decryption? Peter -- Dr. Peter Bieringer http://www.bieringer.de/pb/ GPG/PGP Key 0x958F422D mailto: pb at bieringer dot de Deep Space 6 Co-Founder and Core Member http://www.deepspace6.net/ From pb@bieringer.de Sun Jan 2 01:04:40 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 02 Jan 2005 01:04:46 -0800 (PST) Received: from smtp2.aerasec.de (gromit.aerasec.de [195.226.187.57]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0294JP0006820 for ; Sun, 2 Jan 2005 01:04:40 -0800 Received: from localhost (localhost [127.0.0.1]) by smtp2.aerasec.de (Postfix) with SMTP id 8E460137EA; Sun, 2 Jan 2005 10:12:53 +0100 (CET) X-AV-Checked: Sun Jan 2 10:12:53 2005 smtp2.aerasec.de Received: from [192.168.1.2] (pD9E4EFC7.dip.t-dialin.net [217.228.239.199]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client did not present a certificate) by smtp2.aerasec.de (Postfix) with ESMTP id C6EFE137F1; Sun, 2 Jan 2005 10:12:44 +0100 (CET) Date: Sun, 02 Jan 2005 10:12:42 +0100 From: Peter Bieringer To: "YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?=" , yasuyuki.kozakai@toshiba.co.jp Cc: netdev@oss.sgi.com, usagi-users@linux-ipv6.org, laforge@gnumonks.org, kaber@trash.net, netfilter-devel@lists.netfilter.org Subject: Re: netfilter6: ICMPv6 type 143 doesn't match (130 also not) Message-ID: <44BA844FEB4A052700F3C77E@worker.muc.bieringer.de> In-Reply-To: <20041227.100205.102356251.yoshfuji@linux-ipv6.org> References: <6050E336B1A0D7D8E70C66F3@t1mobil.muc.aerasec.de> <200412270417.iBR4HZRG021429@toshiba.co.jp> <20041227.100205.102356251.yoshfuji@linux-ipv6.org> X-Mailer: Mulberry/3.1.6 (Linux/x86) X-URL: http://www.bieringer.de/pb/ X-OS: Linux MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13329 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pb@bieringer.de Precedence: bulk X-list: netdev Hi, --On Monday, December 27, 2004 10:02:05 AM +0100 "YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?=" wrote: > In article <200412270417.iBR4HZRG021429@toshiba.co.jp> (at Mon, 27 Dec > 2004 13:17:34 +0900 (JST)), Yasuyuki Kozakai > says: > >> >> - ptr = IPV6_HDR_LEN; >> + ptr = ((u8*)skb->nh.ipv6h - skb->data) + IPV6_HDR_LEN; >> > > IMHO, skb->nh.ipv6h does not points ipv6 header anymore; > it should be skb->nh.raw in this case. > > --yoshfuji Can someone pls. provide me a patch for kernel version 2.6.9? If so, I would run tests. BTW: at the moment, I have an additional packet where no ICMPv6 rule matches: Jan 2 10:04:15 gate kernel: default-drop-extIN:IN=sit1 OUT= MAC=53:2e:55:**:**:**->00:00:65:**:**:** TUNNEL=212.224. 0.188->217.228.***.*** SRC=fe80:0000:0000:0000:0000:0000:d4e0:00bc DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=76 TC=0 HOPLIMIT=1 FLOWLBL=0 OPT ( ) PROTO=ICMPv6 TYPE=130 CODE=0 10:08:25.540037 fe80::d4e0:bc > ff02::1: HBH icmp6: multicast listener query max resp delay: 2000 addr: :: [hlim 1] 0x0000: 6000 0000 0024 0001 fe80 0000 0000 0000 `....$.......... 0x0010: 0000 0000 d4e0 00bc ff02 0000 0000 0000 ................ 0x0020: 0000 0000 0000 0001 3a00 0502 0000 0100 ........:....... 0x0030: 8200 a03a 07d0 0000 0000 0000 0000 0000 ...:............ 0x0040: 0000 0000 0000 0000 027d 0000 .........}.. # ip6tables -vnL INPUT --line-num Chain INPUT (policy DROP 0 packets, 0 bytes) num pkts bytes target prot opt in out source destination 1 0 0 ACCEPT icmpv6 * * ::/0 fe80::/10 ipv6-icmp type 136 HL match HL == 255 2 0 0 ACCEPT icmpv6 * * ::/0 ff02::1:ff00:1/128 ipv6-icmp type 135 HL match HL == 255 3 0 0 ACCEPT icmpv6 * * ::/128 fe80::/10 ipv6-icmp type 135 HL match HL == 255 4 0 0 ACCEPT icmpv6 * * fe80::/10 ::/0 ipv6-icmp type 135 HL match HL == 255 5 4 384 ACCEPT icmpv6 * * fe80::/10 ff02::1/128 ipv6-icmp type 134 HL match HL == 255 6 0 0 ACCEPT icmpv6 * * fe80::/10 fe80::/10 ipv6-icmp type 133 HL match HL == 255 7 0 0 ACCEPT icmpv6 * * fe80::/10 ff02::1/128 ipv6-icmp type 130 HL match HL == 1 8 0 0 ACCEPT icmpv6 * * ::/0 ::/0 ipv6-icmp type 4 9 0 0 ACCEPT icmpv6 * * ::/0 ::/0 ipv6-icmp type 3 10 0 0 ACCEPT icmpv6 * * ::/0 ::/0 ipv6-icmp type 2 11 0 0 ACCEPT icmpv6 * * ::/0 ::/0 ipv6-icmp type 1 Expected: match of rule 7 Peter -- Dr. Peter Bieringer http://www.bieringer.de/pb/ GPG/PGP Key 0x958F422D mailto: pb at bieringer dot de Deep Space 6 Co-Founder and Core Member http://www.deepspace6.net/ From gandalf@wlug.westbo.se Sun Jan 2 01:57:27 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 02 Jan 2005 01:57:34 -0800 (PST) Received: from null.rsn.bth.se (postfix@null.rsn.bth.se [194.47.142.3]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j029v5pm008386 for ; Sun, 2 Jan 2005 01:57:26 -0800 Received: by null.rsn.bth.se (Postfix, from userid 65534) id D53E32C0007; Sun, 2 Jan 2005 11:05:33 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by null.rsn.bth.se (Postfix) with ESMTP id 8A7E92C002D; Sun, 2 Jan 2005 11:05:33 +0100 (CET) Received: from tux.rsn.bth.se (tux.rsn.bth.se [194.47.143.135]) by null.rsn.bth.se (Postfix) with ESMTP id CD5492C0007; Sun, 2 Jan 2005 11:05:32 +0100 (CET) Received: by tux.rsn.bth.se (Postfix, from userid 501) id 062253F79; Sun, 2 Jan 2005 11:05:32 +0100 (CET) Subject: Re: 2.6.10-bk4 ip_conntrack oops fix From: Martin Josefsson To: Matthew J Galgoci Cc: netdev@oss.sgi.com In-Reply-To: References: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-t7qNmEHVwCYZzqHnTZvU" Date: Sun, 02 Jan 2005 11:05:32 +0100 Message-Id: <1104660332.3821.40.camel@tux.rsn.bth.se> Mime-Version: 1.0 X-Mailer: Evolution 2.0.3 X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: by amavisd-new-20030616-p10 on null.rsn.bth.se X-Virus-Status: Clean X-archive-position: 13330 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: gandalf@wlug.westbo.se Precedence: bulk X-list: netdev --=-t7qNmEHVwCYZzqHnTZvU Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Sun, 2005-01-02 at 06:12 +0000, Matthew J Galgoci wrote: > I stumbled onto an annoying oops in 2.6.10-bk4. >=20 > Here is how to cause the oops. >=20 > load ip_conntrack > remove ip_conntrack > ls /proc/net/stat > boom Thanks for the fix, a patch for this has already been submitted. Hopefully it'll make it's way into the tree soon, The hollidays and vacations is making the process a bit sluggish at the moment. --=20 /Martin --=-t7qNmEHVwCYZzqHnTZvU Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQBB18dsWm2vlfa207ERAp+UAKCjWidLHkboST3L0uLOp6zGHZ0wFgCfW0g3 19ViKWGchnRiP9dwpuLiOrU= =RPkS -----END PGP SIGNATURE----- --=-t7qNmEHVwCYZzqHnTZvU-- From linux_lover2004@yahoo.com Sun Jan 2 03:09:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 02 Jan 2005 03:09:53 -0800 (PST) Received: from web52204.mail.yahoo.com (web52204.mail.yahoo.com [206.190.39.86]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j02B9PU5012300 for ; Sun, 2 Jan 2005 03:09:45 -0800 Received: (qmail 8758 invoked by uid 60001); 2 Jan 2005 11:17:55 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=ocMxXZkMLOIXw+DcQhwF8XlRUmgVKvCPsbkBhKCaFQxd8y4mhW3G4JvLVNQqImBRRcHn9QCigdubNfg5z3h2jOhxWXHBPTSxCiKSgGuNN8fwPNcshy6q9/D15pmt8gSoZ76arFwhduLMP9iRhX45CbOPWVtZ6amg1579VZ7bChA= ; Message-ID: <20050102111755.8756.qmail@web52204.mail.yahoo.com> Received: from [202.56.231.117] by web52204.mail.yahoo.com via HTTP; Sun, 02 Jan 2005 03:17:55 PST Date: Sun, 2 Jan 2005 03:17:55 -0800 (PST) From: linux lover Subject: what is mean by linear socket buffers? To: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13331 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: linux_lover2004@yahoo.com Precedence: bulk X-list: netdev Hello, On Internet i found one document that states following statement "Linux chooses to use linear buffers and save space in advance because linear buffers make many other things much faster." I want to know what is linear buffers? are they different than what we declare in normal C programming syntax unsigned char *str. regards, linux_lover. __________________________________ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo From kaber@trash.net Sun Jan 2 03:35:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 02 Jan 2005 03:35:55 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j02BZRVR013230 for ; Sun, 2 Jan 2005 03:35:47 -0800 Received: from eru.coreworks.de ([172.16.0.2] helo=trash.net) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Cl49h-0007Qy-FW; Sun, 02 Jan 2005 12:44:17 +0100 Message-ID: <41D7DE3E.2090304@trash.net> Date: Sun, 02 Jan 2005 12:42:54 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5 X-Accept-Language: en MIME-Version: 1.0 To: Peter Bieringer CC: USAGI core , Maillist netdev , Harald Welte , Netfilter development mailing list Subject: Re: ip6tables: accept of IPv6 transport esp packages not possible - no rule matches References: <019064D0423CE6C823CBF476@t1mobil.muc.aerasec.de> <5F6ACA5CEF52DBFBF11FBF94@t1mobil.muc.aerasec.de> <41CD8B4F.6010402@trash.net> <85346B5DA83795C08812E782@worker.muc.bieringer.de> In-Reply-To: <85346B5DA83795C08812E782@worker.muc.bieringer.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13332 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Peter Bieringer wrote: >>Does this patch fix the problem ? >> > Yes, this patch fix the problem on the incoming side: Thanks. > > I ping6 to a remote host via IPsec in transport mode: > > IPv6 INPUT chain: > > 0 0 ACCEPT icmpv6 * * ::/0 ::/0 > ipv6-icmp type 128 > 0 0 ACCEPT icmpv6 * * ::/0 ::/0 > ipv6-icmp type 129 > 1 156 ACCEPT esp * * remote/128 local/128 > 0 0 ACCEPT all * * remote/128 local/128 > > > So the proper chain matches. > > > But I wonder a little bit because of the result of the OUTPUT chain: > > 0 0 ACCEPT icmpv6 * * ::/0 ::/0 > ipv6-icmp type 129 > 1 104 ACCEPT icmpv6 * * ::/0 ::/0 > ipv6-icmp type 128 > 0 0 ACCEPT esp * * local/128 remote/128 > 0 0 ACCEPT all * * local/128 remote/128 > > > Here, the ICMPv6 rule matches. > > This means for me that the traffic goes like this: > > OUTPUT: ping6 -> netfilter -> encryption -> ESP > INPUT : ESP -> netfilter -> decryption -> ping6 More specific, with transport mode it goes: OUTPUT: ping6 -> LOCAL_OUT -> encryption -> POST_ROUTING INPUT: ESP -> PRE_ROUTING -> LOCAL_IN -> decryption -> ping6 Filtering for IPv6 happens on LOCAL_IN/LOCAL_OUT (and FORWARD). > Is this logical? Not very. Patches to improve this for IPv4 will be submitted next week, but IPv6 still needs some work. > > BTW: how to filter incoming traffic after decryption? Use tunnel-mode. The decrypted packets will hit PRE_ROUTING and LOCAL_IN again. Regards Patrick From ahu@outpost.ds9a.nl Sun Jan 2 04:05:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 02 Jan 2005 04:05:44 -0800 (PST) Received: from outpost.ds9a.nl (postfix@outpost.ds9a.nl [213.244.168.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j02C5FhS014608 for ; Sun, 2 Jan 2005 04:05:35 -0800 Received: by outpost.ds9a.nl (Postfix, from userid 1000) id 7CD1D441A; Sun, 2 Jan 2005 13:13:49 +0100 (CET) Date: Sun, 2 Jan 2005 13:13:49 +0100 From: bert hubert To: jamal Cc: Wichert Akkerman , netdev@oss.sgi.com Subject: Re: unregister_netdev Annoyance WAS(Re: ing_filter debug messages Message-ID: <20050102121349.GA27022@outpost.ds9a.nl> Mail-Followup-To: bert hubert , jamal , Wichert Akkerman , netdev@oss.sgi.com References: <20041230160643.GD24603@wiggy.net> <1104469666.1049.231.camel@jzny.localdomain> <20041231093827.GG24603@wiggy.net> <1104491510.1047.234.camel@jzny.localdomain> <20041231131553.GA7460@wiggy.net> <1104505838.1048.273.camel@jzny.localdomain> <20041231154844.GA11511@wiggy.net> <1104511697.1048.308.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1104511697.1048.308.camel@jzny.localdomain> User-Agent: Mutt/1.3.28i X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13333 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ahu@ds9a.nl Precedence: bulk X-list: netdev > > However, the unregister_netdev problem still persists. > > I am pretty sure its a different problem. Quick scan shows the > register/unregister state machine may be at fault. This is a separate and known problem - see 'Re: Major deadlock: unregister_netdevice: waiting for to become free. Usage count = 1' by Peter Bieringer. For some reason this issue has been widely ignored. I see it as well here and it is the one reason I don't entirely trust 2.6.10 yet in production. Thanks for looking into it Jamal! -- http://www.PowerDNS.com Open source, database driven DNS Software http://lartc.org Linux Advanced Routing & Traffic Control HOWTO From pb@bieringer.de Sun Jan 2 04:07:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 02 Jan 2005 04:07:47 -0800 (PST) Received: from smtp2.aerasec.de (gromit.aerasec.de [195.226.187.57]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j02C7FRF014929 for ; Sun, 2 Jan 2005 04:07:35 -0800 Received: from localhost (localhost [127.0.0.1]) by smtp2.aerasec.de (Postfix) with SMTP id CD4AA137F1; Sun, 2 Jan 2005 13:15:48 +0100 (CET) X-AV-Checked: Sun Jan 2 13:15:48 2005 smtp2.aerasec.de Received: from [192.168.1.2] (pD9E4EFC7.dip.t-dialin.net [217.228.239.199]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client did not present a certificate) by smtp2.aerasec.de (Postfix) with ESMTP id D52BA137EA; Sun, 2 Jan 2005 13:15:45 +0100 (CET) Date: Sun, 02 Jan 2005 13:15:42 +0100 From: Peter Bieringer To: Patrick McHardy Cc: USAGI core , Maillist netdev , Harald Welte , Netfilter development mailing list Subject: Re: ip6tables: accept of IPv6 transport esp packages not possible - no rule matches Message-ID: In-Reply-To: <41D7DE3E.2090304@trash.net> References: <019064D0423CE6C823CBF476@t1mobil.muc.aerasec.de> <5F6ACA5CEF52DBFBF11FBF94@t1mobil.muc.aerasec.de> <41CD8B4F.6010402@trash.net> <85346B5DA83795C08812E782@worker.muc.bieringer.de> <41D7DE3E.2090304@trash.net> X-Mailer: Mulberry/3.1.6 (Linux/x86) X-URL: http://www.bieringer.de/pb/ X-OS: Linux MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13334 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pb@bieringer.de Precedence: bulk X-list: netdev --On Sunday, January 02, 2005 12:42:54 PM +0100 Patrick McHardy wrote: >> But I wonder a little bit because of the result of the OUTPUT chain: >> >> 0 0 ACCEPT icmpv6 * * ::/0 ::/0 >> ipv6-icmp type 129 >> 1 104 ACCEPT icmpv6 * * ::/0 ::/0 >> ipv6-icmp type 128 >> 0 0 ACCEPT esp * * local/128 remote/128 >> 0 0 ACCEPT all * * local/128 remote/128 >> >> >> Here, the ICMPv6 rule matches. >> >> This means for me that the traffic goes like this: >> >> OUTPUT: ping6 -> netfilter -> encryption -> ESP >> INPUT : ESP -> netfilter -> decryption -> ping6 > > More specific, with transport mode it goes: > > OUTPUT: ping6 -> LOCAL_OUT -> encryption -> POST_ROUTING > INPUT: ESP -> PRE_ROUTING -> LOCAL_IN -> decryption -> ping6 > > Filtering for IPv6 happens on LOCAL_IN/LOCAL_OUT (and FORWARD). > >> Is this logical? > > Not very. Patches to improve this for IPv4 will be submitted > next week, but IPv6 still needs some work. > >> >> BTW: how to filter incoming traffic after decryption? > > Use tunnel-mode. The decrypted packets will hit PRE_ROUTING > and LOCAL_IN again. Ok, confirmed working in tunnel mode, ping6 packet was counted twice in different rules (esp and icmpv6) But for outgoing ping6 packets, this won't work, packet is only counted (and accepted) by the icmpv6 rule, esp rule got no match, also not the "all" rule. Looks like at the moment, outgoing packet is passing netfilter only one time, even if encryption is in tunnel mode. By design / bug / missing feature? Peter -- Dr. Peter Bieringer http://www.bieringer.de/pb/ GPG/PGP Key 0x958F422D mailto: pb at bieringer dot de Deep Space 6 Co-Founder and Core Member http://www.deepspace6.net/ From rich@phekda.gotadsl.co.uk Sun Jan 2 05:42:19 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 02 Jan 2005 05:42:32 -0800 (PST) Received: from smtp.nildram.co.uk (smtp.nildram.co.uk [195.112.4.54]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j02DfvPQ026524 for ; Sun, 2 Jan 2005 05:42:17 -0800 Received: from katrina.int.phekda.gotadsl.co.uk (unknown [84.12.62.218]) by smtp.nildram.co.uk (Postfix) with ESMTP id 0A06D251692; Sun, 2 Jan 2005 13:50:26 +0000 (GMT) Received: from [192.168.1.4] (katrina.int.phekda.gotadsl.co.uk [192.168.1.4]) by katrina.int.phekda.gotadsl.co.uk (Postfix) with ESMTP id 5A3BA355; Sun, 2 Jan 2005 13:51:21 +0000 (GMT) Message-ID: <41D7FC59.2040503@phekda.gotadsl.co.uk> Date: Sun, 02 Jan 2005 13:51:21 +0000 From: Richard Dawe User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020 X-Accept-Language: en, de, fr MIME-Version: 1.0 To: Francois Romieu Cc: netdev@oss.sgi.com, Me Subject: Re: Acer Aspire 1524WLMi and RealTek 8169 - very slow References: <41A09541.5040405@phekda.gotadsl.co.uk> <41A0F0D5.9050702@phekda.gotadsl.co.uk> <20041121205814.GA22460@electric-eye.fr.zoreil.com> <41A24F35.5080106@phekda.gotadsl.co.uk> <20041122213008.GA9618@electric-eye.fr.zoreil.com> <41D2844E.5070204@phekda.gotadsl.co.uk> <20041229235203.GA5465@electric-eye.fr.zoreil.com> In-Reply-To: <20041229235203.GA5465@electric-eye.fr.zoreil.com> Content-Type: multipart/mixed; boundary="------------090209010003000801020701" X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13335 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rich@phekda.gotadsl.co.uk Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------090209010003000801020701 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hello. Francois Romieu wrote: > Richard Dawe : > [...] > >>IRQ routing seems to be disabled in 2.6.10. I got a warning about an >>unhandled interrupt for the VIA 8255 (I think that's the right number) >>on shutdown. I'm wondering if there is some bad interaction between the >>VIA chipset and the 8110 chipset. > > > Possible. I hope the networking does not perform better when you are > listening to music. No, it doesn't. I even built a kernel with no sound support, but this had the same problems. In this case /proc/interrupts showed that there was no driver handling the interrupts for the VIA 8233 sound chip. [snip] > Could you send an updated dmesg, lspci -vvx, /proc/interrupts please ? Please see the attached, which are for running with 2.6.10. I included .config, Just In Case. > Did you remove the other OS from the laptop ? I'd be curious to know > if it can teach us something. I removed Windows XP Home. I only have Fedora Core 3 on it. I've spoken with someone else who's had problems with Acer laptops and networking. He has the laptop mentioned on this page: http://www.latzinator.com/acer_aspire_1705SMi.html Apparently it works fine with FreeBSD 5.3, even booting from cold. So this seems like a Linux ACPI-specific problem. Note that the 1705SMi is a Pentium IV-based laptop. Thanks, bye, Rich =] -- Richard Dawe [ http://homepages.nildram.co.uk/~phekda/richdawe/ ] "You can't evaluate a man by logic alone." -- McCoy, "I, Mudd", Star Trek --------------090209010003000801020701 Content-Type: text/plain; name="2.6.10-dmesg.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="2.6.10-dmesg.txt" Bootdata ok (command line is ro root=/dev/VolGroup00/LogVol00) Linux version 2.6.9-1.678_FC3 (bhcompile@dolly.build.redhat.com) (gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)) #1 Mon Nov 15 18:27:45 EST 2004 BIOS-provided physical RAM map: BIOS-e820: 0000000000000000 - 000000000009f800 (usable) BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved) BIOS-e820: 00000000000d8000 - 0000000000100000 (reserved) BIOS-e820: 0000000000100000 - 000000001ff70000 (usable) BIOS-e820: 000000001ff70000 - 000000001ff7a000 (ACPI data) BIOS-e820: 000000001ff7a000 - 000000001ff80000 (ACPI NVS) BIOS-e820: 000000001ff80000 - 0000000020000000 (reserved) BIOS-e820: 00000000fffe0000 - 0000000100000000 (reserved) No mptable found. On node 0 totalpages: 130928 DMA zone: 4096 pages, LIFO batch:1 Normal zone: 126832 pages, LIFO batch:16 HighMem zone: 0 pages, LIFO batch:1 ACPI: RSDP (v000 PTLTD ) @ 0x00000000000f6a60 ACPI: RSDT (v001 PTLTD RSDT 0x06040000 LTP 0x00000000) @ 0x000000001ff73fbd ACPI: FADT (v002 AMDK8 PTLTW 0x06040000 PTL_ 0x000f4240) @ 0x000000001ff79e35 ACPI: SSDT (v001 PTLTD POWERNOW 0x06040000 LTP 0x00000001) @ 0x000000001ff79eb9 ACPI: MADT (v001 PTLTD APIC 0x06040000 LTP 0x00000000) @ 0x000000001ff79fb0 ACPI: DSDT (v001 VIA PTL_ACPI 0x06040000 MSFT 0x0100000e) @ 0x0000000000000000 ACPI: Local APIC address 0xfee00000 ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled) Processor #0 15:4 APIC version 16 ACPI: LAPIC_NMI (acpi_id[0x00] high edge lint[0x1]) ACPI: IOAPIC (id[0x01] address[0xfec00000] gsi_base[0]) IOAPIC[0]: apic_id 1, version 3, address 0xfec00000, GSI 0-23 ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 high edge) ACPI: IRQ0 used by override. ACPI: IRQ2 used by override. ACPI: IRQ9 used by override. Using ACPI (MADT) for SMP configuration information Checking aperture... CPU 0: aperture @ d0000000 size 256 MB Built 1 zonelists Kernel command line: ro root=/dev/VolGroup00/LogVol00 console=tty0 Initializing CPU#0 PID hash table entries: 2048 (order: 11, 65536 bytes) time.c: Using 1.193182 MHz PIT timer. time.c: Detected 2201.330 MHz processor. Console: colour VGA+ 80x25 Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes) Inode-cache hash table entries: 65536 (order: 7, 524288 bytes) Memory: 508340k/523712k available (2403k kernel code, 14612k reserved, 1285k data, 164k init) Calibrating delay loop... 4325.37 BogoMIPS (lpj=2162688) Security Scaffold v1.0.0 initialized SELinux: Initializing. SELinux: Starting in permissive mode There is already a security framework initialized, register_security failed. selinux_register_security: Registering secondary module capability Capability LSM initialized as secondary Mount-cache hash table entries: 256 (order: 0, 4096 bytes) CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line) CPU: L2 Cache: 1024K (64 bytes/line) CPU: AMD Athlon(tm) 64 Processor 3400+ stepping 0a Using local APIC NMI watchdog using perfctr0 Using local APIC timer interrupts. Detected 12.507 MHz APIC timer. checking if image is initramfs... it is NET: Registered protocol family 16 PCI: Using configuration type 1 mtrr: v2.0 (20020519) ACPI: Subsystem revision 20040816 ACPI: Interpreter enabled ACPI: Using IOAPIC for interrupt routing ACPI: PCI Root Bridge [PCI0] (00:00) PCI: Probing PCI hardware (bus 00) ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT] ACPI: PCI Interrupt Link [ALKA] (IRQs 16 17 18 19 20 21 22 23) *10, disabled. ACPI: PCI Interrupt Link [ALKB] (IRQs 16 17 18 19 20 21 22 23) *10, disabled. ACPI: PCI Interrupt Link [ALKC] (IRQs 22) *11, disabled. ACPI: PCI Interrupt Link [ALKD] (IRQs 21) *11, disabled. ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 7 9 12 14 15) *10 ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 7 *10 12 14 15) ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 7 *11 12 14 15) ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 7 9 10 *11 12 14 15) ACPI: Embedded Controller [EC] (gpe 11) usbcore: registered new driver usbfs usbcore: registered new driver hub PCI: Using ACPI for IRQ routing ACPI: PCI interrupt 0000:00:0a.0[A] -> GSI 21 (level, low) -> IRQ 169 ACPI: PCI interrupt 0000:00:0b.0[A] -> GSI 17 (level, low) -> IRQ 177 ACPI: PCI interrupt 0000:00:0b.1[B] -> GSI 18 (level, low) -> IRQ 185 ACPI: PCI interrupt 0000:00:0b.2[C] -> GSI 19 (level, low) -> IRQ 193 ACPI: PCI interrupt 0000:00:0c.0[A] -> GSI 22 (level, low) -> IRQ 201 ACPI: PCI interrupt 0000:00:10.0[A] -> GSI 21 (level, low) -> IRQ 169 ACPI: PCI interrupt 0000:00:10.1[B] -> GSI 21 (level, low) -> IRQ 169 ACPI: PCI interrupt 0000:00:10.2[C] -> GSI 21 (level, low) -> IRQ 169 ACPI: PCI interrupt 0000:00:10.3[D] -> GSI 21 (level, low) -> IRQ 169 ACPI: PCI interrupt 0000:00:11.1[A]: no GSI ACPI: PCI interrupt 0000:00:11.5[C] -> GSI 22 (level, low) -> IRQ 201 ACPI: PCI interrupt 0000:00:11.6[C] -> GSI 22 (level, low) -> IRQ 201 ACPI: PCI interrupt 0000:01:00.0[A] -> GSI 16 (level, low) -> IRQ 209 agpgart: Detected AGP bridge 0 agpgart: Maximum main memory to use for agp memory: 439M agpgart: AGP aperture is 256M @ 0xd0000000 PCI-DMA: Disabling IOMMU. IA32 emulation $Id: sys_ia32.c,v 1.32 2002/03/24 13:02:28 ak Exp $ audit: initializing netlink socket (disabled) audit(1104670420.329:0): initialized Total HugeTLB memory allocated, 0 VFS: Disk quotas dquot_6.5.1 Dquot-cache hash table entries: 512 (order 0, 4096 bytes) SELinux: Registering netfilter hooks Initializing Cryptographic API ksign: Installing public key data Loading keyring - Added public key A523A41F30C2FAFE - User ID: Red Hat, Inc. (Kernel Module GPG key) PCI: Via IRQ fixup for 0000:00:10.0, from 0 to 9 PCI: Via IRQ fixup for 0000:00:10.1, from 0 to 9 PCI: Via IRQ fixup for 0000:00:10.2, from 0 to 9 PCI: Via IRQ fixup for 0000:00:11.6, from 11 to 9 pci_hotplug: PCI Hot Plug PCI Core version: 0.5 vesafb: probe of vesafb0 failed with error -6 ACPI: Processor [CPU0] (supports C1) ACPI: Thermal Zone [THRS] (18 C) ACPI: Thermal Zone [THRC] (38 C) Real Time Clock Driver v1.12 Linux agpgart interface v0.100 (c) Dave Jones i8042.c: Detected active multiplexing controller, rev 1.1. serio: i8042 AUX0 port at 0x60,0x64 irq 12 serio: i8042 AUX1 port at 0x60,0x64 irq 12 serio: i8042 AUX2 port at 0x60,0x64 irq 12 serio: i8042 AUX3 port at 0x60,0x64 irq 12 serio: i8042 KBD port at 0x60,0x64 irq 1 Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize divert: not allocating divert_blk for non-ethernet device lo Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx VP_IDE: IDE controller at PCI slot 0000:00:11.1 ACPI: PCI interrupt 0000:00:11.1[A]: no GSI VP_IDE: chipset revision 6 VP_IDE: not 100% native mode: will probe irqs later VP_IDE: VIA vt8235 (rev 00) IDE UDMA133 controller on pci0000:00:11.1 ide0: BM-DMA at 0x1c80-0x1c87, BIOS settings: hda:DMA, hdb:pio ide1: BM-DMA at 0x1c88-0x1c8f, BIOS settings: hdc:DMA, hdd:pio Probing IDE interface ide0... hda: IC25N060ATMR04-0, ATA DISK drive Using cfq io scheduler ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 Probing IDE interface ide1... hdc: TSSTcorpCD/DVDW TS-L532A, ATAPI CD/DVD-ROM drive ide1 at 0x170-0x177,0x376 on irq 15 Probing IDE interface ide2... ide2: Wait for ready failed before probe ! Probing IDE interface ide3... ide3: Wait for ready failed before probe ! Probing IDE interface ide4... ide4: Wait for ready failed before probe ! Probing IDE interface ide5... ide5: Wait for ready failed before probe ! hda: max request size: 1024KiB hda: 117210240 sectors (60011 MB) w/7884KiB Cache, CHS=16383/255/63, UDMA(100) hda: cache flushes supported hda: hda1 hda2 hdc: ATAPI 24X DVD-ROM DVD-R CD-R/RW drive, 2048kB Cache, UDMA(33) Uniform CD-ROM driver Revision: 3.20 ide-floppy driver 0.99.newide usbcore: registered new driver hiddev usbcore: registered new driver usbhid drivers/usb/input/hid-core.c: v2.0:USB HID core driver mice: PS/2 mouse device common for all mice input: AT Translated Set 2 keyboard on isa0060/serio0 Synaptics Touchpad, model: 1 Firmware: 5.8 180 degree mounted touchpad Sensor: 18 new absolute packet format Touchpad has extended capability bits -> 4 multi-buttons, i.e. besides standard buttons -> multifinger detection -> palm detection input: SynPS/2 Synaptics TouchPad on isa0060/serio4 md: md driver 0.90.0 MAX_MD_DEVS=256, MD_SB_DISKS=27 NET: Registered protocol family 2 IP: routing cache hash table of 512 buckets, 28Kbytes TCP: Hash tables configured (established 32768 bind 4681) Initializing IPsec netlink socket NET: Registered protocol family 1 NET: Registered protocol family 17 powernow-k8: Found 1 AMD Athlon 64 / Opteron processors (version 1.00.09b) powernow-k8: 0 : fid 0xe (2200 MHz), vid 0x2 (1500 mV) powernow-k8: 1 : fid 0xc (2000 MHz), vid 0x6 (1400 mV) powernow-k8: 2 : fid 0xa (1800 MHz), vid 0xa (1300 mV) powernow-k8: 3 : fid 0x0 (800 MHz), vid 0x12 (1100 mV) powernow-k8: cpu_init done, current fid 0xe, vid 0x0 powernow-k8: ph2 null fid transition 0xe ACPI: (supports S0 S3 S4 S5) ACPI wakeup devices: PCI0 Z007 GLAN LID SLPB Freeing unused kernel memory: 164k freed device-mapper: 4.1.0-ioctl (2003-12-10) initialised: dm@uk.sistina.com cdrom: open failed. kjournald starting. Commit interval 5 seconds EXT3-fs: mounted filesystem with ordered data mode. security: 3 users, 4 roles, 316 types, 20 bools security: 53 classes, 7072 rules SELinux: Completing initialization. SELinux: Setting up existing superblocks. SELinux: initialized (dev dm-0, type ext3), uses xattr SELinux: initialized (dev tmpfs, type tmpfs), uses transition SIDs SELinux: initialized (dev selinuxfs, type selinuxfs), uses genfs_contexts SELinux: initialized (dev mqueue, type mqueue), not configured for labeling SELinux: initialized (dev hugetlbfs, type hugetlbfs), not configured for labeling SELinux: initialized (dev devpts, type devpts), uses transition SIDs SELinux: initialized (dev eventpollfs, type eventpollfs), uses genfs_contexts SELinux: initialized (dev pipefs, type pipefs), uses task SIDs SELinux: initialized (dev tmpfs, type tmpfs), uses transition SIDs SELinux: initialized (dev futexfs, type futexfs), uses genfs_contexts SELinux: initialized (dev sockfs, type sockfs), uses task SIDs SELinux: initialized (dev proc, type proc), uses genfs_contexts SELinux: initialized (dev bdev, type bdev), uses genfs_contexts SELinux: initialized (dev rootfs, type rootfs), uses genfs_contexts SELinux: initialized (dev sysfs, type sysfs), uses genfs_contexts SELinux: initialized (dev usbfs, type usbfs), uses genfs_contexts inserting floppy driver for 2.6.9-1.678_FC3 floppy0: no floppy controllers found r8169 Gigabit Ethernet driver 1.2 loaded ACPI: PCI interrupt 0000:00:0c.0[A] -> GSI 22 (level, low) -> IRQ 201 r8169: NAPI enabled divert: allocating divert_blk for eth0 eth0: Identified chip type is 'RTL8169'. eth0: RTL8169 at 0xffffff0000022400, 00:0a:e4:5f:3e:85, IRQ 201 r8169: media option is deprecated. via82xx: Assuming DXS channels with 48k fixed sample rate. Please try dxs_support=1 or dxs_support=4 option and report if it works on your machine. ACPI: PCI interrupt 0000:00:11.5[C] -> GSI 22 (level, low) -> IRQ 201 PCI: Setting latency timer of device 0000:00:11.5 to 64 ACPI: PCI interrupt 0000:00:10.3[D] -> GSI 21 (level, low) -> IRQ 169 ehci_hcd 0000:00:10.3: EHCI Host Controller ehci_hcd 0000:00:10.3: irq 169, pci mem ffffff0000024800 SELinux: initialized (dev usbdevfs, type usbdevfs), uses genfs_contexts ehci_hcd 0000:00:10.3: new USB bus registered, assigned bus number 1 ehci_hcd 0000:00:10.3: USB 2.0 enabled, EHCI 1.00, driver 2004-May-10 hub 1-0:1.0: USB hub found hub 1-0:1.0: 6 ports detected USB Universal Host Controller Interface driver v2.2 ACPI: PCI interrupt 0000:00:10.0[A] -> GSI 21 (level, low) -> IRQ 169 uhci_hcd 0000:00:10.0: UHCI Host Controller uhci_hcd 0000:00:10.0: irq 169, io base 0000000000001c20 uhci_hcd 0000:00:10.0: new USB bus registered, assigned bus number 2 hub 2-0:1.0: USB hub found hub 2-0:1.0: 2 ports detected ACPI: PCI interrupt 0000:00:10.1[B] -> GSI 21 (level, low) -> IRQ 169 uhci_hcd 0000:00:10.1: UHCI Host Controller uhci_hcd 0000:00:10.1: irq 169, io base 0000000000001c40 uhci_hcd 0000:00:10.1: new USB bus registered, assigned bus number 3 hub 3-0:1.0: USB hub found hub 3-0:1.0: 2 ports detected ACPI: PCI interrupt 0000:00:10.2[C] -> GSI 21 (level, low) -> IRQ 169 uhci_hcd 0000:00:10.2: UHCI Host Controller uhci_hcd 0000:00:10.2: irq 169, io base 0000000000001c60 uhci_hcd 0000:00:10.2: new USB bus registered, assigned bus number 4 hub 4-0:1.0: USB hub found hub 4-0:1.0: 2 ports detected Linux Kernel Card Services options: [pci] [cardbus] [pm] ACPI: PCI interrupt 0000:00:0b.0[A] -> GSI 17 (level, low) -> IRQ 177 Yenta: CardBus bridge found at 0000:00:0b.0 [1025:006e] Yenta: ISA IRQ mask 0x0cf8, PCI irq 177 Socket status: 30000006 PCI: Enabling device 0000:00:0b.1 (0000 -> 0002) ACPI: PCI interrupt 0000:00:0b.1[B] -> GSI 18 (level, low) -> IRQ 185 Yenta: CardBus bridge found at 0000:00:0b.1 [1025:006e] Yenta: ISA IRQ mask 0x0cf8, PCI irq 185 Socket status: 30000006 ohci1394: $Rev: 1223 $ Ben Collins ACPI: PCI interrupt 0000:00:0b.2[C] -> GSI 19 (level, low) -> IRQ 193 ohci1394: fw-host0: OHCI-1394 1.1 (PCI): IRQ=[193] MMIO=[c0005800-c0005fff] Max Packet=[2048] md: Autodetecting RAID arrays. md: autorun ... md: ... autorun DONE. ieee1394: Host added: ID:BUS[0-00:1023] GUID[000ae40444105af8] ACPI: AC Adapter [AC] (off-line) ACPI: Battery Slot [BAT0] (battery present) ACPI: Power Button (FF) [PWRF] ACPI: Lid Switch [LID] ACPI: Sleep Button (CM) [SLPB] EXT3 FS on dm-0, internal journal cdrom: open failed. kjournald starting. Commit interval 5 seconds EXT3 FS on hda1, internal journal EXT3-fs: mounted filesystem with ordered data mode. SELinux: initialized (dev hda1, type ext3), uses xattr SELinux: initialized (dev tmpfs, type tmpfs), uses transition SIDs Adding 1015800k swap on /dev/VolGroup00/LogVol01. Priority:-1 extents:1 SELinux: initialized (dev binfmt_misc, type binfmt_misc), uses genfs_contexts parport0: PC-style at 0x378 (0x778) [PCSPP,TRISTATE] parport0: irq 7 detected ip_tables: (C) 2000-2002 Netfilter core team ip_conntrack version 2.1 (2045 buckets, 16360 max) - 496 bytes per conntrack r8169: eth0: link up SELinux: initialized (dev rpc_pipefs, type rpc_pipefs), uses genfs_contexts i2c /dev entries driver parport0: PC-style at 0x378 (0x778) [PCSPP,TRISTATE] parport0: irq 7 detected lp0: using parport0 (polling). lp0: console ready NET: Registered protocol family 10 Disabled Privacy Extensions on device ffffffff80450020(lo) IPv6 over IPv4 tunneling driver divert: not allocating divert_blk for non-ethernet device sit0 eth0: no IPv6 routers present --------------090209010003000801020701 Content-Type: text/plain; name="2.6.10-lspci-vvx.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="2.6.10-lspci-vvx.txt" 00:00.0 Host bridge: VIA Technologies, Inc.: Unknown device 0204 Subsystem: Acer Incorporated [ALI]: Unknown device 006e Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap+ 66Mhz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- SERR- Capabilities: [50] Power Management version 2 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-) Status: D0 PME-Enable- DSel=0 DScale=0 PME- Capabilities: [60] HyperTransport: Slave or Primary Interface !!! Possibly incomplete decoding Command: BaseUnitID=0 UnitCnt=3 MastHost- DefDir- Link Control 0: CFlE- CST- CFE- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- Reset- FastB2B- Capabilities: [80] Power Management version 2 Flags: PMEClk- DSI- D1+ D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-) Status: D0 PME-Enable- DSel=0 DScale=0 PME- 00: 06 11 88 b1 07 00 30 02 00 00 04 06 00 00 01 00 10: 00 00 00 00 00 00 00 00 00 01 01 00 f0 00 20 22 20: 00 c1 f0 c1 00 e0 f0 ef 00 00 00 00 00 00 00 00 30: 00 00 00 00 80 00 00 00 00 00 00 00 00 00 0c 00 00:0a.0 Ethernet controller: Linksys, A Division of Cisco Systems [AirConn] INPROCOMM IPN 2220 Wireless LAN Adapter (rev 01) Subsystem: AMBIT Microsystem Corp.: Unknown device 0305 Control: I/O+ Mem+ BusMaster- SpecCycle+ MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- SERR- TAbort- SERR- Reset+ 16bInt+ PostWrite+ 16-bit legacy interface ports at 0001 00: 4c 10 8e ac 07 00 10 02 00 00 07 06 20 a8 82 00 10: 00 00 00 20 a0 00 00 02 00 02 05 b0 00 00 40 20 20: 00 f0 7f 20 00 00 80 20 00 f0 bf 20 00 44 00 00 30: fc 44 00 00 00 48 00 00 fc 48 00 00 0a 01 c0 05 40: 25 10 6e 00 01 00 00 00 00 00 00 00 00 00 00 00 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00:0b.1 CardBus bridge: Texas Instruments PCI7420 CardBus Controller Subsystem: Acer Incorporated [ALI]: Unknown device 006e Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- SERR- Reset+ 16bInt+ PostWrite+ 16-bit legacy interface ports at 0001 00: 4c 10 8e ac 07 00 10 02 00 00 07 06 20 a8 82 00 10: 00 10 00 20 a0 00 00 02 00 06 09 b0 00 00 c0 20 20: 00 f0 ff 20 00 00 00 21 00 f0 3f 21 00 4c 00 00 30: fc 4c 00 00 00 50 00 00 fc 50 00 00 0b 02 c0 05 40: 25 10 6e 00 01 00 00 00 00 00 00 00 00 00 00 00 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00:0b.2 FireWire (IEEE 1394): Texas Instruments PCI7x20 1394a-2000 OHCI Two-Port PHY/Link-Layer Controller (prog-if 10 [OHCI]) Subsystem: Acer Incorporated [ALI]: Unknown device 006e Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- 00: de 10 47 03 07 00 b0 02 a1 00 00 03 00 40 00 00 10: 00 00 00 c1 08 00 00 e0 00 00 00 00 00 00 00 00 20: 00 00 00 00 00 00 00 00 00 00 00 00 25 10 6e 00 30: 00 00 00 00 60 00 00 00 00 00 00 00 0a 01 05 01 --------------090209010003000801020701 Content-Type: text/plain; name="2.6.10-proc-interrupts.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="2.6.10-proc-interrupts.txt" CPU0 0: 261994 IO-APIC-edge timer 1: 14 IO-APIC-edge i8042 8: 0 IO-APIC-edge rtc 9: 1 IO-APIC-level acpi 12: 100 IO-APIC-edge i8042 14: 4433 IO-APIC-edge ide0 15: 1934 IO-APIC-edge ide1 169: 0 IO-APIC-level ehci_hcd, uhci_hcd, uhci_hcd, uhci_hcd 177: 0 IO-APIC-level yenta 185: 0 IO-APIC-level yenta 193: 3 IO-APIC-level ohci1394 201: 652 IO-APIC-level VIA8233, eth0 NMI: 11 LOC: 261884 ERR: 0 MIS: 0 --------------090209010003000801020701 Content-Type: text/plain; name="config-2.6.10" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="config-2.6.10" # # Automatically generated make config: don't edit # Linux kernel version: 2.6.10 # Wed Dec 29 00:15:30 2004 # CONFIG_X86_64=y CONFIG_64BIT=y CONFIG_X86=y CONFIG_MMU=y CONFIG_RWSEM_GENERIC_SPINLOCK=y CONFIG_X86_CMPXCHG=y CONFIG_EARLY_PRINTK=y CONFIG_HPET_TIMER=y CONFIG_HPET_EMULATE_RTC=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_IOMAP=y # # Code maturity level options # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y CONFIG_BROKEN_ON_SMP=y # # General setup # CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y CONFIG_BSD_PROCESS_ACCT=y # CONFIG_BSD_PROCESS_ACCT_V3 is not set CONFIG_SYSCTL=y CONFIG_AUDIT=y CONFIG_AUDITSYSCALL=y CONFIG_LOG_BUF_SHIFT=17 CONFIG_HOTPLUG=y CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_ALL is not set CONFIG_KALLSYMS_EXTRA_PASS=y CONFIG_FUTEX=y CONFIG_EPOLL=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SHMEM=y CONFIG_CC_ALIGN_FUNCTIONS=0 CONFIG_CC_ALIGN_LABELS=0 CONFIG_CC_ALIGN_LOOPS=0 CONFIG_CC_ALIGN_JUMPS=0 # CONFIG_TINY_SHMEM is not set # # Loadable module support # CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y # CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y # # Processor type and features # # CONFIG_MK8 is not set # CONFIG_MPSC is not set CONFIG_GENERIC_CPU=y CONFIG_X86_L1_CACHE_BYTES=128 CONFIG_X86_L1_CACHE_SHIFT=7 CONFIG_X86_TSC=y CONFIG_X86_GOOD_APIC=y CONFIG_MICROCODE=m CONFIG_X86_MSR=y CONFIG_X86_CPUID=y CONFIG_X86_IO_APIC=y CONFIG_X86_LOCAL_APIC=y CONFIG_MTRR=y # CONFIG_SMP is not set # CONFIG_PREEMPT is not set # CONFIG_NUMA is not set CONFIG_GART_IOMMU=y CONFIG_SWIOTLB=y CONFIG_X86_MCE=y CONFIG_GENERIC_HARDIRQS=y CONFIG_GENERIC_IRQ_PROBE=y # # Power management options # CONFIG_PM=y # CONFIG_PM_DEBUG is not set # CONFIG_SOFTWARE_SUSPEND is not set # # ACPI (Advanced Configuration and Power Interface) Support # CONFIG_ACPI=y CONFIG_ACPI_BOOT=y CONFIG_ACPI_INTERPRETER=y CONFIG_ACPI_SLEEP=y CONFIG_ACPI_SLEEP_PROC_FS=y CONFIG_ACPI_AC=m CONFIG_ACPI_BATTERY=m CONFIG_ACPI_BUTTON=m CONFIG_ACPI_VIDEO=m CONFIG_ACPI_FAN=y CONFIG_ACPI_PROCESSOR=y CONFIG_ACPI_THERMAL=y CONFIG_ACPI_ASUS=m CONFIG_ACPI_IBM=m CONFIG_ACPI_TOSHIBA=m CONFIG_ACPI_CUSTOM_DSDT=y CONFIG_ACPI_CUSTOM_DSDT_FILE="/home/rich/src/acpi/acer-1524wlmi/dsdt.hex" CONFIG_ACPI_BLACKLIST_YEAR=2001 # CONFIG_ACPI_DEBUG is not set CONFIG_ACPI_BUS=y CONFIG_ACPI_EC=y CONFIG_ACPI_POWER=y CONFIG_ACPI_PCI=y CONFIG_ACPI_SYSTEM=y # # CPU Frequency scaling # CONFIG_CPU_FREQ=y # CONFIG_CPU_FREQ_DEBUG is not set # CONFIG_CPU_FREQ_PROC_INTF is not set # CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y CONFIG_CPU_FREQ_GOV_PERFORMANCE=y CONFIG_CPU_FREQ_GOV_POWERSAVE=m CONFIG_CPU_FREQ_GOV_USERSPACE=y # CONFIG_CPU_FREQ_24_API is not set CONFIG_CPU_FREQ_GOV_ONDEMAND=m CONFIG_CPU_FREQ_TABLE=y # # CPUFreq processor drivers # CONFIG_X86_POWERNOW_K8=y CONFIG_X86_POWERNOW_K8_ACPI=y CONFIG_X86_SPEEDSTEP_CENTRINO=y CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI=y CONFIG_X86_ACPI_CPUFREQ=m # # shared options # # CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set # # Bus options (PCI etc.) # CONFIG_PCI=y CONFIG_PCI_DIRECT=y CONFIG_PCI_MMCONFIG=y # CONFIG_UNORDERED_IO is not set CONFIG_PCI_MSI=y CONFIG_PCI_LEGACY_PROC=y # CONFIG_PCI_NAMES is not set # # PCCARD (PCMCIA/CardBus) support # CONFIG_PCCARD=m # CONFIG_PCMCIA_DEBUG is not set # CONFIG_PCMCIA_OBSOLETE is not set CONFIG_PCMCIA=m CONFIG_CARDBUS=y # # PC-card bridges # CONFIG_YENTA=m CONFIG_PD6729=m CONFIG_I82092=m CONFIG_TCIC=m # # PCI Hotplug Support # CONFIG_HOTPLUG_PCI=y # CONFIG_HOTPLUG_PCI_FAKE is not set # CONFIG_HOTPLUG_PCI_ACPI is not set # CONFIG_HOTPLUG_PCI_CPCI is not set CONFIG_HOTPLUG_PCI_PCIE=m CONFIG_HOTPLUG_PCI_PCIE_POLL_EVENT_MODE=y CONFIG_HOTPLUG_PCI_SHPC=m CONFIG_HOTPLUG_PCI_SHPC_POLL_EVENT_MODE=y # # Executable file formats / Emulations # CONFIG_BINFMT_ELF=y CONFIG_BINFMT_MISC=y CONFIG_IA32_EMULATION=y # CONFIG_IA32_AOUT is not set CONFIG_COMPAT=y CONFIG_SYSVIPC_COMPAT=y CONFIG_UID16=y # # Device Drivers # # # Generic Driver Options # # CONFIG_STANDALONE is not set CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_FW_LOADER=y # CONFIG_DEBUG_DRIVER is not set # # Memory Technology Devices (MTD) # CONFIG_MTD=m # CONFIG_MTD_DEBUG is not set CONFIG_MTD_PARTITIONS=y CONFIG_MTD_CONCAT=m CONFIG_MTD_REDBOOT_PARTS=m # CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set # CONFIG_MTD_REDBOOT_PARTS_READONLY is not set CONFIG_MTD_CMDLINE_PARTS=y # # User Modules And Translation Layers # CONFIG_MTD_CHAR=m CONFIG_MTD_BLOCK=m CONFIG_MTD_BLOCK_RO=m CONFIG_FTL=m CONFIG_NFTL=m CONFIG_NFTL_RW=y CONFIG_INFTL=m # # RAM/ROM/Flash chip drivers # CONFIG_MTD_CFI=m CONFIG_MTD_JEDECPROBE=m CONFIG_MTD_GEN_PROBE=m # CONFIG_MTD_CFI_ADV_OPTIONS is not set CONFIG_MTD_MAP_BANK_WIDTH_1=y CONFIG_MTD_MAP_BANK_WIDTH_2=y CONFIG_MTD_MAP_BANK_WIDTH_4=y # CONFIG_MTD_MAP_BANK_WIDTH_8 is not set # CONFIG_MTD_MAP_BANK_WIDTH_16 is not set # CONFIG_MTD_MAP_BANK_WIDTH_32 is not set CONFIG_MTD_CFI_I1=y CONFIG_MTD_CFI_I2=y # CONFIG_MTD_CFI_I4 is not set # CONFIG_MTD_CFI_I8 is not set CONFIG_MTD_CFI_INTELEXT=m CONFIG_MTD_CFI_AMDSTD=m CONFIG_MTD_CFI_AMDSTD_RETRY=3 CONFIG_MTD_CFI_STAA=m CONFIG_MTD_CFI_UTIL=m CONFIG_MTD_RAM=m CONFIG_MTD_ROM=m CONFIG_MTD_ABSENT=m # # Mapping drivers for chip access # CONFIG_MTD_COMPLEX_MAPPINGS=y # CONFIG_MTD_PHYSMAP is not set # CONFIG_MTD_PNC2000 is not set CONFIG_MTD_SC520CDP=m CONFIG_MTD_NETSC520=m CONFIG_MTD_TS5500=m CONFIG_MTD_SBC_GXX=m CONFIG_MTD_ELAN_104NC=m CONFIG_MTD_SCx200_DOCFLASH=m # CONFIG_MTD_AMD76XROM is not set # CONFIG_MTD_ICHXROM is not set CONFIG_MTD_SCB2_FLASH=m # CONFIG_MTD_NETtel is not set # CONFIG_MTD_DILNETPC is not set # CONFIG_MTD_L440GX is not set CONFIG_MTD_PCI=m # # Self-contained MTD device drivers # CONFIG_MTD_PMC551=m # CONFIG_MTD_PMC551_BUGFIX is not set # CONFIG_MTD_PMC551_DEBUG is not set # CONFIG_MTD_SLRAM is not set # CONFIG_MTD_PHRAM is not set CONFIG_MTD_MTDRAM=m CONFIG_MTDRAM_TOTAL_SIZE=4096 CONFIG_MTDRAM_ERASE_SIZE=128 # CONFIG_MTD_BLKMTD is not set # # Disk-On-Chip Device Drivers # CONFIG_MTD_DOC2000=m # CONFIG_MTD_DOC2001 is not set CONFIG_MTD_DOC2001PLUS=m CONFIG_MTD_DOCPROBE=m CONFIG_MTD_DOCECC=m # CONFIG_MTD_DOCPROBE_ADVANCED is not set CONFIG_MTD_DOCPROBE_ADDRESS=0 # # NAND Flash Device Drivers # CONFIG_MTD_NAND=m # CONFIG_MTD_NAND_VERIFY_WRITE is not set CONFIG_MTD_NAND_IDS=m # CONFIG_MTD_NAND_DISKONCHIP is not set # # Parallel port support # CONFIG_PARPORT=m CONFIG_PARPORT_PC=m CONFIG_PARPORT_PC_CML1=m CONFIG_PARPORT_SERIAL=m # CONFIG_PARPORT_PC_FIFO is not set # CONFIG_PARPORT_PC_SUPERIO is not set CONFIG_PARPORT_PC_PCMCIA=m # CONFIG_PARPORT_OTHER is not set CONFIG_PARPORT_1284=y # # Plug and Play support # CONFIG_PNP=y # CONFIG_PNP_DEBUG is not set # # Protocols # # CONFIG_PNPACPI is not set # # Block devices # CONFIG_BLK_DEV_FD=m # CONFIG_PARIDE is not set CONFIG_BLK_CPQ_DA=m CONFIG_BLK_CPQ_CISS_DA=m CONFIG_CISS_SCSI_TAPE=y CONFIG_BLK_DEV_DAC960=m CONFIG_BLK_DEV_UMEM=m CONFIG_BLK_DEV_LOOP=m CONFIG_BLK_DEV_CRYPTOLOOP=m CONFIG_BLK_DEV_NBD=m CONFIG_BLK_DEV_SX8=m # CONFIG_BLK_DEV_UB is not set CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=16384 CONFIG_BLK_DEV_INITRD=y CONFIG_INITRAMFS_SOURCE="" CONFIG_LBD=y CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set # # IO Schedulers # CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y CONFIG_IOSCHED_CFQ=y # # ATA/ATAPI/MFM/RLL support # CONFIG_IDE=y CONFIG_BLK_DEV_IDE=y # # Please see Documentation/ide.txt for help/info on IDE drives # # CONFIG_BLK_DEV_IDE_SATA is not set # CONFIG_BLK_DEV_HD_IDE is not set CONFIG_BLK_DEV_IDEDISK=y CONFIG_IDEDISK_MULTI_MODE=y CONFIG_BLK_DEV_IDECS=m CONFIG_BLK_DEV_IDECD=y # CONFIG_BLK_DEV_IDETAPE is not set CONFIG_BLK_DEV_IDEFLOPPY=y CONFIG_BLK_DEV_IDESCSI=m # CONFIG_IDE_TASK_IOCTL is not set # # IDE chipset support/bugfixes # CONFIG_IDE_GENERIC=y # CONFIG_BLK_DEV_CMD640 is not set # CONFIG_BLK_DEV_IDEPNP is not set CONFIG_BLK_DEV_IDEPCI=y CONFIG_IDEPCI_SHARE_IRQ=y # CONFIG_BLK_DEV_OFFBOARD is not set CONFIG_BLK_DEV_GENERIC=y # CONFIG_BLK_DEV_OPTI621 is not set CONFIG_BLK_DEV_RZ1000=y CONFIG_BLK_DEV_IDEDMA_PCI=y # CONFIG_BLK_DEV_IDEDMA_FORCED is not set CONFIG_IDEDMA_PCI_AUTO=y # CONFIG_IDEDMA_ONLYDISK is not set CONFIG_BLK_DEV_AEC62XX=y CONFIG_BLK_DEV_ALI15X3=y # CONFIG_WDC_ALI15X3 is not set CONFIG_BLK_DEV_AMD74XX=y CONFIG_BLK_DEV_ATIIXP=y CONFIG_BLK_DEV_CMD64X=y CONFIG_BLK_DEV_TRIFLEX=y CONFIG_BLK_DEV_CY82C693=y CONFIG_BLK_DEV_CS5520=y CONFIG_BLK_DEV_CS5530=y CONFIG_BLK_DEV_HPT34X=y # CONFIG_HPT34X_AUTODMA is not set CONFIG_BLK_DEV_HPT366=y # CONFIG_BLK_DEV_SC1200 is not set CONFIG_BLK_DEV_PIIX=y # CONFIG_BLK_DEV_NS87415 is not set CONFIG_BLK_DEV_PDC202XX_OLD=y # CONFIG_PDC202XX_BURST is not set CONFIG_BLK_DEV_PDC202XX_NEW=y CONFIG_PDC202XX_FORCE=y CONFIG_BLK_DEV_SVWKS=y CONFIG_BLK_DEV_SIIMAGE=y CONFIG_BLK_DEV_SIS5513=y CONFIG_BLK_DEV_SLC90E66=y # CONFIG_BLK_DEV_TRM290 is not set CONFIG_BLK_DEV_VIA82CXXX=y # CONFIG_IDE_ARM is not set CONFIG_BLK_DEV_IDEDMA=y # CONFIG_IDEDMA_IVB is not set CONFIG_IDEDMA_AUTO=y # CONFIG_BLK_DEV_HD is not set # # SCSI device support # CONFIG_SCSI=m CONFIG_SCSI_PROC_FS=y # # SCSI support type (disk, tape, CD-ROM) # CONFIG_BLK_DEV_SD=m CONFIG_CHR_DEV_ST=m CONFIG_CHR_DEV_OSST=m CONFIG_BLK_DEV_SR=m CONFIG_BLK_DEV_SR_VENDOR=y CONFIG_CHR_DEV_SG=m # # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # # CONFIG_SCSI_MULTI_LUN is not set CONFIG_SCSI_CONSTANTS=y CONFIG_SCSI_LOGGING=y # # SCSI Transport Attributes # CONFIG_SCSI_SPI_ATTRS=m CONFIG_SCSI_FC_ATTRS=m # # SCSI low-level drivers # CONFIG_BLK_DEV_3W_XXXX_RAID=m CONFIG_SCSI_3W_9XXX=m CONFIG_SCSI_ACARD=m CONFIG_SCSI_AACRAID=m CONFIG_SCSI_AIC7XXX=m CONFIG_AIC7XXX_CMDS_PER_DEVICE=4 CONFIG_AIC7XXX_RESET_DELAY_MS=15000 # CONFIG_AIC7XXX_DEBUG_ENABLE is not set CONFIG_AIC7XXX_DEBUG_MASK=0 # CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set CONFIG_SCSI_AIC7XXX_OLD=m CONFIG_SCSI_AIC79XX=m CONFIG_AIC79XX_CMDS_PER_DEVICE=4 CONFIG_AIC79XX_RESET_DELAY_MS=15000 # CONFIG_AIC79XX_ENABLE_RD_STRM is not set # CONFIG_AIC79XX_DEBUG_ENABLE is not set CONFIG_AIC79XX_DEBUG_MASK=0 # CONFIG_AIC79XX_REG_PRETTY_PRINT is not set CONFIG_MEGARAID_NEWGEN=y CONFIG_MEGARAID_MM=m CONFIG_MEGARAID_MAILBOX=m CONFIG_SCSI_SATA=y CONFIG_SCSI_SATA_AHCI=m CONFIG_SCSI_SATA_SVW=m CONFIG_SCSI_ATA_PIIX=m CONFIG_SCSI_SATA_NV=m CONFIG_SCSI_SATA_PROMISE=m CONFIG_SCSI_SATA_SX4=m CONFIG_SCSI_SATA_SIL=m CONFIG_SCSI_SATA_SIS=m CONFIG_SCSI_SATA_ULI=m CONFIG_SCSI_SATA_VIA=m CONFIG_SCSI_SATA_VITESSE=m CONFIG_SCSI_BUSLOGIC=m # CONFIG_SCSI_OMIT_FLASHPOINT is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_EATA_PIO is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set CONFIG_SCSI_GDTH=m CONFIG_SCSI_IPS=m CONFIG_SCSI_INITIO=m CONFIG_SCSI_INIA100=m CONFIG_SCSI_PPA=m CONFIG_SCSI_IMM=m # CONFIG_SCSI_IZIP_EPP16 is not set # CONFIG_SCSI_IZIP_SLOW_CTR is not set CONFIG_SCSI_SYM53C8XX_2=m CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set # CONFIG_SCSI_IPR is not set CONFIG_SCSI_QLOGIC_ISP=m # CONFIG_SCSI_QLOGIC_FC is not set CONFIG_SCSI_QLOGIC_1280=m CONFIG_SCSI_QLOGIC_1280_1040=y CONFIG_SCSI_QLA2XXX=m CONFIG_SCSI_QLA21XX=m CONFIG_SCSI_QLA22XX=m CONFIG_SCSI_QLA2300=m CONFIG_SCSI_QLA2322=m CONFIG_SCSI_QLA6312=m CONFIG_SCSI_QLA6322=m # CONFIG_SCSI_DC395x is not set CONFIG_SCSI_DC390T=m # CONFIG_SCSI_DEBUG is not set # # PCMCIA SCSI adapter support # CONFIG_PCMCIA_FDOMAIN=m CONFIG_PCMCIA_QLOGIC=m CONFIG_PCMCIA_SYM53C500=m # # Multi-device support (RAID and LVM) # CONFIG_MD=y CONFIG_BLK_DEV_MD=y CONFIG_MD_LINEAR=m CONFIG_MD_RAID0=m CONFIG_MD_RAID1=m CONFIG_MD_RAID10=m CONFIG_MD_RAID5=m CONFIG_MD_RAID6=m CONFIG_MD_MULTIPATH=m # CONFIG_MD_FAULTY is not set CONFIG_BLK_DEV_DM=m CONFIG_DM_CRYPT=m CONFIG_DM_SNAPSHOT=m CONFIG_DM_MIRROR=m CONFIG_DM_ZERO=m # # Fusion MPT device support # CONFIG_FUSION=m CONFIG_FUSION_MAX_SGE=40 CONFIG_FUSION_CTL=m CONFIG_FUSION_LAN=m # # IEEE 1394 (FireWire) support # CONFIG_IEEE1394=m # # Subsystem Options # # CONFIG_IEEE1394_VERBOSEDEBUG is not set CONFIG_IEEE1394_OUI_DB=y # CONFIG_IEEE1394_EXTRA_CONFIG_ROMS is not set # # Device Drivers # # CONFIG_IEEE1394_PCILYNX is not set CONFIG_IEEE1394_OHCI1394=m # # Protocol Drivers # CONFIG_IEEE1394_VIDEO1394=m CONFIG_IEEE1394_SBP2=m # CONFIG_IEEE1394_SBP2_PHYS_DMA is not set # CONFIG_IEEE1394_ETH1394 is not set CONFIG_IEEE1394_DV1394=m CONFIG_IEEE1394_RAWIO=m CONFIG_IEEE1394_CMP=m CONFIG_IEEE1394_AMDTP=m # # I2O device support # CONFIG_I2O=m CONFIG_I2O_CONFIG=m CONFIG_I2O_BLOCK=m CONFIG_I2O_SCSI=m CONFIG_I2O_PROC=m # # Networking support # CONFIG_NET=y # # Networking options # CONFIG_PACKET=y CONFIG_PACKET_MMAP=y CONFIG_NETLINK_DEV=y CONFIG_UNIX=y CONFIG_NET_KEY=m CONFIG_INET=y CONFIG_IP_MULTICAST=y CONFIG_IP_ADVANCED_ROUTER=y CONFIG_IP_MULTIPLE_TABLES=y CONFIG_IP_ROUTE_FWMARK=y CONFIG_IP_ROUTE_MULTIPATH=y CONFIG_IP_ROUTE_VERBOSE=y # CONFIG_IP_PNP is not set CONFIG_NET_IPIP=m CONFIG_NET_IPGRE=m CONFIG_NET_IPGRE_BROADCAST=y CONFIG_IP_MROUTE=y CONFIG_IP_PIMSM_V1=y CONFIG_IP_PIMSM_V2=y # CONFIG_ARPD is not set CONFIG_SYN_COOKIES=y CONFIG_INET_AH=m CONFIG_INET_ESP=m CONFIG_INET_IPCOMP=m CONFIG_INET_TUNNEL=m CONFIG_IP_TCPDIAG=m CONFIG_IP_TCPDIAG_IPV6=y # # IP: Virtual Server Configuration # CONFIG_IP_VS=m # CONFIG_IP_VS_DEBUG is not set CONFIG_IP_VS_TAB_BITS=12 # # IPVS transport protocol load balancing support # CONFIG_IP_VS_PROTO_TCP=y CONFIG_IP_VS_PROTO_UDP=y CONFIG_IP_VS_PROTO_ESP=y CONFIG_IP_VS_PROTO_AH=y # # IPVS scheduler # CONFIG_IP_VS_RR=m CONFIG_IP_VS_WRR=m CONFIG_IP_VS_LC=m CONFIG_IP_VS_WLC=m CONFIG_IP_VS_LBLC=m CONFIG_IP_VS_LBLCR=m CONFIG_IP_VS_DH=m CONFIG_IP_VS_SH=m CONFIG_IP_VS_SED=m CONFIG_IP_VS_NQ=m # # IPVS application helper # CONFIG_IP_VS_FTP=m CONFIG_IPV6=m CONFIG_IPV6_PRIVACY=y CONFIG_INET6_AH=m CONFIG_INET6_ESP=m CONFIG_INET6_IPCOMP=m CONFIG_INET6_TUNNEL=m CONFIG_IPV6_TUNNEL=m CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set CONFIG_BRIDGE_NETFILTER=y # # IP: Netfilter Configuration # CONFIG_IP_NF_CONNTRACK=m CONFIG_IP_NF_CT_ACCT=y CONFIG_IP_NF_CONNTRACK_MARK=y CONFIG_IP_NF_CT_PROTO_SCTP=m CONFIG_IP_NF_FTP=m CONFIG_IP_NF_IRC=m CONFIG_IP_NF_TFTP=m CONFIG_IP_NF_AMANDA=m CONFIG_IP_NF_QUEUE=m CONFIG_IP_NF_IPTABLES=m CONFIG_IP_NF_MATCH_LIMIT=m CONFIG_IP_NF_MATCH_IPRANGE=m CONFIG_IP_NF_MATCH_MAC=m CONFIG_IP_NF_MATCH_PKTTYPE=m CONFIG_IP_NF_MATCH_MARK=m CONFIG_IP_NF_MATCH_MULTIPORT=m CONFIG_IP_NF_MATCH_TOS=m CONFIG_IP_NF_MATCH_RECENT=m CONFIG_IP_NF_MATCH_ECN=m CONFIG_IP_NF_MATCH_DSCP=m CONFIG_IP_NF_MATCH_AH_ESP=m CONFIG_IP_NF_MATCH_LENGTH=m CONFIG_IP_NF_MATCH_TTL=m CONFIG_IP_NF_MATCH_TCPMSS=m CONFIG_IP_NF_MATCH_HELPER=m CONFIG_IP_NF_MATCH_STATE=m CONFIG_IP_NF_MATCH_CONNTRACK=m CONFIG_IP_NF_MATCH_OWNER=m CONFIG_IP_NF_MATCH_PHYSDEV=m CONFIG_IP_NF_MATCH_ADDRTYPE=m CONFIG_IP_NF_MATCH_REALM=m CONFIG_IP_NF_MATCH_SCTP=m CONFIG_IP_NF_MATCH_COMMENT=m CONFIG_IP_NF_MATCH_CONNMARK=m CONFIG_IP_NF_MATCH_HASHLIMIT=m CONFIG_IP_NF_FILTER=m CONFIG_IP_NF_TARGET_REJECT=m CONFIG_IP_NF_TARGET_LOG=m CONFIG_IP_NF_TARGET_ULOG=m CONFIG_IP_NF_TARGET_TCPMSS=m CONFIG_IP_NF_NAT=m CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m CONFIG_IP_NF_NAT_LOCAL=y CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m CONFIG_IP_NF_NAT_TFTP=m CONFIG_IP_NF_NAT_AMANDA=m CONFIG_IP_NF_MANGLE=m CONFIG_IP_NF_TARGET_TOS=m CONFIG_IP_NF_TARGET_ECN=m CONFIG_IP_NF_TARGET_DSCP=m CONFIG_IP_NF_TARGET_MARK=m CONFIG_IP_NF_TARGET_CLASSIFY=m CONFIG_IP_NF_TARGET_CONNMARK=m CONFIG_IP_NF_TARGET_CLUSTERIP=m CONFIG_IP_NF_RAW=m CONFIG_IP_NF_TARGET_NOTRACK=m CONFIG_IP_NF_ARPTABLES=m CONFIG_IP_NF_ARPFILTER=m CONFIG_IP_NF_ARP_MANGLE=m # CONFIG_IP_NF_COMPAT_IPCHAINS is not set # CONFIG_IP_NF_COMPAT_IPFWADM is not set # # IPv6: Netfilter Configuration # # CONFIG_IP6_NF_QUEUE is not set CONFIG_IP6_NF_IPTABLES=m CONFIG_IP6_NF_MATCH_LIMIT=m CONFIG_IP6_NF_MATCH_MAC=m CONFIG_IP6_NF_MATCH_RT=m CONFIG_IP6_NF_MATCH_OPTS=m CONFIG_IP6_NF_MATCH_FRAG=m CONFIG_IP6_NF_MATCH_HL=m CONFIG_IP6_NF_MATCH_MULTIPORT=m CONFIG_IP6_NF_MATCH_OWNER=m CONFIG_IP6_NF_MATCH_MARK=m CONFIG_IP6_NF_MATCH_IPV6HEADER=m CONFIG_IP6_NF_MATCH_AHESP=m CONFIG_IP6_NF_MATCH_LENGTH=m CONFIG_IP6_NF_MATCH_EUI64=m CONFIG_IP6_NF_MATCH_PHYSDEV=m CONFIG_IP6_NF_FILTER=m CONFIG_IP6_NF_TARGET_LOG=m CONFIG_IP6_NF_MANGLE=m CONFIG_IP6_NF_TARGET_MARK=m CONFIG_IP6_NF_RAW=m # # Bridge: Netfilter Configuration # CONFIG_BRIDGE_NF_EBTABLES=m CONFIG_BRIDGE_EBT_BROUTE=m CONFIG_BRIDGE_EBT_T_FILTER=m CONFIG_BRIDGE_EBT_T_NAT=m CONFIG_BRIDGE_EBT_802_3=m CONFIG_BRIDGE_EBT_AMONG=m CONFIG_BRIDGE_EBT_ARP=m CONFIG_BRIDGE_EBT_IP=m CONFIG_BRIDGE_EBT_LIMIT=m CONFIG_BRIDGE_EBT_MARK=m CONFIG_BRIDGE_EBT_PKTTYPE=m CONFIG_BRIDGE_EBT_STP=m CONFIG_BRIDGE_EBT_VLAN=m CONFIG_BRIDGE_EBT_ARPREPLY=m CONFIG_BRIDGE_EBT_DNAT=m CONFIG_BRIDGE_EBT_MARK_T=m CONFIG_BRIDGE_EBT_REDIRECT=m CONFIG_BRIDGE_EBT_SNAT=m CONFIG_BRIDGE_EBT_LOG=m CONFIG_XFRM=y CONFIG_XFRM_USER=y # # SCTP Configuration (EXPERIMENTAL) # CONFIG_IP_SCTP=m # CONFIG_SCTP_DBG_MSG is not set # CONFIG_SCTP_DBG_OBJCNT is not set # CONFIG_SCTP_HMAC_NONE is not set # CONFIG_SCTP_HMAC_SHA1 is not set CONFIG_SCTP_HMAC_MD5=y CONFIG_ATM=m CONFIG_ATM_CLIP=m # CONFIG_ATM_CLIP_NO_ICMP is not set CONFIG_ATM_LANE=m # CONFIG_ATM_MPOA is not set CONFIG_ATM_BR2684=m # CONFIG_ATM_BR2684_IPFILTER is not set CONFIG_BRIDGE=m CONFIG_VLAN_8021Q=m # CONFIG_DECNET is not set CONFIG_LLC=y # CONFIG_LLC2 is not set CONFIG_IPX=m # CONFIG_IPX_INTERN is not set CONFIG_ATALK=m CONFIG_DEV_APPLETALK=y CONFIG_IPDDP=m CONFIG_IPDDP_ENCAP=y CONFIG_IPDDP_DECAP=y # CONFIG_X25 is not set # CONFIG_LAPB is not set CONFIG_NET_DIVERT=y # CONFIG_ECONET is not set CONFIG_WAN_ROUTER=m # # QoS and/or fair queueing # CONFIG_NET_SCHED=y CONFIG_NET_SCH_CLK_JIFFIES=y # CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set # CONFIG_NET_SCH_CLK_CPU is not set CONFIG_NET_SCH_CBQ=m CONFIG_NET_SCH_HTB=m CONFIG_NET_SCH_HFSC=m CONFIG_NET_SCH_ATM=m CONFIG_NET_SCH_PRIO=m CONFIG_NET_SCH_RED=m CONFIG_NET_SCH_SFQ=m CONFIG_NET_SCH_TEQL=m CONFIG_NET_SCH_TBF=m CONFIG_NET_SCH_GRED=m CONFIG_NET_SCH_DSMARK=m CONFIG_NET_SCH_NETEM=m CONFIG_NET_SCH_INGRESS=m CONFIG_NET_QOS=y CONFIG_NET_ESTIMATOR=y CONFIG_NET_CLS=y CONFIG_NET_CLS_TCINDEX=m CONFIG_NET_CLS_ROUTE4=m CONFIG_NET_CLS_ROUTE=y CONFIG_NET_CLS_FW=m CONFIG_NET_CLS_U32=m CONFIG_CLS_U32_PERF=y CONFIG_NET_CLS_IND=y CONFIG_NET_CLS_RSVP=m CONFIG_NET_CLS_RSVP6=m # CONFIG_NET_CLS_ACT is not set CONFIG_NET_CLS_POLICE=y # # Network testing # # CONFIG_NET_PKTGEN is not set CONFIG_NETPOLL=y # CONFIG_NETPOLL_RX is not set CONFIG_NETPOLL_TRAP=y CONFIG_NET_POLL_CONTROLLER=y # CONFIG_HAMRADIO is not set CONFIG_IRDA=m # # IrDA protocols # CONFIG_IRLAN=m CONFIG_IRNET=m CONFIG_IRCOMM=m # CONFIG_IRDA_ULTRA is not set # # IrDA options # CONFIG_IRDA_CACHE_LAST_LSAP=y CONFIG_IRDA_FAST_RR=y # CONFIG_IRDA_DEBUG is not set # # Infrared-port device drivers # # # SIR device drivers # CONFIG_IRTTY_SIR=m # # Dongle support # CONFIG_DONGLE=y CONFIG_ESI_DONGLE=m CONFIG_ACTISYS_DONGLE=m CONFIG_TEKRAM_DONGLE=m CONFIG_LITELINK_DONGLE=m CONFIG_MA600_DONGLE=m CONFIG_GIRBIL_DONGLE=m CONFIG_MCP2120_DONGLE=m CONFIG_OLD_BELKIN_DONGLE=m CONFIG_ACT200L_DONGLE=m # # Old SIR device drivers # CONFIG_IRPORT_SIR=m # # Old Serial dongle support # # CONFIG_DONGLE_OLD is not set # # FIR device drivers # CONFIG_USB_IRDA=m CONFIG_SIGMATEL_FIR=m # CONFIG_VLSI_FIR is not set CONFIG_BT=m CONFIG_BT_L2CAP=m CONFIG_BT_SCO=m CONFIG_BT_RFCOMM=m CONFIG_BT_RFCOMM_TTY=y CONFIG_BT_BNEP=m CONFIG_BT_BNEP_MC_FILTER=y CONFIG_BT_BNEP_PROTO_FILTER=y CONFIG_BT_CMTP=m CONFIG_BT_HIDP=m # # Bluetooth device drivers # CONFIG_BT_HCIUSB=m CONFIG_BT_HCIUSB_SCO=y CONFIG_BT_HCIUART=m CONFIG_BT_HCIUART_H4=y CONFIG_BT_HCIUART_BCSP=y CONFIG_BT_HCIUART_BCSP_TXCRC=y CONFIG_BT_HCIBCM203X=m CONFIG_BT_HCIBFUSB=m CONFIG_BT_HCIDTL1=m CONFIG_BT_HCIBT3C=m CONFIG_BT_HCIBLUECARD=m CONFIG_BT_HCIBTUART=m CONFIG_BT_HCIVHCI=m CONFIG_NETDEVICES=y CONFIG_DUMMY=m CONFIG_BONDING=m CONFIG_EQUALIZER=m CONFIG_TUN=m CONFIG_ETHERTAP=m CONFIG_NET_SB1000=m # # ARCnet devices # # CONFIG_ARCNET is not set # # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y CONFIG_MII=m CONFIG_HAPPYMEAL=m CONFIG_SUNGEM=m CONFIG_NET_VENDOR_3COM=y CONFIG_VORTEX=m CONFIG_TYPHOON=m # # Tulip family network device support # CONFIG_NET_TULIP=y CONFIG_DE2104X=m CONFIG_TULIP=m # CONFIG_TULIP_MWI is not set CONFIG_TULIP_MMIO=y # CONFIG_TULIP_NAPI is not set CONFIG_DE4X5=m CONFIG_WINBOND_840=m CONFIG_DM9102=m CONFIG_PCMCIA_XIRCOM=m CONFIG_PCMCIA_XIRTULIP=m # CONFIG_HP100 is not set CONFIG_NET_PCI=y CONFIG_PCNET32=m CONFIG_AMD8111_ETH=m CONFIG_AMD8111E_NAPI=y CONFIG_ADAPTEC_STARFIRE=m CONFIG_ADAPTEC_STARFIRE_NAPI=y CONFIG_B44=m CONFIG_FORCEDETH=m CONFIG_DGRS=m CONFIG_EEPRO100=m # CONFIG_EEPRO100_PIO is not set CONFIG_E100=m CONFIG_E100_NAPI=y CONFIG_FEALNX=m CONFIG_NATSEMI=m CONFIG_NE2K_PCI=m CONFIG_8139CP=m CONFIG_8139TOO=m CONFIG_8139TOO_PIO=y # CONFIG_8139TOO_TUNE_TWISTER is not set CONFIG_8139TOO_8129=y # CONFIG_8139_OLD_RX_RESET is not set CONFIG_SIS900=m CONFIG_EPIC100=m CONFIG_SUNDANCE=m # CONFIG_SUNDANCE_MMIO is not set CONFIG_VIA_RHINE=m CONFIG_VIA_RHINE_MMIO=y # # Ethernet (1000 Mbit) # CONFIG_ACENIC=m # CONFIG_ACENIC_OMIT_TIGON_I is not set CONFIG_DL2K=m CONFIG_E1000=m CONFIG_E1000_NAPI=y CONFIG_NS83820=m CONFIG_HAMACHI=m CONFIG_YELLOWFIN=m CONFIG_R8169=m CONFIG_R8169_NAPI=y CONFIG_SK98LIN=m CONFIG_VIA_VELOCITY=m CONFIG_TIGON3=m # # Ethernet (10000 Mbit) # CONFIG_IXGB=m CONFIG_IXGB_NAPI=y CONFIG_S2IO=m CONFIG_S2IO_NAPI=y # # Token Ring devices # CONFIG_TR=y CONFIG_IBMOL=m CONFIG_3C359=m CONFIG_TMS380TR=m CONFIG_TMSPCI=m CONFIG_ABYSS=m # # Wireless LAN (non-hamradio) # CONFIG_NET_RADIO=y # # Obsolete Wireless cards support (pre-802.11) # # CONFIG_STRIP is not set CONFIG_PCMCIA_WAVELAN=m CONFIG_PCMCIA_NETWAVE=m # # Wireless 802.11 Frequency Hopping cards support # CONFIG_PCMCIA_RAYCS=m # # Wireless 802.11b ISA/PCI cards support # CONFIG_HERMES=m CONFIG_PLX_HERMES=m CONFIG_TMD_HERMES=m CONFIG_PCI_HERMES=m CONFIG_ATMEL=m CONFIG_PCI_ATMEL=m # # Wireless 802.11b Pcmcia/Cardbus cards support # CONFIG_PCMCIA_HERMES=m CONFIG_AIRO_CS=m CONFIG_PCMCIA_ATMEL=m CONFIG_PCMCIA_WL3501=m # # Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support # CONFIG_PRISM54=m CONFIG_NET_WIRELESS=y # # PCMCIA network device support # CONFIG_NET_PCMCIA=y CONFIG_PCMCIA_3C589=m CONFIG_PCMCIA_3C574=m CONFIG_PCMCIA_FMVJ18X=m CONFIG_PCMCIA_PCNET=m CONFIG_PCMCIA_NMCLAN=m CONFIG_PCMCIA_SMC91C92=m CONFIG_PCMCIA_XIRC2PS=m CONFIG_PCMCIA_AXNET=m # # Wan interfaces # # CONFIG_WAN is not set # # ATM drivers # CONFIG_ATM_TCP=m CONFIG_ATM_LANAI=m CONFIG_ATM_ENI=m # CONFIG_ATM_ENI_DEBUG is not set # CONFIG_ATM_ENI_TUNE_BURST is not set CONFIG_ATM_FIRESTREAM=m # CONFIG_ATM_ZATM is not set CONFIG_ATM_IDT77252=m # CONFIG_ATM_IDT77252_DEBUG is not set # CONFIG_ATM_IDT77252_RCV_ALL is not set CONFIG_ATM_IDT77252_USE_SUNI=y CONFIG_ATM_AMBASSADOR=m # CONFIG_ATM_AMBASSADOR_DEBUG is not set CONFIG_ATM_HORIZON=m # CONFIG_ATM_HORIZON_DEBUG is not set CONFIG_ATM_FORE200E_MAYBE=m # CONFIG_ATM_FORE200E_PCA is not set CONFIG_ATM_HE=m # CONFIG_ATM_HE_USE_SUNI is not set CONFIG_FDDI=y # CONFIG_DEFXX is not set CONFIG_SKFP=m # CONFIG_HIPPI is not set CONFIG_PLIP=m CONFIG_PPP=m CONFIG_PPP_MULTILINK=y CONFIG_PPP_FILTER=y CONFIG_PPP_ASYNC=m CONFIG_PPP_SYNC_TTY=m CONFIG_PPP_DEFLATE=m # CONFIG_PPP_BSDCOMP is not set CONFIG_PPPOE=m CONFIG_PPPOATM=m CONFIG_SLIP=m CONFIG_SLIP_COMPRESSED=y CONFIG_SLIP_SMART=y # CONFIG_SLIP_MODE_SLIP6 is not set CONFIG_NET_FC=y # CONFIG_SHAPER is not set CONFIG_NETCONSOLE=m # # ISDN subsystem # CONFIG_ISDN=m # # Old ISDN4Linux # CONFIG_ISDN_I4L=m CONFIG_ISDN_PPP=y CONFIG_ISDN_PPP_VJ=y CONFIG_ISDN_MPP=y CONFIG_IPPP_FILTER=y # CONFIG_ISDN_PPP_BSDCOMP is not set CONFIG_ISDN_AUDIO=y CONFIG_ISDN_TTY_FAX=y # # ISDN feature submodules # CONFIG_ISDN_DRV_LOOP=m CONFIG_ISDN_DIVERSION=m # # ISDN4Linux hardware drivers # # # Passive cards # CONFIG_ISDN_DRV_HISAX=m # # D-channel protocol features # CONFIG_HISAX_EURO=y CONFIG_DE_AOC=y CONFIG_HISAX_NO_SENDCOMPLETE=y CONFIG_HISAX_NO_LLC=y CONFIG_HISAX_NO_KEYPAD=y CONFIG_HISAX_1TR6=y CONFIG_HISAX_NI1=y CONFIG_HISAX_MAX_CARDS=8 # # HiSax supported cards # CONFIG_HISAX_16_3=y CONFIG_HISAX_TELESPCI=y CONFIG_HISAX_S0BOX=y CONFIG_HISAX_FRITZPCI=y CONFIG_HISAX_AVM_A1_PCMCIA=y CONFIG_HISAX_ELSA=y CONFIG_HISAX_DIEHLDIVA=y CONFIG_HISAX_SEDLBAUER=y CONFIG_HISAX_NETJET=y CONFIG_HISAX_NETJET_U=y CONFIG_HISAX_NICCY=y CONFIG_HISAX_BKM_A4T=y CONFIG_HISAX_SCT_QUADRO=y CONFIG_HISAX_GAZEL=y CONFIG_HISAX_HFC_PCI=y CONFIG_HISAX_W6692=y CONFIG_HISAX_HFC_SX=y CONFIG_HISAX_ENTERNOW_PCI=y # CONFIG_HISAX_DEBUG is not set # # HiSax PCMCIA card service modules # CONFIG_HISAX_SEDLBAUER_CS=m CONFIG_HISAX_ELSA_CS=m CONFIG_HISAX_AVM_A1_CS=m CONFIG_HISAX_TELES_CS=m # # HiSax sub driver modules # CONFIG_HISAX_ST5481=m CONFIG_HISAX_HFCUSB=m CONFIG_HISAX_FRITZ_PCIPNP=m CONFIG_HISAX_HDLC=y # # Active cards # CONFIG_ISDN_DRV_TPAM=m CONFIG_HYSDN=m CONFIG_HYSDN_CAPI=y # # CAPI subsystem # CONFIG_ISDN_CAPI=m CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON=y CONFIG_ISDN_CAPI_MIDDLEWARE=y CONFIG_ISDN_CAPI_CAPI20=m CONFIG_ISDN_CAPI_CAPIFS_BOOL=y CONFIG_ISDN_CAPI_CAPIFS=m CONFIG_ISDN_CAPI_CAPIDRV=m # # CAPI hardware drivers # # # Active AVM cards # CONFIG_CAPI_AVM=y CONFIG_ISDN_DRV_AVMB1_B1PCI=m CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y CONFIG_ISDN_DRV_AVMB1_B1PCMCIA=m CONFIG_ISDN_DRV_AVMB1_AVM_CS=m CONFIG_ISDN_DRV_AVMB1_T1PCI=m CONFIG_ISDN_DRV_AVMB1_C4=m # # Active Eicon DIVA Server cards # # CONFIG_CAPI_EICON is not set # # Telephony Support # # CONFIG_PHONE is not set # # Input device support # CONFIG_INPUT=y # # Userland interfaces # CONFIG_INPUT_MOUSEDEV=y # CONFIG_INPUT_MOUSEDEV_PSAUX is not set CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 CONFIG_INPUT_JOYDEV=m # CONFIG_INPUT_TSDEV is not set CONFIG_INPUT_EVDEV=y # CONFIG_INPUT_EVBUG is not set # # Input I/O drivers # CONFIG_GAMEPORT=m CONFIG_SOUND_GAMEPORT=m CONFIG_GAMEPORT_NS558=m CONFIG_GAMEPORT_L4=m CONFIG_GAMEPORT_EMU10K1=m CONFIG_GAMEPORT_VORTEX=m CONFIG_GAMEPORT_FM801=m CONFIG_GAMEPORT_CS461x=m CONFIG_SERIO=y CONFIG_SERIO_I8042=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PARKBD is not set # CONFIG_SERIO_PCIPS2 is not set # CONFIG_SERIO_RAW is not set # # Input Device Drivers # CONFIG_INPUT_KEYBOARD=y CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_SUNKBD is not set # CONFIG_KEYBOARD_LKKBD is not set # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_NEWTON is not set CONFIG_INPUT_MOUSE=y CONFIG_MOUSE_PS2=y CONFIG_MOUSE_SERIAL=m CONFIG_MOUSE_VSXXXAA=m CONFIG_INPUT_JOYSTICK=y CONFIG_JOYSTICK_ANALOG=m CONFIG_JOYSTICK_A3D=m CONFIG_JOYSTICK_ADI=m CONFIG_JOYSTICK_COBRA=m CONFIG_JOYSTICK_GF2K=m CONFIG_JOYSTICK_GRIP=m CONFIG_JOYSTICK_GRIP_MP=m CONFIG_JOYSTICK_GUILLEMOT=m CONFIG_JOYSTICK_INTERACT=m CONFIG_JOYSTICK_SIDEWINDER=m CONFIG_JOYSTICK_TMDC=m CONFIG_JOYSTICK_IFORCE=m CONFIG_JOYSTICK_IFORCE_USB=y CONFIG_JOYSTICK_IFORCE_232=y CONFIG_JOYSTICK_WARRIOR=m CONFIG_JOYSTICK_MAGELLAN=m CONFIG_JOYSTICK_SPACEORB=m CONFIG_JOYSTICK_SPACEBALL=m CONFIG_JOYSTICK_STINGER=m CONFIG_JOYSTICK_TWIDDLER=m CONFIG_JOYSTICK_DB9=m CONFIG_JOYSTICK_GAMECON=m CONFIG_JOYSTICK_TURBOGRAFX=m CONFIG_JOYSTICK_JOYDUMP=m CONFIG_INPUT_TOUCHSCREEN=y CONFIG_TOUCHSCREEN_GUNZE=m CONFIG_INPUT_MISC=y CONFIG_INPUT_PCSPKR=m CONFIG_INPUT_UINPUT=m # # Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_HW_CONSOLE=y CONFIG_SERIAL_NONSTANDARD=y # CONFIG_COMPUTONE is not set CONFIG_ROCKETPORT=m # CONFIG_CYCLADES is not set # CONFIG_DIGIEPCA is not set # CONFIG_DIGI is not set # CONFIG_MOXA_INTELLIO is not set # CONFIG_MOXA_SMARTIO is not set # CONFIG_ISI is not set # CONFIG_SYNCLINK is not set # CONFIG_SYNCLINKMP is not set CONFIG_N_HDLC=m # CONFIG_RISCOM8 is not set # CONFIG_SPECIALIX is not set # CONFIG_SX is not set # CONFIG_RIO is not set CONFIG_STALDRV=y # CONFIG_STALLION is not set # CONFIG_ISTALLION is not set # # Serial drivers # CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_CS=m # CONFIG_SERIAL_8250_ACPI is not set CONFIG_SERIAL_8250_NR_UARTS=4 CONFIG_SERIAL_8250_EXTENDED=y # CONFIG_SERIAL_8250_MANY_PORTS is not set CONFIG_SERIAL_8250_SHARE_IRQ=y CONFIG_SERIAL_8250_DETECT_IRQ=y CONFIG_SERIAL_8250_MULTIPORT=y CONFIG_SERIAL_8250_RSA=y # # Non-8250 serial port support # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y # CONFIG_LEGACY_PTYS is not set CONFIG_PRINTER=m CONFIG_LP_CONSOLE=y CONFIG_PPDEV=m CONFIG_TIPAR=m # # IPMI # CONFIG_IPMI_HANDLER=m # CONFIG_IPMI_PANIC_EVENT is not set CONFIG_IPMI_DEVICE_INTERFACE=m CONFIG_IPMI_SI=m CONFIG_IPMI_WATCHDOG=m CONFIG_IPMI_POWEROFF=m # # Watchdog Cards # CONFIG_WATCHDOG=y # CONFIG_WATCHDOG_NOWAYOUT is not set # # Watchdog Device Drivers # CONFIG_SOFT_WATCHDOG=m CONFIG_ACQUIRE_WDT=m CONFIG_ADVANTECH_WDT=m CONFIG_ALIM1535_WDT=m CONFIG_ALIM7101_WDT=m CONFIG_SC520_WDT=m CONFIG_EUROTECH_WDT=m CONFIG_IB700_WDT=m CONFIG_WAFER_WDT=m CONFIG_I8XX_TCO=m CONFIG_SC1200_WDT=m # CONFIG_SCx200_WDT is not set # CONFIG_60XX_WDT is not set CONFIG_CPU5_WDT=m CONFIG_W83627HF_WDT=m CONFIG_W83877F_WDT=m CONFIG_MACHZ_WDT=m # # PCI-based Watchdog Cards # CONFIG_PCIPCWATCHDOG=m CONFIG_WDTPCI=m CONFIG_WDT_501_PCI=y # # USB-based Watchdog Cards # CONFIG_USBPCWATCHDOG=m CONFIG_HW_RANDOM=m # CONFIG_NVRAM is not set CONFIG_RTC=y CONFIG_DTLK=m CONFIG_R3964=m # CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # # CONFIG_FTAPE is not set CONFIG_AGP=y CONFIG_AGP_AMD64=y CONFIG_AGP_INTEL_MCH=y CONFIG_DRM=y CONFIG_DRM_TDFX=m CONFIG_DRM_R128=m CONFIG_DRM_RADEON=m CONFIG_DRM_SIS=m # # PCMCIA character devices # CONFIG_SYNCLINK_CS=m CONFIG_MWAVE=m # CONFIG_RAW_DRIVER is not set # CONFIG_HPET is not set CONFIG_HANGCHECK_TIMER=m # # I2C support # CONFIG_I2C=m CONFIG_I2C_CHARDEV=m # # I2C Algorithms # CONFIG_I2C_ALGOBIT=m CONFIG_I2C_ALGOPCF=m CONFIG_I2C_ALGOPCA=m # # I2C Hardware Bus support # CONFIG_I2C_ALI1535=m CONFIG_I2C_ALI1563=m CONFIG_I2C_ALI15X3=m CONFIG_I2C_AMD756=m CONFIG_I2C_AMD756_S4882=m CONFIG_I2C_AMD8111=m CONFIG_I2C_I801=m CONFIG_I2C_I810=m CONFIG_I2C_ISA=m CONFIG_I2C_NFORCE2=m # CONFIG_I2C_PARPORT is not set # CONFIG_I2C_PARPORT_LIGHT is not set CONFIG_I2C_PROSAVAGE=m CONFIG_I2C_SAVAGE4=m # CONFIG_SCx200_ACB is not set CONFIG_I2C_SIS5595=m CONFIG_I2C_SIS630=m CONFIG_I2C_SIS96X=m CONFIG_I2C_STUB=m CONFIG_I2C_VIA=m CONFIG_I2C_VIAPRO=m CONFIG_I2C_VOODOO3=m CONFIG_I2C_PCA_ISA=m # # Hardware Sensors Chip support # CONFIG_I2C_SENSOR=m CONFIG_SENSORS_ADM1021=m CONFIG_SENSORS_ADM1025=m CONFIG_SENSORS_ADM1026=m CONFIG_SENSORS_ADM1031=m CONFIG_SENSORS_ASB100=m CONFIG_SENSORS_DS1621=m CONFIG_SENSORS_FSCHER=m CONFIG_SENSORS_GL518SM=m CONFIG_SENSORS_IT87=m CONFIG_SENSORS_LM63=m CONFIG_SENSORS_LM75=m CONFIG_SENSORS_LM77=m CONFIG_SENSORS_LM78=m CONFIG_SENSORS_LM80=m CONFIG_SENSORS_LM83=m CONFIG_SENSORS_LM85=m CONFIG_SENSORS_LM87=m CONFIG_SENSORS_LM90=m CONFIG_SENSORS_MAX1619=m CONFIG_SENSORS_PC87360=m CONFIG_SENSORS_SMSC47M1=m CONFIG_SENSORS_VIA686A=m CONFIG_SENSORS_W83781D=m CONFIG_SENSORS_W83L785TS=m CONFIG_SENSORS_W83627HF=m # # Other I2C Chip support # CONFIG_SENSORS_EEPROM=m CONFIG_SENSORS_PCF8574=m CONFIG_SENSORS_PCF8591=m CONFIG_SENSORS_RTC8564=m # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set # CONFIG_I2C_DEBUG_CHIP is not set # # Dallas's 1-wire bus # # CONFIG_W1 is not set # # Misc devices # # CONFIG_IBM_ASM is not set # # Multimedia devices # CONFIG_VIDEO_DEV=m # # Video For Linux # # # Video Adapters # CONFIG_VIDEO_BT848=m CONFIG_VIDEO_BWQCAM=m CONFIG_VIDEO_CQCAM=m CONFIG_VIDEO_W9966=m CONFIG_VIDEO_CPIA=m CONFIG_VIDEO_CPIA_PP=m CONFIG_VIDEO_CPIA_USB=m CONFIG_VIDEO_SAA5246A=m CONFIG_VIDEO_SAA5249=m CONFIG_TUNER_3036=m CONFIG_VIDEO_STRADIS=m CONFIG_VIDEO_ZORAN=m CONFIG_VIDEO_ZORAN_BUZ=m CONFIG_VIDEO_ZORAN_DC10=m CONFIG_VIDEO_ZORAN_DC30=m CONFIG_VIDEO_ZORAN_LML33=m CONFIG_VIDEO_ZORAN_LML33R10=m CONFIG_VIDEO_SAA7134=m CONFIG_VIDEO_MXB=m CONFIG_VIDEO_DPC=m CONFIG_VIDEO_HEXIUM_ORION=m CONFIG_VIDEO_HEXIUM_GEMINI=m CONFIG_VIDEO_CX88=m CONFIG_VIDEO_OVCAMCHIP=m # # Radio Adapters # CONFIG_RADIO_GEMTEK_PCI=m CONFIG_RADIO_MAXIRADIO=m CONFIG_RADIO_MAESTRO=m # # Digital Video Broadcasting Devices # CONFIG_DVB=y CONFIG_DVB_CORE=m # # Supported SAA7146 based PCI Adapters # CONFIG_DVB_AV7110=m # CONFIG_DVB_AV7110_FIRMWARE is not set CONFIG_DVB_AV7110_OSD=y CONFIG_DVB_BUDGET=m CONFIG_DVB_BUDGET_CI=m CONFIG_DVB_BUDGET_AV=m CONFIG_DVB_BUDGET_PATCH=m # # Supported USB Adapters # CONFIG_DVB_TTUSB_BUDGET=m CONFIG_DVB_TTUSB_DEC=m CONFIG_DVB_DIBUSB=m CONFIG_DVB_DIBUSB_MISDESIGNED_DEVICES=y # CONFIG_DVB_DIBCOM_DEBUG is not set CONFIG_DVB_CINERGYT2=m # CONFIG_DVB_CINERGYT2_TUNING is not set # # Supported FlexCopII (B2C2) Adapters # CONFIG_DVB_B2C2_SKYSTAR=m CONFIG_DVB_B2C2_USB=m # # Supported BT878 Adapters # CONFIG_DVB_BT8XX=m # # Supported DVB Frontends # # # Customise DVB Frontends # # # DVB-S (satellite) frontends # CONFIG_DVB_STV0299=m CONFIG_DVB_CX24110=m CONFIG_DVB_TDA8083=m CONFIG_DVB_TDA80XX=m CONFIG_DVB_MT312=m CONFIG_DVB_VES1X93=m # # DVB-T (terrestrial) frontends # CONFIG_DVB_SP8870=m CONFIG_DVB_SP887X=m CONFIG_DVB_CX22700=m CONFIG_DVB_CX22702=m CONFIG_DVB_L64781=m CONFIG_DVB_TDA1004X=m CONFIG_DVB_NXT6000=m CONFIG_DVB_MT352=m CONFIG_DVB_DIB3000MB=m CONFIG_DVB_DIB3000MC=m # # DVB-C (cable) frontends # CONFIG_DVB_ATMEL_AT76C651=m CONFIG_DVB_VES1820=m CONFIG_DVB_TDA10021=m CONFIG_DVB_STV0297=m CONFIG_VIDEO_SAA7146=m CONFIG_VIDEO_SAA7146_VV=m CONFIG_VIDEO_VIDEOBUF=m CONFIG_VIDEO_TUNER=m CONFIG_VIDEO_BUF=m CONFIG_VIDEO_BTCX=m CONFIG_VIDEO_IR=m # # Graphics support # CONFIG_FB=y CONFIG_FB_MODE_HELPERS=y CONFIG_FB_TILEBLITTING=y CONFIG_FB_CIRRUS=m # CONFIG_FB_PM2 is not set # CONFIG_FB_CYBER2000 is not set # CONFIG_FB_ASILIANT is not set # CONFIG_FB_IMSTT is not set CONFIG_FB_VGA16=m CONFIG_FB_VESA=y CONFIG_VIDEO_SELECT=y CONFIG_FB_HGA=m CONFIG_FB_HGA_ACCEL=y CONFIG_FB_RIVA=m # CONFIG_FB_RIVA_I2C is not set # CONFIG_FB_RIVA_DEBUG is not set CONFIG_FB_MATROX=m CONFIG_FB_MATROX_MILLENIUM=y CONFIG_FB_MATROX_MYSTIQUE=y CONFIG_FB_MATROX_G450=y CONFIG_FB_MATROX_G100=y CONFIG_FB_MATROX_I2C=m CONFIG_FB_MATROX_MAVEN=m CONFIG_FB_MATROX_MULTIHEAD=y # CONFIG_FB_RADEON_OLD is not set CONFIG_FB_RADEON=m CONFIG_FB_RADEON_I2C=y # CONFIG_FB_RADEON_DEBUG is not set CONFIG_FB_ATY128=m CONFIG_FB_ATY=m CONFIG_FB_ATY_CT=y # CONFIG_FB_ATY_GENERIC_LCD is not set # CONFIG_FB_ATY_XL_INIT is not set CONFIG_FB_ATY_GX=y CONFIG_FB_SAVAGE=m CONFIG_FB_SAVAGE_I2C=m CONFIG_FB_SAVAGE_ACCEL=m # CONFIG_FB_SIS is not set CONFIG_FB_NEOMAGIC=m CONFIG_FB_KYRO=m CONFIG_FB_3DFX=m CONFIG_FB_3DFX_ACCEL=y CONFIG_FB_VOODOO1=m CONFIG_FB_TRIDENT=m CONFIG_FB_TRIDENT_ACCEL=y # CONFIG_FB_VIRTUAL is not set # # Console display driver support # CONFIG_VGA_CONSOLE=y CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y # CONFIG_FONTS is not set CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y # # Logo configuration # CONFIG_LOGO=y # CONFIG_LOGO_LINUX_MONO is not set # CONFIG_LOGO_LINUX_VGA16 is not set CONFIG_LOGO_LINUX_CLUT224=y # # Sound # CONFIG_SOUND=m # # Advanced Linux Sound Architecture # CONFIG_SND=m CONFIG_SND_TIMER=m CONFIG_SND_PCM=m CONFIG_SND_HWDEP=m CONFIG_SND_RAWMIDI=m CONFIG_SND_SEQUENCER=m CONFIG_SND_SEQ_DUMMY=m CONFIG_SND_OSSEMUL=y CONFIG_SND_MIXER_OSS=m CONFIG_SND_PCM_OSS=m CONFIG_SND_SEQUENCER_OSS=y CONFIG_SND_BIT32_EMUL=m CONFIG_SND_RTCTIMER=m # CONFIG_SND_VERBOSE_PRINTK is not set # CONFIG_SND_DEBUG is not set # # Generic devices # CONFIG_SND_MPU401_UART=m CONFIG_SND_OPL3_LIB=m CONFIG_SND_VX_LIB=m CONFIG_SND_DUMMY=m CONFIG_SND_VIRMIDI=m CONFIG_SND_MTPAV=m # CONFIG_SND_SERIAL_U16550 is not set CONFIG_SND_MPU401=m # # PCI devices # CONFIG_SND_AC97_CODEC=m CONFIG_SND_ALI5451=m CONFIG_SND_ATIIXP=m CONFIG_SND_ATIIXP_MODEM=m CONFIG_SND_AU8810=m CONFIG_SND_AU8820=m CONFIG_SND_AU8830=m CONFIG_SND_AZT3328=m CONFIG_SND_BT87X=m # CONFIG_SND_BT87X_OVERCLOCK is not set CONFIG_SND_CS46XX=m CONFIG_SND_CS46XX_NEW_DSP=y CONFIG_SND_CS4281=m CONFIG_SND_EMU10K1=m CONFIG_SND_KORG1212=m CONFIG_SND_MIXART=m CONFIG_SND_NM256=m CONFIG_SND_RME32=m CONFIG_SND_RME96=m CONFIG_SND_RME9652=m CONFIG_SND_HDSP=m CONFIG_SND_TRIDENT=m CONFIG_SND_YMFPCI=m CONFIG_SND_ALS4000=m CONFIG_SND_CMIPCI=m CONFIG_SND_ENS1370=m CONFIG_SND_ENS1371=m CONFIG_SND_ES1938=m CONFIG_SND_ES1968=m CONFIG_SND_MAESTRO3=m CONFIG_SND_FM801=m CONFIG_SND_FM801_TEA575X=m CONFIG_SND_ICE1712=m CONFIG_SND_ICE1724=m CONFIG_SND_INTEL8X0=m CONFIG_SND_INTEL8X0M=m CONFIG_SND_SONICVIBES=m CONFIG_SND_VIA82XX=m CONFIG_SND_VX222=m # # USB devices # CONFIG_SND_USB_AUDIO=m CONFIG_SND_USB_USX2Y=m # # PCMCIA devices # # # Open Sound System # # CONFIG_SOUND_PRIME is not set # # USB support # CONFIG_USB=y # CONFIG_USB_DEBUG is not set # # Miscellaneous USB options # CONFIG_USB_DEVICEFS=y # CONFIG_USB_BANDWIDTH is not set # CONFIG_USB_DYNAMIC_MINORS is not set CONFIG_USB_SUSPEND=y # CONFIG_USB_OTG is not set CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # # USB Host Controller Drivers # CONFIG_USB_EHCI_HCD=m CONFIG_USB_EHCI_SPLIT_ISO=y CONFIG_USB_EHCI_ROOT_HUB_TT=y CONFIG_USB_OHCI_HCD=m CONFIG_USB_UHCI_HCD=m CONFIG_USB_SL811_HCD=m # # USB Device Class drivers # # CONFIG_USB_AUDIO is not set # # USB Bluetooth TTY can only be used with disabled Bluetooth subsystem # CONFIG_USB_MIDI=m CONFIG_USB_ACM=m CONFIG_USB_PRINTER=m # # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information # CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_DEBUG is not set CONFIG_USB_STORAGE_RW_DETECT=y CONFIG_USB_STORAGE_DATAFAB=y CONFIG_USB_STORAGE_FREECOM=y CONFIG_USB_STORAGE_ISD200=y CONFIG_USB_STORAGE_DPCM=y CONFIG_USB_STORAGE_HP8200e=y CONFIG_USB_STORAGE_SDDR09=y CONFIG_USB_STORAGE_SDDR55=y CONFIG_USB_STORAGE_JUMPSHOT=y # # USB Input Devices # CONFIG_USB_HID=y CONFIG_USB_HIDINPUT=y CONFIG_HID_FF=y CONFIG_HID_PID=y CONFIG_LOGITECH_FF=y CONFIG_THRUSTMASTER_FF=y CONFIG_USB_HIDDEV=y CONFIG_USB_AIPTEK=m CONFIG_USB_WACOM=m CONFIG_USB_KBTAB=m CONFIG_USB_POWERMATE=m CONFIG_USB_MTOUCH=m CONFIG_USB_EGALAX=m CONFIG_USB_XPAD=m CONFIG_USB_ATI_REMOTE=m # # USB Imaging devices # CONFIG_USB_MDC800=m CONFIG_USB_MICROTEK=m CONFIG_USB_HPUSBSCSI=m # # USB Multimedia devices # CONFIG_USB_DABUSB=m CONFIG_USB_VICAM=m CONFIG_USB_DSBR=m CONFIG_USB_IBMCAM=m CONFIG_USB_KONICAWC=m CONFIG_USB_OV511=m CONFIG_USB_SE401=m CONFIG_USB_SN9C102=m CONFIG_USB_STV680=m CONFIG_USB_W9968CF=m # # USB Network Adapters # CONFIG_USB_CATC=m CONFIG_USB_KAWETH=m CONFIG_USB_PEGASUS=m CONFIG_USB_RTL8150=m CONFIG_USB_USBNET=m # # USB Host-to-Host Cables # CONFIG_USB_ALI_M5632=y CONFIG_USB_AN2720=y CONFIG_USB_BELKIN=y CONFIG_USB_GENESYS=y CONFIG_USB_NET1080=y CONFIG_USB_PL2301=y CONFIG_USB_KC2190=y # # Intelligent USB Devices/Gadgets # CONFIG_USB_ARMLINUX=y CONFIG_USB_EPSON2888=y CONFIG_USB_ZAURUS=y CONFIG_USB_CDCETHER=y # # USB Network Adapters # CONFIG_USB_AX8817X=y # # USB port drivers # CONFIG_USB_USS720=m # # USB Serial Converter support # CONFIG_USB_SERIAL=m CONFIG_USB_SERIAL_GENERIC=y CONFIG_USB_SERIAL_BELKIN=m CONFIG_USB_SERIAL_WHITEHEAT=m CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m CONFIG_USB_SERIAL_CYPRESS_M8=m CONFIG_USB_SERIAL_EMPEG=m CONFIG_USB_SERIAL_FTDI_SIO=m CONFIG_USB_SERIAL_VISOR=m CONFIG_USB_SERIAL_IPAQ=m CONFIG_USB_SERIAL_IR=m CONFIG_USB_SERIAL_EDGEPORT=m CONFIG_USB_SERIAL_EDGEPORT_TI=m # CONFIG_USB_SERIAL_IPW is not set CONFIG_USB_SERIAL_KEYSPAN_PDA=m CONFIG_USB_SERIAL_KEYSPAN=m CONFIG_USB_SERIAL_KEYSPAN_MPR=y CONFIG_USB_SERIAL_KEYSPAN_USA28=y CONFIG_USB_SERIAL_KEYSPAN_USA28X=y CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y CONFIG_USB_SERIAL_KEYSPAN_USA19=y CONFIG_USB_SERIAL_KEYSPAN_USA18X=y CONFIG_USB_SERIAL_KEYSPAN_USA19W=y CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y CONFIG_USB_SERIAL_KEYSPAN_USA49W=y CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y CONFIG_USB_SERIAL_KLSI=m CONFIG_USB_SERIAL_KOBIL_SCT=m CONFIG_USB_SERIAL_MCT_U232=m CONFIG_USB_SERIAL_PL2303=m CONFIG_USB_SERIAL_SAFE=m CONFIG_USB_SERIAL_SAFE_PADDED=y CONFIG_USB_SERIAL_CYBERJACK=m CONFIG_USB_SERIAL_XIRCOM=m CONFIG_USB_SERIAL_OMNINET=m CONFIG_USB_EZUSB=y # # USB Miscellaneous drivers # CONFIG_USB_EMI62=m # CONFIG_USB_EMI26 is not set CONFIG_USB_TIGL=m CONFIG_USB_AUERSWALD=m CONFIG_USB_RIO500=m CONFIG_USB_LEGOTOWER=m CONFIG_USB_LCD=m CONFIG_USB_LED=m # CONFIG_USB_CYTHERM is not set CONFIG_USB_PHIDGETKIT=m CONFIG_USB_PHIDGETSERVO=m CONFIG_USB_TEST=m # # USB ATM/DSL drivers # CONFIG_USB_ATM=m CONFIG_USB_SPEEDTOUCH=m # # USB Gadget Support # # CONFIG_USB_GADGET is not set # # MMC/SD Card support # CONFIG_MMC=m # CONFIG_MMC_DEBUG is not set CONFIG_MMC_BLOCK=m CONFIG_MMC_WBSD=m # # Firmware Drivers # # CONFIG_EDD is not set # # File systems # CONFIG_EXT2_FS=y CONFIG_EXT2_FS_XATTR=y CONFIG_EXT2_FS_POSIX_ACL=y CONFIG_EXT2_FS_SECURITY=y CONFIG_EXT3_FS=m CONFIG_EXT3_FS_XATTR=y CONFIG_EXT3_FS_POSIX_ACL=y CONFIG_EXT3_FS_SECURITY=y CONFIG_JBD=m # CONFIG_JBD_DEBUG is not set CONFIG_FS_MBCACHE=y CONFIG_REISERFS_FS=m # CONFIG_REISERFS_CHECK is not set CONFIG_REISERFS_PROC_INFO=y CONFIG_REISERFS_FS_XATTR=y CONFIG_REISERFS_FS_POSIX_ACL=y CONFIG_REISERFS_FS_SECURITY=y CONFIG_JFS_FS=m CONFIG_JFS_POSIX_ACL=y # CONFIG_JFS_DEBUG is not set # CONFIG_JFS_STATISTICS is not set CONFIG_FS_POSIX_ACL=y CONFIG_XFS_FS=m # CONFIG_XFS_RT is not set CONFIG_XFS_QUOTA=y CONFIG_XFS_SECURITY=y CONFIG_XFS_POSIX_ACL=y CONFIG_MINIX_FS=m CONFIG_ROMFS_FS=m CONFIG_QUOTA=y # CONFIG_QFMT_V1 is not set CONFIG_QFMT_V2=y CONFIG_QUOTACTL=y CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=m CONFIG_AUTOFS4_FS=m # # CD-ROM/DVD Filesystems # CONFIG_ISO9660_FS=y CONFIG_JOLIET=y CONFIG_ZISOFS=y CONFIG_ZISOFS_FS=y CONFIG_UDF_FS=m CONFIG_UDF_NLS=y # # DOS/FAT/NT Filesystems # CONFIG_FAT_FS=m CONFIG_MSDOS_FS=m CONFIG_VFAT_FS=m CONFIG_FAT_DEFAULT_CODEPAGE=437 CONFIG_FAT_DEFAULT_IOCHARSET="ascii" # CONFIG_NTFS_FS is not set # # Pseudo filesystems # CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y CONFIG_SYSFS=y # CONFIG_DEVFS_FS is not set CONFIG_DEVPTS_FS_XATTR=y CONFIG_DEVPTS_FS_SECURITY=y CONFIG_TMPFS=y CONFIG_TMPFS_XATTR=y CONFIG_TMPFS_SECURITY=y CONFIG_HUGETLBFS=y CONFIG_HUGETLB_PAGE=y CONFIG_RAMFS=y # # Miscellaneous filesystems # # CONFIG_ADFS_FS is not set CONFIG_AFFS_FS=m CONFIG_HFS_FS=m CONFIG_HFSPLUS_FS=m CONFIG_BEFS_FS=m # CONFIG_BEFS_DEBUG is not set CONFIG_BFS_FS=m CONFIG_EFS_FS=m # CONFIG_JFFS_FS is not set CONFIG_JFFS2_FS=m CONFIG_JFFS2_FS_DEBUG=0 CONFIG_JFFS2_FS_NAND=y # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set CONFIG_JFFS2_ZLIB=y CONFIG_JFFS2_RTIME=y # CONFIG_JFFS2_RUBIN is not set CONFIG_CRAMFS=m CONFIG_VXFS_FS=m # CONFIG_HPFS_FS is not set CONFIG_QNX4FS_FS=m # CONFIG_QNX4FS_RW is not set CONFIG_SYSV_FS=m CONFIG_UFS_FS=m # CONFIG_UFS_FS_WRITE is not set # # Network File Systems # CONFIG_NFS_FS=m CONFIG_NFS_V3=y CONFIG_NFS_V4=y CONFIG_NFS_DIRECTIO=y CONFIG_NFSD=m CONFIG_NFSD_V3=y CONFIG_NFSD_V4=y CONFIG_NFSD_TCP=y CONFIG_LOCKD=m CONFIG_LOCKD_V4=y CONFIG_EXPORTFS=m CONFIG_SUNRPC=m CONFIG_SUNRPC_GSS=m CONFIG_RPCSEC_GSS_KRB5=m CONFIG_RPCSEC_GSS_SPKM3=m CONFIG_SMB_FS=m # CONFIG_SMB_NLS_DEFAULT is not set CONFIG_CIFS=m # CONFIG_CIFS_STATS is not set CONFIG_CIFS_XATTR=y CONFIG_CIFS_POSIX=y # CONFIG_CIFS_EXPERIMENTAL is not set CONFIG_NCP_FS=m CONFIG_NCPFS_PACKET_SIGNING=y CONFIG_NCPFS_IOCTL_LOCKING=y CONFIG_NCPFS_STRONG=y CONFIG_NCPFS_NFS_NS=y CONFIG_NCPFS_OS2_NS=y CONFIG_NCPFS_SMALLDOS=y CONFIG_NCPFS_NLS=y CONFIG_NCPFS_EXTRAS=y # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set # # Partition Types # CONFIG_PARTITION_ADVANCED=y # CONFIG_ACORN_PARTITION is not set CONFIG_OSF_PARTITION=y # CONFIG_AMIGA_PARTITION is not set # CONFIG_ATARI_PARTITION is not set CONFIG_MAC_PARTITION=y CONFIG_MSDOS_PARTITION=y CONFIG_BSD_DISKLABEL=y CONFIG_MINIX_SUBPARTITION=y CONFIG_SOLARIS_X86_PARTITION=y CONFIG_UNIXWARE_DISKLABEL=y # CONFIG_LDM_PARTITION is not set CONFIG_SGI_PARTITION=y # CONFIG_ULTRIX_PARTITION is not set CONFIG_SUN_PARTITION=y CONFIG_EFI_PARTITION=y # # Native Language Support # CONFIG_NLS=y CONFIG_NLS_DEFAULT="utf8" CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_CODEPAGE_737=m CONFIG_NLS_CODEPAGE_775=m CONFIG_NLS_CODEPAGE_850=m CONFIG_NLS_CODEPAGE_852=m CONFIG_NLS_CODEPAGE_855=m CONFIG_NLS_CODEPAGE_857=m CONFIG_NLS_CODEPAGE_860=m CONFIG_NLS_CODEPAGE_861=m CONFIG_NLS_CODEPAGE_862=m CONFIG_NLS_CODEPAGE_863=m CONFIG_NLS_CODEPAGE_864=m CONFIG_NLS_CODEPAGE_865=m CONFIG_NLS_CODEPAGE_866=m CONFIG_NLS_CODEPAGE_869=m CONFIG_NLS_CODEPAGE_936=m CONFIG_NLS_CODEPAGE_950=m CONFIG_NLS_CODEPAGE_932=m CONFIG_NLS_CODEPAGE_949=m CONFIG_NLS_CODEPAGE_874=m CONFIG_NLS_ISO8859_8=m CONFIG_NLS_CODEPAGE_1250=m CONFIG_NLS_CODEPAGE_1251=m CONFIG_NLS_ASCII=y CONFIG_NLS_ISO8859_1=m CONFIG_NLS_ISO8859_2=m CONFIG_NLS_ISO8859_3=m CONFIG_NLS_ISO8859_4=m CONFIG_NLS_ISO8859_5=m CONFIG_NLS_ISO8859_6=m CONFIG_NLS_ISO8859_7=m CONFIG_NLS_ISO8859_9=m CONFIG_NLS_ISO8859_13=m CONFIG_NLS_ISO8859_14=m CONFIG_NLS_ISO8859_15=m CONFIG_NLS_KOI8_R=m CONFIG_NLS_KOI8_U=m CONFIG_NLS_UTF8=m # # Profiling support # CONFIG_PROFILING=y CONFIG_OPROFILE=m # # Kernel hacking # CONFIG_DEBUG_KERNEL=y CONFIG_MAGIC_SYSRQ=y # CONFIG_SCHEDSTATS is not set # CONFIG_DEBUG_SLAB is not set CONFIG_DEBUG_SPINLOCK=y CONFIG_DEBUG_SPINLOCK_SLEEP=y # CONFIG_DEBUG_KOBJECT is not set CONFIG_DEBUG_INFO=y # CONFIG_CHECKING is not set CONFIG_INIT_DEBUG=y # CONFIG_IOMMU_DEBUG is not set # CONFIG_KPROBES is not set # # Security options # # CONFIG_KEYS is not set CONFIG_SECURITY=y CONFIG_SECURITY_NETWORK=y CONFIG_SECURITY_CAPABILITIES=y # CONFIG_SECURITY_ROOTPLUG is not set CONFIG_SECURITY_SECLVL=m CONFIG_SECURITY_SELINUX=y CONFIG_SECURITY_SELINUX_BOOTPARAM=y CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1 CONFIG_SECURITY_SELINUX_DISABLE=y CONFIG_SECURITY_SELINUX_DEVELOP=y # CONFIG_SECURITY_SELINUX_MLS is not set # # Cryptographic options # CONFIG_CRYPTO=y CONFIG_CRYPTO_HMAC=y CONFIG_CRYPTO_NULL=m CONFIG_CRYPTO_MD4=m CONFIG_CRYPTO_MD5=m CONFIG_CRYPTO_SHA1=y CONFIG_CRYPTO_SHA256=m CONFIG_CRYPTO_SHA512=m CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_DES=m CONFIG_CRYPTO_BLOWFISH=m CONFIG_CRYPTO_TWOFISH=m CONFIG_CRYPTO_SERPENT=m CONFIG_CRYPTO_AES=m CONFIG_CRYPTO_CAST5=m CONFIG_CRYPTO_CAST6=m CONFIG_CRYPTO_TEA=m CONFIG_CRYPTO_ARC4=m CONFIG_CRYPTO_KHAZAD=m CONFIG_CRYPTO_ANUBIS=m CONFIG_CRYPTO_DEFLATE=m CONFIG_CRYPTO_MICHAEL_MIC=m CONFIG_CRYPTO_CRC32C=m # CONFIG_CRYPTO_TEST is not set # # Library routines # CONFIG_CRC_CCITT=m CONFIG_CRC32=y CONFIG_LIBCRC32C=m CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=m --------------090209010003000801020701-- From rich@phekda.gotadsl.co.uk Sun Jan 2 07:14:56 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 02 Jan 2005 07:15:08 -0800 (PST) Received: from smtp.nildram.co.uk (smtp.nildram.co.uk [195.112.4.54]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j02FEYCc028693 for ; Sun, 2 Jan 2005 07:14:55 -0800 Received: from katrina.int.phekda.gotadsl.co.uk (unknown [84.12.65.24]) by smtp.nildram.co.uk (Postfix) with ESMTP id A047F24FE6B; Sun, 2 Jan 2005 15:23:03 +0000 (GMT) Received: from [192.168.1.4] (katrina.int.phekda.gotadsl.co.uk [192.168.1.4]) by katrina.int.phekda.gotadsl.co.uk (Postfix) with ESMTP id 76901355; Sun, 2 Jan 2005 15:23:58 +0000 (GMT) Message-ID: <41D811F9.7030202@phekda.gotadsl.co.uk> Date: Sun, 02 Jan 2005 15:23:37 +0000 From: Richard Dawe User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020 X-Accept-Language: en, de, fr MIME-Version: 1.0 To: Francois Romieu Cc: Richard Dawe , netdev@oss.sgi.com Subject: Re: Acer Aspire 1524WLMi and RealTek 8169 - very slow References: <41A09541.5040405@phekda.gotadsl.co.uk> <41A0F0D5.9050702@phekda.gotadsl.co.uk> <20041121205814.GA22460@electric-eye.fr.zoreil.com> <41A24F35.5080106@phekda.gotadsl.co.uk> <20041122213008.GA9618@electric-eye.fr.zoreil.com> <41D2844E.5070204@phekda.gotadsl.co.uk> <20041229235203.GA5465@electric-eye.fr.zoreil.com> <41D7FC59.2040503@phekda.gotadsl.co.uk> In-Reply-To: <41D7FC59.2040503@phekda.gotadsl.co.uk> Content-Type: multipart/mixed; boundary="------------050102090004090802060504" X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13336 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rich@phekda.gotadsl.co.uk Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------050102090004090802060504 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hello. Richard Dawe wrote: > > Francois Romieu wrote: [snip] >> Could you send an updated dmesg, lspci -vvx, /proc/interrupts please ? > > > Please see the attached, which are for running with 2.6.10. I included > .config, Just In Case. [snip] Sorry, I booted into 2.6.9-1.681_FC3 by mistake. Attached are the ones from 2.6.10. Bye, Rich =] -- Richard Dawe [ http://homepages.nildram.co.uk/~phekda/richdawe/ ] "You can't evaluate a man by logic alone." -- McCoy, "I, Mudd", Star Trek --------------050102090004090802060504 Content-Type: text/plain; name="2.6.10-dmesg.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="2.6.10-dmesg.txt" Bootdata ok (command line is ro root=/dev/VolGroup00/LogVol00) Linux version 2.6.10 (rich@meelo.int.phekda.gotadsl.co.uk) (gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)) #1 Wed Dec 29 00:43:22 GMT 2004 BIOS-provided physical RAM map: BIOS-e820: 0000000000000000 - 000000000009f800 (usable) BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved) BIOS-e820: 00000000000d8000 - 0000000000100000 (reserved) BIOS-e820: 0000000000100000 - 000000001ff70000 (usable) BIOS-e820: 000000001ff70000 - 000000001ff7a000 (ACPI data) BIOS-e820: 000000001ff7a000 - 000000001ff80000 (ACPI NVS) BIOS-e820: 000000001ff80000 - 0000000020000000 (reserved) BIOS-e820: 00000000fffe0000 - 0000000100000000 (reserved) No mptable found. On node 0 totalpages: 130928 DMA zone: 4096 pages, LIFO batch:1 Normal zone: 126832 pages, LIFO batch:16 HighMem zone: 0 pages, LIFO batch:1 ACPI: RSDP (v000 PTLTD ) @ 0x00000000000f6a60 ACPI: RSDT (v001 PTLTD RSDT 0x06040000 LTP 0x00000000) @ 0x000000001ff73fbd ACPI: FADT (v002 AMDK8 PTLTW 0x06040000 PTL_ 0x000f4240) @ 0x000000001ff79e35 ACPI: SSDT (v001 PTLTD POWERNOW 0x06040000 LTP 0x00000001) @ 0x000000001ff79eb9 ACPI: MADT (v001 PTLTD APIC 0x06040000 LTP 0x00000000) @ 0x000000001ff79fb0 ACPI: DSDT (v001 VIA PTL_ACPI 0x06040000 MSFT 0x0100000e) @ 0x0000000000000000 ACPI: Local APIC address 0xfee00000 ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled) Processor #0 15:4 APIC version 16 ACPI: LAPIC_NMI (acpi_id[0x00] high edge lint[0x1]) ACPI: IOAPIC (id[0x01] address[0xfec00000] gsi_base[0]) IOAPIC[0]: apic_id 1, version 3, address 0xfec00000, GSI 0-23 ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 high edge) ACPI: IRQ0 used by override. ACPI: IRQ2 used by override. ACPI: IRQ9 used by override. Setting APIC routing to flat Using ACPI (MADT) for SMP configuration information Checking aperture... CPU 0: aperture @ d0000000 size 256 MB Built 1 zonelists Kernel command line: ro root=/dev/VolGroup00/LogVol00 console=tty0 Initializing CPU#0 PID hash table entries: 2048 (order: 11, 65536 bytes) time.c: Using 1.193182 MHz PIT timer. time.c: Detected 2201.348 MHz processor. Console: colour VGA+ 80x25 Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes) Inode-cache hash table entries: 65536 (order: 7, 524288 bytes) Memory: 508232k/523712k available (2585k kernel code, 14724k reserved, 1202k data, 184k init) Calibrating delay loop... 4325.37 BogoMIPS (lpj=2162688) Security Framework v1.0.0 initialized SELinux: Initializing. SELinux: Starting in permissive mode selinux_register_security: Registering secondary module capability Capability LSM initialized as secondary Mount-cache hash table entries: 256 (order: 0, 4096 bytes) CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line) CPU: L2 Cache: 1024K (64 bytes/line) CPU: AMD Athlon(tm) 64 Processor 3400+ stepping 0a ACPI-0294: *** Info: Table [DSDT] replaced by host OS Using local APIC NMI watchdog using perfctr0 Using local APIC timer interrupts. Detected 12.507 MHz APIC timer. checking if image is initramfs... it is NET: Registered protocol family 16 PCI: Using configuration type 1 mtrr: v2.0 (20020519) ACPI: Subsystem revision 20041105 ACPI: Interpreter enabled ACPI: Using IOAPIC for interrupt routing ACPI: PCI Root Bridge [PCI0] (00:00) PCI: Probing PCI hardware (bus 00) ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT] ACPI: PCI Interrupt Link [ALKA] (IRQs 16 17 18 19 20 21 22 23) *10, disabled. ACPI: PCI Interrupt Link [ALKB] (IRQs 16 17 18 19 20 21 22 23) *10, disabled. ACPI: PCI Interrupt Link [ALKC] (IRQs 22) *11, disabled. ACPI: PCI Interrupt Link [ALKD] (IRQs 21) *11, disabled. ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 7 9 12 14 15) *10 ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 7 *10 12 14 15) ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 7 *11 12 14 15) ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 7 9 10 *11 12 14 15) ACPI: Embedded Controller [EC] (gpe 11) Linux Plug and Play Support v0.97 (c) Adam Belay usbcore: registered new driver usbfs usbcore: registered new driver hub PCI: Using ACPI for IRQ routing ** PCI interrupts are no longer routed automatically. If this ** causes a device to stop working, it is probably because the ** driver failed to call pci_enable_device(). As a temporary ** workaround, the "pci=routeirq" argument restores the old ** behavior. If this argument makes the device work again, ** please email the output of "lspci" to bjorn.helgaas@hp.com ** so I can fix the driver. agpgart: Detected AGP bridge 0 agpgart: Maximum main memory to use for agp memory: 439M agpgart: AGP aperture is 256M @ 0xd0000000 PCI-DMA: Disabling IOMMU. IA32 emulation $Id: sys_ia32.c,v 1.32 2002/03/24 13:02:28 ak Exp $ audit: initializing netlink socket (disabled) audit(1104678976.354:0): initialized Total HugeTLB memory allocated, 0 VFS: Disk quotas dquot_6.5.1 Dquot-cache hash table entries: 512 (order 0, 4096 bytes) SELinux: Registering netfilter hooks Initializing Cryptographic API pci_hotplug: PCI Hot Plug PCI Core version: 0.5 vesafb: probe of vesafb0 failed with error -6 ACPI: Thermal Zone [THRS] (42 C) ACPI: Thermal Zone [THRC] (51 C) Real Time Clock Driver v1.12 Linux agpgart interface v0.100 (c) Dave Jones i8042.c: Detected active multiplexing controller, rev 1.1. serio: i8042 AUX0 port at 0x60,0x64 irq 12 serio: i8042 AUX1 port at 0x60,0x64 irq 12 serio: i8042 AUX2 port at 0x60,0x64 irq 12 serio: i8042 AUX3 port at 0x60,0x64 irq 12 serio: i8042 KBD port at 0x60,0x64 irq 1 Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A io scheduler noop registered io scheduler anticipatory registered io scheduler deadline registered io scheduler cfq registered RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize divert: not allocating divert_blk for non-ethernet device lo Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx VP_IDE: IDE controller at PCI slot 0000:00:11.1 ACPI: PCI interrupt 0000:00:11.1[A]: no GSI - using IRQ 0 VP_IDE: chipset revision 6 VP_IDE: not 100% native mode: will probe irqs later VP_IDE: VIA vt8235 (rev 00) IDE UDMA133 controller on pci0000:00:11.1 ide0: BM-DMA at 0x1c80-0x1c87, BIOS settings: hda:DMA, hdb:pio ide1: BM-DMA at 0x1c88-0x1c8f, BIOS settings: hdc:DMA, hdd:pio Probing IDE interface ide0... hda: IC25N060ATMR04-0, ATA DISK drive elevator: using anticipatory as default io scheduler ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 Probing IDE interface ide1... hdc: TSSTcorpCD/DVDW TS-L532A, ATAPI CD/DVD-ROM drive ide1 at 0x170-0x177,0x376 on irq 15 Probing IDE interface ide2... ide2: Wait for ready failed before probe ! Probing IDE interface ide3... ide3: Wait for ready failed before probe ! Probing IDE interface ide4... ide4: Wait for ready failed before probe ! Probing IDE interface ide5... ide5: Wait for ready failed before probe ! hda: max request size: 1024KiB hda: 117210240 sectors (60011 MB) w/7884KiB Cache, CHS=16383/255/63, UDMA(100) hda: cache flushes supported hda: hda1 hda2 hdc: ATAPI 24X DVD-ROM DVD-R CD-R/RW drive, 2048kB Cache, UDMA(33) Uniform CD-ROM driver Revision: 3.20 ide-floppy driver 0.99.newide usbcore: registered new driver hiddev usbcore: registered new driver usbhid drivers/usb/input/hid-core.c: v2.0:USB HID core driver mice: PS/2 mouse device common for all mice input: AT Translated Set 2 keyboard on isa0060/serio0 Synaptics Touchpad, model: 1 Firmware: 5.8 180 degree mounted touchpad Sensor: 18 new absolute packet format Touchpad has extended capability bits -> 4 multi-buttons, i.e. besides standard buttons -> multifinger detection -> palm detection input: SynPS/2 Synaptics TouchPad on isa0060/serio4 md: md driver 0.90.1 MAX_MD_DEVS=256, MD_SB_DISKS=27 NET: Registered protocol family 2 IP: routing cache hash table of 512 buckets, 28Kbytes TCP: Hash tables configured (established 32768 bind 4681) Initializing IPsec netlink socket NET: Registered protocol family 1 NET: Registered protocol family 17 powernow-k8: Found 1 AMD Athlon 64 / Opteron processors (version 1.00.09e) powernow-k8: 0 : fid 0xe (2200 MHz), vid 0x2 (1500 mV) powernow-k8: 1 : fid 0xc (2000 MHz), vid 0x6 (1400 mV) powernow-k8: 2 : fid 0xa (1800 MHz), vid 0xa (1300 mV) powernow-k8: 3 : fid 0x0 (800 MHz), vid 0x12 (1100 mV) cpu_init done, current fid 0xe, vid 0x0 powernow-k8: ph2 null fid transition 0xe ACPI wakeup devices: PCI0 Z007 GLAN LID SLPB ACPI: (supports S0 S3 S4 S5) Freeing unused kernel memory: 184k freed device-mapper: 4.3.0-ioctl (2004-09-30) initialised: dm-devel@redhat.com cdrom: open failed. kjournald starting. Commit interval 5 seconds EXT3-fs: mounted filesystem with ordered data mode. security: 3 users, 4 roles, 316 types, 20 bools security: 53 classes, 7085 rules SELinux: Completing initialization. SELinux: Setting up existing superblocks. SELinux: initialized (dev dm-0, type ext3), uses xattr SELinux: initialized (dev tmpfs, type tmpfs), uses transition SIDs SELinux: initialized (dev selinuxfs, type selinuxfs), uses genfs_contexts SELinux: initialized (dev mqueue, type mqueue), not configured for labeling SELinux: initialized (dev hugetlbfs, type hugetlbfs), not configured for labeling SELinux: initialized (dev devpts, type devpts), uses transition SIDs SELinux: initialized (dev eventpollfs, type eventpollfs), uses genfs_contexts SELinux: initialized (dev tmpfs, type tmpfs), uses transition SIDs SELinux: initialized (dev futexfs, type futexfs), uses genfs_contexts SELinux: initialized (dev pipefs, type pipefs), uses task SIDs SELinux: initialized (dev sockfs, type sockfs), uses task SIDs SELinux: initialized (dev proc, type proc), uses genfs_contexts SELinux: initialized (dev bdev, type bdev), uses genfs_contexts SELinux: initialized (dev rootfs, type rootfs), uses genfs_contexts SELinux: initialized (dev sysfs, type sysfs), uses genfs_contexts SELinux: initialized (dev usbfs, type usbfs), uses genfs_contexts inserting floppy driver for 2.6.10 floppy0: no floppy controllers found r8169 Gigabit Ethernet driver 1.2 loaded ACPI: PCI interrupt 0000:00:0c.0[A] -> GSI 22 (level, low) -> IRQ 169 r8169: NAPI enabled divert: allocating divert_blk for eth0 eth0: Identified chip type is 'RTL8169'. eth0: RTL8169 at 0xffffff000001a400, 00:0a:e4:5f:3e:85, IRQ 169 r8169: media option is deprecated. via82xx: Assuming DXS channels with 48k fixed sample rate. Please try dxs_support=1 or dxs_support=4 option and report if it works on your machine. ACPI: PCI interrupt 0000:00:11.5[C] -> GSI 22 (level, low) -> IRQ 169 PCI: Via IRQ fixup for 0000:00:11.5, from 11 to 9 PCI: Setting latency timer of device 0000:00:11.5 to 64 ACPI: PCI interrupt 0000:00:10.3[D] -> GSI 21 (level, low) -> IRQ 177 ehci_hcd 0000:00:10.3: EHCI Host Controller ehci_hcd 0000:00:10.3: irq 177, pci mem 0xc0006800 ehci_hcd 0000:00:10.3: new USB bus registered, assigned bus number 1 ehci_hcd 0000:00:10.3: USB 2.0 initialized, EHCI 1.00, driver 26 Oct 2004 hub 1-0:1.0: USB hub found hub 1-0:1.0: 6 ports detected USB Universal Host Controller Interface driver v2.2 ACPI: PCI interrupt 0000:00:10.0[A] -> GSI 21 (level, low) -> IRQ 177 PCI: Via IRQ fixup for 0000:00:10.0, from 0 to 1 uhci_hcd 0000:00:10.0: UHCI Host Controller uhci_hcd 0000:00:10.0: irq 177, io base 0x1c20 uhci_hcd 0000:00:10.0: new USB bus registered, assigned bus number 2 hub 2-0:1.0: USB hub found hub 2-0:1.0: 2 ports detected ACPI: PCI interrupt 0000:00:10.1[B] -> GSI 21 (level, low) -> IRQ 177 PCI: Via IRQ fixup for 0000:00:10.1, from 0 to 1 uhci_hcd 0000:00:10.1: UHCI Host Controller uhci_hcd 0000:00:10.1: irq 177, io base 0x1c40 uhci_hcd 0000:00:10.1: new USB bus registered, assigned bus number 3 hub 3-0:1.0: USB hub found hub 3-0:1.0: 2 ports detected ACPI: PCI interrupt 0000:00:10.2[C] -> GSI 21 (level, low) -> IRQ 177 PCI: Via IRQ fixup for 0000:00:10.2, from 0 to 1 uhci_hcd 0000:00:10.2: UHCI Host Controller uhci_hcd 0000:00:10.2: irq 177, io base 0x1c60 uhci_hcd 0000:00:10.2: new USB bus registered, assigned bus number 4 hub 4-0:1.0: USB hub found hub 4-0:1.0: 2 ports detected Linux Kernel Card Services options: [pci] [cardbus] [pm] ACPI: PCI interrupt 0000:00:0b.0[A] -> GSI 17 (level, low) -> IRQ 185 Yenta: CardBus bridge found at 0000:00:0b.0 [1025:006e] Yenta: ISA IRQ mask 0x0cf8, PCI irq 185 Socket status: 30000006 PCI: Enabling device 0000:00:0b.1 (0000 -> 0002) ACPI: PCI interrupt 0000:00:0b.1[B] -> GSI 18 (level, low) -> IRQ 193 Yenta: CardBus bridge found at 0000:00:0b.1 [1025:006e] Yenta: ISA IRQ mask 0x0cf8, PCI irq 193 Socket status: 30000006 ohci1394: $Rev: 1223 $ Ben Collins ACPI: PCI interrupt 0000:00:0b.2[C] -> GSI 19 (level, low) -> IRQ 201 ohci1394: fw-host0: OHCI-1394 1.1 (PCI): IRQ=[201] MMIO=[c0005800-c0005fff] Max Packet=[2048] md: Autodetecting RAID arrays. md: autorun ... md: ... autorun DONE. ieee1394: Host added: ID:BUS[0-00:1023] GUID[000ae40444105af8] ACPI: AC Adapter [AC] (on-line) ACPI: Battery Slot [BAT0] (battery present) ACPI: Power Button (FF) [PWRF] ACPI: Lid Switch [LID] ACPI: Sleep Button (CM) [SLPB] ibm_acpi: ec object not found ACPI: Video Device [VGA] (multi-head: yes rom: no post: no) EXT3 FS on dm-0, internal journal cdrom: open failed. kjournald starting. Commit interval 5 seconds EXT3 FS on hda1, internal journal EXT3-fs: mounted filesystem with ordered data mode. SELinux: initialized (dev hda1, type ext3), uses xattr SELinux: initialized (dev tmpfs, type tmpfs), uses transition SIDs Adding 1015800k swap on /dev/VolGroup00/LogVol01. Priority:-1 extents:1 SELinux: initialized (dev binfmt_misc, type binfmt_misc), uses genfs_contexts parport_pc: Ignoring new-style parameters in presence of obsolete ones parport0: PC-style at 0x378 (0x778) [PCSPP,TRISTATE] parport0: irq 7 detected ip_tables: (C) 2000-2002 Netfilter core team ip_conntrack version 2.1 (2045 buckets, 16360 max) - 504 bytes per conntrack r8169: eth0: link up SELinux: initialized (dev rpc_pipefs, type rpc_pipefs), uses genfs_contexts parport_pc: Ignoring new-style parameters in presence of obsolete ones parport0: PC-style at 0x378 (0x778) [PCSPP,TRISTATE] parport0: irq 7 detected lp0: using parport0 (polling). lp0: console ready NET: Registered protocol family 10 Disabled Privacy Extensions on device ffffffff80470ae0(lo) IPv6 over IPv4 tunneling driver divert: not allocating divert_blk for non-ethernet device sit0 eth0: no IPv6 routers present --------------050102090004090802060504 Content-Type: text/plain; name="2.6.10-lspci-vvx.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="2.6.10-lspci-vvx.txt" 00:00.0 Host bridge: VIA Technologies, Inc.: Unknown device 0204 Subsystem: Acer Incorporated [ALI]: Unknown device 006e Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap+ 66Mhz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- SERR- Capabilities: [50] Power Management version 2 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-) Status: D0 PME-Enable- DSel=0 DScale=0 PME- Capabilities: [60] HyperTransport: Slave or Primary Interface !!! Possibly incomplete decoding Command: BaseUnitID=0 UnitCnt=3 MastHost- DefDir- Link Control 0: CFlE- CST- CFE- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- Reset- FastB2B- Capabilities: [80] Power Management version 2 Flags: PMEClk- DSI- D1+ D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-) Status: D0 PME-Enable- DSel=0 DScale=0 PME- 00: 06 11 88 b1 07 00 30 02 00 00 04 06 00 00 01 00 10: 00 00 00 00 00 00 00 00 00 01 01 00 f0 00 20 22 20: 00 c1 f0 c1 00 e0 f0 ef 00 00 00 00 00 00 00 00 30: 00 00 00 00 80 00 00 00 00 00 00 00 00 00 0c 00 00:0a.0 Ethernet controller: Linksys, A Division of Cisco Systems [AirConn] INPROCOMM IPN 2220 Wireless LAN Adapter (rev 01) Subsystem: AMBIT Microsystem Corp.: Unknown device 0305 Control: I/O+ Mem+ BusMaster- SpecCycle+ MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- SERR- TAbort- SERR- Reset+ 16bInt+ PostWrite+ 16-bit legacy interface ports at 0001 00: 4c 10 8e ac 07 00 10 02 00 00 07 06 20 a8 82 00 10: 00 00 00 20 a0 00 00 02 00 02 05 b0 00 00 40 20 20: 00 f0 7f 20 00 00 80 20 00 f0 bf 20 00 44 00 00 30: fc 44 00 00 00 48 00 00 fc 48 00 00 0a 01 c0 05 40: 25 10 6e 00 01 00 00 00 00 00 00 00 00 00 00 00 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00:0b.1 CardBus bridge: Texas Instruments PCI7420 CardBus Controller Subsystem: Acer Incorporated [ALI]: Unknown device 006e Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- SERR- Reset+ 16bInt+ PostWrite+ 16-bit legacy interface ports at 0001 00: 4c 10 8e ac 07 00 10 02 00 00 07 06 20 a8 82 00 10: 00 10 00 20 a0 00 00 02 00 06 09 b0 00 00 c0 20 20: 00 f0 ff 20 00 00 00 21 00 f0 3f 21 00 4c 00 00 30: fc 4c 00 00 00 50 00 00 fc 50 00 00 0b 02 c0 05 40: 25 10 6e 00 01 00 00 00 00 00 00 00 00 00 00 00 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00:0b.2 FireWire (IEEE 1394): Texas Instruments PCI7x20 1394a-2000 OHCI Two-Port PHY/Link-Layer Controller (prog-if 10 [OHCI]) Subsystem: Acer Incorporated [ALI]: Unknown device 006e Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- 00: de 10 47 03 07 00 b0 02 a1 00 00 03 00 40 00 00 10: 00 00 00 c1 08 00 00 e0 00 00 00 00 00 00 00 00 20: 00 00 00 00 00 00 00 00 00 00 00 00 25 10 6e 00 30: 00 00 00 00 60 00 00 00 00 00 00 00 0a 01 05 01 --------------050102090004090802060504 Content-Type: text/plain; name="2.6.10-proc-interrupts.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="2.6.10-proc-interrupts.txt" CPU0 0: 132568 IO-APIC-edge timer 1: 14 IO-APIC-edge i8042 8: 0 IO-APIC-edge rtc 9: 0 IO-APIC-level acpi 12: 100 IO-APIC-edge i8042 14: 4750 IO-APIC-edge ide0 15: 729 IO-APIC-edge ide1 169: 548 IO-APIC-level VIA8233, eth0 177: 0 IO-APIC-level ehci_hcd, uhci_hcd, uhci_hcd, uhci_hcd 185: 0 IO-APIC-level yenta 193: 0 IO-APIC-level yenta 201: 3 IO-APIC-level ohci1394 NMI: 12 LOC: 132480 ERR: 0 MIS: 0 --------------050102090004090802060504 Content-Type: text/plain; name="config-2.6.10" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="config-2.6.10" # # Automatically generated make config: don't edit # Linux kernel version: 2.6.10 # Wed Dec 29 00:15:30 2004 # CONFIG_X86_64=y CONFIG_64BIT=y CONFIG_X86=y CONFIG_MMU=y CONFIG_RWSEM_GENERIC_SPINLOCK=y CONFIG_X86_CMPXCHG=y CONFIG_EARLY_PRINTK=y CONFIG_HPET_TIMER=y CONFIG_HPET_EMULATE_RTC=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_IOMAP=y # # Code maturity level options # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y CONFIG_BROKEN_ON_SMP=y # # General setup # CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y CONFIG_BSD_PROCESS_ACCT=y # CONFIG_BSD_PROCESS_ACCT_V3 is not set CONFIG_SYSCTL=y CONFIG_AUDIT=y CONFIG_AUDITSYSCALL=y CONFIG_LOG_BUF_SHIFT=17 CONFIG_HOTPLUG=y CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_ALL is not set CONFIG_KALLSYMS_EXTRA_PASS=y CONFIG_FUTEX=y CONFIG_EPOLL=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SHMEM=y CONFIG_CC_ALIGN_FUNCTIONS=0 CONFIG_CC_ALIGN_LABELS=0 CONFIG_CC_ALIGN_LOOPS=0 CONFIG_CC_ALIGN_JUMPS=0 # CONFIG_TINY_SHMEM is not set # # Loadable module support # CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y # CONFIG_MODULE_FORCE_UNLOAD is not set CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y # CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y # # Processor type and features # # CONFIG_MK8 is not set # CONFIG_MPSC is not set CONFIG_GENERIC_CPU=y CONFIG_X86_L1_CACHE_BYTES=128 CONFIG_X86_L1_CACHE_SHIFT=7 CONFIG_X86_TSC=y CONFIG_X86_GOOD_APIC=y CONFIG_MICROCODE=m CONFIG_X86_MSR=y CONFIG_X86_CPUID=y CONFIG_X86_IO_APIC=y CONFIG_X86_LOCAL_APIC=y CONFIG_MTRR=y # CONFIG_SMP is not set # CONFIG_PREEMPT is not set # CONFIG_NUMA is not set CONFIG_GART_IOMMU=y CONFIG_SWIOTLB=y CONFIG_X86_MCE=y CONFIG_GENERIC_HARDIRQS=y CONFIG_GENERIC_IRQ_PROBE=y # # Power management options # CONFIG_PM=y # CONFIG_PM_DEBUG is not set # CONFIG_SOFTWARE_SUSPEND is not set # # ACPI (Advanced Configuration and Power Interface) Support # CONFIG_ACPI=y CONFIG_ACPI_BOOT=y CONFIG_ACPI_INTERPRETER=y CONFIG_ACPI_SLEEP=y CONFIG_ACPI_SLEEP_PROC_FS=y CONFIG_ACPI_AC=m CONFIG_ACPI_BATTERY=m CONFIG_ACPI_BUTTON=m CONFIG_ACPI_VIDEO=m CONFIG_ACPI_FAN=y CONFIG_ACPI_PROCESSOR=y CONFIG_ACPI_THERMAL=y CONFIG_ACPI_ASUS=m CONFIG_ACPI_IBM=m CONFIG_ACPI_TOSHIBA=m CONFIG_ACPI_CUSTOM_DSDT=y CONFIG_ACPI_CUSTOM_DSDT_FILE="/home/rich/src/acpi/acer-1524wlmi/dsdt.hex" CONFIG_ACPI_BLACKLIST_YEAR=2001 # CONFIG_ACPI_DEBUG is not set CONFIG_ACPI_BUS=y CONFIG_ACPI_EC=y CONFIG_ACPI_POWER=y CONFIG_ACPI_PCI=y CONFIG_ACPI_SYSTEM=y # # CPU Frequency scaling # CONFIG_CPU_FREQ=y # CONFIG_CPU_FREQ_DEBUG is not set # CONFIG_CPU_FREQ_PROC_INTF is not set # CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y CONFIG_CPU_FREQ_GOV_PERFORMANCE=y CONFIG_CPU_FREQ_GOV_POWERSAVE=m CONFIG_CPU_FREQ_GOV_USERSPACE=y # CONFIG_CPU_FREQ_24_API is not set CONFIG_CPU_FREQ_GOV_ONDEMAND=m CONFIG_CPU_FREQ_TABLE=y # # CPUFreq processor drivers # CONFIG_X86_POWERNOW_K8=y CONFIG_X86_POWERNOW_K8_ACPI=y CONFIG_X86_SPEEDSTEP_CENTRINO=y CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI=y CONFIG_X86_ACPI_CPUFREQ=m # # shared options # # CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set # # Bus options (PCI etc.) # CONFIG_PCI=y CONFIG_PCI_DIRECT=y CONFIG_PCI_MMCONFIG=y # CONFIG_UNORDERED_IO is not set CONFIG_PCI_MSI=y CONFIG_PCI_LEGACY_PROC=y # CONFIG_PCI_NAMES is not set # # PCCARD (PCMCIA/CardBus) support # CONFIG_PCCARD=m # CONFIG_PCMCIA_DEBUG is not set # CONFIG_PCMCIA_OBSOLETE is not set CONFIG_PCMCIA=m CONFIG_CARDBUS=y # # PC-card bridges # CONFIG_YENTA=m CONFIG_PD6729=m CONFIG_I82092=m CONFIG_TCIC=m # # PCI Hotplug Support # CONFIG_HOTPLUG_PCI=y # CONFIG_HOTPLUG_PCI_FAKE is not set # CONFIG_HOTPLUG_PCI_ACPI is not set # CONFIG_HOTPLUG_PCI_CPCI is not set CONFIG_HOTPLUG_PCI_PCIE=m CONFIG_HOTPLUG_PCI_PCIE_POLL_EVENT_MODE=y CONFIG_HOTPLUG_PCI_SHPC=m CONFIG_HOTPLUG_PCI_SHPC_POLL_EVENT_MODE=y # # Executable file formats / Emulations # CONFIG_BINFMT_ELF=y CONFIG_BINFMT_MISC=y CONFIG_IA32_EMULATION=y # CONFIG_IA32_AOUT is not set CONFIG_COMPAT=y CONFIG_SYSVIPC_COMPAT=y CONFIG_UID16=y # # Device Drivers # # # Generic Driver Options # # CONFIG_STANDALONE is not set CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_FW_LOADER=y # CONFIG_DEBUG_DRIVER is not set # # Memory Technology Devices (MTD) # CONFIG_MTD=m # CONFIG_MTD_DEBUG is not set CONFIG_MTD_PARTITIONS=y CONFIG_MTD_CONCAT=m CONFIG_MTD_REDBOOT_PARTS=m # CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set # CONFIG_MTD_REDBOOT_PARTS_READONLY is not set CONFIG_MTD_CMDLINE_PARTS=y # # User Modules And Translation Layers # CONFIG_MTD_CHAR=m CONFIG_MTD_BLOCK=m CONFIG_MTD_BLOCK_RO=m CONFIG_FTL=m CONFIG_NFTL=m CONFIG_NFTL_RW=y CONFIG_INFTL=m # # RAM/ROM/Flash chip drivers # CONFIG_MTD_CFI=m CONFIG_MTD_JEDECPROBE=m CONFIG_MTD_GEN_PROBE=m # CONFIG_MTD_CFI_ADV_OPTIONS is not set CONFIG_MTD_MAP_BANK_WIDTH_1=y CONFIG_MTD_MAP_BANK_WIDTH_2=y CONFIG_MTD_MAP_BANK_WIDTH_4=y # CONFIG_MTD_MAP_BANK_WIDTH_8 is not set # CONFIG_MTD_MAP_BANK_WIDTH_16 is not set # CONFIG_MTD_MAP_BANK_WIDTH_32 is not set CONFIG_MTD_CFI_I1=y CONFIG_MTD_CFI_I2=y # CONFIG_MTD_CFI_I4 is not set # CONFIG_MTD_CFI_I8 is not set CONFIG_MTD_CFI_INTELEXT=m CONFIG_MTD_CFI_AMDSTD=m CONFIG_MTD_CFI_AMDSTD_RETRY=3 CONFIG_MTD_CFI_STAA=m CONFIG_MTD_CFI_UTIL=m CONFIG_MTD_RAM=m CONFIG_MTD_ROM=m CONFIG_MTD_ABSENT=m # # Mapping drivers for chip access # CONFIG_MTD_COMPLEX_MAPPINGS=y # CONFIG_MTD_PHYSMAP is not set # CONFIG_MTD_PNC2000 is not set CONFIG_MTD_SC520CDP=m CONFIG_MTD_NETSC520=m CONFIG_MTD_TS5500=m CONFIG_MTD_SBC_GXX=m CONFIG_MTD_ELAN_104NC=m CONFIG_MTD_SCx200_DOCFLASH=m # CONFIG_MTD_AMD76XROM is not set # CONFIG_MTD_ICHXROM is not set CONFIG_MTD_SCB2_FLASH=m # CONFIG_MTD_NETtel is not set # CONFIG_MTD_DILNETPC is not set # CONFIG_MTD_L440GX is not set CONFIG_MTD_PCI=m # # Self-contained MTD device drivers # CONFIG_MTD_PMC551=m # CONFIG_MTD_PMC551_BUGFIX is not set # CONFIG_MTD_PMC551_DEBUG is not set # CONFIG_MTD_SLRAM is not set # CONFIG_MTD_PHRAM is not set CONFIG_MTD_MTDRAM=m CONFIG_MTDRAM_TOTAL_SIZE=4096 CONFIG_MTDRAM_ERASE_SIZE=128 # CONFIG_MTD_BLKMTD is not set # # Disk-On-Chip Device Drivers # CONFIG_MTD_DOC2000=m # CONFIG_MTD_DOC2001 is not set CONFIG_MTD_DOC2001PLUS=m CONFIG_MTD_DOCPROBE=m CONFIG_MTD_DOCECC=m # CONFIG_MTD_DOCPROBE_ADVANCED is not set CONFIG_MTD_DOCPROBE_ADDRESS=0 # # NAND Flash Device Drivers # CONFIG_MTD_NAND=m # CONFIG_MTD_NAND_VERIFY_WRITE is not set CONFIG_MTD_NAND_IDS=m # CONFIG_MTD_NAND_DISKONCHIP is not set # # Parallel port support # CONFIG_PARPORT=m CONFIG_PARPORT_PC=m CONFIG_PARPORT_PC_CML1=m CONFIG_PARPORT_SERIAL=m # CONFIG_PARPORT_PC_FIFO is not set # CONFIG_PARPORT_PC_SUPERIO is not set CONFIG_PARPORT_PC_PCMCIA=m # CONFIG_PARPORT_OTHER is not set CONFIG_PARPORT_1284=y # # Plug and Play support # CONFIG_PNP=y # CONFIG_PNP_DEBUG is not set # # Protocols # # CONFIG_PNPACPI is not set # # Block devices # CONFIG_BLK_DEV_FD=m # CONFIG_PARIDE is not set CONFIG_BLK_CPQ_DA=m CONFIG_BLK_CPQ_CISS_DA=m CONFIG_CISS_SCSI_TAPE=y CONFIG_BLK_DEV_DAC960=m CONFIG_BLK_DEV_UMEM=m CONFIG_BLK_DEV_LOOP=m CONFIG_BLK_DEV_CRYPTOLOOP=m CONFIG_BLK_DEV_NBD=m CONFIG_BLK_DEV_SX8=m # CONFIG_BLK_DEV_UB is not set CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=16384 CONFIG_BLK_DEV_INITRD=y CONFIG_INITRAMFS_SOURCE="" CONFIG_LBD=y CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set # # IO Schedulers # CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y CONFIG_IOSCHED_CFQ=y # # ATA/ATAPI/MFM/RLL support # CONFIG_IDE=y CONFIG_BLK_DEV_IDE=y # # Please see Documentation/ide.txt for help/info on IDE drives # # CONFIG_BLK_DEV_IDE_SATA is not set # CONFIG_BLK_DEV_HD_IDE is not set CONFIG_BLK_DEV_IDEDISK=y CONFIG_IDEDISK_MULTI_MODE=y CONFIG_BLK_DEV_IDECS=m CONFIG_BLK_DEV_IDECD=y # CONFIG_BLK_DEV_IDETAPE is not set CONFIG_BLK_DEV_IDEFLOPPY=y CONFIG_BLK_DEV_IDESCSI=m # CONFIG_IDE_TASK_IOCTL is not set # # IDE chipset support/bugfixes # CONFIG_IDE_GENERIC=y # CONFIG_BLK_DEV_CMD640 is not set # CONFIG_BLK_DEV_IDEPNP is not set CONFIG_BLK_DEV_IDEPCI=y CONFIG_IDEPCI_SHARE_IRQ=y # CONFIG_BLK_DEV_OFFBOARD is not set CONFIG_BLK_DEV_GENERIC=y # CONFIG_BLK_DEV_OPTI621 is not set CONFIG_BLK_DEV_RZ1000=y CONFIG_BLK_DEV_IDEDMA_PCI=y # CONFIG_BLK_DEV_IDEDMA_FORCED is not set CONFIG_IDEDMA_PCI_AUTO=y # CONFIG_IDEDMA_ONLYDISK is not set CONFIG_BLK_DEV_AEC62XX=y CONFIG_BLK_DEV_ALI15X3=y # CONFIG_WDC_ALI15X3 is not set CONFIG_BLK_DEV_AMD74XX=y CONFIG_BLK_DEV_ATIIXP=y CONFIG_BLK_DEV_CMD64X=y CONFIG_BLK_DEV_TRIFLEX=y CONFIG_BLK_DEV_CY82C693=y CONFIG_BLK_DEV_CS5520=y CONFIG_BLK_DEV_CS5530=y CONFIG_BLK_DEV_HPT34X=y # CONFIG_HPT34X_AUTODMA is not set CONFIG_BLK_DEV_HPT366=y # CONFIG_BLK_DEV_SC1200 is not set CONFIG_BLK_DEV_PIIX=y # CONFIG_BLK_DEV_NS87415 is not set CONFIG_BLK_DEV_PDC202XX_OLD=y # CONFIG_PDC202XX_BURST is not set CONFIG_BLK_DEV_PDC202XX_NEW=y CONFIG_PDC202XX_FORCE=y CONFIG_BLK_DEV_SVWKS=y CONFIG_BLK_DEV_SIIMAGE=y CONFIG_BLK_DEV_SIS5513=y CONFIG_BLK_DEV_SLC90E66=y # CONFIG_BLK_DEV_TRM290 is not set CONFIG_BLK_DEV_VIA82CXXX=y # CONFIG_IDE_ARM is not set CONFIG_BLK_DEV_IDEDMA=y # CONFIG_IDEDMA_IVB is not set CONFIG_IDEDMA_AUTO=y # CONFIG_BLK_DEV_HD is not set # # SCSI device support # CONFIG_SCSI=m CONFIG_SCSI_PROC_FS=y # # SCSI support type (disk, tape, CD-ROM) # CONFIG_BLK_DEV_SD=m CONFIG_CHR_DEV_ST=m CONFIG_CHR_DEV_OSST=m CONFIG_BLK_DEV_SR=m CONFIG_BLK_DEV_SR_VENDOR=y CONFIG_CHR_DEV_SG=m # # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # # CONFIG_SCSI_MULTI_LUN is not set CONFIG_SCSI_CONSTANTS=y CONFIG_SCSI_LOGGING=y # # SCSI Transport Attributes # CONFIG_SCSI_SPI_ATTRS=m CONFIG_SCSI_FC_ATTRS=m # # SCSI low-level drivers # CONFIG_BLK_DEV_3W_XXXX_RAID=m CONFIG_SCSI_3W_9XXX=m CONFIG_SCSI_ACARD=m CONFIG_SCSI_AACRAID=m CONFIG_SCSI_AIC7XXX=m CONFIG_AIC7XXX_CMDS_PER_DEVICE=4 CONFIG_AIC7XXX_RESET_DELAY_MS=15000 # CONFIG_AIC7XXX_DEBUG_ENABLE is not set CONFIG_AIC7XXX_DEBUG_MASK=0 # CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set CONFIG_SCSI_AIC7XXX_OLD=m CONFIG_SCSI_AIC79XX=m CONFIG_AIC79XX_CMDS_PER_DEVICE=4 CONFIG_AIC79XX_RESET_DELAY_MS=15000 # CONFIG_AIC79XX_ENABLE_RD_STRM is not set # CONFIG_AIC79XX_DEBUG_ENABLE is not set CONFIG_AIC79XX_DEBUG_MASK=0 # CONFIG_AIC79XX_REG_PRETTY_PRINT is not set CONFIG_MEGARAID_NEWGEN=y CONFIG_MEGARAID_MM=m CONFIG_MEGARAID_MAILBOX=m CONFIG_SCSI_SATA=y CONFIG_SCSI_SATA_AHCI=m CONFIG_SCSI_SATA_SVW=m CONFIG_SCSI_ATA_PIIX=m CONFIG_SCSI_SATA_NV=m CONFIG_SCSI_SATA_PROMISE=m CONFIG_SCSI_SATA_SX4=m CONFIG_SCSI_SATA_SIL=m CONFIG_SCSI_SATA_SIS=m CONFIG_SCSI_SATA_ULI=m CONFIG_SCSI_SATA_VIA=m CONFIG_SCSI_SATA_VITESSE=m CONFIG_SCSI_BUSLOGIC=m # CONFIG_SCSI_OMIT_FLASHPOINT is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_EATA_PIO is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set CONFIG_SCSI_GDTH=m CONFIG_SCSI_IPS=m CONFIG_SCSI_INITIO=m CONFIG_SCSI_INIA100=m CONFIG_SCSI_PPA=m CONFIG_SCSI_IMM=m # CONFIG_SCSI_IZIP_EPP16 is not set # CONFIG_SCSI_IZIP_SLOW_CTR is not set CONFIG_SCSI_SYM53C8XX_2=m CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set # CONFIG_SCSI_IPR is not set CONFIG_SCSI_QLOGIC_ISP=m # CONFIG_SCSI_QLOGIC_FC is not set CONFIG_SCSI_QLOGIC_1280=m CONFIG_SCSI_QLOGIC_1280_1040=y CONFIG_SCSI_QLA2XXX=m CONFIG_SCSI_QLA21XX=m CONFIG_SCSI_QLA22XX=m CONFIG_SCSI_QLA2300=m CONFIG_SCSI_QLA2322=m CONFIG_SCSI_QLA6312=m CONFIG_SCSI_QLA6322=m # CONFIG_SCSI_DC395x is not set CONFIG_SCSI_DC390T=m # CONFIG_SCSI_DEBUG is not set # # PCMCIA SCSI adapter support # CONFIG_PCMCIA_FDOMAIN=m CONFIG_PCMCIA_QLOGIC=m CONFIG_PCMCIA_SYM53C500=m # # Multi-device support (RAID and LVM) # CONFIG_MD=y CONFIG_BLK_DEV_MD=y CONFIG_MD_LINEAR=m CONFIG_MD_RAID0=m CONFIG_MD_RAID1=m CONFIG_MD_RAID10=m CONFIG_MD_RAID5=m CONFIG_MD_RAID6=m CONFIG_MD_MULTIPATH=m # CONFIG_MD_FAULTY is not set CONFIG_BLK_DEV_DM=m CONFIG_DM_CRYPT=m CONFIG_DM_SNAPSHOT=m CONFIG_DM_MIRROR=m CONFIG_DM_ZERO=m # # Fusion MPT device support # CONFIG_FUSION=m CONFIG_FUSION_MAX_SGE=40 CONFIG_FUSION_CTL=m CONFIG_FUSION_LAN=m # # IEEE 1394 (FireWire) support # CONFIG_IEEE1394=m # # Subsystem Options # # CONFIG_IEEE1394_VERBOSEDEBUG is not set CONFIG_IEEE1394_OUI_DB=y # CONFIG_IEEE1394_EXTRA_CONFIG_ROMS is not set # # Device Drivers # # CONFIG_IEEE1394_PCILYNX is not set CONFIG_IEEE1394_OHCI1394=m # # Protocol Drivers # CONFIG_IEEE1394_VIDEO1394=m CONFIG_IEEE1394_SBP2=m # CONFIG_IEEE1394_SBP2_PHYS_DMA is not set # CONFIG_IEEE1394_ETH1394 is not set CONFIG_IEEE1394_DV1394=m CONFIG_IEEE1394_RAWIO=m CONFIG_IEEE1394_CMP=m CONFIG_IEEE1394_AMDTP=m # # I2O device support # CONFIG_I2O=m CONFIG_I2O_CONFIG=m CONFIG_I2O_BLOCK=m CONFIG_I2O_SCSI=m CONFIG_I2O_PROC=m # # Networking support # CONFIG_NET=y # # Networking options # CONFIG_PACKET=y CONFIG_PACKET_MMAP=y CONFIG_NETLINK_DEV=y CONFIG_UNIX=y CONFIG_NET_KEY=m CONFIG_INET=y CONFIG_IP_MULTICAST=y CONFIG_IP_ADVANCED_ROUTER=y CONFIG_IP_MULTIPLE_TABLES=y CONFIG_IP_ROUTE_FWMARK=y CONFIG_IP_ROUTE_MULTIPATH=y CONFIG_IP_ROUTE_VERBOSE=y # CONFIG_IP_PNP is not set CONFIG_NET_IPIP=m CONFIG_NET_IPGRE=m CONFIG_NET_IPGRE_BROADCAST=y CONFIG_IP_MROUTE=y CONFIG_IP_PIMSM_V1=y CONFIG_IP_PIMSM_V2=y # CONFIG_ARPD is not set CONFIG_SYN_COOKIES=y CONFIG_INET_AH=m CONFIG_INET_ESP=m CONFIG_INET_IPCOMP=m CONFIG_INET_TUNNEL=m CONFIG_IP_TCPDIAG=m CONFIG_IP_TCPDIAG_IPV6=y # # IP: Virtual Server Configuration # CONFIG_IP_VS=m # CONFIG_IP_VS_DEBUG is not set CONFIG_IP_VS_TAB_BITS=12 # # IPVS transport protocol load balancing support # CONFIG_IP_VS_PROTO_TCP=y CONFIG_IP_VS_PROTO_UDP=y CONFIG_IP_VS_PROTO_ESP=y CONFIG_IP_VS_PROTO_AH=y # # IPVS scheduler # CONFIG_IP_VS_RR=m CONFIG_IP_VS_WRR=m CONFIG_IP_VS_LC=m CONFIG_IP_VS_WLC=m CONFIG_IP_VS_LBLC=m CONFIG_IP_VS_LBLCR=m CONFIG_IP_VS_DH=m CONFIG_IP_VS_SH=m CONFIG_IP_VS_SED=m CONFIG_IP_VS_NQ=m # # IPVS application helper # CONFIG_IP_VS_FTP=m CONFIG_IPV6=m CONFIG_IPV6_PRIVACY=y CONFIG_INET6_AH=m CONFIG_INET6_ESP=m CONFIG_INET6_IPCOMP=m CONFIG_INET6_TUNNEL=m CONFIG_IPV6_TUNNEL=m CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set CONFIG_BRIDGE_NETFILTER=y # # IP: Netfilter Configuration # CONFIG_IP_NF_CONNTRACK=m CONFIG_IP_NF_CT_ACCT=y CONFIG_IP_NF_CONNTRACK_MARK=y CONFIG_IP_NF_CT_PROTO_SCTP=m CONFIG_IP_NF_FTP=m CONFIG_IP_NF_IRC=m CONFIG_IP_NF_TFTP=m CONFIG_IP_NF_AMANDA=m CONFIG_IP_NF_QUEUE=m CONFIG_IP_NF_IPTABLES=m CONFIG_IP_NF_MATCH_LIMIT=m CONFIG_IP_NF_MATCH_IPRANGE=m CONFIG_IP_NF_MATCH_MAC=m CONFIG_IP_NF_MATCH_PKTTYPE=m CONFIG_IP_NF_MATCH_MARK=m CONFIG_IP_NF_MATCH_MULTIPORT=m CONFIG_IP_NF_MATCH_TOS=m CONFIG_IP_NF_MATCH_RECENT=m CONFIG_IP_NF_MATCH_ECN=m CONFIG_IP_NF_MATCH_DSCP=m CONFIG_IP_NF_MATCH_AH_ESP=m CONFIG_IP_NF_MATCH_LENGTH=m CONFIG_IP_NF_MATCH_TTL=m CONFIG_IP_NF_MATCH_TCPMSS=m CONFIG_IP_NF_MATCH_HELPER=m CONFIG_IP_NF_MATCH_STATE=m CONFIG_IP_NF_MATCH_CONNTRACK=m CONFIG_IP_NF_MATCH_OWNER=m CONFIG_IP_NF_MATCH_PHYSDEV=m CONFIG_IP_NF_MATCH_ADDRTYPE=m CONFIG_IP_NF_MATCH_REALM=m CONFIG_IP_NF_MATCH_SCTP=m CONFIG_IP_NF_MATCH_COMMENT=m CONFIG_IP_NF_MATCH_CONNMARK=m CONFIG_IP_NF_MATCH_HASHLIMIT=m CONFIG_IP_NF_FILTER=m CONFIG_IP_NF_TARGET_REJECT=m CONFIG_IP_NF_TARGET_LOG=m CONFIG_IP_NF_TARGET_ULOG=m CONFIG_IP_NF_TARGET_TCPMSS=m CONFIG_IP_NF_NAT=m CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m CONFIG_IP_NF_NAT_LOCAL=y CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m CONFIG_IP_NF_NAT_TFTP=m CONFIG_IP_NF_NAT_AMANDA=m CONFIG_IP_NF_MANGLE=m CONFIG_IP_NF_TARGET_TOS=m CONFIG_IP_NF_TARGET_ECN=m CONFIG_IP_NF_TARGET_DSCP=m CONFIG_IP_NF_TARGET_MARK=m CONFIG_IP_NF_TARGET_CLASSIFY=m CONFIG_IP_NF_TARGET_CONNMARK=m CONFIG_IP_NF_TARGET_CLUSTERIP=m CONFIG_IP_NF_RAW=m CONFIG_IP_NF_TARGET_NOTRACK=m CONFIG_IP_NF_ARPTABLES=m CONFIG_IP_NF_ARPFILTER=m CONFIG_IP_NF_ARP_MANGLE=m # CONFIG_IP_NF_COMPAT_IPCHAINS is not set # CONFIG_IP_NF_COMPAT_IPFWADM is not set # # IPv6: Netfilter Configuration # # CONFIG_IP6_NF_QUEUE is not set CONFIG_IP6_NF_IPTABLES=m CONFIG_IP6_NF_MATCH_LIMIT=m CONFIG_IP6_NF_MATCH_MAC=m CONFIG_IP6_NF_MATCH_RT=m CONFIG_IP6_NF_MATCH_OPTS=m CONFIG_IP6_NF_MATCH_FRAG=m CONFIG_IP6_NF_MATCH_HL=m CONFIG_IP6_NF_MATCH_MULTIPORT=m CONFIG_IP6_NF_MATCH_OWNER=m CONFIG_IP6_NF_MATCH_MARK=m CONFIG_IP6_NF_MATCH_IPV6HEADER=m CONFIG_IP6_NF_MATCH_AHESP=m CONFIG_IP6_NF_MATCH_LENGTH=m CONFIG_IP6_NF_MATCH_EUI64=m CONFIG_IP6_NF_MATCH_PHYSDEV=m CONFIG_IP6_NF_FILTER=m CONFIG_IP6_NF_TARGET_LOG=m CONFIG_IP6_NF_MANGLE=m CONFIG_IP6_NF_TARGET_MARK=m CONFIG_IP6_NF_RAW=m # # Bridge: Netfilter Configuration # CONFIG_BRIDGE_NF_EBTABLES=m CONFIG_BRIDGE_EBT_BROUTE=m CONFIG_BRIDGE_EBT_T_FILTER=m CONFIG_BRIDGE_EBT_T_NAT=m CONFIG_BRIDGE_EBT_802_3=m CONFIG_BRIDGE_EBT_AMONG=m CONFIG_BRIDGE_EBT_ARP=m CONFIG_BRIDGE_EBT_IP=m CONFIG_BRIDGE_EBT_LIMIT=m CONFIG_BRIDGE_EBT_MARK=m CONFIG_BRIDGE_EBT_PKTTYPE=m CONFIG_BRIDGE_EBT_STP=m CONFIG_BRIDGE_EBT_VLAN=m CONFIG_BRIDGE_EBT_ARPREPLY=m CONFIG_BRIDGE_EBT_DNAT=m CONFIG_BRIDGE_EBT_MARK_T=m CONFIG_BRIDGE_EBT_REDIRECT=m CONFIG_BRIDGE_EBT_SNAT=m CONFIG_BRIDGE_EBT_LOG=m CONFIG_XFRM=y CONFIG_XFRM_USER=y # # SCTP Configuration (EXPERIMENTAL) # CONFIG_IP_SCTP=m # CONFIG_SCTP_DBG_MSG is not set # CONFIG_SCTP_DBG_OBJCNT is not set # CONFIG_SCTP_HMAC_NONE is not set # CONFIG_SCTP_HMAC_SHA1 is not set CONFIG_SCTP_HMAC_MD5=y CONFIG_ATM=m CONFIG_ATM_CLIP=m # CONFIG_ATM_CLIP_NO_ICMP is not set CONFIG_ATM_LANE=m # CONFIG_ATM_MPOA is not set CONFIG_ATM_BR2684=m # CONFIG_ATM_BR2684_IPFILTER is not set CONFIG_BRIDGE=m CONFIG_VLAN_8021Q=m # CONFIG_DECNET is not set CONFIG_LLC=y # CONFIG_LLC2 is not set CONFIG_IPX=m # CONFIG_IPX_INTERN is not set CONFIG_ATALK=m CONFIG_DEV_APPLETALK=y CONFIG_IPDDP=m CONFIG_IPDDP_ENCAP=y CONFIG_IPDDP_DECAP=y # CONFIG_X25 is not set # CONFIG_LAPB is not set CONFIG_NET_DIVERT=y # CONFIG_ECONET is not set CONFIG_WAN_ROUTER=m # # QoS and/or fair queueing # CONFIG_NET_SCHED=y CONFIG_NET_SCH_CLK_JIFFIES=y # CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set # CONFIG_NET_SCH_CLK_CPU is not set CONFIG_NET_SCH_CBQ=m CONFIG_NET_SCH_HTB=m CONFIG_NET_SCH_HFSC=m CONFIG_NET_SCH_ATM=m CONFIG_NET_SCH_PRIO=m CONFIG_NET_SCH_RED=m CONFIG_NET_SCH_SFQ=m CONFIG_NET_SCH_TEQL=m CONFIG_NET_SCH_TBF=m CONFIG_NET_SCH_GRED=m CONFIG_NET_SCH_DSMARK=m CONFIG_NET_SCH_NETEM=m CONFIG_NET_SCH_INGRESS=m CONFIG_NET_QOS=y CONFIG_NET_ESTIMATOR=y CONFIG_NET_CLS=y CONFIG_NET_CLS_TCINDEX=m CONFIG_NET_CLS_ROUTE4=m CONFIG_NET_CLS_ROUTE=y CONFIG_NET_CLS_FW=m CONFIG_NET_CLS_U32=m CONFIG_CLS_U32_PERF=y CONFIG_NET_CLS_IND=y CONFIG_NET_CLS_RSVP=m CONFIG_NET_CLS_RSVP6=m # CONFIG_NET_CLS_ACT is not set CONFIG_NET_CLS_POLICE=y # # Network testing # # CONFIG_NET_PKTGEN is not set CONFIG_NETPOLL=y # CONFIG_NETPOLL_RX is not set CONFIG_NETPOLL_TRAP=y CONFIG_NET_POLL_CONTROLLER=y # CONFIG_HAMRADIO is not set CONFIG_IRDA=m # # IrDA protocols # CONFIG_IRLAN=m CONFIG_IRNET=m CONFIG_IRCOMM=m # CONFIG_IRDA_ULTRA is not set # # IrDA options # CONFIG_IRDA_CACHE_LAST_LSAP=y CONFIG_IRDA_FAST_RR=y # CONFIG_IRDA_DEBUG is not set # # Infrared-port device drivers # # # SIR device drivers # CONFIG_IRTTY_SIR=m # # Dongle support # CONFIG_DONGLE=y CONFIG_ESI_DONGLE=m CONFIG_ACTISYS_DONGLE=m CONFIG_TEKRAM_DONGLE=m CONFIG_LITELINK_DONGLE=m CONFIG_MA600_DONGLE=m CONFIG_GIRBIL_DONGLE=m CONFIG_MCP2120_DONGLE=m CONFIG_OLD_BELKIN_DONGLE=m CONFIG_ACT200L_DONGLE=m # # Old SIR device drivers # CONFIG_IRPORT_SIR=m # # Old Serial dongle support # # CONFIG_DONGLE_OLD is not set # # FIR device drivers # CONFIG_USB_IRDA=m CONFIG_SIGMATEL_FIR=m # CONFIG_VLSI_FIR is not set CONFIG_BT=m CONFIG_BT_L2CAP=m CONFIG_BT_SCO=m CONFIG_BT_RFCOMM=m CONFIG_BT_RFCOMM_TTY=y CONFIG_BT_BNEP=m CONFIG_BT_BNEP_MC_FILTER=y CONFIG_BT_BNEP_PROTO_FILTER=y CONFIG_BT_CMTP=m CONFIG_BT_HIDP=m # # Bluetooth device drivers # CONFIG_BT_HCIUSB=m CONFIG_BT_HCIUSB_SCO=y CONFIG_BT_HCIUART=m CONFIG_BT_HCIUART_H4=y CONFIG_BT_HCIUART_BCSP=y CONFIG_BT_HCIUART_BCSP_TXCRC=y CONFIG_BT_HCIBCM203X=m CONFIG_BT_HCIBFUSB=m CONFIG_BT_HCIDTL1=m CONFIG_BT_HCIBT3C=m CONFIG_BT_HCIBLUECARD=m CONFIG_BT_HCIBTUART=m CONFIG_BT_HCIVHCI=m CONFIG_NETDEVICES=y CONFIG_DUMMY=m CONFIG_BONDING=m CONFIG_EQUALIZER=m CONFIG_TUN=m CONFIG_ETHERTAP=m CONFIG_NET_SB1000=m # # ARCnet devices # # CONFIG_ARCNET is not set # # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y CONFIG_MII=m CONFIG_HAPPYMEAL=m CONFIG_SUNGEM=m CONFIG_NET_VENDOR_3COM=y CONFIG_VORTEX=m CONFIG_TYPHOON=m # # Tulip family network device support # CONFIG_NET_TULIP=y CONFIG_DE2104X=m CONFIG_TULIP=m # CONFIG_TULIP_MWI is not set CONFIG_TULIP_MMIO=y # CONFIG_TULIP_NAPI is not set CONFIG_DE4X5=m CONFIG_WINBOND_840=m CONFIG_DM9102=m CONFIG_PCMCIA_XIRCOM=m CONFIG_PCMCIA_XIRTULIP=m # CONFIG_HP100 is not set CONFIG_NET_PCI=y CONFIG_PCNET32=m CONFIG_AMD8111_ETH=m CONFIG_AMD8111E_NAPI=y CONFIG_ADAPTEC_STARFIRE=m CONFIG_ADAPTEC_STARFIRE_NAPI=y CONFIG_B44=m CONFIG_FORCEDETH=m CONFIG_DGRS=m CONFIG_EEPRO100=m # CONFIG_EEPRO100_PIO is not set CONFIG_E100=m CONFIG_E100_NAPI=y CONFIG_FEALNX=m CONFIG_NATSEMI=m CONFIG_NE2K_PCI=m CONFIG_8139CP=m CONFIG_8139TOO=m CONFIG_8139TOO_PIO=y # CONFIG_8139TOO_TUNE_TWISTER is not set CONFIG_8139TOO_8129=y # CONFIG_8139_OLD_RX_RESET is not set CONFIG_SIS900=m CONFIG_EPIC100=m CONFIG_SUNDANCE=m # CONFIG_SUNDANCE_MMIO is not set CONFIG_VIA_RHINE=m CONFIG_VIA_RHINE_MMIO=y # # Ethernet (1000 Mbit) # CONFIG_ACENIC=m # CONFIG_ACENIC_OMIT_TIGON_I is not set CONFIG_DL2K=m CONFIG_E1000=m CONFIG_E1000_NAPI=y CONFIG_NS83820=m CONFIG_HAMACHI=m CONFIG_YELLOWFIN=m CONFIG_R8169=m CONFIG_R8169_NAPI=y CONFIG_SK98LIN=m CONFIG_VIA_VELOCITY=m CONFIG_TIGON3=m # # Ethernet (10000 Mbit) # CONFIG_IXGB=m CONFIG_IXGB_NAPI=y CONFIG_S2IO=m CONFIG_S2IO_NAPI=y # # Token Ring devices # CONFIG_TR=y CONFIG_IBMOL=m CONFIG_3C359=m CONFIG_TMS380TR=m CONFIG_TMSPCI=m CONFIG_ABYSS=m # # Wireless LAN (non-hamradio) # CONFIG_NET_RADIO=y # # Obsolete Wireless cards support (pre-802.11) # # CONFIG_STRIP is not set CONFIG_PCMCIA_WAVELAN=m CONFIG_PCMCIA_NETWAVE=m # # Wireless 802.11 Frequency Hopping cards support # CONFIG_PCMCIA_RAYCS=m # # Wireless 802.11b ISA/PCI cards support # CONFIG_HERMES=m CONFIG_PLX_HERMES=m CONFIG_TMD_HERMES=m CONFIG_PCI_HERMES=m CONFIG_ATMEL=m CONFIG_PCI_ATMEL=m # # Wireless 802.11b Pcmcia/Cardbus cards support # CONFIG_PCMCIA_HERMES=m CONFIG_AIRO_CS=m CONFIG_PCMCIA_ATMEL=m CONFIG_PCMCIA_WL3501=m # # Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support # CONFIG_PRISM54=m CONFIG_NET_WIRELESS=y # # PCMCIA network device support # CONFIG_NET_PCMCIA=y CONFIG_PCMCIA_3C589=m CONFIG_PCMCIA_3C574=m CONFIG_PCMCIA_FMVJ18X=m CONFIG_PCMCIA_PCNET=m CONFIG_PCMCIA_NMCLAN=m CONFIG_PCMCIA_SMC91C92=m CONFIG_PCMCIA_XIRC2PS=m CONFIG_PCMCIA_AXNET=m # # Wan interfaces # # CONFIG_WAN is not set # # ATM drivers # CONFIG_ATM_TCP=m CONFIG_ATM_LANAI=m CONFIG_ATM_ENI=m # CONFIG_ATM_ENI_DEBUG is not set # CONFIG_ATM_ENI_TUNE_BURST is not set CONFIG_ATM_FIRESTREAM=m # CONFIG_ATM_ZATM is not set CONFIG_ATM_IDT77252=m # CONFIG_ATM_IDT77252_DEBUG is not set # CONFIG_ATM_IDT77252_RCV_ALL is not set CONFIG_ATM_IDT77252_USE_SUNI=y CONFIG_ATM_AMBASSADOR=m # CONFIG_ATM_AMBASSADOR_DEBUG is not set CONFIG_ATM_HORIZON=m # CONFIG_ATM_HORIZON_DEBUG is not set CONFIG_ATM_FORE200E_MAYBE=m # CONFIG_ATM_FORE200E_PCA is not set CONFIG_ATM_HE=m # CONFIG_ATM_HE_USE_SUNI is not set CONFIG_FDDI=y # CONFIG_DEFXX is not set CONFIG_SKFP=m # CONFIG_HIPPI is not set CONFIG_PLIP=m CONFIG_PPP=m CONFIG_PPP_MULTILINK=y CONFIG_PPP_FILTER=y CONFIG_PPP_ASYNC=m CONFIG_PPP_SYNC_TTY=m CONFIG_PPP_DEFLATE=m # CONFIG_PPP_BSDCOMP is not set CONFIG_PPPOE=m CONFIG_PPPOATM=m CONFIG_SLIP=m CONFIG_SLIP_COMPRESSED=y CONFIG_SLIP_SMART=y # CONFIG_SLIP_MODE_SLIP6 is not set CONFIG_NET_FC=y # CONFIG_SHAPER is not set CONFIG_NETCONSOLE=m # # ISDN subsystem # CONFIG_ISDN=m # # Old ISDN4Linux # CONFIG_ISDN_I4L=m CONFIG_ISDN_PPP=y CONFIG_ISDN_PPP_VJ=y CONFIG_ISDN_MPP=y CONFIG_IPPP_FILTER=y # CONFIG_ISDN_PPP_BSDCOMP is not set CONFIG_ISDN_AUDIO=y CONFIG_ISDN_TTY_FAX=y # # ISDN feature submodules # CONFIG_ISDN_DRV_LOOP=m CONFIG_ISDN_DIVERSION=m # # ISDN4Linux hardware drivers # # # Passive cards # CONFIG_ISDN_DRV_HISAX=m # # D-channel protocol features # CONFIG_HISAX_EURO=y CONFIG_DE_AOC=y CONFIG_HISAX_NO_SENDCOMPLETE=y CONFIG_HISAX_NO_LLC=y CONFIG_HISAX_NO_KEYPAD=y CONFIG_HISAX_1TR6=y CONFIG_HISAX_NI1=y CONFIG_HISAX_MAX_CARDS=8 # # HiSax supported cards # CONFIG_HISAX_16_3=y CONFIG_HISAX_TELESPCI=y CONFIG_HISAX_S0BOX=y CONFIG_HISAX_FRITZPCI=y CONFIG_HISAX_AVM_A1_PCMCIA=y CONFIG_HISAX_ELSA=y CONFIG_HISAX_DIEHLDIVA=y CONFIG_HISAX_SEDLBAUER=y CONFIG_HISAX_NETJET=y CONFIG_HISAX_NETJET_U=y CONFIG_HISAX_NICCY=y CONFIG_HISAX_BKM_A4T=y CONFIG_HISAX_SCT_QUADRO=y CONFIG_HISAX_GAZEL=y CONFIG_HISAX_HFC_PCI=y CONFIG_HISAX_W6692=y CONFIG_HISAX_HFC_SX=y CONFIG_HISAX_ENTERNOW_PCI=y # CONFIG_HISAX_DEBUG is not set # # HiSax PCMCIA card service modules # CONFIG_HISAX_SEDLBAUER_CS=m CONFIG_HISAX_ELSA_CS=m CONFIG_HISAX_AVM_A1_CS=m CONFIG_HISAX_TELES_CS=m # # HiSax sub driver modules # CONFIG_HISAX_ST5481=m CONFIG_HISAX_HFCUSB=m CONFIG_HISAX_FRITZ_PCIPNP=m CONFIG_HISAX_HDLC=y # # Active cards # CONFIG_ISDN_DRV_TPAM=m CONFIG_HYSDN=m CONFIG_HYSDN_CAPI=y # # CAPI subsystem # CONFIG_ISDN_CAPI=m CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON=y CONFIG_ISDN_CAPI_MIDDLEWARE=y CONFIG_ISDN_CAPI_CAPI20=m CONFIG_ISDN_CAPI_CAPIFS_BOOL=y CONFIG_ISDN_CAPI_CAPIFS=m CONFIG_ISDN_CAPI_CAPIDRV=m # # CAPI hardware drivers # # # Active AVM cards # CONFIG_CAPI_AVM=y CONFIG_ISDN_DRV_AVMB1_B1PCI=m CONFIG_ISDN_DRV_AVMB1_B1PCIV4=y CONFIG_ISDN_DRV_AVMB1_B1PCMCIA=m CONFIG_ISDN_DRV_AVMB1_AVM_CS=m CONFIG_ISDN_DRV_AVMB1_T1PCI=m CONFIG_ISDN_DRV_AVMB1_C4=m # # Active Eicon DIVA Server cards # # CONFIG_CAPI_EICON is not set # # Telephony Support # # CONFIG_PHONE is not set # # Input device support # CONFIG_INPUT=y # # Userland interfaces # CONFIG_INPUT_MOUSEDEV=y # CONFIG_INPUT_MOUSEDEV_PSAUX is not set CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 CONFIG_INPUT_JOYDEV=m # CONFIG_INPUT_TSDEV is not set CONFIG_INPUT_EVDEV=y # CONFIG_INPUT_EVBUG is not set # # Input I/O drivers # CONFIG_GAMEPORT=m CONFIG_SOUND_GAMEPORT=m CONFIG_GAMEPORT_NS558=m CONFIG_GAMEPORT_L4=m CONFIG_GAMEPORT_EMU10K1=m CONFIG_GAMEPORT_VORTEX=m CONFIG_GAMEPORT_FM801=m CONFIG_GAMEPORT_CS461x=m CONFIG_SERIO=y CONFIG_SERIO_I8042=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PARKBD is not set # CONFIG_SERIO_PCIPS2 is not set # CONFIG_SERIO_RAW is not set # # Input Device Drivers # CONFIG_INPUT_KEYBOARD=y CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_SUNKBD is not set # CONFIG_KEYBOARD_LKKBD is not set # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_NEWTON is not set CONFIG_INPUT_MOUSE=y CONFIG_MOUSE_PS2=y CONFIG_MOUSE_SERIAL=m CONFIG_MOUSE_VSXXXAA=m CONFIG_INPUT_JOYSTICK=y CONFIG_JOYSTICK_ANALOG=m CONFIG_JOYSTICK_A3D=m CONFIG_JOYSTICK_ADI=m CONFIG_JOYSTICK_COBRA=m CONFIG_JOYSTICK_GF2K=m CONFIG_JOYSTICK_GRIP=m CONFIG_JOYSTICK_GRIP_MP=m CONFIG_JOYSTICK_GUILLEMOT=m CONFIG_JOYSTICK_INTERACT=m CONFIG_JOYSTICK_SIDEWINDER=m CONFIG_JOYSTICK_TMDC=m CONFIG_JOYSTICK_IFORCE=m CONFIG_JOYSTICK_IFORCE_USB=y CONFIG_JOYSTICK_IFORCE_232=y CONFIG_JOYSTICK_WARRIOR=m CONFIG_JOYSTICK_MAGELLAN=m CONFIG_JOYSTICK_SPACEORB=m CONFIG_JOYSTICK_SPACEBALL=m CONFIG_JOYSTICK_STINGER=m CONFIG_JOYSTICK_TWIDDLER=m CONFIG_JOYSTICK_DB9=m CONFIG_JOYSTICK_GAMECON=m CONFIG_JOYSTICK_TURBOGRAFX=m CONFIG_JOYSTICK_JOYDUMP=m CONFIG_INPUT_TOUCHSCREEN=y CONFIG_TOUCHSCREEN_GUNZE=m CONFIG_INPUT_MISC=y CONFIG_INPUT_PCSPKR=m CONFIG_INPUT_UINPUT=m # # Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_HW_CONSOLE=y CONFIG_SERIAL_NONSTANDARD=y # CONFIG_COMPUTONE is not set CONFIG_ROCKETPORT=m # CONFIG_CYCLADES is not set # CONFIG_DIGIEPCA is not set # CONFIG_DIGI is not set # CONFIG_MOXA_INTELLIO is not set # CONFIG_MOXA_SMARTIO is not set # CONFIG_ISI is not set # CONFIG_SYNCLINK is not set # CONFIG_SYNCLINKMP is not set CONFIG_N_HDLC=m # CONFIG_RISCOM8 is not set # CONFIG_SPECIALIX is not set # CONFIG_SX is not set # CONFIG_RIO is not set CONFIG_STALDRV=y # CONFIG_STALLION is not set # CONFIG_ISTALLION is not set # # Serial drivers # CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_CS=m # CONFIG_SERIAL_8250_ACPI is not set CONFIG_SERIAL_8250_NR_UARTS=4 CONFIG_SERIAL_8250_EXTENDED=y # CONFIG_SERIAL_8250_MANY_PORTS is not set CONFIG_SERIAL_8250_SHARE_IRQ=y CONFIG_SERIAL_8250_DETECT_IRQ=y CONFIG_SERIAL_8250_MULTIPORT=y CONFIG_SERIAL_8250_RSA=y # # Non-8250 serial port support # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y # CONFIG_LEGACY_PTYS is not set CONFIG_PRINTER=m CONFIG_LP_CONSOLE=y CONFIG_PPDEV=m CONFIG_TIPAR=m # # IPMI # CONFIG_IPMI_HANDLER=m # CONFIG_IPMI_PANIC_EVENT is not set CONFIG_IPMI_DEVICE_INTERFACE=m CONFIG_IPMI_SI=m CONFIG_IPMI_WATCHDOG=m CONFIG_IPMI_POWEROFF=m # # Watchdog Cards # CONFIG_WATCHDOG=y # CONFIG_WATCHDOG_NOWAYOUT is not set # # Watchdog Device Drivers # CONFIG_SOFT_WATCHDOG=m CONFIG_ACQUIRE_WDT=m CONFIG_ADVANTECH_WDT=m CONFIG_ALIM1535_WDT=m CONFIG_ALIM7101_WDT=m CONFIG_SC520_WDT=m CONFIG_EUROTECH_WDT=m CONFIG_IB700_WDT=m CONFIG_WAFER_WDT=m CONFIG_I8XX_TCO=m CONFIG_SC1200_WDT=m # CONFIG_SCx200_WDT is not set # CONFIG_60XX_WDT is not set CONFIG_CPU5_WDT=m CONFIG_W83627HF_WDT=m CONFIG_W83877F_WDT=m CONFIG_MACHZ_WDT=m # # PCI-based Watchdog Cards # CONFIG_PCIPCWATCHDOG=m CONFIG_WDTPCI=m CONFIG_WDT_501_PCI=y # # USB-based Watchdog Cards # CONFIG_USBPCWATCHDOG=m CONFIG_HW_RANDOM=m # CONFIG_NVRAM is not set CONFIG_RTC=y CONFIG_DTLK=m CONFIG_R3964=m # CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # # CONFIG_FTAPE is not set CONFIG_AGP=y CONFIG_AGP_AMD64=y CONFIG_AGP_INTEL_MCH=y CONFIG_DRM=y CONFIG_DRM_TDFX=m CONFIG_DRM_R128=m CONFIG_DRM_RADEON=m CONFIG_DRM_SIS=m # # PCMCIA character devices # CONFIG_SYNCLINK_CS=m CONFIG_MWAVE=m # CONFIG_RAW_DRIVER is not set # CONFIG_HPET is not set CONFIG_HANGCHECK_TIMER=m # # I2C support # CONFIG_I2C=m CONFIG_I2C_CHARDEV=m # # I2C Algorithms # CONFIG_I2C_ALGOBIT=m CONFIG_I2C_ALGOPCF=m CONFIG_I2C_ALGOPCA=m # # I2C Hardware Bus support # CONFIG_I2C_ALI1535=m CONFIG_I2C_ALI1563=m CONFIG_I2C_ALI15X3=m CONFIG_I2C_AMD756=m CONFIG_I2C_AMD756_S4882=m CONFIG_I2C_AMD8111=m CONFIG_I2C_I801=m CONFIG_I2C_I810=m CONFIG_I2C_ISA=m CONFIG_I2C_NFORCE2=m # CONFIG_I2C_PARPORT is not set # CONFIG_I2C_PARPORT_LIGHT is not set CONFIG_I2C_PROSAVAGE=m CONFIG_I2C_SAVAGE4=m # CONFIG_SCx200_ACB is not set CONFIG_I2C_SIS5595=m CONFIG_I2C_SIS630=m CONFIG_I2C_SIS96X=m CONFIG_I2C_STUB=m CONFIG_I2C_VIA=m CONFIG_I2C_VIAPRO=m CONFIG_I2C_VOODOO3=m CONFIG_I2C_PCA_ISA=m # # Hardware Sensors Chip support # CONFIG_I2C_SENSOR=m CONFIG_SENSORS_ADM1021=m CONFIG_SENSORS_ADM1025=m CONFIG_SENSORS_ADM1026=m CONFIG_SENSORS_ADM1031=m CONFIG_SENSORS_ASB100=m CONFIG_SENSORS_DS1621=m CONFIG_SENSORS_FSCHER=m CONFIG_SENSORS_GL518SM=m CONFIG_SENSORS_IT87=m CONFIG_SENSORS_LM63=m CONFIG_SENSORS_LM75=m CONFIG_SENSORS_LM77=m CONFIG_SENSORS_LM78=m CONFIG_SENSORS_LM80=m CONFIG_SENSORS_LM83=m CONFIG_SENSORS_LM85=m CONFIG_SENSORS_LM87=m CONFIG_SENSORS_LM90=m CONFIG_SENSORS_MAX1619=m CONFIG_SENSORS_PC87360=m CONFIG_SENSORS_SMSC47M1=m CONFIG_SENSORS_VIA686A=m CONFIG_SENSORS_W83781D=m CONFIG_SENSORS_W83L785TS=m CONFIG_SENSORS_W83627HF=m # # Other I2C Chip support # CONFIG_SENSORS_EEPROM=m CONFIG_SENSORS_PCF8574=m CONFIG_SENSORS_PCF8591=m CONFIG_SENSORS_RTC8564=m # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set # CONFIG_I2C_DEBUG_CHIP is not set # # Dallas's 1-wire bus # # CONFIG_W1 is not set # # Misc devices # # CONFIG_IBM_ASM is not set # # Multimedia devices # CONFIG_VIDEO_DEV=m # # Video For Linux # # # Video Adapters # CONFIG_VIDEO_BT848=m CONFIG_VIDEO_BWQCAM=m CONFIG_VIDEO_CQCAM=m CONFIG_VIDEO_W9966=m CONFIG_VIDEO_CPIA=m CONFIG_VIDEO_CPIA_PP=m CONFIG_VIDEO_CPIA_USB=m CONFIG_VIDEO_SAA5246A=m CONFIG_VIDEO_SAA5249=m CONFIG_TUNER_3036=m CONFIG_VIDEO_STRADIS=m CONFIG_VIDEO_ZORAN=m CONFIG_VIDEO_ZORAN_BUZ=m CONFIG_VIDEO_ZORAN_DC10=m CONFIG_VIDEO_ZORAN_DC30=m CONFIG_VIDEO_ZORAN_LML33=m CONFIG_VIDEO_ZORAN_LML33R10=m CONFIG_VIDEO_SAA7134=m CONFIG_VIDEO_MXB=m CONFIG_VIDEO_DPC=m CONFIG_VIDEO_HEXIUM_ORION=m CONFIG_VIDEO_HEXIUM_GEMINI=m CONFIG_VIDEO_CX88=m CONFIG_VIDEO_OVCAMCHIP=m # # Radio Adapters # CONFIG_RADIO_GEMTEK_PCI=m CONFIG_RADIO_MAXIRADIO=m CONFIG_RADIO_MAESTRO=m # # Digital Video Broadcasting Devices # CONFIG_DVB=y CONFIG_DVB_CORE=m # # Supported SAA7146 based PCI Adapters # CONFIG_DVB_AV7110=m # CONFIG_DVB_AV7110_FIRMWARE is not set CONFIG_DVB_AV7110_OSD=y CONFIG_DVB_BUDGET=m CONFIG_DVB_BUDGET_CI=m CONFIG_DVB_BUDGET_AV=m CONFIG_DVB_BUDGET_PATCH=m # # Supported USB Adapters # CONFIG_DVB_TTUSB_BUDGET=m CONFIG_DVB_TTUSB_DEC=m CONFIG_DVB_DIBUSB=m CONFIG_DVB_DIBUSB_MISDESIGNED_DEVICES=y # CONFIG_DVB_DIBCOM_DEBUG is not set CONFIG_DVB_CINERGYT2=m # CONFIG_DVB_CINERGYT2_TUNING is not set # # Supported FlexCopII (B2C2) Adapters # CONFIG_DVB_B2C2_SKYSTAR=m CONFIG_DVB_B2C2_USB=m # # Supported BT878 Adapters # CONFIG_DVB_BT8XX=m # # Supported DVB Frontends # # # Customise DVB Frontends # # # DVB-S (satellite) frontends # CONFIG_DVB_STV0299=m CONFIG_DVB_CX24110=m CONFIG_DVB_TDA8083=m CONFIG_DVB_TDA80XX=m CONFIG_DVB_MT312=m CONFIG_DVB_VES1X93=m # # DVB-T (terrestrial) frontends # CONFIG_DVB_SP8870=m CONFIG_DVB_SP887X=m CONFIG_DVB_CX22700=m CONFIG_DVB_CX22702=m CONFIG_DVB_L64781=m CONFIG_DVB_TDA1004X=m CONFIG_DVB_NXT6000=m CONFIG_DVB_MT352=m CONFIG_DVB_DIB3000MB=m CONFIG_DVB_DIB3000MC=m # # DVB-C (cable) frontends # CONFIG_DVB_ATMEL_AT76C651=m CONFIG_DVB_VES1820=m CONFIG_DVB_TDA10021=m CONFIG_DVB_STV0297=m CONFIG_VIDEO_SAA7146=m CONFIG_VIDEO_SAA7146_VV=m CONFIG_VIDEO_VIDEOBUF=m CONFIG_VIDEO_TUNER=m CONFIG_VIDEO_BUF=m CONFIG_VIDEO_BTCX=m CONFIG_VIDEO_IR=m # # Graphics support # CONFIG_FB=y CONFIG_FB_MODE_HELPERS=y CONFIG_FB_TILEBLITTING=y CONFIG_FB_CIRRUS=m # CONFIG_FB_PM2 is not set # CONFIG_FB_CYBER2000 is not set # CONFIG_FB_ASILIANT is not set # CONFIG_FB_IMSTT is not set CONFIG_FB_VGA16=m CONFIG_FB_VESA=y CONFIG_VIDEO_SELECT=y CONFIG_FB_HGA=m CONFIG_FB_HGA_ACCEL=y CONFIG_FB_RIVA=m # CONFIG_FB_RIVA_I2C is not set # CONFIG_FB_RIVA_DEBUG is not set CONFIG_FB_MATROX=m CONFIG_FB_MATROX_MILLENIUM=y CONFIG_FB_MATROX_MYSTIQUE=y CONFIG_FB_MATROX_G450=y CONFIG_FB_MATROX_G100=y CONFIG_FB_MATROX_I2C=m CONFIG_FB_MATROX_MAVEN=m CONFIG_FB_MATROX_MULTIHEAD=y # CONFIG_FB_RADEON_OLD is not set CONFIG_FB_RADEON=m CONFIG_FB_RADEON_I2C=y # CONFIG_FB_RADEON_DEBUG is not set CONFIG_FB_ATY128=m CONFIG_FB_ATY=m CONFIG_FB_ATY_CT=y # CONFIG_FB_ATY_GENERIC_LCD is not set # CONFIG_FB_ATY_XL_INIT is not set CONFIG_FB_ATY_GX=y CONFIG_FB_SAVAGE=m CONFIG_FB_SAVAGE_I2C=m CONFIG_FB_SAVAGE_ACCEL=m # CONFIG_FB_SIS is not set CONFIG_FB_NEOMAGIC=m CONFIG_FB_KYRO=m CONFIG_FB_3DFX=m CONFIG_FB_3DFX_ACCEL=y CONFIG_FB_VOODOO1=m CONFIG_FB_TRIDENT=m CONFIG_FB_TRIDENT_ACCEL=y # CONFIG_FB_VIRTUAL is not set # # Console display driver support # CONFIG_VGA_CONSOLE=y CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y # CONFIG_FONTS is not set CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y # # Logo configuration # CONFIG_LOGO=y # CONFIG_LOGO_LINUX_MONO is not set # CONFIG_LOGO_LINUX_VGA16 is not set CONFIG_LOGO_LINUX_CLUT224=y # # Sound # CONFIG_SOUND=m # # Advanced Linux Sound Architecture # CONFIG_SND=m CONFIG_SND_TIMER=m CONFIG_SND_PCM=m CONFIG_SND_HWDEP=m CONFIG_SND_RAWMIDI=m CONFIG_SND_SEQUENCER=m CONFIG_SND_SEQ_DUMMY=m CONFIG_SND_OSSEMUL=y CONFIG_SND_MIXER_OSS=m CONFIG_SND_PCM_OSS=m CONFIG_SND_SEQUENCER_OSS=y CONFIG_SND_BIT32_EMUL=m CONFIG_SND_RTCTIMER=m # CONFIG_SND_VERBOSE_PRINTK is not set # CONFIG_SND_DEBUG is not set # # Generic devices # CONFIG_SND_MPU401_UART=m CONFIG_SND_OPL3_LIB=m CONFIG_SND_VX_LIB=m CONFIG_SND_DUMMY=m CONFIG_SND_VIRMIDI=m CONFIG_SND_MTPAV=m # CONFIG_SND_SERIAL_U16550 is not set CONFIG_SND_MPU401=m # # PCI devices # CONFIG_SND_AC97_CODEC=m CONFIG_SND_ALI5451=m CONFIG_SND_ATIIXP=m CONFIG_SND_ATIIXP_MODEM=m CONFIG_SND_AU8810=m CONFIG_SND_AU8820=m CONFIG_SND_AU8830=m CONFIG_SND_AZT3328=m CONFIG_SND_BT87X=m # CONFIG_SND_BT87X_OVERCLOCK is not set CONFIG_SND_CS46XX=m CONFIG_SND_CS46XX_NEW_DSP=y CONFIG_SND_CS4281=m CONFIG_SND_EMU10K1=m CONFIG_SND_KORG1212=m CONFIG_SND_MIXART=m CONFIG_SND_NM256=m CONFIG_SND_RME32=m CONFIG_SND_RME96=m CONFIG_SND_RME9652=m CONFIG_SND_HDSP=m CONFIG_SND_TRIDENT=m CONFIG_SND_YMFPCI=m CONFIG_SND_ALS4000=m CONFIG_SND_CMIPCI=m CONFIG_SND_ENS1370=m CONFIG_SND_ENS1371=m CONFIG_SND_ES1938=m CONFIG_SND_ES1968=m CONFIG_SND_MAESTRO3=m CONFIG_SND_FM801=m CONFIG_SND_FM801_TEA575X=m CONFIG_SND_ICE1712=m CONFIG_SND_ICE1724=m CONFIG_SND_INTEL8X0=m CONFIG_SND_INTEL8X0M=m CONFIG_SND_SONICVIBES=m CONFIG_SND_VIA82XX=m CONFIG_SND_VX222=m # # USB devices # CONFIG_SND_USB_AUDIO=m CONFIG_SND_USB_USX2Y=m # # PCMCIA devices # # # Open Sound System # # CONFIG_SOUND_PRIME is not set # # USB support # CONFIG_USB=y # CONFIG_USB_DEBUG is not set # # Miscellaneous USB options # CONFIG_USB_DEVICEFS=y # CONFIG_USB_BANDWIDTH is not set # CONFIG_USB_DYNAMIC_MINORS is not set CONFIG_USB_SUSPEND=y # CONFIG_USB_OTG is not set CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # # USB Host Controller Drivers # CONFIG_USB_EHCI_HCD=m CONFIG_USB_EHCI_SPLIT_ISO=y CONFIG_USB_EHCI_ROOT_HUB_TT=y CONFIG_USB_OHCI_HCD=m CONFIG_USB_UHCI_HCD=m CONFIG_USB_SL811_HCD=m # # USB Device Class drivers # # CONFIG_USB_AUDIO is not set # # USB Bluetooth TTY can only be used with disabled Bluetooth subsystem # CONFIG_USB_MIDI=m CONFIG_USB_ACM=m CONFIG_USB_PRINTER=m # # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information # CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_DEBUG is not set CONFIG_USB_STORAGE_RW_DETECT=y CONFIG_USB_STORAGE_DATAFAB=y CONFIG_USB_STORAGE_FREECOM=y CONFIG_USB_STORAGE_ISD200=y CONFIG_USB_STORAGE_DPCM=y CONFIG_USB_STORAGE_HP8200e=y CONFIG_USB_STORAGE_SDDR09=y CONFIG_USB_STORAGE_SDDR55=y CONFIG_USB_STORAGE_JUMPSHOT=y # # USB Input Devices # CONFIG_USB_HID=y CONFIG_USB_HIDINPUT=y CONFIG_HID_FF=y CONFIG_HID_PID=y CONFIG_LOGITECH_FF=y CONFIG_THRUSTMASTER_FF=y CONFIG_USB_HIDDEV=y CONFIG_USB_AIPTEK=m CONFIG_USB_WACOM=m CONFIG_USB_KBTAB=m CONFIG_USB_POWERMATE=m CONFIG_USB_MTOUCH=m CONFIG_USB_EGALAX=m CONFIG_USB_XPAD=m CONFIG_USB_ATI_REMOTE=m # # USB Imaging devices # CONFIG_USB_MDC800=m CONFIG_USB_MICROTEK=m CONFIG_USB_HPUSBSCSI=m # # USB Multimedia devices # CONFIG_USB_DABUSB=m CONFIG_USB_VICAM=m CONFIG_USB_DSBR=m CONFIG_USB_IBMCAM=m CONFIG_USB_KONICAWC=m CONFIG_USB_OV511=m CONFIG_USB_SE401=m CONFIG_USB_SN9C102=m CONFIG_USB_STV680=m CONFIG_USB_W9968CF=m # # USB Network Adapters # CONFIG_USB_CATC=m CONFIG_USB_KAWETH=m CONFIG_USB_PEGASUS=m CONFIG_USB_RTL8150=m CONFIG_USB_USBNET=m # # USB Host-to-Host Cables # CONFIG_USB_ALI_M5632=y CONFIG_USB_AN2720=y CONFIG_USB_BELKIN=y CONFIG_USB_GENESYS=y CONFIG_USB_NET1080=y CONFIG_USB_PL2301=y CONFIG_USB_KC2190=y # # Intelligent USB Devices/Gadgets # CONFIG_USB_ARMLINUX=y CONFIG_USB_EPSON2888=y CONFIG_USB_ZAURUS=y CONFIG_USB_CDCETHER=y # # USB Network Adapters # CONFIG_USB_AX8817X=y # # USB port drivers # CONFIG_USB_USS720=m # # USB Serial Converter support # CONFIG_USB_SERIAL=m CONFIG_USB_SERIAL_GENERIC=y CONFIG_USB_SERIAL_BELKIN=m CONFIG_USB_SERIAL_WHITEHEAT=m CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m CONFIG_USB_SERIAL_CYPRESS_M8=m CONFIG_USB_SERIAL_EMPEG=m CONFIG_USB_SERIAL_FTDI_SIO=m CONFIG_USB_SERIAL_VISOR=m CONFIG_USB_SERIAL_IPAQ=m CONFIG_USB_SERIAL_IR=m CONFIG_USB_SERIAL_EDGEPORT=m CONFIG_USB_SERIAL_EDGEPORT_TI=m # CONFIG_USB_SERIAL_IPW is not set CONFIG_USB_SERIAL_KEYSPAN_PDA=m CONFIG_USB_SERIAL_KEYSPAN=m CONFIG_USB_SERIAL_KEYSPAN_MPR=y CONFIG_USB_SERIAL_KEYSPAN_USA28=y CONFIG_USB_SERIAL_KEYSPAN_USA28X=y CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y CONFIG_USB_SERIAL_KEYSPAN_USA19=y CONFIG_USB_SERIAL_KEYSPAN_USA18X=y CONFIG_USB_SERIAL_KEYSPAN_USA19W=y CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y CONFIG_USB_SERIAL_KEYSPAN_USA49W=y CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y CONFIG_USB_SERIAL_KLSI=m CONFIG_USB_SERIAL_KOBIL_SCT=m CONFIG_USB_SERIAL_MCT_U232=m CONFIG_USB_SERIAL_PL2303=m CONFIG_USB_SERIAL_SAFE=m CONFIG_USB_SERIAL_SAFE_PADDED=y CONFIG_USB_SERIAL_CYBERJACK=m CONFIG_USB_SERIAL_XIRCOM=m CONFIG_USB_SERIAL_OMNINET=m CONFIG_USB_EZUSB=y # # USB Miscellaneous drivers # CONFIG_USB_EMI62=m # CONFIG_USB_EMI26 is not set CONFIG_USB_TIGL=m CONFIG_USB_AUERSWALD=m CONFIG_USB_RIO500=m CONFIG_USB_LEGOTOWER=m CONFIG_USB_LCD=m CONFIG_USB_LED=m # CONFIG_USB_CYTHERM is not set CONFIG_USB_PHIDGETKIT=m CONFIG_USB_PHIDGETSERVO=m CONFIG_USB_TEST=m # # USB ATM/DSL drivers # CONFIG_USB_ATM=m CONFIG_USB_SPEEDTOUCH=m # # USB Gadget Support # # CONFIG_USB_GADGET is not set # # MMC/SD Card support # CONFIG_MMC=m # CONFIG_MMC_DEBUG is not set CONFIG_MMC_BLOCK=m CONFIG_MMC_WBSD=m # # Firmware Drivers # # CONFIG_EDD is not set # # File systems # CONFIG_EXT2_FS=y CONFIG_EXT2_FS_XATTR=y CONFIG_EXT2_FS_POSIX_ACL=y CONFIG_EXT2_FS_SECURITY=y CONFIG_EXT3_FS=m CONFIG_EXT3_FS_XATTR=y CONFIG_EXT3_FS_POSIX_ACL=y CONFIG_EXT3_FS_SECURITY=y CONFIG_JBD=m # CONFIG_JBD_DEBUG is not set CONFIG_FS_MBCACHE=y CONFIG_REISERFS_FS=m # CONFIG_REISERFS_CHECK is not set CONFIG_REISERFS_PROC_INFO=y CONFIG_REISERFS_FS_XATTR=y CONFIG_REISERFS_FS_POSIX_ACL=y CONFIG_REISERFS_FS_SECURITY=y CONFIG_JFS_FS=m CONFIG_JFS_POSIX_ACL=y # CONFIG_JFS_DEBUG is not set # CONFIG_JFS_STATISTICS is not set CONFIG_FS_POSIX_ACL=y CONFIG_XFS_FS=m # CONFIG_XFS_RT is not set CONFIG_XFS_QUOTA=y CONFIG_XFS_SECURITY=y CONFIG_XFS_POSIX_ACL=y CONFIG_MINIX_FS=m CONFIG_ROMFS_FS=m CONFIG_QUOTA=y # CONFIG_QFMT_V1 is not set CONFIG_QFMT_V2=y CONFIG_QUOTACTL=y CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=m CONFIG_AUTOFS4_FS=m # # CD-ROM/DVD Filesystems # CONFIG_ISO9660_FS=y CONFIG_JOLIET=y CONFIG_ZISOFS=y CONFIG_ZISOFS_FS=y CONFIG_UDF_FS=m CONFIG_UDF_NLS=y # # DOS/FAT/NT Filesystems # CONFIG_FAT_FS=m CONFIG_MSDOS_FS=m CONFIG_VFAT_FS=m CONFIG_FAT_DEFAULT_CODEPAGE=437 CONFIG_FAT_DEFAULT_IOCHARSET="ascii" # CONFIG_NTFS_FS is not set # # Pseudo filesystems # CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y CONFIG_SYSFS=y # CONFIG_DEVFS_FS is not set CONFIG_DEVPTS_FS_XATTR=y CONFIG_DEVPTS_FS_SECURITY=y CONFIG_TMPFS=y CONFIG_TMPFS_XATTR=y CONFIG_TMPFS_SECURITY=y CONFIG_HUGETLBFS=y CONFIG_HUGETLB_PAGE=y CONFIG_RAMFS=y # # Miscellaneous filesystems # # CONFIG_ADFS_FS is not set CONFIG_AFFS_FS=m CONFIG_HFS_FS=m CONFIG_HFSPLUS_FS=m CONFIG_BEFS_FS=m # CONFIG_BEFS_DEBUG is not set CONFIG_BFS_FS=m CONFIG_EFS_FS=m # CONFIG_JFFS_FS is not set CONFIG_JFFS2_FS=m CONFIG_JFFS2_FS_DEBUG=0 CONFIG_JFFS2_FS_NAND=y # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set CONFIG_JFFS2_ZLIB=y CONFIG_JFFS2_RTIME=y # CONFIG_JFFS2_RUBIN is not set CONFIG_CRAMFS=m CONFIG_VXFS_FS=m # CONFIG_HPFS_FS is not set CONFIG_QNX4FS_FS=m # CONFIG_QNX4FS_RW is not set CONFIG_SYSV_FS=m CONFIG_UFS_FS=m # CONFIG_UFS_FS_WRITE is not set # # Network File Systems # CONFIG_NFS_FS=m CONFIG_NFS_V3=y CONFIG_NFS_V4=y CONFIG_NFS_DIRECTIO=y CONFIG_NFSD=m CONFIG_NFSD_V3=y CONFIG_NFSD_V4=y CONFIG_NFSD_TCP=y CONFIG_LOCKD=m CONFIG_LOCKD_V4=y CONFIG_EXPORTFS=m CONFIG_SUNRPC=m CONFIG_SUNRPC_GSS=m CONFIG_RPCSEC_GSS_KRB5=m CONFIG_RPCSEC_GSS_SPKM3=m CONFIG_SMB_FS=m # CONFIG_SMB_NLS_DEFAULT is not set CONFIG_CIFS=m # CONFIG_CIFS_STATS is not set CONFIG_CIFS_XATTR=y CONFIG_CIFS_POSIX=y # CONFIG_CIFS_EXPERIMENTAL is not set CONFIG_NCP_FS=m CONFIG_NCPFS_PACKET_SIGNING=y CONFIG_NCPFS_IOCTL_LOCKING=y CONFIG_NCPFS_STRONG=y CONFIG_NCPFS_NFS_NS=y CONFIG_NCPFS_OS2_NS=y CONFIG_NCPFS_SMALLDOS=y CONFIG_NCPFS_NLS=y CONFIG_NCPFS_EXTRAS=y # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set # # Partition Types # CONFIG_PARTITION_ADVANCED=y # CONFIG_ACORN_PARTITION is not set CONFIG_OSF_PARTITION=y # CONFIG_AMIGA_PARTITION is not set # CONFIG_ATARI_PARTITION is not set CONFIG_MAC_PARTITION=y CONFIG_MSDOS_PARTITION=y CONFIG_BSD_DISKLABEL=y CONFIG_MINIX_SUBPARTITION=y CONFIG_SOLARIS_X86_PARTITION=y CONFIG_UNIXWARE_DISKLABEL=y # CONFIG_LDM_PARTITION is not set CONFIG_SGI_PARTITION=y # CONFIG_ULTRIX_PARTITION is not set CONFIG_SUN_PARTITION=y CONFIG_EFI_PARTITION=y # # Native Language Support # CONFIG_NLS=y CONFIG_NLS_DEFAULT="utf8" CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_CODEPAGE_737=m CONFIG_NLS_CODEPAGE_775=m CONFIG_NLS_CODEPAGE_850=m CONFIG_NLS_CODEPAGE_852=m CONFIG_NLS_CODEPAGE_855=m CONFIG_NLS_CODEPAGE_857=m CONFIG_NLS_CODEPAGE_860=m CONFIG_NLS_CODEPAGE_861=m CONFIG_NLS_CODEPAGE_862=m CONFIG_NLS_CODEPAGE_863=m CONFIG_NLS_CODEPAGE_864=m CONFIG_NLS_CODEPAGE_865=m CONFIG_NLS_CODEPAGE_866=m CONFIG_NLS_CODEPAGE_869=m CONFIG_NLS_CODEPAGE_936=m CONFIG_NLS_CODEPAGE_950=m CONFIG_NLS_CODEPAGE_932=m CONFIG_NLS_CODEPAGE_949=m CONFIG_NLS_CODEPAGE_874=m CONFIG_NLS_ISO8859_8=m CONFIG_NLS_CODEPAGE_1250=m CONFIG_NLS_CODEPAGE_1251=m CONFIG_NLS_ASCII=y CONFIG_NLS_ISO8859_1=m CONFIG_NLS_ISO8859_2=m CONFIG_NLS_ISO8859_3=m CONFIG_NLS_ISO8859_4=m CONFIG_NLS_ISO8859_5=m CONFIG_NLS_ISO8859_6=m CONFIG_NLS_ISO8859_7=m CONFIG_NLS_ISO8859_9=m CONFIG_NLS_ISO8859_13=m CONFIG_NLS_ISO8859_14=m CONFIG_NLS_ISO8859_15=m CONFIG_NLS_KOI8_R=m CONFIG_NLS_KOI8_U=m CONFIG_NLS_UTF8=m # # Profiling support # CONFIG_PROFILING=y CONFIG_OPROFILE=m # # Kernel hacking # CONFIG_DEBUG_KERNEL=y CONFIG_MAGIC_SYSRQ=y # CONFIG_SCHEDSTATS is not set # CONFIG_DEBUG_SLAB is not set CONFIG_DEBUG_SPINLOCK=y CONFIG_DEBUG_SPINLOCK_SLEEP=y # CONFIG_DEBUG_KOBJECT is not set CONFIG_DEBUG_INFO=y # CONFIG_CHECKING is not set CONFIG_INIT_DEBUG=y # CONFIG_IOMMU_DEBUG is not set # CONFIG_KPROBES is not set # # Security options # # CONFIG_KEYS is not set CONFIG_SECURITY=y CONFIG_SECURITY_NETWORK=y CONFIG_SECURITY_CAPABILITIES=y # CONFIG_SECURITY_ROOTPLUG is not set CONFIG_SECURITY_SECLVL=m CONFIG_SECURITY_SELINUX=y CONFIG_SECURITY_SELINUX_BOOTPARAM=y CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=1 CONFIG_SECURITY_SELINUX_DISABLE=y CONFIG_SECURITY_SELINUX_DEVELOP=y # CONFIG_SECURITY_SELINUX_MLS is not set # # Cryptographic options # CONFIG_CRYPTO=y CONFIG_CRYPTO_HMAC=y CONFIG_CRYPTO_NULL=m CONFIG_CRYPTO_MD4=m CONFIG_CRYPTO_MD5=m CONFIG_CRYPTO_SHA1=y CONFIG_CRYPTO_SHA256=m CONFIG_CRYPTO_SHA512=m CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_DES=m CONFIG_CRYPTO_BLOWFISH=m CONFIG_CRYPTO_TWOFISH=m CONFIG_CRYPTO_SERPENT=m CONFIG_CRYPTO_AES=m CONFIG_CRYPTO_CAST5=m CONFIG_CRYPTO_CAST6=m CONFIG_CRYPTO_TEA=m CONFIG_CRYPTO_ARC4=m CONFIG_CRYPTO_KHAZAD=m CONFIG_CRYPTO_ANUBIS=m CONFIG_CRYPTO_DEFLATE=m CONFIG_CRYPTO_MICHAEL_MIC=m CONFIG_CRYPTO_CRC32C=m # CONFIG_CRYPTO_TEST is not set # # Library routines # CONFIG_CRC_CCITT=m CONFIG_CRC32=y CONFIG_LIBCRC32C=m CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=m --------------050102090004090802060504 Content-Type: text/plain; name="2.6.10-uname.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="2.6.10-uname.txt" Linux meelo.int.phekda.gotadsl.co.uk 2.6.10 #1 Wed Dec 29 00:43:22 GMT 2004 x86_64 x86_64 x86_64 GNU/Linux --------------050102090004090802060504-- From kaber@trash.net Sun Jan 2 13:06:27 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 02 Jan 2005 13:06:34 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j02L667S011222 for ; Sun, 2 Jan 2005 13:06:27 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1ClD3w-0008JB-Uu; Sun, 02 Jan 2005 22:14:56 +0100 Message-ID: <41D86450.1070904@trash.net> Date: Sun, 02 Jan 2005 22:14:56 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: Peter Bieringer CC: USAGI core , Maillist netdev , Harald Welte , Netfilter development mailing list Subject: Re: ip6tables: accept of IPv6 transport esp packages not possible - no rule matches References: <019064D0423CE6C823CBF476@t1mobil.muc.aerasec.de> <5F6ACA5CEF52DBFBF11FBF94@t1mobil.muc.aerasec.de> <41CD8B4F.6010402@trash.net> <85346B5DA83795C08812E782@worker.muc.bieringer.de> <41D7DE3E.2090304@trash.net> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13337 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Peter Bieringer wrote: >>>BTW: how to filter incoming traffic after decryption? >>> >>Use tunnel-mode. The decrypted packets will hit PRE_ROUTING >>and LOCAL_IN again. >> > >Ok, confirmed working in tunnel mode, ping6 packet was counted twice in >different rules (esp and icmpv6) > >But for outgoing ping6 packets, this won't work, packet is only counted >(and accepted) by the icmpv6 rule, esp rule got no match, also not the >"all" rule. > >Looks like at the moment, outgoing packet is passing netfilter only one >time, even if encryption is in tunnel mode. > That is correct. > >By design / bug / missing feature? > By design and missing feature :) As I said, patches to fix this for IPv4 will be submitted this week .. IPv6 will hopefully follow soon. Regards Patrick From eric.lemoine@gmail.com Sun Jan 2 15:22:22 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 02 Jan 2005 15:22:29 -0800 (PST) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.199]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j02NM2f1014530 for ; Sun, 2 Jan 2005 15:22:22 -0800 Received: by wproxy.gmail.com with SMTP id 50so4482wri for ; Sun, 02 Jan 2005 15:30:32 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=dfullWpQ+6i8if36k9vS+ZzayY0N6nDz4RWx3AuyeDG7Ss4db1zvvQdzDIxWypItQQVNzO221czDENVa2inahnEZLBsJz7yAIzPN/1+0wuHc03hwBNT6j2Pjbcn/97aQo2nhRmhfxfa5WCANe9tYafsaQ4v44yvm7MPBxHOmfnQ= Received: by 10.54.10.55 with SMTP id 55mr67773wrj; Sun, 02 Jan 2005 15:30:31 -0800 (PST) Received: by 10.54.30.8 with HTTP; Sun, 2 Jan 2005 15:30:31 -0800 (PST) Message-ID: <5cac192f0501021530672a908a@mail.gmail.com> Date: Mon, 3 Jan 2005 00:30:31 +0100 From: Eric Lemoine Reply-To: Eric Lemoine To: hadi@cyberus.ca Subject: Re: LLTX and netif_stop_queue Cc: Patrick McHardy , "David S. Miller" , roland@topspin.com, netdev@oss.sgi.com, openib-general@openib.org In-Reply-To: <1104240717.1100.66.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_709_5375345.1104708631807" References: <52llbwoaej.fsf@topspin.com> <20041217214432.07b7b21e.davem@davemloft.net> <1103484675.1050.158.camel@jzny.localdomain> <5cac192f04122210491d64d4b6@mail.gmail.com> <20041222202919.057b8331.davem@davemloft.net> <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13338 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: eric.lemoine@gmail.com Precedence: bulk X-list: netdev ------=_Part_709_5375345.1104708631807 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On 28 Dec 2004 08:31:57 -0500, jamal wrote: > On Fri, 2004-12-24 at 11:10, Eric Lemoine wrote: > > > Yes but requiring drivers to release a lock that they should not even > > be aware of doesn't sound good. Another way would be to keep > > dev->queue_lock grabbed when entering start_xmit() and let the driver > > drop it (and re-acquire it before it returns) only if it wishes so. > > Although I don't like this too much either, that's the best way I can > > think of up to now... > > I am not a big fan of that patch either, but i cant think of a cleaner > way to do it. > The violation already happens with the LLTX flag. So maybe a big warning > that says "Do this only if you driver is LLTX enabled". The other way to > do it is put a check to see if LLTX is enabled before releasing that > lock - but why the extra cycles? Driver writer should know. Two (untested) patches implementing what I described above. The first pach (sch_generic.patch) keeps queue_lock held in qdisc_restart() when calling hard_start_xmit() of a LLTX driver. The second (sungem.patch) makes sungem release queue_lock after grabbing its private tx lock. Note that the modifications made to qdisc_restart() are not compatible with the current LLTX drivers. All LLTX drivers must be modified along sungem.patch's lines. Take sungem.patch as an example of how things must be done. Patches apply to current davem bk snapshot. -- Eric ------=_Part_709_5375345.1104708631807 Content-Type: application/octet-stream; name="sch_generic.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="sch_generic.patch" PT09PT0gbmV0L3NjaGVkL3NjaF9nZW5lcmljLmMgMS4zMiB2cyBlZGl0ZWQgPT09PT0KLS0tIDEu MzIvbmV0L3NjaGVkL3NjaF9nZW5lcmljLmMJMjAwNC0xMi0yOCAwNTo1MToyMCArMDE6MDAKKysr IGVkaXRlZC9uZXQvc2NoZWQvc2NoX2dlbmVyaWMuYwkyMDA1LTAxLTAyIDIzOjU1OjE4ICswMTow MApAQCAtMTA0LDkgKzEwNCwxNyBAQAogCQkgKiBsb2NraW5nIGFnYWluLiBUaGVzZSBjaGVja3Mg YXJlIHdvcnRoIGl0IGJlY2F1c2UKIAkJICogZXZlbiB1bmNvbmdlc3RlZCBsb2NrcyBjYW4gYmUg cXVpdGUgZXhwZW5zaXZlLgogCQkgKiBUaGUgZHJpdmVyIGNhbiBkbyB0cnlsb2NrIGxpa2UgaGVy ZSB0b28sIGluIGNhc2UKLQkJICogb2YgbG9jayBjb25nZXN0aW9uIGl0IHNob3VsZCByZXR1cm4g LTEgYW5kIHRoZSBwYWNrZXQKLQkJICogd2lsbCBiZSByZXF1ZXVlZC4KKwkJICogb2YgbG9jayBj b25nZXN0aW9uIGl0IHNob3VsZCByZXR1cm4gTkVUREVWX1RYX0xPQ0tFRAorCQkgKiBhbmQgdGhl IHBhY2tldCB3aWxsIGJlIHJlcXVldWVkLgorCQkgKiAKKwkJICogTm90ZTogd2hlbiB0aGUgZHJp dmVyIGhhcyBMTFRYIHNldCBxdWV1ZV9sb2NrIGNhbm5vdAorCQkgKiBiZSBkcm9wcGVkIGluIGhl cmUgaWYgd2Ugd2FudCB0byBhdm9pZCBoYXZpbmcgcGFja2V0cworCQkgKiBwYXNzaW5nIGVhY2hv dmVyIGR1cmluZyB0cmFuc21pdC4gcXVldWVfbG9jayBjYW4gb25seQorCQkgKiBiZSBkcm9wcGVk IGluIGhhcmRfc3RhcnRfeG1pdCgpIGFmdGVyIHByaXZhdGUgdHggbG9jayAKKwkJICogaGFzIGJl ZW4gZ3JhYmJlZC4gSWYgaGFyZF9zdGFydF94bWl0KCkgZG9lcyByZWxlYXNlIAorCQkgKiBxdWV1 ZV9sb2NrIGl0IG11c3QgZ3JhYiBpdCBhZ2FpbiBiZWZvcmUgaXQgcmV0dXJucy4KIAkJICovCisK IAkJaWYgKCFub2xvY2spIHsKIAkJCWlmICghc3Bpbl90cnlsb2NrKCZkZXYtPnhtaXRfbG9jaykp IHsKIAkJCWNvbGxpc2lvbjoKQEAgLTEyOCwxMiArMTM2LDEyIEBACiAJCQl9CiAJCQkvKiBSZW1l bWJlciB0aGF0IHRoZSBkcml2ZXIgaXMgZ3JhYmJlZCBieSB1cy4gKi8KIAkJCWRldi0+eG1pdF9s b2NrX293bmVyID0gc21wX3Byb2Nlc3Nvcl9pZCgpOworCisJCQkvKiBBbmQgcmVsZWFzZSBxdWV1 ZSAqLworCQkJc3Bpbl91bmxvY2soJmRldi0+cXVldWVfbG9jayk7CiAJCX0KIAkJCiAJCXsKLQkJ CS8qIEFuZCByZWxlYXNlIHF1ZXVlICovCi0JCQlzcGluX3VubG9jaygmZGV2LT5xdWV1ZV9sb2Nr KTsKLQogCQkJaWYgKCFuZXRpZl9xdWV1ZV9zdG9wcGVkKGRldikpIHsKIAkJCQlpbnQgcmV0Owog CQkJCWlmIChuZXRkZXZfbml0KQpAQCAtMTQ0LDE0ICsxNTIsMTIgQEAKIAkJCQkJaWYgKCFub2xv Y2spIHsKIAkJCQkJCWRldi0+eG1pdF9sb2NrX293bmVyID0gLTE7CiAJCQkJCQlzcGluX3VubG9j aygmZGV2LT54bWl0X2xvY2spOworCQkJCQkJc3Bpbl9sb2NrKCZkZXYtPnF1ZXVlX2xvY2spOwog CQkJCQl9Ci0JCQkJCXNwaW5fbG9jaygmZGV2LT5xdWV1ZV9sb2NrKTsKIAkJCQkJcmV0dXJuIC0x OwogCQkJCX0KLQkJCQlpZiAocmV0ID09IE5FVERFVl9UWF9MT0NLRUQgJiYgbm9sb2NrKSB7Ci0J CQkJCXNwaW5fbG9jaygmZGV2LT5xdWV1ZV9sb2NrKTsKKwkJCQlpZiAocmV0ID09IE5FVERFVl9U WF9MT0NLRUQgJiYgbm9sb2NrKQogCQkJCQlnb3RvIGNvbGxpc2lvbjsgCi0JCQkJfQogCQkJfQog CiAJCQkvKiBORVRERVZfVFhfQlVTWSAtIHdlIG5lZWQgdG8gcmVxdWV1ZSAqLwpAQCAtMTU5LDgg KzE2NSw4IEBACiAJCQlpZiAoIW5vbG9jaykgeyAKIAkJCQlkZXYtPnhtaXRfbG9ja19vd25lciA9 IC0xOwogCQkJCXNwaW5fdW5sb2NrKCZkZXYtPnhtaXRfbG9jayk7CisJCQkJc3Bpbl9sb2NrKCZk ZXYtPnF1ZXVlX2xvY2spOwogCQkJfSAKLQkJCXNwaW5fbG9jaygmZGV2LT5xdWV1ZV9sb2NrKTsK IAkJCXEgPSBkZXYtPnFkaXNjOwogCQl9CiAK ------=_Part_709_5375345.1104708631807 Content-Type: application/octet-stream; name="sungem.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="sungem.patch" PT09PT0gZHJpdmVycy9uZXQvc3VuZ2VtLmMgMS43MSB2cyBlZGl0ZWQgPT09PT0KLS0tIDEuNzEv ZHJpdmVycy9uZXQvc3VuZ2VtLmMJMjAwNC0xMS0xNCAxMDo0NTozNiArMDE6MDAKKysrIGVkaXRl ZC9kcml2ZXJzL25ldC9zdW5nZW0uYwkyMDA1LTAxLTAzIDAwOjAwOjIyICswMTowMApAQCAtOTUw LDYgKzk1MCw3IEBACiAJcmV0dXJuIDA7CiB9CiAKKy8qIENhbGxlZCB3aXRoIGRldi0+cXVldWVf bG9jayBoZWxkICovCiBzdGF0aWMgaW50IGdlbV9zdGFydF94bWl0KHN0cnVjdCBza19idWZmICpz a2IsIHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpCiB7CiAJc3RydWN0IGdlbSAqZ3AgPSBkZXYtPnBy aXY7CkBAIC05NzYsOCArOTc3LDE2IEBACiAJCXJldHVybiBORVRERVZfVFhfTE9DS0VEOwogCX0K IAorCS8qIFdlIGNhbiBub3cgZHJvcCBxdWV1ZV9sb2NrIHNpbmNlIHR4X2xvY2sgcHJvdGVjdHMg dXMuIEJ1dCByZW1lbWJlcgorCSAqIHRoYXQgcXVldWVfbG9jayBtdXN0IGJlIHJlYWNxdWlyZWQg YmVmb3JlIHdlIHJldHVybi4gTW9yZW92ZXIgd2UKKwkgKiBtdXN0IHJlYWNxdWlyZSBpdCBiZWZv cmUgcmVsZWFzaW5nIHR4X2xvY2sgdG8gYXZvaWQgYmVpbmcgY2FsbGVkCisJICogd2l0aCB0aGUg cXVldWUgc3RvcHBlZC4KKwkgKi8KKwlzcGluX3VubG9jaygmZGV2LT5xdWV1ZV9sb2NrKTsKKwog CS8qIFRoaXMgaXMgYSBoYXJkIGVycm9yLCBsb2cgaXQuICovCiAJaWYgKFRYX0JVRkZTX0FWQUlM KGdwKSA8PSAoc2tiX3NoaW5mbyhza2IpLT5ucl9mcmFncyArIDEpKSB7CisJCXNwaW5fbG9jaygm ZGV2LT5xdWV1ZV9sb2NrKTsKIAkJbmV0aWZfc3RvcF9xdWV1ZShkZXYpOwogCQlzcGluX3VubG9j a19pcnFyZXN0b3JlKCZncC0+dHhfbG9jaywgZmxhZ3MpOwogCQlwcmludGsoS0VSTl9FUlIgUEZY ICIlczogQlVHISBUeCBSaW5nIGZ1bGwgd2hlbiBxdWV1ZSBhd2FrZSFcbiIsCkBAIC0xMDY2LDYg KzEwNzUsNyBAQAogCQkgICAgICAgZGV2LT5uYW1lLCBlbnRyeSwgc2tiLT5sZW4pOwogCW1iKCk7 CiAJd3JpdGVsKGdwLT50eF9uZXcsIGdwLT5yZWdzICsgVFhETUFfS0lDSyk7CisJc3Bpbl9sb2Nr KCZkZXYtPnF1ZXVlX2xvY2spOwogCXNwaW5fdW5sb2NrX2lycXJlc3RvcmUoJmdwLT50eF9sb2Nr LCBmbGFncyk7CiAKIAlkZXYtPnRyYW5zX3N0YXJ0ID0gamlmZmllczsK ------=_Part_709_5375345.1104708631807-- From eric.lemoine@gmail.com Sun Jan 2 23:33:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 02 Jan 2005 23:33:38 -0800 (PST) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.203]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j037XB6o000815 for ; Sun, 2 Jan 2005 23:33:31 -0800 Received: by wproxy.gmail.com with SMTP id 50so29809wri for ; Sun, 02 Jan 2005 23:41:41 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=cc827pRpvybQlkDhw5gYQr9P6ari95lM9KiR9xjV2v29aAdkHTlWk+yuuThdRsOCk8XrPOw5+zEyOBElAT0QEVh7Obx4aw0ZpkGqc3dzMPB765mweEkvzHp6LJnRAl2MUKGg84vrDXeEMfZngPOhE9MsfXyqOyIhGvmiSPkNrS8= Received: by 10.54.22.35 with SMTP id 35mr229070wrv; Sun, 02 Jan 2005 23:41:40 -0800 (PST) Received: by 10.54.30.8 with HTTP; Sun, 2 Jan 2005 23:41:40 -0800 (PST) Message-ID: <5cac192f050102234168b40bc@mail.gmail.com> Date: Mon, 3 Jan 2005 08:41:40 +0100 From: Eric Lemoine Reply-To: Eric Lemoine To: hadi@cyberus.ca Subject: Re: LLTX and netif_stop_queue Cc: Patrick McHardy , "David S. Miller" , roland@topspin.com, netdev@oss.sgi.com, openib-general@openib.org In-Reply-To: <5cac192f0501021530672a908a@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <52llbwoaej.fsf@topspin.com> <20041217214432.07b7b21e.davem@davemloft.net> <1103484675.1050.158.camel@jzny.localdomain> <5cac192f04122210491d64d4b6@mail.gmail.com> <20041222202919.057b8331.davem@davemloft.net> <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> <5cac192f0501021530672a908a@mail.gmail.com> X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13339 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: eric.lemoine@gmail.com Precedence: bulk X-list: netdev > Two (untested) patches implementing what I described above. > > The first pach (sch_generic.patch) keeps queue_lock held in > qdisc_restart() when calling hard_start_xmit() of a LLTX driver. The > second (sungem.patch) makes sungem release queue_lock after grabbing > its private tx lock. > > Note that the modifications made to qdisc_restart() are not compatible > with the current LLTX drivers. All LLTX drivers must be modified along > sungem.patch's lines. Take sungem.patch as an example of how things > must be done. Correction: the current LLTX drivers need not be modified to work correctly. However, as an opimisation, they can modified along sungem.patch's line. Thanks, -- Eric From thomas.spatzier@de.ibm.com Mon Jan 3 01:03:39 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 01:03:47 -0800 (PST) Received: from mtagate4.de.ibm.com (mtagate4.de.ibm.com [195.212.29.153]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0393HuU007091 for ; Mon, 3 Jan 2005 01:03:38 -0800 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate4.de.ibm.com (8.12.10/8.12.10) with ESMTP id j039BjvU230926 for ; Mon, 3 Jan 2005 09:11:45 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j039CZ3N095016 for ; Mon, 3 Jan 2005 10:12:35 +0100 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11/8.12.11) with ESMTP id j039BiRg004882 for ; Mon, 3 Jan 2005 10:11:45 +0100 Received: from d12ml061.megacenter.de.ibm.com ([9.149.165.51]) by d12av02.megacenter.de.ibm.com (8.12.11/8.12.11) with ESMTP id j039BiJB004874; Mon, 3 Jan 2005 10:11:44 +0100 In-Reply-To: <1103723307.1092.83.camel@jzny.localdomain> Subject: Re: [patch 4/10] s390: network driver. To: hadi@cyberus.ca Cc: "David S. Miller" , Hasso Tepper , Herbert Xu , Jeff Garzik , netdev@oss.sgi.com, Paul Jakma , Tommy Christensen X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: Thomas Spatzier Date: Mon, 3 Jan 2005 10:10:56 +0100 X-MIMETrack: Serialize by Router on D12ML061/12/M/IBM(Release 6.51HF338 | June 21, 2004) at 03/01/2005 10:12:23 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13340 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: thomas.spatzier@de.ibm.com Precedence: bulk X-list: netdev jamal wrote on 22.12.2004 14:48:28: > I think this needs to be resolved too. > It is possible to have a centralized action instead of requiring drivers > to make changes if we know the state of the driver is in netcarrier_off. > What that would require is > on cable gone, you just say: > netif_carrier_off(); > and the top layer code will junk the packets before they hit the driver. > This way the socket code can continue sending whatever it wants but if > theres no link, then its fair to drop those packets? > > If this acceptable i can generate a quick patch. Does Jamal's solution sound good for all? Then I would change my driver to do the following: just call netif_carrier_off() (not netif_stop_queue) Then the upper layers will do the propper thing, so I should not get any more packets. If I still get some, I will drop them. Did I get this correctly? BTW: A happy new year to all ;-) Regards, Thomas. From tgraf@suug.ch Mon Jan 3 04:48:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 04:48:14 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j03Clf0O026270 for ; Mon, 3 Jan 2005 04:48:02 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 4B0AC84; Mon, 3 Jan 2005 13:55:52 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 67CA01C0EA; Mon, 3 Jan 2005 13:56:35 +0100 (CET) Date: Mon, 3 Jan 2005 13:56:35 +0100 From: Thomas Graf To: Jamal Hadi Salim Cc: netdev@oss.sgi.com Subject: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier Message-ID: <20050103125635.GB26856@postel.suug.ch> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="4Ckj6UjgE2iN1+kY" Content-Disposition: inline X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13341 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev --4Ckj6UjgE2iN1+kY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Jamal et al, I attached 4 patches of a first ematch implementation. Comments and suggestions very much appreciated. Compiles but untested. Patch 1: ematch API API visible to classifier: tcf_em_tree_validate(tp, tlv, tree) tlv: ematches TLV tree: temporary struct tcf_ematch_tree Validates the data in the TLV and builds the ematch tree upon the temporary variable. tcf_em_tree_change(tp, dst, src) dst: destination ematch tree (from classifier private data) src: source ematch tree (temporary tree from _validate) Replaces the ematch tree in the classifier with the temporary tree. tcf_em_tree_destroy(tp, tree) Destroys an ematch tree tcf_em_tree_dump(skb, tree, tlv_type) tlv_type: T of ematches TLV (classifier specific) Dumps the ematch tree to the skb with given tlv_type. tcf_em_tree_match(skb, tree, res) res: struct tcf_result * Macro returning 1 if no ematches are configured, otherwise the tree is evaulated and 1 is returned if the tree matches. The complete API is also visible if ematch is not configured but will result in empty macros/structures. Those need to be improved though. API visible to ematches: tcf_em_register(ops) tcf_em_unregister(ops) ematches must at least provide the following callbacks: change, match Optional callbacks are: destroy, dump kind must be set to a unique ID, i thought about declaring 1..2^16 to ematches within the mainline tree and have the rest declared as to be used for private use to avoid collisions. Patch 2: u32 ematch Is an ematch based on the existing u32 match but allows to specify the layer and is able to read u32 values if alignment does not allow direct access. Additionally it supports the operands, eq, lt, gt. It is a few ticks slower than the existing match but worth it. However, it does not support the neat nexthdr via hashing as u32 does which is the main problem before u32 can make proper use of it. Patch 3: nbyte ematch Compares n bytes at specified offset. To be used for IPv6 address matches to avoid 4 ANDed u32 matches. Patch 4: Basic Classifier This is the most basic classifier possible doing nothing more than executing extensions and ematches. It follows the architecture of u32 and fw by storing a filter list in tp->root. This eventually makes fw obsolete once meta ematch is available. I didn't copy the u32/fw code but rather made use of the list.h. pskbs are completely unhandled so far as I'm still not sure how to do it properly. Cheers --4Ckj6UjgE2iN1+kY Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="01_ematch.diff" diff -Nru linux-2.6.10-bk4.orig/include/linux/pkt_cls.h linux-2.6.10-bk4/include/linux/pkt_cls.h --- linux-2.6.10-bk4.orig/include/linux/pkt_cls.h 2005-01-02 21:39:16.000000000 +0100 +++ linux-2.6.10-bk4/include/linux/pkt_cls.h 2005-01-02 21:31:48.000000000 +0100 @@ -319,4 +319,47 @@ #define TCA_TCINDEX_MAX (__TCA_TCINDEX_MAX - 1) +struct tcf_ematch_tree_hdr +{ + __u16 nmatches; + __u16 progid; +}; + +enum +{ + TCA_EMATCH_TREE_UNSPEC, + TCA_EMATCH_TREE_HDR, + TCA_EMATCH_TREE_LIST, + __TCA_EMATCH_TREE_MAX +}; +#define TCA_EMATCH_TREE_MAX (__TCA_EMATCH_TREE_MAX - 1) + +struct tcf_ematch_hdr +{ + __u16 handle; + __u16 matchID; + __u16 kind; + __u8 flags; + __u8 pad; /* currently unused */ +}; + +enum +{ + TCF_EM_CONTAINER, + __TCF_EM_MAX +}; + +#define TCF_EM_REL_MASK 3 +#define TCF_EM_REL_VALID(v) \ + (!(((v) & TCF_EM_REL_MASK) == TCF_EM_REL_MASK)) +#define TCF_EM_LAST_KEY(v) (!((v) & TCF_EM_REL_MASK)) + +#define TCF_EM_REL_OBVIOUS(v, r) (TCF_EM_LAST_KEY(v) || \ + (!(r) && ((v) & TCF_EM_REL_AND)) || ((r) && ((v) & TCF_EM_REL_OR))) + +#define TCF_EM_REL_END (1<<0) +#define TCF_EM_REL_AND (1<<1) +#define TCF_EM_REL_OR (1<<2) +#define TCF_EM_INVERT (1<<3) + #endif diff -Nru linux-2.6.10-bk4.orig/include/linux/rtnetlink.h linux-2.6.10-bk4/include/linux/rtnetlink.h --- linux-2.6.10-bk4.orig/include/linux/rtnetlink.h 2005-01-02 21:39:16.000000000 +0100 +++ linux-2.6.10-bk4/include/linux/rtnetlink.h 2005-01-02 21:32:46.000000000 +0100 @@ -779,6 +779,11 @@ goto rtattr_failure; \ __rta_fill(skb, attrtype, attrlen, data); }) +#define RTA_PUT_NOHDR(skb, attrlen, data) \ +({ if (unlikely(skb_tailroom(skb) < (int)(attrlen))) \ + goto rtattr_failure; \ + memcpy(skb_put(skb, RTA_ALIGN(attrlen)), data, attrlen); }) + static inline struct rtattr * __rta_reserve(struct sk_buff *skb, int attrtype, int attrlen) { diff -Nru linux-2.6.10-bk4.orig/include/net/pkt_cls.h linux-2.6.10-bk4/include/net/pkt_cls.h --- linux-2.6.10-bk4.orig/include/net/pkt_cls.h 2005-01-02 21:39:16.000000000 +0100 +++ linux-2.6.10-bk4/include/net/pkt_cls.h 2005-01-02 21:33:21.000000000 +0100 @@ -149,6 +149,75 @@ extern int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts, struct tcf_ext_map *map); +#ifdef CONFIG_NET_EMATCH + +struct tcf_ematch_ops; + +struct tcf_ematch +{ + struct tcf_ematch_hdr hdr; + struct tcf_ematch_ops * ops; + unsigned long data; +}; + +struct tcf_ematch_tree +{ + struct tcf_ematch_tree_hdr hdr; + struct tcf_ematch * matches; + +}; + +#define em_lookup_match(t, i) (&(t)->matches[(i)]) + +struct tcf_ematch_ops +{ + int kind; + + int (*change)(struct tcf_proto *tp, void *data, + int len, struct tcf_ematch *m); + + int (*match)(struct sk_buff *skb, struct tcf_ematch *m); + int (*destroy)(struct tcf_proto *tp, struct tcf_ematch *m); + int (*dump)(struct sk_buff *skb, struct tcf_ematch *m); + + struct module * owner; + struct list_head link; +}; + +extern int tcf_em_register(struct tcf_ematch_ops *); +extern int tcf_em_unregister(struct tcf_ematch_ops *); +extern int tcf_em_tree_validate(struct tcf_proto *, struct rtattr *, + struct tcf_ematch_tree *); +extern void tcf_em_tree_destroy(struct tcf_proto *, struct tcf_ematch_tree *); +extern int tcf_em_tree_dump(struct sk_buff *, struct tcf_ematch_tree *, int); +extern int __tcf_em_tree_match(struct sk_buff *, struct tcf_ematch_tree *); + +static inline void +tcf_em_tree_change(struct tcf_proto *tp, struct tcf_ematch_tree *dst, + struct tcf_ematch_tree *src) +{ + tcf_tree_lock(tp); + memcpy(dst, src, sizeof(*dst)); + tcf_tree_unlock(tp); +} + +#define tcf_em_tree_match(skb, t) \ + ((t)->hdr.nmatches ? __tcf_em_tree_match(skb, t) : 1) + +#else /* CONFIG_NET_EMATCH */ + +struct tcf_ematch_tree +{ +}; + +#define tcf_em_tree_validate(tp, tb, t) do { } while(0) +#define tcf_em_tree_destroy(tp, t) do { } while(0) +#define tcf_em_tree_dump(skb, t, tlv) do { } while(0) +#define tcf_em_tree_change(tp, dst, src) do { } while(0) +#define tcf_em_tree_match(skb, t) do { } while(0) + +#endif /* CONFIG_NET_EMATCH */ + #ifdef CONFIG_NET_CLS_IND static inline int tcf_change_indev(struct tcf_proto *tp, char *indev, struct rtattr *indev_tlv) diff -Nru linux-2.6.10-bk4.orig/net/sched/Kconfig linux-2.6.10-bk4/net/sched/Kconfig --- linux-2.6.10-bk4.orig/net/sched/Kconfig 2005-01-02 21:39:16.000000000 +0100 +++ linux-2.6.10-bk4/net/sched/Kconfig 2005-01-02 21:31:44.000000000 +0100 @@ -375,6 +375,12 @@ To compile this code as a module, choose M here: the module will be called cls_rsvp6. +config NET_EMATCH + bool "Extended Matches" + depends on NET_CLS + ---help--- + TODO + config NET_CLS_ACT bool "Packet ACTION" depends on EXPERIMENTAL && NET_CLS && NET_QOS diff -Nru linux-2.6.10-bk4.orig/net/sched/Makefile linux-2.6.10-bk4/net/sched/Makefile --- linux-2.6.10-bk4.orig/net/sched/Makefile 2005-01-02 21:39:16.000000000 +0100 +++ linux-2.6.10-bk4/net/sched/Makefile 2005-01-02 21:31:48.000000000 +0100 @@ -33,3 +33,4 @@ obj-$(CONFIG_NET_CLS_RSVP) += cls_rsvp.o obj-$(CONFIG_NET_CLS_TCINDEX) += cls_tcindex.o obj-$(CONFIG_NET_CLS_RSVP6) += cls_rsvp6.o +obj-$(CONFIG_NET_EMATCH) += ematch.o diff -Nru linux-2.6.10-bk4.orig/net/sched/ematch.c linux-2.6.10-bk4/net/sched/ematch.c --- linux-2.6.10-bk4.orig/net/sched/ematch.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.10-bk4/net/sched/ematch.c 2005-01-01 23:32:13.000000000 +0100 @@ -0,0 +1,300 @@ +/* + * net/sched/ematch.c Extended Match API + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: Thomas Graf + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define EMATCH_STACK_SIZE 32 + +static LIST_HEAD(ematch_ops); +static rwlock_t ematch_mod_lock = RW_LOCK_UNLOCKED; + +static inline struct tcf_ematch_ops * +tcf_em_lookup(u16 kind) +{ + struct tcf_ematch_ops *e = NULL; + + read_lock(&ematch_mod_lock); + list_for_each_entry(e, &ematch_ops, link) { + if (kind == e->kind) { + if (!try_module_get(e->owner)) + e = NULL; + break; + } + } + read_unlock(&ematch_mod_lock); + + return e; +} + +int tcf_em_register(struct tcf_ematch_ops *ops) +{ + int err = -EEXIST; + struct tcf_ematch_ops *e; + + write_lock(&ematch_mod_lock); + list_for_each_entry(e, &ematch_ops, link) + if (ops->kind == e->kind) + goto errout; + + list_add_tail(&ops->link, &ematch_ops); + err = 0; +errout: + write_unlock(&ematch_mod_lock); + return err; +} + +int tcf_em_unregister(struct tcf_ematch_ops *ops) +{ + int err = 0; + struct tcf_ematch_ops *e; + + write_lock(&ematch_mod_lock); + list_for_each_entry(e, &ematch_ops, link) { + if (e == ops) { + list_del(&e->link); + goto out; + } + } + + err = -ENOENT; +out: + write_unlock(&ematch_mod_lock); + return err; +} + +static int tcf_em_validate(struct tcf_proto *tp, struct tcf_ematch_tree_hdr *th, + struct tcf_ematch *m, struct rtattr *rta) +{ + int err = -EINVAL; + struct tcf_ematch_hdr *mh = RTA_DATA(rta); + int datalen = RTA_PAYLOAD(rta) - sizeof(*mh); + void *data = (void *) data + sizeof(*mh); + + if (!TCF_EM_REL_VALID(mh->flags)) + goto errout; + + memcpy(&m->hdr, mh, sizeof(*mh)); + + if (mh->kind == TCF_EM_CONTAINER) { + u32 ref; + + if (datalen < sizeof(ref)) + goto errout; + ref = *(u32 *) data; + if (ref >= th->nmatches) + goto errout; + m->data = ref; + } else { + struct tcf_ematch_ops *ops = tcf_em_lookup(mh->kind); + + if (ops == NULL) { + err = -ENOENT; + goto errout; + } + + if (ops->change) { + err = ops->change(tp, data, datalen, m); + if (err < 0) + goto errout; + } + } + + err = 0; +errout: + return err; +} + +int tcf_em_tree_validate(struct tcf_proto *tp, struct rtattr *rta, + struct tcf_ematch_tree *tree) +{ + int i, len, mlen, err = -EINVAL; + struct rtattr *m, *tb[TCA_EMATCH_TREE_MAX]; + struct tcf_ematch_tree_hdr *th; + + if (!rta || rtattr_parse_nested(tb, TCA_EMATCH_TREE_MAX, rta) < 0) + goto errout; + + if (RTA_PAYLOAD(tb[TCA_EMATCH_TREE_HDR-1]) < sizeof(*th) || + RTA_PAYLOAD(tb[TCA_EMATCH_TREE_LIST-1]) < sizeof(*m)) + goto errout; + + th = RTA_DATA(tb[TCA_EMATCH_TREE_HDR-1]); + m = RTA_DATA(tb[TCA_EMATCH_TREE_LIST-1]); + len = RTA_PAYLOAD(tb[TCA_EMATCH_TREE_LIST-1]); + mlen = th->nmatches * sizeof(struct tcf_ematch); + + memcpy(&tree->hdr, th, sizeof(*th)); + + tree->matches = kmalloc(mlen, GFP_KERNEL); + if (tree->matches == NULL) + goto errout; + memset(tree->matches, 0, mlen); + + for (i = 0; RTA_OK(m, len); i++) { + if (rta->rta_type != (i+1) || i >= th->nmatches || + RTA_PAYLOAD(rta) < sizeof(struct tcf_ematch_hdr)) { + err = -EINVAL; + goto errout_abort; + } + + err = tcf_em_validate(tp, th, em_lookup_match(tree, i), rta); + if (err < 0) + goto errout_abort; + + m = RTA_NEXT(m, len); + } + + if (i != th->nmatches) { + err = -EINVAL; + goto errout_abort; + } + + + err = 0; +errout: + return err; + +errout_abort: + tcf_em_tree_destroy(tp, tree); + return err; +} + + +void tcf_em_tree_destroy(struct tcf_proto *tp, struct tcf_ematch_tree *t) +{ + int i; + + if (t->matches == NULL) + return; + + for (i = 0; i < t->hdr.nmatches; i++) { + struct tcf_ematch *m = em_lookup_match(t, i); + if (m->ops) { + if (m->ops->destroy) + m->ops->destroy(tp, m); + module_put(m->ops->owner); + } + } + + kfree(t->matches); +} + +int tcf_em_tree_dump(struct sk_buff *skb, struct tcf_ematch_tree *t, int tlv) +{ + int i; + struct rtattr * p_rta = (struct rtattr*) skb->tail; + struct rtattr * pm_rta; + + RTA_PUT(skb, tlv, 0, NULL); + RTA_PUT(skb, TCA_EMATCH_TREE_HDR, sizeof(t->hdr), &t->hdr); + + pm_rta = (struct rtattr *) skb->tail; + RTA_PUT(skb, TCA_EMATCH_TREE_LIST, 0, NULL); + + for (i = 0; i < t->hdr.nmatches; i++) { + struct rtattr * pd_rta = (struct rtattr*) skb->tail; + struct tcf_ematch *m = em_lookup_match(t, i); + + RTA_PUT(skb, i+1, sizeof(m->hdr), &m->hdr); + if (m->ops->dump && m->ops->dump(skb, m) < 0) + goto rtattr_failure; + pd_rta->rta_len = skb->tail - (u8*) pd_rta; + } + + pm_rta->rta_len = skb->tail - (u8*)pm_rta; + p_rta->rta_len = skb->tail - (u8*)p_rta; + return 0; +rtattr_failure: + return -1; +} + +static inline int tcf_em_match(struct sk_buff *skb, struct tcf_ematch *m) +{ + int r = 0; + + if (m->ops->match) + r = m->ops->match(skb, m); + + return m->hdr.flags & TCF_EM_INVERT ? !r : r; +} + +/* Do not use this function directly, use tcf_em_tree_match */ +int __tcf_em_tree_match(struct sk_buff *skb, struct tcf_ematch_tree *t) +{ + int i = 0, n = 0, r = 0; + struct tcf_ematch *m; + int stack[EMATCH_STACK_SIZE]; + + memset(stack, 0, sizeof(stack)); + +proceed: + while (n < t->hdr.nmatches) { + m = em_lookup_match(t, n); + + if (m->hdr.kind == TCF_EM_CONTAINER) { + if (unlikely(i >= EMATCH_STACK_SIZE)) { + if (net_ratelimit()) + printk("Local stack overflow, " \ + "increase EMATCH_STACK_SIZE\n"); + return -1; + } + + if (unlikely(m->data <= n)) { + if (net_ratelimit()) + printk("Detected backward precedence " \ + "jump, fix your filter.\n"); + return -1; + } + + stack[i++] = n; + n = m->data; + continue; + } + + r = tcf_em_match(skb, m); + if (TCF_EM_REL_OBVIOUS(m->hdr.flags, r)) + break; + n++; + } + +pop_stack: + if (i > 0) { + n = stack[--i]; + m = em_lookup_match(t, n); + + if (TCF_EM_REL_OBVIOUS(m->hdr.flags, r)) + goto pop_stack; + else { + n++; + goto proceed; + } + } + + return r; +} + +EXPORT_SYMBOL(tcf_em_register); +EXPORT_SYMBOL(tcf_em_unregister); +EXPORT_SYMBOL(tcf_em_tree_validate); +EXPORT_SYMBOL(tcf_em_tree_destroy); +EXPORT_SYMBOL(tcf_em_tree_dump); +EXPORT_SYMBOL(__tcf_em_tree_match); + --4Ckj6UjgE2iN1+kY Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="02_em_u32.diff" diff -Nru linux-2.6.10-bk4.orig/include/linux/pkt_cls.h linux-2.6.10-bk4/include/linux/pkt_cls.h --- linux-2.6.10-bk4.orig/include/linux/pkt_cls.h 2005-01-02 22:37:46.000000000 +0100 +++ linux-2.6.10-bk4/include/linux/pkt_cls.h 2005-01-02 22:37:39.000000000 +0100 @@ -346,6 +346,7 @@ enum { TCF_EM_CONTAINER, + TCF_EM_U32, __TCF_EM_MAX }; @@ -362,4 +363,28 @@ #define TCF_EM_REL_OR (1<<2) #define TCF_EM_INVERT (1<<3) +struct tcf_em_u32 +{ + __u32 val; + __u32 mask; + __u16 off; + __u8 align; + __u8 layer:4; + __u8 opnd:4; +}; + +enum +{ + TCF_EM_ALIGN_U8 = 1, + TCF_EM_ALIGN_U16 = 2, + TCF_EM_ALIGN_U32 = 4 +}; + +enum +{ + TCF_EM_OPND_EQ, + TCF_EM_OPND_GT, + TCF_EM_OPND_LT +}; + #endif diff -Nru linux-2.6.10-bk4.orig/include/net/pkt_cls.h linux-2.6.10-bk4/include/net/pkt_cls.h --- linux-2.6.10-bk4.orig/include/net/pkt_cls.h 2005-01-02 22:37:46.000000000 +0100 +++ linux-2.6.10-bk4/include/net/pkt_cls.h 2005-01-02 22:23:24.000000000 +0100 @@ -218,6 +218,36 @@ #endif /* CONFIG_NET_EMATCH */ +static inline u32 tcf_read_bucket(u8 *ptr, u8 align) +{ + switch (align) { + case TCF_EM_ALIGN_U8: + return *ptr; + case TCF_EM_ALIGN_U16: + return (*ptr << 8) | *(ptr+1); + case TCF_EM_ALIGN_U32: + return (*ptr << 24) | (*(ptr+1) << 16) | + (*(ptr+2) << 8) | *(ptr+3); + } + return 0; +} + +static inline u8 * tcf_get_base_ptr(struct sk_buff *skb, u8 layer) +{ + switch (layer) { + case 0: + return skb->data; + case 1: + return skb->nh.raw; + case 2: + return skb->h.raw; + } + return NULL; +} + +#define tcf_valid_offset(skb, ptr, off, len) \ + ((ptr + off + len) < skb->tail && (ptr + off) > skb->head) + #ifdef CONFIG_NET_CLS_IND static inline int tcf_change_indev(struct tcf_proto *tp, char *indev, struct rtattr *indev_tlv) diff -Nru linux-2.6.10-bk4.orig/net/sched/Kconfig linux-2.6.10-bk4/net/sched/Kconfig --- linux-2.6.10-bk4.orig/net/sched/Kconfig 2005-01-02 22:37:46.000000000 +0100 +++ linux-2.6.10-bk4/net/sched/Kconfig 2005-01-02 22:37:39.000000000 +0100 @@ -381,6 +381,12 @@ ---help--- TODO +config NET_EMATCH_U32 + tristate "U32" + depends on NET_EMATCH + ---help--- + TODO + config NET_CLS_ACT bool "Packet ACTION" depends on EXPERIMENTAL && NET_CLS && NET_QOS diff -Nru linux-2.6.10-bk4.orig/net/sched/Makefile linux-2.6.10-bk4/net/sched/Makefile --- linux-2.6.10-bk4.orig/net/sched/Makefile 2005-01-02 22:37:46.000000000 +0100 +++ linux-2.6.10-bk4/net/sched/Makefile 2005-01-02 22:37:39.000000000 +0100 @@ -34,3 +34,4 @@ obj-$(CONFIG_NET_CLS_TCINDEX) += cls_tcindex.o obj-$(CONFIG_NET_CLS_RSVP6) += cls_rsvp6.o obj-$(CONFIG_NET_EMATCH) += ematch.o +obj-$(CONFIG_NET_EMATCH_U32) += em_u32.o diff -Nru linux-2.6.10-bk4.orig/net/sched/em_u32.c linux-2.6.10-bk4/net/sched/em_u32.c --- linux-2.6.10-bk4.orig/net/sched/em_u32.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.10-bk4/net/sched/em_u32.c 2005-01-02 22:38:27.000000000 +0100 @@ -0,0 +1,98 @@ +/* + * net/sched/em_u32.c U32 ematch + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: Thomas Graf + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int em_u32_change(struct tcf_proto *tp, void *data, int len, + struct tcf_ematch *m) +{ + if (len != sizeof(struct tcf_em_u32)) + return -EINVAL; + + m->data = (unsigned long) kmalloc(len, GFP_KERNEL); + if (!m->data) + return -ENOBUFS; + + memcpy((void *) m->data, data, len); + return 0; +} + +static int em_u32_match(struct sk_buff *skb, struct tcf_ematch *m) +{ + struct tcf_em_u32 *u = (struct tcf_em_u32 *) m->data; + u8 *ptr = tcf_get_base_ptr(skb, u->layer); + u32 v; + + if (unlikely(!tcf_valid_offset(skb, ptr, u->off, u->align))) + return 0; + + v = tcf_read_bucket(ptr + u->off, u->align) & u->mask; + + switch (u->opnd) { + case TCF_EM_OPND_EQ: + return v == u->val; + case TCF_EM_OPND_LT: + return v < u->val; + case TCF_EM_OPND_GT: + return v > u->val; + } + + return 0; +} + +static int em_u32_destroy(struct tcf_proto *tp, struct tcf_ematch *m) +{ + kfree((void *) m->data); + return 0; +} + +static int em_u32_dump(struct sk_buff *skb, struct tcf_ematch *m) +{ + RTA_PUT_NOHDR(skb, sizeof(struct tcf_em_u32), (void *) m->data); + return 0; +rtattr_failure: + return -1; +} + +static struct tcf_ematch_ops em_u32_ops = { + .kind = TCF_EM_U32, + .change = em_u32_change, + .match = em_u32_match, + .destroy = em_u32_destroy, + .dump = em_u32_dump, + .owner = THIS_MODULE, + .link = LIST_HEAD_INIT(em_u32_ops.link) +}; + +static int __init init_em_u32(void) +{ + return tcf_em_register(&em_u32_ops); +} + +static void __exit exit_em_u32(void) +{ + tcf_em_unregister(&em_u32_ops); +} + +MODULE_LICENSE("GPL"); + +module_init(init_em_u32); +module_exit(exit_em_u32); + --4Ckj6UjgE2iN1+kY Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="03_em_nbyte.diff" diff -Nru linux-2.6.10-bk4.orig/include/linux/pkt_cls.h linux-2.6.10-bk4/include/linux/pkt_cls.h --- linux-2.6.10-bk4.orig/include/linux/pkt_cls.h 2005-01-02 22:44:16.000000000 +0100 +++ linux-2.6.10-bk4/include/linux/pkt_cls.h 2005-01-02 22:44:31.000000000 +0100 @@ -347,6 +347,7 @@ { TCF_EM_CONTAINER, TCF_EM_U32, + TCF_EM_NBYTE, __TCF_EM_MAX }; @@ -387,4 +388,11 @@ TCF_EM_OPND_LT }; +struct tcf_em_nbyte +{ + __u16 off; + __u16 len:12; + __u8 layer:4; +}; + #endif diff -Nru linux-2.6.10-bk4.orig/net/sched/Kconfig linux-2.6.10-bk4/net/sched/Kconfig --- linux-2.6.10-bk4.orig/net/sched/Kconfig 2005-01-02 22:44:16.000000000 +0100 +++ linux-2.6.10-bk4/net/sched/Kconfig 2005-01-02 22:44:31.000000000 +0100 @@ -387,6 +387,12 @@ ---help--- TODO +config NET_EMATCH_NBYTE + tristate "N-Byte" + depends on NET_EMATCH + ---help--- + TODO + config NET_CLS_ACT bool "Packet ACTION" depends on EXPERIMENTAL && NET_CLS && NET_QOS diff -Nru linux-2.6.10-bk4.orig/net/sched/Makefile linux-2.6.10-bk4/net/sched/Makefile --- linux-2.6.10-bk4.orig/net/sched/Makefile 2005-01-02 22:44:16.000000000 +0100 +++ linux-2.6.10-bk4/net/sched/Makefile 2005-01-02 22:44:31.000000000 +0100 @@ -35,3 +35,4 @@ obj-$(CONFIG_NET_CLS_RSVP6) += cls_rsvp6.o obj-$(CONFIG_NET_EMATCH) += ematch.o obj-$(CONFIG_NET_EMATCH_U32) += em_u32.o +obj-$(CONFIG_NET_EMATCH_NBYTE) += em_nbyte.o diff -Nru linux-2.6.10-bk4.orig/net/sched/em_nbyte.c linux-2.6.10-bk4/net/sched/em_nbyte.c --- linux-2.6.10-bk4.orig/net/sched/em_nbyte.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.10-bk4/net/sched/em_nbyte.c 2005-01-02 22:54:20.000000000 +0100 @@ -0,0 +1,95 @@ +/* + * net/sched/em_nbyte.c N-Byte ematch + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: Thomas Graf + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct nbyte_data +{ + struct tcf_em_nbyte hdr; + char pattern[0]; +}; + +static int em_nbyte_validate(struct tcf_proto *tp, void *data, int len, + struct tcf_ematch *m) +{ + struct tcf_em_nbyte *n = data; + + if (len < sizeof(*n) || len < (sizeof(*n) + n->len)) + return -EINVAL; + + m->data = (unsigned long) kmalloc(sizeof(*n) + n->len, GFP_KERNEL); + if (!m->data) + return -ENOBUFS; + + memcpy((void *) m->data, data, sizeof(*n) + n->len); + return 0; +} + +static int em_nbyte_match(struct sk_buff *skb, struct tcf_ematch *m) +{ + struct nbyte_data *d = (struct nbyte_data *) m->data; + u8 *ptr = tcf_get_base_ptr(skb, d->hdr.layer); + + if (unlikely(!tcf_valid_offset(skb, ptr, d->hdr.off, d->hdr.len))) + return 0; + + return !memcmp(ptr + d->hdr.off, d->pattern, d->hdr.len); +} + +static int em_nbyte_destroy(struct tcf_proto *tp, struct tcf_ematch *m) +{ + kfree((void *) m->data); + return 0; +} + +static int em_nbyte_dump(struct sk_buff *skb, struct tcf_ematch *m) +{ + struct nbyte_data *d = (struct nbyte_data *) m->data; + RTA_PUT_NOHDR(skb, sizeof(*d) + d->hdr.len, d); + return 0; +rtattr_failure: + return -1; +} + +static struct tcf_ematch_ops em_nbyte_ops = { + .kind = TCF_EM_NBYTE, + .change = em_nbyte_validate, + .match = em_nbyte_match, + .destroy = em_nbyte_destroy, + .dump = em_nbyte_dump, + .owner = THIS_MODULE, + .link = LIST_HEAD_INIT(em_nbyte_ops.link) +}; + +static int __init init_em_nbyte(void) +{ + return tcf_em_register(&em_nbyte_ops); +} + +static void __exit exit_em_nbyte(void) +{ + tcf_em_unregister(&em_nbyte_ops); +} + +MODULE_LICENSE("GPL"); + +module_init(init_em_nbyte); +module_exit(exit_em_nbyte); + --4Ckj6UjgE2iN1+kY Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="04_cls_basic.diff" diff -Nru linux-2.6.10-bk4.orig/include/linux/pkt_cls.h linux-2.6.10-bk4/include/linux/pkt_cls.h --- linux-2.6.10-bk4.orig/include/linux/pkt_cls.h 2005-01-02 22:57:36.000000000 +0100 +++ linux-2.6.10-bk4/include/linux/pkt_cls.h 2005-01-03 02:43:05.000000000 +0100 @@ -319,6 +319,20 @@ #define TCA_TCINDEX_MAX (__TCA_TCINDEX_MAX - 1) +/* Basic filter */ + +enum +{ + TCA_BASIC_UNSPEC, + TCA_BASIC_CLASSID, + TCA_BASIC_EMATCHES, + TCA_BASIC_ACT, + TCA_BASIC_POLICE, + __TCA_BASIC_MAX +}; + +#define TCA_BASIC_MAX (__TCA_BASIC_MAX - 1) + struct tcf_ematch_tree_hdr { __u16 nmatches; diff -Nru linux-2.6.10-bk4.orig/net/sched/Kconfig linux-2.6.10-bk4/net/sched/Kconfig --- linux-2.6.10-bk4.orig/net/sched/Kconfig 2005-01-02 22:57:36.000000000 +0100 +++ linux-2.6.10-bk4/net/sched/Kconfig 2005-01-03 03:27:54.000000000 +0100 @@ -269,6 +269,12 @@ Documentation and software is at . +config NET_CLS_BASIC + tristate "Basic classifier" + depends on NET_CLS + ---help--- + TODO + config NET_CLS_TCINDEX tristate "TC index classifier" depends on NET_CLS diff -Nru linux-2.6.10-bk4.orig/net/sched/Makefile linux-2.6.10-bk4/net/sched/Makefile --- linux-2.6.10-bk4.orig/net/sched/Makefile 2005-01-02 22:57:36.000000000 +0100 +++ linux-2.6.10-bk4/net/sched/Makefile 2005-01-03 03:27:21.000000000 +0100 @@ -33,6 +33,7 @@ obj-$(CONFIG_NET_CLS_RSVP) += cls_rsvp.o obj-$(CONFIG_NET_CLS_TCINDEX) += cls_tcindex.o obj-$(CONFIG_NET_CLS_RSVP6) += cls_rsvp6.o +obj-$(CONFIG_NET_CLS_BASIC) += cls_basic.o obj-$(CONFIG_NET_EMATCH) += ematch.o obj-$(CONFIG_NET_EMATCH_U32) += em_u32.o obj-$(CONFIG_NET_EMATCH_NBYTE) += em_nbyte.o diff -Nru linux-2.6.10-bk4.orig/net/sched/cls_basic.c linux-2.6.10-bk4/net/sched/cls_basic.c --- linux-2.6.10-bk4.orig/net/sched/cls_basic.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.10-bk4/net/sched/cls_basic.c 2005-01-03 13:32:00.000000000 +0100 @@ -0,0 +1,300 @@ +/* + * net/sched/cls_basic.c Basic Packet Classifier. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: Thomas Graf + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct basic_head +{ + u32 hgenerator; + struct list_head flist; +}; + +struct basic_filter +{ + u32 handle; + struct tcf_exts exts; + struct tcf_ematch_tree ematches; + struct tcf_result res; + struct list_head link; +}; + +static struct tcf_ext_map basic_ext_map = { + .action = TCA_BASIC_ACT, + .police = TCA_BASIC_POLICE +}; + +static int basic_classify(struct sk_buff *skb, struct tcf_proto *tp, + struct tcf_result *res) +{ + int r; + struct basic_head *head = (struct basic_head *) tp->root; + struct basic_filter *f; + + list_for_each_entry(f, &head->flist, link) { + if (!tcf_em_tree_match(skb, &f->ematches)) + continue; + *res = f->res; + r = tcf_exts_exec(skb, &f->exts, res); + if (r < 0) + continue; + return r; + } + return -1; +} + +static unsigned long basic_get(struct tcf_proto *tp, u32 handle) +{ + unsigned long l = 0UL; + struct basic_head *head = (struct basic_head *) tp->root; + struct basic_filter *f; + + list_for_each_entry(f, &head->flist, link) + if (f->handle == handle) + l = (unsigned long) f; + + return l; +} + +static void basic_put(struct tcf_proto *tp, unsigned long f) +{ +} + +static int basic_init(struct tcf_proto *tp) +{ + return 0; +} + +static inline void +basic_delete_filter(struct tcf_proto *tp, struct basic_filter *f) +{ + tcf_unbind_filter(tp, &f->res); + tcf_exts_destroy(tp, &f->exts); + tcf_em_tree_destroy(tp, &f->ematches); + kfree(f); +} + +static void basic_destroy(struct tcf_proto *tp) +{ + struct basic_head *head = (struct basic_head *) xchg(&tp->root, NULL); + struct basic_filter *f, *n; + + list_for_each_entry_safe(f, n, &head->flist, link) { + list_del(&f->link); + basic_delete_filter(tp, f); + } +} + +static int basic_delete(struct tcf_proto *tp, unsigned long arg) +{ + struct basic_head *head = (struct basic_head *) tp->root; + struct basic_filter *t, *f = (struct basic_filter *) arg; + + list_for_each_entry(t, &head->flist, link) + if (t == f) { + tcf_tree_lock(tp); + list_del(&t->link); + tcf_tree_unlock(tp); + basic_delete_filter(tp, t); + return 0; + } + + return -ENOENT; +} + +static inline int basic_set_parms(struct tcf_proto *tp, struct basic_filter *f, + unsigned long base, struct rtattr **tb, + struct rtattr *est) +{ + int err; + struct tcf_exts e; + struct tcf_ematch_tree t; + + err = tcf_exts_validate(tp, tb, est, &e, &basic_ext_map); + if (err < 0) + return err; + + err = tcf_em_tree_validate(tp, tb[TCA_BASIC_EMATCHES-1], &t); + if (err < 0) + goto errout; + + if (tb[TCA_BASIC_CLASSID-1]) { + err = -EINVAL; + if (RTA_PAYLOAD(tb[TCA_BASIC_CLASSID-1]) < sizeof(u32)) + goto errout; + + f->res.classid = *(u32*)RTA_DATA(tb[TCA_BASIC_CLASSID-1]); + tcf_bind_filter(tp, &f->res, base); + } + + tcf_exts_change(tp, &f->exts, &e); + tcf_em_tree_change(tp, &f->ematches, &t); + + return 0; +errout: + tcf_exts_destroy(tp, &e); + return err; +} + +static int basic_change(struct tcf_proto *tp, unsigned long base, u32 handle, + struct rtattr **tca, unsigned long *arg) +{ + int err = -EINVAL; + struct basic_head *head = (struct basic_head *) tp->root; + struct rtattr *tb[TCA_BASIC_MAX]; + struct basic_filter *f = (struct basic_filter *) *arg; + + if (!tca[TCA_OPTIONS-1]) + return -EINVAL; + + if (rtattr_parse_nested(tb, TCA_BASIC_MAX, tca[TCA_OPTIONS-1]) < 0) + return -EINVAL; + + if (f != NULL) { + if (handle && f->handle != handle) + return -EINVAL; + return basic_set_parms(tp, f, base, tb, tca[TCA_RATE-1]); + } + + err = -ENOBUFS; + if (!head) { + head = kmalloc(sizeof(*head), GFP_KERNEL); + if (!head) + goto errout; + + memset(head, 0, sizeof(*head)); + INIT_LIST_HEAD(&head->flist); + tp->root = head; + } + + f = kmalloc(sizeof(*f), GFP_KERNEL); + if (!f) + goto errout; + memset(f, 0, sizeof(*f)); + + err = -EINVAL; + if (handle) + f->handle = handle; + else { + int i = 0x80000000; + do { + if (++head->hgenerator == 0x7FFFFFFF) + head->hgenerator = 1; + } while (--i > 0 && basic_get(tp, head->hgenerator)); + + if (i <= 0) { + printk(KERN_ERR "Insufficient number of handles\n"); + goto errout; + } + + f->handle = head->hgenerator; + } + + err = basic_set_parms(tp, f, base, tb, tca[TCA_RATE-1]); + if (err < 0) + goto errout; + + tcf_tree_lock(tp); + list_add(&f->link, &head->flist); + tcf_tree_unlock(tp); + *arg = (unsigned long) f; + + return 0; +errout: + if (*arg == 0UL && f) + kfree(f); + + return err; +} + +static void basic_walk(struct tcf_proto *tp, struct tcf_walker *arg) +{ + struct basic_head *head = (struct basic_head *) tp->root; + struct basic_filter *f; + + list_for_each_entry(f, &head->flist, link) { + if (arg->count < arg->skip) + goto skip; + + if (arg->fn(tp, (unsigned long) f, arg) < 0) { + arg->stop = 1; + break; + } +skip: + arg->count++; + } +} + +static int basic_dump(struct tcf_proto *tp, unsigned long fh, + struct sk_buff *skb, struct tcmsg *t) +{ + struct basic_filter *f = (struct basic_filter *) fh; + unsigned char *b = skb->tail; + struct rtattr *rta; + + if (!f) + return skb->len; + + t->tcm_handle = f->handle; + + rta = (struct rtattr *) b; + RTA_PUT(skb, TCA_OPTIONS, 0, NULL); + + if (tcf_exts_dump(skb, &f->exts, &basic_ext_map) < 0 || + tcf_em_tree_dump(skb, &f->ematches, TCA_BASIC_EMATCHES) < 0) + goto rtattr_failure; + + rta->rta_len = (skb->tail - b); + return skb->len; + +rtattr_failure: + skb_trim(skb, b - skb->data); + return -1; +} + +static struct tcf_proto_ops cls_basic_ops = { + .kind = "basic", + .classify = basic_classify, + .init = basic_init, + .destroy = basic_destroy, + .get = basic_get, + .put = basic_put, + .change = basic_change, + .delete = basic_delete, + .walk = basic_walk, + .dump = basic_dump, + .owner = THIS_MODULE, +}; + +static int __init init_basic(void) +{ + return register_tcf_proto_ops(&cls_basic_ops); +} + +static void __exit exit_basic(void) +{ + unregister_tcf_proto_ops(&cls_basic_ops); +} + +module_init(init_basic) +module_exit(exit_basic) +MODULE_LICENSE("GPL"); + --4Ckj6UjgE2iN1+kY-- From okir@suse.de Mon Jan 3 06:25:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 06:25:11 -0800 (PST) Received: from Cantor.suse.de (mail.suse.de [195.135.220.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j03EOecH030329 for ; Mon, 3 Jan 2005 06:25:03 -0800 Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 0616412C516C for ; Mon, 3 Jan 2005 15:33:07 +0100 (CET) Date: Mon, 3 Jan 2005 15:33:06 +0100 From: Olaf Kirch To: netdev@oss.sgi.com Subject: [PATCH] Check for SOL_SOCKET in compat_sys_getsockopt Message-ID: <20050103143306.GG25446@suse.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="IiVenqGWf+H9Y6IX" Content-Disposition: inline User-Agent: Mutt/1.5.6i X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13342 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: okir@suse.de Precedence: bulk X-list: netdev --IiVenqGWf+H9Y6IX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline compat_sys_getsockopt checks for SO_RCVTIMEO/SO_SNDTIMEO without making sure that the level is actually SOL_SOCKET. This can break getsockopt() requests for other protocols. Cheers, and a happy new year to everyone! Olaf -- Olaf Kirch | Things that make Monday morning interesting, #2: okir@suse.de | "We have 8,000 NFS mount points, why do we keep ---------------+ running out of privileged ports?" --IiVenqGWf+H9Y6IX Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=setsockopt-compat Subject: check for SOL_SOCKET in compat_sys_getsocket compat_sys_getsockopt checks for SO_RCVTIMEO/SO_SNDTIMEO without making sure that the level is actually SOL_SOCKET. This can break getsockopt() requests for other protocols. Signed-off-by: Olaf Kirch Index: linux-2.6.9/net/compat.c =================================================================== --- linux-2.6.9.orig/net/compat.c 2005-01-03 15:25:11.000000000 +0100 +++ linux-2.6.9/net/compat.c 2005-01-03 15:25:29.000000000 +0100 @@ -507,7 +507,8 @@ static int do_get_sock_timeout(int fd, i asmlinkage long compat_sys_getsockopt(int fd, int level, int optname, char __user *optval, int __user *optlen) { - if (optname == SO_RCVTIMEO || optname == SO_SNDTIMEO) + if (level == SOL_SOCKET && + (optname == SO_RCVTIMEO || optname == SO_SNDTIMEO)) return do_get_sock_timeout(fd, level, optname, optval, optlen); return sys_getsockopt(fd, level, optname, optval, optlen); } --IiVenqGWf+H9Y6IX-- From hadi@cyberus.ca Mon Jan 3 06:28:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 06:28:53 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j03ESP1U030896 for ; Mon, 3 Jan 2005 06:28:45 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1ClTKL-00030n-8H for netdev@oss.sgi.com; Mon, 03 Jan 2005 09:36:57 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1ClTKJ-0003Wa-HA; Mon, 03 Jan 2005 09:36:55 -0500 Subject: Re: [PKT_SCHED]: Allow using nfmark as key in U32 classifier. From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <20050102000612.GU32419@postel.suug.ch> References: <20041230174313.GB32419@postel.suug.ch> <1104469111.1049.219.camel@jzny.localdomain> <20041231110836.GD32419@postel.suug.ch> <1104505142.1048.262.camel@jzny.localdomain> <20041231153930.GN32419@postel.suug.ch> <1104511494.1048.303.camel@jzny.localdomain> <20041231181153.GP32419@postel.suug.ch> <1104526311.1047.379.camel@jzny.localdomain> <20050101121041.GR32419@postel.suug.ch> <1104622164.1048.444.camel@jzny.localdomain> <20050102000612.GU32419@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1104763012.1047.524.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 03 Jan 2005 09:36:52 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13343 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Sat, 2005-01-01 at 19:06, Thomas Graf wrote: > * jamal <1104622164.1048.444.camel@jzny.localdomain> 2005-01-01 18:29 > > Does the ematch API include a dump()? I dont think it should - thats the > > point i was making. Should be simple. > > Yes, although simple ematches are not required to implement dump. ok. I realize its optional - but i wouldnt even give the writter of ematch the opportunity to write one. Want something more complex? write a classifier. > > > [validate] > > Even this is too much for a simple ematch. Validation should happen in > > user space or maybe at the mother clasifier. maybe a maxsize,minsize > > attribute is needed in the ematch struct. > > > [replace] > > Equivalent of this should be done by the mother classifier. > > All it needs to know is the length (and no other details). And the > > length is known from the L in TLV. > > I merged validate/replace into change which takes a unsigned long > for storage and a data/len parameter. It's up to the ematch what he > does with it, data may contain a u32 directly and the ematch might > save it in the unsigned long or a ematch may allocate a structure. Again allowing for this may be overkill. Just send the same structure the ematch needs in exactly the same form it needs it and you dont need this. > Why are you focused on hiding so much? I'd rather try to make it > simple but still allow more complex ematches to exist. > > Have a look at http://people.suug.ch/~tgr/tmp/ematch.diff Thanks, give me a few hours then i will look. > I broke the API down to: > > change > match > destroy (optional, only for complex ematches) > dump (optional, only for complex ematches) > Other than match, anything really should be optional for simplicity sake. > > Note that the ematch is supposed to be a very very simple thing... > > Something a fireman who has implemented a iptables target can whip in an > > hour. Keep in mind that design goal. Non trivial coding needed or poor > > usability is the major problem with tc in general. Avoid that theme. > > An ematch _needs_ a mother classifier such as u32. u32 has a very nice > > and very flexible layout - it can be trained to build any sort of tree. > > Maybe the first step should be to not even have u32 as an ematch .. > > I understand your point but I want to at least be able to implement > some more complex stuff. Hiding too much can be bad too. Having only 2 > functions to implement is really easy, the rest can be done the LinuxWay(tm) ;-> > True - but the goals of this ematch is to be simple ;-> > Have a look at the code and tell me what you think. > > Here's an example ematch, I find this quite simple already. > > static in foo_change(struct tcf_proto *tp, void *data, int len, struct > tcf_ematch *m) > { > if (len != sizeof(u32)) > return -EINVAL; > m->data = *(u32*)data; > return 0; > } > I still say not needed ;-> > static int foo_match(struct sk_buff *skb, struct tcf_ematch *m) > { > return skb->security == m->data; > } makes sense. > static struct tcf_ematch_ops foo_ops = { > .kind = 111, > .change = foo_change, > .match = foo_match, > .owner = THIS_MODULE, > .link = LIST_HEAD_INIT(foo_ops.link) > } whats the .link for? > static int __init foo_init(void) > { > return tcf_ematch_register(&foo_ops); > } > > static void __exit foo_exit(void) > { > return tcf_ematch_unregister(&foo_ops); > } > > module_init(init_foo); > module_exit(exit_foo); All looks good. Give me a few hours, first day of working week will slow me down. cheers, jamal From hadi@cyberus.ca Mon Jan 3 06:38:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 06:38:19 -0800 (PST) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j03EbqCH031733 for ; Mon, 3 Jan 2005 06:38:12 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.30) id 1ClTTU-0006Ip-47 for netdev@oss.sgi.com; Mon, 03 Jan 2005 09:46:24 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1ClTTR-00058B-0M; Mon, 03 Jan 2005 09:46:21 -0500 Subject: Re: patch: tunnels not setting inputdev From: jamal Reply-To: hadi@cyberus.ca To: Patrick McHardy Cc: "David S. Miller" , netdev@oss.sgi.com, Wichert Akkerman In-Reply-To: <41D73F28.3090206@trash.net> References: <1104513392.1048.316.camel@jzny.localdomain> <41D5941C.8060001@trash.net> <1104523892.1047.338.camel@jzny.localdomain> <41D6CB87.8040205@trash.net> <1104622406.1049.450.camel@jzny.localdomain> <41D73F28.3090206@trash.net> Content-Type: multipart/mixed; boundary="=-fHTulGJembddNxbTRWt5" Organization: jamalopolous Message-Id: <1104763578.1047.553.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 03 Jan 2005 09:46:18 -0500 X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13344 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev --=-fHTulGJembddNxbTRWt5 Content-Type: text/plain Content-Transfer-Encoding: 7bit On Sat, 2005-01-01 at 19:24, Patrick McHardy wrote: > jamal wrote: > > I want to understand the repurcasssions instead of blindly setting. Let > > users complain, thats why the printk exists. For example what does > > input_dev mean for netbios or a 802.3ad interface? You already saw one, > > xfrm, where there was no need to reset. > > What's special about netbios ? For 802.3ad, I would expect input_dev > to hold the virtual device through which the packet entered the stack, > just what iptables -i would match. For xfrm - there is no need but its > also not wrong. This is exactly why i am not just setting things arbitraliy at input. Different _types_ of devices that need different _types_ of treatment (with dependency of where they are in the path as well). Tunnels are not the same as ethernet are not the same as atm devices are not the same as ppp-based devices. Heck some of these things dont even use netdevices. Note, one could claim that if you remove the printk there is already a central place to set things. However, I need to know when people use this path what the circumstances are - at some point we will get rid of the printk. At some point it may be you are right, lets just put it all in one spot - but for now just leave it as is. > > in some cases the pointers are swapped. You cant just blindly > > set skb->input_dev = skb->dev at the input - that would be violating the > > intent; think reinjecting packets (and look at mirred as a sample of > > apps to come that do this). > > I don't know your intent, but I assumed it was to match the incoming > interface as the networking stack sees it. Why would the pointers be > swapped ? Please give me an example. mirred does: > > skb2->dev = dev; > skb2->input_dev = skb->dev; > > So on input input_dev is the incoming interface of the original packet, > on output it is the outgoing interface of the original packet. Doesn't > make much sense to me, the original packet came the same way both times. The current mirred does only egress redirection - it doesnt do ingress redirection, nor socket redirection yet. The TODO list in the file says it will at some point. I have some code - but its not clean enough to include - those for example will matter in this case. I dont want to rule it out to be specific just for those few apps i have. The architecture allows arbitrary loops between arbitrary number of actions and netdevices in a policy topology. The input could appear more than once in such a topology at arbitrary points. I am attaching an old version of the dummy device, which i am hoping to propose as a replacement for IMQ at some point; its has an example of such usage. I havent really added any hooks for contracking action in the path in which dummy is to be found etc, but I hope it helps make my point. At some point i will document all the features. An example policy: on eth0: match filter at ingress/egress then action mirred egress redirect dev dummy0. dummy0 reinjects at ingress/egress. More complex: on dummy0 add more interesting rules to do further redirection. cheers, jamal --=-fHTulGJembddNxbTRWt5 Content-Disposition: attachment; filename=dummy.c Content-Type: text/x-c; name=dummy.c; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit /* dummy.c: a dummy net driver The purpose of this driver is to provide a device to point a route through, but not to actually transmit packets. Why? If you have a machine whose only connection is an occasional PPP/SLIP/PLIP link, you can only connect to your own hostname when the link is up. Otherwise you have to use localhost. This isn't very consistent. One solution is to set up a dummy link using PPP/SLIP/PLIP, but this seems (to me) too much overhead for too little gain. This driver provides a small alternative. Thus you can do [when not running slip] ifconfig dummy slip.addr.ess.here up [to go to slip] ifconfig dummy down dip whatever This was written by looking at Donald Becker's skeleton driver and the loopback driver. I then threw away anything that didn't apply! Thanks to Alan Cox for the key clue on what to do with misguided packets. Nick Holloway, 27th May 1994 [I tweaked this explanation a little but that's all] Alan Cox, 30th May 1994 */ /* * This driver isnt abused enough ;-> * Here to add only a _feeew more_ features, * 10 years after AC added comment above ;-> hehe - JHS */ #include #include #include #include #include #include #include #ifdef CONFIG_NET_CLS_ACT #include #endif #define TX_TIMEOUT (2*HZ) #define TX_Q_LIMIT 32 struct dummy_private { struct net_device_stats stats; #ifdef CONFIG_NET_CLS_ACT struct tasklet_struct dummy_tasklet; int tasklet_pending; /* mostly debug stats leave in for now */ unsigned long stat_r1; unsigned long stat_r2; unsigned long stat_r3; unsigned long stat_r4; unsigned long stat_r5; unsigned long stat_r6; unsigned long stat_r7; unsigned long stat_r8; struct sk_buff_head rq; struct sk_buff_head tq; #endif }; #ifdef CONFIG_NET_CLS_ACT static void ri_tasklet(unsigned long dev); #endif static int numdummies = 1; static int dummy_xmit(struct sk_buff *skb, struct net_device *dev); static struct net_device_stats *dummy_get_stats(struct net_device *dev); static void dummy_timeout(struct net_device *dev); static int dummy_open(struct net_device *dev); static int dummy_close(struct net_device *dev); static void dummy_timeout(struct net_device *dev) { int cpu = smp_processor_id(); dev->trans_start = jiffies; printk("%s: BUG tx timeout on CPU %d\n",dev->name,cpu); if (spin_is_locked((&dev->xmit_lock))) printk("xmit lock grabbed already\n"); if (spin_is_locked((&dev->queue_lock))) printk("queue lock grabbed already\n"); } #ifdef CONFIG_NET_CLS_ACT static void ri_tasklet(unsigned long dev) { struct net_device *dv = (struct net_device *)dev; struct dummy_private *dp = ((struct net_device *)dev)->priv; struct net_device_stats *stats = &dp->stats; struct sk_buff *skb = NULL; dp->stat_r4 +=1; if (NULL == (skb = skb_peek(&dp->tq))) { dp->stat_r5 +=1; if (spin_trylock(&dv->xmit_lock)) { dp->stat_r8 +=1; while (NULL != (skb = skb_dequeue(&dp->rq))) { skb_queue_tail(&dp->tq, skb); } spin_unlock(&dv->xmit_lock); } else { /* reschedule */ dp->stat_r1 +=1; goto resched; } } while (NULL != (skb = skb_dequeue(&dp->tq))) { __u32 from = G_TC_FROM(skb->tc_verd); skb->tc_verd = 0; skb->tc_verd = SET_TC_NCLS(skb->tc_verd); stats->tx_packets++; stats->tx_bytes+=skb->len; if (from & AT_EGRESS) { dp->stat_r6 +=1; dev_queue_xmit(skb); } else if (from & AT_INGRESS) { dp->stat_r7 +=1; netif_rx(skb); } else { /* if netfilt is compiled in and packet is tagged, we could reinject the packet back this would make it do what current IMQ does + more; if someone really really insists then this is the spot .. jhs */ dev_kfree_skb(skb); stats->tx_dropped++; } } if (spin_trylock(&dv->xmit_lock)) { dp->stat_r3 +=1; if (NULL == (skb = skb_peek(&dp->rq))) { dp->tasklet_pending = 0; if (netif_queue_stopped(dv)) netif_start_queue(dv); } else { dp->stat_r2 +=1; spin_unlock(&dv->xmit_lock); goto resched; } spin_unlock(&dv->xmit_lock); } else { resched: dp->tasklet_pending = 1; tasklet_schedule(&dp->dummy_tasklet); } } #endif static int dummy_set_address(struct net_device *dev, void *p) { struct sockaddr *sa = p; if (!is_valid_ether_addr(sa->sa_data)) return -EADDRNOTAVAIL; memcpy(dev->dev_addr, sa->sa_data, ETH_ALEN); return 0; } /* fake multicast ability */ static void set_multicast_list(struct net_device *dev) { } #ifdef CONFIG_NET_FASTROUTE static int dummy_accept_fastpath(struct net_device *dev, struct dst_entry *dst) { return -1; } #endif static void __init dummy_setup(struct net_device *dev) { /* Initialize the device structure. */ dev->get_stats = dummy_get_stats; dev->hard_start_xmit = dummy_xmit; dev->tx_timeout = &dummy_timeout; dev->watchdog_timeo = TX_TIMEOUT; dev->open = &dummy_open; dev->stop = &dummy_close; dev->set_multicast_list = set_multicast_list; dev->set_mac_address = dummy_set_address; #ifdef CONFIG_NET_FASTROUTE dev->accept_fastpath = dummy_accept_fastpath; #endif /* Fill in device structure with ethernet-generic values. */ ether_setup(dev); dev->tx_queue_len = TX_Q_LIMIT; dev->flags |= IFF_NOARP; dev->flags &= ~IFF_MULTICAST; SET_MODULE_OWNER(dev); random_ether_addr(dev->dev_addr); } static int dummy_xmit(struct sk_buff *skb, struct net_device *dev) { struct dummy_private *dp = ((struct net_device *)dev)->priv; struct net_device_stats *stats = &dp->stats; #ifdef CONFIG_NET_CLS_ACT __u32 from = G_TC_FROM(skb->tc_verd); #endif int ret = 0; stats->rx_packets++; stats->rx_bytes+=skb->len; #ifdef CONFIG_NET_CLS_ACT if ( !from || !skb->input_dev ) { dropped: dev_kfree_skb(skb); stats->rx_dropped++; return ret; } else { if (skb->input_dev) skb->dev = skb->input_dev; else printk("warning!!! no idev %s\n",skb->dev->name); skb->input_dev = dev; if (from & AT_INGRESS) { skb_pull(skb, skb->dev->hard_header_len); } else { if (!(from & AT_EGRESS)) { goto dropped; } } } if (skb_queue_len(&dp->rq) >= dev->tx_queue_len) { netif_stop_queue(dev); } dev->trans_start = jiffies; skb_queue_tail(&dp->rq, skb); if (!dp->tasklet_pending) { dp->tasklet_pending = 1; tasklet_schedule(&dp->dummy_tasklet); } #else dev_kfree_skb(skb); #endif return ret; } static struct net_device_stats *dummy_get_stats(struct net_device *dev) { struct dummy_private *dp = ((struct net_device *)dev)->priv; struct net_device_stats *stats = &dp->stats; #ifdef CONFIG_NET_CLS_ACT_DEB printk("tasklets stats %ld:%ld:%ld:%ld:%ld:%ld:%ld:%ld \n", dp->stat_r1,dp->stat_r2,dp->stat_r3,dp->stat_r4, dp->stat_r5,dp->stat_r6,dp->stat_r7,dp->stat_r8); #endif return stats; } static struct net_device **dummies; /* Number of dummy devices to be set up by this module. */ module_param(numdummies, int, 0); MODULE_PARM_DESC(numdummies, "Number of dummy pseudo devices"); static int dummy_close(struct net_device *dev) { #ifdef CONFIG_NET_CLS_ACT struct dummy_private *dp = ((struct net_device *)dev)->priv; tasklet_kill(&dp->dummy_tasklet); skb_queue_purge(&dp->rq); skb_queue_purge(&dp->tq); #endif netif_stop_queue(dev); return 0; } static int dummy_open(struct net_device *dev) { #ifdef CONFIG_NET_CLS_ACT struct dummy_private *dp = ((struct net_device *)dev)->priv; tasklet_init(&dp->dummy_tasklet, ri_tasklet, (unsigned long)dev); skb_queue_head_init(&dp->rq); skb_queue_head_init(&dp->tq); #endif netif_start_queue(dev); return 0; } static int __init dummy_init_one(int index) { struct net_device *dev_dummy; int err; dev_dummy = alloc_netdev(sizeof(struct dummy_private), "dummy%d", dummy_setup); if (!dev_dummy) return -ENOMEM; if ((err = register_netdev(dev_dummy))) { free_netdev(dev_dummy); dev_dummy = NULL; } else { dummies[index] = dev_dummy; } return err; } static void dummy_free_one(int index) { unregister_netdev(dummies[index]); free_netdev(dummies[index]); } static int __init dummy_init_module(void) { int i, err = 0; dummies = kmalloc(numdummies * sizeof(void *), GFP_KERNEL); if (!dummies) return -ENOMEM; for (i = 0; i < numdummies && !err; i++) err = dummy_init_one(i); if (err) { while (--i >= 0) dummy_free_one(i); } return err; } static void __exit dummy_cleanup_module(void) { int i; for (i = 0; i < numdummies; i++) dummy_free_one(i); kfree(dummies); } module_init(dummy_init_module); module_exit(dummy_cleanup_module); MODULE_LICENSE("GPL"); --=-fHTulGJembddNxbTRWt5-- From hadi@cyberus.ca Mon Jan 3 06:42:32 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 06:42:39 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j03EgBIq032344 for ; Mon, 3 Jan 2005 06:42:32 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1ClTXf-0005hg-BY for netdev@oss.sgi.com; Mon, 03 Jan 2005 09:50:43 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1ClTXe-0005vF-Hc; Mon, 03 Jan 2005 09:50:42 -0500 Subject: Re: unregister_netdev Annoyance WAS(Re: ing_filter debug messages From: jamal Reply-To: hadi@cyberus.ca To: bert hubert Cc: Wichert Akkerman , netdev@oss.sgi.com In-Reply-To: <20050102121349.GA27022@outpost.ds9a.nl> References: <20041230160643.GD24603@wiggy.net> <1104469666.1049.231.camel@jzny.localdomain> <20041231093827.GG24603@wiggy.net> <1104491510.1047.234.camel@jzny.localdomain> <20041231131553.GA7460@wiggy.net> <1104505838.1048.273.camel@jzny.localdomain> <20041231154844.GA11511@wiggy.net> <1104511697.1048.308.camel@jzny.localdomain> <20050102121349.GA27022@outpost.ds9a.nl> Content-Type: text/plain Organization: jamalopolous Message-Id: <1104763839.1047.563.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 03 Jan 2005 09:50:40 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13345 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Sun, 2005-01-02 at 07:13, bert hubert wrote: > This is a separate and known problem - see 'Re: Major deadlock: > unregister_netdevice: waiting for to become free. Usage count = 1' > by Peter Bieringer. > > For some reason this issue has been widely ignored. I see it as well here > and it is the one reason I don't entirely trust 2.6.10 yet in production. > > Thanks for looking into it Jamal! This issue was already being looked into by about 3 people {Dave, Yoshfuji-san, Herbert}. They have more knowledge about the circumstances than i do. The holidays are over, so give it a short time and lets see what happens. cheers, jamal From tgraf@suug.ch Mon Jan 3 06:53:57 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 06:54:04 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j03EracX000823 for ; Mon, 3 Jan 2005 06:53:57 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 492B184; Mon, 3 Jan 2005 16:01:48 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 04AD41C0EA; Mon, 3 Jan 2005 16:02:30 +0100 (CET) Date: Mon, 3 Jan 2005 16:02:30 +0100 From: Thomas Graf To: jamal Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PKT_SCHED]: Allow using nfmark as key in U32 classifier. Message-ID: <20050103150230.GC26856@postel.suug.ch> References: <20041231110836.GD32419@postel.suug.ch> <1104505142.1048.262.camel@jzny.localdomain> <20041231153930.GN32419@postel.suug.ch> <1104511494.1048.303.camel@jzny.localdomain> <20041231181153.GP32419@postel.suug.ch> <1104526311.1047.379.camel@jzny.localdomain> <20050101121041.GR32419@postel.suug.ch> <1104622164.1048.444.camel@jzny.localdomain> <20050102000612.GU32419@postel.suug.ch> <1104763012.1047.524.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1104763012.1047.524.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13346 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1104763012.1047.524.camel@jzny.localdomain> 2005-01-03 09:36 > On Sat, 2005-01-01 at 19:06, Thomas Graf wrote: > > * jamal <1104622164.1048.444.camel@jzny.localdomain> 2005-01-01 18:29 > > > Does the ematch API include a dump()? I dont think it should - thats the > > > point i was making. Should be simple. > > > > Yes, although simple ematches are not required to implement dump. > > ok. I realize its optional - but i wouldnt even give the writter of > ematch the opportunity to write one. Want something more complex? write > a classifier. A classifier is at least 300 lines and you lose the ability to use the logic relations. > Again allowing for this may be overkill. Just send the same structure > the ematch needs in exactly the same form it needs it and you dont need > this. Compromise: If change/dump is not provided the api allocates and memcpy's itself resptively dumps m->data. Simple ematches don't have to care and can simple access m->data, more complex ematches can implement their own change/dump. Does that sound beter? > whats the .link for? I use list.h to chain ematch_ops and it's better to have it initialized. From hadi@cyberus.ca Mon Jan 3 06:56:17 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 06:56:23 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j03EtvR2001312 for ; Mon, 3 Jan 2005 06:56:17 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1ClTkw-0000oV-B3 for netdev@oss.sgi.com; Mon, 03 Jan 2005 10:04:26 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1ClTku-0007Aw-3i; Mon, 03 Jan 2005 10:04:24 -0500 Subject: Re: LLTX and netif_stop_queue From: jamal Reply-To: hadi@cyberus.ca To: Eric Lemoine , Andi Kleen Cc: Patrick McHardy , "David S. Miller" , roland@topspin.com, netdev@oss.sgi.com, openib-general@openib.org In-Reply-To: <5cac192f0501021530672a908a@mail.gmail.com> References: <52llbwoaej.fsf@topspin.com> <20041217214432.07b7b21e.davem@davemloft.net> <1103484675.1050.158.camel@jzny.localdomain> <5cac192f04122210491d64d4b6@mail.gmail.com> <20041222202919.057b8331.davem@davemloft.net> <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> <5cac192f0501021530672a908a@mail.gmail.com> Content-Type: text/plain Organization: jamalopolous Message-Id: <1104764660.1048.578.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 03 Jan 2005 10:04:21 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13347 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev this piece: ----- + + /* And release queue */ + spin_unlock(&dev->queue_lock); } --------- Isnt there a possibility (higher as you increase number of processors) that you will spin for a long time in _the driver_ waiting for the queue lock? Maybe we need a flag "the queue lock" is already been grabbed passed to the driver. LLTX is a good alias but insufficient (if you run your driver in an old kernels which support LLTX but not the idea of locking the queue for you). Andi or anyone else - has anyone really done perfomance analysis of LLTX (with anything other than loopback) and shown it has any value? Maybe time to just shoot the damn thing. cheers, jamal On Sun, 2005-01-02 at 18:30, Eric Lemoine wrote: > On 28 Dec 2004 08:31:57 -0500, jamal wrote: > > On Fri, 2004-12-24 at 11:10, Eric Lemoine wrote: > > > > > Yes but requiring drivers to release a lock that they should not even > > > be aware of doesn't sound good. Another way would be to keep > > > dev->queue_lock grabbed when entering start_xmit() and let the driver > > > drop it (and re-acquire it before it returns) only if it wishes so. > > > Although I don't like this too much either, that's the best way I can > > > think of up to now... > > > > I am not a big fan of that patch either, but i cant think of a cleaner > > way to do it. > > The violation already happens with the LLTX flag. So maybe a big warning > > that says "Do this only if you driver is LLTX enabled". The other way to > > do it is put a check to see if LLTX is enabled before releasing that > > lock - but why the extra cycles? Driver writer should know. > > Two (untested) patches implementing what I described above. > > The first pach (sch_generic.patch) keeps queue_lock held in > qdisc_restart() when calling hard_start_xmit() of a LLTX driver. The > second (sungem.patch) makes sungem release queue_lock after grabbing > its private tx lock. > > Note that the modifications made to qdisc_restart() are not compatible > with the current LLTX drivers. All LLTX drivers must be modified along > sungem.patch's lines. Take sungem.patch as an example of how things > must be done. > > Patches apply to current davem bk snapshot. From eric.lemoine@gmail.com Mon Jan 3 07:39:51 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 07:39:58 -0800 (PST) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.202]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j03FdU9e003208 for ; Mon, 3 Jan 2005 07:39:50 -0800 Received: by wproxy.gmail.com with SMTP id 71so1331127wra for ; Mon, 03 Jan 2005 07:48:00 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=bqlWbHnOofEuCNnArW5xjKx8U5HVmqRlvva6gi2Qn6HCXr9CpEDiyA6UYpotEvWgw1TXf58STO33hUvt5mRjRYgRXYYmJSO+Nr2rrR9Kbhq03MAFpllsJyY/HFD6tcSz6tWhDFqmIVJxXSGoeRV0mtcivQuo5hIKuSxj+TMnVoI= Received: by 10.54.51.35 with SMTP id y35mr143948wry; Mon, 03 Jan 2005 07:48:00 -0800 (PST) Received: by 10.54.30.8 with HTTP; Mon, 3 Jan 2005 07:48:00 -0800 (PST) Message-ID: <5cac192f05010307484f23bca5@mail.gmail.com> Date: Mon, 3 Jan 2005 16:48:00 +0100 From: Eric Lemoine Reply-To: Eric Lemoine To: hadi@cyberus.ca Subject: Re: LLTX and netif_stop_queue Cc: Andi Kleen , Patrick McHardy , "David S. Miller" , roland@topspin.com, netdev@oss.sgi.com, openib-general@openib.org In-Reply-To: <1104764660.1048.578.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <52llbwoaej.fsf@topspin.com> <1103484675.1050.158.camel@jzny.localdomain> <5cac192f04122210491d64d4b6@mail.gmail.com> <20041222202919.057b8331.davem@davemloft.net> <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> <5cac192f0501021530672a908a@mail.gmail.com> <1104764660.1048.578.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13348 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: eric.lemoine@gmail.com Precedence: bulk X-list: netdev On 03 Jan 2005 10:04:21 -0500, jamal wrote: > this piece: > ----- > + > + /* And release queue */ > + spin_unlock(&dev->queue_lock); > } > --------- > > Isnt there a possibility (higher as you increase number of processors) > that you will spin for a long time in _the driver_ waiting for the queue > lock? I don't see how LLTX is different from non-LLTX wrt the time spent spinning on queue_lock. What am i missing? > > Maybe we need a flag "the queue lock" is already been grabbed passed > to the driver. LLTX is a good alias but insufficient (if you run your > driver in an old kernels which support LLTX but not the idea of locking > the queue for you). > > Andi or anyone else - has anyone really done perfomance analysis of LLTX > (with anything other than loopback) and shown it has any value? Maybe > time to just shoot the damn thing. I do not like LLTX too much either as I can't see a cleaner way to get rid of that packet reordering race condition. -- Eric From hadi@cyberus.ca Mon Jan 3 07:47:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 07:47:27 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j03Fl0kO003949 for ; Mon, 3 Jan 2005 07:47:20 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1ClUYN-0001A3-VE for netdev@oss.sgi.com; Mon, 03 Jan 2005 10:55:31 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1ClUYL-0005Cr-5F; Mon, 03 Jan 2005 10:55:29 -0500 Subject: Re: [PKT_SCHED]: Allow using nfmark as key in U32 classifier. From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <20050103150230.GC26856@postel.suug.ch> References: <20041231110836.GD32419@postel.suug.ch> <1104505142.1048.262.camel@jzny.localdomain> <20041231153930.GN32419@postel.suug.ch> <1104511494.1048.303.camel@jzny.localdomain> <20041231181153.GP32419@postel.suug.ch> <1104526311.1047.379.camel@jzny.localdomain> <20050101121041.GR32419@postel.suug.ch> <1104622164.1048.444.camel@jzny.localdomain> <20050102000612.GU32419@postel.suug.ch> <1104763012.1047.524.camel@jzny.localdomain> <20050103150230.GC26856@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1104767726.1049.591.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 03 Jan 2005 10:55:26 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13349 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Mon, 2005-01-03 at 10:02, Thomas Graf wrote: > > ok. I realize its optional - but i wouldnt even give the writter of > > ematch the opportunity to write one. Want something more complex? write > > a classifier. > > A classifier is at least 300 lines and you lose the ability to use the > logic relations. Sure, but simpler-than-classifier is where we started ;-> I think in time we should revamp this a little more, but classifiers we have today already we just cant get rid of them now. Over time, I agree we should revamp. > > Again allowing for this may be overkill. Just send the same structure > > the ematch needs in exactly the same form it needs it and you dont need > > this. > > Compromise: If change/dump is not provided the api allocates and > memcpy's itself resptively dumps m->data. Simple ematches don't have to > care and can simple access m->data, more complex ematches can implement > their own change/dump. Does that sound beter? Yes, indeed. A copy instead of reference is owned by the classifier. To me its a valid compromise. Dont want those matches to be shared in any case. Also dont want user to know shit about TLVs. Neither in the kernel, nor in user space. Simplicty. Sorry, havent looked at the code yet. Is the patch you posted the same as you have on the url earlier? > > whats the .link for? > > I use list.h to chain ematch_ops and it's better to have it initialized. I relaized that - but should the user know anything about this? cheers, jamal From roland@topspin.com Mon Jan 3 07:49:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 07:49:10 -0800 (PST) Received: from umhlanga.STRATNET.NET (umhlanga.stratnet.net [12.162.17.40]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j03FmeiW004264 for ; Mon, 3 Jan 2005 07:49:01 -0800 Received: from exch-1.topspincom.com ([12.162.17.3]) by umhlanga.STRATNET.NET with Microsoft SMTPSVC(5.0.2195.5329); Mon, 3 Jan 2005 07:57:15 -0800 Received: from eddore ([10.10.253.169]) by exch-1.topspincom.com with Microsoft SMTPSVC(5.0.2195.5329); Mon, 3 Jan 2005 07:57:14 -0800 Received: from roland by eddore with local (Exim 4.34) id 1ClUa2-0002Wp-8F; Mon, 03 Jan 2005 07:57:14 -0800 To: hadi@cyberus.ca Cc: Eric Lemoine , Andi Kleen , Patrick McHardy , "David S. Miller" , netdev@oss.sgi.com, openib-general@openib.org X-Message-Flag: Warning: May contain useful information References: <52llbwoaej.fsf@topspin.com> <20041217214432.07b7b21e.davem@davemloft.net> <1103484675.1050.158.camel@jzny.localdomain> <5cac192f04122210491d64d4b6@mail.gmail.com> <20041222202919.057b8331.davem@davemloft.net> <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> <5cac192f0501021530672a908a@mail.gmail.com> <1104764660.1048.578.camel@jzny.localdomain> From: Roland Dreier Date: Mon, 03 Jan 2005 07:57:14 -0800 In-Reply-To: <1104764660.1048.578.camel@jzny.localdomain> (jamal's message of "03 Jan 2005 10:04:21 -0500") Message-ID: <52brc68q05.fsf@topspin.com> User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Corporate Culture, linux) MIME-Version: 1.0 X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: roland@topspin.com Subject: Re: LLTX and netif_stop_queue Content-Type: text/plain; charset=us-ascii X-SA-Exim-Version: 4.1 (built Tue, 17 Aug 2004 11:06:07 +0200) X-SA-Exim-Scanned: Yes (on eddore) X-OriginalArrivalTime: 03 Jan 2005 15:57:14.0803 (UTC) FILETIME=[E4C57030:01C4F1AC] X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13350 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: roland@topspin.com Precedence: bulk X-list: netdev jamal> Andi or anyone else - has anyone really done perfomance jamal> analysis of LLTX (with anything other than loopback) and jamal> shown it has any value? Maybe time to just shoot the damn jamal> thing. For the IPoIB driver, it seems to be worth a couple percent. It's hard to get really consistent results but on my pair of test systems, TCP throughput with netperf goes up by about 30 Mbps out of roughly 1900 Mbps total. It's probably not worth the complexity in the net core if all drivers only get that level of improvement. - Roland From tgraf@suug.ch Mon Jan 3 08:18:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 08:18:08 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j03GHeiC005631 for ; Mon, 3 Jan 2005 08:18:01 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id CBAEC84; Mon, 3 Jan 2005 17:25:52 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 890DE1C0EA; Mon, 3 Jan 2005 17:26:35 +0100 (CET) Date: Mon, 3 Jan 2005 17:26:35 +0100 From: Thomas Graf To: jamal Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PKT_SCHED]: Allow using nfmark as key in U32 classifier. Message-ID: <20050103162635.GD26856@postel.suug.ch> References: <20041231153930.GN32419@postel.suug.ch> <1104511494.1048.303.camel@jzny.localdomain> <20041231181153.GP32419@postel.suug.ch> <1104526311.1047.379.camel@jzny.localdomain> <20050101121041.GR32419@postel.suug.ch> <1104622164.1048.444.camel@jzny.localdomain> <20050102000612.GU32419@postel.suug.ch> <1104763012.1047.524.camel@jzny.localdomain> <20050103150230.GC26856@postel.suug.ch> <1104767726.1049.591.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1104767726.1049.591.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13351 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1104767726.1049.591.camel@jzny.localdomain> 2005-01-03 10:55 > Sorry, havent looked at the code yet. Is the patch you posted the same > as you have on the url earlier? Yes, with a few minor fixes and I made it depend on CONFIG_NET_CLS_EMATCH and added nil macros when it's not defined. Those macros need some more work though. TODO: - KConfig doc - make change optional - dump m->data if no dump implementation is provided The question I'm yet unsure is whether to strictly return 1/0 or allow classifier return codes. Given I'm done with the above, a minimal ematch will look like: static int sec_match(struct sk_buff *skb, struct tcf_ematch *m) { return *(u32 *) m->data == skb->security; } static struct tcf_ematch_ops sec_ops = { .kind = 11, .match = sec_match, .owner = THIS_MODULE } ... init/exit calling tcf_em_(un_register ... What do you think about checking RTA_PAYLOAD of the ematch data for < sizeof(unsigned long) and assign it to m->data without allocation? Would save us nonse allocations. The yet unused 8bit in tcf_ematch_hdr would hold a flag to indicate that m->data contains the data directly. > I relaized that - but should the user know anything about this? Actually no but initializing it in tcf_em_register wouldn't serve any purpose so we can either remove it or leave it there. From eric.lemoine@gmail.com Mon Jan 3 08:32:57 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 08:33:04 -0800 (PST) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.202]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j03GWaEq009789 for ; Mon, 3 Jan 2005 08:32:57 -0800 Received: by wproxy.gmail.com with SMTP id 71so1338921wra for ; Mon, 03 Jan 2005 08:41:06 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=BCkYFIPGcx9omY9dyEloq48dp5pOhDfDGlryvzB6X0yHCRdn3PEJkjh/P/dVtyDY+x1kDo2tLJimtRVIa32rKNZp/3n1HoqO39AU1wh/bzcfflHxLiAyXI/hxU4xNruAY+Fer/XUW4yzp2cgGNv6n+4bcdY7CdD8ESy8UX7Cqhg= Received: by 10.54.23.71 with SMTP id 71mr22509wrw; Mon, 03 Jan 2005 08:41:06 -0800 (PST) Received: by 10.54.30.8 with HTTP; Mon, 3 Jan 2005 08:41:05 -0800 (PST) Message-ID: <5cac192f05010308414a25b548@mail.gmail.com> Date: Mon, 3 Jan 2005 17:41:05 +0100 From: Eric Lemoine Reply-To: Eric Lemoine To: Roland Dreier Subject: Re: LLTX and netif_stop_queue Cc: hadi@cyberus.ca, Andi Kleen , Patrick McHardy , "David S. Miller" , netdev@oss.sgi.com, openib-general@openib.org In-Reply-To: <52brc68q05.fsf@topspin.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <52llbwoaej.fsf@topspin.com> <5cac192f04122210491d64d4b6@mail.gmail.com> <20041222202919.057b8331.davem@davemloft.net> <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> <5cac192f0501021530672a908a@mail.gmail.com> <1104764660.1048.578.camel@jzny.localdomain> <52brc68q05.fsf@topspin.com> X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13352 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: eric.lemoine@gmail.com Precedence: bulk X-list: netdev On Mon, 03 Jan 2005 07:57:14 -0800, Roland Dreier wrote: > jamal> Andi or anyone else - has anyone really done perfomance > jamal> analysis of LLTX (with anything other than loopback) and > jamal> shown it has any value? Maybe time to just shoot the damn > jamal> thing. > > For the IPoIB driver, it seems to be worth a couple percent. It's > hard to get really consistent results but on my pair of test systems, > TCP throughput with netperf goes up by about 30 Mbps out of roughly > 1900 Mbps total. It's probably not worth the complexity in the net > core if all drivers only get that level of improvement. > > - Roland > What are your machines? In particular, how many CPUs do they have? -- Eric From wensong@linux-vs.org Mon Jan 3 08:36:40 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 08:36:47 -0800 (PST) Received: from lb1.ctrip.com ([218.244.111.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j03GaGVh010347 for ; Mon, 3 Jan 2005 08:36:38 -0800 Received: from penguin.linux-vs.org ([61.149.155.144]) by lb1.ctrip.com (8.12.10/8.12.10) with ESMTP id j03Gi0Mh005257 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 4 Jan 2005 00:44:07 +0800 Received: from penguin.linux-vs.org (localhost.localdomain [127.0.0.1]) by penguin.linux-vs.org (8.12.8/8.12.8) with ESMTP id j03GeT3Y003617; Tue, 4 Jan 2005 00:40:29 +0800 Received: from localhost (wensong@localhost) by penguin.linux-vs.org (8.12.8/8.12.8/Submit) with ESMTP id j03GeQGP003613; Tue, 4 Jan 2005 00:40:28 +0800 X-Authentication-Warning: penguin.linux-vs.org: wensong owned process doing -bs Date: Tue, 4 Jan 2005 00:40:25 +0800 (CST) From: Wensong Zhang To: "David S. Miller" , netdev@oss.sgi.com Subject: [PATCH] [IPVS] run master/backup sync daemon at a time Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/Mixed; BOUNDARY="-1463811584-572891765-1097000265=:2451" Content-ID: X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13353 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: wensong@linux-vs.org Precedence: bulk X-list: netdev This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1463811584-572891765-1097000265=:2451 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; FORMAT=flowed Content-ID: Hi Dave, Here is the back port patch from kernel 2.6, which is to run master/backup sync daemon at a time with SyncID support. Please check and apply it to kernel 2.4. Thanks, Wensong ---1463811584-572891765-1097000265=:2451 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="linux-2.4-ipvs-sync.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="linux-2.4-ipvs-sync.patch" IyBUaGlzIGlzIGEgQml0S2VlcGVyIGdlbmVyYXRlZCBkaWZmIC1OcnUgc3R5 bGUgcGF0Y2guDQojDQojIENoYW5nZVNldA0KIyAgIDIwMDUvMDEvMDQgMDA6 MzA6NTgrMDg6MDAgYWNhc3NlbkBsaW51eC12cy5vcmcgDQojICAgW0lQVlNd IGNoYW5nZSB0byBydW4gbWFzdGVyL2JhY2t1cCBzeW5jIGRhZW1vbiBhdCBh IHRpbWUNCiMgICANCiMgICBTaWduZWQtb2ZmLWJ5OiBXZW5zb25nIFpoYW5n IDx3ZW5zb25nQGxpbnV4LXZzLm9yZz4NCiMgDQojIG5ldC9pcHY0L2lwdnMv aXBfdnNfc3luYy5jDQojICAgMjAwNS8wMS8wNCAwMDozMDo0NyswODowMCBh Y2Fzc2VuQGxpbnV4LXZzLm9yZyArOTYgLTM4DQojICAgY2hhbmdlZCB0byBy dW4gbWFzdGVyL2JhY2t1cCBzeW5jIGRhZW1vbiBhdCBhIHRpbWUuDQojIA0K IyBuZXQvaXB2NC9pcHZzL2lwX3ZzX2N0bC5jDQojICAgMjAwNS8wMS8wNCAw MDozMDo0NyswODowMCBhY2Fzc2VuQGxpbnV4LXZzLm9yZyArNyAtMw0KIyAg IGV4dGVuZHMgdGhlIGludGVyZmFjZSBvZiBJUFZTDQojIA0KIyBuZXQvaXB2 NC9pcHZzL2lwX3ZzX2NvcmUuYw0KIyAgIDIwMDUvMDEvMDQgMDA6MzA6NDcr MDg6MDAgYWNhc3NlbkBsaW51eC12cy5vcmcgKzEgLTENCiMgICBzeW5jIGEg Y29ubmVjdGlvbiB3aGVuIHRoZSBmbGFnIG9mIHN5bmMgc3RhdGUgaXMgbWFz dGVyLg0KIyANCiMgaW5jbHVkZS9uZXQvaXBfdnMuaA0KIyAgIDIwMDUvMDEv MDQgMDA6MzA6NDcrMDg6MDAgYWNhc3NlbkBsaW51eC12cy5vcmcgKzggLTUN CiMgICBleHRlbmQgdGhlIHN0cnVjdHMgZm9yIG1hc3Rlci9iYWNrdXAgZGFl bW9uIHJ1bm5pbmcgYXQgYSB0aW1lLg0KIyANCmRpZmYgLU5ydSBhL2luY2x1 ZGUvbmV0L2lwX3ZzLmggYi9pbmNsdWRlL25ldC9pcF92cy5oDQotLS0gYS9p bmNsdWRlL25ldC9pcF92cy5oCTIwMDUtMDEtMDQgMDA6MzM6MDYgKzA4OjAw DQorKysgYi9pbmNsdWRlL25ldC9pcF92cy5oCTIwMDUtMDEtMDQgMDA6MzM6 MDYgKzA4OjAwDQpAQCAtOTcsNiArOTcsNyBAQA0KIAlpbnQgICAgICAgICAg ICAgc3RhdGU7ICAgICAgICAgIC8qIHN5bmMgZGFlbW9uIHN0YXRlICovDQog CWNoYXIgICAgICAgICAgICBtY2FzdF9pZm5bSVBfVlNfSUZOQU1FX01BWExF Tl07DQogCQkJCQkvKiBtdWx0aWNhc3QgaW50ZXJmYWNlIG5hbWUgKi8NCisJ aW50CQlzeW5jaWQ7DQogDQogCS8qIHZpcnR1YWwgc2VydmljZSBvcHRpb25z ICovDQogCXVfaW50MTZfdAlwcm90b2NvbDsNCkBAIC0yMTMsOCArMjE0LDkg QEANCiANCiAvKiBUaGUgYXJndW1lbnQgdG8gSVBfVlNfU09fR0VUX0RBRU1P TiAqLw0KIHN0cnVjdCBpcF92c19kYWVtb25fdXNlciB7DQotCWludAlzdGF0 ZTsJCQkJLyogc3luYyBkYWVtb24gc3RhdGUgKi8NCi0JY2hhcgltY2FzdF9p Zm5bSVBfVlNfSUZOQU1FX01BWExFTl07CS8qIG11bHRpY2FzdCBpbnRlcmZh Y2UgbmFtZSAqLw0KKwlpbnQJc3RhdGU7CQkJCQkvKiBzeW5jIGRhZW1vbiBz dGF0ZSAqLw0KKwljaGFyCW1jYXN0X21hc3Rlcl9pZm5bSVBfVlNfSUZOQU1F X01BWExFTl07CS8qIG1jYXN0IG1hc3RlciBpbnRlcmZhY2UgbmFtZSAqLw0K KwljaGFyCW1jYXN0X2JhY2t1cF9pZm5bSVBfVlNfSUZOQU1FX01BWExFTl07 CS8qIG1jYXN0IGJhY2t1cCBpbnRlcmZhY2UgbmFtZSAqLw0KIH07DQogDQog DQpAQCAtNzI2LDkgKzcyOCwxMCBAQA0KICAqICAgICAgKGZyb20gaXBfdnNf c3luYy5jKQ0KICAqLw0KIGV4dGVybiB2b2xhdGlsZSBpbnQgaXBfdnNfc3lu Y19zdGF0ZTsNCi1leHRlcm4gY2hhciBpcF92c19tY2FzdF9pZm5bSVBfVlNf SUZOQU1FX01BWExFTl07DQotZXh0ZXJuIGludCBzdGFydF9zeW5jX3RocmVh ZChpbnQgc3RhdGUsIGNoYXIgKm1jYXN0X2lmbik7DQotZXh0ZXJuIGludCBz dG9wX3N5bmNfdGhyZWFkKHZvaWQpOw0KK2V4dGVybiBjaGFyIGlwX3ZzX21j YXN0X21hc3Rlcl9pZm5bSVBfVlNfSUZOQU1FX01BWExFTl07DQorZXh0ZXJu IGNoYXIgaXBfdnNfbWNhc3RfYmFja3VwX2lmbltJUF9WU19JRk5BTUVfTUFY TEVOXTsNCitleHRlcm4gaW50IHN0YXJ0X3N5bmNfdGhyZWFkKGludCBzdGF0 ZSwgY2hhciAqbWNhc3RfaWZuLCBfX3U4IHN5bmNpZCk7DQorZXh0ZXJuIGlu dCBzdG9wX3N5bmNfdGhyZWFkKGludCBzdGF0ZSk7DQogZXh0ZXJuIHZvaWQg aXBfdnNfc3luY19jb25uKHN0cnVjdCBpcF92c19jb25uICpjcCk7DQogDQog DQpkaWZmIC1OcnUgYS9uZXQvaXB2NC9pcHZzL2lwX3ZzX2NvcmUuYyBiL25l dC9pcHY0L2lwdnMvaXBfdnNfY29yZS5jDQotLS0gYS9uZXQvaXB2NC9pcHZz L2lwX3ZzX2NvcmUuYwkyMDA1LTAxLTA0IDAwOjMzOjA2ICswODowMA0KKysr IGIvbmV0L2lwdjQvaXB2cy9pcF92c19jb3JlLmMJMjAwNS0wMS0wNCAwMDoz MzowNiArMDg6MDANCkBAIC0xMTMxLDcgKzExMzEsNyBAQA0KIAkvKiBpbmNy ZWFzZSBpdHMgcGFja2V0IGNvdW50ZXIgYW5kIGNoZWNrIGlmIGl0IGlzIG5l ZWRlZA0KIAkgICB0byBiZSBzeW5jaHJvbml6ZWQgKi8NCiAJYXRvbWljX2lu YygmY3AtPmluX3BrdHMpOw0KLQlpZiAoaXBfdnNfc3luY19zdGF0ZSA9PSBJ UF9WU19TVEFURV9NQVNURVIgJiYNCisJaWYgKGlwX3ZzX3N5bmNfc3RhdGUg JiBJUF9WU19TVEFURV9NQVNURVIgJiYNCiAJICAgIChjcC0+cHJvdG9jb2wg IT0gSVBQUk9UT19UQ1AgfHwNCiAJICAgICBjcC0+c3RhdGUgPT0gSVBfVlNf U19FU1RBQkxJU0hFRCkgJiYNCiAJICAgIChhdG9taWNfcmVhZCgmY3AtPmlu X3BrdHMpICUgNTAgPT0gc3lzY3RsX2lwX3ZzX3N5bmNfdGhyZXNob2xkKSkN CmRpZmYgLU5ydSBhL25ldC9pcHY0L2lwdnMvaXBfdnNfY3RsLmMgYi9uZXQv aXB2NC9pcHZzL2lwX3ZzX2N0bC5jDQotLS0gYS9uZXQvaXB2NC9pcHZzL2lw X3ZzX2N0bC5jCTIwMDUtMDEtMDQgMDA6MzM6MDYgKzA4OjAwDQorKysgYi9u ZXQvaXB2NC9pcHZzL2lwX3ZzX2N0bC5jCTIwMDUtMDEtMDQgMDA6MzM6MDYg KzA4OjAwDQpAQCAtMTczMSwxMCArMTczMSwxMSBAQA0KIAkJcmV0ID0gaXBf dnNfc2V0X3RpbWVvdXRzKHVydWxlKTsNCiAJCWdvdG8gb3V0X3VubG9jazsN CiAJfSBlbHNlIGlmIChjbWQgPT0gSVBfVlNfU09fU0VUX1NUQVJUREFFTU9O KSB7DQotCQlyZXQgPSBzdGFydF9zeW5jX3RocmVhZCh1cnVsZS0+c3RhdGUs IHVydWxlLT5tY2FzdF9pZm4pOw0KKwkJcmV0ID0gc3RhcnRfc3luY190aHJl YWQodXJ1bGUtPnN0YXRlLCB1cnVsZS0+bWNhc3RfaWZuLA0KKwkJCQkJdXJ1 bGUtPnN5bmNpZCk7DQogCQlnb3RvIG91dF91bmxvY2s7DQogCX0gZWxzZSBp ZiAoY21kID09IElQX1ZTX1NPX1NFVF9TVE9QREFFTU9OKSB7DQotCQlyZXQg PSBzdG9wX3N5bmNfdGhyZWFkKCk7DQorCQlyZXQgPSBzdG9wX3N5bmNfdGhy ZWFkKHVydWxlLT5zdGF0ZSk7DQogCQlnb3RvIG91dF91bmxvY2s7DQogCX0g ZWxzZSBpZiAoY21kID09IElQX1ZTX1NPX1NFVF9aRVJPKSB7DQogCQkvKiBp ZiBubyBzZXJ2aWNlIGFkZHJlc3MgaXMgc2V0LCB6ZXJvIGNvdW50ZXJzIGlu IGFsbCAqLw0KQEAgLTIwODIsNyArMjA4MywxMCBAQA0KIAkJCWdvdG8gb3V0 Ow0KIAkJfQ0KIAkJdS5zdGF0ZSA9IGlwX3ZzX3N5bmNfc3RhdGU7DQotCQlz dHJjcHkodS5tY2FzdF9pZm4sIGlwX3ZzX21jYXN0X2lmbik7DQorCQlpZiAo aXBfdnNfc3luY19zdGF0ZSAmIElQX1ZTX1NUQVRFX01BU1RFUikNCisJCQlz dHJjcHkodS5tY2FzdF9tYXN0ZXJfaWZuLCBpcF92c19tY2FzdF9tYXN0ZXJf aWZuKTsNCisJCWlmIChpcF92c19zeW5jX3N0YXRlICYgSVBfVlNfU1RBVEVf QkFDS1VQKQ0KKwkJCXN0cmNweSh1Lm1jYXN0X2JhY2t1cF9pZm4sIGlwX3Zz X21jYXN0X2JhY2t1cF9pZm4pOw0KIAkJaWYgKGNvcHlfdG9fdXNlcih1c2Vy LCAmdSwgc2l6ZW9mKHUpKSAhPSAwKQ0KIAkJCXJldCA9IC1FRkFVTFQ7DQog CX0NCmRpZmYgLU5ydSBhL25ldC9pcHY0L2lwdnMvaXBfdnNfc3luYy5jIGIv bmV0L2lwdjQvaXB2cy9pcF92c19zeW5jLmMNCi0tLSBhL25ldC9pcHY0L2lw dnMvaXBfdnNfc3luYy5jCTIwMDUtMDEtMDQgMDA6MzM6MDYgKzA4OjAwDQor KysgYi9uZXQvaXB2NC9pcHZzL2lwX3ZzX3N5bmMuYwkyMDA1LTAxLTA0IDAw OjMzOjA2ICswODowMA0KQEAgLTEzLDYgKzEzLDkgQEANCiAgKiAgICAgICAg ICAgICAgdGhyb3VnaCBtdWx0aWNhc3QNCiAgKg0KICAqIENoYW5nZXM6DQor ICoJQWxleGFuZHJlIENhc3NlbiAgICAgICAgOiAgICAgICBBZGRlZCBtYXN0 ZXIgJiBiYWNrdXAgc3VwcG9ydCBhdCBhIHRpbWUuDQorICoJQWxleGFuZHJl IENhc3NlbiAgICAgICAgOiAgICAgICBBZGRlZCBTeW5jSUQgc3VwcG9ydCBm b3IgaW5jb21pbmcgc3luYw0KKyAqCQkJCQltZXNzYWdlcyBmaWx0ZXJpbmcu DQogICoJSnVzdGluIE9zc2V2b29ydAk6CUZpeCBlbmRpYW4gcHJvYmxlbSBv biBzeW5jIG1lc3NhZ2Ugc2l6ZS4NCiAgKi8NCiANCkBAIC03NCw3ICs3Nyw3 IEBADQogICAgICAgIDAgICAgICAgICAgICAgICAgICAgMSAgICAgICAgICAg ICAgICAgICAyICAgICAgICAgICAgICAgICAgIDMNCiAgICAgICAgMCAxIDIg MyA0IDUgNiA3IDggOSAwIDEgMiAzIDQgNSA2IDcgOCA5IDAgMSAyIDMgNCA1 IDYgNyA4IDkgMCAxDQogICAgICAgKy0rLSstKy0rLSstKy0rLSstKy0rLSst Ky0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSsNCi0g ICAgICB8ICBDb3VudCBDb25ucyAgfCAgIFJlc2VydmVkICAgIHwgICAgICAg ICAgICBTaXplICAgICAgICAgICAgICAgfA0KKyAgICAgIHwgIENvdW50IENv bm5zICB8ICAgIFN5bmMgSUQgICAgfCAgICAgICAgICAgIFNpemUgICAgICAg ICAgICAgICB8DQogICAgICAgKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0r LSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSsNCiAgICAg ICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgfA0KICAgICAgIHwgICAgICAgICAgICAg ICAgICAgIElQVlMgU3luYyBDb25uZWN0aW9uICgxKSAgICAgICAgICAgICAg ICAgICB8DQpAQCAtODYsMTEgKzg5LDE2IEBADQogICAgICAgfCAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHwNCiAgICAgICB8ICAgICAgICAgICAgICAgICAgICBJUFZT IFN5bmMgQ29ubmVjdGlvbiAobikgICAgICAgICAgICAgICAgICAgfA0KICAg ICAgICstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0r LSstKy0rLSstKy0rLSstKy0rLSstKy0rDQorDQorICAgQ291bnQgQ29ubnMg OiBOdW1iZXIgb2YgSVBWUyBzeW5jIENvbm5lY3Rpb24gZW50cmllcy4NCisg ICBTeW5jIElEICAgICA6IElQVlMgc3luYyBncm91cCB3ZSBiZWxvbmcgdG8u DQorICAgU2l6ZSAgICAgICAgOiBTaXplIG9mIHBhY2tldC4NCisNCiAqLw0K ICNkZWZpbmUgU1lOQ19NRVNHX01BWF9TSVpFICAgICAgKDI0KjUwKzQpDQog c3RydWN0IGlwX3ZzX3N5bmNfbWVzZyB7DQogCV9fdTggICAgICAgICAgICAg ICAgICAgIG5yX2Nvbm5zOw0KLQlfX3U4ICAgICAgICAgICAgICAgICAgICBy ZXNlcnZlZDsNCisJX191OCAgICAgICAgICAgICAgICAgICAgc3luY2lkOw0K IAlfX3UxNiAgICAgICAgICAgICAgICAgICBzaXplOw0KIA0KIAkvKiBpcF92 c19zeW5jX2Nvbm4gZW50cmllcyBzdGFydCBoZXJlICovDQpAQCAtMTE2LDYg KzEyNCwxOCBAQA0KIHN0YXRpYyBzdHJ1Y3QgaXBfdnNfc3luY19idWZmICAg KmN1cnJfc2IgPSBOVUxMOw0KIHN0YXRpYyBzcGlubG9ja190IGN1cnJfc2Jf bG9jayA9IFNQSU5fTE9DS19VTkxPQ0tFRDsNCiANCisvKiBpcHZzIHN5bmMg ZGFlbW9uIHN0YXRlICovDQordm9sYXRpbGUgaW50IGlwX3ZzX3N5bmNfc3Rh dGUgPSBJUF9WU19TVEFURV9OT05FOw0KK3ZvbGF0aWxlIGludCBpcF92c19t YXN0ZXJfc3luY2lkID0gMDsNCit2b2xhdGlsZSBpbnQgaXBfdnNfYmFja3Vw X3N5bmNpZCA9IDA7DQorDQorLyogbXVsdGljYXN0IGludGVyZmFjZSBuYW1l ICovDQorY2hhciBpcF92c19tY2FzdF9tYXN0ZXJfaWZuW0lQX1ZTX0lGTkFN RV9NQVhMRU5dOw0KK2NoYXIgaXBfdnNfbWNhc3RfYmFja3VwX2lmbltJUF9W U19JRk5BTUVfTUFYTEVOXTsNCisNCisvKiBtdWx0aWNhc3QgYWRkciAqLw0K K3N0YXRpYyBzdHJ1Y3Qgc29ja2FkZHJfaW4gbWNhc3RfYWRkcjsNCisNCiBz dGF0aWMgaW5saW5lIHZvaWQgc2JfcXVldWVfdGFpbChzdHJ1Y3QgaXBfdnNf c3luY19idWZmICpzYikNCiB7DQogCXNwaW5fbG9jaygmaXBfdnNfc3luY19s b2NrKTsNCkBAIC0xNTMsNiArMTczLDcgQEANCiAJCXJldHVybiBOVUxMOw0K IAl9DQogCXNiLT5tZXNnLT5ucl9jb25ucyA9IDA7DQorCXNiLT5tZXNnLT5z eW5jaWQgPSBpcF92c19tYXN0ZXJfc3luY2lkOw0KIAlzYi0+bWVzZy0+c2l6 ZSA9IDQ7DQogCXNiLT5oZWFkID0gKHVuc2lnbmVkIGNoYXIgKilzYi0+bWVz ZyArIDQ7DQogCXNiLT5lbmQgPSAodW5zaWduZWQgY2hhciAqKXNiLT5tZXNn ICsgU1lOQ19NRVNHX01BWF9TSVpFOw0KQEAgLTI2NSw2ICsyODYsMTMgQEAN CiAJCXJldHVybjsNCiAJfQ0KIA0KKwkvKiBTeW5jSUQgc2FuaXR5IGNoZWNr ICovDQorCWlmIChpcF92c19iYWNrdXBfc3luY2lkICE9IDAgJiYgbS0+c3lu Y2lkICE9IGlwX3ZzX2JhY2t1cF9zeW5jaWQpIHsNCisJCUlQX1ZTX0RCRyg3 LCAiSWdub3JpbmcgaW5jb21pbmcgbXNnIHdpdGggc3luY2lkID0gJWRcbiIs DQorCQkJICBtLT5zeW5jaWQpOw0KKwkJcmV0dXJuOw0KKwl9DQorDQogCXAg PSAoY2hhciAqKWJ1ZmZlciArIHNpemVvZihzdHJ1Y3QgaXBfdnNfc3luY19t ZXNnKTsNCiAJZm9yIChpPTA7IGk8bS0+bnJfY29ubnM7IGkrKykgew0KIAkJ cyA9IChzdHJ1Y3QgaXBfdnNfc3luY19jb25uICopcDsNCkBAIC0zMDgsMTYg KzMzNiw2IEBADQogfQ0KIA0KIA0KLS8qIGlwdnMgc3luYyBkYWVtb24gc3Rh dGUgKi8NCi12b2xhdGlsZSBpbnQgaXBfdnNfc3luY19zdGF0ZSA9IElQX1ZT X1NUQVRFX05PTkU7DQotDQotLyogbXVsdGljYXN0IGludGVyZmFjZSBuYW1l ICovDQotY2hhciBpcF92c19tY2FzdF9pZm5bSVBfVlNfSUZOQU1FX01BWExF Tl07DQotDQotLyogbXVsdGljYXN0IGFkZHIgKi8NCi1zdGF0aWMgc3RydWN0 IHNvY2thZGRyX2luIG1jYXN0X2FkZHI7DQotDQotDQogLyoNCiAgKiAgICAg IFNldHVwIGxvb3BiYWNrIG9mIG91dGdvaW5nIG11bHRpY2FzdHMgb24gYSBz ZW5kaW5nIHNvY2tldA0KICAqLw0KQEAgLTQyOSw3ICs0NDcsNyBAQA0KIAkJ cmV0dXJuIE5VTEw7DQogCX0NCiANCi0JaWYgKHNldF9tY2FzdF9pZihzb2Nr LT5zaywgaXBfdnNfbWNhc3RfaWZuKSA8IDApIHsNCisJaWYgKHNldF9tY2Fz dF9pZihzb2NrLT5zaywgaXBfdnNfbWNhc3RfbWFzdGVyX2lmbikgPCAwKSB7 DQogCQlJUF9WU19FUlIoIkVycm9yIHNldHRpbmcgb3V0Ym91bmQgbWNhc3Qg aW50ZXJmYWNlXG4iKTsNCiAJCWdvdG8gZXJyb3I7DQogCX0NCkBAIC00Mzcs NyArNDU1LDcgQEANCiAJc2V0X21jYXN0X2xvb3Aoc29jay0+c2ssIDApOw0K IAlzZXRfbWNhc3RfdHRsKHNvY2stPnNrLCAxKTsNCiANCi0JaWYgKGJpbmRf bWNhc3RpZl9hZGRyKHNvY2ssIGlwX3ZzX21jYXN0X2lmbikgPCAwKSB7DQor CWlmIChiaW5kX21jYXN0aWZfYWRkcihzb2NrLCBpcF92c19tY2FzdF9tYXN0 ZXJfaWZuKSA8IDApIHsNCiAJCUlQX1ZTX0VSUigiRXJyb3IgYmluZGluZyBh ZGRyZXNzIG9mIHRoZSBtY2FzdCBpbnRlcmZhY2VcbiIpOw0KIAkJZ290byBl cnJvcjsNCiAJfQ0KQEAgLTQ4Myw3ICs1MDEsNyBAQA0KIAkvKiBqb2luIHRo ZSBtdWx0aWNhc3QgZ3JvdXAgKi8NCiAJaWYgKGpvaW5fbWNhc3RfZ3JvdXAo c29jay0+c2ssDQogCQkJICAgICAoc3RydWN0IGluX2FkZHIqKSZtY2FzdF9h ZGRyLnNpbl9hZGRyLA0KLQkJCSAgICAgaXBfdnNfbWNhc3RfaWZuKSA8IDAp IHsNCisJCQkgICAgIGlwX3ZzX21jYXN0X2JhY2t1cF9pZm4pIDwgMCkgew0K IAkJSVBfVlNfRVJSKCJFcnJvciBqb2luaW5nIHRvIHRoZSBtdWx0aWNhc3Qg Z3JvdXBcbiIpOw0KIAkJZ290byBlcnJvcjsNCiAJfQ0KQEAgLTU3MSwxMCAr NTg5LDEyIEBADQogDQogDQogc3RhdGljIERFQ0xBUkVfV0FJVF9RVUVVRV9I RUFEKHN5bmNfd2FpdCk7DQotc3RhdGljIHBpZF90IHN5bmNfcGlkID0gMDsN CitzdGF0aWMgcGlkX3Qgc3luY19tYXN0ZXJfcGlkID0gMDsNCitzdGF0aWMg cGlkX3Qgc3luY19iYWNrdXBfcGlkID0gMDsNCiANCiBzdGF0aWMgREVDTEFS RV9XQUlUX1FVRVVFX0hFQUQoc3RvcF9zeW5jX3dhaXQpOw0KLXN0YXRpYyBp bnQgc3RvcF9zeW5jID0gMDsNCitzdGF0aWMgaW50IHN0b3BfbWFzdGVyX3N5 bmMgPSAwOw0KK3N0YXRpYyBpbnQgc3RvcF9iYWNrdXBfc3luYyA9IDA7DQog DQogc3RhdGljIHZvaWQgc3luY19tYXN0ZXJfbG9vcCh2b2lkKQ0KIHsNCkBA IC01ODYsNiArNjA2LDEwIEBADQogCWlmICghc29jaykNCiAJCXJldHVybjsN CiANCisJSVBfVlNfSU5GTygic3luYyB0aHJlYWQgc3RhcnRlZDogc3RhdGUg PSBNQVNURVIsIG1jYXN0X2lmbiA9ICVzLCAiDQorCQkgICAic3luY2lkID0g JWRcbiIsDQorCQkgICBpcF92c19tY2FzdF9tYXN0ZXJfaWZuLCBpcF92c19t YXN0ZXJfc3luY2lkKTsNCisNCiAJZm9yICg7Oykgew0KIAkJd2hpbGUgKChz Yj1zYl9kZXF1ZXVlKCkpKSB7DQogCQkJaXBfdnNfc2VuZF9zeW5jX21zZyhz b2NrLCBzYi0+bWVzZyk7DQpAQCAtNTk4LDcgKzYyMiw3IEBADQogCQkJaXBf dnNfc3luY19idWZmX3JlbGVhc2Uoc2IpOw0KIAkJfQ0KIA0KLQkJaWYgKHN0 b3Bfc3luYykNCisJCWlmIChzdG9wX21hc3Rlcl9zeW5jKQ0KIAkJCWJyZWFr Ow0KIA0KIAkJX19zZXRfY3VycmVudF9zdGF0ZShUQVNLX0lOVEVSUlVQVElC TEUpOw0KQEAgLTYzNyw2ICs2NjEsMTAgQEANCiAJaWYgKCFzb2NrKQ0KIAkJ Z290byBvdXQ7DQogDQorCUlQX1ZTX0lORk8oInN5bmMgdGhyZWFkIHN0YXJ0 ZWQ6IHN0YXRlID0gQkFDS1VQLCBtY2FzdF9pZm4gPSAlcywgIg0KKwkJICAg InN5bmNpZCA9ICVkXG4iLA0KKwkJICAgaXBfdnNfbWNhc3RfYmFja3VwX2lm biwgaXBfdnNfYmFja3VwX3N5bmNpZCk7DQorDQogCWZvciAoOzspIHsNCiAJ CS8qIGRvIHlvdSBoYXZlIGRhdGEgbm93PyAqLw0KIAkJd2hpbGUgKCFza2Jf cXVldWVfZW1wdHkoJihzb2NrLT5zay0+cmVjZWl2ZV9xdWV1ZSkpKSB7DQpA QCAtNjUyLDcgKzY4MCw3IEBADQogCQkJbG9jYWxfYmhfZW5hYmxlKCk7DQog CQl9DQogDQotCQlpZiAoc3RvcF9zeW5jKQ0KKwkJaWYgKHN0b3BfYmFja3Vw X3N5bmMpDQogCQkJYnJlYWs7DQogDQogCQlfX3NldF9jdXJyZW50X3N0YXRl KFRBU0tfSU5URVJSVVBUSUJMRSk7DQpAQCAtNjY3LDEyICs2OTUsMzEgQEAN CiAJa2ZyZWUoYnVmKTsNCiB9DQogDQorc3RhdGljIHZvaWQgc3luY19waWRf c2V0KGludCBzeW5jX3N0YXRlLCBwaWRfdCBzeW5jX3BpZCkNCit7DQorCWlm IChzeW5jX3N0YXRlID09IElQX1ZTX1NUQVRFX01BU1RFUikNCisJCXN5bmNf bWFzdGVyX3BpZCA9IHN5bmNfcGlkOw0KKwllbHNlIGlmIChzeW5jX3N0YXRl ID09IElQX1ZTX1NUQVRFX0JBQ0tVUCkNCisJCXN5bmNfYmFja3VwX3BpZCA9 IHN5bmNfcGlkOw0KK30NCisNCitzdGF0aWMgdm9pZCBzeW5jX3N0b3Bfc2V0 KGludCBzeW5jX3N0YXRlLCBpbnQgc2V0KQ0KK3sNCisJaWYgKHN5bmNfc3Rh dGUgPT0gSVBfVlNfU1RBVEVfTUFTVEVSKQ0KKwkJc3RvcF9tYXN0ZXJfc3lu YyA9IHNldDsNCisJZWxzZSBpZiAoc3luY19zdGF0ZSA9PSBJUF9WU19TVEFU RV9CQUNLVVApDQorCQlzdG9wX2JhY2t1cF9zeW5jID0gc2V0Ow0KKwllbHNl IHsNCisJCXN0b3BfbWFzdGVyX3N5bmMgPSBzZXQ7DQorCQlzdG9wX2JhY2t1 cF9zeW5jID0gc2V0Ow0KKwl9DQorfQ0KIA0KIHN0YXRpYyBpbnQgc3luY190 aHJlYWQodm9pZCAqc3RhcnR1cCkNCiB7DQogCURFQ0xBUkVfV0FJVFFVRVVF KHdhaXQsIGN1cnJlbnQpOw0KIAltbV9zZWdtZW50X3Qgb2xkbW07DQotCWlu dCBzdGF0ZTsNCisJaW50IHN0YXRlID0gSVBfVlNfU1RBVEVfTk9ORTsNCiAN CiAJTU9EX0lOQ19VU0VfQ09VTlQ7DQogCWRhZW1vbml6ZSgpOw0KQEAgLTY4 MCwxMiArNzI3LDE1IEBADQogCW9sZG1tID0gZ2V0X2ZzKCk7DQogCXNldF9m cyhLRVJORUxfRFMpOw0KIA0KLQlpZiAoaXBfdnNfc3luY19zdGF0ZSA9PSBJ UF9WU19TVEFURV9NQVNURVIpDQorCWlmIChpcF92c19zeW5jX3N0YXRlICYg SVBfVlNfU1RBVEVfTUFTVEVSICYmICFzeW5jX21hc3Rlcl9waWQpIHsNCisJ CXN0YXRlID0gSVBfVlNfU1RBVEVfTUFTVEVSOw0KIAkJc3ByaW50ZihjdXJy ZW50LT5jb21tLCAiaXB2c19zeW5jbWFzdGVyIik7DQotCWVsc2UgaWYgKGlw X3ZzX3N5bmNfc3RhdGUgPT0gSVBfVlNfU1RBVEVfQkFDS1VQKQ0KKwl9IGVs c2UgaWYgKGlwX3ZzX3N5bmNfc3RhdGUgJiBJUF9WU19TVEFURV9CQUNLVVAp IHsNCisJCXN0YXRlID0gSVBfVlNfU1RBVEVfQkFDS1VQOw0KIAkJc3ByaW50 ZihjdXJyZW50LT5jb21tLCAiaXB2c19zeW5jYmFja3VwIik7DQotCWVsc2Ug SVBfVlNfQlVHKCk7DQorCX0gZWxzZSBJUF9WU19CVUcoKTsNCiANCisJLyog QmxvY2sgYWxsIHNpZ25hbHMgKi8NCiAJc3Bpbl9sb2NrX2lycSgmY3VycmVu dC0+c2lnbWFza19sb2NrKTsNCiAJc2lnaW5pdHNldGludigmY3VycmVudC0+ YmxvY2tlZCwgMCk7DQogCXJlY2FsY19zaWdwZW5kaW5nKGN1cnJlbnQpOw0K QEAgLTY5OCw5ICs3NDgsNyBAQA0KIA0KIAlhZGRfd2FpdF9xdWV1ZSgmc3lu Y193YWl0LCAmd2FpdCk7DQogDQotCXN0YXRlID0gaXBfdnNfc3luY19zdGF0 ZTsNCi0Jc3luY19waWQgPSBjdXJyZW50LT5waWQ7DQotCUlQX1ZTX0lORk8o InN5bmMgdGhyZWFkIHN0YXJ0ZWQuXG4iKTsNCisJc3luY19waWRfc2V0KHN0 YXRlLCBjdXJyZW50LT5waWQpOw0KIAljb21wbGV0ZSgoc3RydWN0IGNvbXBs ZXRpb24gKilzdGFydHVwKTsNCiANCiAJLyogcHJvY2Vzc2luZyBtYXN0ZXIv YmFja3VwIGxvb3AgaGVyZSAqLw0KQEAgLTcxMywxMyArNzYxLDEzIEBADQog CXJlbW92ZV93YWl0X3F1ZXVlKCZzeW5jX3dhaXQsICZ3YWl0KTsNCiANCiAJ LyogdGhyZWFkIGV4aXRzICovDQotCXN5bmNfcGlkID0gMDsNCisJc3luY19w aWRfc2V0KHN0YXRlLCAwKTsNCiAJSVBfVlNfSU5GTygic3luYyB0aHJlYWQg c3RvcHBlZCFcbiIpOw0KIA0KIAlzZXRfZnMob2xkbW0pOw0KIAlNT0RfREVD X1VTRV9DT1VOVDsNCiANCi0Jc3RvcF9zeW5jID0gMDsNCisJc3luY19zdG9w X3NldChzdGF0ZSwgMCk7DQogCXdha2VfdXAoJnN0b3Bfc3luY193YWl0KTsN CiANCiAJcmV0dXJuIDA7DQpAQCAtNzQ1LDIwICs3OTMsMjcgQEANCiB9DQog DQogDQotaW50IHN0YXJ0X3N5bmNfdGhyZWFkKGludCBzdGF0ZSwgY2hhciAq bWNhc3RfaWZuKQ0KK2ludCBzdGFydF9zeW5jX3RocmVhZChpbnQgc3RhdGUs IGNoYXIgKm1jYXN0X2lmbiwgX191OCBzeW5jaWQpDQogew0KIAlERUNMQVJF X0NPTVBMRVRJT04oc3RhcnR1cCk7DQogCXBpZF90IHBpZDsNCiANCi0JaWYg KHN5bmNfcGlkKQ0KKwlpZiAoKHN0YXRlID09IElQX1ZTX1NUQVRFX01BU1RF UiAmJiBzeW5jX21hc3Rlcl9waWQpIHx8DQorCSAgICAoc3RhdGUgPT0gSVBf VlNfU1RBVEVfQkFDS1VQICYmIHN5bmNfYmFja3VwX3BpZCkpDQogCQlyZXR1 cm4gLUVFWElTVDsNCiANCiAJSVBfVlNfREJHKDcsICIlczogcGlkICVkXG4i LCBfX0ZVTkNUSU9OX18sIGN1cnJlbnQtPnBpZCk7DQogCUlQX1ZTX0RCRyg3 LCAiRWFjaCBpcF92c19zeW5jX2Nvbm4gZW50cnkgbmVlZCAlZCBieXRlc1xu IiwNCiAJCSAgc2l6ZW9mKHN0cnVjdCBpcF92c19zeW5jX2Nvbm4pKTsNCiAN Ci0JaXBfdnNfc3luY19zdGF0ZSA9IHN0YXRlOw0KLQlzdHJjcHkoaXBfdnNf bWNhc3RfaWZuLCBtY2FzdF9pZm4pOw0KKwlpcF92c19zeW5jX3N0YXRlIHw9 IHN0YXRlOw0KKwlpZiAoc3RhdGUgPT0gSVBfVlNfU1RBVEVfTUFTVEVSKSB7 DQorCQlzdHJjcHkoaXBfdnNfbWNhc3RfbWFzdGVyX2lmbiwgbWNhc3RfaWZu KTsNCisJCWlwX3ZzX21hc3Rlcl9zeW5jaWQgPSBzeW5jaWQ7DQorCX0gZWxz ZSB7DQorCQlzdHJjcHkoaXBfdnNfbWNhc3RfYmFja3VwX2lmbiwgbWNhc3Rf aWZuKTsNCisJCWlwX3ZzX2JhY2t1cF9zeW5jaWQgPSBzeW5jaWQ7DQorCX0N CiANCiAgIHJlcGVhdDoNCiAJaWYgKChwaWQgPSBrZXJuZWxfdGhyZWFkKGZv cmtfc3luY190aHJlYWQsICZzdGFydHVwLCAwKSkgPCAwKSB7DQpAQCAtNzc1 LDIwICs4MzAsMjIgQEANCiB9DQogDQogDQotaW50IHN0b3Bfc3luY190aHJl YWQodm9pZCkNCitpbnQgc3RvcF9zeW5jX3RocmVhZChpbnQgc3RhdGUpDQog ew0KIAlERUNMQVJFX1dBSVRRVUVVRSh3YWl0LCBjdXJyZW50KTsNCiANCi0J aWYgKCFzeW5jX3BpZCkNCisJaWYgKChzdGF0ZSA9PSBJUF9WU19TVEFURV9N QVNURVIgJiYgIXN5bmNfbWFzdGVyX3BpZCkgfHwNCisJICAgIChzdGF0ZSA9 PSBJUF9WU19TVEFURV9CQUNLVVAgJiYgIXN5bmNfYmFja3VwX3BpZCkpDQog CQlyZXR1cm4gLUVTUkNIOw0KIA0KIAlJUF9WU19EQkcoNywgIiVzOiBwaWQg JWRcbiIsIF9fRlVOQ1RJT05fXywgY3VycmVudC0+cGlkKTsNCi0JSVBfVlNf SU5GTygic3RvcHBpbmcgc3luYyB0aHJlYWQgJWQgLi4uXG4iLCBzeW5jX3Bp ZCk7DQorCUlQX1ZTX0lORk8oInN0b3BwaW5nIHN5bmMgdGhyZWFkICVkIC4u LlxuIiwNCisJCSAgIChzdGF0ZSA9PSBJUF9WU19TVEFURV9NQVNURVIpID8g c3luY19tYXN0ZXJfcGlkIDogc3luY19iYWNrdXBfcGlkKTsNCiANCiAJX19z ZXRfY3VycmVudF9zdGF0ZShUQVNLX1VOSU5URVJSVVBUSUJMRSk7DQogCWFk ZF93YWl0X3F1ZXVlKCZzdG9wX3N5bmNfd2FpdCwgJndhaXQpOw0KLQlpcF92 c19zeW5jX3N0YXRlID0gSVBfVlNfU1RBVEVfTk9ORTsNCi0Jc3RvcF9zeW5j ID0gMTsNCisJc3luY19zdG9wX3NldChzdGF0ZSwgMSk7DQorCWlwX3ZzX3N5 bmNfc3RhdGUgLT0gc3RhdGU7DQogCXdha2VfdXAoJnN5bmNfd2FpdCk7DQog CXNjaGVkdWxlKCk7DQogCV9fc2V0X2N1cnJlbnRfc3RhdGUoVEFTS19SVU5O SU5HKTsNCkBAIC03OTcsNyArODU0LDggQEANCiAJLyogTm90ZTogbm8gbmVl ZCB0byByZWFwIHRoZSBzeW5jIHRocmVhZCwgYmVjYXVzZSBpdHMgcGFyZW50 DQogCSAgIHByb2Nlc3MgaXMgdGhlIGluaXQgcHJvY2VzcyAqLw0KIA0KLQlp ZiAoc3RvcF9zeW5jKQ0KKwlpZiAoKHN0YXRlID09IElQX1ZTX1NUQVRFX01B U1RFUiAmJiBzdG9wX21hc3Rlcl9zeW5jKSB8fA0KKwkgICAgKHN0YXRlID09 IElQX1ZTX1NUQVRFX0JBQ0tVUCAmJiBzdG9wX2JhY2t1cF9zeW5jKSkNCiAJ CUlQX1ZTX0JVRygpOw0KIA0KIAlyZXR1cm4gMDsNCg== ---1463811584-572891765-1097000265=:2451-- From roland@topspin.com Mon Jan 3 08:46:45 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 08:46:53 -0800 (PST) Received: from umhlanga.STRATNET.NET (umhlanga.stratnet.net [12.162.17.40]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j03GkPFl011134 for ; Mon, 3 Jan 2005 08:46:45 -0800 Received: from exch-1.topspincom.com ([12.162.17.3]) by umhlanga.STRATNET.NET with Microsoft SMTPSVC(5.0.2195.5329); Mon, 3 Jan 2005 08:55:00 -0800 Received: from eddore ([10.10.253.169]) by exch-1.topspincom.com with Microsoft SMTPSVC(5.0.2195.5329); Mon, 3 Jan 2005 08:54:59 -0800 Received: from roland by eddore with local (Exim 4.34) id 1ClVTv-0002Yi-Bc; Mon, 03 Jan 2005 08:54:59 -0800 To: Eric Lemoine Cc: hadi@cyberus.ca, Andi Kleen , Patrick McHardy , "David S. Miller" , netdev@oss.sgi.com, openib-general@openib.org X-Message-Flag: Warning: May contain useful information References: <52llbwoaej.fsf@topspin.com> <5cac192f04122210491d64d4b6@mail.gmail.com> <20041222202919.057b8331.davem@davemloft.net> <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> <5cac192f0501021530672a908a@mail.gmail.com> <1104764660.1048.578.camel@jzny.localdomain> <52brc68q05.fsf@topspin.com> <5cac192f05010308414a25b548@mail.gmail.com> From: Roland Dreier Date: Mon, 03 Jan 2005 08:54:59 -0800 In-Reply-To: <5cac192f05010308414a25b548@mail.gmail.com> (Eric Lemoine's message of "Mon, 3 Jan 2005 17:41:05 +0100") Message-ID: <527jmu8nbw.fsf@topspin.com> User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Corporate Culture, linux) MIME-Version: 1.0 X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: roland@topspin.com Subject: Re: LLTX and netif_stop_queue Content-Type: text/plain; charset=us-ascii X-SA-Exim-Version: 4.1 (built Tue, 17 Aug 2004 11:06:07 +0200) X-SA-Exim-Scanned: Yes (on eddore) X-OriginalArrivalTime: 03 Jan 2005 16:55:00.0006 (UTC) FILETIME=[F6317460:01C4F1B4] X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13354 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: roland@topspin.com Precedence: bulk X-list: netdev Eric> What are your machines? In particular, how many CPUs do they have? Dual Xeons with HT on, so they look like 4 CPUs. - R. From eric.lemoine@gmail.com Mon Jan 3 08:58:51 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 08:58:58 -0800 (PST) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.200]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j03GwUJI011890 for ; Mon, 3 Jan 2005 08:58:51 -0800 Received: by wproxy.gmail.com with SMTP id 71so1342477wra for ; Mon, 03 Jan 2005 09:07:00 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=LG2/9QmpfiE0lmO++pln2mMGFeMpQYugpOLjwNyRBNK/OG6YzfxSf9CAwcSP+fM2gOp/Fz0ZZtR/er35QYFol+zXOJxMovDuZlZcoj6cepCRhUxNERWWhzgVzYLJw4iqcnzT22epQQsSHhT0SnHhhMEoKQNqSkchuQW6vwqqPes= Received: by 10.54.16.72 with SMTP id 72mr78682wrp; Mon, 03 Jan 2005 09:07:00 -0800 (PST) Received: by 10.54.30.8 with HTTP; Mon, 3 Jan 2005 09:07:00 -0800 (PST) Message-ID: <5cac192f0501030907c755135@mail.gmail.com> Date: Mon, 3 Jan 2005 18:07:00 +0100 From: Eric Lemoine Reply-To: Eric Lemoine To: Roland Dreier Subject: Re: LLTX and netif_stop_queue Cc: hadi@cyberus.ca, Andi Kleen , Patrick McHardy , "David S. Miller" , netdev@oss.sgi.com, openib-general@openib.org In-Reply-To: <527jmu8nbw.fsf@topspin.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <52llbwoaej.fsf@topspin.com> <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> <5cac192f0501021530672a908a@mail.gmail.com> <1104764660.1048.578.camel@jzny.localdomain> <52brc68q05.fsf@topspin.com> <5cac192f05010308414a25b548@mail.gmail.com> <527jmu8nbw.fsf@topspin.com> X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13355 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: eric.lemoine@gmail.com Precedence: bulk X-list: netdev On Mon, 03 Jan 2005 08:54:59 -0800, Roland Dreier wrote: > Eric> What are your machines? In particular, how many CPUs do they have? > > Dual Xeons with HT on, so they look like 4 CPUs. If I understand correctly, LLTX aims at avoiding cache misses on lock variables (because of cacheline bouncing). So the effect of LLTX should increase as the number of CPUs not sharing the same cache increases. And two CPUs might not be enough... -- Eric From grundler@cup.hp.com Mon Jan 3 09:05:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 09:05:20 -0800 (PST) Received: from palrel11.hp.com (palrel11.hp.com [156.153.255.246]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j03H4bHo012486 for ; Mon, 3 Jan 2005 09:05:13 -0800 Received: from esmail.cup.hp.com (esmail.cup.hp.com [15.0.65.164]) by palrel11.hp.com (Postfix) with ESMTP id C1D34E751; Mon, 3 Jan 2005 09:13:05 -0800 (PST) Received: from localhost.localdomain (postfix@debian.cup.hp.com [15.244.57.47]) by esmail.cup.hp.com (8.9.3 (PHNE_29774)/8.8.6) with ESMTP id JAA19635; Mon, 3 Jan 2005 09:09:57 -0800 (PST) Received: by localhost.localdomain (Postfix, from userid 1000) id 8E5C19009A; Mon, 3 Jan 2005 09:12:27 -0800 (PST) Date: Mon, 3 Jan 2005 09:12:27 -0800 From: Grant Grundler To: Eric Lemoine Cc: Roland Dreier , netdev@oss.sgi.com, hadi@cyberus.ca, Andi Kleen , openib-general@openib.org, Patrick McHardy , "David S. Miller" Subject: Re: [openib-general] Re: LLTX and netif_stop_queue Message-ID: <20050103171227.GD7370@esmail.cup.hp.com> References: <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> <5cac192f0501021530672a908a@mail.gmail.com> <1104764660.1048.578.camel@jzny.localdomain> <52brc68q05.fsf@topspin.com> <5cac192f05010308414a25b548@mail.gmail.com> <527jmu8nbw.fsf@topspin.com> <5cac192f0501030907c755135@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5cac192f0501030907c755135@mail.gmail.com> User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13356 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: iod00d@hp.com Precedence: bulk X-list: netdev On Mon, Jan 03, 2005 at 06:07:00PM +0100, Eric Lemoine wrote: > If I understand correctly, LLTX aims at avoiding cache misses on lock > variables (because of cacheline bouncing). So the effect of LLTX > should increase as the number of CPUs not sharing the same cache > increases. And two CPUs might not be enough... Cacheline bouncing usually starts to show up with > 4 CPUs (ie 8 or more). Some workloads that Jamal cares about (routing) only need 2 cpus. grant From pb@bieringer.de Mon Jan 3 12:30:34 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 12:30:45 -0800 (PST) Received: from smtp2.aerasec.de (gromit.aerasec.de [195.226.187.57]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j03KUDZj023653 for ; Mon, 3 Jan 2005 12:30:34 -0800 Received: from localhost (localhost [127.0.0.1]) by smtp2.aerasec.de (Postfix) with SMTP id 55152137EE; Mon, 3 Jan 2005 21:38:46 +0100 (CET) X-AV-Checked: Mon Jan 3 21:38:46 2005 smtp2.aerasec.de Received: from [192.168.1.2] (p50805EF3.dip.t-dialin.net [80.128.94.243]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client did not present a certificate) by smtp2.aerasec.de (Postfix) with ESMTP id 8774C137EA; Mon, 3 Jan 2005 21:38:44 +0100 (CET) Date: Mon, 03 Jan 2005 21:38:41 +0100 From: Peter Bieringer To: Maillist USAGI-users , Maillist netdev Subject: Sneak preview: IPv6-IPsec now described in Linux+IPv6-HOWTO Message-ID: X-Mailer: Mulberry/3.1.6 (Linux/x86) X-URL: http://www.bieringer.de/pb/ X-OS: Linux MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13357 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pb@bieringer.de Precedence: bulk X-list: netdev Hi, I wrote some information about IPv6-IPsec in an intermediate release (0.47.1) of my howto, sneak preview is available at following locations: Perhaps one has some time for review and suggestions until Sunday, when I plan a new major release, which will submitted to TLDP also. BTW: does anyone know the status of the IPsec backport from 2.6 to 2.4? Thank you very much, Peter -- Dr. Peter Bieringer http://www.bieringer.de/pb/ GPG/PGP Key 0x958F422D mailto: pb at bieringer dot de Deep Space 6 Co-Founder and Core Member http://www.deepspace6.net/ From jeremy.guthrie@berbee.com Mon Jan 3 12:47:24 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 12:47:30 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j03Kkx21024507 for ; Mon, 3 Jan 2005 12:47:23 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Mon, 3 Jan 2005 14:55:28 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: V2.4 policy router operates faster/better than V2.6 Date: Mon, 3 Jan 2005 14:55:24 -0600 User-Agent: KMail/1.7.2 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart6658067.kfCW7YP8Jb"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501031455.26980.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 03 Jan 2005 20:55:28.0766 (UTC) FILETIME=[8E6781E0:01C4F1D6] X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13358 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart6658067.kfCW7YP8Jb Content-Type: multipart/mixed; boundary="Boundary-01=_8Eb2BlUDcnK2yQT" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_8Eb2BlUDcnK2yQT Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I have a dual processor box running Suse 9.1 Ent. that I changed over to th= e=20 V2.6.10 kernel. The box has two interfaces in it, both E1000s. The box=20 receives anywhere from 200mbit to 500+ mbit that it needs to route out to= =20 other boxes. The policy routing table is running ~ 150-200 rules. ie. da= ta=20 comes in E3(e1000), is policy routed to a destination sent out E2(e1000). Under V2.4 kernels, the system will operate just fine and drop few packets = if=20 any. ie. right now under V2.4, I have dropped all of three packets. Under= =20 2.6, I can watch the RX drop counter increment. See below. [h-pr-msn-1 guthrie 1:48pm]~-> ifconfig eth3 ; sleep 10 ; ifconfig eth3 eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255.0 inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:132919934 errors:311285 dropped:311285 overruns:247225= =20 frame:0 TX packets:6 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2630721320 (2508.8 Mb) TX bytes:484 (484.0 b) Base address:0x22a0 Memory:eff80000-effa0000 eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255.0 inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:133847068 errors:325697 dropped:325697 overruns:258546= =20 frame:0 TX packets:6 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3102796062 (2959.0 Mb) TX bytes:484 (484.0 b) Base address:0x22a0 Memory:eff80000-effa0000 If I turn off the policy routing, I instantly stop getting RX errors or=20 overruns as it appears the CPU can now pay attention to the packets coming = in=20 and drop them(as I turned off IP forwarding as well). V2.4 Kernel mpstat data: command: mpstat -P ALL 60 Linux 2.4.21-251-smp (h-pr-msn-1) 12/15/2004 01:16:24 PM CPU %user %nice %system %idle intr/s 01:17:19 PM all 0.16 0.00 50.12 49.72 42114.18 01:17:19 PM 0 0.12 0.00 55.60 44.28 42114.18 01:17:19 PM 1 0.20 0.00 44.65 55.15 42114.18 01:17:19 PM CPU %user %nice %system %idle intr/s 01:18:19 PM all 0.13 0.00 48.49 51.38 42103.08 01:18:19 PM 0 0.13 0.00 31.88 67.98 42103.08 01:18:19 PM 1 0.13 0.00 65.10 34.77 42103.08 V2.6 kernel mpstat data: command: mpstat -P ALL 60 Linux 2.6.5-7.111.5-smp (h-pr-msn-1) 12/15/04 13:36:25 CPU %user %nice %system %iowait %irq %soft %idle = =20 intr/s 13:37:25 all 0.13 0.00 0.15 0.09 2.03 43.14 54.45 =20 25506.53 13:37:25 0 0.17 0.00 0.08 0.18 0.00 16.81 82.76 = =20 2215.63 13:37:25 1 0.08 0.00 0.20 0.00 4.08 69.49 26.14 =20 23291.34 13:37:25 CPU %user %nice %system %iowait %irq %soft %idle = =20 intr/s 13:38:24 all 0.14 0.00 0.12 0.12 2.02 42.89 54.71 =20 25900.70 13:38:24 0 0.03 0.00 0.05 0.22 0.00 16.67 83.03 = =20 2246.10 13:38:24 1 0.25 0.00 0.20 0.03 4.02 69.12 26.40 =20 23654.55 Any insights as to why there would be such a stark difference in performanc= e=20 between V2.6 and V2.4? Please advise. =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --Boundary-01=_8Eb2BlUDcnK2yQT Content-Type: application/pgp-keys; name="OpenPGP key 0x719905E5" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0x719905E5.asc -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1.2.4 (GNU/Linux) mQGiBDtxSucRBACqnISb8M/pvbF1gUb7iCPB7t6XbFa5237KsRZHBaeugLdtKCw3 8ulxSrEAsDHFgRJ3eFNWXEX5LEu52CI/riyhR9qzWYTtomddLNAOfZpyalKBtyxC P9nv0WwYxvmEnsrgnfsJ41mVBaW0Ft5f/IbeyxwZbAxqwHJm2nM4QOVYcwCgng9G Cw79l9J91FaUVNPMcupFLPMD/0u15pANW+jBXeTFBHLjAp60PFROr4Z0ePBdIGqD bKV6dX7vfPv/rMhaImUozr/rCCllmrzEFwC63WGZ6QGEl9zzB49vdcwEkPZfMneY j+QNrAc3OA0cRHm07DugnhRpgawJMzuc9UV9kN3CL0p0zZ7Be94YrNb0tEsSfEJQ kd2zA/4hQoJmYeDf/UgZZnmWsWioay/S6/9s+ENvkd0/QjLYe1SLU6STeBCkmJWe fk3iSBYpRquj9w+5v8spltu91nhv5K8giTFiidk6inQ70yH/Dz8FKflWuMhbEGUL SLLXWtWLJUB2wShvMbEpKVIcVn3ylrBZEF7qGNFdiUwqQkVe/7RBSmVyZW15IE0u IEd1dGhyaWUgKEplcmVteSBNLiBHdXRocmllKSA8amVyZW15Lmd1dGhyaWVAYmVy YmVlLmNvbT6IZAQTEQIAJAUCQEziyQIbAwUJB+pfZwYLCQgHAwIDFQIDAxYCAQIe AQIXgAAKCRCq2NoEcZkF5cWLAJ986CQQIz7zVV2z+TgucV3LOYRXDwCaAiwptN0c quyV1upu4f8GQAtNd9i5Ag0EO3FK8RAIAMi4ZmMfAGAv9n7m3n5HXmAfHARllCv2 2nxzZYMKp9XmAHLl7NbvxOw6rs+hWFufL1QfGxiHaaMTO64gPUi64+kKFWoGwTY5 AfidjLhNFWoP+gNIc1Mi90J6ZQuXwZI+mieRWTQNE4B9R7ZRftBH05Sj63ioqfbr uPszGXiunM2S8V3z1U/L9GIvqIW7+tiFYmgXMzW7H2ElIV11Nl+AFqihVSqljXvG Gi6zkD4OAK6O3fRHtjOTf55eZHHlQ+WjgTn+FtrBQFLRwZ+KDaBOymAjdxoxhe3n +ZDegk+HzWSPzv8929LGTZeTCI1OMTl/S6AXwwwNGiAZjfVXTsa018MAAwUH/2KG szyDYLLMd72TK7Yojsvltf84ctK+2hscYrYf34MjNu4ODqe0a/1gwxvfvG4zaIQ5 fWJgFzA/JuprE/gFp9JnSAtvrTBTno4KYlwJggkq5KVpfZs5GDN4Q9uecdvJZ17y EGasTfyxuTnyxdpHtNkn9ehfs1aVPbd4QzolO0N2QZB2YDBw/GPZ6rgeo/XKkzqg AoIOwlyWVRgGb5Hv93fNOXhbQ+xMpw4uieeBr8p6B/nwlp/o5M6H676aY9JTf9Up hdbcBKQpe2Zs54grERng/Q9KJqCDFh65BKGMc7ceckSRhzaKwGF3Wa1BSVn/dLsz d/0FZ9UX1Cs9LsKnRlCITAQYEQIADAUCPbgP6QUJB+pfeAAKCRCq2NoEcZkF5QvZ AJ0byLfrhE+kbl+PXTRJ9eeU//O/+wCffaUH/md38U3ZkCgxOcRmPqmf3W0= =03qu -----END PGP PUBLIC KEY BLOCK----- --Boundary-01=_8Eb2BlUDcnK2yQT-- --nextPart6658067.kfCW7YP8Jb Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB2bE+qtjaBHGZBeURAgEjAJsEepf2zXr5iYSXdm135VDp627O9QCfd/+E r/oNJpgFcPI8IH8Lw1fUICU= =Fh1p -----END PGP SIGNATURE----- --nextPart6658067.kfCW7YP8Jb-- From shemminger@osdl.org Mon Jan 3 14:43:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 14:43:22 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j03MgoKr028701 for ; Mon, 3 Jan 2005 14:43:15 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j03MpF604659; Mon, 3 Jan 2005 14:51:16 -0800 Date: Mon, 3 Jan 2005 14:51:15 -0800 From: Stephen Hemminger To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Message-Id: <20050103145115.4bdb2cd6@dxpl.pdx.osdl.net> In-Reply-To: <200501031455.26980.jeremy.guthrie@berbee.com> References: <200501031455.26980.jeremy.guthrie@berbee.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.10claws (GTK+ 1.2.10; x86_64-suse-linux) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13359 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev On Mon, 3 Jan 2005 14:55:24 -0600 "Jeremy M. Guthrie" wrote: > I have a dual processor box running Suse 9.1 Ent. that I changed over to the > V2.6.10 kernel. The box has two interfaces in it, both E1000s. The box > receives anywhere from 200mbit to 500+ mbit that it needs to route out to > other boxes. The policy routing table is running ~ 150-200 rules. ie. data > comes in E3(e1000), is policy routed to a destination sent out E2(e1000). > > Under V2.4 kernels, the system will operate just fine and drop few packets if > any. ie. right now under V2.4, I have dropped all of three packets. Under > 2.6, I can watch the RX drop counter increment. See below. > > [h-pr-msn-1 guthrie 1:48pm]~-> ifconfig eth3 ; sleep 10 ; ifconfig eth3 > eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 > inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255.0 > inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:132919934 errors:311285 dropped:311285 overruns:247225 > frame:0 > TX packets:6 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:1000 > RX bytes:2630721320 (2508.8 Mb) TX bytes:484 (484.0 b) > Base address:0x22a0 Memory:eff80000-effa0000 > > eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 > inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255.0 > inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:133847068 errors:325697 dropped:325697 overruns:258546 > frame:0 > TX packets:6 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:1000 > RX bytes:3102796062 (2959.0 Mb) TX bytes:484 (484.0 b) > Base address:0x22a0 Memory:eff80000-effa0000 > > If I turn off the policy routing, I instantly stop getting RX errors or > overruns as it appears the CPU can now pay attention to the packets coming in > and drop them(as I turned off IP forwarding as well). > > V2.4 Kernel mpstat data: > command: mpstat -P ALL 60 > Linux 2.4.21-251-smp (h-pr-msn-1) 12/15/2004 > > 01:16:24 PM CPU %user %nice %system %idle intr/s > 01:17:19 PM all 0.16 0.00 50.12 49.72 42114.18 > 01:17:19 PM 0 0.12 0.00 55.60 44.28 42114.18 > 01:17:19 PM 1 0.20 0.00 44.65 55.15 42114.18 > > 01:17:19 PM CPU %user %nice %system %idle intr/s > 01:18:19 PM all 0.13 0.00 48.49 51.38 42103.08 > 01:18:19 PM 0 0.13 0.00 31.88 67.98 42103.08 > 01:18:19 PM 1 0.13 0.00 65.10 34.77 42103.08 > > V2.6 kernel mpstat data: > command: mpstat -P ALL 60 > Linux 2.6.5-7.111.5-smp (h-pr-msn-1) 12/15/04 > > 13:36:25 CPU %user %nice %system %iowait %irq %soft %idle > intr/s > 13:37:25 all 0.13 0.00 0.15 0.09 2.03 43.14 54.45 > 25506.53 > 13:37:25 0 0.17 0.00 0.08 0.18 0.00 16.81 82.76 > 2215.63 > 13:37:25 1 0.08 0.00 0.20 0.00 4.08 69.49 26.14 > 23291.34 > > 13:37:25 CPU %user %nice %system %iowait %irq %soft %idle > intr/s > 13:38:24 all 0.14 0.00 0.12 0.12 2.02 42.89 54.71 > 25900.70 > 13:38:24 0 0.03 0.00 0.05 0.22 0.00 16.67 83.03 > 2246.10 > 13:38:24 1 0.25 0.00 0.20 0.03 4.02 69.12 26.40 > 23654.55 > > Any insights as to why there would be such a stark difference in performance > between V2.6 and V2.4? How many flows are going through the router? The neighbour cache can get to be a bottleneck. Perhaps Robert "the Router Man" Olssen can give some hints. From jeremy.guthrie@berbee.com Mon Jan 3 14:48:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 14:48:56 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j03MmSK6029275 for ; Mon, 3 Jan 2005 14:48:48 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Mon, 3 Jan 2005 16:56:57 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Mon, 3 Jan 2005 16:56:53 -0600 User-Agent: KMail/1.7.2 Cc: Stephen Hemminger References: <200501031455.26980.jeremy.guthrie@berbee.com> <20050103145115.4bdb2cd6@dxpl.pdx.osdl.net> In-Reply-To: <20050103145115.4bdb2cd6@dxpl.pdx.osdl.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2723897.nnnOR6FQuA"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501031656.57041.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 03 Jan 2005 22:56:58.0001 (UTC) FILETIME=[87208010:01C4F1E7] X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13360 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart2723897.nnnOR6FQuA Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline How would I check? It should be in the hundreds of thousands. On Monday 03 January 2005 04:51 pm, Stephen Hemminger wrote: > On Mon, 3 Jan 2005 14:55:24 -0600 > > "Jeremy M. Guthrie" wrote: > > Any insights as to why there would be such a stark difference in > > performance between V2.6 and V2.4? > > How many flows are going through the router? The neighbour cache > can get to be a bottleneck. Perhaps Robert "the Router Man" Olssen can > give some hints. =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart2723897.nnnOR6FQuA Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB2c24qtjaBHGZBeURApfPAJ47JnVz3gwRijJDhfR02fR2zCDrkgCgk+K0 lVInjqbgrTXWPVwsKyMdWzA= =cpIW -----END PGP SIGNATURE----- --nextPart2723897.nnnOR6FQuA-- From hadi@cyberus.ca Mon Jan 3 14:52:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 14:52:32 -0800 (PST) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j03Mq1HF029811 for ; Mon, 3 Jan 2005 14:52:25 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.30) id 1ClbBi-00038X-GF for netdev@oss.sgi.com; Mon, 03 Jan 2005 18:00:34 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1ClTMc-0003tQ-Pk; Mon, 03 Jan 2005 09:39:19 -0500 Subject: Re: [PKT_SCHED]: Allow using nfmark as key in U32 classifier. From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <20050102001338.GV32419@postel.suug.ch> References: <20041230174313.GB32419@postel.suug.ch> <1104469111.1049.219.camel@jzny.localdomain> <20041231110836.GD32419@postel.suug.ch> <1104505142.1048.262.camel@jzny.localdomain> <20041231153930.GN32419@postel.suug.ch> <1104511494.1048.303.camel@jzny.localdomain> <20041231181153.GP32419@postel.suug.ch> <1104526311.1047.379.camel@jzny.localdomain> <20050101183230.GT32419@postel.suug.ch> <1104622934.1047.460.camel@jzny.localdomain> <20050102001338.GV32419@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1104763156.1048.531.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 03 Jan 2005 09:39:16 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13361 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Sat, 2005-01-01 at 19:13, Thomas Graf wrote: > * jamal <1104622934.1047.460.camel@jzny.localdomain> 2005-01-01 18:42 > > what happened to the good old SEL TLV (which i believe we called SEL2 > > now); or maybe thats what contains this TLV? > > Please look at the patch I posted in the other post. I think > we missudnerstand each other. Will do. > > Why do you need to specify "nmatches". > > It's mainly a shortcut to validate precedence jumps so I > can avoid traversing the RTA chain twice. It could be > avoided but is quite handy to speed things up and > also acts for validation purposes to check consistency of > the match list. Ok. > > What is TCA_EMATCH_TREE_LIST for? Looks like another TLV nesting. Not > > needed, you just plumb the T=1,..T=N right after the header. > > No, what if we need some more stuff in the selector TLV? We can't > modify the header TLV w/o breaking backwards compatibility. Adding > this addtional nesting allows to simply add stuff after TREE_LIST > TLV. Good point. > > I think the way you have it is fine - and believe it is the way the > > action code has it for the list. > > You're using a maximum prio aren't you? I use a RTA_OK() loop > supporting unlimited number of matches without the need to > allocate rtattr pointer array. Sounds reasonable; Note in my case, you probably want a limit on how many actions you chain in one policy - I would suggest you do the same as well. In other words even if you do it that way, have a limit check/setting somewhere. cheers, jamal From hadi@cyberus.ca Mon Jan 3 15:43:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 15:43:10 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j03NgcQc032070 for ; Mon, 3 Jan 2005 15:43:02 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1ClTls-0003Z0-Km for netdev@oss.sgi.com; Mon, 03 Jan 2005 10:05:24 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1ClTlh-0007IC-EU; Mon, 03 Jan 2005 10:05:13 -0500 Subject: Re: [patch 4/10] s390: network driver. From: jamal Reply-To: hadi@cyberus.ca To: Thomas Spatzier Cc: "David S. Miller" , Hasso Tepper , Herbert Xu , Jeff Garzik , netdev@oss.sgi.com, Paul Jakma , Tommy Christensen In-Reply-To: References: Content-Type: text/plain Organization: jamalopolous Message-Id: <1104764710.1048.580.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 03 Jan 2005 10:05:10 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13362 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev The change is simple if theres consensus to go this path. cheers, jamal On Mon, 2005-01-03 at 04:10, Thomas Spatzier wrote: > > > jamal wrote on 22.12.2004 14:48:28: > > I think this needs to be resolved too. > > It is possible to have a centralized action instead of requiring drivers > > to make changes if we know the state of the driver is in netcarrier_off. > > What that would require is > > on cable gone, you just say: > > netif_carrier_off(); > > and the top layer code will junk the packets before they hit the driver. > > This way the socket code can continue sending whatever it wants but if > > theres no link, then its fair to drop those packets? > > > > If this acceptable i can generate a quick patch. > > Does Jamal's solution sound good for all? Then I would change my driver > to do the following: > just call netif_carrier_off() (not netif_stop_queue) > > Then the upper layers will do the propper thing, so I should not > get any more packets. If I still get some, I will drop them. > Did I get this correctly? > > BTW: A happy new year to all ;-) > > Regards, > Thomas. > > From bunk@stusta.de Mon Jan 3 15:43:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 15:43:32 -0800 (PST) Received: from mailout.stusta.mhn.de (mailout.stusta.mhn.de [141.84.69.5]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j03Nh02M032080 for ; Mon, 3 Jan 2005 15:43:25 -0800 Received: (qmail 17606 invoked from network); 3 Jan 2005 23:51:29 -0000 Received: from r063144.stusta.swh.mhn.de (10.150.63.144) by mailout.stusta.mhn.de with SMTP; 3 Jan 2005 23:51:29 -0000 Received: by r063144.stusta.swh.mhn.de (Postfix, from userid 1000) id 2974BBC0A4; Tue, 4 Jan 2005 00:51:28 +0100 (CET) Date: Tue, 4 Jan 2005 00:51:27 +0100 From: Adrian Bunk To: "David S. Miller" Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [2.6 patch] net/core/: misc possible cleanups Message-ID: <20050103235127.GQ2980@stusta.de> References: <20041214045758.GA23151@stusta.de> <20041227190249.6afda3df.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041227190249.6afda3df.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13363 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bunk@stusta.de Precedence: bulk X-list: netdev On Mon, Dec 27, 2004 at 07:02:49PM -0800, David S. Miller wrote: > On Tue, 14 Dec 2004 05:57:58 +0100 > Adrian Bunk wrote: > > > - skbuff.c: skb_insert > > - skbuff.c: skb_iter_first > > - skbuff.c: skb_iter_next > > - skbuff.c: skb_iter_abort > > These are actually planned to be used, let's keep them in for > now. OK, updated patch: <-- snip --> The patch below contains the following cleanups: - make needlessly global code static - remove the following unused global functions: - datagram.c: skb_copy_datagram - iovec.c: memcpy_tokerneliovec - remove the following unneeded EXPORT_SYMBOL's: - datagram.c: skb_copy_datagram - dev.c: ing_filter - iovec.c: memcpy_tokerneliovec - netpoll.c: netpoll_send_skb - rtnetlink.c: rtnetlink_dump_ifinfo - sock.c: sock_alloc_send_pskb diffstat output: include/linux/netdevice.h | 1 - include/linux/netfilter.h | 4 ---- include/linux/netpoll.h | 1 - include/linux/rtnetlink.h | 1 - include/linux/skbuff.h | 5 ----- include/linux/socket.h | 1 - include/net/iw_handler.h | 3 --- include/net/pkt_cls.h | 1 - include/net/sock.h | 7 ------- net/core/datagram.c | 19 +++---------------- net/core/dev.c | 13 ++++--------- net/core/dst.c | 2 +- net/core/iovec.c | 23 ----------------------- net/core/netfilter.c | 2 +- net/core/netpoll.c | 5 ++--- net/core/rtnetlink.c | 3 +-- net/core/sock.c | 17 +++++++++-------- net/core/wireless.c | 3 +-- 18 files changed, 22 insertions(+), 89 deletions(-) Signed-off-by: Adrian Bunk --- linux-2.6.10-rc3-mm1-full/include/linux/skbuff.h.old 2004-12-14 02:34:03.000000000 +0100 +++ linux-2.6.10-rc3-mm1-full/include/linux/skbuff.h 2004-12-14 02:51:27.000000000 +0100 @@ -1086,14 +1085,9 @@ int noblock, int *err); extern unsigned int datagram_poll(struct file *file, struct socket *sock, struct poll_table_struct *wait); -extern int skb_copy_datagram(const struct sk_buff *from, - int offset, char __user *to, int size); extern int skb_copy_datagram_iovec(const struct sk_buff *from, int offset, struct iovec *to, int size); -extern int skb_copy_and_csum_datagram(const struct sk_buff *skb, - int offset, u8 __user *to, - int len, unsigned int *csump); extern int skb_copy_and_csum_datagram_iovec(const struct sk_buff *skb, int hlen, --- linux-2.6.10-rc3-mm1-full/include/net/pkt_cls.h.old 2004-12-14 02:37:09.000000000 +0100 +++ linux-2.6.10-rc3-mm1-full/include/net/pkt_cls.h 2004-12-14 02:37:15.000000000 +0100 @@ -17,7 +17,6 @@ extern int register_tcf_proto_ops(struct tcf_proto_ops *ops); extern int unregister_tcf_proto_ops(struct tcf_proto_ops *ops); -extern int ing_filter(struct sk_buff *skb); static inline unsigned long __cls_set_class(unsigned long *clp, unsigned long cl) --- linux-2.6.10-rc3-mm1-full/include/linux/netdevice.h.old 2004-12-14 02:38:05.000000000 +0100 +++ linux-2.6.10-rc3-mm1-full/include/linux/netdevice.h 2004-12-14 02:38:11.000000000 +0100 @@ -522,7 +522,6 @@ extern struct net_device *dev_base; /* All devices */ extern rwlock_t dev_base_lock; /* Device list lock */ -extern int netdev_boot_setup_add(char *name, struct ifmap *map); extern int netdev_boot_setup_check(struct net_device *dev); extern unsigned long netdev_boot_base(const char *prefix, int unit); extern struct net_device *dev_getbyhwaddr(unsigned short type, char *hwaddr); --- linux-2.6.10-rc3-mm1-full/include/linux/socket.h.old 2004-12-14 02:39:18.000000000 +0100 +++ linux-2.6.10-rc3-mm1-full/include/linux/socket.h 2004-12-14 02:39:24.000000000 +0100 @@ -286,7 +286,6 @@ extern int verify_iovec(struct msghdr *m, struct iovec *iov, char *address, int mode); extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); -extern void memcpy_tokerneliovec(struct iovec *iov, unsigned char *kdata, int len); extern int move_addr_to_user(void *kaddr, int klen, void __user *uaddr, int __user *ulen); extern int move_addr_to_kernel(void __user *uaddr, int ulen, void *kaddr); extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); --- linux-2.6.10-rc3-mm1-full/include/linux/netfilter.h.old 2004-12-14 02:41:28.000000000 +0100 +++ linux-2.6.10-rc3-mm1-full/include/linux/netfilter.h 2004-12-14 02:41:37.000000000 +0100 @@ -175,10 +175,6 @@ extern void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *); extern void nf_ct_attach(struct sk_buff *, struct sk_buff *); -#ifdef CONFIG_NETFILTER_DEBUG -extern void nf_dump_skb(int pf, struct sk_buff *skb); -#endif - /* FIXME: Before cache is ever used, this must be implemented for real. */ extern void nf_invalidate_cache(int pf); --- linux-2.6.10-rc3-mm1-full/net/core/datagram.c.old 2004-12-14 04:22:37.000000000 +0100 +++ linux-2.6.10-rc3-mm1-full/net/core/datagram.c 2004-12-14 02:35:34.000000000 +0100 @@ -199,19 +199,6 @@ kfree_skb(skb); } -/* - * Copy a datagram to a linear buffer. - */ -int skb_copy_datagram(const struct sk_buff *skb, int offset, char __user *to, int size) -{ - struct iovec iov = { - .iov_base = to, - .iov_len =size, - }; - - return skb_copy_datagram_iovec(skb, offset, &iov, size); -} - /** * skb_copy_datagram_iovec - Copy a datagram to an iovec. * @skb - buffer to copy @@ -296,8 +283,9 @@ return -EFAULT; } -int skb_copy_and_csum_datagram(const struct sk_buff *skb, int offset, - u8 __user *to, int len, unsigned int *csump) +static int skb_copy_and_csum_datagram(const struct sk_buff *skb, int offset, + u8 __user *to, int len, + unsigned int *csump) { int start = skb_headlen(skb); int pos = 0; @@ -489,7 +477,6 @@ EXPORT_SYMBOL(datagram_poll); EXPORT_SYMBOL(skb_copy_and_csum_datagram_iovec); -EXPORT_SYMBOL(skb_copy_datagram); EXPORT_SYMBOL(skb_copy_datagram_iovec); EXPORT_SYMBOL(skb_free_datagram); EXPORT_SYMBOL(skb_recv_datagram); --- linux-2.6.10-rc3-mm1-full/net/core/dev.c.old 2004-12-14 02:36:09.000000000 +0100 +++ linux-2.6.10-rc3-mm1-full/net/core/dev.c 2004-12-14 02:38:19.000000000 +0100 @@ -183,7 +183,7 @@ * semaphore held. */ struct net_device *dev_base; -struct net_device **dev_tail = &dev_base; +static struct net_device **dev_tail = &dev_base; rwlock_t dev_base_lock = RW_LOCK_UNLOCKED; EXPORT_SYMBOL(dev_base); @@ -361,7 +361,7 @@ * returns 0 on error and 1 on success. This is a generic routine to * all netdevices. */ -int netdev_boot_setup_add(char *name, struct ifmap *map) +static int netdev_boot_setup_add(char *name, struct ifmap *map) { struct netdev_boot_setup *s; int i; @@ -644,7 +644,7 @@ * Network device names need to be valid file names to * to allow sysfs to work */ -int dev_valid_name(const char *name) +static int dev_valid_name(const char *name) { return !(*name == '\0' || !strcmp(name, ".") @@ -1596,7 +1596,7 @@ * the ingress scheduler, you just cant add policies on ingress. * */ -int ing_filter(struct sk_buff *skb) +static int ing_filter(struct sk_buff *skb) { struct Qdisc *q; struct net_device *dev = skb->dev; @@ -3251,9 +3251,4 @@ EXPORT_SYMBOL(dev_load); #endif -#ifdef CONFIG_NET_CLS_ACT -EXPORT_SYMBOL(ing_filter); -#endif - - EXPORT_PER_CPU_SYMBOL(softnet_data); --- linux-2.6.10-rc3-mm1-full/net/core/dst.c.old 2004-12-14 02:38:35.000000000 +0100 +++ linux-2.6.10-rc3-mm1-full/net/core/dst.c 2004-12-14 02:38:45.000000000 +0100 @@ -264,7 +264,7 @@ return NOTIFY_DONE; } -struct notifier_block dst_dev_notifier = { +static struct notifier_block dst_dev_notifier = { .notifier_call = dst_dev_event, }; --- linux-2.6.10-rc3-mm1-full/net/core/iovec.c.old 2004-12-14 02:39:30.000000000 +0100 +++ linux-2.6.10-rc3-mm1-full/net/core/iovec.c 2004-12-14 02:39:52.000000000 +0100 @@ -99,28 +99,6 @@ } /* - * In kernel copy to iovec. Returns -EFAULT on error. - * - * Note: this modifies the original iovec. - */ - -void memcpy_tokerneliovec(struct iovec *iov, unsigned char *kdata, int len) -{ - while (len > 0) { - if (iov->iov_len) { - int copy = min_t(unsigned int, iov->iov_len, len); - memcpy(iov->iov_base, kdata, copy); - kdata += copy; - len -= copy; - iov->iov_len -= copy; - iov->iov_base += copy; - } - iov++; - } -} - - -/* * Copy iovec to kernel. Returns -EFAULT on error. * * Note: this modifies the original iovec. @@ -259,4 +237,3 @@ EXPORT_SYMBOL(memcpy_fromiovec); EXPORT_SYMBOL(memcpy_fromiovecend); EXPORT_SYMBOL(memcpy_toiovec); -EXPORT_SYMBOL(memcpy_tokerneliovec); --- linux-2.6.10-rc3-mm1-full/net/core/netfilter.c.old 2004-12-14 02:41:44.000000000 +0100 +++ linux-2.6.10-rc3-mm1-full/net/core/netfilter.c 2004-12-14 02:41:52.000000000 +0100 @@ -173,7 +173,7 @@ printk("\n"); } -void nf_dump_skb(int pf, struct sk_buff *skb) +static void nf_dump_skb(int pf, struct sk_buff *skb) { printk("skb: pf=%i %s dev=%s len=%u\n", pf, --- linux-2.6.10-rc3-mm1-full/include/linux/netpoll.h.old 2004-12-14 02:43:42.000000000 +0100 +++ linux-2.6.10-rc3-mm1-full/include/linux/netpoll.h 2004-12-14 02:43:47.000000000 +0100 @@ -24,7 +24,6 @@ }; void netpoll_poll(struct netpoll *np); -void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb); void netpoll_send_udp(struct netpoll *np, const char *msg, int len); int netpoll_parse_options(struct netpoll *np, char *opt); int netpoll_setup(struct netpoll *np); --- linux-2.6.10-rc3-mm1-full/net/core/netpoll.c.old 2004-12-14 02:43:06.000000000 +0100 +++ linux-2.6.10-rc3-mm1-full/net/core/netpoll.c 2004-12-14 02:43:59.000000000 +0100 @@ -39,7 +39,7 @@ static LIST_HEAD(rx_list); static atomic_t trapped; -spinlock_t netpoll_poll_lock = SPIN_LOCK_UNLOCKED; +static spinlock_t netpoll_poll_lock = SPIN_LOCK_UNLOCKED; #define NETPOLL_RX_ENABLED 1 #define NETPOLL_RX_DROP 2 @@ -178,7 +178,7 @@ return skb; } -void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) +static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) { int status; @@ -676,6 +676,5 @@ EXPORT_SYMBOL(netpoll_parse_options); EXPORT_SYMBOL(netpoll_setup); EXPORT_SYMBOL(netpoll_cleanup); -EXPORT_SYMBOL(netpoll_send_skb); EXPORT_SYMBOL(netpoll_send_udp); EXPORT_SYMBOL(netpoll_poll); --- linux-2.6.10-rc3-mm1-full/include/linux/rtnetlink.h.old 2004-12-14 02:44:36.000000000 +0100 +++ linux-2.6.10-rc3-mm1-full/include/linux/rtnetlink.h 2004-12-14 02:44:52.000000000 +0100 @@ -765,7 +765,6 @@ }; extern struct rtnetlink_link * rtnetlink_links[NPROTO]; -extern int rtnetlink_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb); extern int rtnetlink_send(struct sk_buff *skb, u32 pid, u32 group, int echo); extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics); --- linux-2.6.10-rc3-mm1-full/net/core/rtnetlink.c.old 2004-12-14 02:45:12.000000000 +0100 +++ linux-2.6.10-rc3-mm1-full/net/core/rtnetlink.c 2004-12-14 02:45:26.000000000 +0100 @@ -241,7 +241,7 @@ return -1; } -int rtnetlink_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb) +static int rtnetlink_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb) { int idx; int s_idx = cb->args[0]; @@ -676,7 +676,6 @@ EXPORT_SYMBOL(__rta_fill); EXPORT_SYMBOL(rtattr_parse); -EXPORT_SYMBOL(rtnetlink_dump_ifinfo); EXPORT_SYMBOL(rtnetlink_links); EXPORT_SYMBOL(rtnetlink_put_metrics); EXPORT_SYMBOL(rtnl); --- linux-2.6.10-rc3-mm1-full/include/net/sock.h.old 2004-12-14 02:56:46.000000000 +0100 +++ linux-2.6.10-rc3-mm1-full/include/net/sock.h 2004-12-14 02:53:27.000000000 +0100 @@ -733,11 +733,6 @@ unsigned long size, int noblock, int *errcode); -extern struct sk_buff *sock_alloc_send_pskb(struct sock *sk, - unsigned long header_len, - unsigned long data_len, - int noblock, - int *errcode); extern void *sock_kmalloc(struct sock *sk, int size, int priority); extern void sock_kfree_s(struct sock *sk, void *mem, int size); extern void sk_send_sigurg(struct sock *sk); @@ -795,8 +790,6 @@ * Default socket callbacks and setup code */ -extern void sock_def_destruct(struct sock *); - /* Initialise core socket variables */ extern void sock_init_data(struct socket *sock, struct sock *sk); --- linux-2.6.10-rc3-mm1-full/net/core/sock.c.old 2004-12-14 02:52:27.000000000 +0100 +++ linux-2.6.10-rc3-mm1-full/net/core/sock.c 2004-12-14 03:12:56.000000000 +0100 @@ -825,8 +825,10 @@ * Generic send/receive buffer handlers */ -struct sk_buff *sock_alloc_send_pskb(struct sock *sk, unsigned long header_len, - unsigned long data_len, int noblock, int *errcode) +static struct sk_buff *sock_alloc_send_pskb(struct sock *sk, + unsigned long header_len, + unsigned long data_len, + int noblock, int *errcode) { struct sk_buff *skb; unsigned int gfp_mask; @@ -1084,7 +1086,7 @@ * Default Socket Callbacks */ -void sock_def_wakeup(struct sock *sk) +static void sock_def_wakeup(struct sock *sk) { read_lock(&sk->sk_callback_lock); if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) @@ -1092,7 +1094,7 @@ read_unlock(&sk->sk_callback_lock); } -void sock_def_error_report(struct sock *sk) +static void sock_def_error_report(struct sock *sk) { read_lock(&sk->sk_callback_lock); if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) @@ -1101,7 +1103,7 @@ read_unlock(&sk->sk_callback_lock); } -void sock_def_readable(struct sock *sk, int len) +static void sock_def_readable(struct sock *sk, int len) { read_lock(&sk->sk_callback_lock); if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) @@ -1110,7 +1112,7 @@ read_unlock(&sk->sk_callback_lock); } -void sock_def_write_space(struct sock *sk) +static void sock_def_write_space(struct sock *sk) { read_lock(&sk->sk_callback_lock); @@ -1129,7 +1131,7 @@ read_unlock(&sk->sk_callback_lock); } -void sock_def_destruct(struct sock *sk) +static void sock_def_destruct(struct sock *sk) { if (sk->sk_protinfo) kfree(sk->sk_protinfo); @@ -1368,7 +1370,6 @@ EXPORT_SYMBOL(sk_alloc); EXPORT_SYMBOL(sk_free); EXPORT_SYMBOL(sk_send_sigurg); -EXPORT_SYMBOL(sock_alloc_send_pskb); EXPORT_SYMBOL(sock_alloc_send_skb); EXPORT_SYMBOL(sock_init_data); EXPORT_SYMBOL(sock_kfree_s); --- linux-2.6.10-rc3-mm1-full/include/net/iw_handler.h.old 2004-12-14 02:54:50.000000000 +0100 +++ linux-2.6.10-rc3-mm1-full/include/net/iw_handler.h 2004-12-14 02:54:57.000000000 +0100 @@ -418,9 +418,6 @@ * Those may be called only within the kernel. */ -/* Data needed by fs/compat_ioctl.c for 32->64 bit conversion */ -extern const char iw_priv_type_size[]; - /* First : function strictly used inside the kernel */ /* Handle /proc/net/wireless, called in net/code/dev.c */ --- linux-2.6.10-rc3-mm1-full/net/core/wireless.c.old 2004-12-14 02:55:04.000000000 +0100 +++ linux-2.6.10-rc3-mm1-full/net/core/wireless.c 2004-12-14 02:55:12.000000000 +0100 @@ -304,7 +304,7 @@ sizeof(struct iw_ioctl_description)); /* Size (in bytes) of the various private data types */ -const char iw_priv_type_size[] = { +static const char iw_priv_type_size[] = { 0, /* IW_PRIV_TYPE_NONE */ 1, /* IW_PRIV_TYPE_BYTE */ 1, /* IW_PRIV_TYPE_CHAR */ From akepner@sgi.com Mon Jan 3 17:36:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 17:36:55 -0800 (PST) Received: from omx1.americas.sgi.com (omx1-ext.sgi.com [192.48.179.11]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j041aT1r006947 for ; Mon, 3 Jan 2005 17:36:49 -0800 Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) by omx1.americas.sgi.com (8.12.10/8.12.9/linux-outbound_gateway-1.1) with ESMTP id j041j3xT019715 for ; Mon, 3 Jan 2005 19:45:03 -0600 From: akepner@sgi.com Received: from [192.168.2.3] (mtv-vpn-sw-corp-0-142.corp.sgi.com [134.15.0.142]) by cthulhu.engr.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id j041j1Fx4730500; Mon, 3 Jan 2005 17:45:02 -0800 (PST) Date: Mon, 3 Jan 2005 17:45:01 -0800 (PST) X-X-Sender: To: , cc: Subject: [PATCH bk-2.6.10] tg3:align IP headers from 5701 in PCI-X mode Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13364 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akepner@sgi.com Precedence: bulk X-list: netdev We still have customers using 5701 cards, and their syslogs fill with "kernel unaligned access" messages. They may also see a significant performance degradation due to the expense of unaligned accesses on ia64. Here's a patch to address this (it is almost the same as the patch which was discussed in http://marc.theaimsgroup.com/?l=linux-netdev&m=109770128816605&w=2). In a quick throughput test, I found that this could improve throughput by ~30% on an Altix. diffstats: drivers/net/Kconfig | 13 +++++++++++++ drivers/net/tg3.c | 8 +++++++- 2 files changed, 20 insertions(+), 1 deletion(-) Signed-off-by: Arthur Kepner ===== drivers/net/Kconfig 1.97 vs edited ===== --- 1.97/drivers/net/Kconfig 2004-12-27 01:29:18 -08:00 +++ edited/drivers/net/Kconfig 2005-01-03 17:12:26 -08:00 @@ -2089,6 +2089,19 @@ config TIGON3 To compile this driver as a module, choose M here: the module will be called tg3. This is recommended. +config 5701_PCIX_IP_ALIGN + bool "align IP headers from 5701 cards in the driver (in PCI-X mode)" + depends on TIGON3 + help + IP headers from 5701 cards (in PCI-X mode only) are not aligned as + the TCP/IP stack expects. On some architectures (including ia64) + unaligned accesses are particularly expensive, and the performance + of 5701 cards in PCI-X mode suffers. Configuring 5701_PCIX_IP_ALIGN + causes the driver to copy packets so that the IP headers are + aligned. 5701_PCIX_IP_ALIGN only affects operation of the TIGON3 driver + when used with a 5701 card in PCI-X mode - other cards are unaffected + by this option. + config GIANFAR tristate "Gianfar Ethernet" depends on 85xx ===== drivers/net/tg3.c 1.222 vs edited ===== --- 1.222/drivers/net/tg3.c 2004-11-15 15:53:08 -08:00 +++ edited/drivers/net/tg3.c 2005-01-03 17:25:09 -08:00 @@ -2702,7 +2702,13 @@ static int tg3_rx(struct tg3 *tp, int bu len = ((desc->idx_len & RXD_LEN_MASK) >> RXD_LEN_SHIFT) - 4; /* omit crc */ - if (len > RX_COPY_THRESHOLD) { + if (len > RX_COPY_THRESHOLD +#ifdef CONFIG_5701_PCIX_IP_ALIGN + && tp->rx_offset == 2 + /* rx_offset != 2 iff this is a 5701 card running + * in PCI-X mode [see tg3_get_invariants()] */ +#endif + ) { int skb_size; skb_size = tg3_alloc_rx_skb(tp, opaque_key, -- Arthur From y030729@njupt.edu.cn Mon Jan 3 18:13:39 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 18:13:46 -0800 (PST) Received: from njupt.edu.cn (em.njupt.edu.cn [202.119.230.11]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j042DHah008208 for ; Mon, 3 Jan 2005 18:13:38 -0800 Received: (eyou send program); Tue, 04 Jan 2005 11:15:37 +0800 Message-ID: <304808537.11599@njupt.edu.cn> Received: from 10.10.136.115 by em.njupt.edu.cn with HTTP; Tue, 04 Jan 2005 11:15:37 +0800 X-WebMAIL-MUA: [10.10.136.115] From: "Zhenyu Wu" To: netdev@oss.sgi.com Cc: lartc@mailman.ds9a.nl Date: Tue, 04 Jan 2005 11:15:37 +0800 Reply-To: "Zhenyu Wu" X-Priority: 3 Subject: Scheduler Mechnisms! Content-Type: text/plain X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13365 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: y030729@njupt.edu.cn Precedence: bulk X-list: netdev Hello, Normally, in addition to such qdisc scheduler mechanisms as FIFO, PQ, WRR, WFQ, are there any more? Then, there is a confusion on scheduler in Linux enviroment: Assume there is a qdisc, such as RED as a leaf qdisc in a router, we know, if there is packet which want to enqueue the packet, the Function red_enqueue is called, but when the packet leave the queue(when the Function red_dequeue is called)? I think it is meaningless when the pack leaves the queue just it enterred it. Is there anything need to be done betweent the packet's enqueue and dequeue? Best, From akpm@osdl.org Mon Jan 3 19:10:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 19:10:45 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j043AFCU010514 for ; Mon, 3 Jan 2005 19:10:35 -0800 Received: from bix (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id j043Ii617056 for ; Mon, 3 Jan 2005 19:18:44 -0800 Date: Mon, 3 Jan 2005 19:18:36 -0800 From: Andrew Morton To: netdev@oss.sgi.com Subject: Fw: b44 ifconfig fails with ENOMEM Message-Id: <20050103191836.57f918e5.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Mon__3_Jan_2005_19_18_36_-0800_WFmoBQgWAKAe8uBv" X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13366 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --Multipart=_Mon__3_Jan_2005_19_18_36_-0800_WFmoBQgWAKAe8uBv Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit b44 requires an order-8 allocation? Good luck... Begin forwarded message: Date: Wed, 29 Dec 2004 05:57:28 +0100 From: Stefan Knoblich To: linux-kernel@vger.kernel.org Cc: pp@ee.oulu.fi Subject: b44 ifconfig fails with ENOMEM Hi, ifconfig eth0 192.168.1.2 up returns the following error message: laptop ~ # ifconfig eth0 192.168.1.2 up SIOCSIFFLAGS: Cannot allocate memory SIOCSIFFLAGS: Cannot allocate memory output of dmesg: ifconfig: page allocation failure. order:8, mode:0x21 [] __alloc_pages+0x1d2/0x3a0 [] __get_free_pages+0x1f/0x40 [] dma_alloc_coherent+0xca/0x100 [] b44_alloc_consistent+0xc7/0x1a0 [b44] [] b44_open+0x21/0xd0 [b44] [] schedule+0x2be/0x4e0 [] dev_open+0x85/0xa0 [] dev_change_flags+0x53/0x130 [] devinet_ioctl+0x257/0x5b0 [] inet_ioctl+0x66/0xb0 [] sock_ioctl+0xd9/0x2b0 [] sys_ioctl+0xd5/0x220 [] do_syscall_trace+0x47/0x90 [] syscall_call+0x7/0xb there's plenty of free memory available: laptop ~ # free total used free shared buffers cached Mem: 506320 499728 6592 0 20036 274712 -/+ buffers/cache: 204980 301340 Swap: 987988 3144 984844 unloading and reloading the module didn't help, only a reboot fixed it (after ~36hours uptime) the wlan nic (ipw2100) worked fine (i was abled to ifconfig down and up it again, add an ip alias...) more hardware information: Fujitsu-Siemens Amilo 7400M, Pentium-m 1500MHz, i855GM Chipset 0000:02:05.0 Ethernet controller: Broadcom Corporation BCM4401 100Base-T (rev 01) Subsystem: Wistron Corp.: Unknown device 1082 Flags: bus master, fast devsel, latency 64, IRQ 10 Memory at e0200000 (32-bit, non-prefetchable) Capabilities: [40] Power Management version 2 if you need more information, please tell me since it 2.6.9 worked fine, i guess the recent PCI DMA changes in b44.c may cause this problem stefan --Multipart=_Mon__3_Jan_2005_19_18_36_-0800_WFmoBQgWAKAe8uBv Content-Type: text/plain; name="config-2.6.10" Content-Disposition: attachment; filename="config-2.6.10" Content-Transfer-Encoding: 7bit # # Automatically generated make config: don't edit # Linux kernel version: 2.6.10 # Sun Dec 26 20:54:11 2004 # CONFIG_X86=y CONFIG_MMU=y CONFIG_UID16=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_IOMAP=y # # Code maturity level options # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y CONFIG_BROKEN_ON_SMP=y # # General setup # CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=14 CONFIG_HOTPLUG=y CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_ALL is not set # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SHMEM=y CONFIG_CC_ALIGN_FUNCTIONS=0 CONFIG_CC_ALIGN_LABELS=0 CONFIG_CC_ALIGN_LOOPS=0 CONFIG_CC_ALIGN_JUMPS=0 # CONFIG_TINY_SHMEM is not set # # Loadable module support # CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y CONFIG_OBSOLETE_MODPARM=y # CONFIG_MODVERSIONS is not set # CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y # # Processor type and features # CONFIG_X86_PC=y # CONFIG_X86_ELAN is not set # CONFIG_X86_VOYAGER is not set # CONFIG_X86_NUMAQ is not set # CONFIG_X86_SUMMIT is not set # CONFIG_X86_BIGSMP is not set # CONFIG_X86_VISWS is not set # CONFIG_X86_GENERICARCH is not set # CONFIG_X86_ES7000 is not set # CONFIG_M386 is not set # CONFIG_M486 is not set # CONFIG_M586 is not set # CONFIG_M586TSC is not set # CONFIG_M586MMX is not set # CONFIG_M686 is not set # CONFIG_MPENTIUMII is not set # CONFIG_MPENTIUMIII is not set CONFIG_MPENTIUMM=y # CONFIG_MPENTIUM4 is not set # CONFIG_MK6 is not set # CONFIG_MK7 is not set # CONFIG_MK8 is not set # CONFIG_MCRUSOE is not set # CONFIG_MEFFICEON is not set # CONFIG_MWINCHIPC6 is not set # CONFIG_MWINCHIP2 is not set # CONFIG_MWINCHIP3D is not set # CONFIG_MCYRIXIII is not set # CONFIG_MVIAC3_2 is not set # CONFIG_X86_GENERIC is not set CONFIG_X86_CMPXCHG=y CONFIG_X86_XADD=y CONFIG_X86_L1_CACHE_SHIFT=6 CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_X86_WP_WORKS_OK=y CONFIG_X86_INVLPG=y CONFIG_X86_BSWAP=y CONFIG_X86_POPAD_OK=y CONFIG_X86_GOOD_APIC=y CONFIG_X86_INTEL_USERCOPY=y CONFIG_X86_USE_PPRO_CHECKSUM=y CONFIG_HPET_TIMER=y CONFIG_HPET_EMULATE_RTC=y # CONFIG_SMP is not set # CONFIG_PREEMPT is not set CONFIG_X86_UP_APIC=y CONFIG_X86_UP_IOAPIC=y CONFIG_X86_LOCAL_APIC=y CONFIG_X86_IO_APIC=y CONFIG_X86_TSC=y CONFIG_X86_MCE=y CONFIG_X86_MCE_NONFATAL=y CONFIG_X86_MCE_P4THERMAL=y # CONFIG_TOSHIBA is not set # CONFIG_I8K is not set # CONFIG_MICROCODE is not set # CONFIG_X86_MSR is not set # CONFIG_X86_CPUID is not set # # Firmware Drivers # # CONFIG_EDD is not set CONFIG_NOHIGHMEM=y # CONFIG_HIGHMEM4G is not set # CONFIG_HIGHMEM64G is not set # CONFIG_MATH_EMULATION is not set CONFIG_MTRR=y # CONFIG_EFI is not set # CONFIG_REGPARM is not set # # Power management options (ACPI, APM) # CONFIG_PM=y # CONFIG_PM_DEBUG is not set # CONFIG_SOFTWARE_SUSPEND is not set # # ACPI (Advanced Configuration and Power Interface) Support # CONFIG_ACPI=y CONFIG_ACPI_BOOT=y CONFIG_ACPI_INTERPRETER=y CONFIG_ACPI_SLEEP=y CONFIG_ACPI_SLEEP_PROC_FS=y CONFIG_ACPI_AC=y CONFIG_ACPI_BATTERY=y CONFIG_ACPI_BUTTON=y CONFIG_ACPI_VIDEO=y CONFIG_ACPI_FAN=y CONFIG_ACPI_PROCESSOR=y CONFIG_ACPI_THERMAL=y # CONFIG_ACPI_ASUS is not set # CONFIG_ACPI_IBM is not set # CONFIG_ACPI_TOSHIBA is not set CONFIG_ACPI_BLACKLIST_YEAR=0 # CONFIG_ACPI_DEBUG is not set CONFIG_ACPI_BUS=y CONFIG_ACPI_EC=y CONFIG_ACPI_POWER=y CONFIG_ACPI_PCI=y CONFIG_ACPI_SYSTEM=y CONFIG_X86_PM_TIMER=y # # APM (Advanced Power Management) BIOS Support # # CONFIG_APM is not set # # CPU Frequency scaling # CONFIG_CPU_FREQ=y # CONFIG_CPU_FREQ_DEBUG is not set CONFIG_CPU_FREQ_PROC_INTF=m # CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y CONFIG_CPU_FREQ_GOV_PERFORMANCE=m CONFIG_CPU_FREQ_GOV_POWERSAVE=m CONFIG_CPU_FREQ_GOV_USERSPACE=y CONFIG_CPU_FREQ_24_API=y CONFIG_CPU_FREQ_GOV_ONDEMAND=m CONFIG_CPU_FREQ_TABLE=y # # CPUFreq processor drivers # CONFIG_X86_ACPI_CPUFREQ=m # CONFIG_X86_POWERNOW_K6 is not set # CONFIG_X86_POWERNOW_K7 is not set # CONFIG_X86_POWERNOW_K8 is not set # CONFIG_X86_GX_SUSPMOD is not set CONFIG_X86_SPEEDSTEP_CENTRINO=m CONFIG_X86_SPEEDSTEP_CENTRINO_ACPI=y CONFIG_X86_SPEEDSTEP_CENTRINO_TABLE=y CONFIG_X86_SPEEDSTEP_ICH=m # CONFIG_X86_SPEEDSTEP_SMI is not set # CONFIG_X86_P4_CLOCKMOD is not set # CONFIG_X86_CPUFREQ_NFORCE2 is not set # CONFIG_X86_LONGRUN is not set # CONFIG_X86_LONGHAUL is not set # # shared options # CONFIG_X86_ACPI_CPUFREQ_PROC_INTF=y CONFIG_X86_SPEEDSTEP_LIB=m CONFIG_X86_SPEEDSTEP_RELAXED_CAP_CHECK=y # # Bus options (PCI, PCMCIA, EISA, MCA, ISA) # CONFIG_PCI=y # CONFIG_PCI_GOBIOS is not set # CONFIG_PCI_GOMMCONFIG is not set # CONFIG_PCI_GODIRECT is not set CONFIG_PCI_GOANY=y CONFIG_PCI_BIOS=y CONFIG_PCI_DIRECT=y CONFIG_PCI_MMCONFIG=y # CONFIG_PCI_MSI is not set CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y CONFIG_ISA=y # CONFIG_EISA is not set # CONFIG_MCA is not set # CONFIG_SCx200 is not set # # PCCARD (PCMCIA/CardBus) support # CONFIG_PCCARD=m # CONFIG_PCMCIA_DEBUG is not set # CONFIG_PCMCIA_OBSOLETE is not set CONFIG_PCMCIA=m CONFIG_CARDBUS=y # # PC-card bridges # CONFIG_YENTA=m CONFIG_PD6729=m CONFIG_I82092=m CONFIG_I82365=m CONFIG_TCIC=m CONFIG_PCMCIA_PROBE=y # # PCI Hotplug Support # # CONFIG_HOTPLUG_PCI is not set # # Executable file formats # CONFIG_BINFMT_ELF=y CONFIG_BINFMT_AOUT=m CONFIG_BINFMT_MISC=m # # Device Drivers # # # Generic Driver Options # CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_FW_LOADER=y # CONFIG_DEBUG_DRIVER is not set # # Memory Technology Devices (MTD) # # CONFIG_MTD is not set # # Parallel port support # CONFIG_PARPORT=m CONFIG_PARPORT_PC=m CONFIG_PARPORT_PC_CML1=m # CONFIG_PARPORT_SERIAL is not set # CONFIG_PARPORT_PC_FIFO is not set # CONFIG_PARPORT_PC_SUPERIO is not set # CONFIG_PARPORT_PC_PCMCIA is not set CONFIG_PARPORT_OTHER=y CONFIG_PARPORT_1284=y # # Plug and Play support # CONFIG_PNP=y # CONFIG_PNP_DEBUG is not set # # Protocols # CONFIG_ISAPNP=y # CONFIG_PNPBIOS is not set CONFIG_PNPACPI=y # # Block devices # CONFIG_BLK_DEV_FD=y # CONFIG_BLK_DEV_XD is not set # CONFIG_PARIDE is not set # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set CONFIG_BLK_DEV_LOOP=m CONFIG_BLK_DEV_CRYPTOLOOP=m # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_SX8 is not set CONFIG_BLK_DEV_UB=m CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set # CONFIG_CDROM_PKTCDVD is not set # # IO Schedulers # CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y CONFIG_IOSCHED_CFQ=y # # ATA/ATAPI/MFM/RLL support # CONFIG_IDE=y CONFIG_BLK_DEV_IDE=y # # Please see Documentation/ide.txt for help/info on IDE drives # # CONFIG_BLK_DEV_IDE_SATA is not set # CONFIG_BLK_DEV_HD_IDE is not set CONFIG_BLK_DEV_IDEDISK=y CONFIG_IDEDISK_MULTI_MODE=y # CONFIG_BLK_DEV_IDECS is not set CONFIG_BLK_DEV_IDECD=y # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set CONFIG_BLK_DEV_IDESCSI=m # CONFIG_IDE_TASK_IOCTL is not set # # IDE chipset support/bugfixes # CONFIG_IDE_GENERIC=y # CONFIG_BLK_DEV_CMD640 is not set # CONFIG_BLK_DEV_IDEPNP is not set CONFIG_BLK_DEV_IDEPCI=y CONFIG_IDEPCI_SHARE_IRQ=y # CONFIG_BLK_DEV_OFFBOARD is not set CONFIG_BLK_DEV_GENERIC=y # CONFIG_BLK_DEV_OPTI621 is not set # CONFIG_BLK_DEV_RZ1000 is not set CONFIG_BLK_DEV_IDEDMA_PCI=y # CONFIG_BLK_DEV_IDEDMA_FORCED is not set CONFIG_IDEDMA_PCI_AUTO=y # CONFIG_IDEDMA_ONLYDISK is not set # CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_ALI15X3 is not set # CONFIG_BLK_DEV_AMD74XX is not set # CONFIG_BLK_DEV_ATIIXP is not set # CONFIG_BLK_DEV_CMD64X is not set # CONFIG_BLK_DEV_TRIFLEX is not set # CONFIG_BLK_DEV_CY82C693 is not set # CONFIG_BLK_DEV_CS5520 is not set # CONFIG_BLK_DEV_CS5530 is not set # CONFIG_BLK_DEV_HPT34X is not set # CONFIG_BLK_DEV_HPT366 is not set # CONFIG_BLK_DEV_SC1200 is not set CONFIG_BLK_DEV_PIIX=y # CONFIG_BLK_DEV_NS87415 is not set # CONFIG_BLK_DEV_PDC202XX_OLD is not set # CONFIG_BLK_DEV_PDC202XX_NEW is not set # CONFIG_BLK_DEV_SVWKS is not set # CONFIG_BLK_DEV_SIIMAGE is not set # CONFIG_BLK_DEV_SIS5513 is not set # CONFIG_BLK_DEV_SLC90E66 is not set # CONFIG_BLK_DEV_TRM290 is not set # CONFIG_BLK_DEV_VIA82CXXX is not set # CONFIG_IDE_ARM is not set # CONFIG_IDE_CHIPSETS is not set CONFIG_BLK_DEV_IDEDMA=y # CONFIG_IDEDMA_IVB is not set CONFIG_IDEDMA_AUTO=y # CONFIG_BLK_DEV_HD is not set # # SCSI device support # CONFIG_SCSI=y CONFIG_SCSI_PROC_FS=y # # SCSI support type (disk, tape, CD-ROM) # CONFIG_BLK_DEV_SD=m # CONFIG_CHR_DEV_ST is not set # CONFIG_CHR_DEV_OSST is not set CONFIG_BLK_DEV_SR=m CONFIG_BLK_DEV_SR_VENDOR=y CONFIG_CHR_DEV_SG=m # # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # # CONFIG_SCSI_MULTI_LUN is not set # CONFIG_SCSI_CONSTANTS is not set # CONFIG_SCSI_LOGGING is not set # # SCSI Transport Attributes # # CONFIG_SCSI_SPI_ATTRS is not set # CONFIG_SCSI_FC_ATTRS is not set # # SCSI low-level drivers # # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_7000FASST is not set # CONFIG_SCSI_ACARD is not set # CONFIG_SCSI_AHA152X is not set # CONFIG_SCSI_AHA1542 is not set # CONFIG_SCSI_AACRAID is not set # CONFIG_SCSI_AIC7XXX is not set # CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC79XX is not set # CONFIG_SCSI_DPT_I2O is not set # CONFIG_SCSI_IN2000 is not set # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_DTC3280 is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_EATA_PIO is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_GENERIC_NCR5380 is not set # CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set # CONFIG_SCSI_IPS is not set # CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_PPA is not set # CONFIG_SCSI_IMM is not set # CONFIG_SCSI_NCR53C406A is not set # CONFIG_SCSI_SYM53C8XX_2 is not set # CONFIG_SCSI_IPR is not set # CONFIG_SCSI_PAS16 is not set # CONFIG_SCSI_PSI240I is not set # CONFIG_SCSI_QLOGIC_FAS is not set # CONFIG_SCSI_QLOGIC_ISP is not set # CONFIG_SCSI_QLOGIC_FC is not set # CONFIG_SCSI_QLOGIC_1280 is not set CONFIG_SCSI_QLA2XXX=y # CONFIG_SCSI_QLA21XX is not set # CONFIG_SCSI_QLA22XX is not set # CONFIG_SCSI_QLA2300 is not set # CONFIG_SCSI_QLA2322 is not set # CONFIG_SCSI_QLA6312 is not set # CONFIG_SCSI_QLA6322 is not set # CONFIG_SCSI_SYM53C416 is not set # CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_T128 is not set # CONFIG_SCSI_U14_34F is not set # CONFIG_SCSI_ULTRASTOR is not set # CONFIG_SCSI_NSP32 is not set # CONFIG_SCSI_DEBUG is not set # # PCMCIA SCSI adapter support # # CONFIG_PCMCIA_AHA152X is not set # CONFIG_PCMCIA_FDOMAIN is not set # CONFIG_PCMCIA_NINJA_SCSI is not set # CONFIG_PCMCIA_QLOGIC is not set # CONFIG_PCMCIA_SYM53C500 is not set # # Old CD-ROM drivers (not SCSI, not IDE) # # CONFIG_CD_NO_IDESCSI is not set # # Multi-device support (RAID and LVM) # CONFIG_MD=y CONFIG_BLK_DEV_MD=m CONFIG_MD_LINEAR=m CONFIG_MD_RAID0=m CONFIG_MD_RAID1=m CONFIG_MD_RAID10=m CONFIG_MD_RAID5=m CONFIG_MD_RAID6=m CONFIG_MD_MULTIPATH=m CONFIG_MD_FAULTY=m CONFIG_BLK_DEV_DM=y CONFIG_DM_CRYPT=y CONFIG_DM_SNAPSHOT=y CONFIG_DM_MIRROR=y CONFIG_DM_ZERO=y # # Fusion MPT device support # # CONFIG_FUSION is not set # # IEEE 1394 (FireWire) support # CONFIG_IEEE1394=y # # Subsystem Options # # CONFIG_IEEE1394_VERBOSEDEBUG is not set CONFIG_IEEE1394_OUI_DB=y CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y CONFIG_IEEE1394_CONFIG_ROM_IP1394=y # # Device Drivers # # CONFIG_IEEE1394_PCILYNX is not set CONFIG_IEEE1394_OHCI1394=m # # Protocol Drivers # CONFIG_IEEE1394_VIDEO1394=m CONFIG_IEEE1394_SBP2=m # CONFIG_IEEE1394_SBP2_PHYS_DMA is not set CONFIG_IEEE1394_ETH1394=m CONFIG_IEEE1394_DV1394=m CONFIG_IEEE1394_RAWIO=m CONFIG_IEEE1394_CMP=m CONFIG_IEEE1394_AMDTP=m # # I2O device support # # CONFIG_I2O is not set # # Networking support # CONFIG_NET=y # # Networking options # CONFIG_PACKET=y CONFIG_PACKET_MMAP=y CONFIG_NETLINK_DEV=m CONFIG_UNIX=y CONFIG_NET_KEY=m CONFIG_INET=y CONFIG_IP_MULTICAST=y # CONFIG_IP_ADVANCED_ROUTER is not set # CONFIG_IP_PNP is not set CONFIG_NET_IPIP=m CONFIG_NET_IPGRE=m CONFIG_NET_IPGRE_BROADCAST=y CONFIG_IP_MROUTE=y CONFIG_IP_PIMSM_V1=y CONFIG_IP_PIMSM_V2=y # CONFIG_ARPD is not set CONFIG_SYN_COOKIES=y CONFIG_INET_AH=m CONFIG_INET_ESP=m CONFIG_INET_IPCOMP=m CONFIG_INET_TUNNEL=m CONFIG_IP_TCPDIAG=y # CONFIG_IP_TCPDIAG_IPV6 is not set # # IP: Virtual Server Configuration # # CONFIG_IP_VS is not set CONFIG_IPV6=m CONFIG_IPV6_PRIVACY=y CONFIG_INET6_AH=m CONFIG_INET6_ESP=m CONFIG_INET6_IPCOMP=m CONFIG_INET6_TUNNEL=m CONFIG_IPV6_TUNNEL=m CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set CONFIG_BRIDGE_NETFILTER=y # # IP: Netfilter Configuration # CONFIG_IP_NF_CONNTRACK=y # CONFIG_IP_NF_CT_ACCT is not set # CONFIG_IP_NF_CONNTRACK_MARK is not set # CONFIG_IP_NF_CT_PROTO_SCTP is not set # CONFIG_IP_NF_FTP is not set # CONFIG_IP_NF_IRC is not set # CONFIG_IP_NF_TFTP is not set # CONFIG_IP_NF_AMANDA is not set CONFIG_IP_NF_QUEUE=y CONFIG_IP_NF_IPTABLES=y CONFIG_IP_NF_MATCH_LIMIT=y CONFIG_IP_NF_MATCH_IPRANGE=y CONFIG_IP_NF_MATCH_MAC=y CONFIG_IP_NF_MATCH_PKTTYPE=y CONFIG_IP_NF_MATCH_MARK=y CONFIG_IP_NF_MATCH_MULTIPORT=y CONFIG_IP_NF_MATCH_TOS=y CONFIG_IP_NF_MATCH_RECENT=y CONFIG_IP_NF_MATCH_ECN=y CONFIG_IP_NF_MATCH_DSCP=y CONFIG_IP_NF_MATCH_AH_ESP=y CONFIG_IP_NF_MATCH_LENGTH=y CONFIG_IP_NF_MATCH_TTL=y CONFIG_IP_NF_MATCH_TCPMSS=y CONFIG_IP_NF_MATCH_HELPER=y CONFIG_IP_NF_MATCH_STATE=y CONFIG_IP_NF_MATCH_CONNTRACK=y CONFIG_IP_NF_MATCH_OWNER=y # CONFIG_IP_NF_MATCH_PHYSDEV is not set CONFIG_IP_NF_MATCH_ADDRTYPE=y CONFIG_IP_NF_MATCH_REALM=y # CONFIG_IP_NF_MATCH_SCTP is not set CONFIG_IP_NF_MATCH_COMMENT=y # CONFIG_IP_NF_MATCH_HASHLIMIT is not set CONFIG_IP_NF_FILTER=y CONFIG_IP_NF_TARGET_REJECT=y CONFIG_IP_NF_TARGET_LOG=y CONFIG_IP_NF_TARGET_ULOG=y CONFIG_IP_NF_TARGET_TCPMSS=y CONFIG_IP_NF_NAT=y CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=y CONFIG_IP_NF_TARGET_REDIRECT=y CONFIG_IP_NF_TARGET_NETMAP=y CONFIG_IP_NF_TARGET_SAME=y # CONFIG_IP_NF_NAT_LOCAL is not set # CONFIG_IP_NF_NAT_SNMP_BASIC is not set CONFIG_IP_NF_MANGLE=y CONFIG_IP_NF_TARGET_TOS=y CONFIG_IP_NF_TARGET_ECN=y CONFIG_IP_NF_TARGET_DSCP=y CONFIG_IP_NF_TARGET_MARK=y CONFIG_IP_NF_TARGET_CLASSIFY=y # CONFIG_IP_NF_RAW is not set CONFIG_IP_NF_ARPTABLES=y CONFIG_IP_NF_ARPFILTER=y CONFIG_IP_NF_ARP_MANGLE=y # # IPv6: Netfilter Configuration # # CONFIG_IP6_NF_QUEUE is not set # CONFIG_IP6_NF_IPTABLES is not set # # Bridge: Netfilter Configuration # # CONFIG_BRIDGE_NF_EBTABLES is not set CONFIG_XFRM=y CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) # # CONFIG_IP_SCTP is not set # CONFIG_ATM is not set CONFIG_BRIDGE=m CONFIG_VLAN_8021Q=m # CONFIG_DECNET is not set # CONFIG_LLC2 is not set # CONFIG_IPX is not set # CONFIG_ATALK is not set # CONFIG_X25 is not set # CONFIG_LAPB is not set # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set # # QoS and/or fair queueing # CONFIG_NET_SCHED=y CONFIG_NET_SCH_CLK_JIFFIES=y # CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set # CONFIG_NET_SCH_CLK_CPU is not set CONFIG_NET_SCH_CBQ=m CONFIG_NET_SCH_HTB=m CONFIG_NET_SCH_HFSC=m CONFIG_NET_SCH_PRIO=m CONFIG_NET_SCH_RED=m CONFIG_NET_SCH_SFQ=m CONFIG_NET_SCH_TEQL=m CONFIG_NET_SCH_TBF=m CONFIG_NET_SCH_GRED=m CONFIG_NET_SCH_DSMARK=m CONFIG_NET_SCH_NETEM=m CONFIG_NET_SCH_INGRESS=m CONFIG_NET_QOS=y CONFIG_NET_ESTIMATOR=y CONFIG_NET_CLS=y CONFIG_NET_CLS_TCINDEX=m CONFIG_NET_CLS_ROUTE4=m CONFIG_NET_CLS_ROUTE=y CONFIG_NET_CLS_FW=m CONFIG_NET_CLS_U32=m # CONFIG_CLS_U32_PERF is not set # CONFIG_NET_CLS_IND is not set CONFIG_NET_CLS_RSVP=m CONFIG_NET_CLS_RSVP6=m # CONFIG_NET_CLS_ACT is not set CONFIG_NET_CLS_POLICE=y # # Network testing # # CONFIG_NET_PKTGEN is not set # CONFIG_NETPOLL is not set # CONFIG_NET_POLL_CONTROLLER is not set # CONFIG_HAMRADIO is not set CONFIG_IRDA=m # # IrDA protocols # CONFIG_IRLAN=m # CONFIG_IRNET is not set CONFIG_IRCOMM=m CONFIG_IRDA_ULTRA=y # # IrDA options # CONFIG_IRDA_CACHE_LAST_LSAP=y CONFIG_IRDA_FAST_RR=y # CONFIG_IRDA_DEBUG is not set # # Infrared-port device drivers # # # SIR device drivers # CONFIG_IRTTY_SIR=m # # Dongle support # # CONFIG_DONGLE is not set # # Old SIR device drivers # CONFIG_IRPORT_SIR=m # # Old Serial dongle support # # CONFIG_DONGLE_OLD is not set # # FIR device drivers # # CONFIG_USB_IRDA is not set CONFIG_SIGMATEL_FIR=m CONFIG_NSC_FIR=m CONFIG_WINBOND_FIR=m CONFIG_TOSHIBA_FIR=m CONFIG_SMC_IRCC_FIR=m CONFIG_ALI_FIR=m CONFIG_VLSI_FIR=m CONFIG_VIA_FIR=m CONFIG_BT=m CONFIG_BT_L2CAP=m CONFIG_BT_SCO=m CONFIG_BT_RFCOMM=m CONFIG_BT_RFCOMM_TTY=y CONFIG_BT_BNEP=m CONFIG_BT_BNEP_MC_FILTER=y CONFIG_BT_BNEP_PROTO_FILTER=y CONFIG_BT_HIDP=m # # Bluetooth device drivers # CONFIG_BT_HCIUSB=m CONFIG_BT_HCIUSB_SCO=y CONFIG_BT_HCIUART=m CONFIG_BT_HCIUART_H4=y CONFIG_BT_HCIUART_BCSP=y # CONFIG_BT_HCIUART_BCSP_TXCRC is not set CONFIG_BT_HCIBCM203X=m CONFIG_BT_HCIBFUSB=m # CONFIG_BT_HCIDTL1 is not set # CONFIG_BT_HCIBT3C is not set # CONFIG_BT_HCIBLUECARD is not set # CONFIG_BT_HCIBTUART is not set CONFIG_BT_HCIVHCI=m CONFIG_NETDEVICES=y CONFIG_DUMMY=m # CONFIG_BONDING is not set # CONFIG_EQUALIZER is not set CONFIG_TUN=m # CONFIG_ETHERTAP is not set # CONFIG_NET_SB1000 is not set # # ARCnet devices # # CONFIG_ARCNET is not set # # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y CONFIG_MII=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set # CONFIG_NET_VENDOR_3COM is not set # CONFIG_LANCE is not set # CONFIG_NET_VENDOR_SMC is not set # CONFIG_NET_VENDOR_RACAL is not set # # Tulip family network device support # # CONFIG_NET_TULIP is not set # CONFIG_AT1700 is not set # CONFIG_DEPCA is not set # CONFIG_HP100 is not set # CONFIG_NET_ISA is not set CONFIG_NET_PCI=y # CONFIG_PCNET32 is not set # CONFIG_AMD8111_ETH is not set # CONFIG_ADAPTEC_STARFIRE is not set # CONFIG_AC3200 is not set # CONFIG_APRICOT is not set CONFIG_B44=m # CONFIG_FORCEDETH is not set # CONFIG_CS89x0 is not set # CONFIG_DGRS is not set # CONFIG_EEPRO100 is not set # CONFIG_E100 is not set # CONFIG_FEALNX is not set # CONFIG_NATSEMI is not set # CONFIG_NE2K_PCI is not set # CONFIG_8139CP is not set # CONFIG_8139TOO is not set # CONFIG_SIS900 is not set # CONFIG_EPIC100 is not set # CONFIG_SUNDANCE is not set # CONFIG_TLAN is not set # CONFIG_VIA_RHINE is not set # CONFIG_NET_POCKET is not set # # Ethernet (1000 Mbit) # # CONFIG_ACENIC is not set # CONFIG_DL2K is not set # CONFIG_E1000 is not set # CONFIG_NS83820 is not set # CONFIG_HAMACHI is not set # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SK98LIN is not set # CONFIG_VIA_VELOCITY is not set # CONFIG_TIGON3 is not set # # Ethernet (10000 Mbit) # # CONFIG_IXGB is not set # CONFIG_S2IO is not set # # Token Ring devices # # CONFIG_TR is not set # # Wireless LAN (non-hamradio) # CONFIG_NET_RADIO=y # # Obsolete Wireless cards support (pre-802.11) # # CONFIG_STRIP is not set # CONFIG_ARLAN is not set # CONFIG_WAVELAN is not set # CONFIG_PCMCIA_WAVELAN is not set # CONFIG_PCMCIA_NETWAVE is not set # # Wireless 802.11 Frequency Hopping cards support # # CONFIG_PCMCIA_RAYCS is not set # # Wireless 802.11b ISA/PCI cards support # # CONFIG_AIRO is not set CONFIG_HERMES=m # CONFIG_PLX_HERMES is not set # CONFIG_TMD_HERMES is not set # CONFIG_PCI_HERMES is not set CONFIG_ATMEL=m # CONFIG_PCI_ATMEL is not set # # Wireless 802.11b Pcmcia/Cardbus cards support # # CONFIG_PCMCIA_HERMES is not set # CONFIG_AIRO_CS is not set # CONFIG_PCMCIA_ATMEL is not set # CONFIG_PCMCIA_WL3501 is not set # # Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support # CONFIG_PRISM54=m CONFIG_NET_WIRELESS=y # # PCMCIA network device support # # CONFIG_NET_PCMCIA is not set # # Wan interfaces # # CONFIG_WAN is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set # CONFIG_PLIP is not set CONFIG_PPP=m CONFIG_PPP_MULTILINK=y CONFIG_PPP_FILTER=y CONFIG_PPP_ASYNC=m CONFIG_PPP_SYNC_TTY=m CONFIG_PPP_DEFLATE=m CONFIG_PPP_BSDCOMP=m CONFIG_PPPOE=m # CONFIG_SLIP is not set # CONFIG_NET_FC is not set # CONFIG_SHAPER is not set # CONFIG_NETCONSOLE is not set # # ISDN subsystem # # CONFIG_ISDN is not set # # Telephony Support # # CONFIG_PHONE is not set # # Input device support # CONFIG_INPUT=y # # Userland interfaces # CONFIG_INPUT_MOUSEDEV=y CONFIG_INPUT_MOUSEDEV_PSAUX=y CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 # CONFIG_INPUT_JOYDEV is not set # CONFIG_INPUT_TSDEV is not set CONFIG_INPUT_EVDEV=m # CONFIG_INPUT_EVBUG is not set # # Input I/O drivers # # CONFIG_GAMEPORT is not set CONFIG_SOUND_GAMEPORT=y CONFIG_SERIO=y CONFIG_SERIO_I8042=y # CONFIG_SERIO_SERPORT is not set # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PARKBD is not set CONFIG_SERIO_PCIPS2=y # CONFIG_SERIO_RAW is not set # # Input Device Drivers # CONFIG_INPUT_KEYBOARD=y CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_SUNKBD is not set # CONFIG_KEYBOARD_LKKBD is not set # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_NEWTON is not set CONFIG_INPUT_MOUSE=y CONFIG_MOUSE_PS2=y # CONFIG_MOUSE_SERIAL is not set # CONFIG_MOUSE_INPORT is not set # CONFIG_MOUSE_LOGIBM is not set # CONFIG_MOUSE_PC110PAD is not set # CONFIG_MOUSE_VSXXXAA is not set # CONFIG_INPUT_JOYSTICK is not set # CONFIG_INPUT_TOUCHSCREEN is not set CONFIG_INPUT_MISC=y CONFIG_INPUT_PCSPKR=y CONFIG_INPUT_UINPUT=m # # Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_HW_CONSOLE=y # CONFIG_SERIAL_NONSTANDARD is not set # # Serial drivers # CONFIG_SERIAL_8250=y # CONFIG_SERIAL_8250_CONSOLE is not set # CONFIG_SERIAL_8250_CS is not set CONFIG_SERIAL_8250_ACPI=y CONFIG_SERIAL_8250_NR_UARTS=4 # CONFIG_SERIAL_8250_EXTENDED is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 CONFIG_PRINTER=m # CONFIG_LP_CONSOLE is not set CONFIG_PPDEV=m CONFIG_TIPAR=m # # IPMI # # CONFIG_IPMI_HANDLER is not set # # Watchdog Cards # # CONFIG_WATCHDOG is not set CONFIG_HW_RANDOM=m # CONFIG_NVRAM is not set CONFIG_RTC=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set # CONFIG_SONYPI is not set # # Ftape, the floppy tape device driver # # CONFIG_FTAPE is not set CONFIG_AGP=m # CONFIG_AGP_ALI is not set # CONFIG_AGP_ATI is not set # CONFIG_AGP_AMD is not set # CONFIG_AGP_AMD64 is not set CONFIG_AGP_INTEL=m CONFIG_AGP_INTEL_MCH=m # CONFIG_AGP_NVIDIA is not set # CONFIG_AGP_SIS is not set # CONFIG_AGP_SWORKS is not set # CONFIG_AGP_VIA is not set # CONFIG_AGP_EFFICEON is not set CONFIG_DRM=y # CONFIG_DRM_TDFX is not set # CONFIG_DRM_R128 is not set # CONFIG_DRM_RADEON is not set # CONFIG_DRM_I810 is not set # CONFIG_DRM_I830 is not set # CONFIG_DRM_I915 is not set # CONFIG_DRM_MGA is not set # CONFIG_DRM_SIS is not set # # PCMCIA character devices # # CONFIG_SYNCLINK_CS is not set # CONFIG_MWAVE is not set # CONFIG_RAW_DRIVER is not set # CONFIG_HPET is not set # CONFIG_HANGCHECK_TIMER is not set # # I2C support # CONFIG_I2C=m CONFIG_I2C_CHARDEV=m # # I2C Algorithms # CONFIG_I2C_ALGOBIT=m CONFIG_I2C_ALGOPCF=m # CONFIG_I2C_ALGOPCA is not set # # I2C Hardware Bus support # # CONFIG_I2C_ALI1535 is not set # CONFIG_I2C_ALI1563 is not set # CONFIG_I2C_ALI15X3 is not set # CONFIG_I2C_AMD756 is not set # CONFIG_I2C_AMD8111 is not set # CONFIG_I2C_ELEKTOR is not set CONFIG_I2C_I801=m CONFIG_I2C_I810=m CONFIG_I2C_ISA=m # CONFIG_I2C_NFORCE2 is not set # CONFIG_I2C_PARPORT is not set # CONFIG_I2C_PARPORT_LIGHT is not set # CONFIG_I2C_PIIX4 is not set # CONFIG_I2C_PROSAVAGE is not set # CONFIG_I2C_SAVAGE4 is not set # CONFIG_SCx200_ACB is not set # CONFIG_I2C_SIS5595 is not set # CONFIG_I2C_SIS630 is not set # CONFIG_I2C_SIS96X is not set # CONFIG_I2C_STUB is not set # CONFIG_I2C_VIA is not set # CONFIG_I2C_VIAPRO is not set # CONFIG_I2C_VOODOO3 is not set # CONFIG_I2C_PCA_ISA is not set # # Hardware Sensors Chip support # CONFIG_I2C_SENSOR=m CONFIG_SENSORS_ADM1021=m CONFIG_SENSORS_ADM1025=m CONFIG_SENSORS_ADM1026=m CONFIG_SENSORS_ADM1031=m CONFIG_SENSORS_ASB100=m CONFIG_SENSORS_DS1621=m CONFIG_SENSORS_FSCHER=m CONFIG_SENSORS_GL518SM=m CONFIG_SENSORS_IT87=m CONFIG_SENSORS_LM63=m CONFIG_SENSORS_LM75=m CONFIG_SENSORS_LM77=m CONFIG_SENSORS_LM78=m CONFIG_SENSORS_LM80=m CONFIG_SENSORS_LM83=m CONFIG_SENSORS_LM85=m CONFIG_SENSORS_LM87=m CONFIG_SENSORS_LM90=m CONFIG_SENSORS_MAX1619=m CONFIG_SENSORS_PC87360=m CONFIG_SENSORS_SMSC47M1=m CONFIG_SENSORS_VIA686A=m CONFIG_SENSORS_W83781D=m CONFIG_SENSORS_W83L785TS=m CONFIG_SENSORS_W83627HF=m # # Other I2C Chip support # CONFIG_SENSORS_EEPROM=m # CONFIG_SENSORS_PCF8574 is not set # CONFIG_SENSORS_PCF8591 is not set # CONFIG_SENSORS_RTC8564 is not set # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set # CONFIG_I2C_DEBUG_CHIP is not set # # Dallas's 1-wire bus # # CONFIG_W1 is not set # # Misc devices # # CONFIG_IBM_ASM is not set # # Multimedia devices # CONFIG_VIDEO_DEV=m # # Video For Linux # # # Video Adapters # # CONFIG_VIDEO_BT848 is not set # CONFIG_VIDEO_PMS is not set # CONFIG_VIDEO_BWQCAM is not set # CONFIG_VIDEO_CQCAM is not set # CONFIG_VIDEO_W9966 is not set # CONFIG_VIDEO_CPIA is not set # CONFIG_VIDEO_SAA5246A is not set # CONFIG_VIDEO_SAA5249 is not set # CONFIG_TUNER_3036 is not set # CONFIG_VIDEO_STRADIS is not set # CONFIG_VIDEO_ZORAN is not set # CONFIG_VIDEO_SAA7134 is not set # CONFIG_VIDEO_MXB is not set # CONFIG_VIDEO_DPC is not set # CONFIG_VIDEO_HEXIUM_ORION is not set # CONFIG_VIDEO_HEXIUM_GEMINI is not set # CONFIG_VIDEO_CX88 is not set # CONFIG_VIDEO_OVCAMCHIP is not set # # Radio Adapters # # CONFIG_RADIO_CADET is not set # CONFIG_RADIO_RTRACK is not set # CONFIG_RADIO_RTRACK2 is not set # CONFIG_RADIO_AZTECH is not set # CONFIG_RADIO_GEMTEK is not set # CONFIG_RADIO_GEMTEK_PCI is not set # CONFIG_RADIO_MAXIRADIO is not set # CONFIG_RADIO_MAESTRO is not set # CONFIG_RADIO_SF16FMI is not set # CONFIG_RADIO_SF16FMR2 is not set # CONFIG_RADIO_TERRATEC is not set # CONFIG_RADIO_TRUST is not set # CONFIG_RADIO_TYPHOON is not set # CONFIG_RADIO_ZOLTRIX is not set # # Digital Video Broadcasting Devices # # CONFIG_DVB is not set # # Graphics support # CONFIG_FB=y CONFIG_FB_MODE_HELPERS=y # CONFIG_FB_TILEBLITTING is not set # CONFIG_FB_CIRRUS is not set # CONFIG_FB_PM2 is not set # CONFIG_FB_CYBER2000 is not set # CONFIG_FB_ASILIANT is not set # CONFIG_FB_IMSTT is not set # CONFIG_FB_VGA16 is not set CONFIG_FB_VESA=y CONFIG_VIDEO_SELECT=y # CONFIG_FB_HGA is not set # CONFIG_FB_RIVA is not set # CONFIG_FB_I810 is not set # CONFIG_FB_INTEL is not set # CONFIG_FB_MATROX is not set # CONFIG_FB_RADEON_OLD is not set # CONFIG_FB_RADEON is not set # CONFIG_FB_ATY128 is not set # CONFIG_FB_ATY is not set # CONFIG_FB_SAVAGE is not set # CONFIG_FB_SIS is not set # CONFIG_FB_NEOMAGIC is not set # CONFIG_FB_KYRO is not set # CONFIG_FB_3DFX is not set # CONFIG_FB_VOODOO1 is not set # CONFIG_FB_TRIDENT is not set # CONFIG_FB_VIRTUAL is not set # # Console display driver support # CONFIG_VGA_CONSOLE=y # CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y # CONFIG_FONTS is not set CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y # # Logo configuration # CONFIG_LOGO=y CONFIG_LOGO_LINUX_MONO=y CONFIG_LOGO_LINUX_VGA16=y CONFIG_LOGO_LINUX_CLUT224=y # # Sound # CONFIG_SOUND=m # # Advanced Linux Sound Architecture # CONFIG_SND=m CONFIG_SND_TIMER=m CONFIG_SND_PCM=m CONFIG_SND_SEQUENCER=m # CONFIG_SND_SEQ_DUMMY is not set CONFIG_SND_OSSEMUL=y CONFIG_SND_MIXER_OSS=m CONFIG_SND_PCM_OSS=m CONFIG_SND_SEQUENCER_OSS=y CONFIG_SND_RTCTIMER=m # CONFIG_SND_VERBOSE_PRINTK is not set # CONFIG_SND_DEBUG is not set # # Generic devices # # CONFIG_SND_DUMMY is not set # CONFIG_SND_VIRMIDI is not set # CONFIG_SND_MTPAV is not set # CONFIG_SND_SERIAL_U16550 is not set # CONFIG_SND_MPU401 is not set # # ISA devices # # CONFIG_SND_AD1816A is not set # CONFIG_SND_AD1848 is not set # CONFIG_SND_CS4231 is not set # CONFIG_SND_CS4232 is not set # CONFIG_SND_CS4236 is not set # CONFIG_SND_ES968 is not set # CONFIG_SND_ES1688 is not set # CONFIG_SND_ES18XX is not set # CONFIG_SND_GUSCLASSIC is not set # CONFIG_SND_GUSEXTREME is not set # CONFIG_SND_GUSMAX is not set # CONFIG_SND_INTERWAVE is not set # CONFIG_SND_INTERWAVE_STB is not set # CONFIG_SND_OPTI92X_AD1848 is not set # CONFIG_SND_OPTI92X_CS4231 is not set # CONFIG_SND_OPTI93X is not set # CONFIG_SND_SB8 is not set # CONFIG_SND_SB16 is not set # CONFIG_SND_SBAWE is not set # CONFIG_SND_WAVEFRONT is not set # CONFIG_SND_ALS100 is not set # CONFIG_SND_AZT2320 is not set # CONFIG_SND_CMI8330 is not set # CONFIG_SND_DT019X is not set # CONFIG_SND_OPL3SA2 is not set # CONFIG_SND_SGALAXY is not set # CONFIG_SND_SSCAPE is not set # # PCI devices # CONFIG_SND_AC97_CODEC=m # CONFIG_SND_ALI5451 is not set # CONFIG_SND_ATIIXP is not set # CONFIG_SND_ATIIXP_MODEM is not set # CONFIG_SND_AU8810 is not set # CONFIG_SND_AU8820 is not set # CONFIG_SND_AU8830 is not set # CONFIG_SND_AZT3328 is not set # CONFIG_SND_BT87X is not set # CONFIG_SND_CS46XX is not set # CONFIG_SND_CS4281 is not set # CONFIG_SND_EMU10K1 is not set # CONFIG_SND_KORG1212 is not set # CONFIG_SND_MIXART is not set # CONFIG_SND_NM256 is not set # CONFIG_SND_RME32 is not set # CONFIG_SND_RME96 is not set # CONFIG_SND_RME9652 is not set # CONFIG_SND_HDSP is not set # CONFIG_SND_TRIDENT is not set # CONFIG_SND_YMFPCI is not set # CONFIG_SND_ALS4000 is not set # CONFIG_SND_CMIPCI is not set # CONFIG_SND_ENS1370 is not set # CONFIG_SND_ENS1371 is not set # CONFIG_SND_ES1938 is not set # CONFIG_SND_ES1968 is not set # CONFIG_SND_MAESTRO3 is not set # CONFIG_SND_FM801 is not set # CONFIG_SND_ICE1712 is not set # CONFIG_SND_ICE1724 is not set CONFIG_SND_INTEL8X0=m # CONFIG_SND_INTEL8X0M is not set # CONFIG_SND_SONICVIBES is not set # CONFIG_SND_VIA82XX is not set # CONFIG_SND_VX222 is not set # # USB devices # # CONFIG_SND_USB_AUDIO is not set # CONFIG_SND_USB_USX2Y is not set # # PCMCIA devices # # CONFIG_SND_VXPOCKET is not set # CONFIG_SND_VXP440 is not set # CONFIG_SND_PDAUDIOCF is not set # # Open Sound System # CONFIG_SOUND_PRIME=m # CONFIG_SOUND_BT878 is not set # CONFIG_SOUND_CMPCI is not set # CONFIG_SOUND_EMU10K1 is not set # CONFIG_SOUND_FUSION is not set # CONFIG_SOUND_CS4281 is not set # CONFIG_SOUND_ES1370 is not set # CONFIG_SOUND_ES1371 is not set # CONFIG_SOUND_ESSSOLO1 is not set # CONFIG_SOUND_MAESTRO is not set # CONFIG_SOUND_MAESTRO3 is not set CONFIG_SOUND_ICH=m # CONFIG_SOUND_SONICVIBES is not set # CONFIG_SOUND_TRIDENT is not set # CONFIG_SOUND_MSNDCLAS is not set # CONFIG_SOUND_MSNDPIN is not set # CONFIG_SOUND_VIA82CXXX is not set # CONFIG_SOUND_OSS is not set # CONFIG_SOUND_TVMIXER is not set # CONFIG_SOUND_ALI5455 is not set # CONFIG_SOUND_FORTE is not set # CONFIG_SOUND_RME96XX is not set # CONFIG_SOUND_AD1980 is not set # # USB support # CONFIG_USB=y # CONFIG_USB_DEBUG is not set # # Miscellaneous USB options # CONFIG_USB_DEVICEFS=y # CONFIG_USB_BANDWIDTH is not set # CONFIG_USB_DYNAMIC_MINORS is not set # CONFIG_USB_SUSPEND is not set # CONFIG_USB_OTG is not set CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # # USB Host Controller Drivers # CONFIG_USB_EHCI_HCD=m # CONFIG_USB_EHCI_SPLIT_ISO is not set # CONFIG_USB_EHCI_ROOT_HUB_TT is not set CONFIG_USB_OHCI_HCD=m CONFIG_USB_UHCI_HCD=m # CONFIG_USB_SL811_HCD is not set # # USB Device Class drivers # # CONFIG_USB_AUDIO is not set # # USB Bluetooth TTY can only be used with disabled Bluetooth subsystem # # CONFIG_USB_MIDI is not set CONFIG_USB_ACM=m CONFIG_USB_PRINTER=m # # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information # CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_DEBUG is not set CONFIG_USB_STORAGE_RW_DETECT=y # CONFIG_USB_STORAGE_DATAFAB is not set # CONFIG_USB_STORAGE_FREECOM is not set # CONFIG_USB_STORAGE_ISD200 is not set # CONFIG_USB_STORAGE_DPCM is not set # CONFIG_USB_STORAGE_HP8200e is not set # CONFIG_USB_STORAGE_SDDR09 is not set # CONFIG_USB_STORAGE_SDDR55 is not set # CONFIG_USB_STORAGE_JUMPSHOT is not set # # USB Input Devices # CONFIG_USB_HID=m CONFIG_USB_HIDINPUT=y # CONFIG_HID_FF is not set # CONFIG_USB_HIDDEV is not set # # USB HID Boot Protocol drivers # # CONFIG_USB_KBD is not set # CONFIG_USB_MOUSE is not set # CONFIG_USB_AIPTEK is not set # CONFIG_USB_WACOM is not set # CONFIG_USB_KBTAB is not set # CONFIG_USB_POWERMATE is not set # CONFIG_USB_MTOUCH is not set # CONFIG_USB_EGALAX is not set # CONFIG_USB_XPAD is not set # CONFIG_USB_ATI_REMOTE is not set # # USB Imaging devices # CONFIG_USB_MDC800=m CONFIG_USB_MICROTEK=m CONFIG_USB_HPUSBSCSI=m # # USB Multimedia devices # # CONFIG_USB_DABUSB is not set CONFIG_USB_VICAM=m # CONFIG_USB_DSBR is not set CONFIG_USB_IBMCAM=m CONFIG_USB_KONICAWC=m CONFIG_USB_OV511=m CONFIG_USB_SE401=m # CONFIG_USB_SN9C102 is not set CONFIG_USB_STV680=m # # USB Network Adapters # # CONFIG_USB_CATC is not set # CONFIG_USB_KAWETH is not set # CONFIG_USB_PEGASUS is not set # CONFIG_USB_RTL8150 is not set # CONFIG_USB_USBNET is not set # # USB port drivers # CONFIG_USB_USS720=m # # USB Serial Converter support # CONFIG_USB_SERIAL=m CONFIG_USB_SERIAL_GENERIC=y # CONFIG_USB_SERIAL_BELKIN is not set # CONFIG_USB_SERIAL_WHITEHEAT is not set # CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set # CONFIG_USB_SERIAL_CYPRESS_M8 is not set # CONFIG_USB_SERIAL_EMPEG is not set # CONFIG_USB_SERIAL_FTDI_SIO is not set # CONFIG_USB_SERIAL_VISOR is not set # CONFIG_USB_SERIAL_IPAQ is not set # CONFIG_USB_SERIAL_IR is not set # CONFIG_USB_SERIAL_EDGEPORT is not set # CONFIG_USB_SERIAL_EDGEPORT_TI is not set # CONFIG_USB_SERIAL_IPW is not set # CONFIG_USB_SERIAL_KEYSPAN_PDA is not set # CONFIG_USB_SERIAL_KEYSPAN is not set # CONFIG_USB_SERIAL_KLSI is not set # CONFIG_USB_SERIAL_KOBIL_SCT is not set # CONFIG_USB_SERIAL_MCT_U232 is not set CONFIG_USB_SERIAL_PL2303=m # CONFIG_USB_SERIAL_SAFE is not set # CONFIG_USB_SERIAL_CYBERJACK is not set # CONFIG_USB_SERIAL_XIRCOM is not set # CONFIG_USB_SERIAL_OMNINET is not set # # USB Miscellaneous drivers # # CONFIG_USB_EMI62 is not set # CONFIG_USB_EMI26 is not set # CONFIG_USB_TIGL is not set # CONFIG_USB_AUERSWALD is not set # CONFIG_USB_RIO500 is not set # CONFIG_USB_LEGOTOWER is not set # CONFIG_USB_LCD is not set # CONFIG_USB_LED is not set # CONFIG_USB_CYTHERM is not set # CONFIG_USB_PHIDGETKIT is not set # CONFIG_USB_PHIDGETSERVO is not set # CONFIG_USB_TEST is not set # # USB ATM/DSL drivers # # # USB Gadget Support # # CONFIG_USB_GADGET is not set # # MMC/SD Card support # CONFIG_MMC=m # CONFIG_MMC_DEBUG is not set CONFIG_MMC_BLOCK=m CONFIG_MMC_WBSD=m # # File systems # CONFIG_EXT2_FS=y CONFIG_EXT2_FS_XATTR=y CONFIG_EXT2_FS_POSIX_ACL=y CONFIG_EXT2_FS_SECURITY=y CONFIG_EXT3_FS=y CONFIG_EXT3_FS_XATTR=y CONFIG_EXT3_FS_POSIX_ACL=y CONFIG_EXT3_FS_SECURITY=y CONFIG_JBD=y # CONFIG_JBD_DEBUG is not set CONFIG_FS_MBCACHE=y # CONFIG_REISERFS_FS is not set CONFIG_JFS_FS=m CONFIG_JFS_POSIX_ACL=y # CONFIG_JFS_DEBUG is not set # CONFIG_JFS_STATISTICS is not set CONFIG_FS_POSIX_ACL=y CONFIG_XFS_FS=m # CONFIG_XFS_RT is not set # CONFIG_XFS_QUOTA is not set CONFIG_XFS_SECURITY=y CONFIG_XFS_POSIX_ACL=y CONFIG_MINIX_FS=m # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set CONFIG_AUTOFS4_FS=y # # CD-ROM/DVD Filesystems # CONFIG_ISO9660_FS=y CONFIG_JOLIET=y CONFIG_ZISOFS=y CONFIG_ZISOFS_FS=y CONFIG_UDF_FS=y CONFIG_UDF_NLS=y # # DOS/FAT/NT Filesystems # CONFIG_FAT_FS=m CONFIG_MSDOS_FS=m CONFIG_VFAT_FS=m CONFIG_FAT_DEFAULT_CODEPAGE=852 CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-15" CONFIG_NTFS_FS=m # CONFIG_NTFS_DEBUG is not set # CONFIG_NTFS_RW is not set # # Pseudo filesystems # CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y CONFIG_SYSFS=y CONFIG_DEVFS_FS=y CONFIG_DEVFS_MOUNT=y # CONFIG_DEVFS_DEBUG is not set CONFIG_DEVPTS_FS_XATTR=y CONFIG_DEVPTS_FS_SECURITY=y CONFIG_TMPFS=y CONFIG_TMPFS_XATTR=y CONFIG_TMPFS_SECURITY=y CONFIG_HUGETLBFS=y CONFIG_HUGETLB_PAGE=y CONFIG_RAMFS=y # # Miscellaneous filesystems # # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_HFSPLUS_FS is not set # CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set CONFIG_CRAMFS=m # CONFIG_VXFS_FS is not set # CONFIG_HPFS_FS is not set # CONFIG_QNX4FS_FS is not set # CONFIG_SYSV_FS is not set # CONFIG_UFS_FS is not set # # Network File Systems # CONFIG_NFS_FS=y CONFIG_NFS_V3=y # CONFIG_NFS_V4 is not set # CONFIG_NFS_DIRECTIO is not set CONFIG_NFSD=y CONFIG_NFSD_V3=y # CONFIG_NFSD_V4 is not set # CONFIG_NFSD_TCP is not set CONFIG_LOCKD=y CONFIG_LOCKD_V4=y CONFIG_EXPORTFS=y CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set # CONFIG_RPCSEC_GSS_SPKM3 is not set CONFIG_SMB_FS=m # CONFIG_SMB_NLS_DEFAULT is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set # # Partition Types # # CONFIG_PARTITION_ADVANCED is not set CONFIG_MSDOS_PARTITION=y # # Native Language Support # CONFIG_NLS=y CONFIG_NLS_DEFAULT="iso8859-15" CONFIG_NLS_CODEPAGE_437=m CONFIG_NLS_CODEPAGE_737=m CONFIG_NLS_CODEPAGE_775=m CONFIG_NLS_CODEPAGE_850=m CONFIG_NLS_CODEPAGE_852=m CONFIG_NLS_CODEPAGE_855=m CONFIG_NLS_CODEPAGE_857=m CONFIG_NLS_CODEPAGE_860=m CONFIG_NLS_CODEPAGE_861=m CONFIG_NLS_CODEPAGE_862=m CONFIG_NLS_CODEPAGE_863=m CONFIG_NLS_CODEPAGE_864=m CONFIG_NLS_CODEPAGE_865=m CONFIG_NLS_CODEPAGE_866=m CONFIG_NLS_CODEPAGE_869=m CONFIG_NLS_CODEPAGE_936=m CONFIG_NLS_CODEPAGE_950=m CONFIG_NLS_CODEPAGE_932=m CONFIG_NLS_CODEPAGE_949=m CONFIG_NLS_CODEPAGE_874=m CONFIG_NLS_ISO8859_8=m CONFIG_NLS_CODEPAGE_1250=m CONFIG_NLS_CODEPAGE_1251=m CONFIG_NLS_ASCII=m CONFIG_NLS_ISO8859_1=y CONFIG_NLS_ISO8859_2=m CONFIG_NLS_ISO8859_3=m CONFIG_NLS_ISO8859_4=m CONFIG_NLS_ISO8859_5=m CONFIG_NLS_ISO8859_6=m CONFIG_NLS_ISO8859_7=m CONFIG_NLS_ISO8859_9=m CONFIG_NLS_ISO8859_13=m CONFIG_NLS_ISO8859_14=m CONFIG_NLS_ISO8859_15=y CONFIG_NLS_KOI8_R=m CONFIG_NLS_KOI8_U=m CONFIG_NLS_UTF8=m # # Profiling support # # CONFIG_PROFILING is not set # # Kernel hacking # CONFIG_DEBUG_KERNEL=y CONFIG_MAGIC_SYSRQ=y # CONFIG_SCHEDSTATS is not set # CONFIG_DEBUG_SLAB is not set # CONFIG_DEBUG_SPINLOCK is not set CONFIG_DEBUG_SPINLOCK_SLEEP=y # CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set # CONFIG_FRAME_POINTER is not set CONFIG_EARLY_PRINTK=y # CONFIG_DEBUG_STACKOVERFLOW is not set # CONFIG_KPROBES is not set # CONFIG_DEBUG_STACK_USAGE is not set # CONFIG_DEBUG_PAGEALLOC is not set # CONFIG_4KSTACKS is not set CONFIG_X86_FIND_SMP_CONFIG=y CONFIG_X86_MPPARSE=y # # Security options # # CONFIG_KEYS is not set CONFIG_SECURITY=y CONFIG_SECURITY_NETWORK=y CONFIG_SECURITY_CAPABILITIES=m # CONFIG_SECURITY_ROOTPLUG is not set # CONFIG_SECURITY_SECLVL is not set # CONFIG_SECURITY_SELINUX is not set # # Cryptographic options # CONFIG_CRYPTO=y CONFIG_CRYPTO_HMAC=y CONFIG_CRYPTO_NULL=m CONFIG_CRYPTO_MD4=m CONFIG_CRYPTO_MD5=m CONFIG_CRYPTO_SHA1=m CONFIG_CRYPTO_SHA256=m CONFIG_CRYPTO_SHA512=m CONFIG_CRYPTO_WP512=m CONFIG_CRYPTO_DES=m CONFIG_CRYPTO_BLOWFISH=m CONFIG_CRYPTO_TWOFISH=m CONFIG_CRYPTO_SERPENT=m CONFIG_CRYPTO_AES_586=m CONFIG_CRYPTO_CAST5=m CONFIG_CRYPTO_CAST6=m CONFIG_CRYPTO_TEA=m CONFIG_CRYPTO_ARC4=m CONFIG_CRYPTO_KHAZAD=m CONFIG_CRYPTO_ANUBIS=m CONFIG_CRYPTO_DEFLATE=m CONFIG_CRYPTO_MICHAEL_MIC=m CONFIG_CRYPTO_CRC32C=m CONFIG_CRYPTO_TEST=m # # Library routines # CONFIG_CRC_CCITT=m CONFIG_CRC32=y CONFIG_LIBCRC32C=m CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=m CONFIG_GENERIC_HARDIRQS=y CONFIG_GENERIC_IRQ_PROBE=y CONFIG_X86_BIOS_REBOOT=y CONFIG_PC=y --Multipart=_Mon__3_Jan_2005_19_18_36_-0800_WFmoBQgWAKAe8uBv-- From hadi@cyberus.ca Mon Jan 3 20:05:43 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 20:05:50 -0800 (PST) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0445NOu012629 for ; Mon, 3 Jan 2005 20:05:43 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.30) id 1Clg4z-0004k7-Fz for netdev@oss.sgi.com; Mon, 03 Jan 2005 23:13:57 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Clg4w-0002nl-2z; Mon, 03 Jan 2005 23:13:54 -0500 Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: netdev@oss.sgi.com In-Reply-To: <20050103125635.GB26856@postel.suug.ch> References: <20050103125635.GB26856@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1104812028.1085.50.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 03 Jan 2005 23:13:48 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13367 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Mon, 2005-01-03 at 07:56, Thomas Graf wrote: > Jamal et al, > > I attached 4 patches of a first ematch implementation. Comments > and suggestions very much appreciated. Compiles but untested. > > Patch 1: ematch API > > API visible to classifier: > > tcf_em_tree_validate(tp, tlv, tree) > tlv: ematches TLV > tree: temporary struct tcf_ematch_tree > > Validates the data in the TLV and builds the ematch tree > upon the temporary variable. struct tcf_ematch_hdr { __u16 handle; __u16 matchID; __u16 kind; __u8 flags; __u8 pad; /* currently unused */ }; you need both matchID and handle? struct tcf_ematch { struct tcf_ematch_hdr hdr; struct tcf_ematch_ops * ops; unsigned long data; }; Both tcf_ematch_ops and tcf_ematch_hdr have kind; Is data length stored somewhere? Noticed indev still hanging there ;-> shouldnt that die by this patch? > tcf_em_tree_change(tp, dst, src) > dst: destination ematch tree (from classifier private data) > src: source ematch tree (temporary tree from _validate) > > Replaces the ematch tree in the classifier with the temporary > tree. Seems to assume some owner of the ematch other than mother classifier. Recall the idea of ownership by classifier we discussed earlier which should be default if the ematch doesnt implement a ->change() BTW, Is the assumption i can have a u32: match ematch match match ematch now gone? I couldnt tell. > tcf_em_tree_destroy(tp, tree) > Destroys an ematch tree > > tcf_em_tree_dump(skb, tree, tlv_type) > tlv_type: T of ematches TLV (classifier specific) > > Dumps the ematch tree to the skb with given tlv_type. Same comments as in ->change(). if ematch doesnt implement a destroy or dump then mother classifier is responsible. > tcf_em_tree_match(skb, tree, res) > res: struct tcf_result * > > Macro returning 1 if no ematches are configured, otherwise > the tree is evaulated and 1 is returned if the tree matches. I think that looks valid for simplicty case. I wasnt so sure about the INVERT thing you had. It doesnt look like a bad idea, just different from what i had in mind (where you let the ematch worry about inversion). > The complete API is also visible if ematch is not configured but > will result in empty macros/structures. Those need to be > improved though. > > API visible to ematches: > > tcf_em_register(ops) > tcf_em_unregister(ops) > > ematches must at least provide the following callbacks: > > change, match > > Optional callbacks are: destroy, dump > > kind must be set to a unique ID, i thought about declaring > 1..2^16 to ematches within the mainline tree and have the > rest declared as to be used for private use to avoid collisions. With std actions also this was an issue - at the moment dont have anything in any headers just to make it free for all - This way you could write a simple module that has zero dependency on an already compiled kernel. There would be standard practise where say 11 would mean something - but i suggest not to enforce it; the register() should probably spit some helpful message of who already has the number. you are trying to grab. > Patch 2: u32 ematch > > Is an ematch based on the existing u32 match but allows to > specify the layer and is able to read u32 values if alignment > does not allow direct access. Additionally it supports > the operands, eq, lt, gt. It is a few ticks slower than the > existing match but worth it. However, it does not support > the neat nexthdr via hashing as u32 does which is the main > problem before u32 can make proper use of it. It does emulate a u32 node but not the classifier - which is a _lot_ more sophisticated (with multilevel trees of hashes etc). Maybe you should change its name to something like 32bit match. > Patch 3: nbyte ematch > > Compares n bytes at specified offset. To be used for IPv6 > address matches to avoid 4 ANDed u32 matches. This looks useful. My recommendation would be to have the metamatch as the first thing so we can kill indev and friends. > Patch 4: Basic Classifier > > This is the most basic classifier possible doing nothing more > than executing extensions and ematches. It follows the > architecture of u32 and fw by storing a filter list in tp->root. > This eventually makes fw obsolete once meta ematch is available. > I didn't copy the u32/fw code but rather made use of the list.h. Very inefficient, but serves the purpose of an example. [Even if you go as basic a hash as fw classifier you will do better] > pskbs are completely unhandled so far as I'm still not sure > how to do it properly. Given where we are doing these things (egress and ingress of stack) we would mostly be fine (unlike netfilter). cheers, jamal From hadi@cyberus.ca Mon Jan 3 20:10:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 20:10:22 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0449nhC013152 for ; Mon, 3 Jan 2005 20:10:09 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1Clg9K-0007uH-Sz for netdev@oss.sgi.com; Mon, 03 Jan 2005 23:18:26 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Clg9D-0003FZ-SU; Mon, 03 Jan 2005 23:18:20 -0500 Subject: Re: [openib-general] Re: LLTX and netif_stop_queue From: jamal Reply-To: hadi@cyberus.ca To: Grant Grundler Cc: Eric Lemoine , Roland Dreier , netdev@oss.sgi.com, Andi Kleen , openib-general@openib.org, Patrick McHardy , "David S. Miller" In-Reply-To: <20050103171227.GD7370@esmail.cup.hp.com> References: <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> <5cac192f0501021530672a908a@mail.gmail.com> <1104764660.1048.578.camel@jzny.localdomain> <52brc68q05.fsf@topspin.com> <5cac192f05010308414a25b548@mail.gmail.com> <527jmu8nbw.fsf@topspin.com> <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> Content-Type: text/plain Organization: jamalopolous Message-Id: <1104812294.1085.53.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 03 Jan 2005 23:18:14 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13368 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Mon, 2005-01-03 at 12:12, Grant Grundler wrote: > Some workloads that Jamal cares about (routing) only need 2 cpus. What bothers me is more the complexity this has introduced more than the workload. OTOH, 1-2% improvement posted by Roland is good justification. cheers, jamal From imipak@yahoo.com Mon Jan 3 21:30:58 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 21:31:05 -0800 (PST) Received: from web12304.mail.yahoo.com (web12304.mail.yahoo.com [216.136.173.102]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j045Uc51018795 for ; Mon, 3 Jan 2005 21:30:58 -0800 Received: (qmail 37918 invoked by uid 60001); 4 Jan 2005 05:39:13 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=HtL24ZE50UKSFlqKo/55xDMow4aBa3IVj+1r4RGj+XMFNouOqmizyIpgCCEIIZOnFBf26w4XWOe/IYa+a3vfz3T+zP+JwI8jlIHcPniHVV1VD/4VW+8AnrUont/JmmJz2Qdc0V5CIl0HHAINY5rPD2JJJSDWqM9VZU9rWJ3luhE= ; Message-ID: <20050104053912.37916.qmail@web12304.mail.yahoo.com> Received: from [65.102.7.124] by web12304.mail.yahoo.com via HTTP; Mon, 03 Jan 2005 21:39:12 PST Date: Mon, 3 Jan 2005 21:39:12 -0800 (PST) From: Jonathan Day Subject: Re: [LARTC] Scheduler Mechnisms! To: Zhenyu Wu , netdev@oss.sgi.com Cc: lartc@mailman.ds9a.nl In-Reply-To: <304808537.11599@njupt.edu.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13369 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: imipak@yahoo.com Precedence: bulk X-list: netdev It depends on what you mean by "more". More for Linux? Certainly. HTB3 seems to be a popular mechanism, and you can use IMQ to set up an intermediate device to allow shaping of both inbound and outbound traffic, using one (or more!) scheduling mechanisms in series. (In fact, there are several versions of IMQ out there. I've given links to both the projects that seem to be alive, but there may be more.) There's also ESFQ, but there doesn't seem to be much active work on that. There are forward ports to recent Linux kernels, though. QLinux has a version of H-SFQ for Linux, but again it seems to be getting long in the tooth. Unfortunately, I can't find any forward ports of that. http://luxik.cdi.cz/~devik/qos/htb/ http://www.linuximq.net/ http://pupa.da.ru/imq/ http://www.digriz.org.uk/jdg-qos-script/#qos-2.6 http://kem.p.lodz.pl/~peter/qnet/ http://lass.cs.umass.edu/software/qlinux/ There are a great many systems that I can't find a Linux version of. Cisco routers support something called "Class-Based Weighted Fair Queueing" (CBWFQ) which seems to be a hybrid of classful and classless scheduling. Cisco also has two versions of ECN, for forwards and backwards propogation. I've listed below a number of papers detailing various QoS schemes. Some of these have been implemented in other OS' (the BSDs tend to get a lot of this stuff implemented quickly for them as part of ALTQ) and some I've never seen an implementation at all. However, the papers should all give enough information to write a version for Linux. Note: ALTQ can be found at: http://www.csl.sony.co.jp/person/kjc/kjc/software.html Please note that this list is not exhaustive. Rather, I got exhausted after trying to find what was out there and what state it was currently in. QoS is a big field, if the number of papers is anything to go by. Linux only touches the fringes of it. If anyone feels particularly bored, or in need of a good ego boost, it would be cool to see if a reasonable selection of these could be introduced into Linux over the 2.7 cycle. EDF (Earliest Deadline First) http://citeseer.ist.psu.edu/13919.html BLUE (an alternative to RED) http://citeseer.ist.psu.edu/feng99blue.html AF PHB (Assured Forwarding Per-Hop Behaviour) http://citeseer.ist.psu.edu/552302.html SFB (Stochastic Fair Blue) http://citeseer.ist.psu.edu/551253.html GREEN (a pro-active variant on the theme of RED) http://citeseer.ist.psu.edu/feng02green.html SMART (Scalable Multipath Aggregated RouTing) http://citeseer.ist.psu.edu/vutukury00smart.html CSFQ (Core Stateless Fair Queueing) http://citeseer.ist.psu.edu/391.html StFQ (Start-Time Fair Queueing) http://citeseer.ist.psu.edu/goyal96starttime.html RFQ (Rainbow Fair Queueing) http://citeseer.ist.psu.edu/cao00rainbow.html PrFQ (Probabalistic Fair Queueing) http://citeseer.ist.psu.edu/anker00prfq.html ERR (Elastic Round Robin) http://citeseer.ist.psu.edu/kanhere02fair.html GFQ (Greedy Fair Queueing) http://citeseer.ist.psu.edu/690207.html PERR (Prioritized Elastic Round Robin) http://citeseer.ist.psu.edu/681127.html AOQ (Anchored Opportunity Queueing) http://citeseer.ist.psu.edu/701742.html BSFQ (Bin Sort Fair Queueing) http://citeseer.ist.psu.edu/622188.html As for the final question on what happens between enqueue and dequeue, there are various diagrams out there which show different aspects of how packets traverse the system. I've included a few links to those I could find: http://open-source.arkoon.net/kernel/kernel_net.png http://ebtables.sourceforge.net/br_fw_ia/PacketFlow.png http://ebtables.sourceforge.net/br_fw_ia/br_fw_ia.html http://www.docum.org/docum.org/kptd/ The last of these is the infamous Kernel Packet Travelling Diagram. Most links to this that I've been able to find are broken. It should be noted that the diagrams all refer to the Linux 2.4 kernel. Linux 2.6 has quite a few QoS changes to it, but I'm unclear as to whether they significantly alter any of the flows. I hope this is of some use. Or, at the very least, is an effective remedy to insomnia. :) Jonathan --- Zhenyu Wu wrote: > Hello, > > Normally, in addition to such qdisc scheduler > mechanisms as FIFO, PQ, WRR, WFQ, > are there any more? Then, there is a confusion on > scheduler in Linux enviroment: > Assume there is a qdisc, such as RED as a leaf qdisc > in a router, we know, if > there is packet which want to enqueue the packet, > the Function red_enqueue is > called, but when the packet leave the queue(when the > Function red_dequeue is > called)? I think it is meaningless when the pack > leaves the queue just it enterred > it. Is there anything need to be done betweent the > packet's enqueue and dequeue? > > Best, > > > _______________________________________________ > LARTC mailing list / LARTC@mailman.ds9a.nl > http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: > http://lartc.org/ > __________________________________ Do you Yahoo!? Jazz up your holiday email with celebrity designs. Learn more. http://celebrity.mail.yahoo.com From jgarzik@pobox.com Mon Jan 3 22:32:43 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 03 Jan 2005 22:32:50 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j046WMfE020786 for ; Mon, 3 Jan 2005 22:32:42 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CliNB-0006yA-Iu; Tue, 04 Jan 2005 06:40:53 +0000 Message-ID: <41DA3A60.8050102@pobox.com> Date: Tue, 04 Jan 2005 01:40:32 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Netdev CC: =?UTF-8?B?WU9TSElGVUpJIEhpZGVha2kgLyDlkInol6Toi7HmmI4=?= , Herbert Xu Subject: IPv6 badness continues Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13370 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev This problem seems to be appearing much sooner, in 2.6.10 and 2.6.10-bk kernels. Herbert, your patch did not apply to recent kernels, so I did not boot with it. The first 'Badness in dst_release' message (of many) from 2.6.10-bk1, on x86 SMP, is found below. Standard FC2 OS with IPv6 6to4 setup as described on http://linux.yyz.us/ipv6-fc2-howto.html Sorry, this is my main fileserver and router, so I need to reboot it... Jeff Badness in dst_release at include/net/dst.h:149 [] ip6_dst_check+0x67/0x80 [ipv6] [] ip6_dst_lookup+0x1b4/0x1d0 [ipv6] [] udpv6_sendmsg+0x2b4/0x950 [ipv6] [] udp_recvmsg+0x64/0x300 [] inet_sendmsg+0x4d/0x60 [] sock_sendmsg+0xdd/0x100 [] find_busiest_group+0xd4/0x300 [] copy_from_user+0x42/0x70 [] autoremove_wake_function+0x0/0x60 [] sys_sendmsg+0x18f/0x1f0 [] __wake_up_common+0x41/0x70 [] __wake_up+0x3e/0x60 [] wake_futex+0x37/0x70 [] futex_wake+0x7b/0xd0 [] copy_from_user+0x42/0x70 [] sys_socketcall+0x242/0x260 From buytenh@wantstofly.org Tue Jan 4 01:25:22 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 01:25:30 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j049P1DC031170 for ; Tue, 4 Jan 2005 01:25:22 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id 33DD12B0EE; Tue, 4 Jan 2005 10:33:35 +0100 (MET) Date: Tue, 4 Jan 2005 10:33:35 +0100 From: Lennert Buytenhek To: Jeff Garzik Cc: Netdev , YOSHIFUJI Hideaki / ???????????? , Herbert Xu Subject: Re: IPv6 badness continues Message-ID: <20050104093335.GB7823@xi.wantstofly.org> References: <41DA3A60.8050102@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41DA3A60.8050102@pobox.com> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13371 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev On Tue, Jan 04, 2005 at 01:40:32AM -0500, Jeff Garzik wrote: > Standard FC2 OS with IPv6 6to4 setup as described on > http://linux.yyz.us/ipv6-fc2-howto.html I upgraded my problematic machine to FC3, which somehow broke 6to4, and I didn't bother to reenable it again because the local DNS server (dnscache) just drops AAAA queries on the floor anyway, leading to lots of timeouts when trying to resolve host names, etc. Ever since 6to4 was turned off on that box I stopped seeing these messages. --L From tgraf@suug.ch Tue Jan 4 03:55:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 03:55:10 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04Bsetq006588 for ; Tue, 4 Jan 2005 03:55:01 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 337BF82; Tue, 4 Jan 2005 13:02:52 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id A24611C0EA; Tue, 4 Jan 2005 13:03:33 +0100 (CET) Date: Tue, 4 Jan 2005 13:03:33 +0100 From: Thomas Graf To: jamal Cc: netdev@oss.sgi.com Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier Message-ID: <20050104120333.GF26856@postel.suug.ch> References: <20050103125635.GB26856@postel.suug.ch> <1104812028.1085.50.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1104812028.1085.50.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13372 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1104812028.1085.50.camel@jzny.localdomain> 2005-01-03 23:13 > struct tcf_ematch_hdr > { > __u16 handle; > __u16 matchID; > __u16 kind; > __u8 flags; > __u8 pad; /* currently unused */ > }; > > you need both matchID and handle? No, handle is yet unused and I think we can screw it again. > Both tcf_ematch_ops and tcf_ematch_hdr have kind; Correct, I wanted to avoid having to do transformations but it would save us a few bits. > Is data length stored somewhere? Not in this patch as it wasn't needed, I added it to my local tree yesterday though. It is indeed required if we allocate in the ematch api instead of having the ematch doing it. > Noticed indev still hanging there ;-> shouldnt that die by this patch? As soon as I find the time to write the meta ematch. > > tcf_em_tree_change(tp, dst, src) > > dst: destination ematch tree (from classifier private data) > > src: source ematch tree (temporary tree from _validate) > > > > Replaces the ematch tree in the classifier with the temporary > > tree. > > Seems to assume some owner of the ematch other than mother classifier. > Recall the idea of ownership by classifier we discussed earlier > which should be default if the ematch doesnt implement a ->change() The classifier must always be the owner. Splitting the vaildation and changing into 2 separate functions makes it easy for the classifier to stay consistent while changing without doing expensive error recovery. > BTW, Is the assumption i can have a u32: > match > ematch > match > match > ematch > > now gone? I couldnt tell. I can't tell you either but not really. It's still possible but I'm not sure if it makes sense. My idea was to replace match with ematch so it would benefit from logic relations. The problem arises when we get to the nexthdr offset mangling. I have to look into this but I might have to drop my idea and do as you state above. > > tcf_em_tree_destroy(tp, tree) > > Destroys an ematch tree > > > > tcf_em_tree_dump(skb, tree, tlv_type) > > tlv_type: T of ematches TLV (classifier specific) > > > > Dumps the ematch tree to the skb with given tlv_type. > > Same comments as in ->change(). > if ematch doesnt implement a destroy or dump then mother classifier is > responsible. Right, I changed this already. change/dump/destroy are fully optional. Here's the latest API to the classifier: change() (Optional) Called if provided, otherwise ematch api allocates the data, stores it in m->data and sets m->datalen. Special Case: If TCF_EM_SIMPLE is set the ematch data consists of a simple u32 which means no allocation is required and the value is stored in m->data directly. Note: I might add a special field to ematch_ops which can be set to the expected length of the ematch data so we have at least some basic sanity check. Thoughts? match() (Must) ... destroy() (Optional) Called if provided, otheriwse m->data is freed in ematch api unless TCF_EM_SIMPLE is set. dump() (Optional) Called if provided, otherwise m->data is dumped onto the skb with m->datalen as L. Special handling again for TCF_EM_SIMPLE. I think this makes it as simple as it can get while keeping the door open for complex ematches such as meta ematch. > With std actions also this was an issue - at the moment dont have > anything in any headers just to make it free for all - This way you > could write a simple module that has zero dependency on an already > compiled kernel. There would be standard practise where say 11 would > mean something - but i suggest not to enforce it; the register() > should probably spit some helpful message of who already has the number. > you are trying to grab. The warning is a good idea. I don't want to enforce it, a comment is just fine and it's up to you whehter you want to fix your ematch everyime a new ematch makes it into the kernel. I added this comment: /* Ematch type assignments * 1..32767 Reserved for ematches inside kernel tree * 32768..65535 Free to use, not reliable */ > > Patch 2: u32 ematch > > It does emulate a u32 node but not the classifier - which is a _lot_ > more sophisticated (with multilevel trees of hashes etc). Maybe you > should change its name to something like 32bit match. Agreed. Note: With the latest API everything except for match can be screwed. Same for em_nbyte. > > Patch 3: nbyte ematch > > > > Compares n bytes at specified offset. To be used for IPv6 > > address matches to avoid 4 ANDed u32 matches. > > This looks useful. > My recommendation would be to have the metamatch as the first thing > so we can kill indev and friends. Right, but those were easy to write in in interruptive working enviroment and somewhat validated the API. meta ematch will take some time to write but it sure has top priority. > > Patch 4: Basic Classifier > > Very inefficient, but serves the purpose of an example. > [Even if you go as basic a hash as fw classifier you will do better] Fully agreed, nevertheless I think something like this is required to fill the gaps of u32 and fw. From tgraf@suug.ch Tue Jan 4 04:19:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 04:19:11 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04CIh53008256 for ; Tue, 4 Jan 2005 04:19:04 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id BA15C82; Tue, 4 Jan 2005 13:26:55 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id CDA701C0EA; Tue, 4 Jan 2005 13:27:38 +0100 (CET) Date: Tue, 4 Jan 2005 13:27:38 +0100 From: Thomas Graf To: jamal Cc: netdev@oss.sgi.com Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier Message-ID: <20050104122738.GG26856@postel.suug.ch> References: <20050103125635.GB26856@postel.suug.ch> <1104812028.1085.50.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1104812028.1085.50.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13373 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1104812028.1085.50.camel@jzny.localdomain> 2005-01-03 23:13 > On Mon, 2005-01-03 at 07:56, Thomas Graf wrote: > > Patch 4: Basic Classifier > > Very inefficient, but serves the purpose of an example. > [Even if you go as basic a hash as fw classifier you will do better] Might be worth to mention the motivation for this. fw and u32 will definitely perform much better on complex setups but many do not use u32 hashing not to mention even understand it or have large nfmark -> classid fw maps. Many use u32 to match simple stuff as port numbers, dscp values or ip subnet addresses and create a new filter for every port/dscp value and for every address. Some even use temporary classes to emulate logic relations and this gets really slow. I have to get numbers first but a single basic filter with ORed matches is probably faster than a separate u32 filter for every case. Sure, once u32 has ematch support it gets better and the hashing shouldn't have too much influence even if it's unused.. We can see what to do once u32 can handle ematches. From hadi@cyberus.ca Tue Jan 4 05:11:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 05:11:16 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04DAnA1013418 for ; Tue, 4 Jan 2005 05:11:09 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1Cloal-00033k-87 for netdev@oss.sgi.com; Tue, 04 Jan 2005 08:19:19 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Cloai-0002Ey-VF; Tue, 04 Jan 2005 08:19:17 -0500 Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: netdev@oss.sgi.com In-Reply-To: <20050104120333.GF26856@postel.suug.ch> References: <20050103125635.GB26856@postel.suug.ch> <1104812028.1085.50.camel@jzny.localdomain> <20050104120333.GF26856@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1104844753.1085.99.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 04 Jan 2005 08:19:13 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13374 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Tue, 2005-01-04 at 07:03, Thomas Graf wrote: > * jamal <1104812028.1085.50.camel@jzny.localdomain> 2005-01-03 23:13 > Right, I changed this already. change/dump/destroy are fully > optional. Here's the latest API to the classifier: > > change() (Optional) > Called if provided, otherwise ematch api allocates the data, stores > it in m->data and sets m->datalen. Special Case: If TCF_EM_SIMPLE > is set the ematch data consists of a simple u32 which means no > allocation is required and the value is stored in m->data directly. > > Note: I might add a special field to ematch_ops which can be set to > the expected length of the ematch data so we have at least some basic > sanity check. Thoughts? My thinking is: It doesnt have to be simple 32 bit data. If i pass you a struct and tell you what length it is, then you as the classifier dont know need to know anything about it. You just store mystruct as data and datalen from the TLV. you then pass the datastruct to match() - Of course the match() will have to know what that struct means. > match() (Must) > ... > > destroy() (Optional) > Called if provided, otheriwse m->data is freed in ematch api unless > TCF_EM_SIMPLE is set. Again using the above logic, destroy becomes just kfree(mystruct) > dump() (Optional) > Called if provided, otherwise m->data is dumped onto the skb with > m->datalen as L. Special handling again for TCF_EM_SIMPLE. and dump becomes a matter of looking at datalen and encapsulating mystruct in a TLV without thinking about what the content is. > I think this makes it as simple as it can get while keeping the door > open for complex ematches such as meta ematch. Agreed. > > > Patch 4: Basic Classifier > > > > Very inefficient, but serves the purpose of an example. > > [Even if you go as basic a hash as fw classifier you will do better] > > Fully agreed, nevertheless I think something like this is > required to fill the gaps of u32 and fw. agreed. cheers, jamal From hadi@cyberus.ca Tue Jan 4 05:14:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 05:14:14 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04DDljL013816 for ; Tue, 4 Jan 2005 05:14:07 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1Clodf-0004hI-R8 for netdev@oss.sgi.com; Tue, 04 Jan 2005 08:22:19 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Clode-0002YX-EY; Tue, 04 Jan 2005 08:22:18 -0500 Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: netdev@oss.sgi.com In-Reply-To: <20050104122738.GG26856@postel.suug.ch> References: <20050103125635.GB26856@postel.suug.ch> <1104812028.1085.50.camel@jzny.localdomain> <20050104122738.GG26856@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1104844935.1085.103.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 04 Jan 2005 08:22:15 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13375 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Tue, 2005-01-04 at 07:27, Thomas Graf wrote: > * jamal <1104812028.1085.50.camel@jzny.localdomain> 2005-01-03 23:13 > > Very inefficient, but serves the purpose of an example. > > [Even if you go as basic a hash as fw classifier you will do better] > > Might be worth to mention the motivation for this. fw and u32 > will definitely perform much better on complex setups but > many do not use u32 hashing not to mention even understand it > or have large nfmark -> classid fw maps. agreed. > Many use u32 to match simple stuff as port numbers, dscp values > or ip subnet addresses and create a new filter for every port/dscp > value and for every address. Some even use temporary classes to > emulate logic relations and this gets really slow. I have to get > numbers first but a single basic filter with ORed matches is probably > faster than a separate u32 filter for every case. I am pretty sure someone who knows u32 well can outperform you (in the scenarios where u32 works using AND etc). Start hitting 50K rules then lets talk ;-> > Sure, once u32 > has ematch support it gets better and the hashing shouldn't have > too much influence even if it's unused.. We can see what to do once > u32 can handle ematches. If your intent is to write an ematch holder, then it would be worth to at least go as far as making it some basic hash - as basic as fw does; where collision leads toa linked list. If it is just to show an example, then it is fine. cheers, jamal From tgraf@suug.ch Tue Jan 4 05:32:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 05:33:01 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04DWXmm015060 for ; Tue, 4 Jan 2005 05:32:53 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id EA8C682; Tue, 4 Jan 2005 14:40:43 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 70FB71C0EA; Tue, 4 Jan 2005 14:41:26 +0100 (CET) Date: Tue, 4 Jan 2005 14:41:26 +0100 From: Thomas Graf To: jamal Cc: netdev@oss.sgi.com Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier Message-ID: <20050104134126.GJ26856@postel.suug.ch> References: <20050103125635.GB26856@postel.suug.ch> <1104812028.1085.50.camel@jzny.localdomain> <20050104122738.GG26856@postel.suug.ch> <1104844935.1085.103.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1104844935.1085.103.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13376 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1104844935.1085.103.camel@jzny.localdomain> 2005-01-04 08:22 > On Tue, 2005-01-04 at 07:27, Thomas Graf wrote: > > Many use u32 to match simple stuff as port numbers, dscp values > > or ip subnet addresses and create a new filter for every port/dscp > > value and for every address. Some even use temporary classes to > > emulate logic relations and this gets really slow. I have to get > > numbers first but a single basic filter with ORed matches is probably > > faster than a separate u32 filter for every case. > > I am pretty sure someone who knows u32 well can outperform you (in the > scenarios where u32 works using AND etc). > Start hitting 50K rules then lets talk ;-> Sure but I'd call a filter with 50K ANDed rules an unlikely scenario ;-> In most cases logic will beat brute force. I used to have a u32 setup with 4K matches and hashing, it was not only error prone but could be replaced with 12 egp filters gaining 90kpps. Why's that? Simply because it was easier to optimize the logic behind it. egp itself is terribly slow compared to u32. > If your intent is to write an ematch holder, then it would be worth to > at least go as far as making it some basic hash - as basic as fw does; > where collision leads toa linked list. If it is just to show an example, > then it is fine. Using what key? We have no knowledge about what the ematches want to see or not. From tgraf@suug.ch Tue Jan 4 05:37:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 05:38:01 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04DbYW0015675 for ; Tue, 4 Jan 2005 05:37:54 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 3ECB582; Tue, 4 Jan 2005 14:45:46 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 62A781C0EA; Tue, 4 Jan 2005 14:46:29 +0100 (CET) Date: Tue, 4 Jan 2005 14:46:29 +0100 From: Thomas Graf To: jamal Cc: netdev@oss.sgi.com Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier Message-ID: <20050104134629.GK26856@postel.suug.ch> References: <20050103125635.GB26856@postel.suug.ch> <1104812028.1085.50.camel@jzny.localdomain> <20050104120333.GF26856@postel.suug.ch> <1104844753.1085.99.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1104844753.1085.99.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13377 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1104844753.1085.99.camel@jzny.localdomain> 2005-01-04 08:19 > On Tue, 2005-01-04 at 07:03, Thomas Graf wrote: > > change() (Optional) > > My thinking is: > It doesnt have to be simple 32 bit data. > If i pass you a struct and tell you what length it is, then you as the > classifier dont know need to know anything about it. You just store > mystruct as data and datalen from the TLV. you then pass the datastruct > to match() - Of course the match() will have to know what that struct > means. That's exactly how it is, basically the logic is: if (ops->change) { err = ops->change(tp, data, datalen, m); if (err < 0) goto errout; } else if (datalen > 0) { if (mh->flags & TCF_EM_SIMPLE) { if (datalen != sizeof(u32)) goto errout; m->data = *(u32 *) data; } else { void *v = kmalloc(datalen, GFP_KERNEL); if (v == NULL) { err = -ENOBUFS; goto errout; } memcpy(v, data, datalen); m->data = (unsigned long) v; } } m->datalen = datalen; > > destroy() (Optional) > > Called if provided, otheriwse m->data is freed in ematch api unless > > TCF_EM_SIMPLE is set. > > Again using the above logic, destroy becomes just kfree(mystruct) Right, that's exactly how it is if (m->ops->destroy) m->ops->destroy(tp, m); else if (!(m->hdr.flags & TCF_EM_SIMPLE) && m->data) kfree((void *) m->data); > > dump() (Optional) > > Called if provided, otherwise m->data is dumped onto the skb with > > m->datalen as L. Special handling again for TCF_EM_SIMPLE. > > and dump becomes a matter of looking at datalen and encapsulating > mystruct in a TLV without thinking about what the content is. Absolutely true, you know about the code before you read it ;-> if (m->ops->dump) { if (m->ops->dump(skb, m) < 0) goto rtattr_failure; } else if (m->hdr.flags & TCF_EM_SIMPLE) { u32 u = m->data; RTA_PUT_NOHDR(skb, sizeof(u32), &u); } else if (m->datalen > 0) RTA_PUT_NOHDR(skb, m->datalen, (void *) m->data); From jeremy.guthrie@berbee.com Tue Jan 4 06:58:59 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 06:59:06 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04EwcSa018326 for ; Tue, 4 Jan 2005 06:58:59 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Tue, 4 Jan 2005 09:07:07 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Tue, 4 Jan 2005 09:07:03 -0600 User-Agent: KMail/1.7.2 References: <200501031455.26980.jeremy.guthrie@berbee.com> <20050103145115.4bdb2cd6@dxpl.pdx.osdl.net> In-Reply-To: <20050103145115.4bdb2cd6@dxpl.pdx.osdl.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2323836.npItmXt88H"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501040907.07466.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 04 Jan 2005 15:07:07.0955 (UTC) FILETIME=[0EF69830:01C4F26F] X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13378 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart2323836.npItmXt88H Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Monday 03 January 2005 04:51 pm, Stephen Hemminger wrote: > How many flows are going through the router? The neighbour cache > can get to be a bottleneck. Perhaps Robert "the Router Man" Olssen can > give some hints. Tue Jan 4 08:59:12 CST 2005 58406 rt_cache Tue Jan 4 08:59:48 CST 2005 60636 rt_cache Tue Jan 4 09:00:34 CST 2005 63891 rt_cache Tue Jan 4 09:01:02 CST 2005 64635 rt_cache Tue Jan 4 09:01:29 CST 2005 65689 rt_cache Tue Jan 4 09:01:58 CST 2005 63426 rt_cache Tue Jan 4 09:02:25 CST 2005 64139 rt_cache Tue Jan 4 09:02:53 CST 2005 63860 rt_cache Tue Jan 4 09:03:20 CST 2005 65719 rt_cache Tue Jan 4 09:03:48 CST 2005 62465 rt_cache Tue Jan 4 09:04:15 CST 2005 39339 rt_cache =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart2323836.npItmXt88H Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB2rEbqtjaBHGZBeURAqWAAJ9KZYqLRuAig+bKL6/MT9R9/hWuigCeOip1 XyXwql9OqQ4OWxV5aRYM06g= =HPlF -----END PGP SIGNATURE----- --nextPart2323836.npItmXt88H-- From okir@suse.de Tue Jan 4 08:51:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 08:51:38 -0800 (PST) Received: from Cantor.suse.de (news.suse.de [195.135.220.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04GpAZK026523 for ; Tue, 4 Jan 2005 08:51:31 -0800 Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 2F24D12CCE28; Tue, 4 Jan 2005 17:59:39 +0100 (CET) Date: Tue, 4 Jan 2005 17:59:34 +0100 From: Olaf Kirch To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] Problem with recent CMSG_COMPAT_OK fix Message-ID: <20050104165934.GJ7761@suse.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="T4sUOijqQbZv57TR" Content-Disposition: inline User-Agent: Mutt/1.5.6i X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13379 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: okir@suse.de Precedence: bulk X-list: netdev --T4sUOijqQbZv57TR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, The recent fixes for cmsg_len handling seem to break 32bit compatibility at least on x86_64. The new CMSG_COMPAT_OK macro requires that cmsg_len is greater or equal the size of struct cmsghdr, which is the 64bit version of the struct. The code should really check against the size of struct compat_cmsghdr. Signed-off-by: Olaf Kirch --- linux-2.6.10/net/compat.c.orig 2005-01-04 13:51:49.000000000 +0100 +++ linux-2.6.10/net/compat.c 2005-01-04 16:53:38.000000000 +0100 @@ -125,7 +125,7 @@ (struct compat_cmsghdr __user *)NULL) #define CMSG_COMPAT_OK(ucmlen, ucmsg, mhdr) \ - ((ucmlen) >= sizeof(struct cmsghdr) && \ + ((ucmlen) >= sizeof(struct compat_cmsghdr) && \ (ucmlen) <= (unsigned long) \ ((mhdr)->msg_controllen - \ ((char *)(ucmsg) - (char *)(mhdr)->msg_control))) -- Olaf Kirch | Things that make Monday morning interesting, #2: okir@suse.de | "We have 8,000 NFS mount points, why do we keep ---------------+ running out of privileged ports?" --T4sUOijqQbZv57TR Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=cmsg-compat-signedness-fix-fix From: Olaf Kirch Subject: Fix cmsg_len checks in 32bit compat mode References: 49517 - LTC13227 The recent fixes for cmsg_len handling seem to break 32bit compatibility at least on x86_64. The new CMSG_COMPAT_OK macro requires that cmsg_len is greater or equal the size of struct cmsghdr, which is the 64bit version of the struct. The code should really check against the size of struct compat_cmsghdr. Signed-off-by: Olaf Kirch --- linux-2.6.10/net/compat.c.orig 2005-01-04 13:51:49.000000000 +0100 +++ linux-2.6.10/net/compat.c 2005-01-04 16:53:38.000000000 +0100 @@ -125,7 +125,7 @@ (struct compat_cmsghdr __user *)NULL) #define CMSG_COMPAT_OK(ucmlen, ucmsg, mhdr) \ - ((ucmlen) >= sizeof(struct cmsghdr) && \ + ((ucmlen) >= sizeof(struct compat_cmsghdr) && \ (ucmlen) <= (unsigned long) \ ((mhdr)->msg_controllen - \ ((char *)(ucmsg) - (char *)(mhdr)->msg_control))) --T4sUOijqQbZv57TR-- From davem@davemloft.net Tue Jan 4 09:39:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 09:40:02 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04HdY4T028383 for ; Tue, 4 Jan 2005 09:39:55 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1ClsjH-0001yZ-00; Tue, 04 Jan 2005 09:44:23 -0800 Date: Tue, 4 Jan 2005 09:44:23 -0800 From: "David S. Miller" To: David Dillow Cc: netdev@oss.sgi.com, dave@thedillows.org Subject: Re: Ethtool offload patch Message-Id: <20050104094423.2d404759.davem@davemloft.net> In-Reply-To: <1104396895.5845.1.camel@ori.thedillows.org> References: <1104396895.5845.1.camel@ori.thedillows.org> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13380 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Thu, 30 Dec 2004 03:54:55 -0500 David Dillow wrote: > The attached patch allows the ethtool userspace tool to query and > control IPSEC crypto offload. Aren't you going to need something much more sophisticated than a boolean on/off value? How can I tell the driver "offload 3DES ESP, but not AH at all" or something like that? From robert.j.woodruff@intel.com Tue Jan 4 09:55:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 09:55:38 -0800 (PST) Received: from orsfmr005.jf.intel.com (fmr20.intel.com [134.134.136.19]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04HtBkE029422 for ; Tue, 4 Jan 2005 09:55:31 -0800 Received: from orsfmr101.jf.intel.com (orsfmr101.jf.intel.com [10.7.209.17]) by orsfmr005.jf.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j04I3bvZ025026; Tue, 4 Jan 2005 18:03:37 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by orsfmr101.jf.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j04I3PM3020680; Tue, 4 Jan 2005 18:03:28 GMT Received: from orsmsx332.amr.corp.intel.com ([192.168.65.60]) by orsmsxvs040.jf.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010409592228321 ; Tue, 04 Jan 2005 09:59:27 -0800 Received: from orsmsx408.amr.corp.intel.com ([192.168.65.52]) by orsmsx332.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 4 Jan 2005 09:59:01 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: [openib-general] Re: [PATCH][v5][0/24] Latest IB patch queue Date: Tue, 4 Jan 2005 09:58:59 -0800 Message-ID: <1AC79F16F5C5284499BB9591B33D6F00032CA55B@orsmsx408> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [openib-general] Re: [PATCH][v5][0/24] Latest IB patch queue Thread-Index: AcTtRtA8sfH+7rkCRfybU0u6Of9gBQFPznFQ From: "Woodruff, Robert J" To: "Roland Dreier" , "Karen Shaeffer" Cc: , , X-OriginalArrivalTime: 04 Jan 2005 17:59:01.0344 (UTC) FILETIME=[1238DE00:01C4F287] X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j04HtBkE029422 X-archive-position: 13381 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: robert.j.woodruff@intel.com Precedence: bulk X-list: netdev Karen> I am interested in Infiniband with x86_64 Opterons. Roland>OK, the current code should work well for you -- x86_64 is probably Roland>the most-tested architecture. I have tested on X86_64 EM64T systems. I have a 4 node cluster that I ran some MPI tests on top of IpoIB over the holidays and it ran without any problems. I know that others have also tested on x86_64 Opteron, so it should work fine for that arch. woody From dave@thedillows.org Tue Jan 4 10:56:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 10:56:33 -0800 (PST) Received: from iasrv1.idleaire.net (NS1.idleaire.net [65.220.16.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04Iu5W9031702 for ; Tue, 4 Jan 2005 10:56:25 -0800 Received: by iasrv1.idleaire.net (Postfix, from userid 300) id 4D7B8236E66; Tue, 4 Jan 2005 14:04:34 -0500 (EST) Received: from corp4.idleaire.com (corp4.idleaire.com [10.1.66.36]) by iasrv1.idleaire.net (Postfix) with ESMTP id 1799A236E4E; Tue, 4 Jan 2005 14:04:34 -0500 (EST) Received: from knox.voodoobox.net ([10.1.66.124]) by corp4.idleaire.com with Microsoft SMTPSVC(5.0.2195.6713); Tue, 4 Jan 2005 14:04:33 -0500 Subject: Re: Ethtool offload patch From: Dave Dillow To: "David S. Miller" Cc: netdev@oss.sgi.com In-Reply-To: <20050104094423.2d404759.davem@davemloft.net> References: <1104396895.5845.1.camel@ori.thedillows.org> <20050104094423.2d404759.davem@davemloft.net> Content-Type: text/plain Message-Id: <1104865471.9860.16.camel@dillow.idleaire.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Tue, 04 Jan 2005 14:04:31 -0500 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 04 Jan 2005 19:04:33.0963 (UTC) FILETIME=[3A3EE7B0:01C4F290] X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13382 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev On Tue, 2005-01-04 at 12:44, David S. Miller wrote: > On Thu, 30 Dec 2004 03:54:55 -0500 > David Dillow wrote: > > > The attached patch allows the ethtool userspace tool to query and > > control IPSEC crypto offload. > > Aren't you going to need something much more sophisticated > than a boolean on/off value? How can I tell the driver > "offload 3DES ESP, but not AH at all" or something like > that? Sure, but this was quicker. :) Actually, I thought that would be better suited to the xfrm_user/pf_key interfaces, perhaps using a flag on the SA that says "do not offload me", or perhaps the opposite. I'd probably want to add a flag to indicate which ones were actually offloaded as well so "ip xfrm state" could give an overview of what is currently offloaded. I know you just got back from vacation, so when you get a chance, I'd welcome comments on the patch series -- I did most of it simply, just to see how it would perform. There is (obviously) still work to do -- I need to figure out how to determine if an IPv6 address is local, and it may be nice to have some sort of LRU list to offload the most active SAs when resources get low on the card. The current version I'm testing includes the changes suggested on the board (change afinfo->map_direction() and remove xfrm_bundle_list), as well as a change to call dev->xfrm_state_add() and dev->xfrm_bundle_add() from process context, so I can get rid of the GFP_ATOMIC allocations. I'll have that out as soon as I can test and rediff everything, but in the meantime, is the whole idea fatally flawed? -- Dave Dillow From pekkas@netcore.fi Tue Jan 4 12:51:24 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 12:51:31 -0800 (PST) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04Kp2gC006367 for ; Tue, 4 Jan 2005 12:51:23 -0800 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id j04Kvh331419; Tue, 4 Jan 2005 22:57:43 +0200 Date: Tue, 4 Jan 2005 22:57:43 +0200 (EET) From: Pekka Savola To: Lennert Buytenhek cc: Jeff Garzik , Netdev , YOSHIFUJI Hideaki / ???????????? , Herbert Xu Subject: Re: IPv6 badness continues In-Reply-To: <20050104093335.GB7823@xi.wantstofly.org> Message-ID: References: <41DA3A60.8050102@pobox.com> <20050104093335.GB7823@xi.wantstofly.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13383 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev On Tue, 4 Jan 2005, Lennert Buytenhek wrote: > On Tue, Jan 04, 2005 at 01:40:32AM -0500, Jeff Garzik wrote: > >> Standard FC2 OS with IPv6 6to4 setup as described on >> http://linux.yyz.us/ipv6-fc2-howto.html > > I upgraded my problematic machine to FC3, which somehow broke 6to4, and I > didn't bother to reenable it again because the local DNS server (dnscache) > just drops AAAA queries on the floor anyway, leading to lots of timeouts > when trying to resolve host names, etc. Ever since 6to4 was turned off > on that box I stopped seeing these messages. Surely it doesn't just drop AAAA queries on the floor, but sends an error message? If so, maybe then the problem is that glibc resolver cannot properly handle such errors without undue timeouts. Actually I've just sent a message on libc-alpha@ describing a similar timeout issue: http://sources.redhat.com/ml/libc-alpha/2005-01/msg00007.html Maybe you could run a little bit of debug on whether the server sends errors (which kind) and how the resolver reacts. -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From davem@davemloft.net Tue Jan 4 14:16:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 14:16:08 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04MFexc009542 for ; Tue, 4 Jan 2005 14:16:01 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Clx2Q-0002vA-00; Tue, 04 Jan 2005 14:20:26 -0800 Date: Tue, 4 Jan 2005 14:20:26 -0800 From: "David S. Miller" To: Andrew Morton Cc: netdev@oss.sgi.com Subject: Re: Fw: b44 ifconfig fails with ENOMEM Message-Id: <20050104142026.000be2e8.davem@davemloft.net> In-Reply-To: <20050103191836.57f918e5.akpm@osdl.org> References: <20050103191836.57f918e5.akpm@osdl.org> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13384 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Mon, 3 Jan 2005 19:18:36 -0800 Andrew Morton wrote: > b44 requires an order-8 allocation? Good luck... Yes, it allocates a full TX ring worth of bounce buffers to work around a DMA addressing limitation. It should do a bunch of smaller consistent allocations instead of one huge one, that's for sure. From tgraf@suug.ch Tue Jan 4 14:27:40 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 14:27:47 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04MRI31010320 for ; Tue, 4 Jan 2005 14:27:39 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 0F04382; Tue, 4 Jan 2005 23:35:29 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 848AD1C0EA; Tue, 4 Jan 2005 23:36:12 +0100 (CET) Date: Tue, 4 Jan 2005 23:36:12 +0100 From: Thomas Graf To: Jamal Hadi Salim Cc: netdev@oss.sgi.com Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier Message-ID: <20050104223612.GN26856@postel.suug.ch> References: <20050103125635.GB26856@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050103125635.GB26856@postel.suug.ch> X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13385 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Updated patch with the following changes (still untested) * destroy/dump/change are not optional (only match is required) * ematch can set datalen in ematch_ops to have the ematch api do a data length sanity check. (to at least avoid bogus memory refs) * better nop macros if ematch is not enabled * TCF_EM_SIMPLE flag which marks an ematch config as simple, meaning that the data consists of a u32 value. * API documentation * removed handle from ematch_hdr * userspace visible ematch header is no longer used in ematch tree and the attributes are copied now to avoid duplications such as kind. * suggestion comment to use a kind > 2^15 for private/temporary ematches to avoid collisions on kernel upgrades * some minor cosmetic fixes to make code look more pretty * renamed tcf_em_tree_change to tcf_em_tree_replace, it gives a better impression on what is being done Jamal, I know it's still not simple enough for you but can you live with it? ;-> diff -Nru linux-2.6.10-bk6.orig/include/linux/pkt_cls.h linux-2.6.10-bk6/include/linux/pkt_cls.h --- linux-2.6.10-bk6.orig/include/linux/pkt_cls.h 2005-01-04 18:10:11.000000000 +0100 +++ linux-2.6.10-bk6/include/linux/pkt_cls.h 2005-01-04 18:10:17.000000000 +0100 @@ -319,4 +319,51 @@ #define TCA_TCINDEX_MAX (__TCA_TCINDEX_MAX - 1) +struct tcf_ematch_tree_hdr +{ + __u16 nmatches; + __u16 progid; +}; + +enum +{ + TCA_EMATCH_TREE_UNSPEC, + TCA_EMATCH_TREE_HDR, + TCA_EMATCH_TREE_LIST, + __TCA_EMATCH_TREE_MAX +}; +#define TCA_EMATCH_TREE_MAX (__TCA_EMATCH_TREE_MAX - 1) + +struct tcf_ematch_hdr +{ + __u16 matchID; + __u16 kind; + __u16 flags; + __u16 pad; /* currently unused */ +}; + +/* Ematch type assignments + * 1..32767 Reserved for ematches inside kernel tree + * 32768..65535 Free to use, not reliable + */ +enum +{ + TCF_EM_CONTAINER, + __TCF_EM_MAX +}; + +#define TCF_EM_REL_MASK 3 +#define TCF_EM_REL_VALID(v) \ + (!(((v) & TCF_EM_REL_MASK) == TCF_EM_REL_MASK)) +#define TCF_EM_LAST_KEY(v) (!((v) & TCF_EM_REL_MASK)) + +#define TCF_EM_REL_OBVIOUS(v, r) (TCF_EM_LAST_KEY(v) || \ + (!(r) && ((v) & TCF_EM_REL_AND)) || ((r) && ((v) & TCF_EM_REL_OR))) + +#define TCF_EM_REL_END (1<<0) +#define TCF_EM_REL_AND (1<<1) +#define TCF_EM_REL_OR (1<<2) +#define TCF_EM_INVERT (1<<3) +#define TCF_EM_SIMPLE (1<<4) + #endif diff -Nru linux-2.6.10-bk6.orig/include/linux/rtnetlink.h linux-2.6.10-bk6/include/linux/rtnetlink.h --- linux-2.6.10-bk6.orig/include/linux/rtnetlink.h 2005-01-04 18:10:11.000000000 +0100 +++ linux-2.6.10-bk6/include/linux/rtnetlink.h 2005-01-04 01:33:32.000000000 +0100 @@ -779,6 +779,11 @@ goto rtattr_failure; \ __rta_fill(skb, attrtype, attrlen, data); }) +#define RTA_PUT_NOHDR(skb, attrlen, data) \ +({ if (unlikely(skb_tailroom(skb) < (int)(attrlen))) \ + goto rtattr_failure; \ + memcpy(skb_put(skb, RTA_ALIGN(attrlen)), data, attrlen); }) + static inline struct rtattr * __rta_reserve(struct sk_buff *skb, int attrtype, int attrlen) { diff -Nru linux-2.6.10-bk6.orig/include/net/pkt_cls.h linux-2.6.10-bk6/include/net/pkt_cls.h --- linux-2.6.10-bk6.orig/include/net/pkt_cls.h 2005-01-04 18:10:11.000000000 +0100 +++ linux-2.6.10-bk6/include/net/pkt_cls.h 2005-01-04 19:42:59.000000000 +0100 @@ -149,6 +149,127 @@ extern int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts, struct tcf_ext_map *map); +#ifdef CONFIG_NET_EMATCH + +struct tcf_ematch_ops; + +/** + * struct tcf_ematch - extended match (ematch) + * + * @matchID: identifier to allow userspace to reidentify a match + * @flags: flags specifying attributes and the relation to other matches + * @ops: the operations lookup table of the corresponding ematch module + * @datalen: length of the ematch specific configuration data + * @data: ematch specific data + */ +struct tcf_ematch +{ + u16 matchID; + u16 flags; + struct tcf_ematch_ops * ops; + unsigned int datalen; + unsigned long data; +}; + +/** + * struct tcf_ematch_tree - ematch tree handle + * + * @hdr: ematch tree header supplied by userspace + * @matches: array of ematches + */ +struct tcf_ematch_tree +{ + struct tcf_ematch_tree_hdr hdr; + struct tcf_ematch * matches; + +}; + +#define em_lookup_match(t, i) (&(t)->matches[(i)]) + +/** + * struct tcf_ematch_ops - ematch module operations + * + * @kind: identifier (kind) of this ematch module + * @datalen: length of expected configuration data (optional) + * @change: called during validation (optional) + * @match: called during ematch tree evaluation, must return 1/0 + * @destroy: called during destroyage (optional) + * @dump: called during dumping process (optional) + * @owner: owner, must be set to THIS_MODULE + * @link: link to previous/next ematch module (internal use) + */ +struct tcf_ematch_ops +{ + int kind; + int datalen; + int (*change)(struct tcf_proto *, void *, + int, struct tcf_ematch *); + int (*match)(struct sk_buff *, struct tcf_ematch *); + int (*destroy)(struct tcf_proto *, + struct tcf_ematch *); + int (*dump)(struct sk_buff *, struct tcf_ematch *); + struct module *owner; + struct list_head link; +}; + +extern int tcf_em_register(struct tcf_ematch_ops *); +extern int tcf_em_unregister(struct tcf_ematch_ops *); +extern int tcf_em_tree_validate(struct tcf_proto *, struct rtattr *, + struct tcf_ematch_tree *); +extern void tcf_em_tree_destroy(struct tcf_proto *, struct tcf_ematch_tree *); +extern int tcf_em_tree_dump(struct sk_buff *, struct tcf_ematch_tree *, int); +extern int __tcf_em_tree_match(struct sk_buff *, struct tcf_ematch_tree *); + +/** + * tcf_em_tree_replace - replace ematch tree of a running classifier + * + * @tp: classifier kind handle + * @dst: destination ematch tree variable + * @src: source ematch tree (temporary tree from tcf_em_tree_validate) + * + * This functions replaces the ematch tree in @dst with the ematch + * tree in @src. The classifier in charge of the ematch tree may be + * running. + */ +static inline void +tcf_em_tree_replace(struct tcf_proto *tp, struct tcf_ematch_tree *dst, + struct tcf_ematch_tree *src) +{ + tcf_tree_lock(tp); + memcpy(dst, src, sizeof(*dst)); + tcf_tree_unlock(tp); +} + +/** + * tcf_em_tree_match - evaulate an ematch tree + * + * @skb: socket buffer of the packet in question + * @t: ematch tree to be used for evaluation + * + * This function matches @skb against the ematch tree in @t by going + * through all ematches respecting their logic relations returning + * as soon as the result is obvious. + * + * Returns 1 if the ematch tree as-one matches, no ematches are configured + * or ematch is not enabled in the kernel, otherwise 0 is returned. + */ +#define tcf_em_tree_match(skb, t) \ + ((t)->hdr.nmatches ? __tcf_em_tree_match(skb, t) : 1) + +#else /* CONFIG_NET_EMATCH */ + +struct tcf_ematch_tree +{ +}; + +#define tcf_em_tree_validate(tp, tb, t) (0) +#define tcf_em_tree_destroy(tp, t) do { } while(0) +#define tcf_em_tree_dump(skb, t, tlv) (0) +#define tcf_em_tree_change(tp, dst, src) do { } while(0) +#define tcf_em_tree_match(skb, t) (1) + +#endif /* CONFIG_NET_EMATCH */ + #ifdef CONFIG_NET_CLS_IND static inline int tcf_change_indev(struct tcf_proto *tp, char *indev, struct rtattr *indev_tlv) diff -Nru linux-2.6.10-bk6.orig/net/sched/Kconfig linux-2.6.10-bk6/net/sched/Kconfig --- linux-2.6.10-bk6.orig/net/sched/Kconfig 2005-01-04 18:10:11.000000000 +0100 +++ linux-2.6.10-bk6/net/sched/Kconfig 2005-01-04 18:10:17.000000000 +0100 @@ -375,6 +375,19 @@ To compile this code as a module, choose M here: the module will be called cls_rsvp6. +config NET_EMATCH + bool "Extended Matches" + depends on NET_CLS + ---help--- + Say Y here if you want to use extended matches on top of classifiers + and select the extended matches below. + + Extended matches are small classification helpers not worth writing + a separate classifier. + + You must have a recent version of the iproute2 tools in order to use + extended matches. + config NET_CLS_ACT bool "Packet ACTION" depends on EXPERIMENTAL && NET_CLS && NET_QOS diff -Nru linux-2.6.10-bk6.orig/net/sched/Makefile linux-2.6.10-bk6/net/sched/Makefile --- linux-2.6.10-bk6.orig/net/sched/Makefile 2005-01-04 18:10:11.000000000 +0100 +++ linux-2.6.10-bk6/net/sched/Makefile 2005-01-04 18:10:17.000000000 +0100 @@ -33,3 +33,4 @@ obj-$(CONFIG_NET_CLS_RSVP) += cls_rsvp.o obj-$(CONFIG_NET_CLS_TCINDEX) += cls_tcindex.o obj-$(CONFIG_NET_CLS_RSVP6) += cls_rsvp6.o +obj-$(CONFIG_NET_EMATCH) += ematch.o diff -Nru linux-2.6.10-bk6.orig/net/sched/ematch.c linux-2.6.10-bk6/net/sched/ematch.c --- linux-2.6.10-bk6.orig/net/sched/ematch.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.10-bk6/net/sched/ematch.c 2005-01-04 18:55:40.000000000 +0100 @@ -0,0 +1,396 @@ +/* + * net/sched/ematch.c Extended Match API + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: Thomas Graf + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define EMATCH_STACK_SIZE 32 + +static LIST_HEAD(ematch_ops); +static rwlock_t ematch_mod_lock = RW_LOCK_UNLOCKED; + +static inline struct tcf_ematch_ops * +tcf_em_lookup(u16 kind) +{ + struct tcf_ematch_ops *e = NULL; + + read_lock(&ematch_mod_lock); + list_for_each_entry(e, &ematch_ops, link) { + if (kind == e->kind) { + if (!try_module_get(e->owner)) + e = NULL; + break; + } + } + read_unlock(&ematch_mod_lock); + + return e; +} + +/** + * tcf_em_register - register an extended match + * + * @ops: ematch operations lookup table + * + * This function must be called by ematches to announce their presence. + * The given @ops must have kind set to a unique identifier and the + * callback match() must be implemented. All other callbacks are optional + * and a fallback implementation is used instead. + * + * Returns -EEXISTS if an ematch of the same kind has already registered. + */ +int tcf_em_register(struct tcf_ematch_ops *ops) +{ + int err = -EEXIST; + struct tcf_ematch_ops *e; + + write_lock(&ematch_mod_lock); + list_for_each_entry(e, &ematch_ops, link) + if (ops->kind == e->kind) + goto errout; + + list_add_tail(&ops->link, &ematch_ops); + err = 0; +errout: + write_unlock(&ematch_mod_lock); + return err; +} + +/** + * tcf_em_unregister - unregster and extended match + * + * @ops: ematch operations lookup table + * + * This function must be called by ematches to announce their disappearance + * for examples when the module gets unloaded. The @ops parameter must be + * the same as the one used for registration. + * + * Returns -ENOENT if no matching ematch was found. + */ +int tcf_em_unregister(struct tcf_ematch_ops *ops) +{ + int err = 0; + struct tcf_ematch_ops *e; + + write_lock(&ematch_mod_lock); + list_for_each_entry(e, &ematch_ops, link) { + if (e == ops) { + list_del(&e->link); + goto out; + } + } + + err = -ENOENT; +out: + write_unlock(&ematch_mod_lock); + return err; +} + +static int tcf_em_validate(struct tcf_proto *tp, struct tcf_ematch_tree_hdr *th, + struct tcf_ematch *m, struct rtattr *rta) +{ + int err = -EINVAL; + struct tcf_ematch_hdr *mh = RTA_DATA(rta); + int datalen = RTA_PAYLOAD(rta) - sizeof(*mh); + void *data = (void *) data + sizeof(*mh); + + if (!TCF_EM_REL_VALID(mh->flags)) + goto errout; + + if (mh->kind == TCF_EM_CONTAINER) { + u32 ref; + + if (datalen < sizeof(ref)) + goto errout; + ref = *(u32 *) data; + if (ref >= th->nmatches) + goto errout; + m->data = ref; + } else { + struct tcf_ematch_ops *ops = tcf_em_lookup(mh->kind); + + if (ops == NULL) { + err = -ENOENT; + goto errout; + } + + if (ops->datalen && datalen < ops->datalen) + goto errout; + + if (ops->change) { + err = ops->change(tp, data, datalen, m); + if (err < 0) + goto errout; + } else if (datalen > 0) { + if (mh->flags & TCF_EM_SIMPLE) { + if (datalen < sizeof(u32)) + goto errout; + m->data = *(u32 *) data; + } else { + void *v = kmalloc(datalen, GFP_KERNEL); + if (v == NULL) { + err = -ENOBUFS; + goto errout; + } + memcpy(v, data, datalen); + m->data = (unsigned long) v; + } + } + } + + m->matchID = mh->matchID; + m->flags = mh->flags; + m->datalen = datalen; + + err = 0; +errout: + return err; +} + +/** + * tcf_em_tree_validate - validate ematch config TLV and build ematch tree + * + * @tp: classifier kind handle + * @rta: ematch tree configuration TLV + * @tree: destination ematch tree variable to store the resulting + * ematch tree. + * + * This function validates the given configuration TLV @rta and builds an + * ematch tree in @tree. The resulting tree must later be copied into + * the private classifier data using tcf_em_tree_change(). You MUST NOT + * provide the ematch tree variable of the private classifier data directly, + * the changes would not be locked properly. + * + * Returns a negative error code if the configuration TLV contains errors. + */ +int tcf_em_tree_validate(struct tcf_proto *tp, struct rtattr *rta, + struct tcf_ematch_tree *tree) +{ + int i, len, mlen, err = -EINVAL; + struct rtattr *m, *tb[TCA_EMATCH_TREE_MAX]; + struct tcf_ematch_tree_hdr *th; + + if (!rta || rtattr_parse_nested(tb, TCA_EMATCH_TREE_MAX, rta) < 0) + goto errout; + + if (RTA_PAYLOAD(tb[TCA_EMATCH_TREE_HDR-1]) < sizeof(*th) || + RTA_PAYLOAD(tb[TCA_EMATCH_TREE_LIST-1]) < sizeof(*m)) + goto errout; + + th = RTA_DATA(tb[TCA_EMATCH_TREE_HDR-1]); + m = RTA_DATA(tb[TCA_EMATCH_TREE_LIST-1]); + len = RTA_PAYLOAD(tb[TCA_EMATCH_TREE_LIST-1]); + mlen = th->nmatches * sizeof(struct tcf_ematch); + + memcpy(&tree->hdr, th, sizeof(*th)); + + tree->matches = kmalloc(mlen, GFP_KERNEL); + if (tree->matches == NULL) + goto errout; + memset(tree->matches, 0, mlen); + + for (i = 0; RTA_OK(m, len); i++) { + if (rta->rta_type != (i+1) || i >= th->nmatches || + RTA_PAYLOAD(rta) < sizeof(struct tcf_ematch_hdr)) { + err = -EINVAL; + goto errout_abort; + } + + err = tcf_em_validate(tp, th, em_lookup_match(tree, i), rta); + if (err < 0) + goto errout_abort; + + m = RTA_NEXT(m, len); + } + + if (i != th->nmatches) { + err = -EINVAL; + goto errout_abort; + } + + + err = 0; +errout: + return err; + +errout_abort: + tcf_em_tree_destroy(tp, tree); + return err; +} + +/** + * tcf_em_tree_destroy - destroy an ematch tree + * + * @tp: classifier kind handle + * @t: ematch tree to be deleted + * + * This functions destroys an ematch tree previously created by + * tcf_em_tree_validate()/tcf_em_tree_change(). You must ensure that + * the ematch tree is not in use before calling this function. + */ +void tcf_em_tree_destroy(struct tcf_proto *tp, struct tcf_ematch_tree *t) +{ + int i; + + if (t->matches == NULL) + return; + + for (i = 0; i < t->hdr.nmatches; i++) { + struct tcf_ematch *m = em_lookup_match(t, i); + if (m->ops) { + if (m->ops->destroy) + m->ops->destroy(tp, m); + else if (!(m->flags & TCF_EM_SIMPLE) && m->data) + kfree((void *) m->data); + module_put(m->ops->owner); + } + } + + t->hdr.nmatches = 0; + kfree(t->matches); +} + +/** + * tcf_em_tree_dump - dump ematch tree into a rtnl message + * + * @skb: skb holding the rtnl message + * @t: ematch tree to be dumped + * @tlv: TLV type to be used to encapsulate the tree + * + * This function dumps a ematch tree into a rtnl message. It is valid to + * call this function while the ematch tree is in use. + * + * Returns -1 if the skb tailroom is insufficient. + */ +int tcf_em_tree_dump(struct sk_buff *skb, struct tcf_ematch_tree *t, int tlv) +{ + int i; + struct rtattr * p_rta = (struct rtattr*) skb->tail; + struct rtattr * pm_rta; + + RTA_PUT(skb, tlv, 0, NULL); + RTA_PUT(skb, TCA_EMATCH_TREE_HDR, sizeof(t->hdr), &t->hdr); + + pm_rta = (struct rtattr *) skb->tail; + RTA_PUT(skb, TCA_EMATCH_TREE_LIST, 0, NULL); + + for (i = 0; i < t->hdr.nmatches; i++) { + struct rtattr * pd_rta = (struct rtattr*) skb->tail; + struct tcf_ematch *m = em_lookup_match(t, i); + struct tcf_ematch_hdr hdr = { + .kind = m->ops->kind, + .matchID = m->matchID, + .flags = m->flags + }; + + RTA_PUT(skb, i+1, sizeof(hdr), &hdr); + if (m->ops->dump) { + if (m->ops->dump(skb, m) < 0) + goto rtattr_failure; + } else if (m->flags & TCF_EM_SIMPLE) { + u32 u = m->data; + RTA_PUT_NOHDR(skb, sizeof(u32), &u); + } else if (m->datalen > 0) + RTA_PUT_NOHDR(skb, m->datalen, (void *) m->data); + + pd_rta->rta_len = skb->tail - (u8*) pd_rta; + } + + pm_rta->rta_len = skb->tail - (u8*) pm_rta; + p_rta->rta_len = skb->tail - (u8*) p_rta; + return 0; +rtattr_failure: + return -1; +} + +static inline int tcf_em_match(struct sk_buff *skb, struct tcf_ematch *m) +{ + int r = 0; + + if (m->ops->match) + r = m->ops->match(skb, m); + + return m->flags & TCF_EM_INVERT ? !r : r; +} + +/* Do not use this function directly, use tcf_em_tree_match instead */ +int __tcf_em_tree_match(struct sk_buff *skb, struct tcf_ematch_tree *t) +{ + int i = 0, n = 0, r = 0; + struct tcf_ematch *m; + int stack[EMATCH_STACK_SIZE]; + + memset(stack, 0, sizeof(stack)); + +proceed: + while (n < t->hdr.nmatches) { + m = em_lookup_match(t, n); + + if (m->ops->kind == TCF_EM_CONTAINER) { + if (unlikely(i >= EMATCH_STACK_SIZE)) + goto stack_overflow; + + if (unlikely(m->data <= n)) + goto backward_jump; + + stack[i++] = n; + n = m->data; + continue; + } + + r = tcf_em_match(skb, m); + if (TCF_EM_REL_OBVIOUS(m->flags, r)) + break; + n++; + } + +pop_stack: + if (i > 0) { + n = stack[--i]; + m = em_lookup_match(t, n); + + if (TCF_EM_REL_OBVIOUS(m->flags, r)) + goto pop_stack; + else { + n++; + goto proceed; + } + } + + return r; + +stack_overflow: + if (net_ratelimit()) + printk("Local stack overflow, increase EMATCH_STACK_SIZE\n"); + return -1; + +backward_jump: + if (net_ratelimit()) + printk("Detected backward precedence jump, fix your filter.\n"); + return -1; +} + +EXPORT_SYMBOL(tcf_em_register); +EXPORT_SYMBOL(tcf_em_unregister); +EXPORT_SYMBOL(tcf_em_tree_validate); +EXPORT_SYMBOL(tcf_em_tree_destroy); +EXPORT_SYMBOL(tcf_em_tree_dump); +EXPORT_SYMBOL(__tcf_em_tree_match); + From jgarzik@pobox.com Tue Jan 4 15:18:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 15:18:39 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04NIAdb012795 for ; Tue, 4 Jan 2005 15:18:30 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1Cly4Z-0000mR-7l; Tue, 04 Jan 2005 23:26:43 +0000 Message-ID: <41DB2623.7000601@pobox.com> Date: Tue, 04 Jan 2005 18:26:27 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Lennert Buytenhek CC: Netdev , YOSHIFUJI Hideaki / ???????????? , Herbert Xu Subject: Re: IPv6 badness continues References: <41DA3A60.8050102@pobox.com> <20050104093335.GB7823@xi.wantstofly.org> In-Reply-To: <20050104093335.GB7823@xi.wantstofly.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13386 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Lennert Buytenhek wrote: > On Tue, Jan 04, 2005 at 01:40:32AM -0500, Jeff Garzik wrote: > > >>Standard FC2 OS with IPv6 6to4 setup as described on >>http://linux.yyz.us/ipv6-fc2-howto.html > > > I upgraded my problematic machine to FC3, which somehow broke 6to4, and I > didn't bother to reenable it again because the local DNS server (dnscache) > just drops AAAA queries on the floor anyway, leading to lots of timeouts > when trying to resolve host names, etc. Ever since 6to4 was turned off > on that box I stopped seeing these messages. hmmm, that's annoying. My router is still FC2, but I'll check that out when I upgrade it to FC3. Jeff From jgarzik@pobox.com Tue Jan 4 15:20:45 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 15:20:53 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04NKOLb013162 for ; Tue, 4 Jan 2005 15:20:44 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1Cly6f-0000q7-SL; Tue, 04 Jan 2005 23:28:53 +0000 Message-ID: <41DB26A6.2070008@pobox.com> Date: Tue, 04 Jan 2005 18:28:38 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: hadi@cyberus.ca CC: Thomas Spatzier , "David S. Miller" , Hasso Tepper , Herbert Xu , netdev@oss.sgi.com, Paul Jakma , Tommy Christensen Subject: Re: [patch 4/10] s390: network driver. References: <1104764710.1048.580.camel@jzny.localdomain> In-Reply-To: <1104764710.1048.580.camel@jzny.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13387 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev jamal wrote: > The change is simple if theres consensus to go this path. Can you resend your patch? My main objection was that any change should be made in the core, not in individual net drivers. Another objection was that it seemed that some of the proposed solutions for clearing the queue on link down were imposing app-specific policy on the overall kernel. Aren't there cases where people would -not- want the queue to be cleared? Jeff From y030729@njupt.edu.cn Tue Jan 4 16:45:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 16:45:22 -0800 (PST) Received: from njupt.edu.cn (em.njupt.edu.cn [202.119.230.11]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j050ipgR019227 for ; Tue, 4 Jan 2005 16:45:12 -0800 Received: (eyou send program); Wed, 05 Jan 2005 09:47:27 +0800 Message-ID: <304889647.25037@njupt.edu.cn> Received: from 10.10.136.115 by em.njupt.edu.cn with HTTP; Wed, 05 Jan 2005 09:47:27 +0800 X-WebMAIL-MUA: [10.10.136.115] From: "Zhenyu Wu" To: imipak@yahoo.com, netdev@oss.sgi.com Cc: lartc@mailman.ds9a.nl Date: Wed, 05 Jan 2005 09:47:27 +0800 Reply-To: "Zhenyu Wu" X-Priority: 3 Subject: Re: [LARTC] Scheduler Mechnisms! Content-Type: text/plain X-Virus-Scanned: ClamAV 0.80/645/Mon Dec 27 14:56:20 2004 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13388 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: y030729@njupt.edu.cn Precedence: bulk X-list: netdev Thank you very much, i will try to find these papers which must be very helpful for me. The "more" means that whether there are other mechanisms not only for Linux. Sorry, i have not make it clear! Sometimes, i wonder whether the qdiscs such as CBQ, RED, GRED ... are belong to the scheduler mechanisms in linux enviroment. For example, In Red, which i can find are enqueue, and dequeue.... so, if i add a RED qidsc to a class, must i add a scheduler mechanism so that i can decide which packet in the queues will be scheduled and put to the link? Good luck, Best, >It depends on what you mean by "more". More for Linux? > Certainly. HTB3 seems to be a popular mechanism, and > you can use IMQ to set up an intermediate device to > allow shaping of both inbound and outbound traffic, > using one (or more!) scheduling mechanisms in series. > > (In fact, there are several versions of IMQ out there. > I've given links to both the projects that seem to be > alive, but there may be more.) > > There's also ESFQ, but there doesn't seem to be much > active work on that. There are forward ports to recent > Linux kernels, though. QLinux has a version of H-SFQ > for Linux, but again it seems to be getting long in > the tooth. Unfortunately, I can't find any forward > ports of that. > > http://luxik.cdi.cz/~devik/qos/htb/ > http://www.linuximq.net/ > http://pupa.da.ru/imq/ > > http://www.digriz.org.uk/jdg-qos-script/#qos-2.6 > http://kem.p.lodz.pl/~peter/qnet/ > http://lass.cs.umass.edu/software/qlinux/ > > There are a great many systems that I can't find a > Linux version of. Cisco routers support something > called "Class-Based Weighted Fair Queueing" (CBWFQ) > which seems to be a hybrid of classful and classless > scheduling. Cisco also has two versions of ECN, for > forwards and backwards propogation. > > I've listed below a number of papers detailing various > QoS schemes. Some of these have been implemented in > other OS' (the BSDs tend to get a lot of this stuff > implemented quickly for them as part of ALTQ) and some > I've never seen an implementation at all. However, the > papers should all give enough information to write a > version for Linux. > > Note: ALTQ can be found at: > http://www.csl.sony.co.jp/person/kjc/kjc/software.html > > Please note that this list is not exhaustive. Rather, > I got exhausted after trying to find what was out > there and what state it was currently in. QoS is a big > field, if the number of papers is anything to go by. > Linux only touches the fringes of it. If anyone feels > particularly bored, or in need of a good ego boost, it > would be cool to see if a reasonable selection of > these could be introduced into Linux over the 2.7 > cycle. > > EDF (Earliest Deadline First) > http://citeseer.ist.psu.edu/13919.html > > BLUE (an alternative to RED) > http://citeseer.ist.psu.edu/feng99blue.html > > AF PHB (Assured Forwarding Per-Hop Behaviour) > http://citeseer.ist.psu.edu/552302.html > > SFB (Stochastic Fair Blue) > http://citeseer.ist.psu.edu/551253.html > > GREEN (a pro-active variant on the theme of RED) > http://citeseer.ist.psu.edu/feng02green.html > > SMART (Scalable Multipath Aggregated RouTing) > http://citeseer.ist.psu.edu/vutukury00smart.html > > CSFQ (Core Stateless Fair Queueing) > http://citeseer.ist.psu.edu/391.html > > StFQ (Start-Time Fair Queueing) > http://citeseer.ist.psu.edu/goyal96starttime.html > > RFQ (Rainbow Fair Queueing) > http://citeseer.ist.psu.edu/cao00rainbow.html > > PrFQ (Probabalistic Fair Queueing) > http://citeseer.ist.psu.edu/anker00prfq.html > > ERR (Elastic Round Robin) > http://citeseer.ist.psu.edu/kanhere02fair.html > > GFQ (Greedy Fair Queueing) > http://citeseer.ist.psu.edu/690207.html > > PERR (Prioritized Elastic Round Robin) > http://citeseer.ist.psu.edu/681127.html > > AOQ (Anchored Opportunity Queueing) > http://citeseer.ist.psu.edu/701742.html > > BSFQ (Bin Sort Fair Queueing) > http://citeseer.ist.psu.edu/622188.html > > > As for the final question on what happens between > enqueue and dequeue, there are various diagrams out > there which show different aspects of how packets > traverse the system. I've included a few links to > those I could find: > > http://open-source.arkoon.net/kernel/kernel_net.png > http://ebtables.sourceforge.net/br_fw_ia/PacketFlow.png > http://ebtables.sourceforge.net/br_fw_ia/br_fw_ia.html > http://www.docum.org/docum.org/kptd/ > > The last of these is the infamous Kernel Packet > Travelling Diagram. Most links to this that I've been > able to find are broken. It should be noted that the > diagrams all refer to the Linux 2.4 kernel. Linux 2.6 > has quite a few QoS changes to it, but I'm unclear as > to whether they significantly alter any of the flows. > > I hope this is of some use. Or, at the very least, is > an effective remedy to insomnia. :) > > Jonathan > > --- Zhenyu Wu wrote: > > > Hello, > > > > Normally, in addition to such qdisc scheduler > > mechanisms as FIFO, PQ, WRR, WFQ, > > are there any more? Then, there is a confusion on > > scheduler in Linux enviroment: > > Assume there is a qdisc, such as RED as a leaf qdisc > > in a router, we know, if > > there is packet which want to enqueue the packet, > > the Function red_enqueue is > > called, but when the packet leave the queue(when the > > Function red_dequeue is > > called)? I think it is meaningless when the pack > > leaves the queue just it enterred > > it. Is there anything need to be done betweent the > > packet's enqueue and dequeue? > > > > Best, > > > > > > _______________________________________________ > > LARTC mailing list / LARTC@mailman.ds9a.nl > > http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: > > http://lartc.org/ > > > > > > > __________________________________ > Do you Yahoo!? > Jazz up your holiday email with celebrity designs. Learn more. > http://celebrity.mail.yahoo.com > > From hadi@cyberus.ca Tue Jan 4 06:55:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 06:55:43 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04EtFcD003593 for ; Tue, 4 Jan 2005 06:55:36 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1Cm1KF-000358-QG for netdev@oss.sgi.com; Tue, 04 Jan 2005 21:55:07 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Cm1K7-0003Tm-Sr; Tue, 04 Jan 2005 21:55:00 -0500 Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: netdev@oss.sgi.com In-Reply-To: <20050104134126.GJ26856@postel.suug.ch> References: <20050103125635.GB26856@postel.suug.ch> <1104812028.1085.50.camel@jzny.localdomain> <20050104122738.GG26856@postel.suug.ch> <1104844935.1085.103.camel@jzny.localdomain> <20050104134126.GJ26856@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1104893694.1124.37.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 04 Jan 2005 21:54:54 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13389 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Tue, 2005-01-04 at 08:41, Thomas Graf wrote: > * jamal <1104844935.1085.103.camel@jzny.localdomain> 2005-01-04 08:22 > > On Tue, 2005-01-04 at 07:27, Thomas Graf wrote: > > I am pretty sure someone who knows u32 well can outperform you (in the > > scenarios where u32 works using AND etc). > > Start hitting 50K rules then lets talk ;-> > > Sure but I'd call a filter with 50K ANDed rules an unlikely scenario ;-> 50K matches is probably senseless - i was talking about rules (which contain matches). > In most cases logic will beat brute force. I used to have a u32 setup > with 4K matches and hashing, it was not only error prone but could be > replaced with 12 egp filters gaining 90kpps. Why's that? Simply because > it was easier to optimize the logic behind it. egp itself is terribly > slow compared to u32. I think this is a debate that can be easily settled ;-> Agreed logic will beat brute force smartness and u32 is not exactly for the faint hearted. And its usability is extremely poor - but lets maintain its power as is. > > If your intent is to write an ematch holder, then it would be worth to > > at least go as far as making it some basic hash - as basic as fw does; > > where collision leads toa linked list. If it is just to show an example, > > then it is fine. > > Using what key? We have no knowledge about what the ematches want to > see or not. Ok, good question ;-> Maybe you should have own some 32 bit key? cheers, jamal From hadi@cyberus.ca Tue Jan 4 07:12:43 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 07:12:50 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04FCM6Y004421 for ; Tue, 4 Jan 2005 07:12:42 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1Cm1as-0005Np-7e for netdev@oss.sgi.com; Tue, 04 Jan 2005 22:12:18 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Cm1an-0006sZ-Mh; Tue, 04 Jan 2005 22:12:13 -0500 Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: netdev@oss.sgi.com In-Reply-To: <20050104223612.GN26856@postel.suug.ch> References: <20050103125635.GB26856@postel.suug.ch> <20050104223612.GN26856@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1104894728.1117.56.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 04 Jan 2005 22:12:08 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13390 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Tue, 2005-01-04 at 17:36, Thomas Graf wrote: > * TCF_EM_SIMPLE flag which marks an ematch config as simple, meaning > that the data consists of a u32 value. This is 1 of 2 parts i think thats still an issue; otherwise looks very good. Why do i need to signal something as simple? AND why does it have to be 32 bit type - what edge does that give you? I should be able to specify a struct with two 32 bits and encap it in a TLV and the classifier can treat it the same way - it knows the type and length - thats sufficient to create, destroy and dump. The other issue is still on the ematch/match interleaving i.e i should be able to say something along the lines: //simple slammer-worm or code-red ACL detector rule //using u32 classifier and ematches (match ip protocol udp port 1434 AND ematch packetlen minsize 404 maxsize 404) OR (match ip protocol tcp http AND ematch urlscanner "*.ida") action ipt -j ULOG "Virus detected and dropped" action drop Not a very good example - but you can see how powerfull this is when you can quickly use a string scanner such as the one you have as an ematch while maintaining u32 as is. cheers, jamal From hadi@cyberus.ca Tue Jan 4 07:20:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 07:20:20 -0800 (PST) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04FJolB005008 for ; Tue, 4 Jan 2005 07:20:11 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.30) id 1Cm1i4-00005l-DW for netdev@oss.sgi.com; Tue, 04 Jan 2005 22:19:44 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Cm1hv-0007wP-Ir; Tue, 04 Jan 2005 22:19:35 -0500 Subject: Re: [patch 4/10] s390: network driver. From: jamal Reply-To: hadi@cyberus.ca To: Jeff Garzik Cc: Thomas Spatzier , "David S. Miller" , Hasso Tepper , Herbert Xu , netdev@oss.sgi.com, Paul Jakma , Tommy Christensen In-Reply-To: <41DB26A6.2070008@pobox.com> References: <1104764710.1048.580.camel@jzny.localdomain> <41DB26A6.2070008@pobox.com> Content-Type: multipart/mixed; boundary="=-0846Th3rEGC6QKddUtsg" Organization: jamalopolous Message-Id: <1104895169.1117.63.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 04 Jan 2005 22:19:29 -0500 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13391 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev --=-0846Th3rEGC6QKddUtsg Content-Type: text/plain Content-Transfer-Encoding: 7bit On Tue, 2005-01-04 at 18:28, Jeff Garzik wrote: > jamal wrote: > > The change is simple if theres consensus to go this path. > > Can you resend your patch? I didnt send any patch - but heres one that looks right - havent tried compiling it. > My main objection was that any change should be made in the core, not in > individual net drivers. Attached patch resolves that concern > Another objection was that it seemed that some of the proposed solutions > for clearing the queue on link down were imposing app-specific policy on > the overall kernel. > > Aren't there cases where people would -not- want the queue to be cleared? Thats a good question and your point of imposing policy in the kernel is valid. I know that i would probably want packets to appear they are going out when the wire is pulled from underneath me. Theres possibly people who would want it differently - so for we havent heard from them. Maybe poll far and wide - or push it in and wait for them to whine. cheers, jamal --=-0846Th3rEGC6QKddUtsg Content-Disposition: attachment; filename=nc.p Content-Type: text/plain; name=nc.p; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit --- 2610-bk1/net/sched/sch_generic.c 2005/01/05 01:21:04 1.1 +++ 2610-bk1/net/sched/sch_generic.c 2005/01/05 01:36:26 @@ -152,7 +152,7 @@ spin_lock(&dev->queue_lock); goto collision; } - } + } /* NETDEV_TX_BUSY - we need to requeue */ /* Release the driver */ @@ -162,6 +162,11 @@ } spin_lock(&dev->queue_lock); q = dev->qdisc; + if (!netif_carrier_ok(dev)) { + kfree_skb(skb); + q->qstats.drops++; + return -1; + } } /* Device kicked us out :( --=-0846Th3rEGC6QKddUtsg-- From imipak@yahoo.com Tue Jan 4 08:00:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 08:00:19 -0800 (PST) Received: from web12303.mail.yahoo.com (web12303.mail.yahoo.com [216.136.173.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j04FxrMC006486 for ; Tue, 4 Jan 2005 08:00:13 -0800 Received: (qmail 38740 invoked by uid 60001); 5 Jan 2005 03:59:46 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=xdOT+6FehLtWodBHcdQK7bJ1yfD/vwQW5NOfBNFMkxfV9O2MV9gZCtggTkp9E4y6fCb5lqEZg7fF/LiGpqoJaYE4bUIQmjLbGb3Pj6tZJM+KieveNoG40vPg6vLikeerP8sep3muEqkepiABWuA1Kqn45llQUNCbCvxd7a/PATg= ; Message-ID: <20050105035946.38738.qmail@web12303.mail.yahoo.com> Received: from [65.102.7.124] by web12303.mail.yahoo.com via HTTP; Tue, 04 Jan 2005 19:59:46 PST Date: Tue, 4 Jan 2005 19:59:46 -0800 (PST) From: Jonathan Day Subject: Re: [LARTC] Scheduler Mechnisms! To: Zhenyu Wu , netdev@oss.sgi.com Cc: lartc@mailman.ds9a.nl In-Reply-To: <304889647.25037@njupt.edu.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13392 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: imipak@yahoo.com Precedence: bulk X-list: netdev I may be wrong on this, but I believe that RED can be attached to any queueing system, including the basic FIFO queues. In a sense, you're still using a scheduling system, when using the default arrangement, it's just a first-come, first-served one. RED is classless and applies to the whole of a queue. What that queue is attached to, if I understand it correctly, isn't important. It can be a class, but it can just as easily be everything going through that device. Again, someone correct me if I'm wrong, but as I understand it, there are four levels to the whole QoS/diffserv concept. One of these levels is the queueing discipline. This can be something like CBQ, WFQ, FIFO, PRIO, or whatever. This is how the data is organized, it does not describe how the data is sent. In the case of something like CBQ, you have a defined set of queues in parallel, with rules as to what packets fall into what queue. On the other hand, queueing schemes such as FIFO are flat. There's a single queue that everything goes through, though there may be different rules for how things get pushed to it. Another level is the scheduling mechanism. This describes how the data is sent, once organized, but does not describe the organization itself. If you've only one queue, then there's really not much to schedule. If you've multiple queues, then it's fairly normal to use "round robin" or "weighted round robin" to pick which queue to pull a packet from. Linux' CBQ uses "weighted round robin", according to the C file. The next level is the packet dropping mechanism. When queues flood, packets are going to be dropped. There's nowhere to store them. I'm pretty sure the default behaviour is to simply continue accepting packets, but to drop any that expire before being sent or which fall off the end of the queue (if the queue is bounded). RED, GRED, and a whole host of similar mechanisms, try to drop packets in a more controlled manner. However, that is really all they do. Finally, there are mechanisms for damping overly active applications, such as ECN. The idea here is that if you throttle back whatever is generating excess traffic, you don't get the problems assoicated with dealing with it. The "default" behaviour is to do nothing. When setting up QoS - on Linux or anything else - you basically pick one of each of the four categories to assemble a packet delivery system. Even without QoS, you're doing that, you're just using the defaults in all cases. The mechanisms are still going to be there. The Linux configuration menu does NOT match the above terminology, or the terminology in the source code. Thus, the source code identifies CBQ as a queueing discipline, but the configuration menu calls it a scheduler. The QoS help is also not very helpful, as it mostly tells people to look at the source. However, if you look at the source for CBQ or RED, for example, the explanation is relative to the cited papers, so you then have to go and read those before coming back and doing anything. This is one area I hope is going to get resolved in the reasonably near future. If not, I might have to come up with a patch myself. The very thought of that should send shivers down the spines of any kernel developers out there. Jonathan --- Zhenyu Wu wrote: > Thank you very much, i will try to find these papers > which must be very helpful > for me. The "more" means that whether there are > other mechanisms not only for > Linux. Sorry, i have not make it clear! Sometimes, i > wonder whether the qdiscs > such as CBQ, RED, GRED ... are belong to the > scheduler mechanisms in linux > enviroment. For example, In Red, which i can find > are enqueue, and dequeue.... so, > if i add a RED qidsc to a class, must i add a > scheduler mechanism so that i can > decide which packet in the queues will be scheduled > and put to the link? > > Good luck, > Best, __________________________________ Do you Yahoo!? The all-new My Yahoo! - What will yours do? http://my.yahoo.com From akpm@osdl.org Tue Jan 4 09:59:56 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 10:00:03 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04Hxalj016045 for ; Tue, 4 Jan 2005 09:59:56 -0800 Received: from bix (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id j055xL614574; Tue, 4 Jan 2005 21:59:21 -0800 Date: Tue, 4 Jan 2005 21:59:13 -0800 From: Andrew Morton To: Jeff Garzik , "David S. Miller" Cc: netdev@oss.sgi.com Subject: net patches Message-Id: <20050104215913.274e6567.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13393 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev I'll unload some accumulated net patches. I can't say that I've looked at them very closely. From akpm@osdl.org Tue Jan 4 10:00:17 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 10:00:31 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04Hxui9016054 for ; Tue, 4 Jan 2005 10:00:16 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j055xh614717; Tue, 4 Jan 2005 21:59:43 -0800 Message-Id: <200501050559.j055xh614717@mail.osdl.org> Subject: [patch 08/10] r8169: reduce max MTU for large frames To: jgarzik@pobox.com Cc: davem@davemloft.net, netdev@oss.sgi.com, akpm@osdl.org, romieu@fr.zoreil.com From: akpm@osdl.org Date: Tue, 04 Jan 2005 21:59:34 -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13397 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev From: Francois Romieu The device does not support the whole mtu range it claims. Experimenting with the Tx threshold and/or the PCI burst size does not seem to improve the behavior. Signed-off-by: Francois Romieu Signed-off-by: Andrew Morton --- 25-akpm/drivers/net/r8169.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff -puN drivers/net/r8169.c~r8169-reduce-max-mtu-for-large-frames drivers/net/r8169.c --- 25/drivers/net/r8169.c~r8169-reduce-max-mtu-for-large-frames 2005-01-04 21:57:36.322612408 -0800 +++ 25-akpm/drivers/net/r8169.c 2005-01-04 21:57:44.698339104 -0800 @@ -112,7 +112,8 @@ static int multicast_filter_limit = 32; #define RX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ #define TX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ #define EarlyTxThld 0x3F /* 0x3F means NO early transmit */ -#define RxPacketMaxSize 0x3FE8 /* 16K - 1 - ETH_HLEN - VLAN - CRC */ +#define RxPacketMaxSize 0x3FE8 /* 16K - 1 - ETH_HLEN - VLAN - CRC... */ +#define SafeMtu 0x1c20 /* ... actually life sucks beyond ~7k */ #define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */ #define R8169_REGS_SIZE 256 @@ -1593,7 +1594,7 @@ static int rtl8169_change_mtu(struct net struct rtl8169_private *tp = netdev_priv(dev); int ret = 0; - if (new_mtu < ETH_ZLEN || new_mtu > RxPacketMaxSize) + if (new_mtu < ETH_ZLEN || new_mtu > SafeMtu) return -EINVAL; dev->mtu = new_mtu; _ From akpm@osdl.org Tue Jan 4 10:00:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 10:00:16 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04HxnQr016047 for ; Tue, 4 Jan 2005 10:00:09 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j055xZ614657; Tue, 4 Jan 2005 21:59:35 -0800 Message-Id: <200501050559.j055xZ614657@mail.osdl.org> Subject: [patch 01/10] xircom_tulip_cb.c build fix To: jgarzik@pobox.com Cc: davem@davemloft.net, netdev@oss.sgi.com, akpm@osdl.org, bero@arklinux.org, bunk@stusta.de From: akpm@osdl.org Date: Tue, 04 Jan 2005 21:59:26 -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13394 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev From: Bernhard Rosenkraenzer , Adrian Bunk - Define `debug' before using it. - remove now-unneeded module_parm_array hack. Signed-off-by: Andrew Morton --- 25-akpm/drivers/net/tulip/xircom_tulip_cb.c | 19 +++++++++---------- 1 files changed, 9 insertions(+), 10 deletions(-) diff -puN drivers/net/tulip/xircom_tulip_cb.c~xircom_tulip_cb-build-fix drivers/net/tulip/xircom_tulip_cb.c --- 25/drivers/net/tulip/xircom_tulip_cb.c~xircom_tulip_cb-build-fix 2005-01-04 21:54:38.251683304 -0800 +++ 25-akpm/drivers/net/tulip/xircom_tulip_cb.c 2005-01-04 21:54:41.815141576 -0800 @@ -33,6 +33,13 @@ /* A few user-configurable values. */ +#define xircom_debug debug +#ifdef XIRCOM_DEBUG +static int xircom_debug = XIRCOM_DEBUG; +#else +static int xircom_debug = 1; +#endif + /* Maximum events (Rx packets, etc.) to handle at each interrupt. */ static int max_interrupt_work = 25; @@ -124,19 +131,11 @@ module_param(max_interrupt_work, int, 0) module_param(rx_copybreak, int, 0); module_param(csr0, int, 0); -static int num_units; -module_param_array(options, num_units, int, 0); -module_param_array(full_duplex, num_units, int, 0); +module_param_array(options, int, NULL, 0); +module_param_array(full_duplex, int, NULL, 0); #define RUN_AT(x) (jiffies + (x)) -#define xircom_debug debug -#ifdef XIRCOM_DEBUG -static int xircom_debug = XIRCOM_DEBUG; -#else -static int xircom_debug = 1; -#endif - /* Theory of Operation _ From akpm@osdl.org Tue Jan 4 10:00:18 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 10:00:32 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04Hxvhm016055 for ; Tue, 4 Jan 2005 10:00:18 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j055xi614722; Tue, 4 Jan 2005 21:59:44 -0800 Message-Id: <200501050559.j055xi614722@mail.osdl.org> Subject: [patch 09/10] r8169: oversized driver field for ethtool To: jgarzik@pobox.com Cc: davem@davemloft.net, netdev@oss.sgi.com, akpm@osdl.org, romieu@fr.zoreil.com, rich@phekda.gotadsl.co.uk From: akpm@osdl.org Date: Tue, 04 Jan 2005 21:59:35 -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13398 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev From: Francois Romieu Reported by Richard Dawe : - RTL8169_DRIVER_NAME contains more than the 32 characters allowed for the driver field; - remove RTL8169_DRIVER_NAME as it is only used once. Signed-off-by: Francois Romieu Signed-off-by: Andrew Morton --- 25-akpm/drivers/net/r8169.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff -puN drivers/net/r8169.c~r8169-oversized-driver-field-for-ethtool drivers/net/r8169.c --- 25/drivers/net/r8169.c~r8169-oversized-driver-field-for-ethtool 2005-01-04 21:57:36.451592800 -0800 +++ 25-akpm/drivers/net/r8169.c 2005-01-04 21:57:36.455592192 -0800 @@ -63,7 +63,6 @@ VERSION 1.6LK <2004/04/14> #define RTL8169_VERSION "1.6LK" #define MODULENAME "r8169" -#define RTL8169_DRIVER_NAME MODULENAME " Gigabit Ethernet driver " RTL8169_VERSION #define PFX MODULENAME ": " #ifdef RTL8169_DEBUG @@ -564,8 +563,8 @@ static void rtl8169_get_drvinfo(struct n { struct rtl8169_private *tp = netdev_priv(dev); - strcpy(info->driver, RTL8169_DRIVER_NAME); - strcpy(info->version, RTL8169_VERSION ); + strcpy(info->driver, MODULENAME); + strcpy(info->version, RTL8169_VERSION); strcpy(info->bus_info, pci_name(tp->pci_dev)); } @@ -1282,7 +1281,8 @@ rtl8169_init_one(struct pci_dev *pdev, c board_idx++; if (!printed_version) { - printk(KERN_INFO RTL8169_DRIVER_NAME " loaded\n"); + printk(KERN_INFO "%s Gigabit Ethernet driver %s loaded\n", + MODULENAME, RTL8169_VERSION); printed_version = 1; } _ From akpm@osdl.org Tue Jan 4 10:00:12 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 10:00:19 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04Hxpck016050 for ; Tue, 4 Jan 2005 10:00:12 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j055xb614676; Tue, 4 Jan 2005 21:59:37 -0800 Message-Id: <200501050559.j055xb614676@mail.osdl.org> Subject: [patch 03/10] pcnet32: 79c976 with fiber optic fix To: jgarzik@pobox.com Cc: davem@davemloft.net, netdev@oss.sgi.com, akpm@osdl.org, agx@sigxcpu.org, lars@segv.dk From: akpm@osdl.org Date: Tue, 04 Jan 2005 21:59:28 -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13396 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev From: Guido Guenther , Lars Munch Skip PHY selection on Allied Telesyn 2701FX, it looses the link otherwise. Fix up the AT 2701 as well. Signed-Off-By: Guido Guenther Signed-off-by: Andrew Morton --- 25-akpm/drivers/net/pcnet32.c | 47 ++++++++++++++++++++++++---------------- 25-akpm/include/linux/pci_ids.h | 5 ++++ 2 files changed, 34 insertions(+), 18 deletions(-) diff -puN drivers/net/pcnet32.c~pcnet32-79c976-with-fiber-optic drivers/net/pcnet32.c --- 25/drivers/net/pcnet32.c~pcnet32-79c976-with-fiber-optic 2005-01-04 21:57:35.666712120 -0800 +++ 25-akpm/drivers/net/pcnet32.c 2005-01-04 21:57:35.673711056 -0800 @@ -1429,25 +1429,36 @@ pcnet32_open(struct net_device *dev) val |= 0x10; lp->a.write_csr (ioaddr, 124, val); - /* 24 Jun 2004 according AMD, in order to change the PHY, - * DANAS (or DISPM for 79C976) must be set; then select the speed, - * duplex, and/or enable auto negotiation, and clear DANAS */ - if (lp->mii && !(lp->options & PCNET32_PORT_ASEL)) { - lp->a.write_bcr(ioaddr, 32, lp->a.read_bcr(ioaddr, 32) | 0x0080); - /* disable Auto Negotiation, set 10Mpbs, HD */ - val = lp->a.read_bcr(ioaddr, 32) & ~0xb8; - if (lp->options & PCNET32_PORT_FD) - val |= 0x10; - if (lp->options & PCNET32_PORT_100) - val |= 0x08; - lp->a.write_bcr (ioaddr, 32, val); + /* Allied Telesyn AT 2700/2701 FX looses the link, so skip that */ + if (lp->pci_dev->subsystem_vendor == PCI_VENDOR_ID_AT && + (lp->pci_dev->subsystem_device == PCI_SUBDEVICE_ID_AT_2700FX || + lp->pci_dev->subsystem_device == PCI_SUBDEVICE_ID_AT_2701FX)) { + printk(KERN_DEBUG "pcnet32: Skipping PHY selection.\n"); } else { - if (lp->options & PCNET32_PORT_ASEL) { - lp->a.write_bcr(ioaddr, 32, lp->a.read_bcr(ioaddr, 32) | 0x0080); - /* enable auto negotiate, setup, disable fd */ - val = lp->a.read_bcr(ioaddr, 32) & ~0x98; - val |= 0x20; - lp->a.write_bcr(ioaddr, 32, val); + /* + * 24 Jun 2004 according AMD, in order to change the PHY, + * DANAS (or DISPM for 79C976) must be set; then select the speed, + * duplex, and/or enable auto negotiation, and clear DANAS + */ + if (lp->mii && !(lp->options & PCNET32_PORT_ASEL)) { + lp->a.write_bcr(ioaddr, 32, + lp->a.read_bcr(ioaddr, 32) | 0x0080); + /* disable Auto Negotiation, set 10Mpbs, HD */ + val = lp->a.read_bcr(ioaddr, 32) & ~0xb8; + if (lp->options & PCNET32_PORT_FD) + val |= 0x10; + if (lp->options & PCNET32_PORT_100) + val |= 0x08; + lp->a.write_bcr (ioaddr, 32, val); + } else { + if (lp->options & PCNET32_PORT_ASEL) { + lp->a.write_bcr(ioaddr, 32, + lp->a.read_bcr(ioaddr, 32) | 0x0080); + /* enable auto negotiate, setup, disable fd */ + val = lp->a.read_bcr(ioaddr, 32) & ~0x98; + val |= 0x20; + lp->a.write_bcr(ioaddr, 32, val); + } } } diff -puN include/linux/pci_ids.h~pcnet32-79c976-with-fiber-optic include/linux/pci_ids.h --- 25/include/linux/pci_ids.h~pcnet32-79c976-with-fiber-optic 2005-01-04 21:57:35.669711664 -0800 +++ 25-akpm/include/linux/pci_ids.h 2005-01-04 21:57:35.676710600 -0800 @@ -1644,6 +1644,11 @@ #define PCI_DEVICE_ID_OPTIBASE_VPLEXCC 0x2120 #define PCI_DEVICE_ID_OPTIBASE_VQUEST 0x2130 +/* Allied Telesyn */ +#define PCI_VENDOR_ID_AT 0x1259 +#define PCI_SUBDEVICE_ID_AT_2700FX 0x2701 +#define PCI_SUBDEVICE_ID_AT_2701FX 0x2703 + #define PCI_VENDOR_ID_ESS 0x125d #define PCI_DEVICE_ID_ESS_ESS1968 0x1968 #define PCI_DEVICE_ID_ESS_AUDIOPCI 0x1969 _ From akpm@osdl.org Tue Jan 4 10:00:10 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 10:00:17 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04Hxov6016048 for ; Tue, 4 Jan 2005 10:00:10 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j055xa614669; Tue, 4 Jan 2005 21:59:36 -0800 Message-Id: <200501050559.j055xa614669@mail.osdl.org> Subject: [patch 02/10] net: Netconsole poll support for 3c509 To: jgarzik@pobox.com Cc: davem@davemloft.net, netdev@oss.sgi.com, akpm@osdl.org, kernel@kolivas.org From: akpm@osdl.org Date: Tue, 04 Jan 2005 21:59:27 -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13395 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev From: Con Kolivas This patch provides poll support to allow netconsole to work with 3c509 network cards. Status: Compiled, debugged and tested working by Michael Buesch. Signed-off-by: Con Kolivas Signed-off-by: Andrew Morton --- 25-akpm/drivers/net/3c509.c | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+) diff -puN drivers/net/3c509.c~net-netconsole-poll-support-for-3c509 drivers/net/3c509.c --- 25/drivers/net/3c509.c~net-netconsole-poll-support-for-3c509 2005-01-04 21:57:35.537731728 -0800 +++ 25-akpm/drivers/net/3c509.c 2005-01-04 21:57:35.542730968 -0800 @@ -209,6 +209,9 @@ static int el3_pm_callback(struct pm_dev #if defined(CONFIG_EISA) || defined(CONFIG_MCA) static int el3_device_remove (struct device *device); #endif +#ifdef CONFIG_NET_POLL_CONTROLLER +static void el3_poll_controller(struct net_device *dev); +#endif #ifdef CONFIG_EISA struct eisa_device_id el3_eisa_ids[] = { @@ -321,6 +324,9 @@ static int __init el3_common_init(struct dev->set_multicast_list = &set_multicast_list; dev->tx_timeout = el3_tx_timeout; dev->watchdog_timeo = TX_TIMEOUT; +#ifdef CONFIG_NET_POLL_CONTROLLER + dev->poll_controller = el3_poll_controller; +#endif SET_ETHTOOL_OPS(dev, ðtool_ops); err = register_netdev(dev); @@ -999,6 +1005,19 @@ el3_interrupt(int irq, void *dev_id, str } +#ifdef CONFIG_NET_POLL_CONTROLLER +/* + * Polling receive - used by netconsole and other diagnostic tools + * to allow network i/o with interrupts disabled. + */ +static void el3_poll_controller(struct net_device *dev) +{ + disable_irq(dev->irq); + el3_interrupt(dev->irq, dev, NULL); + enable_irq(dev->irq); +} +#endif + static struct net_device_stats * el3_get_stats(struct net_device *dev) { _ From akpm@osdl.org Tue Jan 4 10:00:19 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 10:00:33 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04HxwEP016056 for ; Tue, 4 Jan 2005 10:00:18 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j055xf614691; Tue, 4 Jan 2005 21:59:41 -0800 Message-Id: <200501050559.j055xf614691@mail.osdl.org> Subject: [patch 06/10] r8169: C 101 To: jgarzik@pobox.com Cc: davem@davemloft.net, netdev@oss.sgi.com, akpm@osdl.org, romieu@fr.zoreil.com From: akpm@osdl.org Date: Tue, 04 Jan 2005 21:59:32 -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13400 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev From: Francois Romieu Back to C101 and code which gives the expected result. Signed-off-by: Francois Romieu Signed-off-by: Andrew Morton --- 25-akpm/drivers/net/r8169.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN drivers/net/r8169.c~r8169-c-101 drivers/net/r8169.c --- 25/drivers/net/r8169.c~r8169-c-101 2005-01-04 21:57:36.066651320 -0800 +++ 25-akpm/drivers/net/r8169.c 2005-01-04 21:57:44.966298368 -0800 @@ -1979,7 +1979,7 @@ static void rtl8169_pcierr_interrupt(str PCI_STATUS_REC_TARGET_ABORT | PCI_STATUS_SIG_TARGET_ABORT)); /* The infamous DAC f*ckup only happens at boot time */ - if ((tp->cp_cmd & PCIDAC) && (tp->dirty_rx == tp->cur_rx == 0)) { + if ((tp->cp_cmd & PCIDAC) && !tp->dirty_rx && !tp->cur_rx) { printk(KERN_INFO PFX "%s: disabling PCI DAC.\n", dev->name); tp->cp_cmd &= ~PCIDAC; RTL_W16(CPlusCmd, tp->cp_cmd); _ From akpm@osdl.org Tue Jan 4 10:00:16 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 10:00:33 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04HxtML016052 for ; Tue, 4 Jan 2005 10:00:16 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j055xg614698; Tue, 4 Jan 2005 21:59:42 -0800 Message-Id: <200501050559.j055xg614698@mail.osdl.org> Subject: [patch 07/10] r8169: Large Send enablement To: jgarzik@pobox.com Cc: davem@davemloft.net, netdev@oss.sgi.com, akpm@osdl.org, romieu@fr.zoreil.com, jdmason@us.ibm.com From: akpm@osdl.org Date: Tue, 04 Jan 2005 21:59:33 -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13399 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev From: Francois Romieu Large Send enablement. Acked-by: Francois Romieu Signed-off-by: Jon Mason Signed-off-by: Andrew Morton --- 25-akpm/drivers/net/r8169.c | 80 ++++++++++++++++++++++++++++++++++++-------- 1 files changed, 67 insertions(+), 13 deletions(-) diff -puN drivers/net/r8169.c~r8169-large-send-enablement drivers/net/r8169.c --- 25/drivers/net/r8169.c~r8169-large-send-enablement 2005-01-04 21:57:36.194631864 -0800 +++ 25-akpm/drivers/net/r8169.c 2005-01-04 21:57:44.830319040 -0800 @@ -112,7 +112,7 @@ static int multicast_filter_limit = 32; #define RX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ #define TX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ #define EarlyTxThld 0x3F /* 0x3F means NO early transmit */ -#define RxPacketMaxSize 0x0800 /* Maximum size supported is 16K-1 */ +#define RxPacketMaxSize 0x3FE8 /* 16K - 1 - ETH_HLEN - VLAN - CRC */ #define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */ #define R8169_REGS_SIZE 256 @@ -427,6 +427,9 @@ static void rtl8169_tx_timeout(struct ne static struct net_device_stats *rtl8169_get_stats(struct net_device *netdev); static int rtl8169_rx_interrupt(struct net_device *, struct rtl8169_private *, void __iomem *); +static int rtl8169_change_mtu(struct net_device *netdev, int new_mtu); +static void rtl8169_down(struct net_device *dev); + #ifdef CONFIG_R8169_NAPI static int rtl8169_poll(struct net_device *dev, int *budget); #endif @@ -1238,8 +1241,6 @@ rtl8169_init_board(struct pci_dev *pdev, } tp->chipset = i; - tp->rx_buf_sz = RX_BUF_SIZE; - *ioaddr_out = ioaddr; *dev_out = dev; out: @@ -1321,6 +1322,7 @@ rtl8169_init_one(struct pci_dev *pdev, c dev->watchdog_timeo = RTL8169_TX_TIMEOUT; dev->irq = pdev->irq; dev->base_addr = (unsigned long) ioaddr; + dev->change_mtu = rtl8169_change_mtu; #ifdef CONFIG_R8169_NAPI dev->poll = rtl8169_poll; @@ -1449,13 +1451,22 @@ static int rtl8169_resume(struct pci_dev #endif /* CONFIG_PM */ -static int -rtl8169_open(struct net_device *dev) +static void rtl8169_set_rxbufsize(struct rtl8169_private *tp, + struct net_device *dev) +{ + unsigned int mtu = dev->mtu; + + tp->rx_buf_sz = (mtu > RX_BUF_SIZE) ? mtu + ETH_HLEN + 8 : RX_BUF_SIZE; +} + +static int rtl8169_open(struct net_device *dev) { struct rtl8169_private *tp = netdev_priv(dev); struct pci_dev *pdev = tp->pci_dev; int retval; + rtl8169_set_rxbufsize(tp, dev); + retval = request_irq(dev->irq, rtl8169_interrupt, SA_SHIRQ, dev->name, dev); if (retval < 0) @@ -1535,8 +1546,8 @@ rtl8169_hw_start(struct net_device *dev) RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); RTL_W8(EarlyTxThres, EarlyTxThld); - // For gigabit rtl8169 - RTL_W16(RxMaxSize, RxPacketMaxSize); + // For gigabit rtl8169, MTU + header + CRC + VLAN + RTL_W16(RxMaxSize, tp->rx_buf_sz); // Set Rx Config register i = rtl8169_rx_config | @@ -1577,6 +1588,37 @@ rtl8169_hw_start(struct net_device *dev) netif_start_queue(dev); } +static int rtl8169_change_mtu(struct net_device *dev, int new_mtu) +{ + struct rtl8169_private *tp = netdev_priv(dev); + int ret = 0; + + if (new_mtu < ETH_ZLEN || new_mtu > RxPacketMaxSize) + return -EINVAL; + + dev->mtu = new_mtu; + + if (!netif_running(dev)) + goto out; + + rtl8169_down(dev); + + rtl8169_set_rxbufsize(tp, dev); + + ret = rtl8169_init_ring(dev); + if (ret < 0) + goto out; + + rtl8169_hw_start(dev); + + netif_poll_enable(dev); + + rtl8169_request_timer(dev); + +out: + return ret; +} + static inline void rtl8169_make_unusable_by_asic(struct RxDesc *desc) { desc->addr = 0x0badbadbadbadbadull; @@ -2265,19 +2307,17 @@ static int rtl8169_poll(struct net_devic } #endif -static int -rtl8169_close(struct net_device *dev) +static void rtl8169_down(struct net_device *dev) { struct rtl8169_private *tp = netdev_priv(dev); - struct pci_dev *pdev = tp->pci_dev; void __iomem *ioaddr = tp->mmio_addr; + rtl8169_delete_timer(dev); + netif_stop_queue(dev); flush_scheduled_work(); - rtl8169_delete_timer(dev); - spin_lock_irq(&tp->lock); /* Stop the chip's Tx and Rx DMA processes. */ @@ -2292,13 +2332,27 @@ rtl8169_close(struct net_device *dev) spin_unlock_irq(&tp->lock); - free_irq(dev->irq, dev); + synchronize_irq(dev->irq); netif_poll_disable(dev); + /* Give a racing hard_start_xmit a few cycles to complete. */ + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(1); + rtl8169_tx_clear(tp); rtl8169_rx_clear(tp); +} + +static int rtl8169_close(struct net_device *dev) +{ + struct rtl8169_private *tp = netdev_priv(dev); + struct pci_dev *pdev = tp->pci_dev; + + rtl8169_down(dev); + + free_irq(dev->irq, dev); pci_free_consistent(pdev, R8169_RX_RING_BYTES, tp->RxDescArray, tp->RxPhyAddr); _ From akpm@osdl.org Tue Jan 4 10:00:23 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 10:00:37 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04I03t6016065 for ; Tue, 4 Jan 2005 10:00:23 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j055xe614686; Tue, 4 Jan 2005 21:59:40 -0800 Message-Id: <200501050559.j055xe614686@mail.osdl.org> Subject: [patch 05/10] r8169: missing netif_poll_enable and irq ack To: jgarzik@pobox.com Cc: davem@davemloft.net, netdev@oss.sgi.com, akpm@osdl.org, romieu@fr.zoreil.com From: akpm@osdl.org Date: Tue, 04 Jan 2005 21:59:31 -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13401 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev From: Francois Romieu - (noticed by Jon D. Mason) rtl8169_wait_for_quiescence() needs to disable the NAPI processing but it has no reason to lock any part of the driver which would try to do the same at a later time. Let's reenable NAPI processing as soon as possible. - properly ack any aborted interruption: a reset of the device is not always enough. Signed-off-by: Francois Romieu Signed-off-by: Andrew Morton --- 25-akpm/drivers/net/r8169.c | 9 +++++++++ 1 files changed, 9 insertions(+) diff -puN drivers/net/r8169.c~r8169-missing-netif_poll_enable-and-irq-ack drivers/net/r8169.c --- 25/drivers/net/r8169.c~r8169-missing-netif_poll_enable-and-irq-ack 2005-01-04 21:57:35.938670776 -0800 +++ 25-akpm/drivers/net/r8169.c 2005-01-04 21:57:45.096278608 -0800 @@ -1743,10 +1743,19 @@ static void rtl8169_schedule_work(struct static void rtl8169_wait_for_quiescence(struct net_device *dev) { + struct rtl8169_private *tp = netdev_priv(dev); + void __iomem *ioaddr = tp->mmio_addr; + synchronize_irq(dev->irq); /* Wait for any pending NAPI task to complete */ netif_poll_disable(dev); + + RTL_W16(IntrMask, 0x0000); + + RTL_W16(IntrStatus, 0xffff); + + netif_poll_enable(dev); } static void rtl8169_reinit_task(void *_data) _ From akpm@osdl.org Tue Jan 4 10:00:22 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 10:00:38 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04I02j9016063 for ; Tue, 4 Jan 2005 10:00:22 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j055xc614681; Tue, 4 Jan 2005 21:59:38 -0800 Message-Id: <200501050559.j055xc614681@mail.osdl.org> Subject: [patch 04/10] Multicast filtering for tun.c To: jgarzik@pobox.com Cc: davem@davemloft.net, netdev@oss.sgi.com, akpm@osdl.org, sjackman@gmail.com From: akpm@osdl.org Date: Tue, 04 Jan 2005 21:59:30 -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13402 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev From: Shaun Jackman This patch adds multicast filtering to the TUN network driver, for packets being sent from the network device to the character device. * drivers/net/tun.c: Add multicast filtering for packets travelling from the network device to the character device. * include/linux/if_tun.h (tun_struct): Add interface flags, a hardware device addres, and a multicast filter. Signed-off-by: Andrew Morton --- 25-akpm/drivers/net/tun.c | 151 +++++++++++++++++++++++++++++++++++++---- 25-akpm/include/linux/if_tun.h | 5 + 2 files changed, 144 insertions(+), 12 deletions(-) diff -puN drivers/net/tun.c~multicast-filtering-for-tunc drivers/net/tun.c --- 25/drivers/net/tun.c~multicast-filtering-for-tunc 2005-01-04 21:57:35.804691144 -0800 +++ 25-akpm/drivers/net/tun.c 2005-01-04 21:57:35.810690232 -0800 @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -104,11 +105,42 @@ drop: return 0; } -static void tun_net_mclist(struct net_device *dev) +/** Add the specified Ethernet address to this multicast filter. */ +static void +add_multi(u32* filter, const u8* addr) { - /* Nothing to do for multicast filters. - * We always accept all frames. */ - return; + int bit_nr = ether_crc(ETH_ALEN, addr) >> 26; + filter[bit_nr >> 5] |= 1 << (bit_nr & 31); +} + +/** Remove the specified Ethernet addres from this multicast filter. */ +static void +del_multi(u32* filter, const u8* addr) +{ + int bit_nr = ether_crc(ETH_ALEN, addr) >> 26; + filter[bit_nr >> 5] &= ~(1 << (bit_nr & 31)); +} + +/** Update the list of multicast groups to which the network device belongs. + * This list is used to filter packets being sent from the character device to + * the network device. */ +static void +tun_net_mclist(struct net_device *dev) +{ + struct tun_struct *tun = netdev_priv(dev); + const struct dev_mc_list *mclist; + int i; + DBG(KERN_DEBUG "%s: tun_net_mclist: mc_count %d\n", + dev->name, dev->mc_count); + memset(tun->chr_filter, 0, sizeof tun->chr_filter); + for (i = 0, mclist = dev->mc_list; i < dev->mc_count && mclist != NULL; + i++, mclist = mclist->next) { + add_multi(tun->net_filter, mclist->dmi_addr); + DBG(KERN_DEBUG "%s: tun_net_mclist: %x:%x:%x:%x:%x:%x\n", + dev->name, + mclist->dmi_addr[0], mclist->dmi_addr[1], mclist->dmi_addr[2], + mclist->dmi_addr[3], mclist->dmi_addr[4], mclist->dmi_addr[5]); + } } static struct net_device_stats *tun_net_stats(struct net_device *dev) @@ -301,6 +333,10 @@ static ssize_t tun_chr_readv(struct file add_wait_queue(&tun->read_wait, &wait); while (len) { + const u8 ones[ ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; + u8 addr[ ETH_ALEN]; + int bit_nr; + current->state = TASK_INTERRUPTIBLE; /* Read frames from the queue */ @@ -320,10 +356,37 @@ static ssize_t tun_chr_readv(struct file } netif_start_queue(tun->dev); - ret = tun_put_user(tun, skb, (struct iovec *) iv, len); - - kfree_skb(skb); - break; + /** Decide whether to accept this packet. This code is designed to + * behave identically to an Ethernet interface. Accept the packet if + * - we are promiscuous. + * - the packet is addressed to us. + * - the packet is broadcast. + * - the packet is multicast and + * - we are multicast promiscous. + * - we belong to the multicast group. + */ + memcpy(addr, skb->data, min(sizeof addr, skb->len)); + bit_nr = ether_crc(sizeof addr, addr) >> 26; + if ((tun->if_flags & IFF_PROMISC) || + memcmp(addr, tun->dev_addr, sizeof addr) == 0 || + memcmp(addr, ones, sizeof addr) == 0 || + (((addr[0] == 1 && addr[1] == 0 && addr[2] == 0x5e) || + (addr[0] == 0x33 && addr[1] == 0x33)) && + ((tun->if_flags & IFF_ALLMULTI) || + (tun->chr_filter[bit_nr >> 5] & (1 << (bit_nr & 31)))))) { + DBG(KERN_DEBUG "%s: tun_chr_readv: accepted: %x:%x:%x:%x:%x:%x\n", + tun->dev->name, addr[0], addr[1], addr[2], + addr[3], addr[4], addr[5]); + ret = tun_put_user(tun, skb, (struct iovec *) iv, len); + kfree_skb(skb); + break; + } else { + DBG(KERN_DEBUG "%s: tun_chr_readv: rejected: %x:%x:%x:%x:%x:%x\n", + tun->dev->name, addr[0], addr[1], addr[2], + addr[3], addr[4], addr[5]); + kfree_skb(skb); + continue; + } } current->state = TASK_RUNNING; @@ -417,6 +480,12 @@ static int tun_set_iff(struct file *file tun = netdev_priv(dev); tun->dev = dev; tun->flags = flags; + /* Be promiscuous by default to maintain previous behaviour. */ + tun->if_flags = IFF_PROMISC; + /* Generate random Ethernet address. */ + *(u16 *)tun->dev_addr = htons(0x00FF); + get_random_bytes(tun->dev_addr + sizeof(u16), 4); + memset(tun->chr_filter, 0, sizeof tun->chr_filter); tun_net_init(dev); @@ -457,13 +526,16 @@ static int tun_chr_ioctl(struct inode *i unsigned int cmd, unsigned long arg) { struct tun_struct *tun = file->private_data; + void __user* argp = (void __user*)arg; + struct ifreq ifr; + + if (cmd == TUNSETIFF || _IOC_TYPE(cmd) == 0x89) + if (copy_from_user(&ifr, argp, sizeof ifr)) + return -EFAULT; if (cmd == TUNSETIFF && !tun) { - struct ifreq ifr; int err; - if (copy_from_user(&ifr, (void __user *)arg, sizeof(ifr))) - return -EFAULT; ifr.ifr_name[IFNAMSIZ-1] = '\0'; rtnl_lock(); @@ -473,7 +545,7 @@ static int tun_chr_ioctl(struct inode *i if (err) return err; - if (copy_to_user((void __user *)arg, &ifr, sizeof(ifr))) + if (copy_to_user(argp, &ifr, sizeof(ifr))) return -EFAULT; return 0; } @@ -519,6 +591,61 @@ static int tun_chr_ioctl(struct inode *i break; #endif + case SIOCGIFFLAGS: + ifr.ifr_flags = tun->if_flags; + if (copy_to_user( argp, &ifr, sizeof ifr)) + return -EFAULT; + return 0; + + case SIOCSIFFLAGS: + /** Set the character device's interface flags. Currently only + * IFF_PROMISC and IFF_ALLMULTI are used. */ + tun->if_flags = ifr.ifr_flags; + DBG(KERN_INFO "%s: interface flags 0x%lx\n", + tun->dev->name, tun->if_flags); + return 0; + + case SIOCGIFHWADDR: + memcpy(ifr.ifr_hwaddr.sa_data, tun->dev_addr, + min(sizeof ifr.ifr_hwaddr.sa_data, sizeof tun->dev_addr)); + if (copy_to_user( argp, &ifr, sizeof ifr)) + return -EFAULT; + return 0; + + case SIOCSIFHWADDR: + /** Set the character device's hardware address. This is used when + * filtering packets being sent from the network device to the character + * device. */ + memcpy(tun->dev_addr, ifr.ifr_hwaddr.sa_data, + min(sizeof ifr.ifr_hwaddr.sa_data, sizeof tun->dev_addr)); + DBG(KERN_DEBUG "%s: set hardware address: %x:%x:%x:%x:%x:%x\n", + tun->dev->name, + tun->dev_addr[0], tun->dev_addr[1], tun->dev_addr[2], + tun->dev_addr[3], tun->dev_addr[4], tun->dev_addr[5]); + return 0; + + case SIOCADDMULTI: + /** Add the specified group to the character device's multicast filter + * list. */ + add_multi(tun->chr_filter, ifr.ifr_hwaddr.sa_data); + DBG(KERN_DEBUG "%s: add multi: %x:%x:%x:%x:%x:%x\n", + tun->dev->name, + (u8)ifr.ifr_hwaddr.sa_data[0], (u8)ifr.ifr_hwaddr.sa_data[1], + (u8)ifr.ifr_hwaddr.sa_data[2], (u8)ifr.ifr_hwaddr.sa_data[3], + (u8)ifr.ifr_hwaddr.sa_data[4], (u8)ifr.ifr_hwaddr.sa_data[5]); + return 0; + + case SIOCDELMULTI: + /** Remove the specified group from the character device's multicast + * filter list. */ + del_multi(tun->chr_filter, ifr.ifr_hwaddr.sa_data); + DBG(KERN_DEBUG "%s: del multi: %x:%x:%x:%x:%x:%x\n", + tun->dev->name, + (u8)ifr.ifr_hwaddr.sa_data[0], (u8)ifr.ifr_hwaddr.sa_data[1], + (u8)ifr.ifr_hwaddr.sa_data[2], (u8)ifr.ifr_hwaddr.sa_data[3], + (u8)ifr.ifr_hwaddr.sa_data[4], (u8)ifr.ifr_hwaddr.sa_data[5]); + return 0; + default: return -EINVAL; }; diff -puN include/linux/if_tun.h~multicast-filtering-for-tunc include/linux/if_tun.h --- 25/include/linux/if_tun.h~multicast-filtering-for-tunc 2005-01-04 21:57:35.805690992 -0800 +++ 25-akpm/include/linux/if_tun.h 2005-01-04 21:57:35.810690232 -0800 @@ -45,6 +45,11 @@ struct tun_struct { struct fasync_struct *fasync; + unsigned long if_flags; + u8 dev_addr[ETH_ALEN]; + u32 chr_filter[2]; + u32 net_filter[2]; + #ifdef TUN_DEBUG int debug; #endif _ From akpm@osdl.org Tue Jan 4 10:00:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 10:00:41 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04I08ZW016078 for ; Tue, 4 Jan 2005 10:00:28 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j055xj614727; Tue, 4 Jan 2005 21:59:45 -0800 Message-Id: <200501050559.j055xj614727@mail.osdl.org> Subject: [patch 10/10] EMAC: fix ibm_emac autonegotiation result parsing To: jgarzik@pobox.com Cc: davem@davemloft.net, netdev@oss.sgi.com, akpm@osdl.org, mporter@kernel.crashing.org, ebs@ebshome.net From: akpm@osdl.org Date: Tue, 04 Jan 2005 21:59:36 -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13403 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev From: Matt Porter Fix aneg result parsing in ibm_emac driver. Signed-off-by: Eugene Surovegin Signed-off-by: Matt Porter Signed-off-by: Andrew Morton --- 25-akpm/drivers/net/ibm_emac/ibm_emac_phy.c | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 deletions(-) diff -puN drivers/net/ibm_emac/ibm_emac_phy.c~fix-ibm_emac-autonegotiation-result-parsing drivers/net/ibm_emac/ibm_emac_phy.c --- 25/drivers/net/ibm_emac/ibm_emac_phy.c~fix-ibm_emac-autonegotiation-result-parsing 2005-01-04 21:57:36.578573496 -0800 +++ 25-akpm/drivers/net/ibm_emac/ibm_emac_phy.c 2005-01-04 21:57:36.581573040 -0800 @@ -191,17 +191,18 @@ static int genmii_read_link(struct mii_p u16 lpa; if (phy->autoneg) { - lpa = phy_read(phy, MII_LPA); + lpa = phy_read(phy, MII_LPA) & phy_read(phy, MII_ADVERTISE); - if (lpa & (LPA_10FULL | LPA_100FULL)) - phy->duplex = DUPLEX_FULL; - else - phy->duplex = DUPLEX_HALF; - if (lpa & (LPA_100FULL | LPA_100HALF)) - phy->speed = SPEED_100; - else - phy->speed = SPEED_10; + phy->speed = SPEED_10; + phy->duplex = DUPLEX_HALF; phy->pause = 0; + + if (lpa & (LPA_100FULL | LPA_100HALF)) { + phy->speed = SPEED_100; + if (lpa & LPA_100FULL) + phy->duplex = DUPLEX_FULL; + } else if (lpa & LPA_10FULL) + phy->duplex = DUPLEX_FULL; } /* On non-aneg, we assume what we put in BMCR is the speed, * though magic-aneg shouldn't prevent this case from occurring _ From akpm@osdl.org Tue Jan 4 10:02:18 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 10:02:24 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04I1u0o018289 for ; Tue, 4 Jan 2005 10:02:16 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0561h615068; Tue, 4 Jan 2005 22:01:43 -0800 Message-Id: <200501050601.j0561h615068@mail.osdl.org> Subject: [patch 1/1] ixgb LR card support To: jgarzik@pobox.com Cc: netdev@oss.sgi.com, akpm@osdl.org, aafes@psu.edu From: akpm@osdl.org Date: Tue, 04 Jan 2005 22:01:34 -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13404 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev From: Phil Sorber This enables the ixgb driver to be used for LR cards as well. Signed-off-by: Andrew Morton --- 25-akpm/drivers/net/ixgb/ixgb_hw.c | 1 + 25-akpm/drivers/net/ixgb/ixgb_ids.h | 1 + 25-akpm/drivers/net/ixgb/ixgb_main.c | 5 ++++- 3 files changed, 6 insertions(+), 1 deletion(-) diff -puN drivers/net/ixgb/ixgb_hw.c~ixgb-lr-card-support drivers/net/ixgb/ixgb_hw.c --- 25/drivers/net/ixgb/ixgb_hw.c~ixgb-lr-card-support 2004-11-22 20:33:33.912389136 -0800 +++ 25-akpm/drivers/net/ixgb/ixgb_hw.c 2004-11-22 20:33:33.920387920 -0800 @@ -198,6 +198,7 @@ static ixgb_phy_type ixgb_identify_phy(s break; case IXGB_DEVICE_ID_82597EX_SR: + case IXGB_DEVICE_ID_82597EX_LR: /* The SR adapters carry two different types of XPAK optics * modules; read the vendor identifier to determine the exact * type of optics. */ diff -puN drivers/net/ixgb/ixgb_ids.h~ixgb-lr-card-support drivers/net/ixgb/ixgb_ids.h --- 25/drivers/net/ixgb/ixgb_ids.h~ixgb-lr-card-support 2004-11-22 20:33:33.914388832 -0800 +++ 25-akpm/drivers/net/ixgb/ixgb_ids.h 2004-11-22 20:33:33.920387920 -0800 @@ -38,6 +38,7 @@ #define IXGB_DEVICE_ID_82597EX 0x1048 #define IXGB_DEVICE_ID_82597EX_SR 0x1A48 +#define IXGB_DEVICE_ID_82597EX_LR 0x1B48 #define IXGB_SUBDEVICE_ID_A11F 0xA11F #define IXGB_SUBDEVICE_ID_A01F 0xA01F diff -puN drivers/net/ixgb/ixgb_main.c~ixgb-lr-card-support drivers/net/ixgb/ixgb_main.c --- 25/drivers/net/ixgb/ixgb_main.c~ixgb-lr-card-support 2004-11-22 20:33:33.916388528 -0800 +++ 25-akpm/drivers/net/ixgb/ixgb_main.c 2004-11-22 20:33:33.922387616 -0800 @@ -46,6 +46,8 @@ static struct pci_device_id ixgb_pci_tbl PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {INTEL_VENDOR_ID, IXGB_DEVICE_ID_82597EX_SR, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {INTEL_VENDOR_ID, IXGB_DEVICE_ID_82597EX_LR, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* required last entry */ {0,} @@ -511,7 +513,8 @@ static int __devinit ixgb_sw_init(struct hw->max_frame_size = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH; if ((hw->device_id == IXGB_DEVICE_ID_82597EX) - || (hw->device_id == IXGB_DEVICE_ID_82597EX_SR)) + || (hw->device_id == IXGB_DEVICE_ID_82597EX_SR) + || (hw->device_id == IXGB_DEVICE_ID_82597EX_LR)) hw->mac_type = ixgb_82597; else { /* should never have loaded on this device */ _ From paul@clubi.ie Tue Jan 4 10:28:41 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 10:28:48 -0800 (PST) Received: from hibernia.jakma.org (IDENT:U2FsdGVkX1/mC2+jilYpFQM9ggWyKSc+O21ghiOswKQ@hibernia.jakma.org [212.17.55.49]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04ISJQe022251 for ; Tue, 4 Jan 2005 10:28:40 -0800 Received: from hibernia.jakma.org (IDENT:U2FsdGVkX19RMg9cCxCWw42Z405+sYLrPghtd9J7QEg@hibernia.jakma.org [192.168.0.3]) by hibernia.jakma.org (8.13.1/8.12.11) with ESMTP id j056QXfN006795; Wed, 5 Jan 2005 06:26:33 GMT Date: Wed, 5 Jan 2005 06:26:32 +0000 (GMT) From: Paul Jakma X-X-Sender: paul@hibernia.jakma.org To: Jeff Garzik cc: hadi@cyberus.ca, Thomas Spatzier , "David S. Miller" , Hasso Tepper , Herbert Xu , netdev@oss.sgi.com, Tommy Christensen Subject: Re: [patch 4/10] s390: network driver. In-Reply-To: <41DB26A6.2070008@pobox.com> Message-ID: References: <1104764710.1048.580.camel@jzny.localdomain> <41DB26A6.2070008@pobox.com> Mail-Followup-To: paul@hibernia.jakma.org X-NSA: arafat al aqsar jihad musharef jet-A1 avgas ammonium qran inshallah allah al-akbar martyr iraq saddam hammas hisballah rabin ayatollah korea vietnam revolt mustard gas british airways washington MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: ClamAV 0.80/634/Sun Dec 19 21:21:52 2004 clamav-milter version 0.80j on hibernia.jakma.org X-Virus-Status: Clean X-Virus-Status: Clean X-archive-position: 13405 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: paul@clubi.ie Precedence: bulk X-list: netdev On Tue, 4 Jan 2005, Jeff Garzik wrote: > Aren't there cases where people would -not- want the queue to be > cleared? Why *do* you want the queue to be cleared? (avoiding NIC /dev/null is only reason right?) TCP (AIUI) has its owns means to resend. Most (all?) other transports have *never* had an expectation of such reliability. Applications *know* they have to provide their own reliability. Queueing and later sending (by then) stale packets is *bad* Think: - heartbeat applications - Router or route advertisements (IPv6 RA, IPv4 ICMP IRDP, RIP) - Streaming media (ok, not much damage here, but still there's simply no point queueing while link is down..) Why queue packets on behalf of applications which have no expectation of kernel doing this (any application expecting such is certainlty broken) and which very likely implement their own reliability or packet-loss recovery strategies? Particularly when queueing is quite possibly *detrimental* to what the application is trying to achieve (timely sending of packets). If an application wants reliable sending of packets, it will be using TCP.. > Jeff regards, -- Paul Jakma paul@clubi.ie paul@jakma.org Key ID: 64A2FF6A Fortune: When the speaker and he to whom he is speaks do not understand, that is metaphysics. -- Voltaire From paul@clubi.ie Tue Jan 4 10:30:57 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 10:31:03 -0800 (PST) Received: from hibernia.jakma.org (IDENT:U2FsdGVkX19Fq751r7B2WOQh3YxIFYqXE0mf5v+ScXY@hibernia.jakma.org [212.17.55.49]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04IUZMB022751 for ; Tue, 4 Jan 2005 10:30:56 -0800 Received: from hibernia.jakma.org (IDENT:U2FsdGVkX1+3svVdQm+osAv9N37oS9iaQoYmLBwtouo@hibernia.jakma.org [192.168.0.3]) by hibernia.jakma.org (8.13.1/8.12.11) with ESMTP id j056UBaG006840; Wed, 5 Jan 2005 06:30:11 GMT Date: Wed, 5 Jan 2005 06:30:11 +0000 (GMT) From: Paul Jakma X-X-Sender: paul@hibernia.jakma.org To: jamal cc: Jeff Garzik , Thomas Spatzier , "David S. Miller" , Hasso Tepper , Herbert Xu , netdev@oss.sgi.com, Tommy Christensen Subject: Re: [patch 4/10] s390: network driver. In-Reply-To: <1104895169.1117.63.camel@jzny.localdomain> Message-ID: References: <1104764710.1048.580.camel@jzny.localdomain> <41DB26A6.2070008@pobox.com> <1104895169.1117.63.camel@jzny.localdomain> Mail-Followup-To: paul@hibernia.jakma.org X-NSA: arafat al aqsar jihad musharef jet-A1 avgas ammonium qran inshallah allah al-akbar martyr iraq saddam hammas hisballah rabin ayatollah korea vietnam revolt mustard gas british airways washington MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: ClamAV 0.80/634/Sun Dec 19 21:21:52 2004 clamav-milter version 0.80j on hibernia.jakma.org X-Virus-Status: Clean X-Virus-Status: Clean X-archive-position: 13406 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: paul@clubi.ie Precedence: bulk X-list: netdev On Wed, 4 Jan 2005, jamal wrote: > Theres possibly people who would want it differently - so for we > havent heard from them. Maybe poll far and wide - or push it in and > wait for them to whine. We're whining. This policy in the Linux kernel makes using Linux dangerous for certain routing applications (RIP, routing advertisements). Name a non-TCP application that *does* want this newish kernel policy and tell me how it breaks without this *new* policy. ;) > cheers, > jamal regards, -- Paul Jakma paul@clubi.ie paul@jakma.org Key ID: 64A2FF6A Fortune: My only love sprung from my only hate! Too early seen unknown, and known too late! -- William Shakespeare, "Romeo and Juliet" From davem@davemloft.net Tue Jan 4 10:35:33 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 10:35:39 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04IZAhK023357 for ; Tue, 4 Jan 2005 10:35:33 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cm4hE-0004fR-00; Tue, 04 Jan 2005 22:31:04 -0800 Date: Tue, 4 Jan 2005 22:31:04 -0800 From: "David S. Miller" To: Andrew Morton Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: net patches Message-Id: <20050104223104.2ec87f5b.davem@davemloft.net> In-Reply-To: <20050104215913.274e6567.akpm@osdl.org> References: <20050104215913.274e6567.akpm@osdl.org> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13407 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Tue, 4 Jan 2005 21:59:13 -0800 Andrew Morton wrote: > I'll unload some accumulated net patches. I can't say that I've looked at > them very closely. I'll be quiet for the next few days as I try to discover why sparc64 now explodes after the past week of changes. I'm heavily suspecting the 4-level page table stuff. wli kept saying that he was having trouble getting his sparc boxes working with the -mm tree over the past month and that's about how long the 4-level page table stuff has been in there. What's odd is that Andi's original 4-level page table patch he gave to me worked just fine on sparc64, but it's been changed a lot. From wli@holomorphy.com Tue Jan 4 10:49:33 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 10:49:39 -0800 (PST) Received: from holomorphy.com (mail@holomorphy.com [207.189.100.168]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04InCv1024099 for ; Tue, 4 Jan 2005 10:49:32 -0800 Received: from wli by holomorphy.com with local (Exim 3.36 #1 (Debian)) id 1Cm4yX-0002Y2-00; Tue, 04 Jan 2005 22:48:57 -0800 Date: Tue, 4 Jan 2005 22:48:57 -0800 From: William Lee Irwin III To: "David S. Miller" Cc: Andrew Morton , jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: net patches Message-ID: <20050105064857.GD7961@holomorphy.com> References: <20050104215913.274e6567.akpm@osdl.org> <20050104223104.2ec87f5b.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050104223104.2ec87f5b.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040722i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13408 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: wli@holomorphy.com Precedence: bulk X-list: netdev On Tue, 4 Jan 2005 21:59:13 -0800 Andrew Morton wrote: >> I'll unload some accumulated net patches. I can't say that I've looked at >> them very closely. On Tue, Jan 04, 2005 at 10:31:04PM -0800, David S. Miller wrote: > I'll be quiet for the next few days as I try to discover why > sparc64 now explodes after the past week of changes. I'm > heavily suspecting the 4-level page table stuff. wli kept > saying that he was having trouble getting his sparc boxes > working with the -mm tree over the past month and that's about > how long the 4-level page table stuff has been in there. > What's odd is that Andi's original 4-level page table patch > he gave to me worked just fine on sparc64, but it's been > changed a lot. I eventually narrowed this down to something associated with some unusual core fault handling changes with an unclear relationship to Andi's 4-level code. Something odd was going on with spec-guided definitions of pte_read(), pte_write(), et al. sun4u seemed to do okay with Andi's earlier code in my testing; later problems seemed to stem from elsewhere (e.g. the ioctl bogon). $ uname -a Linux analyticity 2.6.10-rc2-mm2 #8 SMP Sat Dec 18 07:57:42 PST 2004 sparc64 GNU/Linux -- wli From jgarzik@pobox.com Tue Jan 4 11:26:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 11:26:11 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04JPgpa025448 for ; Tue, 4 Jan 2005 11:26:03 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1Cm5Xy-0005T9-H1; Wed, 05 Jan 2005 07:25:34 +0000 Message-ID: <41DB965F.6070409@pobox.com> Date: Wed, 05 Jan 2005 02:25:19 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrew Morton CC: "David S. Miller" , netdev@oss.sgi.com Subject: Re: net patches References: <20050104215913.274e6567.akpm@osdl.org> In-Reply-To: <20050104215913.274e6567.akpm@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13409 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Andrew Morton wrote: > I'll unload some accumulated net patches. I can't say that I've looked at > them very closely. I'll push the drivers/net stuff through tomorrow, after sleep :) Jeff From buytenh@wantstofly.org Tue Jan 4 14:20:24 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 14:20:31 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04MK3BA001531 for ; Tue, 4 Jan 2005 14:20:23 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id BC4382B0EE; Wed, 5 Jan 2005 11:19:55 +0100 (MET) Date: Wed, 5 Jan 2005 11:19:55 +0100 From: Lennert Buytenhek To: Pekka Savola Cc: Jeff Garzik , Netdev , YOSHIFUJI Hideaki / ???????????? , Herbert Xu Subject: Re: IPv6 badness continues Message-ID: <20050105101955.GE19910@xi.wantstofly.org> References: <41DA3A60.8050102@pobox.com> <20050104093335.GB7823@xi.wantstofly.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13410 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev On Tue, Jan 04, 2005 at 10:57:43PM +0200, Pekka Savola wrote: > >I upgraded my problematic machine to FC3, which somehow broke 6to4, and I > >didn't bother to reenable it again because the local DNS server (dnscache) > >just drops AAAA queries on the floor anyway, leading to lots of timeouts > >when trying to resolve host names, etc. Ever since 6to4 was turned off > >on that box I stopped seeing these messages. > > Surely it doesn't just drop AAAA queries on the floor, but sends an > error message? Sorry, I just tried again and can't reproduce this behavior -- when doing an AAAA query on a random domain name I get a clean 0/0/0 answer indicating no RRs of the desired type having been found, and doing an AAAA query on a domain name that does have RRs of that type, I do get the desired records. I'm trying to recall what specific problem it was that I was seeing.. --L From tgraf@suug.ch Tue Jan 4 15:01:00 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 15:01:07 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04N0caH002809 for ; Tue, 4 Jan 2005 15:00:59 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id BEE9182; Wed, 5 Jan 2005 12:00:07 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 34CDD1C0EA; Wed, 5 Jan 2005 12:00:48 +0100 (CET) Date: Wed, 5 Jan 2005 12:00:48 +0100 From: Thomas Graf To: jamal Cc: netdev@oss.sgi.com Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier Message-ID: <20050105110048.GO26856@postel.suug.ch> References: <20050103125635.GB26856@postel.suug.ch> <20050104223612.GN26856@postel.suug.ch> <1104894728.1117.56.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1104894728.1117.56.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13411 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1104894728.1117.56.camel@jzny.localdomain> 2005-01-04 22:12 > On Tue, 2005-01-04 at 17:36, Thomas Graf wrote: > > > * TCF_EM_SIMPLE flag which marks an ematch config as simple, meaning > > that the data consists of a u32 value. > > This is 1 of 2 parts i think thats still an issue; otherwise looks very > good. > Why do i need to signal something as simple? AND why does it have to be > 32 bit type - what edge does that give you? You don't have to, providing a 32bit data chunk without TCF_EM_SIMPLE set will simply result in allocating & copy. It's an optimization, nothing more. > I should be able to specify a struct with two 32 bits and > encap it in a TLV and the classifier can treat it the same way - it > knows the type and length - thats sufficient to create, destroy and > dump. Correct, maybe you're right and I should drop it again. > The other issue is still on the ematch/match interleaving i.e i should > be able to say something along the lines: > > //simple slammer-worm or code-red ACL detector rule > //using u32 classifier and ematches > (match ip protocol udp port 1434 AND > ematch packetlen minsize 404 maxsize 404) OR > (match ip protocol tcp http AND > ematch urlscanner "*.ida") > action ipt -j ULOG "Virus detected and dropped" > action drop > > Not a very good example - but you can see how powerfull this is when you > can quickly use a string scanner such as the one you have as an ematch > while maintaining u32 as is. Basically you could do that already with the basic classifier but I understand your concern and it would be neat to benefit from u32's hashing. There are 2 options: 1) We make u32 hold multiple ematch trees, a u32 key can be of 3 kinds: u32/ematch/container. It's kind of a hack and not very fast due to a lot of stack movement. 2) We make the existing u32 match be an ematch which I already did expect for the nexthdr bits. That is the select will simply be replaced by an ematch tree. I'll take a look into how we could have the classifier take influence on the ematches config data. One possibiliy is to have a struct transfered via map which contains useful data such as offset to next header (u32/rsvp). I have to think about this a little more though. Personally I'm all for 2) because it's just cleaner and easier to maintain. It's probably the best to not to use the u32 ematch I wrote (which I renamed to cmp) but to write a new one behaving exactly the same as the existing u32 match. Attached cmp ematch (formerly u32), it was on diet for a while and is quite smallish now. diff -Nru linux-2.6.10-bk6.orig/include/linux/pkt_cls.h linux-2.6.10-bk6/include/linux/pkt_cls.h --- linux-2.6.10-bk6.orig/include/linux/pkt_cls.h 2005-01-05 01:09:29.000000000 +0100 +++ linux-2.6.10-bk6/include/linux/pkt_cls.h 2005-01-05 01:46:34.000000000 +0100 @@ -349,6 +349,7 @@ enum { TCF_EM_CONTAINER, + TCF_EM_CMP, __TCF_EM_MAX }; @@ -366,4 +367,28 @@ #define TCF_EM_INVERT (1<<3) #define TCF_EM_SIMPLE (1<<4) +struct tcf_em_cmp +{ + __u32 val; + __u32 mask; + __u16 off; + __u8 align; + __u8 layer:4; + __u8 opnd:4; +}; + +enum +{ + TCF_EM_ALIGN_U8 = 1, + TCF_EM_ALIGN_U16 = 2, + TCF_EM_ALIGN_U32 = 4 +}; + +enum +{ + TCF_EM_OPND_EQ, + TCF_EM_OPND_GT, + TCF_EM_OPND_LT +}; + #endif diff -Nru linux-2.6.10-bk6.orig/include/net/pkt_cls.h linux-2.6.10-bk6/include/net/pkt_cls.h --- linux-2.6.10-bk6.orig/include/net/pkt_cls.h 2005-01-05 01:09:29.000000000 +0100 +++ linux-2.6.10-bk6/include/net/pkt_cls.h 2005-01-05 01:26:03.000000000 +0100 @@ -270,6 +270,36 @@ #endif /* CONFIG_NET_EMATCH */ +static inline u32 tcf_read_bucket(u8 *ptr, u8 align) +{ + switch (align) { + case TCF_EM_ALIGN_U8: + return *ptr; + case TCF_EM_ALIGN_U16: + return (*ptr << 8) | *(ptr+1); + case TCF_EM_ALIGN_U32: + return (*ptr << 24) | (*(ptr+1) << 16) | + (*(ptr+2) << 8) | *(ptr+3); + } + return 0; +} + +static inline u8 * tcf_get_base_ptr(struct sk_buff *skb, u8 layer) +{ + switch (layer) { + case 0: + return skb->data; + case 1: + return skb->nh.raw; + case 2: + return skb->h.raw; + } + return NULL; +} + +#define tcf_valid_offset(skb, ptr, off, len) \ + ((ptr + off + len) < skb->tail && (ptr + off) > skb->head) + #ifdef CONFIG_NET_CLS_IND static inline int tcf_change_indev(struct tcf_proto *tp, char *indev, struct rtattr *indev_tlv) diff -Nru linux-2.6.10-bk6.orig/net/sched/Kconfig linux-2.6.10-bk6/net/sched/Kconfig --- linux-2.6.10-bk6.orig/net/sched/Kconfig 2005-01-05 01:09:29.000000000 +0100 +++ linux-2.6.10-bk6/net/sched/Kconfig 2005-01-05 01:34:38.000000000 +0100 @@ -388,6 +388,16 @@ You must have a recent version of the iproute2 tools in order to use extended matches. +config NET_EMATCH_CMP + tristate "Simple packet data comparison" + depends on NET_EMATCH + ---help--- + Say Y here if you want to be able to classify packets based on + simple packet data comparisons for 8, 16, and 32bit values. + + To compile this code as a module, choose M here: the + module will be called em_cmp. + config NET_CLS_ACT bool "Packet ACTION" depends on EXPERIMENTAL && NET_CLS && NET_QOS diff -Nru linux-2.6.10-bk6.orig/net/sched/Makefile linux-2.6.10-bk6/net/sched/Makefile --- linux-2.6.10-bk6.orig/net/sched/Makefile 2005-01-05 01:09:29.000000000 +0100 +++ linux-2.6.10-bk6/net/sched/Makefile 2005-01-05 01:28:03.000000000 +0100 @@ -34,3 +34,4 @@ obj-$(CONFIG_NET_CLS_TCINDEX) += cls_tcindex.o obj-$(CONFIG_NET_CLS_RSVP6) += cls_rsvp6.o obj-$(CONFIG_NET_EMATCH) += ematch.o +obj-$(CONFIG_NET_EMATCH_CMP) += em_cmp.o diff -Nru linux-2.6.10-bk6.orig/net/sched/em_cmp.c linux-2.6.10-bk6/net/sched/em_cmp.c --- linux-2.6.10-bk6.orig/net/sched/em_cmp.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.10-bk6/net/sched/em_cmp.c 2005-01-05 01:47:00.000000000 +0100 @@ -0,0 +1,66 @@ +/* + * net/sched/em_cmp.c Simple packet data comparison ematch + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: Thomas Graf + */ + +#include +#include +#include +#include +#include +#include + +static int em_cmp_match(struct sk_buff *skb, struct tcf_ematch *m) +{ + struct tcf_em_cmp *u = (struct tcf_em_cmp *) m->data; + u8 *ptr = tcf_get_base_ptr(skb, u->layer); + u32 v; + + if (unlikely(!tcf_valid_offset(skb, ptr, u->off, u->align))) + return 0; + + v = tcf_read_bucket(ptr + u->off, u->align) & u->mask; + + /* FIXME: byte order issues */ + + switch (u->opnd) { + case TCF_EM_OPND_EQ: + return v == u->val; + case TCF_EM_OPND_LT: + return v < u->val; + case TCF_EM_OPND_GT: + return v > u->val; + } + + return 0; +} + +static struct tcf_ematch_ops em_cmp_ops = { + .kind = TCF_EM_CMP, + .datalen = sizeof(struct tcf_em_cmp), + .match = em_cmp_match, + .owner = THIS_MODULE, + .link = LIST_HEAD_INIT(em_cmp_ops.link) +}; + +static int __init init_em_cmp(void) +{ + return tcf_em_register(&em_cmp_ops); +} + +static void __exit exit_em_cmp(void) +{ + tcf_em_unregister(&em_cmp_ops); +} + +MODULE_LICENSE("GPL"); + +module_init(init_em_cmp); +module_exit(exit_em_cmp); + From tgraf@suug.ch Tue Jan 4 15:09:24 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 15:09:31 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j04N93Xj003493 for ; Tue, 4 Jan 2005 15:09:24 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 6E18B82; Wed, 5 Jan 2005 12:08:34 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 9B15F1C0EA; Wed, 5 Jan 2005 12:09:17 +0100 (CET) Date: Wed, 5 Jan 2005 12:09:17 +0100 From: Thomas Graf To: jamal Cc: netdev@oss.sgi.com Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier Message-ID: <20050105110917.GP26856@postel.suug.ch> References: <20050103125635.GB26856@postel.suug.ch> <1104812028.1085.50.camel@jzny.localdomain> <20050104122738.GG26856@postel.suug.ch> <1104844935.1085.103.camel@jzny.localdomain> <20050104134126.GJ26856@postel.suug.ch> <1104893694.1124.37.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1104893694.1124.37.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13412 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1104893694.1124.37.camel@jzny.localdomain> 2005-01-04 21:54 > I think this is a debate that can be easily settled ;-> > Agreed logic will beat brute force smartness and u32 is not exactly > for the faint hearted. And its usability is extremely poor - but lets > maintain its power as is. Absolutely. > > Using what key? We have no knowledge about what the ematches want to > > see or not. > > Ok, good question ;-> > Maybe you should have own some 32 bit key? Actually the goal of basic is to be an alternative to u32 if hashing is not required because I think adding hashing will simply result in a duplication of u32. From Robert.Olsson@data.slu.se Tue Jan 4 17:18:56 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 17:19:03 -0800 (PST) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j051IY3r017441 for ; Tue, 4 Jan 2005 17:18:55 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.12.10/8.12.10) with ESMTP id j05DIJuA014850; Wed, 5 Jan 2005 14:18:19 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 91AD2EC0BC; Wed, 5 Jan 2005 14:18:19 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16859.59675.522262.418329@robur.slu.se> Date: Wed, 5 Jan 2005 14:18:19 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Stephen Hemminger Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501031656.57041.jeremy.guthrie@berbee.com> References: <200501031455.26980.jeremy.guthrie@berbee.com> <20050103145115.4bdb2cd6@dxpl.pdx.osdl.net> <200501031656.57041.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13413 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > How would I check? It should be in the hundreds of thousands. Good question Stephen,.. Yes it seems like this pretty hefty load. Forwarding rate of 92k kpps and a drop rate of 10 kpps and dst hash mostly at 50-60 kentries if I read the stats correctly. And 2.4 were able handle this but not 2.6.10? Assuming things are uses and setup identically. 2.6 uses RCU for route hash locking. Any dst cache overslow messages seen? A couple of lines of rtstat would be very interesing from this box. Also check that the CPU shares the RX packet load. CPU0 affinty to eth0 and CPU1 to eth1 seems to be best. It gives cache bouncing at "TX" and slab jobs but we have accept that for now. 13:37:25 CPU %user %nice %system %iowait %irq %soft %idle > intr/s > 13:38:24 all 0.14 0.00 0.12 0.12 2.02 42.89 54.71 > 25900.70 > 13:38:24 0 0.03 0.00 0.05 0.22 0.00 16.67 83.03 > 2246.10 > 13:38:24 1 0.25 0.00 0.20 0.03 4.02 69.12 26.40 > 23654.55 This looks weird to me... we cannot have CPU left? Due to the imbalance? Check /proc/net/softnet_stat, Haven't used mpstat. %soft is that *all* softirq's or only softirq's deferred to ksoftird only? --ro From fw@deneb.enyo.de Tue Jan 4 17:33:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 17:33:15 -0800 (PST) Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j051WlP8018234 for ; Tue, 4 Jan 2005 17:33:07 -0800 Received: from deneb.enyo.de ([212.9.189.171]) by albireo.enyo.de with esmtp id 1CmBH4-0004Rx-FJ; Wed, 05 Jan 2005 14:32:30 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.43) id 1CmBH3-0001nH-MD; Wed, 05 Jan 2005 14:32:29 +0100 From: Florian Weimer To: Thomas Graf Cc: netdev@oss.sgi.com Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier References: <20050103125635.GB26856@postel.suug.ch> Date: Wed, 05 Jan 2005 14:32:29 +0100 In-Reply-To: <20050103125635.GB26856@postel.suug.ch> (Thomas Graf's message of "Mon, 3 Jan 2005 13:56:35 +0100") Message-ID: <87pt0kc87m.fsf@deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13414 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fw@deneb.enyo.de Precedence: bulk X-list: netdev * Thomas Graf: > I attached 4 patches of a first ematch implementation. Comments > and suggestions very much appreciated. Compiles but untested. This might infringe US patent 5,793,954 and the patents that reference it. 8-( From hadi@cyberus.ca Tue Jan 4 17:46:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 17:46:09 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j051jgRi019422 for ; Tue, 4 Jan 2005 17:46:02 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1CmBTf-0007QO-En for netdev@oss.sgi.com; Wed, 05 Jan 2005 08:45:31 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CmBTV-0003GC-EC; Wed, 05 Jan 2005 08:45:21 -0500 Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier From: jamal Reply-To: hadi@cyberus.ca To: Florian Weimer Cc: Thomas Graf , netdev@oss.sgi.com In-Reply-To: <87pt0kc87m.fsf@deneb.enyo.de> References: <20050103125635.GB26856@postel.suug.ch> <87pt0kc87m.fsf@deneb.enyo.de> Content-Type: text/plain Organization: jamalopolous Message-Id: <1104932718.1124.155.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 05 Jan 2005 08:45:18 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13415 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Wed, 2005-01-05 at 08:32, Florian Weimer wrote: > * Thomas Graf: > > > I attached 4 patches of a first ematch implementation. Comments > > and suggestions very much appreciated. Compiles but untested. > > This might infringe US patent 5,793,954 and the patents that reference > it. 8-( hehe. We can sleep better knowing we dont run Linux using C++ ;-> That patents reads like it owns every classifier ever written in C++ that runs on a processor. cheers, jamal From hadi@cyberus.ca Tue Jan 4 17:59:38 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 17:59:46 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j051xD5r020218 for ; Tue, 4 Jan 2005 17:59:37 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CmBgm-0003yT-TE for netdev@oss.sgi.com; Wed, 05 Jan 2005 08:59:04 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CmBHm-0001OE-JJ; Wed, 05 Jan 2005 08:33:14 -0500 Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: netdev@oss.sgi.com In-Reply-To: <20050105110048.GO26856@postel.suug.ch> References: <20050103125635.GB26856@postel.suug.ch> <20050104223612.GN26856@postel.suug.ch> <1104894728.1117.56.camel@jzny.localdomain> <20050105110048.GO26856@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1104931991.1117.152.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 05 Jan 2005 08:33:11 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13416 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Wed, 2005-01-05 at 06:00, Thomas Graf wrote: > * jamal <1104894728.1117.56.camel@jzny.localdomain> 2005-01-04 22:12 > > Why do i need to signal something as simple? AND why does it have to be > > 32 bit type - what edge does that give you? > > You don't have to, providing a 32bit data chunk without TCF_EM_SIMPLE > set will simply result in allocating & copy. It's an optimization, > nothing more. Sorry i missed that. Isnt it still unecessary though? You should be able to pass L=4 and not need the speacial treatment, no? > > Not a very good example - but you can see how powerfull this is when you > > can quickly use a string scanner such as the one you have as an ematch > > while maintaining u32 as is. > > Basically you could do that already with the basic classifier but > I understand your concern and it would be neat to benefit from u32's > hashing. There are 2 options: > 1) We make u32 hold multiple ematch trees, a u32 key can be of 3 > kinds: u32/ematch/container. It's kind of a hack and not very > fast due to a lot of stack movement. Indeed this is what i was thinking of. The only added overhead I can think of is when processing a series of u32 keys _within the same selector_ (not across selectors), you check if its u32 native and execute localy (as is done now) or transfer the check to the ematch defined in that key and continue to next key based on the ematchs return code + the logical operation. > 2) We make the existing u32 match be an ematch which I already did > expect for the nexthdr bits. That is the select will simply be > replaced by an ematch tree. I'll take a look into how we could > have the classifier take influence on the ematches config data. > One possibiliy is to have a struct transfered via map which > contains useful data such as offset to next header (u32/rsvp). > I have to think about this a little more though. This could be done in addition to #1. I see #1 as more important for u32 but not so for things like fwmark, tcindex which should fizzle away with meta ematch. I think the danger is in trying to replicate u32 as an ematch; if somehow you can loop back and use the real u32 code, then fine. I feel it being non-trivial to do so. Like i said earlier, theres a lot of power in u32 other than in basic matching. > Personally I'm all for 2) because it's just cleaner and easier to > maintain. Aha, thats why we were not converging then ;-> I think #2 is better for other classifiers which were already doomed anyways. #1 is important for u32 and perhaps other classifiers like rsvp and route. And yes, #1 is more work ;-> > It's probably the best to not to use the u32 ematch I > wrote (which I renamed to cmp) but to write a new one behaving > exactly the same as the existing u32 match. > hang on:-> No dont rewrite u32 please. Your cmp is good for the basic matches that u32 does, but is _nowhere_ close to being able to do what u32 can when used properly. > Attached cmp ematch (formerly u32), it was on diet for a while > and is quite smallish now. Looks very appetizing. Two general comments: > diff -Nru linux-2.6.10-bk6.orig/include/linux/pkt_cls.h linux-2.6.10-bk6/include/linux/pkt_cls.h > --- linux-2.6.10-bk6.orig/include/linux/pkt_cls.h 2005-01-05 01:09:29.000000000 +0100 > +++ linux-2.6.10-bk6/include/linux/pkt_cls.h 2005-01-05 01:46:34.000000000 +0100 > @@ -349,6 +349,7 @@ > enum > { > TCF_EM_CONTAINER, > + TCF_EM_CMP, > __TCF_EM_MAX > }; I Should be able to compile a new ematch as a module in an already running kernel. So, other than generic stuff for ematches, things like TCF_EM_CMP should not be in that enumeration. > @@ -366,4 +367,28 @@ > #define TCF_EM_INVERT (1<<3) > #define TCF_EM_SIMPLE (1<<4) > > +struct tcf_em_cmp > +{ > + __u32 val; > + __u32 mask; > + __u16 off; > + __u8 align; > + __u8 layer:4; > + __u8 opnd:4; > +}; > + > +enum > +{ > + TCF_EM_ALIGN_U8 = 1, > + TCF_EM_ALIGN_U16 = 2, > + TCF_EM_ALIGN_U32 = 4 > +}; > + > +enum > +{ > + TCF_EM_OPND_EQ, > + TCF_EM_OPND_GT, > + TCF_EM_OPND_LT > +}; > + Which means the above should go in its own file; probably create a include/linux/tc_ematch directory with a file of sort tcf_em_cmp.h which holds all the above. > #endif > diff -Nru linux-2.6.10-bk6.orig/include/net/pkt_cls.h linux-2.6.10-bk6/include/net/pkt_cls.h > --- linux-2.6.10-bk6.orig/include/net/pkt_cls.h 2005-01-05 01:09:29.000000000 +0100 > +++ linux-2.6.10-bk6/include/net/pkt_cls.h 2005-01-05 01:26:03.000000000 +0100 > @@ -270,6 +270,36 @@ > > #endif /* CONFIG_NET_EMATCH */ > > +static inline u32 tcf_read_bucket(u8 *ptr, u8 align) > +{ > + switch (align) { > + case TCF_EM_ALIGN_U8: > + return *ptr; > + case TCF_EM_ALIGN_U16: > + return (*ptr << 8) | *(ptr+1); > + case TCF_EM_ALIGN_U32: > + return (*ptr << 24) | (*(ptr+1) << 16) | > + (*(ptr+2) << 8) | *(ptr+3); > + } > + return 0; > +} > + > +static inline u8 * tcf_get_base_ptr(struct sk_buff *skb, u8 layer) > +{ > + switch (layer) { > + case 0: > + return skb->data; > + case 1: > + return skb->nh.raw; > + case 2: > + return skb->h.raw; > + } > + return NULL; > +} > + > +#define tcf_valid_offset(skb, ptr, off, len) \ > + ((ptr + off + len) < skb->tail && (ptr + off) > skb->head) > + And all this also goes in that header file as well. cheers, jamal From hadi@cyberus.ca Tue Jan 4 18:05:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 18:06:00 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0525RXD020913 for ; Tue, 4 Jan 2005 18:05:47 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1CmBmk-0003Uw-Rc for netdev@oss.sgi.com; Wed, 05 Jan 2005 09:05:14 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CmB1y-0008Ec-4u; Wed, 05 Jan 2005 08:16:54 -0500 Subject: Re: [patch 4/10] s390: network driver. From: jamal Reply-To: hadi@cyberus.ca To: Paul Jakma Cc: Jeff Garzik , Thomas Spatzier , "David S. Miller" , Hasso Tepper , Herbert Xu , netdev@oss.sgi.com, Tommy Christensen In-Reply-To: References: <1104764710.1048.580.camel@jzny.localdomain> <41DB26A6.2070008@pobox.com> <1104895169.1117.63.camel@jzny.localdomain> Content-Type: text/plain Organization: jamalopolous Message-Id: <1104931011.1118.134.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 05 Jan 2005 08:16:51 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13417 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Wed, 2005-01-05 at 01:30, Paul Jakma wrote: > On Wed, 4 Jan 2005, jamal wrote: > > > Theres possibly people who would want it differently - so for we > > havent heard from them. Maybe poll far and wide - or push it in and > > wait for them to whine. > > We're whining. > > This policy in the Linux kernel makes using Linux dangerous for > certain routing applications (RIP, routing advertisements). > > Name a non-TCP application that *does* want this newish kernel policy > and tell me how it breaks without this *new* policy. ;) Ok, Iam confused - I thought you guys _wanted this_ ;-> The issue is about message obsolency more than it is about reliability. Without this the scenario you played you played for us before was: 1)=>send a few LSAs from user space, pull cable before they go out (this will happen if you are sending sufficiently large amounts of packets i.e network is busy), 2)=>user space gets notified via netlink, device shuts down acces to DMA, packets queued anyways and you have no ability to say "ooops,sorry take that packet back" a)You could do a move to another device at this point. or b) dumb app will continue sending 3)=>plug cable back in 2 minutes later, obsolete LSAs sent followed by any new ones that may follow .... With the patch, packets in #2 will be dropped. As a matter of fact within those two minutes, if stopped, it is probable the device watchdog timer will kick in and flush the DMA but not the scheduler queues above it (which is where upto a 1000 stale packets could be sitting). What is it that you dont like now? cheers, jamal From paul@clubi.ie Tue Jan 4 18:31:56 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 18:32:02 -0800 (PST) Received: from hibernia.jakma.org (IDENT:U2FsdGVkX18CpjiC5rVNHJTbfCgvwCDjr/yEEJkXPEg@hibernia.jakma.org [212.17.55.49]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j052VW00022007 for ; Tue, 4 Jan 2005 18:31:55 -0800 Received: from hibernia.jakma.org (IDENT:U2FsdGVkX1+L/mbcoFnU9w/oDtd++/IuZVr8Eu8GWeU@hibernia.jakma.org [192.168.0.3]) by hibernia.jakma.org (8.13.1/8.12.11) with ESMTP id j05ETvjt010773; Wed, 5 Jan 2005 14:29:58 GMT Date: Wed, 5 Jan 2005 14:29:57 +0000 (GMT) From: Paul Jakma X-X-Sender: paul@hibernia.jakma.org To: jamal cc: Jeff Garzik , Thomas Spatzier , "David S. Miller" , Hasso Tepper , Herbert Xu , netdev@oss.sgi.com, Tommy Christensen Subject: Re: [patch 4/10] s390: network driver. In-Reply-To: <1104931011.1118.134.camel@jzny.localdomain> Message-ID: References: <1104764710.1048.580.camel@jzny.localdomain> <41DB26A6.2070008@pobox.com> <1104895169.1117.63.camel@jzny.localdomain> <1104931011.1118.134.camel@jzny.localdomain> Mail-Followup-To: paul@hibernia.jakma.org X-NSA: arafat al aqsar jihad musharef jet-A1 avgas ammonium qran inshallah allah al-akbar martyr iraq saddam hammas hisballah rabin ayatollah korea vietnam revolt mustard gas british airways washington MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: ClamAV 0.80/634/Sun Dec 19 21:21:52 2004 clamav-milter version 0.80j on hibernia.jakma.org X-Virus-Status: Clean X-Virus-Status: Clean X-archive-position: 13418 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: paul@clubi.ie Precedence: bulk X-list: netdev On Wed, 5 Jan 2005, jamal wrote: > Ok, Iam confused - I thought you guys _wanted this_ ;-> I'm confused too now. We dont want "queue packets" - that's the 'newish' policy I was referring to. (newish in quotes, as I'm not sure from when this behaviour dates). > The issue is about message obsolency more than it is about reliability. Right, exactly. So we do want what you think we want ;) (i think). > Without this the scenario you played you played for us before was: > > 1)=>send a few LSAs from user space, pull cable before they go out > (this will happen if you are sending sufficiently large amounts of > packets i.e network is busy), > 2)=>user space gets notified via netlink, device shuts down acces to > DMA, packets queued anyways and you have no ability to say "ooops,sorry > take that packet back" Right. Two things: - we noticed this behaviour because of OSPF Users reported ospfd would cease to send packets on all interfaces, (with certain drivers) because /one/ interface was link-down. We can workaround this easily by opening a socket per interface - at present we simply punt OSPF packets down a single raw socket and rely on IP_HDRINCL to have kernel route the packet out correct interface (IP_MULTICAST_IF for multicast destined packets). - The queueing does not affect OSPF terribly, it would affect other protocols though OSPF implements its own 'synchronisation' facilities between neighbours and can easily 'detect' obsolecent packets. So the obsolence issue does not affect it, routing-information in stale packets will not propogate, so they cant do much damage really. (just unneccessary to queue and send such packets). However, other commonly used protocols are not as robust. Mostly those where a protocol is used to distribute routing information to passive listeners, eg: - RIP - IPv4 ICMP based router-discovery (IRDP) - IPv6 Router-advertisements In these cases, the queuing behaviour is potentially dangerous and could disrupt connectivity by propogating no-longer-valid routing information. > a)You could do a move to another device at this point. > or > b) dumb app will continue sending > > 3)=>plug cable back in 2 minutes later, obsolete LSAs sent followed by > any new ones that may follow Right. Except OSPF is robust enough against stale packets. Other protocols are not. > With the patch, packets in #2 will be dropped. Perfect. > As a matter of fact within those two minutes, if stopped, it is > probable the device watchdog timer will kick in and flush the DMA > but not the scheduler queues above it (which is where upto a 1000 > stale packets could be sitting). Right, and our argument it doesnt make sense to send those packets. I've never heard of any UDP and/or raw application that expected a kernel to queue packets if they could not be sent for lack of link or other problem, and any which did are surely broken by definition? ;) > What is it that you dont like now? Sorry, wires crossed re "new behaviour". The "new new" behaviour in the patch as you describe would be perfect. PS: Another issue, could we have kernel space IP fragmentation for IP_HDRINCL sockets please? We currently have to implement fragmentation ourselves, which seems silly given that kernel already has this functionality. > cheers, > jamal regards, -- Paul Jakma paul@clubi.ie paul@jakma.org Key ID: 64A2FF6A Fortune: The early bird who catches the worm works for someone who comes in late and owns the worm farm. -- Travis McGee From advertiser@localhost.localdomain Tue Jan 4 18:35:30 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 18:35:37 -0800 (PST) Received: from localhost.localdomain ([82.201.181.227]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j052Z7HW022529 for ; Tue, 4 Jan 2005 18:35:28 -0800 Received: from localhost.localdomain (admin3 [127.0.0.1]) by localhost.localdomain (8.12.8/8.12.8) with ESMTP id j062c1lW001751 for ; Thu, 6 Jan 2005 04:41:31 +0200 Received: (from advertiser@localhost) by localhost.localdomain (8.12.8/8.12.8/Submit) id j05C6fKa006526 for netdev@oss.sgi.com; Wed, 5 Jan 2005 14:06:41 +0200 Date: Wed, 5 Jan 2005 14:06:41 +0200 From: advertiser@advertise.com Message-Id: <200501051206.j05C6fKa006526@localhost.localdomain> To: netdev@oss.sgi.com Subject: Cheap Prices NOT Cheap Hosting X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13419 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: advertiser@advertise.com Precedence: bulk X-list: netdev .HellO... ------------------------------------------------------------ ############################################################## $ Visit http://www.mkhoster.com For Very Good Hosting Offer $ $--- Cpanel $ $--- PHP $ $--- CGI-perl $ $--- Mysql $ $--- And MORE ....... $ ############################################################## FOR MORE INFORMATIONS -----< http://mkhoster.com/support.html >----- ************************************************************** From tgraf@suug.ch Tue Jan 4 18:45:22 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 18:45:29 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j052j1kX023282 for ; Tue, 4 Jan 2005 18:45:22 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id D8E5C82; Wed, 5 Jan 2005 15:44:31 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id F41791C0EA; Wed, 5 Jan 2005 15:45:14 +0100 (CET) Date: Wed, 5 Jan 2005 15:45:14 +0100 From: Thomas Graf To: jamal Cc: netdev@oss.sgi.com Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier Message-ID: <20050105144514.GQ26856@postel.suug.ch> References: <20050103125635.GB26856@postel.suug.ch> <20050104223612.GN26856@postel.suug.ch> <1104894728.1117.56.camel@jzny.localdomain> <20050105110048.GO26856@postel.suug.ch> <1104931991.1117.152.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1104931991.1117.152.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13420 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1104931991.1117.152.camel@jzny.localdomain> 2005-01-05 08:33 > On Wed, 2005-01-05 at 06:00, Thomas Graf wrote: > > * jamal <1104894728.1117.56.camel@jzny.localdomain> 2005-01-04 22:12 > > > > Why do i need to signal something as simple? AND why does it have to be > > > 32 bit type - what edge does that give you? > > > > You don't have to, providing a 32bit data chunk without TCF_EM_SIMPLE > > set will simply result in allocating & copy. It's an optimization, > > nothing more. > > Sorry i missed that. Isnt it still unecessary though? You should be able > to pass L=4 and not need the speacial treatment, no? Agreed, but the ematch might expect an allocated block. Assuming the data is variable and sometimes is L=4, sometimes L=16 the ematch requires special handling because m->data might hold the value directly or a pointer depending on datalen. > > 1) We make u32 hold multiple ematch trees, a u32 key can be of 3 > > kinds: u32/ematch/container. It's kind of a hack and not very > > fast due to a lot of stack movement. > > Indeed this is what i was thinking of. > The only added overhead I can think of is when processing a series of > u32 keys _within the same selector_ (not across selectors), you check if > its u32 native and execute localy (as is done now) or transfer the check > to the ematch defined in that key and continue to next key based on the > ematchs return code + the logical operation. Exactly, does the performance gap come with any advantage? No. That's why I don't like it. > > 2) We make the existing u32 match be an ematch which I already did > > expect for the nexthdr bits. That is the select will simply be > > replaced by an ematch tree. I'll take a look into how we could > > have the classifier take influence on the ematches config data. > > One possibiliy is to have a struct transfered via map which > > contains useful data such as offset to next header (u32/rsvp). > > I have to think about this a little more though. > > This could be done in addition to #1. I see #1 as more important for u32 > but not so for things like fwmark, tcindex which should fizzle away with > meta ematch. I think the danger is in trying to replicate u32 as an > ematch; if somehow you can loop back and use the real u32 code, then > fine. I feel it being non-trivial to do so. > Like i said earlier, theres a lot of power in u32 other than in basic > matching. Most importantly I don't want to touch any of the hashing code in u32. I really like and it should stay as it is. The existing u32 match can be easly made an ematch so this would safe us the extra work in u32 to implement logic relations again and to fiddle with complicated selector TLVs. The only problem with this is the nexthdr bits because it relies on the hashing code. So we have to make this data available to the ematch which is actually not a bad idea anyway. So I'm thinking about introducing a new structure tcf_em_pkt_info or alike which carries some additional information found out by the classifiers which can be used by ematches. This can be information about the next header, already extracted dscp values, etc. This would give us the chance to add a very small em_u32.c (~40 lines) doing exactly the same as the current u32 match and have the u32 selector replaced with an ematch tree at no additional cost. Backward compatibility is as easy as creating a flat ANDed ematch tree. Note: The u32 ematch I'm talking about is not the cmp ematch, cmp is more advanced but also slightly slower. Thoughts? > I think #2 is better for other classifiers which were already doomed > anyways. #1 is important for u32 and perhaps other classifiers like rsvp > and route. And yes, #1 is more work ;-> Why is it better? What's the advantage? > hang on:-> No dont rewrite u32 please. Your cmp is good for the basic > matches that u32 does, but is _nowhere_ close to being able to do what > u32 can when used properly. Right, that's why I now call it cmp and the existing u32 match becomes the u32 ematch. > I Should be able to compile a new ematch as a module in an already > running kernel. So, other than generic stuff for ematches, things like > TCF_EM_CMP should not be in that enumeration. It's not a requirement to put it there but we need to manage the assigned types for ematches in mainline anyway. > Which means the above should go in its own file; probably create a > include/linux/tc_ematch directory with a file of sort tcf_em_cmp.h > which holds all the above. This one I can agree. > And all this also goes in that header file as well. I put it here because it might be very useful for other ematches or further classifiers, you name it. tcf_get_base_ptr is used by nbyte ematch for example. From webvenza@libero.it Tue Jan 4 18:59:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 18:59:52 -0800 (PST) Received: from gateway.milesteg.arr (venza@adsl-ull-142-137.44-151.net24.it [151.44.137.142]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j052xPci024778 for ; Tue, 4 Jan 2005 18:59:45 -0800 Date: Wed, 5 Jan 2005 15:59:16 +0100 From: Daniele Venzano To: Brancaleoni Matteo Cc: linux-kernel@vger.kernel.org, NetDev Subject: Re: [PATCH] sis900.c net poll support Message-ID: <20050105145916.GA31207@picchio.gall.it> Mail-Followup-To: Brancaleoni Matteo , linux-kernel@vger.kernel.org, NetDev References: <1104921127.5729.17.camel@athlon64> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1104921127.5729.17.camel@athlon64> X-Operating-System: Debian GNU/Linux on kernel Linux 2.4.28-grsec X-Copyright: Forwarding or publishing without permission is prohibited. X-Truth: La vita e' una questione di culo, o ce l'hai o te lo fanno. X-GPG-Fingerprint: 642A A345 1CEF B6E3 925C 23CE DAB9 8764 25B3 57ED X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13421 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: webvenza@libero.it Precedence: bulk X-list: netdev Thanks, it was on my TODO list and now I can just remove the entry :-) I'll try to integrate your patch in the next sis900 update. Bye. On Wed, Jan 05, 2005 at 11:32:07AM +0100, Brancaleoni Matteo wrote: > Hi. > > I was in need to use netconsole to trace some lock > of my sata disk, but my onboard network card (sis900) > seems doesn't support net poll. > So searching the web I found out an old patch for enabling > in under 2.4, and ported it to 2.6.10 (looking > also into 2.6.x device drivers already working) > > Seems to be ok, netconsole works without issues. > Hope that's ok and can be useful. > > Matteo Brancaleoni. > --- linux-2.6.10/drivers/net/sis900.orig 2005-01-05 09:55:46.000000000 +0100 > +++ linux-2.6.10/drivers/net/sis900.c 2005-01-05 10:09:04.000000000 +0100 -- ----------------------------- Daniele Venzano Web: http://teg.homeunix.org From jeremy.guthrie@berbee.com Tue Jan 4 19:18:58 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 19:19:07 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j053IZaV026350 for ; Tue, 4 Jan 2005 19:18:57 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 5 Jan 2005 09:18:23 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Wed, 5 Jan 2005 09:18:19 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson , Stephen Hemminger References: <200501031455.26980.jeremy.guthrie@berbee.com> <200501031656.57041.jeremy.guthrie@berbee.com> <16859.59675.522262.418329@robur.slu.se> In-Reply-To: <16859.59675.522262.418329@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3761034.eMIVnrcmVK"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501050918.22472.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 05 Jan 2005 15:18:23.0136 (UTC) FILETIME=[CBD0CA00:01C4F339] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13422 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart3761034.eMIVnrcmVK Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wednesday 05 January 2005 07:18 am, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > How would I check? It should be in the hundreds of thousands. > > Good question Stephen,.. > > Yes it seems like this pretty hefty load. Forwarding rate of 92k kpps > and a drop rate of 10 kpps and dst hash mostly at 50-60 kentries if > I read the stats correctly. Yeah, the load will be high. I'm expecting this to be watching ~ 750 mbps = by=20 next December. The app profiles all traffic going in and out of our data=20 centers. > And 2.4 were able handle this but not 2.6.10? Yes. It does handle it. It runs harder ie. 2.6 caps out at ~ 50% utilizat= ion=20 where 2.4 might run 60-75% utilized. > Assuming things are uses and setup identically. 2.6 uses RCU for route > hash locking. Any dst cache overslow messages seen? No. > A couple of lines of rtstat would be very interesing from this box. I'm not showing the /proc/net/rt_cache_stat file. Was there a kernel optio= n I=20 need to recompile with for rt_cache_stat to show up in proc? > Also check that the CPU shares the RX packet load. CPU0 affinty to eth0 > and CPU1 to eth1 seems to be best. It gives cache bouncing at "TX" and > slab jobs but we have accept that for now. How would I go about doing this? > 13:37:25 CPU %user %nice %system %iowait %irq %soft %idle > > > intr/s > > 13:38:24 all 0.14 0.00 0.12 0.12 2.02 42.89 54.71 > > 25900.70 > > 13:38:24 0 0.03 0.00 0.05 0.22 0.00 16.67 83.03 > > 2246.10 > > 13:38:24 1 0.25 0.00 0.20 0.03 4.02 69.12 26.40 > > 23654.55 > > This looks weird to me... we cannot have CPU left? Due to the imbalance? > Check /proc/net/softnet_stat, cat /proc/net/softnet_stat 5592c972 00000000 00001fc8 00000000 00000000 00000000 00000000 00000000=20 00391c3f 000f1991 00000000 00000000 00000000 00000000 00000000 00000000 00000000=20 001292ba > Haven't used mpstat. %soft is that *all* softirq's or only softirq's > deferred to ksoftird only? "%soft" Show the percentage of time spent by the CPU or CPUs to service = =20 softirqs. A softirq (software interrupt) is one of up to 32 = =20 enumerated software interrupts which can run on multiple CPUs at = =20 once. =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart3761034.eMIVnrcmVK Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB3AU+qtjaBHGZBeURAieyAJ9rfhGwR6xUQ7nG20+7sD80au3vSwCaA3Vm vQkUCdaU2ctd5k52Bjow/X0= =azzl -----END PGP SIGNATURE----- --nextPart3761034.eMIVnrcmVK-- From tommy.christensen@tpack.net Tue Jan 4 19:34:19 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 19:34:26 -0800 (PST) Received: from mail.tpack.net (ip18.tpack.net [213.173.228.18]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j053Xw4M027933 for ; Tue, 4 Jan 2005 19:34:18 -0800 Received: (qmail 29798 invoked from network); 5 Jan 2005 15:33:44 -0000 Received: from dhcp-112.cph.tpack.net (HELO ?172.17.159.11?) (192.168.0.112) by 0 with SMTP; 5 Jan 2005 15:33:44 -0000 Message-ID: <41DC0931.80603@tpack.net> Date: Wed, 05 Jan 2005 16:35:13 +0100 From: Tommy Christensen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: en-us, en MIME-Version: 1.0 To: hadi@cyberus.ca CC: Jeff Garzik , Thomas Spatzier , "David S. Miller" , Hasso Tepper , Herbert Xu , netdev@oss.sgi.com, Paul Jakma Subject: Re: [patch 4/10] s390: network driver. References: <1104764710.1048.580.camel@jzny.localdomain> <41DB26A6.2070008@pobox.com> <1104895169.1117.63.camel@jzny.localdomain> In-Reply-To: <1104895169.1117.63.camel@jzny.localdomain> Content-Type: multipart/mixed; boundary="------------040400030706040102090604" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13423 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tommy.christensen@tpack.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------040400030706040102090604 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit jamal wrote: > On Tue, 2005-01-04 at 18:28, Jeff Garzik wrote: > >>jamal wrote: >> >>>The change is simple if theres consensus to go this path. >> >>Can you resend your patch? > > > I didnt send any patch - but heres one that looks right - havent tried > compiling it. Thank you for diving into this, Jamal. For the patch to have much effect, we need to check the carrier before calling hard_start_xmit(). Like in the modified patch below. >>My main objection was that any change should be made in the core, not in >>individual net drivers. > > > Attached patch resolves that concern Except for the drivers that call netif_stop_queue() on link-down. These calls (and the corresponding netif_wake_queue) would have to be removed. -Tommy --------------040400030706040102090604 Content-Type: text/plain; name="sch_generic.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sch_generic.c.patch" --- linux-2.6.10-bk7/net/sched/sch_generic.c Wed Jan 5 16:27:13 2005 +++ linux-2.6.10-work/net/sched/sch_generic.c Wed Jan 5 16:28:53 2005 @@ -134,7 +134,7 @@ /* And release queue */ spin_unlock(&dev->queue_lock); - if (!netif_queue_stopped(dev)) { + if (!netif_queue_stopped(dev) && netif_carrier_ok(dev)) { int ret; if (netdev_nit) dev_queue_xmit_nit(skb, dev); @@ -162,6 +162,11 @@ } spin_lock(&dev->queue_lock); q = dev->qdisc; + if (!netif_carrier_ok(dev)) { + kfree_skb(skb); + q->qstats.drops++; + return -1; + } } /* Device kicked us out :( --------------040400030706040102090604-- From Robert.Olsson@data.slu.se Tue Jan 4 20:31:12 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 20:31:19 -0800 (PST) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j054Un0X000656 for ; Tue, 4 Jan 2005 20:31:11 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.12.10/8.12.10) with ESMTP id j05GUYuA030779; Wed, 5 Jan 2005 17:30:34 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 9DDAFEC0BC; Wed, 5 Jan 2005 17:30:34 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16860.5674.612383.986202@robur.slu.se> Date: Wed, 5 Jan 2005 17:30:34 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson , Stephen Hemminger Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501050918.22472.jeremy.guthrie@berbee.com> References: <200501031455.26980.jeremy.guthrie@berbee.com> <200501031656.57041.jeremy.guthrie@berbee.com> <16859.59675.522262.418329@robur.slu.se> <200501050918.22472.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13424 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > Yeah, the load will be high. I'm expecting this to be watching ~ 750 mbps by > next December. The app profiles all traffic going in and out of our data > centers. BW itself or pps is that not much of challange as handling of concurrent flows. > I'm not showing the /proc/net/rt_cache_stat file. Was there a kernel > option I need to recompile with for rt_cache_stat to show up in proc? No it's there without any options. Would be nice to the output from rtstat > > Also check that the CPU shares the RX packet load. CPU0 affinty to eth0 > > and CPU1 to eth1 seems to be best. It gives cache bouncing at "TX" and > > slab jobs but we have accept that for now. > How would I go about doing this? Assume you route packets between eth0 <-> eth1 Set eth0 irq to CPU0 and eth1 to CPU1 with /proc/irq/XX/smp_affinity Disable irqbalancer etc. > cat /proc/net/softnet_stat total droppped tsquz Throttl FR_hit FR_succe FR_defer FR_def_o cpu_coll > 5592c972 00000000 00001fc8 00000000 00000000 00000000 00000000 00000000 > 00391c3f > 000f1991 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > 001292ba See! One line per CPU. So CPU0 is handing almost all packets. > "%soft" > Show the percentage of time spent by the CPU or CPUs to service > softirqs. A softirq (software interrupt) is one of up to 32 > enumerated software interrupts which can run on multiple CPUs Well yes. I had a more specific question. I'll look into mpstat where do find it? Kernel pacthes? Be also aware that packet forwarding with SMP/NUMA is very much research today it is not that easy or not even possible to get aggregated performance from several CPU's. in any setup. Well anyway we are beginning to see some benefits now as we better understand the problems. --ro From tgraf@suug.ch Tue Jan 4 20:48:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 20:48:48 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j054mIAZ001568 for ; Tue, 4 Jan 2005 20:48:42 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 02C2D82; Wed, 5 Jan 2005 17:47:48 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 31A3F1C0EA; Wed, 5 Jan 2005 17:48:32 +0100 (CET) Date: Wed, 5 Jan 2005 17:48:32 +0100 From: Thomas Graf To: jamal Cc: netdev@oss.sgi.com Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier Message-ID: <20050105164832.GB17836@postel.suug.ch> References: <20050103125635.GB26856@postel.suug.ch> <20050104223612.GN26856@postel.suug.ch> <1104894728.1117.56.camel@jzny.localdomain> <20050105110048.GO26856@postel.suug.ch> <1104931991.1117.152.camel@jzny.localdomain> <20050105144514.GQ26856@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050105144514.GQ26856@postel.suug.ch> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13425 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev > Most importantly I don't want to touch any of the hashing code in u32. > I really like and it should stay as it is. The existing u32 match can > be easly made an ematch so this would safe us the extra work in u32 to > implement logic relations again and to fiddle with complicated selector > TLVs. The only problem with this is the nexthdr bits because it relies > on the hashing code. So we have to make this data available to the > ematch which is actually not a bad idea anyway. So I'm thinking about > introducing a new structure tcf_em_pkt_info or alike which carries > some additional information found out by the classifiers which can be > used by ematches. This can be information about the next header, > already extracted dscp values, etc. Here's what I mean, it moves the u32 match as-is to an ematch so it benefits from logic relations, inversion and can be used from other classifiers as well. All we have to do is set info->ptr and info->nexthdr to ptr respetively off2 before we evaluate the ematch tree. The pkt_info struct is then passed to tcf_em_tree_match and made available to every ematch. Thoughts? diff -Nru linux-2.6.10-bk8.orig/include/linux/pkt_cls.h linux-2.6.10-bk8/include/linux/pkt_cls.h --- linux-2.6.10-bk8.orig/include/linux/pkt_cls.h 2005-01-05 17:40:02.000000000 +0100 +++ linux-2.6.10-bk8/include/linux/pkt_cls.h 2005-01-05 17:38:42.000000000 +0100 @@ -351,6 +351,7 @@ TCF_EM_CONTAINER, TCF_EM_CMP, TCF_EM_NBYTE, + TCF_EM_U32, __TCF_EM_MAX }; diff -Nru linux-2.6.10-bk8.orig/include/net/pkt_cls.h linux-2.6.10-bk8/include/net/pkt_cls.h --- linux-2.6.10-bk8.orig/include/net/pkt_cls.h 2005-01-05 17:40:02.000000000 +0100 +++ linux-2.6.10-bk8/include/net/pkt_cls.h 2005-01-05 17:39:08.000000000 +0100 @@ -274,6 +274,8 @@ struct tcf_pkt_info { + u8 * ptr; + int nexthdr; }; static inline u32 tcf_read_bucket(u8 *ptr, u8 align) diff -Nru linux-2.6.10-bk8.orig/net/sched/Kconfig linux-2.6.10-bk8/net/sched/Kconfig --- linux-2.6.10-bk8.orig/net/sched/Kconfig 2005-01-05 17:38:26.000000000 +0100 +++ linux-2.6.10-bk8/net/sched/Kconfig 2005-01-05 17:41:59.000000000 +0100 @@ -408,6 +408,12 @@ To compile this code as a module, choose M here: the module will be called em_nbyte. +config NET_EMATCH_U32 + tristate "U32 hashing key" + depends on NET_EMATCH + ---help--- + TODO + config NET_CLS_ACT bool "Packet ACTION" depends on EXPERIMENTAL && NET_CLS && NET_QOS diff -Nru linux-2.6.10-bk8.orig/net/sched/Makefile linux-2.6.10-bk8/net/sched/Makefile --- linux-2.6.10-bk8.orig/net/sched/Makefile 2005-01-05 17:38:26.000000000 +0100 +++ linux-2.6.10-bk8/net/sched/Makefile 2005-01-05 17:40:15.000000000 +0100 @@ -36,3 +36,4 @@ obj-$(CONFIG_NET_EMATCH) += ematch.o obj-$(CONFIG_NET_EMATCH_CMP) += em_cmp.o obj-$(CONFIG_NET_EMATCH_NBYTE) += em_nbyte.o +obj-$(CONFIG_NET_EMATCH_U32) += em_u32.o diff -Nru linux-2.6.10-bk8.orig/net/sched/em_u32.c linux-2.6.10-bk8/net/sched/em_u32.c --- linux-2.6.10-bk8.orig/net/sched/em_u32.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.10-bk8/net/sched/em_u32.c 2005-01-05 17:38:42.000000000 +0100 @@ -0,0 +1,53 @@ +/* + * net/sched/em_u32.c U32 Ematch + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: Thomas Graf + * Alexey Kuznetsov, + * + * Based on net/sched/cls_u32.c + */ + +#include +#include +#include +#include +#include +#include + +static int em_u32_match(struct sk_buff *skb, struct tcf_ematch *m, + struct tcf_pkt_info *info) +{ + struct tc_u32_key *k = (struct tc_u32_key *) m->data; + u8 *ptr = info->ptr + k->off + (info->nexthdr & k->offmask); + + return !((*(u32*) ptr ^ k->val) & k->mask); +} + +static struct tcf_ematch_ops em_u32_ops = { + .kind = TCF_EM_U32, + .datalen = sizeof(struct tc_u32_key), + .match = em_u32_match, + .owner = THIS_MODULE, + .link = LIST_HEAD_INIT(em_u32_ops.link) +}; + +static int __init init_em_u32(void) +{ + return tcf_em_register(&em_u32_ops); +} + +static void __exit exit_em_u32(void) +{ + tcf_em_unregister(&em_u32_ops); +} + +MODULE_LICENSE("GPL"); + +module_init(init_em_u32); +module_exit(exit_em_u32); + From jeremy.guthrie@berbee.com Tue Jan 4 21:35:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 21:35:44 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j055ZG2d003619 for ; Tue, 4 Jan 2005 21:35:36 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 5 Jan 2005 11:35:04 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Wed, 5 Jan 2005 11:35:00 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson , Stephen Hemminger References: <200501031455.26980.jeremy.guthrie@berbee.com> <200501050918.22472.jeremy.guthrie@berbee.com> <16860.5674.612383.986202@robur.slu.se> In-Reply-To: <16860.5674.612383.986202@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2230455.ZoKKAJfLF7"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501051135.03493.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 05 Jan 2005 17:35:04.0115 (UTC) FILETIME=[E3FAE030:01C4F34C] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13426 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart2230455.ZoKKAJfLF7 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wednesday 05 January 2005 10:30 am, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > Yeah, the load will be high. I'm expecting this to be watching ~ 750 > > mbps by next December. The app profiles all traffic going in and out = of > > our data centers. > BW itself or pps is that not much of challange as handling of concurrent > flows. Roger that. > > I'm not showing the /proc/net/rt_cache_stat file. Was there a kernel > > option I need to recompile with for rt_cache_stat to show up in proc? > > No it's there without any options. Would be nice to the output from rtst= at Output from rtstat: rtstat fopen: No such file or directory cd /proc/net/ ls -la total 0 dr-xr-xr-x 5 root root 0 2005-01-04 08:53 . dr-xr-xr-x 72 root root 0 2005-01-04 08:53 .. =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 anycast6 =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 arp dr-xr-xr-x 2 root root 0 2005-01-05 10:32 atm =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 dev =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 dev_mcast dr-xr-xr-x 2 root root 0 2005-01-05 10:32 dev_snmp6 =2Dr--r--r-- 1 root root 0 2005-01-04 08:53 if_inet6 =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 igmp =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 igmp6 =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 ip6_flowlabel =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 ip_mr_cache =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 ip_mr_vif =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 ip_tables_matches =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 ip_tables_names =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 ip_tables_targets =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 ipv6_route =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 mcfilter =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 mcfilter6 =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 netlink =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 netstat =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 psched =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 raw =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 raw6 =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 route dr-xr-xr-x 6 root root 0 2005-01-05 10:32 rpc =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 rt6_stats =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 rt_acct =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 rt_cache =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 snmp =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 snmp6 =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 sockstat =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 sockstat6 =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 softnet_stat dr-xr-xr-x 2 root root 0 2005-01-05 10:32 stat =2Dr--r--r-- 1 root root 0 2005-01-04 08:53 tcp =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 tcp6 =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 tr_rif =2Dr--r--r-- 1 root root 0 2005-01-04 08:53 udp =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 udp6 =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 unix =2Dr--r--r-- 1 root root 0 2005-01-05 10:32 wireless > > > Also check that the CPU shares the RX packet load. CPU0 affinty to > > > eth0 and CPU1 to eth1 seems to be best. It gives cache bouncing at > > > "TX" and slab jobs but we have accept that for now. > > > > How would I go about doing this? > > Assume you route packets between eth0 <-> eth1 Yup > Set eth0 irq to CPU0 and eth1 to CPU1 with /proc/irq/XX/smp_affinity Done > Disable irqbalancer etc. Done I'll let you know what I see for stats once I get some collected. > > cat /proc/net/softnet_stat > > total droppped tsquz Throttl FR_hit FR_succe FR_defer FR_def_o > cpu_coll > > > 5592c972 00000000 00001fc8 00000000 00000000 00000000 00000000 00000000 > > 00391c3f > > 000f1991 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > > 001292ba > > See! One line per CPU. So CPU0 is handing almost all packets. cat /proc/interrupts CPU0 CPU1 0: 674862 93484967 IO-APIC-edge timer 1: 564 9 IO-APIC-edge i8042 7: 0 0 IO-APIC-level ohci_hcd 8: 1 1 IO-APIC-edge rtc 12: 268 62 IO-APIC-edge i8042 14: 2 0 IO-APIC-edge ide0 18: 2105131410 9140835 IO-APIC-level eth3 20: 1077 248075156 IO-APIC-level eth2 27: 118224 1 IO-APIC-level eth0 28: 36298 49 IO-APIC-level aic7xxx 30: 0 0 IO-APIC-level acpi NMI: 0 0 LOC: 94168097 94168094 ERR: 0 MIS: 0 > > "%soft" > > Show the percentage of time spent by the CPU or CPUs to service > > softirqs. A softirq (software interrupt) is one of up to 32 > > enumerated software interrupts which can run on multiple CPUs > > Well yes. I had a more specific question. I'll look into mpstat where do > find it? Kernel pacthes? Sorry about that. New to the list. I'm not suggesting anything. I=20 appreciate the help! Suse listed mpstat as part of sysstat 5.1.2. I'm running stock 2.6.10. > Be also aware that packet forwarding with SMP/NUMA is very much research > today it is not that easy or not even possible to get aggregated > performance from several CPU's. in any setup. Well anyway we are beginning > to see some benefits now as we better understand the problems. Understood. As long as I know this, I can articulate this to my uppers for= =20 bigger hardware. My current system is a dual P-III 700mhz. May be time fo= r=20 an upgrade. However, I figure this may also offer a good environment to he= lp=20 provide you guys with a taxed system running an load of flows. Nothing lik= e=20 finding fun stuff while a system is ready to fall over. Would a single hyper threaded CPU help this or should I default to a normal= =20 dual-cpu system? =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart2230455.ZoKKAJfLF7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB3CVHqtjaBHGZBeURAnY6AJ9bDuvkkdvq4Fz4e7cFE9fAwy69zwCfb5Yi QuzCimWD5bzoT/f5J+D8DTk= =XYHB -----END PGP SIGNATURE----- --nextPart2230455.ZoKKAJfLF7-- From jeremy.guthrie@berbee.com Tue Jan 4 23:26:16 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 23:26:23 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j057Pt8u007072 for ; Tue, 4 Jan 2005 23:26:16 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 5 Jan 2005 13:25:41 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Wed, 5 Jan 2005 13:25:37 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson , Stephen Hemminger References: <200501031455.26980.jeremy.guthrie@berbee.com> <16860.5674.612383.986202@robur.slu.se> <200501051135.03493.jeremy.guthrie@berbee.com> In-Reply-To: <200501051135.03493.jeremy.guthrie@berbee.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1848405.zG5ppPKG5L"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501051325.40616.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 05 Jan 2005 19:25:41.0432 (UTC) FILETIME=[58211380:01C4F35C] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13427 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart1848405.zG5ppPKG5L Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline After smp_affinity adjustments and turning off IRQ balancing. eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255.0 inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:537271635 errors:2377048 dropped:2377048 overruns:1849= 169=20 frame:0 TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1804727106 (1721.1 Mb) TX bytes:398 (398.0 b) Base address:0x22a0 Memory:eff80000-effa0000 =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart1848405.zG5ppPKG5L Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB3D80qtjaBHGZBeURAjNkAJ9CabJ3ZnVy6UfHF2bkQ+XyJUP/ugCgmZhw jZ4s0v7Q+e7diEU0AjwVY/8= =Df1l -----END PGP SIGNATURE----- --nextPart1848405.zG5ppPKG5L-- From johannes@erdfelt.com Tue Jan 4 23:34:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 04 Jan 2005 23:34:59 -0800 (PST) Received: from farley.sventech.com (IDENT:daemon@farley.sventech.com [69.36.241.87]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j057YWxZ007803 for ; Tue, 4 Jan 2005 23:34:52 -0800 Received: from localhost (localhost [127.0.0.1]) (uid 500) by farley.sventech.com with local; Wed, 05 Jan 2005 19:34:25 +0000 Date: Wed, 5 Jan 2005 11:34:25 -0800 From: Johannes Erdfelt To: netdev@oss.sgi.com Subject: [RFC] tulip VLAN support Message-ID: <20050105193425.GY18847@sventech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13428 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: johannes@erdfelt.com Precedence: bulk X-list: netdev I recently upgraded a system running a 2.4 kernel to a 2.6 based distribution (Fedora Core 2, 2.6.9-1.6_FC2 kernel) and ran into a problem using NFS. After spending some tracking it down, I found out it was an MTU problem and then remembered I had the same problem a couple of years ago with the 2.4 kernels I was running. The problem is that the tulip driver doesn't handle 802.1q tags correctly. Since the VLAN tagging adds 4 bytes to the beginning of the frame, this can cause frame sizes to be too large for the driver (chip?) and the packets get dropped. I've taken the 2.4 patch I found (I forget who developed it, sorry) and ported it to the 2.6 driver. The patch is relative to the 2.6.9-1.6_FC2 kernel for FC2, but I suspect it will apply to other kernels relatively cleanly. Before I rediff the patch against the BK tree and double check all of the tulip variants are updated correctly as well, is there any interest in accepting a patch like this? The 2.4 patch worked for a couple of years for me with no problems and this 2.6 patch has worked for over a week now with no problems. However, I'm worried that there is a reason why a similar patch has not been applied already. JE diff -ur linux-2.6.9.orig/drivers/net/tulip/interrupt.c linux-2.6.9/drivers/net/tulip/interrupt.c --- linux-2.6.9.orig/drivers/net/tulip/interrupt.c 2004-10-18 14:55:36.000000000 -0700 +++ linux-2.6.9/drivers/net/tulip/interrupt.c 2004-12-30 15:23:51.085876693 -0800 @@ -155,9 +155,9 @@ if (--rx_work_limit < 0) goto not_done; - if ((status & 0x38008300) != 0x0300) { - if ((status & 0x38000300) != 0x0300) { - /* Ingore earlier buffers. */ + if ((status & (0x38000000 | RxDescFatalErr | RxWholePkt)) != RxWholePkt) { + if ((status & (0x38000000 | RxWholePkt)) != RxWholePkt) { + /* Ignore earlier buffers. */ if ((status & 0xffff) != 0x7fff) { if (tulip_debug > 1) printk(KERN_WARNING "%s: Oversized Ethernet frame " @@ -182,10 +182,10 @@ struct sk_buff *skb; #ifndef final_version - if (pkt_len > 1518) { + if (pkt_len > 1522) { printk(KERN_WARNING "%s: Bogus packet size of %d (%#x).\n", dev->name, pkt_len, pkt_len); - pkt_len = 1518; + pkt_len = 1522; tp->stats.rx_length_errors++; } #endif @@ -378,9 +378,9 @@ dev->name, entry, status); if (--rx_work_limit < 0) break; - if ((status & 0x38008300) != 0x0300) { - if ((status & 0x38000300) != 0x0300) { - /* Ingore earlier buffers. */ + if ((status & (0x38000000 | RxDescFatalErr | RxWholePkt)) != RxWholePkt) { + if ((status & (0x38000000 | RxWholePkt)) != RxWholePkt) { + /* Ignore earlier buffers. */ if ((status & 0xffff) != 0x7fff) { if (tulip_debug > 1) printk(KERN_WARNING "%s: Oversized Ethernet frame " @@ -405,10 +405,10 @@ struct sk_buff *skb; #ifndef final_version - if (pkt_len > 1518) { + if (pkt_len > 1522) { printk(KERN_WARNING "%s: Bogus packet size of %d (%#x).\n", dev->name, pkt_len, pkt_len); - pkt_len = 1518; + pkt_len = 1522; tp->stats.rx_length_errors++; } #endif diff -ur linux-2.6.9.orig/drivers/net/tulip/tulip.h linux-2.6.9/drivers/net/tulip/tulip.h --- linux-2.6.9.orig/drivers/net/tulip/tulip.h 2004-10-18 14:55:21.000000000 -0700 +++ linux-2.6.9/drivers/net/tulip/tulip.h 2004-12-30 15:20:21.432056171 -0800 @@ -191,7 +191,7 @@ enum desc_status_bits { DescOwned = 0x80000000, - RxDescFatalErr = 0x8000, + RxDescFatalErr = 0x4842, RxWholePkt = 0x0300, }; @@ -259,7 +259,7 @@ #define RX_RING_SIZE 128 #define MEDIA_MASK 31 -#define PKT_BUF_SZ 1536 /* Size of each temporary Rx buffer. */ +#define PKT_BUF_SZ 1540 /* Size of each temporary Rx buffer. */ #define TULIP_MIN_CACHE_LINE 8 /* in units of 32-bit words */ diff -ur linux-2.6.9.orig/drivers/net/tulip/tulip_core.c linux-2.6.9/drivers/net/tulip/tulip_core.c --- linux-2.6.9.orig/drivers/net/tulip/tulip_core.c 2004-10-18 14:54:32.000000000 -0700 +++ linux-2.6.9/drivers/net/tulip/tulip_core.c 2004-12-30 15:19:42.424578510 -0800 @@ -70,7 +70,7 @@ #if defined(__alpha__) || defined(__arm__) || defined(__hppa__) \ || defined(__sparc_) || defined(__ia64__) \ || defined(__sh__) || defined(__mips__) -static int rx_copybreak = 1518; +static int rx_copybreak = 1522; #else static int rx_copybreak = 100; #endif From mcgrof@studorgs.rutgers.edu Wed Jan 5 00:05:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 00:06:01 -0800 (PST) Received: from ruslug.rutgers.edu (studorgs.rutgers.edu [128.6.24.131]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0585XWl009173 for ; Wed, 5 Jan 2005 00:05:54 -0800 Received: by ruslug.rutgers.edu (Postfix, from userid 503) id 98475F9D4D; Wed, 5 Jan 2005 15:05:26 -0500 (EST) Date: Wed, 5 Jan 2005 15:05:26 -0500 To: prism54-devel@prism54.org, prism54-users@prism54.org Cc: Netdev , linux-kernel@vger.kernel.org, Jeff Garzik , Jean Tourrilhes , mcgrof@studorgs.rutgers.edu Subject: Open hardware wireless cards Message-ID: <20050105200526.GL5159@ruslug.rutgers.edu> Mail-Followup-To: prism54-devel@prism54.org, prism54-users@prism54.org, Netdev , linux-kernel@vger.kernel.org, Jeff Garzik , Jean Tourrilhes Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FN+gV9K+162wdwwF" Content-Disposition: inline In-Reply-To: <20050105192447.GJ5159@ruslug.rutgers.edu> User-Agent: Mutt/1.3.28i X-Operating-System: 2.4.18-1-686 Organization: Rutgers University Student Linux Users Group From: mcgrof@studorgs.rutgers.edu (Luis R. Rodriguez) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13429 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mcgrof@studorgs.rutgers.edu Precedence: bulk X-list: netdev --FN+gV9K+162wdwwF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 05, 2005 at 02:24:47PM -0500, Luis R. Rodriguez wrote: <-- snip --> > As far as support for the new chipsets goes -- sorry -- we won't be able > to support it as I don't think even Conexant has a final well tested > linux source base ready for 2.6. And even if we are given a source base > there is nothing we can do to get around the need for the closed-source= =20 > softmac libs that it relies on. As much as I'd like to support it, I > don't want to get a headache to support something I cannot modify so I > won't be willing to support a half-opened driver as the atheros driver. I'd also like to add... For those of you frustrated about our current wireless driver situation in open platforms -- I think we probably will have this trouble with most modern hardware for a = while (graphics cards, wireless driver, etc). A lot of has to do with patent infringement issues, "intellectual property" protection, and other business-oriented excuses. What I think we probably will have to do is just work torwards seeing if we can come up with our own open wireless hardware. I know there was a recent thread on lkml about an open video card -- anyone know where that ended up? If we can't come up with our own project to work on open hardware we can also just see if its feasible to purchase hardware companies on the verge of going backrupt and buy them out and release the specs/etc (a la blender). Can someone do the math here? I'm lazy. Luis --=20 GnuPG Key fingerprint =3D 113F B290 C6D2 0251 4D84 A34A 6ADD 4937 E20A 525E --FN+gV9K+162wdwwF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFB3EiGat1JN+IKUl4RAt6mAJ9gbrBRF/ua2WuCBHLQcrpy012SxQCgjAlq HLlowOyG5hYmToywmmfBsNA= =g6/K -----END PGP SIGNATURE----- --FN+gV9K+162wdwwF-- From lsorense@csclub.uwaterloo.ca Wed Jan 5 00:15:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 00:15:09 -0800 (PST) Received: from perpugilliam.csclub.uwaterloo.ca (postfix@perpugilliam.csclub.uwaterloo.ca [129.97.134.31]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j058EfmB010282 for ; Wed, 5 Jan 2005 00:15:02 -0800 Received: by perpugilliam.csclub.uwaterloo.ca (Postfix, from userid 3120) id 8C5F5A85E1; Wed, 5 Jan 2005 15:14:34 -0500 (EST) Date: Wed, 5 Jan 2005 15:14:34 -0500 To: prism54-devel@prism54.org, prism54-users@prism54.org, Netdev , linux-kernel@vger.kernel.org, Jeff Garzik , Jean Tourrilhes Subject: Re: Open hardware wireless cards Message-ID: <20050105201434.GB30311@csclub.uwaterloo.ca> References: <20050105192447.GJ5159@ruslug.rutgers.edu> <20050105200526.GL5159@ruslug.rutgers.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050105200526.GL5159@ruslug.rutgers.edu> User-Agent: Mutt/1.3.28i From: lsorense@csclub.uwaterloo.ca (Lennart Sorensen) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13430 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: lsorense@csclub.uwaterloo.ca Precedence: bulk X-list: netdev On Wed, Jan 05, 2005 at 03:05:26PM -0500, Luis R. Rodriguez wrote: > I'd also like to add... > > For those of you frustrated about our current wireless driver situation > in open platforms -- > > I think we probably will have this trouble with most modern hardware for a while > (graphics cards, wireless driver, etc). A lot of has to do with patent > infringement issues, "intellectual property" protection, and other > business-oriented excuses. > > What I think we probably will have to do is just work torwards seeing if > we can come up with our own open wireless hardware. I know there was > a recent thread on lkml about an open video card -- anyone know where > that ended up? > > If we can't come up with our own project to work on open hardware we can > also just see if its feasible to purchase hardware companies on the > verge of going backrupt and buy them out and release the specs/etc (a la > blender). Can someone do the math here? I'm lazy. Being open doesn't mean you aren't violating some stupid patent. Software patents really are an incredibly stupid idea. Algorithms are pushing it. After all what does the algorithm do on it's own? Can you show it working and doing something? Len Sorensen From Robert.Olsson@data.slu.se Wed Jan 5 00:23:29 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 00:23:40 -0800 (PST) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j058N8sL014258 for ; Wed, 5 Jan 2005 00:23:29 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.12.10/8.12.10) with ESMTP id j05KMtuA001260; Wed, 5 Jan 2005 21:22:55 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 455B8EC0BC; Wed, 5 Jan 2005 21:22:55 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16860.19615.251360.169722@robur.slu.se> Date: Wed, 5 Jan 2005 21:22:55 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson , Stephen Hemminger Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501051325.40616.jeremy.guthrie@berbee.com> References: <200501031455.26980.jeremy.guthrie@berbee.com> <16860.5674.612383.986202@robur.slu.se> <200501051135.03493.jeremy.guthrie@berbee.com> <200501051325.40616.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13432 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > After smp_affinity adjustments and turning off IRQ balancing. > > eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 > RX packets:537271635 errors:2377048 dropped:2377048 overruns:1849169 Worse? Yes. I'll remember Hararld moved rt_cache_stat /proc/net/stats/ and wrote a new utility for it. Should be in iproute2 package. Stephen knows the details. Otherwise change path in rtstat. You need this to relate and verify the load. Check throughtput and how packet load is used with 2.4. /proc/net/softnet_stat and rtstat. Also meditate how the comparison can be fair wrt taffic patterns. Do smame with 2.6. Prepare for a oprofile. I'm lazy and compile the stuff I use into kernel if you can get the same result w. nodules it's ok. --ro From dhollis@davehollis.com Wed Jan 5 00:23:22 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 00:23:29 -0800 (PST) Received: from pop-a065d23.pas.sa.earthlink.net (pop-a065d23.pas.sa.earthlink.net [207.217.121.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j058N1xB014251 for ; Wed, 5 Jan 2005 00:23:22 -0800 Received: from user-12hcjeo.cable.mindspring.com ([69.22.77.216] helo=bender.davehollis.com) by pop-a065d23.pas.sa.earthlink.net with esmtp (Exim 3.33 #1) id 1CmHgE-0007Pn-00 for netdev@oss.sgi.com; Wed, 05 Jan 2005 12:22:54 -0800 Received: from 10.8.0.6 ([10.8.0.6]) (authenticated bits=0) by bender.davehollis.com (8.13.1/8.12.11) with ESMTP id j05KMl9I020266 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Wed, 5 Jan 2005 15:22:50 -0500 Subject: Network driver test suite? From: David Hollis To: Netdev Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-iN/CSXxyVrLxrJOpvhY/" Date: Wed, 05 Jan 2005 15:19:46 -0500 Message-Id: <1104956386.3877.58.camel@dhollis-lnx.centricconsulting.com> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) X-Scanned-By: MIMEDefang 2.49 on 10.8.0.1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13431 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dhollis@davehollis.com Precedence: bulk X-list: netdev --=-iN/CSXxyVrLxrJOpvhY/ Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Is there any kind of test suite (automated or list of tests) available for testing Linux network drivers? I'm completing the addition of a few new USB ethernet devices and would like to able to test all possible scenarios instead of coming across them piece-meal in the future. I'm not a big fan of the "works on my box" testing that I'm doing now. I'm sure there are all kinds of things that I'm not testing that aren't everyday types of things such as VLANs, multicasting, various ethtool/mii-tool things, large packets, etc. If there isn't anything like this, maybe it would be a useful thing to develop? At a minimum, maybe to set the treshhold for minimum features that drivers support and the like. --=20 David Hollis --=-iN/CSXxyVrLxrJOpvhY/ Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQBB3EvhxasLqOyGHncRAgMDAKCO/pkUIwy3BdKNud9stqyPDF/VZgCfXiWi zIyyHfUy0G/ue6WPaUnMhmI= =QxIc -----END PGP SIGNATURE----- --=-iN/CSXxyVrLxrJOpvhY/-- From steve@nexusuk.org Wed Jan 5 00:28:50 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 00:28:58 -0800 (PST) Received: from rivendell.nexusuk.org (rivendell.nexusuk.org [84.92.27.250]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j058STZh015302 for ; Wed, 5 Jan 2005 00:28:50 -0800 Received: from rivendell.nexusuk.org (localhost [127.0.0.1]) by rivendell.nexusuk.org (8.13.1/8.13.1) with ESMTP id j05KMDmb008700 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 5 Jan 2005 20:22:13 GMT Date: Wed, 5 Jan 2005 20:22:10 +0000 (GMT) From: Steve Hill To: "Luis R. Rodriguez" cc: prism54-devel@prism54.org, prism54-users@prism54.org, Netdev , Jean Tourrilhes , Jeff Garzik , linux-kernel@vger.kernel.org Subject: Re: [Prism54-users] Open hardware wireless cards In-Reply-To: <20050105200526.GL5159@ruslug.rutgers.edu> Message-ID: References: <20050105200526.GL5159@ruslug.rutgers.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13433 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: steve@nexusuk.org Precedence: bulk X-list: netdev -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wed, 5 Jan 2005, Luis R. Rodriguez wrote: > What I think we probably will have to do is just work torwards seeing if > we can come up with our own open wireless hardware. I know there was > a recent thread on lkml about an open video card -- anyone know where > that ended up? This may be a silly point, but there *was* good 802.11g hardware available which worked well with the fully open drivers. I presume the manufacturers are moving to the "softmac" design instead because (for them) it is cheaper. However, the point is that the working designs are already there and it may be that buying the existing design which is being phased out is cheaper for the FOSS community than developing a whole new open device. Maybe it would be possible to convince one of the manufacturers that it's worth their while producing the older design hardware - if there is a single manufacturer who is making more or less the only hardware that is guaranteed to work under Linux there is probably quite a market for them. - Steve Jabber: steve@nexusuk.org Web: http://www.nexusuk.org/ Servatis a periculum, servatis a maleficum - Whisper, Evanescence -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) Comment: Public key available at http://www.nexusuk.org/pubkey.txt iD8DBQFB3Ex15zUOsIV3bqERAuInAKCGVS1kzaR4En2nQnKhDPv6TptZ+QCdEzFN y8HbDEpnxvJql8AVpDePcnA= =NfEa -----END PGP SIGNATURE----- From mcgrof@studorgs.rutgers.edu Wed Jan 5 00:37:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 00:37:20 -0800 (PST) Received: from ruslug.rutgers.edu (studorgs.rutgers.edu [128.6.24.131]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j058aqd0016599 for ; Wed, 5 Jan 2005 00:37:13 -0800 Received: by ruslug.rutgers.edu (Postfix, from userid 503) id 953A4F9D6B; Wed, 5 Jan 2005 15:36:45 -0500 (EST) Date: Wed, 5 Jan 2005 15:36:45 -0500 To: Steve Hill Cc: "Luis R. Rodriguez" , prism54-devel@prism54.org, prism54-users@prism54.org, Netdev , Jean Tourrilhes , Jeff Garzik , linux-kernel@vger.kernel.org Subject: Re: [Prism54-users] Open hardware wireless cards Message-ID: <20050105203645.GO5159@ruslug.rutgers.edu> Mail-Followup-To: Steve Hill , "Luis R. Rodriguez" , prism54-devel@prism54.org, prism54-users@prism54.org, Netdev , Jean Tourrilhes , Jeff Garzik , linux-kernel@vger.kernel.org References: <20050105200526.GL5159@ruslug.rutgers.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Il7n/DHsA0sMLmDu" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i X-Operating-System: 2.4.18-1-686 Organization: Rutgers University Student Linux Users Group From: mcgrof@studorgs.rutgers.edu (Luis R. Rodriguez) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13434 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mcgrof@studorgs.rutgers.edu Precedence: bulk X-list: netdev --Il7n/DHsA0sMLmDu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 05, 2005 at 08:22:10PM +0000, Steve Hill wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 >=20 > On Wed, 5 Jan 2005, Luis R. Rodriguez wrote: >=20 > >What I think we probably will have to do is just work torwards seeing if > >we can come up with our own open wireless hardware. I know there was > >a recent thread on lkml about an open video card -- anyone know where > >that ended up? >=20 > This may be a silly point, but there *was* good 802.11g hardware availabl= e=20 > which worked well with the fully open drivers.=20 Yes, that would be the Full MAC prism chipsets with the linux prism54 drive= r, which I help maintain. > I presume the=20 > manufacturers are moving to the "softmac" design instead because (for=20 > them) it is cheaper. That is correct. They have already moved to the Softmac design and you're lucky if you can buy FullMAC chipsets in stores now. > However, the point is that the working designs are=20 > already there and it may be that buying the existing design which is bein= g=20 > phased out is cheaper for the FOSS community than developing a whole new= =20 > open device. Definitely, I agree. Anyone have an idea of how much buying a wireless chipset design may cost? > Maybe it would be possible to convince one of the manufacturers that it's= =20 > worth their while producing the older design hardware - if there is a=20 > single manufacturer who is making more or less the only hardware that is= =20 > guaranteed to work under Linux there is probably quite a market for them. I think they made the move because of economics as you mentioned earlier. Under the current circumstances, I find it hard to be able to Convince Conexant, for example, to start selling FullMAC chipsets again. AFAICT the FullMAC chipsets have reached the END OF LIFE period. Luis --=20 GnuPG Key fingerprint =3D 113F B290 C6D2 0251 4D84 A34A 6ADD 4937 E20A 525E --Il7n/DHsA0sMLmDu Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFB3E/dat1JN+IKUl4RAn+zAJ9Nqm7B2/Z/4ouMrwSdYqjNQlSLRQCfdWtT Zum49MFe0zuSx+3O2yHHpKE= =uXsP -----END PGP SIGNATURE----- --Il7n/DHsA0sMLmDu-- From jeremy.guthrie@berbee.com Wed Jan 5 00:53:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 00:53:43 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j058rGC8017504 for ; Wed, 5 Jan 2005 00:53:36 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 5 Jan 2005 14:53:03 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Wed, 5 Jan 2005 14:52:57 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson , Stephen Hemminger References: <200501031455.26980.jeremy.guthrie@berbee.com> <200501051325.40616.jeremy.guthrie@berbee.com> <16860.19615.251360.169722@robur.slu.se> In-Reply-To: <16860.19615.251360.169722@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2053757.ArktrbUOaq"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501051453.03022.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 05 Jan 2005 20:53:03.0854 (UTC) FILETIME=[8CDB30E0:01C4F368] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13435 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart2053757.ArktrbUOaq Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wednesday 05 January 2005 02:22 pm, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > After smp_affinity adjustments and turning off IRQ balancing. > > > > eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 > > > > RX packets:537271635 errors:2377048 dropped:2377048 > > overruns:1849169 > > Worse? > > Yes. I'll remember Hararld moved rt_cache_stat /proc/net/stats/ and wrote > a new utility for it. Should be in iproute2 package. Stephen knows the > details. Otherwise change path in rtstat. You need this to relate and > verify the load. Hm... ls -la /proc/net/stat/ total 0 dr-xr-xr-x 2 root root 0 Jan 5 14:47 . dr-xr-xr-x 5 root root 0 Jan 5 11:50 .. =2Dr--r--r-- 1 root root 0 Jan 5 14:47 arp_cache =2Dr--r--r-- 1 root root 0 Jan 5 14:47 clip_arp_cache =2Dr--r--r-- 1 root root 0 Jan 5 14:47 ndisc_cache =2Dr--r--r-- 1 root root 0 Jan 5 14:47 rt_cache > Check throughtput and how packet load is used with 2.4. > /proc/net/softnet_stat and rtstat.=20 Will do. > Also meditate how the comparison can be=20 > fair wrt taffic patterns. Do smame with 2.6. Not sure I follow. I can see higher pps/byte through puts on switch port=20 counters when I run with 2.4 vs 2.6. I'll double check though. I am the=20 'dev' state so I can swap between V2.4 and V2.6 as necessary to compare=20 during roughly equivalent times. The only delay is the time between reboot= s. > Prepare for a oprofile. I'm lazy and compile the stuff I use into kernel > if you can get the same result w. nodules it's ok. Okay. > > > --ro =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart2053757.ArktrbUOaq Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB3FOuqtjaBHGZBeURArx5AJoD1hHvaB93tJpQtWF6wrOGpNfBugCfTtEj L/NGCQWMNHjI4Au8pD6LJNc= =4LXK -----END PGP SIGNATURE----- --nextPart2053757.ArktrbUOaq-- From linux-os@chaos.analogic.com Wed Jan 5 00:56:29 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 00:56:36 -0800 (PST) Received: from chaos.analogic.com (alog0237.analogic.com [208.224.220.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j058u80r018030 for ; Wed, 5 Jan 2005 00:56:29 -0800 Received: from chaos.analogic.com (localhost.localdomain [127.0.0.1]) by chaos.analogic.com (8.12.11/8.12.11) with ESMTP id j05KmklR012273; Wed, 5 Jan 2005 15:48:46 -0500 Received: (from linux-os@localhost) by chaos.analogic.com (8.12.11/8.12.11/Submit) id j05KmkPP012272; Wed, 5 Jan 2005 15:48:46 -0500 Date: Wed, 5 Jan 2005 15:48:46 -0500 (EST) From: linux-os Reply-To: linux-os@analogic.com To: lsorense@csclub.uwaterloo.ca cc: prism54-devel@prism54.org, prism54-users@prism54.org, Netdev , linux-kernel@vger.kernel.org, Jeff Garzik , Jean Tourrilhes Subject: Re: Open hardware wireless cards In-Reply-To: <20050105201434.GB30311@csclub.uwaterloo.ca> Message-ID: References: <20050105192447.GJ5159@ruslug.rutgers.edu> <20050105200526.GL5159@ruslug.rutgers.edu> <20050105201434.GB30311@csclub.uwaterloo.ca> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13436 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: linux-os@chaos.analogic.com Precedence: bulk X-list: netdev On Wed, 5 Jan 2005 lsorense@csclub.uwaterloo.ca wrote: > On Wed, Jan 05, 2005 at 03:05:26PM -0500, Luis R. Rodriguez wrote: >> I'd also like to add... >> >> For those of you frustrated about our current wireless driver situation >> in open platforms -- >> >> I think we probably will have this trouble with most modern hardware for a while >> (graphics cards, wireless driver, etc). A lot of has to do with patent >> infringement issues, "intellectual property" protection, and other >> business-oriented excuses. >> >> What I think we probably will have to do is just work torwards seeing if >> we can come up with our own open wireless hardware. I know there was >> a recent thread on lkml about an open video card -- anyone know where >> that ended up? >> >> If we can't come up with our own project to work on open hardware we can >> also just see if its feasible to purchase hardware companies on the >> verge of going backrupt and buy them out and release the specs/etc (a la >> blender). Can someone do the math here? I'm lazy. > > Being open doesn't mean you aren't violating some stupid patent. > Software patents really are an incredibly stupid idea. Algorithms are > pushing it. After all what does the algorithm do on it's own? Can you > show it working and doing something? > > Len Sorensen Well its mostly about making boards just a bit too cheap. If the vendors would just put in a serial EPROM that loads the proprietary stuff to their PLD upon startup, then there is no "proprietary" code to worry about. You have the generic published interface like a PLX chip, plus the specific published register functions of their PLD chip. How the device actually makes smoke and mirrors is hidden even from the programmer. But, by eliminating the US$0.50 cost of a EPROM, they want to supply a sack of bits that needs to be uploaded to the PLD by software. This sack of bits can be reverse-engineered so companies are not going to supply these (you can extract those bits from a Win-Modem dll so this gets a bit too ridiculous for some devices). In most cases it's not some algorithm that needs to be protected. Instead its the 400-or-so engineering man-hours used to develop the contents of the PLD (notice I did not use the words "Gate-Arrays" until now. There are many kinds of Programmable Logic Devices). Until vendors stop being penny-wise-pound-foolish, we will continue to have these kinds of problems. Vendor education will ultimately be the fix, I predict. Cheers, Dick Johnson Penguin : Linux version 2.6.10 on an i686 machine (5537.79 BogoMips). Notice : All mail here is now cached for review by Dictator Bush. 98.36% of all statistics are fiction. From akpm@osdl.org Wed Jan 5 01:36:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 01:36:14 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j059Zkc6019701 for ; Wed, 5 Jan 2005 01:36:06 -0800 Received: from bix (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id j05LZYd02938 for ; Wed, 5 Jan 2005 13:35:34 -0800 Date: Wed, 5 Jan 2005 13:35:25 -0800 From: Andrew Morton To: netdev@oss.sgi.com Subject: Fw: [Bugme-new] [Bug 3992] New: Bondig. Not correct work function ARP Monitoring. Broken link. Message-Id: <20050105133525.2bab2e09.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j059Zkc6019701 X-archive-position: 13438 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Begin forwarded message: Date: Wed, 5 Jan 2005 07:59:17 -0800 From: bugme-daemon@osdl.org To: bugme-new@lists.osdl.org Subject: [Bugme-new] [Bug 3992] New: Bondig. Not correct work function ARP Monitoring. Broken link. http://bugme.osdl.org/show_bug.cgi?id=3992 Summary: Bondig. Not correct work function ARP Monitoring. Broken link. Kernel Version: 2.6.10 Status: NEW Severity: normal Owner: jgarzik@pobox.com Submitter: stanislav@muhachev.petro.ru Distribution: Hardware Environment: Vmware GSX machine Software Environment: Gentoo Problem Description: bonding interface going down and down slave link Steps to reproduce: 2 virtual pc identical gentoo linux (copy) 1 nic for both virtual pc up 2 openvpn link trouch nic to another virtual pc (tap0 and tap1)[ethernet bridge] link both vpn1 and vpn2 - ok!(independing link like:192.168.1.1-192.168.1.2 and 192.168.2.1-192.168.2.2) bonding vpn1 & vpn2 òî bond0 (bonding default setup -> nothing failover setings) link îê!(192.168.100.1-192.168.100.2) setting arp monitor in bonding (TUN/TAP driver not support Mii status) link down! arp request go from bond0(machine1)[from tap0 & tap1] to bond0(machine2) - ok. arp answer bond0(machine2) interface - ok! !!! bond0(machine2) -> tap0(tap1)(machine2) - noting!!!(arp answer broken) resultat arp request not complite situation analog both side for monitoring use TCPDUMP ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. From lsorense@csclub.uwaterloo.ca Wed Jan 5 01:35:41 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 01:35:47 -0800 (PST) Received: from perpugilliam.csclub.uwaterloo.ca (postfix@perpugilliam.csclub.uwaterloo.ca [129.97.134.31]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j059ZLvm019690 for ; Wed, 5 Jan 2005 01:35:41 -0800 Received: by perpugilliam.csclub.uwaterloo.ca (Postfix, from userid 3120) id 4D665A8600; Wed, 5 Jan 2005 16:35:10 -0500 (EST) Date: Wed, 5 Jan 2005 16:35:10 -0500 To: linux-os@analogic.com Cc: prism54-devel@prism54.org, prism54-users@prism54.org, Netdev , linux-kernel@vger.kernel.org, Jeff Garzik , Jean Tourrilhes Subject: Re: Open hardware wireless cards Message-ID: <20050105213510.GP28140@csclub.uwaterloo.ca> References: <20050105192447.GJ5159@ruslug.rutgers.edu> <20050105200526.GL5159@ruslug.rutgers.edu> <20050105201434.GB30311@csclub.uwaterloo.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i From: lsorense@csclub.uwaterloo.ca (Lennart Sorensen) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13437 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: lsorense@csclub.uwaterloo.ca Precedence: bulk X-list: netdev On Wed, Jan 05, 2005 at 03:48:46PM -0500, linux-os wrote: > Well its mostly about making boards just a bit too cheap. > > If the vendors would just put in a serial EPROM that loads the > proprietary stuff to their PLD upon startup, then there is > no "proprietary" code to worry about. You have the generic > published interface like a PLX chip, plus the specific published > register functions of their PLD chip. How the device actually > makes smoke and mirrors is hidden even from the programmer. > > But, by eliminating the US$0.50 cost of a EPROM, they want to supply > a sack of bits that needs to be uploaded to the PLD by software. This > sack of bits can be reverse-engineered so companies are not going > to supply these (you can extract those bits from a Win-Modem dll so > this gets a bit too ridiculous for some devices). > > In most cases it's not some algorithm that needs to be protected. > Instead its the 400-or-so engineering man-hours used to develop the > contents of the PLD (notice I did not use the words "Gate-Arrays" > until now. There are many kinds of Programmable Logic Devices). > > Until vendors stop being penny-wise-pound-foolish, we will continue > to have these kinds of problems. Vendor education will ultimately > be the fix, I predict. Well unfortunately I think you underestimate the cost of the serial eprom needed to do the load on an fpga or pld or the like. According to our suppliers they are actually rather hard to get for some reason (that I don't understand) and are more than $0.50. The product I am current working on software for would be a whole lot simpler if we could just program an eprom with the fpga code, but instead we have to load it via jtag through the parallel port to save a fair bit of moeny on eprom chips assuming we could even get them in the quantities we would need. The winmodem is just a sound card with the cpu doing the actual algorihtm. That is different and would not be solved with an eprom, only with a real DSP or other chip capable of doing the modulation and demodulation of the signals. I guess calling them modem's is being too generous, more like phone line sampler cards. Len Sorensen From flamingice@sourmilk.net Wed Jan 5 01:54:22 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 01:54:29 -0800 (PST) Received: from server8.totalchoicehosting.com (server8.totalchoicehosting.com [216.180.241.250]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j059s1sc021459 for ; Wed, 5 Jan 2005 01:54:22 -0800 Received: from host-24-225-148-91.patmedia.net ([24.225.148.91] helo=[192.168.0.100]) by server8.totalchoicehosting.com with esmtpsa (TLSv1:RC4-MD5:128) (Exim 4.43) id 1CmJ6L-0005XA-GJ for netdev@oss.sgi.com; Wed, 05 Jan 2005 16:53:57 -0500 From: Michael Wu To: netdev@oss.sgi.com Subject: Re: [Prism54-users] Open hardware wireless cards Date: Wed, 5 Jan 2005 16:53:30 -0500 User-Agent: KMail/1.7.1 References: <20050105200526.GL5159@ruslug.rutgers.edu> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1788797.UstzDMJBSy"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501051653.41053.flamingice@sourmilk.net> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server8.totalchoicehosting.com X-AntiAbuse: Original Domain - oss.sgi.com X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - sourmilk.net X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13439 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: flamingice@sourmilk.net Precedence: bulk X-list: netdev --nextPart1788797.UstzDMJBSy Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wednesday 05 January 2005 3:22 pm, Steve Hill wrote: > On Wed, 5 Jan 2005, Luis R. Rodriguez wrote: > > What I think we probably will have to do is just work torwards seeing if > > we can come up with our own open wireless hardware. I know there was > > a recent thread on lkml about an open video card -- anyone know where > > that ended up? > > This may be a silly point, but there *was* good 802.11g hardware available > which worked well with the fully open drivers. I presume the > manufacturers are moving to the "softmac" design instead because (for > them) it is cheaper. However, the point is that the working designs are > already there and it may be that buying the existing design which is being > phased out is cheaper for the FOSS community than developing a whole new > open device. Softmac doesn't necessary mean evil all the time. The adm8211 has a fully G= PL=20 driver for Linux. There is no firmware to worry about either. ADMtek actual= ly=20 helped me with the driver, by providing the source to their old 2.4 binary= =20 Linux driver and sending me (from Taiwan to New Jersey, fedexed overnight)= =20 two sample cards to test with. Oh yes, and it's quite cheap. (but 802.11b,= =20 which maybe a problem for some people) If ADMtek can do it, why can't other manufacturers? =2DMichael Wu --nextPart1788797.UstzDMJBSy Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQBB3GHlyWWBbDEe0UIRAv60AJ4r2kU8cLsPl+Hu1OGKu+6GTaAqegCgvKfh ogmmOEs5Gv4d17bomnelBzE= =2oNQ -----END PGP SIGNATURE----- --nextPart1788797.UstzDMJBSy-- From jgarzik@pobox.com Wed Jan 5 02:11:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 02:11:23 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j05AAsMs023442 for ; Wed, 5 Jan 2005 02:11:15 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CmJMc-0000TV-Ts; Wed, 05 Jan 2005 22:10:47 +0000 Message-ID: <41DC65DB.1010907@pobox.com> Date: Wed, 05 Jan 2005 17:10:35 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Hollis CC: Netdev Subject: Re: Network driver test suite? References: <1104956386.3877.58.camel@dhollis-lnx.centricconsulting.com> In-Reply-To: <1104956386.3877.58.camel@dhollis-lnx.centricconsulting.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13440 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev David Hollis wrote: > Is there any kind of test suite (automated or list of tests) available > for testing Linux network drivers? I'm completing the addition of a few No, but I would love to someone to write one!!! Jeff (in a rare case of multi-exclamation-point use) From jgarzik@pobox.com Wed Jan 5 02:13:30 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 02:13:37 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j05AD9sH025003 for ; Wed, 5 Jan 2005 02:13:29 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CmJOm-0000Ww-Qn; Wed, 05 Jan 2005 22:13:00 +0000 Message-ID: <41DC6669.9090407@pobox.com> Date: Wed, 05 Jan 2005 17:12:57 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Johannes Erdfelt CC: netdev@oss.sgi.com Subject: Re: [RFC] tulip VLAN support References: <20050105193425.GY18847@sventech.com> In-Reply-To: <20050105193425.GY18847@sventech.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13441 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Johannes Erdfelt wrote: > @@ -259,7 +259,7 @@ > #define RX_RING_SIZE 128 > #define MEDIA_MASK 31 > > -#define PKT_BUF_SZ 1536 /* Size of each temporary Rx buffer. */ > +#define PKT_BUF_SZ 1540 /* Size of each temporary Rx buffer. */ This is the reason why the tulip "vlan" patch is continually rejected. You shouldn't need to increase this constant, but rather follow the other "large MTU" driver conversions. Donald Becker's tulip.c (on which the kernel tulip is based) supports proper MTU changing: ftp://ftp.scyld.com/pub/network/ Jeff From greearb@candelatech.com Wed Jan 5 02:18:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 02:18:33 -0800 (PST) Received: from www.lanforge.com (ns1.lanforge.com [66.165.47.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j05AI67t025652 for ; Wed, 5 Jan 2005 02:18:26 -0800 Received: from [4.33.45.22] (evrtwa1-ar2-4-33-045-022.evrtwa1.dsl-verizon.net [4.33.45.22]) (authenticated bits=0) by www.lanforge.com (8.12.8/8.12.8) with ESMTP id j05MXhLH011923; Wed, 5 Jan 2005 14:33:43 -0800 Message-ID: <41DC6795.6060000@candelatech.com> Date: Wed, 05 Jan 2005 14:17:57 -0800 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041020 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jeff Garzik CC: Johannes Erdfelt , netdev@oss.sgi.com Subject: Re: [RFC] tulip VLAN support References: <20050105193425.GY18847@sventech.com> <41DC6669.9090407@pobox.com> In-Reply-To: <41DC6669.9090407@pobox.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13442 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Jeff Garzik wrote: > Johannes Erdfelt wrote: > >> @@ -259,7 +259,7 @@ >> #define RX_RING_SIZE 128 #define MEDIA_MASK 31 >> >> -#define PKT_BUF_SZ 1536 /* Size of each temporary Rx >> buffer. */ >> +#define PKT_BUF_SZ 1540 /* Size of each temporary Rx >> buffer. */ > > > > This is the reason why the tulip "vlan" patch is continually rejected. > You shouldn't need to increase this constant, but rather follow the > other "large MTU" driver conversions. Has anyone tried just leaving this line as it was (but adding the rest of the patch)? I believe the 1536 already has plenty of space and can hold the extra 4 bytes w/out problem. Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From johannes@erdfelt.com Wed Jan 5 02:32:16 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 02:32:22 -0800 (PST) Received: from farley.sventech.com (IDENT:daemon@farley.sventech.com [69.36.241.87]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j05AVt5k026582 for ; Wed, 5 Jan 2005 02:32:16 -0800 Received: from localhost (localhost [127.0.0.1]) (uid 500) by farley.sventech.com with local; Wed, 05 Jan 2005 22:31:47 +0000 Date: Wed, 5 Jan 2005 14:31:47 -0800 From: Johannes Erdfelt To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: Re: [RFC] tulip VLAN support Message-ID: <20050105223147.GE18847@sventech.com> References: <20050105193425.GY18847@sventech.com> <41DC6669.9090407@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41DC6669.9090407@pobox.com> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13443 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: johannes@erdfelt.com Precedence: bulk X-list: netdev On Wed, Jan 05, 2005, Jeff Garzik wrote: > Johannes Erdfelt wrote: > >@@ -259,7 +259,7 @@ > > #define RX_RING_SIZE 128 > > #define MEDIA_MASK 31 > > > >-#define PKT_BUF_SZ 1536 /* Size of each temporary Rx buffer. > >*/ > >+#define PKT_BUF_SZ 1540 /* Size of each temporary Rx buffer. > >*/ > > This is the reason why the tulip "vlan" patch is continually rejected. > You shouldn't need to increase this constant, but rather follow the > other "large MTU" driver conversions. Donald replied to my privately with a number of reasons why similar patches have been rejected and this one of the same points brought up. I just copied the 2.4 patch that worked so well for me, but I was curious about this part of the patch as well. I asked Donald this, but I guess I'll ask on the list here too. If the point of PKT_BUF_SZ is to keep a consistent buffer size between drivers (for performance reasons), why isn't this value defined in a standard header? > Donald Becker's tulip.c (on which the kernel tulip is based) supports > proper MTU changing: ftp://ftp.scyld.com/pub/network/ The problem isn't changing the MTU, it's that a full ethernet sized packet along with the 802.1q tagging causes the size of the packet to grow past the size the driver (and it looks like the chip) will allow. The driver on Donald's site looks to have the same problem as the driver in the kernel. I'm still trying to find some specs on the tulip interface so I can better understand the chip and the changes necessary to fix this problem. Anyone have any pointers? JE From a.korud@vector.com.pl Wed Jan 5 02:34:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 02:34:44 -0800 (PST) Received: from 3bit.vector.com.pl (3bit.vector.com.pl [81.210.9.37]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j05AYFKn027100 for ; Wed, 5 Jan 2005 02:34:37 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message Subject: RE: [Prism54-devel] Re: [Prism54-users] Open hardware wireless cards MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Date: Wed, 5 Jan 2005 23:34:02 +0100 Message-ID: <60E856FD577CC04BA3727AF4122D3F161134B8@3bit.vector.com.pl> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Prism54-devel] Re: [Prism54-users] Open hardware wireless cards Thread-Index: AcTzZlCkwLK6ZQ9pT36HT8ksJlpIgwADzxad From: "Andriy Korud" To: "Luis R. Rodriguez" , "Steve Hill" Cc: "Netdev" , "Jean Tourrilhes" , "Luis R. Rodriguez" , "Jeff Garzik" , , , X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j05AYFKn027100 X-archive-position: 13444 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: a.korud@vector.com.pl Precedence: bulk X-list: netdev > AFAICT the FullMAC chipsets have reached the END OF LIFE period. Sorry, as I know (no more details - NDA, sorry) some manufacturers are developing (and planning to continue) FullMAC 802.11g (and further) chipsets and also they are offering Linux drivers (however had no chance to test yet). But from my point of view, SoftMAC cards are better sometimes - you have more control from drivers and can implement some interesting features (for example, madwifi Linux driver with MAC layer ported from xBSD). Any thoughts why we should prefer FullMAC cards over SoftMAC (except CPU usage, of course)? regards, -- Andriy Korud From jgarzik@pobox.com Wed Jan 5 02:46:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 02:46:29 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j05Ajx23029864 for ; Wed, 5 Jan 2005 02:46:19 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CmJuZ-0001MT-HV; Wed, 05 Jan 2005 22:45:51 +0000 Message-ID: <41DC6E08.3080507@pobox.com> Date: Wed, 05 Jan 2005 17:45:28 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Johannes Erdfelt CC: netdev@oss.sgi.com Subject: Re: [RFC] tulip VLAN support References: <20050105193425.GY18847@sventech.com> <41DC6669.9090407@pobox.com> <20050105223147.GE18847@sventech.com> In-Reply-To: <20050105223147.GE18847@sventech.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13445 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Johannes Erdfelt wrote: > On Wed, Jan 05, 2005, Jeff Garzik wrote: > >>Johannes Erdfelt wrote: >> >>>@@ -259,7 +259,7 @@ >>>#define RX_RING_SIZE 128 >>>#define MEDIA_MASK 31 >>> >>>-#define PKT_BUF_SZ 1536 /* Size of each temporary Rx buffer. >>>*/ >>>+#define PKT_BUF_SZ 1540 /* Size of each temporary Rx buffer. >>>*/ >> >>This is the reason why the tulip "vlan" patch is continually rejected. >>You shouldn't need to increase this constant, but rather follow the >>other "large MTU" driver conversions. > > > Donald replied to my privately with a number of reasons why similar > patches have been rejected and this one of the same points brought up. > > I just copied the 2.4 patch that worked so well for me, but I was > curious about this part of the patch as well. > > I asked Donald this, but I guess I'll ask on the list here too. If the > point of PKT_BUF_SZ is to keep a consistent buffer size between drivers > (for performance reasons), why isn't this value defined in a standard > header? > > >>Donald Becker's tulip.c (on which the kernel tulip is based) supports >>proper MTU changing: ftp://ftp.scyld.com/pub/network/ > > > The problem isn't changing the MTU, it's that a full ethernet sized > packet along with the 802.1q tagging causes the size of the packet to > grow past the size the driver (and it looks like the chip) will allow. What size do you need? 1504 bytes, right? > The driver on Donald's site looks to have the same problem as the driver > in the kernel. > > I'm still trying to find some specs on the tulip interface so I can > better understand the chip and the changes necessary to fix this > problem. Anyone have any pointers? They're available for free on the Intel site. I mirror 21143: http://gkernel.sourceforge.net/specs/intel/21143-hrm.pdf.bz2 Jeff From jean-baptiste.note@m4x.org Wed Jan 5 02:50:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 02:50:11 -0800 (PST) Received: from debian.local.gxaafoot.homelinux.org (postfix@did75-1-82-231-41-149.fbx.proxad.net [82.231.41.149] (may be forged)) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j05AnhP4030437 for ; Wed, 5 Jan 2005 02:50:04 -0800 Received: by debian.local.gxaafoot.homelinux.org (Postfix, from userid 1000) id C5309C59B; Wed, 5 Jan 2005 23:47:10 +0100 (CET) From: Jean-Baptiste Note To: "Andriy Korud" Cc: "Luis R. Rodriguez" , Netdev , prism54-devel@prism54.org Subject: Re: [Prism54-devel] Re: [Prism54-users] Open hardware wireless cards References: <60E856FD577CC04BA3727AF4122D3F161134B8@3bit.vector.com.pl> Date: Wed, 05 Jan 2005 23:47:10 +0100 In-Reply-To: <60E856FD577CC04BA3727AF4122D3F161134B8@3bit.vector.com.pl> (Andriy Korud's message of "Wed, 5 Jan 2005 23:34:02 +0100") Message-ID: <87u0pv7att.fsf@gxaafoot.homelinux.org> User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13446 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jean-baptiste.note@wanadoo.fr Precedence: bulk X-list: netdev Hello, "Andriy Korud" said : >> AFAICT the FullMAC chipsets have reached the END OF LIFE period. > > Sorry, as I know (no more details - NDA, sorry) some manufacturers are developing (and planning to continue) FullMAC 802.11g (and further) chipsets and also they are offering Linux drivers (however had no chance to test yet). I think he meant "prism54 802.11g fullmac chipsets (all the prism54 project is about) are EOL'd". Not "all fullmac chipsets from all manufacturers for all norms to come". In the way of "some manufacturer", are you thinking of ralink ? They've set up a website with their linux driver, and i think they're fullmac chipsets. -- Jean-Baptiste Note +33 (0)6 83 03 42 38 jean-baptiste.note@wanadoo.fr From greearb@candelatech.com Wed Jan 5 02:56:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 02:56:55 -0800 (PST) Received: from www.lanforge.com (ns1.lanforge.com [66.165.47.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j05AuRrl031261 for ; Wed, 5 Jan 2005 02:56:47 -0800 Received: from [4.33.45.22] (evrtwa1-ar2-4-33-045-022.evrtwa1.dsl-verizon.net [4.33.45.22]) (authenticated bits=0) by www.lanforge.com (8.12.8/8.12.8) with ESMTP id j05NC5LH012417; Wed, 5 Jan 2005 15:12:05 -0800 Message-ID: <41DC7093.2080705@candelatech.com> Date: Wed, 05 Jan 2005 14:56:19 -0800 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041020 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jeff Garzik CC: Johannes Erdfelt , netdev@oss.sgi.com Subject: Re: [RFC] tulip VLAN support References: <20050105193425.GY18847@sventech.com> <41DC6669.9090407@pobox.com> <20050105223147.GE18847@sventech.com> <41DC6E08.3080507@pobox.com> In-Reply-To: <41DC6E08.3080507@pobox.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13447 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev > What size do you need? 1504 bytes, right? 1500 MTU + 14 for header + 4 for CRC + 4 for VLAN == 1522 Normally, you just have to tell the chip to accept slightly larger frames and/or ignore the over-size frame flag. You do not actually need any ability to set a larger than 1500 MTU. Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From shemminger@osdl.org Wed Jan 5 03:19:43 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 03:19:51 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j05BJMSh000686 for ; Wed, 5 Jan 2005 03:19:42 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j05NJ8d23406; Wed, 5 Jan 2005 15:19:08 -0800 Date: Wed, 5 Jan 2005 15:19:10 -0800 From: Stephen Hemminger To: Jeb Cramer , john.ronciak@intel.com, ganesh.venkatesan@intel.com Cc: netdev@oss.sgi.com Subject: [PATCH] e1000: use netdev_priv Message-ID: <20050105151910.1e9a50fe@dxpl.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13448 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Convert e1000 to use netdev_priv which should generate better code Signed-off-by: Stephen Hemminger diff -Nru a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c --- a/drivers/net/e1000/e1000_ethtool.c 2005-01-05 13:53:02 -08:00 +++ b/drivers/net/e1000/e1000_ethtool.c 2005-01-05 13:53:02 -08:00 @@ -104,7 +104,7 @@ static int e1000_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_hw *hw = &adapter->hw; if(hw->media_type == e1000_media_type_copper) { @@ -178,7 +178,7 @@ static int e1000_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_hw *hw = &adapter->hw; if(ecmd->autoneg == AUTONEG_ENABLE) { @@ -205,7 +205,7 @@ e1000_get_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_hw *hw = &adapter->hw; pause->autoneg = @@ -225,7 +225,7 @@ e1000_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_hw *hw = &adapter->hw; adapter->fc_autoneg = pause->autoneg; @@ -258,14 +258,14 @@ static uint32_t e1000_get_rx_csum(struct net_device *netdev) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); return adapter->rx_csum; } static int e1000_set_rx_csum(struct net_device *netdev, uint32_t data) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); adapter->rx_csum = data; if(netif_running(netdev)) { @@ -285,7 +285,7 @@ static int e1000_set_tx_csum(struct net_device *netdev, uint32_t data) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); if(adapter->hw.mac_type < e1000_82543) { if (!data) @@ -305,7 +305,7 @@ static int e1000_set_tso(struct net_device *netdev, uint32_t data) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); if ((adapter->hw.mac_type < e1000_82544) || (adapter->hw.mac_type == e1000_82547)) return data ? -EINVAL : 0; @@ -321,14 +321,14 @@ static uint32_t e1000_get_msglevel(struct net_device *netdev) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); return adapter->msg_enable; } static void e1000_set_msglevel(struct net_device *netdev, uint32_t data) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); adapter->msg_enable = data; } @@ -343,7 +343,7 @@ e1000_get_regs(struct net_device *netdev, struct ethtool_regs *regs, void *p) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_hw *hw = &adapter->hw; uint32_t *regs_buff = p; uint16_t phy_data; @@ -431,7 +431,7 @@ static int e1000_get_eeprom_len(struct net_device *netdev) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); return adapter->hw.eeprom.word_size * 2; } @@ -439,7 +439,7 @@ e1000_get_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom, uint8_t *bytes) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_hw *hw = &adapter->hw; uint16_t *eeprom_buff; int first_word, last_word; @@ -485,7 +485,7 @@ e1000_set_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom, uint8_t *bytes) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_hw *hw = &adapter->hw; uint16_t *eeprom_buff; void *ptr; @@ -546,7 +546,7 @@ e1000_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); strncpy(drvinfo->driver, e1000_driver_name, 32); strncpy(drvinfo->version, e1000_driver_version, 32); @@ -562,7 +562,7 @@ e1000_get_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); e1000_mac_type mac_type = adapter->hw.mac_type; struct e1000_desc_ring *txdr = &adapter->tx_ring; struct e1000_desc_ring *rxdr = &adapter->rx_ring; @@ -583,7 +583,7 @@ e1000_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); e1000_mac_type mac_type = adapter->hw.mac_type; struct e1000_desc_ring *txdr = &adapter->tx_ring; struct e1000_desc_ring *rxdr = &adapter->rx_ring; @@ -765,7 +765,7 @@ struct pt_regs *regs) { struct net_device *netdev = (struct net_device *) data; - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); adapter->test_icr |= E1000_READ_REG(&adapter->hw, ICR); @@ -1376,7 +1376,7 @@ e1000_diag_test(struct net_device *netdev, struct ethtool_test *eth_test, uint64_t *data) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); boolean_t if_running = netif_running(netdev); if(eth_test->flags == ETH_TEST_FL_OFFLINE) { @@ -1436,7 +1436,7 @@ static void e1000_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_hw *hw = &adapter->hw; switch(adapter->hw.device_id) { @@ -1481,7 +1481,7 @@ static int e1000_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_hw *hw = &adapter->hw; switch(adapter->hw.device_id) { @@ -1540,7 +1540,7 @@ static int e1000_phys_id(struct net_device *netdev, uint32_t data) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); if(!data || data > (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ)) data = (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ); @@ -1568,7 +1568,7 @@ static int e1000_nway_reset(struct net_device *netdev) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); if(netif_running(netdev)) { e1000_down(adapter); e1000_up(adapter); @@ -1586,7 +1586,7 @@ e1000_get_ethtool_stats(struct net_device *netdev, struct ethtool_stats *stats, uint64_t *data) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); int i; e1000_update_stats(adapter); diff -Nru a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c --- a/drivers/net/e1000/e1000_main.c 2005-01-05 13:53:02 -08:00 +++ b/drivers/net/e1000/e1000_main.c 2005-01-05 13:53:02 -08:00 @@ -411,7 +411,7 @@ SET_NETDEV_DEV(netdev, &pdev->dev); pci_set_drvdata(pdev, netdev); - adapter = netdev->priv; + adapter = netdev_priv(netdev); adapter->netdev = netdev; adapter->pdev = pdev; adapter->hw.back = adapter; @@ -608,7 +608,7 @@ e1000_remove(struct pci_dev *pdev) { struct net_device *netdev = pci_get_drvdata(pdev); - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); uint32_t manc; if(adapter->hw.mac_type >= e1000_82540 && @@ -723,7 +723,7 @@ static int e1000_open(struct net_device *netdev) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); int err; /* allocate transmit descriptors */ @@ -766,7 +766,7 @@ static int e1000_close(struct net_device *netdev) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); e1000_down(adapter); @@ -1226,7 +1226,7 @@ static int e1000_set_mac(struct net_device *netdev, void *p) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); struct sockaddr *addr = p; if(!is_valid_ether_addr(addr->sa_data)) @@ -1261,7 +1261,7 @@ static void e1000_set_multi(struct net_device *netdev) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_hw *hw = &adapter->hw; struct dev_mc_list *mc_ptr; uint32_t rctl; @@ -1752,7 +1752,7 @@ static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); unsigned int first, max_per_txd = E1000_MAX_DATA_PER_TXD; unsigned int max_txd_pwr = E1000_MAX_TXD_PWR; unsigned int tx_flags = 0; @@ -1856,7 +1856,7 @@ static void e1000_tx_timeout(struct net_device *netdev) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); /* Do the reset outside of interrupt context */ schedule_work(&adapter->tx_timeout_task); @@ -1865,7 +1865,7 @@ static void e1000_tx_timeout_task(struct net_device *netdev) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); e1000_down(adapter); e1000_up(adapter); @@ -1882,7 +1882,7 @@ static struct net_device_stats * e1000_get_stats(struct net_device *netdev) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); e1000_update_stats(adapter); return &adapter->net_stats; @@ -1899,7 +1899,7 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); int old_mtu = adapter->rx_buffer_len; int max_frame = new_mtu + ENET_HEADER_SIZE + ETHERNET_FCS_SIZE; @@ -2112,7 +2112,7 @@ e1000_intr(int irq, void *data, struct pt_regs *regs) { struct net_device *netdev = data; - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_hw *hw = &adapter->hw; uint32_t icr = E1000_READ_REG(hw, ICR); #ifndef CONFIG_E1000_NAPI @@ -2157,7 +2157,7 @@ static int e1000_clean(struct net_device *netdev, int *budget) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); int work_to_do = min(*budget, netdev->quota); int tx_cleaned; int work_done = 0; @@ -2503,7 +2503,7 @@ static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); struct mii_ioctl_data *data = if_mii(ifr); int retval; uint16_t mii_reg; @@ -2670,7 +2670,7 @@ static void e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); uint32_t ctrl, rctl; e1000_irq_disable(adapter); @@ -2705,7 +2705,7 @@ static void e1000_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); uint32_t vfta, index; /* add VID to filter table */ @@ -2718,7 +2718,7 @@ static void e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); uint32_t vfta, index; e1000_irq_disable(adapter); @@ -2802,7 +2802,7 @@ e1000_suspend(struct pci_dev *pdev, uint32_t state) { struct net_device *netdev = pci_get_drvdata(pdev); - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); uint32_t ctrl, ctrl_ext, rctl, manc, status; uint32_t wufc = adapter->wol; @@ -2882,7 +2882,7 @@ e1000_resume(struct pci_dev *pdev) { struct net_device *netdev = pci_get_drvdata(pdev); - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); uint32_t manc, ret; pci_set_power_state(pdev, 0); @@ -2922,7 +2922,7 @@ static void e1000_netpoll (struct net_device *netdev) { - struct e1000_adapter *adapter = netdev->priv; + struct e1000_adapter *adapter = netdev_priv(netdev); disable_irq(adapter->pdev->irq); e1000_intr(adapter->pdev->irq, netdev, NULL); enable_irq(adapter->pdev->irq); From shemminger@osdl.org Wed Jan 5 03:22:45 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 03:22:53 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j05BMPFR001300 for ; Wed, 5 Jan 2005 03:22:45 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j05NMCd24545; Wed, 5 Jan 2005 15:22:12 -0800 Date: Wed, 5 Jan 2005 15:22:13 -0800 From: Stephen Hemminger To: Jeb Cramer , john.ronciak@intel.com, ganesh.venkatesan@intel.com Cc: netdev@oss.sgi.com Subject: [PATCH] e1000: ethtool cleanups Message-ID: <20050105152213.6bb7b5dd@dxpl.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13449 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev E1000 ethtool fixes: * can use ethtool_ops_get_tx_csum * use ADVERTISED_xxx fields when setting advertised fields (works now because fields are the same in ethtool.h) * don't hardcode constant for advertised field Signed-off-by: Stephen Hemminger diff -Nru a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c --- a/drivers/net/e1000/e1000_ethtool.c 2005-01-05 13:54:27 -08:00 +++ b/drivers/net/e1000/e1000_ethtool.c 2005-01-05 13:54:27 -08:00 @@ -140,9 +140,9 @@ SUPPORTED_FIBRE | SUPPORTED_Autoneg); - ecmd->advertising = (SUPPORTED_1000baseT_Full | - SUPPORTED_FIBRE | - SUPPORTED_Autoneg); + ecmd->advertising = (ADVERTISED_1000baseT_Full | + ADVERTISED_FIBRE | + ADVERTISED_Autoneg); ecmd->port = PORT_FIBRE; @@ -183,8 +183,19 @@ if(ecmd->autoneg == AUTONEG_ENABLE) { hw->autoneg = 1; - hw->autoneg_advertised = 0x002F; - ecmd->advertising = 0x002F; + if (hw->media_type == e1000_media_type_fiber) + hw->autoneg_advertised = ADVERTISED_100baseT_Full | + ADVERTISED_FIBRE | + ADVERTISED_Autoneg; + else + hw->autoneg_advertised = ADVERTISED_10baseT_Half | + ADVERTISED_10baseT_Full | + ADVERTISED_100baseT_Half | + ADVERTISED_100baseT_Full | + ADVERTISED_1000baseT_Full| + ADVERTISED_Autoneg | + ADVERTISED_TP; + ecmd->advertising = hw->autoneg_advertised; } else if(e1000_set_spd_dplx(adapter, ecmd->speed + ecmd->duplex)) return -EINVAL; @@ -276,12 +287,6 @@ return 0; } -static uint32_t -e1000_get_tx_csum(struct net_device *netdev) -{ - return (netdev->features & NETIF_F_HW_CSUM) != 0; -} - static int e1000_set_tx_csum(struct net_device *netdev, uint32_t data) { @@ -293,12 +298,7 @@ return 0; } - if (data) - netdev->features |= NETIF_F_HW_CSUM; - else - netdev->features &= ~NETIF_F_HW_CSUM; - - return 0; + return ethtool_op_set_tx_csum(netdev, data); } #ifdef NETIF_F_TSO @@ -1638,7 +1638,7 @@ .set_pauseparam = e1000_set_pauseparam, .get_rx_csum = e1000_get_rx_csum, .set_rx_csum = e1000_set_rx_csum, - .get_tx_csum = e1000_get_tx_csum, + .get_tx_csum = ethtool_op_get_tx_csum, .set_tx_csum = e1000_set_tx_csum, .get_sg = ethtool_op_get_sg, .set_sg = ethtool_op_set_sg, From cramerj@intel.com Wed Jan 5 04:37:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 04:37:53 -0800 (PST) Received: from orsfmr003.jf.intel.com (fmr18.intel.com [134.134.136.17]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j05CbQxh007530 for ; Wed, 5 Jan 2005 04:37:46 -0800 Received: from orsfmr100.jf.intel.com (orsfmr100.jf.intel.com [10.7.209.16]) by orsfmr003.jf.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j060b7NA004646; Thu, 6 Jan 2005 00:37:07 GMT Received: from orsmsxvs041.jf.intel.com (orsmsxvs041.jf.intel.com [192.168.65.54]) by orsfmr100.jf.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j060anWG002491; Thu, 6 Jan 2005 00:37:05 GMT Received: from orsmsx331.amr.corp.intel.com ([192.168.65.56]) by orsmsxvs041.jf.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010516365921991 ; Wed, 05 Jan 2005 16:37:01 -0800 Received: from orsmsx405.amr.corp.intel.com ([192.168.65.46]) by orsmsx331.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 5 Jan 2005 16:36:32 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Subject: RE: [PATCH] e1000: ethtool cleanups Date: Wed, 5 Jan 2005 16:36:31 -0800 Message-ID: <76FA8CF8F1F53240BB5B962A3385A58001EBD04C@orsmsx405> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] e1000: ethtool cleanups Thread-Index: AcTzfWPLRoDcuRJsSPmYxQgM/zEXEgACctaw From: "cramerj" To: "Stephen Hemminger" , "Ronciak, John" , "Venkatesan, Ganesh" Cc: X-OriginalArrivalTime: 06 Jan 2005 00:36:32.0857 (UTC) FILETIME=[C53EAC90:01C4F387] X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j05CbQxh007530 X-archive-position: 13450 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cramerj@intel.com Precedence: bulk X-list: netdev > + if (hw->media_type == e1000_media_type_fiber) > + hw->autoneg_advertised = ADVERTISED_100baseT_Full | should be ADVERTISED_1000baseT_Full ^ Looks good. Thanks, -Jeb From y030729@njupt.edu.cn Wed Jan 5 05:07:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 05:08:00 -0800 (PST) Received: from njupt.edu.cn (em.njupt.edu.cn [202.119.230.11]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j05D7VKI009137 for ; Wed, 5 Jan 2005 05:07:52 -0800 Received: (eyou send program); Thu, 06 Jan 2005 10:01:35 +0800 Message-ID: <304976895.08643@njupt.edu.cn> Received: from 10.10.136.115 by em.njupt.edu.cn with HTTP; Thu, 06 Jan 2005 10:01:35 +0800 X-WebMAIL-MUA: [10.10.136.115] From: "Zhenyu Wu" To: imipak@yahoo.com, netdev@oss.sgi.com Cc: lartc@mailman.ds9a.nl Date: Thu, 06 Jan 2005 10:01:35 +0800 Reply-To: "Zhenyu Wu" X-Priority: 3 Subject: Re: [LARTC] Scheduler Mechnisms! Content-Type: text/plain X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13451 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: y030729@njupt.edu.cn Precedence: bulk X-list: netdev Jonathan, Yes, I think you are right, RED can be applied to any qdisc. The "RED" you mentioned here is the RED algorithm, right? I know, in linux kernel (sch_red.c), which implements the RED algotithm, just indeed uses a FIFO queue, do you think so? So, if there are serveral RED qdiscs which attach to different classes, a scheduling mechanism is needed, right? If what i have said is right, it seems that there are no scheduler mechanisms for serveral FIFO qdiscs(or RED qdiscs) in linux kernel. Of course, as we can see, CBQ which can be regard as a scheduling queue also has a scheduler mechanisms WRR. But if the FIFO is attached to the CBQ classes, then, when CBQ schedule different queues(FIFOs) using WRR, will the packets in different queues are scheduled in turn? In another condition, if i add a scheduling mechanism such as WRR behind all FIFOs, i can use this mechnism to shedule the packets in different queues, are there are any difference? Thank you very much! Regards, Zhenyu Wu >I may be wrong on this, but I believe that RED can be > attached to any queueing system, including the basic > FIFO queues. In a sense, you're still using a > scheduling system, when using the default arrangement, > it's just a first-come, first-served one. > > RED is classless and applies to the whole of a queue. > What that queue is attached to, if I understand it > correctly, isn't important. It can be a class, but it > can just as easily be everything going through that > device. > > Again, someone correct me if I'm wrong, but as I > understand it, there are four levels to the whole > QoS/diffserv concept. > > One of these levels is the queueing discipline. This > can be something like CBQ, WFQ, FIFO, PRIO, or > whatever. This is how the data is organized, it does > not describe how the data is sent. In the case of > something like CBQ, you have a defined set of queues > in parallel, with rules as to what packets fall into > what queue. On the other hand, queueing schemes such > as FIFO are flat. There's a single queue that > everything goes through, though there may be different > rules for how things get pushed to it. > > Another level is the scheduling mechanism. This > describes how the data is sent, once organized, but > does not describe the organization itself. If you've > only one queue, then there's really not much to > schedule. If you've multiple queues, then it's fairly > normal to use "round robin" or "weighted round robin" > to pick which queue to pull a packet from. Linux' CBQ > uses "weighted round robin", according to the C file. > > The next level is the packet dropping mechanism. When > queues flood, packets are going to be dropped. There's > nowhere to store them. I'm pretty sure the default > behaviour is to simply continue accepting packets, but > to drop any that expire before being sent or which > fall off the end of the queue (if the queue is > bounded). RED, GRED, and a whole host of similar > mechanisms, try to drop packets in a more controlled > manner. However, that is really all they do. > > Finally, there are mechanisms for damping overly > active applications, such as ECN. The idea here is > that if you throttle back whatever is generating > excess traffic, you don't get the problems assoicated > with dealing with it. The "default" behaviour is to do > nothing. > > When setting up QoS - on Linux or anything else - you > basically pick one of each of the four categories to > assemble a packet delivery system. Even without QoS, > you're doing that, you're just using the defaults in > all cases. The mechanisms are still going to be there. > > The Linux configuration menu does NOT match the above > terminology, or the terminology in the source code. > Thus, the source code identifies CBQ as a queueing > discipline, but the configuration menu calls it a > scheduler. The QoS help is also not very helpful, as > it mostly tells people to look at the source. However, > if you look at the source for CBQ or RED, for example, > the explanation is relative to the cited papers, so > you then have to go and read those before coming back > and doing anything. > > This is one area I hope is going to get resolved in > the reasonably near future. If not, I might have to > come up with a patch myself. The very thought of that > should send shivers down the spines of any kernel > developers out there. > > Jonathan > > --- Zhenyu Wu wrote: > > > Thank you very much, i will try to find these papers > > which must be very helpful > > for me. The "more" means that whether there are > > other mechanisms not only for > > Linux. Sorry, i have not make it clear! Sometimes, i > > wonder whether the qdiscs > > such as CBQ, RED, GRED ... are belong to the > > scheduler mechanisms in linux > > enviroment. For example, In Red, which i can find > > are enqueue, and dequeue.... so, > > if i add a RED qidsc to a class, must i add a > > scheduler mechanism so that i can > > decide which packet in the queues will be scheduled > > and put to the link? > > > > Good luck, > > Best, > > > > > __________________________________ > Do you Yahoo!? > The all-new My Yahoo! - What will yours do? > http://my.yahoo.com > From akpm@osdl.org Wed Jan 5 08:34:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 08:34:43 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j05GYG7h018087 for ; Wed, 5 Jan 2005 08:34:36 -0800 Received: from bix (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id j064Y1d03895; Wed, 5 Jan 2005 20:34:01 -0800 Date: Wed, 5 Jan 2005 20:33:52 -0800 From: Andrew Morton To: Rusty Russell Cc: netdev@oss.sgi.com Subject: net/sched/ipt.c Message-Id: <20050105203352.2bc3b71a.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13452 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Am I missing something? *** Warning: "__ipt_mutex_up" [net/sched/ipt.ko] undefined! *** Warning: "__ipt_find_target_lock" [net/sched/ipt.ko] undefined! From rusty@rustcorp.com.au Wed Jan 5 08:47:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 08:47:37 -0800 (PST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j05GlA1D018697 for ; Wed, 5 Jan 2005 08:47:30 -0800 Received: from localhost.localdomain (localhost [127.0.0.1]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTP id 961D12BF0E; Thu, 6 Jan 2005 15:46:55 +1100 (EST) Subject: Re: net/sched/ipt.c From: Rusty Russell To: Andrew Morton Cc: netdev@oss.sgi.com In-Reply-To: <20050105203352.2bc3b71a.akpm@osdl.org> References: <20050105203352.2bc3b71a.akpm@osdl.org> Content-Type: text/plain Date: Thu, 06 Jan 2005 15:46:45 +1100 Message-Id: <1104986805.20582.116.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.3 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13453 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rusty@rustcorp.com.au Precedence: bulk X-list: netdev On Wed, 2005-01-05 at 20:33 -0800, Andrew Morton wrote: > Am I missing something? > > *** Warning: "__ipt_mutex_up" [net/sched/ipt.ko] undefined! > *** Warning: "__ipt_find_target_lock" [net/sched/ipt.ko] undefined! Patch already sent... Rusty. Name: Restore net/sched/ipt.c After iptables Kmod Cleanup Status: Tested under nfsim Signed-off-by: Rusty Russell Thomas Graf points out that I broke net/sched/ipt.c when I removed __ipt_find_target_lock. In fact, those routines don't need to keep the lock held, so we can simplify them, and expose an interface (ipt_find_target) which does module loading correctly for net/sched/ipt.c. As Thomas points out, this also gets the module refcounts right. Index: linux-2.6.10-bk8-Netfilter/net/ipv4/netfilter/ip_tables.c =================================================================== --- linux-2.6.10-bk8-Netfilter.orig/net/ipv4/netfilter/ip_tables.c 2005-01-06 09:12:01.000000000 +1100 +++ linux-2.6.10-bk8-Netfilter/net/ipv4/netfilter/ip_tables.c 2005-01-06 09:49:10.000000000 +1100 @@ -430,62 +430,63 @@ return NULL; } -/* Find match, grabs mutex & ref. Returns ERR_PTR() on error. */ -static inline struct ipt_match *find_match_lock(const char *name, u8 revision) +/* Find match, grabs ref. Returns ERR_PTR() on error. */ +static inline struct ipt_match *find_match(const char *name, u8 revision) { struct ipt_match *m; - int found = 0; + int err = 0; if (down_interruptible(&ipt_mutex) != 0) return ERR_PTR(-EINTR); list_for_each_entry(m, &ipt_match, list) { if (strcmp(m->name, name) == 0) { - found = 1; if (m->revision == revision) { - if (!try_module_get(m->me)) - found = 0; - else + if (try_module_get(m->me)) { + up(&ipt_mutex); return m; - } + } + } else + err = -EPROTOTYPE; /* Found something. */ } } up(&ipt_mutex); - - /* Not found at all? NULL so try_then_request_module loads module. */ - if (!found) - return NULL; - - return ERR_PTR(-EPROTOTYPE); + return ERR_PTR(err); } -/* Find target, grabs mutex & ref. Returns ERR_PTR() on error. */ -static inline struct ipt_target *find_target_lock(const char *name, u8 revision) +/* Find target, grabs ref. Returns ERR_PTR() on error. */ +static inline struct ipt_target *find_target(const char *name, u8 revision) { struct ipt_target *t; - int found = 0; + int err = 0; if (down_interruptible(&ipt_mutex) != 0) return ERR_PTR(-EINTR); list_for_each_entry(t, &ipt_target, list) { if (strcmp(t->name, name) == 0) { - found = 1; if (t->revision == revision) { - if (!try_module_get(t->me)) - found = 0; - else + if (try_module_get(t->me)) { + up(&ipt_mutex); return t; - } + } + } else + err = -EPROTOTYPE; /* Found something. */ } } up(&ipt_mutex); + return ERR_PTR(err); +} - /* Not found at all? NULL so try_then_request_module loads module. */ - if (!found) - return NULL; +struct ipt_target *ipt_find_target(const char *name, u8 revision) +{ + struct ipt_target *target; - return ERR_PTR(-EPROTOTYPE); + target = try_then_request_module(find_target(name, revision), + "ipt_%s", name); + if (IS_ERR(target) || !target) + return NULL; + return target; } static int match_revfn(const char *name, u8 revision, int *bestp) @@ -708,15 +709,14 @@ { struct ipt_match *match; - match = try_then_request_module(find_match_lock(m->u.user.name, - m->u.user.revision), + match = try_then_request_module(find_match(m->u.user.name, + m->u.user.revision), "ipt_%s", m->u.user.name); if (IS_ERR(match) || !match) { duprintf("check_match: `%s' not found\n", m->u.user.name); return match ? PTR_ERR(match) : -ENOENT; } m->u.kernel.match = match; - up(&ipt_mutex); if (m->u.kernel.match->checkentry && !m->u.kernel.match->checkentry(name, ip, m->data, @@ -754,8 +754,8 @@ goto cleanup_matches; t = ipt_get_target(e); - target = try_then_request_module(find_target_lock(t->u.user.name, - t->u.user.revision), + target = try_then_request_module(find_target(t->u.user.name, + t->u.user.revision), "ipt_%s", t->u.user.name); if (IS_ERR(target) || !target) { duprintf("check_entry: `%s' not found\n", t->u.user.name); @@ -763,7 +763,6 @@ goto cleanup_matches; } t->u.kernel.target = target; - up(&ipt_mutex); if (t->u.kernel.target == &ipt_standard_target) { if (!standard_check(t, size)) { Index: linux-2.6.10-bk8-Netfilter/net/sched/ipt.c =================================================================== --- linux-2.6.10-bk8-Netfilter.orig/net/sched/ipt.c 2004-12-28 12:31:11.000000000 +1100 +++ linux-2.6.10-bk8-Netfilter/net/sched/ipt.c 2005-01-06 09:37:01.000000000 +1100 @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -60,32 +61,23 @@ struct ipt_target *target; int ret = 0; struct ipt_entry_target *t = p->t; - target = __ipt_find_target_lock(t->u.user.name, &ret); + target = ipt_find_target(t->u.user.name, t->u.user.revision); if (!target) { printk("init_targ: Failed to find %s\n", t->u.user.name); return -1; } DPRINTK("init_targ: found %s\n", target->name); - /* we really need proper ref counting - seems to be only needed for modules?? Talk to laforge */ -/* if (target->me) - __MOD_INC_USE_COUNT(target->me); -*/ t->u.kernel.target = target; - __ipt_mutex_up(); - if (t->u.kernel.target->checkentry && !t->u.kernel.target->checkentry(p->tname, NULL, t->data, t->u.target_size - sizeof (*t), p->hook)) { -/* if (t->u.kernel.target->me) - __MOD_DEC_USE_COUNT(t->u.kernel.target->me); -*/ DPRINTK("ip_tables: check failed for `%s'.\n", t->u.kernel.target->name); + module_put(t->u.kernel.target->me); ret = -EINVAL; } @@ -235,8 +227,12 @@ { struct tcf_ipt *p; p = PRIV(a,ipt); - if (NULL != p) + if (NULL != p) { + struct ipt_entry_target *t = p->t; + if (t && t->u.kernel.target) + module_put(t->u.kernel.target->me); return tcf_hash_release(p, bind); + } return 0; } Index: linux-2.6.10-bk8-Netfilter/include/linux/netfilter_ipv4/ip_tables.h =================================================================== --- linux-2.6.10-bk8-Netfilter.orig/include/linux/netfilter_ipv4/ip_tables.h 2005-01-06 09:11:56.000000000 +1100 +++ linux-2.6.10-bk8-Netfilter/include/linux/netfilter_ipv4/ip_tables.h 2005-01-06 09:40:03.000000000 +1100 @@ -456,6 +456,9 @@ struct module *me; }; +/* net/sched/ipt.c: Gimme access to your targets! Gets target->me. */ +extern struct ipt_target *ipt_find_target(const char *name, u8 revision); + extern int ipt_register_table(struct ipt_table *table); extern void ipt_unregister_table(struct ipt_table *table); extern unsigned int ipt_do_table(struct sk_buff **pskb, -- A bad analogy is like a leaky screwdriver -- Richard Braakman From akpm@osdl.org Wed Jan 5 10:40:05 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 10:40:11 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j05IdjFp021203 for ; Wed, 5 Jan 2005 10:40:05 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j066dUd19597; Wed, 5 Jan 2005 22:39:30 -0800 Message-Id: <200501060639.j066dUd19597@mail.osdl.org> Subject: [patch 1/1] netfilter: ipt build fix To: rusty@rustcorp.com.au Cc: netdev@oss.sgi.com, akpm@osdl.org From: akpm@osdl.org Date: Wed, 05 Jan 2005 22:39:21 -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13454 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev *** Warning: "ipt_find_target" [net/sched/ipt.ko] undefined! Signed-off-by: Andrew Morton --- 25-akpm/net/ipv4/netfilter/ip_tables.c | 1 + 1 files changed, 1 insertion(+) diff -puN net/ipv4/netfilter/ip_tables.c~netfilter-ipt-build-fix net/ipv4/netfilter/ip_tables.c --- 25/net/ipv4/netfilter/ip_tables.c~netfilter-ipt-build-fix 2005-01-05 22:43:32.000000000 -0800 +++ 25-akpm/net/ipv4/netfilter/ip_tables.c 2005-01-05 22:43:41.000000000 -0800 @@ -488,6 +488,7 @@ struct ipt_target *ipt_find_target(const return NULL; return target; } +EXPORT_SYMBOL(ipt_find_target); static int match_revfn(const char *name, u8 revision, int *bestp) { _ From ebs@ebshome.net Wed Jan 5 11:03:18 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 11:03:24 -0800 (PST) Received: from gate.ebshome.net (gate.ebshome.net [64.81.67.12]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j05J2v0P021965 for ; Wed, 5 Jan 2005 11:03:18 -0800 Received: (qmail 6759 invoked by uid 1000); 5 Jan 2005 23:02:45 -0800 Date: Wed, 5 Jan 2005 23:02:45 -0800 From: Eugene Surovegin To: Andy Fleming Cc: Netdev , Embedded PPC Linux list , Kumar Gala Subject: Re: [RFC] Patch to Abstract Ethernet PHY support (using driver model) Message-ID: <20050106070245.GA6539@gate.ebshome.net> Mail-Followup-To: Andy Fleming , Netdev , Embedded PPC Linux list , Kumar Gala References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ICQ-UIN: 1193073 X-Operating-System: Linux i686 X-PGP-Key: http://www.ebshome.net/pubkey.asc User-Agent: Mutt/1.5.5.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13455 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ebs@ebshome.net Precedence: bulk X-list: netdev On Thu, Dec 23, 2004 at 03:00:13PM -0600, Andy Fleming wrote: > > >Adds a Phy Abstraction Layer which allows ethernet controllers to > >manage their PHYs without knowing the details of how the particular > >PHY device operates. This code steals heavily from BenH's sungem > >driver, and got some stuff out of Jason McMullan's patch. Some random notes from quick look at the code: 1) IMO if we can extract some info from the PHY using _standard_ registers we should use them, even if the PHY provides some custom ones. I suspect that _all_ XXX_read_status functions for different PHYs in your patch can be easily handled by generic IEEE 802.3 compliant code (you need to update genphy_read_status to properly handle GigE of course). 2) genphy can be changed to handle GigE speeds as well. 3) I think it's better for the genphy case to _detect_ PHY features instead of hard coding PHY_BASIC_FEATURES. In this case you can easily handle 10/100 and 10/100/1000 PHYs by genphy code. 4) Pause negotiation/advertising is completely missing. 5) PHY interrupt sharing looks broken. Although you request_irq using SA_SHIRQ flag, in the handler itself you don't detect whether this interrupt is for this PHY or not, and return IRQ_HANDLED. This will result in first registered PHY hijacking IRQs from other PHYs (or devices) sharing the same IRQ line. -- Eugene From takata@linux-m32r.org Wed Jan 5 15:55:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 15:55:52 -0800 (PST) Received: from mail01.idc.renesas.com (mail.renesas.com [202.234.163.13]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j05NtOK0031209 for ; Wed, 5 Jan 2005 15:55:45 -0800 Received: (from root@localhost) by guardian02.idc.renesas.com with id j06Bt8J2023578; Thu, 6 Jan 2005 20:55:08 +0900 (JST) Received: from unknown [172.20.8.68] by guardian02.idc.renesas.com with SMTP id WAA23577 ; Thu, 6 Jan 2005 20:55:08 +0900 Received: from mrkaisv.hoku.renesas.com ([10.145.105.245]) by rnsmtp01.hoku_r.renesas.com (8.9.3/3.7W) with ESMTP id UAA20604; Thu, 6 Jan 2005 20:55:06 +0900 (JST) Received: from localhost (pcepx10 [10.145.105.241]) by mrkaisv.hoku.renesas.com (Postfix) with ESMTP id 5A72D7981B7; Thu, 6 Jan 2005 20:55:04 +0900 (JST) Date: Thu, 06 Jan 2005 20:55:03 +0900 (JST) Message-Id: <20050106.205503.719899966.takata.hirokazu@renesas.com> To: Nicolas Pitre Cc: linux-kernel@vger.kernel.org, Jeff Garzik , Andrew Morton , netdev@oss.sgi.com, takata@linux-m32r.org Subject: [PATCH 2.6.10-mm2] net: netconsole support for smc91x From: Hirokazu Takata X-Mailer: Mew version 3.3 on XEmacs 21.4.16 (Corporate Culture) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13456 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: takata@linux-m32r.org Precedence: bulk X-list: netdev This patch is for "netconsole" support of smc91x driver. It looks working. Could you please include this? Thank you. Signed-off-by: Hayato Fujiwara Signed-off-by: Hirokazu Takata --- drivers/net/smc91x.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+) diff -ruNp a/drivers/net/smc91x.c b/drivers/net/smc91x.c --- a/drivers/net/smc91x.c 2004-12-25 06:35:40.000000000 +0900 +++ b/drivers/net/smc91x.c 2005-01-06 19:40:56.000000000 +0900 @@ -1333,6 +1333,19 @@ static irqreturn_t smc_interrupt(int irq return IRQ_HANDLED; } +#ifdef CONFIG_NET_POLL_CONTROLLER +/* + * Polling receive - used by netconsole and other diagnostic tools + * to allow network i/o with interrupts disabled. + */ +static void smc_poll_controller(struct net_device *dev) +{ + disable_irq(dev->irq); + smc_interrupt(dev->irq, dev, NULL); + enable_irq(dev->irq); +} +#endif + /* Our watchdog timed out. Called by the networking layer */ static void smc_timeout(struct net_device *dev) { @@ -1912,6 +1925,9 @@ static int __init smc_probe(struct net_d dev->get_stats = smc_query_statistics; dev->set_multicast_list = smc_set_multicast_list; dev->ethtool_ops = &smc_ethtool_ops; +#ifdef CONFIG_NET_POLL_CONTROLLER + dev->poll_controller = smc_poll_controller; +#endif tasklet_init(&lp->tx_task, smc_hardware_send_pkt, (unsigned long)dev); INIT_WORK(&lp->phy_configure, smc_phy_configure, dev); --- Usage: - Config: Device Drivers -> Networking support -> Network device support -> Network console logging support (NETCONSOLE) - Kernel parameter: Please set a kernel parameter "netconsole=...". (more info: Documentation/networking/netcosole.txt) - Observation on a remote host: $ netcat -u -l -p -v This is an example output log: $ netcat -u -l -p 6666 -v listening on [any] 6666 ... connect to [192.168.0.1] from mappi001 [192.168.0.101] 6665 Kernel command line: console=tty1 console=ttyS0,115200n8x root=/dev/nfsroot nfsroot=192.168.0.1:/project/m32r-linux/export/rootfs2.6_small,rsize=1024,wsize=1024 nfsaddrs=192.168.0.101:192.168.0.1:192.168.0.1:255.255.255.0:mappi001 mem=32M netconsole=6665@192.168.0.101/eth0,6666@192.168.0.1/ netconsole: local port 6665 netconsole: local IP 192.168.0.101 netconsole: interface eth0 netconsole: remote port 6666 netconsole: remote IP 192.168.0.1 netconsole: remote ethernet address ff:ff:ff:ff:ff:ff PID hash table entries: 256 (order: 8, 4096 bytes) Timer start : latch = 5859 Console: colour dummy device 80x25 Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) Memory: 30288k/32772k available (1528k kernel code, 2436k reserved, 281k data, 108k init) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) M32R-mp information On-chip CPUs : 2 CPU model : M32R-MP 012U2/CHAOS(Ver.) CPU present map : 3 Booting processor 1/1 Waiting for send to finish... Initializing CPU#1 CPU#1 (phys ID: 1) waiting for CALLOUT +After Startup. Before Callout 1. After Callout 1. OK. Boot done. Brought up 2 CPUs CPU#0 : CPU clock 300.00MHz, Bus clock 75.00MHz, loops_per_jiffy[1196032] CPU#1 : CPU clock 300.00MHz, Bus clock 75.00MHz, loops_per_jiffy[1196032] Before bogomips. Total of 2 processors activated (478.41 BogoMIPS). Before bogocount - setting activated=1. NET: Registered protocol family 16 Linux Kernel Card Services options: none devfs: 2004-01-31 Richard Gooch (rgooch@atnf.csiro.au) devfs: boot_options: 0x1 ds1302: Set PLD_RTCBAUR = 37 ds1302: RTC not found. Serial: M32R SIO driver $Revision: 1.9 $ IRQ sharing disabled ttyS0 at I/O 0x4c20000 (irq = 80) is a M32RSIO io scheduler noop registered io scheduler deadline registered io scheduler cfq registered RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize loop: loaded (max 8 devices) elevator: using deadline as default io scheduler nbd: registered device at major 43 smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre eth0: SMC91C11xFD (rev 1) at 0xa0000300 IRQ 129 eth0: Ethernet addr: 08:00:70:25:b0:e1 netconsole: device eth0 not up yet, forcing it eth0: link down eth0: link up, 100Mbps, full-duplex, lpa 0x45E1 netconsole: network logging started Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 ide: Assuming 50MHz system bus speed for PIO modes; override with idebus=xx hda: HMS360404D5CF00, CFA DISK drive ide0 at 0x1f0-0x1f7,0x3f6 on irq 67 hda: max request size: 128KiB hda: 7999488 sectors (4095 MB) w/128KiB Cache, CHS=7936/16/63 /dev/ide/host0/bus0/target0/lun0: p1 NET: Registered protocol family 2 IP: routing cache hash table of 256 buckets, 4Kbytes TCP established hash table entries: 2048 (order: 3, 32768 bytes) TCP bind hash table entries: 2048 (order: 2, 24576 bytes) TCP: Hash tables configured (established 2048 bind 2048) NET: Registered protocol family 1 NET: Registered protocol family 17 IP-Config: Complete: device=eth0, addr=192.168.0.101, mask=255.255.255.0, gw=192.168.0.1, host=mappi001, domain=, nis-domain=(none), bootserver=192.168.0.1, rootserver=192.168.0.1, rootpath= Looking up port of RPC 100003/2 on 192.168.0.1 Looking up port of RPC 100005/1 on 192.168.0.1 VFS: Mounted root (nfs filesystem) readonly. Mounted devfs on /dev Freeing unused kernel memory: 108k freed -- Hirokazu Takata Linux/M32R Project: http://www.linux-m32r.org/ From hadi@cyberus.ca Wed Jan 5 17:47:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 17:47:27 -0800 (PST) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j061lKiX005958 for ; Wed, 5 Jan 2005 17:47:21 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.30) id 1CmXyo-0005Qu-Hz for netdev@oss.sgi.com; Thu, 06 Jan 2005 08:47:10 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CmXyl-0007gD-Ub; Thu, 06 Jan 2005 08:47:08 -0500 Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: netdev@oss.sgi.com In-Reply-To: <20050105144514.GQ26856@postel.suug.ch> References: <20050103125635.GB26856@postel.suug.ch> <20050104223612.GN26856@postel.suug.ch> <1104894728.1117.56.camel@jzny.localdomain> <20050105110048.GO26856@postel.suug.ch> <1104931991.1117.152.camel@jzny.localdomain> <20050105144514.GQ26856@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105019225.2312.7.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 06 Jan 2005 08:47:05 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13457 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Sorry for the latency - vacation over, i am gonna slow down a little .. On Wed, 2005-01-05 at 09:45, Thomas Graf wrote: > * jamal <1104931991.1117.152.camel@jzny.localdomain> 2005-01-05 08:33 [..] > > Sorry i missed that. Isnt it still unecessary though? You should be able > > to pass L=4 and not need the speacial treatment, no? > > Agreed, but the ematch might expect an allocated block. Assuming the > data is variable and sometimes is L=4, sometimes L=16 the ematch > requires special handling because m->data might hold the value directly > or a pointer depending on datalen. So the issue is whether its by ref or copy? Maybe thats what the flag is for then. My view is that _everything_ for ematches should be by copy for simplicty. > > > 1) We make u32 hold multiple ematch trees, a u32 key can be of 3 > > > kinds: u32/ematch/container. It's kind of a hack and not very > > > fast due to a lot of stack movement. > > > > Indeed this is what i was thinking of. > > The only added overhead I can think of is when processing a series of > > u32 keys _within the same selector_ (not across selectors), you check if > > its u32 native and execute localy (as is done now) or transfer the check > > to the ematch defined in that key and continue to next key based on the > > ematchs return code + the logical operation. > > Exactly, does the performance gap come with any advantage? No. Oh, yes;-> the one check in the datapath comes with a _huge_ advantage even all that you had was old style matches because now you have embeded logical operations which are more than just the old AND. But more importantly you can use ematches as well to influence the existing u32 tree path. > That's > why I don't like it. > > > > > 2) We make the existing u32 match be an ematch which I already did > > > expect for the nexthdr bits. That is the select will simply be > > > replaced by an ematch tree. I'll take a look into how we could > > > have the classifier take influence on the ematches config data. > > > One possibiliy is to have a struct transfered via map which > > > contains useful data such as offset to next header (u32/rsvp). > > > I have to think about this a little more though. > > > > This could be done in addition to #1. I see #1 as more important for u32 > > but not so for things like fwmark, tcindex which should fizzle away with > > meta ematch. I think the danger is in trying to replicate u32 as an > > ematch; if somehow you can loop back and use the real u32 code, then > > fine. I feel it being non-trivial to do so. > > Like i said earlier, theres a lot of power in u32 other than in basic > > matching. > > Most importantly I don't want to touch any of the hashing code in u32. What i am reading is you see more work involved. Is this correct? > I really like and it should stay as it is. The existing u32 match can > be easly made an ematch so this would safe us the extra work in u32 to > implement logic relations again and to fiddle with complicated selector > TLVs. The only problem with this is the nexthdr bits because it relies > on the hashing code. So we have to make this data available to the > ematch which is actually not a bad idea anyway. So I'm thinking about > introducing a new structure tcf_em_pkt_info or alike which carries > some additional information found out by the classifiers which can be > used by ematches. This can be information about the next header, > already extracted dscp values, etc. > > This would give us the chance to add a very small em_u32.c (~40 lines) > doing exactly the same as the current u32 match and have the u32 > selector replaced with an ematch tree at no additional cost. Backward > compatibility is as easy as creating a flat ANDed ematch tree. > > Note: The u32 ematch I'm talking about is not the cmp ematch, cmp is > more advanced but also slightly slower. > > Thoughts? I think I understand more after reading the above now. There is one issue which i think is the big source of our lack of sync: You conclude people are gonna want to use the logical tree building scheme you are putting in to put together matches and ematches. U32 _already_ has a tree building scheme which is very very flexible. Now that the sel2 matches will provide u32 logial operators, it presents a very interesting fresh outlook on life in a jiffy of a packet. This is what i dont wanna kill or ignore. fw, tcindex etc donot have this infrastructure so they dont matter. > > I think #2 is better for other classifiers which were already doomed > > anyways. #1 is important for u32 and perhaps other classifiers like rsvp > > and route. And yes, #1 is more work ;-> > > Why is it better? What's the advantage? Refer to what i said above: u32 has built in tree building scheme made more interesting now that there exist more interesting logical operators. > > hang on:-> No dont rewrite u32 please. Your cmp is good for the basic > > matches that u32 does, but is _nowhere_ close to being able to do what > > u32 can when used properly. > > Right, that's why I now call it cmp and the existing u32 match becomes > the u32 ematch. Again, u32 classifier is not just matches; the more interesting thing is the layout of the rules that it can be taught to do. I think the ematch which emulates the std u32 match is of course valuable to have but it _doesnt_ deserve the same name. > > I Should be able to compile a new ematch as a module in an already > > running kernel. So, other than generic stuff for ematches, things like > > TCF_EM_CMP should not be in that enumeration. > > It's not a requirement to put it there but we need to manage the > assigned types for ematches in mainline anyway. Thinking more about it; not sure why you would even bother managing them. Everything runs at the same kernel privilege level. I am not sure you want to have certain things that can only be built when recompiling the kernel > > And all this also goes in that header file as well. > > I put it here because it might be very useful for other ematches > or further classifiers, you name it. tcf_get_base_ptr is used by > nbyte ematch for example. If its generic then it stays in the main header; cheers, jamal From hadi@cyberus.ca Wed Jan 5 17:56:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 17:56:25 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j061uLCC006577 for ; Wed, 5 Jan 2005 17:56:21 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CmY7W-00076f-U4 for netdev@oss.sgi.com; Thu, 06 Jan 2005 08:56:10 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CmY7M-0000cy-6a; Thu, 06 Jan 2005 08:56:00 -0500 Subject: Re: [patch 4/10] s390: network driver. From: jamal Reply-To: hadi@cyberus.ca To: Paul Jakma Cc: Jeff Garzik , Thomas Spatzier , "David S. Miller" , Hasso Tepper , Herbert Xu , netdev@oss.sgi.com, Tommy Christensen In-Reply-To: References: <1104764710.1048.580.camel@jzny.localdomain> <41DB26A6.2070008@pobox.com> <1104895169.1117.63.camel@jzny.localdomain> <1104931011.1118.134.camel@jzny.localdomain> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105019757.2314.16.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 06 Jan 2005 08:55:58 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13458 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Wed, 2005-01-05 at 09:29, Paul Jakma wrote: > On Wed, 5 Jan 2005, jamal wrote: [..] > Sorry, wires crossed re "new behaviour". The "new new" behaviour in > the patch as you describe would be perfect. > > PS: Another issue, could we have kernel space IP fragmentation for > IP_HDRINCL sockets please? We currently have to implement > fragmentation ourselves, which seems silly given that kernel already > has this functionality. I will let some other fireman grab this bait ;-> If not i will revisit it after a unknown/random timeout. cheers, jamal From hadi@cyberus.ca Wed Jan 5 17:58:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 17:58:50 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j061wkBA007042 for ; Wed, 5 Jan 2005 17:58:46 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CmY9t-0000EJ-EQ for netdev@oss.sgi.com; Thu, 06 Jan 2005 08:58:37 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CmY9q-00011e-GT; Thu, 06 Jan 2005 08:58:34 -0500 Subject: Re: [patch 4/10] s390: network driver. From: jamal Reply-To: hadi@cyberus.ca To: Tommy Christensen Cc: Jeff Garzik , Thomas Spatzier , "David S. Miller" , Hasso Tepper , Herbert Xu , netdev@oss.sgi.com, Paul Jakma In-Reply-To: <41DC0931.80603@tpack.net> References: <1104764710.1048.580.camel@jzny.localdomain> <41DB26A6.2070008@pobox.com> <1104895169.1117.63.camel@jzny.localdomain> <41DC0931.80603@tpack.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105019912.2314.20.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 06 Jan 2005 08:58:32 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13459 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Wed, 2005-01-05 at 10:35, Tommy Christensen wrote: > jamal wrote: > > Except for the drivers that call netif_stop_queue() on link-down. These > calls (and the corresponding netif_wake_queue) would have to be removed. If we assume all drivers do: netif_stop then carrier_off then you dont need that extra check. Thats the working assumption i had - maybe a comment is deserving or we could say we dont think that all drivers are going to follow that sequence. cheers, jamal From hadi@cyberus.ca Wed Jan 5 18:04:12 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 18:04:16 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0624BBn007576 for ; Wed, 5 Jan 2005 18:04:12 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1CmYF7-0000u8-C7 for netdev@oss.sgi.com; Thu, 06 Jan 2005 09:04:01 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CmYF5-0001ps-DH; Thu, 06 Jan 2005 09:03:59 -0500 Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: netdev@oss.sgi.com In-Reply-To: <20050105164832.GB17836@postel.suug.ch> References: <20050103125635.GB26856@postel.suug.ch> <20050104223612.GN26856@postel.suug.ch> <1104894728.1117.56.camel@jzny.localdomain> <20050105110048.GO26856@postel.suug.ch> <1104931991.1117.152.camel@jzny.localdomain> <20050105144514.GQ26856@postel.suug.ch> <20050105164832.GB17836@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105020237.2314.26.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 06 Jan 2005 09:03:57 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13460 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Wed, 2005-01-05 at 11:48, Thomas Graf wrote: > Here's what I mean, it moves the u32 match as-is to an ematch so it > benefits from logic relations, inversion and can be used from other > classifiers as well. All we have to do is set info->ptr and > info->nexthdr to ptr respetively off2 before we evaluate the ematch > tree. The pkt_info struct is then passed to tcf_em_tree_match and > made available to every ematch. > > Thoughts? I think this is fine; getting into complicated-land with off2 etc but fine and does not preclude (and is lower importance in my opinion) than having u32 do its own magic. Note again Thomas: I do realize its more work to do the ematch/match thing ;-> cheers, jamal From dhollis@davehollis.com Wed Jan 5 18:35:24 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 18:35:30 -0800 (PST) Received: from pop-a065d14.pas.sa.earthlink.net (pop-a065d14.pas.sa.earthlink.net [207.217.121.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j062ZNeR008697 for ; Wed, 5 Jan 2005 18:35:24 -0800 Received: from user-12hcjeo.cable.mindspring.com ([69.22.77.216] helo=bender.davehollis.com) by pop-a065d14.pas.sa.earthlink.net with esmtp (Exim 3.33 #1) id 1CmYjM-0002PC-00 for netdev@oss.sgi.com; Thu, 06 Jan 2005 06:35:16 -0800 Received: from 10.8.0.6 ([10.8.0.6]) (authenticated bits=0) by bender.davehollis.com (8.13.1/8.12.11) with ESMTP id j06EYwNJ028884 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Thu, 6 Jan 2005 09:35:03 -0500 Subject: Re: Network driver test suite? From: David Hollis To: Netdev In-Reply-To: <41DC65DB.1010907@pobox.com> References: <1104956386.3877.58.camel@dhollis-lnx.centricconsulting.com> <41DC65DB.1010907@pobox.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-QyYPyklJnchyC1iCRJ3z" Date: Thu, 06 Jan 2005 08:43:41 -0500 Message-Id: <1105019021.5804.4.camel@dhollis-lnx.centricconsulting.com> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) X-Scanned-By: MIMEDefang 2.49 on 10.8.0.1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13461 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dhollis@davehollis.com Precedence: bulk X-list: netdev --=-QyYPyklJnchyC1iCRJ3z Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, 2005-01-05 at 17:10 -0500, Jeff Garzik wrote: > David Hollis wrote: > > Is there any kind of test suite (automated or list of tests) available > > for testing Linux network drivers? I'm completing the addition of a fe= w >=20 >=20 > No, but I would love to someone to write one!!! >=20 > Jeff (in a rare case of multi-exclamation-point use) >=20 >=20 What kinds of things do you think should be tested? What I can think of in no particular order and certainly not complete: Simple, standard ping remote host pings with various crazy large packet sizes mii-tool ethtool, all of the various options. Not all need to be supported certainly, but there is a set of basic ones that really should be Changing MTU to various sizes Configuring VLANs and being able to send/recv traffic What other types of things should be tested? --=20 David Hollis --=-QyYPyklJnchyC1iCRJ3z Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQBB3UCNxasLqOyGHncRAu8rAJ4gFIGclJq0vyTZ3e3aSlVK1YF2twCfXX2O Is9ZfiSaVj2z4WfvHjlXWlk= =wvIS -----END PGP SIGNATURE----- --=-QyYPyklJnchyC1iCRJ3z-- From tommy.christensen@tpack.net Wed Jan 5 19:06:32 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 19:06:36 -0800 (PST) Received: from mail.tpack.net (ip18.tpack.net [213.173.228.18]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0636QJ2009931 for ; Wed, 5 Jan 2005 19:06:31 -0800 Received: (qmail 7237 invoked from network); 6 Jan 2005 15:06:13 -0000 Received: from tsc-6.cph.tpack.net (HELO ?192.168.9.22?) (192.168.9.22) by 0 with SMTP; 6 Jan 2005 15:06:13 -0000 Subject: Re: [patch 4/10] s390: network driver. From: Tommy Christensen To: hadi@cyberus.ca Cc: Jeff Garzik , Thomas Spatzier , "David S. Miller" , Hasso Tepper , Herbert Xu , netdev@oss.sgi.com, Paul Jakma In-Reply-To: <1105019912.2314.20.camel@jzny.localdomain> References: <1104764710.1048.580.camel@jzny.localdomain> <41DB26A6.2070008@pobox.com> <1104895169.1117.63.camel@jzny.localdomain> <41DC0931.80603@tpack.net> <1105019912.2314.20.camel@jzny.localdomain> Content-Type: text/plain Message-Id: <1105023972.3462.48.camel@tsc-6.cph.tpack.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Thu, 06 Jan 2005 16:06:13 +0100 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13462 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tommy.christensen@tpack.net Precedence: bulk X-list: netdev On Thu, 2005-01-06 at 14:58, jamal wrote: > On Wed, 2005-01-05 at 10:35, Tommy Christensen wrote: > > jamal wrote: > > > > > Except for the drivers that call netif_stop_queue() on link-down. These > > calls (and the corresponding netif_wake_queue) would have to be removed. > > If we assume all drivers do: > netif_stop then carrier_off then you dont need that extra check. > Thats the working assumption i had - maybe a comment is deserving or > we could say we dont think that all drivers are going to follow that > sequence. But qdisc_restart() isn't called any more after the queue is stopped. So how do we get to drain the packets? Another approach could be to reset the qdisc (kind of what dev_deactivate does) if the driver stays in queue_stopped and carrier_off for some period of time. -Tommy From lsorense@csclub.uwaterloo.ca Wed Jan 5 19:16:24 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 19:16:29 -0800 (PST) Received: from perpugilliam.csclub.uwaterloo.ca (postfix@perpugilliam.csclub.uwaterloo.ca [129.97.134.31]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j063GOLM011822 for ; Wed, 5 Jan 2005 19:16:24 -0800 Received: by perpugilliam.csclub.uwaterloo.ca (Postfix, from userid 3120) id BA90EA865B; Thu, 6 Jan 2005 10:16:16 -0500 (EST) Date: Thu, 6 Jan 2005 10:16:16 -0500 To: Andriy Korud Cc: "Luis R. Rodriguez" , Steve Hill , Netdev , Jean Tourrilhes , "Luis R. Rodriguez" , Jeff Garzik , linux-kernel@vger.kernel.org, prism54-users@prism54.org, prism54-devel@prism54.org Subject: Re: [Prism54-devel] Re: [Prism54-users] Open hardware wireless cards Message-ID: <20050106151616.GC30311@csclub.uwaterloo.ca> References: <60E856FD577CC04BA3727AF4122D3F161134B8@3bit.vector.com.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <60E856FD577CC04BA3727AF4122D3F161134B8@3bit.vector.com.pl> User-Agent: Mutt/1.3.28i From: lsorense@csclub.uwaterloo.ca (Lennart Sorensen) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13463 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: lsorense@csclub.uwaterloo.ca Precedence: bulk X-list: netdev On Wed, Jan 05, 2005 at 11:34:02PM +0100, Andriy Korud wrote: > Sorry, as I know (no more details - NDA, sorry) some manufacturers are developing (and planning to continue) FullMAC 802.11g (and further) chipsets and also they are offering Linux drivers (however had no chance to test yet). > > But from my point of view, SoftMAC cards are better sometimes - you have more control from drivers and can implement some interesting features (for example, madwifi Linux driver with MAC layer ported from xBSD). > > Any thoughts why we should prefer FullMAC cards over SoftMAC (except CPU usage, of course)? Embedded systems with low end cpus (to make less heat and use less power) would prefer anything that uses less cpu and can be done in dedicated (and usually simpler than the cpu) hardware. Of course the windows laptop and desktop market probably far outsells the embedded market, for now at least. Len Sorensen From jeremy.guthrie@berbee.com Wed Jan 5 19:27:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 19:27:14 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j063R8Bk012479 for ; Wed, 5 Jan 2005 19:27:08 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Thu, 6 Jan 2005 09:26:55 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Thu, 6 Jan 2005 09:26:50 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson , Stephen Hemminger References: <200501031455.26980.jeremy.guthrie@berbee.com> <200501051325.40616.jeremy.guthrie@berbee.com> <16860.19615.251360.169722@robur.slu.se> In-Reply-To: <16860.19615.251360.169722@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1559170.S0gtjA0Rb7"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501060926.54588.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 06 Jan 2005 15:26:55.0689 (UTC) FILETIME=[27BBEB90:01C4F404] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13464 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart1559170.S0gtjA0Rb7 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wednesday 05 January 2005 02:22 pm, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > After smp_affinity adjustments and turning off IRQ balancing. > > > > eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 > > > > RX packets:537271635 errors:2377048 dropped:2377048 > > overruns:1849169 > > Worse? > > Yes. I'll remember Hararld moved rt_cache_stat /proc/net/stats/ and wrote > a new utility for it. Should be in iproute2 package. Stephen knows the > details. Otherwise change path in rtstat. You need this to relate and > verify the load. I still don't see the rt_cache_stat file even under 2.4.28 stock. See belo= w. > Check throughtput and how packet load is used with 2.4. > /proc/net/softnet_stat and rtstat. Also meditate how the comparison can be > fair wrt taffic patterns. Do smame with 2.6. wc -l /proc/net/rt_cache Segmentation fault cat /proc/net/rt_cache > /tmp/rt_cache ; wc -l /tmp/rt_cache cat: write error: Bad address 57664 /tmp/rt_cache ls -la /proc/net/ total 0 dr-xr-xr-x 6 root root 0 Jan 6 09:22 . dr-xr-xr-x 55 root root 0 Jan 5 15:23 .. =2Dr--r--r-- 1 root root 0 Jan 6 09:22 arp dr-xr-xr-x 2 root root 0 Jan 6 09:22 atm =2Dr--r--r-- 1 root root 0 Jan 6 09:22 dev =2Dr--r--r-- 1 root root 0 Jan 6 09:22 dev_mcast dr-xr-xr-x 2 root root 0 Jan 6 09:22 drivers =2Dr--r--r-- 1 root root 0 Jan 6 09:22 igmp =2Dr--r--r-- 1 root root 0 Jan 6 09:22 ip_mr_cache =2Dr--r--r-- 1 root root 0 Jan 6 09:22 ip_mr_vif =2Dr--r--r-- 1 root root 0 Jan 6 09:22 ip_queue =2Dr--r--r-- 1 root root 0 Jan 6 09:22 ip_tables_matches =2Dr--r--r-- 1 root root 0 Jan 6 09:22 ip_tables_names =2Dr--r--r-- 1 root root 0 Jan 6 09:22 ip_tables_targets =2Dr--r--r-- 1 root root 0 Jan 6 09:22 mcfilter =2Dr--r--r-- 1 root root 0 Jan 6 09:22 netlink =2Dr--r--r-- 1 root root 0 Jan 6 09:22 netstat =2Dr--r--r-- 1 root root 0 Jan 6 09:22 pnp =2Dr--r--r-- 1 root root 0 Jan 6 09:22 psched =2Dr--r--r-- 1 root root 0 Jan 6 09:22 raw =2Dr--r--r-- 1 root root 0 Jan 6 09:22 route dr-xr-xr-x 2 root root 0 Jan 6 09:22 rpc =2Dr--r--r-- 1 root root 0 Jan 6 09:22 rt_acct =2Dr--r--r-- 1 root root 0 Jan 6 09:22 rt_cache =2Dr--r--r-- 1 root root 0 Jan 6 09:22 snmp =2Dr--r--r-- 1 root root 0 Jan 6 09:22 sockstat =2Dr--r--r-- 1 root root 0 Jan 6 09:22 softnet_stat dr-xr-xr-x 2 root root 0 Jan 6 09:22 stat =2Dr--r--r-- 1 root root 0 Jan 6 09:22 tcp =2Dr--r--r-- 1 root root 0 Jan 6 09:22 udp =2Dr--r--r-- 1 root root 0 Jan 6 09:22 unix =2Dr--r--r-- 1 root root 0 Jan 6 09:22 wireless ls -la /proc/net/stat/ total 0 dr-xr-xr-x 2 root root 0 Jan 6 09:22 . dr-xr-xr-x 6 root root 0 Jan 6 09:22 .. =2Dr--r--r-- 1 root root 0 Jan 6 09:22 arp_cache =2Dr--r--r-- 1 root root 0 Jan 6 09:22 clip_arp_cache =2Dr--r--r-- 1 root root 0 Jan 6 09:22 rt_cache cat /proc/net/softnet_stat 96deb140 0032844e 00012bbb 00000fd8 00000000 00000000 00000000 00000000=20 00000dd4 00013dda 00000000 00000000 00000000 00000000 00000000 00000000 00000000=20 0000041f cat /proc/interrupts CPU0 CPU1 0: 821852 5664906 IO-APIC-edge timer 1: 484 1247 IO-APIC-edge keyboard 8: 0 2 IO-APIC-edge rtc 14: 5 16 IO-APIC-edge ide0 18: 1928608529 1374 IO-APIC-level eth3 20: 1 226113098 IO-APIC-level eth2 27: 7950 34312 IO-APIC-level eth0 28: 2718 8097 IO-APIC-level aic7xxx 30: 0 0 IO-APIC-level acpi NMI: 0 0 LOC: 6487240 6487239 ERR: 0 MIS: 0 =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart1559170.S0gtjA0Rb7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB3Vi+qtjaBHGZBeURAt66AJwM0xWjzgxb+u3M/UlpHFEWhMH0VgCfXpXz DJFwD5QWmhr9IfBJzDX98a0= =hXMn -----END PGP SIGNATURE----- --nextPart1559170.S0gtjA0Rb7-- From mitch.a.williams@intel.com Wed Jan 5 21:04:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 21:04:40 -0800 (PST) Received: from orsfmr002.jf.intel.com (fmr17.intel.com [134.134.136.16]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0654Z9E019199 for ; Wed, 5 Jan 2005 21:04:35 -0800 Received: from orsfmr100.jf.intel.com (orsfmr100.jf.intel.com [10.7.209.16]) by orsfmr002.jf.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j06H4HXD029818; Thu, 6 Jan 2005 17:04:17 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by orsfmr100.jf.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j06H4EGE016209; Thu, 6 Jan 2005 17:04:17 GMT Received: from orsmsx331.amr.corp.intel.com ([192.168.65.56]) by orsmsxvs040.jf.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010609041701652 ; Thu, 06 Jan 2005 09:04:17 -0800 Received: from orsmsx402.amr.corp.intel.com ([192.168.65.208]) by orsmsx331.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 6 Jan 2005 09:04:16 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Subject: RE: [Bugme-new] [Bug 3992] New: Bondig. Not correct work function ARP Monitoring. Broken link. Date: Thu, 6 Jan 2005 09:04:15 -0800 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Bugme-new] [Bug 3992] New: Bondig. Not correct work function ARP Monitoring. Broken link. thread-index: AcTzbphnoKruf5E+TwG6OHYoOFxO1QAouHjA From: "Williams, Mitch A" To: "Andrew Morton" , X-OriginalArrivalTime: 06 Jan 2005 17:04:16.0775 (UTC) FILETIME=[C14AE970:01C4F411] X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j0654Z9E019199 X-archive-position: 13465 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mitch.a.williams@intel.com Precedence: bulk X-list: netdev Our test lab has found a number of issues with ARP monitoring. These bugs were on my to-do list for Q4 but got bumped due to other issues. So now they're on my to-do list for Q1. That being said, if somebody else really wants to fix this before I get to it, I won't complain. -Mitch Williams -----Original Message----- From: netdev-bounce@oss.sgi.com [mailto:netdev-bounce@oss.sgi.com] On Behalf Of Andrew Morton Sent: Wednesday, January 05, 2005 1:35 PM To: netdev@oss.sgi.com Subject: Fw: [Bugme-new] [Bug 3992] New: Bondig. Not correct work function ARP Monitoring. Broken link. Begin forwarded message: Date: Wed, 5 Jan 2005 07:59:17 -0800 From: bugme-daemon@osdl.org To: bugme-new@lists.osdl.org Subject: [Bugme-new] [Bug 3992] New: Bondig. Not correct work function ARP Monitoring. Broken link. http://bugme.osdl.org/show_bug.cgi?id=3992 Summary: Bondig. Not correct work function ARP Monitoring. Broken link. Kernel Version: 2.6.10 Status: NEW Severity: normal Owner: jgarzik@pobox.com Submitter: stanislav@muhachev.petro.ru Distribution: Hardware Environment: Vmware GSX machine Software Environment: Gentoo Problem Description: bonding interface going down and down slave link Steps to reproduce: 2 virtual pc identical gentoo linux (copy) 1 nic for both virtual pc up 2 openvpn link trouch nic to another virtual pc (tap0 and tap1)[ethernet bridge] link both vpn1 and vpn2 - ok!(independing link like:192.168.1.1-192.168.1.2 and 192.168.2.1-192.168.2.2) bonding vpn1 & vpn2 òî bond0 (bonding default setup -> nothing failover setings) link îê!(192.168.100.1-192.168.100.2) setting arp monitor in bonding (TUN/TAP driver not support Mii status) link down! arp request go from bond0(machine1)[from tap0 & tap1] to bond0(machine2) - ok. arp answer bond0(machine2) interface - ok! !!! bond0(machine2) -> tap0(tap1)(machine2) - noting!!!(arp answer broken) resultat arp request not complite situation analog both side for monitoring use TCPDUMP ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. From ebs@ebshome.net Wed Jan 5 21:14:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 21:14:11 -0800 (PST) Received: from gate.ebshome.net (gate.ebshome.net [64.81.67.12]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j065E78b019931 for ; Wed, 5 Jan 2005 21:14:07 -0800 Received: (qmail 15049 invoked by uid 1000); 6 Jan 2005 09:13:55 -0800 Date: Thu, 6 Jan 2005 09:13:55 -0800 From: Eugene Surovegin To: Andy Fleming Cc: Netdev , Embedded PPC Linux list , Kumar Gala Subject: Re: [RFC] Patch to Abstract Ethernet PHY support (using driver model) Message-ID: <20050106171355.GB6539@gate.ebshome.net> Mail-Followup-To: Andy Fleming , Netdev , Embedded PPC Linux list , Kumar Gala References: <20050106070245.GA6539@gate.ebshome.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050106070245.GA6539@gate.ebshome.net> X-ICQ-UIN: 1193073 X-Operating-System: Linux i686 X-PGP-Key: http://www.ebshome.net/pubkey.asc User-Agent: Mutt/1.5.5.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13466 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ebs@ebshome.net Precedence: bulk X-list: netdev On Wed, Jan 05, 2005 at 11:02:45PM -0800, Eugene Surovegin wrote: > 5) PHY interrupt sharing looks broken. Although you request_irq using > SA_SHIRQ flag, in the handler itself you don't detect whether this > interrupt is for this PHY or not, and return IRQ_HANDLED. This will > result in first registered PHY hijacking IRQs from other PHYs (or > devices) sharing the same IRQ line. Doh, ignore this. I wasn't thinking straight... -- Eugene From chas@cmf.nrl.navy.mil Wed Jan 5 21:18:06 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 21:18:11 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j065I5MQ020459 for ; Wed, 5 Jan 2005 21:18:06 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.11/8.12.11) with ESMTP id j06HHJ5I000508 for ; Thu, 6 Jan 2005 12:17:19 -0500 (EST) Message-Id: <200501061717.j06HHJ5I000508@ginger.cmf.nrl.navy.mil> To: netdev@oss.sgi.com Subject: [RFC] locking changes for lec.c Date: Thu, 06 Jan 2005 12:17:20 -0500 From: "chas williams - CONTRACTOR" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-Virus-Status: Clean X-archive-position: 13467 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev after looking at things recently its not clear to me that the combination of lec_arp_lock and lec_arp_users was protecting things properly. here is a small rewrite that eliminates lec_arp_users completely and uses lec_arp_lock to protect the lists in lec_prev: lec_arp_tables, lec_arp_empty_ones, et al. and yes, after this patch i will probably submit another patch to fix the tab (or lack of tab) problem. ===== net/atm/lec.c 1.44 vs edited ===== --- 1.44/net/atm/lec.c 2004-07-28 11:59:55 -04:00 +++ edited/net/atm/lec.c 2005-01-06 12:01:46 -05:00 @@ -422,6 +422,7 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb) { + unsigned long flags; struct net_device *dev = (struct net_device*)vcc->proto_data; struct lec_priv *priv = (struct lec_priv*)dev->priv; struct atmlec_msg *mesg; @@ -456,8 +457,10 @@ lec_flush_complete(priv, mesg->content.normal.flag); break; case l_narp_req: /* LANE2: see 7.1.35 in the lane2 spec */ + spin_lock_irqsave(&priv->lec_arp_lock, flags); entry = lec_arp_find(priv, mesg->content.normal.mac_addr); lec_arp_remove(priv, entry); + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); if (mesg->content.normal.no_source_le_narp) break; @@ -1222,17 +1225,20 @@ static int lane2_resolve(struct net_device *dev, u8 *dst_mac, int force, u8 **tlvs, u32 *sizeoftlvs) { + unsigned long flags; struct lec_priv *priv = (struct lec_priv *)dev->priv; struct lec_arp_table *table; struct sk_buff *skb; int retval; if (force == 0) { + spin_lock_irqsave(&priv->lec_arp_lock, flags); table = lec_arp_find(priv, dst_mac); + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); if(table == NULL) return -1; - *tlvs = kmalloc(table->sizeoftlvs, GFP_KERNEL); + *tlvs = kmalloc(table->sizeoftlvs, GFP_ATOMIC); if (*tlvs == NULL) return -1; @@ -1377,18 +1383,6 @@ #define HASH(ch) (ch & (LEC_ARP_TABLE_SIZE -1)) -static __inline__ void -lec_arp_get(struct lec_priv *priv) -{ - atomic_inc(&priv->lec_arp_users); -} - -static __inline__ void -lec_arp_put(struct lec_priv *priv) -{ - atomic_dec(&priv->lec_arp_users); -} - /* * Initialization of arp-cache */ @@ -1397,12 +1391,12 @@ { unsigned short i; - for (i=0;ilec_arp_tables[i] = NULL; } spin_lock_init(&priv->lec_arp_lock); init_timer(&priv->lec_arp_timer); - priv->lec_arp_timer.expires = jiffies+LEC_ARP_REFRESH_INTERVAL; + priv->lec_arp_timer.expires = jiffies + LEC_ARP_REFRESH_INTERVAL; priv->lec_arp_timer.data = (unsigned long)priv; priv->lec_arp_timer.function = lec_arp_check_expire; add_timer(&priv->lec_arp_timer); @@ -1439,12 +1433,9 @@ static inline void lec_arp_add(struct lec_priv *priv, struct lec_arp_table *to_add) { - unsigned long flags; unsigned short place; struct lec_arp_table *tmp; - spin_lock_irqsave(&priv->lec_arp_lock, flags); - place = HASH(to_add->mac_addr[ETH_ALEN-1]); tmp = priv->lec_arp_tables[place]; to_add->next = NULL; @@ -1457,8 +1448,6 @@ tmp->next = to_add; } - spin_unlock_irqrestore(&priv->lec_arp_lock, flags); - DPRINTK("LEC_ARP: Added entry:%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n", 0xff&to_add->mac_addr[0], 0xff&to_add->mac_addr[1], 0xff&to_add->mac_addr[2], 0xff&to_add->mac_addr[3], @@ -1472,15 +1461,11 @@ lec_arp_remove(struct lec_priv *priv, struct lec_arp_table *to_remove) { - unsigned long flags; unsigned short place; struct lec_arp_table *tmp; int remove_vcc=1; - spin_lock_irqsave(&priv->lec_arp_lock, flags); - if (!to_remove) { - spin_unlock_irqrestore(&priv->lec_arp_lock, flags); return -1; } place = HASH(to_remove->mac_addr[ETH_ALEN-1]); @@ -1492,7 +1477,6 @@ tmp = tmp->next; } if (!tmp) {/* Entry was not found */ - spin_unlock_irqrestore(&priv->lec_arp_lock, flags); return -1; } } @@ -1505,7 +1489,7 @@ /* * ESI_FLUSH_PENDING, ESI_FORWARD_DIRECT */ - for(place=0;placelec_arp_tables[place]; tmp != NULL; tmp = tmp->next) { if (memcmp(tmp->atm_addr, to_remove->atm_addr, ATM_ESA_LEN)==0) { @@ -1519,8 +1503,6 @@ } skb_queue_purge(&to_remove->tx_wait); /* FIXME: good place for this? */ - spin_unlock_irqrestore(&priv->lec_arp_lock, flags); - DPRINTK("LEC_ARP: Removed entry:%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n", 0xff&to_remove->mac_addr[0], 0xff&to_remove->mac_addr[1], 0xff&to_remove->mac_addr[2], 0xff&to_remove->mac_addr[3], @@ -1704,6 +1686,7 @@ void lec_arp_destroy(struct lec_priv *priv) { + unsigned long flags; struct lec_arp_table *entry, *next; int i; @@ -1712,8 +1695,10 @@ /* * Remove all entries */ - for (i=0;ilec_arp_tables[i];entry != NULL; entry=next) { + + spin_lock_irqsave(&priv->lec_arp_lock, flags); + for (i = 0; i < LEC_ARP_TABLE_SIZE; i++) { + for(entry = priv->lec_arp_tables[i]; entry != NULL; entry=next) { next = entry->next; lec_arp_remove(priv, entry); kfree(entry); @@ -1748,7 +1733,8 @@ priv->mcast_fwds = NULL; priv->mcast_vcc = NULL; memset(priv->lec_arp_tables, 0, - sizeof(struct lec_arp_table*)*LEC_ARP_TABLE_SIZE); + sizeof(struct lec_arp_table *) * LEC_ARP_TABLE_SIZE); + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); } @@ -1765,18 +1751,15 @@ DPRINTK("LEC_ARP: lec_arp_find :%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n", mac_addr[0]&0xff, mac_addr[1]&0xff, mac_addr[2]&0xff, mac_addr[3]&0xff, mac_addr[4]&0xff, mac_addr[5]&0xff); - lec_arp_get(priv); place = HASH(mac_addr[ETH_ALEN-1]); to_return = priv->lec_arp_tables[place]; while(to_return) { if (memcmp(mac_addr, to_return->mac_addr, ETH_ALEN) == 0) { - lec_arp_put(priv); return to_return; } to_return = to_return->next; } - lec_arp_put(priv); return NULL; } @@ -1785,17 +1768,17 @@ { struct lec_arp_table *to_return; - to_return=(struct lec_arp_table *)kmalloc(sizeof(struct lec_arp_table), - GFP_ATOMIC); + to_return = (struct lec_arp_table *) kmalloc(sizeof(struct lec_arp_table), + GFP_ATOMIC); if (!to_return) { printk("LEC: Arp entry kmalloc failed\n"); return NULL; } - memset(to_return,0,sizeof(struct lec_arp_table)); + memset(to_return, 0, sizeof(struct lec_arp_table)); memcpy(to_return->mac_addr, mac_addr, ETH_ALEN); init_timer(&to_return->timer); to_return->timer.function = lec_arp_expire_arp; - to_return->timer.data = (unsigned long)to_return; + to_return->timer.data = (unsigned long) to_return; to_return->last_used = jiffies; to_return->priv = priv; skb_queue_head_init(&to_return->tx_wait); @@ -1835,6 +1818,7 @@ static void lec_arp_expire_vcc(unsigned long data) { + unsigned flags; struct lec_arp_table *to_remove = (struct lec_arp_table*)data; struct lec_priv *priv = (struct lec_priv *)to_remove->priv; struct lec_arp_table *entry = NULL; @@ -1846,6 +1830,8 @@ to_remove->vcc?to_remove->recv_vcc->vpi:0, to_remove->vcc?to_remove->recv_vcc->vci:0); DPRINTK("eo:%p nf:%p\n",priv->lec_arp_empty_ones,priv->lec_no_forward); + + spin_lock_irqsave(&priv->lec_arp_lock, flags); if (to_remove == priv->lec_arp_empty_ones) priv->lec_arp_empty_ones = to_remove->next; else { @@ -1866,6 +1852,8 @@ entry->next = to_remove->next; } } + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); + lec_arp_clear_vccs(to_remove); kfree(to_remove); } @@ -1889,69 +1877,67 @@ static void lec_arp_check_expire(unsigned long data) { + unsigned long flags; struct lec_priv *priv = (struct lec_priv *)data; struct lec_arp_table *entry, *next; unsigned long now; unsigned long time_to_check; int i; - DPRINTK("lec_arp_check_expire %p,%d\n",priv, - atomic_read(&priv->lec_arp_users)); + DPRINTK("lec_arp_check_expire %p\n",priv); DPRINTK("expire: eo:%p nf:%p\n",priv->lec_arp_empty_ones, priv->lec_no_forward); - if (!atomic_read(&priv->lec_arp_users)) { - lec_arp_get(priv); - now = jiffies; - for(i=0;ilec_arp_tables[i]; entry != NULL; ) { - if ((entry->flags) & LEC_REMOTE_FLAG && - priv->topology_change) - time_to_check=priv->forward_delay_time; - else - time_to_check = priv->aging_time; - - DPRINTK("About to expire: %lx - %lx > %lx\n", - now,entry->last_used, time_to_check); - if( time_after(now, entry->last_used+ - time_to_check) && - !(entry->flags & LEC_PERMANENT_FLAG) && - !(entry->mac_addr[0] & 0x01) ) { /* LANE2: 7.1.20 */ - /* Remove entry */ - DPRINTK("LEC:Entry timed out\n"); - next = entry->next; - lec_arp_remove(priv, entry); - kfree(entry); - entry = next; - } else { - /* Something else */ - if ((entry->status == ESI_VC_PENDING || - entry->status == ESI_ARP_PENDING) - && time_after_eq(now, - entry->timestamp + - priv->max_unknown_frame_time)) { - entry->timestamp = jiffies; - entry->packets_flooded = 0; - if (entry->status == ESI_VC_PENDING) - send_to_lecd(priv, l_svc_setup, entry->mac_addr, entry->atm_addr, NULL); - } - if (entry->status == ESI_FLUSH_PENDING - && - time_after_eq(now, entry->timestamp+ - priv->path_switching_delay)) { - struct sk_buff *skb; - - while ((skb = skb_dequeue(&entry->tx_wait)) != NULL) - lec_send(entry->vcc, skb, entry->priv); - entry->last_used = jiffies; - entry->status = - ESI_FORWARD_DIRECT; - } - entry = entry->next; - } - } - } - lec_arp_put(priv); - } + now = jiffies; + spin_lock_irqsave(&priv->lec_arp_lock, flags); + for(i = 0; i < LEC_ARP_TABLE_SIZE; i++) { + for(entry = priv->lec_arp_tables[i]; entry != NULL; ) { + if ((entry->flags) & LEC_REMOTE_FLAG && + priv->topology_change) + time_to_check = priv->forward_delay_time; + else + time_to_check = priv->aging_time; + + DPRINTK("About to expire: %lx - %lx > %lx\n", + now,entry->last_used, time_to_check); + if( time_after(now, entry->last_used+ + time_to_check) && + !(entry->flags & LEC_PERMANENT_FLAG) && + !(entry->mac_addr[0] & 0x01) ) { /* LANE2: 7.1.20 */ + /* Remove entry */ + DPRINTK("LEC:Entry timed out\n"); + next = entry->next; + lec_arp_remove(priv, entry); + kfree(entry); + entry = next; + } else { + /* Something else */ + if ((entry->status == ESI_VC_PENDING || + entry->status == ESI_ARP_PENDING) + && time_after_eq(now, + entry->timestamp + + priv->max_unknown_frame_time)) { + entry->timestamp = jiffies; + entry->packets_flooded = 0; + if (entry->status == ESI_VC_PENDING) + send_to_lecd(priv, l_svc_setup, entry->mac_addr, entry->atm_addr, NULL); + } + if (entry->status == ESI_FLUSH_PENDING + && + time_after_eq(now, entry->timestamp+ + priv->path_switching_delay)) { + struct sk_buff *skb; + + while ((skb = skb_dequeue(&entry->tx_wait)) != NULL) + lec_send(entry->vcc, skb, entry->priv); + entry->last_used = jiffies; + entry->status = + ESI_FORWARD_DIRECT; + } + entry = entry->next; + } + } + } + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); mod_timer(&priv->lec_arp_timer, jiffies + LEC_ARP_REFRESH_INTERVAL); } @@ -1963,9 +1949,11 @@ lec_arp_resolve(struct lec_priv *priv, unsigned char *mac_to_find, int is_rdesc, struct lec_arp_table **ret_entry) { + unsigned long flags; struct lec_arp_table *entry; + struct atm_vcc *found; - if (mac_to_find[0]&0x01) { + if (mac_to_find[0] & 0x01) { switch (priv->lane_version) { case 1: return priv->mcast_vcc; @@ -1979,6 +1967,7 @@ } } + spin_lock_irqsave(&priv->lec_arp_lock, flags); entry = lec_arp_find(priv, mac_to_find); if (entry) { @@ -1986,7 +1975,8 @@ /* Connection Ok */ entry->last_used = jiffies; *ret_entry = entry; - return entry->vcc; + found = entry->vcc; + goto out; } /* Data direct VC not yet set up, check to see if the unknown frame count is greater than the limit. If the limit has @@ -1996,7 +1986,8 @@ entry->packets_floodedmaximum_unknown_frame_count) { entry->packets_flooded++; DPRINTK("LEC_ARP: Flooding..\n"); - return priv->mcast_vcc; + found = priv->mcast_vcc; + goto out; } /* We got here because entry->status == ESI_FLUSH_PENDING * or BUS flood limit was reached for an entry which is @@ -2004,13 +1995,14 @@ */ *ret_entry = entry; DPRINTK("lec: entry->status %d entry->vcc %p\n", entry->status, entry->vcc); - return NULL; + found = NULL; } else { /* No matching entry was found */ entry = make_entry(priv, mac_to_find); DPRINTK("LEC_ARP: Making entry\n"); if (!entry) { - return priv->mcast_vcc; + found = priv->mcast_vcc; + goto out; } lec_arp_add(priv, entry); /* We want arp-request(s) to be sent */ @@ -2026,33 +2018,38 @@ entry->timer.expires = jiffies + (1*HZ); entry->timer.function = lec_arp_expire_arp; add_timer(&entry->timer); - return priv->mcast_vcc; + found = priv->mcast_vcc; } + +out: + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); + return found; } int lec_addr_delete(struct lec_priv *priv, unsigned char *atm_addr, unsigned long permanent) { + unsigned long flags; struct lec_arp_table *entry, *next; int i; - lec_arp_get(priv); DPRINTK("lec_addr_delete\n"); - for(i=0;ilec_arp_tables[i];entry != NULL; entry=next) { + spin_lock_irqsave(&priv->lec_arp_lock, flags); + for(i = 0; i < LEC_ARP_TABLE_SIZE; i++) { + for(entry = priv->lec_arp_tables[i]; entry != NULL; entry = next) { next = entry->next; if (!memcmp(atm_addr, entry->atm_addr, ATM_ESA_LEN) && (permanent || !(entry->flags & LEC_PERMANENT_FLAG))) { - lec_arp_remove(priv, entry); + lec_arp_remove(priv, entry); kfree(entry); } - lec_arp_put(priv); + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); return 0; } } - lec_arp_put(priv); + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); return -1; } @@ -2064,6 +2061,7 @@ unsigned char *atm_addr, unsigned long remoteflag, unsigned int targetless_le_arp) { + unsigned long flags; struct lec_arp_table *entry, *tmp; int i; @@ -2072,12 +2070,12 @@ mac_addr[0],mac_addr[1],mac_addr[2],mac_addr[3], mac_addr[4],mac_addr[5]); + spin_lock_irqsave(&priv->lec_arp_lock, flags); entry = lec_arp_find(priv, mac_addr); if (entry == NULL && targetless_le_arp) - return; /* LANE2: ignore targetless LE_ARPs for which - * we have no entry in the cache. 7.1.30 - */ - lec_arp_get(priv); + goto out; /* LANE2: ignore targetless LE_ARPs for which + * we have no entry in the cache. 7.1.30 + */ if (priv->lec_arp_empty_ones) { entry = priv->lec_arp_empty_ones; if (!memcmp(entry->atm_addr, atm_addr, ATM_ESA_LEN)) { @@ -2117,27 +2115,24 @@ entry->flags|=LEC_REMOTE_FLAG; else entry->flags&=~LEC_REMOTE_FLAG; - lec_arp_put(priv); DPRINTK("After update\n"); dump_arp_table(priv); - return; + goto out; } } entry = lec_arp_find(priv, mac_addr); if (!entry) { entry = make_entry(priv, mac_addr); - if (!entry) { - lec_arp_put(priv); - return; - } + if (!entry) + goto out; entry->status = ESI_UNKNOWN; lec_arp_add(priv, entry); /* Temporary, changes before end of function */ } memcpy(entry->atm_addr, atm_addr, ATM_ESA_LEN); del_timer(&entry->timer); - for(i=0;ilec_arp_tables[i];tmp;tmp=tmp->next) { + for(i = 0; i < LEC_ARP_TABLE_SIZE; i++) { + for(tmp = priv->lec_arp_tables[i]; tmp; tmp=tmp->next) { if (entry != tmp && !memcmp(tmp->atm_addr, atm_addr, ATM_ESA_LEN)) { @@ -2166,7 +2161,8 @@ } DPRINTK("After update2\n"); dump_arp_table(priv); - lec_arp_put(priv); +out: + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); } /* @@ -2177,10 +2173,11 @@ struct atm_vcc *vcc, void (*old_push)(struct atm_vcc *vcc, struct sk_buff *skb)) { + unsigned long flags; struct lec_arp_table *entry; int i, found_entry=0; - lec_arp_get(priv); + spin_lock_irqsave(&priv->lec_arp_lock, flags); if (ioc_data->receive == 2) { /* Vcc for Multicast Forward. No timer, LANEv2 7.1.20 and 2.3.5.3 */ @@ -2189,26 +2186,22 @@ entry = lec_arp_find(priv, bus_mac); if (!entry) { printk("LEC_ARP: Multicast entry not found!\n"); - lec_arp_put(priv); - return; + goto out; } memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); entry->recv_vcc = vcc; entry->old_recv_push = old_push; #endif entry = make_entry(priv, bus_mac); - if (entry == NULL) { - lec_arp_put(priv); - return; - } + if (entry == NULL) + goto out; del_timer(&entry->timer); memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); entry->recv_vcc = vcc; entry->old_recv_push = old_push; entry->next = priv->mcast_fwds; priv->mcast_fwds = entry; - lec_arp_put(priv); - return; + goto out; } else if (ioc_data->receive == 1) { /* Vcc which we don't want to make default vcc, attach it anyway. */ @@ -2224,10 +2217,8 @@ ioc_data->atm_addr[16],ioc_data->atm_addr[17], ioc_data->atm_addr[18],ioc_data->atm_addr[19]); entry = make_entry(priv, bus_mac); - if (entry == NULL) { - lec_arp_put(priv); - return; - } + if (entry == NULL) + goto out; memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); memset(entry->mac_addr, 0, ETH_ALEN); entry->recv_vcc = vcc; @@ -2238,9 +2229,8 @@ add_timer(&entry->timer); entry->next = priv->lec_no_forward; priv->lec_no_forward = entry; - lec_arp_put(priv); dump_arp_table(priv); - return; + goto out; } DPRINTK("LEC_ARP:Attaching data direct, default:%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x\n", ioc_data->atm_addr[0],ioc_data->atm_addr[1], @@ -2253,8 +2243,8 @@ ioc_data->atm_addr[14],ioc_data->atm_addr[15], ioc_data->atm_addr[16],ioc_data->atm_addr[17], ioc_data->atm_addr[18],ioc_data->atm_addr[19]); - for (i=0;ilec_arp_tables[i];entry;entry=entry->next) { + for (i = 0; i < LEC_ARP_TABLE_SIZE; i++) { + for (entry = priv->lec_arp_tables[i]; entry; entry=entry->next) { if (memcmp(ioc_data->atm_addr, entry->atm_addr, ATM_ESA_LEN)==0) { DPRINTK("LEC_ARP: Attaching data direct\n"); @@ -2297,18 +2287,15 @@ } } if (found_entry) { - lec_arp_put(priv); DPRINTK("After vcc was added\n"); dump_arp_table(priv); - return; + goto out; } /* Not found, snatch address from first data packet that arrives from this vcc */ entry = make_entry(priv, bus_mac); - if (!entry) { - lec_arp_put(priv); - return; - } + if (!entry) + goto out; entry->vcc = vcc; entry->old_push = old_push; memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); @@ -2319,20 +2306,23 @@ entry->timer.expires = jiffies + priv->vcc_timeout_period; entry->timer.function = lec_arp_expire_vcc; add_timer(&entry->timer); - lec_arp_put(priv); DPRINTK("After vcc was added\n"); dump_arp_table(priv); +out: + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); } void lec_flush_complete(struct lec_priv *priv, unsigned long tran_id) { + unsigned long flags; struct lec_arp_table *entry; int i; DPRINTK("LEC:lec_flush_complete %lx\n",tran_id); - for (i=0;ilec_arp_tables[i];entry;entry=entry->next) { + spin_lock_irqsave(&priv->lec_arp_lock, flags); + for (i = 0; i < LEC_ARP_TABLE_SIZE; i++) { + for (entry = priv->lec_arp_tables[i]; entry; entry=entry->next) { if (entry->flush_tran_id == tran_id && entry->status == ESI_FLUSH_PENDING) { struct sk_buff *skb; @@ -2344,6 +2334,7 @@ } } } + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); dump_arp_table(priv); } @@ -2351,24 +2342,29 @@ lec_set_flush_tran_id(struct lec_priv *priv, unsigned char *atm_addr, unsigned long tran_id) { + unsigned long flags; struct lec_arp_table *entry; int i; - for (i=0;ilec_arp_tables[i];entry;entry=entry->next) + spin_lock_irqsave(&priv->lec_arp_lock, flags); + for (i = 0; i < LEC_ARP_TABLE_SIZE; i++) + for(entry = priv->lec_arp_tables[i]; entry; entry=entry->next) if (!memcmp(atm_addr, entry->atm_addr, ATM_ESA_LEN)) { entry->flush_tran_id = tran_id; DPRINTK("Set flush transaction id to %lx for %p\n",tran_id,entry); } + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); } int lec_mcast_make(struct lec_priv *priv, struct atm_vcc *vcc) { + unsigned long flags; unsigned char mac_addr[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; struct lec_arp_table *to_add; struct lec_vcc_priv *vpriv; + int err = 0; if (!(vpriv = kmalloc(sizeof(struct lec_vcc_priv), GFP_KERNEL))) return -ENOMEM; @@ -2376,13 +2372,13 @@ vpriv->old_pop = vcc->pop; vcc->user_back = vpriv; vcc->pop = lec_pop; - lec_arp_get(priv); + spin_lock_irqsave(&priv->lec_arp_lock, flags); to_add = make_entry(priv, mac_addr); if (!to_add) { - lec_arp_put(priv); vcc->pop = vpriv->old_pop; kfree(vpriv); - return -ENOMEM; + err = -ENOMEM; + goto out; } memcpy(to_add->atm_addr, vcc->remote.sas_addr.prv, ATM_ESA_LEN); to_add->status = ESI_FORWARD_DIRECT; @@ -2392,19 +2388,21 @@ vcc->push = lec_push; priv->mcast_vcc = vcc; lec_arp_add(priv, to_add); - lec_arp_put(priv); - return 0; +out: + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); + return err; } void lec_vcc_close(struct lec_priv *priv, struct atm_vcc *vcc) { + unsigned long flags; struct lec_arp_table *entry, *next; int i; DPRINTK("LEC_ARP: lec_vcc_close vpi:%d vci:%d\n",vcc->vpi,vcc->vci); dump_arp_table(priv); - lec_arp_get(priv); + spin_lock_irqsave(&priv->lec_arp_lock, flags); for(i=0;ilec_arp_tables[i];entry; entry=next) { next = entry->next; @@ -2466,7 +2464,7 @@ entry = next; } - lec_arp_put(priv); + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); dump_arp_table(priv); } @@ -2486,26 +2484,22 @@ #endif src = hdr->h_source; - lec_arp_get(priv); + spin_lock_irqsave(&priv->lec_arp_lock, flags); entry = priv->lec_arp_empty_ones; if (vcc == entry->vcc) { - spin_lock_irqsave(&priv->lec_arp_lock, flags); del_timer(&entry->timer); memcpy(entry->mac_addr, src, ETH_ALEN); entry->status = ESI_FORWARD_DIRECT; entry->last_used = jiffies; priv->lec_arp_empty_ones = entry->next; - spin_unlock_irqrestore(&priv->lec_arp_lock, flags); /* We might have got an entry */ - if ((prev=lec_arp_find(priv,src))) { + if ((prev = lec_arp_find(priv,src))) { lec_arp_remove(priv, prev); kfree(prev); } lec_arp_add(priv, entry); - lec_arp_put(priv); - return; + goto out; } - spin_lock_irqsave(&priv->lec_arp_lock, flags); prev = entry; entry = entry->next; while (entry && entry->vcc != vcc) { @@ -2514,21 +2508,19 @@ } if (!entry) { DPRINTK("LEC_ARP: Arp_check_empties: entry not found!\n"); - lec_arp_put(priv); - spin_unlock_irqrestore(&priv->lec_arp_lock, flags); - return; + goto out; } del_timer(&entry->timer); memcpy(entry->mac_addr, src, ETH_ALEN); entry->status = ESI_FORWARD_DIRECT; entry->last_used = jiffies; prev->next = entry->next; - spin_unlock_irqrestore(&priv->lec_arp_lock, flags); if ((prev = lec_arp_find(priv, src))) { lec_arp_remove(priv, prev); kfree(prev); } lec_arp_add(priv, entry); - lec_arp_put(priv); +out: + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); } MODULE_LICENSE("GPL"); ===== net/atm/lec.h 1.12 vs edited ===== --- 1.12/net/atm/lec.h 2004-08-23 04:14:59 -04:00 +++ edited/net/atm/lec.h 2005-01-06 11:11:18 -05:00 @@ -95,7 +95,6 @@ establishes multiple Multicast Forward VCCs to us. This list collects all those VCCs. LANEv1 client has only one item in this list. These entries are not aged out. */ - atomic_t lec_arp_users; spinlock_t lec_arp_lock; struct atm_vcc *mcast_vcc; /* Default Multicast Send VCC */ struct atm_vcc *lecd; From Robert.Olsson@data.slu.se Wed Jan 5 22:16:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 22:16:10 -0800 (PST) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j066G2xg024072 for ; Wed, 5 Jan 2005 22:16:03 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.12.10/8.12.10) with ESMTP id j06IFmuA026017; Thu, 6 Jan 2005 19:15:48 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 1AEABEC1A0; Thu, 6 Jan 2005 19:15:48 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16861.32852.11187.131058@robur.slu.se> Date: Thu, 6 Jan 2005 19:15:48 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson , Stephen Hemminger Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501060926.54588.jeremy.guthrie@berbee.com> References: <200501031455.26980.jeremy.guthrie@berbee.com> <200501051325.40616.jeremy.guthrie@berbee.com> <16860.19615.251360.169722@robur.slu.se> <200501060926.54588.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13468 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > I still don't see the rt_cache_stat file even under 2.4.28 stock. See below. > ls -la /proc/net/stat/ > total 0 > -r--r--r-- 1 root root 0 Jan 6 09:22 rt_cache rtstat is replaced by lnstat which is in iproute2 package: http://developer.osdl.org/dev/iproute2/download/ (Old version ftp://robur.slu.se/pub/Linux/net-development/rt_cache_stat/rtstat.c) > cat /proc/net/softnet_stat > 96deb140 0032844e 00012bbb 00000fd8 00000000 00000000 00000000 00000000 > 00000dd4 > 00013dda 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > 0000041f You only use CPU0 for packet processing. Also it seems you use the non-NAPI version of e1000. > cat /proc/interrupts > CPU0 CPU1 > 0: 821852 5664906 IO-APIC-edge timer > 1: 484 1247 IO-APIC-edge keyboard > 8: 0 2 IO-APIC-edge rtc > 14: 5 16 IO-APIC-edge ide0 > 18: 1928608529 1374 IO-APIC-level eth3 > 20: 1 226113098 IO-APIC-level eth2 > 27: 7950 34312 IO-APIC-level eth0 Traffic is flowing from eth3->eth2 Why all the interrupts on eth2/CPU1? Is traffic most unidirectional? --ro From shemminger@osdl.org Wed Jan 5 22:57:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 22:57:20 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j066vE9P025341 for ; Wed, 5 Jan 2005 22:57:14 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j06Iv2d29046 for ; Thu, 6 Jan 2005 10:57:02 -0800 Date: Thu, 6 Jan 2005 10:57:03 -0800 From: Stephen Hemminger To: netdev@oss.sgi.com Subject: Fw: [Bug 3998] New: ARP issues after 2.4.28-RC1 Message-ID: <20050106105703.3728eb2f@dxpl.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13469 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev http://bugme.osdl.org/show_bug.cgi?id=3998 Summary: ARP issues after RC1 Kernel Version: 2.4.28 Status: NEW Severity: normal Owner: shemminger@osdl.org Submitter: terryb@d2.com Distribution: Redhat 9.0 Hardware Environment: Intel/IWill MBs. Intel e1000 and Broadcom tg3 network modules. Problem Description: After upgrading to 2.4.28, we having issues where hosts are unreachable and we are getting entries in the ARP tables. After the entry has cleared, the host will become reachable. This is most noticible upon startup, where netfs (nfs mounts), yp, and ntp fail, as they cannot reach their corresponding servers. This is happening on multiple machines, with different MBs and network interfaces, all running RedHat 9.0. 2.4.27, using the same .config had no such issues. After compiling all the pre and rc patches, it seems that the offending change occurred between rc1 and rc2. Steps to reproduce: 1. Install RH9, workstation install. 2. Configure NFS mounts in /etc/fstab, chkconfig netfs on. 3. Configure NTP, chkconfig ntp on. 4. Configure YP, chkconfig ypbind on. 5. Compile 2.4.28 using .config below 6. Reboot using 2.4.28. Upon boot, the services above will fail, as they cannot reach their servers. 7. Once up, log in as root and type arp -a. There will be entries for the unreachable hosts. 8. Compile 2.4.28-rc1, using the same .config. 9. Reboot using 2.4.28-rc1. All the previously failing services will start up with no issues. 10. Compile 2.4.28-rc2, using the same .config. 11. Reboot using 2.4.28-rc2. The services will fail once again. # # Automatically generated by make menuconfig: don't edit # CONFIG_X86=y # CONFIG_SBUS is not set CONFIG_UID16=y # # Code maturity level options # CONFIG_EXPERIMENTAL=y # # Loadable module support # CONFIG_MODULES=y CONFIG_MODVERSIONS=y CONFIG_KMOD=y # # Processor type and features # # CONFIG_M386 is not set # CONFIG_M486 is not set # CONFIG_M586 is not set # CONFIG_M586TSC is not set # CONFIG_M586MMX is not set # CONFIG_M686 is not set # CONFIG_MPENTIUMIII is not set CONFIG_MPENTIUM4=y # CONFIG_MK6 is not set # CONFIG_MK7 is not set # CONFIG_MK8 is not set # CONFIG_MELAN is not set # CONFIG_MCRUSOE is not set # CONFIG_MWINCHIPC6 is not set # CONFIG_MWINCHIP2 is not set # CONFIG_MWINCHIP3D is not set # CONFIG_MCYRIXIII is not set # CONFIG_MVIAC3_2 is not set CONFIG_X86_WP_WORKS_OK=y CONFIG_X86_INVLPG=y CONFIG_X86_CMPXCHG=y CONFIG_X86_XADD=y CONFIG_X86_BSWAP=y CONFIG_X86_POPAD_OK=y # CONFIG_RWSEM_GENERIC_SPINLOCK is not set CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_X86_L1_CACHE_SHIFT=7 CONFIG_X86_HAS_TSC=y CONFIG_X86_GOOD_APIC=y CONFIG_X86_PGE=y CONFIG_X86_USE_PPRO_CHECKSUM=y CONFIG_X86_F00F_WORKS_OK=y CONFIG_X86_MCE=y # CONFIG_TOSHIBA is not set # CONFIG_I8K is not set CONFIG_MICROCODE=y # CONFIG_X86_MSR is not set # CONFIG_X86_CPUID is not set # CONFIG_EDD is not set # CONFIG_NOHIGHMEM is not set CONFIG_HIGHMEM4G=y # CONFIG_HIGHMEM64G is not set CONFIG_HIGHMEM=y CONFIG_HIGHIO=y # CONFIG_MATH_EMULATION is not set CONFIG_MTRR=y CONFIG_SMP=y CONFIG_NR_CPUS=32 # CONFIG_X86_NUMA is not set # CONFIG_X86_TSC_DISABLE is not set CONFIG_X86_TSC=y CONFIG_HAVE_DEC_LOCK=y # # General setup # CONFIG_NET=y CONFIG_X86_IO_APIC=y CONFIG_X86_LOCAL_APIC=y CONFIG_PCI=y # CONFIG_PCI_GOBIOS is not set # CONFIG_PCI_GODIRECT is not set CONFIG_PCI_GOANY=y CONFIG_PCI_BIOS=y CONFIG_PCI_DIRECT=y CONFIG_ISA=y CONFIG_PCI_NAMES=y # CONFIG_EISA is not set # CONFIG_MCA is not set CONFIG_HOTPLUG=y # # PCMCIA/CardBus support # CONFIG_PCMCIA=y CONFIG_CARDBUS=y # CONFIG_TCIC is not set # CONFIG_I82092 is not set # CONFIG_I82365 is not set # # PCI Hotplug Support # # CONFIG_HOTPLUG_PCI is not set # CONFIG_HOTPLUG_PCI_COMPAQ is not set # CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set # CONFIG_HOTPLUG_PCI_IBM is not set # CONFIG_HOTPLUG_PCI_SHPC is not set # CONFIG_HOTPLUG_PCI_SHPC_POLL_EVENT_MODE is not set # CONFIG_HOTPLUG_PCI_SHPC_PHPRM_LEGACY is not set # CONFIG_HOTPLUG_PCI_PCIE is not set # CONFIG_HOTPLUG_PCI_PCIE_POLL_EVENT_MODE is not set CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y CONFIG_KCORE_ELF=y # CONFIG_KCORE_AOUT is not set CONFIG_BINFMT_AOUT=y CONFIG_BINFMT_ELF=y CONFIG_BINFMT_MISC=y # CONFIG_OOM_KILLER is not set # CONFIG_PM is not set # CONFIG_APM is not set # # ACPI Support # # CONFIG_ACPI is not set CONFIG_ACPI_BOOT=y # # Memory Technology Devices (MTD) # # CONFIG_MTD is not set # # Parallel port support # # CONFIG_PARPORT is not set # # Plug and Play configuration # CONFIG_PNP=y CONFIG_ISAPNP=y # # Block devices # CONFIG_BLK_DEV_FD=y # CONFIG_BLK_DEV_XD is not set # CONFIG_PARIDE is not set # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_CISS_SCSI_TAPE is not set # CONFIG_CISS_MONITOR_THREAD is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set # CONFIG_BLK_DEV_SX8 is not set CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_NBD=y CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y # CONFIG_BLK_STATS is not set # # Multi-device support (RAID and LVM) # CONFIG_MD=y CONFIG_BLK_DEV_MD=y CONFIG_MD_LINEAR=y CONFIG_MD_RAID0=y CONFIG_MD_RAID1=y CONFIG_MD_RAID5=y CONFIG_MD_MULTIPATH=y CONFIG_BLK_DEV_LVM=y # # Networking options # CONFIG_PACKET=y # CONFIG_PACKET_MMAP is not set # CONFIG_NETLINK_DEV is not set CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set CONFIG_FILTER=y CONFIG_UNIX=y CONFIG_INET=y CONFIG_IP_MULTICAST=y # CONFIG_IP_ADVANCED_ROUTER is not set CONFIG_IP_PNP=y CONFIG_IP_PNP_DHCP=y # CONFIG_IP_PNP_BOOTP is not set # CONFIG_IP_PNP_RARP is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set # CONFIG_IP_MROUTE is not set # CONFIG_ARPD is not set # CONFIG_INET_ECN is not set # CONFIG_SYN_COOKIES is not set # # IP: Netfilter Configuration # # CONFIG_IP_NF_CONNTRACK is not set # CONFIG_IP_NF_QUEUE is not set # CONFIG_IP_NF_IPTABLES is not set # CONFIG_IP_NF_ARPTABLES is not set # CONFIG_IP_NF_COMPAT_IPCHAINS is not set # CONFIG_IP_NF_COMPAT_IPFWADM is not set # # IP: Virtual Server Configuration # # CONFIG_IP_VS is not set # CONFIG_IPV6 is not set # CONFIG_KHTTPD is not set # # SCTP Configuration (EXPERIMENTAL) # # CONFIG_IP_SCTP is not set # CONFIG_ATM is not set # CONFIG_VLAN_8021Q is not set # CONFIG_IPX is not set CONFIG_ATALK=y # # Appletalk devices # # CONFIG_DEV_APPLETALK is not set # CONFIG_DECNET is not set # CONFIG_BRIDGE is not set # CONFIG_X25 is not set # CONFIG_LAPB is not set # CONFIG_LLC is not set # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set # CONFIG_NET_FASTROUTE is not set # CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing # # CONFIG_NET_SCHED is not set # # Network testing # # CONFIG_NET_PKTGEN is not set # # Telephony Support # # CONFIG_PHONE is not set # CONFIG_PHONE_IXJ is not set # CONFIG_PHONE_IXJ_PCMCIA is not set # # ATA/IDE/MFM/RLL support # CONFIG_IDE=y # # IDE, ATA and ATAPI Block devices # CONFIG_BLK_DEV_IDE=y # CONFIG_BLK_DEV_HD_IDE is not set # CONFIG_BLK_DEV_HD is not set # CONFIG_BLK_DEV_IDE_SATA is not set CONFIG_BLK_DEV_IDEDISK=y CONFIG_IDEDISK_MULTI_MODE=y # CONFIG_IDEDISK_STROKE is not set # CONFIG_BLK_DEV_IDECS is not set # CONFIG_BLK_DEV_DELKIN is not set CONFIG_BLK_DEV_IDECD=y # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_BLK_DEV_IDESCSI is not set # CONFIG_IDE_TASK_IOCTL is not set CONFIG_BLK_DEV_CMD640=y # CONFIG_BLK_DEV_CMD640_ENHANCED is not set # CONFIG_BLK_DEV_ISAPNP is not set CONFIG_BLK_DEV_IDEPCI=y # CONFIG_BLK_DEV_GENERIC is not set CONFIG_IDEPCI_SHARE_IRQ=y CONFIG_BLK_DEV_IDEDMA_PCI=y # CONFIG_BLK_DEV_OFFBOARD is not set # CONFIG_BLK_DEV_IDEDMA_FORCED is not set CONFIG_IDEDMA_PCI_AUTO=y # CONFIG_IDEDMA_ONLYDISK is not set CONFIG_BLK_DEV_IDEDMA=y # CONFIG_IDEDMA_PCI_WIP is not set # CONFIG_BLK_DEV_ADMA100 is not set # CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_ALI15X3 is not set # CONFIG_WDC_ALI15X3 is not set # CONFIG_BLK_DEV_AMD74XX is not set # CONFIG_AMD74XX_OVERRIDE is not set # CONFIG_BLK_DEV_ATIIXP is not set # CONFIG_BLK_DEV_CMD64X is not set # CONFIG_BLK_DEV_TRIFLEX is not set # CONFIG_BLK_DEV_CY82C693 is not set # CONFIG_BLK_DEV_CS5530 is not set # CONFIG_BLK_DEV_HPT34X is not set # CONFIG_HPT34X_AUTODMA is not set # CONFIG_BLK_DEV_HPT366 is not set CONFIG_BLK_DEV_PIIX=y # CONFIG_BLK_DEV_NS87415 is not set # CONFIG_BLK_DEV_OPTI621 is not set CONFIG_BLK_DEV_PDC202XX_OLD=y # CONFIG_PDC202XX_BURST is not set CONFIG_BLK_DEV_PDC202XX_NEW=y # CONFIG_PDC202XX_FORCE is not set CONFIG_BLK_DEV_RZ1000=y # CONFIG_BLK_DEV_SC1200 is not set # CONFIG_BLK_DEV_SVWKS is not set # CONFIG_BLK_DEV_SIIMAGE is not set # CONFIG_BLK_DEV_SIS5513 is not set # CONFIG_BLK_DEV_SLC90E66 is not set # CONFIG_BLK_DEV_TRM290 is not set # CONFIG_BLK_DEV_VIA82CXXX is not set # CONFIG_IDE_CHIPSETS is not set CONFIG_IDEDMA_AUTO=y # CONFIG_IDEDMA_IVB is not set # CONFIG_DMA_NONPCI is not set CONFIG_BLK_DEV_PDC202XX=y # CONFIG_BLK_DEV_ATARAID is not set # CONFIG_BLK_DEV_ATARAID_PDC is not set # CONFIG_BLK_DEV_ATARAID_HPT is not set # CONFIG_BLK_DEV_ATARAID_MEDLEY is not set # CONFIG_BLK_DEV_ATARAID_SII is not set # # SCSI support # CONFIG_SCSI=y CONFIG_BLK_DEV_SD=y CONFIG_SD_EXTRA_DEVS=40 CONFIG_CHR_DEV_ST=y # CONFIG_CHR_DEV_OSST is not set CONFIG_BLK_DEV_SR=y # CONFIG_BLK_DEV_SR_VENDOR is not set CONFIG_SR_EXTRA_DEVS=2 CONFIG_CHR_DEV_SG=y CONFIG_SCSI_DEBUG_QUEUES=y CONFIG_SCSI_MULTI_LUN=y CONFIG_SCSI_CONSTANTS=y # CONFIG_SCSI_LOGGING is not set # # SCSI low-level drivers # # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_7000FASST is not set # CONFIG_SCSI_ACARD is not set # CONFIG_SCSI_AHA152X is not set # CONFIG_SCSI_AHA1542 is not set # CONFIG_SCSI_AHA1740 is not set # CONFIG_SCSI_AACRAID is not set CONFIG_SCSI_AIC7XXX=y CONFIG_AIC7XXX_CMDS_PER_DEVICE=32 CONFIG_AIC7XXX_RESET_DELAY_MS=15000 # CONFIG_AIC7XXX_PROBE_EISA_VL is not set # CONFIG_AIC7XXX_BUILD_FIRMWARE is not set # CONFIG_AIC7XXX_DEBUG_ENABLE is not set CONFIG_AIC7XXX_DEBUG_MASK=0 # CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set # CONFIG_SCSI_AIC79XX is not set # CONFIG_SCSI_DPT_I2O is not set # CONFIG_SCSI_ADVANSYS is not set # CONFIG_SCSI_IN2000 is not set # CONFIG_SCSI_AM53C974 is not set # CONFIG_SCSI_MEGARAID is not set # CONFIG_SCSI_MEGARAID2 is not set CONFIG_SCSI_SATA=y # CONFIG_SCSI_SATA_SVW is not set CONFIG_SCSI_ATA_PIIX=y # CONFIG_SCSI_SATA_NV is not set # CONFIG_SCSI_SATA_PROMISE is not set # CONFIG_SCSI_SATA_SX4 is not set # CONFIG_SCSI_SATA_SIL is not set # CONFIG_SCSI_SATA_SIS is not set # CONFIG_SCSI_SATA_ULI is not set # CONFIG_SCSI_SATA_VIA is not set # CONFIG_SCSI_SATA_VITESSE is not set # CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_CPQFCTS is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_DTC3280 is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_EATA_DMA is not set # CONFIG_SCSI_EATA_PIO is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_GENERIC_NCR5380 is not set # CONFIG_SCSI_IPS is not set # CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_NCR53C406A is not set # CONFIG_SCSI_NCR53C7xx is not set CONFIG_SCSI_SYM53C8XX_2=y CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set # CONFIG_SCSI_PAS16 is not set # CONFIG_SCSI_PCI2000 is not set # CONFIG_SCSI_PCI2220I is not set # CONFIG_SCSI_PSI240I is not set # CONFIG_SCSI_QLOGIC_FAS is not set # CONFIG_SCSI_QLOGIC_ISP is not set # CONFIG_SCSI_QLOGIC_FC is not set # CONFIG_SCSI_QLOGIC_1280 is not set # CONFIG_SCSI_SEAGATE is not set # CONFIG_SCSI_SIM710 is not set # CONFIG_SCSI_SYM53C416 is not set # CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_T128 is not set # CONFIG_SCSI_U14_34F is not set # CONFIG_SCSI_ULTRASTOR is not set # CONFIG_SCSI_NSP32 is not set # CONFIG_SCSI_DEBUG is not set # # PCMCIA SCSI adapter support # # CONFIG_SCSI_PCMCIA is not set # # Fusion MPT device support # # CONFIG_FUSION is not set # CONFIG_FUSION_BOOT is not set # CONFIG_FUSION_ISENSE is not set # CONFIG_FUSION_CTL is not set # CONFIG_FUSION_LAN is not set # # IEEE 1394 (FireWire) support (EXPERIMENTAL) # CONFIG_IEEE1394=m CONFIG_IEEE1394_OHCI1394=m CONFIG_IEEE1394_VIDEO1394=m CONFIG_IEEE1394_SBP2=m CONFIG_IEEE1394_SBP2_PHYS_DMA=y # CONFIG_IEEE1394_ETH1394 is not set CONFIG_IEEE1394_DV1394=m CONFIG_IEEE1394_RAWIO=m # CONFIG_IEEE1394_CMP is not set # CONFIG_IEEE1394_VERBOSEDEBUG is not set # CONFIG_IEEE1394_OUI_DB is not set # # I2O device support # # CONFIG_I2O is not set # CONFIG_I2O_PCI is not set # CONFIG_I2O_BLOCK is not set # CONFIG_I2O_LAN is not set # CONFIG_I2O_SCSI is not set # CONFIG_I2O_PROC is not set # # Network device support # CONFIG_NETDEVICES=y # # ARCnet devices # # CONFIG_ARCNET is not set CONFIG_DUMMY=m # CONFIG_BONDING is not set # CONFIG_EQUALIZER is not set # CONFIG_TUN is not set # CONFIG_ETHERTAP is not set # CONFIG_NET_SB1000 is not set # # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y # CONFIG_SUNLANCE is not set # CONFIG_HAPPYMEAL is not set # CONFIG_SUNBMAC is not set # CONFIG_SUNQE is not set # CONFIG_SUNGEM is not set # CONFIG_NET_VENDOR_3COM is not set # CONFIG_LANCE is not set # CONFIG_NET_VENDOR_SMC is not set # CONFIG_NET_VENDOR_RACAL is not set # CONFIG_AT1700 is not set # CONFIG_DEPCA is not set # CONFIG_HP100 is not set # CONFIG_NET_ISA is not set CONFIG_NET_PCI=y # CONFIG_PCNET32 is not set # CONFIG_AMD8111_ETH is not set # CONFIG_ADAPTEC_STARFIRE is not set # CONFIG_AC3200 is not set # CONFIG_APRICOT is not set # CONFIG_B44 is not set # CONFIG_CS89x0 is not set # CONFIG_TULIP is not set # CONFIG_DE4X5 is not set # CONFIG_DGRS is not set # CONFIG_DM9102 is not set # CONFIG_EEPRO100 is not set # CONFIG_EEPRO100_PIO is not set CONFIG_E100=m # CONFIG_LNE390 is not set # CONFIG_FEALNX is not set # CONFIG_NATSEMI is not set # CONFIG_NE2K_PCI is not set # CONFIG_FORCEDETH is not set # CONFIG_NE3210 is not set # CONFIG_ES3210 is not set # CONFIG_8139CP is not set # CONFIG_8139TOO is not set # CONFIG_8139TOO_PIO is not set # CONFIG_8139TOO_TUNE_TWISTER is not set # CONFIG_8139TOO_8129 is not set # CONFIG_8139_OLD_RX_RESET is not set # CONFIG_SIS900 is not set # CONFIG_EPIC100 is not set # CONFIG_SUNDANCE is not set # CONFIG_SUNDANCE_MMIO is not set # CONFIG_TLAN is not set # CONFIG_VIA_RHINE is not set # CONFIG_VIA_RHINE_MMIO is not set # CONFIG_WINBOND_840 is not set # CONFIG_NET_POCKET is not set # # Ethernet (1000 Mbit) # # CONFIG_ACENIC is not set # CONFIG_DL2K is not set CONFIG_E1000=m # CONFIG_E1000_NAPI is not set # CONFIG_MYRI_SBUS is not set # CONFIG_NS83820 is not set # CONFIG_HAMACHI is not set # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SK98LIN is not set CONFIG_TIGON3=m # CONFIG_FDDI is not set # CONFIG_HIPPI is not set # CONFIG_PLIP is not set # CONFIG_PPP is not set # CONFIG_SLIP is not set # # Wireless LAN (non-hamradio) # # CONFIG_NET_RADIO is not set # # Token Ring devices # # CONFIG_TR is not set # CONFIG_NET_FC is not set # CONFIG_RCPCI is not set # CONFIG_SHAPER is not set # # Wan interfaces # # CONFIG_WAN is not set # # PCMCIA network device support # CONFIG_NET_PCMCIA=y # CONFIG_PCMCIA_3C589 is not set # CONFIG_PCMCIA_3C574 is not set # CONFIG_PCMCIA_FMVJ18X is not set CONFIG_PCMCIA_PCNET=y # CONFIG_PCMCIA_AXNET is not set # CONFIG_PCMCIA_NMCLAN is not set # CONFIG_PCMCIA_SMC91C92 is not set # CONFIG_PCMCIA_XIRC2PS is not set # CONFIG_ARCNET_COM20020_CS is not set # CONFIG_PCMCIA_IBMTR is not set # CONFIG_PCMCIA_XIRCOM is not set # CONFIG_PCMCIA_XIRTULIP is not set CONFIG_NET_PCMCIA_RADIO=y CONFIG_PCMCIA_RAYCS=y # CONFIG_PCMCIA_NETWAVE is not set # CONFIG_PCMCIA_WAVELAN is not set # CONFIG_AIRONET4500_CS is not set # # Amateur Radio support # # CONFIG_HAMRADIO is not set # # IrDA (infrared) support # # CONFIG_IRDA is not set # # ISDN subsystem # # CONFIG_ISDN is not set # # Old CD-ROM drivers (not SCSI, not IDE) # # CONFIG_CD_NO_IDESCSI is not set # # Input core support # CONFIG_INPUT=m CONFIG_INPUT_KEYBDEV=m CONFIG_INPUT_MOUSEDEV=m CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 CONFIG_INPUT_JOYDEV=m CONFIG_INPUT_EVDEV=m CONFIG_INPUT_UINPUT=m # # Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_SERIAL=y # CONFIG_SERIAL_CONSOLE is not set # CONFIG_SERIAL_EXTENDED is not set # CONFIG_SERIAL_NONSTANDARD is not set CONFIG_UNIX98_PTYS=y CONFIG_UNIX98_PTY_COUNT=256 # # I2C support # # CONFIG_I2C is not set # # Mice # # CONFIG_BUSMOUSE is not set CONFIG_MOUSE=y CONFIG_PSMOUSE=y # CONFIG_82C710_MOUSE is not set # CONFIG_PC110_PAD is not set # CONFIG_MK712_MOUSE is not set # # Joysticks # # CONFIG_INPUT_GAMEPORT is not set # CONFIG_INPUT_NS558 is not set # CONFIG_INPUT_LIGHTNING is not set # CONFIG_INPUT_PCIGAME is not set # CONFIG_INPUT_CS461X is not set # CONFIG_INPUT_EMU10K1 is not set # CONFIG_INPUT_SERIO is not set # CONFIG_INPUT_SERPORT is not set # CONFIG_INPUT_ANALOG is not set # CONFIG_INPUT_A3D is not set # CONFIG_INPUT_ADI is not set # CONFIG_INPUT_COBRA is not set # CONFIG_INPUT_GF2K is not set # CONFIG_INPUT_GRIP is not set # CONFIG_INPUT_INTERACT is not set # CONFIG_INPUT_TMDC is not set # CONFIG_INPUT_SIDEWINDER is not set # CONFIG_INPUT_IFORCE_USB is not set # CONFIG_INPUT_IFORCE_232 is not set # CONFIG_INPUT_WARRIOR is not set # CONFIG_INPUT_MAGELLAN is not set # CONFIG_INPUT_SPACEORB is not set # CONFIG_INPUT_SPACEBALL is not set # CONFIG_INPUT_STINGER is not set # CONFIG_INPUT_DB9 is not set # CONFIG_INPUT_GAMECON is not set # CONFIG_INPUT_TURBOGRAFX is not set # CONFIG_QIC02_TAPE is not set # CONFIG_IPMI_HANDLER is not set # CONFIG_IPMI_PANIC_EVENT is not set # CONFIG_IPMI_DEVICE_INTERFACE is not set # CONFIG_IPMI_KCS is not set # CONFIG_IPMI_WATCHDOG is not set # # Watchdog Cards # # CONFIG_WATCHDOG is not set # CONFIG_SCx200 is not set # CONFIG_SCx200_GPIO is not set # CONFIG_AMD_RNG is not set # CONFIG_INTEL_RNG is not set # CONFIG_HW_RANDOM is not set # CONFIG_AMD_PM768 is not set # CONFIG_NVRAM is not set # CONFIG_RTC is not set # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set # CONFIG_SONYPI is not set # # Ftape, the floppy tape device driver # # CONFIG_FTAPE is not set CONFIG_AGP=y CONFIG_AGP_INTEL=y CONFIG_AGP_I810=y CONFIG_AGP_VIA=y CONFIG_AGP_AMD=y # CONFIG_AGP_AMD_K8 is not set CONFIG_AGP_SIS=y CONFIG_AGP_ALI=y CONFIG_AGP_SWORKS=y CONFIG_AGP_NVIDIA=y CONFIG_AGP_ATI=y # # Direct Rendering Manager (XFree86 DRI support) # CONFIG_DRM=y # CONFIG_DRM_OLD is not set CONFIG_DRM_NEW=y CONFIG_DRM_TDFX=y # CONFIG_DRM_GAMMA is not set # CONFIG_DRM_R128 is not set CONFIG_DRM_RADEON=y CONFIG_DRM_I810=y CONFIG_DRM_I810_XFREE_41=y # CONFIG_DRM_I830 is not set # CONFIG_DRM_MGA is not set # CONFIG_DRM_SIS is not set # # PCMCIA character devices # # CONFIG_PCMCIA_SERIAL_CS is not set # CONFIG_SYNCLINK_CS is not set # CONFIG_MWAVE is not set # CONFIG_OBMOUSE is not set # # Multimedia devices # CONFIG_VIDEO_DEV=y # # Video For Linux # CONFIG_VIDEO_PROC_FS=y # CONFIG_I2C_PARPORT is not set # CONFIG_VIDEO_BT848 is not set # CONFIG_VIDEO_PMS is not set # CONFIG_VIDEO_CPIA is not set # CONFIG_VIDEO_SAA5249 is not set # CONFIG_TUNER_3036 is not set # CONFIG_VIDEO_STRADIS is not set # CONFIG_VIDEO_ZORAN is not set # CONFIG_VIDEO_ZORAN_BUZ is not set # CONFIG_VIDEO_ZORAN_DC10 is not set # CONFIG_VIDEO_ZORAN_LML33 is not set # CONFIG_VIDEO_ZR36120 is not set # CONFIG_VIDEO_MEYE is not set # # Radio Adapters # # CONFIG_RADIO_CADET is not set # CONFIG_RADIO_RTRACK is not set # CONFIG_RADIO_RTRACK2 is not set # CONFIG_RADIO_AZTECH is not set # CONFIG_RADIO_GEMTEK is not set # CONFIG_RADIO_GEMTEK_PCI is not set # CONFIG_RADIO_MAXIRADIO is not set # CONFIG_RADIO_MAESTRO is not set # CONFIG_RADIO_MIROPCM20 is not set # CONFIG_RADIO_MIROPCM20_RDS is not set # CONFIG_RADIO_SF16FMI is not set # CONFIG_RADIO_SF16FMR2 is not set # CONFIG_RADIO_TERRATEC is not set # CONFIG_RADIO_TRUST is not set # CONFIG_RADIO_TYPHOON is not set # CONFIG_RADIO_ZOLTRIX is not set # # File systems # # CONFIG_QUOTA is not set # CONFIG_QFMT_V2 is not set # CONFIG_AUTOFS_FS is not set CONFIG_AUTOFS4_FS=y # CONFIG_REISERFS_FS is not set # CONFIG_REISERFS_CHECK is not set # CONFIG_REISERFS_PROC_INFO is not set # CONFIG_ADFS_FS is not set # CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_HFSPLUS_FS is not set # CONFIG_BEFS_FS is not set # CONFIG_BEFS_DEBUG is not set # CONFIG_BFS_FS is not set CONFIG_EXT3_FS=y CONFIG_JBD=y # CONFIG_JBD_DEBUG is not set CONFIG_FAT_FS=y CONFIG_MSDOS_FS=y CONFIG_UMSDOS_FS=y CONFIG_VFAT_FS=y # CONFIG_EFS_FS is not set # CONFIG_JFFS_FS is not set # CONFIG_JFFS2_FS is not set # CONFIG_CRAMFS is not set CONFIG_TMPFS=y CONFIG_RAMFS=y CONFIG_ISO9660_FS=y CONFIG_JOLIET=y # CONFIG_ZISOFS is not set # CONFIG_JFS_FS is not set # CONFIG_JFS_DEBUG is not set # CONFIG_JFS_STATISTICS is not set # CONFIG_MINIX_FS is not set # CONFIG_VXFS_FS is not set CONFIG_NTFS_FS=y # CONFIG_NTFS_RW is not set # CONFIG_HPFS_FS is not set CONFIG_PROC_FS=y # CONFIG_DEVFS_FS is not set # CONFIG_DEVFS_MOUNT is not set # CONFIG_DEVFS_DEBUG is not set CONFIG_DEVPTS_FS=y # CONFIG_QNX4FS_FS is not set # CONFIG_QNX4FS_RW is not set # CONFIG_ROMFS_FS is not set CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set CONFIG_UDF_FS=y # CONFIG_UDF_RW is not set # CONFIG_UFS_FS is not set # CONFIG_UFS_FS_WRITE is not set # CONFIG_XFS_FS is not set # CONFIG_XFS_QUOTA is not set # CONFIG_XFS_RT is not set # CONFIG_XFS_TRACE is not set # CONFIG_XFS_DEBUG is not set # # Network File Systems # # CONFIG_CODA_FS is not set # CONFIG_INTERMEZZO_FS is not set CONFIG_NFS_FS=y CONFIG_NFS_V3=y CONFIG_NFS_DIRECTIO=y CONFIG_ROOT_NFS=y CONFIG_NFSD=y CONFIG_NFSD_V3=y CONFIG_NFSD_TCP=y CONFIG_SUNRPC=y CONFIG_LOCKD=y CONFIG_LOCKD_V4=y CONFIG_SMB_FS=y # CONFIG_SMB_NLS_DEFAULT is not set # CONFIG_SMB_UNIX is not set # CONFIG_NCP_FS is not set # CONFIG_NCPFS_PACKET_SIGNING is not set # CONFIG_NCPFS_IOCTL_LOCKING is not set # CONFIG_NCPFS_STRONG is not set # CONFIG_NCPFS_NFS_NS is not set # CONFIG_NCPFS_OS2_NS is not set # CONFIG_NCPFS_SMALLDOS is not set # CONFIG_NCPFS_NLS is not set # CONFIG_NCPFS_EXTRAS is not set # CONFIG_ZISOFS_FS is not set # # Partition Types # # CONFIG_PARTITION_ADVANCED is not set CONFIG_MSDOS_PARTITION=y CONFIG_SMB_NLS=y CONFIG_NLS=y # # Native Language Support # CONFIG_NLS_DEFAULT="iso8859-1" # CONFIG_NLS_CODEPAGE_437 is not set # CONFIG_NLS_CODEPAGE_737 is not set # CONFIG_NLS_CODEPAGE_775 is not set # CONFIG_NLS_CODEPAGE_850 is not set # CONFIG_NLS_CODEPAGE_852 is not set # CONFIG_NLS_CODEPAGE_855 is not set # CONFIG_NLS_CODEPAGE_857 is not set # CONFIG_NLS_CODEPAGE_860 is not set # CONFIG_NLS_CODEPAGE_861 is not set # CONFIG_NLS_CODEPAGE_862 is not set # CONFIG_NLS_CODEPAGE_863 is not set # CONFIG_NLS_CODEPAGE_864 is not set # CONFIG_NLS_CODEPAGE_865 is not set # CONFIG_NLS_CODEPAGE_866 is not set # CONFIG_NLS_CODEPAGE_869 is not set # CONFIG_NLS_CODEPAGE_936 is not set # CONFIG_NLS_CODEPAGE_950 is not set # CONFIG_NLS_CODEPAGE_932 is not set # CONFIG_NLS_CODEPAGE_949 is not set # CONFIG_NLS_CODEPAGE_874 is not set # CONFIG_NLS_ISO8859_8 is not set # CONFIG_NLS_CODEPAGE_1250 is not set # CONFIG_NLS_CODEPAGE_1251 is not set # CONFIG_NLS_ISO8859_1 is not set # CONFIG_NLS_ISO8859_2 is not set # CONFIG_NLS_ISO8859_3 is not set # CONFIG_NLS_ISO8859_4 is not set # CONFIG_NLS_ISO8859_5 is not set # CONFIG_NLS_ISO8859_6 is not set # CONFIG_NLS_ISO8859_7 is not set # CONFIG_NLS_ISO8859_9 is not set # CONFIG_NLS_ISO8859_13 is not set # CONFIG_NLS_ISO8859_14 is not set # CONFIG_NLS_ISO8859_15 is not set # CONFIG_NLS_KOI8_R is not set # CONFIG_NLS_KOI8_U is not set # CONFIG_NLS_UTF8 is not set # # Console drivers # CONFIG_VGA_CONSOLE=y # CONFIG_VIDEO_SELECT is not set # CONFIG_MDA_CONSOLE is not set # # Frame-buffer support # # CONFIG_FB is not set # # Sound # CONFIG_SOUND=m # CONFIG_SOUND_ALI5455 is not set # CONFIG_SOUND_BT878 is not set # CONFIG_SOUND_CMPCI is not set # CONFIG_SOUND_EMU10K1 is not set # CONFIG_MIDI_EMU10K1 is not set # CONFIG_SOUND_FUSION is not set # CONFIG_SOUND_CS4281 is not set # CONFIG_SOUND_ES1370 is not set # CONFIG_SOUND_ES1371 is not set # CONFIG_SOUND_ESSSOLO1 is not set # CONFIG_SOUND_MAESTRO is not set # CONFIG_SOUND_MAESTRO3 is not set # CONFIG_SOUND_FORTE is not set # CONFIG_SOUND_ICH is not set # CONFIG_SOUND_RME96XX is not set # CONFIG_SOUND_SONICVIBES is not set # CONFIG_SOUND_TRIDENT is not set # CONFIG_SOUND_MSNDCLAS is not set # CONFIG_SOUND_MSNDPIN is not set # CONFIG_SOUND_VIA82CXXX is not set # CONFIG_MIDI_VIA82CXXX is not set # CONFIG_SOUND_OSS is not set # CONFIG_SOUND_TVMIXER is not set # CONFIG_SOUND_AD1980 is not set # CONFIG_SOUND_WM97XX is not set # # USB support # CONFIG_USB=m # CONFIG_USB_DEBUG is not set CONFIG_USB_DEVICEFS=y # CONFIG_USB_BANDWIDTH is not set CONFIG_USB_EHCI_HCD=m CONFIG_USB_UHCI=m # CONFIG_USB_UHCI_ALT is not set # CONFIG_USB_OHCI is not set # CONFIG_USB_SL811HS_ALT is not set # CONFIG_USB_SL811HS is not set CONFIG_USB_AUDIO=m CONFIG_USB_EMI26=m CONFIG_USB_BLUETOOTH=m CONFIG_USB_MIDI=m CONFIG_USB_STORAGE=m CONFIG_USB_STORAGE_DEBUG=y CONFIG_USB_STORAGE_DATAFAB=y CONFIG_USB_STORAGE_FREECOM=y CONFIG_USB_STORAGE_ISD200=y CONFIG_USB_STORAGE_DPCM=y CONFIG_USB_STORAGE_HP8200e=y CONFIG_USB_STORAGE_SDDR09=y CONFIG_USB_STORAGE_SDDR55=y CONFIG_USB_STORAGE_JUMPSHOT=y # CONFIG_USB_ACM is not set CONFIG_USB_PRINTER=m CONFIG_USB_HID=m CONFIG_USB_HIDINPUT=y CONFIG_USB_HIDDEV=y CONFIG_USB_KBD=m CONFIG_USB_MOUSE=m # CONFIG_USB_AIPTEK is not set CONFIG_USB_WACOM=m # CONFIG_USB_KBTAB is not set CONFIG_USB_POWERMATE=m CONFIG_USB_DC2XX=m CONFIG_USB_MDC800=m CONFIG_USB_SCANNER=m CONFIG_USB_MICROTEK=m # CONFIG_USB_HPUSBSCSI is not set # CONFIG_USB_IBMCAM is not set # CONFIG_USB_KONICAWC is not set # CONFIG_USB_OV511 is not set CONFIG_USB_PWC=m # CONFIG_USB_SE401 is not set # CONFIG_USB_STV680 is not set # CONFIG_USB_W9968CF is not set # CONFIG_USB_VICAM is not set # CONFIG_USB_DSBR is not set # CONFIG_USB_DABUSB is not set # CONFIG_USB_PEGASUS is not set # CONFIG_USB_RTL8150 is not set # CONFIG_USB_KAWETH is not set # CONFIG_USB_CATC is not set # CONFIG_USB_CDCETHER is not set # CONFIG_USB_USBNET is not set # CONFIG_USB_USS720 is not set # # USB Serial Converter support # # CONFIG_USB_SERIAL is not set CONFIG_USB_RIO500=m CONFIG_USB_AUERSWALD=m CONFIG_USB_TIGL=m CONFIG_USB_BRLVGER=m CONFIG_USB_LCD=m # # Support for USB gadgets # # CONFIG_USB_GADGET is not set # # Bluetooth support # # CONFIG_BLUEZ is not set # # Kernel hacking # # CONFIG_DEBUG_KERNEL is not set CONFIG_LOG_BUF_SHIFT=0 # # Cryptographic options # # CONFIG_CRYPTO is not set # # Library routines # CONFIG_CRC32=y # CONFIG_ZLIB_INFLATE is not set # CONFIG_ZLIB_DEFLATE is not set # CONFIG_FW_LOADER is not set ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From jeremy.guthrie@berbee.com Wed Jan 5 23:36:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 23:36:17 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j067a87N026628 for ; Wed, 5 Jan 2005 23:36:08 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Thu, 6 Jan 2005 13:35:55 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Thu, 6 Jan 2005 13:35:52 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson , Stephen Hemminger References: <200501031455.26980.jeremy.guthrie@berbee.com> <200501060926.54588.jeremy.guthrie@berbee.com> <16861.32852.11187.131058@robur.slu.se> In-Reply-To: <16861.32852.11187.131058@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart11278716.QdpK7jeLio"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501061335.55104.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 06 Jan 2005 19:35:55.0690 (UTC) FILETIME=[F0AB28A0:01C4F426] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13470 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart11278716.QdpK7jeLio Content-Type: multipart/mixed; boundary="Boundary-01=_YMZ3BgNw2vwGpSi" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_YMZ3BgNw2vwGpSi Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thursday 06 January 2005 12:15 pm, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > I still don't see the rt_cache_stat file even under 2.4.28 stock. See > > below. > > > > ls -la /proc/net/stat/ > > total 0 > > -r--r--r-- 1 root root 0 Jan 6 09:22 rt_cache > > rtstat is replaced by lnstat which is in iproute2 package: > http://developer.osdl.org/dev/iproute2/download/ > > (Old version=20 > ftp://robur.slu.se/pub/Linux/net-development/rt_cache_stat/rtstat.c) Please see the attachment. > > cat /proc/net/softnet_stat > > 96deb140 0032844e 00012bbb 00000fd8 00000000 00000000 00000000 00000000 > > 00000dd4 > > 00013dda 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > > 0000041f > > You only use CPU0 for packet processing. Also it seems you use the > non-NAPI version of e1000. The E1000 driver is the stock driver in 2.4.28. > > > cat /proc/interrupts > > CPU0 CPU1 > > 0: 821852 5664906 IO-APIC-edge timer > > 1: 484 1247 IO-APIC-edge keyboard > > 8: 0 2 IO-APIC-edge rtc > > 14: 5 16 IO-APIC-edge ide0 > > 18: 1928608529 1374 IO-APIC-level eth3 > > 20: 1 226113098 IO-APIC-level eth2 > > 27: 7950 34312 IO-APIC-level eth0 > > Traffic is flowing from eth3->eth2 Why all the interrupts on eth2/CPU1? > Is traffic most unidirectional? eth2 is TX only. We don't receive anything on it. This system should only= =20 ever RX on eth3 and TX on eth2 as part of its function. Eth0 is the=20 management interface on the host. =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --Boundary-01=_YMZ3BgNw2vwGpSi Content-Type: text/plain; charset="iso-8859-1"; name="results-2.4.28.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="results-2.4.28.txt" arp_cach|arp_cach|arp_cach|arp_cach|arp_cach|arp_cach|arp_cach|arp_cach|arp_cach|arp_cach|arp_cach|arp_cach|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|clip_arp|clip_arp|clip_arp|clip_arp|clip_arp|clip_arp|clip_arp|clip_arp|clip_arp|clip_arp|clip_arp|clip_arp| entries| allocs|destroys|hash_gro| lookups| hits|res_fail|rcv_prob|rcv_prob|periodic|forced_g|forced_g| entries| in_hit|in_slow_|in_slow_|in_no_ro| in_brd|in_marti|in_marti| out_hit|out_slow|out_slow|gc_total|gc_ignor|gc_goal_|gc_dst_o|in_hlist|out_hlis| entries| allocs|destroys|hash_gro| lookups| hits|res_fail|rcv_prob|rcv_prob|periodic|forced_g|forced_g| | | | ws| | | ed|es_mcast|es_ucast|_gc_runs| c_runs|c_goal_m| | | tot| mc| ute| | an_dst| an_src| | _tot| _mc| | ed| miss| verflow| _search|t_search| | | | ws| | | ed|es_mcast|es_ucast|_gc_runs| c_runs|c_goal_m| | | | | | | | | | | | iss| | | | | | | | | | | | | | | | | | | | | | | | | | | | | iss| 22| 9| 425| 1| 17202| 14599| 0| 0| 0| 75743| 0| 0| 61129| 6329| 20428| 0| 0| 1539| 0| 0| 8| 28| 0| 1677| 1675| 0| 0| 143038| 145| 0| 0| 0| 0| 0| 0| 0| 0| 0| 4649| 0| 0| 22| 0| 0| 0| 1| 1| 0| 0| 0| 2| 0| 0| 62833| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 10| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 22| 0| 0| 0| 1| 1| 0| 0| 0| 1| 0| 0| 64306| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 7| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 22| 0| 0| 0| 0| 0| 0| 0| 0| 2| 0| 0| 65602| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 22| 0| 0| 0| 0| 0| 0| 0| 0| 2| 0| 0| 59707| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 2| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 0| 0| 0| 0| 0| 2| 0| 0| 60684| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 0| 0| 0| 0| 0| 2| 0| 0| 62249| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 0| 0| 0| 0| 0| 2| 0| 0| 62249| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 0| 0| 0| 0| 0| 4| 0| 0| 65000| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 4| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 22| 0| 0| 0| 0| 0| 0| 0| 0| 2| 0| 0| 58800| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 3| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 22| 0| 0| 0| 0| 0| 0| 0| 0| 2| 0| 0| 58800| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 3| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 22| 0| 0| 0| 0| 0| 0| 0| 0| 4| 0| 0| 62135| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 22| 0| 0| 0| 0| 0| 0| 0| 0| 2| 0| 0| 63677| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 3| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 22| 0| 0| 0| 0| 0| 0| 0| 0| 2| 0| 0| 63677| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 3| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 0| 0| 0| 0| 0| 4| 0| 0| 59013| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 2| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 0| 0| 0| 0| 0| 4| 0| 0| 59013| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 2| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 24| 0| 0| 0| 0| 0| 0| 0| 0| 3| 0| 0| 62462| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 24| 0| 0| 0| 0| 0| 0| 0| 0| 3| 0| 0| 62462| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 24| 0| 0| 0| 1| 0| 0| 0| 0| 4| 0| 0| 65225| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 7| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 24| 0| 0| 0| 1| 0| 0| 0| 0| 4| 0| 0| 65225| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 7| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| arp_cach|arp_cach|arp_cach|arp_cach|arp_cach|arp_cach|arp_cach|arp_cach|arp_cach|arp_cach|arp_cach|arp_cach|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|clip_arp|clip_arp|clip_arp|clip_arp|clip_arp|clip_arp|clip_arp|clip_arp|clip_arp|clip_arp|clip_arp|clip_arp| entries| allocs|destroys|hash_gro| lookups| hits|res_fail|rcv_prob|rcv_prob|periodic|forced_g|forced_g| entries| in_hit|in_slow_|in_slow_|in_no_ro| in_brd|in_marti|in_marti| out_hit|out_slow|out_slow|gc_total|gc_ignor|gc_goal_|gc_dst_o|in_hlist|out_hlis| entries| allocs|destroys|hash_gro| lookups| hits|res_fail|rcv_prob|rcv_prob|periodic|forced_g|forced_g| | | | ws| | | ed|es_mcast|es_ucast|_gc_runs| c_runs|c_goal_m| | | tot| mc| ute| | an_dst| an_src| | _tot| _mc| | ed| miss| verflow| _search|t_search| | | | ws| | | ed|es_mcast|es_ucast|_gc_runs| c_runs|c_goal_m| | | | | | | | | | | | iss| | | | | | | | | | | | | | | | | | | | | | | | | | | | | iss| 24| 0| 0| 0| 0| 0| 0| 0| 0| 3| 0| 0| 60904| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 4| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 24| 0| 0| 0| 0| 0| 0| 0| 0| 3| 0| 0| 60904| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 4| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 0| 0| 0| 0| 0| 4| 0| 0| 63890| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 3| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 0| 0| 0| 0| 0| 4| 0| 0| 63890| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 3| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 0| 0| 0| 0| 0| 3| 0| 0| 59738| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 3| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 0| 0| 0| 0| 0| 3| 0| 0| 59738| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 3| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 1| 1| 0| 0| 0| 4| 0| 0| 63346| 0| 2| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 13| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 1| 1| 0| 0| 0| 4| 0| 0| 63346| 0| 2| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 13| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 1| 0| 0| 0| 0| 4| 0| 0| 58798| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 13| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 1| 0| 0| 0| 0| 4| 0| 0| 58798| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 13| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 24| 0| 0| 0| 1| 1| 0| 0| 0| 4| 0| 0| 62518| 0| 2| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 13| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 24| 0| 0| 0| 1| 1| 0| 0| 0| 4| 0| 0| 62518| 0| 2| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 13| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 22| 0| 0| 0| 2| 2| 0| 0| 0| 3| 0| 0| 65364| 0| 2| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 12| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 22| 0| 0| 0| 2| 2| 0| 0| 0| 3| 0| 0| 65364| 0| 2| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 12| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 2| 2| 0| 0| 0| 4| 0| 0| 61111| 0| 2| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 11| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 2| 2| 0| 0| 0| 4| 0| 0| 61111| 0| 2| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 11| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 1| 1| 0| 0| 0| 4| 0| 0| 63152| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 6| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 1| 1| 0| 0| 0| 4| 0| 0| 63152| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 6| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 1| 1| 0| 0| 0| 4| 0| 0| 58223| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 7| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 1| 1| 0| 0| 0| 4| 0| 0| 58223| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 7| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| arp_cach|arp_cach|arp_cach|arp_cach|arp_cach|arp_cach|arp_cach|arp_cach|arp_cach|arp_cach|arp_cach|arp_cach|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|clip_arp|clip_arp|clip_arp|clip_arp|clip_arp|clip_arp|clip_arp|clip_arp|clip_arp|clip_arp|clip_arp|clip_arp| entries| allocs|destroys|hash_gro| lookups| hits|res_fail|rcv_prob|rcv_prob|periodic|forced_g|forced_g| entries| in_hit|in_slow_|in_slow_|in_no_ro| in_brd|in_marti|in_marti| out_hit|out_slow|out_slow|gc_total|gc_ignor|gc_goal_|gc_dst_o|in_hlist|out_hlis| entries| allocs|destroys|hash_gro| lookups| hits|res_fail|rcv_prob|rcv_prob|periodic|forced_g|forced_g| | | | ws| | | ed|es_mcast|es_ucast|_gc_runs| c_runs|c_goal_m| | | tot| mc| ute| | an_dst| an_src| | _tot| _mc| | ed| miss| verflow| _search|t_search| | | | ws| | | ed|es_mcast|es_ucast|_gc_runs| c_runs|c_goal_m| | | | | | | | | | | | iss| | | | | | | | | | | | | | | | | | | | | | | | | | | | | iss| 24| 0| 0| 0| 2| 2| 0| 0| 0| 4| 0| 0| 62044| 0| 2| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 15| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 24| 0| 0| 0| 2| 2| 0| 0| 0| 4| 0| 0| 62044| 0| 2| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 15| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 24| 0| 0| 0| 0| 0| 0| 0| 0| 4| 0| 0| 64932| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 24| 0| 0| 0| 0| 0| 0| 0| 0| 4| 0| 0| 64932| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 25| 0| 0| 0| 2| 2| 0| 0| 0| 4| 0| 0| 60712| 0| 2| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 14| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 1| 0| 1| 1| 0| 0| 0| 2| 0| 0| 62304| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 10| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 0| 0| 0| 0| 0| 2| 0| 0| 63758| 1| 1| 0| 0| 1| 0| 0| 0| 0| 0| 1| 1| 0| 0| 8| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 0| 0| 0| 0| 0| 1| 0| 0| 64967| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 1| 1| 0| 0| 0| 2| 0| 0| 58931| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 7| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 0| 0| 0| 0| 0| 2| 0| 0| 60836| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 6| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 1| 1| 0| 0| 0| 2| 0| 0| 62574| 1| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 11| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 0| 0| 0| 0| 0| 2| 0| 0| 64121| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 1| 1| 0| 0| 0| 1| 0| 0| 65615| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 10| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 1| 1| 0| 0| 0| 2| 0| 0| 60057| 1| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 11| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 23| 0| 0| 0| 1| 1| 0| 0| 0| 1| 0| 0| 62008| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 7| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 22| 0| 0| 0| 1| 1| 0| 0| 0| 1| 0| 0| 63651| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 7| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 22| 0| 0| 0| 1| 1| 0| 0| 0| 1| 0| 0| 63651| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 7| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 22| 0| 0| 0| 1| 1| 0| 0| 0| 1| 0| 0| 63651| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 7| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 25| 0| 0| 0| 2| 2| 0| 0| 0| 6| 0| 0| 61300| 0| 2| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 12| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 24| 0| 0| 0| 0| 0| 0| 0| 0| 2| 0| 0| 63087| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 4| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| --Boundary-01=_YMZ3BgNw2vwGpSi-- --nextPart11278716.QdpK7jeLio Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB3ZMbqtjaBHGZBeURAn36AJ0ZgrFrRrZ0ltYkf+9wcVopJboaBQCZAamg RbifMHm5Th0HwiWo6rysTbk= =TL7p -----END PGP SIGNATURE----- --nextPart11278716.QdpK7jeLio-- From tgraf@suug.ch Wed Jan 5 23:40:52 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 05 Jan 2005 23:40:57 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j067epYJ027199 for ; Wed, 5 Jan 2005 23:40:51 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 5E7B882; Thu, 6 Jan 2005 20:40:20 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 3E8C01C0EA; Thu, 6 Jan 2005 20:41:02 +0100 (CET) Date: Thu, 6 Jan 2005 20:41:02 +0100 From: Thomas Graf To: jamal Cc: netdev@oss.sgi.com Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier Message-ID: <20050106194102.GW26856@postel.suug.ch> References: <20050103125635.GB26856@postel.suug.ch> <20050104223612.GN26856@postel.suug.ch> <1104894728.1117.56.camel@jzny.localdomain> <20050105110048.GO26856@postel.suug.ch> <1104931991.1117.152.camel@jzny.localdomain> <20050105144514.GQ26856@postel.suug.ch> <1105019225.2312.7.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1105019225.2312.7.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13471 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1105019225.2312.7.camel@jzny.localdomain> 2005-01-06 08:47 > So the issue is whether its by ref or copy? Maybe thats what the flag is > for then. My view is that _everything_ for ematches should be by copy > for simplicty. If we do everything as ref we'll be allocating 4 byte chunks or we introduce a storage u32 which pollutes the structure. I don't like that given that the transfer of a single u32 is probably the most common for all those smallish ematches for a specific thing. For simplicity, you don't even notice if you're not aware of that it can be of help so I don't think we're losing any simplicity here. > Oh, yes;-> the one check in the datapath comes with a _huge_ advantage > even all that you had was old style matches because now you have embeded > logical operations which are more than just the old AND. But more > importantly you can use ematches as well to influence the existing u32 > tree path. Missunderstanding here, I meant is there any advantage in having multiple ematch trees (interleaved) over just making the existing u32 key an ematch and have the selector (with the hashing bits extracted) with one ematch tree. > What i am reading is you see more work involved. Is this correct? Well, given we can agree on moving the u32 key to an ematch and have the selector replaced with an ematch tree the following modifications would be required in u32: 1) extract hashing bits out of selector and move it into a new TLV. 2) Replace the foreach key match loop with an ematch_tree match 3) Fill out a pkt_info struct with ptr and off2 so we don't lose hashing capabilities 4) Add backward compat code. Old selector must be transformed into a flat ematch tree and the hashing bits must be extracted and stored in the new struct. > There is one issue which i think is the big source of our lack of sync: > You conclude people are gonna want to use the logical tree building > scheme you are putting in to put together matches and ematches. U32 > _already_ has a tree building scheme which is very very flexible. I know and I'm not gonna break it but rather replace the ANDed u32 key chains with an ematch tree. I'm fully aware of what u32 can do and I will in no way remove anything. To make it clear, I'm only gonna change about 10 lines in classify: for (i = n->sel.nkeys; i>0; i--, key++) { if ((*(u32*)(ptr+key->off+(off2&key->offmask))^key->val)&key->mask) { n = n->next; goto next_knode; } } will be replaced with: info.nexthdr = off2; info.ptr = ptr; if (!tcf_em_tree_match(..., &info)) { n = n->next; goto next_knode; } That's all, nothing else is changed. I think this is exactly the part were we're out of sync. The most difficult part is to do the Kconfig dependencies in a smart way ;-> > Again, u32 classifier is not just matches; the more interesting thing > is the layout of the rules that it can be taught to do. > I think the ematch which emulates the std u32 match is of course > valuable to have but it _doesnt_ deserve the same name. Stupid terms, em_u32.c is a replacement for the u32 key and it has exactly the same behaviour. I'll be happy to rename it but as you know I really suck at naming things ;-> > Thinking more about it; not sure why you would even bother managing > them. Everything runs at the same kernel privilege level. I am not sure > you want to have certain things that can only be built when recompiling > the kernel Well, we have exactly the same issues as with TLV types. I don't see why one would need to recompile things. The enumeration is for ematches included in the kernel tree. From Robert.Olsson@data.slu.se Thu Jan 6 00:29:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 00:29:33 -0800 (PST) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j068TRwg031753 for ; Thu, 6 Jan 2005 00:29:28 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.12.10/8.12.10) with ESMTP id j06KTEuA023204; Thu, 6 Jan 2005 21:29:14 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 1E3E4EC1A0; Thu, 6 Jan 2005 21:29:14 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16861.40858.80960.794144@robur.slu.se> Date: Thu, 6 Jan 2005 21:29:14 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson , Stephen Hemminger Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501061335.55104.jeremy.guthrie@berbee.com> References: <200501031455.26980.jeremy.guthrie@berbee.com> <200501060926.54588.jeremy.guthrie@berbee.com> <16861.32852.11187.131058@robur.slu.se> <200501061335.55104.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13472 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > > You only use CPU0 for packet processing. Also it seems you use the > > non-NAPI version of e1000. > The E1000 driver is the stock driver in 2.4.28. There is a kernel config option. Use Rx Polling (NAPI) > eth2 is TX only. We don't receive anything on it. This system should only > ever RX on eth3 and TX on eth2 as part of its function. Ok! So unidirectional traffic and CPU0 processes all skb's and passes them over to CPU1 which touches and frees them. You could try some other affinity setting later on but there are so many options depending what we want do. If we just want to compare 2.4/2.6 we can start out simple with setting affinity so only one CPU. Which is almost what you got. We reach all the complicated problems immediately... Now we pass skb's between the CPU's which release cache bouncing and makes slab rebalance it's pools. So using just one CPU is probably better... If we had incoming pkts on eth2 eventually we could have had any use for CPU1. Install NAPI-driver, set affinity so eth2/eth3 uses same CPU to start with. The stats info you sent was almost impossible to read. See if you can get only the rtstats. --ro From jeremy.guthrie@berbee.com Thu Jan 6 00:55:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 00:55:15 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j068t7Y8032633 for ; Thu, 6 Jan 2005 00:55:08 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Thu, 6 Jan 2005 14:54:55 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Thu, 6 Jan 2005 14:54:51 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson , Stephen Hemminger References: <200501031455.26980.jeremy.guthrie@berbee.com> <200501061335.55104.jeremy.guthrie@berbee.com> <16861.40858.80960.794144@robur.slu.se> In-Reply-To: <16861.40858.80960.794144@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1802544.rI78qs9h2M"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501061454.54595.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 06 Jan 2005 20:54:55.0490 (UTC) FILETIME=[F9CF3E20:01C4F431] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13473 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart1802544.rI78qs9h2M Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thursday 06 January 2005 02:29 pm, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > > You only use CPU0 for packet processing. Also it seems you use the > > > non-NAPI version of e1000. > > > > The E1000 driver is the stock driver in 2.4.28. > There is a kernel config option. Use Rx Polling (NAPI) I'm recompiling the module and will reload the module. > > eth2 is TX only. We don't receive anything on it. This system should > > only ever RX on eth3 and TX on eth2 as part of its function. > > Ok! So unidirectional traffic and CPU0 processes all skb's and passes th= em > over to CPU1 which touches and frees them. You could try some other > affinity setting later on but there are so many options depending what > we want do. If we just want to compare 2.4/2.6 we can start out simple > with setting affinity so only one CPU. Which is almost what you got. > We reach all the complicated problems immediately... Now we pass skb's > between the CPU's which release cache bouncing and makes slab rebalance > it's pools. So using just one CPU is probably better... If we had incoming > pkts on eth2 eventually we could have had any use for CPU1. > > Install NAPI-driver, set affinity so eth2/eth3 uses same CPU to start > with. I installed the NAPI driver and now I drop packets under 2.4.28. I tried=20 setting eth2/3 onto the same CPU. If both eth2/3 are on CPU0, I drop a lot= =20 of packets. If CPU0-eth2 & CPU1-eth3, I still drop packets, just not as=20 fast. I am going to try V2.6 w/o NAPI to see how much that helps. > The stats info you sent was almost impossible to read. See if you can get > only the rtstats. =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart1802544.rI78qs9h2M Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB3aWeqtjaBHGZBeURAgJLAJ9Ivcgnf/HcOFB4eMC9XGFGC1ck4wCfeYG/ MT8a07gBXWfgSiaudO8YcDs= =bxZV -----END PGP SIGNATURE----- --nextPart1802544.rI78qs9h2M-- From jeremy.guthrie@berbee.com Thu Jan 6 00:56:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 00:56:18 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j068u6M1000431 for ; Thu, 6 Jan 2005 00:56:10 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Thu, 6 Jan 2005 14:55:54 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Thu, 6 Jan 2005 14:55:50 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson , Stephen Hemminger References: <200501031455.26980.jeremy.guthrie@berbee.com> <200501061335.55104.jeremy.guthrie@berbee.com> <16861.40858.80960.794144@robur.slu.se> In-Reply-To: <16861.40858.80960.794144@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1938077.N2rRDRFtMu"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501061455.53590.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 06 Jan 2005 20:55:54.0225 (UTC) FILETIME=[1CD17E10:01C4F432] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13474 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart1938077.N2rRDRFtMu Content-Type: multipart/mixed; boundary="Boundary-01=_XXa3BZ690xkxonk" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_XXa3BZ690xkxonk Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline =46orgot the attachment. =20 On Thursday 06 January 2005 02:29 pm, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > > You only use CPU0 for packet processing. Also it seems you use the > > > non-NAPI version of e1000. > > > > The E1000 driver is the stock driver in 2.4.28. > > There is a kernel config option. Use Rx Polling (NAPI) > > > eth2 is TX only. We don't receive anything on it. This system should > > only ever RX on eth3 and TX on eth2 as part of its function. > > Ok! So unidirectional traffic and CPU0 processes all skb's and passes th= em > over to CPU1 which touches and frees them. You could try some other > affinity setting later on but there are so many options depending what > we want do. If we just want to compare 2.4/2.6 we can start out simple > with setting affinity so only one CPU. Which is almost what you got. > We reach all the complicated problems immediately... Now we pass skb's > between the CPU's which release cache bouncing and makes slab rebalance > it's pools. So using just one CPU is probably better... If we had incoming > pkts on eth2 eventually we could have had any use for CPU1. > > Install NAPI-driver, set affinity so eth2/eth3 uses same CPU to start > with. > > The stats info you sent was almost impossible to read. See if you can get > only the rtstats. > > --ro =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --Boundary-01=_XXa3BZ690xkxonk Content-Type: text/plain; charset="iso-8859-1"; name="results-2.4.28.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="results-2.4.28.txt" rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache| in_hit|in_slow_|in_slow_|in_no_ro| in_brd|in_marti|in_marti| out_hit|out_slow|out_slow|gc_total|gc_ignor|gc_goal_|gc_dst_o|in_hlist|out_hlis| | tot| mc| ute| | an_dst| an_src| | _tot| _mc| | ed| miss| verflow| _search|t_search| 9092| 21888| 0| 0| 1656| 0| 0| 9| 42| 0| 1836| 1833| 0| 0| 158622| 206| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 4| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 1| 1| 0| 0| 9| 0| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 1| 1| 0| 0| 9| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 2| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 3| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 3| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 3| 0| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 14| 0| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 14| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache| in_hit|in_slow_|in_slow_|in_no_ro| in_brd|in_marti|in_marti| out_hit|out_slow|out_slow|gc_total|gc_ignor|gc_goal_|gc_dst_o|in_hlist|out_hlis| | tot| mc| ute| | an_dst| an_src| | _tot| _mc| | ed| miss| verflow| _search|t_search| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 9| 0| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 9| 0| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 7| 0| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 7| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 4| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 4| 0| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 9| 0| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 9| 0| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 9| 0| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 9| 0| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 9| 0| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 9| 0| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 9| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 4| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 4| 0| 0| 2| 0| 0| 0| 0| 0| 0| 0| 0| 1| 1| 0| 0| 14| 0| 0| 2| 0| 0| 0| 0| 0| 0| 0| 0| 1| 1| 0| 0| 14| 0| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 7| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 3| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 3| 0| rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache|rt_cache| in_hit|in_slow_|in_slow_|in_no_ro| in_brd|in_marti|in_marti| out_hit|out_slow|out_slow|gc_total|gc_ignor|gc_goal_|gc_dst_o|in_hlist|out_hlis| | tot| mc| ute| | an_dst| an_src| | _tot| _mc| | ed| miss| verflow| _search|t_search| 1| 2| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 16| 0| 1| 2| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 16| 0| 1| 2| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 16| 0| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 8| 0| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 8| 0| 2| 2| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 16| 0| 1| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 8| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 6| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 6| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 6| 0| 2| 2| 0| 0| 1| 0| 0| 0| 0| 0| 1| 1| 0| 0| 24| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 2| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 1| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 4| 0| 0| 2| 0| 0| 1| 0| 0| 0| 0| 0| 1| 1| 0| 0| 16| 0| 0| 2| 0| 0| 1| 0| 0| 0| 0| 0| 1| 1| 0| 0| 16| 0| 2| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 4| 0| 2| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 4| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| 0| --Boundary-01=_XXa3BZ690xkxonk-- --nextPart1938077.N2rRDRFtMu Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB3aXZqtjaBHGZBeURAjLjAJkBi385GCSOhiNUVhsZwINncCXMKQCgkGNO KF1TaJcccd9gfXJxV+yZeXs= =A1iR -----END PGP SIGNATURE----- --nextPart1938077.N2rRDRFtMu-- From jeremy.guthrie@berbee.com Thu Jan 6 01:20:19 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 01:20:26 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j069KFka001612 for ; Thu, 6 Jan 2005 01:20:19 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Thu, 6 Jan 2005 15:20:02 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Thu, 6 Jan 2005 15:19:59 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson , Stephen Hemminger References: <200501031455.26980.jeremy.guthrie@berbee.com> <200501061335.55104.jeremy.guthrie@berbee.com> <16861.40858.80960.794144@robur.slu.se> In-Reply-To: <16861.40858.80960.794144@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1762425.JcF5JoSj3n"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501061520.02362.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 06 Jan 2005 21:20:02.0949 (UTC) FILETIME=[7C533B50:01C4F435] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13475 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart1762425.JcF5JoSj3n Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Pulling Rx Polling has kept V2.6 from dropping packets. argh?!?!?! I shou= ld=20 have caught that sooner. 8( Well, I have a window of opportunity here. = If=20 you want I can still provide a broken environment but that seems pointless= =20 while NAPI is not acting right... what is evident is that this will run=20 better till we start to bump up against the top of CPU0. On Thursday 06 January 2005 02:29 pm, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > > You only use CPU0 for packet processing. Also it seems you use the > > > non-NAPI version of e1000. > > > > The E1000 driver is the stock driver in 2.4.28. > > There is a kernel config option. Use Rx Polling (NAPI) > > > eth2 is TX only. We don't receive anything on it. This system should > > only ever RX on eth3 and TX on eth2 as part of its function. > > Ok! So unidirectional traffic and CPU0 processes all skb's and passes th= em > over to CPU1 which touches and frees them. You could try some other > affinity setting later on but there are so many options depending what > we want do. If we just want to compare 2.4/2.6 we can start out simple > with setting affinity so only one CPU. Which is almost what you got. > We reach all the complicated problems immediately... Now we pass skb's > between the CPU's which release cache bouncing and makes slab rebalance > it's pools. So using just one CPU is probably better... If we had incoming > pkts on eth2 eventually we could have had any use for CPU1. > > Install NAPI-driver, set affinity so eth2/eth3 uses same CPU to start > with. > > The stats info you sent was almost impossible to read. See if you can get > only the rtstats. > > --ro =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart1762425.JcF5JoSj3n Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB3auCqtjaBHGZBeURAjvkAJ45z7mmyPo5uy7j5n6AUuz9mom0ZwCfabzF 9epO/lWTp3KOLc5IGxztcJU= =c04g -----END PGP SIGNATURE----- --nextPart1762425.JcF5JoSj3n-- From Robert.Olsson@data.slu.se Thu Jan 6 01:36:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 01:36:26 -0800 (PST) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j069aJ0b002457 for ; Thu, 6 Jan 2005 01:36:19 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.12.10/8.12.10) with ESMTP id j06La6uA016530; Thu, 6 Jan 2005 22:36:06 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 014E9EC1A0; Thu, 6 Jan 2005 22:36:06 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16861.44870.968343.578778@robur.slu.se> Date: Thu, 6 Jan 2005 22:36:06 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson , Stephen Hemminger Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501061520.02362.jeremy.guthrie@berbee.com> References: <200501031455.26980.jeremy.guthrie@berbee.com> <200501061335.55104.jeremy.guthrie@berbee.com> <16861.40858.80960.794144@robur.slu.se> <200501061520.02362.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13476 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > Pulling Rx Polling has kept V2.6 from dropping packets. argh?!?!?! Thats fine... > I should have caught that sooner. 8( Well, I have a window of opportunity > here. If you want I can still provide a broken environment but that seems > pointless while NAPI is not acting right... what is evident is that this > will run better till we start to bump up against the top of CPU0. I don't follow... The stats didn't show any numbers so we don't know your load. --ro From jeremy.guthrie@berbee.com Thu Jan 6 01:46:45 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 01:46:52 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j069kjVq003202 for ; Thu, 6 Jan 2005 01:46:45 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Thu, 6 Jan 2005 15:46:32 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Thu, 6 Jan 2005 15:46:29 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson , Stephen Hemminger References: <200501031455.26980.jeremy.guthrie@berbee.com> <200501061520.02362.jeremy.guthrie@berbee.com> <16861.44870.968343.578778@robur.slu.se> In-Reply-To: <16861.44870.968343.578778@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart6041310.sTJrLWFtUM"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501061546.32116.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 06 Jan 2005 21:46:32.0861 (UTC) FILETIME=[2FFC8CD0:01C4F439] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13477 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart6041310.sTJrLWFtUM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thursday 06 January 2005 03:36 pm, Robert Olsson wrote: > > I should have caught that sooner. 8( Well, I have a window of > > opportunity here. If you want I can still provide a broken environment > > but that seems pointless while NAPI is not acting right... what is > > evident is that this will run better till we start to bump up against > > the top of CPU0. > > I don't follow... Technically by turning off NAPI, I have 'solved' my short term packet loss= =20 problem. However I can still provide you a window to go through further troubleshoot= ing=20 if it is beneficial. > The stats didn't show any numbers so we don't know your load. Are you referring to the # of entries in the rt_cache table? =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart6041310.sTJrLWFtUM Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB3bG4qtjaBHGZBeURAlh6AKCGTkaEa8sKvtg4k1Un3T474YTG/ACeLIZb 2eeMHU7sz23LBGz7Gv/NpKA= =cn/n -----END PGP SIGNATURE----- --nextPart6041310.sTJrLWFtUM-- From jketreno@linux.intel.com Thu Jan 6 02:11:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 02:11:12 -0800 (PST) Received: from orsfmr002.jf.intel.com (fmr17.intel.com [134.134.136.16]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06AB3gZ010810 for ; Thu, 6 Jan 2005 02:11:07 -0800 Received: from talaria.jf.intel.com (talaria.jf.intel.com [10.7.209.7]) by orsfmr002.jf.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j06MAnXD003597; Thu, 6 Jan 2005 22:10:49 GMT Received: from [127.0.0.1] (hdlrvguser-533.hd.intel.com [10.127.54.40]) by talaria.jf.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.11 2004/07/29 22:51:53 root Exp $) with ESMTP id j06M2KRY031348; Thu, 6 Jan 2005 22:02:24 GMT Message-ID: <41DD630A.1030604@linux.intel.com> Date: Thu, 06 Jan 2005 10:10:50 -0600 From: James Ketrenos User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041207 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jeff Garzik CC: Netdev Subject: Re: Steps for netdev-2.6 inclusion? References: <41AE7143.80505@linux.intel.com> <41C88183.3020906@pobox.com> In-Reply-To: <41C88183.3020906@pobox.com> X-Enigmail-Version: 0.86.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13478 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jketreno@linux.intel.com Precedence: bulk X-list: netdev Jeff Garzik wrote: > James Ketrenos wrote: > >> >> Ok, its been a long time coming, but it appears the ipw* wireless >> drivers are to the point where being more proactive at getting them >> into the kernel is appropriate (at least based on the frequency of >> emails I'm getting of 'why isn't this in mainline?') >> >> So, what would be the set of steps required to get a version in the >> queue for inclusion? > > > Any updates? Where do we stand with this? Sorry -- we had some fires to put out, and then Christmas kicked in :) We're rolling in a couple fixes into the 2200 driver this week for ad-hoc mode and will then send out the patches to this list. Thanks, James > > I would suggest sending a patch for each driver, diff'd against -mm > (which auto-includes my netdev-2.6 and wireless-2.6 queues). > > Jeff > > > From Robert.Olsson@data.slu.se Thu Jan 6 02:11:18 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 02:11:23 -0800 (PST) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06ABHkJ010853 for ; Thu, 6 Jan 2005 02:11:18 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.12.10/8.12.10) with ESMTP id j06MB5uA029066; Thu, 6 Jan 2005 23:11:05 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 8B1F8EC1A0; Thu, 6 Jan 2005 23:11:05 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16861.46969.536236.11355@robur.slu.se> Date: Thu, 6 Jan 2005 23:11:05 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson , Stephen Hemminger Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501061546.32116.jeremy.guthrie@berbee.com> References: <200501031455.26980.jeremy.guthrie@berbee.com> <200501061520.02362.jeremy.guthrie@berbee.com> <16861.44870.968343.578778@robur.slu.se> <200501061546.32116.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13479 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > > I don't follow... > Technically by turning off NAPI, I have 'solved' my short term packet loss > problem. You need NAPI of course just wait until your packet load increases just a little bit... I saw drops in your 2.4 /proc/net/softnet_stat which indicates you are close to your system performance. With NAPI you keep up your system system performance regardless of incoming load. The e1000 driver has some bugs in "your setup" as it enables irq's when there is only RX and no TX and should have irq's disabled. I sent patch to intel. --ro From jeremy.guthrie@berbee.com Thu Jan 6 02:18:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 02:18:44 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06AIbIo011836 for ; Thu, 6 Jan 2005 02:18:37 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Thu, 6 Jan 2005 16:18:25 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Thu, 6 Jan 2005 16:18:21 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson , Stephen Hemminger References: <200501031455.26980.jeremy.guthrie@berbee.com> <200501061546.32116.jeremy.guthrie@berbee.com> <16861.46969.536236.11355@robur.slu.se> In-Reply-To: <16861.46969.536236.11355@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1568023.hnZFYY8YNB"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501061618.24465.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 06 Jan 2005 22:18:25.0053 (UTC) FILETIME=[A3BDE4D0:01C4F43D] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13480 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart1568023.hnZFYY8YNB Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thursday 06 January 2005 04:11 pm, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > > I don't follow... > > > > Technically by turning off NAPI, I have 'solved' my short term packet > > loss problem. > > You need NAPI of course just wait until your packet load increases just > a little bit...=20 I agree. Running mpstat now shows that even w/o packet drops, I'm running= =20 2-5% free CPU. > I saw drops in your 2.4 /proc/net/softnet_stat which=20 > indicates you are close to your system performance.=20 Should those drops show up in RX drops in ifconfig? > With NAPI you keep=20 > up your system system performance regardless of incoming load. You mentioned before that " The stats didn't show any numbers so we don't k= now=20 your load." Was there a command you wanted me to re-run? > The e1000 driver has some bugs in "your setup" as it enables irq's when > there is only RX and no TX and should have irq's disabled. I sent patch > to intel. > > --ro =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart1568023.hnZFYY8YNB Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB3bkwqtjaBHGZBeURAhwtAJ0dxJdldtO4/T6CJ8GUHnZeyCD8MwCdE0qt FNGzOiQeLVhCPgFf47mSIvM= =JJXF -----END PGP SIGNATURE----- --nextPart1568023.hnZFYY8YNB-- From Robert.Olsson@data.slu.se Thu Jan 6 02:36:22 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 02:36:26 -0800 (PST) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06AaGZl012707 for ; Thu, 6 Jan 2005 02:36:21 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.12.10/8.12.10) with ESMTP id j06MZxuA007354; Thu, 6 Jan 2005 23:35:59 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id C2E30EC1A0; Thu, 6 Jan 2005 23:35:59 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16861.48463.770166.352726@robur.slu.se> Date: Thu, 6 Jan 2005 23:35:59 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson , Stephen Hemminger Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501061618.24465.jeremy.guthrie@berbee.com> References: <200501031455.26980.jeremy.guthrie@berbee.com> <200501061546.32116.jeremy.guthrie@berbee.com> <16861.46969.536236.11355@robur.slu.se> <200501061618.24465.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13481 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > You mentioned before that " The stats didn't show any numbers so we don't > know your load." Was there a command you wanted me to re-run? rtstat should show the routing/packet load. From a systems like yours 2*933 MHz PIII in production for tens of thoundans of users many filter and full BGP routing. Current (late here) use. ifstat2 eth* RX -------------------------- TX ------------------------- eth0 272.8 M bit/s 51 k pps 350.7 M bit/s 51 k pps eth1 371.9 M bit/s 55 k pps 293.6 M bit/s 55 k pps eth2 6.7 M bit/s 1348 pps 3.0 M bit/s 991 pps eth3 472 bit/s 0 pps 600 bit/s 0 pps rtstat size IN: hit tot mc no_rt bcast madst masrc OUT: hit tot mc GC: tot ignored goal_miss ovrf HASH: in_search out_search 21007 114060 748 0 5 0 0 0 11 5 0 0 0 0 0 58280 4 22683 112556 827 0 6 0 0 0 5 5 0 0 0 0 0 60841 7 24230 111083 765 0 4 0 0 0 13 4 0 0 0 0 0 66628 7 Around 110 kpps hitting warm cache entries and ~800 new lookups/sec. I was expecting so see something similar from your system. FYI. cat /proc/net/softnet_stat 9ba490f3 00000000 01281572 00000000 00000000 00000000 00000000 00000000 002562c2 9939268d 00000000 010e42e9 00000000 00000000 00000000 00000000 00000000 0028fe72 Good Night. --ro From jgarzik@pobox.com Thu Jan 6 02:45:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 02:45:38 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06AjQEk015228 for ; Thu, 6 Jan 2005 02:45:31 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CmgNW-0006Ot-Ej; Thu, 06 Jan 2005 22:45:14 +0000 Message-ID: <41DDBF72.4000406@pobox.com> Date: Thu, 06 Jan 2005 17:45:06 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Don Fry CC: akpm@osdl.org, davem@davemloft.net, netdev@oss.sgi.com, agx@sigxcpu.org, lars@segv.dk Subject: Re: [patch 03/10] pcnet32: 79c976 with fiber optic fix References: <200501050559.j055xb614676@mail.osdl.org> In-Reply-To: <200501050559.j055xb614676@mail.osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13482 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev akpm@osdl.org wrote: > From: Guido Guenther , > Lars Munch > > Skip PHY selection on Allied Telesyn 2701FX, it looses the link otherwise. > Fix up the AT 2701 as well. > > Signed-Off-By: Guido Guenther > Signed-off-by: Andrew Morton Don, any comments? Jeff From brazilnut@us.ibm.com Thu Jan 6 03:20:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 03:20:55 -0800 (PST) Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.131]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06BKgqA017153 for ; Thu, 6 Jan 2005 03:20:48 -0800 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e33.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j06NKTCO566962 for ; Thu, 6 Jan 2005 18:20:29 -0500 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j06NKS4J307584 for ; Thu, 6 Jan 2005 16:20:28 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j06NKREs014909 for ; Thu, 6 Jan 2005 16:20:28 -0700 Received: from DYN319661.beaverton.ibm.com (DYN319661.beaverton.ibm.com [9.47.22.144]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j06NKRvS014893; Thu, 6 Jan 2005 16:20:27 -0700 Received: by DYN319661.beaverton.ibm.com (Postfix, from userid 1000) id B546B22942E; Thu, 6 Jan 2005 15:19:56 -0800 (PST) Date: Thu, 6 Jan 2005 15:19:56 -0800 From: Don Fry To: Jeff Garzik Cc: akpm@osdl.org, davem@davemloft.net, netdev@oss.sgi.com, agx@sigxcpu.org, lars@segv.dk Subject: Re: [patch 03/10] pcnet32: 79c976 with fiber optic fix Message-ID: <20050106231956.GA22130@us.ibm.com> References: <200501050559.j055xb614676@mail.osdl.org> <41DDBF72.4000406@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41DDBF72.4000406@pobox.com> User-Agent: Mutt/1.5.6i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13483 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brazilnut@us.ibm.com Precedence: bulk X-list: netdev Sorry for the delay, I had a nice vacation and am a little slow getting through the email. Three comments: 1) I recently obtained a 2701FX card but I haven't installed it in a system yet, but I will today. 2) Thomas Bogendorfer was working on a patch to support a board with both a fiber and copper connection on the same board. He is still cooking that change, but it changes code in the same place, but in a different way. 3) I will send another email, later today or tomorrow morning, after I have been able to do a little testing of the patch. On Thu, Jan 06, 2005 at 05:45:06PM -0500, Jeff Garzik wrote: > akpm@osdl.org wrote: > >From: Guido Guenther , > > Lars Munch > > > >Skip PHY selection on Allied Telesyn 2701FX, it looses the link otherwise. > >Fix up the AT 2701 as well. > > > >Signed-Off-By: Guido Guenther > >Signed-off-by: Andrew Morton > > Don, any comments? > > Jeff -- Don Fry brazilnut@us.ibm.com From davem@davemloft.net Thu Jan 6 03:23:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 03:24:01 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06BNokw017665 for ; Thu, 6 Jan 2005 03:23:55 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CmguM-0002NA-00; Thu, 06 Jan 2005 15:19:10 -0800 Date: Thu, 6 Jan 2005 15:19:10 -0800 From: "David S. Miller" To: Peter Chubb Cc: peterc@gelato.unsw.edu.au, netdev@oss.sgi.com Subject: Re: TG3 fix for slow switches (Was: TG3 driver failure on HP 16-way) Message-Id: <20050106151910.4d51673e.davem@davemloft.net> In-Reply-To: <16839.30796.413939.333935@wombat.chubb.wattle.id.au> References: <16839.27239.264551.415058@berry.gelato.unsw.EDU.AU> <20041220161552.2b88aa3d.davem@davemloft.net> <16839.30796.413939.333935@wombat.chubb.wattle.id.au> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13484 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Peter, let me know if this patch solves your PHY link up problem too. # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/06 14:53:55-08:00 davem@nuts.davemloft.net # [TG3]: Return 0 when PHY read times out, not all-ones. # # Noticed by Peter Chubb. # # Signed-off-by: David S. Miller # # drivers/net/tg3.c # 2005/01/06 14:53:07-08:00 davem@nuts.davemloft.net +1 -1 # [TG3]: Return 0 when PHY read times out, not all-ones. # diff -Nru a/drivers/net/tg3.c b/drivers/net/tg3.c --- a/drivers/net/tg3.c 2005-01-06 14:54:21 -08:00 +++ b/drivers/net/tg3.c 2005-01-06 14:54:21 -08:00 @@ -485,7 +485,7 @@ udelay(80); } - *val = 0xffffffff; + *val = 0x0; frame_val = ((PHY_ADDR << MI_COM_PHY_ADDR_SHIFT) & MI_COM_PHY_ADDR_MASK); From juhl-lkml@dif.dk Thu Jan 6 03:24:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 03:24:20 -0800 (PST) Received: from mail.dif.dk (mail.dif.dk [193.138.115.101]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06BO9Jx017694 for ; Thu, 6 Jan 2005 03:24:10 -0800 Received: from localhost (localhost [127.0.0.1]) by mail.dif.dk (Postfix) with ESMTP id 2E3C5FFC6E for ; Fri, 7 Jan 2005 00:28:11 +0100 (CET) Received: from mail.dif.dk ([127.0.0.1]) by localhost (saerimmer [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 27879-05 for ; Fri, 7 Jan 2005 00:28:10 +0100 (CET) Received: from diftmgw2.backbone.dif.dk (diftmgw2.backbone.dif.dk [10.227.136.246]) by mail.dif.dk (Postfix) with ESMTP id 1ACACFFC78 for ; Fri, 7 Jan 2005 00:28:10 +0100 (CET) Received: from DIFPST1A.backbone.dif.dk ([10.227.136.220]) by diftmgw2.backbone.dif.dk with InterScan Messaging Security Suite; Fri, 07 Jan 2005 00:23:21 +0100 Received: from [172.16.2.11] (10.227.136.29 [10.227.136.29]) by DIFPST1A.backbone.dif.dk with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2657.72) id CHBN3HT1; Fri, 7 Jan 2005 00:23:54 +0100 Date: Fri, 7 Jan 2005 00:35:24 +0100 (CET) From: Jesper Juhl To: linux-kernel Cc: linux-net@vger.kernel.org, netdev@oss.sgi.com, Jorge Cwik , Arnt Gulbrandsen Subject: [patch] net: get rid of redundant access_ok() call in checksum calculation. Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: by amavisd-new at dif.dk X-Virus-Status: Clean X-archive-position: 13485 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: juhl-lkml@dif.dk Precedence: bulk X-list: netdev Hi, in include/net/checksum.h::csum_and_copy_to_user it would seem that the access_ok() call before attempting to call copy_to_user() is redundant since copy_to_user() calls access_ok() internally. If that is indeed the case then please consider applying the patch below (if that access_ok() does make sense I'd apreciate to be told why). Signed-off-by: Jesper Juhl diff -up linux-2.6.10-bk9-orig/include/net/checksum.h linux-2.6.10-bk9/include/net/checksum.h --- linux-2.6.10-bk9-orig/include/net/checksum.h 2004-12-24 22:34:26.000000000 +0100 +++ linux-2.6.10-bk9/include/net/checksum.h 2005-01-07 00:27:05.000000000 +0100 @@ -46,10 +46,9 @@ static __inline__ unsigned int csum_and_ { sum = csum_partial(src, len, sum); - if (access_ok(VERIFY_WRITE, dst, len)) { - if (copy_to_user(dst, src, len) == 0) - return sum; - } + if (copy_to_user(dst, src, len) == 0) + return sum; + if (len) *err_ptr = -EFAULT; From nacc@us.ibm.com Thu Jan 6 03:34:38 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 03:34:44 -0800 (PST) Received: from e1.ny.us.ibm.com (e1.ny.us.ibm.com [32.97.182.141]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06BYXW0018758 for ; Thu, 6 Jan 2005 03:34:38 -0800 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e1.ny.us.ibm.com (8.12.10/8.12.10) with ESMTP id j06NYLvk014683 for ; Thu, 6 Jan 2005 18:34:21 -0500 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay04.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j06NYL8m263758 for ; Thu, 6 Jan 2005 18:34:21 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j06NYLHd001357 for ; Thu, 6 Jan 2005 18:34:21 -0500 Received: from joust (joust.beaverton.ibm.com [9.47.17.70]) by d01av02.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j06NYKqA001338; Thu, 6 Jan 2005 18:34:21 -0500 Received: by joust (Postfix, from userid 1000) id 015094F966; Thu, 6 Jan 2005 15:34:19 -0800 (PST) Date: Thu, 6 Jan 2005 15:34:19 -0800 From: Nishanth Aravamudan To: kernel-janitors@lists.osdl.org Cc: linux-net@vger.kernel.org, netdev@oss.sgi.com Subject: [PATCH 3/28] net/airo: replace schedule_timeout() with msleep()/ssleep() Message-ID: <20050106233419.GD3055@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13486 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nacc@us.ibm.com Precedence: bulk X-list: netdev Hi, Description: Use msleep()/ssleep() instead of schedule_timeout() to guarantee the task delays as expected. Signed-off-by: Nishanth Aravamudan --- 2.6.10-v/drivers/net/wireless/airo.c 2004-12-24 13:33:59.000000000 -0800 +++ 2.6.10/drivers/net/wireless/airo.c 2005-01-04 14:57:49.000000000 -0800 @@ -1699,9 +1699,8 @@ static int readBSSListRid(struct airo_in issuecommand(ai, &cmd, &rsp); up(&ai->sem); /* Let the command take effect */ - set_current_state (TASK_INTERRUPTIBLE); ai->task = current; - schedule_timeout (3*HZ); + ssleep(3); ai->task = NULL; } rc = PC4500_readrid(ai, first ? RID_BSSLISTFIRST : RID_BSSLISTNEXT, @@ -2686,11 +2685,9 @@ int reset_card( struct net_device *dev , return -1; waitbusy (ai); OUT4500(ai,COMMAND,CMD_SOFTRESET); - set_current_state (TASK_UNINTERRUPTIBLE); - schedule_timeout (HZ/5); + msleep(200); waitbusy (ai); - set_current_state (TASK_UNINTERRUPTIBLE); - schedule_timeout (HZ/5); + msleep(200); if (lock) up(&ai->sem); return 0; @@ -5518,12 +5515,12 @@ static int airo_pci_resume(struct pci_de } else { OUT4500(ai, EVACK, EV_AWAKEN); OUT4500(ai, EVACK, EV_AWAKEN); - schedule_timeout(HZ/10); + msleep(100); } set_bit (FLAG_COMMIT, &ai->flags); disable_MAC(ai, 0); - schedule_timeout (HZ/5); + msleep(200); if (ai->SSID) { writeSsidRid(ai, ai->SSID, 0); kfree(ai->SSID); @@ -7472,8 +7469,7 @@ int cmdreset(struct airo_info *ai) { OUT4500(ai,COMMAND,CMD_SOFTRESET); - set_current_state (TASK_UNINTERRUPTIBLE); - schedule_timeout (HZ); /* WAS 600 12/7/00 */ + ssleep(1); /* WAS 600 12/7/00 */ if(!waitbusy (ai)){ printk(KERN_INFO "Waitbusy hang AFTER RESET\n"); @@ -7500,8 +7496,7 @@ int setflashmode (struct airo_info *ai) OUT4500(ai, SWS3, FLASH_COMMAND); OUT4500(ai, COMMAND,0); } - set_current_state (TASK_UNINTERRUPTIBLE); - schedule_timeout (HZ/2); /* 500ms delay */ + msleep(500); /* 500ms delay */ if(!waitbusy(ai)) { clear_bit (FLAG_FLASHING, &ai->flags); @@ -7611,8 +7606,7 @@ int flashputbuf(struct airo_info *ai){ int flashrestart(struct airo_info *ai,struct net_device *dev){ int i,status; - set_current_state (TASK_UNINTERRUPTIBLE); - schedule_timeout (HZ); /* Added 12/7/00 */ + ssleep(1); /* Added 12/7/00 */ clear_bit (FLAG_FLASHING, &ai->flags); if (test_bit(FLAG_MPI, &ai->flags)) { status = mpi_init_descriptors(ai); @@ -7627,8 +7621,7 @@ int flashrestart(struct airo_info *ai,st ( ai, 2312, i >= MAX_FIDS / 2 ); } - set_current_state (TASK_UNINTERRUPTIBLE); - schedule_timeout (HZ); /* Added 12/7/00 */ + ssleep(1); /* Added 12/7/00 */ return status; } #endif /* CISCO_EXT */ From davem@davemloft.net Thu Jan 6 03:35:29 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 03:35:34 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06BZS12019084 for ; Thu, 6 Jan 2005 03:35:29 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cmh5f-0002P9-00; Thu, 06 Jan 2005 15:30:51 -0800 Date: Thu, 6 Jan 2005 15:30:51 -0800 From: "David S. Miller" To: hadi@znyx.com Cc: netdev@oss.sgi.com Subject: Re: 2.4.x patchlet Message-Id: <20050106153051.7d0fb873.davem@davemloft.net> In-Reply-To: <1104242685.1090.97.camel@jzny.localdomain> References: <1104242685.1090.97.camel@jzny.localdomain> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13487 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On 28 Dec 2004 09:04:45 -0500 Jamal Hadi Salim wrote: > Removes annoying compile of newer tools when done on 2.4.x Applied, thanks Jamal. From jgarzik@pobox.com Thu Jan 6 03:36:06 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 03:36:11 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06Ba1O7019491 for ; Thu, 6 Jan 2005 03:36:05 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CmhAX-0007bG-8B; Thu, 06 Jan 2005 23:35:53 +0000 Message-ID: <41DDCB54.2080101@pobox.com> Date: Thu, 06 Jan 2005 18:35:48 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniele Venzano CC: NetDev Subject: Re: [PATCH 1/5] sis900 debugging and revision code References: <20041212121852.GA16325@gateway.milesteg.arr> <20041212123031.GB16325@gateway.milesteg.arr> In-Reply-To: <20041212123031.GB16325@gateway.milesteg.arr> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13488 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Patches 1, 2, and 5 are OK. For the other two patches, I don't want to deviate from the style that has been standard for years: dev->name prefix, followed by message. It may make greps easier for you, but it becomes a non-standard style and may make existing sysadmin scripts out in the field. Please resend series without the PFX-where-devname-is-known changes. Jeff From nacc@us.ibm.com Thu Jan 6 03:41:52 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 03:41:57 -0800 (PST) Received: from e1.ny.us.ibm.com (e1.ny.us.ibm.com [32.97.182.141]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06Bfmbj020208 for ; Thu, 6 Jan 2005 03:41:52 -0800 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e1.ny.us.ibm.com (8.12.10/8.12.10) with ESMTP id j06NfZvk028775 for ; Thu, 6 Jan 2005 18:41:35 -0500 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay04.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j06NfZ8m202858 for ; Thu, 6 Jan 2005 18:41:35 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j06NfZJb014333 for ; Thu, 6 Jan 2005 18:41:35 -0500 Received: from joust (joust.beaverton.ibm.com [9.47.17.70]) by d01av02.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j06NfZoO014328; Thu, 6 Jan 2005 18:41:35 -0500 Received: by joust (Postfix, from userid 1000) id 80D794F966; Thu, 6 Jan 2005 15:41:34 -0800 (PST) Date: Thu, 6 Jan 2005 15:41:34 -0800 From: Nishanth Aravamudan To: kernel-janitors@lists.osdl.org Cc: linux-net@vger.kernel.org, netdev@oss.sgi.com Subject: [PATCH 4/28] net/cosa: replace schedule_timeout() with msleep() Message-ID: <20050106234134.GE3055@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13489 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nacc@us.ibm.com Precedence: bulk X-list: netdev Hi, Description: Use msleep() instead of schedule_timeout() to guarantee the task delays as expected. Also uses the set_current_state() macro instead of direct assignment in a pair of spots. I am still concerned about those sleeps, as TASK_INTERRUPTIBLE() is used without any checking for signals. Hence I used msleep() for the longer delay. Perhaps the 30 jiffy delay has not been updated for the larger HZ values and thus could be changed to msleep(300). Signed-off-by: Nishanth Aravamudan --- 2.6.10-v/drivers/net/wan/cosa.c 2004-12-24 13:33:49.000000000 -0800 +++ 2.6.10/drivers/net/wan/cosa.c 2005-01-04 14:57:49.000000000 -0800 @@ -543,7 +543,7 @@ static int cosa_probe(int base, int irq, * FIXME: When this code is not used as module, we should * probably call udelay() instead of the interruptible sleep. */ - current->state = TASK_INTERRUPTIBLE; + set_current_state(TASK_INTERRUPTIBLE); cosa_putstatus(cosa, SR_TX_INT_ENA); schedule_timeout(30); irq = probe_irq_off(irqs); @@ -1564,8 +1564,7 @@ static int cosa_reset_and_read_id(struct cosa_getdata8(cosa); cosa_putstatus(cosa, SR_RST); #ifdef MODULE - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(HZ/2); + msleep(500); #else udelay(5*100000); #endif @@ -1618,7 +1617,7 @@ static int get_wait_data(struct cosa_dat return r; } /* sleep if not ready to read */ - current->state = TASK_INTERRUPTIBLE; + set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(1); } printk(KERN_INFO "cosa: timeout in get_wait_data (status 0x%x)\n", From davem@davemloft.net Thu Jan 6 03:51:06 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 03:51:11 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06Box6c020812 for ; Thu, 6 Jan 2005 03:51:06 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CmhKc-0002Ra-00; Thu, 06 Jan 2005 15:46:18 -0800 Date: Thu, 6 Jan 2005 15:46:18 -0800 From: "David S. Miller" To: Arnaldo Carvalho de Melo Cc: netdev@oss.sgi.com Subject: Re: [PATCH][TCP] merge tcp_sock with tcp_opt Message-Id: <20050106154618.12d7b7d1.davem@davemloft.net> In-Reply-To: <41D1A876.9050609@conectiva.com.br> References: <41D1A876.9050609@conectiva.com.br> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13490 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Tue, 28 Dec 2004 16:39:50 -0200 Arnaldo Carvalho de Melo wrote: > Here is the tcp_sock one, please consider pulling from: > > bk://kernel.bkbits.net/acme/connection_sock-2.6 Pulled, thanks Arnaldo. From jgarzik@pobox.com Thu Jan 6 03:52:00 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 03:52:05 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06Bq0fd021136 for ; Thu, 6 Jan 2005 03:52:00 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CmhQ0-0007y5-4q; Thu, 06 Jan 2005 23:51:52 +0000 Message-ID: <41DDCF00.6070405@pobox.com> Date: Thu, 06 Jan 2005 18:51:28 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" , Netdev Subject: BK-current build breakage Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13491 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev net/built-in.o(.text+0x25858): In function `tcf_ipt_init': net/sched/ipt.c:63: undefined reference to `__ipt_find_target_lock' net/built-in.o(.text+0x25873):net/sched/ipt.c:78: undefined reference to `__ipt_mutex_up' make: *** [.tmp_vmlinux1] Error 1 From tgraf@suug.ch Thu Jan 6 04:10:43 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 04:10:56 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06CAfdG022932 for ; Thu, 6 Jan 2005 04:10:42 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id D234882; Fri, 7 Jan 2005 01:10:11 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 6C4E41C0EA; Fri, 7 Jan 2005 01:10:53 +0100 (CET) Date: Fri, 7 Jan 2005 01:10:53 +0100 From: Thomas Graf To: Jeff Garzik Cc: "David S. Miller" , Netdev Subject: Re: BK-current build breakage Message-ID: <20050107001053.GY26856@postel.suug.ch> References: <41DDCF00.6070405@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41DDCF00.6070405@pobox.com> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13492 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * Jeff Garzik <41DDCF00.6070405@pobox.com> 2005-01-06 18:51 > net/built-in.o(.text+0x25858): In function `tcf_ipt_init': > net/sched/ipt.c:63: undefined reference to `__ipt_find_target_lock' > net/built-in.o(.text+0x25873):net/sched/ipt.c:78: undefined reference to > `__ipt_mutex_up' > make: *** [.tmp_vmlinux1] Error 1 A fix for this is in the queue: On Wed, 2005-01-05 at 19:12 +0100, Thomas Graf wrote: > * Rusty Russell <1104896029.20582.72.camel@localhost.localdomain> 2005-01-05 14:33 > > Name: Clean up the kmod handling code in iptables.c > > Status: Tested under nfsim > > > > 4) Remove __ipt_mutex_up() and __ipt_find_target_lock() which weren't > > used (even in patch-o-matic AFAICT). > > Those are used by ipt action (net/sched/ipt.c). > > Readds __ipt_find_target_lock() and __ipt_mutex_up() and adapts ipt.c > to correctly use it. module must be given back properly upon cleanup. > removes the comments demanding for proper module refcnt since > find_target_lock() takes care of this now. OK, thanks. You missed a module_put in the check_entry-failed error path though. I looked harder at this, and I prefer this patch: Name: Restore net/sched/ipt.c After iptables Kmod Cleanup Status: Tested under nfsim Signed-off-by: Rusty Russell Thomas Graf points out that I broke net/sched/ipt.c when I removed __ipt_find_target_lock. In fact, those routines don't need to keep the lock held, so we can simplify them, and expose an interface (ipt_find_target) which does module loading correctly for net/sched/ipt.c. As Thomas points out, this also gets the module refcounts right. Index: linux-2.6.10-bk8-Netfilter/net/ipv4/netfilter/ip_tables.c =================================================================== --- linux-2.6.10-bk8-Netfilter.orig/net/ipv4/netfilter/ip_tables.c 2005-01-06 09:12:01.000000000 +1100 +++ linux-2.6.10-bk8-Netfilter/net/ipv4/netfilter/ip_tables.c 2005-01-06 09:49:10.000000000 +1100 @@ -430,62 +430,63 @@ return NULL; } -/* Find match, grabs mutex & ref. Returns ERR_PTR() on error. */ -static inline struct ipt_match *find_match_lock(const char *name, u8 revision) +/* Find match, grabs ref. Returns ERR_PTR() on error. */ +static inline struct ipt_match *find_match(const char *name, u8 revision) { struct ipt_match *m; - int found = 0; + int err = 0; if (down_interruptible(&ipt_mutex) != 0) return ERR_PTR(-EINTR); list_for_each_entry(m, &ipt_match, list) { if (strcmp(m->name, name) == 0) { - found = 1; if (m->revision == revision) { - if (!try_module_get(m->me)) - found = 0; - else + if (try_module_get(m->me)) { + up(&ipt_mutex); return m; - } + } + } else + err = -EPROTOTYPE; /* Found something. */ } } up(&ipt_mutex); - - /* Not found at all? NULL so try_then_request_module loads module. */ - if (!found) - return NULL; - - return ERR_PTR(-EPROTOTYPE); + return ERR_PTR(err); } -/* Find target, grabs mutex & ref. Returns ERR_PTR() on error. */ -static inline struct ipt_target *find_target_lock(const char *name, u8 revision) +/* Find target, grabs ref. Returns ERR_PTR() on error. */ +static inline struct ipt_target *find_target(const char *name, u8 revision) { struct ipt_target *t; - int found = 0; + int err = 0; if (down_interruptible(&ipt_mutex) != 0) return ERR_PTR(-EINTR); list_for_each_entry(t, &ipt_target, list) { if (strcmp(t->name, name) == 0) { - found = 1; if (t->revision == revision) { - if (!try_module_get(t->me)) - found = 0; - else + if (try_module_get(t->me)) { + up(&ipt_mutex); return t; - } + } + } else + err = -EPROTOTYPE; /* Found something. */ } } up(&ipt_mutex); + return ERR_PTR(err); +} - /* Not found at all? NULL so try_then_request_module loads module. */ - if (!found) - return NULL; +struct ipt_target *ipt_find_target(const char *name, u8 revision) +{ + struct ipt_target *target; - return ERR_PTR(-EPROTOTYPE); + target = try_then_request_module(find_target(name, revision), + "ipt_%s", name); + if (IS_ERR(target) || !target) + return NULL; + return target; } static int match_revfn(const char *name, u8 revision, int *bestp) @@ -708,15 +709,14 @@ { struct ipt_match *match; - match = try_then_request_module(find_match_lock(m->u.user.name, - m->u.user.revision), + match = try_then_request_module(find_match(m->u.user.name, + m->u.user.revision), "ipt_%s", m->u.user.name); if (IS_ERR(match) || !match) { duprintf("check_match: `%s' not found\n", m->u.user.name); return match ? PTR_ERR(match) : -ENOENT; } m->u.kernel.match = match; - up(&ipt_mutex); if (m->u.kernel.match->checkentry && !m->u.kernel.match->checkentry(name, ip, m->data, @@ -754,8 +754,8 @@ goto cleanup_matches; t = ipt_get_target(e); - target = try_then_request_module(find_target_lock(t->u.user.name, - t->u.user.revision), + target = try_then_request_module(find_target(t->u.user.name, + t->u.user.revision), "ipt_%s", t->u.user.name); if (IS_ERR(target) || !target) { duprintf("check_entry: `%s' not found\n", t->u.user.name); @@ -763,7 +763,6 @@ goto cleanup_matches; } t->u.kernel.target = target; - up(&ipt_mutex); if (t->u.kernel.target == &ipt_standard_target) { if (!standard_check(t, size)) { Index: linux-2.6.10-bk8-Netfilter/net/sched/ipt.c =================================================================== --- linux-2.6.10-bk8-Netfilter.orig/net/sched/ipt.c 2004-12-28 12:31:11.000000000 +1100 +++ linux-2.6.10-bk8-Netfilter/net/sched/ipt.c 2005-01-06 09:37:01.000000000 +1100 @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -60,32 +61,23 @@ struct ipt_target *target; int ret = 0; struct ipt_entry_target *t = p->t; - target = __ipt_find_target_lock(t->u.user.name, &ret); + target = ipt_find_target(t->u.user.name, t->u.user.revision); if (!target) { printk("init_targ: Failed to find %s\n", t->u.user.name); return -1; } DPRINTK("init_targ: found %s\n", target->name); - /* we really need proper ref counting - seems to be only needed for modules?? Talk to laforge */ -/* if (target->me) - __MOD_INC_USE_COUNT(target->me); -*/ t->u.kernel.target = target; - __ipt_mutex_up(); - if (t->u.kernel.target->checkentry && !t->u.kernel.target->checkentry(p->tname, NULL, t->data, t->u.target_size - sizeof (*t), p->hook)) { -/* if (t->u.kernel.target->me) - __MOD_DEC_USE_COUNT(t->u.kernel.target->me); -*/ DPRINTK("ip_tables: check failed for `%s'.\n", t->u.kernel.target->name); + module_put(t->u.kernel.target->me); ret = -EINVAL; } @@ -235,8 +227,12 @@ { struct tcf_ipt *p; p = PRIV(a,ipt); - if (NULL != p) + if (NULL != p) { + struct ipt_entry_target *t = p->t; + if (t && t->u.kernel.target) + module_put(t->u.kernel.target->me); return tcf_hash_release(p, bind); + } return 0; } Index: linux-2.6.10-bk8-Netfilter/include/linux/netfilter_ipv4/ip_tables.h =================================================================== --- linux-2.6.10-bk8-Netfilter.orig/include/linux/netfilter_ipv4/ip_tables.h 2005-01-06 09:11:56.000000000 +1100 +++ linux-2.6.10-bk8-Netfilter/include/linux/netfilter_ipv4/ip_tables.h 2005-01-06 09:40:03.000000000 +1100 @@ -456,6 +456,9 @@ struct module *me; }; +/* net/sched/ipt.c: Gimme access to your targets! Gets target->me. */ +extern struct ipt_target *ipt_find_target(const char *name, u8 revision); + extern int ipt_register_table(struct ipt_table *table); extern void ipt_unregister_table(struct ipt_table *table); extern unsigned int ipt_do_table(struct sk_buff **pskb, -- A bad analogy is like a leaky screwdriver -- Richard Braakman From nacc@us.ibm.com Thu Jan 6 04:15:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 04:15:16 -0800 (PST) Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.130]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06CF7Rn023496 for ; Thu, 6 Jan 2005 04:15:08 -0800 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e32.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j070EtFJ646946 for ; Thu, 6 Jan 2005 19:14:55 -0500 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j070Et4J317306 for ; Thu, 6 Jan 2005 17:14:55 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j070EswC014459 for ; Thu, 6 Jan 2005 17:14:54 -0700 Received: from joust (DYN318000BLD.beaverton.ibm.com [9.47.17.70] (may be forged)) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j070Er4q014446; Thu, 6 Jan 2005 17:14:54 -0700 Received: by joust (Postfix, from userid 1000) id 17B634F966; Thu, 6 Jan 2005 16:14:53 -0800 (PST) Date: Thu, 6 Jan 2005 16:14:53 -0800 From: Nishanth Aravamudan To: kernel-janitors@lists.osdl.org Cc: linux-net@vger.kernel.org, netdev@oss.sgi.com Subject: [PATCH 5/28] net/cs89x0: replace schedule_timeout() with msleep() Message-ID: <20050107001453.GF3055@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13493 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nacc@us.ibm.com Precedence: bulk X-list: netdev Hi, Description: The existing wait is in TASK_INTERRUPTIBLE, but does not check for signals (especially problemtic for a 30 msec wait!) as being a cause for schedule_timeout()s return. Use msleep() instead, to guarantee the task delays as expected. Signed-off-by: Nishanth Aravamudan --- 2.6.10-v/drivers/net/cs89x0.c 2004-12-24 13:35:24.000000000 -0800 +++ 2.6.10/drivers/net/cs89x0.c 2005-01-04 14:57:49.000000000 -0800 @@ -136,6 +136,7 @@ #include #include #include +#include #include #include @@ -909,8 +910,7 @@ void __init reset_chip(struct net_devic writereg(dev, PP_SelfCTL, readreg(dev, PP_SelfCTL) | POWER_ON_RESET); /* wait 30 ms */ - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(30*HZ/1000); + msleep(30); #ifndef CONFIG_ARCH_IXDP2X01 if (lp->chip_type != CS8900) { From dsw@cse.unsw.edu.au Thu Jan 6 04:18:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 04:18:09 -0800 (PST) Received: from note.orchestra.cse.unsw.EDU.AU (root@note.orchestra.cse.unsw.EDU.AU [129.94.242.24]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06CI1e7024001 for ; Thu, 6 Jan 2005 04:18:02 -0800 Received: From wagner With LocalMail ; Fri, 7 Jan 2005 11:17:44 +1100 From: Darren Williams To: "David S. Miller" Date: Fri, 7 Jan 2005 11:17:44 +1100 Cc: Peter Chubb , netdev@oss.sgi.com, mchan@broadcom.com Subject: Re: TG3 fix for slow switches (Was: TG3 driver failure on HP 16-way) Message-ID: <20050107001743.GH17027@cse.unsw.EDU.AU> Mail-Followup-To: "David S. Miller" , Peter Chubb , netdev@oss.sgi.com, mchan@broadcom.com References: <16839.27239.264551.415058@berry.gelato.unsw.EDU.AU> <20041220161552.2b88aa3d.davem@davemloft.net> <16839.30796.413939.333935@wombat.chubb.wattle.id.au> <20050106151910.4d51673e.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050106151910.4d51673e.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040523i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13494 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dsw@gelato.unsw.edu.au Precedence: bulk X-list: netdev Hi David On Thu, 06 Jan 2005, David S. Miller wrote: > > Peter, let me know if this patch solves your PHY link up problem > too. > > # This is a BitKeeper generated diff -Nru style patch. > # > # ChangeSet > # 2005/01/06 14:53:55-08:00 davem@nuts.davemloft.net > # [TG3]: Return 0 when PHY read times out, not all-ones. > # > # Noticed by Peter Chubb. > # > # Signed-off-by: David S. Miller > # > # drivers/net/tg3.c > # 2005/01/06 14:53:07-08:00 davem@nuts.davemloft.net +1 -1 > # [TG3]: Return 0 when PHY read times out, not all-ones. > # > diff -Nru a/drivers/net/tg3.c b/drivers/net/tg3.c > --- a/drivers/net/tg3.c 2005-01-06 14:54:21 -08:00 > +++ b/drivers/net/tg3.c 2005-01-06 14:54:21 -08:00 > @@ -485,7 +485,7 @@ > udelay(80); > } > > - *val = 0xffffffff; > + *val = 0x0; > > frame_val = ((PHY_ADDR << MI_COM_PHY_ADDR_SHIFT) & > MI_COM_PHY_ADDR_MASK); No, if I revert back to an earlier driver the link comes up OK printing: tg3: eth0: Link is up at 1000 Mbps, full duplex. tg3: eth0: Flow control is off for TX and off for RX. after a short delay. With the current dirver I do not see any prinks from tg3_link_report about the state of the link. Darren -------------------------------------------------- Darren Williams Gelato@UNSW -------------------------------------------------- From akpm@osdl.org Thu Jan 6 04:18:23 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 04:18:30 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06CIInF024041 for ; Thu, 6 Jan 2005 04:18:23 -0800 Received: from akpm.pao.digeo.com (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id j070I6d26160; Thu, 6 Jan 2005 16:18:06 -0800 Date: Thu, 6 Jan 2005 16:22:47 -0800 From: Andrew Morton To: netdev@oss.sgi.com Cc: fadlouni@hotmail.com Subject: Fw: [Bugme-new] [Bug 4001] New: can't lower mtu of via_velocity Message-Id: <20050106162247.064add04.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i586-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13495 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Begin forwarded message: Date: Thu, 6 Jan 2005 15:30:14 -0800 From: bugme-daemon@osdl.org To: bugme-new@lists.osdl.org Subject: [Bugme-new] [Bug 4001] New: can't lower mtu of via_velocity http://bugme.osdl.org/show_bug.cgi?id=4001 Summary: can't lower mtu of via_velocity Kernel Version: 2.6.10 Status: NEW Severity: high Owner: jgarzik@pobox.com Submitter: fadlouni@hotmail.com Distribution: gentoo Hardware Environment: amd64 asus av8 motherboard Software Environment: x86_64 AMD Athlon(tm) 64 Processor 3500+ AuthenticAMD GNU/Linux gcc 3.4.3 sys-libs/glibc-2.3.4.20041102 net-tools-1.60-r9 ifconfig 1.42 Problem Description: trying to lower mtu of eth0 to anything lower than 1500 doesn't work: /usr/src:/whoami root /usr/src:/ifconfig eth0 mtu 1499 SIOCSIFMTU: Invalid argument /var/log/messages shows: eth0: Invalid MTU. via-velocity.h has: #define VELOCITY_MIN_MTU (1514-14) via-velocity.c has: if ((new_mtu < VELOCITY_MIN_MTU) || new_mtu > (VELOCITY_MAX_MTU)) { VELOCITY_PRT(MSG_LEVEL_ERR, KERN_NOTICE "%s: Invalid MTU.\n", vptr->dev->name); this explains the reason. however i tried changing the VELOCITY_MIN_MTU to something like 64, then recompiled. now ifconfig accepts mtu 1400. but nothing works afterwards. a simple ping to the gateway fails. Steps to reproduce: load via-velocity module, then /usr/src:/ifconfig eth0 mtu 1499 SIOCSIFMTU: Invalid argument ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. From nacc@us.ibm.com Thu Jan 6 04:19:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 04:19:50 -0800 (PST) Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.129]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06CJjdT028128 for ; Thu, 6 Jan 2005 04:19:45 -0800 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e31.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j070JWm4501710 for ; Thu, 6 Jan 2005 19:19:32 -0500 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j070JWmw437306 for ; Thu, 6 Jan 2005 17:19:32 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j070JWMr022064 for ; Thu, 6 Jan 2005 17:19:32 -0700 Received: from joust (DYN318000BLD.beaverton.ibm.com [9.47.17.70] (may be forged)) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j070JVVS022056; Thu, 6 Jan 2005 17:19:32 -0700 Received: by joust (Postfix, from userid 1000) id 269A94F966; Thu, 6 Jan 2005 16:19:31 -0800 (PST) Date: Thu, 6 Jan 2005 16:19:31 -0800 From: Nishanth Aravamudan To: cramerj@intel.com, john.ronciak@intel.com, ganesh.venkatesan@intel.com Cc: kernel-janitors@lists.osdl.org, linux-net@vger.kernel.org, netdev@oss.sgi.com Subject: [PATCH 6/28] net/e1000_osdep: replace schedule_timeout() with msleep() Message-ID: <20050107001931.GH3055@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13496 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nacc@us.ibm.com Precedence: bulk X-list: netdev Hi, Description: Use msleep() instead of schedule_timeout() to guarantee the task delays as expected. Signed-off-by: Nishanth Aravamudan --- 2.6.10-v/drivers/net/e1000/e1000_osdep.h 2004-12-24 13:34:26.000000000 -0800 +++ 2.6.10/drivers/net/e1000/e1000_osdep.h 2005-01-04 14:57:49.000000000 -0800 @@ -46,8 +46,7 @@ /* Don't mdelay in interrupt context! */ \ BUG(); \ } else { \ - set_current_state(TASK_UNINTERRUPTIBLE); \ - schedule_timeout((x * HZ)/1000 + 2); \ + msleep(x); } } while(0) /* Some workarounds require millisecond delays and are run during interrupt * context. Most notably, when establishing link, the phy may need tweaking From ganesh.venkatesan@intel.com Thu Jan 6 05:02:27 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:02:31 -0800 (PST) Received: from fmsfmr002.fm.intel.com (fmr14.intel.com [192.55.52.68]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06D2RMx031559 for ; Thu, 6 Jan 2005 05:02:27 -0800 Received: from fmsfmr100.fm.intel.com (fmsfmr100.fm.intel.com [10.1.192.58]) by fmsfmr002.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j0712FEK019259; Fri, 7 Jan 2005 01:02:15 GMT Received: from fmsmsxvs040.fm.intel.com (fmsmsxvs040.fm.intel.com [132.233.42.124]) by fmsfmr100.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j0712FwF031624; Fri, 7 Jan 2005 01:02:15 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs040.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617021518322 ; Thu, 06 Jan 2005 17:02:15 -0800 Date: Thu, 6 Jan 2005 17:02:15 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 2/3] e100: Sort Device IDs Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13499 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/e100.c net-drivers-2.6/drivers/net/e100.c.new --- net-drivers-2.6/drivers/net/e100.c 2004-12-02 10:09:34.000000000 -0800 +++ net-drivers-2.6/drivers/net/e100.c.new 2004-12-02 10:09:36.000000000 -0800 @@ -200,6 +200,7 @@ static struct pci_device_id e100_id_tabl INTEL_8255X_ETHERNET_DEVICE(0x1055, 5), INTEL_8255X_ETHERNET_DEVICE(0x1056, 5), INTEL_8255X_ETHERNET_DEVICE(0x1057, 5), + INTEL_8255X_ETHERNET_DEVICE(0x1059, 0), INTEL_8255X_ETHERNET_DEVICE(0x1064, 6), INTEL_8255X_ETHERNET_DEVICE(0x1065, 6), INTEL_8255X_ETHERNET_DEVICE(0x1066, 6), @@ -208,7 +209,6 @@ static struct pci_device_id e100_id_tabl INTEL_8255X_ETHERNET_DEVICE(0x1069, 6), INTEL_8255X_ETHERNET_DEVICE(0x106A, 6), INTEL_8255X_ETHERNET_DEVICE(0x106B, 6), - INTEL_8255X_ETHERNET_DEVICE(0x1059, 0), INTEL_8255X_ETHERNET_DEVICE(0x1209, 0), INTEL_8255X_ETHERNET_DEVICE(0x1229, 0), INTEL_8255X_ETHERNET_DEVICE(0x2449, 2), From ganesh.venkatesan@intel.com Thu Jan 6 05:03:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:03:30 -0800 (PST) Received: from fmsfmr006.fm.intel.com (fmr16.intel.com [192.55.52.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06D3OBL032550 for ; Thu, 6 Jan 2005 05:03:25 -0800 Received: from fmsfmr100.fm.intel.com (fmsfmr100.fm.intel.com [10.1.192.58]) by fmsfmr006.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j0713DwM030105; Fri, 7 Jan 2005 01:03:13 GMT Received: from fmsmsxvs040.fm.intel.com (fmsmsxvs040.fm.intel.com [132.233.42.124]) by fmsfmr100.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j0712vwp032050; Fri, 7 Jan 2005 01:03:12 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs040.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617031218499 ; Thu, 06 Jan 2005 17:03:12 -0800 Date: Thu, 6 Jan 2005 17:03:12 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.4] e1000: Documentation/networking/e1000.txt update Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13501 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -Nuar -u net-drivers-2.4/Documentation/networking/e1000.txt net-drivers-2.4.new/Documentation/networking/e1000.txt --- net-drivers-2.4/Documentation/networking/e1000.txt 2004-11-18 04:11:17.000000000 -0800 +++ net-drivers-2.4.new/Documentation/networking/e1000.txt 2005-01-06 11:01:03.000000000 -0800 @@ -1,14 +1,14 @@ Linux* Base Driver for the Intel(R) PRO/1000 Family of Adapters =============================================================== -September 13, 2004 +November 17, 2004 Contents ======== - In This Release -- Supported Adapters +- Identifying Your Adapter - Command Line Parameters - Speed and Duplex Configuration - Additional Configurations @@ -20,8 +20,7 @@ =============== This file describes the Linux* Base Driver for the Intel(R) PRO/1000 Family -of Adapters, version 5.x.x. This driver includes support for Itanium(TM)2 -and EM64T systems. +of Adapters, version 5.x.x. For questions related to hardware requirements, refer to the documentation supplied with your Intel PRO/1000 adapter. All hardware requirements listed @@ -145,9 +144,11 @@ Default Value: 256 This value is the number of receive descriptors allocated by the driver. Increasing this value allows the driver to buffer more incoming packets. - Each descriptor is 16 bytes. A receive buffer is also allocated for each - descriptor and can be either 2048, 4096, 8192, or 16384 bytes, depending - on the MTU setting. The maximum MTU size is 16110. + Each descriptor is 16 bytes. A receive buffer is allocated for each + descriptor and can either be 2048 or 4096 bytes long, depending on the MTU + + setting. An incoming packet can span one or more receive descriptors. + The maximum MTU size is 16110. NOTE: MTU designates the frame size. It only needs to be set for Jumbo Frames. @@ -251,17 +252,18 @@ also be forced. The AutoNeg parameter is used when more control is required over the auto- -negotiation process. When this parameter is used, Speed and Duplex must not -be specified. This parameter is a bitmap that specifies which speed and -duplex settings are advertised to the link partner. - -Bit 7 6 5 4 3 2 1 0 -Speed (Mbps) N/A N/A 1000 N/A 100 100 10 10 -Duplex Full Full Half Full Half - -For example to limit the negotiated speed/duplex on the interface to 10 Mbps -Half or Full duplex, set AutoNeg to 0x02: - insmod e1000 AutoNeg=0x02 +negotiation process. When this parameter is used, Speed and Duplex parameters +must not be specified. The following table describes supported values for the +AutoNeg parameter: + + +Speed (Mbps) 1000 100 100 10 10 +Duplex Full Full Half Full Half +Value (in base 16) 0x20 0x08 0x04 0x02 0x01 + + +Example: insmod e1000 AutoNeg=0x03, loads e1000 and specifies (10 full duplex, +10 half duplex) for negotiation with the peer. Note that setting AutoNeg does not guarantee that the board will link at the highest specified speed or duplex mode, but the board will link at the @@ -333,11 +335,7 @@ version 1.6 or later is required for this functionality. The latest release of ethtool can be found from - http://sf.net/projects/gkernel. After ethtool is installed, - ethtool-copy.h must be copied and renamed to ethtool.h in your kernel - source tree at /include/linux. Backup the original - ethtool.h as needed before copying. The driver then must be recompiled - in order to take advantage of the latest ethtool features. + http://sf.net/projects/gkernel. NOTE: Ethtool 1.6 only supports a limited set of ethtool options. Support for a more complete ethtool feature set can be enabled by upgrading From ganesh.venkatesan@intel.com Thu Jan 6 05:02:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:02:11 -0800 (PST) Received: from fmsfmr006.fm.intel.com (fmr16.intel.com [192.55.52.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06D27qb031434 for ; Thu, 6 Jan 2005 05:02:07 -0800 Received: from fmsfmr100.fm.intel.com (fmsfmr100.fm.intel.com [10.1.192.58]) by fmsfmr006.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j0711twM029368; Fri, 7 Jan 2005 01:01:55 GMT Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by fmsfmr100.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j0711kwP031319; Fri, 7 Jan 2005 01:01:55 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs043.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617015516044 ; Thu, 06 Jan 2005 17:01:55 -0800 Date: Thu, 6 Jan 2005 17:01:55 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 3/3] e100: Update driver version number Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13498 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/e100.c net-drivers-2.6/drivers/net/e100.c.new --- net-drivers-2.6/drivers/net/e100.c 2004-12-02 10:09:34.000000000 -0800 +++ net-drivers-2.6/drivers/net/e100.c.new 2004-12-02 10:09:36.000000000 -0800 @@ -155,7 +155,7 @@ #define DRV_NAME "e100" #define DRV_EXT "-NAPI" -#define DRV_VERSION "3.2.3-k2"DRV_EXT +#define DRV_VERSION "3.3.6-k2"DRV_EXT #define DRV_DESCRIPTION "Intel(R) PRO/100 Network Driver" #define DRV_COPYRIGHT "Copyright(c) 1999-2004 Intel Corporation" #define PFX DRV_NAME ": " From ganesh.venkatesan@intel.com Thu Jan 6 05:02:45 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:02:49 -0800 (PST) Received: from orsfmr002.jf.intel.com (fmr17.intel.com [134.134.136.16]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06D2jPX031785 for ; Thu, 6 Jan 2005 05:02:45 -0800 Received: from orsfmr101.jf.intel.com (orsfmr101.jf.intel.com [10.7.209.17]) by orsfmr002.jf.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j0712XXD009330; Fri, 7 Jan 2005 01:02:33 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by orsfmr101.jf.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j0711xus030330; Fri, 7 Jan 2005 01:02:20 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by orsmsxvs040.jf.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617012703474 ; Thu, 06 Jan 2005 17:01:33 -0800 Date: Thu, 6 Jan 2005 17:01:27 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 0/3] e100: driver update Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13500 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev 1 Replace locally implemented delay routines with call to msleep (nacc@us.ibm.com) 2 Sort device ids 3 Update driver version number From ganesh.venkatesan@intel.com Thu Jan 6 05:02:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:02:06 -0800 (PST) Received: from fmsfmr002.fm.intel.com (fmr14.intel.com [192.55.52.68]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06D20aH031427 for ; Thu, 6 Jan 2005 05:02:01 -0800 Received: from fmsfmr100.fm.intel.com (fmsfmr100.fm.intel.com [10.1.192.58]) by fmsfmr002.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j0711lEK019139; Fri, 7 Jan 2005 01:01:47 GMT Received: from fmsmsxvs040.fm.intel.com (fmsmsxvs040.fm.intel.com [132.233.42.124]) by fmsfmr100.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j0711lwF031331; Fri, 7 Jan 2005 01:01:47 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs040.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617014718236 ; Thu, 06 Jan 2005 17:01:47 -0800 Date: Thu, 6 Jan 2005 17:01:47 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.4 1/3] e100: Replace locally implemented delay routines with call to msleep (nacc@us.ibm.com) Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13497 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/e100.c net-drivers-2.6/drivers/net/e100.c.new --- net-drivers-2.6/drivers/net/e100.c 2004-12-02 10:09:34.000000000 -0800 +++ net-drivers-2.6/drivers/net/e100.c.new 2004-12-02 10:09:36.000000000 -0800 @@ -620,8 +620,7 @@ static int e100_self_test(struct nic *ni writel(selftest | dma_addr, &nic->csr->port); e100_write_flush(nic); /* Wait 10 msec for self-test to complete */ - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ / 100 + 1); + msleep(10); /* Interrupts are enabled after self-test */ e100_disable_irq(nic); @@ -669,8 +668,7 @@ static void e100_eeprom_write(struct nic e100_write_flush(nic); udelay(4); } /* Wait 10 msec for cmd to complete */ - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ / 100 + 1); + msleep(10); /* Chip deselect */ writeb(0, &nic->csr->eeprom_ctrl_lo); @@ -1759,8 +1758,7 @@ static int e100_loopback_test(struct nic memset(skb->data, 0xFF, ETH_DATA_LEN); e100_xmit_frame(skb, nic->netdev); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ / 100 + 1); + msleep(10); if(memcmp(nic->rx_to_clean->skb->data + sizeof(struct rfd), skb->data, ETH_DATA_LEN)) @@ -1846,8 +1843,7 @@ static void e100_get_regs(struct net_dev mdio_read(netdev, nic->mii.phy_id, i); memset(nic->mem->dump_buf, 0, sizeof(nic->mem->dump_buf)); e100_exec_cb(nic, NULL, e100_dump); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ / 100 + 1); + msleep(10); memcpy(&buff[2 + E100_PHY_REGS], nic->mem->dump_buf, sizeof(nic->mem->dump_buf)); } @@ -2026,8 +2022,7 @@ static int e100_phys_id(struct net_devic if(!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ)) data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ); mod_timer(&nic->blink_timer, jiffies); - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(data * HZ); + msleep_interruptible(data * 1000); del_timer_sync(&nic->blink_timer); mdio_write(netdev, nic->mii.phy_id, MII_LED_CONTROL, 0); From ganesh.venkatesan@intel.com Thu Jan 6 05:04:00 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:04:05 -0800 (PST) Received: from fmsfmr002.fm.intel.com (fmr14.intel.com [192.55.52.68]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06D3vWw000468 for ; Thu, 6 Jan 2005 05:04:00 -0800 Received: from fmsfmr100.fm.intel.com (fmsfmr100.fm.intel.com [10.1.192.58]) by fmsfmr002.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j0713jEK020002; Fri, 7 Jan 2005 01:03:45 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by fmsfmr100.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j0713jwF000445; Fri, 7 Jan 2005 01:03:45 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs042.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617034505937 ; Thu, 06 Jan 2005 17:03:45 -0800 Date: Thu, 6 Jan 2005 17:03:45 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6] e1000: Documentation/networking/e1000.txt update Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13502 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -Nuar -u net-drivers-2.6/Documentation/networking/e1000.txt net-drivers-2.6.new/Documentation/networking/e1000.txt --- net-drivers-2.6/Documentation/networking/e1000.txt 2004-10-26 04:14:03.000000000 -0700 +++ net-drivers-2.6.new/Documentation/networking/e1000.txt 2005-01-06 11:01:12.000000000 -0800 @@ -1,7 +1,7 @@ Linux* Base Driver for the Intel(R) PRO/1000 Family of Adapters =============================================================== -September 13, 2004 +November 17, 2004 Contents @@ -20,8 +20,7 @@ =============== This file describes the Linux* Base Driver for the Intel(R) PRO/1000 Family -of Adapters, version 5.x.x. This driver includes support for Itanium(TM)2 -and EM64T systems. +of Adapters, version 5.x.x. For questions related to hardware requirements, refer to the documentation supplied with your Intel PRO/1000 adapter. All hardware requirements listed @@ -145,9 +144,11 @@ Default Value: 256 This value is the number of receive descriptors allocated by the driver. Increasing this value allows the driver to buffer more incoming packets. - Each descriptor is 16 bytes. A receive buffer is also allocated for each - descriptor and can be either 2048, 4096, 8192, or 16384 bytes, depending - on the MTU setting. The maximum MTU size is 16110. + Each descriptor is 16 bytes. A receive buffer is allocated for each + descriptor and can either be 2048 or 4096 bytes long, depending on the MTU + + setting. An incoming packet can span one or more receive descriptors. + The maximum MTU size is 16110. NOTE: MTU designates the frame size. It only needs to be set for Jumbo Frames. @@ -251,17 +252,16 @@ also be forced. The AutoNeg parameter is used when more control is required over the auto- -negotiation process. When this parameter is used, Speed and Duplex must not -be specified. This parameter is a bitmap that specifies which speed and -duplex settings are advertised to the link partner. - -Bit 7 6 5 4 3 2 1 0 -Speed (Mbps) N/A N/A 1000 N/A 100 100 10 10 -Duplex Full Full Half Full Half - -For example to limit the negotiated speed/duplex on the interface to 10 Mbps -Half or Full duplex, set AutoNeg to 0x02: - insmod e1000 AutoNeg=0x02 +negotiation process. When this parameter is used, Speed and Duplex parameters +must not be specified. The following table describes supported values for the +AutoNeg parameter: + +Speed (Mbps) 1000 100 100 10 10 +Duplex Full Full Half Full Half +Value (in base 16) 0x20 0x08 0x04 0x02 0x01 + +Example: insmod e1000 AutoNeg=0x03, loads e1000 and specifies (10 full duplex, +10 half duplex) for negotiation with the peer. Note that setting AutoNeg does not guarantee that the board will link at the highest specified speed or duplex mode, but the board will link at the @@ -333,11 +333,7 @@ version 1.6 or later is required for this functionality. The latest release of ethtool can be found from - http://sf.net/projects/gkernel. After ethtool is installed, - ethtool-copy.h must be copied and renamed to ethtool.h in your kernel - source tree at /include/linux. Backup the original - ethtool.h as needed before copying. The driver then must be recompiled - in order to take advantage of the latest ethtool features. + http://sf.net/projects/gkernel. NOTE: Ethtool 1.6 only supports a limited set of ethtool options. Support for a more complete ethtool feature set can be enabled by upgrading From ganesh.venkatesan@intel.com Thu Jan 6 05:04:10 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:04:14 -0800 (PST) Received: from fmsfmr002.fm.intel.com (fmr14.intel.com [192.55.52.68]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06D4AKd000648 for ; Thu, 6 Jan 2005 05:04:10 -0800 Received: from fmsfmr100.fm.intel.com (fmsfmr100.fm.intel.com [10.1.192.58]) by fmsfmr002.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j0713wEK020051; Fri, 7 Jan 2005 01:03:58 GMT Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by fmsfmr100.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j0713vwF000503; Fri, 7 Jan 2005 01:03:57 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs043.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617035716256 ; Thu, 06 Jan 2005 17:03:57 -0800 Date: Thu, 6 Jan 2005 17:03:57 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6] ixgb: Documentation/networking/ixgb.txt Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13503 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -Nuar -u net-drivers-2.6/Documentation/networking/ixgb.txt net-drivers-2.6.new/Documentation/networking/ixgb.txt --- net-drivers-2.6/Documentation/networking/ixgb.txt 2004-10-26 04:14:03.000000000 -0700 +++ net-drivers-2.6.new/Documentation/networking/ixgb.txt 2005-01-06 11:01:30.000000000 -0800 @@ -1,7 +1,7 @@ Linux* Base Driver for the Intel(R) PRO/10GbE Family of Adapters ================================================================ -September 13, 2004 +November 17, 2004 Contents @@ -18,8 +18,7 @@ =============== This file describes the Linux* Base Driver for the Intel(R) PRO/10GbE Family -of Adapters, version 1.0.x. This driver includes support for Itanium(TM)2 and -EM64T systems. +of Adapters, version 1.0.x. For questions related to hardware requirements, refer to the documentation supplied with your Intel PRO/10GbE adapter. All hardware requirements listed @@ -71,8 +70,8 @@ Ethernet PAUSE frames. RxDescriptors -Valid Range: 64-4096 -Default Value: 1024 +Valid Range: 64-512 +Default Value: 512 This value is the number of receive descriptors allocated by the driver. Increasing this value allows the driver to buffer more incoming packets. Each descriptor is 16 bytes. A receive buffer is also allocated for From ganesh.venkatesan@intel.com Thu Jan 6 05:04:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:04:24 -0800 (PST) Received: from fmsfmr006.fm.intel.com (fmr16.intel.com [192.55.52.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06D4Jwf000874 for ; Thu, 6 Jan 2005 05:04:20 -0800 Received: from fmsfmr100.fm.intel.com (fmsfmr100.fm.intel.com [10.1.192.58]) by fmsfmr006.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j07147wM030692; Fri, 7 Jan 2005 01:04:07 GMT Received: from fmsmsxvs040.fm.intel.com (fmsmsxvs040.fm.intel.com [132.233.42.124]) by fmsfmr100.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j07147wF000623; Fri, 7 Jan 2005 01:04:07 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs040.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617040718604 ; Thu, 06 Jan 2005 17:04:07 -0800 Date: Thu, 6 Jan 2005 17:04:07 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6] e100: Documentation/networking/e100.txt update Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13504 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -Nuar -u net-drivers-2.6/Documentation/networking/e100.txt net-drivers-2.6.new/Documentation/networking/e100.txt --- net-drivers-2.6/Documentation/networking/e100.txt 2004-10-26 04:14:03.000000000 -0700 +++ net-drivers-2.6.new/Documentation/networking/e100.txt 2005-01-06 11:01:18.000000000 -0800 @@ -1,7 +1,7 @@ Linux* Base Driver for the Intel(R) PRO/100 Family of Adapters ============================================================== -September 13, 2004 +November 17, 2004 Contents @@ -18,9 +18,7 @@ =============== This file describes the Linux* Base Driver for the Intel(R) PRO/100 Family of -Adapters, version 3.2.x. This driver includes support for Itanium(TM)2 and -EM64T systems. - +Adapters, version 3.3.x. This driver supports 2.4.x and 2.6.x kernels. Identifying Your Adapter ======================== @@ -119,12 +117,6 @@ The latest release of ethtool can be found at: http://sf.net/projects/gkernel. - After ethtool is installed, ethtool-copy.h must be copied and renamed to - ethtool.h in your kernel source tree at /include/linux. - Backup the original ethtool.h as needed before copying. The driver then - must be recompiled in order to take advantage of the latest ethtool - features. - NOTE: This driver uses mii support from the kernel. As a result, when there is no link, ethtool will report speed/duplex to be 10/half. From ganesh.venkatesan@intel.com Thu Jan 6 05:06:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:06:29 -0800 (PST) Received: from orsfmr003.jf.intel.com (fmr18.intel.com [134.134.136.17]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06D6LFX002547 for ; Thu, 6 Jan 2005 05:06:26 -0800 Received: from orsfmr101.jf.intel.com (orsfmr101.jf.intel.com [10.7.209.17]) by orsfmr003.jf.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j07169P6019038; Fri, 7 Jan 2005 01:06:09 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by orsfmr101.jf.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j07158vI032492; Fri, 7 Jan 2005 01:05:58 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by orsmsxvs040.jf.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617041904692 ; Thu, 06 Jan 2005 17:04:25 -0800 Date: Thu, 6 Jan 2005 17:04:14 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.4 1/13] e1000: ITR does not default correctly Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13505 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.4/drivers/net/e1000/e1000_param.c net-drivers-2.4/drivers/net/e1000.new/e1000_param.c --- net-drivers-2.4/drivers/net/e1000/e1000_param.c 2004-12-06 08:43:11.635381920 -0800 +++ net-drivers-2.4/drivers/net/e1000.new/e1000_param.c 2004-12-06 08:43:12.622231896 -0800 @@ -447,9 +447,6 @@ e1000_check_options(struct e1000_adapter adapter->itr = InterruptThrottleRate[bd]; switch(adapter->itr) { - case -1: - adapter->itr = 1; - break; case 0: DPRINTK(PROBE, INFO, "%s turned off\n", opt.name); @@ -458,6 +455,7 @@ e1000_check_options(struct e1000_adapter DPRINTK(PROBE, INFO, "%s set to dynamic mode\n", opt.name); break; + case -1: default: e1000_validate_option(&adapter->itr, &opt, adapter); From ganesh.venkatesan@intel.com Thu Jan 6 05:07:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:07:08 -0800 (PST) Received: from orsfmr002.jf.intel.com (fmr17.intel.com [134.134.136.16]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06D73QG002950 for ; Thu, 6 Jan 2005 05:07:04 -0800 Received: from orsfmr101.jf.intel.com (orsfmr101.jf.intel.com [10.7.209.17]) by orsfmr002.jf.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j0716pXD011270; Fri, 7 Jan 2005 01:06:51 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by orsfmr101.jf.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j07158vc032492; Fri, 7 Jan 2005 01:06:41 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by orsmsxvs040.jf.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617051905048 ; Thu, 06 Jan 2005 17:05:25 -0800 Date: Thu, 6 Jan 2005 17:05:07 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.4 2/13] e1000: Fix for kernel panic when the interface is brought down while the NAPI enabled driver is under stress Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13506 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.4/drivers/net/e1000/e1000_main.c net-drivers-2.4/drivers/net/e1000.new/e1000_main.c --- net-drivers-2.4/drivers/net/e1000/e1000_main.c 2004-12-06 08:43:11.635381920 -0800 +++ net-drivers-2.4/drivers/net/e1000.new/e1000_main.c 2004-12-06 08:43:12.534245272 -0800 @@ -2147,6 +2147,9 @@ e1000_clean(struct net_device *netdev, i int tx_cleaned; int work_done = 0; + if (!netif_carrier_ok(netdev)) + goto quit_polling; + tx_cleaned = e1000_clean_tx_irq(adapter); e1000_clean_rx_irq(adapter, &work_done, work_to_do); @@ -2156,7 +2159,7 @@ e1000_clean(struct net_device *netdev, i /* if no Rx and Tx cleanup work was done, exit the polling mode */ if(!tx_cleaned || (work_done < work_to_do) || !netif_running(netdev)) { - netif_rx_complete(netdev); +quit_polling: netif_rx_complete(netdev); e1000_irq_enable(adapter); return 0; } From ganesh.venkatesan@intel.com Thu Jan 6 05:07:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:07:58 -0800 (PST) Received: from fmsfmr002.fm.intel.com (fmr14.intel.com [192.55.52.68]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06D7rT6003583 for ; Thu, 6 Jan 2005 05:07:54 -0800 Received: from fmsfmr101.fm.intel.com (fmsfmr101.fm.intel.com [10.1.192.59]) by fmsfmr002.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j0717gEK021160; Fri, 7 Jan 2005 01:07:42 GMT Received: from fmsmsxvs041.fm.intel.com (fmsmsxvs041.fm.intel.com [132.233.42.126]) by fmsfmr101.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j0717fIX005771; Fri, 7 Jan 2005 01:07:41 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs041.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617074123543 ; Thu, 06 Jan 2005 17:07:41 -0800 Date: Thu, 6 Jan 2005 17:07:11 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.4 3/13] e1000: Fix ethtool diagnostics -- specifically for blade server implementations Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13507 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.4/drivers/net/e1000/e1000_ethtool.c net-drivers-2.4/drivers/net/e1000.new/e1000_ethtool.c --- net-drivers-2.4/drivers/net/e1000/e1000_ethtool.c 2004-12-06 08:43:11.617384656 -0800 +++ net-drivers-2.4/drivers/net/e1000.new/e1000_ethtool.c 2004-12-06 08:43:12.382268376 -0800 @@ -776,7 +776,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data) { struct net_device *netdev = adapter->netdev; - uint32_t icr, mask, i=0, shared_int = TRUE; + uint32_t mask, i=0, shared_int = TRUE; uint32_t irq = adapter->pdev->irq; *data = 0; @@ -784,7 +784,8 @@ e1000_intr_test(struct e1000_adapter *ad /* Hook up test interrupt handler just for this test */ if(!request_irq(irq, &e1000_test_intr, 0, netdev->name, netdev)) { shared_int = FALSE; - } else if(request_irq(irq, &e1000_test_intr, SA_SHIRQ, netdev->name, netdev)){ + } else if(request_irq(irq, &e1000_test_intr, SA_SHIRQ, + netdev->name, netdev)){ *data = 1; return -1; } @@ -793,21 +794,6 @@ e1000_intr_test(struct e1000_adapter *ad E1000_WRITE_REG(&adapter->hw, IMC, 0xFFFFFFFF); msec_delay(10); - /* Interrupts are disabled, so read interrupt cause - * register (icr) twice to verify that there are no interrupts - * pending. icr is clear on read. - */ - icr = E1000_READ_REG(&adapter->hw, ICR); - icr = E1000_READ_REG(&adapter->hw, ICR); - - if(icr != 0) { - /* if icr is non-zero, there is no point - * running other interrupt tests. - */ - *data = 2; - i = 10; - } - /* Test each interrupt */ for(; i < 10; i++) { @@ -856,8 +842,10 @@ e1000_intr_test(struct e1000_adapter *ad * test failed. */ adapter->test_icr = 0; - E1000_WRITE_REG(&adapter->hw, IMC, ~mask); - E1000_WRITE_REG(&adapter->hw, ICS, ~mask); + E1000_WRITE_REG(&adapter->hw, IMC, + (~mask & 0x00007FFF)); + E1000_WRITE_REG(&adapter->hw, ICS, + (~mask & 0x00007FFF)); msec_delay(10); if(adapter->test_icr) { @@ -1335,10 +1333,17 @@ e1000_run_loopback_test(struct e1000_ada msec_delay(200); - pci_dma_sync_single(pdev, rxdr->buffer_info[0].dma, - rxdr->buffer_info[0].length, PCI_DMA_FROMDEVICE); + i = 0; + do { + pci_dma_sync_single(pdev, rxdr->buffer_info[i].dma, + rxdr->buffer_info[i].length, + PCI_DMA_FROMDEVICE); + + if (!e1000_check_lbtest_frame(rxdr->buffer_info[i++].skb, 1024)) + return 0; + } while (i < 64); - return e1000_check_lbtest_frame(rxdr->buffer_info[0].skb, 1024); + return 13; } static int @@ -1357,10 +1352,27 @@ static int e1000_link_test(struct e1000_adapter *adapter, uint64_t *data) { *data = 0; - e1000_check_for_link(&adapter->hw); - if(!(E1000_READ_REG(&adapter->hw, STATUS) & E1000_STATUS_LU)) { - *data = 1; + if (adapter->hw.media_type == e1000_media_type_internal_serdes) { + int i = 0; + adapter->hw.serdes_link_down = TRUE; + + /* on some blade server designs link establishment */ + /* could take as long as 2-3 minutes. */ + do { + e1000_check_for_link(&adapter->hw); + if (adapter->hw.serdes_link_down == FALSE) + return *data; + msec_delay(20); + } while (i++ < 3750); + + *data = 1; + } else { + e1000_check_for_link(&adapter->hw); + + if(!(E1000_READ_REG(&adapter->hw, STATUS) & E1000_STATUS_LU)) { + *data = 1; + } } return *data; } From ganesh.venkatesan@intel.com Thu Jan 6 05:09:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:09:38 -0800 (PST) Received: from fmsfmr002.fm.intel.com (fmr14.intel.com [192.55.52.68]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06D9ZOh004120 for ; Thu, 6 Jan 2005 05:09:35 -0800 Received: from fmsfmr101.fm.intel.com (fmsfmr101.fm.intel.com [10.1.192.59]) by fmsfmr002.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j0719NEK021596; Fri, 7 Jan 2005 01:09:23 GMT Received: from fmsmsxvs041.fm.intel.com (fmsmsxvs041.fm.intel.com [132.233.42.126]) by fmsfmr101.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j0719FIb006554; Fri, 7 Jan 2005 01:09:23 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs041.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617092223742 ; Thu, 06 Jan 2005 17:09:22 -0800 Date: Thu, 6 Jan 2005 17:09:22 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.4 4/13] e1000: Enabling NETIF_F_SG without checksum offload is illegal -- jdmason@us.ibm.com Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13508 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.4/drivers/net/e1000/e1000_main.c net-drivers-2.4/drivers/net/e1000.new/e1000_main.c --- net-drivers-2.4/drivers/net/e1000/e1000_main.c 2004-12-06 08:43:11.635381920 -0800 +++ net-drivers-2.4/drivers/net/e1000.new/e1000_main.c 2004-12-06 08:43:12.534245272 -0800 @@ -475,8 +475,6 @@ e1000_probe(struct pci_dev *pdev, NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER; - } else { - netdev->features = NETIF_F_SG; } #ifdef NETIF_F_TSO From ganesh.venkatesan@intel.com Thu Jan 6 05:09:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:09:51 -0800 (PST) Received: from fmsfmr006.fm.intel.com (fmr16.intel.com [192.55.52.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06D9j1u004146 for ; Thu, 6 Jan 2005 05:09:46 -0800 Received: from fmsfmr101.fm.intel.com (fmsfmr101.fm.intel.com [10.1.192.59]) by fmsfmr006.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j0719YwM001217; Fri, 7 Jan 2005 01:09:34 GMT Received: from fmsmsxvs041.fm.intel.com (fmsmsxvs041.fm.intel.com [132.233.42.126]) by fmsfmr101.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j0719XIX006774; Fri, 7 Jan 2005 01:09:33 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs041.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617093323761 ; Thu, 06 Jan 2005 17:09:33 -0800 Date: Thu, 6 Jan 2005 17:09:33 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.4 5/13] e1000: Apply patch from Jamal (hadi@znyx.com) to remove a redundant assignment to a local nr_frags in e1000_xmit_frame Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13509 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.4/drivers/net/e1000/e1000_main.c net-drivers-2.4/drivers/net/e1000.new/e1000_main.c --- net-drivers-2.4/drivers/net/e1000/e1000_main.c 2004-12-06 08:43:11.635381920 -0800 +++ net-drivers-2.4/drivers/net/e1000.new/e1000_main.c 2004-12-06 08:43:12.534245272 -0800 @@ -1750,7 +1750,6 @@ e1000_xmit_frame(struct sk_buff *skb, st unsigned int mss = 0; int count = 0; unsigned int f; - nr_frags = skb_shinfo(skb)->nr_frags; len -= skb->data_len; if(unlikely(skb->len <= 0)) { From ganesh.venkatesan@intel.com Thu Jan 6 05:10:00 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:10:06 -0800 (PST) Received: from fmsfmr005.fm.intel.com (fmr15.intel.com [192.55.52.69]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DA0qB004308 for ; Thu, 6 Jan 2005 05:10:00 -0800 Received: from fmsfmr101.fm.intel.com (fmsfmr101.fm.intel.com [10.1.192.59]) by fmsfmr005.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j0719mbh018230; Fri, 7 Jan 2005 01:09:48 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by fmsfmr101.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j0719lIX006986; Fri, 7 Jan 2005 01:09:47 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs042.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617094706734 ; Thu, 06 Jan 2005 17:09:47 -0800 Date: Thu, 6 Jan 2005 17:09:47 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.4 6/13] e1000: Synchronizing multicast table setup with transmit path - ak@suse.de Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13510 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.4/drivers/net/e1000/e1000_main.c net-drivers-2.4/drivers/net/e1000.new/e1000_main.c --- net-drivers-2.4/drivers/net/e1000/e1000_main.c 2004-12-06 08:43:11.635381920 -0800 +++ net-drivers-2.4/drivers/net/e1000.new/e1000_main.c 2004-12-06 08:43:12.534245272 -0800 @@ -1260,9 +1260,12 @@ e1000_set_multi(struct net_device *netde uint32_t rctl; uint32_t hash_value; int i; + unsigned long flags; /* Check for Promiscuous and All Multicast modes */ + spin_lock_irqsave(&adapter->tx_lock, flags); + rctl = E1000_READ_REG(hw, RCTL); if(netdev->flags & IFF_PROMISC) { @@ -1311,6 +1314,8 @@ e1000_set_multi(struct net_device *netde if(hw->mac_type == e1000_82542_rev2_0) e1000_leave_82542_rst(adapter); + + spin_unlock_irqrestore(&adapter->tx_lock, flags); } /* Need to wait a few seconds after link up to get diagnostic information from From ganesh.venkatesan@intel.com Thu Jan 6 05:10:14 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:10:19 -0800 (PST) Received: from fmsfmr005.fm.intel.com (fmr15.intel.com [192.55.52.69]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DAEuW004558 for ; Thu, 6 Jan 2005 05:10:14 -0800 Received: from fmsfmr101.fm.intel.com (fmsfmr101.fm.intel.com [10.1.192.59]) by fmsfmr005.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071A1bh018331; Fri, 7 Jan 2005 01:10:02 GMT Received: from fmsmsxvs041.fm.intel.com (fmsmsxvs041.fm.intel.com [132.233.42.126]) by fmsfmr101.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j0719uIZ007111; Fri, 7 Jan 2005 01:10:01 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs041.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617100023806 ; Thu, 06 Jan 2005 17:10:00 -0800 Date: Thu, 6 Jan 2005 17:10:00 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.4 7/13] e1000: fix tx resource cleanup logic Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13511 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.4/drivers/net/e1000/e1000_main.c net-drivers-2.4/drivers/net/e1000.new/e1000_main.c --- net-drivers-2.4/drivers/net/e1000/e1000_main.c 2004-12-06 08:43:11.635381920 -0800 +++ net-drivers-2.4/drivers/net/e1000.new/e1000_main.c 2004-12-06 08:43:12.534245272 -0800 @@ -1054,6 +1054,24 @@ e1000_free_tx_resources(struct e1000_ada adapter->tx_ring.desc = NULL; } +static inline void +e1000_unmap_and_free_tx_resource(struct e1000_adapter *adapter, + struct e1000_buffer *buffer_info) +{ + struct pci_dev *pdev = adapter->pdev; + if(buffer_info->dma) { + pci_unmap_page(pdev, + buffer_info->dma, + buffer_info->length, + PCI_DMA_TODEVICE); + buffer_info->dma = 0; + } + if(buffer_info->skb) { + dev_kfree_skb_any(buffer_info->skb); + buffer_info->skb = NULL; + } +} + /** * e1000_clean_tx_ring - Free Tx Buffers * @adapter: board private structure @@ -1064,7 +1082,6 @@ e1000_clean_tx_ring(struct e1000_adapter { struct e1000_desc_ring *tx_ring = &adapter->tx_ring; struct e1000_buffer *buffer_info; - struct pci_dev *pdev = adapter->pdev; unsigned long size; unsigned int i; @@ -1072,17 +1089,7 @@ e1000_clean_tx_ring(struct e1000_adapter for(i = 0; i < tx_ring->count; i++) { buffer_info = &tx_ring->buffer_info[i]; - if(buffer_info->skb) { - - pci_unmap_page(pdev, - buffer_info->dma, - buffer_info->length, - PCI_DMA_TODEVICE); - - dev_kfree_skb(buffer_info->skb); - - buffer_info->skb = NULL; - } + e1000_unmap_and_free_tx_resource(adapter, buffer_info); } size = sizeof(struct e1000_buffer) * tx_ring->count; @@ -2180,7 +2187,6 @@ e1000_clean_tx_irq(struct e1000_adapter { struct e1000_desc_ring *tx_ring = &adapter->tx_ring; struct net_device *netdev = adapter->netdev; - struct pci_dev *pdev = adapter->pdev; struct e1000_tx_desc *tx_desc, *eop_desc; struct e1000_buffer *buffer_info; unsigned int i, eop; @@ -2195,20 +2201,7 @@ e1000_clean_tx_irq(struct e1000_adapter tx_desc = E1000_TX_DESC(*tx_ring, i); buffer_info = &tx_ring->buffer_info[i]; - if(likely(buffer_info->dma)) { - pci_unmap_page(pdev, - buffer_info->dma, - buffer_info->length, - PCI_DMA_TODEVICE); - - buffer_info->dma = 0; - } - - if(buffer_info->skb) { - dev_kfree_skb_any(buffer_info->skb); - buffer_info->skb = NULL; - } - + e1000_unmap_and_free_tx_resource(adapter, buffer_info); tx_desc->buffer_addr = 0; tx_desc->lower.data = 0; tx_desc->upper.data = 0; From ganesh.venkatesan@intel.com Thu Jan 6 05:11:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:11:08 -0800 (PST) Received: from fmsfmr006.fm.intel.com (fmr16.intel.com [192.55.52.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DB3B2005612 for ; Thu, 6 Jan 2005 05:11:04 -0800 Received: from fmsfmr101.fm.intel.com (fmsfmr101.fm.intel.com [10.1.192.59]) by fmsfmr006.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071ApwM002011; Fri, 7 Jan 2005 01:10:51 GMT Received: from fmsmsxvs041.fm.intel.com (fmsmsxvs041.fm.intel.com [132.233.42.126]) by fmsfmr101.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071AhIb007846; Fri, 7 Jan 2005 01:10:51 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs041.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617105023908 ; Thu, 06 Jan 2005 17:10:51 -0800 Date: Thu, 6 Jan 2005 17:10:21 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.4 8/13] e1000: {set, get}_wol is now symmetric for 82545EM adapters Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13512 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.4/drivers/net/e1000/e1000_ethtool.c net-drivers-2.4/drivers/net/e1000.new/e1000_ethtool.c --- net-drivers-2.4/drivers/net/e1000/e1000_ethtool.c 2004-12-06 08:43:11.617384656 -0800 +++ net-drivers-2.4/drivers/net/e1000.new/e1000_ethtool.c 2004-12-06 08:43:12.382268376 -0800 @@ -1501,6 +1501,8 @@ e1000_set_wol(struct net_device *netdev, case E1000_DEV_ID_82543GC_COPPER: case E1000_DEV_ID_82544EI_FIBER: case E1000_DEV_ID_82546EB_QUAD_COPPER: + case E1000_DEV_ID_82545EM_FIBER: + case E1000_DEV_ID_82545EM_COPPER: return wol->wolopts ? -EOPNOTSUPP : 0; case E1000_DEV_ID_82546EB_FIBER: From ganesh.venkatesan@intel.com Thu Jan 6 05:20:24 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:20:29 -0800 (PST) Received: from orsfmr002.jf.intel.com (fmr17.intel.com [134.134.136.16]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DKMvZ006581 for ; Thu, 6 Jan 2005 05:20:24 -0800 Received: from orsfmr100.jf.intel.com (orsfmr100.jf.intel.com [10.7.209.16]) by orsfmr002.jf.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071KAXD016673; Fri, 7 Jan 2005 01:20:10 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by orsfmr100.jf.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071JvGQ014557; Fri, 7 Jan 2005 01:20:10 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by orsmsxvs040.jf.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617200909177 ; Thu, 06 Jan 2005 17:20:09 -0800 Date: Thu, 6 Jan 2005 17:20:09 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.4 9/13] e1000: Sparse cleanup - shemminger@osdl.org Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13513 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.4/drivers/net/e1000/e1000.h net-drivers-2.4/drivers/net/e1000.new/e1000.h --- net-drivers-2.4/drivers/net/e1000/e1000.h 2004-12-06 08:43:11.624383592 -0800 +++ net-drivers-2.4/drivers/net/e1000.new/e1000.h 2004-12-06 08:43:12.400265640 -0800 @@ -86,7 +86,7 @@ struct e1000_adapter; #include "e1000_hw.h" -#if DBG +#ifdef DBG #define E1000_DBG(args...) printk(KERN_DEBUG "e1000: " args) #else #define E1000_DBG(args...) diff -up net-drivers-2.4/drivers/net/e1000/e1000_osdep.h net-drivers-2.4/drivers/net/e1000.new/e1000_osdep.h --- net-drivers-2.4/drivers/net/e1000/e1000_osdep.h 2004-12-06 08:43:11.635381920 -0800 +++ net-drivers-2.4/drivers/net/e1000.new/e1000_osdep.h 2004-12-06 08:43:12.576238888 -0800 @@ -69,7 +69,7 @@ typedef enum { #define MSGOUT(S, A, B) printk(KERN_DEBUG S "\n", A, B) -#if DBG +#ifdef DBG #define DEBUGOUT(S) printk(KERN_DEBUG S "\n") #define DEBUGOUT1(S, A...) printk(KERN_DEBUG S "\n", A) #else From ganesh.venkatesan@intel.com Thu Jan 6 05:20:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:20:41 -0800 (PST) Received: from fmsfmr001.fm.intel.com (fmr13.intel.com [192.55.52.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DKbMU006616 for ; Thu, 6 Jan 2005 05:20:37 -0800 Received: from fmsfmr101.fm.intel.com (fmsfmr101.fm.intel.com [10.1.192.59]) by fmsfmr001.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071KPu5027210; Fri, 7 Jan 2005 01:20:25 GMT Received: from fmsmsxvs041.fm.intel.com (fmsmsxvs041.fm.intel.com [132.233.42.126]) by fmsfmr101.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071KLIZ016628; Fri, 7 Jan 2005 01:20:25 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs041.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617202424693 ; Thu, 06 Jan 2005 17:20:24 -0800 Date: Thu, 6 Jan 2005 17:20:24 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.4 11/13] e1000: Applied eeprom fix where it was possible to read/write one more word than what should have been possible Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13515 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.4/drivers/net/e1000/e1000_hw.c net-drivers-2.4/drivers/net/e1000.new/e1000_hw.c --- net-drivers-2.4/drivers/net/e1000/e1000_hw.c 2004-12-06 08:43:11.629382832 -0800 +++ net-drivers-2.4/drivers/net/e1000.new/e1000_hw.c 2004-12-06 08:43:12.460256520 -0800 @@ -3507,7 +3507,7 @@ e1000_read_eeprom(struct e1000_hw *hw, /* A check for invalid values: offset too large, too many words, and not * enough words. */ - if((offset > eeprom->word_size) || (words > eeprom->word_size - offset) || + if((offset >= eeprom->word_size) || (words > eeprom->word_size - offset) || (words == 0)) { DEBUGOUT("\"words\" parameter out of bounds\n"); return -E1000_ERR_EEPROM; @@ -3653,11 +3653,10 @@ e1000_write_eeprom(struct e1000_hw *hw, DEBUGFUNC("e1000_write_eeprom"); - /* A check for invalid values: offset too large, too many words, and not * enough words. */ - if((offset > eeprom->word_size) || (words > eeprom->word_size - offset) || + if((offset >= eeprom->word_size) || (words > eeprom->word_size - offset) || (words == 0)) { DEBUGOUT("\"words\" parameter out of bounds\n"); return -E1000_ERR_EEPROM; From ganesh.venkatesan@intel.com Thu Jan 6 05:20:34 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:20:38 -0800 (PST) Received: from fmsfmr001.fm.intel.com (fmr13.intel.com [192.55.52.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DKV6J006589 for ; Thu, 6 Jan 2005 05:20:33 -0800 Received: from fmsfmr100.fm.intel.com (fmsfmr100.fm.intel.com [10.1.192.58]) by fmsfmr001.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071KIu5027158; Fri, 7 Jan 2005 01:20:18 GMT Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by fmsfmr100.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071KBwH009124; Fri, 7 Jan 2005 01:20:18 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs043.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617201618030 ; Thu, 06 Jan 2005 17:20:17 -0800 Date: Thu, 6 Jan 2005 17:20:17 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.4 10/13] e1000: Added workaround to prevent inadvertent gigabit waveform to be sent out on the wire due to init-time operations on the IGP phy Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13514 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.4/drivers/net/e1000/e1000_hw.c net-drivers-2.4/drivers/net/e1000.new/e1000_hw.c --- net-drivers-2.4/drivers/net/e1000/e1000_hw.c 2004-12-06 08:43:11.629382832 -0800 +++ net-drivers-2.4/drivers/net/e1000.new/e1000_hw.c 2004-12-06 08:43:12.460256520 -0800 @@ -123,17 +123,31 @@ e1000_set_phy_type(struct e1000_hw *hw) static void e1000_phy_init_script(struct e1000_hw *hw) { + uint32_t ret_val; + uint16_t phy_saved_data; + DEBUGFUNC("e1000_phy_init_script"); - + if(hw->phy_init_script) { msec_delay(20); + /* Save off the current value of register 0x2F5B to be restored at + * the end of this routine. */ + ret_val = e1000_read_phy_reg(hw, 0x2F5B, &phy_saved_data); + + /* Disabled the PHY transmitter */ + e1000_write_phy_reg(hw, 0x2F5B, 0x0003); + + msec_delay(20); + e1000_write_phy_reg(hw,0x0000,0x0140); msec_delay(5); - if(hw->mac_type == e1000_82541 || hw->mac_type == e1000_82547) { + switch(hw->mac_type) { + case e1000_82541: + case e1000_82547: e1000_write_phy_reg(hw, 0x1F95, 0x0001); e1000_write_phy_reg(hw, 0x1F71, 0xBD21); @@ -151,12 +165,23 @@ e1000_phy_init_script(struct e1000_hw *h e1000_write_phy_reg(hw, 0x1F96, 0x003F); e1000_write_phy_reg(hw, 0x2010, 0x0008); - } else { + break; + + case e1000_82541_rev_2: + case e1000_82547_rev_2: e1000_write_phy_reg(hw, 0x1F73, 0x0099); + break; + default: + break; } e1000_write_phy_reg(hw, 0x0000, 0x3300); + msec_delay(20); + + /* Now enable the transmitter */ + e1000_write_phy_reg(hw, 0x2F5B, phy_saved_data); + if(hw->mac_type == e1000_82547) { uint16_t fused, fine, coarse; @@ -968,7 +993,7 @@ e1000_setup_copper_link(struct e1000_hw if((hw->mac_type == e1000_82541) || (hw->mac_type == e1000_82547)) { hw->dsp_config_state = e1000_dsp_config_disabled; - /* Force MDI for IGP B-0 PHY */ + /* Force MDI for earlier revs of the IGP PHY */ phy_data &= ~(IGP01E1000_PSCR_AUTO_MDIX | IGP01E1000_PSCR_FORCE_MDI_MDIX); hw->mdix = 1; @@ -4924,7 +4949,7 @@ e1000_config_dsp_after_link_change(struc boolean_t link_up) { int32_t ret_val; - uint16_t phy_data, speed, duplex, i; + uint16_t phy_data, phy_saved_data, speed, duplex, i; uint16_t dsp_reg_array[IGP01E1000_PHY_CHANNEL_NUM] = {IGP01E1000_PHY_AGC_PARAM_A, IGP01E1000_PHY_AGC_PARAM_B, @@ -5005,6 +5030,21 @@ e1000_config_dsp_after_link_change(struc } } else { if(hw->dsp_config_state == e1000_dsp_config_activated) { + /* Save off the current value of register 0x2F5B to be restored at + * the end of the routines. */ + ret_val = e1000_read_phy_reg(hw, 0x2F5B, &phy_saved_data); + + if(ret_val) + return ret_val; + + /* Disable the PHY transmitter */ + ret_val = e1000_write_phy_reg(hw, 0x2F5B, 0x0003); + + if(ret_val) + return ret_val; + + msec_delay(20); + ret_val = e1000_write_phy_reg(hw, 0x0000, IGP01E1000_IEEE_FORCE_GIGA); if(ret_val) @@ -5027,10 +5067,33 @@ e1000_config_dsp_after_link_change(struc if(ret_val) return ret_val; + msec_delay(20); + + /* Now enable the transmitter */ + ret_val = e1000_write_phy_reg(hw, 0x2F5B, phy_saved_data); + + if(ret_val) + return ret_val; + hw->dsp_config_state = e1000_dsp_config_enabled; } if(hw->ffe_config_state == e1000_ffe_config_active) { + /* Save off the current value of register 0x2F5B to be restored at + * the end of the routines. */ + ret_val = e1000_read_phy_reg(hw, 0x2F5B, &phy_saved_data); + + if(ret_val) + return ret_val; + + /* Disable the PHY transmitter */ + ret_val = e1000_write_phy_reg(hw, 0x2F5B, 0x0003); + + if(ret_val) + return ret_val; + + msec_delay(20); + ret_val = e1000_write_phy_reg(hw, 0x0000, IGP01E1000_IEEE_FORCE_GIGA); if(ret_val) @@ -5044,6 +5107,15 @@ e1000_config_dsp_after_link_change(struc IGP01E1000_IEEE_RESTART_AUTONEG); if(ret_val) return ret_val; + + msec_delay(20); + + /* Now enable the transmitter */ + ret_val = e1000_write_phy_reg(hw, 0x2F5B, phy_saved_data); + + if(ret_val) + return ret_val; + hw->ffe_config_state = e1000_ffe_config_enabled; } } From ganesh.venkatesan@intel.com Thu Jan 6 05:20:44 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:20:49 -0800 (PST) Received: from orsfmr005.jf.intel.com (fmr20.intel.com [134.134.136.19]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DKhbK006689 for ; Thu, 6 Jan 2005 05:20:44 -0800 Received: from orsfmr100.jf.intel.com (orsfmr100.jf.intel.com [10.7.209.16]) by orsfmr005.jf.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071KVf5019794; Fri, 7 Jan 2005 01:20:31 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by orsfmr100.jf.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071KKGM014871; Fri, 7 Jan 2005 01:20:31 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by orsmsxvs040.jf.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617203109223 ; Thu, 06 Jan 2005 17:20:31 -0800 Date: Thu, 6 Jan 2005 17:20:31 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.4 12/13] e1000: Applied smart speed fix where the code was forcing smart speed on all the time. Now it will honor the setting defined in the eeprom Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13516 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.4/drivers/net/e1000/e1000_hw.c net-drivers-2.4/drivers/net/e1000.new/e1000_hw.c --- net-drivers-2.4/drivers/net/e1000/e1000_hw.c 2004-12-06 08:43:11.629382832 -0800 +++ net-drivers-2.4/drivers/net/e1000.new/e1000_hw.c 2004-12-06 08:43:12.460256520 -0800 @@ -5203,14 +5203,29 @@ e1000_set_d3_lplu_state(struct e1000_hw * Dx states where the power conservation is most important. During * driver activity we should enable SmartSpeed, so performance is * maintained. */ - ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_CONFIG, &phy_data); - if(ret_val) - return ret_val; + if (hw->smart_speed == e1000_smart_speed_on) { + ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_CONFIG, + &phy_data); + if(ret_val) + return ret_val; - phy_data |= IGP01E1000_PSCFR_SMART_SPEED; - ret_val = e1000_write_phy_reg(hw, IGP01E1000_PHY_PORT_CONFIG, phy_data); - if(ret_val) - return ret_val; + phy_data |= IGP01E1000_PSCFR_SMART_SPEED; + ret_val = e1000_write_phy_reg(hw, IGP01E1000_PHY_PORT_CONFIG, + phy_data); + if(ret_val) + return ret_val; + } else if (hw->smart_speed == e1000_smart_speed_off) { + ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_CONFIG, + &phy_data); + if (ret_val) + return ret_val; + + phy_data &= ~IGP01E1000_PSCFR_SMART_SPEED; + ret_val = e1000_write_phy_reg(hw, IGP01E1000_PHY_PORT_CONFIG, + phy_data); + if(ret_val) + return ret_val; + } } else if((hw->autoneg_advertised == AUTONEG_ADVERTISE_SPEED_DEFAULT) || (hw->autoneg_advertised == AUTONEG_ADVERTISE_10_ALL ) || diff -up net-drivers-2.4/drivers/net/e1000/e1000_hw.h net-drivers-2.4/drivers/net/e1000.new/e1000_hw.h --- net-drivers-2.4/drivers/net/e1000/e1000_hw.h 2004-12-06 08:43:11.633382224 -0800 +++ net-drivers-2.4/drivers/net/e1000.new/e1000_hw.h 2004-12-06 08:43:12.497250896 -0800 @@ -169,6 +169,12 @@ typedef enum { } e1000_downshift; typedef enum { + e1000_smart_speed_default = 0, + e1000_smart_speed_on, + e1000_smart_speed_off +} e1000_smart_speed; + +typedef enum { e1000_polarity_reversal_enabled = 0, e1000_polarity_reversal_disabled, e1000_polarity_reversal_undefined = 0xFF @@ -1027,6 +1033,7 @@ struct e1000_hw { uint8_t perm_mac_addr[NODE_ADDRESS_SIZE]; boolean_t disable_polarity_correction; boolean_t speed_downgraded; + e1000_smart_speed smart_speed; e1000_dsp_config dsp_config_state; boolean_t get_link_status; boolean_t serdes_link_down; From ganesh.venkatesan@intel.com Thu Jan 6 05:20:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:20:56 -0800 (PST) Received: from orsfmr004.jf.intel.com (fmr19.intel.com [134.134.136.18]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DKnZK006796 for ; Thu, 6 Jan 2005 05:20:49 -0800 Received: from orsfmr100.jf.intel.com (orsfmr100.jf.intel.com [10.7.209.16]) by orsfmr004.jf.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071KbBU006387; Fri, 7 Jan 2005 01:20:37 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by orsfmr100.jf.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071KKGW014871; Fri, 7 Jan 2005 01:20:37 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by orsmsxvs040.jf.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617203609241 ; Thu, 06 Jan 2005 17:20:36 -0800 Date: Thu, 6 Jan 2005 17:20:37 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.4 13/13] e1000: Driver version number, white spaces, comments, device id & other changes Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13517 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.4/drivers/net/e1000/e1000.h net-drivers-2.4/drivers/net/e1000.new/e1000.h --- net-drivers-2.4/drivers/net/e1000/e1000.h 2004-12-06 08:43:11.624383592 -0800 +++ net-drivers-2.4/drivers/net/e1000.new/e1000.h 2004-12-06 08:43:12.400265640 -0800 @@ -204,7 +204,7 @@ struct e1000_adapter { spinlock_t stats_lock; atomic_t irq_sem; struct tq_struct tx_timeout_task; - uint8_t fc_autoneg; + uint8_t fc_autoneg; struct timer_list blink_timer; unsigned long led_status; diff -up net-drivers-2.4/drivers/net/e1000/e1000_hw.c net-drivers-2.4/drivers/net/e1000.new/e1000_hw.c --- net-drivers-2.4/drivers/net/e1000/e1000_hw.c 2004-12-06 08:43:11.629382832 -0800 +++ net-drivers-2.4/drivers/net/e1000.new/e1000_hw.c 2004-12-06 08:43:12.460256520 -0800 @@ -270,6 +270,7 @@ e1000_set_mac_type(struct e1000_hw *hw) case E1000_DEV_ID_82546GB_COPPER: case E1000_DEV_ID_82546GB_FIBER: case E1000_DEV_ID_82546GB_SERDES: + case E1000_DEV_ID_82546GB_PCIE: hw->mac_type = e1000_82546_rev_3; break; case E1000_DEV_ID_82541EI: @@ -2138,7 +2139,7 @@ e1000_check_for_link(struct e1000_hw *hw * at gigabit speed, then TBI compatibility is not needed. If we are * at gigabit speed, we turn on TBI compatibility. */ - if(hw->tbi_compatibility_en) { + if(hw->tbi_compatibility_en) { uint16_t speed, duplex; e1000_get_speed_and_duplex(hw, &speed, &duplex); if(speed != SPEED_1000) { @@ -2498,8 +2499,9 @@ e1000_read_phy_reg(struct e1000_hw *hw, (reg_addr > MAX_PHY_MULTI_PAGE_REG)) { ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT, (uint16_t)reg_addr); - if(ret_val) + if(ret_val) { return ret_val; + } } ret_val = e1000_read_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT & reg_addr, @@ -2603,8 +2605,9 @@ e1000_write_phy_reg(struct e1000_hw *hw, (reg_addr > MAX_PHY_MULTI_PAGE_REG)) { ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT, (uint16_t)reg_addr); - if(ret_val) + if(ret_val) { return ret_val; + } } ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT & reg_addr, diff -up net-drivers-2.4/drivers/net/e1000/e1000_hw.h net-drivers-2.4/drivers/net/e1000.new/e1000_hw.h --- net-drivers-2.4/drivers/net/e1000/e1000_hw.h 2004-12-06 08:43:11.633382224 -0800 +++ net-drivers-2.4/drivers/net/e1000.new/e1000_hw.h 2004-12-06 08:43:12.497250896 -0800 @@ -368,6 +368,7 @@ int32_t e1000_set_d3_lplu_state(struct e #define E1000_DEV_ID_82546GB_COPPER 0x1079 #define E1000_DEV_ID_82546GB_FIBER 0x107A #define E1000_DEV_ID_82546GB_SERDES 0x107B +#define E1000_DEV_ID_82546GB_PCIE 0x108A #define E1000_DEV_ID_82547EI 0x1019 #define NODE_ADDRESS_SIZE 6 #define ETH_LENGTH_OF_ADDRESS 6 diff -up net-drivers-2.4/drivers/net/e1000/e1000_main.c net-drivers-2.4/drivers/net/e1000.new/e1000_main.c --- net-drivers-2.4/drivers/net/e1000/e1000_main.c 2004-12-06 08:43:11.635381920 -0800 +++ net-drivers-2.4/drivers/net/e1000.new/e1000_main.c 2004-12-06 08:43:12.534245272 -0800 @@ -34,11 +34,15 @@ * - if_mii support and associated kcompat for older kernels * - More errlogging support from Jon Mason * - Fix TSO issues on PPC64 machines -- Jon Mason - * - * 5.3.11 6/4/04 - * - ethtool register dump reads MANC register conditionally. - * - * 5.3.10 6/1/04 + * 5.6.5 11/01/04 + * - Enabling NETIF_F_SG without checksum offload is illegal - + John Mason + * 5.6.3 10/26/04 + * - Remove redundant initialization - Jamal Hadi + * - Reset buffer_info->dma in tx resource cleanup logic + * 5.6.2 10/12/04 + * - Sparse cleanup - shemminger@osdl.org + * - Fix tx resource cleanup logic */ char e1000_driver_name[] = "e1000"; @@ -48,7 +48,7 @@ char e1000_driver_string[] = "Intel(R) P #else #define DRIVERNAPI "-NAPI" #endif -char e1000_driver_version[] = "5.5.4-k1"DRIVERNAPI; +char e1000_driver_version[] = "5.6.10.1-k1"DRIVERNAPI; char e1000_copyright[] = "Copyright (c) 1999-2004 Intel Corporation."; /* e1000_pci_tbl - PCI Device ID Table @@ -90,6 +94,7 @@ static struct pci_device_id e1000_pci_tb INTEL_E1000_ETHERNET_DEVICE(0x107A), INTEL_E1000_ETHERNET_DEVICE(0x107B), INTEL_E1000_ETHERNET_DEVICE(0x107C), + INTEL_E1000_ETHERNET_DEVICE(0x108A), /* required last entry */ {0,} }; @@ -128,8 +133,6 @@ static int e1000_xmit_frame(struct sk_bu static struct net_device_stats * e1000_get_stats(struct net_device *netdev); static int e1000_change_mtu(struct net_device *netdev, int new_mtu); static int e1000_set_mac(struct net_device *netdev, void *p); -static void e1000_irq_disable(struct e1000_adapter *adapter); -static void e1000_irq_enable(struct e1000_adapter *adapter); static irqreturn_t e1000_intr(int irq, void *data, struct pt_regs *regs); static boolean_t e1000_clean_tx_irq(struct e1000_adapter *adapter); #ifdef CONFIG_E1000_NAPI @@ -146,9 +168,6 @@ static int e1000_ioctl(struct net_device void set_ethtool_ops(struct net_device *netdev); static void e1000_enter_82542_rst(struct e1000_adapter *adapter); static void e1000_leave_82542_rst(struct e1000_adapter *adapter); -static void e1000_rx_checksum(struct e1000_adapter *adapter, - struct e1000_rx_desc *rx_desc, - struct sk_buff *skb); static void e1000_tx_timeout(struct net_device *dev); static void e1000_tx_timeout_task(struct net_device *dev); static void e1000_smartspeed(struct e1000_adapter *adapter); @@ -242,6 +242,33 @@ e1000_exit_module(void) module_exit(e1000_exit_module); +/** + * e1000_irq_disable - Mask off interrupt generation on the NIC + * @adapter: board private structure + **/ + +static inline void +e1000_irq_disable(struct e1000_adapter *adapter) +{ + atomic_inc(&adapter->irq_sem); + E1000_WRITE_REG(&adapter->hw, IMC, ~0); + E1000_WRITE_FLUSH(&adapter->hw); + synchronize_irq(); +} + +/** + * e1000_irq_enable - Enable default interrupt generation settings + * @adapter: board private structure + **/ + +static inline void +e1000_irq_enable(struct e1000_adapter *adapter) +{ + if(likely(atomic_dec_and_test(&adapter->irq_sem))) { + E1000_WRITE_REG(&adapter->hw, IMS, IMS_ENABLE_MASK); + E1000_WRITE_FLUSH(&adapter->hw); + } +} int e1000_up(struct e1000_adapter *adapter) @@ -1805,22 +1824,22 @@ e1000_xmit_frame(struct sk_buff *skb, st /* need: count + 2 desc gap to keep tail from touching * head, otherwise try next time */ - if(E1000_DESC_UNUSED(&adapter->tx_ring) < count + 2) { + if(unlikely(E1000_DESC_UNUSED(&adapter->tx_ring) < count + 2)) { netif_stop_queue(netdev); spin_unlock_irqrestore(&adapter->tx_lock, flags); return 1; } - spin_unlock_irqrestore(&adapter->tx_lock, flags); - if(unlikely(adapter->hw.mac_type == e1000_82547)) { if(unlikely(e1000_82547_fifo_workaround(adapter, skb))) { netif_stop_queue(netdev); mod_timer(&adapter->tx_fifo_stall_timer, jiffies); return 1; + spin_unlock_irqrestore(&adapter->tx_lock, flags); } } + spin_unlock_irqrestore(&adapter->tx_lock, flags); if(unlikely(adapter->vlgrp && vlan_tx_tag_present(skb))) { tx_flags |= E1000_TX_FLAGS_VLAN; tx_flags |= (vlan_tx_tag_get(skb) << E1000_TX_FLAGS_VLAN_SHIFT); @@ -1898,9 +1925,9 @@ e1000_change_mtu(struct net_device *netd int max_frame = new_mtu + ENET_HEADER_SIZE + ETHERNET_FCS_SIZE; if((max_frame < MINIMUM_ETHERNET_FRAME_SIZE) || - (max_frame > MAX_JUMBO_FRAME_SIZE)) { - DPRINTK(PROBE, ERR, "Invalid MTU setting\n"); - return -EINVAL; + (max_frame > MAX_JUMBO_FRAME_SIZE)) { + DPRINTK(PROBE, ERR, "Invalid MTU setting\n"); + return -EINVAL; } if(max_frame <= MAXIMUM_ETHERNET_FRAME_SIZE) { @@ -2068,34 +2095,6 @@ e1000_update_stats(struct e1000_adapter } /** - * e1000_irq_disable - Mask off interrupt generation on the NIC - * @adapter: board private structure - **/ - -static void -e1000_irq_disable(struct e1000_adapter *adapter) -{ - atomic_inc(&adapter->irq_sem); - E1000_WRITE_REG(&adapter->hw, IMC, ~0); - E1000_WRITE_FLUSH(&adapter->hw); - synchronize_irq(); -} - -/** - * e1000_irq_enable - Enable default interrupt generation settings - * @adapter: board private structure - **/ - -static void -e1000_irq_enable(struct e1000_adapter *adapter) -{ - if(likely(atomic_dec_and_test(&adapter->irq_sem))) { - E1000_WRITE_REG(&adapter->hw, IMS, IMS_ENABLE_MASK); - E1000_WRITE_FLUSH(&adapter->hw); - } -} - -/** * e1000_intr - Interrupt Handler * @irq: interrupt number * @data: pointer to a network interface device structure @@ -2228,6 +2227,41 @@ e1000_clean_tx_irq(struct e1000_adapter } /** + * e1000_rx_checksum - Receive Checksum Offload for 82543 + * @adapter: board private structure + * @rx_desc: receive descriptor + * @sk_buff: socket buffer with received data + **/ + +static inline void +e1000_rx_checksum(struct e1000_adapter *adapter, + struct e1000_rx_desc *rx_desc, + struct sk_buff *skb) +{ + /* 82543 or newer only */ + if(unlikely((adapter->hw.mac_type < e1000_82543) || + /* Ignore Checksum bit is set */ + (rx_desc->status & E1000_RXD_STAT_IXSM) || + /* TCP Checksum has not been calculated */ + (!(rx_desc->status & E1000_RXD_STAT_TCPCS)))) { + skb->ip_summed = CHECKSUM_NONE; + return; + } + + /* At this point we know the hardware did the TCP checksum */ + /* now look at the TCP checksum error bit */ + if(rx_desc->errors & E1000_RXD_ERR_TCPE) { + /* let the stack verify checksum errors */ + skb->ip_summed = CHECKSUM_NONE; + adapter->hw_csum_err++; + } else { + /* TCP checksum is good */ + skb->ip_summed = CHECKSUM_UNNECESSARY; + adapter->hw_csum_good++; + } +} + +/** * e1000_clean_rx_irq - Send received data up the network stack * @adapter: board private structure **/ @@ -2275,7 +2309,7 @@ e1000_clean_rx_irq(struct e1000_adapter if(unlikely(!(rx_desc->status & E1000_RXD_STAT_EOP))) { /* All receives must fit into a single buffer */ E1000_DBG("%s: Receive packet consumed multiple" - " buffers\n", netdev->name); + " buffers\n", netdev->name); dev_kfree_skb_irq(skb); goto next_desc; } @@ -2573,41 +2607,6 @@ e1000_mii_ioctl(struct net_device *netde return E1000_SUCCESS; } -/** - * e1000_rx_checksum - Receive Checksum Offload for 82543 - * @adapter: board private structure - * @rx_desc: receive descriptor - * @sk_buff: socket buffer with received data - **/ - -static void -e1000_rx_checksum(struct e1000_adapter *adapter, - struct e1000_rx_desc *rx_desc, - struct sk_buff *skb) -{ - /* 82543 or newer only */ - if(unlikely((adapter->hw.mac_type < e1000_82543) || - /* Ignore Checksum bit is set */ - (rx_desc->status & E1000_RXD_STAT_IXSM) || - /* TCP Checksum has not been calculated */ - (!(rx_desc->status & E1000_RXD_STAT_TCPCS)))) { - skb->ip_summed = CHECKSUM_NONE; - return; - } - - /* At this point we know the hardware did the TCP checksum */ - /* now look at the TCP checksum error bit */ - if(rx_desc->errors & E1000_RXD_ERR_TCPE) { - /* let the stack verify checksum errors */ - skb->ip_summed = CHECKSUM_NONE; - adapter->hw_csum_err++; - } else { - /* TCP checksum is good */ - skb->ip_summed = CHECKSUM_UNNECESSARY; - adapter->hw_csum_good++; - } -} - void e1000_pci_set_mwi(struct e1000_hw *hw) { From ganesh.venkatesan@intel.com Thu Jan 6 05:20:57 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:21:02 -0800 (PST) Received: from fmsfmr005.fm.intel.com (fmr15.intel.com [192.55.52.69]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DKuiS006968 for ; Thu, 6 Jan 2005 05:20:56 -0800 Received: from fmsfmr101.fm.intel.com (fmsfmr101.fm.intel.com [10.1.192.59]) by fmsfmr005.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071Kibh021774; Fri, 7 Jan 2005 01:20:44 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by fmsfmr101.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071KfIZ016894; Fri, 7 Jan 2005 01:20:44 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs042.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617204407548 ; Thu, 06 Jan 2005 17:20:44 -0800 Date: Thu, 6 Jan 2005 17:20:44 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.4 0/13] e1000: driver update Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13518 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev 1 ITR does not default correctly on 2.4.x kernels 2 Fix for kernel panic when the interface is brought down while the NAPI enabled driver is under stress 3 Fix ethtool diagnostics -- specifically for blade server implementations 4 Enabling NETIF_F_SG without checksum offload is illegal -- jdmason@us.ibm.com 5 Apply patch from Jamal (hadi@znyx.com) to remove a redundant assignment to a local nr_frags in e1000_xmit_frame. 6 Synchronizing multicast table setup with transmit path - ak@suse.de 7 fix tx resource cleanup logic 8 {set, get}_wol is now symmetric for 82545EM adapters 9 Sparse cleanup - shemminger@osdl.org 10 Added workaround to prevent inadvertent gigabit waveform to be sent out on the wire due to init-time operations on the IGP phy. 11 Applied eeprom fix where it was possible to read/write one more word than what should have been possible. 12 Applied smart speed fix where the code was forcing smart speed on all the time. Now it will honor the setting defined in the eeprom. 13 Driver version number, white spaces, comments, device id & other changes From ganesh.venkatesan@intel.com Thu Jan 6 05:21:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:21:07 -0800 (PST) Received: from orsfmr003.jf.intel.com (fmr18.intel.com [134.134.136.17]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DL1iA007089 for ; Thu, 6 Jan 2005 05:21:02 -0800 Received: from orsfmr100.jf.intel.com (orsfmr100.jf.intel.com [10.7.209.16]) by orsfmr003.jf.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071KnP6025095; Fri, 7 Jan 2005 01:20:49 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by orsfmr100.jf.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071KiGC015127; Fri, 7 Jan 2005 01:20:49 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by orsmsxvs040.jf.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617204909266 ; Thu, 06 Jan 2005 17:20:49 -0800 Date: Thu, 6 Jan 2005 17:20:49 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 0/14] e1000: driver update Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13519 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev 1 ITR does not default correctly on 2.6.x kernels 2 Fix kernel panic when the interface is brought down while the NAPI enabled driver is under stress 3 Fix ethtool diagnostics -- specifically for blade server implementations 4 Enabling NETIF_F_SG without checksum offload is illegal -- jdmason@us.ibm.com 5 Avoid filling tx_ring completely - shemminger@osdl.org 6 Apply patch from Jamal (hadi@znyx.com) to remove a redundant assignment to a local nr_frags in e1000_xmit_frame. 7 Replace schedule_timeout() with msleep()/msleep_interruptible() nacc@us.ibm.com 8 Fix tx resource cleanup logic 9 {set, get}_wol is now symmetric for 82545EM adapters 10 Kernel API change for Module_param_array_named 11 Added workaround to prevent inadvertent gigabit waveform to be sent out on the wire due to init-time operations on the IGP phy. 12 Applied eeprom fix where it was possible to read/write one more word than what should have been possible. 13 Applied smart speed fix where the code was forcing smart speed on all the time. Now it will honor the setting defined in the eeprom. 14 Driver version number, white spaces, comments, device id & other changes From ganesh.venkatesan@intel.com Thu Jan 6 05:21:27 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:21:31 -0800 (PST) Received: from orsfmr005.jf.intel.com (fmr20.intel.com [134.134.136.19]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DLP6Q007594 for ; Thu, 6 Jan 2005 05:21:26 -0800 Received: from orsfmr100.jf.intel.com (orsfmr100.jf.intel.com [10.7.209.16]) by orsfmr005.jf.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071LDf5020081; Fri, 7 Jan 2005 01:21:13 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by orsfmr100.jf.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071KiGW015127; Fri, 7 Jan 2005 01:21:13 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by orsmsxvs040.jf.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617211309350 ; Thu, 06 Jan 2005 17:21:13 -0800 Date: Thu, 6 Jan 2005 17:21:13 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2/6 4/14] e1000: Enabling NETIF_F_SG without checksum offload is illegal -- jdmason@us.ibm.com Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13523 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/e1000/e1000_main.c net-drivers-2.6/drivers/net/e1000.new/e1000_main.c --- net-drivers-2.6/drivers/net/e1000/e1000_main.c 2004-12-03 07:24:37.090623184 -0800 +++ net-drivers-2.6/drivers/net/e1000.new/e1000_main.c 2004-12-03 07:24:38.581396552 -0800 @@ -475,8 +475,6 @@ e1000_probe(struct pci_dev *pdev, NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER; - } else { - netdev->features = NETIF_F_SG; } #ifdef NETIF_F_TSO From ganesh.venkatesan@intel.com Thu Jan 6 05:21:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:21:20 -0800 (PST) Received: from fmsfmr002.fm.intel.com (fmr14.intel.com [192.55.52.68]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DLDKS007329 for ; Thu, 6 Jan 2005 05:21:13 -0800 Received: from fmsfmr101.fm.intel.com (fmsfmr101.fm.intel.com [10.1.192.59]) by fmsfmr002.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071L1EK025163; Fri, 7 Jan 2005 01:21:01 GMT Received: from fmsmsxvs041.fm.intel.com (fmsmsxvs041.fm.intel.com [132.233.42.126]) by fmsfmr101.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071L0IX017062; Fri, 7 Jan 2005 01:21:00 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs041.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617205924719 ; Thu, 06 Jan 2005 17:21:00 -0800 Date: Thu, 6 Jan 2005 17:21:00 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 2/14] e1000: Fix kernel panic when the interface is brought down while the NAPI enabled driver is under stress Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13521 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/e1000/e1000_main.c net-drivers-2.6/drivers/net/e1000.new/e1000_main.c --- net-drivers-2.6/drivers/net/e1000/e1000_main.c 2004-12-03 07:24:37.090623184 -0800 +++ net-drivers-2.6/drivers/net/e1000.new/e1000_main.c 2004-12-03 07:24:38.581396552 -0800 @@ -2162,6 +2162,9 @@ e1000_clean(struct net_device *netdev, i int tx_cleaned; int work_done = 0; + if (!netif_carrier_ok(netdev)) + goto quit_polling; + tx_cleaned = e1000_clean_tx_irq(adapter); e1000_clean_rx_irq(adapter, &work_done, work_to_do); @@ -2171,7 +2174,7 @@ e1000_clean(struct net_device *netdev, i /* if no Rx and Tx cleanup work was done, exit the polling mode */ if(!tx_cleaned || (work_done < work_to_do) || !netif_running(netdev)) { - netif_rx_complete(netdev); +quit_polling: netif_rx_complete(netdev); e1000_irq_enable(adapter); return 0; } From ganesh.venkatesan@intel.com Thu Jan 6 05:21:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:21:15 -0800 (PST) Received: from fmsfmr002.fm.intel.com (fmr14.intel.com [192.55.52.68]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DL6Bw007191 for ; Thu, 6 Jan 2005 05:21:07 -0800 Received: from fmsfmr100.fm.intel.com (fmsfmr100.fm.intel.com [10.1.192.58]) by fmsfmr002.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071KsEK025130; Fri, 7 Jan 2005 01:20:54 GMT Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by fmsfmr100.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071KmwH009407; Fri, 7 Jan 2005 01:20:54 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs043.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617205318074 ; Thu, 06 Jan 2005 17:20:53 -0800 Date: Thu, 6 Jan 2005 17:20:54 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 1/14] e1000: ITR does not default correctly on 2.6.x kernels Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13520 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/e1000/e1000_param.c net-drivers-2.6/drivers/net/e1000.new/e1000_param.c --- net-drivers-2.6/drivers/net/e1000/e1000_param.c 2004-12-03 07:24:37.091623032 -0800 +++ net-drivers-2.6/drivers/net/e1000.new/e1000_param.c 2004-12-03 07:24:38.662384240 -0800 @@ -470,9 +470,6 @@ e1000_check_options(struct e1000_adapter if (num_InterruptThrottleRate > bd) { adapter->itr = InterruptThrottleRate[bd]; switch(adapter->itr) { - case -1: - adapter->itr = 1; - break; case 0: DPRINTK(PROBE, INFO, "%s turned off\n", opt.name); @@ -481,13 +478,14 @@ e1000_check_options(struct e1000_adapter DPRINTK(PROBE, INFO, "%s set to dynamic mode\n", opt.name); break; + case -1: default: e1000_validate_option(&adapter->itr, &opt, adapter); break; } } else { - adapter->itr = 1; + adapter->itr = opt.def; } } Only in net-drivers-2.6/drivers/net/e1000.new: kcompat_ethtool.c From ganesh.venkatesan@intel.com Thu Jan 6 05:21:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:21:26 -0800 (PST) Received: from fmsfmr001.fm.intel.com (fmr13.intel.com [192.55.52.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DLJk3007446 for ; Thu, 6 Jan 2005 05:21:19 -0800 Received: from fmsfmr100.fm.intel.com (fmsfmr100.fm.intel.com [10.1.192.58]) by fmsfmr001.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071L7u5027420; Fri, 7 Jan 2005 01:21:07 GMT Received: from fmsmsxvs040.fm.intel.com (fmsmsxvs040.fm.intel.com [132.233.42.124]) by fmsfmr100.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071L4wP009524; Fri, 7 Jan 2005 01:21:07 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs040.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617210619743 ; Thu, 06 Jan 2005 17:21:07 -0800 Date: Thu, 6 Jan 2005 17:21:06 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 3/14] e1000: Fix ethtool diagnostics -- specifically for blade server implementations Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13522 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/e1000/e1000_ethtool.c net-drivers-2.6/drivers/net/e1000.new/e1000_ethtool.c --- net-drivers-2.6/drivers/net/e1000/e1000_ethtool.c 2004-12-03 07:24:37.089623336 -0800 +++ net-drivers-2.6/drivers/net/e1000.new/e1000_ethtool.c 2004-12-03 07:24:38.346432272 -0800 @@ -776,7 +776,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data) { struct net_device *netdev = adapter->netdev; - uint32_t icr, mask, i=0, shared_int = TRUE; + uint32_t mask, i=0, shared_int = TRUE; uint32_t irq = adapter->pdev->irq; *data = 0; @@ -784,7 +784,8 @@ e1000_intr_test(struct e1000_adapter *ad /* Hook up test interrupt handler just for this test */ if(!request_irq(irq, &e1000_test_intr, 0, netdev->name, netdev)) { shared_int = FALSE; - } else if(request_irq(irq, &e1000_test_intr, SA_SHIRQ, netdev->name, netdev)){ + } else if(request_irq(irq, &e1000_test_intr, SA_SHIRQ, + netdev->name, netdev)){ *data = 1; return -1; } @@ -793,21 +794,6 @@ e1000_intr_test(struct e1000_adapter *ad E1000_WRITE_REG(&adapter->hw, IMC, 0xFFFFFFFF); msec_delay(10); - /* Interrupts are disabled, so read interrupt cause - * register (icr) twice to verify that there are no interrupts - * pending. icr is clear on read. - */ - icr = E1000_READ_REG(&adapter->hw, ICR); - icr = E1000_READ_REG(&adapter->hw, ICR); - - if(icr != 0) { - /* if icr is non-zero, there is no point - * running other interrupt tests. - */ - *data = 2; - i = 10; - } - /* Test each interrupt */ for(; i < 10; i++) { @@ -856,8 +842,10 @@ e1000_intr_test(struct e1000_adapter *ad * test failed. */ adapter->test_icr = 0; - E1000_WRITE_REG(&adapter->hw, IMC, ~mask); - E1000_WRITE_REG(&adapter->hw, ICS, ~mask); + E1000_WRITE_REG(&adapter->hw, IMC, + (~mask & 0x00007FFF)); + E1000_WRITE_REG(&adapter->hw, ICS, + (~mask & 0x00007FFF)); msec_delay(10); if(adapter->test_icr) { @@ -1336,10 +1324,17 @@ e1000_run_loopback_test(struct e1000_ada msec_delay(200); - pci_dma_sync_single_for_cpu(pdev, rxdr->buffer_info[0].dma, - rxdr->buffer_info[0].length, PCI_DMA_FROMDEVICE); + i = 0; + do { + pci_dma_sync_single_for_cpu(pdev, rxdr->buffer_info[i].dma, + rxdr->buffer_info[i].length, + PCI_DMA_FROMDEVICE); + + if (!e1000_check_lbtest_frame(rxdr->buffer_info[i++].skb, 1024)) + return 0; + } while (i < 64); - return e1000_check_lbtest_frame(rxdr->buffer_info[0].skb, 1024); + return 13; } static int @@ -1358,10 +1353,27 @@ static int e1000_link_test(struct e1000_adapter *adapter, uint64_t *data) { *data = 0; - e1000_check_for_link(&adapter->hw); - if(!(E1000_READ_REG(&adapter->hw, STATUS) & E1000_STATUS_LU)) { - *data = 1; + if (adapter->hw.media_type == e1000_media_type_internal_serdes) { + int i = 0; + adapter->hw.serdes_link_down = TRUE; + + /* on some blade server designs link establishment */ + /* could take as long as 2-3 minutes. */ + do { + e1000_check_for_link(&adapter->hw); + if (adapter->hw.serdes_link_down == FALSE) + return *data; + msec_delay(20); + } while (i++ < 3750); + + *data = 1; + } else { + e1000_check_for_link(&adapter->hw); + + if(!(E1000_READ_REG(&adapter->hw, STATUS) & E1000_STATUS_LU)) { + *data = 1; + } } return *data; } From ganesh.venkatesan@intel.com Thu Jan 6 05:21:38 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:21:42 -0800 (PST) Received: from orsfmr005.jf.intel.com (fmr20.intel.com [134.134.136.19]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DLa19007832 for ; Thu, 6 Jan 2005 05:21:36 -0800 Received: from orsfmr100.jf.intel.com (orsfmr100.jf.intel.com [10.7.209.16]) by orsfmr005.jf.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071LOf5020136; Fri, 7 Jan 2005 01:21:24 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by orsfmr100.jf.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071LOGA015567; Fri, 7 Jan 2005 01:21:24 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by orsmsxvs040.jf.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617212309365 ; Thu, 06 Jan 2005 17:21:23 -0800 Date: Thu, 6 Jan 2005 17:21:24 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 6/14] e1000: Apply patch from Jamal (hadi@znyx.com) to remove a redundant assignment to a local nr_frags in e1000_xmit_frame Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13525 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/e1000/e1000_main.c net-drivers-2.6/drivers/net/e1000.new/e1000_main.c --- net-drivers-2.6/drivers/net/e1000/e1000_main.c 2004-12-03 07:24:37.090623184 -0800 +++ net-drivers-2.6/drivers/net/e1000.new/e1000_main.c 2004-12-03 07:24:38.581396552 -0800 @@ -1760,7 +1760,6 @@ e1000_xmit_frame(struct sk_buff *skb, st unsigned int mss = 0; int count = 0; unsigned int f; - nr_frags = skb_shinfo(skb)->nr_frags; len -= skb->data_len; if(unlikely(skb->len <= 0)) { From ganesh.venkatesan@intel.com Thu Jan 6 05:21:32 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:21:37 -0800 (PST) Received: from fmsfmr002.fm.intel.com (fmr14.intel.com [192.55.52.68]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DLUGO007710 for ; Thu, 6 Jan 2005 05:21:31 -0800 Received: from fmsfmr100.fm.intel.com (fmsfmr100.fm.intel.com [10.1.192.58]) by fmsfmr002.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071LIEK025271; Fri, 7 Jan 2005 01:21:18 GMT Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by fmsfmr100.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071LIwF009648; Fri, 7 Jan 2005 01:21:18 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs043.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617211818118 ; Thu, 06 Jan 2005 17:21:18 -0800 Date: Thu, 6 Jan 2005 17:21:18 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 5/14] e1000: Avoid filling tx_ring completely - shemminger@osdl.org Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13524 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/e1000/e1000_main.c net-drivers-2.6/drivers/net/e1000.new/e1000_main.c --- net-drivers-2.6/drivers/net/e1000/e1000_main.c 2004-12-03 07:24:37.090623184 -0800 +++ net-drivers-2.6/drivers/net/e1000.new/e1000_main.c 2004-12-03 07:24:38.581396552 -0800 @@ -1842,6 +1842,10 @@ e1000_xmit_frame(struct sk_buff *skb, st netdev->trans_start = jiffies; + /* Make sure there is space in the ring for the next send. */ + if(unlikely(E1000_DESC_UNUSED(&adapter->tx_ring) < MAX_SKB_FRAGS + 2)) + netif_stop_queue(netdev); + spin_unlock_irqrestore(&adapter->tx_lock, flags); return NETDEV_TX_OK; } From ganesh.venkatesan@intel.com Thu Jan 6 05:21:59 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:22:05 -0800 (PST) Received: from fmsfmr005.fm.intel.com (fmr15.intel.com [192.55.52.69]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DLuLq008305 for ; Thu, 6 Jan 2005 05:21:56 -0800 Received: from fmsfmr101.fm.intel.com (fmsfmr101.fm.intel.com [10.1.192.59]) by fmsfmr005.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071Libh022066; Fri, 7 Jan 2005 01:21:44 GMT Received: from fmsmsxvs041.fm.intel.com (fmsmsxvs041.fm.intel.com [132.233.42.126]) by fmsfmr101.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071LiIX017650; Fri, 7 Jan 2005 01:21:44 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs041.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617214324758 ; Thu, 06 Jan 2005 17:21:43 -0800 Date: Thu, 6 Jan 2005 17:21:43 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 9/14] e1000: {set, get}_wol is now symmetric for 82545EM adapters Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13528 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/e1000/e1000_ethtool.c net-drivers-2.6/drivers/net/e1000.new/e1000_ethtool.c --- net-drivers-2.6/drivers/net/e1000/e1000_ethtool.c 2004-12-03 07:24:37.089623336 -0800 +++ net-drivers-2.6/drivers/net/e1000.new/e1000_ethtool.c 2004-12-03 07:24:38.346432272 -0800 @@ -1502,6 +1502,8 @@ e1000_set_wol(struct net_device *netdev, case E1000_DEV_ID_82543GC_COPPER: case E1000_DEV_ID_82544EI_FIBER: case E1000_DEV_ID_82546EB_QUAD_COPPER: + case E1000_DEV_ID_82545EM_FIBER: + case E1000_DEV_ID_82545EM_COPPER: return wol->wolopts ? -EOPNOTSUPP : 0; case E1000_DEV_ID_82546EB_FIBER: From ganesh.venkatesan@intel.com Thu Jan 6 05:21:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:22:04 -0800 (PST) Received: from fmsfmr006.fm.intel.com (fmr16.intel.com [192.55.52.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DLq5t008200 for ; Thu, 6 Jan 2005 05:21:52 -0800 Received: from fmsfmr100.fm.intel.com (fmsfmr100.fm.intel.com [10.1.192.58]) by fmsfmr006.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071LdwM008969; Fri, 7 Jan 2005 01:21:40 GMT Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by fmsfmr100.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071LQwR009696; Fri, 7 Jan 2005 01:21:39 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs043.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617213818151 ; Thu, 06 Jan 2005 17:21:39 -0800 Date: Thu, 6 Jan 2005 17:21:39 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 8/14] e1000: Fix tx resource cleanup logic Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13527 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/e1000/e1000_main.c net-drivers-2.6/drivers/net/e1000.new/e1000_main.c --- net-drivers-2.6/drivers/net/e1000/e1000_main.c 2004-12-03 07:24:37.090623184 -0800 +++ net-drivers-2.6/drivers/net/e1000.new/e1000_main.c 2004-12-03 07:24:38.581396552 -0800 @@ -1059,6 +1059,24 @@ e1000_free_tx_resources(struct e1000_ada adapter->tx_ring.desc = NULL; } +static inline void +e1000_unmap_and_free_tx_resource(struct e1000_adapter *adapter, + struct e1000_buffer *buffer_info) +{ + struct pci_dev *pdev = adapter->pdev; + if(buffer_info->dma) { + pci_unmap_page(pdev, + buffer_info->dma, + buffer_info->length, + PCI_DMA_TODEVICE); + buffer_info->dma = 0; + } + if(buffer_info->skb) { + dev_kfree_skb_any(buffer_info->skb); + buffer_info->skb = NULL; + } +} + /** * e1000_clean_tx_ring - Free Tx Buffers * @adapter: board private structure @@ -1069,7 +1087,6 @@ e1000_clean_tx_ring(struct e1000_adapter { struct e1000_desc_ring *tx_ring = &adapter->tx_ring; struct e1000_buffer *buffer_info; - struct pci_dev *pdev = adapter->pdev; unsigned long size; unsigned int i; @@ -1077,17 +1094,7 @@ e1000_clean_tx_ring(struct e1000_adapter for(i = 0; i < tx_ring->count; i++) { buffer_info = &tx_ring->buffer_info[i]; - if(buffer_info->skb) { - - pci_unmap_page(pdev, - buffer_info->dma, - buffer_info->length, - PCI_DMA_TODEVICE); - - dev_kfree_skb(buffer_info->skb); - - buffer_info->skb = NULL; - } + e1000_unmap_and_free_tx_resource(adapter, buffer_info); } size = sizeof(struct e1000_buffer) * tx_ring->count; @@ -2194,7 +2201,6 @@ e1000_clean_tx_irq(struct e1000_adapter { struct e1000_desc_ring *tx_ring = &adapter->tx_ring; struct net_device *netdev = adapter->netdev; - struct pci_dev *pdev = adapter->pdev; struct e1000_tx_desc *tx_desc, *eop_desc; struct e1000_buffer *buffer_info; unsigned int i, eop; @@ -2209,19 +2215,7 @@ e1000_clean_tx_irq(struct e1000_adapter tx_desc = E1000_TX_DESC(*tx_ring, i); buffer_info = &tx_ring->buffer_info[i]; - if(likely(buffer_info->dma)) { - pci_unmap_page(pdev, - buffer_info->dma, - buffer_info->length, - PCI_DMA_TODEVICE); - buffer_info->dma = 0; - } - - if(buffer_info->skb) { - dev_kfree_skb_any(buffer_info->skb); - buffer_info->skb = NULL; - } - + e1000_unmap_and_free_tx_resource(adapter, buffer_info); tx_desc->buffer_addr = 0; tx_desc->lower.data = 0; tx_desc->upper.data = 0; From ganesh.venkatesan@intel.com Thu Jan 6 05:21:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:21:52 -0800 (PST) Received: from orsfmr002.jf.intel.com (fmr17.intel.com [134.134.136.16]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DLjG3008044 for ; Thu, 6 Jan 2005 05:21:45 -0800 Received: from orsfmr100.jf.intel.com (orsfmr100.jf.intel.com [10.7.209.16]) by orsfmr002.jf.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071LXXD017169; Fri, 7 Jan 2005 01:21:33 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by orsfmr100.jf.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071LOGY015567; Fri, 7 Jan 2005 01:21:33 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by orsmsxvs040.jf.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617213309393 ; Thu, 06 Jan 2005 17:21:33 -0800 Date: Thu, 6 Jan 2005 17:21:33 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 7/14] e1000: Replace schedule_timeout() with msleep()/msleep_interruptible() nacc@us.ibm.com Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13526 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/e1000/e1000_ethtool.c net-drivers-2.6/drivers/net/e1000.new/e1000_ethtool.c --- net-drivers-2.6/drivers/net/e1000/e1000_ethtool.c 2004-12-03 07:24:37.089623336 -0800 +++ net-drivers-2.6/drivers/net/e1000.new/e1000_ethtool.c 2004-12-03 07:24:38.346432272 -0800 @@ -1566,9 +1566,7 @@ e1000_phys_id(struct net_device *netdev, e1000_setup_led(&adapter->hw); mod_timer(&adapter->blink_timer, jiffies); - set_current_state(TASK_INTERRUPTIBLE); - - schedule_timeout(data * HZ); + msleep_interruptible(data * 1000); del_timer_sync(&adapter->blink_timer); e1000_led_off(&adapter->hw); clear_bit(E1000_LED_ON, &adapter->led_status); diff -up net-drivers-2.6/drivers/net/e1000/e1000_osdep.h net-drivers-2.6/drivers/net/e1000.new/e1000_osdep.h --- net-drivers-2.6/drivers/net/e1000/e1000_osdep.h 2004-12-03 07:24:37.090623184 -0800 +++ net-drivers-2.6/drivers/net/e1000.new/e1000_osdep.h 2004-12-03 07:24:38.620390624 -0800 @@ -42,13 +42,8 @@ #include #ifndef msec_delay -#define msec_delay(x) do { if(in_interrupt()) { \ - /* Don't mdelay in interrupt context! */ \ - BUG(); \ - } else { \ - set_current_state(TASK_UNINTERRUPTIBLE); \ - schedule_timeout((x * HZ)/1000 + 2); \ - } } while(0) +#define msec_delay(x) msleep(x) + /* Some workarounds require millisecond delays and are run during interrupt * context. Most notably, when establishing link, the phy may need tweaking * but cannot process phy register reads/writes faster than millisecond From ganesh.venkatesan@intel.com Thu Jan 6 05:22:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:22:12 -0800 (PST) Received: from fmsfmr002.fm.intel.com (fmr14.intel.com [192.55.52.68]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DM5rU008484 for ; Thu, 6 Jan 2005 05:22:05 -0800 Received: from fmsfmr100.fm.intel.com (fmsfmr100.fm.intel.com [10.1.192.58]) by fmsfmr002.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071LrEK025432; Fri, 7 Jan 2005 01:21:53 GMT Received: from fmsmsxvs040.fm.intel.com (fmsmsxvs040.fm.intel.com [132.233.42.124]) by fmsfmr100.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071L4x3009524; Fri, 7 Jan 2005 01:21:53 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs040.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617215219806 ; Thu, 06 Jan 2005 17:21:52 -0800 Date: Thu, 6 Jan 2005 17:21:52 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 10/14] e1000: Kernel API change for Module_param_array_named Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13529 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/e1000/e1000_param.c net-drivers-2.6/drivers/net/e1000.new/e1000_param.c --- net-drivers-2.6/drivers/net/e1000/e1000_param.c 2004-12-03 07:24:37.091623032 -0800 +++ net-drivers-2.6/drivers/net/e1000.new/e1000_param.c 2004-12-03 07:24:38.662384240 -0800 @@ -47,7 +47,7 @@ #define E1000_PARAM(X, desc) \ static int __devinitdata X[E1000_MAX_NIC+1] = E1000_PARAM_INIT; \ static int num_##X = 0; \ - module_param_array(X, int, &num_##X, 0); \ + module_param_array_named(X, X, int, &num_##X, 0); \ MODULE_PARM_DESC(X, desc); /* Transmit Descriptor Count From ganesh.venkatesan@intel.com Thu Jan 6 05:22:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:22:26 -0800 (PST) Received: from fmsfmr002.fm.intel.com (fmr14.intel.com [192.55.52.68]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DMIw3008767 for ; Thu, 6 Jan 2005 05:22:19 -0800 Received: from fmsfmr100.fm.intel.com (fmsfmr100.fm.intel.com [10.1.192.58]) by fmsfmr002.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071M6EK025499; Fri, 7 Jan 2005 01:22:06 GMT Received: from fmsmsxvs040.fm.intel.com (fmsmsxvs040.fm.intel.com [132.233.42.124]) by fmsfmr100.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071M6wF009974; Fri, 7 Jan 2005 01:22:06 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs040.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617220519819 ; Thu, 06 Jan 2005 17:22:06 -0800 Date: Thu, 6 Jan 2005 17:22:05 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 12/14] e1000: Applied eeprom fix where it was possible to read/write one more word than what should have been possible Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13531 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/e1000/e1000_hw.c net-drivers-2.6/drivers/net/e1000.new/e1000_hw.c --- net-drivers-2.6/drivers/net/e1000/e1000_hw.c 2004-12-03 07:24:37.090623184 -0800 +++ net-drivers-2.6/drivers/net/e1000.new/e1000_hw.c 2004-12-03 07:24:38.466414032 -0800 @@ -3504,7 +3504,7 @@ e1000_read_eeprom(struct e1000_hw *hw, /* A check for invalid values: offset too large, too many words, and not * enough words. */ - if((offset > eeprom->word_size) || (words > eeprom->word_size - offset) || + if((offset >= eeprom->word_size) || (words > eeprom->word_size - offset) || (words == 0)) { DEBUGOUT("\"words\" parameter out of bounds\n"); return -E1000_ERR_EEPROM; @@ -3652,7 +3652,7 @@ e1000_write_eeprom(struct e1000_hw *hw, /* A check for invalid values: offset too large, too many words, and not * enough words. */ - if((offset > eeprom->word_size) || (words > eeprom->word_size - offset) || + if((offset >= eeprom->word_size) || (words > eeprom->word_size - offset) || (words == 0)) { DEBUGOUT("\"words\" parameter out of bounds\n"); return -E1000_ERR_EEPROM; From ganesh.venkatesan@intel.com Thu Jan 6 05:22:14 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:22:19 -0800 (PST) Received: from fmsfmr006.fm.intel.com (fmr16.intel.com [192.55.52.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DMBgc008603 for ; Thu, 6 Jan 2005 05:22:11 -0800 Received: from fmsfmr100.fm.intel.com (fmsfmr100.fm.intel.com [10.1.192.58]) by fmsfmr006.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071LxwM009103; Fri, 7 Jan 2005 01:21:59 GMT Received: from fmsmsxvs040.fm.intel.com (fmsmsxvs040.fm.intel.com [132.233.42.124]) by fmsfmr100.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071L4x9009524; Fri, 7 Jan 2005 01:21:59 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs040.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617215819812 ; Thu, 06 Jan 2005 17:21:58 -0800 Date: Thu, 6 Jan 2005 17:21:58 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 11/14] e1000: Added workaround to prevent inadvertent gigabit waveform to be sent out on the wire due to init-time operations on the IGP phy Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13530 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/e1000/e1000_hw.c net-drivers-2.6/drivers/net/e1000.new/e1000_hw.c --- net-drivers-2.6/drivers/net/e1000/e1000_hw.c 2004-12-03 07:24:37.090623184 -0800 +++ net-drivers-2.6/drivers/net/e1000.new/e1000_hw.c 2004-12-03 07:24:38.466414032 -0800 @@ -123,16 +123,31 @@ e1000_set_phy_type(struct e1000_hw *hw) static void e1000_phy_init_script(struct e1000_hw *hw) { + uint32_t ret_val; + uint16_t phy_saved_data; + DEBUGFUNC("e1000_phy_init_script"); + if(hw->phy_init_script) { msec_delay(20); + /* Save off the current value of register 0x2F5B to be restored at + * the end of this routine. */ + ret_val = e1000_read_phy_reg(hw, 0x2F5B, &phy_saved_data); + + /* Disabled the PHY transmitter */ + e1000_write_phy_reg(hw, 0x2F5B, 0x0003); + + msec_delay(20); + e1000_write_phy_reg(hw,0x0000,0x0140); msec_delay(5); - if(hw->mac_type == e1000_82541 || hw->mac_type == e1000_82547) { + switch(hw->mac_type) { + case e1000_82541: + case e1000_82547: e1000_write_phy_reg(hw, 0x1F95, 0x0001); e1000_write_phy_reg(hw, 0x1F71, 0xBD21); @@ -150,12 +165,23 @@ e1000_phy_init_script(struct e1000_hw *h e1000_write_phy_reg(hw, 0x1F96, 0x003F); e1000_write_phy_reg(hw, 0x2010, 0x0008); - } else { + break; + + case e1000_82541_rev_2: + case e1000_82547_rev_2: e1000_write_phy_reg(hw, 0x1F73, 0x0099); + break; + default: + break; } e1000_write_phy_reg(hw, 0x0000, 0x3300); + msec_delay(20); + + /* Now enable the transmitter */ + e1000_write_phy_reg(hw, 0x2F5B, phy_saved_data); + if(hw->mac_type == e1000_82547) { uint16_t fused, fine, coarse; @@ -967,7 +993,7 @@ e1000_setup_copper_link(struct e1000_hw if((hw->mac_type == e1000_82541) || (hw->mac_type == e1000_82547)) { hw->dsp_config_state = e1000_dsp_config_disabled; - /* Force MDI for IGP B-0 PHY */ + /* Force MDI for earlier revs of the IGP PHY */ phy_data &= ~(IGP01E1000_PSCR_AUTO_MDIX | IGP01E1000_PSCR_FORCE_MDI_MDIX); hw->mdix = 1; @@ -4918,7 +4944,7 @@ e1000_config_dsp_after_link_change(struc boolean_t link_up) { int32_t ret_val; - uint16_t phy_data, speed, duplex, i; + uint16_t phy_data, phy_saved_data, speed, duplex, i; uint16_t dsp_reg_array[IGP01E1000_PHY_CHANNEL_NUM] = {IGP01E1000_PHY_AGC_PARAM_A, IGP01E1000_PHY_AGC_PARAM_B, @@ -4999,6 +5025,21 @@ e1000_config_dsp_after_link_change(struc } } else { if(hw->dsp_config_state == e1000_dsp_config_activated) { + /* Save off the current value of register 0x2F5B to be restored at + * the end of the routines. */ + ret_val = e1000_read_phy_reg(hw, 0x2F5B, &phy_saved_data); + + if(ret_val) + return ret_val; + + /* Disable the PHY transmitter */ + ret_val = e1000_write_phy_reg(hw, 0x2F5B, 0x0003); + + if(ret_val) + return ret_val; + + msec_delay(20); + ret_val = e1000_write_phy_reg(hw, 0x0000, IGP01E1000_IEEE_FORCE_GIGA); if(ret_val) @@ -5021,10 +5062,33 @@ e1000_config_dsp_after_link_change(struc if(ret_val) return ret_val; + msec_delay(20); + + /* Now enable the transmitter */ + ret_val = e1000_write_phy_reg(hw, 0x2F5B, phy_saved_data); + + if(ret_val) + return ret_val; + hw->dsp_config_state = e1000_dsp_config_enabled; } if(hw->ffe_config_state == e1000_ffe_config_active) { + /* Save off the current value of register 0x2F5B to be restored at + * the end of the routines. */ + ret_val = e1000_read_phy_reg(hw, 0x2F5B, &phy_saved_data); + + if(ret_val) + return ret_val; + + /* Disable the PHY transmitter */ + ret_val = e1000_write_phy_reg(hw, 0x2F5B, 0x0003); + + if(ret_val) + return ret_val; + + msec_delay(20); + ret_val = e1000_write_phy_reg(hw, 0x0000, IGP01E1000_IEEE_FORCE_GIGA); if(ret_val) @@ -5038,6 +5102,15 @@ e1000_config_dsp_after_link_change(struc IGP01E1000_IEEE_RESTART_AUTONEG); if(ret_val) return ret_val; + + msec_delay(20); + + /* Now enable the transmitter */ + ret_val = e1000_write_phy_reg(hw, 0x2F5B, phy_saved_data); + + if(ret_val) + return ret_val; + hw->ffe_config_state = e1000_ffe_config_enabled; } } From ganesh.venkatesan@intel.com Thu Jan 6 05:22:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:22:54 -0800 (PST) Received: from fmsfmr006.fm.intel.com (fmr16.intel.com [192.55.52.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DMjm5009372 for ; Thu, 6 Jan 2005 05:22:48 -0800 Received: from fmsfmr100.fm.intel.com (fmsfmr100.fm.intel.com [10.1.192.58]) by fmsfmr006.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071MXwM009417; Fri, 7 Jan 2005 01:22:33 GMT Received: from fmsmsxvs040.fm.intel.com (fmsmsxvs040.fm.intel.com [132.233.42.124]) by fmsfmr100.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071MWwH010118; Fri, 7 Jan 2005 01:22:33 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs040.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617223319843 ; Thu, 06 Jan 2005 17:22:33 -0800 Date: Thu, 6 Jan 2005 17:22:33 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 5/9] ixgb: Fix ordering of elements in ixgb_buffer to avoid padding by the compiler. Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13534 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/ixgb/ixgb.h net-drivers-2.6/drivers/net/ixgb.new/ixgb.h --- net-drivers-2.6/drivers/net/ixgb/ixgb.h 2005-01-05 17:13:27.000000000 -0800 +++ net-drivers-2.6/drivers/net/ixgb.new/ixgb.h 2005-01-05 17:13:28.000000000 -0800 @@ -120,8 +120,8 @@ struct ixgb_adapter; struct ixgb_buffer { struct sk_buff *skb; uint64_t dma; - uint16_t length; unsigned long time_stamp; + uint16_t length; uint16_t next_to_watch; }; From ganesh.venkatesan@intel.com Thu Jan 6 05:22:34 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:22:41 -0800 (PST) Received: from fmsfmr005.fm.intel.com (fmr15.intel.com [192.55.52.69]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DMUE5009035 for ; Thu, 6 Jan 2005 05:22:33 -0800 Received: from fmsfmr100.fm.intel.com (fmsfmr100.fm.intel.com [10.1.192.58]) by fmsfmr005.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071MIbh022231; Fri, 7 Jan 2005 01:22:18 GMT Received: from fmsmsxvs040.fm.intel.com (fmsmsxvs040.fm.intel.com [132.233.42.124]) by fmsfmr100.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071MHwH010040; Fri, 7 Jan 2005 01:22:18 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs040.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617221819827 ; Thu, 06 Jan 2005 17:22:18 -0800 Date: Thu, 6 Jan 2005 17:22:18 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 14/14] e1000: Driver version number, white spaces, comments, device id & other changes Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13533 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/e1000/e1000_hw.c net-drivers-2.6/drivers/net/e1000.new/e1000_hw.c --- net-drivers-2.6/drivers/net/e1000/e1000_hw.c 2004-12-03 07:24:37.090623184 -0800 +++ net-drivers-2.6/drivers/net/e1000.new/e1000_hw.c 2004-12-03 07:24:38.466414032 -0800 @@ -270,6 +270,7 @@ e1000_set_mac_type(struct e1000_hw *hw) case E1000_DEV_ID_82546GB_COPPER: case E1000_DEV_ID_82546GB_FIBER: case E1000_DEV_ID_82546GB_SERDES: + case E1000_DEV_ID_82546GB_PCIE: hw->mac_type = e1000_82546_rev_3; break; case E1000_DEV_ID_82541EI: @@ -2137,7 +2138,7 @@ e1000_check_for_link(struct e1000_hw *hw * at gigabit speed, then TBI compatibility is not needed. If we are * at gigabit speed, we turn on TBI compatibility. */ - if(hw->tbi_compatibility_en) { + if(hw->tbi_compatibility_en) { uint16_t speed, duplex; e1000_get_speed_and_duplex(hw, &speed, &duplex); if(speed != SPEED_1000) { @@ -2492,12 +2493,14 @@ e1000_read_phy_reg(struct e1000_hw *hw, DEBUGFUNC("e1000_read_phy_reg"); + if(hw->phy_type == e1000_phy_igp && (reg_addr > MAX_PHY_MULTI_PAGE_REG)) { ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT, (uint16_t)reg_addr); - if(ret_val) + if(ret_val) { return ret_val; + } } ret_val = e1000_read_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT & reg_addr, @@ -2596,12 +2599,14 @@ e1000_write_phy_reg(struct e1000_hw *hw, DEBUGFUNC("e1000_write_phy_reg"); + if(hw->phy_type == e1000_phy_igp && (reg_addr > MAX_PHY_MULTI_PAGE_REG)) { ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT, (uint16_t)reg_addr); - if(ret_val) + if(ret_val) { return ret_val; + } } ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT & reg_addr, diff -up net-drivers-2.6/drivers/net/e1000/e1000_hw.h net-drivers-2.6/drivers/net/e1000.new/e1000_hw.h --- net-drivers-2.6/drivers/net/e1000/e1000_hw.h 2004-12-03 07:24:37.090623184 -0800 +++ net-drivers-2.6/drivers/net/e1000.new/e1000_hw.h 2004-12-03 07:24:38.524405216 -0800 @@ -367,6 +367,7 @@ int32_t e1000_set_d3_lplu_state(struct e #define E1000_DEV_ID_82546GB_COPPER 0x1079 #define E1000_DEV_ID_82546GB_FIBER 0x107A #define E1000_DEV_ID_82546GB_SERDES 0x107B +#define E1000_DEV_ID_82546GB_PCIE 0x108A #define E1000_DEV_ID_82547EI 0x1019 #define NODE_ADDRESS_SIZE 6 #define ETH_LENGTH_OF_ADDRESS 6 diff -up net-drivers-2.6/drivers/net/e1000/e1000_main.c net-drivers-2.6/drivers/net/e1000.new/e1000_main.c --- net-drivers-2.6/drivers/net/e1000/e1000_main.c 2004-12-03 07:24:37.090623184 -0800 +++ net-drivers-2.6/drivers/net/e1000.new/e1000_main.c 2004-12-03 07:24:38.581396552 -0800 @@ -35,10 +35,19 @@ * - More errlogging support from Jon Mason * - Fix TSO issues on PPC64 machines -- Jon Mason * - * 5.3.11 6/4/04 - * - ethtool register dump reads MANC register conditionally. - * - * 5.3.10 6/1/04 + * 5.6.5 11/01/04 + * - Enabling NETIF_F_SG without checksum offload is illegal - + John Mason + * 5.6.3 10/26/04 + * - Remove redundant initialization - Jamal Hadi + * - Reset buffer_info->dma in tx resource cleanup logic + * 5.6.2 10/12/04 + * - Avoid filling tx_ring completely - shemminger@osdl.org + * - Replace schedule_timeout() with msleep()/msleep_interruptible() - + * nacc@us.ibm.com + * - Sparse cleanup - shemminger@osdl.org + * - Fix tx resource cleanup logic + * - LLTX support - ak@suse.de and hadi@cyberus.ca */ char e1000_driver_name[] = "e1000"; @@ -48,7 +48,7 @@ char e1000_driver_string[] = "Intel(R) P #else #define DRIVERNAPI "-NAPI" #endif -char e1000_driver_version[] = "5.5.4-k2"DRIVERNAPI; +char e1000_driver_version[] = "5.6.10.1-k2"DRIVERNAPI; char e1000_copyright[] = "Copyright (c) 1999-2004 Intel Corporation."; /* e1000_pci_tbl - PCI Device ID Table @@ -90,6 +99,7 @@ static struct pci_device_id e1000_pci_tb INTEL_E1000_ETHERNET_DEVICE(0x107A), INTEL_E1000_ETHERNET_DEVICE(0x107B), INTEL_E1000_ETHERNET_DEVICE(0x107C), + INTEL_E1000_ETHERNET_DEVICE(0x108A), /* required last entry */ {0,} }; @@ -128,8 +138,6 @@ static int e1000_xmit_frame(struct sk_bu static struct net_device_stats * e1000_get_stats(struct net_device *netdev); static int e1000_change_mtu(struct net_device *netdev, int new_mtu); static int e1000_set_mac(struct net_device *netdev, void *p); -static void e1000_irq_disable(struct e1000_adapter *adapter); -static void e1000_irq_enable(struct e1000_adapter *adapter); static irqreturn_t e1000_intr(int irq, void *data, struct pt_regs *regs); static boolean_t e1000_clean_tx_irq(struct e1000_adapter *adapter); #ifdef CONFIG_E1000_NAPI @@ -146,9 +163,6 @@ static int e1000_ioctl(struct net_device void set_ethtool_ops(struct net_device *netdev); static void e1000_enter_82542_rst(struct e1000_adapter *adapter); static void e1000_leave_82542_rst(struct e1000_adapter *adapter); -static void e1000_rx_checksum(struct e1000_adapter *adapter, - struct e1000_rx_desc *rx_desc, - struct sk_buff *skb); static void e1000_tx_timeout(struct net_device *dev); static void e1000_tx_timeout_task(struct net_device *dev); static void e1000_smartspeed(struct e1000_adapter *adapter); @@ -242,6 +247,33 @@ e1000_exit_module(void) module_exit(e1000_exit_module); +/** + * e1000_irq_disable - Mask off interrupt generation on the NIC + * @adapter: board private structure + **/ + +static inline void +e1000_irq_disable(struct e1000_adapter *adapter) +{ + atomic_inc(&adapter->irq_sem); + E1000_WRITE_REG(&adapter->hw, IMC, ~0); + E1000_WRITE_FLUSH(&adapter->hw); + synchronize_irq(adapter->pdev->irq); +} + +/** + * e1000_irq_enable - Enable default interrupt generation settings + * @adapter: board private structure + **/ + +static inline void +e1000_irq_enable(struct e1000_adapter *adapter) +{ + if(likely(atomic_dec_and_test(&adapter->irq_sem))) { + E1000_WRITE_REG(&adapter->hw, IMS, IMS_ENABLE_MASK); + E1000_WRITE_FLUSH(&adapter->hw); + } +} int e1000_up(struct e1000_adapter *adapter) @@ -1815,7 +1824,7 @@ e1000_xmit_frame(struct sk_buff *skb, st /* need: count + 2 desc gap to keep tail from touching * head, otherwise try next time */ - if(E1000_DESC_UNUSED(&adapter->tx_ring) < count + 2) { + if(unlikely(E1000_DESC_UNUSED(&adapter->tx_ring) < count + 2)) { netif_stop_queue(netdev); spin_unlock_irqrestore(&adapter->tx_lock, flags); return NETDEV_TX_BUSY; @@ -1912,9 +1944,9 @@ e1000_change_mtu(struct net_device *netd int max_frame = new_mtu + ENET_HEADER_SIZE + ETHERNET_FCS_SIZE; if((max_frame < MINIMUM_ETHERNET_FRAME_SIZE) || - (max_frame > MAX_JUMBO_FRAME_SIZE)) { - DPRINTK(PROBE, ERR, "Invalid MTU setting\n"); - return -EINVAL; + (max_frame > MAX_JUMBO_FRAME_SIZE)) { + DPRINTK(PROBE, ERR, "Invalid MTU setting\n"); + return -EINVAL; } if(max_frame <= MAXIMUM_ETHERNET_FRAME_SIZE) { @@ -2082,34 +2114,6 @@ e1000_update_stats(struct e1000_adapter } /** - * e1000_irq_disable - Mask off interrupt generation on the NIC - * @adapter: board private structure - **/ - -static void -e1000_irq_disable(struct e1000_adapter *adapter) -{ - atomic_inc(&adapter->irq_sem); - E1000_WRITE_REG(&adapter->hw, IMC, ~0); - E1000_WRITE_FLUSH(&adapter->hw); - synchronize_irq(adapter->pdev->irq); -} - -/** - * e1000_irq_enable - Enable default interrupt generation settings - * @adapter: board private structure - **/ - -static void -e1000_irq_enable(struct e1000_adapter *adapter) -{ - if(likely(atomic_dec_and_test(&adapter->irq_sem))) { - E1000_WRITE_REG(&adapter->hw, IMS, IMS_ENABLE_MASK); - E1000_WRITE_FLUSH(&adapter->hw); - } -} - -/** * e1000_intr - Interrupt Handler * @irq: interrupt number * @data: pointer to a network interface device structure @@ -2242,6 +2246,41 @@ e1000_clean_tx_irq(struct e1000_adapter } /** + * e1000_rx_checksum - Receive Checksum Offload for 82543 + * @adapter: board private structure + * @rx_desc: receive descriptor + * @sk_buff: socket buffer with received data + **/ + +static inline void +e1000_rx_checksum(struct e1000_adapter *adapter, + struct e1000_rx_desc *rx_desc, + struct sk_buff *skb) +{ + /* 82543 or newer only */ + if(unlikely((adapter->hw.mac_type < e1000_82543) || + /* Ignore Checksum bit is set */ + (rx_desc->status & E1000_RXD_STAT_IXSM) || + /* TCP Checksum has not been calculated */ + (!(rx_desc->status & E1000_RXD_STAT_TCPCS)))) { + skb->ip_summed = CHECKSUM_NONE; + return; + } + + /* At this point we know the hardware did the TCP checksum */ + /* now look at the TCP checksum error bit */ + if(rx_desc->errors & E1000_RXD_ERR_TCPE) { + /* let the stack verify checksum errors */ + skb->ip_summed = CHECKSUM_NONE; + adapter->hw_csum_err++; + } else { + /* TCP checksum is good */ + skb->ip_summed = CHECKSUM_UNNECESSARY; + adapter->hw_csum_good++; + } +} + +/** * e1000_clean_rx_irq - Send received data up the network stack * @adapter: board private structure **/ @@ -2289,7 +2328,7 @@ e1000_clean_rx_irq(struct e1000_adapter if(unlikely(!(rx_desc->status & E1000_RXD_STAT_EOP))) { /* All receives must fit into a single buffer */ E1000_DBG("%s: Receive packet consumed multiple" - " buffers\n", netdev->name); + " buffers\n", netdev->name); dev_kfree_skb_irq(skb); goto next_desc; } @@ -2374,8 +2413,8 @@ e1000_alloc_rx_buffers(struct e1000_adap buffer_info = &rx_ring->buffer_info[i]; while(!buffer_info->skb) { - skb = dev_alloc_skb(adapter->rx_buffer_len + NET_IP_ALIGN); + if(unlikely(!skb)) { /* Better luck next round */ break; @@ -2585,41 +2624,6 @@ e1000_mii_ioctl(struct net_device *netde return E1000_SUCCESS; } -/** - * e1000_rx_checksum - Receive Checksum Offload for 82543 - * @adapter: board private structure - * @rx_desc: receive descriptor - * @sk_buff: socket buffer with received data - **/ - -static void -e1000_rx_checksum(struct e1000_adapter *adapter, - struct e1000_rx_desc *rx_desc, - struct sk_buff *skb) -{ - /* 82543 or newer only */ - if(unlikely((adapter->hw.mac_type < e1000_82543) || - /* Ignore Checksum bit is set */ - (rx_desc->status & E1000_RXD_STAT_IXSM) || - /* TCP Checksum has not been calculated */ - (!(rx_desc->status & E1000_RXD_STAT_TCPCS)))) { - skb->ip_summed = CHECKSUM_NONE; - return; - } - - /* At this point we know the hardware did the TCP checksum */ - /* now look at the TCP checksum error bit */ - if(rx_desc->errors & E1000_RXD_ERR_TCPE) { - /* let the stack verify checksum errors */ - skb->ip_summed = CHECKSUM_NONE; - adapter->hw_csum_err++; - } else { - /* TCP checksum is good */ - skb->ip_summed = CHECKSUM_UNNECESSARY; - adapter->hw_csum_good++; - } -} - void e1000_pci_set_mwi(struct e1000_hw *hw) { From ganesh.venkatesan@intel.com Thu Jan 6 05:22:27 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:22:32 -0800 (PST) Received: from fmsfmr002.fm.intel.com (fmr14.intel.com [192.55.52.68]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DMOqT008904 for ; Thu, 6 Jan 2005 05:22:25 -0800 Received: from fmsfmr100.fm.intel.com (fmsfmr100.fm.intel.com [10.1.192.58]) by fmsfmr002.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071MCEK025526; Fri, 7 Jan 2005 01:22:12 GMT Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by fmsfmr100.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071MBwJ010006; Fri, 7 Jan 2005 01:22:12 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs043.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617221218184 ; Thu, 06 Jan 2005 17:22:12 -0800 Date: Thu, 6 Jan 2005 17:22:12 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 13/14] e1000: Applied smart speed fix where the code was forcing smart speed on all the time. Now it will honor the setting defined in the eeprom Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13532 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/e1000/e1000_hw.c net-drivers-2.6/drivers/net/e1000.new/e1000_hw.c --- net-drivers-2.6/drivers/net/e1000/e1000_hw.c 2004-12-03 07:24:37.090623184 -0800 +++ net-drivers-2.6/drivers/net/e1000.new/e1000_hw.c 2004-12-03 07:24:38.466414032 -0800 @@ -5199,14 +5199,29 @@ e1000_set_d3_lplu_state(struct e1000_hw * Dx states where the power conservation is most important. During * driver activity we should enable SmartSpeed, so performance is * maintained. */ - ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_CONFIG, &phy_data); - if(ret_val) - return ret_val; + if (hw->smart_speed == e1000_smart_speed_on) { + ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_CONFIG, + &phy_data); + if(ret_val) + return ret_val; - phy_data |= IGP01E1000_PSCFR_SMART_SPEED; - ret_val = e1000_write_phy_reg(hw, IGP01E1000_PHY_PORT_CONFIG, phy_data); - if(ret_val) - return ret_val; + phy_data |= IGP01E1000_PSCFR_SMART_SPEED; + ret_val = e1000_write_phy_reg(hw, IGP01E1000_PHY_PORT_CONFIG, + phy_data); + if(ret_val) + return ret_val; + } else if (hw->smart_speed == e1000_smart_speed_off) { + ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_CONFIG, + &phy_data); + if (ret_val) + return ret_val; + + phy_data &= ~IGP01E1000_PSCFR_SMART_SPEED; + ret_val = e1000_write_phy_reg(hw, IGP01E1000_PHY_PORT_CONFIG, + phy_data); + if(ret_val) + return ret_val; + } } else if((hw->autoneg_advertised == AUTONEG_ADVERTISE_SPEED_DEFAULT) || (hw->autoneg_advertised == AUTONEG_ADVERTISE_10_ALL ) || diff -up net-drivers-2.6/drivers/net/e1000/e1000_hw.h net-drivers-2.6/drivers/net/e1000.new/e1000_hw.h --- net-drivers-2.6/drivers/net/e1000/e1000_hw.h 2004-12-03 07:24:37.090623184 -0800 +++ net-drivers-2.6/drivers/net/e1000.new/e1000_hw.h 2004-12-03 07:24:38.524405216 -0800 @@ -168,6 +168,12 @@ typedef enum { } e1000_downshift; typedef enum { + e1000_smart_speed_default = 0, + e1000_smart_speed_on, + e1000_smart_speed_off +} e1000_smart_speed; + +typedef enum { e1000_polarity_reversal_enabled = 0, e1000_polarity_reversal_disabled, e1000_polarity_reversal_undefined = 0xFF @@ -1026,6 +1032,7 @@ struct e1000_hw { uint8_t perm_mac_addr[NODE_ADDRESS_SIZE]; boolean_t disable_polarity_correction; boolean_t speed_downgraded; + e1000_smart_speed smart_speed; e1000_dsp_config dsp_config_state; boolean_t get_link_status; boolean_t serdes_link_down; From ganesh.venkatesan@intel.com Thu Jan 6 05:23:12 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:23:17 -0800 (PST) Received: from fmsfmr005.fm.intel.com (fmr15.intel.com [192.55.52.69]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DN9tZ009915 for ; Thu, 6 Jan 2005 05:23:10 -0800 Received: from fmsfmr101.fm.intel.com (fmsfmr101.fm.intel.com [10.1.192.59]) by fmsfmr005.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071Mvbh022371; Fri, 7 Jan 2005 01:22:57 GMT Received: from fmsmsxvs041.fm.intel.com (fmsmsxvs041.fm.intel.com [132.233.42.126]) by fmsfmr101.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071MvIX018753; Fri, 7 Jan 2005 01:22:57 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs041.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617225724841 ; Thu, 06 Jan 2005 17:22:57 -0800 Date: Thu, 6 Jan 2005 17:22:56 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 1/9] ixgb: Enabling MSI on a PCI slot (not PCI-X) may not work, so always disable MSI for PCI slots, enable message signalled interrupts on 82597EX based adapters Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13536 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/ixgb/ixgb.h net-drivers-2.6/drivers/net/ixgb.new/ixgb.h --- net-drivers-2.6/drivers/net/ixgb/ixgb.h 2005-01-05 17:13:27.000000000 -0800 +++ net-drivers-2.6/drivers/net/ixgb.new/ixgb.h 2005-01-05 17:13:28.000000000 -0800 @@ -188,5 +188,9 @@ struct ixgb_adapter { /* structs defined in ixgb_hw.h */ struct ixgb_hw hw; struct ixgb_hw_stats stats; + uint32_t pci_state[16]; +#ifdef CONFIG_PCI_MSI + boolean_t have_msi; +#endif }; #endif /* _IXGB_H_ */ diff -up net-drivers-2.6/drivers/net/ixgb/ixgb_main.c net-drivers-2.6/drivers/net/ixgb.new/ixgb_main.c --- net-drivers-2.6/drivers/net/ixgb/ixgb_main.c 2005-01-05 17:13:27.000000000 -0800 +++ net-drivers-2.6/drivers/net/ixgb.new/ixgb_main.c 2005-01-05 17:13:29.000000000 -0800 @@ -238,6 +238,23 @@ ixgb_up(struct ixgb_adapter *adapter) ixgb_configure_rx(adapter); ixgb_alloc_rx_buffers(adapter); +#ifdef CONFIG_PCI_MSI + { + boolean_t pcix = (IXGB_READ_REG(&adapter->hw, STATUS) & + IXGB_STATUS_PCIX_MODE) ? TRUE : FALSE; + adapter->have_msi = TRUE; + + if (!pcix) + adapter->have_msi = FALSE; + else if((err = pci_enable_msi(adapter->pdev))) { + printk (KERN_ERR + "Unable to allocate MSI interrupt Error: %d\n", err); + adapter->have_msi = FALSE; + /* proceed to try to request regular interrupt */ + } + } + +#endif if((err = request_irq(adapter->pdev->irq, &ixgb_intr, SA_SHIRQ | SA_SAMPLE_RANDOM, netdev->name, netdev))) @@ -278,6 +278,11 @@ ixgb_down(struct ixgb_adapter *adapter, ixgb_irq_disable(adapter); free_irq(adapter->pdev->irq, netdev); +#ifdef CONFIG_PCI_MSI + if(adapter->have_msi == TRUE) + pci_disable_msi(adapter->pdev); + +#endif if(kill_watchdog) del_timer_sync(&adapter->watchdog_timer); adapter->link_speed = 0; From ganesh.venkatesan@intel.com Thu Jan 6 05:22:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:23:00 -0800 (PST) Received: from fmsfmr005.fm.intel.com (fmr15.intel.com [192.55.52.69]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DMptv009506 for ; Thu, 6 Jan 2005 05:22:52 -0800 Received: from fmsfmr100.fm.intel.com (fmsfmr100.fm.intel.com [10.1.192.58]) by fmsfmr005.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071Mdbh022300; Fri, 7 Jan 2005 01:22:39 GMT Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by fmsfmr100.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071MdwF010181; Fri, 7 Jan 2005 01:22:39 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs043.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617223818211 ; Thu, 06 Jan 2005 17:22:39 -0800 Date: Thu, 6 Jan 2005 17:22:38 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 0/9] ixgb: driver update Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13535 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev 1 Enabling MSI on a PCI slot (not PCI-X) may not work, so always disable MSI for PCI slots, enable message signalled interrupts on 82597EX based adapters 2 Limit number of Rx descriptors to 512. 3 Add support for LR device ID 4 Include Tx workdone in deciding when to quit polling, Robert Olsson's fix for NAPI quit condition, avoid polling routine racing with the interface down routine 5 Fix ordering of elements in ixgb_buffer to avoid padding by the compiler. 6 Fix tx cleanup logic error. 7 Remove support for RAIDC interrupt moderation. 8 Support for 2.6.x style module parameters 9 White space/driver version number update. From ganesh.venkatesan@intel.com Thu Jan 6 05:23:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:23:32 -0800 (PST) Received: from orsfmr004.jf.intel.com (fmr19.intel.com [134.134.136.18]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DNFTH010012 for ; Thu, 6 Jan 2005 05:23:23 -0800 Received: from orsfmr100.jf.intel.com (orsfmr100.jf.intel.com [10.7.209.16]) by orsfmr004.jf.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071N3BU007298; Fri, 7 Jan 2005 01:23:03 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by orsfmr100.jf.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071MkGM016489; Fri, 7 Jan 2005 01:23:02 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by orsmsxvs040.jf.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617230209601 ; Thu, 06 Jan 2005 17:23:02 -0800 Date: Thu, 6 Jan 2005 17:23:02 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 2/9] ixgb: Limit number of Rx descriptors to 512 Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13537 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/ixgb/ixgb.h net-drivers-2.6/drivers/net/ixgb.new/ixgb.h --- net-drivers-2.6/drivers/net/ixgb/ixgb.h 2005-01-05 17:13:27.000000000 -0800 +++ net-drivers-2.6/drivers/net/ixgb.new/ixgb.h 2005-01-05 17:13:28.000000000 -0800 @@ -91,9 +91,14 @@ struct ixgb_adapter; #define MAX_TXD 4096 #define MIN_TXD 64 -#define DEFAULT_RXD 1024 -#define MAX_RXD 4096 #define MIN_RXD 64 +/* hardware cannot reliably support more than 512 descriptors owned by + * hardware descriptor cache otherwise an unreliable ring under heavy + * recieve load may result */ +/* #define DEFAULT_RXD 1024 */ +/* #define MAX_RXD 4096 */ +#define DEFAULT_RXD 512 +#define MAX_RXD 512 /* Supported Rx Buffer Sizes */ #define IXGB_RXBUFFER_2048 2048 From ganesh.venkatesan@intel.com Thu Jan 6 05:23:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:23:32 -0800 (PST) Received: from fmsfmr001.fm.intel.com (fmr13.intel.com [192.55.52.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DNKse010138 for ; Thu, 6 Jan 2005 05:23:26 -0800 Received: from fmsfmr101.fm.intel.com (fmsfmr101.fm.intel.com [10.1.192.59]) by fmsfmr001.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071N8u5028090; Fri, 7 Jan 2005 01:23:08 GMT Received: from fmsmsxvs041.fm.intel.com (fmsmsxvs041.fm.intel.com [132.233.42.126]) by fmsfmr101.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071MvIf018753; Fri, 7 Jan 2005 01:23:08 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs041.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617230824855 ; Thu, 06 Jan 2005 17:23:08 -0800 Date: Thu, 6 Jan 2005 17:23:08 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 3/9] ixgb: Add support for LR device ID Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13538 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/ixgb/ixgb_ids.h net-drivers-2.6/drivers/net/ixgb.new/ixgb_ids.h --- net-drivers-2.6/drivers/net/ixgb/ixgb_ids.h 2005-01-05 17:13:27.000000000 -0800 +++ net-drivers-2.6/drivers/net/ixgb.new/ixgb_ids.h 2005-01-05 17:13:29.000000000 -0800 @@ -43,6 +43,7 @@ #define IXGB_DEVICE_ID_82597EX_SR 0x1A48 #define IXGB_SUBDEVICE_ID_A11F 0xA11F #define IXGB_SUBDEVICE_ID_A01F 0xA01F +#define IXGB_DEVICE_ID_82597EX_LR 0x1B48 #endif /* #ifndef _IXGB_IDS_H_ */ diff -up net-drivers-2.6/drivers/net/ixgb/ixgb_main.c net-drivers-2.6/drivers/net/ixgb.new/ixgb_main.c --- net-drivers-2.6/drivers/net/ixgb/ixgb_main.c 2005-01-05 17:13:27.000000000 -0800 +++ net-drivers-2.6/drivers/net/ixgb.new/ixgb_main.c 2005-01-05 17:13:29.000000000 -0800 @@ -51,6 +51,8 @@ static struct pci_device_id ixgb_pci_tbl PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {INTEL_VENDOR_ID, IXGB_DEVICE_ID_82597EX_SR, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {INTEL_VENDOR_ID, IXGB_DEVICE_ID_82597EX_LR, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* required last entry */ {0,} @@ -548,6 +533,7 @@ ixgb_sw_init(struct ixgb_adapter *adapte hw->max_frame_size = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH; if((hw->device_id == IXGB_DEVICE_ID_82597EX) + ||(hw->device_id == IXGB_DEVICE_ID_82597EX_LR) ||(hw->device_id == IXGB_DEVICE_ID_82597EX_SR)) hw->mac_type = ixgb_82597; else { From ganesh.venkatesan@intel.com Thu Jan 6 05:25:32 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:25:39 -0800 (PST) Received: from fmsfmr002.fm.intel.com (fmr14.intel.com [192.55.52.68]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DPP9U012611 for ; Thu, 6 Jan 2005 05:25:32 -0800 Received: from fmsfmr100.fm.intel.com (fmsfmr100.fm.intel.com [10.1.192.58]) by fmsfmr002.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071PDEK026347; Fri, 7 Jan 2005 01:25:13 GMT Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by fmsfmr100.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071P1wP011101; Fri, 7 Jan 2005 01:25:13 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs043.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617251218355 ; Thu, 06 Jan 2005 17:25:13 -0800 Date: Thu, 6 Jan 2005 17:25:12 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 4/9] ixgb: Include Tx workdone in deciding when to quit polling, Robert Olsson's fix for NAPI quit condition, avoid polling routine racing with the interface down routine Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13539 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/ixgb/ixgb_main.c net-drivers-2.6/drivers/net/ixgb.new/ixgb_main.c --- net-drivers-2.6/drivers/net/ixgb/ixgb_main.c 2005-01-05 17:13:27.000000000 -0800 +++ net-drivers-2.6/drivers/net/ixgb.new/ixgb_main.c 2005-01-05 17:13:29.000000000 -0800 @@ -1701,22 +1701,27 @@ ixgb_clean(struct net_device *netdev, in { struct ixgb_adapter *adapter = netdev->priv; int work_to_do = min(*budget, netdev->quota); + int tx_cleaned; int work_done = 0; + + if (!netif_carrier_ok(netdev)) + goto quit_polling; - ixgb_clean_tx_irq(adapter); + tx_cleaned = ixgb_clean_tx_irq(adapter); ixgb_clean_rx_irq(adapter, &work_done, work_to_do); *budget -= work_done; netdev->quota -= work_done; - - if (work_done < work_to_do || !netif_running(netdev)) { - netif_rx_complete(netdev); - /* RAIDC will be automatically restarted by irq_enable */ + + /* if cleanup and not enough Rx work done, exit the polling mode */ + if((!tx_cleaned && (work_done < work_to_do)) || + !netif_running(netdev)) { +quit_polling: netif_rx_complete(netdev); ixgb_irq_enable(adapter); return 0; } - return (work_done >= work_to_do); + return 1; } #endif From ganesh.venkatesan@intel.com Thu Jan 6 05:26:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:26:41 -0800 (PST) Received: from fmsfmr005.fm.intel.com (fmr15.intel.com [192.55.52.69]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DQYC8018693 for ; Thu, 6 Jan 2005 05:26:35 -0800 Received: from fmsfmr100.fm.intel.com (fmsfmr100.fm.intel.com [10.1.192.58]) by fmsfmr005.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071QLbh023406; Fri, 7 Jan 2005 01:26:21 GMT Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by fmsfmr100.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071QLwF011733; Fri, 7 Jan 2005 01:26:21 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs043.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617262118435 ; Thu, 06 Jan 2005 17:26:21 -0800 Date: Thu, 6 Jan 2005 17:26:21 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 7/9] ixgb: Remove support for RAIDC interrupt moderation Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13541 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/ixgb/ixgb.h net-drivers-2.6/drivers/net/ixgb.new/ixgb.h --- net-drivers-2.6/drivers/net/ixgb/ixgb.h 2005-01-05 17:13:27.000000000 -0800 +++ net-drivers-2.6/drivers/net/ixgb.new/ixgb.h 2005-01-05 17:13:28.000000000 -0800 @@ -182,7 +182,6 @@ struct ixgb_desc_ring { uint64_t hw_csum_rx_error; uint64_t hw_csum_rx_good; uint32_t rx_int_delay; - boolean_t raidc; boolean_t rx_csum; /* OS defined structs */ diff -up net-drivers-2.6/drivers/net/ixgb/ixgb_main.c net-drivers-2.6/drivers/net/ixgb.new/ixgb_main.c --- net-drivers-2.6/drivers/net/ixgb/ixgb_main.c 2005-01-05 17:13:27.000000000 -0800 +++ net-drivers-2.6/drivers/net/ixgb.new/ixgb_main.c 2005-01-05 17:13:29.000000000 -0800 @@ -850,44 +850,6 @@ ixgb_configure_rx(struct ixgb_adapter *a | RXDCTL_PTHRESH_DEFAULT << IXGB_RXDCTL_PTHRESH_SHIFT; IXGB_WRITE_REG(hw, RXDCTL, rxdctl); - if (adapter->raidc) { - uint32_t raidc; - uint8_t poll_threshold; - - /* Poll every rx_int_delay period, if RBD exists - * Receive Backlog Detection is set to - * Rx Descriptors - * max is 0x3F == set to poll when 504 RxDesc left - * min is 0 */ - - /* polling times are 1 == 0.8192us - 2 == 1.6384us - 3 == 3.2768us etc - ... - 511 == 418 us - */ -#define IXGB_RAIDC_POLL_DEFAULT 122 /* set to poll every ~100 us under load - also known as 10000 interrupts / sec */ - - /* divide this by 2^3 (8) to get a register size count */ - poll_threshold = ((adapter->rx_ring.count-1) >> 3); - /* poll at half of that size */ - poll_threshold >>= 1; - /* make sure its not bigger than our max */ - poll_threshold &= 0x3F; - - raidc = - IXGB_RAIDC_EN | /* turn on raidc style moderation */ - IXGB_RAIDC_RXT_GATE | /* don't interrupt with rxt0 while - in RBD mode (polling) */ - (IXGB_RAIDC_POLL_DEFAULT << IXGB_RAIDC_POLL_SHIFT) | - /* this sets the regular "min interrupt delay" */ - (adapter-> rx_int_delay << IXGB_RAIDC_DELAY_SHIFT) | - poll_threshold; - - IXGB_WRITE_REG(hw, RAIDC, raidc); - } - /* Enable Receive Checksum Offload for TCP and UDP */ if(adapter->rx_csum == TRUE) { rxcsum = IXGB_READ_REG(hw, RXCSUM); @@ -1684,16 +1684,7 @@ ixgb_intr(int irq, void *data, struct pt if(!ixgb_clean_rx_irq(adapter) & !ixgb_clean_tx_irq(adapter)) break; - /* if RAIDC:EN == 1 and ICR:RXDMT0 == 1, we need to - * set IMS:RXDMT0 to 1 to restart the RBD timer (POLL) - */ - if ((icr & IXGB_INT_RXDMT0) && adapter->raidc) { - /* ready the timer by writing the clear reg */ - IXGB_WRITE_REG(hw, IMC, IXGB_INT_RXDMT0); - /* now restart it, h/w will decide if its necessary */ - IXGB_WRITE_REG(hw, IMS, IXGB_INT_RXDMT0); - } -#endif +#endif return IRQ_HANDLED; } @@ -1974,13 +1927,8 @@ ixgb_alloc_rx_buffers(struct ixgb_adapte buffer_info = &rx_ring->buffer_info[i]; cleancount = IXGB_DESC_UNUSED (rx_ring); - /* lessen this to 4 if we're - * in the midst of raidc and rbd is occuring - * because we don't want to delay returning buffers when low - */ - num_group_tail_writes - = adapter->raidc ? 4 : IXGB_RX_BUFFER_WRITE; - + num_group_tail_writes = IXGB_RX_BUFFER_WRITE; + /* leave one descriptor unused */ while(--cleancount > 0) { rx_desc = IXGB_RX_DESC(*rx_ring, i); diff -up net-drivers-2.6/drivers/net/ixgb/ixgb_param.c net-drivers-2.6/drivers/net/ixgb.new/ixgb_param.c --- net-drivers-2.6/drivers/net/ixgb/ixgb_param.c 2005-01-05 18:01:29.000000000 -0800 +++ net-drivers-2.6/drivers/net/ixgb.new/ixgb_param.c 2005-01-05 18:01:31.000000000 -0800 @@ -121,15 +121,6 @@ IXGB_PARAM(TxIntDelay, "Transmit Interru IXGB_PARAM(RxIntDelay, "Receive Interrupt Delay"); -/* Receive Interrupt Moderation enable (uses RxIntDelay too) - * - * Valid Range: 0,1 - * - * Default Value: 1 - */ - -IXGB_PARAM(RAIDC, "Disable or enable Receive Interrupt Moderation"); - /* Receive Flow control high threshold (when we send a pause frame) * (FCRTH) * @@ -430,17 +436,6 @@ ixgb_check_options(struct ixgb_adapter * adapter->rx_int_delay = RxIntDelay[bd]; ixgb_validate_option(&adapter->rx_int_delay, &opt); } - { /* Receive Interrupt Moderation */ - struct ixgb_option opt = { - .type = enable_option, - .name = "Advanced Receive Interrupt Moderation", - .err = "defaulting to Enabled", - .def = OPTION_ENABLED - }; - int raidc = RAIDC[bd]; - - ixgb_validate_option(&raidc, &opt); - adapter->raidc = raidc; } { /* Transmit Interrupt Delay */ struct ixgb_option opt = { From ganesh.venkatesan@intel.com Thu Jan 6 05:26:30 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:26:35 -0800 (PST) Received: from fmsfmr006.fm.intel.com (fmr16.intel.com [192.55.52.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DQQGL018508 for ; Thu, 6 Jan 2005 05:26:28 -0800 Received: from fmsfmr101.fm.intel.com (fmsfmr101.fm.intel.com [10.1.192.59]) by fmsfmr006.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071QEwM011659; Fri, 7 Jan 2005 01:26:14 GMT Received: from fmsmsxvs041.fm.intel.com (fmsmsxvs041.fm.intel.com [132.233.42.126]) by fmsfmr101.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071PsIn021525; Fri, 7 Jan 2005 01:26:14 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs041.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617261325095 ; Thu, 06 Jan 2005 17:26:13 -0800 Date: Thu, 6 Jan 2005 17:26:13 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 6/9] ixgb: Fix tx cleanup logic error Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13540 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/ixgb/ixgb_main.c net-drivers-2.6/drivers/net/ixgb.new/ixgb_main.c --- net-drivers-2.6/drivers/net/ixgb/ixgb_main.c 2005-01-05 17:13:27.000000000 -0800 +++ net-drivers-2.6/drivers/net/ixgb.new/ixgb_main.c 2005-01-05 17:13:29.000000000 -0800 @@ -923,6 +923,24 @@ ixgb_free_tx_resources(struct ixgb_adapt adapter->tx_ring.desc = NULL; } +static inline void +ixgb_unmap_and_free_tx_resource(struct ixgb_adapter *adapter, + struct ixgb_buffer *buffer_info) +{ + struct pci_dev *pdev = adapter->pdev; + if(buffer_info->dma) { + pci_unmap_page(pdev, + buffer_info->dma, + buffer_info->length, + PCI_DMA_TODEVICE); + buffer_info->dma = 0; + } + if(buffer_info->skb) { + dev_kfree_skb_any(buffer_info->skb); + buffer_info->skb = NULL; + } +} + /** * ixgb_clean_tx_ring - Free Tx Buffers * @adapter: board private structure @@ -933,7 +885,6 @@ ixgb_clean_tx_ring(struct ixgb_adapter * { struct ixgb_desc_ring *tx_ring = &adapter->tx_ring; struct ixgb_buffer *buffer_info; - struct pci_dev *pdev = adapter->pdev; unsigned long size; unsigned int i; @@ -941,17 +941,7 @@ ixgb_clean_tx_ring(struct ixgb_adapter * for(i = 0; i < tx_ring->count; i++) { buffer_info = &tx_ring->buffer_info[i]; - if(buffer_info->skb) { - - pci_unmap_page(pdev, - buffer_info->dma, - buffer_info->length, - PCI_DMA_TODEVICE); - - dev_kfree_skb(buffer_info->skb); - - buffer_info->skb = NULL; - } + ixgb_unmap_and_free_tx_resource(adapter, buffer_info); } size = sizeof(struct ixgb_buffer) * tx_ring->count; @@ -1735,7 +1742,6 @@ ixgb_clean_tx_irq(struct ixgb_adapter *a { struct ixgb_desc_ring *tx_ring = &adapter->tx_ring; struct net_device *netdev = adapter->netdev; - struct pci_dev *pdev = adapter->pdev; struct ixgb_tx_desc *tx_desc, *eop_desc; struct ixgb_buffer *buffer_info; unsigned int i, eop; @@ -1756,22 +1690,7 @@ ixgb_clean_tx_irq(struct ixgb_adapter *a IXGB_TX_DESC_POPTS_IXSM)) adapter->hw_csum_tx_good++; - if(buffer_info->dma) { - - pci_unmap_page(pdev, - buffer_info->dma, - buffer_info->length, - PCI_DMA_TODEVICE); - - buffer_info->dma = 0; - } - - if(buffer_info->skb) { - - dev_kfree_skb_any(buffer_info->skb); - - buffer_info->skb = NULL; - } + ixgb_unmap_and_free_tx_resource(adapter, buffer_info); *(uint32_t *)&(tx_desc->status) = 0; From ganesh.venkatesan@intel.com Thu Jan 6 05:26:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:27:01 -0800 (PST) Received: from fmsfmr006.fm.intel.com (fmr16.intel.com [192.55.52.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DQjOH018926 for ; Thu, 6 Jan 2005 05:26:54 -0800 Received: from fmsfmr101.fm.intel.com (fmsfmr101.fm.intel.com [10.1.192.59]) by fmsfmr006.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071QXwM011867; Fri, 7 Jan 2005 01:26:33 GMT Received: from fmsmsxvs041.fm.intel.com (fmsmsxvs041.fm.intel.com [132.233.42.126]) by fmsfmr101.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071PsJ7021525; Fri, 7 Jan 2005 01:26:33 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs041.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617263225119 ; Thu, 06 Jan 2005 17:26:32 -0800 Date: Thu, 6 Jan 2005 17:26:32 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 9/9] ixgb: White space/driver version number update Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13543 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/ixgb/ixgb_main.c net-drivers-2.6/drivers/net/ixgb.new/ixgb_main.c --- net-drivers-2.6/drivers/net/ixgb/ixgb_main.c 2005-01-05 17:13:27.000000000 -0800 +++ net-drivers-2.6/drivers/net/ixgb.new/ixgb_main.c 2005-01-05 17:13:29.000000000 -0800 @@ -35,7 +35,7 @@ char ixgb_driver_string[] = "Intel(R) PR #else #define DRIVERNAPI "-NAPI" #endif -char ixgb_driver_version[] = "1.0.82-k2"DRIVERNAPI; +char ixgb_driver_version[] = "1.0.87-k2"DRIVERNAPI; char ixgb_copyright[] = "Copyright (c) 1999-2004 Intel Corporation."; /* ixgb_pci_tbl - PCI Device ID Table @@ -62,8 +62,6 @@ MODULE_DEVICE_TABLE(pci, ixgb_pci_tbl); /* Local Function Prototypes */ -static inline void ixgb_irq_disable(struct ixgb_adapter *adapter); -static inline void ixgb_irq_enable(struct ixgb_adapter *adapter); int ixgb_up(struct ixgb_adapter *adapter); void ixgb_down(struct ixgb_adapter *adapter, boolean_t kill_watchdog); void ixgb_reset(struct ixgb_adapter *adapter); @@ -93,9 +94,6 @@ static void ixgb_clean_rx_ring(struct ix static int ixgb_set_mac(struct net_device *netdev, void *p); static irqreturn_t ixgb_intr(int irq, void *data, struct pt_regs *regs); static boolean_t ixgb_clean_tx_irq(struct ixgb_adapter *adapter); -static inline void ixgb_rx_checksum(struct ixgb_adapter *adapter, - struct ixgb_rx_desc *rx_desc, - struct sk_buff *skb); #ifdef CONFIG_IXGB_NAPI static int ixgb_clean(struct net_device *netdev, int *budget); static boolean_t ixgb_clean_rx_irq(struct ixgb_adapter *adapter, @@ -107,14 +94,12 @@ void set_ethtool_ops(struct net_device *netdev); static void ixgb_tx_timeout(struct net_device *dev); static void ixgb_tx_timeout_task(struct net_device *dev); -static void ixgb_vlan_rx_register(struct net_device *netdev, - struct vlan_group *grp); +static void ixgb_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp); static void ixgb_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid); static void ixgb_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid); static void ixgb_restore_vlan(struct ixgb_adapter *adapter); -static int ixgb_notify_reboot(struct notifier_block *, unsigned long event, - void *ptr); +static int ixgb_notify_reboot(struct notifier_block *, unsigned long event, void *ptr); static int ixgb_suspend(struct pci_dev *pdev, uint32_t state); #ifdef CONFIG_NET_POLL_CONTROLLER @@ -198,7 +191,8 @@ module_exit(ixgb_exit_module); * @adapter: board private structure **/ -static inline void ixgb_irq_disable(struct ixgb_adapter *adapter) +static inline void +ixgb_irq_disable(struct ixgb_adapter *adapter) { atomic_inc(&adapter->irq_sem); IXGB_WRITE_REG(&adapter->hw, IMC, ~0); @@ -211,7 +221,8 @@ static inline void ixgb_irq_disable(stru * @adapter: board private structure **/ -static inline void ixgb_irq_enable(struct ixgb_adapter *adapter) +static inline void +ixgb_irq_enable(struct ixgb_adapter *adapter) { if (atomic_dec_and_test(&adapter->irq_sem)) { IXGB_WRITE_REG(&adapter->hw, IMS, @@ -706,11 +701,11 @@ ixgb_configure_tx(struct ixgb_adapter *a /* don't set up txdctl, it induces performance problems if * configured incorrectly - txdctl = TXDCTL_PTHRESH_DEFAULT; // prefetch txds below this threshold - txdctl |= (TXDCTL_HTHRESH_DEFAULT // only prefetch if there are this many ready - << IXGB_TXDCTL_HTHRESH_SHIFT); - IXGB_WRITE_REG (hw, TXDCTL, txdctl); - */ + txdctl = TXDCTL_PTHRESH_DEFAULT; // prefetch txds below this threshold + txdctl |= (TXDCTL_HTHRESH_DEFAULT // only prefetch if there are this many ready + << IXGB_TXDCTL_HTHRESH_SHIFT); + IXGB_WRITE_REG (hw, TXDCTL, txdctl); + */ /* Set the Tx Interrupt Delay register */ @@ -1634,7 +1629,7 @@ ixgb_intr(int irq, void *data, struct pt */ atomic_inc(&adapter->irq_sem); - IXGB_WRITE_REG(hw, IMC, ~0); + IXGB_WRITE_REG(&adapter->hw, IMC, ~0); __netif_rx_schedule(netdev); } #else @@ -1754,8 +1795,8 @@ ixgb_clean_tx_irq(struct ixgb_adapter *a /* Ignore Checksum bit is set OR * TCP Checksum has not been calculated */ - if ((rx_desc->status & IXGB_RX_DESC_STATUS_IXSM) || - (!(rx_desc->status & IXGB_RX_DESC_STATUS_TCPCS))) { + if((rx_desc->status & IXGB_RX_DESC_STATUS_IXSM) || + (!(rx_desc->status & IXGB_RX_DESC_STATUS_TCPCS))) { skb->ip_summed = CHECKSUM_NONE; return; } @@ -1762,7 +1795,7 @@ /* At this point we know the hardware did the TCP checksum */ /* now look at the TCP checksum error bit */ - if (rx_desc->errors & IXGB_RX_DESC_ERRORS_TCPE) { + if(rx_desc->errors & IXGB_RX_DESC_ERRORS_TCPE) { /* let the stack verify checksum errors */ skb->ip_summed = CHECKSUM_NONE; adapter->hw_csum_rx_error++; From ganesh.venkatesan@intel.com Thu Jan 6 05:26:40 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 05:26:46 -0800 (PST) Received: from fmsfmr001.fm.intel.com (fmr13.intel.com [192.55.52.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06DQcJj018788 for ; Thu, 6 Jan 2005 05:26:39 -0800 Received: from fmsfmr100.fm.intel.com (fmsfmr100.fm.intel.com [10.1.192.58]) by fmsfmr001.fm.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j071QQu5029218; Fri, 7 Jan 2005 01:26:26 GMT Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by fmsfmr100.fm.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j071QLwH011733; Fri, 7 Jan 2005 01:26:26 GMT Received: from isotope.jf.intel.com ([10.23.51.62]) by fmsmsxvs043.fm.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005010617262618443 ; Thu, 06 Jan 2005 17:26:26 -0800 Date: Thu, 6 Jan 2005 17:26:26 -0800 (PST) From: Ganesh Venkatesan To: "jgarzik@pobox.com" cc: netdev Subject: [PATCH 2.6 8/9] ixgb: Support for 2.6.x style module parameters Message-ID: ReplyTo: "Ganesh Venkatesan" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13542 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Signed-off-by: Ganesh Venkatesan diff -up net-drivers-2.6/drivers/net/ixgb/ixgb_param.c net-drivers-2.6/drivers/net/ixgb.new/ixgb_param.c --- net-drivers-2.6/drivers/net/ixgb/ixgb_param.c 2005-01-05 18:01:29.000000000 -0800 +++ net-drivers-2.6/drivers/net/ixgb.new/ixgb_param.c 2005-01-05 18:01:31.000000000 -0800 @@ -38,27 +38,17 @@ #define OPTION_DISABLED 0 #define OPTION_ENABLED 1 -/* Module Parameters are always initialized to -1, so that the driver - * can tell the difference between no user specified value or the - * user asking for the default value. - * The true default values are loaded in when ixgb_check_options is called. - * - * This is a GCC extension to ANSI C. - * See the item "Labeled Elements in Initializers" in the section - * "Extensions to the C Language Family" of the GCC documentation. - */ - -#define IXGB_PARAM_INIT { [0 ... IXGB_MAX_NIC] = OPTION_UNSET } - /* All parameters are treated the same, as an integer array of values. * This macro just reduces the need to repeat the same declaration code * over and over (plus this helps to avoid typo bugs). */ -#define IXGB_PARAM(X, S) \ -static const int __devinitdata X[IXGB_MAX_NIC + 1] = IXGB_PARAM_INIT; \ -MODULE_PARM(X, "1-" __MODULE_STRING(IXGB_MAX_NIC) "i"); \ -MODULE_PARM_DESC(X, S); +#define IXGB_PARAM_INIT { [0 ... IXGB_MAX_NIC] = OPTION_UNSET } +#define IXGB_PARAM(X, desc) \ + static int __devinitdata X[IXGB_MAX_NIC+1] = IXGB_PARAM_INIT; \ + static int num_##X = 0; \ + module_param_array_named(X, X, int, &num_##X, 0); \ + MODULE_PARM_DESC(X, desc); /* Transmit Descriptor Count * @@ -275,7 +265,6 @@ ixgb_check_options(struct ixgb_adapter * printk(KERN_NOTICE "Warning: no configuration for board #%i\n", bd); printk(KERN_NOTICE "Using defaults for all values\n"); - bd = IXGB_MAX_NIC; } { /* Transmit Descriptor Count */ @@ -289,8 +278,12 @@ ixgb_check_options(struct ixgb_adapter * }; struct ixgb_desc_ring *tx_ring = &adapter->tx_ring; - tx_ring->count = TxDescriptors[bd]; - ixgb_validate_option(&tx_ring->count, &opt); + if (num_TxDescriptors > bd) { + tx_ring->count = TxDescriptors[bd]; + ixgb_validate_option(&tx_ring->count, &opt); + } else { + tx_ring->count = opt.def; + } IXGB_ROUNDUP(tx_ring->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE); } { /* Receive Descriptor Count */ @@ -304,8 +297,12 @@ ixgb_check_options(struct ixgb_adapter * }; struct ixgb_desc_ring *rx_ring = &adapter->rx_ring; - rx_ring->count = RxDescriptors[bd]; - ixgb_validate_option(&rx_ring->count, &opt); + if (num_RxDescriptors > bd) { + rx_ring->count = RxDescriptors[bd]; + ixgb_validate_option(&rx_ring->count, &opt); + } else { + rx_ring->count = opt.def; + } IXGB_ROUNDUP(rx_ring->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE); } { /* Receive Checksum Offload Enable */ @@ -316,9 +313,13 @@ ixgb_check_options(struct ixgb_adapter * .def = OPTION_ENABLED }; - int rx_csum = XsumRX[bd]; - ixgb_validate_option(&rx_csum, &opt); - adapter->rx_csum = rx_csum; + if (num_XsumRX > bd) { + int rx_csum = XsumRX[bd]; + ixgb_validate_option(&rx_csum, &opt); + adapter->rx_csum = rx_csum; + } else { + adapter->rx_csum = opt.def; + } } { /* Flow Control */ @@ -338,23 +339,30 @@ ixgb_check_options(struct ixgb_adapter * .p = fc_list }} }; - int fc = FlowControl[bd]; - ixgb_validate_option(&fc, &opt); - adapter->hw.fc.type = fc; + if (num_FlowControl > bd) { + int fc = FlowControl[bd]; + ixgb_validate_option(&fc, &opt); + adapter->hw.fc.type = fc; + } else { + adapter->hw.fc.type = opt.def; + } } { /* Receive Flow Control High Threshold */ struct ixgb_option opt = { .type = range_option, .name = "Rx Flow Control High Threshold", - .err = - "using default of " __MODULE_STRING(DEFAULT_FCRTH), - .def = DEFAULT_FCRTH, - .arg = {.r = {.min = MIN_FCRTH, - .max = MAX_FCRTH}} + .err = "using default of " __MODULE_STRING(DEFAULT_FCRTH), + .def = DEFAULT_FCRTH, + .arg = { .r = { .min = MIN_FCRTH, + .max = MAX_FCRTH}} }; - adapter->hw.fc.high_water = RxFCHighThresh[bd]; - ixgb_validate_option(&adapter->hw.fc.high_water, &opt); + if (num_RxFCHighThresh > bd) { + adapter->hw.fc.high_water = RxFCHighThresh[bd]; + ixgb_validate_option(&adapter->hw.fc.high_water, &opt); + } else { + adapter->hw.fc.high_water = opt.def; + } if ( !(adapter->hw.fc.type & ixgb_fc_rx_pause) ) printk (KERN_INFO "Ignoring RxFCHighThresh when no RxFC\n"); @@ -363,15 +371,18 @@ ixgb_check_options(struct ixgb_adapter * struct ixgb_option opt = { .type = range_option, .name = "Rx Flow Control Low Threshold", - .err = - "using default of " __MODULE_STRING(DEFAULT_FCRTL), - .def = DEFAULT_FCRTL, - .arg = {.r = {.min = MIN_FCRTL, - .max = MAX_FCRTL}} + .err = "using default of " __MODULE_STRING(DEFAULT_FCRTL), + .def = DEFAULT_FCRTL, + .arg = { .r = { .min = MIN_FCRTL, + .max = MAX_FCRTL}} }; - adapter->hw.fc.low_water = RxFCLowThresh[bd]; - ixgb_validate_option(&adapter->hw.fc.low_water, &opt); + if (num_RxFCLowThresh > bd) { + adapter->hw.fc.low_water = RxFCLowThresh[bd]; + ixgb_validate_option(&adapter->hw.fc.low_water, &opt); + } else { + adapter->hw.fc.low_water = opt.def; + } if ( !(adapter->hw.fc.type & ixgb_fc_rx_pause) ) printk (KERN_INFO "Ignoring RxFCLowThresh when no RxFC\n"); @@ -380,21 +391,22 @@ ixgb_check_options(struct ixgb_adapter * struct ixgb_option opt = { .type = range_option, .name = "Flow Control Pause Time Request", - .err = - "using default of " - __MODULE_STRING(DEFAULT_FCPAUSE), - .def = DEFAULT_FCPAUSE, - .arg = {.r = {.min = MIN_FCPAUSE, - .max = MAX_FCPAUSE}} + .err = "using default of "__MODULE_STRING(DEFAULT_FCPAUSE), + .def = DEFAULT_FCPAUSE, + .arg = { .r = { .min = MIN_FCPAUSE, + .max = MAX_FCPAUSE}} }; - int pause_time = FCReqTimeout[bd]; - - ixgb_validate_option(&pause_time, &opt); + if (num_FCReqTimeout > bd) { + int pause_time = FCReqTimeout[bd]; + ixgb_validate_option(&pause_time, &opt); + adapter->hw.fc.pause_time = pause_time; + } else { + adapter->hw.fc.pause_time = opt.def; + } if ( !(adapter->hw.fc.type & ixgb_fc_rx_pause) ) printk (KERN_INFO "Ignoring FCReqTimeout when no RxFC\n"); - adapter->hw.fc.pause_time = pause_time; } /* high low and spacing check for rx flow control thresholds */ if (adapter->hw.fc.type & ixgb_fc_rx_pause) { @@ -412,28 +424,35 @@ ixgb_check_options(struct ixgb_adapter * struct ixgb_option opt = { .type = range_option, .name = "Receive Interrupt Delay", - .err = "using default of " __MODULE_STRING(DEFAULT_RDTR), - .def = DEFAULT_RDTR, - .arg = { .r = { .min = MIN_RDTR, + .err = "using default of " __MODULE_STRING(DEFAULT_RDTR), + .def = DEFAULT_RDTR, + .arg = { .r = { .min = MIN_RDTR, .max = MAX_RDTR}} }; - adapter->rx_int_delay = RxIntDelay[bd]; - ixgb_validate_option(&adapter->rx_int_delay, &opt); - } + if (num_RxIntDelay > bd) { + adapter->rx_int_delay = RxIntDelay[bd]; + ixgb_validate_option(&adapter->rx_int_delay, &opt); + } else { + adapter->rx_int_delay = opt.def; + } } { /* Transmit Interrupt Delay */ struct ixgb_option opt = { .type = range_option, .name = "Transmit Interrupt Delay", - .err = "using default of " __MODULE_STRING(DEFAULT_TIDV), - .def = DEFAULT_TIDV, - .arg = { .r = { .min = MIN_TIDV, + .err = "using default of " __MODULE_STRING(DEFAULT_TIDV), + .def = DEFAULT_TIDV, + .arg = { .r = { .min = MIN_TIDV, .max = MAX_TIDV}} }; - adapter->tx_int_delay = TxIntDelay[bd]; - ixgb_validate_option(&adapter->tx_int_delay, &opt); + if (num_TxIntDelay > bd) { + adapter->tx_int_delay = TxIntDelay[bd]; + ixgb_validate_option(&adapter->tx_int_delay, &opt); + } else { + adapter->tx_int_delay = opt.def; + } } { /* Transmit Interrupt Delay Enable */ @@ -443,9 +462,14 @@ ixgb_check_options(struct ixgb_adapter * .err = "defaulting to Enabled", .def = OPTION_ENABLED }; - int ide = IntDelayEnable[bd]; - ixgb_validate_option(&ide, &opt); - adapter->tx_int_delay_enable = ide; + if (num_IntDelayEnable > bd) { + int ide = IntDelayEnable[bd]; + ixgb_validate_option(&ide, &opt); + adapter->tx_int_delay_enable = ide; + } else { + adapter->tx_int_delay_enable = opt.def; + } } } + From yoshfuji@linux-ipv6.org Thu Jan 6 06:17:50 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 06:17:56 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06EHnNW027676 for ; Thu, 6 Jan 2005 06:17:50 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id 5852F33CC2; Fri, 7 Jan 2005 11:18:07 +0900 (JST) Date: Fri, 07 Jan 2005 11:18:06 +0900 (JST) Message-Id: <20050107.111806.27181187.yoshfuji@linux-ipv6.org> To: jgarzik@pobox.com, davem@davemloft.net Cc: netdev@oss.sgi.com, herbert@gondor.apana.org.au Subject: [RFC PATCH] Fix double dereference (Re: IPv6 badness continues) From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <41DA3A60.8050102@pobox.com> References: <41DA3A60.8050102@pobox.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13544 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Hello. In article <41DA3A60.8050102@pobox.com> (at Tue, 04 Jan 2005 01:40:32 -0500), Jeff Garzik says: > The first 'Badness in dst_release' message (of many) from 2.6.10-bk1, on > x86 SMP, is found below. : > Badness in dst_release at include/net/dst.h:149 > [] ip6_dst_check+0x67/0x80 [ipv6] > [] ip6_dst_lookup+0x1b4/0x1d0 [ipv6] > [] udpv6_sendmsg+0x2b4/0x950 [ipv6] Ok, now I doubt sk_dst_check() code path. When ip6_dst_check() (or its variants) returns NULL, it will release refcnt while it leaves sk->dst_cache non-NULL. Later, caller sets it to NULL by sk_dst_reset() (or its variants), and it decrements refcnt again. I think we should NOT release refcnt in sk_dst_check() (or its variants) even we return NULL because that reference was held for sk->dst_cache and it is available yet. Instead, we should release refcnt when we really reset the dst in sk_dst_reset() (or its variants). (Alternatively, we may always set sk->dst_cache to NULL and release refcnt when we're about to return NULL in sk_dst_check() (or its variants).) Am I miss something? ===== net/decnet/dn_route.c 1.29 vs edited ===== --- 1.29/net/decnet/dn_route.c 2004-11-10 09:44:25 +09:00 +++ edited/net/decnet/dn_route.c 2005-01-04 17:14:01 +09:00 @@ -253,7 +253,6 @@ */ static struct dst_entry *dn_dst_check(struct dst_entry *dst, __u32 cookie) { - dst_release(dst); return NULL; } ===== net/ipv4/route.c 1.99 vs edited ===== --- 1.99/net/ipv4/route.c 2004-12-28 12:49:57 +09:00 +++ edited/net/ipv4/route.c 2005-01-04 17:13:49 +09:00 @@ -1321,7 +1321,6 @@ static struct dst_entry *ipv4_dst_check(struct dst_entry *dst, u32 cookie) { - dst_release(dst); return NULL; } ===== net/ipv6/route.c 1.102 vs edited ===== --- 1.102/net/ipv6/route.c 2004-11-30 12:24:46 +09:00 +++ edited/net/ipv6/route.c 2005-01-04 17:13:34 +09:00 @@ -578,8 +578,6 @@ if (rt && rt->rt6i_node && (rt->rt6i_node->fn_sernum == cookie)) return dst; - - dst_release(dst); return NULL; } ===== net/xfrm/xfrm_policy.c 1.61 vs edited ===== --- 1.61/net/xfrm/xfrm_policy.c 2004-12-28 11:33:32 +09:00 +++ edited/net/xfrm/xfrm_policy.c 2005-01-04 17:13:12 +09:00 @@ -1000,8 +1000,6 @@ { if (!stale_bundle(dst)) return dst; - - dst_release(dst); return NULL; } -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From jgarzik@pobox.com Thu Jan 6 06:24:19 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 06:24:26 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06EODlY028277 for ; Thu, 6 Jan 2005 06:24:18 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CmjnI-0004E9-6n; Fri, 07 Jan 2005 02:24:04 +0000 Message-ID: <41DDF2C0.3030600@pobox.com> Date: Thu, 06 Jan 2005 21:24:00 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ganesh Venkatesan CC: netdev Subject: Re: [PATCH 2.4 1/3] e100: Replace locally implemented delay routines with call to msleep (nacc@us.ibm.com) References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13545 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev applied patches 1-3 to 2.6.x From jgarzik@pobox.com Thu Jan 6 06:38:18 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 06:38:26 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06EcHf2029186 for ; Thu, 6 Jan 2005 06:38:18 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1Cmk0w-0004Zx-04; Fri, 07 Jan 2005 02:38:10 +0000 Message-ID: <41DDF60B.5060402@pobox.com> Date: Thu, 06 Jan 2005 21:38:03 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ganesh Venkatesan CC: netdev Subject: Re: [PATCH 2.6 0/14] e1000: driver update References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13546 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Ganesh Venkatesan wrote: > 1 ITR does not default correctly on 2.6.x kernels > 2 Fix kernel panic when the interface is brought down while the NAPI enabled driver is under stress > 3 Fix ethtool diagnostics -- specifically for blade server implementations > 4 Enabling NETIF_F_SG without checksum offload is illegal -- jdmason@us.ibm.com > 5 Avoid filling tx_ring completely - shemminger@osdl.org > 6 Apply patch from Jamal (hadi@znyx.com) to remove a redundant assignment to a local nr_frags in e1000_xmit_frame. > 7 Replace schedule_timeout() with msleep()/msleep_interruptible() nacc@us.ibm.com > 8 Fix tx resource cleanup logic > 9 {set, get}_wol is now symmetric for 82545EM adapters > 10 Kernel API change for Module_param_array_named > 11 Added workaround to prevent inadvertent gigabit waveform to be sent out on the wire due to init-time operations on the IGP phy. > 12 Applied eeprom fix where it was possible to read/write one more word than what should have been possible. > 13 Applied smart speed fix where the code was forcing smart speed on all the time. Now it will honor the setting defined in the eeprom. > 14 Driver version number, white spaces, comments, device id & other changes applied patches 1-14 to 2.6.x. request for the future: please modify your patch submission procedure as follows: 1) create a descriptive subject line of no more than 60 characters 2) include an extended description of the change (> 60 characters) in the body of the email. 3) in the email subject line, please include the _specific_ version of the kernel your patch is diff'd against. i.e. "2.6.10-bk1", "2.6.10", "2.4.21-pre2", etc. More details see http://linux.yyz.us/patch-format.html Jeff From jgarzik@pobox.com Thu Jan 6 06:42:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 06:43:01 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06Egl6O029709 for ; Thu, 6 Jan 2005 06:42:48 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1Cmk5H-0004z3-Iq; Fri, 07 Jan 2005 02:42:39 +0000 Message-ID: <41DDF71B.5020807@pobox.com> Date: Thu, 06 Jan 2005 21:42:35 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ganesh Venkatesan CC: netdev Subject: Re: [PATCH 2.4 1/13] e1000: ITR does not default correctly References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13547 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev applied patches 1-13 to 2.4.x From jgarzik@pobox.com Thu Jan 6 06:43:16 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 06:43:21 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06EhFK5029812 for ; Thu, 6 Jan 2005 06:43:16 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1Cmk5k-0004zj-5X; Fri, 07 Jan 2005 02:43:08 +0000 Message-ID: <41DDF737.7060504@pobox.com> Date: Thu, 06 Jan 2005 21:43:03 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ganesh Venkatesan CC: netdev Subject: Re: [PATCH 2.4] e1000: Documentation/networking/e1000.txt update References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13548 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev applied From jgarzik@pobox.com Thu Jan 6 06:43:57 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 06:44:02 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06Ehokv030123 for ; Thu, 6 Jan 2005 06:43:55 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1Cmk6I-000503-Kp; Fri, 07 Jan 2005 02:43:42 +0000 Message-ID: <41DDF75A.5050504@pobox.com> Date: Thu, 06 Jan 2005 21:43:38 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ganesh Venkatesan CC: netdev Subject: Re: [PATCH 2.6] e1000: Documentation/networking/e1000.txt update References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13549 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev applied From jgarzik@pobox.com Thu Jan 6 06:44:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 06:44:43 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06EiZXv030543 for ; Thu, 6 Jan 2005 06:44:36 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1Cmk71-00052E-VB; Fri, 07 Jan 2005 02:44:28 +0000 Message-ID: <41DDF787.8010507@pobox.com> Date: Thu, 06 Jan 2005 21:44:23 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ganesh Venkatesan CC: netdev Subject: Re: [PATCH 2.6] e100: Documentation/networking/e100.txt update References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13550 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev applied From jgarzik@pobox.com Thu Jan 6 06:57:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 06:57:42 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06EvaaG031830 for ; Thu, 6 Jan 2005 06:57:37 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CmkJc-0005K7-Pn; Fri, 07 Jan 2005 02:57:28 +0000 Message-ID: <41DDFA93.9040701@pobox.com> Date: Thu, 06 Jan 2005 21:57:23 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ganesh Venkatesan CC: netdev Subject: Re: [PATCH 2.6 1/9] ixgb: Enabling MSI on a PCI slot (not PCI-X) may not work, so always disable MSI for PCI slots, enable message signalled interrupts on 82597EX based adapters References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13551 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev unfortunately these ixgb patches don't apply. Can you please resend against a vanilla 2.6.10 kernel, with no other patches applied? Jeff From bunk@stusta.de Thu Jan 6 07:00:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 07:00:40 -0800 (PST) Received: from mailout.stusta.mhn.de (mailout.stusta.mhn.de [141.84.69.5]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j06F0WgV032325 for ; Thu, 6 Jan 2005 07:00:34 -0800 Received: (qmail 12009 invoked from network); 7 Jan 2005 03:00:19 -0000 Received: from r063144.stusta.swh.mhn.de (10.150.63.144) by mailout.stusta.mhn.de with SMTP; 7 Jan 2005 03:00:19 -0000 Received: by r063144.stusta.swh.mhn.de (Postfix, from userid 1000) id 0139BBBA66; Fri, 7 Jan 2005 04:00:17 +0100 (CET) Date: Fri, 7 Jan 2005 04:00:17 +0100 From: Adrian Bunk To: "YOSHIFUJI Hideaki / ?$B5HF#1QL@" Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [2.6 patch] net/ipv6/: misc cleanups Message-ID: <20050107030017.GF14108@stusta.de> References: <20041215005546.GA11972@stusta.de> <20041215.105900.27736391.yoshfuji@linux-ipv6.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041215.105900.27736391.yoshfuji@linux-ipv6.org> User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13552 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bunk@stusta.de Precedence: bulk X-list: netdev On Wed, Dec 15, 2004 at 10:59:00AM +0900, YOSHIFUJI Hideaki / ?$B5HF#1QL@ wrote: > In article <20041215005546.GA11972@stusta.de> (at Wed, 15 Dec 2004 01:55:46 +0100), Adrian Bunk says: > > >... > > Please comment on which of these changes are correct and which conflict > > with pending patches. > > Please keep addrconf_lock (for SCTP). Ups, sorry, my bad. > Please keep in6addr_any in addrconf.c (or enclose by #if 0 ... #endif) >... OK. Updated patch: <-- snip --> The patch below contains the following possible cleanups: - make some needlessly global code static - remove the following unused functions: - exthdrs.c: ipv6_build_rthdr - exthdrs.c: ipv6_build_exthdr - exthdrs.c: ipv6_build_nfrag_opts - exthdrs.c: ipv6_build_frag_opts - remove the following write-only global variables: - addrconf.c: inet6_dev_count - addrconf.c: inet6_ifa_count - #if 0 the following unused global variable: - addrconf.c: in6addr_any - remove the following EXPORT_SYMBOL's: - ipv6_syms.c: in6addr_any - ipv6_syms.c: in6addr_loopback diffstat output: include/linux/in6.h | 4 - include/net/addrconf.h | 1 include/net/ipv6.h | 2 net/ipv6/addrconf.c | 11 +---- net/ipv6/anycast.c | 4 + net/ipv6/exthdrs.c | 77 ------------------------------------- net/ipv6/icmp.c | 2 net/ipv6/ip6_output.c | 2 net/ipv6/ipv6_syms.c | 2 net/ipv6/mcast.c | 32 ++++++++------- net/ipv6/route.c | 4 - net/ipv6/sysctl_net_ipv6.c | 2 12 files changed, 32 insertions(+), 111 deletions(-) Signed-off-by: Adrian Bunk --- linux-2.6.10-mm2-full/include/linux/in6.h.old 2005-01-07 02:34:21.000000000 +0100 +++ linux-2.6.10-mm2-full/include/linux/in6.h 2005-01-07 02:36:18.000000000 +0100 @@ -44,10 +44,10 @@ * NOTE: Be aware the IN6ADDR_* constants and in6addr_* externals are defined * in network byte order, not in host byte order as are the IPv4 equivalents */ +#if 0 extern const struct in6_addr in6addr_any; #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } -extern const struct in6_addr in6addr_loopback; -#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } +#endif struct sockaddr_in6 { unsigned short int sin6_family; /* AF_INET6 */ --- linux-2.6.10-mm2-full/net/ipv6/addrconf.c.old 2005-01-07 02:34:57.000000000 +0100 +++ linux-2.6.10-mm2-full/net/ipv6/addrconf.c 2005-01-07 02:37:28.000000000 +0100 @@ -99,9 +99,6 @@ static void addrconf_sysctl_unregister(struct ipv6_devconf *p); #endif -int inet6_dev_count; -int inet6_ifa_count; - #ifdef CONFIG_IPV6_PRIVACY static int __ipv6_regen_rndid(struct inet6_dev *idev); static int __ipv6_try_regen_rndid(struct inet6_dev *idev, struct in6_addr *tmpaddr); @@ -191,7 +188,11 @@ }; /* IPv6 Wildcard Address and Loopback Address defined by RFC2553 */ +#if 0 +#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; +#endif +#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT; int ipv6_addr_type(const struct in6_addr *addr) @@ -310,7 +311,6 @@ return; } snmp6_unregister_dev(idev); - inet6_dev_count--; kfree(idev); } @@ -338,7 +338,6 @@ kfree(ndev); return NULL; } - inet6_dev_count++; /* We refer to the device */ dev_hold(dev); @@ -475,7 +474,6 @@ } dst_release(&ifp->rt->u.dst); - inet6_ifa_count--; kfree(ifp); } @@ -530,7 +528,6 @@ ifa->flags = flags | IFA_F_TENTATIVE; ifa->cstamp = ifa->tstamp = jiffies; - inet6_ifa_count++; ifa->idev = idev; in6_dev_hold(idev); /* For caller */ --- linux-2.6.10-mm2-full/net/ipv6/ipv6_syms.c.old 2005-01-07 02:35:19.000000000 +0100 +++ linux-2.6.10-mm2-full/net/ipv6/ipv6_syms.c 2005-01-07 02:36:35.000000000 +0100 @@ -32,8 +32,6 @@ EXPORT_SYMBOL(inet6_ioctl); EXPORT_SYMBOL(ipv6_get_saddr); EXPORT_SYMBOL(ipv6_chk_addr); -EXPORT_SYMBOL(in6addr_any); -EXPORT_SYMBOL(in6addr_loopback); EXPORT_SYMBOL(in6_dev_finish_destroy); #ifdef CONFIG_XFRM EXPORT_SYMBOL(xfrm6_rcv); --- linux-2.6.10-mm2-full/include/net/addrconf.h.old 2005-01-07 02:38:03.000000000 +0100 +++ linux-2.6.10-mm2-full/include/net/addrconf.h 2005-01-07 02:38:10.000000000 +0100 @@ -112,7 +112,6 @@ extern int ipv6_dev_ac_inc(struct net_device *dev, struct in6_addr *addr); extern int __ipv6_dev_ac_dec(struct inet6_dev *idev, struct in6_addr *addr); -extern int ipv6_dev_ac_dec(struct net_device *dev, struct in6_addr *addr); extern int ipv6_chk_acast_addr(struct net_device *dev, struct in6_addr *addr); --- linux-2.6.10-mm2-full/net/ipv6/anycast.c.old 2005-01-07 02:38:21.000000000 +0100 +++ linux-2.6.10-mm2-full/net/ipv6/anycast.c 2005-01-07 02:38:44.000000000 +0100 @@ -43,6 +43,8 @@ #include +static int ipv6_dev_ac_dec(struct net_device *dev, struct in6_addr *addr); + /* Big ac list lock for all the sockets */ static rwlock_t ipv6_sk_ac_lock = RW_LOCK_UNLOCKED; @@ -413,7 +415,7 @@ return 0; } -int ipv6_dev_ac_dec(struct net_device *dev, struct in6_addr *addr) +static int ipv6_dev_ac_dec(struct net_device *dev, struct in6_addr *addr) { int ret; struct inet6_dev *idev = in6_dev_get(dev); --- linux-2.6.10-mm2-full/net/ipv6/exthdrs.c.old 2005-01-07 02:39:33.000000000 +0100 +++ linux-2.6.10-mm2-full/net/ipv6/exthdrs.c 2005-01-07 02:50:24.000000000 +0100 @@ -501,83 +501,6 @@ * for headers. */ -static u8 *ipv6_build_rthdr(struct sk_buff *skb, u8 *prev_hdr, - struct ipv6_rt_hdr *opt, struct in6_addr *addr) -{ - struct rt0_hdr *phdr, *ihdr; - int hops; - - ihdr = (struct rt0_hdr *) opt; - - phdr = (struct rt0_hdr *) skb_put(skb, (ihdr->rt_hdr.hdrlen + 1) << 3); - memcpy(phdr, ihdr, sizeof(struct rt0_hdr)); - - hops = ihdr->rt_hdr.hdrlen >> 1; - - if (hops > 1) - memcpy(phdr->addr, ihdr->addr + 1, - (hops - 1) * sizeof(struct in6_addr)); - - ipv6_addr_copy(phdr->addr + (hops - 1), addr); - - phdr->rt_hdr.nexthdr = *prev_hdr; - *prev_hdr = NEXTHDR_ROUTING; - return &phdr->rt_hdr.nexthdr; -} - -static u8 *ipv6_build_exthdr(struct sk_buff *skb, u8 *prev_hdr, u8 type, struct ipv6_opt_hdr *opt) -{ - struct ipv6_opt_hdr *h = (struct ipv6_opt_hdr *)skb_put(skb, ipv6_optlen(opt)); - - memcpy(h, opt, ipv6_optlen(opt)); - h->nexthdr = *prev_hdr; - *prev_hdr = type; - return &h->nexthdr; -} - -u8 *ipv6_build_nfrag_opts(struct sk_buff *skb, u8 *prev_hdr, struct ipv6_txoptions *opt, - struct in6_addr *daddr, u32 jumbolen) -{ - struct ipv6_opt_hdr *h = (struct ipv6_opt_hdr *)skb->data; - - if (opt && opt->hopopt) - prev_hdr = ipv6_build_exthdr(skb, prev_hdr, NEXTHDR_HOP, opt->hopopt); - - if (jumbolen) { - u8 *jumboopt = (u8 *)skb_put(skb, 8); - - if (opt && opt->hopopt) { - *jumboopt++ = IPV6_TLV_PADN; - *jumboopt++ = 0; - h->hdrlen++; - } else { - h = (struct ipv6_opt_hdr *)jumboopt; - h->nexthdr = *prev_hdr; - h->hdrlen = 0; - jumboopt += 2; - *prev_hdr = NEXTHDR_HOP; - prev_hdr = &h->nexthdr; - } - jumboopt[0] = IPV6_TLV_JUMBO; - jumboopt[1] = 4; - *(u32*)(jumboopt+2) = htonl(jumbolen); - } - if (opt) { - if (opt->dst0opt) - prev_hdr = ipv6_build_exthdr(skb, prev_hdr, NEXTHDR_DEST, opt->dst0opt); - if (opt->srcrt) - prev_hdr = ipv6_build_rthdr(skb, prev_hdr, opt->srcrt, daddr); - } - return prev_hdr; -} - -u8 *ipv6_build_frag_opts(struct sk_buff *skb, u8 *prev_hdr, struct ipv6_txoptions *opt) -{ - if (opt->dst1opt) - prev_hdr = ipv6_build_exthdr(skb, prev_hdr, NEXTHDR_DEST, opt->dst1opt); - return prev_hdr; -} - static void ipv6_push_rthdr(struct sk_buff *skb, u8 *proto, struct ipv6_rt_hdr *opt, struct in6_addr **addr_p) --- linux-2.6.10-mm2-full/net/ipv6/icmp.c.old 2005-01-07 02:40:12.000000000 +0100 +++ linux-2.6.10-mm2-full/net/ipv6/icmp.c 2005-01-07 02:40:20.000000000 +0100 @@ -211,7 +211,7 @@ return (*op & 0xC0) == 0x80; } -int icmpv6_push_pending_frames(struct sock *sk, struct flowi *fl, struct icmp6hdr *thdr, int len) +static int icmpv6_push_pending_frames(struct sock *sk, struct flowi *fl, struct icmp6hdr *thdr, int len) { struct sk_buff *skb; struct icmp6hdr *icmp6h; --- linux-2.6.10-mm2-full/include/net/ipv6.h.old 2005-01-07 02:40:56.000000000 +0100 +++ linux-2.6.10-mm2-full/include/net/ipv6.h 2005-01-07 02:41:03.000000000 +0100 @@ -229,8 +229,6 @@ void (*destructor)(struct sock *)); -extern int ip6_call_ra_chain(struct sk_buff *skb, int sel); - extern int ipv6_parse_hopopts(struct sk_buff *skb, int); extern struct ipv6_txoptions * ipv6_dup_options(struct sock *sk, struct ipv6_txoptions *opt); --- linux-2.6.10-mm2-full/net/ipv6/ip6_output.c.old 2005-01-07 02:41:10.000000000 +0100 +++ linux-2.6.10-mm2-full/net/ipv6/ip6_output.c 2005-01-07 02:41:15.000000000 +0100 @@ -311,7 +311,7 @@ return 0; } -int ip6_call_ra_chain(struct sk_buff *skb, int sel) +static int ip6_call_ra_chain(struct sk_buff *skb, int sel) { struct ip6_ra_chain *ra; struct sock *last = NULL; --- linux-2.6.10-mm2-full/net/ipv6/mcast.c.old 2005-01-07 02:41:35.000000000 +0100 +++ linux-2.6.10-mm2-full/net/ipv6/mcast.c 2005-01-07 02:44:44.000000000 +0100 @@ -121,7 +121,7 @@ struct in6_addr srcs[0]; }; -struct in6_addr mld2_all_mcr = MLD2_ALL_MCR_INIT; +static struct in6_addr mld2_all_mcr = MLD2_ALL_MCR_INIT; /* Big mc list lock for all the sockets */ static rwlock_t ipv6_sk_mc_lock = RW_LOCK_UNLOCKED; @@ -143,12 +143,14 @@ static int sf_setstate(struct ifmcaddr6 *pmc); static void sf_markstate(struct ifmcaddr6 *pmc); static void ip6_mc_clear_src(struct ifmcaddr6 *pmc); -int ip6_mc_del_src(struct inet6_dev *idev, struct in6_addr *pmca, int sfmode, - int sfcount, struct in6_addr *psfsrc, int delta); -int ip6_mc_add_src(struct inet6_dev *idev, struct in6_addr *pmca, int sfmode, - int sfcount, struct in6_addr *psfsrc, int delta); -int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml, - struct inet6_dev *idev); +static int ip6_mc_del_src(struct inet6_dev *idev, struct in6_addr *pmca, + int sfmode, int sfcount, struct in6_addr *psfsrc, + int delta); +static int ip6_mc_add_src(struct inet6_dev *idev, struct in6_addr *pmca, + int sfmode, int sfcount, struct in6_addr *psfsrc, + int delta); +static int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml, + struct inet6_dev *idev); #define IGMP6_UNSOLICITED_IVAL (10*HZ) @@ -272,7 +274,7 @@ return -ENOENT; } -struct inet6_dev *ip6_mc_find_dev(struct in6_addr *group, int ifindex) +static struct inet6_dev *ip6_mc_find_dev(struct in6_addr *group, int ifindex) { struct net_device *dev = NULL; struct inet6_dev *idev = NULL; @@ -1723,8 +1725,9 @@ return rv; } -int ip6_mc_del_src(struct inet6_dev *idev, struct in6_addr *pmca, int sfmode, - int sfcount, struct in6_addr *psfsrc, int delta) +static int ip6_mc_del_src(struct inet6_dev *idev, struct in6_addr *pmca, + int sfmode, int sfcount, struct in6_addr *psfsrc, + int delta) { struct ifmcaddr6 *pmc; int changerec = 0; @@ -1847,8 +1850,9 @@ /* * Add multicast source filter list to the interface list */ -int ip6_mc_add_src(struct inet6_dev *idev, struct in6_addr *pmca, int sfmode, - int sfcount, struct in6_addr *psfsrc, int delta) +static int ip6_mc_add_src(struct inet6_dev *idev, struct in6_addr *pmca, + int sfmode, int sfcount, struct in6_addr *psfsrc, + int delta) { struct ifmcaddr6 *pmc; int isexclude; @@ -1951,8 +1955,8 @@ spin_unlock_bh(&ma->mca_lock); } -int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml, - struct inet6_dev *idev) +static int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml, + struct inet6_dev *idev) { int err; --- linux-2.6.10-mm2-full/net/ipv6/route.c.old 2005-01-07 02:45:00.000000000 +0100 +++ linux-2.6.10-mm2-full/net/ipv6/route.c 2005-01-07 02:45:22.000000000 +0100 @@ -208,8 +208,8 @@ /* * pointer to the last default router chosen. BH is disabled locally. */ -struct rt6_info *rt6_dflt_pointer; -spinlock_t rt6_dflt_lock = SPIN_LOCK_UNLOCKED; +static struct rt6_info *rt6_dflt_pointer; +static spinlock_t rt6_dflt_lock = SPIN_LOCK_UNLOCKED; void rt6_reset_dflt_pointer(struct rt6_info *rt) { --- linux-2.6.10-mm2-full/net/ipv6/sysctl_net_ipv6.c.old 2005-01-07 02:45:38.000000000 +0100 +++ linux-2.6.10-mm2-full/net/ipv6/sysctl_net_ipv6.c 2005-01-07 02:45:46.000000000 +0100 @@ -19,7 +19,7 @@ #ifdef CONFIG_SYSCTL -ctl_table ipv6_table[] = { +static ctl_table ipv6_table[] = { { .ctl_name = NET_IPV6_ROUTE, .procname = "route", From jgarzik@pobox.com Thu Jan 6 07:01:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 07:01:06 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06F0u1j032481 for ; Thu, 6 Jan 2005 07:01:00 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CmkMo-0005P3-6y; Fri, 07 Jan 2005 03:00:46 +0000 Message-ID: <41DDFB59.8090801@pobox.com> Date: Thu, 06 Jan 2005 22:00:41 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Domen Puncer CC: netdev@oss.sgi.com Subject: Re: [patch] arcnet: remove casts References: <20041229221615.GF26245@nd47.coderock.org> In-Reply-To: <20041229221615.GF26245@nd47.coderock.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13553 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev applied From yoshfuji@linux-ipv6.org Thu Jan 6 07:11:45 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 07:11:49 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06FBWx6001047 for ; Thu, 6 Jan 2005 07:11:45 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id A88FD33CC2; Fri, 7 Jan 2005 12:11:50 +0900 (JST) Date: Fri, 07 Jan 2005 12:11:49 +0900 (JST) Message-Id: <20050107.121149.102802103.yoshfuji@linux-ipv6.org> To: bunk@stusta.de Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org, yoshfuji@linux-ipv6.org Subject: Re: [2.6 patch] net/ipv6/: misc cleanups From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20050107030017.GF14108@stusta.de> References: <20041215005546.GA11972@stusta.de> <20041215.105900.27736391.yoshfuji@linux-ipv6.org> <20050107030017.GF14108@stusta.de> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13554 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev In article <20050107030017.GF14108@stusta.de> (at Fri, 7 Jan 2005 04:00:17 +0100), Adrian Bunk says: > - #if 0 the following unused global variable: > - addrconf.c: in6addr_any > - remove the following EXPORT_SYMBOL's: > - ipv6_syms.c: in6addr_any > - ipv6_syms.c: in6addr_loopback : > --- linux-2.6.10-mm2-full/include/linux/in6.h.old 2005-01-07 02:34:21.000000000 +0100 > +++ linux-2.6.10-mm2-full/include/linux/in6.h 2005-01-07 02:36:18.000000000 +0100 > @@ -44,10 +44,10 @@ > * NOTE: Be aware the IN6ADDR_* constants and in6addr_* externals are defined > * in network byte order, not in host byte order as are the IPv4 equivalents > */ > +#if 0 > extern const struct in6_addr in6addr_any; > #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } > -extern const struct in6_addr in6addr_loopback; > -#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } > +#endif > I meant: #if 0 extern const struct in6_addr in6addr_any; #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } #endif extern const struct in6_addr in6addr_loopback; #define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } And, > @@ -191,7 +188,11 @@ > }; > > /* IPv6 Wildcard Address and Loopback Address defined by RFC2553 */ > +#if 0 > +#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } > const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; > +#endif > +#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } > const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT; > #if 0 const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; #endif const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT; or something like this. --yoshfuji From yoshfuji@linux-ipv6.org Thu Jan 6 07:35:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 07:35:15 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06FZ2H7002098 for ; Thu, 6 Jan 2005 07:35:04 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id 81D6333CC2; Fri, 7 Jan 2005 12:35:20 +0900 (JST) Date: Fri, 07 Jan 2005 12:35:19 +0900 (JST) Message-Id: <20050107.123519.125017441.yoshfuji@linux-ipv6.org> To: sri@us.ibm.com, davem@davemloft.net Cc: lksctp-developers@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] kill needless addrconf lock in sctp. From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13555 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Hello. I don't think we really need to obtain this lock here. Signed-off-by: Hideaki YOSHIFUJI After applying this patch, I think we can stop exporting addrconf_lock. ===== net/sctp/ipv6.c 1.57 vs edited ===== --- 1.57/net/sctp/ipv6.c 2004-12-28 10:56:34 +09:00 +++ edited/net/sctp/ipv6.c 2005-01-07 12:29:26 +09:00 @@ -319,11 +319,8 @@ struct inet6_ifaddr *ifp; struct sctp_sockaddr_entry *addr; - read_lock(&addrconf_lock); - if ((in6_dev = __in6_dev_get(dev)) == NULL) { - read_unlock(&addrconf_lock); + if ((in6_dev = in6_dev_get(dev)) == NULL) return; - } read_lock(&in6_dev->lock); for (ifp = in6_dev->addr_list; ifp; ifp = ifp->if_next) { @@ -340,7 +337,7 @@ } read_unlock(&in6_dev->lock); - read_unlock(&addrconf_lock); + in6_dev_put(in6_dev); } /* Initialize a sockaddr_storage from in incoming skb. */ -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Thu Jan 6 07:41:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 07:41:15 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06Ff6YJ002612 for ; Thu, 6 Jan 2005 07:41:10 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id A1D4B33CC2; Fri, 7 Jan 2005 12:41:24 +0900 (JST) Date: Fri, 07 Jan 2005 12:41:23 +0900 (JST) Message-Id: <20050107.124123.07582199.yoshfuji@linux-ipv6.org> To: sri@us.ibm.com, davem@davemloft.net Cc: lksctp-developers@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [PATCH] kill needless addrconf lock in sctp. From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20050107.123519.125017441.yoshfuji@linux-ipv6.org> References: <20050107.123519.125017441.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13556 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev In article <20050107.123519.125017441.yoshfuji@linux-ipv6.org> (at Fri, 07 Jan 2005 12:35:19 +0900 (JST)), YOSHIFUJI Hideaki / $B5HF#1QL@(B says: > After applying this patch, I think we can stop exporting > addrconf_lock. Oops, sorry, we can't, because in6_dev_get() is inlined function, and it uses addrconf_lock. --yoshfuji From jgarzik@pobox.com Thu Jan 6 07:45:58 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 07:46:04 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06FjvZg003131 for ; Thu, 6 Jan 2005 07:45:58 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1Cml4P-0006Yq-M5; Fri, 07 Jan 2005 03:45:49 +0000 Message-ID: <41DE05E6.9090301@pobox.com> Date: Thu, 06 Jan 2005 22:45:42 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: netdev@oss.sgi.com Subject: Re: [PATCH] via-velocity: convert to module_param References: <20041129094032.3b9cb540@zqx3.pdx.osdl.net> In-Reply-To: <20041129094032.3b9cb540@zqx3.pdx.osdl.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13557 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev applied From jgarzik@pobox.com Thu Jan 6 07:47:33 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 07:47:40 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06FlWHk003619 for ; Thu, 6 Jan 2005 07:47:33 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1Cml5w-0006bj-96; Fri, 07 Jan 2005 03:47:24 +0000 Message-ID: <41DE0648.6090302@pobox.com> Date: Thu, 06 Jan 2005 22:47:20 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Dillow CC: Netdev Subject: Re: [PATCH 2.6] typhoon: fix PCI enable, add port IO option References: <1101535273.4734.3.camel@ori.thedillows.org> In-Reply-To: <1101535273.4734.3.camel@ori.thedillows.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13558 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev David Dillow wrote: > Jeff, please do a > > bk pull http://typhoon.bkbits.net/typhoon-2.6 Unfortunately, I can't pull this since it is not based on vanilla upstream 2.6.x. Can you please re-create your typhoon repository, based only on Linus's 2.6.x? Jeff From jgarzik@pobox.com Thu Jan 6 07:52:14 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 07:52:18 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06FqDGe004195 for ; Thu, 6 Jan 2005 07:52:13 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CmlAS-0006i1-SI; Fri, 07 Jan 2005 03:52:05 +0000 Message-ID: <41DE075F.4090008@pobox.com> Date: Thu, 06 Jan 2005 22:51:59 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Aristeu Sergio Rozanski Filho CC: netdev@oss.sgi.com Subject: Re: [PATCH] 1/5: eepro: cache EEPROM values References: <20041118234043.GF24080@cathedrallabs.org> In-Reply-To: <20041118234043.GF24080@cathedrallabs.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13559 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev your patches look good, but do not seem to apply. can you please resend versus 2.6.10? Jeff From jgarzik@pobox.com Thu Jan 6 07:53:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 07:53:36 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06FrQ2l004673 for ; Thu, 6 Jan 2005 07:53:31 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CmlBb-0006kx-Sp; Fri, 07 Jan 2005 03:53:16 +0000 Message-ID: <41DE07A7.30106@pobox.com> Date: Thu, 06 Jan 2005 22:53:11 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Koushik CC: netdev@oss.sgi.com, kumarkr@us.ibm.com, rapuru.sriram@s2io.com, leonid.grossman@s2io.com, alicia.pena@s2io.com, ravinandan.arakali@s2io.com Subject: Re: [PATCH 2.6.9-rc2 1/1] S2io: fixes in free_shared_mem function References: <20041118213506.1081C32887@linux.site> In-Reply-To: <20041118213506.1081C32887@linux.site> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13561 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev applied From davem@davemloft.net Thu Jan 6 07:53:27 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 07:53:33 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06FrNV5004672 for ; Thu, 6 Jan 2005 07:53:27 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cml78-00036D-00; Thu, 06 Jan 2005 19:48:38 -0800 Date: Thu, 6 Jan 2005 19:48:38 -0800 From: "David S. Miller" To: Darren Williams Cc: peterc@gelato.unsw.edu.au, netdev@oss.sgi.com, mchan@broadcom.com Subject: Re: TG3 fix for slow switches (Was: TG3 driver failure on HP 16-way) Message-Id: <20050106194838.0909020a.davem@davemloft.net> In-Reply-To: <20050107001743.GH17027@cse.unsw.EDU.AU> References: <16839.27239.264551.415058@berry.gelato.unsw.EDU.AU> <20041220161552.2b88aa3d.davem@davemloft.net> <16839.30796.413939.333935@wombat.chubb.wattle.id.au> <20050106151910.4d51673e.davem@davemloft.net> <20050107001743.GH17027@cse.unsw.EDU.AU> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13560 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Fri, 7 Jan 2005 11:17:44 +1100 Darren Williams wrote: > No, if I revert back to an earlier driver the link comes > up OK printing: > tg3: eth0: Link is up at 1000 Mbps, full duplex. > tg3: eth0: Flow control is off for TX and off for RX. > after a short delay. With the current dirver I do not > see any prinks from tg3_link_report about the state > of the link. Is the working verion with Peter's patch applied? In any case, please try this one instead which is a variant of the second patch Peter proposed plus some signedness fixes I've done. Thanks. --- ../linus-2.6/drivers/net/tg3.c 2005-01-06 19:23:03.000000000 -0800 +++ drivers/net/tg3.c 2005-01-06 19:22:53.000000000 -0800 @@ -60,8 +60,8 @@ #define DRV_MODULE_NAME "tg3" #define PFX DRV_MODULE_NAME ": " -#define DRV_MODULE_VERSION "3.14" -#define DRV_MODULE_RELDATE "November 15, 2004" +#define DRV_MODULE_VERSION "3.15" +#define DRV_MODULE_RELDATE "January 6, 2005" #define TG3_DEF_MAC_MODE 0 #define TG3_DEF_RX_MODE 0 @@ -493,7 +493,8 @@ static int tg3_readphy(struct tg3 *tp, int reg, u32 *val) { u32 frame_val; - int loops, ret; + unsigned int loops; + int ret; if ((tp->mi_mode & MAC_MI_MODE_AUTO_POLL) != 0) { tw32_f(MAC_MI_MODE, @@ -512,7 +513,7 @@ tw32_f(MAC_MI_COM, frame_val); loops = PHY_BUSY_LOOPS; - while (loops-- > 0) { + while (loops != 0) { udelay(10); frame_val = tr32(MAC_MI_COM); @@ -521,10 +522,11 @@ frame_val = tr32(MAC_MI_COM); break; } + loops -= 1; } ret = -EBUSY; - if (loops > 0) { + if (loops != 0) { *val = frame_val & MI_COM_DATA_MASK; ret = 0; } @@ -540,7 +542,8 @@ static int tg3_writephy(struct tg3 *tp, int reg, u32 val) { u32 frame_val; - int loops, ret; + unsigned int loops; + int ret; if ((tp->mi_mode & MAC_MI_MODE_AUTO_POLL) != 0) { tw32_f(MAC_MI_MODE, @@ -558,7 +561,7 @@ tw32_f(MAC_MI_COM, frame_val); loops = PHY_BUSY_LOOPS; - while (loops-- > 0) { + while (loops != 0) { udelay(10); frame_val = tr32(MAC_MI_COM); if ((frame_val & MI_COM_BUSY) == 0) { @@ -566,10 +569,11 @@ frame_val = tr32(MAC_MI_COM); break; } + loops -= 1; } ret = -EBUSY; - if (loops > 0) + if (loops != 0) ret = 0; if ((tp->mi_mode & MAC_MI_MODE_AUTO_POLL) != 0) { @@ -1557,7 +1561,9 @@ bmsr = 0; for (i = 0; i < 100; i++) { tg3_readphy(tp, MII_BMSR, &bmsr); - tg3_readphy(tp, MII_BMSR, &bmsr); + if (tg3_readphy(tp, MII_BMSR, &bmsr)) + bmsr = 0; + if (bmsr & BMSR_LSTATUS) break; udelay(40); @@ -1640,7 +1646,9 @@ tg3_phy_copper_begin(tp); tg3_readphy(tp, MII_BMSR, &tmp); - tg3_readphy(tp, MII_BMSR, &tmp); + if (tg3_readphy(tp, MII_BMSR, &tmp)) + tmp = 0; + if (tmp & BMSR_LSTATUS) current_link_up = 1; } @@ -7209,7 +7217,8 @@ u32 bmsr, adv_reg, tg3_ctrl; tg3_readphy(tp, MII_BMSR, &bmsr); - tg3_readphy(tp, MII_BMSR, &bmsr); + if (tg3_readphy(tp, MII_BMSR, &bmsr)) + bmsr = 0; if (bmsr & BMSR_LSTATUS) goto skip_phy_reset; From jgarzik@pobox.com Thu Jan 6 07:57:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 07:57:05 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06Fv07G005662 for ; Thu, 6 Jan 2005 07:57:00 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CmlF6-0006qf-9m; Fri, 07 Jan 2005 03:56:52 +0000 Message-ID: <41DE0880.7080600@pobox.com> Date: Thu, 06 Jan 2005 22:56:48 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Don Fry CC: tsbogend@alpha.franken.de, netdev@oss.sgi.com Subject: Re: [PATCH 2.4.28-rc2-bk3] pcnet32: added pci_disable_device References: <20041112194124.GA17957@us.ibm.com> In-Reply-To: <20041112194124.GA17957@us.ibm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13562 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev applied From davem@davemloft.net Thu Jan 6 07:58:18 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 07:58:22 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06FwI63006129 for ; Thu, 6 Jan 2005 07:58:18 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CmlBt-000370-00; Thu, 06 Jan 2005 19:53:33 -0800 Date: Thu, 6 Jan 2005 19:53:33 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: jgarzik@pobox.com, netdev@oss.sgi.com, herbert@gondor.apana.org.au Subject: Re: [RFC PATCH] Fix double dereference (Re: IPv6 badness continues) Message-Id: <20050106195333.2a90f6cb.davem@davemloft.net> In-Reply-To: <20050107.111806.27181187.yoshfuji@linux-ipv6.org> References: <41DA3A60.8050102@pobox.com> <20050107.111806.27181187.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j06FwI63006129 X-archive-position: 13563 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Fri, 07 Jan 2005 11:18:06 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > Am I miss something? Does every path which destroys an ipv6 socket do the sk_dst_reset()? If so, your patch should be valid. From jgarzik@pobox.com Thu Jan 6 08:03:16 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 08:03:20 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06G3Eii006648 for ; Thu, 6 Jan 2005 08:03:16 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CmlL7-00071e-Ta; Fri, 07 Jan 2005 04:03:06 +0000 Message-ID: <41DE09F5.5020902@pobox.com> Date: Thu, 06 Jan 2005 23:03:01 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Pekka Enberg CC: netdev@oss.sgi.com Subject: Re: [PATCH] 8139too: use iomap for pio/mmio References: <1099689836.5732.2.camel@cherry> In-Reply-To: <1099689836.5732.2.camel@cherry> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13564 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev applied From dsw@cse.unsw.edu.au Thu Jan 6 09:30:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 09:30:30 -0800 (PST) Received: from note.orchestra.cse.unsw.EDU.AU (root@note.orchestra.cse.unsw.EDU.AU [129.94.242.24]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06HUO2U011991 for ; Thu, 6 Jan 2005 09:30:25 -0800 Received: From wagner With LocalMail ; Fri, 7 Jan 2005 16:30:09 +1100 From: Darren Williams To: "David S. Miller" Date: Fri, 7 Jan 2005 16:30:09 +1100 Cc: peterc@gelato.unsw.edu.au, netdev@oss.sgi.com, mchan@broadcom.com Subject: Re: TG3 fix for slow switches (Was: TG3 driver failure on HP 16-way) Message-ID: <20050107053009.GI17027@cse.unsw.EDU.AU> Mail-Followup-To: "David S. Miller" , peterc@gelato.unsw.edu.au, netdev@oss.sgi.com, mchan@broadcom.com References: <16839.27239.264551.415058@berry.gelato.unsw.EDU.AU> <20041220161552.2b88aa3d.davem@davemloft.net> <16839.30796.413939.333935@wombat.chubb.wattle.id.au> <20050106151910.4d51673e.davem@davemloft.net> <20050107001743.GH17027@cse.unsw.EDU.AU> <20050106194838.0909020a.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050106194838.0909020a.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040523i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13565 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dsw@gelato.unsw.edu.au Precedence: bulk X-list: netdev Hi David On Thu, 06 Jan 2005, David S. Miller wrote: > On Fri, 7 Jan 2005 11:17:44 +1100 > Darren Williams wrote: > > > No, if I revert back to an earlier driver the link comes > > up OK printing: > > tg3: eth0: Link is up at 1000 Mbps, full duplex. > > tg3: eth0: Flow control is off for TX and off for RX. > > after a short delay. With the current dirver I do not > > see any prinks from tg3_link_report about the state > > of the link. > > Is the working verion with Peter's patch applied? No see below. > > In any case, please try this one instead which is a variant > of the second patch Peter proposed plus some signedness fixes > I've done. > No still no link. The patch that I have working is: tg3.c:v2.9 (March 8, 2004) that I took from 2.6.7 > Thanks. > > --- ../linus-2.6/drivers/net/tg3.c 2005-01-06 19:23:03.000000000 -0800 > +++ drivers/net/tg3.c 2005-01-06 19:22:53.000000000 -0800 > @@ -60,8 +60,8 @@ > > #define DRV_MODULE_NAME "tg3" > #define PFX DRV_MODULE_NAME ": " > -#define DRV_MODULE_VERSION "3.14" > -#define DRV_MODULE_RELDATE "November 15, 2004" > +#define DRV_MODULE_VERSION "3.15" > +#define DRV_MODULE_RELDATE "January 6, 2005" > > #define TG3_DEF_MAC_MODE 0 > #define TG3_DEF_RX_MODE 0 > @@ -493,7 +493,8 @@ > static int tg3_readphy(struct tg3 *tp, int reg, u32 *val) > { > u32 frame_val; > - int loops, ret; > + unsigned int loops; > + int ret; > > if ((tp->mi_mode & MAC_MI_MODE_AUTO_POLL) != 0) { > tw32_f(MAC_MI_MODE, > @@ -512,7 +513,7 @@ > tw32_f(MAC_MI_COM, frame_val); > > loops = PHY_BUSY_LOOPS; > - while (loops-- > 0) { > + while (loops != 0) { > udelay(10); > frame_val = tr32(MAC_MI_COM); > > @@ -521,10 +522,11 @@ > frame_val = tr32(MAC_MI_COM); > break; > } > + loops -= 1; > } > > ret = -EBUSY; > - if (loops > 0) { > + if (loops != 0) { > *val = frame_val & MI_COM_DATA_MASK; > ret = 0; > } > @@ -540,7 +542,8 @@ > static int tg3_writephy(struct tg3 *tp, int reg, u32 val) > { > u32 frame_val; > - int loops, ret; > + unsigned int loops; > + int ret; > > if ((tp->mi_mode & MAC_MI_MODE_AUTO_POLL) != 0) { > tw32_f(MAC_MI_MODE, > @@ -558,7 +561,7 @@ > tw32_f(MAC_MI_COM, frame_val); > > loops = PHY_BUSY_LOOPS; > - while (loops-- > 0) { > + while (loops != 0) { > udelay(10); > frame_val = tr32(MAC_MI_COM); > if ((frame_val & MI_COM_BUSY) == 0) { > @@ -566,10 +569,11 @@ > frame_val = tr32(MAC_MI_COM); > break; > } > + loops -= 1; > } > > ret = -EBUSY; > - if (loops > 0) > + if (loops != 0) > ret = 0; > > if ((tp->mi_mode & MAC_MI_MODE_AUTO_POLL) != 0) { > @@ -1557,7 +1561,9 @@ > bmsr = 0; > for (i = 0; i < 100; i++) { > tg3_readphy(tp, MII_BMSR, &bmsr); > - tg3_readphy(tp, MII_BMSR, &bmsr); > + if (tg3_readphy(tp, MII_BMSR, &bmsr)) > + bmsr = 0; > + > if (bmsr & BMSR_LSTATUS) > break; > udelay(40); > @@ -1640,7 +1646,9 @@ > tg3_phy_copper_begin(tp); > > tg3_readphy(tp, MII_BMSR, &tmp); > - tg3_readphy(tp, MII_BMSR, &tmp); > + if (tg3_readphy(tp, MII_BMSR, &tmp)) > + tmp = 0; > + > if (tmp & BMSR_LSTATUS) > current_link_up = 1; > } > @@ -7209,7 +7217,8 @@ > u32 bmsr, adv_reg, tg3_ctrl; > > tg3_readphy(tp, MII_BMSR, &bmsr); > - tg3_readphy(tp, MII_BMSR, &bmsr); > + if (tg3_readphy(tp, MII_BMSR, &bmsr)) > + bmsr = 0; > > if (bmsr & BMSR_LSTATUS) > goto skip_phy_reset; -------------------------------------------------- Darren Williams Gelato@UNSW -------------------------------------------------- From davem@davemloft.net Thu Jan 6 09:33:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 09:33:29 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06HXLB8012346 for ; Thu, 6 Jan 2005 09:33:26 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cmmfu-0003UJ-00; Thu, 06 Jan 2005 21:28:38 -0800 Date: Thu, 6 Jan 2005 21:28:38 -0800 From: "David S. Miller" To: Darren Williams Cc: peterc@gelato.unsw.edu.au, netdev@oss.sgi.com, mchan@broadcom.com Subject: Re: TG3 fix for slow switches (Was: TG3 driver failure on HP 16-way) Message-Id: <20050106212838.5e94af1f.davem@davemloft.net> In-Reply-To: <20050107053009.GI17027@cse.unsw.EDU.AU> References: <16839.27239.264551.415058@berry.gelato.unsw.EDU.AU> <20041220161552.2b88aa3d.davem@davemloft.net> <16839.30796.413939.333935@wombat.chubb.wattle.id.au> <20050106151910.4d51673e.davem@davemloft.net> <20050107001743.GH17027@cse.unsw.EDU.AU> <20050106194838.0909020a.davem@davemloft.net> <20050107053009.GI17027@cse.unsw.EDU.AU> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13566 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Fri, 7 Jan 2005 16:30:09 +1100 Darren Williams wrote: > > In any case, please try this one instead which is a variant > > of the second patch Peter proposed plus some signedness fixes > > I've done. > > > No still no link. The patch that I have working is: > tg3.c:v2.9 (March 8, 2004) > that I took from 2.6.7 Darren, I believe you are confusing this entire situation. And I should have suspected this when you were responding to my test requests instead of Peter. Peter had a problem on a 16-way HP machine, and the patch that I just gave to you is nearly identical to his which he said makes his problem go away. Are you having the same problem on the same configuration or are you hoping this fixes some other tg3 bug that you happen to be seeing? From dave@thedillows.org Thu Jan 6 10:35:22 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 10:35:28 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j06IZJx5014222 for ; Thu, 6 Jan 2005 10:35:21 -0800 Received: (qmail 14427 invoked by uid 0); 7 Jan 2005 06:43:07 -0000 Received: from user-69-1-45-93.knology.net (HELO ori.thedillows.org) (69.1.45.93) by smtp7.knology.net with SMTP; 7 Jan 2005 06:43:07 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j076ZAn7009055; Fri, 7 Jan 2005 01:35:11 -0500 Received: (from il1@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j076ZAoX009054; Fri, 7 Jan 2005 01:35:10 -0500 X-Authentication-Warning: ori.thedillows.org: il1 set sender to dave@thedillows.org using -f Subject: Re: [PATCH 2.6] typhoon: fix PCI enable, add port IO option From: David Dillow To: Jeff Garzik Cc: Netdev In-Reply-To: <41DE0648.6090302@pobox.com> References: <1101535273.4734.3.camel@ori.thedillows.org> <41DE0648.6090302@pobox.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Fri, 07 Jan 2005 01:35:08 -0500 Message-Id: <1105079709.6202.4.camel@ori.thedillows.org> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13567 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev On Thu, 2005-01-06 at 22:47 -0500, Jeff Garzik wrote: > David Dillow wrote: > > Jeff, please do a > > > > bk pull http://typhoon.bkbits.net/typhoon-2.6 > > Unfortunately, I can't pull this since it is not based on vanilla > upstream 2.6.x. Heh, I based it off netdev-2.6 at the time, because, IIRC, there were changes in it that hadn't been pushed to Linus yet, and hadn't come through me to be picked up in my tree. (There may be a way for me to do it, I didn't try very hard.) > Can you please re-create your typhoon repository, based only on Linus's > 2.6.x? Sure thing, it is there now. Content hasn't changed from the broken-out patches I sent earlier, but I broke the file deltas into changesets of their own. -- David Dillow From davem@davemloft.net Thu Jan 6 10:49:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 10:49:41 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06Inbuu015055 for ; Thu, 6 Jan 2005 10:49:37 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cmnrh-0003ky-00; Thu, 06 Jan 2005 22:44:53 -0800 Date: Thu, 6 Jan 2005 22:44:53 -0800 From: "David S. Miller" To: Dave Dillow Cc: netdev@oss.sgi.com Subject: Re: Ethtool offload patch Message-Id: <20050106224453.3420f987.davem@davemloft.net> In-Reply-To: <1104865471.9860.16.camel@dillow.idleaire.com> References: <1104396895.5845.1.camel@ori.thedillows.org> <20050104094423.2d404759.davem@davemloft.net> <1104865471.9860.16.camel@dillow.idleaire.com> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13568 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Tue, 04 Jan 2005 14:04:31 -0500 Dave Dillow wrote: > I know you just got back from vacation, so when you get a chance, I'd > welcome comments on the patch series -- I did most of it simply, just to > see how it would perform. There is (obviously) still work to do -- I > need to figure out how to determine if an IPv6 address is local, and it > may be nice to have some sort of LRU list to offload the most active SAs > when resources get low on the card. I intend to review this next week some time. Sorry for the delay, but it's snowing like crazy in the mountains and I simply can't resist taking advantage of that :-) From rddunlap@osdl.org Thu Jan 6 11:14:58 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 11:15:03 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06JEw8P016049 for ; Thu, 6 Jan 2005 11:14:58 -0800 Received: from midway.verizon.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id j077Ejd21091; Thu, 6 Jan 2005 23:14:45 -0800 Date: Thu, 6 Jan 2005 23:08:03 -0800 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: jgarzik , jt@hpl.hp.com Subject: [PATCH[ via-ircc: fix exit section usage Message-Id: <20050106230803.00714c45.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; i386-vine-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13569 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Fix exit section usage, starting with this Error from reference_discarded.pl (make buildcheck): Error: ./drivers/net/irda/via-ircc.o .data refers to 000000f8 R_386_32 .exit.text Signed-off-by: Randy Dunlap diffstat:= drivers/net/irda/via-ircc.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff -Naurp ./drivers/net/irda/via-ircc.c~irda_via_devexit ./drivers/net/irda/via-ircc.c --- ./drivers/net/irda/via-ircc.c~irda_via_devexit 2004-12-24 13:33:47.000000000 -0800 +++ ./drivers/net/irda/via-ircc.c 2005-01-06 21:18:49.742203456 -0800 @@ -83,7 +83,7 @@ static struct via_ircc_cb *dev_self[] = /* Some prototypes */ static int via_ircc_open(int i, chipio_t * info, unsigned int id); -static int __exit via_ircc_close(struct via_ircc_cb *self); +static int via_ircc_close(struct via_ircc_cb *self); static int via_ircc_dma_receive(struct via_ircc_cb *self); static int via_ircc_dma_receive_complete(struct via_ircc_cb *self, int iobase); @@ -111,7 +111,7 @@ static void hwreset(struct via_ircc_cb * static int via_ircc_dma_xmit(struct via_ircc_cb *self, u16 iobase); static int upload_rxdata(struct via_ircc_cb *self, int iobase); static int __devinit via_init_one (struct pci_dev *pcidev, const struct pci_device_id *id); -static void __exit via_remove_one (struct pci_dev *pdev); +static void __devexit via_remove_one (struct pci_dev *pdev); /* FIXME : Should use udelay() instead, even if we are x86 only - Jean II */ static void iodelay(int udelay) @@ -140,7 +140,7 @@ static struct pci_driver via_driver = { .name = VIA_MODULE_NAME, .id_table = via_pci_tbl, .probe = via_init_one, - .remove = via_remove_one, + .remove = __devexit_p(via_remove_one), }; @@ -273,7 +273,7 @@ static int __devinit via_init_one (struc * Close all configured chips * */ -static void __exit via_ircc_clean(void) +static void via_ircc_clean(void) { int i; @@ -285,7 +285,7 @@ static void __exit via_ircc_clean(void) } } -static void __exit via_remove_one (struct pci_dev *pdev) +static void __devexit via_remove_one (struct pci_dev *pdev) { IRDA_DEBUG(3, "%s()\n", __FUNCTION__); @@ -468,7 +468,7 @@ static __devinit int via_ircc_open(int i * Close driver instance * */ -static int __exit via_ircc_close(struct via_ircc_cb *self) +static int via_ircc_close(struct via_ircc_cb *self) { int iobase; --- From jgarzik@pobox.com Thu Jan 6 11:24:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 11:24:17 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06JO9Y1017446 for ; Thu, 6 Jan 2005 11:24:10 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CmoTZ-0004vD-RF; Fri, 07 Jan 2005 07:24:01 +0000 Message-ID: <41DE390A.2050002@pobox.com> Date: Fri, 07 Jan 2005 02:23:54 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Dillow CC: Netdev Subject: Re: [PATCH 2.6] typhoon: fix PCI enable, add port IO option References: <1101535273.4734.3.camel@ori.thedillows.org> <41DE0648.6090302@pobox.com> <1105079709.6202.4.camel@ori.thedillows.org> In-Reply-To: <1105079709.6202.4.camel@ori.thedillows.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13570 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev David Dillow wrote: > On Thu, 2005-01-06 at 22:47 -0500, Jeff Garzik wrote: > >>David Dillow wrote: >> >>>Jeff, please do a >>> >>> bk pull http://typhoon.bkbits.net/typhoon-2.6 >> >>Unfortunately, I can't pull this since it is not based on vanilla >>upstream 2.6.x. > > > Heh, I based it off netdev-2.6 at the time, because, IIRC, there were > changes in it that hadn't been pushed to Linus yet, and hadn't come > through me to be picked up in my tree. (There may be a way for me to do > it, I didn't try very hard.) it's a natural guess to base it off of netdev-2.6, but that's mainly for people who send patches. For BitKeeper, it's better to base it off a vanilla linux-2.6 tree. >>Can you please re-create your typhoon repository, based only on Linus's >>2.6.x? > > > Sure thing, it is there now. Content hasn't changed from the broken-out > patches I sent earlier, but I broke the file deltas into changesets of > their own. thanks, pulled. Jeff From linux.lover2004@gmail.com Thu Jan 6 12:20:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 12:20:19 -0800 (PST) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.206]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06KK71g022398 for ; Thu, 6 Jan 2005 12:20:08 -0800 Received: by rproxy.gmail.com with SMTP id c16so359491rne for ; Fri, 07 Jan 2005 00:20:00 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:mime-version:content-type:content-transfer-encoding; b=den3sxkd6UX861kVNMJJz1n4GcToNJl6K+dgd4wYOBb2/9KY3lbX+/+gcnB+xJ9Csdwwbgym8YriLI9d6rQXfxqpD90b2k9JM93lmALKVfjqxLT+WVaTs3bwXrbo5CVtwXsBVo/J4f1d7GwzTxZipkSFf6PFKh47MFqty5FCDlQ= Received: by 10.38.22.71 with SMTP id 71mr106244rnv; Fri, 07 Jan 2005 00:20:00 -0800 (PST) Received: by 10.38.207.9 with HTTP; Fri, 7 Jan 2005 00:20:00 -0800 (PST) Message-ID: <72c6e3790501070020755ffacf@mail.gmail.com> Date: Fri, 7 Jan 2005 13:50:00 +0530 From: linux lover Reply-To: linux lover To: linux-net@vger.kernel.org Subject: require packet path at device layer Cc: netdev@oss.sgi.com Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13571 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: linux.lover2004@gmail.com Precedence: bulk X-list: netdev Hello, Can anybody provide me how packet control is transferred from netif_rx to netif_receive_skb function. regards, linux.lover From agx@sigxcpu.org Thu Jan 6 12:41:23 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 12:41:34 -0800 (PST) Received: from honk1.physik.uni-konstanz.de (honk1.physik.uni-konstanz.de [134.34.140.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06KfM8v023314 for ; Thu, 6 Jan 2005 12:41:23 -0800 Received: from localhost (localhost.localnet [127.0.0.1]) by honk1.physik.uni-konstanz.de (Postfix) with ESMTP id 7BABF2BC41; Fri, 7 Jan 2005 09:41:09 +0100 (CET) Received: from honk1.physik.uni-konstanz.de ([127.0.0.1]) by localhost (honk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 19104-34; Fri, 7 Jan 2005 09:41:01 +0100 (CET) Received: from bogon.sigxcpu.org (unknown [62.157.100.134]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by honk1.physik.uni-konstanz.de (Postfix) with ESMTP id 6CCA42BC3C; Fri, 7 Jan 2005 09:41:01 +0100 (CET) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id C07424089; Fri, 7 Jan 2005 09:36:15 +0100 (CET) Date: Fri, 7 Jan 2005 09:36:15 +0100 From: Guido Guenther To: Don Fry Cc: Jeff Garzik , akpm@osdl.org, davem@davemloft.net, netdev@oss.sgi.com, lars@segv.dk Subject: Re: [patch 03/10] pcnet32: 79c976 with fiber optic fix Message-ID: <20050107083615.GC13766@bogon.ms20.nix> References: <200501050559.j055xb614676@mail.osdl.org> <41DDBF72.4000406@pobox.com> <20050106231956.GA22130@us.ibm.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IpbVkmxF4tDyP/Kb" Content-Disposition: inline In-Reply-To: <20050106231956.GA22130@us.ibm.com> User-Agent: Mutt/1.5.6i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at honk.physik.uni-konstanz.de X-Virus-Status: Clean X-archive-position: 13572 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: agx@sigxcpu.org Precedence: bulk X-list: netdev --IpbVkmxF4tDyP/Kb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jan 06, 2005 at 03:19:56PM -0800, Don Fry wrote: > 2) Thomas Bogendorfer was working on a patch to support a board with > both a fiber and copper connection on the same board. He is still > cooking that change, but it changes code in the same place, but in a > different way. I sent the patch to Andrew as a "quick fix" to get things working at all until Thomas's full fix is available. Cheers, -- Guido --IpbVkmxF4tDyP/Kb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFB3kn/n88szT8+ZCYRAn4+AJ9cDx7KBo2Ez1n2uHSDsqx0ordqqACfRKp6 w5zm1v4K64l3cMU4UltbGSw= =i3EM -----END PGP SIGNATURE----- --IpbVkmxF4tDyP/Kb-- From y030729@njupt.edu.cn Thu Jan 6 13:06:51 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 13:06:55 -0800 (PST) Received: from njupt.edu.cn (em.njupt.edu.cn [202.119.230.11]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j06L6nfn024279 for ; Thu, 6 Jan 2005 13:06:50 -0800 Received: (eyou send program); Fri, 07 Jan 2005 18:00:53 +0800 Message-ID: <305092053.32587@njupt.edu.cn> Received: from 10.10.136.115 by em.njupt.edu.cn with HTTP; Fri, 07 Jan 2005 18:00:53 +0800 X-WebMAIL-MUA: [10.10.136.115] From: "Zhenyu Wu" To: netdev@oss.sgi.com Cc: lartc@mailman.ds9a.nl, imipak@yahoo.com Date: Fri, 07 Jan 2005 18:00:53 +0800 Reply-To: "Zhenyu Wu" X-Priority: 3 Subject: Something on CBQ! Content-Type: text/plain X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13573 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: y030729@njupt.edu.cn Precedence: bulk X-list: netdev Hello, I think I have misundertood the relationship between cbq and the queue (such as Red) attached to it. This is my latest opion, please give me some advice on it: At beginning, I thought that a packet will be firstly classified by the CBQ where it will find the proper class it belongs to. Then the packet enters the queue attached to that class. At last, the packet is scheduled in that queue, and put into the link. But now, I find it is wrong. I have read the source code on CBQ again, especially the part-cbq_dequeue, I think that at first the CBQ will find the active class and their priority. Then in the function cbq_dequeue_prio, the algorithm WRR will be used to schedule the packet. At first, it find a class, then, this skb = cl->q->dequeue(cl->q) maybe very important, I think "cl->q" is the queue attached to the class "cl". So, the packet in the different queue is scheduled and put into the link. Another issue is that a scheduling algorithm WRR is used here, But i think it is not the best one, So can we modify here and add a new scheduling algorithm as we expected? What about your opions? Best, From dsw@cse.unsw.edu.au Thu Jan 6 13:25:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 13:25:41 -0800 (PST) Received: from note.orchestra.cse.unsw.EDU.AU (root@note.orchestra.cse.unsw.EDU.AU [129.94.242.24]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06LPYOL025252 for ; Thu, 6 Jan 2005 13:25:34 -0800 Received: From wagner With LocalMail ; Fri, 7 Jan 2005 20:25:19 +1100 From: Darren Williams To: "David S. Miller" Date: Fri, 7 Jan 2005 20:25:19 +1100 Cc: Darren Williams , peterc@gelato.unsw.edu.au, netdev@oss.sgi.com, mchan@broadcom.com Subject: Re: TG3 fix for slow switches (Was: TG3 driver failure on HP 16-way) Message-ID: <20050107092519.GA20134@cse.unsw.EDU.AU> Mail-Followup-To: "David S. Miller" , Darren Williams , peterc@gelato.unsw.edu.au, netdev@oss.sgi.com, mchan@broadcom.com References: <16839.27239.264551.415058@berry.gelato.unsw.EDU.AU> <20041220161552.2b88aa3d.davem@davemloft.net> <16839.30796.413939.333935@wombat.chubb.wattle.id.au> <20050106151910.4d51673e.davem@davemloft.net> <20050107001743.GH17027@cse.unsw.EDU.AU> <20050106194838.0909020a.davem@davemloft.net> <20050107053009.GI17027@cse.unsw.EDU.AU> <20050106212838.5e94af1f.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050106212838.5e94af1f.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040523i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13574 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dsw@gelato.unsw.edu.au Precedence: bulk X-list: netdev Hi David On Thu, 06 Jan 2005, David S. Miller wrote: > On Fri, 7 Jan 2005 16:30:09 +1100 > Darren Williams wrote: > > > > In any case, please try this one instead which is a variant > > > of the second patch Peter proposed plus some signedness fixes > > > I've done. > > > > > No still no link. The patch that I have working is: > > tg3.c:v2.9 (March 8, 2004) > > that I took from 2.6.7 > > Darren, I believe you are confusing this entire situation. > And I should have suspected this when you were responding > to my test requests instead of Peter. > > Peter had a problem on a 16-way HP machine, and the patch > that I just gave to you is nearly identical to his which > he said makes his problem go away. > Yes it the same machine. > Are you having the same problem on the same configuration or > are you hoping this fixes some other tg3 bug that you happen > to be seeing? I'm having the same problem on the same machine. Peter's original patch fixed it once as far as I know. I have patched the currently kernel with Peter's original patch though have had no success bringing the interface up. Thats why I started looking at older drivers since they play nicely with the switch. Peter is currently on holidays, and I am using the machine for benchmarking and assisting with solving this problem. I should of let you know to avoid the confusion. Darren -------------------------------------------------- Darren Williams Gelato@UNSW -------------------------------------------------- From yoshfuji@linux-ipv6.org Thu Jan 6 13:30:30 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 13:30:34 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06LURSl025820 for ; Thu, 6 Jan 2005 13:30:29 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id AA2D333CC2; Fri, 7 Jan 2005 18:30:45 +0900 (JST) Date: Fri, 07 Jan 2005 18:30:39 +0900 (JST) Message-Id: <20050107.183039.59264047.yoshfuji@linux-ipv6.org> To: davem@davemloft.net Cc: jgarzik@pobox.com, netdev@oss.sgi.com, herbert@gondor.apana.org.au, yoshfuji@linux-ipv6.org Subject: Re: [RFC PATCH] Fix double dereference From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20050106195333.2a90f6cb.davem@davemloft.net> References: <41DA3A60.8050102@pobox.com> <20050107.111806.27181187.yoshfuji@linux-ipv6.org> <20050106195333.2a90f6cb.davem@davemloft.net> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13575 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev In article <20050106195333.2a90f6cb.davem@davemloft.net> (at Thu, 6 Jan 2005 19:53:33 -0800), "David S. Miller" says: > On Fri, 07 Jan 2005 11:18:06 +0900 (JST) > YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > > > Am I miss something? > > Does every path which destroys an ipv6 socket do the > sk_dst_reset()? If so, your patch should be valid. Currently, inet6_destroy_sock() in net/ipv6/af_inet6.c, which is called from udpv6_destory_sock() etc., takes care of this. In that means, yes. However, one for ipv4 doesn't do this. I'll come up with new changesets. Thanks. --yoshfuji From SRS0+ed48ce240802494c5636+502+infradead.org+dwmw2@baythorne.srs.infradead.org Thu Jan 6 14:41:50 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 14:41:54 -0800 (PST) Received: from baythorne.infradead.org (IDENT:U2FsdGVkX1/bmszRjVZRSYVojw1papCITQr1lK5G6GI@baythorne.infradead.org [81.187.226.107]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06MfmQb028054 for ; Thu, 6 Jan 2005 14:41:49 -0800 Received: from localhost ([127.0.0.1] helo=localhost.localdomain) by baythorne.infradead.org with esmtpsa (Exim 4.43 #1 (Red Hat Linux)) id 1CmrSs-0001Lv-GN; Fri, 07 Jan 2005 10:35:30 +0000 Subject: Re: [PATCH] Check for SOL_SOCKET in compat_sys_getsockopt From: David Woodhouse To: Olaf Kirch Cc: netdev@oss.sgi.com In-Reply-To: <20050103143306.GG25446@suse.de> References: <20050103143306.GG25446@suse.de> Content-Type: text/plain Date: Fri, 07 Jan 2005 10:35:29 +0000 Message-Id: <1105094129.5547.98.camel@baythorne.infradead.org> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3.dwmw2.1) Content-Transfer-Encoding: 7bit X-SRS-Rewrite: SMTP reverse-path rewritten from by baythorne.infradead.org See http://www.infradead.org/rpr.html X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13576 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev On Mon, 2005-01-03 at 15:33 +0100, Olaf Kirch wrote: > compat_sys_getsockopt checks for SO_RCVTIMEO/SO_SNDTIMEO without > making sure that the level is actually SOL_SOCKET. This can break > getsockopt() requests for other protocols. It's a band-aid, not a fix. Trying to do the conversion in compat_sys_getsockopt() for _all_ possible sockopts is broken. I think we need to let each protocol offer compat [gs]etsockopt() methods of its own, or at least have the existing [gs]etsockopt() methods check whether the current process is 32-bit or 64-bit and do the right thing. Have you started looking at netfilter with 32-bit userspace yet? :) -- dwmw2 From aris@cathedrallabs.org Thu Jan 6 15:13:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 15:13:28 -0800 (PST) Received: from smtp.uol.com.br (smtpout4.uol.com.br [200.221.4.195]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06NDKjM029206 for ; Thu, 6 Jan 2005 15:13:20 -0800 Received: from cathedrallabs.org (200-193-150-052.ctame7013.dsl.brasiltelecom.net.br [200.193.150.52]) by scorpion4.uol.com.br (Postfix) with ESMTP id 2EB397919; Fri, 7 Jan 2005 09:13:03 -0200 (BRST) Received: by cathedrallabs.org (Postfix, from userid 1000) id 56D8D231E8; Fri, 7 Jan 2005 09:13:03 -0200 (GMT+2) Date: Fri, 7 Jan 2005 09:13:03 -0200 From: Aristeu Sergio Rozanski Filho To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: Re: [PATCH] 1/5: eepro: cache EEPROM values Message-ID: <20050107111303.GR27328@cathedrallabs.org> References: <20041118234043.GF24080@cathedrallabs.org> <41DE075F.4090008@pobox.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="J+eNKFoVC4T1DV3f" Content-Disposition: inline In-Reply-To: <41DE075F.4090008@pobox.com> User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13577 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: aris@cathedrallabs.org Precedence: bulk X-list: netdev --J+eNKFoVC4T1DV3f Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > your patches look good, but do not seem to apply. > > can you please resend versus 2.6.10? sure! they're attached -- Aristeu --J+eNKFoVC4T1DV3f Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="01-eepro-cache_eeprom_values.patch" eepro: cache EEPROM values Signed-off-by: Aristeu Sergio Rozanski Filho --- 2.6-inc/drivers/net/eepro.c 2004-09-13 15:54:43.000000000 -0300 +++ 2.6-foo/drivers/net/eepro.c 2004-09-14 13:46:15.000000000 -0300 @@ -214,6 +214,7 @@ struct eepro_local { short rcv_lower_limit; short rcv_upper_limit; unsigned char eeprom_reg; + unsigned short word[8]; }; /* The station (ethernet) address prefix, used for IDing the board. */ @@ -608,16 +609,22 @@ out: } #endif -static void __init printEEPROMInfo(short ioaddr, struct net_device *dev) +static void __init printEEPROMInfo(struct net_device *dev) { + struct eepro_local *lp = (struct eepro_local *)dev->priv; + int ioaddr = dev->base_addr; unsigned short Word; int i,j; - for (i=0, j=ee_Checksum; iword[i]; + for ( ; i < ee_SIZE; i++) + j += read_eeprom(ioaddr, i, dev); + printk(KERN_DEBUG "Checksum: %#x\n",j&0xffff); - Word=read_eeprom(ioaddr, 0, dev); + Word = lp->word[0]; printk(KERN_DEBUG "Word0:\n"); printk(KERN_DEBUG " Plug 'n Pray: %d\n",GetBit(Word,ee_PnP)); printk(KERN_DEBUG " Buswidth: %d\n",(GetBit(Word,ee_BusWidth)+1)*8 ); @@ -625,7 +632,7 @@ static void __init printEEPROMInfo(short printk(KERN_DEBUG " IO Address: %#x\n", (Word>>ee_IO0)<<4); if (net_debug>4) { - Word=read_eeprom(ioaddr, 1, dev); + Word = lp->word[1]; printk(KERN_DEBUG "Word1:\n"); printk(KERN_DEBUG " INT: %d\n", Word & ee_IntMask); printk(KERN_DEBUG " LI: %d\n", GetBit(Word,ee_LI)); @@ -636,7 +643,7 @@ static void __init printEEPROMInfo(short printk(KERN_DEBUG " Duplex: %d\n", GetBit(Word,ee_Duplex)); } - Word=read_eeprom(ioaddr, 5, dev); + Word = lp->word[5]; printk(KERN_DEBUG "Word5:\n"); printk(KERN_DEBUG " BNC: %d\n",GetBit(Word,ee_BNC_TPE)); printk(KERN_DEBUG " NumConnectors: %d\n",GetBit(Word,ee_NumConn)); @@ -646,12 +653,12 @@ static void __init printEEPROMInfo(short if (GetBit(Word,ee_PortAUI)) printk(KERN_DEBUG "AUI "); printk(KERN_DEBUG "port(s) \n"); - Word=read_eeprom(ioaddr, 6, dev); + Word = lp->word[6]; printk(KERN_DEBUG "Word6:\n"); printk(KERN_DEBUG " Stepping: %d\n",Word & ee_StepMask); printk(KERN_DEBUG " BoardID: %d\n",Word>>ee_BoardID); - Word=read_eeprom(ioaddr, 7, dev); + Word = lp->word[7]; printk(KERN_DEBUG "Word7:\n"); printk(KERN_DEBUG " INT to IRQ:\n"); @@ -725,7 +732,7 @@ static void __init eepro_print_info (str printk(", %s.\n", ifmap[dev->if_port]); if (net_debug > 3) { - i = read_eeprom(dev->base_addr, 5, dev); + i = lp->word[5]; if (i & 0x2000) /* bit 13 of EEPROM word 5 */ printk(KERN_DEBUG "%s: Concurrent Processing is " "enabled but not used!\n", dev->name); @@ -733,7 +740,7 @@ static void __init eepro_print_info (str /* Check the station address for the manufacturer's code */ if (net_debug>3) - printEEPROMInfo(dev->base_addr, dev); + printEEPROMInfo(dev); } /* This is the real probe routine. Linux has a history of friendly device @@ -796,11 +803,16 @@ static int __init eepro_probe1(struct ne lp->xmt_bar = XMT_BAR_10; station_addr[0] = read_eeprom(ioaddr, 2, dev); } - station_addr[1] = read_eeprom(ioaddr, 3, dev); - station_addr[2] = read_eeprom(ioaddr, 4, dev); + + /* get all words at once. will be used here and for ethtool */ + for (i = 0; i < 8; i++) { + lp->word[i] = read_eeprom(ioaddr, i, dev); + } + station_addr[1] = lp->word[3]; + station_addr[2] = lp->word[4]; if (!lp->eepro) { - if (read_eeprom(ioaddr,7,dev)== ee_FX_INT2IRQ) + if (lp->word[7] == ee_FX_INT2IRQ) lp->eepro = 2; else if (station_addr[2] == SA_ADDR1) lp->eepro = 1; @@ -817,15 +829,15 @@ static int __init eepro_probe1(struct ne /* calculate {xmt,rcv}_{lower,upper}_limit */ eepro_recalc(dev); - if (GetBit( read_eeprom(ioaddr, 5, dev),ee_BNC_TPE)) + if (GetBit(lp->word[5], ee_BNC_TPE)) dev->if_port = BNC; else dev->if_port = TPE; if (dev->irq < 2 && lp->eepro != 0) { /* Mask off INT number */ - int count = read_eeprom(ioaddr, 1, dev) & 7; - unsigned irqMask = read_eeprom(ioaddr, 7, dev); + int count = lp->word[1] & 7; + unsigned irqMask = lp->word[7]; while (count--) irqMask &= irqMask - 1; @@ -941,7 +953,7 @@ static int eepro_open(struct net_device if (net_debug > 3) printk(KERN_DEBUG "%s: entering eepro_open routine.\n", dev->name); - irqMask = read_eeprom(ioaddr,7,dev); + irqMask = lp->word[7]; if (lp->eepro == LAN595FX_10ISA) { if (net_debug > 3) printk(KERN_DEBUG "p->eepro = 3;\n"); --J+eNKFoVC4T1DV3f Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="02-eepro-module_param.patch" diff -uprN -X dontdiff 2.6-inc/drivers/net/eepro.c 2.6/drivers/net/eepro.c --- 2.6-inc/drivers/net/eepro.c 2005-01-07 09:01:26.128430328 -0200 +++ 2.6/drivers/net/eepro.c 2005-01-07 09:01:12.409515920 -0200 @@ -1732,10 +1732,11 @@ MODULE_AUTHOR("Pascal Dupuis, and aris@c MODULE_DESCRIPTION("Intel i82595 ISA EtherExpressPro10/10+ driver"); MODULE_LICENSE("GPL"); -MODULE_PARM(io, "1-" __MODULE_STRING(MAX_EEPRO) "i"); -MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_EEPRO) "i"); -MODULE_PARM(mem, "1-" __MODULE_STRING(MAX_EEPRO) "i"); -MODULE_PARM(autodetect, "1-" __MODULE_STRING(1) "i"); +static int num_params; +module_param_array(io, int, num_params, 0); +module_param_array(irq, int, num_params, 0); +module_param_array(mem, int, num_params, 0); +module_param(autodetect, int, 0); MODULE_PARM_DESC(io, "EtherExpress Pro/10 I/O base addres(es)"); MODULE_PARM_DESC(irq, "EtherExpress Pro/10 IRQ number(s)"); MODULE_PARM_DESC(mem, "EtherExpress Pro/10 Rx buffer size(es) in kB (3-29)"); --J+eNKFoVC4T1DV3f Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="03-eepro-ethtool_basic.patch" diff -uprN -X dontdiff 2.6-inc/drivers/net/eepro.c 2.6/drivers/net/eepro.c --- 2.6-inc/drivers/net/eepro.c 2005-01-07 09:03:59.854060480 -0200 +++ 2.6/drivers/net/eepro.c 2005-01-07 09:04:39.659009208 -0200 @@ -23,6 +23,7 @@ This is a compatibility hardware problem. Versions: + 0.13b basic ethtool support (aris, 09/13/2004) 0.13a in memory shortage, drop packets also in board (Michael Westermann , 07/30/2002) 0.13 irq sharing, rewrote probe function, fixed a nasty bug in @@ -104,7 +105,7 @@ */ static const char version[] = - "eepro.c: v0.13 11/08/2001 aris@cathedrallabs.org\n"; + "eepro.c: v0.13b 09/13/2004 aris@cathedrallabs.org\n"; #include @@ -146,19 +147,21 @@ static const char version[] = #include #include #include +#include #include #include #include #define DRV_NAME "eepro" +#define DRV_VERSION "0.13b" #define compat_dev_kfree_skb( skb, mode ) dev_kfree_skb( (skb) ) /* I had reports of looong delays with SLOW_DOWN defined as udelay(2) */ #define SLOW_DOWN inb(0x80) /* udelay(2) */ #define compat_init_data __initdata - +enum iftype { AUI=0, BNC=1, TPE=2 }; /* First, a few definitions that the brave might change. */ /* A zero-terminated list of I/O addresses to be probed. */ @@ -743,16 +746,17 @@ static void __init eepro_print_info (str printEEPROMInfo(dev); } +static struct ethtool_ops eepro_ethtool_ops; + /* This is the real probe routine. Linux has a history of friendly device probes on the ISA bus. A good device probe avoids doing writes, and verifies that the correct device exists and functions. */ static int __init eepro_probe1(struct net_device *dev, int autoprobe) { - unsigned short station_addr[6], id, counter; + unsigned short station_addr[3], id, counter; int i; struct eepro_local *lp; - enum iftype { AUI=0, BNC=1, TPE=2 }; int ioaddr = dev->base_addr; /* Grab the region so we can find another board if autoIRQ fails. */ @@ -862,6 +866,7 @@ static int __init eepro_probe1(struct ne dev->set_multicast_list = &set_multicast_list; dev->tx_timeout = eepro_tx_timeout; dev->watchdog_timeo = TX_TIMEOUT; + dev->ethtool_ops = &eepro_ethtool_ops; /* print boot time info */ eepro_print_info(dev); @@ -1082,8 +1087,6 @@ static int eepro_open(struct net_device old9 = inb(ioaddr + 9); if (irqMask==ee_FX_INT2IRQ) { - enum iftype { AUI=0, BNC=1, TPE=2 }; - if (net_debug > 3) { printk(KERN_DEBUG "IrqMask: %#x\n",irqMask); printk(KERN_DEBUG "i82595FX detected!\n"); @@ -1713,6 +1716,64 @@ eepro_transmit_interrupt(struct net_devi } } +static int eepro_ethtool_get_settings(struct net_device *dev, + struct ethtool_cmd *cmd) +{ + struct eepro_local *lp = (struct eepro_local *)dev->priv; + + cmd->supported = SUPPORTED_10baseT_Half | + SUPPORTED_10baseT_Full | + SUPPORTED_Autoneg; + cmd->advertising = ADVERTISED_10baseT_Half | + ADVERTISED_10baseT_Full | + ADVERTISED_Autoneg; + + if (GetBit(lp->word[5], ee_PortTPE)) { + cmd->supported |= SUPPORTED_TP; + cmd->advertising |= ADVERTISED_TP; + } + if (GetBit(lp->word[5], ee_PortBNC)) { + cmd->supported |= SUPPORTED_BNC; + cmd->advertising |= ADVERTISED_BNC; + } + if (GetBit(lp->word[5], ee_PortAUI)) { + cmd->supported |= SUPPORTED_AUI; + cmd->advertising |= ADVERTISED_AUI; + } + + cmd->speed = SPEED_10; + + if (dev->if_port == TPE && lp->word[1] & ee_Duplex) { + cmd->duplex = DUPLEX_FULL; + } + else { + cmd->duplex = DUPLEX_HALF; + } + + cmd->port = dev->if_port; + cmd->phy_address = dev->base_addr; + cmd->transceiver = XCVR_INTERNAL; + + if (lp->word[0] & ee_AutoNeg) { + cmd->autoneg = 1; + } + + return 0; +} + +static void eepro_ethtool_get_drvinfo(struct net_device *dev, + struct ethtool_drvinfo *drvinfo) +{ + strcpy(drvinfo->driver, DRV_NAME); + strcpy(drvinfo->version, DRV_VERSION); + sprintf(drvinfo->bus_info, "ISA 0x%lx", dev->base_addr); +} + +static struct ethtool_ops eepro_ethtool_ops = { + .get_settings = eepro_ethtool_get_settings, + .get_drvinfo = eepro_ethtool_get_drvinfo, +}; + #ifdef MODULE #define MAX_EEPRO 8 @@ -1728,7 +1789,7 @@ static int autodetect; static int n_eepro; /* For linux 2.1.xx */ -MODULE_AUTHOR("Pascal Dupuis, and aris@cathedrallabs.org"); +MODULE_AUTHOR("Pascal Dupuis and others"); MODULE_DESCRIPTION("Intel i82595 ISA EtherExpressPro10/10+ driver"); MODULE_LICENSE("GPL"); --J+eNKFoVC4T1DV3f Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="04-eepro-fix_return_value_in_init.patch" eepro: fix return value in init_module() Signed-off-by: Aristeu Sergio Rozanski Filho --- 2.6/drivers/net/eepro.c.orig 2004-10-05 22:26:48.000000000 -0300 +++ 2.6/drivers/net/eepro.c 2004-10-05 22:27:00.000000000 -0300 @@ -1811,7 +1811,7 @@ init_module(void) if (io[0] == 0 && autodetect == 0) { printk(KERN_WARNING "eepro_init_module: Probe is very dangerous in ISA boards!\n"); printk(KERN_WARNING "eepro_init_module: Please add \"autodetect=1\" to force probe\n"); - return 1; + return -ENODEV; } else if (autodetect) { /* if autodetect is set then we must force detection */ --J+eNKFoVC4T1DV3f Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="05-eepro-fix_autodetect_option.patch" eepro: fix auto-detection option Signed-off-by: Aristeu Sergio Rozanski Filho --- 2.6-dual/drivers/net/eepro.c.orig 2004-10-05 22:27:55.000000000 -0300 +++ 2.6-dual/drivers/net/eepro.c 2004-10-05 21:44:23.000000000 -0300 @@ -1779,7 +1779,9 @@ static struct ethtool_ops eepro_ethtool_ #define MAX_EEPRO 8 static struct net_device *dev_eepro[MAX_EEPRO]; -static int io[MAX_EEPRO]; +static int io[MAX_EEPRO] = { + [0 ... MAX_EEPRO-1] = -1 +}; static int irq[MAX_EEPRO]; static int mem[MAX_EEPRO] = { /* Size of the rx buffer in KB */ [0 ... MAX_EEPRO-1] = RCV_DEFAULT_RAM/1024 @@ -1808,19 +1810,21 @@ init_module(void) { struct net_device *dev; int i; - if (io[0] == 0 && autodetect == 0) { + if (io[0] == -1 && autodetect == 0) { printk(KERN_WARNING "eepro_init_module: Probe is very dangerous in ISA boards!\n"); printk(KERN_WARNING "eepro_init_module: Please add \"autodetect=1\" to force probe\n"); return -ENODEV; } else if (autodetect) { /* if autodetect is set then we must force detection */ - io[0] = 0; + for (i = 0; i < MAX_EEPRO; i++) { + io[i] = 0; + } printk(KERN_INFO "eepro_init_module: Auto-detecting boards (May God protect us...)\n"); } - for (i = 0; i < MAX_EEPRO; i++) { + for (i = 0; io[i] != -1 && i < MAX_EEPRO; i++) { dev = alloc_etherdev(sizeof(struct eepro_local)); if (!dev) break; --J+eNKFoVC4T1DV3f-- From jgarzik@pobox.com Thu Jan 6 15:24:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 15:24:09 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06NO1i4029888 for ; Thu, 6 Jan 2005 15:24:02 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CmsDh-0004ro-6X; Fri, 07 Jan 2005 11:23:53 +0000 Message-ID: <41DE713D.8030004@pobox.com> Date: Fri, 07 Jan 2005 06:23:41 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Aristeu Sergio Rozanski Filho CC: netdev@oss.sgi.com Subject: Re: [PATCH] 1/5: eepro: cache EEPROM values References: <20041118234043.GF24080@cathedrallabs.org> <41DE075F.4090008@pobox.com> <20050107111303.GR27328@cathedrallabs.org> In-Reply-To: <20050107111303.GR27328@cathedrallabs.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13578 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Please resend in separate messages. See http://linux.yyz.us/patch-format.html for more info. Thanks, Jeff From jgarzik@pobox.com Thu Jan 6 15:34:30 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 15:34:35 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06NYSZP032532 for ; Thu, 6 Jan 2005 15:34:29 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CmsNn-0005EJ-Pd; Fri, 07 Jan 2005 11:34:20 +0000 Message-ID: <41DE73B5.6080303@pobox.com> Date: Fri, 07 Jan 2005 06:34:13 -0500 From: Jeff Garzik Reply-To: Netdev User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Netdev CC: Linux Kernel , Andrew Morton Subject: netdev-2.6 queue updated Content-Type: multipart/mixed; boundary="------------080005030005030704040103" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13579 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------080005030005030704040103 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit A bunch of stuff was merged upstream, and a bunch of new stuff was merged into netdev-2.6. See attached changelog for details, BK and patch URLs. BK NOTE: BK users should re-clone netdev-2.6, do not simply 'bk pull'. --------------080005030005030704040103 Content-Type: text/plain; name="changelog.txt" Content-Transfer-Encoding: 8bit Content-Disposition: inline; filename="changelog.txt" BK users: bk pull bk://gkernel.bkbits.net/netdev-2.6 Patch: http://www.kernel.org/pub/linux/kernel/people/jgarzik/patchkits/2.6/2.6.10-bk10-netdev1.patch.bz2 This will update the following files: Documentation/networking/e100.txt | 12 Documentation/networking/e1000.txt | 40 MAINTAINERS | 7 drivers/net/3c509.c | 19 drivers/net/8139cp.c | 102 drivers/net/8139too.c | 291 - drivers/net/arcnet/arc-rawmode.c | 4 drivers/net/arcnet/arc-rimi.c | 14 drivers/net/arcnet/arcnet.c | 30 drivers/net/arcnet/com20020.c | 6 drivers/net/arcnet/com90io.c | 4 drivers/net/arcnet/com90xx.c | 8 drivers/net/arcnet/rfc1051.c | 8 drivers/net/arcnet/rfc1201.c | 12 drivers/net/atp.c | 2 drivers/net/bmac.c | 68 drivers/net/e100.c | 19 drivers/net/e1000/e1000_ethtool.c | 68 drivers/net/e1000/e1000_hw.c | 125 drivers/net/e1000/e1000_hw.h | 8 drivers/net/e1000/e1000_main.c | 220 drivers/net/e1000/e1000_osdep.h | 9 drivers/net/e1000/e1000_param.c | 8 drivers/net/es3210.c | 32 drivers/net/ewrk3.c | 84 drivers/net/fealnx.c | 275 - drivers/net/forcedeth.c | 305 + drivers/net/hamachi.c | 81 drivers/net/ibm_emac/ibm_emac.h | 2 drivers/net/ibm_emac/ibm_emac_core.c | 15 drivers/net/ibm_emac/ibm_emac_phy.c | 19 drivers/net/myri_sbus.c | 10 drivers/net/pcmcia/ibmtr_cs.c | 7 drivers/net/r8169.c | 100 drivers/net/s2io.c | 126 drivers/net/s2io.h | 19 drivers/net/smc-mca.c | 37 drivers/net/smc-ultra.c | 34 drivers/net/smc-ultra32.c | 30 drivers/net/smc91x.c | 16 drivers/net/tokenring/ibmtr.c | 158 drivers/net/tulip/media.c | 37 drivers/net/tulip/timer.c | 1 drivers/net/tulip/tulip.h | 8 drivers/net/tulip/tulip_core.c | 42 drivers/net/tulip/winbond-840.c | 2 drivers/net/tulip/xircom_tulip_cb.c | 19 drivers/net/tun.c | 151 drivers/net/typhoon-firmware.h | 5568 ++++++++++-------------- drivers/net/typhoon.c | 244 - drivers/net/via-rhine.c | 2 drivers/net/via-velocity.c | 6 drivers/net/wd.c | 36 drivers/net/wireless/Kconfig | 2 drivers/net/wireless/Makefile | 2 drivers/net/wireless/airport.c | 5 drivers/net/wireless/hermes.c | 43 drivers/net/wireless/hermes.h | 62 drivers/net/wireless/hostap/Kconfig | 104 drivers/net/wireless/hostap/Makefile | 8 drivers/net/wireless/hostap/hostap.c | 1205 +++++ drivers/net/wireless/hostap/hostap.h | 57 drivers/net/wireless/hostap/hostap_80211.h | 107 drivers/net/wireless/hostap/hostap_80211_rx.c | 1080 ++++ drivers/net/wireless/hostap/hostap_80211_tx.c | 522 ++ drivers/net/wireless/hostap/hostap_ap.c | 3259 ++++++++++++++ drivers/net/wireless/hostap/hostap_ap.h | 272 + drivers/net/wireless/hostap/hostap_common.h | 556 ++ drivers/net/wireless/hostap/hostap_config.h | 86 drivers/net/wireless/hostap/hostap_crypt.c | 167 drivers/net/wireless/hostap/hostap_crypt.h | 50 drivers/net/wireless/hostap/hostap_crypt_ccmp.c | 486 ++ drivers/net/wireless/hostap/hostap_crypt_tkip.c | 696 +++ drivers/net/wireless/hostap/hostap_crypt_wep.c | 281 + drivers/net/wireless/hostap/hostap_cs.c | 785 +++ drivers/net/wireless/hostap/hostap_download.c | 761 +++ drivers/net/wireless/hostap/hostap_hw.c | 3607 +++++++++++++++ drivers/net/wireless/hostap/hostap_info.c | 469 ++ drivers/net/wireless/hostap/hostap_ioctl.c | 3624 +++++++++++++++ drivers/net/wireless/hostap/hostap_pci.c | 452 + drivers/net/wireless/hostap/hostap_plx.c | 611 ++ drivers/net/wireless/hostap/hostap_proc.c | 466 ++ drivers/net/wireless/hostap/hostap_wlan.h | 1071 ++++ drivers/net/wireless/orinoco.c | 203 drivers/net/wireless/orinoco_cs.c | 10 drivers/net/wireless/orinoco_pci.c | 7 drivers/net/wireless/orinoco_plx.c | 82 drivers/net/wireless/orinoco_tmd.c | 51 include/linux/ibmtr.h | 15 include/linux/if_tun.h | 5 include/linux/pci_ids.h | 6 91 files changed, 25371 insertions(+), 4454 deletions(-) through these ChangeSets: : o new PCI_ID for tulip : o 8139cp: support for TTTech MC322 : o [netdrvr 8139cp] add PCI ID : o S2io: fixes in free_shared_mem function Alan Cox: o ULi support for 526X tulip variants Alexander Viro: o s2io iomem annotations and cleanups o bmac iomem annotations o hamachi iomem annotations o miri_sbus iomem annotations o es3210 iomem annotions and isa-ectomy o ewrk3 iomem annotations + isa-ectomy o wd iomem annotations + isa-ectomy o smc-ultra32 iomem annotations + isa-ectomy o smc-ultra iomem annotations + isa-ectomy o smc-mca iomem annotations and isa-ectomy o fealnx iomem annotations, switch to io{read,write} o wireless iomem annotations and fixes, switch to io{read,write} o ibmtr annotations - the rest o beginning of ibmtr iomem annotations Andi Kleen: o Fix ADMtek Comet on x86-64 Andrew Morton: o xircom_tulip_cb.c build fix o via-rhine warning fix Con Kolivas: o net: Netconsole poll support for 3c509 David Dillow: o Bump version and release date o Version 03.001.008 of the Typhoon firmware, courtesy of 3Com o Fixup the version reporting to match 3Com o Use module_param() and add descriptions o Teach typhoon to use port IO on machines that need it. It will attempt to use MMIO, but if that fails (or the user asks), it will fallback to port IO. o Enable bus mastering before saving our state, or we'll only be able to load the modules one time. David Gibson: o Another trivial orinoco update Domen Puncer: o arcnet: remove casts Felipe Damasio: o 8139cp net driver: add MODULE_VERSION François Romieu: o r8169: oversized driver field for ethtool o r8169: reduce max MTU for large frames o r8169: Large Send enablement o r8169: C 101 o r8169: missing netif_poll_enable and irq ack o 8139cp: SG support fixes Ganesh Venkatesan: o e100: Documentation/networking/e100.txt update o e1000: Documentation/networking/e1000.txt update o e1000: Driver version number, white spaces, comments, device id & other changes o e1000: Applied smart speed fix where the code was forcing smart speed on all the time. Now it will honor the setting defined in the eeprom. o e1000: Applied eeprom fix where it was possible to read/write o e1000: Added workaround to prevent inadvertent gigabit waveform to be sent out on the wire due to init-time operations on the IGP phy. o e1000: Kernel API change for Module_param_array_named o e1000: {set, get}_wol is now symmetric for 82545EM adapters o e1000: Fix tx resource cleanup logic o e1000: Replace schedule_timeout() with msleep()/msleep_interruptible() nacc@us.ibm.com o e1000: remove a redundant assignment to a local nr_frags in e1000_xmit_frame o e1000: Avoid filling tx_ring completely - shemminger@osdl.org o e1000: Enabling NETIF_F_SG without checksum offload is illegal o e1000: Fix ethtool diagnostics -- specifically for blade server implementations o e1000: Fix kernel panic when the interface is brought down while the NAPI enabled driver is under stress o e1000: ITR does not default correctly on 2.6.x kernels o e100: Update driver version number o e100: Sort Device IDs o e100: Replace locally implemented delay routines Hirokazu Takata: o net: netconsole support for smc91x Jeff Garzik: o [wireless hostap] update for new pci_save_state() o [netdrvr 8139cp] TSO support Joshua Kwan: o hostap: fix Kconfig typos and missing select CRYPTO Jouni Malinen: o Host AP: Replaced MODULE_PARM with module_param* o Host AP: Replaced direct dev->priv references with netdev_priv(dev) o Host AP: Updated to use Linux wireless extensions v17 o Host AP: pci_register_driver() return value changes o Host AP: Fix netif_carrier_off() in non-client modes o Host AP: Fix PRISM2_IO_DEBUG o Host AP: Use void __iomem * with {read,write}{b,w} o Host AP: Fix card enabling after firmware download o Host AP: Do not bridge packets to unauthorized ports o Host AP: Fix compilation with PRISM2_NO_STATION_MODES defined o Host AP: Prevent STAs from associating using AP address o Host AP: Fix hw address changing for wifi# interface o Host AP: Remove ioctl debug messages o Host AP: Ignore (Re)AssocResp messages silently o Host AP: Fix interface packet counters o Host AP: Disable EAPOL TX/RX debug messages o fix hostap crypto bugs o Add HostAP wireless driver Manfred Spraul: o forcedeth: add ethtool get/set_settings support Matt Porter: o Add netpoll support o allow rx of the maximum sized VLAN tagged packets o EMAC: fix ibm_emac autonegotiation result parsing Pekka Enberg: o 8139too: use iomap for pio/mmio Rene Herman: o 8139too Interframe Gap Time Roger Luethi: o mc_filter on big-endian arch Shaun Jackman: o Multicast filtering for tun.c Steffen Klassert: o 8139cp - add netpoll support Stephen Hemminger: o via-velocity: convert to module_param o 8139too: use netdev_priv o 8139cp - module_param Thomas Gleixner: o rtl8139too.c: Fix missing pci_disable_dev o rtl8139too.c: Fix missing pci_disable_dev --------------080005030005030704040103-- From aris@cathedrallabs.org Thu Jan 6 15:47:38 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 15:47:44 -0800 (PST) Received: from smtp.uol.com.br (smtpout1.uol.com.br [200.221.4.192]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06NlZwK000857 for ; Thu, 6 Jan 2005 15:47:37 -0800 Received: from cathedrallabs.org (200-193-150-052.ctame7013.dsl.brasiltelecom.net.br [200.193.150.52]) by scorpion1.uol.com.br (Postfix) with ESMTP id E79E878DF; Fri, 7 Jan 2005 09:47:19 -0200 (BRST) Received: by cathedrallabs.org (Postfix, from userid 1000) id E6504231E8; Fri, 7 Jan 2005 09:47:18 -0200 (GMT+2) Date: Fri, 7 Jan 2005 09:47:18 -0200 From: Aristeu Sergio Rozanski Filho To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] 1/5: eepro: cache EEPROM values Message-ID: <20050107114718.GS27328@cathedrallabs.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13580 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: aris@cathedrallabs.org Precedence: bulk X-list: netdev eepro: cache EEPROM values Signed-off-by: Aristeu Sergio Rozanski Filho --- 2.6-inc/drivers/net/eepro.c 2004-09-13 15:54:43.000000000 -0300 +++ 2.6-foo/drivers/net/eepro.c 2004-09-14 13:46:15.000000000 -0300 @@ -214,6 +214,7 @@ struct eepro_local { short rcv_lower_limit; short rcv_upper_limit; unsigned char eeprom_reg; + unsigned short word[8]; }; /* The station (ethernet) address prefix, used for IDing the board. */ @@ -608,16 +609,22 @@ out: } #endif -static void __init printEEPROMInfo(short ioaddr, struct net_device *dev) +static void __init printEEPROMInfo(struct net_device *dev) { + struct eepro_local *lp = (struct eepro_local *)dev->priv; + int ioaddr = dev->base_addr; unsigned short Word; int i,j; - for (i=0, j=ee_Checksum; iword[i]; + for ( ; i < ee_SIZE; i++) + j += read_eeprom(ioaddr, i, dev); + printk(KERN_DEBUG "Checksum: %#x\n",j&0xffff); - Word=read_eeprom(ioaddr, 0, dev); + Word = lp->word[0]; printk(KERN_DEBUG "Word0:\n"); printk(KERN_DEBUG " Plug 'n Pray: %d\n",GetBit(Word,ee_PnP)); printk(KERN_DEBUG " Buswidth: %d\n",(GetBit(Word,ee_BusWidth)+1)*8 ); @@ -625,7 +632,7 @@ static void __init printEEPROMInfo(short printk(KERN_DEBUG " IO Address: %#x\n", (Word>>ee_IO0)<<4); if (net_debug>4) { - Word=read_eeprom(ioaddr, 1, dev); + Word = lp->word[1]; printk(KERN_DEBUG "Word1:\n"); printk(KERN_DEBUG " INT: %d\n", Word & ee_IntMask); printk(KERN_DEBUG " LI: %d\n", GetBit(Word,ee_LI)); @@ -636,7 +643,7 @@ static void __init printEEPROMInfo(short printk(KERN_DEBUG " Duplex: %d\n", GetBit(Word,ee_Duplex)); } - Word=read_eeprom(ioaddr, 5, dev); + Word = lp->word[5]; printk(KERN_DEBUG "Word5:\n"); printk(KERN_DEBUG " BNC: %d\n",GetBit(Word,ee_BNC_TPE)); printk(KERN_DEBUG " NumConnectors: %d\n",GetBit(Word,ee_NumConn)); @@ -646,12 +653,12 @@ static void __init printEEPROMInfo(short if (GetBit(Word,ee_PortAUI)) printk(KERN_DEBUG "AUI "); printk(KERN_DEBUG "port(s) \n"); - Word=read_eeprom(ioaddr, 6, dev); + Word = lp->word[6]; printk(KERN_DEBUG "Word6:\n"); printk(KERN_DEBUG " Stepping: %d\n",Word & ee_StepMask); printk(KERN_DEBUG " BoardID: %d\n",Word>>ee_BoardID); - Word=read_eeprom(ioaddr, 7, dev); + Word = lp->word[7]; printk(KERN_DEBUG "Word7:\n"); printk(KERN_DEBUG " INT to IRQ:\n"); @@ -725,7 +732,7 @@ static void __init eepro_print_info (str printk(", %s.\n", ifmap[dev->if_port]); if (net_debug > 3) { - i = read_eeprom(dev->base_addr, 5, dev); + i = lp->word[5]; if (i & 0x2000) /* bit 13 of EEPROM word 5 */ printk(KERN_DEBUG "%s: Concurrent Processing is " "enabled but not used!\n", dev->name); @@ -733,7 +740,7 @@ static void __init eepro_print_info (str /* Check the station address for the manufacturer's code */ if (net_debug>3) - printEEPROMInfo(dev->base_addr, dev); + printEEPROMInfo(dev); } /* This is the real probe routine. Linux has a history of friendly device @@ -796,11 +803,16 @@ static int __init eepro_probe1(struct ne lp->xmt_bar = XMT_BAR_10; station_addr[0] = read_eeprom(ioaddr, 2, dev); } - station_addr[1] = read_eeprom(ioaddr, 3, dev); - station_addr[2] = read_eeprom(ioaddr, 4, dev); + + /* get all words at once. will be used here and for ethtool */ + for (i = 0; i < 8; i++) { + lp->word[i] = read_eeprom(ioaddr, i, dev); + } + station_addr[1] = lp->word[3]; + station_addr[2] = lp->word[4]; if (!lp->eepro) { - if (read_eeprom(ioaddr,7,dev)== ee_FX_INT2IRQ) + if (lp->word[7] == ee_FX_INT2IRQ) lp->eepro = 2; else if (station_addr[2] == SA_ADDR1) lp->eepro = 1; @@ -817,15 +829,15 @@ static int __init eepro_probe1(struct ne /* calculate {xmt,rcv}_{lower,upper}_limit */ eepro_recalc(dev); - if (GetBit( read_eeprom(ioaddr, 5, dev),ee_BNC_TPE)) + if (GetBit(lp->word[5], ee_BNC_TPE)) dev->if_port = BNC; else dev->if_port = TPE; if (dev->irq < 2 && lp->eepro != 0) { /* Mask off INT number */ - int count = read_eeprom(ioaddr, 1, dev) & 7; - unsigned irqMask = read_eeprom(ioaddr, 7, dev); + int count = lp->word[1] & 7; + unsigned irqMask = lp->word[7]; while (count--) irqMask &= irqMask - 1; @@ -941,7 +953,7 @@ static int eepro_open(struct net_device if (net_debug > 3) printk(KERN_DEBUG "%s: entering eepro_open routine.\n", dev->name); - irqMask = read_eeprom(ioaddr,7,dev); + irqMask = lp->word[7]; if (lp->eepro == LAN595FX_10ISA) { if (net_debug > 3) printk(KERN_DEBUG "p->eepro = 3;\n"); From aris@cathedrallabs.org Thu Jan 6 15:49:56 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 15:50:00 -0800 (PST) Received: from smtp.uol.com.br (smtpout4.uol.com.br [200.221.4.195]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06NntVe001308 for ; Thu, 6 Jan 2005 15:49:56 -0800 Received: from cathedrallabs.org (200-193-150-052.ctame7013.dsl.brasiltelecom.net.br [200.193.150.52]) by scorpion4.uol.com.br (Postfix) with ESMTP id B8DC17E9E; Fri, 7 Jan 2005 09:49:40 -0200 (BRST) Received: by cathedrallabs.org (Postfix, from userid 1000) id E3EBF231E8; Fri, 7 Jan 2005 09:49:39 -0200 (GMT+2) Date: Fri, 7 Jan 2005 09:49:39 -0200 From: Aristeu Sergio Rozanski Filho To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH 2.6.10 2/5] eepro: use module_param macros Message-ID: <20050107114939.GT27328@cathedrallabs.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13581 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: aris@cathedrallabs.org Precedence: bulk X-list: netdev eepro: use module_param macros Signed-off-by: Aristeu Sergio Rozanski Filho diff -uprN -X dontdiff 2.6-inc/drivers/net/eepro.c 2.6/drivers/net/eepro.c --- 2.6-inc/drivers/net/eepro.c 2005-01-07 09:01:26.128430328 -0200 +++ 2.6/drivers/net/eepro.c 2005-01-07 09:01:12.409515920 -0200 @@ -1732,10 +1732,11 @@ MODULE_AUTHOR("Pascal Dupuis, and aris@c MODULE_DESCRIPTION("Intel i82595 ISA EtherExpressPro10/10+ driver"); MODULE_LICENSE("GPL"); -MODULE_PARM(io, "1-" __MODULE_STRING(MAX_EEPRO) "i"); -MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_EEPRO) "i"); -MODULE_PARM(mem, "1-" __MODULE_STRING(MAX_EEPRO) "i"); -MODULE_PARM(autodetect, "1-" __MODULE_STRING(1) "i"); +static int num_params; +module_param_array(io, int, num_params, 0); +module_param_array(irq, int, num_params, 0); +module_param_array(mem, int, num_params, 0); +module_param(autodetect, int, 0); MODULE_PARM_DESC(io, "EtherExpress Pro/10 I/O base addres(es)"); MODULE_PARM_DESC(irq, "EtherExpress Pro/10 IRQ number(s)"); MODULE_PARM_DESC(mem, "EtherExpress Pro/10 Rx buffer size(es) in kB (3-29)"); From aris@cathedrallabs.org Thu Jan 6 15:51:17 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 15:51:21 -0800 (PST) Received: from smtp.uol.com.br (smtpout6.uol.com.br [200.221.4.197]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06NpGWZ001780 for ; Thu, 6 Jan 2005 15:51:17 -0800 Received: from cathedrallabs.org (200-193-150-052.ctame7013.dsl.brasiltelecom.net.br [200.193.150.52]) by scorpion6.uol.com.br (Postfix) with ESMTP id 625B17F5A; Fri, 7 Jan 2005 09:51:01 -0200 (BRST) Received: by cathedrallabs.org (Postfix, from userid 1000) id E8A7C231E8; Fri, 7 Jan 2005 09:51:00 -0200 (GMT+2) Date: Fri, 7 Jan 2005 09:51:00 -0200 From: Aristeu Sergio Rozanski Filho To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH 2.6.10 3/5] eepro: basic ethtool support Message-ID: <20050107115100.GU27328@cathedrallabs.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13582 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: aris@cathedrallabs.org Precedence: bulk X-list: netdev eepro: basic ethtool support Signed-off-by: Aristeu Sergio Rozanski Filho diff -uprN -X dontdiff 2.6-inc/drivers/net/eepro.c 2.6/drivers/net/eepro.c --- 2.6-inc/drivers/net/eepro.c 2005-01-07 09:03:59.854060480 -0200 +++ 2.6/drivers/net/eepro.c 2005-01-07 09:04:39.659009208 -0200 @@ -23,6 +23,7 @@ This is a compatibility hardware problem. Versions: + 0.13b basic ethtool support (aris, 09/13/2004) 0.13a in memory shortage, drop packets also in board (Michael Westermann , 07/30/2002) 0.13 irq sharing, rewrote probe function, fixed a nasty bug in @@ -104,7 +105,7 @@ */ static const char version[] = - "eepro.c: v0.13 11/08/2001 aris@cathedrallabs.org\n"; + "eepro.c: v0.13b 09/13/2004 aris@cathedrallabs.org\n"; #include @@ -146,19 +147,21 @@ static const char version[] = #include #include #include +#include #include #include #include #define DRV_NAME "eepro" +#define DRV_VERSION "0.13b" #define compat_dev_kfree_skb( skb, mode ) dev_kfree_skb( (skb) ) /* I had reports of looong delays with SLOW_DOWN defined as udelay(2) */ #define SLOW_DOWN inb(0x80) /* udelay(2) */ #define compat_init_data __initdata - +enum iftype { AUI=0, BNC=1, TPE=2 }; /* First, a few definitions that the brave might change. */ /* A zero-terminated list of I/O addresses to be probed. */ @@ -743,16 +746,17 @@ static void __init eepro_print_info (str printEEPROMInfo(dev); } +static struct ethtool_ops eepro_ethtool_ops; + /* This is the real probe routine. Linux has a history of friendly device probes on the ISA bus. A good device probe avoids doing writes, and verifies that the correct device exists and functions. */ static int __init eepro_probe1(struct net_device *dev, int autoprobe) { - unsigned short station_addr[6], id, counter; + unsigned short station_addr[3], id, counter; int i; struct eepro_local *lp; - enum iftype { AUI=0, BNC=1, TPE=2 }; int ioaddr = dev->base_addr; /* Grab the region so we can find another board if autoIRQ fails. */ @@ -862,6 +866,7 @@ static int __init eepro_probe1(struct ne dev->set_multicast_list = &set_multicast_list; dev->tx_timeout = eepro_tx_timeout; dev->watchdog_timeo = TX_TIMEOUT; + dev->ethtool_ops = &eepro_ethtool_ops; /* print boot time info */ eepro_print_info(dev); @@ -1082,8 +1087,6 @@ static int eepro_open(struct net_device old9 = inb(ioaddr + 9); if (irqMask==ee_FX_INT2IRQ) { - enum iftype { AUI=0, BNC=1, TPE=2 }; - if (net_debug > 3) { printk(KERN_DEBUG "IrqMask: %#x\n",irqMask); printk(KERN_DEBUG "i82595FX detected!\n"); @@ -1713,6 +1716,64 @@ eepro_transmit_interrupt(struct net_devi } } +static int eepro_ethtool_get_settings(struct net_device *dev, + struct ethtool_cmd *cmd) +{ + struct eepro_local *lp = (struct eepro_local *)dev->priv; + + cmd->supported = SUPPORTED_10baseT_Half | + SUPPORTED_10baseT_Full | + SUPPORTED_Autoneg; + cmd->advertising = ADVERTISED_10baseT_Half | + ADVERTISED_10baseT_Full | + ADVERTISED_Autoneg; + + if (GetBit(lp->word[5], ee_PortTPE)) { + cmd->supported |= SUPPORTED_TP; + cmd->advertising |= ADVERTISED_TP; + } + if (GetBit(lp->word[5], ee_PortBNC)) { + cmd->supported |= SUPPORTED_BNC; + cmd->advertising |= ADVERTISED_BNC; + } + if (GetBit(lp->word[5], ee_PortAUI)) { + cmd->supported |= SUPPORTED_AUI; + cmd->advertising |= ADVERTISED_AUI; + } + + cmd->speed = SPEED_10; + + if (dev->if_port == TPE && lp->word[1] & ee_Duplex) { + cmd->duplex = DUPLEX_FULL; + } + else { + cmd->duplex = DUPLEX_HALF; + } + + cmd->port = dev->if_port; + cmd->phy_address = dev->base_addr; + cmd->transceiver = XCVR_INTERNAL; + + if (lp->word[0] & ee_AutoNeg) { + cmd->autoneg = 1; + } + + return 0; +} + +static void eepro_ethtool_get_drvinfo(struct net_device *dev, + struct ethtool_drvinfo *drvinfo) +{ + strcpy(drvinfo->driver, DRV_NAME); + strcpy(drvinfo->version, DRV_VERSION); + sprintf(drvinfo->bus_info, "ISA 0x%lx", dev->base_addr); +} + +static struct ethtool_ops eepro_ethtool_ops = { + .get_settings = eepro_ethtool_get_settings, + .get_drvinfo = eepro_ethtool_get_drvinfo, +}; + #ifdef MODULE #define MAX_EEPRO 8 @@ -1728,7 +1789,7 @@ static int autodetect; static int n_eepro; /* For linux 2.1.xx */ -MODULE_AUTHOR("Pascal Dupuis, and aris@cathedrallabs.org"); +MODULE_AUTHOR("Pascal Dupuis and others"); MODULE_DESCRIPTION("Intel i82595 ISA EtherExpressPro10/10+ driver"); MODULE_LICENSE("GPL"); From aris@cathedrallabs.org Thu Jan 6 15:52:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 15:52:41 -0800 (PST) Received: from smtp.uol.com.br (smtpout5.uol.com.br [200.221.4.196]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06Nqat0002347 for ; Thu, 6 Jan 2005 15:52:37 -0800 Received: from cathedrallabs.org (200-193-150-052.ctame7013.dsl.brasiltelecom.net.br [200.193.150.52]) by scorpion5.uol.com.br (Postfix) with ESMTP id BE7D67B41; Fri, 7 Jan 2005 09:53:25 -0200 (BRST) Received: by cathedrallabs.org (Postfix, from userid 1000) id 065DB231E8; Fri, 7 Jan 2005 09:52:21 -0200 (GMT+2) Date: Fri, 7 Jan 2005 09:52:20 -0200 From: Aristeu Sergio Rozanski Filho To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH 2.6.10 4/5] eepro: fix return value in init_module() Message-ID: <20050107115220.GV27328@cathedrallabs.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13583 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: aris@cathedrallabs.org Precedence: bulk X-list: netdev eepro: fix return value in init_module() Signed-off-by: Aristeu Sergio Rozanski Filho --- 2.6/drivers/net/eepro.c.orig 2004-10-05 22:26:48.000000000 -0300 +++ 2.6/drivers/net/eepro.c 2004-10-05 22:27:00.000000000 -0300 @@ -1811,7 +1811,7 @@ init_module(void) if (io[0] == 0 && autodetect == 0) { printk(KERN_WARNING "eepro_init_module: Probe is very dangerous in ISA boards!\n"); printk(KERN_WARNING "eepro_init_module: Please add \"autodetect=1\" to force probe\n"); - return 1; + return -ENODEV; } else if (autodetect) { /* if autodetect is set then we must force detection */ From aris@cathedrallabs.org Thu Jan 6 15:53:33 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 15:53:38 -0800 (PST) Received: from smtp.uol.com.br (smtpout5.uol.com.br [200.221.4.196]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06NrWLi002551 for ; Thu, 6 Jan 2005 15:53:33 -0800 Received: from cathedrallabs.org (200-193-150-052.ctame7013.dsl.brasiltelecom.net.br [200.193.150.52]) by scorpion5.uol.com.br (Postfix) with ESMTP id 8B7317F00; Fri, 7 Jan 2005 09:54:21 -0200 (BRST) Received: by cathedrallabs.org (Postfix, from userid 1000) id 40976231E8; Fri, 7 Jan 2005 09:53:17 -0200 (GMT+2) Date: Fri, 7 Jan 2005 09:53:17 -0200 From: Aristeu Sergio Rozanski Filho To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH 2.6.10 5/5] eepro: fix auto-detection option Message-ID: <20050107115317.GW27328@cathedrallabs.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13584 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: aris@cathedrallabs.org Precedence: bulk X-list: netdev eepro: fix auto-detection option Signed-off-by: Aristeu Sergio Rozanski Filho --- 2.6-dual/drivers/net/eepro.c.orig 2004-10-05 22:27:55.000000000 -0300 +++ 2.6-dual/drivers/net/eepro.c 2004-10-05 21:44:23.000000000 -0300 @@ -1779,7 +1779,9 @@ static struct ethtool_ops eepro_ethtool_ #define MAX_EEPRO 8 static struct net_device *dev_eepro[MAX_EEPRO]; -static int io[MAX_EEPRO]; +static int io[MAX_EEPRO] = { + [0 ... MAX_EEPRO-1] = -1 +}; static int irq[MAX_EEPRO]; static int mem[MAX_EEPRO] = { /* Size of the rx buffer in KB */ [0 ... MAX_EEPRO-1] = RCV_DEFAULT_RAM/1024 @@ -1808,19 +1810,21 @@ init_module(void) { struct net_device *dev; int i; - if (io[0] == 0 && autodetect == 0) { + if (io[0] == -1 && autodetect == 0) { printk(KERN_WARNING "eepro_init_module: Probe is very dangerous in ISA boards!\n"); printk(KERN_WARNING "eepro_init_module: Please add \"autodetect=1\" to force probe\n"); return -ENODEV; } else if (autodetect) { /* if autodetect is set then we must force detection */ - io[0] = 0; + for (i = 0; i < MAX_EEPRO; i++) { + io[i] = 0; + } printk(KERN_INFO "eepro_init_module: Auto-detecting boards (May God protect us...)\n"); } - for (i = 0; i < MAX_EEPRO; i++) { + for (i = 0; io[i] != -1 && i < MAX_EEPRO; i++) { dev = alloc_etherdev(sizeof(struct eepro_local)); if (!dev) break; From aris@cathedrallabs.org Thu Jan 6 15:54:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 15:54:39 -0800 (PST) Received: from smtp.uol.com.br (smtpout2.uol.com.br [200.221.4.193]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06NsYxG003056 for ; Thu, 6 Jan 2005 15:54:35 -0800 Received: from cathedrallabs.org (200-193-150-052.ctame7013.dsl.brasiltelecom.net.br [200.193.150.52]) by scorpion2.uol.com.br (Postfix) with ESMTP id 9D7F78171; Fri, 7 Jan 2005 09:54:19 -0200 (BRST) Received: by cathedrallabs.org (Postfix, from userid 1000) id 2C08F231E8; Fri, 7 Jan 2005 09:54:19 -0200 (GMT+2) Date: Fri, 7 Jan 2005 09:54:19 -0200 From: Aristeu Sergio Rozanski Filho To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH 2.6.10 1/5] eepro: cache EEPROM values Message-ID: <20050107115419.GX27328@cathedrallabs.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13585 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: aris@cathedrallabs.org Precedence: bulk X-list: netdev eepro: cache EEPROM values Signed-off-by: Aristeu Sergio Rozanski Filho --- 2.6-inc/drivers/net/eepro.c 2004-09-13 15:54:43.000000000 -0300 +++ 2.6-foo/drivers/net/eepro.c 2004-09-14 13:46:15.000000000 -0300 @@ -214,6 +214,7 @@ struct eepro_local { short rcv_lower_limit; short rcv_upper_limit; unsigned char eeprom_reg; + unsigned short word[8]; }; /* The station (ethernet) address prefix, used for IDing the board. */ @@ -608,16 +609,22 @@ out: } #endif -static void __init printEEPROMInfo(short ioaddr, struct net_device *dev) +static void __init printEEPROMInfo(struct net_device *dev) { + struct eepro_local *lp = (struct eepro_local *)dev->priv; + int ioaddr = dev->base_addr; unsigned short Word; int i,j; - for (i=0, j=ee_Checksum; iword[i]; + for ( ; i < ee_SIZE; i++) + j += read_eeprom(ioaddr, i, dev); + printk(KERN_DEBUG "Checksum: %#x\n",j&0xffff); - Word=read_eeprom(ioaddr, 0, dev); + Word = lp->word[0]; printk(KERN_DEBUG "Word0:\n"); printk(KERN_DEBUG " Plug 'n Pray: %d\n",GetBit(Word,ee_PnP)); printk(KERN_DEBUG " Buswidth: %d\n",(GetBit(Word,ee_BusWidth)+1)*8 ); @@ -625,7 +632,7 @@ static void __init printEEPROMInfo(short printk(KERN_DEBUG " IO Address: %#x\n", (Word>>ee_IO0)<<4); if (net_debug>4) { - Word=read_eeprom(ioaddr, 1, dev); + Word = lp->word[1]; printk(KERN_DEBUG "Word1:\n"); printk(KERN_DEBUG " INT: %d\n", Word & ee_IntMask); printk(KERN_DEBUG " LI: %d\n", GetBit(Word,ee_LI)); @@ -636,7 +643,7 @@ static void __init printEEPROMInfo(short printk(KERN_DEBUG " Duplex: %d\n", GetBit(Word,ee_Duplex)); } - Word=read_eeprom(ioaddr, 5, dev); + Word = lp->word[5]; printk(KERN_DEBUG "Word5:\n"); printk(KERN_DEBUG " BNC: %d\n",GetBit(Word,ee_BNC_TPE)); printk(KERN_DEBUG " NumConnectors: %d\n",GetBit(Word,ee_NumConn)); @@ -646,12 +653,12 @@ static void __init printEEPROMInfo(short if (GetBit(Word,ee_PortAUI)) printk(KERN_DEBUG "AUI "); printk(KERN_DEBUG "port(s) \n"); - Word=read_eeprom(ioaddr, 6, dev); + Word = lp->word[6]; printk(KERN_DEBUG "Word6:\n"); printk(KERN_DEBUG " Stepping: %d\n",Word & ee_StepMask); printk(KERN_DEBUG " BoardID: %d\n",Word>>ee_BoardID); - Word=read_eeprom(ioaddr, 7, dev); + Word = lp->word[7]; printk(KERN_DEBUG "Word7:\n"); printk(KERN_DEBUG " INT to IRQ:\n"); @@ -725,7 +732,7 @@ static void __init eepro_print_info (str printk(", %s.\n", ifmap[dev->if_port]); if (net_debug > 3) { - i = read_eeprom(dev->base_addr, 5, dev); + i = lp->word[5]; if (i & 0x2000) /* bit 13 of EEPROM word 5 */ printk(KERN_DEBUG "%s: Concurrent Processing is " "enabled but not used!\n", dev->name); @@ -733,7 +740,7 @@ static void __init eepro_print_info (str /* Check the station address for the manufacturer's code */ if (net_debug>3) - printEEPROMInfo(dev->base_addr, dev); + printEEPROMInfo(dev); } /* This is the real probe routine. Linux has a history of friendly device @@ -796,11 +803,16 @@ static int __init eepro_probe1(struct ne lp->xmt_bar = XMT_BAR_10; station_addr[0] = read_eeprom(ioaddr, 2, dev); } - station_addr[1] = read_eeprom(ioaddr, 3, dev); - station_addr[2] = read_eeprom(ioaddr, 4, dev); + + /* get all words at once. will be used here and for ethtool */ + for (i = 0; i < 8; i++) { + lp->word[i] = read_eeprom(ioaddr, i, dev); + } + station_addr[1] = lp->word[3]; + station_addr[2] = lp->word[4]; if (!lp->eepro) { - if (read_eeprom(ioaddr,7,dev)== ee_FX_INT2IRQ) + if (lp->word[7] == ee_FX_INT2IRQ) lp->eepro = 2; else if (station_addr[2] == SA_ADDR1) lp->eepro = 1; @@ -817,15 +829,15 @@ static int __init eepro_probe1(struct ne /* calculate {xmt,rcv}_{lower,upper}_limit */ eepro_recalc(dev); - if (GetBit( read_eeprom(ioaddr, 5, dev),ee_BNC_TPE)) + if (GetBit(lp->word[5], ee_BNC_TPE)) dev->if_port = BNC; else dev->if_port = TPE; if (dev->irq < 2 && lp->eepro != 0) { /* Mask off INT number */ - int count = read_eeprom(ioaddr, 1, dev) & 7; - unsigned irqMask = read_eeprom(ioaddr, 7, dev); + int count = lp->word[1] & 7; + unsigned irqMask = lp->word[7]; while (count--) irqMask &= irqMask - 1; @@ -941,7 +953,7 @@ static int eepro_open(struct net_device if (net_debug > 3) printk(KERN_DEBUG "%s: entering eepro_open routine.\n", dev->name); - irqMask = read_eeprom(ioaddr,7,dev); + irqMask = lp->word[7]; if (lp->eepro == LAN595FX_10ISA) { if (net_debug > 3) printk(KERN_DEBUG "p->eepro = 3;\n"); From aris@cathedrallabs.org Thu Jan 6 15:55:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 15:55:06 -0800 (PST) Received: from smtp.uol.com.br (smtpout3.uol.com.br [200.221.4.194]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06Nt16W003394 for ; Thu, 6 Jan 2005 15:55:01 -0800 Received: from cathedrallabs.org (200-193-150-052.ctame7013.dsl.brasiltelecom.net.br [200.193.150.52]) by scorpion3.uol.com.br (Postfix) with ESMTP id 443698004; Fri, 7 Jan 2005 09:54:46 -0200 (BRST) Received: by cathedrallabs.org (Postfix, from userid 1000) id C35BA231E8; Fri, 7 Jan 2005 09:54:45 -0200 (GMT+2) Date: Fri, 7 Jan 2005 09:54:45 -0200 From: Aristeu Sergio Rozanski Filho To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: Re: [PATCH] 1/5: eepro: cache EEPROM values Message-ID: <20050107115445.GY27328@cathedrallabs.org> References: <20050107114718.GS27328@cathedrallabs.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050107114718.GS27328@cathedrallabs.org> User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13586 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: aris@cathedrallabs.org Precedence: bulk X-list: netdev please drop this one, wrong subject format -- Aristeu From webvenza@libero.it Thu Jan 6 15:58:43 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 15:58:47 -0800 (PST) Received: from gateway.milesteg.arr (venza@adsl-ull-142-137.44-151.net24.it [151.44.137.142]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j06NwgAg004422 for ; Thu, 6 Jan 2005 15:58:43 -0800 Date: Fri, 7 Jan 2005 12:58:32 +0100 From: Daniele Venzano To: Jeff Garzik Cc: NetDev Subject: Re: [PATCH 1/5] sis900 debugging and revision code Message-ID: <20050107115832.GB14223@picchio.gall.it> Mail-Followup-To: Jeff Garzik , NetDev References: <20041212121852.GA16325@gateway.milesteg.arr> <20041212123031.GB16325@gateway.milesteg.arr> <41DDCB54.2080101@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41DDCB54.2080101@pobox.com> X-Operating-System: Debian GNU/Linux on kernel Linux 2.4.28-grsec X-Copyright: Forwarding or publishing without permission is prohibited. X-Truth: La vita e' una questione di culo, o ce l'hai o te lo fanno. X-GPG-Fingerprint: 642A A345 1CEF B6E3 925C 23CE DAB9 8764 25B3 57ED X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13587 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: webvenza@libero.it Precedence: bulk X-list: netdev On Thu, Jan 06, 2005 at 06:35:48PM -0500, Jeff Garzik wrote: > Patches 1, 2, and 5 are OK. > > For the other two patches, I don't want to deviate from the style that > has been standard for years: dev->name prefix, followed by message. > > It may make greps easier for you, but it becomes a non-standard style > and may make existing sysadmin scripts out in the field. > > Please resend series without the PFX-where-devname-is-known changes. Ok, I just don't have time to do it right now, but I'll rediff ASAP. However a message reformat patch will be needed because there are some messages that don't conform to either (mine or established) standard. Also I think I'll add at the end of the patchset a new patch that was sent recently on linux-kernel that adds support for netconsole. Bye. -- ----------------------------- Daniele Venzano Web: http://teg.homeunix.org From raivis@mt.lv Thu Jan 6 16:50:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 16:50:07 -0800 (PST) Received: from frog.mt.lv (frog.mt.lv [159.148.172.197]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j070nvkl009376 for ; Thu, 6 Jan 2005 16:50:01 -0800 Received: from duah.mt.lv (raivis@[10.0.0.32]) by frog.mt.lv (8.12.11/8.12.11/Debian-3) with ESMTP id j07CnehG005796 for ; Fri, 7 Jan 2005 14:49:40 +0200 From: Raivis Bucis Organization: Mikrotikls To: netdev@oss.sgi.com Subject: [PATCH 2.4] Bugfix in neigh_create Date: Fri, 7 Jan 2005 14:52:28 +0200 User-Agent: KMail/1.7.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501071452.29006.raivis@mt.lv> X-mikrotik.com-Virus_kerajs: Not scanned. X-mikrotik.com-Virus_un_spam-kerajs: X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13588 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: raivis@mt.lv Precedence: bulk X-list: netdev Hello, I believe that there is a bug in neigh_create in linux-2.4.28 introduced by neighbor cache backport from v2.6.9. New neigh entry hash_val was calculated before possible hash growth. So it got inserted in wrong place, making ARP entry (that was inserted immediately after hash growth) unresolvable until entry timeout. It looked like this. The host did not answer to pings from some random host, but it could ping it after that with no problems. And vice versa. Raivis Bucis diff -uNr linux-2.4.28.org/net/core/neighbour.c linux-2.4.28/net/core/neighbour.c --- linux-2.4.28.org/net/core/neighbour.c 2004-11-17 13:54:22.000000000 +0200 +++ linux-2.4.28/net/core/neighbour.c 2005-01-07 14:11:57.000000000 +0200 @@ -427,11 +427,12 @@ n->confirmed = jiffies - (n->parms->base_reachable_time<<1); - hash_val = tbl->hash(pkey, dev) & tbl->hash_mask; - write_lock_bh(&tbl->lock); if (atomic_read(&tbl->entries) > (tbl->hash_mask + 1)) neigh_hash_grow(tbl, (tbl->hash_mask + 1) << 1); + + hash_val = tbl->hash(pkey, dev) & tbl->hash_mask; + for (n1 = tbl->hash_buckets[hash_val]; n1; n1 = n1->next) { if (dev == n1->dev && memcmp(n1->primary_key, pkey, key_len) == 0) { From nhorman@redhat.com Thu Jan 6 17:06:06 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 17:06:12 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0716561010200 for ; Thu, 6 Jan 2005 17:06:05 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j07D5qd3010687; Fri, 7 Jan 2005 08:05:52 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j07D5qr17792; Fri, 7 Jan 2005 08:05:52 -0500 Received: from [172.16.57.156] (hmsendeavour.rdu.redhat.com [172.16.57.156]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id j07D5plL031057; Fri, 7 Jan 2005 08:05:51 -0500 Message-ID: <41DE892F.5030206@redhat.com> Date: Fri, 07 Jan 2005 08:05:51 -0500 From: Neil Horman User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0; hi, Mom) Gecko/20020604 Netscape/7.01 X-Accept-Language: en-us, en MIME-Version: 1.0 To: linux lover CC: linux-net@vger.kernel.org, netdev@oss.sgi.com Subject: Re: require packet path at device layer References: <72c6e3790501070020755ffacf@mail.gmail.com> In-Reply-To: <72c6e3790501070020755ffacf@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13589 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nhorman@redhat.com Precedence: bulk X-list: netdev linux lover wrote: > Hello, > Can anybody provide me how packet control is transferred from > netif_rx to netif_receive_skb function. > regards, > linux.lover > - > To unsubscribe from this list: send the line "unsubscribe linux-net" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Believe its done directly in netif_rx, which calls: netif_rx_schedule(&queue->blog_dev) The poll routine for blog_dev which gets set in net_dev_init is called process_backlog, which takes packets queued from netif_rx and calls netif_receive_skb with them HTH Neil -- /*************************************************** *Neil Horman *Software Engineer *Red Hat, Inc. *nhorman@redhat.com *gpg keyid: 1024D / 0x92A74FA1 *http://pgp.mit.edu ***************************************************/ From hadi@cyberus.ca Thu Jan 6 17:32:58 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 17:33:02 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j071WwL0011372 for ; Thu, 6 Jan 2005 17:32:58 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1CmuER-0002Mb-NK for netdev@oss.sgi.com; Fri, 07 Jan 2005 08:32:47 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CmuEK-0001KI-Jo; Fri, 07 Jan 2005 08:32:40 -0500 Subject: Re: [patch 4/10] s390: network driver. From: jamal Reply-To: hadi@cyberus.ca To: Tommy Christensen Cc: Jeff Garzik , Thomas Spatzier , "David S. Miller" , Hasso Tepper , Herbert Xu , netdev@oss.sgi.com, Paul Jakma In-Reply-To: <1105023972.3462.48.camel@tsc-6.cph.tpack.net> References: <1104764710.1048.580.camel@jzny.localdomain> <41DB26A6.2070008@pobox.com> <1104895169.1117.63.camel@jzny.localdomain> <41DC0931.80603@tpack.net> <1105019912.2314.20.camel@jzny.localdomain> <1105023972.3462.48.camel@tsc-6.cph.tpack.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105104757.1046.63.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 07 Jan 2005 08:32:37 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13590 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Thu, 2005-01-06 at 10:06, Tommy Christensen wrote: > But qdisc_restart() isn't called any more after the queue is > stopped. So how do we get to drain the packets? We return -1; so qdisc restart will be called until theres no packets left on the queue. Did i miss something in the state machine there? > Another approach could be to reset the qdisc (kind of what > dev_deactivate does) if the driver stays in queue_stopped > and carrier_off for some period of time. > reseting qdisc could certainly be part of the device watchdog. Note that once the packets are drained, the next thing that will happen if device is stopped for a dev->timeout period is watchdog kicking in and flushing the DMA. So you could reset your qdisc there though i am not sure it will be needed with that patch. cheers, jamal From hadi@cyberus.ca Thu Jan 6 17:45:30 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 17:45:34 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j071jTqK012088 for ; Thu, 6 Jan 2005 17:45:30 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1CmuQZ-0001FG-K4 for netdev@oss.sgi.com; Fri, 07 Jan 2005 08:45:19 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CmuQU-0002t7-1t; Fri, 07 Jan 2005 08:45:14 -0500 Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: netdev@oss.sgi.com In-Reply-To: <20050106194102.GW26856@postel.suug.ch> References: <20050103125635.GB26856@postel.suug.ch> <20050104223612.GN26856@postel.suug.ch> <1104894728.1117.56.camel@jzny.localdomain> <20050105110048.GO26856@postel.suug.ch> <1104931991.1117.152.camel@jzny.localdomain> <20050105144514.GQ26856@postel.suug.ch> <1105019225.2312.7.camel@jzny.localdomain> <20050106194102.GW26856@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105105511.1046.77.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 07 Jan 2005 08:45:12 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13591 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Thu, 2005-01-06 at 14:41, Thomas Graf wrote: > * jamal <1105019225.2312.7.camel@jzny.localdomain> 2005-01-06 08:47 [..] > If we do everything as ref we'll be allocating 4 byte chunks or we > introduce a storage u32 which pollutes the structure. I don't > like that given that the transfer of a single u32 is probably the > most common for all those smallish ematches for a specific thing. > For simplicity, you don't even notice if you're not aware of that > it can be of help so I don't think we're losing any simplicity here. I am not sure the optimization for a single u32 as the ematch data is valid ;-> But this is not a show stopper, i will wait for the code to see if its an annoyance or tolerable. > Missunderstanding here, I meant is there any advantage in having > multiple ematch trees (interleaved) over just making the existing > u32 key an ematch and have the selector (with the hashing bits > extracted) with one ematch tree. Misunderstanding is the right description. If you did a s/ematch/match for the u32 part then we'd be shooting for the same thing;-> So i take back what i said, you are not gonna mess up the u32 tree logic. > 1) extract hashing bits out of selector and move it into a new > TLV. > 2) Replace the foreach key match loop with an ematch_tree match This is our contention point. > 3) Fill out a pkt_info struct with ptr and off2 so we don't lose > hashing capabilities And this is why i dont like it. > 4) Add backward compat code. Old selector must be transformed > into a flat ematch tree and the hashing bits must be extracted > and stored in the new struct. I think the u32 changes are one-shot if you want to avoid lotsa #ifdefs. Someone sends you a old sel, then convert it to a new one for storage. Dumping is a little trickier, need some way to recognize old style request. > The most difficult part is to do the Kconfig dependencies in a smart way ;-> The trick would be to always use sel2 and present no kconfig options for back compat. We need to figure out how to recognize an old style dump and we are set. > > Again, u32 classifier is not just matches; the more interesting thing > > is the layout of the rules that it can be taught to do. > > I think the ematch which emulates the std u32 match is of course > > valuable to have but it _doesnt_ deserve the same name. > > Stupid terms, em_u32.c is a replacement for the u32 key and it has exactly > the same behaviour. I'll be happy to rename it but as you know I really > suck at naming things ;-> em_u32 sounds better ;-> Above you are trying to insert off2 into the info (what i said i didnt like) - how are you going to achieve the same with a standalone en_u32 from say you basic classifier? > > Thinking more about it; not sure why you would even bother managing > > them. Everything runs at the same kernel privilege level. I am not sure > > you want to have certain things that can only be built when recompiling > > the kernel > > Well, we have exactly the same issues as with TLV types. I don't see > why one would need to recompile things. The enumeration is for ematches > included in the kernel tree. Your call. Actions do it the way i described it. It is more flexible in my opionion, nothing reserved. Good practise is to know who uses what (not hardcoding in headers) and the register will catch any discrepancy. cheers, jamal From tommy.christensen@tpack.net Thu Jan 6 19:27:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 19:27:05 -0800 (PST) Received: from mail.tpack.net (ip18.tpack.net [213.173.228.18]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j073QxDf015729 for ; Thu, 6 Jan 2005 19:27:00 -0800 Received: (qmail 25223 invoked from network); 7 Jan 2005 15:26:45 -0000 Received: from tsc-6.cph.tpack.net (HELO ?192.168.9.22?) (192.168.9.22) by 0 with SMTP; 7 Jan 2005 15:26:45 -0000 Subject: Re: [patch 4/10] s390: network driver. From: Tommy Christensen To: hadi@cyberus.ca Cc: Jeff Garzik , Thomas Spatzier , "David S. Miller" , Hasso Tepper , Herbert Xu , netdev@oss.sgi.com, Paul Jakma In-Reply-To: <1105104757.1046.63.camel@jzny.localdomain> References: <1104764710.1048.580.camel@jzny.localdomain> <41DB26A6.2070008@pobox.com> <1104895169.1117.63.camel@jzny.localdomain> <41DC0931.80603@tpack.net> <1105019912.2314.20.camel@jzny.localdomain> <1105023972.3462.48.camel@tsc-6.cph.tpack.net> <1105104757.1046.63.camel@jzny.localdomain> Content-Type: text/plain Message-Id: <1105111605.3462.101.camel@tsc-6.cph.tpack.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Fri, 07 Jan 2005 16:26:45 +0100 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13592 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tommy.christensen@tpack.net Precedence: bulk X-list: netdev On Fri, 2005-01-07 at 14:32, jamal wrote: > On Thu, 2005-01-06 at 10:06, Tommy Christensen wrote: > > > But qdisc_restart() isn't called any more after the queue is > > stopped. So how do we get to drain the packets? > > We return -1; so qdisc restart will be called until theres no packets > left on the queue. Did i miss something in the state machine there? Yes, qdisc_run does this while (!netif_queue_stopped(dev) && qdisc_restart(dev) < 0) /* NOTHING */; > > Another approach could be to reset the qdisc (kind of what > > dev_deactivate does) if the driver stays in queue_stopped > > and carrier_off for some period of time. > > > > reseting qdisc could certainly be part of the device watchdog. > Note that once the packets are drained, the next thing that will happen > if device is stopped for a dev->timeout period is watchdog kicking in > and flushing the DMA. So you could reset your qdisc there though i am > not sure it will be needed with that patch. Unfortunately the watchdog won't do this when carrier is off, which is fair enough since the chip isn't hung as such. So, we would need another method to flush out stale packets from the DMA ring. Some drivers already do this themselves, and some won't need it because they keep on running even when link is down. -Tommy From jeremy.guthrie@berbee.com Thu Jan 6 20:17:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 20:17:54 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j074HiSv017345 for ; Thu, 6 Jan 2005 20:17:45 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Fri, 7 Jan 2005 10:17:32 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Fri, 7 Jan 2005 10:17:26 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson , Stephen Hemminger References: <200501031455.26980.jeremy.guthrie@berbee.com> <200501061618.24465.jeremy.guthrie@berbee.com> <16861.48463.770166.352726@robur.slu.se> In-Reply-To: <16861.48463.770166.352726@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1340695.bQ2qdNF43y"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501071017.31751.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 07 Jan 2005 16:17:32.0425 (UTC) FILETIME=[642ECF90:01C4F4D4] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13593 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart1340695.bQ2qdNF43y Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thursday 06 January 2005 04:35 pm, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > You mentioned before that " The stats didn't show any numbers so we > > don't know your load." Was there a command you wanted me to re-run? > > rtstat should show the routing/packet load. > > From a systems like yours 2*933 MHz PIII in production for tens of > thoundans of users many filter and full BGP routing. Current (late here) > use. > > > ifstat2 eth* > RX -------------------------- TX ------------------------- > eth0 272.8 M bit/s 51 k pps 350.7 M bit/s 51 k pps > eth1 371.9 M bit/s 55 k pps 293.6 M bit/s 55 k pps > eth2 6.7 M bit/s 1348 pps 3.0 M bit/s 991 pps > eth3 472 bit/s 0 pps 600 bit/s 0 pps Ifstat output: #kernel Interface RX Pkts/Rate TX Pkts/Rate RX Data/Rate TX Data/Ra= te RX Errs/Drop TX Errs/Drop RX Over/Rate TX Coll/Ra= te lo 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 eth0 1 0 1 0 66 0 178 0 0 0 0 0 0 0 0 0 eth2 0 0 30770 0 0 0 13361K 0 0 0 0 0 0 0 0 0 eth3 81019 0 0 0 41740K 0 0 0 0 0 0 0 0 0 0 0 > rtstat > size IN: hit tot mc no_rt bcast madst masrc OUT: hit tot = =20 > mc GC: tot ignored goal_miss ovrf HASH: in_search out_search 21007 =20 > 114060 748 0 5 0 0 0 11 5 0 = =20 > 0 0 0 0 58280 4 22683 112556 8= 27 > 0 6 0 0 0 5 5 0 0 0 = =20 > 0 0 60841 7 24230 111083 765 0 4 = =20 > 0 0 0 13 4 0 0 0 0 0 = =20 > 66628 7 > Around 110 kpps hitting warm cache entries and ~800 new lookups/sec. I was > expecting so see something similar from your system. Did my second email w/ the lnstat data not make it? > > FYI. > cat /proc/net/softnet_stat total droppped tsquz Throttl FR_hit FR_succe FR_defer FR_def_o=20 cpu_coll=20 > 9ba490f3 00000000 01281572 00000000 00000000 00000000 00000000 00000000 > 002562c2 9939268d 00000000 010e42e9 00000000 00000000 00000000 00000000=20 > 00000000 0028fe72 Why do these drops not show up in the interface drop? > Good Night. > > > --ro =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart1340695.bQ2qdNF43y Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB3rYbqtjaBHGZBeURApowAJ9tp9NRJazOm/HsVeC4ANYiDgyzjgCghJBx U1Pf8s66CXj3d7Zk3O7yBzQ= =AMaR -----END PGP SIGNATURE----- --nextPart1340695.bQ2qdNF43y-- From oxymoron@waste.org Thu Jan 6 21:01:38 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 21:01:45 -0800 (PST) Received: from waste.org (waste.org [216.27.176.166]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0751cdf022926 for ; Thu, 6 Jan 2005 21:01:38 -0800 Received: from waste.org (localhost [127.0.0.1]) by waste.org (8.12.3/8.12.3/Debian-7.1) with ESMTP id j07H1JAT016432; Fri, 7 Jan 2005 11:01:19 -0600 Received: (from oxymoron@localhost) by waste.org (8.12.3/8.12.3/Debian-7.1) id j07H1IMf016425; Fri, 7 Jan 2005 11:01:18 -0600 Date: Fri, 7 Jan 2005 09:01:18 -0800 From: Matt Mackall To: Francois Romieu Cc: Mark Broadbent , netdev@oss.sgi.com Subject: Re: Followup to netpoll issues Message-ID: <20050107170118.GU2940@waste.org> References: <1105045914.7687.3.camel@tigger> <20050106234610.GT2940@waste.org> <20050107011547.GE27896@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050107011547.GE27896@electric-eye.fr.zoreil.com> User-Agent: Mutt/1.3.28i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: by amavisd-new X-Virus-Status: Clean X-archive-position: 13594 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mpm@selenic.com Precedence: bulk X-list: netdev On Fri, Jan 07, 2005 at 02:15:47AM +0100, Francois Romieu wrote: > Matt Mackall : > [...] > > I've tinkered with this idea as well, but I'm not convinced it's the > > right idea. All current netpoll users (netconsole, kgdb, netdump) are > > intrinsically concerned with timeliness of delivery. Queueing packets > ^^^^^^^^^^^^^^^ > (as well as with reliability of the delivery maybe) > > for later delivery simply doesn't work with the latter two and might > > mislead with the former (eg netconsole message and other network > > traffic could be reordered). > > If kernel/printk.c::vprintk can not take the console semaphore, I > would say that messages are reordered with regard to the order in > which xmit_lock has been taken even without Mark's patch. > > So what do you exactly mean by "reordered" ? printk("debug: at point A"); do_something_that_sends_a_packet_B(); printk("debug: at point C"); Depending on locking and queueing, we might see on our network dump B, A, C, and wrongly conclude that whatever did B was not between A and C. That's a bad way for printk to work. > > Also note that there's a closely related class of deadlock that we > > can't detect: netconsole-induced recursion on driver-private locks. We > > haven't actually seen one of these yet and haven't attempted to audit > > for them, but my plan all along has been to treat it as a bug and > > hoist offending printks out of the locked regions. Note that this is > > really a netconsole-specific problem as the other netpoll clients are > > unlikely to have such usage patterns. > > Is is still a problem if Mark turns the spinlock in tx_retry_wq() into > an irq safe trylock ? > > (driver-private bugs could/will be inherited but fixing these is not > netconsole's job). The bugs I'm talking about are identical to the xmit_lock deadlock except with locks we can't see outside the driver. In other words, this patch addresses the easy part of larger problem by adding a bunch of complexity that doesn't help in the larger problem. To me, that's a hint that it's the wrong fix. > > Since the xmit_lock is so similar, it seems things that hit it ought > > to get the same treatment. So the rule becomes: no printk with network > > driver locks held (public or private). This is obviously broken in the > > face of oopsing in the driver, but netconsole can't be expected to > > work under such conditions anyway. > > I am not convinced that people will be satisfied with a rule which > states that printk _from anywhere_ are lost as soon as a CPU enters > in the xmit_lock zone but, hey, it's just me. It should only be dropped on the CPU holding the lock, with a loud warning to follow shortly. > Objection against Ccing further messages to netdev ? It is better indexed > than our mailboxes. Nope. -- Mathematics is the supreme nostalgia of our time. From SRS0+ed48ce240802494c5636+502+infradead.org+dwmw2@baythorne.srs.infradead.org Thu Jan 6 21:12:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 21:12:30 -0800 (PST) Received: from baythorne.infradead.org (IDENT:U2FsdGVkX1+WW8241NC/C1Advjz0vL4D9os9QazN9Tg@baythorne.infradead.org [81.187.226.107]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j075CPxc023652 for ; Thu, 6 Jan 2005 21:12:26 -0800 Received: from localhost ([127.0.0.1] helo=localhost.localdomain) by baythorne.infradead.org with esmtpsa (Exim 4.43 #1 (Red Hat Linux)) id 1CmxYm-0007iZ-6Z; Fri, 07 Jan 2005 17:06:00 +0000 Subject: Re: do_IRQ: stack overflow: 872.. From: David Woodhouse To: Andi Kleen Cc: Crazy AMD K7 , linux-kernel@vger.kernel.org, netdev@oss.sgi.com, Stephen Hemminger In-Reply-To: References: <1131604877.20041218092730@mail.ru.suse.lists.linux.kernel> Content-Type: text/plain Date: Fri, 07 Jan 2005 17:05:59 +0000 Message-Id: <1105117559.11753.34.camel@baythorne.infradead.org> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3.dwmw2.1) Content-Transfer-Encoding: 7bit X-SRS-Rewrite: SMTP reverse-path rewritten from by baythorne.infradead.org See http://www.infradead.org/rpr.html X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13595 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev On Sat, 2004-12-18 at 08:50 +0100, Andi Kleen wrote: > It's not really an oops, just a warning that stack space got quiet > tight. > > The problem seems to be that the br netfilter code is nesting far too > deeply and recursing several times. Looks like a design bug to me, > it shouldn't do that. I don't think it's recursing -- I think the stack trace is just a bit noisy. The problem is that the bridge code, especially with br_netfilter in the equation, is implicated in code paths which are just _too_ deep. This happens when you're bridging packets received in an interrupt while you were deep in journalling code, and it's also been seen with a call trace something like nfs->sunrpc->ip->bridge->br_netfilter. One option might be to make br_dev_xmit() just queue the packet rather than trying to deliver it to all the slave devices immediately. Then the actual retransmission can be handled from a context where we're _not_ short of stack; perhaps from a dedicated kernel thread. Unfortunately that approach would introduce a lot of latency on all packets we pass. Another option would be to have all architectures provide a stack_available() function and for br_dev_xmit() to queue the packet only if we're short of stack, while still sending most packets immediately. Proof of concept below; obviously the stack_available() is an evil hack and would need to be done more sanely. Comments? ===== net/bridge/br_device.c 1.17 vs edited ===== --- 1.17/net/bridge/br_device.c 2004-07-29 22:40:51 +01:00 +++ edited/net/bridge/br_device.c 2005-01-07 16:54:26 +00:00 @@ -19,6 +19,13 @@ #include #include "br_private.h" +static inline unsigned long stack_available(void) +{ + unsigned long esp; + asm volatile("movl %%esp,%0" : "=r"(esp)); + return esp - (unsigned long)current - sizeof(struct thread_info); +} + static struct net_device_stats *br_dev_get_stats(struct net_device *dev) { struct net_bridge *br; @@ -34,6 +41,14 @@ const unsigned char *dest = skb->data; struct net_bridge_fdb_entry *dst; + if (stack_available() < THREAD_SIZE/2) { + if (net_ratelimit()) { + printk(KERN_DEBUG "Bridge device %s queues packet due to stack shortage\n", + dev->name); + } + return NETDEV_TX_BUSY; + } + br->statistics.tx_packets++; br->statistics.tx_bytes += skb->len; @@ -104,7 +119,7 @@ SET_MODULE_OWNER(dev); dev->stop = br_dev_stop; dev->accept_fastpath = br_dev_accept_fastpath; - dev->tx_queue_len = 0; + dev->tx_queue_len = 5; dev->set_mac_address = NULL; dev->priv_flags = IFF_EBRIDGE; } -- dwmw2 From brazilnut@us.ibm.com Thu Jan 6 21:33:24 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 21:33:30 -0800 (PST) Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.130]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j075XHB7024637 for ; Thu, 6 Jan 2005 21:33:24 -0800 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e32.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j07HX4FJ714912 for ; Fri, 7 Jan 2005 12:33:04 -0500 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j07HX4Gc284354 for ; Fri, 7 Jan 2005 10:33:04 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j07HX4GF002586 for ; Fri, 7 Jan 2005 10:33:04 -0700 Received: from DYN319661.beaverton.ibm.com (DYN319661.beaverton.ibm.com [9.47.22.144]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j07HX38b002574; Fri, 7 Jan 2005 10:33:03 -0700 Received: by DYN319661.beaverton.ibm.com (Postfix, from userid 1000) id 51623229440; Fri, 7 Jan 2005 09:32:32 -0800 (PST) Date: Fri, 7 Jan 2005 09:32:32 -0800 From: Don Fry To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Subject: [PATCH 2.6.10-bk9] pcnet32: 79c976 with fiber optic fix Message-ID: <20050107173232.GA24906@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13596 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brazilnut@us.ibm.com Precedence: bulk X-list: netdev After testing this patch I agree that it should be applied. The one change I made was to print the device name (ethN) instead of 'pcnet32'. Tested ia32. From: Guido Guenther , Lars Munch Skip PHY selection on Allied Telesyn 2701FX, it looses the link otherwise. Fix up the AT 2700FX as well. Signed-Off-By: Guido Guenther Signed-off-by: Andrew Morton signed-off-by: Don Fry --- 25-akpm/drivers/net/pcnet32.c | 47 ++++++++++++++++++++++++---------------- 25-akpm/include/linux/pci_ids.h | 5 ++++ 2 files changed, 34 insertions(+), 18 deletions(-) diff -puN drivers/net/pcnet32.c~pcnet32-79c976-with-fiber-optic drivers/net/pcnet32.c --- 25/drivers/net/pcnet32.c~pcnet32-79c976-with-fiber-optic 2005-01-04 21:57:35.666712120 -0800 +++ 25-akpm/drivers/net/pcnet32.c 2005-01-04 21:57:35.673711056 -0800 @@ -1429,25 +1429,36 @@ pcnet32_open(struct net_device *dev) val |= 0x10; lp->a.write_csr (ioaddr, 124, val); - /* 24 Jun 2004 according AMD, in order to change the PHY, - * DANAS (or DISPM for 79C976) must be set; then select the speed, - * duplex, and/or enable auto negotiation, and clear DANAS */ - if (lp->mii && !(lp->options & PCNET32_PORT_ASEL)) { - lp->a.write_bcr(ioaddr, 32, lp->a.read_bcr(ioaddr, 32) | 0x0080); - /* disable Auto Negotiation, set 10Mpbs, HD */ - val = lp->a.read_bcr(ioaddr, 32) & ~0xb8; - if (lp->options & PCNET32_PORT_FD) - val |= 0x10; - if (lp->options & PCNET32_PORT_100) - val |= 0x08; - lp->a.write_bcr (ioaddr, 32, val); + /* Allied Telesyn AT 2700/2701 FX looses the link, so skip that */ + if (lp->pci_dev->subsystem_vendor == PCI_VENDOR_ID_AT && + (lp->pci_dev->subsystem_device == PCI_SUBDEVICE_ID_AT_2700FX || + lp->pci_dev->subsystem_device == PCI_SUBDEVICE_ID_AT_2701FX)) { + printk(KERN_DEBUG "%s: Skipping PHY selection.\n", dev->name); } else { - if (lp->options & PCNET32_PORT_ASEL) { - lp->a.write_bcr(ioaddr, 32, lp->a.read_bcr(ioaddr, 32) | 0x0080); - /* enable auto negotiate, setup, disable fd */ - val = lp->a.read_bcr(ioaddr, 32) & ~0x98; - val |= 0x20; - lp->a.write_bcr(ioaddr, 32, val); + /* + * 24 Jun 2004 according AMD, in order to change the PHY, + * DANAS (or DISPM for 79C976) must be set; then select the speed, + * duplex, and/or enable auto negotiation, and clear DANAS + */ + if (lp->mii && !(lp->options & PCNET32_PORT_ASEL)) { + lp->a.write_bcr(ioaddr, 32, + lp->a.read_bcr(ioaddr, 32) | 0x0080); + /* disable Auto Negotiation, set 10Mpbs, HD */ + val = lp->a.read_bcr(ioaddr, 32) & ~0xb8; + if (lp->options & PCNET32_PORT_FD) + val |= 0x10; + if (lp->options & PCNET32_PORT_100) + val |= 0x08; + lp->a.write_bcr (ioaddr, 32, val); + } else { + if (lp->options & PCNET32_PORT_ASEL) { + lp->a.write_bcr(ioaddr, 32, + lp->a.read_bcr(ioaddr, 32) | 0x0080); + /* enable auto negotiate, setup, disable fd */ + val = lp->a.read_bcr(ioaddr, 32) & ~0x98; + val |= 0x20; + lp->a.write_bcr(ioaddr, 32, val); + } } } diff -puN include/linux/pci_ids.h~pcnet32-79c976-with-fiber-optic include/linux/pci_ids.h --- 25/include/linux/pci_ids.h~pcnet32-79c976-with-fiber-optic 2005-01-04 21:57:35.669711664 -0800 +++ 25-akpm/include/linux/pci_ids.h 2005-01-04 21:57:35.676710600 -0800 @@ -1644,6 +1644,11 @@ #define PCI_DEVICE_ID_OPTIBASE_VPLEXCC 0x2120 #define PCI_DEVICE_ID_OPTIBASE_VQUEST 0x2130 +/* Allied Telesyn */ +#define PCI_VENDOR_ID_AT 0x1259 +#define PCI_SUBDEVICE_ID_AT_2700FX 0x2701 +#define PCI_SUBDEVICE_ID_AT_2701FX 0x2703 + #define PCI_VENDOR_ID_ESS 0x125d #define PCI_DEVICE_ID_ESS_ESS1968 0x1968 #define PCI_DEVICE_ID_ESS_AUDIOPCI 0x1969 _ -- Don Fry brazilnut@us.ibm.com From max@stro.at Thu Jan 6 21:38:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 21:38:21 -0800 (PST) Received: from baikonur.stro.at (baikonur.stro.at [213.239.196.228]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j075cEft025200 for ; Thu, 6 Jan 2005 21:38:15 -0800 Received: from sputnik (stallburg.stro.at [128.131.216.190]) by baikonur.stro.at (Postfix) with ESMTP id 521D75C007; Fri, 7 Jan 2005 18:37:59 +0100 (CET) Received: from max by sputnik with local (Exim 4.34) id 1Cmy3n-00007H-BX; Fri, 07 Jan 2005 18:38:03 +0100 Date: Fri, 7 Jan 2005 18:38:03 +0100 From: maximilian attems To: netdev@oss.sgi.com Cc: Leszek Subject: (fwd) Re: Bug#270451: 3com 3c905x dhcp not working in kernel 2.6.x on d ebian sarge Message-ID: <20050107173803.GD6036@stro.at> Mail-Followup-To: netdev@oss.sgi.com, Leszek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: by Amavis (ClamAV) at stro.at X-Virus-Status: Clean X-archive-position: 13597 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: janitor@sternwelten.at Precedence: bulk X-list: netdev better post to right networking mailinglist. ----- Forwarded message from Leszek ----- From: Leszek I have Slackware kernel kernels 2.4.6, kernel 2.6.10 and the ethernet card 3c589. Under 2.4 6 everything goes well and I recive a good IP from dhcp. Under 2.6.10 I receive different IP and it doesn't work properly. I can not get acess to Internet. So, if someone has a solution I would appreciate any hint. BR Leszek ----- End forwarded message ----- From shemminger@osdl.org Thu Jan 6 22:00:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 22:00:43 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0760aR0026797 for ; Thu, 6 Jan 2005 22:00:37 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j07I0Fd16796; Fri, 7 Jan 2005 10:00:15 -0800 Date: Fri, 7 Jan 2005 10:00:17 -0800 From: Stephen Hemminger To: David Woodhouse , Bart De Schuymer Cc: Andi Kleen , Crazy AMD K7 , bridge@osdl.org, netdev@oss.sgi.com Subject: Re: do_IRQ: stack overflow: 872.. Message-ID: <20050107100017.454ddadc@dxpl.pdx.osdl.net> In-Reply-To: <1105117559.11753.34.camel@baythorne.infradead.org> References: <1131604877.20041218092730@mail.ru.suse.lists.linux.kernel> <1105117559.11753.34.camel@baythorne.infradead.org> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13598 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev On Fri, 07 Jan 2005 17:05:59 +0000 David Woodhouse wrote: > On Sat, 2004-12-18 at 08:50 +0100, Andi Kleen wrote: > > It's not really an oops, just a warning that stack space got quiet > > tight. > > > > The problem seems to be that the br netfilter code is nesting far too > > deeply and recursing several times. Looks like a design bug to me, > > it shouldn't do that. > > I don't think it's recursing -- I think the stack trace is just a bit > noisy. The problem is that the bridge code, especially with br_netfilter > in the equation, is implicated in code paths which are just _too_ deep. > This happens when you're bridging packets received in an interrupt while > you were deep in journalling code, and it's also been seen with a call > trace something like nfs->sunrpc->ip->bridge->br_netfilter. Sounds like an argument for interrupt stacks. > One option might be to make br_dev_xmit() just queue the packet rather > than trying to deliver it to all the slave devices immediately. Then the > actual retransmission can be handled from a context where we're _not_ > short of stack; perhaps from a dedicated kernel thread. Probably the solution would be to handle it in the filter code that way if we are not filtering, we can use the interrupt path, but if filtering just defer to a safer context (like soft irq). > Unfortunately that approach would introduce a lot of latency on all > packets we pass. Another option would be to have all architectures > provide a stack_available() function and for br_dev_xmit() to queue the > packet only if we're short of stack, while still sending most packets > immediately. NO, that looks like a testablity and portablity nightmare. From SRS0+f6fa0f70176b0954674e+502+infradead.org+dwmw2@canuck.srs.infradead.org Thu Jan 6 22:09:18 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 22:09:22 -0800 (PST) Received: from canuck.infradead.org (canuck.infradead.org [205.233.218.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0769Hmb027614 for ; Thu, 6 Jan 2005 22:09:18 -0800 Received: from shinybook.infradead.org ([81.187.226.99]) by canuck.infradead.org with esmtpsa (Exim 4.42 #1 (Red Hat Linux)) id 1CmyXk-0003CH-4U; Fri, 07 Jan 2005 13:09:03 -0500 Subject: Re: do_IRQ: stack overflow: 872.. From: David Woodhouse To: Stephen Hemminger Cc: Bart De Schuymer , Andi Kleen , Crazy AMD K7 , bridge@osdl.org, netdev@oss.sgi.com In-Reply-To: <20050107100017.454ddadc@dxpl.pdx.osdl.net> References: <1131604877.20041218092730@mail.ru.suse.lists.linux.kernel> <1105117559.11753.34.camel@baythorne.infradead.org> <20050107100017.454ddadc@dxpl.pdx.osdl.net> Content-Type: text/plain Date: Fri, 07 Jan 2005 19:06:52 +0100 Message-Id: <1105121212.6500.3.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3.dwmw2.1) Content-Transfer-Encoding: 7bit X-SRS-Rewrite: SMTP reverse-path rewritten from by canuck.infradead.org See http://www.infradead.org/rpr.html X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13599 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev On Fri, 2005-01-07 at 10:00 -0800, Stephen Hemminger wrote: > > I don't think it's recursing -- I think the stack trace is just a bit > > noisy. The problem is that the bridge code, especially with br_netfilter > > in the equation, is implicated in code paths which are just _too_ deep. > > This happens when you're bridging packets received in an interrupt while > > you were deep in journalling code, and it's also been seen with a call > > trace something like nfs->sunrpc->ip->bridge->br_netfilter. > > Sounds like an argument for interrupt stacks. The NFS case didn't involve hardware interrupts. Except for the one which actually detected that the stack had overflowed. > Probably the solution would be to handle it in the filter code > that way if we are not filtering, we can use the interrupt path, > but if filtering just defer to a safer context (like soft irq). That's also a possibility. > > Unfortunately that approach would introduce a lot of latency on all > > packets we pass. Another option would be to have all architectures > > provide a stack_available() function and for br_dev_xmit() to queue the > > packet only if we're short of stack, while still sending most packets > > immediately. > > NO, that looks like a testablity and portablity nightmare. Yeah, I suppose I'm inclined to agree. -- dwmw2 From romieu@fr.zoreil.com Thu Jan 6 23:04:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 23:04:59 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0774q3j030069 for ; Thu, 6 Jan 2005 23:04:53 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.13.1/8.12.1) with ESMTP id j07J4V94017243; Fri, 7 Jan 2005 20:04:31 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.13.1/8.13.1/Submit) id j07J4QXh017242; Fri, 7 Jan 2005 20:04:26 +0100 Date: Fri, 7 Jan 2005 20:04:26 +0100 From: Francois Romieu To: Jeff Garzik Cc: Netdev , linux-kernel@vger.kernel.org Subject: Re: netdev-2.6 queue updated Message-ID: <20050107190426.GA17017@electric-eye.fr.zoreil.com> References: <41DE73B5.6080303@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41DE73B5.6080303@pobox.com> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13600 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Jeff Garzik : [...] > o r8169: oversized driver field for ethtool > o r8169: reduce max MTU for large frames > o r8169: Large Send enablement > o r8169: C 101 > o r8169: missing netif_poll_enable and irq ack Imho you can push these changes to mainline (with due credit to Jon D Mason for its contributions). -- Ueimor From jgarzik@pobox.com Thu Jan 6 23:11:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 23:11:52 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j077BlSU030769 for ; Thu, 6 Jan 2005 23:11:47 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CmzWL-0006jc-04; Fri, 07 Jan 2005 19:11:37 +0000 Message-ID: <41DEDEE5.5020908@pobox.com> Date: Fri, 07 Jan 2005 14:11:33 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Francois Romieu CC: Netdev , linux-kernel@vger.kernel.org Subject: Re: netdev-2.6 queue updated References: <41DE73B5.6080303@pobox.com> <20050107190426.GA17017@electric-eye.fr.zoreil.com> In-Reply-To: <20050107190426.GA17017@electric-eye.fr.zoreil.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13601 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Francois Romieu wrote: > Jeff Garzik : > [...] > >> o r8169: oversized driver field for ethtool >> o r8169: reduce max MTU for large frames >> o r8169: Large Send enablement >> o r8169: C 101 >> o r8169: missing netif_poll_enable and irq ack > > > Imho you can push these changes to mainline (with due credit to > Jon D Mason for its contributions). Yep, it's going in the next batch. Most of netdev-2.6 is bound for mainline "soon". Jeff From Robert.Olsson@data.slu.se Thu Jan 6 23:19:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 23:19:21 -0800 (PST) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j077JCqu031515 for ; Thu, 6 Jan 2005 23:19:15 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.12.10/8.12.10) with ESMTP id j07JIuuA025916; Fri, 7 Jan 2005 20:18:56 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 66A94EC1A0; Fri, 7 Jan 2005 20:18:56 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16862.57504.383176.640058@robur.slu.se> Date: Fri, 7 Jan 2005 20:18:56 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson , Stephen Hemminger Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501071017.31751.jeremy.guthrie@berbee.com> References: <200501031455.26980.jeremy.guthrie@berbee.com> <200501061618.24465.jeremy.guthrie@berbee.com> <16861.48463.770166.352726@robur.slu.se> <200501071017.31751.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13602 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > Did my second email w/ the lnstat data not make it? I see most zeroes > > cat /proc/net/softnet_stat > total droppped tsquz Throttl FR_hit FR_succe FR_defer FR_def_o > cpu_coll > > 9ba490f3 00000000 01281572 00000000 00000000 00000000 00000000 00000000 > > 002562c2 9939268d 00000000 010e42e9 00000000 00000000 00000000 00000000 > > 00000000 0028fe72 > Why do these drops not show up in the interface drop? These are drops in the network stack not in the devices. --ro From jeremy.guthrie@berbee.com Thu Jan 6 23:38:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 06 Jan 2005 23:38:37 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j077cUNr032419 for ; Thu, 6 Jan 2005 23:38:31 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Fri, 7 Jan 2005 13:38:17 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Fri, 7 Jan 2005 13:38:13 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson , Stephen Hemminger References: <200501031455.26980.jeremy.guthrie@berbee.com> <200501071017.31751.jeremy.guthrie@berbee.com> <16862.57504.383176.640058@robur.slu.se> In-Reply-To: <16862.57504.383176.640058@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2026825.t1k58qBlYN"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501071338.16621.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 07 Jan 2005 19:38:17.0920 (UTC) FILETIME=[6FDB7C00:01C4F4F0] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13603 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart2026825.t1k58qBlYN Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Friday 07 January 2005 01:18 pm, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > Did my second email w/ the lnstat data not make it? > I see most zeroes Is there a particular duration and count you want me to run for? The snaps= hot=20 should have been 60 one-second snapshots. =20 > > > cat /proc/net/softnet_stat > > > > total droppped tsquz Throttl FR_hit FR_succe FR_defer FR_def_o > > cpu_coll > > > > > 9ba490f3 00000000 01281572 00000000 00000000 00000000 00000000 > > > 00000000 002562c2 9939268d 00000000 010e42e9 00000000 00000000 > > > 00000000 00000000 00000000 0028fe72 > > > > Why do these drops not show up in the interface drop? > > These are drops in the network stack not in the devices. =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart2026825.t1k58qBlYN Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB3uUoqtjaBHGZBeURAshBAJ9j0hZAuvcmr2HvVyZDlMyd5Va8ZwCfdVjW m8mRjQ5TRwfYPnppWdPI2qo= =aicE -----END PGP SIGNATURE----- --nextPart2026825.t1k58qBlYN-- From Robert.Olsson@data.slu.se Fri Jan 7 00:07:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 00:07:40 -0800 (PST) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0787YkJ001232 for ; Fri, 7 Jan 2005 00:07:35 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.12.10/8.12.10) with ESMTP id j07K7MuA022177; Fri, 7 Jan 2005 21:07:22 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 6A553EC1A0; Fri, 7 Jan 2005 21:07:22 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16862.60410.396462.959693@robur.slu.se> Date: Fri, 7 Jan 2005 21:07:22 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson , Stephen Hemminger Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501071338.16621.jeremy.guthrie@berbee.com> References: <200501031455.26980.jeremy.guthrie@berbee.com> <200501071017.31751.jeremy.guthrie@berbee.com> <16862.57504.383176.640058@robur.slu.se> <200501071338.16621.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13604 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > Is there a particular duration and count you want me to run for? > The snapshot should have been 60 one-second snapshots. That should be OK as we would see one GC going and some flows recreated after this. --ro From jeremy.guthrie@berbee.com Fri Jan 7 00:14:19 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 00:14:26 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j078EIuh001903 for ; Fri, 7 Jan 2005 00:14:19 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Fri, 7 Jan 2005 14:14:06 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Fri, 7 Jan 2005 14:14:01 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson , Stephen Hemminger References: <200501031455.26980.jeremy.guthrie@berbee.com> <16862.57504.383176.640058@robur.slu.se> <200501071338.16621.jeremy.guthrie@berbee.com> In-Reply-To: <200501071338.16621.jeremy.guthrie@berbee.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart5095543.GhOXsq51Cb"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501071414.05126.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 07 Jan 2005 20:14:06.0665 (UTC) FILETIME=[709BF390:01C4F4F5] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13605 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart5095543.GhOXsq51Cb Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I just updated the Intel Drivers to the latest on source-forge(5.6.10.1). = I=20 now see lower CPU usage but I am still dropping. During a 60 second window the machine received 5,110,164 packets and droppe= d=20 20461 or roughly 0.4% packet loss. cat /proc/net/softnet_stat 2f9c9bd0 150dc67c 00c4701b 000d2659 00000000 00000000 00000000 00000000=20 00097049 00010f9b 00000000 0000003a 00000000 00000000 00000000 00000000 00000000=20 000002fc It has been at 150dc67c for a while now. So while I am dropping at the car= d,=20 I am not dropping in the stack. mpstat -P ALL 2 Linux 2.6.10 (h-idspr-msn-1) 01/07/05 14:06:45 CPU %user %nice %system %iowait %irq %soft %idle = =20 intr/s 14:06:47 all 0.00 0.00 0.00 0.75 1.74 43.03 54.48 =20 22598.51 14:06:47 0 0.00 0.00 0.00 0.00 2.49 78.61 18.91 =20 17570.65 14:06:47 1 0.00 0.00 0.00 1.49 1.49 7.46 90.05 = =20 5023.88 14:06:47 CPU %user %nice %system %iowait %irq %soft %idle = =20 intr/s 14:06:49 all 0.00 0.00 0.00 0.00 1.50 45.75 52.75 =20 19352.00 14:06:49 0 0.00 0.00 0.00 0.00 2.50 83.00 14.50 =20 14467.00 14:06:49 1 0.00 0.00 0.00 0.00 0.50 9.00 90.50 = =20 4886.50 14:06:49 CPU %user %nice %system %iowait %irq %soft %idle = =20 intr/s 14:06:51 all 0.00 0.00 0.00 0.00 1.75 42.50 55.75 =20 22482.59 14:06:51 0 0.00 0.00 0.00 0.00 2.49 77.61 19.90 =20 17572.64 14:06:51 1 0.00 0.00 0.50 0.00 1.00 6.97 91.54 = =20 4919.90 14:06:51 CPU %user %nice %system %iowait %irq %soft %idle = =20 intr/s 14:06:53 all 0.00 0.00 0.25 0.00 1.99 43.03 54.73 =20 22458.00 14:06:53 0 0.00 0.00 0.00 0.00 3.00 78.50 18.50 =20 17456.00 14:06:53 1 0.00 0.00 0.00 0.00 0.50 8.00 91.00 = =20 4992.50 14:06:53 CPU %user %nice %system %iowait %irq %soft %idle = =20 intr/s 14:06:55 all 0.00 0.00 0.00 0.00 1.75 42.75 55.50 =20 22854.00 14:06:55 0 0.00 0.00 0.00 0.00 3.00 77.00 20.00 =20 17838.00 14:06:55 1 0.00 0.00 0.00 0.00 1.00 8.50 91.00 = =20 5012.50 =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart5095543.GhOXsq51Cb Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD4DBQBB3u2NqtjaBHGZBeURAtWvAKCNruPqTyGJpSYfz/lcul499cbg8ACVGt2b PTNzJOqIcPfEU58YFq2lfg== =K52x -----END PGP SIGNATURE----- --nextPart5095543.GhOXsq51Cb-- From markb@wetlettuce.com Fri Jan 7 00:15:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 00:15:43 -0800 (PST) Received: from piglet.wetlettuce.com (piglet.wetlettuce.com [82.68.149.69]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j078FY5g002251 for ; Fri, 7 Jan 2005 00:15:34 -0800 Received: from pooh.wireless.wetlettuce.com ([192.168.10.70]) by piglet.wetlettuce.com with esmtp (TLSv1:RC4-MD5:128) (Exim 3.35 #1 (Debian)) id 1Cn0Va-000131-00; Fri, 07 Jan 2005 20:14:54 +0000 Subject: Re: Followup to netpoll issues From: Mark Broadbent To: Francois Romieu Cc: Matt Mackall , "Network Development (Linux)" In-Reply-To: <20050107002053.GD27896@electric-eye.fr.zoreil.com> References: <1105045914.7687.3.camel@tigger> <20050107002053.GD27896@electric-eye.fr.zoreil.com> Content-Type: multipart/mixed; boundary="=-siOvjmewd9qVZIRl+1iS" Date: Fri, 07 Jan 2005 20:14:47 +0000 Message-Id: <1105128887.3814.20.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) X-MailScanner: Mail is clear of Viree X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13606 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: markb@wetlettuce.com Precedence: bulk X-list: netdev --=-siOvjmewd9qVZIRl+1iS Content-Type: text/plain Content-Transfer-Encoding: 7bit [cc'ing netdev] On Fri, 2005-01-07 at 01:20 +0100, Francois Romieu wrote: > Mark Broadbent : > [...] > > I had a think about the netpoll deadlock following the initial detective > > work by you and Francois did. I came up with a sample fix given below > > that defers the packet transmission within netpoll until the xmit_lock > > can be grabbed. An advantage of this is that is maintains the packet > > ordering. I have attached the patch. > > Nice. > > Comments below. Off to bed now. > > > It is possible for netpoll to deadlock by attempting to take the network > > device xmit_lock twice on different processors. This patch resolves this > > by deferring to transmission of the second and subsequent skbs. > > > > Signed-Off-By: Mark Broadbent > > > > --- linux-2.6.10-org/net/core/netpoll.c 2005-01-05 22:30:53.000000000 +0000 > > +++ linux-2.6.10/net/core/netpoll.c 2005-01-06 21:00:24.000000000 +0000 > [...] > > @@ -178,17 +201,14 @@ repeat: > > return skb; > > } > > > > -void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) > > +/* This must be called with np->dev->xmit_lock spinlock held - this function > > + * function will drop the lock before returning indicating if it needs to be > > + * retried > > + */ > > +static int transmit_skb(struct netpoll *np, struct sk_buff *skb) > > It may seem like cosmetic but I do not like functions which unlock a lock > they have not acquired themselves (and I am probably not alone). Would you > consider pushing the trylock() in transmit_skb() itself ? > > All the callers of this functions have to issue the trylock anyway so it > should not matter from a performance POV. Good point, I was having doubts about that. > [...] > > + > > + spin_lock(&tx_list_lock); > ^^^^^^^^^ > kernel/workqueue.c::run_workqueue() could reenable interrupts before > it calls tx_retry_wq(). An irq safe version of the underlined lock > seems required to avoid deadlocking with printks potentially issued > from interrupt context. Fixed. > > + > > + list_for_each_safe(tx_ctr, tx_tmp, &tx_queue.link) { > > + tx_el = list_entry(tx_ctr, struct tx_queue_list, link); > > + > > + while (tx_el->np && tx_el->np->dev && > > + netif_running(tx_el->np->dev)) { > > netif_running() without xmit_lock held ? Uh oh... This is done in the original code (and still is in other parts of the code). > Imho you should try to keep transmit_skb() closer to the former > netpoll_send_skb() (modulo the try_lock change of course). > Btw I do not see what will prevent cleanup_netconsole() to succeed > when tx_retry_wq() is scheduled for later execution. Add some module > refcounting ? No need, if netpoll_cleanup is called whilst a retry is pending the tx list lock is taken. All the references to the netpoll pointer are deleted from the pending list before the lock is released. > > +void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) > > +{ > > +repeat: > > + if(!np || !np->dev || !netif_running(np->dev)) > > + goto out_free; > > I am not sure that the first two tests above really made sense in > the former version of the code: > -> kernel/printk.c::vprintk() (downs console_sem) > -> kernel/printk.c::release_console_sem > -> kernel/printk.c::call_console_drivers > [blah blah] > -> drivers/net/netconsole.c::netconsole.write_msg > -> drivers/net/netconsole.c::netpoll_send_udp > -> drivers/net/netconsole.c::netpoll_send_skb > > -> drivers/net/netconsole.c::cleanup_netconsole > -> kernel/printk.c::unregister_console > -> kernel/printk.c::acquire_console_sem > -> try to down(&console_sem) > > dev_put() has not been issued, np->dev is still among us and != NULL. > So far, so good. > > However netpoll_send_skb can be called through: > netpoll_rx -> arp_reply -> netpoll_send_skb > Here I fail to see why netpoll_cleanup could not happen at the same time > and issue np->dev = NULL; Could this solved by having a per netpoll structure rw_lock to protect against changing elements in the structure? e.g. struct netpoll { ... rwlock_t netpoll_lock; }; write_lock_irqsave(&np->netpoll_lock, flags); np->dev = NULL; write_unlock_irqsave(&np->netpoll_lock, flags); > > + > > + /* If the list is non-empty then pkts are pending tx, > > + * append to the end of list to stop reordering of the pkts > > + */ > > + if (!list_empty(&tx_queue.link) || !spin_trylock(&np->dev->xmit_lock)) { > > + struct tx_queue_list *txel; > > + > > + /* If we failed to get the xmit_lock then netpoll probably > > + * already holds this lock but will deadlock here if we relock, > > Ok ("probably" ?). :) Fixed > > + * queue the skb for transmission later > > + */ > > + spin_lock(&tx_list_lock); > > No spin_lock_irqsave ? Hmmm... > The only use of netpoll_send_skb() goes through netpoll_send_udp() which is > issued in drivers/net/netconsole.c::write_msg() with local_irq disabled. > You are right but an extra comment would not hurt imho. Is it safe to issue spin_lock_irqsave/spin_unlock_restore in this context? Reason: What if it wasn't netconsole calling netpoll_send_udp and not with local interrupts disabled? > > + > > + txel = kmalloc(sizeof(struct tx_queue_list), GFP_ATOMIC); > > + if (!txel) > > + goto out_free; > > + > > + txel->skb = skb_get(skb); > > + txel->np = np; > > + > > + list_add_tail(&txel->link, &tx_queue.link); > > + > > + queue_delayed_work(tx_wq, &tx_wq_obj, HZ/100); > > + > > + spin_unlock(&tx_list_lock); > > + } else if (transmit_skb(np, skb)) > > + goto repeat; > > As I read it, the previous code could loop as long as netif_queue_stopped() > is true and it can acquire the lock. Any reason to not defer the skb for > transmission in tx_retry_wq() ? Nope, no good reason. If transmit_skb fails it'll now defer. > > > + > > + return; > > + > > +out_free: > > + __kfree_skb(skb); > > } > > > > void netpoll_send_udp(struct netpoll *np, const char *msg, int len) > > @@ -636,6 +729,15 @@ int netpoll_setup(struct netpoll *np) > > spin_unlock_irqrestore(&rx_list_lock, flags); > > } > > > > + /* Workqueue to schedule the tx retries */ > > + if (!tx_wq) > > + tx_wq = create_workqueue("netpoll"); > > + > > + if (!tx_wq) { > > + printk(KERN_ERR "Failed to create netpoll workqueue\n"); > > + goto release; > > + } > > + > > This queue is created but never removed. May be it could/should go in a > separate function and be anchored to net_dev_init(). The network maintainers > will tell if they care or not. > > Pure curiosity: why a specific queue instead of schedule_delayed_work() ? Pure ignorance I'm afraid ;). That'll more what I was looking for originally so I've changed it. I've attached a revised version. Thanks for you comments (and Matts) Mark -- Mark Broadbent --=-siOvjmewd9qVZIRl+1iS Content-Disposition: attachment; filename=netpoll-fix-tx-deadlock-2.patch Content-Type: text/x-patch; name=netpoll-fix-tx-deadlock-2.patch; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit It is possible for netpoll to deadlock by attempting to take the network device xmit_lock twice on different processors. This patch resolves this by deferring to transmission of the second and subsequent skbs. Signed-Off-By: Mark Broadbent --- linux-2.6.10-org/net/core/netpoll.c 2005-01-05 22:30:53.000000000 +0000 +++ linux-2.6.10/net/core/netpoll.c 2005-01-07 20:10:20.000000000 +0000 @@ -1,6 +1,9 @@ /* * Common framework for low-level network console, dump, and debugger code * + * Jan 5 2005 Mark Broadbent + * avoid deadlock on transmission + * * Sep 8 2003 Matt Mackall * * based on the netconsole code from: @@ -19,6 +22,8 @@ #include #include #include +#include +#include #include #include #include @@ -31,6 +36,22 @@ #define MAX_SKBS 32 #define MAX_UDP_CHUNK 1460 +static void tx_retry_wq(void *p); + +struct tx_queue_list { + struct list_head link; + struct sk_buff *skb; + struct netpoll *np; +}; + +static spinlock_t tx_list_lock = SPIN_LOCK_UNLOCKED; +static struct tx_queue_list tx_queue = { + .link = LIST_HEAD_INIT(tx_queue.link) +}; + +static DECLARE_WORK(tx_wq_obj, tx_retry_wq, NULL); + + static spinlock_t skb_list_lock = SPIN_LOCK_UNLOCKED; static int nr_skbs; static struct sk_buff *skbs; @@ -178,17 +199,21 @@ repeat: return skb; } -void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) +/* This must be called with np->dev->xmit_lock spinlock held - this function + * function will drop the lock before returning indicating if it needs to be + * retried + */ +static int transmit_skb(struct netpoll *np, struct sk_buff *skb) { int status; -repeat: - if(!np || !np->dev || !netif_running(np->dev)) { - __kfree_skb(skb); - return; - } - - spin_lock(&np->dev->xmit_lock); + if (np && np->dev && netif_running(np->dev)) + return -1; + + /* Attempt the xmit lock as we may already hold it */ + if (!spin_trylock(&np->dev->xmit_lock)) + return -1; + np->dev->xmit_lock_owner = smp_processor_id(); /* @@ -200,7 +225,7 @@ repeat: spin_unlock(&np->dev->xmit_lock); netpoll_poll(np); - goto repeat; + return -1; } status = np->dev->hard_start_xmit(skb, np->dev); @@ -210,8 +235,73 @@ repeat: /* transmit busy */ if(status) { netpoll_poll(np); - goto repeat; + return -1; } + + return 0; +} + +static void tx_retry_wq(void *p) +{ + struct list_head *tx_ctr, *tx_tmp; + struct tx_queue_list *tx_el; + unsigned long flags; + + spin_lock_irqsave(&tx_list_lock, flags); + + list_for_each_safe(tx_ctr, tx_tmp, &tx_queue.link) { + tx_el = list_entry(tx_ctr, struct tx_queue_list, link); + + if (transmit_skb(tx_el->np, tx_el->skb)) { + // Transmit failed - reschedule + schedule_delayed_work(&tx_wq_obj, HZ/100); + goto out_unlock; + } + + list_del(tx_ctr); + __kfree_skb(tx_el->skb); + kfree(tx_el); + } + +out_unlock: + spin_unlock_irqrestore(&tx_list_lock, flags); +} + +void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) +{ + /* If the list is non-empty (packets pending tx) or the skb transmit + * failed then pkts are pending tx, append to the end of list to stop + * reordering of the pkts + */ + if (!list_empty(&tx_queue.link) || transmit_skb(np, skb)) { + struct tx_queue_list *txel; + + /* If we failed to get the xmit_lock then netpoll already holds + * this lock but will deadlock here if we relock, queue the skb + * for transmission later. + * This function is always called with local irqs disabled, hence + * the lack of spin_lock_irqsave + */ + spin_lock(&tx_list_lock); + + txel = kmalloc(sizeof(struct tx_queue_list), GFP_ATOMIC); + if (!txel) + goto out_free; + + txel->skb = skb_get(skb); + txel->np = np; + + list_add_tail(&txel->link, &tx_queue.link); + + schedule_delayed_work(&tx_wq_obj, HZ/100); + + spin_unlock(&tx_list_lock); + } + + return; + +out_free: + __kfree_skb(skb); } void netpoll_send_udp(struct netpoll *np, const char *msg, int len) @@ -644,6 +734,23 @@ int netpoll_setup(struct netpoll *np) void netpoll_cleanup(struct netpoll *np) { + struct list_head *tx_ctr, *tx_tmp; + struct tx_queue_list *tx_el; + unsigned long flags; + + spin_lock_irqsave(&tx_list_lock, flags); + list_for_each_safe(tx_ctr, tx_tmp, &tx_queue.link) { + tx_el = list_entry(tx_ctr, struct tx_queue_list, link); + + // This netpoll is going away - remove just these elements + if (tx_el->np == np) { + list_del(tx_ctr); + __kfree_skb(tx_el->skb); + kfree(tx_el); + } + } + spin_unlock_irqrestore(&tx_list_lock, flags); + if (np->rx_hook) { unsigned long flags; --=-siOvjmewd9qVZIRl+1iS-- From Robert.Olsson@data.slu.se Fri Jan 7 00:41:10 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 00:41:14 -0800 (PST) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j078f82Z007684 for ; Fri, 7 Jan 2005 00:41:09 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.12.10/8.12.10) with ESMTP id j07KeuuA003018; Fri, 7 Jan 2005 21:40:56 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 348E2EC1A0; Fri, 7 Jan 2005 21:40:56 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16862.62424.180929.680029@robur.slu.se> Date: Fri, 7 Jan 2005 21:40:56 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson , Stephen Hemminger Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501071414.05126.jeremy.guthrie@berbee.com> References: <200501031455.26980.jeremy.guthrie@berbee.com> <16862.57504.383176.640058@robur.slu.se> <200501071338.16621.jeremy.guthrie@berbee.com> <200501071414.05126.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13607 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > During a 60 second window the machine received 5,110,164 packets and > dropped 20461 or roughly 0.4% packet loss. Around 85 kpps. If you run rtstat we could a feeling how may slow-pathx that are taken. Or save the /proc/net/stat/rt_cache before you 60 sec run. mpstat I don't trust in this context. > It has been at 150dc67c for a while now. So while I am dropping at the > card, I am not dropping in the stack. You use NAPI driver then... Check if the patch below is in your e1000 driver. --ro --- drivers/net/e1000/e1000_main.c.orig 2004-02-16 14:46:16.000000000 +0100 +++ drivers/net/e1000/e1000_main.c 2004-02-16 15:45:05.000000000 +0100 @@ -2161,19 +2161,21 @@ struct e1000_adapter *adapter = netdev->priv; int work_to_do = min(*budget, netdev->quota); int work_done = 0; - - e1000_clean_tx_irq(adapter); + static boolean_t tx_cleaned; + + tx_cleaned = e1000_clean_tx_irq(adapter); e1000_clean_rx_irq(adapter, &work_done, work_to_do); *budget -= work_done; netdev->quota -= work_done; - if(work_done < work_to_do || !netif_running(netdev)) { + if( (!tx_cleaned && (work_done == 0)) || !netif_running(netdev)) { netif_rx_complete(netdev); e1000_irq_enable(adapter); + return 0; } - return (work_done >= work_to_do); + return 1; } #endif From terryg@axian.com Fri Jan 7 01:03:00 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 01:03:04 -0800 (PST) Received: from zaphod.axian.com (zaphod.axian.com [64.122.196.146]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0792xbM008770 for ; Fri, 7 Jan 2005 01:03:00 -0800 Received: from [192.168.132.122] (trillian.axian.com [64.122.196.158]) by zaphod.axian.com (8.12.11/8.12.11) with ESMTP id j07L2f6q018804; Fri, 7 Jan 2005 13:02:41 -0800 Subject: [Fwd: oops in snmp6_unregister_dev()] From: Terry Griffin To: netdev@oss.sgi.com Content-Type: multipart/mixed; boundary="=-rVE9M07o5Af1C/OCb4TM" Message-Id: <1105131761.30138.87.camel@tux.hq.axian.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Fri, 07 Jan 2005 13:02:41 -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13608 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: terryg@axian.com Precedence: bulk X-list: netdev --=-rVE9M07o5Af1C/OCb4TM Content-Type: text/plain Content-Transfer-Encoding: 7bit As posted on LKML. Since first posting this I've found that the user-space workaround is not 100% reliable. Thanks, Terry --=-rVE9M07o5Af1C/OCb4TM Content-Disposition: inline Content-Description: Forwarded message - oops in snmp6_unregister_dev() Content-Type: message/rfc822 Subject: oops in snmp6_unregister_dev() From: Terry Griffin To: linux-kernel@vger.kernel.org Content-Type: text/plain Message-Id: <1105124721.30138.77.camel@tux.hq.axian.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Fri, 07 Jan 2005 11:05:21 -0800 Content-Transfer-Encoding: 7bit Hi all, I'm getting an oops in snmp6_unregister_dev(). I've replicated the problem with these kernels: Pre-built 2.6.9-1.6_FC2 (Fedora Core 2) Pre-built 2.6.9-1.11_FC2 (Fedora Core 2) Custom-built 2.6.10 (kernel.org) The oops message below is from 2.6.9-1.11_FC2. The trigger is these commands in rapid succession: service dhcpd stop ifdown eth2 ifconfig eth2 0.0.0.0 The ifconfig command is not required to trigger the oops but it dramatically increases the odds of it happening to better than 90%. Without the ifconfig command the odds of getting the oops are much lower, less than 10%. The service and ifdown scripts, and the ifconfig utility are those included with FC2. Interface eth2 is associated with the r8169 device driver. The DHCP server is configured to dish out leases on this interface. The user-space workaround is to insert delays between the commands as follows: service dhcpd stop sleep 1 ifdown eth2 sleep 1 ifconfig eth2 0.0.0.0 The oops message text below was hand typed so their could be some errors. Thanks, Terry Unable to handle kernel NULL pointer dereference at virtual address 0000000a printing eip: c019f200 *pde = 1faf3067 Oops: 0000 [#1] Modules linked in: r8169 microcode dm_mod uhci_hcd ehci_hdc e100 mii appletalk ipx md5 ipv6 ext3 jbd CPU: 0 EIP: 0060:[] Not tainted VLI EFLAGS: 00010286 (2.6.9-1.11_FC2) EIP is at remove_proc_entry+0x2f/0xe3 eax: 00000000 ebx: 0000000a ecx: ffffffff edx: de100200 esi: ddce6000 edi: 0000000a ebp: c03d9fd0 esp: c03d9f80 ds: 007b es: 007b ss: 0068 Process swapper (pid: 0, threadinfo=c03d9000 task=c034cb80) Stack: de100200 0000000a dfd24800 ddce6000 00000000 c03d9fd0 e09691d7 dfd24800 e094b025 dd9e6e80 dddf2680 c02a63e1 dddf2680 c0421ce0 c03529e0 c02a606f 00000000 c02a5fc4 c0128666 c03d9fd0 c03d9fd0 c03d9fd0 00000000 00000001 Call Trace: [] snmp6_unregister_dev+0x2f/0x3e [ipv6] [] in6_dev_finish_destroy+0x70/0x7f [ipv6] [] dst_destroy+0x60/0xa7 [] dst_run_gc+0xab/0x18a [] dst_run_gc+0x0/0x18a [] run_timer_softirq+0x1e3/0x2e1 [] __do_softirq+0x35/0x79 [] do_softirq+0x3a/0x41 ======================= [] do_IRQ+0x239/0x242 [] common_interrupt+0x18/0x20 [] apm_bios_call_simple+0x5e/0x95 [] __xfrm_state_delete+0xe8/0x160 [] apm_do_idle+0x12/0x5c [] apm_cpu_idle+0xab/0x121 [] cpu_idle+0x1f/0x34 [] start_kernel+0x20f/0x211 Code: 56 53 55 55 89 14 24 89 44 24 04 75 13 8d 4c 24 04 89 e2 e8 42 f4 ff ff 85 c0 0f 85 b7 00 00 00 8b 5c 24 04 31 c0 83 c9 ff 89 df ae f7 d1 49 8b 04 24 89 cd 8d 70 34 83 78 34 00 0f 84 95 00 <0>Kernel panic - not syncing: Fatal exception in interrupt --=-rVE9M07o5Af1C/OCb4TM-- From jeremy.guthrie@berbee.com Fri Jan 7 01:07:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 01:07:30 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0797BZK009317 for ; Fri, 7 Jan 2005 01:07:15 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Fri, 7 Jan 2005 15:06:58 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Fri, 7 Jan 2005 15:06:54 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson , Stephen Hemminger References: <200501031455.26980.jeremy.guthrie@berbee.com> <200501071414.05126.jeremy.guthrie@berbee.com> <16862.62424.180929.680029@robur.slu.se> In-Reply-To: <16862.62424.180929.680029@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1122471.8x5onAmVJB"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501071506.57811.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 07 Jan 2005 21:06:58.0688 (UTC) FILETIME=[D3484000:01C4F4FC] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13609 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart1122471.8x5onAmVJB Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Friday 07 January 2005 02:40 pm, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > During a 60 second window the machine received 5,110,164 packets and > > dropped 20461 or roughly 0.4% packet loss. > > Around 85 kpps. If you run rtstat we could a feeling how may slow-pathx > that are taken.=20 I can't run rstat. The rt_cache_stat file doesn't exist in /proc/net=20 or /proc/net/stat in either V2.4 or V2.6. > Or save the /proc/net/stat/rt_cache before you 60 sec=20 > run. lnstat isn't giving me anything other than zeros. =20 entries in_hit in_slow_tot in_no_route in_brd in_martian_dst in_martian_sr= c =20 out_hit out_slow_tot out_slow_mc gc_total gc_ignored gc_goal_miss=20 gc_dst_overflow in_hlist_search out_hlist_search 0000f91e 15b1ddab 0b69a32c 00000000 00000000 00001b0a 00001fbd 00000000 =20 00066f65 0000b943 00000000 087b80a1 0878e81a 00000256 00000000 ca08c77d=20 0020e549 0000f91e 00005c59 0000b3ef 00000000 00000000 00000cf7 00000000 00000000 =20 0000000f 0000004c 00000002 00000fb9 00000fb5 00000000 00000000 0004e8d9=20 000000b2 60 seconds...... entries in_hit in_slow_tot in_no_route in_brd in_martian_dst in_martian_sr= c =20 out_hit out_slow_tot out_slow_mc gc_total gc_ignored gc_goal_miss=20 gc_dst_overflow in_hlist_search out_hlist_search 0000fb3e 15ff4696 0b6bbb65 00000000 00000000 00001b10 00001fc1 00000000 =20 00067111 0000b974 00000000 087d9903 087b0003 00000256 00000000 cb58b399=20 0020ee79 0000fb3e 00005c5b 0000b40d 00000000 00000000 00000cf9 00000000 00000000 =20 0000000f 0000004c 00000002 00000fbb 00000fb7 00000000 00000000 0004e9ba=20 000000b2 > mpstat I don't trust in this context. > > > It has been at 150dc67c for a while now. So while I am dropping at the > > card, I am not dropping in the stack. > > You use NAPI driver then... > Check if the patch below is in your e1000 driver. > --ro The drivers should be built as NAPI. Here is the snippet: static int e1000_clean(struct net_device *netdev, int *budget) { struct e1000_adapter *adapter =3D netdev->priv; int work_to_do =3D min(*budget, netdev->quota); int tx_cleaned; int work_done =3D 0; if (!netif_carrier_ok(netdev)) goto quit_polling; tx_cleaned =3D e1000_clean_tx_irq(adapter); e1000_clean_rx_irq(adapter, &work_done, work_to_do); *budget -=3D work_done; netdev->quota -=3D work_done; /* if no Rx and Tx cleanup work was done, exit the polling mode */ if(!tx_cleaned || (work_done < work_to_do) || !netif_running(netdev)) { quit_polling: netif_rx_complete(netdev); e1000_irq_enable(adapter); return 0; } return (work_done >=3D work_to_do); } > > --- drivers/net/e1000/e1000_main.c.orig 2004-02-16 14:46:16.000000000 > +0100 +++ drivers/net/e1000/e1000_main.c 2004-02-16 15:45:05.000000000 > +0100 @@ -2161,19 +2161,21 @@ > struct e1000_adapter *adapter =3D netdev->priv; > int work_to_do =3D min(*budget, netdev->quota); > int work_done =3D 0; > - > - e1000_clean_tx_irq(adapter); > + static boolean_t tx_cleaned; > + > + tx_cleaned =3D e1000_clean_tx_irq(adapter); > e1000_clean_rx_irq(adapter, &work_done, work_to_do); > > *budget -=3D work_done; > netdev->quota -=3D work_done; > > - if(work_done < work_to_do || !netif_running(netdev)) { > + if( (!tx_cleaned && (work_done =3D=3D 0)) || !netif_running(netdev)) { > netif_rx_complete(netdev); > e1000_irq_enable(adapter); > + return 0; > } > > - return (work_done >=3D work_to_do); > + return 1; > } > #endif =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart1122471.8x5onAmVJB Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB3vnxqtjaBHGZBeURAqa6AJ95YCgRBAIzM0qXYxDLWsgpjuQW6QCgmyUT PAcawdHWqMOb939ioWONMRA= =5vpR -----END PGP SIGNATURE----- --nextPart1122471.8x5onAmVJB-- From bdschuym@pandora.be Fri Jan 7 01:22:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 01:22:53 -0800 (PST) Received: from asia.telenet-ops.be (asia.telenet-ops.be [195.130.132.59]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j079MkDY010077 for ; Fri, 7 Jan 2005 01:22:47 -0800 Received: from localhost (localhost.localdomain [127.0.0.1]) by asia.telenet-ops.be (Postfix) with SMTP id E9ABA224129; Fri, 7 Jan 2005 22:22:38 +0100 (MET) Received: from 192.168.0.138 (dD5763CA9.access.telenet.be [213.118.60.169]) by asia.telenet-ops.be (Postfix) with ESMTP id E91C62242C4; Fri, 7 Jan 2005 22:22:37 +0100 (MET) Subject: Re: do_IRQ: stack overflow: 872.. From: Bart De Schuymer To: Stephen Hemminger Cc: David Woodhouse , Andi Kleen , Crazy AMD K7 , bridge@osdl.org, netdev@oss.sgi.com, Rusty Russell , "David S. Miller" In-Reply-To: <20050107100017.454ddadc@dxpl.pdx.osdl.net> References: <1131604877.20041218092730@mail.ru.suse.lists.linux.kernel> <1105117559.11753.34.camel@baythorne.infradead.org> <20050107100017.454ddadc@dxpl.pdx.osdl.net> Content-Type: text/plain Date: Fri, 07 Jan 2005 22:27:21 +0100 Message-Id: <1105133241.3375.16.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13610 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bdschuym@pandora.be Precedence: bulk X-list: netdev Op vr, 07-01-2005 te 10:00 -0800, schreef Stephen Hemminger: > On Fri, 07 Jan 2005 17:05:59 +0000 > David Woodhouse wrote: > > I don't think it's recursing -- I think the stack trace is just a bit > > noisy. The problem is that the bridge code, especially with br_netfilter > > in the equation, is implicated in code paths which are just _too_ deep. > > This happens when you're bridging packets received in an interrupt while > > you were deep in journalling code, and it's also been seen with a call > > trace something like nfs->sunrpc->ip->bridge->br_netfilter. > > Sounds like an argument for interrupt stacks. > > > One option might be to make br_dev_xmit() just queue the packet rather > > than trying to deliver it to all the slave devices immediately. Then the > > actual retransmission can be handled from a context where we're _not_ > > short of stack; perhaps from a dedicated kernel thread. > > Probably the solution would be to handle it in the filter code > that way if we are not filtering, we can use the interrupt path, > but if filtering just defer to a safer context (like soft irq). How about something like the patch below (untested but compiles)? The current netfilter scheme adds one function call to the call chain for each NF_HOOK and NF_HOOK_THRESH. This can be prevented by executing the okfn in the calling function instead of in nf_hook_slow(). I didn't check if there's any code that actually uses the return value from NF_HOOK. If so, this patch won't work well in its current form as - EPERM is now also returned for NF_QUEUE and NF_STOLEN. Another 2 calls of okfn can be postponed in br_netfilter.c by adding NF_STOP, which would work like NF_STOLEN except that okfn is still called. But I'd first like to get the IPv4/IPv6 fix for br_netfilter.c accepted (see another thread on netdev). cheers, Bart --- linux-2.6.10/include/linux/netfilter.h.old 2005-01-07 20:41:30.000000000 +0100 +++ linux-2.6.10/include/linux/netfilter.h 2005-01-07 22:04:57.096626176 +0100 @@ -138,21 +138,32 @@ void nf_log_packet(int pf, /* This is gross, but inline doesn't cut it for avoiding the function call in fast path: gcc doesn't inline (needs value tracking?). --RR */ #ifdef CONFIG_NETFILTER_DEBUG -#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) \ - nf_hook_slow((pf), (hook), (skb), (indev), (outdev), (okfn), INT_MIN) -#define NF_HOOK_THRESH nf_hook_slow +#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) \ +({int __ret = nf_hook_slow(pf, hook, &(skb), indev, outdev, okfn, INT_MIN); \ +if (!__ret) \ + __ret = (okfn)(skb); \ +__ret;}) +#define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh) \ +({int __ret = nf_hook_slow(pf, hook, &(skb), indev, outdev, okfn, thresh); \ +if (!__ret) \ + __ret = (okfn)(skb); \ +__ret;}) #else -#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) \ -(list_empty(&nf_hooks[(pf)][(hook)]) \ - ? (okfn)(skb) \ - : nf_hook_slow((pf), (hook), (skb), (indev), (outdev), (okfn), INT_MIN)) -#define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh) \ -(list_empty(&nf_hooks[(pf)][(hook)]) \ - ? (okfn)(skb) \ - : nf_hook_slow((pf), (hook), (skb), (indev), (outdev), (okfn), (thresh))) +#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) \ +({int __ret = 0; \ +if (list_empty(&nf_hooks[pf][hook]) || \ + !(__ret = nf_hook_slow(pf, hook, &(skb), indev, outdev, okfn, INT_MIN))) \ + __ret = (okfn)(skb); \ +__ret;}) +#define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh) \ +({int __ret = 0; \ +if (list_empty(&nf_hooks[pf][hook]) || \ + !(__ret = nf_hook_slow(pf, hook, &(skb), indev, outdev, okfn, thresh))) \ + __ret = (okfn)(skb); \ +__ret;}) #endif -int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb, +int nf_hook_slow(int pf, unsigned int hook, struct sk_buff **pskb, struct net_device *indev, struct net_device *outdev, int (*okfn)(struct sk_buff *), int thresh); --- linux-2.6.10/net/core/netfilter.c.old 2005-01-07 20:41:47.000000000 +0100 +++ linux-2.6.10/net/core/netfilter.c 2005-01-07 21:52:13.659686232 +0100 @@ -494,7 +494,7 @@ static int nf_queue(struct sk_buff *skb, return 1; } -int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb, +int nf_hook_slow(int pf, unsigned int hook, struct sk_buff **pskb, struct net_device *indev, struct net_device *outdev, int (*okfn)(struct sk_buff *), @@ -508,30 +508,28 @@ int nf_hook_slow(int pf, unsigned int ho rcu_read_lock(); #ifdef CONFIG_NETFILTER_DEBUG - if (skb->nf_debug & (1 << hook)) { + if ((*pskb)->nf_debug & (1 << hook)) { printk("nf_hook: hook %i already set.\n", hook); - nf_dump_skb(pf, skb); + nf_dump_skb(pf, *pskb); } skb->nf_debug |= (1 << hook); #endif elem = &nf_hooks[pf][hook]; next_hook: - verdict = nf_iterate(&nf_hooks[pf][hook], &skb, hook, indev, + verdict = nf_iterate(&nf_hooks[pf][hook], pskb, hook, indev, outdev, &elem, okfn, hook_thresh); if (verdict == NF_QUEUE) { NFDEBUG("nf_hook: Verdict = QUEUE.\n"); - if (!nf_queue(skb, elem, pf, hook, indev, outdev, okfn)) + if (!nf_queue(*pskb, elem, pf, hook, indev, outdev, okfn)) goto next_hook; } switch (verdict) { - case NF_ACCEPT: - ret = okfn(skb); - break; - case NF_DROP: - kfree_skb(skb); + kfree_skb(*pskb); + case NF_STOLEN: + case NF_QUEUE: ret = -EPERM; break; } From Robert.Olsson@data.slu.se Fri Jan 7 01:30:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 01:30:35 -0800 (PST) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j079UUV8010682 for ; Fri, 7 Jan 2005 01:30:31 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.12.10/8.12.10) with ESMTP id j07LUGuA020356; Fri, 7 Jan 2005 22:30:17 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 0A3C8EC1A0; Fri, 7 Jan 2005 22:30:17 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16862.65385.9009.742742@robur.slu.se> Date: Fri, 7 Jan 2005 22:30:17 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson , Stephen Hemminger Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501071506.57811.jeremy.guthrie@berbee.com> References: <200501031455.26980.jeremy.guthrie@berbee.com> <200501071414.05126.jeremy.guthrie@berbee.com> <16862.62424.180929.680029@robur.slu.se> <200501071506.57811.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13611 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > lnstat isn't giving me anything other than zeros. Crap. > entries in_hit in_slow_tot in_no_route in_brd in_martian_dst in_martian_src > out_hit out_slow_tot out_slow_mc gc_total gc_ignored gc_goal_miss > gc_dst_overflow in_hlist_search out_hlist_search > 0000f91e 15b1ddab 0b69a32c 00000000 00000000 00001b0a 00001fbd 00000000 > 00066f65 0000b943 00000000 087b80a1 0878e81a 00000256 00000000 ca08c77d > 0020e549 > 0000fb3e 15ff4696 0b6bbb65 00000000 00000000 00001b10 00001fc1 00000000 > 00067111 0000b974 00000000 087d9903 087b0003 00000256 00000000 cb58b399 > 0020ee79 85 kpps and 2287 lookups/sec as a 60 sec average. Pretty nice load yes. Where did you get the load? Try see if you fix lnstat :-) it would be nice to see the route dynamics. Or use the try the rtstat I pointed to. And apply the e1000 patch I sent and make a test run. I'll have a beer and give up for tonight... --ro From nacc@us.ibm.com Fri Jan 7 01:38:05 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 01:38:10 -0800 (PST) Received: from e1.ny.us.ibm.com (e1.ny.us.ibm.com [32.97.182.141]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j079bwaC011301 for ; Fri, 7 Jan 2005 01:38:05 -0800 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e1.ny.us.ibm.com (8.12.10/8.12.10) with ESMTP id j07Lbkvk021227 for ; Fri, 7 Jan 2005 16:37:46 -0500 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j07LbjaI261608 for ; Fri, 7 Jan 2005 16:37:45 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j07LbjZw011149 for ; Fri, 7 Jan 2005 16:37:45 -0500 Received: from joust (joust.beaverton.ibm.com [9.47.17.70]) by d01av02.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j07LbivG011118; Fri, 7 Jan 2005 16:37:45 -0500 Received: by joust (Postfix, from userid 1000) id 0E2874F966; Fri, 7 Jan 2005 13:37:44 -0800 (PST) Date: Fri, 7 Jan 2005 13:37:44 -0800 From: Nishanth Aravamudan To: cramerj@intel.com, john.ronciak@intel.com, ganesh.venkatesan@intel.com Cc: kernel-janitors@lists.osdl.org, linux-net@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH 6/28] net/e1000_osdep: replace schedule_timeout() with msleep() Message-ID: <20050107213744.GE2924@us.ibm.com> References: <20050107001931.GH3055@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050107001931.GH3055@us.ibm.com> X-Operating-System: Linux 2.6.10 (i686) User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13612 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nacc@us.ibm.com Precedence: bulk X-list: netdev On Thu, Jan 06, 2005 at 04:19:31PM -0800, Nishanth Aravamudan wrote: > Hi, > > Description: Use msleep() instead of schedule_timeout() to guarantee the task > delays as expected. > > Signed-off-by: Nishanth Aravamudan > > > --- 2.6.10-v/drivers/net/e1000/e1000_osdep.h 2004-12-24 13:34:26.000000000 -0800 > +++ 2.6.10/drivers/net/e1000/e1000_osdep.h 2005-01-04 14:57:49.000000000 -0800 > @@ -46,8 +46,7 @@ > /* Don't mdelay in interrupt context! */ \ > BUG(); \ > } else { \ > - set_current_state(TASK_UNINTERRUPTIBLE); \ > - schedule_timeout((x * HZ)/1000 + 2); \ > + msleep(x); > } } while(0) > /* Some workarounds require millisecond delays and are run during interrupt > * context. Most notably, when establishing link, the phy may need tweaking Please ignore this patch, as there is already a more correct one in the 2.6.10-kj patchset. Sorry for the noise. Thanks, Nish From romieu@fr.zoreil.com Fri Jan 7 01:45:00 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 01:45:06 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j079ixrB011893 for ; Fri, 7 Jan 2005 01:45:00 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.13.1/8.12.1) with ESMTP id j07Lh3Bf020175; Fri, 7 Jan 2005 22:43:03 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.13.1/8.13.1/Submit) id j07Lgs72020174; Fri, 7 Jan 2005 22:42:54 +0100 Date: Fri, 7 Jan 2005 22:42:54 +0100 From: Francois Romieu To: Matt Mackall Cc: Mark Broadbent , netdev@oss.sgi.com Subject: Re: Followup to netpoll issues Message-ID: <20050107214254.GA17317@electric-eye.fr.zoreil.com> References: <1105045914.7687.3.camel@tigger> <20050106234610.GT2940@waste.org> <20050107011547.GE27896@electric-eye.fr.zoreil.com> <20050107170118.GU2940@waste.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050107170118.GU2940@waste.org> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13613 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Matt Mackall : [...] > printk("debug: at point A"); > do_something_that_sends_a_packet_B(); > printk("debug: at point C"); > > Depending on locking and queueing, we might see on our network dump B, > A, C, and wrongly conclude that whatever did B was not between A and C. > That's a bad way for printk to work. I completely agree that it is not perfect. However netconsole is currently unable to guarantee that you will always see both A and B (currently = assuming the skb is dropped when netconsole fails trylock as suggested by Jamal). So there is an issue with the reliability of the delivery as well. I won't push harder on the queuing side as I believe that it will be possible to add it as an extra choice to the user whatever form netconsole takes to stop deadlocking. [...] > The bugs I'm talking about are identical to the xmit_lock deadlock > except with locks we can't see outside the driver. In other words, Right, it's clearer now. Thanks for the reminder. User space takes device's private lock -> printks -> netconsole.write -> hard_start_xmit -> device's private lock -> splat. Same thing from interrupt context (in_irq() can probably help though). So we ought to check rtnl_sem as well (dev_base_lock anyone ?). /me scratches neck... > this patch addresses the easy part of larger problem by adding a bunch > of complexity that doesn't help in the larger problem. To me, that's a > hint that it's the wrong fix. Too big. It won't bite. :o) [...] > > I am not convinced that people will be satisfied with a rule which > > states that printk _from anywhere_ are lost as soon as a CPU enters > > in the xmit_lock zone but, hey, it's just me. > > It should only be dropped on the CPU holding the lock, with a loud > warning to follow shortly. Sorry if I was not clear: "from anywhere" meant printk issued from any part of the kernel which can interrupt the xmit_locked section of a qdisc_run(), i.e. printk from irq handlers. If I read correctly the suggested design, the remaining CPUs should loop in netpoll_send_skb() when they notice that they can not take the lock and that their CPU do not own it, right ? -- Ueimor From pp@ee.oulu.fi Fri Jan 7 02:02:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 02:02:55 -0800 (PST) Received: from ee.oulu.fi (ee.oulu.fi [130.231.61.23]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j07A2mjn012767 for ; Fri, 7 Jan 2005 02:02:49 -0800 Received: from tk28.oulu.fi (tk28 [130.231.48.68]) by ee.oulu.fi (8.13.1/8.13.1) with ESMTP id j07M2Xk7006146; Sat, 8 Jan 2005 00:02:33 +0200 (EET) Received: (from pp@localhost) by tk28.oulu.fi (8.13.1/8.13.1/Submit) id j07M2X2B009993; Sat, 8 Jan 2005 00:02:33 +0200 (EET) Date: Sat, 8 Jan 2005 00:02:33 +0200 From: Pekka Pietikainen To: "David S. Miller" Cc: Andrew Morton , netdev@oss.sgi.com Subject: Re: Fw: b44 ifconfig fails with ENOMEM Message-ID: <20050107220233.GA9639@ee.oulu.fi> References: <20050103191836.57f918e5.akpm@osdl.org> <20050104142026.000be2e8.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20050104142026.000be2e8.davem@davemloft.net> User-Agent: Mutt/1.4.2i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13614 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pp@ee.oulu.fi Precedence: bulk X-list: netdev On Tue, Jan 04, 2005 at 02:20:26PM -0800, David S. Miller wrote: > On Mon, 3 Jan 2005 19:18:36 -0800 > Andrew Morton wrote: > > > b44 requires an order-8 allocation? Good luck... > > Yes, it allocates a full TX ring worth of bounce buffers > to work around a DMA addressing limitation. It should do > a bunch of smaller consistent allocations instead of one > huge one, that's for sure. -ENOHARDWARE (Santa got me an Athlon64 with dual GigE) so someone else will have to pick up the ball. Shouldn't be too difficult, quickly thinking something like: X-It-Compiles-Lets-Ship-It: pp@ee.oulu.fi --- ./b44.c.orig 2005-01-05 12:15:30.000000000 +0200 +++ ./b44.c 2005-01-08 00:00:49.974949992 +0200 @@ -68,6 +68,8 @@ (BP)->tx_cons - (BP)->tx_prod - TX_RING_GAP(BP)) #define NEXT_TX(N) (((N) + 1) & (B44_TX_RING_SIZE - 1)) +#define B44_BOUNCEBUF(ENTRY) (bp->tx_bufs[(ENTRY)&(B44_NUM_BOUNCEBUFS-1)]+((ENTRY)>>B44_BOUNCEBUF_SHIFT)*TX_PKT_BUF_SZ) + #define RX_PKT_BUF_SZ (1536 + bp->rx_offset + 64) #define TX_PKT_BUF_SZ (B44_MAX_MTU + ETH_HLEN + 8) @@ -927,8 +929,8 @@ if(mapping+len > B44_DMA_MASK) { /* Chip can't handle DMA to/from >1GB, use bounce buffer */ pci_unmap_single(bp->pdev, mapping, len,PCI_DMA_TODEVICE); - memcpy(bp->tx_bufs+entry*TX_PKT_BUF_SZ,skb->data,skb->len); - mapping = pci_map_single(bp->pdev, bp->tx_bufs+entry*TX_PKT_BUF_SZ, len, PCI_DMA_TODEVICE); + memcpy(B44_BOUNCEBUF(entry),skb->data,skb->len); + mapping = pci_map_single(bp->pdev, B44_BOUNCEBUF(entry), len, PCI_DMA_TODEVICE); } bp->tx_buffers[entry].skb = skb; @@ -1059,6 +1061,7 @@ */ static void b44_free_consistent(struct b44 *bp) { + int i; if (bp->rx_buffers) { kfree(bp->rx_buffers); bp->rx_buffers = NULL; @@ -1077,10 +1080,12 @@ bp->tx_ring, bp->tx_ring_dma); bp->tx_ring = NULL; } - if (bp->tx_bufs) { - pci_free_consistent(bp->pdev, B44_TX_RING_SIZE * TX_PKT_BUF_SZ, - bp->tx_bufs, bp->tx_bufs_dma); - bp->tx_bufs = NULL; + for(i = 0; i < B44_NUM_BOUNCEBUFS; i++) { + if (bp->tx_bufs[i]) { + pci_free_consistent(bp->pdev, B44_TX_RING_SIZE * TX_PKT_BUF_SZ / B44_NUM_BOUNCEBUFS, + bp->tx_bufs[i], bp->tx_bufs_dma[i]); + bp->tx_bufs[i] = NULL; + } } } @@ -1090,7 +1095,7 @@ */ static int b44_alloc_consistent(struct b44 *bp) { - int size; + int i,size; size = B44_RX_RING_SIZE * sizeof(struct ring_info); bp->rx_buffers = kmalloc(size, GFP_KERNEL); @@ -1104,11 +1109,13 @@ goto out_err; memset(bp->tx_buffers, 0, size); - size = B44_TX_RING_SIZE * TX_PKT_BUF_SZ; - bp->tx_bufs = pci_alloc_consistent(bp->pdev, size, &bp->tx_bufs_dma); - if (!bp->tx_bufs) + size = (B44_TX_RING_SIZE * TX_PKT_BUF_SZ) / B44_NUM_BOUNCEBUFS; + for(i = 0; i < B44_NUM_BOUNCEBUFS; i++) { + bp->tx_bufs[i] = pci_alloc_consistent(bp->pdev, size, &bp->tx_bufs_dma[i]); + if (!bp->tx_bufs[i]) goto out_err; - memset(bp->tx_bufs, 0, size); + memset(bp->tx_bufs[i], 0, size); + } size = DMA_TABLE_BYTES; bp->rx_ring = pci_alloc_consistent(bp->pdev, size, &bp->rx_ring_dma); --- ./b44.h.orig 2005-01-05 12:15:33.000000000 +0200 +++ ./b44.h 2005-01-07 23:53:07.234297264 +0200 @@ -359,6 +359,8 @@ }; #define B44_MCAST_TABLE_SIZE 32 +#define B44_BOUNCEBUF_SHIFT 3 +#define B44_NUM_BOUNCEBUFS (1 << B44_BOUNCEBUF_SHIFT) /* SW copy of device statistics, kept up to date by periodic timer * which probes HW values. Must have same relative layout as HW @@ -397,7 +399,7 @@ struct ring_info *rx_buffers; struct ring_info *tx_buffers; - unsigned char *tx_bufs; + unsigned char *tx_bufs[B44_NUM_BOUNCEBUFS]; u32 dma_offset; u32 flags; @@ -429,7 +431,8 @@ struct pci_dev *pdev; struct net_device *dev; - dma_addr_t rx_ring_dma, tx_ring_dma,tx_bufs_dma; + dma_addr_t rx_ring_dma, tx_ring_dma; + dma_addr_t tx_bufs_dma[B44_NUM_BOUNCEBUFS]; u32 rx_pending; u32 tx_pending; From oxymoron@waste.org Fri Jan 7 02:07:38 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 02:07:46 -0800 (PST) Received: from waste.org (waste.org [216.27.176.166]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j07A7c2E013381 for ; Fri, 7 Jan 2005 02:07:38 -0800 Received: from waste.org (localhost [127.0.0.1]) by waste.org (8.12.3/8.12.3/Debian-7.1) with ESMTP id j07M7NAT029795; Fri, 7 Jan 2005 16:07:23 -0600 Received: (from oxymoron@localhost) by waste.org (8.12.3/8.12.3/Debian-7.1) id j07M7NB8029792; Fri, 7 Jan 2005 16:07:23 -0600 Date: Fri, 7 Jan 2005 14:07:23 -0800 From: Matt Mackall To: Francois Romieu Cc: Mark Broadbent , netdev@oss.sgi.com Subject: Re: Followup to netpoll issues Message-ID: <20050107220723.GB2940@waste.org> References: <1105045914.7687.3.camel@tigger> <20050106234610.GT2940@waste.org> <20050107011547.GE27896@electric-eye.fr.zoreil.com> <20050107170118.GU2940@waste.org> <20050107214254.GA17317@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050107214254.GA17317@electric-eye.fr.zoreil.com> User-Agent: Mutt/1.3.28i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: by amavisd-new X-Virus-Status: Clean X-archive-position: 13615 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mpm@selenic.com Precedence: bulk X-list: netdev On Fri, Jan 07, 2005 at 10:42:54PM +0100, Francois Romieu wrote: > Matt Mackall : > [...] > > printk("debug: at point A"); > > do_something_that_sends_a_packet_B(); > > printk("debug: at point C"); > > > > Depending on locking and queueing, we might see on our network dump B, > > A, C, and wrongly conclude that whatever did B was not between A and C. > > That's a bad way for printk to work. > > I completely agree that it is not perfect. > > However netconsole is currently unable to guarantee that you will > always see both A and B (currently = assuming the skb is dropped > when netconsole fails trylock as suggested by Jamal). So there is > an issue with the reliability of the delivery as well. Indeed, and we can't really do much about it generally as we're on a lossy media. But I think that's less misleading than potential reordering. I acknowledge that packets can get reordered on the wire potentially as well but for typical LAN segments, this will be uncommon. > I won't push harder on the queuing side as I believe that it will > be possible to add it as an extra choice to the user whatever form > netconsole takes to stop deadlocking. I might be willing to compromise on a queue depth of one. Much simpler code, much less effort to paper over bugs that should be fixed in a different way. But then we've got to have a way to disable it for kgdb-over-ethernet or netdump, where the delayed work simply won't get processed because the box is stopped. Admittedly trying to trace your way into the network driver is asking for a beating here, but the general issue is that netpoll clients can stop interrupt processing and netpoll should tell such clients that the packets its trying to send aren't going anywhere rather than quietly scheduling them for later delivery, see? > [...] > > The bugs I'm talking about are identical to the xmit_lock deadlock > > except with locks we can't see outside the driver. In other words, > > Right, it's clearer now. Thanks for the reminder. > > User space takes device's private lock -> printks -> netconsole.write > -> hard_start_xmit -> device's private lock -> splat. Same thing from > interrupt context (in_irq() can probably help though). > > So we ought to check rtnl_sem as well (dev_base_lock anyone ?). > > /me scratches neck... > > > this patch addresses the easy part of larger problem by adding a bunch > > of complexity that doesn't help in the larger problem. To me, that's a > > hint that it's the wrong fix. > > Too big. It won't bite. :o) > > [...] > > > I am not convinced that people will be satisfied with a rule which > > > states that printk _from anywhere_ are lost as soon as a CPU enters > > > in the xmit_lock zone but, hey, it's just me. > > > > It should only be dropped on the CPU holding the lock, with a loud > > warning to follow shortly. > > Sorry if I was not clear: "from anywhere" meant printk issued from > any part of the kernel which can interrupt the xmit_locked section > of a qdisc_run(), i.e. printk from irq handlers. Hrmm. Yes, that's uglier than I realized. Perhaps there's a way to use the existing IRQ handler reentrancy avoidance to detect that we might be about to recurse on a lock. > If I read correctly the suggested design, the remaining CPUs should > loop in netpoll_send_skb() when they notice that they can not take > the lock and that their CPU do not own it, right ? Yep. -- Mathematics is the supreme nostalgia of our time. From jesse.brandeburg@intel.com Fri Jan 7 02:29:17 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 02:29:22 -0800 (PST) Received: from orsfmr004.jf.intel.com (fmr19.intel.com [134.134.136.18]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j07ATHXG014414 for ; Fri, 7 Jan 2005 02:29:17 -0800 Received: from orsfmr100.jf.intel.com (orsfmr100.jf.intel.com [10.7.209.16]) by orsfmr004.jf.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j07MSgNT026996; Fri, 7 Jan 2005 22:28:42 GMT Received: from nwlxmail01.jf.intel.com (nwlxmail01.jf.intel.com [10.7.171.40]) by orsfmr100.jf.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with ESMTP id j07MSgjH029328; Fri, 7 Jan 2005 22:28:42 GMT Received: from rickshaw.jf.intel.com (rickshaw.jf.intel.com [10.23.51.17]) by nwlxmail01.jf.intel.com (8.12.10/8.12.9/MailSET/Hub) with ESMTP id j07MSggP029871; Fri, 7 Jan 2005 14:28:42 -0800 Date: Fri, 7 Jan 2005 14:28:42 -0800 (PST) From: Jesse Brandeburg X-X-Sender: jbrandeb@localhost.localdomain To: "Jeremy M. Guthrie" cc: netdev@oss.sgi.com, Robert Olsson , Stephen Hemminger Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501071414.05126.jeremy.guthrie@berbee.com> Message-ID: ReplyTo: "Jesse Brandeburg" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13616 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jesse.brandeburg@intel.com Precedence: bulk X-list: netdev On Fri, 7 Jan 2005, Jeremy M. Guthrie wrote: > I just updated the Intel Drivers to the latest on source-forge(5.6.10.1). I > now see lower CPU usage but I am still dropping. > > During a 60 second window the machine received 5,110,164 packets and dropped > 20461 or roughly 0.4% packet loss. > NAPI will cause a very busy stack to force the network card to drop the data instead of the stack. This is supposed to be a good thing because the hardware will be forced to drop the packet (hopefully) instead of interrupt rate thrashing your machine right when it needs the cpu to do other stuff. This is supposed to be the saving grace of NAPI. So, not to distract from the conversation, but in the interest (my interest :-) ) of tuning your E1000, can you please send the output of ethtool -S ethX for each interface? This will help us figure out if there is anything to tune in the driver (like number of rx buffers, etc) Thanks, Jesse From romieu@fr.zoreil.com Fri Jan 7 02:45:00 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 02:45:05 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j07AiwAh017109 for ; Fri, 7 Jan 2005 02:44:59 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.13.1/8.12.1) with ESMTP id j07Mg0nO021246; Fri, 7 Jan 2005 23:42:00 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.13.1/8.13.1/Submit) id j07Mftbx021245; Fri, 7 Jan 2005 23:41:55 +0100 Date: Fri, 7 Jan 2005 23:41:55 +0100 From: Francois Romieu To: Matt Mackall Cc: Mark Broadbent , netdev@oss.sgi.com Subject: Re: Followup to netpoll issues Message-ID: <20050107224155.GB17317@electric-eye.fr.zoreil.com> References: <1105045914.7687.3.camel@tigger> <20050106234610.GT2940@waste.org> <20050107011547.GE27896@electric-eye.fr.zoreil.com> <20050107170118.GU2940@waste.org> <20050107214254.GA17317@electric-eye.fr.zoreil.com> <20050107220723.GB2940@waste.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050107220723.GB2940@waste.org> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13617 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Matt Mackall : [...] > > Sorry if I was not clear: "from anywhere" meant printk issued from > > any part of the kernel which can interrupt the xmit_locked section > > of a qdisc_run(), i.e. printk from irq handlers. > > Hrmm. Yes, that's uglier than I realized. > > Perhaps there's a way to use the existing IRQ handler reentrancy > avoidance to detect that we might be about to recurse on a lock. It would help if qdisc_restart() disabled irq until xmit_lock_owner is set (an extra memory barrier would be required btw). I'd say to go with in_irq() + try_lock() but one could object that try_lock() leaves a window where a late thread could steal the lock. -- Ueimor From jeremy.guthrie@berbee.com Fri Jan 7 02:51:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 02:51:19 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j07Ap9TE017680 for ; Fri, 7 Jan 2005 02:51:10 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Fri, 7 Jan 2005 16:50:57 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Fri, 7 Jan 2005 16:50:51 -0600 User-Agent: KMail/1.7.2 Cc: Jesse Brandeburg , Robert Olsson , Stephen Hemminger References: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3698898.e4CMkgbPaj"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501071650.56423.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 07 Jan 2005 22:50:57.0329 (UTC) FILETIME=[59CD5210:01C4F50B] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13618 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart3698898.e4CMkgbPaj Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Friday 07 January 2005 04:28 pm, Jesse Brandeburg wrote: > On Fri, 7 Jan 2005, Jeremy M. Guthrie wrote: > > I just updated the Intel Drivers to the latest on source-forge(5.6.10.1= ). > > I now see lower CPU usage but I am still dropping. > > > > During a 60 second window the machine received 5,110,164 packets and > > dropped 20461 or roughly 0.4% packet loss. > > NAPI will cause a very busy stack to force the network card to drop the > data instead of the stack. This is supposed to be a good thing because > the hardware will be forced to drop the packet (hopefully) instead of > interrupt rate thrashing your machine right when it needs the cpu to do > other stuff. This is supposed to be the saving grace of NAPI. Makes sense. > So, not to distract from the conversation, but in the interest (my > interest :-) ) of tuning your E1000, can you please send the output of > ethtool -S ethX for each interface? This will help us figure out if there > is anything to tune in the driver (like number of rx buffers, etc) ethtool -S eth2 NIC statistics: rx_packets: 0 tx_packets: 314550698 rx_bytes: 0 tx_bytes: 4290523139 rx_errors: 0 tx_errors: 0 rx_dropped: 0 tx_dropped: 0 multicast: 0 collisions: 0 rx_length_errors: 0 rx_over_errors: 0 rx_crc_errors: 0 rx_frame_errors: 0 rx_fifo_errors: 0 rx_missed_errors: 0 tx_aborted_errors: 0 tx_carrier_errors: 0 tx_fifo_errors: 0 tx_heartbeat_errors: 0 tx_window_errors: 0 tx_abort_late_coll: 0 tx_deferred_ok: 0 tx_single_coll_ok: 0 tx_multi_coll_ok: 0 rx_long_length_errors: 0 rx_short_length_errors: 0 rx_align_errors: 0 tx_tcp_seg_good: 0 tx_tcp_seg_failed: 0 rx_flow_control_xon: 0 rx_flow_control_xoff: 0 tx_flow_control_xon: 0 tx_flow_control_xoff: 0 rx_long_byte_count: 0 rx_csum_offload_good: 0 rx_csum_offload_errors: 0 ethtool -S eth3 NIC statistics: rx_packets: 719847127 tx_packets: 5 rx_bytes: 1880301945 tx_bytes: 398 rx_errors: 3368295 tx_errors: 0 rx_dropped: 1478044 tx_dropped: 0 multicast: 0 collisions: 0 rx_length_errors: 0 rx_over_errors: 0 rx_crc_errors: 0 rx_frame_errors: 0 rx_fifo_errors: 1890251 rx_missed_errors: 1890251 tx_aborted_errors: 0 tx_carrier_errors: 0 tx_fifo_errors: 0 tx_heartbeat_errors: 0 tx_window_errors: 0 tx_abort_late_coll: 0 tx_deferred_ok: 0 tx_single_coll_ok: 0 tx_multi_coll_ok: 0 rx_long_length_errors: 0 rx_short_length_errors: 0 rx_align_errors: 0 tx_tcp_seg_good: 0 tx_tcp_seg_failed: 0 rx_flow_control_xon: 0 rx_flow_control_xoff: 0 tx_flow_control_xon: 0 tx_flow_control_xoff: 0 rx_long_byte_count: 379837423993 rx_csum_offload_good: 672891990 rx_csum_offload_errors: 178666 > Thanks, > Jesse =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart3698898.e4CMkgbPaj Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB3xJQqtjaBHGZBeURAnqnAJ4u5AYcsqHQbD3fiintw+AZ9jKleACgkXpd s7D1duGwiCPoROghnbOC0PY= =MiFq -----END PGP SIGNATURE----- --nextPart3698898.e4CMkgbPaj-- From shemminger@osdl.org Fri Jan 7 02:57:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 02:57:31 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j07AvPpa018283 for ; Fri, 7 Jan 2005 02:57:25 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j07MvAd11436; Fri, 7 Jan 2005 14:57:10 -0800 Date: Fri, 7 Jan 2005 14:57:11 -0800 From: Stephen Hemminger To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Jesse Brandeburg , Robert Olsson Subject: Re: V2.4 policy router operates faster/better than V2.6 Message-ID: <20050107145711.367aa159@dxpl.pdx.osdl.net> In-Reply-To: <200501071650.56423.jeremy.guthrie@berbee.com> References: <200501071650.56423.jeremy.guthrie@berbee.com> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13619 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev On Fri, 7 Jan 2005 16:50:51 -0600 "Jeremy M. Guthrie" wrote: > On Friday 07 January 2005 04:28 pm, Jesse Brandeburg wrote: > > On Fri, 7 Jan 2005, Jeremy M. Guthrie wrote: > > > I just updated the Intel Drivers to the latest on source-forge(5.6.10.1). > > > I now see lower CPU usage but I am still dropping. > > > > > > During a 60 second window the machine received 5,110,164 packets and > > > dropped 20461 or roughly 0.4% packet loss. > > > > NAPI will cause a very busy stack to force the network card to drop the > > data instead of the stack. This is supposed to be a good thing because > > the hardware will be forced to drop the packet (hopefully) instead of > > interrupt rate thrashing your machine right when it needs the cpu to do > > other stuff. This is supposed to be the saving grace of NAPI. > Makes sense. Not sure if NAPI makes sense on transmit because it causes the transmit ring to grow and freeing the transmit skb should be quick. Perhaps other interrupt moderation schemes work better. On receive the processing could take longer and NAPI is a real win. From romieu@fr.zoreil.com Fri Jan 7 03:21:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 03:21:07 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j07BL0kK019437 for ; Fri, 7 Jan 2005 03:21:01 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.13.1/8.12.1) with ESMTP id j07NIKmU021959; Sat, 8 Jan 2005 00:18:20 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.13.1/8.13.1/Submit) id j07NIFrY021958; Sat, 8 Jan 2005 00:18:15 +0100 Date: Sat, 8 Jan 2005 00:18:15 +0100 From: Francois Romieu To: Mark Broadbent Cc: Matt Mackall , netdev@oss.sgi.com Subject: Re: Followup to netpoll issues Message-ID: <20050107231815.GC17317@electric-eye.fr.zoreil.com> References: <1105045914.7687.3.camel@tigger> <20050107002053.GD27896@electric-eye.fr.zoreil.com> <1105128887.3814.20.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1105128887.3814.20.camel@localhost> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13620 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Mark Broadbent : [...] > No need, if netpoll_cleanup is called whilst a retry is pending the tx > list lock is taken. All the references to the netpoll pointer are > deleted from the pending list before the lock is released. I may be a bit dense but: t0 : tx_retry_wq().queue_delayed_work(tx_wq, &tx_wq_obj, HZ/100); t0 + 10*HZ/1000: tx_retry_wq() is done (it was not fast for sure) t0 + 20*HZ/1000: netpoll_cleanup() + module removal t0 + HZ/100 : tx_retry_wq() <- Where are its code and data ? [...] > > However netpoll_send_skb can be called through: > > netpoll_rx -> arp_reply -> netpoll_send_skb > > Here I fail to see why netpoll_cleanup could not happen at the same time > > and issue np->dev = NULL; > > Could this solved by having a per netpoll structure rw_lock to protect > against changing elements in the structure? > > e.g. > struct netpoll { > ... > rwlock_t netpoll_lock; > }; > > write_lock_irqsave(&np->netpoll_lock, flags); > np->dev = NULL; > write_unlock_irqsave(&np->netpoll_lock, flags); I am not sure that a fine coarsed lock is necessary since there will mostly be readers and netpoll_cleanup should be rare. [...] > Is it safe to issue spin_lock_irqsave/spin_unlock_restore in this > context? Reason: What if it wasn't netconsole calling netpoll_send_udp > and not with local interrupts disabled? The irq state is saved and restored. Did I get the question right ? [...] > I've attached a revised version. > > Thanks for you comments (and Matts) The malloc() in netpoll_send_skb() is heavy-weight and it is not that uncommon to fail allocation in network context: preallocate when the np is first set up. It will make netpoll_send_skb() lighter. Issue schedule_delayed_work() in netpoll_send_skb() only if when the task is not already scheduled ? It is an information you can get/set while tx_list_lock is taken. I'll read the patch (or any updated version) more closely once I have recovered my sleep quota. It should not be too hard to isolate the queueing specific stuff from the real fixes. -- Ueimor From jesse.brandeburg@intel.com Fri Jan 7 03:23:39 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 03:23:45 -0800 (PST) Received: from orsfmr003.jf.intel.com (fmr18.intel.com [134.134.136.17]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j07BNdCC019943 for ; Fri, 7 Jan 2005 03:23:39 -0800 Received: from orsfmr100.jf.intel.com (orsfmr100.jf.intel.com [10.7.209.16]) by orsfmr003.jf.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j07NN6ET011929; Fri, 7 Jan 2005 23:23:06 GMT Received: from nwlxmail01.jf.intel.com (nwlxmail01.jf.intel.com [10.7.171.40]) by orsfmr100.jf.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with ESMTP id j07NN6jH005583; Fri, 7 Jan 2005 23:23:06 GMT Received: from rickshaw.jf.intel.com (rickshaw.jf.intel.com [10.23.51.17]) by nwlxmail01.jf.intel.com (8.12.10/8.12.9/MailSET/Hub) with ESMTP id j07NN3gP000422; Fri, 7 Jan 2005 15:23:05 -0800 Date: Fri, 7 Jan 2005 15:23:03 -0800 (PST) From: Jesse Brandeburg X-X-Sender: jbrandeb@localhost.localdomain To: "Jeremy M. Guthrie" cc: "Brandeburg, Jesse" , , , Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501071619.54566.jeremy.guthrie@berbee.com> Message-ID: ReplyTo: "Jesse Brandeburg" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13621 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jesse.brandeburg@intel.com Precedence: bulk X-list: netdev On Fri, 7 Jan 2005, Jeremy M. Guthrie wrote: > > Very interesting that with your workload the napi driver doesn't keep up > > (from looking at your posts in netdev) and yet the interrupt mode driver > > can. > Well, I need to do more digging. One scenario the interrupt mode can hand > stuff off to the CPU but the network stack still drops. The other scenario, > the card drops. > > ethtool -S eth2 > NIC statistics: > tx_packets: 314550698 > tx_bytes: 4290523139 > ethtool -S eth3 > NIC statistics: > rx_packets: 719847127 > tx_packets: 5 > rx_bytes: 1880301945 > tx_bytes: 398 > rx_errors: 3368295 > rx_dropped: 1478044 > rx_fifo_errors: 1890251 > rx_missed_errors: 1890251 > rx_long_byte_count: 379837423993 > rx_csum_offload_good: 672891990 > rx_csum_offload_errors: 178666 Okay, well, rx_dropped means "receive no buffers count" in our driver, but doesn't necessarily mean that the packet was completely dropped it just means that the fifo may have had to queue up the packet on the adapter as best it could and wait for the OS to provide more skb's, this may or may not lead to further errors... Now, the rx_fifo errors is from hardware counter "missed packet count" which means that a packet was dropped because the fifo was full (probably indicated at least some of the time because the card was in "receive no buffers" state) btw fifo errors and rx_missed are both being fed by the same hardware counter. rx_csum_offload_errors is somewhat worrisome because it means that you're receiving packets that appear to be corrupted. This could be from any number of sources, but is most likely a misconfigured station on your lan or something is corrupting checksums (a tcpdump would help debug here, but would really slow things down) The packets are NOT dropped, but handed to the stack to decide what to do. So, to mitigate the rnbc "receive no buffers count" a little you can provide some more buffering on the receive side by loading the module with RxDescriptors=2048 or something larger than the default of 256. this will help (if you haven't already) but will also probably increase the amount of work your system has to do, as more packets will be able to be stored up. From herbert@gondor.apana.org.au Fri Jan 7 07:27:05 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 07:27:13 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j07FR3lP032426 for ; Fri, 7 Jan 2005 07:27:05 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1Cn7FB-0006eQ-00; Sat, 08 Jan 2005 14:26:25 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1Cn7DB-0000O6-00; Sat, 08 Jan 2005 14:24:21 +1100 Date: Sat, 8 Jan 2005 14:24:21 +1100 To: "YOSHIFUJI Hideaki / ?$B5HF#1QL@" Cc: jgarzik@pobox.com, davem@davemloft.net, netdev@oss.sgi.com Subject: Re: [RFC PATCH] Fix double dereference (Re: IPv6 badness continues) Message-ID: <20050108032421.GA1427@gondor.apana.org.au> References: <41DA3A60.8050102@pobox.com> <20050107.111806.27181187.yoshfuji@linux-ipv6.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050107.111806.27181187.yoshfuji@linux-ipv6.org> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13622 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev On Fri, Jan 07, 2005 at 11:18:06AM +0900, YOSHIFUJI Hideaki / ?$B5HF#1QL@ wrote: > > I think we should NOT release refcnt in sk_dst_check() (or its variants) > even we return NULL because that reference was held for sk->dst_cache > and it is available yet. Instead, we should release refcnt when we > really reset the dst in sk_dst_reset() (or its variants). > (Alternatively, we may always set sk->dst_cache to NULL and release > refcnt when we're about to return NULL in sk_dst_check() > (or its variants).) I think the current approach is safe. The reason is that sk_dst_cache has its own reference which gets dropped in __sk_dst_reset. So even though ip6_dst_check has dropped a refcnt, it should not hit zero unless there is a bug somewhere else. > ===== net/decnet/dn_route.c 1.29 vs edited ===== > --- 1.29/net/decnet/dn_route.c 2004-11-10 09:44:25 +09:00 > +++ edited/net/decnet/dn_route.c 2005-01-04 17:14:01 +09:00 > @@ -253,7 +253,6 @@ > */ > static struct dst_entry *dn_dst_check(struct dst_entry *dst, __u32 cookie) > { > - dst_release(dst); > return NULL; > } This patch is not going to work unless you drop the refcnt somewhere else. This refcnt is the one given by the caller of sk_dst_check. So someone needs to drop it. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From herbert@gondor.apana.org.au Fri Jan 7 08:27:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 08:27:10 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j07GR10S005168 for ; Fri, 7 Jan 2005 08:27:02 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1Cn8BO-0006xD-00; Sat, 08 Jan 2005 15:26:34 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1Cn8A1-0000Vv-00; Sat, 08 Jan 2005 15:25:09 +1100 Date: Sat, 8 Jan 2005 15:25:09 +1100 To: Jeff Garzik Cc: Netdev , YOSHIFUJI Hideaki / ???????????? Subject: Re: IPv6 badness continues Message-ID: <20050108042509.GA1959@gondor.apana.org.au> References: <41DA3A60.8050102@pobox.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="/04w6evG8XlLl3ft" Content-Disposition: inline In-Reply-To: <41DA3A60.8050102@pobox.com> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13623 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev --/04w6evG8XlLl3ft Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jan 04, 2005 at 01:40:32AM -0500, Jeff Garzik wrote: > > This problem seems to be appearing much sooner, in 2.6.10 and 2.6.10-bk > kernels. Herbert, your patch did not apply to recent kernels, so I did > not boot with it. Here is that patch rediffed against the current bk. BTW, I'd like to access the machine with the problem. However, in order for it to be useful I also need access to the build directory of your kernel so that I can match things up. Please mail me privately to set it up. Thanks, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --/04w6evG8XlLl3ft Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== net/ipv6/route.c 1.102 vs edited ===== --- 1.102/net/ipv6/route.c 2004-11-30 14:24:46 +11:00 +++ edited/net/ipv6/route.c 2005-01-08 15:23:24 +11:00 @@ -379,6 +379,7 @@ int err; write_lock_bh(&rt6_lock); + WARN_ON(rt->u.dst->obsolete); err = fib6_add(&ip6_routing_table, rt, nlh, _rtattr); write_unlock_bh(&rt6_lock); --/04w6evG8XlLl3ft-- From linux_lover2004@yahoo.com Fri Jan 7 09:37:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 09:37:59 -0800 (PST) Received: from web52205.mail.yahoo.com (web52205.mail.yahoo.com [206.190.39.87]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j07Hbskk007430 for ; Fri, 7 Jan 2005 09:37:54 -0800 Received: (qmail 46080 invoked by uid 60001); 8 Jan 2005 05:37:41 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=BxynCDyh2rbTc3Dg1lqNIUl+Tq6jckg7uyRgIRBuc2UsfkQtg9saXht/WzVOCIjsR87MCqOnjiMe21cQWBSfDYQcgM/BM79Xmo75h+I3ch/sSstbuLlrTWQSmznfs560Vw7j16+tUInUg4GQo43e+UBCl19tZbj9hcy56RewF0k= ; Message-ID: <20050108053741.46078.qmail@web52205.mail.yahoo.com> Received: from [203.199.141.99] by web52205.mail.yahoo.com via HTTP; Fri, 07 Jan 2005 21:37:41 PST Date: Fri, 7 Jan 2005 21:37:41 -0800 (PST) From: linux lover Subject: how IPSEC header is created in xfrm in kernel 2.6.9??? To: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13624 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: linux_lover2004@yahoo.com Precedence: bulk X-list: netdev Hello, Can anybody help me How IpSec calls occurred in Linux kernel 2.6.9. I want to know actually how packet forms AFTER APPLYING ESP/UDP to Forming Normal UDP Packet in Linux Kernel. Please anybody provide me packet path in XFRM to form IPSEC header on packet. Thanks in advance. regards, linux_lover __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From herbert@gondor.apana.org.au Fri Jan 7 14:38:00 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 14:38:09 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j07Mbw1Y018003 for ; Fri, 7 Jan 2005 14:38:00 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CnDyL-00014K-00; Sat, 08 Jan 2005 21:37:30 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CnDxp-00015B-00; Sat, 08 Jan 2005 21:36:57 +1100 From: Herbert Xu To: raivis@mt.lv (Raivis Bucis) Subject: Re: [PATCH 2.4] Bugfix in neigh_create Cc: netdev@oss.sgi.com, davem@davemloft.net Organization: Core In-Reply-To: <200501071452.29006.raivis@mt.lv> X-Newsgroups: apana.lists.os.linux.netdev User-Agent: tin/1.7.4-20040225 ("Benbecula") (UNIX) (Linux/2.4.27-hx-1-686-smp (i686)) Message-Id: Date: Sat, 08 Jan 2005 21:36:57 +1100 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13625 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Raivis Bucis wrote: > > I believe that there is a bug in neigh_create in linux-2.4.28 introduced by > neighbor cache backport from v2.6.9. Yes you're right. Unfortunately your patch's been broken by your mailer. Can you please resend it to davem as an attachment? Thanks, > diff -uNr linux-2.4.28.org/net/core/neighbour.c > linux-2.4.28/net/core/neighbour.c > --- linux-2.4.28.org/net/core/neighbour.c 2004-11-17 13:54:22.000000000 +0200 > +++ linux-2.4.28/net/core/neighbour.c 2005-01-07 14:11:57.000000000 +0200 > @@ -427,11 +427,12 @@ > > n->confirmed = jiffies - (n->parms->base_reachable_time<<1); > > - hash_val = tbl->hash(pkey, dev) & tbl->hash_mask; > - > write_lock_bh(&tbl->lock); > if (atomic_read(&tbl->entries) > (tbl->hash_mask + 1)) > neigh_hash_grow(tbl, (tbl->hash_mask + 1) << 1); > + > + hash_val = tbl->hash(pkey, dev) & tbl->hash_mask; > + > for (n1 = tbl->hash_buckets[hash_val]; n1; n1 = n1->next) { > if (dev == n1->dev && > memcmp(n1->primary_key, pkey, key_len) == 0) { -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From pb@bieringer.de Fri Jan 7 15:45:32 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 15:45:42 -0800 (PST) Received: from smtp2.aerasec.de (gromit.aerasec.de [195.226.187.57]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j07NjUCn020081 for ; Fri, 7 Jan 2005 15:45:31 -0800 Received: from localhost (localhost [127.0.0.1]) by smtp2.aerasec.de (Postfix) with SMTP id 20AE1137EE; Sat, 8 Jan 2005 12:45:21 +0100 (CET) X-AV-Checked: Sat Jan 8 12:45:21 2005 smtp2.aerasec.de Received: from [192.168.1.2] (pD950FC6F.dip.t-dialin.net [217.80.252.111]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client did not present a certificate) by smtp2.aerasec.de (Postfix) with ESMTP id 925A4137EA; Sat, 8 Jan 2005 12:45:15 +0100 (CET) Date: Sat, 08 Jan 2005 12:45:14 +0100 From: Peter Bieringer To: usagi-users@linux-ipv6.org Cc: yasuyuki.kozakai@toshiba.co.jp, netdev@oss.sgi.com, laforge@gnumonks.org, kaber@trash.net, netfilter-devel@lists.netfilter.org Subject: Re: (usagi-users 03180) Re: netfilter6: ICMPv6 type 143 doesn't match Message-ID: In-Reply-To: <20041227.100205.102356251.yoshfuji@linux-ipv6.org> References: <6050E336B1A0D7D8E70C66F3@t1mobil.muc.aerasec.de> <200412270417.iBR4HZRG021429@toshiba.co.jp> <20041227.100205.102356251.yoshfuji@linux-ipv6.org> X-Mailer: Mulberry/3.1.6 (Linux/x86) X-URL: http://www.bieringer.de/pb/ X-OS: Linux MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13626 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pb@bieringer.de Precedence: bulk X-list: netdev --On Monday, December 27, 2004 10:02:05 AM +0100 "YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?=" wrote: > In article <200412270417.iBR4HZRG021429@toshiba.co.jp> (at Mon, 27 Dec > 2004 13:17:34 +0900 (JST)), Yasuyuki Kozakai > says: > >> >> - ptr = IPV6_HDR_LEN; >> + ptr = ((u8*)skb->nh.ipv6h - skb->data) + IPV6_HDR_LEN; >> > > IMHO, skb->nh.ipv6h does not points ipv6 header anymore; > it should be skb->nh.raw in this case. > > --yoshfuji I use following patch now: --- net/ipv6/netfilter/ip6_tables.c.orig 2005-01-07 10:14:08.928948139 +0100 +++ net/ipv6/netfilter/ip6_tables.c 2005-01-07 10:14:54.373283422 +0100 @@ -220,7 +220,7 @@ u_int16_t ptr; /* Header offset in skb */ u_int16_t hdrlen; /* Header */ - ptr = IPV6_HDR_LEN; + ptr = ((u8*)skb->nh.raw - skb->data) + IPV6_HDR_LEN; while (ip6t_ext_hdr(currenthdr)) { /* Is there enough space for the next ext header? */ But it won't help :-(( Current results: ======================= OK/Packet matches rule: 1410 147K ACCEPT icmpv6 * * ::/0 ::/0 ipv6-icmp type 128 12:17:47.666912 2001:6f8:800:1003::2 > 2001:6f8:900:*::*: icmp6: echo request seq 31744 0x0000: 6000 0000 0040 3a40 2001 06f8 0800 1003 `....@:@........ 0x0010: 0000 0000 0000 0002 2001 06f8 0900 **** ................ 0x0020: **** **** **** **** 8000 5c69 2c49 7c00 ..........\i,I|. 0x0030: 0400 0000 5bc1 df41 cc41 0000 0000 0000 ....[..A.A...... 0x0040: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0050: 0000 0000 0000 0000 0000 0000 0000 0000 ................ 0x0060: 0000 0000 0000 0000 ........ ======================= Problem/Packet does not match rule: 0 0 ACCEPT icmpv6 * * fe80::/10 ff02::1/128 ipv6-icmp type 130 HL match HL == 1 12:40:48.484375 fe80::****:**** > ff02::1: HBH (rtalert: 0x0000) (padn)[icmp6 sum ok] icmp6: multicast listener query max resp delay: 2000 addr: :: [hlim 1] (len 36) 0x0000: 6000 0000 0024 0001 fe80 0000 0000 0000 `....$.......... 0x0010: 0000 0000 **** **** ff02 0000 0000 0000 ................ 0x0020: 0000 0000 0000 0001 3a00 0502 0000 0100 ........:....... 0x0030: 8200 a03a 07d0 0000 0000 0000 0000 0000 ...:............ 0x0040: 0000 0000 0000 0000 027d 0000 .........}.. Jan 8 12:19:58 *** kernel: default-drop-extIN:IN=sit1 OUT= MAC=**:**:**:**:**:**->**:**:**:**:**:** TUNNEL=212.224. 0.188->217. 80.***.*** SRC=fe80:0000:0000:0000:0000:0000:****:**** DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=76 TC=0 HOPLIMIT=1 FLOWLBL=0 OPT ( ) PROTO=ICMPv6 TYPE=130 CODE=0 ======================= Problem/Packet does not match rule: 0 0 ACCEPT icmpv6 * * fe80::/10 ff02::16/128 ipv6-icmp type 143 HL match HL == 1 12:42:42.046741 fe80::200:**ff:fe**:**** > ff02::16: HBH (rtalert: 0x0000) (padn)[icmp6 sum ok] icmp6: type-#143 [hlim 1] (len 56) 0x0000: 6000 0000 0038 0001 fe80 0000 0000 0000 `....8.......... 0x0010: 0200 **ff fe** **** ff02 0000 0000 0000 .....*.......... 0x0020: 0000 0000 0000 0016 3a00 0502 0000 0100 ........:....... 0x0030: 8f00 a1d9 0000 0002 0300 0000 ff02 0000 ................ 0x0040: 0000 0000 0000 0000 0001 0002 0300 0000 ................ 0x0050: ff05 0000 0000 0000 0000 0000 0001 0003 ................ Jan 8 12:24:37 gate kernel: default-drop-intOUT:IN= OUT=eth0 SRC=fe80:0000:0000:0000:0200:**ff:fe**:**** DST=ff02:0000:0000:0000:0000:0000:0000:0016 LEN=96 TC=0 HOPLIMIT=1 FLOWLBL=0 OPT ( ) PROTO=ICMPv6 TYPE=143 CODE=0 It looks like that all packets with a Hop-By-Hop Option header causes problems at the moment. I would be glad, if someone can more dig into and provide me patches for kernel and probably also for tcpdump. Note also that kernel doesn't log the options, is this a bug or a missing feature? Thank you very much, Peter -- Dr. Peter Bieringer http://www.bieringer.de/pb/ GPG/PGP Key 0x958F422D mailto: pb at bieringer dot de Deep Space 6 Co-Founder and Core Member http://www.deepspace6.net/ From mikikimimikiki@yahoo.co.jp Fri Jan 7 16:44:40 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 16:44:46 -0800 (PST) Received: from www3.loops.jp (www3.loops.jp [210.189.77.213]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j080ickq025105 for ; Fri, 7 Jan 2005 16:44:39 -0800 Received: from [127.0.0.1] (usen-221x242x148x154.ap-US01.usen.ad.jp [221.242.148.154]) by www3.loops.jp (8.11.6/3.7WPOP-auth 04100511) with ESMTP id j08CiGn11078; Sat, 8 Jan 2005 21:44:16 +0900 Date: Fri, 07 Jan 2005 21:43:14 +0900 From: =?ISO-2022-JP?B?GyRCJF8kLRsoQg==?= To: mikikimimikiki@yahoo.co.jp Subject: =?ISO-2022-JP?B?GyRCJGQkQyRbJCkkKSQpJCkkKSQpJCkkKRsoQg==?= =?ISO-2022-JP?B?GyRCJCkhKiEqISozUCQoJEYkayQrJEohKRsoQg==?= Message-Id: <20050107213756.8DD0.MIKIKIMIMIKIKI@yahoo.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-2022-JP" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.12.01 [ja] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13627 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mikikimimikiki@yahoo.co.jp Precedence: bulk X-list: netdev $B$_$-$@$h$)$)"v$C$F$+K:$l$A$c$C$?$+$J$!!)!*(B $B$^$!$$$$$d#w$3$3:G6aO"Mm$J$+$C$?$+$i!"$_$-$+$iO"Mm$7$A$c$C$?$!!y(B $B$o$C$+$k$C$+$J$C!)$o$C$+$k$C$+$J$C!)(B $B$^$!$o$+$i$J$+$C$?$i From advertiser@localhost.localdomain Fri Jan 7 18:52:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 18:52:12 -0800 (PST) Received: from localhost.localdomain ([82.201.181.227]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j082q6FV028244 for ; Fri, 7 Jan 2005 18:52:07 -0800 Received: from localhost.localdomain (admin3 [127.0.0.1]) by localhost.localdomain (8.12.8/8.12.8) with ESMTP id j08K6d0C032649 for ; Sat, 8 Jan 2005 22:07:20 +0200 Received: (from advertiser@localhost) by localhost.localdomain (8.12.8/8.12.8/Submit) id j08K67QD032392 for netdev@oss.sgi.com; Sat, 8 Jan 2005 22:06:08 +0200 Date: Sat, 8 Jan 2005 22:06:08 +0200 From: advertiser@advertise.com Message-Id: <200501082006.j08K67QD032392@localhost.localdomain> To: netdev@oss.sgi.com Subject: Cheap Prices NOT Cheap Hosting X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13628 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: advertiser@advertise.com Precedence: bulk X-list: netdev .HellO... ------------------------------------------------------------ ############################################################## $ Visit http://www.mkhoster.com For Very Good Hosting Offer $ $ Chosse from our Linux and Windows servers $ $--- Cpanel/helm $ $--- PHP-ASP-ASP.net-JSP $ $--- CGI-perl $ $--- Mysql-Access-MS sqlserver 2000 $ $--- And MORE ....... $ ############################################################## FOR MORE INFORMATIONS -----< http://mkhoster.com/support.html >----- ************************************************************** From tgraf@suug.ch Fri Jan 7 18:54:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 18:54:51 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j082sjGP028644 for ; Fri, 7 Jan 2005 18:54:46 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 70A81F; Sat, 8 Jan 2005 15:54:14 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id D868E1C0EA; Sat, 8 Jan 2005 15:54:57 +0100 (CET) Date: Sat, 8 Jan 2005 15:54:57 +0100 From: Thomas Graf To: jamal Cc: netdev@oss.sgi.com Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier Message-ID: <20050108145457.GZ26856@postel.suug.ch> References: <20050103125635.GB26856@postel.suug.ch> <20050104223612.GN26856@postel.suug.ch> <1104894728.1117.56.camel@jzny.localdomain> <20050105110048.GO26856@postel.suug.ch> <1104931991.1117.152.camel@jzny.localdomain> <20050105144514.GQ26856@postel.suug.ch> <1105019225.2312.7.camel@jzny.localdomain> <20050106194102.GW26856@postel.suug.ch> <1105105511.1046.77.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1105105511.1046.77.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13629 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1105105511.1046.77.camel@jzny.localdomain> 2005-01-07 08:45 > > 3) Fill out a pkt_info struct with ptr and off2 so we don't lose > > hashing capabilities > > And this is why i dont like it. What's the reason for not liking it? I know it's not a perfect solution in terms of layers but having the classifier sharing already gathered information to an ematch is not a bad thing. > I think the u32 changes are one-shot if you want to avoid lotsa #ifdefs. > Someone sends you a old sel, then convert it to a new one for storage. > Dumping is a little trickier, need some way to recognize old style > request. The easiest way is to introduce a new TLV type and regard configuration requests carrying the old type in compatibility mode. > The trick would be to always use sel2 and present no kconfig options for back > compat. We need to figure out how to recognize an old style dump and we are > set. Given we always use the new method by converting old style parameters and we use em_u32 as u32 key we would need to put a dependcy on ematch && em_u32 for cls_u32. > Above you are trying to insert off2 into the info (what i said i didnt > like) - how are you going to achieve the same with a standalone en_u32 > from say you basic classifier? I won't and it's not necessary, one can use u32 if he requires the nexthdr capabilities or otherwise use em_cmp support the skb layers. (Which i know is not perfect since the pointers to those layers are not provided all the time). From jgarzik@pobox.com Fri Jan 7 21:24:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 21:24:52 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j085OkoR003184 for ; Fri, 7 Jan 2005 21:24:46 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CnKKK-0003d7-W7; Sat, 08 Jan 2005 17:24:37 +0000 Message-ID: <41E01746.3080501@pobox.com> Date: Sat, 08 Jan 2005 12:24:22 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Herbert Xu CC: Netdev , YOSHIFUJI Hideaki / ???????????? Subject: Re: IPv6 badness continues References: <41DA3A60.8050102@pobox.com> <20050108042509.GA1959@gondor.apana.org.au> In-Reply-To: <20050108042509.GA1959@gondor.apana.org.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13630 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Herbert Xu wrote: > ===== net/ipv6/route.c 1.102 vs edited ===== > --- 1.102/net/ipv6/route.c 2004-11-30 14:24:46 +11:00 > +++ edited/net/ipv6/route.c 2005-01-08 15:23:24 +11:00 > @@ -379,6 +379,7 @@ > int err; > > write_lock_bh(&rt6_lock); > + WARN_ON(rt->u.dst->obsolete); > err = fib6_add(&ip6_routing_table, rt, nlh, _rtattr); > write_unlock_bh(&rt6_lock); still broken: net/ipv6/route.c: In function `ip6_ins_rt': net/ipv6/route.c:382: error: invalid type argument of `->' From jgarzik@pobox.com Fri Jan 7 21:30:24 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 21:30:28 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j085UNeq003730 for ; Fri, 7 Jan 2005 21:30:24 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CnKPm-0003i0-Vs; Sat, 08 Jan 2005 17:30:15 +0000 Message-ID: <41E01899.9020902@pobox.com> Date: Sat, 08 Jan 2005 12:30:01 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ganesh Venkatesan CC: Netdev Subject: Re: [PATCH linux-2.6.10 17/17] ixgb: White space corrections References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13631 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev applied ixgb patches 1-17 to 2.6.x successfully, thanks for your patience. From herbert@gondor.apana.org.au Fri Jan 7 22:38:14 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 07 Jan 2005 22:38:22 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j086cDox005434 for ; Fri, 7 Jan 2005 22:38:13 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CnLT6-0004bu-00; Sun, 09 Jan 2005 05:37:44 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CnLRC-00057g-00; Sun, 09 Jan 2005 05:35:46 +1100 Date: Sun, 9 Jan 2005 05:35:45 +1100 To: Jeff Garzik Cc: Netdev , YOSHIFUJI Hideaki / ???????????? Subject: Re: IPv6 badness continues Message-ID: <20050108183545.GA6413@gondor.apana.org.au> References: <41DA3A60.8050102@pobox.com> <20050108042509.GA1959@gondor.apana.org.au> <41E01746.3080501@pobox.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="cNdxnHkX5QqsyA0e" Content-Disposition: inline In-Reply-To: <41E01746.3080501@pobox.com> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13632 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Jan 08, 2005 at 12:24:22PM -0500, Jeff Garzik wrote: > Herbert Xu wrote: > >===== net/ipv6/route.c 1.102 vs edited ===== > >--- 1.102/net/ipv6/route.c 2004-11-30 14:24:46 +11:00 > >+++ edited/net/ipv6/route.c 2005-01-08 15:23:24 +11:00 > >@@ -379,6 +379,7 @@ > > int err; > > > > write_lock_bh(&rt6_lock); > >+ WARN_ON(rt->u.dst->obsolete); > > err = fib6_add(&ip6_routing_table, rt, nlh, _rtattr); > > write_unlock_bh(&rt6_lock); > > still broken: > > net/ipv6/route.c: In function `ip6_ins_rt': > net/ipv6/route.c:382: error: invalid type argument of `->' Sorry, I thought you meant that it didn't apply :) Here is the corrected version. -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== net/ipv6/route.c 1.102 vs edited ===== --- 1.102/net/ipv6/route.c 2004-11-30 14:24:46 +11:00 +++ edited/net/ipv6/route.c 2005-01-09 05:34:03 +11:00 @@ -379,6 +379,7 @@ int err; write_lock_bh(&rt6_lock); + WARN_ON(rt->u.dst.obsolete); err = fib6_add(&ip6_routing_table, rt, nlh, _rtattr); write_unlock_bh(&rt6_lock); --cNdxnHkX5QqsyA0e-- From snort2004@mail.ru Sat Jan 8 00:28:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 08 Jan 2005 00:28:26 -0800 (PST) Received: from smtp.direct.ru (customers.imt.ru [212.16.0.33]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j088SICY011210 for ; Sat, 8 Jan 2005 00:28:19 -0800 Received: (qmail 4738 invoked from network); 8 Jan 2005 20:28:05 -0000 Received: from unknown (HELO AMDK7) (212.16.24.4) by 212.16.0.33 with SMTP; 8 Jan 2005 20:28:05 -0000 Date: Sat, 8 Jan 2005 23:29:08 +0300 From: Crazy AMD K7 X-Mailer: The Bat! (v1.46d) Reply-To: Crazy AMD K7 X-Priority: 3 (Normal) Message-ID: <15912343549.20050108232908@mail.ru> To: Crazy AMD K7 CC: David Woodhouse , Andi Kleen , Bart De Schuymer , , , Rusty Russell , "David S. Miller" Subject: do_IRQ: stack overflow: 956 Fwd: Re: do_IRQ: stack overflow: 872.. Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13633 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: snort2004@mail.ru Precedence: bulk X-list: netdev May be it will be interesting, may be not, but the situation with stack overflow appeared at my system again. 2.4.28 kernel + ebtables-brnf-8_vs_2.4.28.diff + fixbrnf.diff + u32 (from patch-o-matic) Here are the results: ksymoops 2.4.4 on i686 2.4.28. Options used -V (default) -k /proc/ksyms (default) -l /proc/modules (default) -o /lib/modules/2.4.28/ (default) -m /boot/System.map-2.4.28-fixed (specified) Jan 6 18:49:04 localhost kernel: do_IRQ: stack overflow: 956 Jan 6 18:49:04 localhost kernel: c02623f4 000003bc dfe65f00 00000001 0000000b ceb1c9d8 c010a508 dfe65f00 Jan 6 18:49:04 localhost kernel: 0000000b 0000000b 00000001 0000000b ceb1c9d8 04000000 00000018 00000018 Jan 6 18:49:04 localhost kernel: ffffff0c c0108069 00000010 00000246 ceb1c9d8 0000000b c0300bc0 dfe65f00 Jan 6 18:49:04 localhost kernel: Call Trace: [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] [] [] [] [] [] Jan 6 18:49:04 localhost kernel: [] Warning (Oops_read): Code line not seen, dumping what data is available Trace; c010a508 Trace; c0108069 Trace; c0108208 Trace; c010a508 Trace; c025769b <_mmx_memcpy+2b/150> Trace; c0208dc8 Trace; c020777b Trace; c020790d <__kfree_skb+13d/150> Trace; c01be170 Trace; c020afd5 Trace; c02530e0 Trace; c02146fc Trace; c020b1de Trace; c02530e0 Trace; c024642c Trace; c0253199 Trace; c02130b3 Trace; c02530e0 Trace; c02530e0 Trace; c021342e Trace; c0213460 Trace; c01be937 Trace; c0256e10 Trace; c02530e0 Trace; c0244098 Trace; c02530e0 Trace; c02130b3 Trace; c02530e0 Trace; c02530e0 Trace; c021342e Trace; c02530e0 Trace; c02130b3 Trace; c02531b0 Trace; c02531e9 Trace; c02530e0 Trace; c0213460 Trace; c020b1de Trace; c02531b0 Trace; c0256cbf Trace; c02531b0 Trace; c0208dc8 Trace; c02531b0 Trace; c02130b3 Trace; c02531b0 Trace; c02531b0 Trace; c021342e Trace; c02531b0 Trace; c020777b Trace; c020790d <__kfree_skb+13d/150> Trace; c025322a <__br_deliver+3a/40> Trace; c02531b0 Trace; c02532ab Trace; c025276a <__br_dev_xmit+6a/90> Trace; c020b02e Trace; c025279d Trace; c020b255 Trace; c02530e0 Trace; c02530e0 Trace; c021342e Trace; c0213460 Trace; c021e9e7 Trace; c0256e10 Trace; c021e940 Trace; c021e940 Trace; c0256f42 Trace; c02130b3 Trace; c021e940 Trace; c021e940 Trace; c021342e Trace; c021e940 Trace; c0108079 Trace; c021d649 Trace; c021e940 Trace; c0208dc8 Trace; c020777b Trace; c020790d <__kfree_skb+13d/150> Trace; c021eb60 Trace; c0246498 Trace; c021ea40 Trace; c021ea40 Trace; c0256f42 Trace; c02130b3 Trace; c021ea40 Trace; c021ea40 Trace; c021342e Trace; c021ea40 Trace; c02130b3 Trace; c021dac1 Trace; c021ea40 Trace; c0213460 Trace; c0208dc8 Trace; c0256e10 Trace; c02530e0 Trace; c0244098 Trace; c023296d Trace; c022db29 Trace; c02292c1 Trace; c02530e0 Trace; c022e5e1 Trace; c022b929 <__tcp_data_snd_check+49/d0> Trace; c0256cbf Trace; c022bd67 Trace; c02531b0 Trace; c02130b3 Trace; c02531b0 Trace; c02531b0 Trace; c021342e Trace; c02531b0 Trace; c020777b Trace; c020790d <__kfree_skb+13d/150> Trace; c025322a <__br_deliver+3a/40> Trace; c02088f5 Trace; c0233719 Trace; c023366e Trace; c0233bc4 Trace; c0244098 Trace; c021acb0 Trace; c02463ac Trace; c021ad67 Trace; c021acb0 Trace; c021acb0 Trace; c021342e Trace; c021acb0 Trace; c0213460 Trace; c02560c0 Trace; c024642c Trace; c021ade0 Trace; c021a93c Trace; c021acb0 Trace; c02560c0 Trace; c02188fd Trace; c021ade0 Trace; c021ade0 Trace; c021af4b Trace; c0253b70 Trace; c02568c0 Trace; c021ade0 Trace; c0256e3b Trace; c02130b3 Trace; c021ade0 Trace; c021ade0 Trace; c021342e Trace; c021ade0 Trace; c021ea40 Trace; c021ac7d Trace; c021ade0 Trace; c0253b70 Trace; c0233719 Trace; c0250f2c Trace; c0253b70 Trace; c02075a1 Trace; c020b7df Trace; c023296d Trace; c020b87d Trace; c020b99c Trace; c0108079 Trace; c01176cb Trace; c010823c Trace; c010a508 Trace; c0163161 Trace; c015ec35 Trace; c020b435 Trace; c02075a1 Trace; c01be64d Trace; c015ec8f Trace; c0158441 Trace; c022db29 Trace; c02292c1 Trace; c0233719 Trace; c0253ac0 Trace; c021342e Trace; c016320b Trace; c015ec35 Trace; c0132e86 Trace; c015ec97 Trace; c0158ab0 Trace; c016320b Trace; c0158a53 Trace; c0158b57 Trace; c0158c2c Trace; c015ef55 Trace; c014312e <__mark_inode_dirty+2e/90> Trace; c015384a Trace; c016320b Trace; c015ec35 Trace; c021ade0 Trace; c021ade0 Trace; c021af4b Trace; c0256e3b Trace; c015f29d Trace; c0158728 Trace; c0158791 Trace; c021ade0 Trace; c021ade0 Trace; c021342e Trace; c016320b Trace; c015ec35 Trace; c0132e86 Trace; c015ec97 Trace; c016320b Trace; c015ec35 Trace; c0155b79 Trace; c0155e95 Trace; c0132bf8 Trace; c0132c09 Trace; c0132e86 Trace; c0158728 Trace; c0158791 Trace; c0155d03 Trace; c015656d Trace; c01330b1 Trace; c01566c9 Trace; c0133616 <__block_prepare_write+e6/300> Trace; c0164f07 <__jbd_kmalloc+27/a0> Trace; c0133ecd Trace; c0156670 Trace; c0156b1c Trace; c0156670 Trace; c01297f5 Trace; c012339d Trace; c0125ec5 Trace; c0126320 Trace; c015467f Trace; c0131175 Trace; c013eea8 Trace; c0108208 Trace; c0116feb Trace; c0106cb3 1 warning issued. Results may not be reliable. From bunk@stusta.de Sat Jan 8 01:40:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 08 Jan 2005 01:40:34 -0800 (PST) Received: from mailout.stusta.mhn.de (emailhub.stusta.mhn.de [141.84.69.5]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j089eM2D013027 for ; Sat, 8 Jan 2005 01:40:28 -0800 Received: (qmail 10825 invoked from network); 8 Jan 2005 21:40:07 -0000 Received: from r063144.stusta.swh.mhn.de (10.150.63.144) by mailhub.stusta.mhn.de with SMTP; 8 Jan 2005 21:40:07 -0000 Received: by r063144.stusta.swh.mhn.de (Postfix, from userid 1000) id 2D7E3BBA5C; Sat, 8 Jan 2005 22:40:03 +0100 (CET) Date: Sat, 8 Jan 2005 22:40:03 +0100 From: Adrian Bunk To: Andrew Morton Cc: patrick@tykepenguin.com, Steve Whitehouse , linux-decnet-user@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [2.6 patch] net/decnet/: misc possible cleanups (fwd) Message-ID: <20050108214003.GS14108@stusta.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13634 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bunk@stusta.de Precedence: bulk X-list: netdev The patch forwarded below (already ACK'ed by Patrick Caulfield) still applies and compiles against 2.6.10-mm2. Please apply. ----- Forwarded message from Adrian Bunk ----- Date: Tue, 14 Dec 2004 13:58:38 +0100 From: Adrian Bunk To: patrick@tykepenguin.com, Steve Whitehouse Cc: linux-decnet-user@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [2.6 patch] net/decnet/: misc possible cleanups The patch below contains the following possible cleanups: - make needlessly global code static - dn_fib.c: remove the write-only global variable dn_fib_info_cnt - dn_fib.c: remove the unused global function dn_fib_rt_message - dn_neigh.c: remove the unused global function dn_neigh_pointopoint_notify - dn_timer.c: remove the fast timer code that isn't used Please review and comment on this patch. diffstat output: include/net/dn.h | 2 - include/net/dn_fib.h | 1 net/decnet/af_decnet.c | 6 +---- net/decnet/dn_fib.c | 15 ------------- net/decnet/dn_neigh.c | 8 ------ net/decnet/dn_route.c | 6 ++--- net/decnet/dn_timer.c | 47 ----------------------------------------- 7 files changed, 5 insertions(+), 80 deletions(-) Signed-off-by: Adrian Bunk --- linux-2.6.10-rc3-mm1-full/net/decnet/af_decnet.c.old 2004-12-14 03:30:13.000000000 +0100 +++ linux-2.6.10-rc3-mm1-full/net/decnet/af_decnet.c 2004-12-14 03:47:00.000000000 +0100 @@ -246,7 +246,7 @@ write_unlock_bh(&dn_hash_lock); } -struct hlist_head *listen_hash(struct sockaddr_dn *addr) +static struct hlist_head *listen_hash(struct sockaddr_dn *addr) { int i; unsigned hash = addr->sdn_objnum; @@ -447,7 +447,7 @@ dst_release(xchg(&sk->sk_dst_cache, NULL)); } -struct sock *dn_alloc_sock(struct socket *sock, int gfp) +static struct sock *dn_alloc_sock(struct socket *sock, int gfp) { struct dn_scp *scp; struct sock *sk = sk_alloc(PF_DECnet, gfp, sizeof(struct dn_sock), @@ -578,7 +578,6 @@ if (sk->sk_socket) return 0; - dn_stop_fast_timer(sk); /* unlikely, but possible that this is runninng */ if ((jiffies - scp->stamp) >= (HZ * decnet_time_wait)) { dn_unhash_sock(sk); sock_put(sk); @@ -631,7 +630,6 @@ default: printk(KERN_DEBUG "DECnet: dn_destroy_sock passed socket in invalid state\n"); case DN_O: - dn_stop_fast_timer(sk); dn_stop_slow_timer(sk); dn_unhash_sock_bh(sk); --- linux-2.6.10-rc3-mm1-full/include/net/dn_fib.h.old 2004-12-14 03:32:14.000000000 +0100 +++ linux-2.6.10-rc3-mm1-full/include/net/dn_fib.h 2004-12-14 03:32:19.000000000 +0100 @@ -117,7 +117,6 @@ extern void dn_fib_init(void); extern void dn_fib_cleanup(void); -extern int dn_fib_rt_message(struct sk_buff *skb); extern int dn_fib_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); extern struct dn_fib_info *dn_fib_create_info(const struct rtmsg *r, --- linux-2.6.10-rc3-mm1-full/net/decnet/dn_fib.c.old 2004-12-14 03:31:33.000000000 +0100 +++ linux-2.6.10-rc3-mm1-full/net/decnet/dn_fib.c 2004-12-14 03:32:31.000000000 +0100 @@ -60,7 +60,6 @@ static spinlock_t dn_fib_multipath_lock = SPIN_LOCK_UNLOCKED; static struct dn_fib_info *dn_fib_info_list; static rwlock_t dn_fib_info_lock = RW_LOCK_UNLOCKED; -int dn_fib_info_cnt; static struct { @@ -93,7 +92,6 @@ dev_put(nh->nh_dev); nh->nh_dev = NULL; } endfor_nexthops(fi); - dn_fib_info_cnt--; kfree(fi); } @@ -388,7 +386,6 @@ if (dn_fib_info_list) dn_fib_info_list->fib_prev = fi; dn_fib_info_list = fi; - dn_fib_info_cnt++; write_unlock(&dn_fib_info_lock); return fi; @@ -486,18 +483,6 @@ } -/* - * Punt to user via netlink for example, but for now - * we just drop it. - */ -int dn_fib_rt_message(struct sk_buff *skb) -{ - kfree_skb(skb); - - return 0; -} - - static int dn_fib_check_attr(struct rtmsg *r, struct rtattr **rta) { int i; --- linux-2.6.10-rc3-mm1-full/net/decnet/dn_neigh.c.old 2004-12-14 03:32:55.000000000 +0100 +++ linux-2.6.10-rc3-mm1-full/net/decnet/dn_neigh.c 2004-12-14 03:33:29.000000000 +0100 @@ -355,14 +355,6 @@ * basically does a neigh_lookup(), but without comparing the device * field. This is required for the On-Ethernet cache */ -/* - * Any traffic on a pointopoint link causes the timer to be reset - * for the entry in the neighbour table. - */ -void dn_neigh_pointopoint_notify(struct sk_buff *skb) -{ - return; -} /* * Pointopoint link receives a hello message --- linux-2.6.10-rc3-mm1-full/net/decnet/dn_route.c.old 2004-12-14 03:33:53.000000000 +0100 +++ linux-2.6.10-rc3-mm1-full/net/decnet/dn_route.c 2004-12-14 03:34:54.000000000 +0100 @@ -99,9 +99,9 @@ static unsigned char dn_hiord_addr[6] = {0xAA,0x00,0x04,0x00,0x00,0x00}; -int dn_rt_min_delay = 2 * HZ; -int dn_rt_max_delay = 10 * HZ; -int dn_rt_mtu_expires = 10 * 60 * HZ; +static const int dn_rt_min_delay = 2 * HZ; +static const int dn_rt_max_delay = 10 * HZ; +static const int dn_rt_mtu_expires = 10 * 60 * HZ; static unsigned long dn_rt_deadline; --- linux-2.6.10-rc3-mm1-full/include/net/dn.h.old 2004-12-14 03:35:13.000000000 +0100 +++ linux-2.6.10-rc3-mm1-full/include/net/dn.h 2004-12-14 03:46:38.000000000 +0100 @@ -220,8 +220,6 @@ extern void dn_start_slow_timer(struct sock *sk); extern void dn_stop_slow_timer(struct sock *sk); -extern void dn_start_fast_timer(struct sock *sk); -extern void dn_stop_fast_timer(struct sock *sk); extern dn_address decnet_address; extern int decnet_debug_level; --- linux-2.6.10-rc3-mm1-full/net/decnet/dn_timer.c.old 2004-12-14 03:35:29.000000000 +0100 +++ linux-2.6.10-rc3-mm1-full/net/decnet/dn_timer.c 2004-12-14 03:48:49.000000000 +0100 @@ -27,11 +27,9 @@ #include /* - * Fast timer is for delayed acks (200mS max) * Slow timer is for everything else (n * 500mS) */ -#define FAST_INTERVAL (HZ/5) #define SLOW_INTERVAL (HZ/2) static void dn_slow_timer(unsigned long arg); @@ -109,48 +107,3 @@ bh_unlock_sock(sk); sock_put(sk); } - -static void dn_fast_timer(unsigned long arg) -{ - struct sock *sk = (struct sock *)arg; - struct dn_scp *scp = DN_SK(sk); - - bh_lock_sock(sk); - if (sock_owned_by_user(sk)) { - scp->delack_timer.expires = jiffies + HZ / 20; - add_timer(&scp->delack_timer); - goto out; - } - - scp->delack_pending = 0; - - if (scp->delack_fxn) - scp->delack_fxn(sk); -out: - bh_unlock_sock(sk); -} - -void dn_start_fast_timer(struct sock *sk) -{ - struct dn_scp *scp = DN_SK(sk); - - if (!scp->delack_pending) { - scp->delack_pending = 1; - init_timer(&scp->delack_timer); - scp->delack_timer.expires = jiffies + FAST_INTERVAL; - scp->delack_timer.data = (unsigned long)sk; - scp->delack_timer.function = dn_fast_timer; - add_timer(&scp->delack_timer); - } -} - -void dn_stop_fast_timer(struct sock *sk) -{ - struct dn_scp *scp = DN_SK(sk); - - if (scp->delack_pending) { - scp->delack_pending = 0; - del_timer(&scp->delack_timer); - } -} - - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ----- End forwarded message ----- From bunk@stusta.de Sat Jan 8 03:32:50 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 08 Jan 2005 03:32:57 -0800 (PST) Received: from mailout.stusta.mhn.de (mailout.stusta.mhn.de [141.84.69.5]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j08BWmmn017531 for ; Sat, 8 Jan 2005 03:32:49 -0800 Received: (qmail 16885 invoked from network); 8 Jan 2005 23:32:35 -0000 Received: from r063144.stusta.swh.mhn.de (10.150.63.144) by mailhub.stusta.mhn.de with SMTP; 8 Jan 2005 23:32:35 -0000 Received: by r063144.stusta.swh.mhn.de (Postfix, from userid 1000) id 9992CBBA26; Sun, 9 Jan 2005 00:32:31 +0100 (CET) Date: Sun, 9 Jan 2005 00:32:31 +0100 From: Adrian Bunk To: "YOSHIFUJI Hideaki / ?$B5HF#1QL@" Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [2.6 patch] net/ipv6/: misc cleanups Message-ID: <20050108233231.GI14108@stusta.de> References: <20041215005546.GA11972@stusta.de> <20041215.105900.27736391.yoshfuji@linux-ipv6.org> <20050107030017.GF14108@stusta.de> <20050107.121149.102802103.yoshfuji@linux-ipv6.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050107.121149.102802103.yoshfuji@linux-ipv6.org> User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13635 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bunk@stusta.de Precedence: bulk X-list: netdev On Fri, Jan 07, 2005 at 12:11:49PM +0900, YOSHIFUJI Hideaki / ?$B5HF#1QL@ wrote: > In article <20050107030017.GF14108@stusta.de> (at Fri, 7 Jan 2005 04:00:17 +0100), Adrian Bunk says: > > > - #if 0 the following unused global variable: > > - addrconf.c: in6addr_any > > - remove the following EXPORT_SYMBOL's: > > - ipv6_syms.c: in6addr_any > > - ipv6_syms.c: in6addr_loopback > : > > --- linux-2.6.10-mm2-full/include/linux/in6.h.old 2005-01-07 02:34:21.000000000 +0100 > > +++ linux-2.6.10-mm2-full/include/linux/in6.h 2005-01-07 02:36:18.000000000 +0100 > > @@ -44,10 +44,10 @@ > > * NOTE: Be aware the IN6ADDR_* constants and in6addr_* externals are defined > > * in network byte order, not in host byte order as are the IPv4 equivalents > > */ > > +#if 0 > > extern const struct in6_addr in6addr_any; > > #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } > > -extern const struct in6_addr in6addr_loopback; > > -#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } > > +#endif > > > > I meant: > > #if 0 > extern const struct in6_addr in6addr_any; > #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } > #endif > extern const struct in6_addr in6addr_loopback; > #define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } > > And, > > > @@ -191,7 +188,11 @@ > > }; > > > > /* IPv6 Wildcard Address and Loopback Address defined by RFC2553 */ > > +#if 0 > > +#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } > > const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; > > +#endif > > +#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } > > const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT; > > > > #if 0 > const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; > #endif > const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT; > > or something like this. OK, updated patch below. > --yoshfuji cu Adrian <-- snip --> The patch below contains the following possible cleanups: - make some needlessly global code static - remove the following unused functions: - exthdrs.c: ipv6_build_rthdr - exthdrs.c: ipv6_build_exthdr - exthdrs.c: ipv6_build_nfrag_opts - exthdrs.c: ipv6_build_frag_opts - remove the following write-only global variables: - addrconf.c: inet6_dev_count - addrconf.c: inet6_ifa_count - #if 0 the following unused global variable: - addrconf.c: in6addr_any - remove the following unneeded EXPORT_SYMBOL's: - ipv6_syms.c: in6addr_any - ipv6_syms.c: in6addr_loopback diffstat output: include/linux/in6.h | 2 include/net/addrconf.h | 1 include/net/ipv6.h | 2 net/ipv6/addrconf.c | 9 ---- net/ipv6/anycast.c | 4 + net/ipv6/exthdrs.c | 77 ------------------------------------- net/ipv6/icmp.c | 2 net/ipv6/ip6_output.c | 2 net/ipv6/ipv6_syms.c | 2 net/ipv6/mcast.c | 32 ++++++++------- net/ipv6/route.c | 4 - net/ipv6/sysctl_net_ipv6.c | 2 12 files changed, 30 insertions(+), 109 deletions(-) Signed-off-by: Adrian Bunk --- linux-2.6.10-mm2-full/include/linux/in6.h.old 2005-01-07 02:34:21.000000000 +0100 +++ linux-2.6.10-mm2-full/include/linux/in6.h 2005-01-08 23:37:31.000000000 +0100 @@ -44,8 +44,10 @@ * NOTE: Be aware the IN6ADDR_* constants and in6addr_* externals are defined * in network byte order, not in host byte order as are the IPv4 equivalents */ +#if 0 extern const struct in6_addr in6addr_any; #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } +#endif extern const struct in6_addr in6addr_loopback; #define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } --- linux-2.6.10-mm2-full/net/ipv6/addrconf.c.old 2005-01-07 02:34:57.000000000 +0100 +++ linux-2.6.10-mm2-full/net/ipv6/addrconf.c 2005-01-08 23:38:34.000000000 +0100 @@ -99,9 +99,6 @@ static void addrconf_sysctl_unregister(struct ipv6_devconf *p); #endif -int inet6_dev_count; -int inet6_ifa_count; - #ifdef CONFIG_IPV6_PRIVACY static int __ipv6_regen_rndid(struct inet6_dev *idev); static int __ipv6_try_regen_rndid(struct inet6_dev *idev, struct in6_addr *tmpaddr); @@ -191,7 +188,9 @@ }; /* IPv6 Wildcard Address and Loopback Address defined by RFC2553 */ +#if 0 const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; +#endif const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT; int ipv6_addr_type(const struct in6_addr *addr) @@ -310,7 +309,6 @@ return; } snmp6_unregister_dev(idev); - inet6_dev_count--; kfree(idev); } @@ -338,7 +336,6 @@ kfree(ndev); return NULL; } - inet6_dev_count++; /* We refer to the device */ dev_hold(dev); @@ -475,7 +472,6 @@ } dst_release(&ifp->rt->u.dst); - inet6_ifa_count--; kfree(ifp); } @@ -530,7 +526,6 @@ ifa->flags = flags | IFA_F_TENTATIVE; ifa->cstamp = ifa->tstamp = jiffies; - inet6_ifa_count++; ifa->idev = idev; in6_dev_hold(idev); /* For caller */ --- linux-2.6.10-mm2-full/net/ipv6/ipv6_syms.c.old 2005-01-07 02:35:19.000000000 +0100 +++ linux-2.6.10-mm2-full/net/ipv6/ipv6_syms.c 2005-01-07 02:36:35.000000000 +0100 @@ -32,8 +32,6 @@ EXPORT_SYMBOL(inet6_ioctl); EXPORT_SYMBOL(ipv6_get_saddr); EXPORT_SYMBOL(ipv6_chk_addr); -EXPORT_SYMBOL(in6addr_any); -EXPORT_SYMBOL(in6addr_loopback); EXPORT_SYMBOL(in6_dev_finish_destroy); #ifdef CONFIG_XFRM EXPORT_SYMBOL(xfrm6_rcv); --- linux-2.6.10-mm2-full/include/net/addrconf.h.old 2005-01-07 02:38:03.000000000 +0100 +++ linux-2.6.10-mm2-full/include/net/addrconf.h 2005-01-07 02:38:10.000000000 +0100 @@ -112,7 +112,6 @@ extern int ipv6_dev_ac_inc(struct net_device *dev, struct in6_addr *addr); extern int __ipv6_dev_ac_dec(struct inet6_dev *idev, struct in6_addr *addr); -extern int ipv6_dev_ac_dec(struct net_device *dev, struct in6_addr *addr); extern int ipv6_chk_acast_addr(struct net_device *dev, struct in6_addr *addr); --- linux-2.6.10-mm2-full/net/ipv6/anycast.c.old 2005-01-07 02:38:21.000000000 +0100 +++ linux-2.6.10-mm2-full/net/ipv6/anycast.c 2005-01-07 02:38:44.000000000 +0100 @@ -43,6 +43,8 @@ #include +static int ipv6_dev_ac_dec(struct net_device *dev, struct in6_addr *addr); + /* Big ac list lock for all the sockets */ static rwlock_t ipv6_sk_ac_lock = RW_LOCK_UNLOCKED; @@ -413,7 +415,7 @@ return 0; } -int ipv6_dev_ac_dec(struct net_device *dev, struct in6_addr *addr) +static int ipv6_dev_ac_dec(struct net_device *dev, struct in6_addr *addr) { int ret; struct inet6_dev *idev = in6_dev_get(dev); --- linux-2.6.10-mm2-full/net/ipv6/exthdrs.c.old 2005-01-07 02:39:33.000000000 +0100 +++ linux-2.6.10-mm2-full/net/ipv6/exthdrs.c 2005-01-07 02:50:24.000000000 +0100 @@ -501,83 +501,6 @@ * for headers. */ -static u8 *ipv6_build_rthdr(struct sk_buff *skb, u8 *prev_hdr, - struct ipv6_rt_hdr *opt, struct in6_addr *addr) -{ - struct rt0_hdr *phdr, *ihdr; - int hops; - - ihdr = (struct rt0_hdr *) opt; - - phdr = (struct rt0_hdr *) skb_put(skb, (ihdr->rt_hdr.hdrlen + 1) << 3); - memcpy(phdr, ihdr, sizeof(struct rt0_hdr)); - - hops = ihdr->rt_hdr.hdrlen >> 1; - - if (hops > 1) - memcpy(phdr->addr, ihdr->addr + 1, - (hops - 1) * sizeof(struct in6_addr)); - - ipv6_addr_copy(phdr->addr + (hops - 1), addr); - - phdr->rt_hdr.nexthdr = *prev_hdr; - *prev_hdr = NEXTHDR_ROUTING; - return &phdr->rt_hdr.nexthdr; -} - -static u8 *ipv6_build_exthdr(struct sk_buff *skb, u8 *prev_hdr, u8 type, struct ipv6_opt_hdr *opt) -{ - struct ipv6_opt_hdr *h = (struct ipv6_opt_hdr *)skb_put(skb, ipv6_optlen(opt)); - - memcpy(h, opt, ipv6_optlen(opt)); - h->nexthdr = *prev_hdr; - *prev_hdr = type; - return &h->nexthdr; -} - -u8 *ipv6_build_nfrag_opts(struct sk_buff *skb, u8 *prev_hdr, struct ipv6_txoptions *opt, - struct in6_addr *daddr, u32 jumbolen) -{ - struct ipv6_opt_hdr *h = (struct ipv6_opt_hdr *)skb->data; - - if (opt && opt->hopopt) - prev_hdr = ipv6_build_exthdr(skb, prev_hdr, NEXTHDR_HOP, opt->hopopt); - - if (jumbolen) { - u8 *jumboopt = (u8 *)skb_put(skb, 8); - - if (opt && opt->hopopt) { - *jumboopt++ = IPV6_TLV_PADN; - *jumboopt++ = 0; - h->hdrlen++; - } else { - h = (struct ipv6_opt_hdr *)jumboopt; - h->nexthdr = *prev_hdr; - h->hdrlen = 0; - jumboopt += 2; - *prev_hdr = NEXTHDR_HOP; - prev_hdr = &h->nexthdr; - } - jumboopt[0] = IPV6_TLV_JUMBO; - jumboopt[1] = 4; - *(u32*)(jumboopt+2) = htonl(jumbolen); - } - if (opt) { - if (opt->dst0opt) - prev_hdr = ipv6_build_exthdr(skb, prev_hdr, NEXTHDR_DEST, opt->dst0opt); - if (opt->srcrt) - prev_hdr = ipv6_build_rthdr(skb, prev_hdr, opt->srcrt, daddr); - } - return prev_hdr; -} - -u8 *ipv6_build_frag_opts(struct sk_buff *skb, u8 *prev_hdr, struct ipv6_txoptions *opt) -{ - if (opt->dst1opt) - prev_hdr = ipv6_build_exthdr(skb, prev_hdr, NEXTHDR_DEST, opt->dst1opt); - return prev_hdr; -} - static void ipv6_push_rthdr(struct sk_buff *skb, u8 *proto, struct ipv6_rt_hdr *opt, struct in6_addr **addr_p) --- linux-2.6.10-mm2-full/net/ipv6/icmp.c.old 2005-01-07 02:40:12.000000000 +0100 +++ linux-2.6.10-mm2-full/net/ipv6/icmp.c 2005-01-07 02:40:20.000000000 +0100 @@ -211,7 +211,7 @@ return (*op & 0xC0) == 0x80; } -int icmpv6_push_pending_frames(struct sock *sk, struct flowi *fl, struct icmp6hdr *thdr, int len) +static int icmpv6_push_pending_frames(struct sock *sk, struct flowi *fl, struct icmp6hdr *thdr, int len) { struct sk_buff *skb; struct icmp6hdr *icmp6h; --- linux-2.6.10-mm2-full/include/net/ipv6.h.old 2005-01-07 02:40:56.000000000 +0100 +++ linux-2.6.10-mm2-full/include/net/ipv6.h 2005-01-07 02:41:03.000000000 +0100 @@ -229,8 +229,6 @@ void (*destructor)(struct sock *)); -extern int ip6_call_ra_chain(struct sk_buff *skb, int sel); - extern int ipv6_parse_hopopts(struct sk_buff *skb, int); extern struct ipv6_txoptions * ipv6_dup_options(struct sock *sk, struct ipv6_txoptions *opt); --- linux-2.6.10-mm2-full/net/ipv6/ip6_output.c.old 2005-01-07 02:41:10.000000000 +0100 +++ linux-2.6.10-mm2-full/net/ipv6/ip6_output.c 2005-01-07 02:41:15.000000000 +0100 @@ -311,7 +311,7 @@ return 0; } -int ip6_call_ra_chain(struct sk_buff *skb, int sel) +static int ip6_call_ra_chain(struct sk_buff *skb, int sel) { struct ip6_ra_chain *ra; struct sock *last = NULL; --- linux-2.6.10-mm2-full/net/ipv6/mcast.c.old 2005-01-07 02:41:35.000000000 +0100 +++ linux-2.6.10-mm2-full/net/ipv6/mcast.c 2005-01-07 02:44:44.000000000 +0100 @@ -121,7 +121,7 @@ struct in6_addr srcs[0]; }; -struct in6_addr mld2_all_mcr = MLD2_ALL_MCR_INIT; +static struct in6_addr mld2_all_mcr = MLD2_ALL_MCR_INIT; /* Big mc list lock for all the sockets */ static rwlock_t ipv6_sk_mc_lock = RW_LOCK_UNLOCKED; @@ -143,12 +143,14 @@ static int sf_setstate(struct ifmcaddr6 *pmc); static void sf_markstate(struct ifmcaddr6 *pmc); static void ip6_mc_clear_src(struct ifmcaddr6 *pmc); -int ip6_mc_del_src(struct inet6_dev *idev, struct in6_addr *pmca, int sfmode, - int sfcount, struct in6_addr *psfsrc, int delta); -int ip6_mc_add_src(struct inet6_dev *idev, struct in6_addr *pmca, int sfmode, - int sfcount, struct in6_addr *psfsrc, int delta); -int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml, - struct inet6_dev *idev); +static int ip6_mc_del_src(struct inet6_dev *idev, struct in6_addr *pmca, + int sfmode, int sfcount, struct in6_addr *psfsrc, + int delta); +static int ip6_mc_add_src(struct inet6_dev *idev, struct in6_addr *pmca, + int sfmode, int sfcount, struct in6_addr *psfsrc, + int delta); +static int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml, + struct inet6_dev *idev); #define IGMP6_UNSOLICITED_IVAL (10*HZ) @@ -272,7 +274,7 @@ return -ENOENT; } -struct inet6_dev *ip6_mc_find_dev(struct in6_addr *group, int ifindex) +static struct inet6_dev *ip6_mc_find_dev(struct in6_addr *group, int ifindex) { struct net_device *dev = NULL; struct inet6_dev *idev = NULL; @@ -1723,8 +1725,9 @@ return rv; } -int ip6_mc_del_src(struct inet6_dev *idev, struct in6_addr *pmca, int sfmode, - int sfcount, struct in6_addr *psfsrc, int delta) +static int ip6_mc_del_src(struct inet6_dev *idev, struct in6_addr *pmca, + int sfmode, int sfcount, struct in6_addr *psfsrc, + int delta) { struct ifmcaddr6 *pmc; int changerec = 0; @@ -1847,8 +1850,9 @@ /* * Add multicast source filter list to the interface list */ -int ip6_mc_add_src(struct inet6_dev *idev, struct in6_addr *pmca, int sfmode, - int sfcount, struct in6_addr *psfsrc, int delta) +static int ip6_mc_add_src(struct inet6_dev *idev, struct in6_addr *pmca, + int sfmode, int sfcount, struct in6_addr *psfsrc, + int delta) { struct ifmcaddr6 *pmc; int isexclude; @@ -1951,8 +1955,8 @@ spin_unlock_bh(&ma->mca_lock); } -int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml, - struct inet6_dev *idev) +static int ip6_mc_leave_src(struct sock *sk, struct ipv6_mc_socklist *iml, + struct inet6_dev *idev) { int err; --- linux-2.6.10-mm2-full/net/ipv6/route.c.old 2005-01-07 02:45:00.000000000 +0100 +++ linux-2.6.10-mm2-full/net/ipv6/route.c 2005-01-07 02:45:22.000000000 +0100 @@ -208,8 +208,8 @@ /* * pointer to the last default router chosen. BH is disabled locally. */ -struct rt6_info *rt6_dflt_pointer; -spinlock_t rt6_dflt_lock = SPIN_LOCK_UNLOCKED; +static struct rt6_info *rt6_dflt_pointer; +static spinlock_t rt6_dflt_lock = SPIN_LOCK_UNLOCKED; void rt6_reset_dflt_pointer(struct rt6_info *rt) { --- linux-2.6.10-mm2-full/net/ipv6/sysctl_net_ipv6.c.old 2005-01-07 02:45:38.000000000 +0100 +++ linux-2.6.10-mm2-full/net/ipv6/sysctl_net_ipv6.c 2005-01-07 02:45:46.000000000 +0100 @@ -19,7 +19,7 @@ #ifdef CONFIG_SYSCTL -ctl_table ipv6_table[] = { +static ctl_table ipv6_table[] = { { .ctl_name = NET_IPV6_ROUTE, .procname = "route", From jgarzik@pobox.com Sat Jan 8 05:12:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 08 Jan 2005 05:12:33 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j08DCRBL023940 for ; Sat, 8 Jan 2005 05:12:27 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CnRcw-00028I-9A; Sun, 09 Jan 2005 01:12:18 +0000 Message-ID: <41E084E0.9070709@pobox.com> Date: Sat, 08 Jan 2005 20:12:00 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Herbert Xu CC: Netdev , YOSHIFUJI Hideaki / ???????????? Subject: Re: IPv6 badness continues References: <41DA3A60.8050102@pobox.com> <20050108042509.GA1959@gondor.apana.org.au> <41E01746.3080501@pobox.com> <20050108183545.GA6413@gondor.apana.org.au> In-Reply-To: <20050108183545.GA6413@gondor.apana.org.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13636 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Herbert Xu wrote: > Here is the corrected version. I applied the patch and tried it out. The kernel was practically unusable, as the warning hit as soon as the kernel booted: > Jan 8 20:06:44 pretzel kernel: Badness in ip6_ins_rt at net/ipv6/route.c:382 > Jan 8 20:06:44 pretzel kernel: [] ip6_ins_rt+0x7e/0x80 [ipv6] > Jan 8 20:06:44 pretzel kernel: [] __ipv6_ifa_notify+0x12e/0x1a0 [ipv > 6] > Jan 8 20:06:44 pretzel kernel: [] ipv6_ifa_notify+0x33/0x50 [ipv6] > Jan 8 20:06:44 pretzel kernel: [] init_loopback+0x90/0x110 [ipv6] > Jan 8 20:06:44 pretzel kernel: [] addrconf_notify+0xff/0x1a0 [ipv6] > Jan 8 20:06:44 pretzel kernel: [] notifier_call_chain+0x2d/0x50 > Jan 8 20:06:44 pretzel kernel: [] dev_open+0x77/0xa0 > Jan 8 20:06:44 pretzel kernel: [] dev_change_flags+0x53/0x130 > Jan 8 20:06:44 pretzel kernel: [] devinet_ioctl+0x257/0x5d0 > Jan 8 20:06:44 pretzel kernel: [] inet_ioctl+0x66/0xb0 > Jan 8 20:06:44 pretzel kernel: [] sock_ioctl+0xc9/0x250 > Jan 8 20:06:44 pretzel kernel: [] sys_ioctl+0xca/0x230 > Jan 8 20:06:44 pretzel kernel: [] sysenter_past_esp+0x52/0x75 From rddunlap@osdl.org Sat Jan 8 06:27:30 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 08 Jan 2005 06:27:40 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j08ERT18025701 for ; Sat, 8 Jan 2005 06:27:29 -0800 Received: from [127.0.0.1] (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j092RDd01329; Sat, 8 Jan 2005 18:27:13 -0800 Message-ID: <41E094F7.4050301@osdl.org> Date: Sat, 08 Jan 2005 18:20:39 -0800 From: "Randy.Dunlap" User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com, brad@wasp.net.au Subject: [Fwd: kernel BUG at net/ipv4/tcpoutput.c:922 2.6.10-bk7] Content-Type: multipart/mixed; boundary="------------070607080905030300090609" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13637 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------070607080905030300090609 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 7bit (from lkml:) additional note: Forgot to mention, it's a vanilla kernel pulled from BK when -bk7 was current on kernel.org. It also has Jeff's libata-dev-2.6 tree pulled in. No other patches. -------- Original Message -------- Subject: kernel BUG at net/ipv4/tcpoutput.c:922 2.6.10-bk7 Date: Sat, 08 Jan 2005 18:26:48 +0400 From: Brad Campbell To: lkml Warning This oops is hand transcribed This machine is set up for a serial console, but of course one is never there when you actually need it. It would be handy to perhaps loop the oops once every 60 seconds or so, then you could always connect up a serial console when you get home and capture it. There was no I connected at oops time, so no magic-sysrq would work. Any interest in such a thing? Perhaps I could have a go at knocking something up. Regards, Brad [1.] One line summary of the problem: Machine oopsed. [2.] Full description of the problem/report: Machine was under light load, a couple of p2 clients running only. Ports eth0 and eth1 would have been practically unused (they use the sk98lin driver) eth2 would have been under traffic of a 512/128 ADSL at full noise. 8139too driver. [3.] Keywords (i.e., modules, networking, kernel): networking. [4.] Kernel version (from /proc/version): Linux version 2.6.10 (brad@srv) (gcc version 3.3.4 (Debian 1:3.3.4-13)) #3 Wed Jan 5 21:14:04 GST 2005 [5.] Output of Oops.. message (if applicable) with symbolic information resolved (see Documentation/oops-tracing.txt) invalid operand: 0000 [#1] Modules linked in: ehci_hcd uhci_hcd usbcore 8139too mii it87 i2c_sensor i2c_isa ohci1394 ieee1394 sk98lin CPU: 0 EIP: 0060:[] Not tainted VLI EFLAGS: 00010202 (2.6.10) EIP is at tcp_retrans_try_collapse+0x339/0x350 eax: db392440 ebx: f52257e0 ecx: 00000000 edx: 000005b4 esi: fffffff5 edi: dd1c71d0 ebp: f63d7240 esp: c0467ea4 Process swapper (pic: 0, threadinfo=c0466000 task=c03abb20) Stack: f7ab8800 c2c2c100 c02e9ccd 00000394 00000218 00107000 00000218 dd1c71d0 dd1c7000 dd1c71d0 fffffff5 f52257e0 dd1c7000 c02fdf0f dd1c7000 f52257e0 000005b4 c02f6056 000005b4 dd1c7000 dd1c71d0 dd1c7054 c0467f64 c02ffbfb Call Trace: [] ip_rcv+0x2dd.0x410 [] tcp_retransmit_skb+0x2af/0x320 [] tcp_enter_loss+0x66/0x230 [] tcp_retransmit_timer+0xdb/0x3f0 [] update_process_times+0x46/0x60 [] tcp_write_timer+0x0/0xe0 [] timer_interrupt+0x4e/0x100 [] tcp_write_timer+0x0/0xe0 [] run_timer_softirq+0xb0/0x170 [] __do_softirq+0x7d/0x90 [] do_softirq+0x26/0x30 [] do_IRQ+0x1e/0x30 [] common_interrupt+0x1a/0x20 [] default_idle+0x23/0x30 [] cpu_idle+0x48/0x60 [] start_kernel+0x141/0x160 [] unknown_bootoption+0x0/0x1b0 Code: e9 55 fe ff ff c7 44 24 08 9b da 2f c0 89 54 54 04 89 1c 24 e8 19 48 fd ff e9 0c fe ff ff 0f 0b cb 02 59 2e 37 c0 e9 de fd ff ff <0f> 0b 9a 03 ff 2b 39 c0 e9 96 fd ff ff 31 c0 e9 5b fd ff ff 8d [6.] A small shell script or example program which triggers the problem (if possible) Unreproducible easily. Took 3 days to manifest. [7.] Environment About 22 Degrees C and 45% RH BASH=/bin/bash BASH_VERSINFO=([0]="2" [1]="05b" [2]="0" [3]="1" [4]="release" [5]="i386-pc-linux-gnu") BASH_VERSION='2.05b.0(1)-release' COLUMNS=221 CVS_RSH=ssh DIRSTACK=() DISPLAY=:0.0 EUID=1000 GNUSTEP_USER_ROOT=/home/brad/GNUstep GROUPS=() HISTFILE=/home/brad/.bash_history HISTFILESIZE=500 HISTSIZE=500 HOME=/home/brad HOSTNAME=bklaptop HOSTTYPE=i386 HUSHLOGIN=FALSE HZ=100 IFS=$' \t\n' LINES=78 LOGNAME=brad LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.mpg=01;35:*.avi=01;35:*.gl=01;35:*.dl=01;35:' LS_OPTIONS=--color=auto MACHTYPE=i386-pc-linux-gnu MAIL=/var/mail/brad MAILCHECK=60 OLDPWD=/home/brad OPTERR=1 OPTIND=1 OSTYPE=linux-gnu PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/usr/sbin:/sbin:/usr/local/sbin:.:/usr/local/programs:/usr/local/bin PIPESTATUS=([0]="0") PPID=28540 PS1='\h:\w>' PS2='> ' PS4='+ ' PWD=/usr/src/linux SHELL=/bin/bash SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor SHLVL=4 TERM=xterm UID=1000 USER=brad WINDOWID=23068686 WMAKER_BIN_NAME=/usr/bin/WindowMaker WRASTER_COLOR_RESOLUTION0=4 XAUTHORITY=/home/brad/.Xauthority _=REPORTING-BUGS [7.1.] Software (add the output of the ver_linux script here) If some fields are empty or look unusual you may have an old version. Compare to the current minimal requirements in Documentation/Changes. Linux srv 2.6.10 #3 Wed Jan 5 21:14:04 GST 2005 i686 GNU/Linux Gnu C 3.3.4 Gnu make 3.80 binutils 2.15 util-linux 2.12 mount 2.12 module-init-tools 3.1-pre6 e2fsprogs 1.35 reiserfsprogs line reiser4progs line PPP 2.4.2 nfs-utils 1.0.6 Linux C Library 2.3.2 Dynamic linker (ldd) 2.3.2 Procps 3.2.1 Net-tools 1.60 Console-tools 0.2.3 Sh-utils 5.2.1 Modules Loaded ehci_hcd uhci_hcd usbcore 8139too mii it87 i2c_sensor i2c_isa ohci1394 ieee1394 sk98lin [7.2.] Processor information (from /proc/cpuinfo): processor : 0 vendor_id : AuthenticAMD cpu family : 6 model : 10 model name : AMD Athlon(TM) XP 2600+ stepping : 0 cpu MHz : 1916.506 cache size : 512 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr sse pni syscall mmxext 3dnowext 3dnow bogomips : 3827.30 [7.3.] Module information (from /proc/modules): ehci_hcd 39876 0 - Live 0xf890e000 uhci_hcd 30476 0 - Live 0xf8919000 usbcore 116408 3 ehci_hcd,uhci_hcd, Live 0xf898e000 8139too 20288 0 - Live 0xf88fc000 mii 3968 1 8139too, Live 0xf88e8000 it87 21284 0 - Live 0xf88ed000 i2c_sensor 2880 1 it87, Live 0xf888c000 i2c_isa 1664 0 - Live 0xf88b8000 ohci1394 30852 0 - Live 0xf88a7000 ieee1394 303220 1 ohci1394, Live 0xf8942000 sk98lin 165288 2 - Live 0xf88bb000 [7.4.] Loaded driver and hardware information (/proc/ioports, /proc/iomem) MemTotal: 1554536 kB MemFree: 1422876 kB Buffers: 46068 kB Cached: 25960 kB SwapCached: 0 kB Active: 76580 kB Inactive: 22204 kB HighTotal: 655340 kB HighFree: 600960 kB LowTotal: 899196 kB LowFree: 821916 kB SwapTotal: 987988 kB SwapFree: 987988 kB Dirty: 0 kB Writeback: 0 kB Mapped: 35596 kB Slab: 13100 kB CommitLimit: 1765256 kB Committed_AS: 56476 kB PageTables: 936 kB VmallocTotal: 114680 kB VmallocUsed: 1588 kB VmallocChunk: 112968 kB 0000-001f : dma1 0020-0021 : pic1 0040-0043 : timer0 0050-0053 : timer1 0060-006f : keyboard 0070-0077 : rtc 0080-008f : dma page reg 00a0-00a1 : pic2 00c0-00df : dma2 00f0-00ff : fpu 01f0-01f7 : ide0 0290-0297 : 02f8-02ff : serial 03c0-03df : vga+ 03f6-03f6 : ide0 03f8-03ff : serial 4000-407f : 0000:00:13.0 4000-407f : sata_promise 4400-440f : 0000:00:13.0 4400-440f : sata_promise 4800-483f : 0000:00:13.0 4800-483f : sata_promise 5000-501f : 0000:00:10.3 5000-501f : uhci_hcd 5400-541f : 0000:00:10.2 5400-541f : uhci_hcd 5800-581f : 0000:00:10.1 5800-581f : uhci_hcd 6000-601f : 0000:00:10.0 6000-601f : uhci_hcd 6400-640f : 0000:00:0f.1 6400-6407 : ide0 6800-68ff : 0000:00:0f.0 6800-68ff : sata_via 7000-700f : 0000:00:0f.0 7000-700f : sata_via 7400-7403 : 0000:00:0f.0 7400-7403 : sata_via 7800-7807 : 0000:00:0f.0 7800-7807 : sata_via 8000-8003 : 0000:00:0f.0 8000-8003 : sata_via 8400-8407 : 0000:00:0f.0 8400-8407 : sata_via 8800-887f : 0000:00:0e.0 8800-887f : sata_promise 9000-900f : 0000:00:0e.0 9000-900f : sata_promise 9400-943f : 0000:00:0e.0 9400-943f : sata_promise 9800-98ff : 0000:00:0d.0 9800-98ff : SysKonnect SK-98xx a000-a07f : 0000:00:0c.0 a400-a47f : 0000:00:0b.0 a400-a47f : sata_promise a800-a80f : 0000:00:0b.0 a800-a80f : sata_promise b000-b03f : 0000:00:0b.0 b000-b03f : sata_promise b400-b4ff : 0000:00:0a.0 b400-b4ff : 8139too b800-b8ff : 0000:00:09.0 b800-b8ff : SysKonnect SK-98xx d000-dfff : PCI Bus #01 d800-d87f : 0000:01:00.0 e400-e47f : motherboard e400-e403 : PM1a_EVT_BLK e404-e405 : PM1a_CNT_BLK e408-e40b : PM_TMR e420-e423 : GPE0_BLK e800-e81f : motherboard 00000000-0009e7ff : System RAM 0009e800-0009ffff : reserved 000a0000-000bffff : Video RAM area 000c0000-000cffff : Video ROM 000d0000-000d33ff : Adapter ROM 000f0000-000fffff : System ROM 00100000-5fffafff : System RAM 00100000-0033abe9 : Kernel code 0033abea-004652ff : Kernel data 5fffb000-5fffefff : ACPI Tables 5ffff000-5fffffff : ACPI Non-volatile Storage d9800000-d981ffff : 0000:00:13.0 d9800000-d981ffff : sata_promise da000000-da000fff : 0000:00:13.0 da000000-da000fff : sata_promise da800000-da8000ff : 0000:00:10.4 da800000-da8000ff : ehci_hcd db000000-db01ffff : 0000:00:0e.0 db000000-db01ffff : sata_promise db800000-db800fff : 0000:00:0e.0 db800000-db800fff : sata_promise dc000000-dc003fff : 0000:00:0d.0 dc000000-dc003fff : SysKonnect SK-98xx dc800000-dc8007ff : 0000:00:0c.0 dc800000-dc8007ff : ohci1394 dd000000-dd01ffff : 0000:00:0b.0 dd000000-dd01ffff : sata_promise dd800000-dd800fff : 0000:00:0b.0 dd800000-dd800fff : sata_promise de000000-de0000ff : 0000:00:0a.0 de000000-de0000ff : 8139too de800000-de803fff : 0000:00:09.0 de800000-de803fff : SysKonnect SK-98xx df000000-dfdfffff : PCI Bus #01 df000000-df03ffff : 0000:01:00.0 dff00000-f7ffffff : PCI Bus #01 e0000000-efffffff : 0000:01:00.0 f8000000-fbffffff : 0000:00:00.0 fec00000-fec00fff : reserved fee00000-fee00fff : reserved ffff0000-ffffffff : reserved [7.5.] PCI information ('lspci -vvv' as root) 0000:00:00.0 Host bridge: VIA Technologies, Inc. VT8377 [KT400/KT600 AGP] Host Bridge (rev 80) Subsystem: Asustek Computer, Inc. A7V8X motherboard Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- SERR- Capabilities: [c0] Power Management version 2 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-) Status: D0 PME-Enable- DSel=0 DScale=0 PME- 0000:00:01.0 PCI bridge: VIA Technologies, Inc. VT8237 PCI Bridge (prog-if 00 [Normal decode]) Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- SERR- Reset- FastB2B- Capabilities: [80] Power Management version 2 Flags: PMEClk- DSI- D1+ D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-) Status: D0 PME-Enable- DSel=0 DScale=0 PME- 0000:00:09.0 Ethernet controller: 3Com Corporation 3c940 10/100/1000Base-T [Marvell] (rev 12) Subsystem: Asustek Computer, Inc. P4P800 Mainboard Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- [7.6.] SCSI information (from /proc/scsi/scsi) Attached devices: Host: scsi0 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: Maxtor 7Y250M0 Rev: YAR5 Type: Direct-Access ANSI SCSI revision: 05 Host: scsi1 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: Maxtor 7Y250M0 Rev: YAR5 Type: Direct-Access ANSI SCSI revision: 05 Host: scsi2 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: Maxtor 7Y250M0 Rev: YAR5 Type: Direct-Access ANSI SCSI revision: 05 Host: scsi3 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: Maxtor 7Y250M0 Rev: YAR5 Type: Direct-Access ANSI SCSI revision: 05 Host: scsi4 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: Maxtor 7Y250M0 Rev: YAR5 Type: Direct-Access ANSI SCSI revision: 05 Host: scsi5 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: Maxtor 7Y250M0 Rev: YAR5 Type: Direct-Access ANSI SCSI revision: 05 Host: scsi6 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: Maxtor 7Y250M0 Rev: YAR5 Type: Direct-Access ANSI SCSI revision: 05 Host: scsi7 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: Maxtor 7Y250M0 Rev: YAR5 Type: Direct-Access ANSI SCSI revision: 05 Host: scsi8 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: Maxtor 7Y250M0 Rev: YAR5 Type: Direct-Access ANSI SCSI revision: 05 Host: scsi9 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: Maxtor 7Y250M0 Rev: YAR5 Type: Direct-Access ANSI SCSI revision: 05 Host: scsi10 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: Maxtor 7Y250M0 Rev: YAR5 Type: Direct-Access ANSI SCSI revision: 05 Host: scsi11 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: Maxtor 7Y250M0 Rev: YAR5 Type: Direct-Access ANSI SCSI revision: 05 Host: scsi13 Channel: 00 Id: 00 Lun: 00 Vendor: ATA Model: WDC WD2500BB-00D Rev: 15.0 Type: Direct-Access ANSI SCSI revision: 05 -- ~Randy --------------070607080905030300090609 Content-Type: text/plain; name="config" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="config" CONFIG_X86=y CONFIG_MMU=y CONFIG_UID16=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_IOMAP=y CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y CONFIG_BROKEN_ON_SMP=y CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y CONFIG_SYSCTL=y CONFIG_LOG_BUF_SHIFT=20 CONFIG_HOTPLUG=y CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y CONFIG_KALLSYMS_EXTRA_PASS=y CONFIG_FUTEX=y CONFIG_EPOLL=y CONFIG_SHMEM=y CONFIG_CC_ALIGN_FUNCTIONS=0 CONFIG_CC_ALIGN_LABELS=0 CONFIG_CC_ALIGN_LOOPS=0 CONFIG_CC_ALIGN_JUMPS=0 CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_OBSOLETE_MODPARM=y CONFIG_KMOD=y CONFIG_X86_PC=y CONFIG_MK7=y CONFIG_X86_CMPXCHG=y CONFIG_X86_XADD=y CONFIG_X86_L1_CACHE_SHIFT=6 CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_X86_WP_WORKS_OK=y CONFIG_X86_INVLPG=y CONFIG_X86_BSWAP=y CONFIG_X86_POPAD_OK=y CONFIG_X86_GOOD_APIC=y CONFIG_X86_INTEL_USERCOPY=y CONFIG_X86_USE_PPRO_CHECKSUM=y CONFIG_X86_USE_3DNOW=y CONFIG_HPET_TIMER=y CONFIG_HPET_EMULATE_RTC=y CONFIG_X86_UP_APIC=y CONFIG_X86_UP_IOAPIC=y CONFIG_X86_LOCAL_APIC=y CONFIG_X86_IO_APIC=y CONFIG_X86_TSC=y CONFIG_X86_MCE=y CONFIG_X86_MCE_NONFATAL=y CONFIG_HIGHMEM4G=y CONFIG_HIGHMEM=y CONFIG_MTRR=y CONFIG_PM=y CONFIG_ACPI=y CONFIG_ACPI_BOOT=y CONFIG_ACPI_INTERPRETER=y CONFIG_ACPI_BUTTON=y CONFIG_ACPI_BLACKLIST_YEAR=0 CONFIG_ACPI_BUS=y CONFIG_ACPI_EC=y CONFIG_ACPI_POWER=y CONFIG_ACPI_PCI=y CONFIG_ACPI_SYSTEM=y CONFIG_PCI=y CONFIG_PCI_GOBIOS=y CONFIG_PCI_BIOS=y CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y CONFIG_BINFMT_ELF=y CONFIG_BINFMT_AOUT=m CONFIG_BINFMT_MISC=m CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_INITRAMFS_SOURCE="" CONFIG_LBD=y CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y CONFIG_IOSCHED_CFQ=y CONFIG_IDE=y CONFIG_BLK_DEV_IDE=y CONFIG_BLK_DEV_IDEDISK=y CONFIG_IDEDISK_MULTI_MODE=y CONFIG_BLK_DEV_IDEPCI=y CONFIG_IDEPCI_SHARE_IRQ=y CONFIG_BLK_DEV_IDEDMA_PCI=y CONFIG_IDEDMA_PCI_AUTO=y CONFIG_BLK_DEV_VIA82CXXX=y CONFIG_BLK_DEV_IDEDMA=y CONFIG_IDEDMA_AUTO=y CONFIG_SCSI=y CONFIG_SCSI_PROC_FS=y CONFIG_BLK_DEV_SD=y CONFIG_BLK_DEV_SR=y CONFIG_CHR_DEV_SG=y CONFIG_SCSI_CONSTANTS=y CONFIG_SCSI_LOGGING=y CONFIG_SCSI_SATA=y CONFIG_SCSI_SATA_PROMISE=y CONFIG_SCSI_SATA_VIA=y CONFIG_SCSI_QLA2XXX=y CONFIG_MD=y CONFIG_BLK_DEV_MD=y CONFIG_MD_RAID0=y CONFIG_MD_RAID5=y CONFIG_MD_RAID6=y CONFIG_IEEE1394=m CONFIG_IEEE1394_OUI_DB=y CONFIG_IEEE1394_OHCI1394=m CONFIG_IEEE1394_SBP2=m CONFIG_IEEE1394_RAWIO=m CONFIG_NET=y CONFIG_PACKET=y CONFIG_UNIX=y CONFIG_INET=y CONFIG_IP_MULTICAST=y CONFIG_IP_TCPDIAG=y CONFIG_BRIDGE=y CONFIG_NETDEVICES=y CONFIG_DUMMY=m CONFIG_NET_ETHERNET=y CONFIG_MII=m CONFIG_NET_PCI=y CONFIG_8139TOO=m CONFIG_SK98LIN=m CONFIG_TIGON3=m CONFIG_INPUT=y CONFIG_INPUT_MOUSEDEV=y CONFIG_INPUT_MOUSEDEV_PSAUX=y CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 CONFIG_SOUND_GAMEPORT=y CONFIG_SERIO=y CONFIG_SERIO_I8042=y CONFIG_SERIO_LIBPS2=y CONFIG_INPUT_KEYBOARD=y CONFIG_KEYBOARD_ATKBD=y CONFIG_INPUT_MOUSE=y CONFIG_MOUSE_PS2=y CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_HW_CONSOLE=y CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_NR_UARTS=4 CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 CONFIG_RTC=y CONFIG_HPET=y CONFIG_HPET_MMAP=y CONFIG_HANGCHECK_TIMER=y CONFIG_I2C=y CONFIG_I2C_CHARDEV=y CONFIG_I2C_ALGOBIT=y CONFIG_I2C_ISA=m CONFIG_I2C_SENSOR=m CONFIG_SENSORS_IT87=m CONFIG_VIDEO_SELECT=y CONFIG_VGA_CONSOLE=y CONFIG_DUMMY_CONSOLE=y CONFIG_USB=m CONFIG_USB_DEBUG=y CONFIG_USB_DEVICEFS=y CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y CONFIG_USB_EHCI_HCD=m CONFIG_USB_UHCI_HCD=m CONFIG_USB_STORAGE=m CONFIG_USB_HID=m CONFIG_USB_HIDINPUT=y CONFIG_EXT2_FS=y CONFIG_EXT3_FS=y CONFIG_EXT3_FS_XATTR=y CONFIG_JBD=y CONFIG_FS_MBCACHE=y CONFIG_FS_POSIX_ACL=y CONFIG_DNOTIFY=y CONFIG_ISO9660_FS=y CONFIG_JOLIET=y CONFIG_UDF_FS=y CONFIG_UDF_NLS=y CONFIG_FAT_FS=y CONFIG_MSDOS_FS=y CONFIG_VFAT_FS=y CONFIG_FAT_DEFAULT_CODEPAGE=437 CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y CONFIG_SYSFS=y CONFIG_DEVFS_FS=y CONFIG_TMPFS=y CONFIG_RAMFS=y CONFIG_NFS_FS=y CONFIG_NFS_V3=y CONFIG_NFS_V4=y CONFIG_NFS_DIRECTIO=y CONFIG_NFSD=y CONFIG_NFSD_V3=y CONFIG_NFSD_V4=y CONFIG_NFSD_TCP=y CONFIG_LOCKD=y CONFIG_LOCKD_V4=y CONFIG_EXPORTFS=y CONFIG_SUNRPC=y CONFIG_SUNRPC_GSS=y CONFIG_RPCSEC_GSS_KRB5=y CONFIG_MSDOS_PARTITION=y CONFIG_NLS=y CONFIG_NLS_DEFAULT="iso8859-1" CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ISO8859_1=y CONFIG_DEBUG_KERNEL=y CONFIG_MAGIC_SYSRQ=y CONFIG_DEBUG_SPINLOCK_SLEEP=y CONFIG_EARLY_PRINTK=y CONFIG_X86_FIND_SMP_CONFIG=y CONFIG_X86_MPPARSE=y CONFIG_CRYPTO=y CONFIG_CRYPTO_MD5=y CONFIG_CRYPTO_DES=y CONFIG_CRC32=y CONFIG_GENERIC_HARDIRQS=y CONFIG_GENERIC_IRQ_PROBE=y CONFIG_X86_BIOS_REBOOT=y CONFIG_PC=y --------------070607080905030300090609-- From herbert@gondor.apana.org.au Sat Jan 8 14:33:32 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 08 Jan 2005 14:33:40 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j08MXVBS010878 for ; Sat, 8 Jan 2005 14:33:32 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CnaNh-0002dW-00; Sun, 09 Jan 2005 21:33:09 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CnaLo-00080H-00; Sun, 09 Jan 2005 21:31:12 +1100 Date: Sun, 9 Jan 2005 21:31:12 +1100 To: Jeff Garzik Cc: Netdev , YOSHIFUJI Hideaki / ???????????? Subject: Re: IPv6 badness continues Message-ID: <20050109103112.GA30653@gondor.apana.org.au> References: <41DA3A60.8050102@pobox.com> <20050108042509.GA1959@gondor.apana.org.au> <41E01746.3080501@pobox.com> <20050108183545.GA6413@gondor.apana.org.au> <41E084E0.9070709@pobox.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="oyUTqETQ0mS9luUI" Content-Disposition: inline In-Reply-To: <41E084E0.9070709@pobox.com> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13639 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev --oyUTqETQ0mS9luUI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Jan 08, 2005 at 08:12:00PM -0500, Jeff Garzik wrote: > > I applied the patch and tried it out. The kernel was practically > unusable, as the warning hit as soon as the kernel booted: Sorry. Should've tested it first. Please try this one instead. -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --oyUTqETQ0mS9luUI Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== net/ipv6/route.c 1.102 vs edited ===== --- 1.102/net/ipv6/route.c 2004-11-30 14:24:46 +11:00 +++ edited/net/ipv6/route.c 2005-01-09 21:28:05 +11:00 @@ -379,6 +379,7 @@ int err; write_lock_bh(&rt6_lock); + WARN_ON(rt->u.dst.obsolete > 0); err = fib6_add(&ip6_routing_table, rt, nlh, _rtattr); write_unlock_bh(&rt6_lock); --oyUTqETQ0mS9luUI-- From akpm@osdl.org Sat Jan 8 14:30:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 08 Jan 2005 14:31:00 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j08MUqPF010679 for ; Sat, 8 Jan 2005 14:30:53 -0800 Received: from bix (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id j09AUad24275; Sun, 9 Jan 2005 02:30:37 -0800 Date: Sun, 9 Jan 2005 02:30:24 -0800 From: Andrew Morton To: netdev@oss.sgi.com Cc: Jan Spitalnik Subject: Fw: oops in fib_get_next() Message-Id: <20050109023024.3e6e78bc.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13638 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Begin forwarded message: Date: Sat, 8 Jan 2005 17:00:24 +0100 From: Jan Spitalnik To: Linux Kernel Mailing List Subject: oops in fib_get_next() Hi I'm getting an oops in fib_get_next(). I've tried 2.6.10-rc2, 2.6.10 and 2.6.10-bk snapshot from today and they both exhibit this behviour. The oops below is from 2.6.10-bk. I'm not sure what in gkrellmd triggers this oops. Usually it happens after 1-2 days of running of the system. Thanks, jan Jan 8 08:01:06 bratrk kernel: Unable to handle kernel paging request at virtual address 00100100 Jan 8 08:01:06 bratrk kernel: printing eip: Jan 8 08:01:06 bratrk kernel: c026b1cf Jan 8 08:01:06 bratrk kernel: *pde = 00000000 Jan 8 08:01:06 bratrk kernel: Oops: 0000 [#1] Jan 8 08:01:06 bratrk kernel: Modules linked in: cls_fw sch_ingress ipt_length ipt_tos sch_sfq sch_htb ipt_CLASSIFY ipt_mark ipt_CONNMARK iptable_mangle ipt_MARK ipt_REJECT ipt_LOG ipt_limit ipt_mac iptable_filter dummy hostap_pci hostap e100 mii 3c59x ip_nat_irc ip_conntrack_irc ip_nat_ftp iptable_nat ip_tables ip_conntrack_ftp ip_conntrack Jan 8 08:01:06 bratrk kernel: CPU: 0 Jan 8 08:01:06 bratrk kernel: EIP: 0060:[fib_get_next+31/304] Not tainted VLI Jan 8 08:01:06 bratrk kernel: EFLAGS: 00010282 (2.6.10) Jan 8 08:01:06 bratrk kernel: EIP is at fib_get_next+0x1f/0x130 Jan 8 08:01:06 bratrk kernel: eax: c6f55360 ebx: 00100100 ecx: 00000001 edx: c75878e0 Jan 8 08:01:06 bratrk kernel: esi: c6e18160 edi: c73d7fac ebp: 00000400 esp: c73d7f1c Jan 8 08:01:06 bratrk kernel: ds: 007b es: 007b ss: 0068 Jan 8 08:01:06 bratrk kernel: Process gkrellmd (pid: 2522, threadinfo=c73d6000 task=c776c020) Jan 8 08:01:06 bratrk kernel: Stack: 00000028 c6f55360 c73d7fac 00000400 c026b31d c6f55360 00000000 c016704e Jan 8 08:01:06 bratrk kernel: c6f55360 c73d7f54 c46a1810 00000000 c73d7f74 c01107b8 00000028 00000000 Jan 8 08:01:06 bratrk kernel: 00000000 c6ae0380 c73d7fac 00000400 c0149418 c6ae0380 b7e0f000 00000400 Jan 8 08:01:06 bratrk kernel: Call Trace: Jan 8 08:01:06 bratrk kernel: [fib_seq_start+61/80] fib_seq_start+0x3d/0x50 Jan 8 08:01:06 bratrk kernel: [seq_read+174/672] seq_read+0xae/0x2a0 Jan 8 08:01:06 bratrk kernel: [recalc_task_prio+168/416] recalc_task_prio+0xa8/0x1a0 Jan 8 08:01:06 bratrk kernel: [vfs_read+200/368] vfs_read+0xc8/0x170 Jan 8 08:01:06 bratrk kernel: [sys_read+81/128] sys_read+0x51/0x80 Jan 8 08:01:06 bratrk kernel: [syscall_call+7/11] syscall_call+0x7/0xb Jan 8 08:01:06 bratrk kernel: Code: 4e 0c 89 5e 10 eb 85 90 8d 74 26 00 55 57 56 53 8b 44 24 14 8b 70 2c 8b 5e 10 8b 56 0c 85 db 74 21 85 d2 0f 84 fe 00 00 00 8b 1b <8b> 03 8d 74 26 00 8d 42 08 39 c3 74 0a 89 5e 10 89 d8 5b 5e 5f -- Jan Spitalnik jan@spitalnik.net Pain makes you beautiful. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ From hch@lst.de Sat Jan 8 16:14:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 08 Jan 2005 16:14:32 -0800 (PST) Received: from mail.lst.de (verein.lst.de [213.95.11.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j090EJod013579 for ; Sat, 8 Jan 2005 16:14:20 -0800 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id j09CE86t019619 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sun, 9 Jan 2005 13:14:08 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id j09CE78W019614; Sun, 9 Jan 2005 13:14:07 +0100 Date: Sun, 9 Jan 2005 13:14:07 +0100 From: Christoph Hellwig To: davem@davemloft.net, jgarzik@pobox.com Cc: netdev@oss.sgi.com Subject: [PATCH 1/2] add rtnl_lock_interruptible() Message-ID: <20050109121407.GA19599@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13640 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: netdev --- 1.47/include/linux/rtnetlink.h 2004-11-03 23:00:25 +01:00 +++ edited/include/linux/rtnetlink.h 2005-01-09 12:49:58 +01:00 @@ -806,6 +806,7 @@ } while(0) extern void rtnl_lock(void); +extern int rtnl_lock_interruptible(void); extern void rtnl_unlock(void); extern void rtnetlink_init(void); --- 1.30/net/core/rtnetlink.c 2004-12-01 07:04:20 +01:00 +++ edited/net/core/rtnetlink.c 2005-01-09 12:53:33 +01:00 @@ -57,6 +57,11 @@ { rtnl_shlock(); } + +int rtnl_lock_interruptible(void) +{ + return down_interruptible(&rtnl_sem); +} void rtnl_unlock(void) { @@ -696,5 +701,6 @@ EXPORT_SYMBOL(rtnetlink_put_metrics); EXPORT_SYMBOL(rtnl); EXPORT_SYMBOL(rtnl_lock); +EXPORT_SYMBOL(rtnl_lock_interruptible); EXPORT_SYMBOL(rtnl_sem); EXPORT_SYMBOL(rtnl_unlock); From hch@lst.de Sat Jan 8 16:16:41 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 08 Jan 2005 16:16:45 -0800 (PST) Received: from mail.lst.de (verein.lst.de [213.95.11.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j090Geop014078 for ; Sat, 8 Jan 2005 16:16:41 -0800 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id j09CGU6t019642 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sun, 9 Jan 2005 13:16:30 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id j09CGU10019640; Sun, 9 Jan 2005 13:16:30 +0100 Date: Sun, 9 Jan 2005 13:16:30 +0100 From: Christoph Hellwig To: davem@davemloft.net, jgarzik@pobox.com Cc: netdev@oss.sgi.com Subject: [PATCH 2/2] use rtnl_lock_interruptible in 8139 to avoid shutdown hang Message-ID: <20050109121630.GB19599@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13641 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: netdev The 8139too thread needs to use rtnl_lock_interruptible so it can avoid doing the actual work once it's been kill_proc()ed on module removal time. Based on debugging and an earlier patch that adds a driver-private semaphore from Herbert Xu. --- 1.101/drivers/net/8139too.c 2004-10-30 02:00:00 +02:00 +++ edited/drivers/net/8139too.c 2005-01-09 12:55:31 +01:00 @@ -1636,7 +1636,8 @@ if (tp->time_to_die) break; - rtnl_lock (); + if (rtnl_lock_interruptible ()) + break; rtl8139_thread_iter (dev, tp, tp->mmio_addr); rtnl_unlock (); } From hch@lst.de Sat Jan 8 17:33:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 08 Jan 2005 17:33:50 -0800 (PST) Received: from mail.lst.de (verein.lst.de [213.95.11.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j091Xj9j019199 for ; Sat, 8 Jan 2005 17:33:45 -0800 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id j09DXa6t020818 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sun, 9 Jan 2005 14:33:36 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id j09DXaQu020816; Sun, 9 Jan 2005 14:33:36 +0100 Date: Sun, 9 Jan 2005 14:33:35 +0100 From: Christoph Hellwig To: jgarzik@pobox.com Cc: netdev@oss.sgi.com Subject: [PATCH] mark arcdev_setup static Message-ID: <20050109133335.GA20801@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13642 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: netdev It's only used in arcnet.c, and following the model of the other link layers it doesn't make sense to use it outside alloc_arcdev() either. --- 1.19/drivers/net/arcnet/arcnet.c 2004-09-23 22:10:54 +02:00 +++ edited/drivers/net/arcnet/arcnet.c 2004-10-23 16:09:36 +02:00 @@ -91,7 +91,6 @@ EXPORT_SYMBOL(arc_proto_null); EXPORT_SYMBOL(arcnet_unregister_proto); EXPORT_SYMBOL(arcnet_debug); -EXPORT_SYMBOL(arcdev_setup); EXPORT_SYMBOL(alloc_arcdev); EXPORT_SYMBOL(arcnet_interrupt); @@ -305,7 +304,7 @@ /* Setup a struct device for ARCnet. */ -void arcdev_setup(struct net_device *dev) +static void arcdev_setup(struct net_device *dev) { dev->type = ARPHRD_ARCNET; dev->hard_header_len = sizeof(struct archdr); --- 1.7/include/linux/arcdevice.h 2004-10-05 22:16:18 +02:00 +++ edited/include/linux/arcdevice.h 2004-10-23 16:09:24 +02:00 @@ -330,7 +330,6 @@ void arcnet_unregister_proto(struct ArcProto *proto); irqreturn_t arcnet_interrupt(int irq, void *dev_id, struct pt_regs *regs); -void arcdev_setup(struct net_device *dev); struct net_device *alloc_arcdev(char *name); void arcnet_rx(struct net_device *dev, int bufnum); From pb@bieringer.de Sat Jan 8 21:42:06 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 08 Jan 2005 21:42:15 -0800 (PST) Received: from smtp2.aerasec.de (gromit.aerasec.de [195.226.187.57]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j095g2cV027675 for ; Sat, 8 Jan 2005 21:42:06 -0800 Received: from localhost (localhost [127.0.0.1]) by smtp2.aerasec.de (Postfix) with SMTP id 1EE4E137EE; Sun, 9 Jan 2005 18:41:49 +0100 (CET) X-AV-Checked: Sun Jan 9 18:41:49 2005 smtp2.aerasec.de Received: from p548001DE.dip.t-dialin.net (p548001DE.dip.t-dialin.net [84.128.1.222]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client did not present a certificate) by smtp2.aerasec.de (Postfix) with ESMTP id 486CE137EA; Sun, 9 Jan 2005 18:41:41 +0100 (CET) Date: Sun, 09 Jan 2005 18:41:38 +0100 From: Peter Bieringer To: usagi-users@linux-ipv6.org Cc: yasuyuki.kozakai@toshiba.co.jp, netdev@oss.sgi.com, laforge@gnumonks.org, kaber@trash.net, netfilter-devel@lists.netfilter.org Subject: Re: (usagi-users 03187) Re: netfilter6: ICMPv6 type 143 doesn't match Message-ID: <097631C1DDA76BD36ECBEFFD@gate.muc.bieringer.de> In-Reply-To: References: <6050E336B1A0D7D8E70C66F3@t1mobil.muc.aerasec.de> <200412270417.iBR4HZRG021429@toshiba.co.jp> <20041227.100205.102356251.yoshfuji@linux-ipv6.org> X-Mailer: Mulberry/3.1.6 (Linux/x86) X-URL: http://www.bieringer.de/pb/ X-OS: Linux MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13643 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pb@bieringer.de Precedence: bulk X-list: netdev --On Saturday, January 08, 2005 12:45:14 PM +0100 Peter Bieringer wrote: > 12:40:48.484375 fe80::****:**** > ff02::1: HBH (rtalert: 0x0000) > (padn)[icmp6 sum ok] icmp6: multicast listener query max resp delay: 2000 > addr: :: [hlim 1] (len 36) > 0x0000: 6000 0000 0024 0001 fe80 0000 0000 0000 `....$.......... > 0x0010: 0000 0000 **** **** ff02 0000 0000 0000 ................ > 0x0020: 0000 0000 0000 0001 3a00 0502 0000 0100 ........:....... > 0x0030: 8200 a03a 07d0 0000 0000 0000 0000 0000 ...:............ > 0x0040: 0000 0000 0000 0000 027d 0000 .........}.. > 12:42:42.046741 fe80::200:**ff:fe**:**** > ff02::16: HBH (rtalert: 0x0000) > (padn)[icmp6 sum ok] icmp6: type-#143 [hlim 1] (len 56) > 0x0000: 6000 0000 0038 0001 fe80 0000 0000 0000 `....8.......... > 0x0010: 0200 **ff fe** **** ff02 0000 0000 0000 .....*.......... > 0x0020: 0000 0000 0000 0016 3a00 0502 0000 0100 ........:....... > 0x0030: 8f00 a1d9 0000 0002 0300 0000 ff02 0000 ................ > 0x0040: 0000 0000 0000 0000 0001 0002 0300 0000 ................ > 0x0050: ff05 0000 0000 0000 0000 0000 0001 0003 ................ > I would be glad, if someone can more dig into and provide me patches for > kernel and probably also for tcpdump. I mentioned "tcpdump" here also because I played with tcpdump filters around and found that while tcpdump displays "icmp6" packet, the filter "icmp6" won't work at all, only the "ip6" filter matches. Understandable, because the next protocol is "00" (hop-by-hop), but I don't know whether this is well enough. My opinion is that tcpdump should be improved to be more smarter (if possible). Peter -- Dr. Peter Bieringer http://www.bieringer.de/pb/ GPG/PGP Key 0x958F422D mailto: pb at bieringer dot de Deep Space 6 Co-Founder and Core Member http://www.deepspace6.net/ From penguin@muskoka.com Sun Jan 9 06:49:59 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 06:50:04 -0800 (PST) Received: from gold.muskoka.com (gold.muskoka.com [216.123.107.5]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j09Enx6l021423 for ; Sun, 9 Jan 2005 06:49:59 -0800 Received: from muskoka.com (ppp133.muskoka.com [216.123.108.143]) by gold.muskoka.com (8.12.3/8.12.3/Debian-6.4) with ESMTP id j0A2qcGl020478; Sun, 9 Jan 2005 21:52:38 -0500 Message-ID: <41E1DCB4.1090902@muskoka.com> Date: Sun, 09 Jan 2005 20:39:00 -0500 From: Paul Gortmaker User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3.1) Gecko/20030425 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jeff Garzik CC: netdev@oss.sgi.com Subject: [PATCH 2.6.10] smc-ultra.c verbose driver Content-Type: multipart/mixed; boundary="------------090906020400050704050108" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13644 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: penguin@muskoka.com Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------090906020400050704050108 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit In keeping with the idea of a quiet boot time with less dmesg clutter, the smc-ultra driver should not be printing about the absence of PnP cards every time it goes probing -- e.g. if you have a non-PnP card installed, you get the message twice... Signed-off-by: Paul Gortmaker --------------090906020400050704050108 Content-Type: text/plain; name="2.6.10-smc-ultra_diff0" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="2.6.10-smc-ultra_diff0" --- linux-200/drivers/net/smc-ultra.c~ Sat Aug 14 01:38:37 2004 +++ linux-200/drivers/net/smc-ultra.c Sun Jan 9 20:33:06 2005 @@ -156,8 +156,6 @@ /* Look for any installed ISAPnP cards */ if (isapnp_present() && (ultra_probe_isapnp(dev) == 0)) return 0; - - printk(KERN_NOTICE "smc-ultra.c: No ISAPnP cards found, trying standard ones...\n"); #endif for (i = 0; ultra_portlist[i]; i++) { --------------090906020400050704050108-- From ak@suse.de Sun Jan 9 06:53:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 06:53:18 -0800 (PST) Received: from Cantor.suse.de (mail-ex.suse.de [195.135.220.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j09ErBod021938 for ; Sun, 9 Jan 2005 06:53:12 -0800 Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id B2F3012C8F8C; Mon, 10 Jan 2005 03:52:57 +0100 (CET) Date: Mon, 10 Jan 2005 03:52:53 +0100 From: Andi Kleen To: akpm@osdl.org Cc: netdev@oss.sgi.com, jgarzik@pobox.com, raghavendra.koushik@s2io.com Subject: [PATCH] Fix gcc4 compilation in s2io Message-ID: <20050110025253.GB5672@wotan.suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13645 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@suse.de Precedence: bulk X-list: netdev Fix gcc 4 compilation in the s2io driver Signed-off-by: Andi Kleen Index: linux/drivers/net/s2io.h =================================================================== --- linux.orig/drivers/net/s2io.h 2005-01-09 18:19:25.%N +0100 +++ linux/drivers/net/s2io.h 2005-01-09 19:04:40.%N +0100 @@ -740,8 +740,8 @@ { u64 ret = 0; ret = readl(addr + 4); - (u64) ret <<= 32; - (u64) ret |= readl(addr); + ret <<= 32; + ret |= readl(addr); return ret; } From andre@tomt.net Sun Jan 9 09:10:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 09:10:59 -0800 (PST) Received: from mx1.skjellin.no (mail1.skjellin.no [80.239.42.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j09HArv7028750 for ; Sun, 9 Jan 2005 09:10:54 -0800 Received: from localhost (localhost [127.0.0.1]) by mx1.skjellin.no (Postfix) with ESMTP id 28EBA88544 for ; Mon, 10 Jan 2005 06:10:45 +0100 (CET) Received: from puppen.pasop.tomt.net (gw-fe-1.pasop.tomt.net [10.255.1.1]) by mail1.skjellin.no (Postfix) with ESMTP id 4BBD188534 for ; Mon, 10 Jan 2005 06:10:44 +0100 (CET) Received: from [10.255.1.10] (slurv.pasop.tomt.net [10.255.1.10]) by puppen.pasop.tomt.net (Postfix) with ESMTP id 3B6D222D72 for ; Mon, 10 Jan 2005 06:10:44 +0100 (CET) Message-ID: <41E20E54.5030008@tomt.net> Date: Mon, 10 Jan 2005 06:10:44 +0100 From: Andre Tomt User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Netdev Subject: 2.6.10 vlan stuck on vconfig on interface removal Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at skjellin.no X-Virus-Status: Clean X-archive-position: 13646 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: andre@tomt.net Precedence: bulk X-list: netdev Hi! Another "unregister_netdevice: waiting for eth0.1 to become free. Usage count = 1" issue coming up.. Fun fun fun! And this one also seems to be related to the ipv6 stack. I can reproduce this reliably this by ifdown lo before ifdown'ing eth0.1. That is, if lo goes down first, vconfig rem eth0.1 gets stuck when run later. This only happens with ipv6.ko loaded. I havn't added *any* ipv6 adresses to any interace, the only one are those the ipv6-stack adds itself. This is hitting us often on our routers, as we have ipv6.ko loaded, and Debian runs ifdown -a (bring down all configured interfaces, starting with lo unfortunatly) on shutdown and reboot. Bringing down non-vlan interfaces works just fine after killing lo. a backtrace from vconfing captured with sysrq-T (quickly typed off-screen): shedule_timeout process_timeout netdev_wait_allrefs netdev_wait_allrefs netdev_run_todo unregister_vlan_device [8021q] vlan_ioctl_handler [8021q] sock_ioctl sys_ioctl syscall_call The lab machine is running with a minimalist config, no listeners besides sshd, ipv6.ko and 8021q.ko loaded. From okir@suse.de Sun Jan 9 17:08:14 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 17:08:20 -0800 (PST) Received: from Cantor.suse.de (cantor.suse.de [195.135.220.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A18DIj023923 for ; Sun, 9 Jan 2005 17:08:14 -0800 Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 13DF11307E06 for ; Mon, 10 Jan 2005 14:08:00 +0100 (CET) Date: Mon, 10 Jan 2005 14:07:59 +0100 From: Olaf Kirch To: netdev@oss.sgi.com Subject: TIOCSETD with PPP, mkiss, etc Message-ID: <20050110130759.GA16911@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13647 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: okir@suse.de Precedence: bulk X-list: netdev Hi, Wouldn't it be safer if the ldisc open function for PPP, mkiss etc included a check for CAP_NET_ADMIN privilege, and reject the attempt to set the line discipline if the user is not privileged? The slip module already has this check, but other modules don't. I looked at various protocol modules (ppp sync/async, mkiss, irtty, ...) and there is no immediate security problem; these modules either do not allocate a netdevice, or if they do, they check for netif_running() before they pass the decoded packet to the network layer. Still I think it's somewhat dangerous to allow a user to open a pty pair, set the slave's line discipline and feed it whatever he likes. Olaf -- Olaf Kirch | Things that make Monday morning interesting, #2: okir@suse.de | "We have 8,000 NFS mount points, why do we keep ---------------+ running out of privileged ports?" From okir@suse.de Sun Jan 9 17:17:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 17:17:52 -0800 (PST) Received: from Cantor.suse.de (cantor.suse.de [195.135.220.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A1HkfG031227 for ; Sun, 9 Jan 2005 17:17:47 -0800 Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 712A4130AC21; Mon, 10 Jan 2005 14:17:31 +0100 (CET) Date: Mon, 10 Jan 2005 14:17:09 +0100 From: Olaf Kirch To: Peter Bieringer Cc: usagi-users@linux-ipv6.org, yasuyuki.kozakai@toshiba.co.jp, netdev@oss.sgi.com, laforge@gnumonks.org, kaber@trash.net, netfilter-devel@lists.netfilter.org Subject: Re: (usagi-users 03180) Re: netfilter6: ICMPv6 type 143 doesn't match Message-ID: <20050110131709.GB16911@suse.de> References: <6050E336B1A0D7D8E70C66F3@t1mobil.muc.aerasec.de> <200412270417.iBR4HZRG021429@toshiba.co.jp> <20041227.100205.102356251.yoshfuji@linux-ipv6.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13648 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: okir@suse.de Precedence: bulk X-list: netdev On Sat, Jan 08, 2005 at 12:45:14PM +0100, Peter Bieringer wrote: > - ptr = IPV6_HDR_LEN; > + ptr = ((u8*)skb->nh.raw - skb->data) + IPV6_HDR_LEN; [...] > But it won't help :-(( The following works for me on 2.6.8: ptr = ((char *) ipv6 - (char *) skb->data) + IPV6_HDR_LEN; Older 2.6 kernels also do not call ipv6_skip_exthdr() in icmp6_match(); more recent kernels fix this. Olaf -- Olaf Kirch | Things that make Monday morning interesting, #2: okir@suse.de | "We have 8,000 NFS mount points, why do we keep ---------------+ running out of privileged ports?" From hadi@cyberus.ca Sun Jan 9 17:18:34 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 17:18:39 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A1IXmG001974 for ; Sun, 9 Jan 2005 17:18:33 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CnzR9-0001qC-Fw for netdev@oss.sgi.com; Mon, 10 Jan 2005 08:18:23 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CnzR1-0001lP-11; Mon, 10 Jan 2005 08:18:15 -0500 Subject: Re: [patch 4/10] s390: network driver. From: jamal Reply-To: hadi@cyberus.ca To: Tommy Christensen Cc: Jeff Garzik , Thomas Spatzier , "David S. Miller" , Hasso Tepper , Herbert Xu , netdev@oss.sgi.com, Paul Jakma In-Reply-To: <1105111605.3462.101.camel@tsc-6.cph.tpack.net> References: <1104764710.1048.580.camel@jzny.localdomain> <41DB26A6.2070008@pobox.com> <1104895169.1117.63.camel@jzny.localdomain> <41DC0931.80603@tpack.net> <1105019912.2314.20.camel@jzny.localdomain> <1105023972.3462.48.camel@tsc-6.cph.tpack.net> <1105104757.1046.63.camel@jzny.localdomain> <1105111605.3462.101.camel@tsc-6.cph.tpack.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105363092.1041.146.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 10 Jan 2005 08:18:12 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13649 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Fri, 2005-01-07 at 10:26, Tommy Christensen wrote: > On Fri, 2005-01-07 at 14:32, jamal wrote: > > On Thu, 2005-01-06 at 10:06, Tommy Christensen wrote: [..] > > reseting qdisc could certainly be part of the device watchdog. > > Note that once the packets are drained, the next thing that will happen > > if device is stopped for a dev->timeout period is watchdog kicking in > > and flushing the DMA. So you could reset your qdisc there though i am > > not sure it will be needed with that patch. > > Unfortunately the watchdog won't do this when carrier is off, which > is fair enough since the chip isn't hung as such. We may have to kick the dog in that path as well then. > So, we would need another method to flush out stale packets from > the DMA ring. Some drivers already do this themselves, and some won't > need it because they keep on running even when link is down. kicking tx_timeout seems like the right thing to do until i looked at the drivers. Sigh. I just stared at a few drivers and it is not pleasant - and they mostly have the same theme (so you cant say they are inconsistent). Looking at e1000 for example is quiet interesting - it actually brings down then up the device ;-> This will both flash the dma and reset qdisc but also loose any static routes. It will also reschedule the device;-< So i am not so sure that the dog kicking in a minute later is a good thing at all. We may need a lot of janitorial work to cleanse the drivers - something jgarzik is against. A qdisc_reset, as you suggest, will probably not cure the problem but provide some cosmetics. Thoughts? cheers, jamal From AAnthony@sbs.com Sun Jan 9 18:53:18 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 18:53:23 -0800 (PST) Received: from mail108.messagelabs.com (mail108.messagelabs.com [216.82.255.115]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A2rIKq031205 for ; Sun, 9 Jan 2005 18:53:18 -0800 X-VirusChecked: Checked X-Env-Sender: AAnthony@sbs.com X-Msg-Ref: server-15.tower-108.messagelabs.com!1105368783!6809937!1 X-StarScan-Version: 5.4.5; banners=sbs.com,-,- X-Originating-IP: [204.255.71.6] Received: (qmail 28990 invoked from network); 10 Jan 2005 14:53:03 -0000 Received: from user6.sbs.com (HELO abqex.sbscorp.sbs.com) (204.255.71.6) by server-15.tower-108.messagelabs.com with SMTP; 10 Jan 2005 14:53:03 -0000 Received: by abqex.sbscorp.sbs.com with Internet Mail Service (5.5.2657.72) id ; Mon, 10 Jan 2005 07:53:02 -0700 Message-ID: <4F23E557A0317D45864097982DE907941A32B1@pilotmail.sbscorp.sbs.com> From: Adam Anthony To: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Cc: Adam Anthony Subject: [PATCH] /driver/net/wan/sbs520 Date: Mon, 10 Jan 2005 07:46:52 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13650 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: AAnthony@sbs.com Precedence: bulk X-list: netdev SGI and Kernel Maintainers, With the permission of my employer, SBS Technologies, Inc., I have released a patch for 2.4 kernels that supports the 520 Series of WAN adapters. (A similar patch for 2.6 kernels will soon follow) The driver itself has been tested by many customers, but as of this morning, the patch has only been tested by me. I have created a Source Forge project for the patch/GPL driver, which can be viewed at the following location: "https://sourceforge.net/projects/sbs520lnxdrv/". The patch can be downloaded directly from the following link: "http://prdownloads.sourceforge.net/sbs520lnxdrv/sbs520patch.bz2?download" It would be great to receive some feedback on our work, and we hope that this driver will eventually be added to the kernel. Best regards, Adam Signed-off-by: Adam T. Anthony For limitations on the use and distribution of this message, please visit www.sbs.com/emaildisclaimer. From hadi@cyberus.ca Sun Jan 9 19:00:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 19:00:13 -0800 (PST) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A301kE031729 for ; Sun, 9 Jan 2005 19:00:01 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.30) id 1Co11K-0008Pr-Rm for netdev@oss.sgi.com; Mon, 10 Jan 2005 09:59:50 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CnzYu-0002Yd-Nw; Mon, 10 Jan 2005 08:26:25 -0500 Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: netdev@oss.sgi.com In-Reply-To: <20050108145457.GZ26856@postel.suug.ch> References: <20050103125635.GB26856@postel.suug.ch> <20050104223612.GN26856@postel.suug.ch> <1104894728.1117.56.camel@jzny.localdomain> <20050105110048.GO26856@postel.suug.ch> <1104931991.1117.152.camel@jzny.localdomain> <20050105144514.GQ26856@postel.suug.ch> <1105019225.2312.7.camel@jzny.localdomain> <20050106194102.GW26856@postel.suug.ch> <1105105511.1046.77.camel@jzny.localdomain> <20050108145457.GZ26856@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105363582.1041.162.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 10 Jan 2005 08:26:22 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13651 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Sat, 2005-01-08 at 09:54, Thomas Graf wrote: > * jamal <1105105511.1046.77.camel@jzny.localdomain> 2005-01-07 08:45 > > > 3) Fill out a pkt_info struct with ptr and off2 so we don't lose > > > hashing capabilities > > > > And this is why i dont like it. > > What's the reason for not liking it? I know it's not a perfect solution > in terms of layers but having the classifier sharing already gathered > information to an ematch is not a bad thing. I think its _a hack_ Thomas ;-> Mostly because it has dependency on u32. off2 doesnt exist on any other classifier and the basic ematch should be usable by any classifier. > The easiest way is to introduce a new TLV type and regard configuration > requests carrying the old type in compatibility mode. > Sounds reasonable. > > The trick would be to always use sel2 and present no kconfig options for back > > compat. We need to figure out how to recognize an old style dump and we are > > set. > > Given we always use the new method by converting old style parameters > and we use em_u32 as u32 key we would need to put a dependcy on ematch > && em_u32 for cls_u32. > I think that you should kill this em_u32 idea if it works only with u32. > > Above you are trying to insert off2 into the info (what i said i didnt > > like) - how are you going to achieve the same with a standalone en_u32 > > from say you basic classifier? > > I won't and it's not necessary, one can use u32 if he requires the > nexthdr capabilities or otherwise use em_cmp support the skb layers. > (Which i know is not perfect since the pointers to those layers are > not provided all the time). Why not just have a check to see if it is native match then not to call up any ematch executing code. Have the native match maybe be of kind 0. Have the return code for ematch lookup return something that indicates that you need to match using local u32 instead of ematch. cheers, jamal From dave@thedillows.org Sun Jan 9 19:37:10 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 19:38:17 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A3b9ds000664 for ; Sun, 9 Jan 2005 19:37:09 -0800 Received: (qmail 30240 invoked by uid 0); 10 Jan 2005 15:36:47 -0000 Received: from user-69-1-45-93.knology.net (HELO ori.thedillows.org) (69.1.45.93) by smtp1.knology.net with SMTP; 10 Jan 2005 15:36:47 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0AFb0XM028647; Mon, 10 Jan 2005 10:37:00 -0500 Received: (from root@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0AFb0ED028646; Mon, 10 Jan 2005 10:37:00 -0500 Date: Mon, 10 Jan 2005 10:37:00 -0500 To: netdev@oss.sgi.com Cc: dave@thedillows.org From: David Dillow Subject: [RFC BK 9/22] xfrm offload v2: Split AH header initialization from zeroing of mutable fields Message-Id: <20040110014300.18@ori.thedillows.org> References: <20040110014300.17@ori.thedillows.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13652 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 00:49:43-05:00 dave@thedillows.org # Seperate AH header initialization from the zeroing of mutable # IP header fields in preparation for offloading the crypto # processing of the packet. # # Signed-off-by: David Dillow # # net/ipv4/ah4.c # 2005/01/10 00:49:27-05:00 dave@thedillows.org +18 -12 # Seperate AH header initialization from the zeroing of mutable # IP header fields in preparation for offloading the crypto # processing of the packet. # # Signed-off-by: David Dillow # diff -Nru a/net/ipv4/ah4.c b/net/ipv4/ah4.c --- a/net/ipv4/ah4.c 2005-01-10 01:19:00 -05:00 +++ b/net/ipv4/ah4.c 2005-01-10 01:19:00 -05:00 @@ -69,6 +69,20 @@ top_iph = skb->nh.iph; iph = &tmp_iph.iph; + ah = (struct ip_auth_hdr *)((char *)top_iph+top_iph->ihl*4); + ah->nexthdr = top_iph->protocol; + + top_iph->tot_len = htons(skb->len); + top_iph->protocol = IPPROTO_AH; + + ahp = x->data; + ah->hdrlen = (XFRM_ALIGN8(sizeof(struct ip_auth_hdr) + + ahp->icv_trunc_len) >> 2) - 2; + + ah->reserved = 0; + ah->spi = x->id.spi; + ah->seq_no = htonl(x->replay.oseq + 1); + iph->tos = top_iph->tos; iph->ttl = top_iph->ttl; iph->frag_off = top_iph->frag_off; @@ -81,23 +95,11 @@ goto error; } - ah = (struct ip_auth_hdr *)((char *)top_iph+top_iph->ihl*4); - ah->nexthdr = top_iph->protocol; - top_iph->tos = 0; - top_iph->tot_len = htons(skb->len); top_iph->frag_off = 0; top_iph->ttl = 0; - top_iph->protocol = IPPROTO_AH; top_iph->check = 0; - ahp = x->data; - ah->hdrlen = (XFRM_ALIGN8(sizeof(struct ip_auth_hdr) + - ahp->icv_trunc_len) >> 2) - 2; - - ah->reserved = 0; - ah->spi = x->id.spi; - ah->seq_no = htonl(++x->replay.oseq); ahp->icv(ahp, skb, ah->auth_data); top_iph->tos = iph->tos; @@ -108,6 +110,10 @@ memcpy(top_iph+1, iph+1, top_iph->ihl*4 - sizeof(struct iphdr)); } + /* Delay incrementing the replay sequence until we know we're going + * to send this packet to prevent gaps. + */ + x->replay.oseq++; ip_send_check(top_iph); err = 0; From dave@thedillows.org Sun Jan 9 19:37:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 19:38:17 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A3b8R1000642 for ; Sun, 9 Jan 2005 19:37:09 -0800 Received: (qmail 30220 invoked by uid 0); 10 Jan 2005 15:36:46 -0000 Received: from user-69-1-45-93.knology.net (HELO ori.thedillows.org) (69.1.45.93) by smtp1.knology.net with SMTP; 10 Jan 2005 15:36:46 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0AFaxu4028623; Mon, 10 Jan 2005 10:36:59 -0500 Received: (from root@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0AFaxdT028622; Mon, 10 Jan 2005 10:36:59 -0500 Date: Mon, 10 Jan 2005 10:36:59 -0500 To: netdev@oss.sgi.com Cc: dave@thedillows.org From: David Dillow Subject: [RFC BK 3/22] xfrm offload v2: Add offload management routines Message-Id: <20040110014300.12@ori.thedillows.org> References: <20040110014300.11@ori.thedillows.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13654 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 00:05:38-05:00 dave@thedillows.org # Add offload management to xfrm_state. # # xfrm_offload_alloc() creates a new xfrm_offload, with a private # part to be used by the driver (ala net_device->priv) # The returned offload may be kfree'd if it has not been # added to a xfrm_state using xfrm_state_offload_add(). # xfrm_offload_priv() returns a pointer to the private area of # the xfrm_offload. This will be 8-byte aligned. # xfrm_offload_hold()/xfrm_offload_release() do the reference # counting of the xfrm_offload # xfrm_offload_get() looks up the xfrm_offload from a given device # The caller should call xfrm_offload_release() when it is # finished with this offload. # xfrm_state_offload_add() adds a new offload to the xfrm_state, # replacing any existing offload for the device that may # exist for this xfrm_state. # # Signed-off-by: David Dillow # # net/xfrm/xfrm_state.c # 2005/01/10 00:05:20-05:00 dave@thedillows.org +28 -0 # Clean up any offloads on destruction of an xfrm_state, and # allow the addition of new xfrm_offloads to a xfrm_state. # # Signed-off-by: David Dillow # # net/xfrm/xfrm_export.c # 2005/01/10 00:05:20-05:00 dave@thedillows.org +2 -0 # Export xfrm_state_offload_add() to drivers. # # Signed-off-by: David Dillow # # include/net/xfrm.h # 2005/01/10 00:05:20-05:00 dave@thedillows.org +79 -0 # Add offload management to xfrm_state. # # Add xfrm_offload_alloc(), xfrm_offload_priv(), xfrm_offload_hold() # xfrm_offload_release(), and xfrm_offload_get(). # # Signed-off-by: David Dillow # diff -Nru a/include/net/xfrm.h b/include/net/xfrm.h --- a/include/net/xfrm.h 2005-01-10 01:20:15 -05:00 +++ b/include/net/xfrm.h 2005-01-10 01:20:15 -05:00 @@ -81,6 +81,8 @@ metrics. Plus, it will be made via sk->sk_dst_cache. Solved. */ +struct xfrm_offload; + /* Full description of state of transformer. */ struct xfrm_state { @@ -149,6 +151,9 @@ /* Intended direction of this state, used for offloading */ u8 dir; + + /* List of offload cookies, per device */ + struct list_head offloads; }; enum { @@ -166,6 +171,13 @@ XFRM_STATE_DIR_OUT, }; +struct xfrm_offload +{ + struct list_head bydev; + struct net_device * dev; + atomic_t refcnt; +}; + struct xfrm_type; struct xfrm_dst; struct xfrm_policy_afinfo { @@ -905,5 +917,72 @@ (struct in6_addr *)b); } } + +#define XFRM_OFFLOAD_ALIGN 8 +#define XFRM_OFFLOAD_ALIGN_CONST (XFRM_OFFLOAD_ALIGN - 1) + +static inline struct xfrm_offload * +xfrm_offload_alloc(int sizeof_priv, struct net_device *dev, int mask) +{ + struct xfrm_offload *xol; + int alloc_size; + + alloc_size = (sizeof(*xol) + XFRM_OFFLOAD_ALIGN_CONST) + & ~XFRM_OFFLOAD_ALIGN_CONST; + alloc_size += sizeof_priv; + xol = kmalloc(alloc_size, mask); + if (xol) { + memset(xol, 0, alloc_size); + INIT_LIST_HEAD(&xol->bydev); + atomic_set(&xol->refcnt, 1); + xol->dev = dev; + } + + return xol; +} + +static inline void *xfrm_offload_priv(struct xfrm_offload *xol) +{ + return (char *)xol + ((sizeof(*xol) + XFRM_OFFLOAD_ALIGN_CONST) + & ~XFRM_OFFLOAD_ALIGN_CONST); +} + +static inline void xfrm_offload_hold(struct xfrm_offload *xol) +{ + atomic_inc(&xol->refcnt); +} + +static inline void xfrm_offload_release(struct xfrm_offload *xol) +{ + if (xol) { + WARN_ON(atomic_read(&xol->refcnt) < 1); + if (atomic_dec_and_test(&xol->refcnt)) { + xol->dev->xfrm_state_del(xol->dev, xol); + dev_put(xol->dev); + kfree(xol); + } + } +} + +static inline struct xfrm_offload *xfrm_offload_get(struct xfrm_state *x, + struct net_device *dev) +{ + struct xfrm_offload *xol, *ret = NULL; + + spin_lock(&x->lock); + list_for_each_entry(xol, &x->offloads, bydev) { + if (xol->dev == dev) { + xfrm_offload_hold(xol); + ret = xol; + break; + } + } + spin_unlock(&x->lock); + + return ret; +} + +extern void xfrm_state_offload_add(struct xfrm_state *x, + struct xfrm_offload *xol); #endif /* _NET_XFRM_H */ diff -Nru a/net/xfrm/xfrm_export.c b/net/xfrm/xfrm_export.c --- a/net/xfrm/xfrm_export.c 2005-01-10 01:20:15 -05:00 +++ b/net/xfrm/xfrm_export.c 2005-01-10 01:20:15 -05:00 @@ -60,3 +60,5 @@ EXPORT_SYMBOL_GPL(xfrm_ealg_get_byname); EXPORT_SYMBOL_GPL(xfrm_calg_get_byname); EXPORT_SYMBOL_GPL(skb_icv_walk); + +EXPORT_SYMBOL_GPL(xfrm_state_offload_add); diff -Nru a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c --- a/net/xfrm/xfrm_state.c 2005-01-10 01:20:15 -05:00 +++ b/net/xfrm/xfrm_state.c 2005-01-10 01:20:15 -05:00 @@ -56,6 +56,12 @@ static void xfrm_state_gc_destroy(struct xfrm_state *x) { + if (!list_empty(&x->offloads)) { + struct xfrm_offload *xol, *next; + + list_for_each_entry_safe(xol, next, &x->offloads, bydev) + xfrm_offload_release(xol); + } if (del_timer(&x->timer)) BUG(); if (x->aalg) @@ -181,6 +187,7 @@ atomic_set(&x->tunnel_users, 0); INIT_LIST_HEAD(&x->bydst); INIT_LIST_HEAD(&x->byspi); + INIT_LIST_HEAD(&x->offloads); init_timer(&x->timer); x->timer.function = xfrm_timer_handler; x->timer.data = (unsigned long)x; @@ -944,6 +951,27 @@ xfrm_state_put(t); x->tunnel = NULL; } +} + +void xfrm_state_offload_add(struct xfrm_state *x, struct xfrm_offload *xol) +{ + struct xfrm_offload *entry, *old = NULL; + + spin_lock(&x->lock); + list_for_each_entry(entry, &x->offloads, bydev) { + if (entry->dev == xol->dev) { + list_del(&entry->bydev); + old = entry; + break; + } + } + + dev_hold(xol->dev); + list_add_tail(&xol->bydev, &x->offloads); + spin_unlock(&x->lock); + + if(old) + xfrm_offload_release(old); } void __init xfrm_state_init(void) From dave@thedillows.org Sun Jan 9 19:37:10 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 19:38:17 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A3b9O4000665 for ; Sun, 9 Jan 2005 19:37:09 -0800 Received: (qmail 1926 invoked by uid 0); 10 Jan 2005 15:35:19 -0000 Received: from user-69-1-45-93.knology.net (HELO ori.thedillows.org) (69.1.45.93) by smtp5.knology.net with SMTP; 10 Jan 2005 15:35:19 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0AFb1A6028655; Mon, 10 Jan 2005 10:37:01 -0500 Received: (from root@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0AFb11L028654; Mon, 10 Jan 2005 10:37:01 -0500 Date: Mon, 10 Jan 2005 10:37:01 -0500 To: netdev@oss.sgi.com Cc: dave@thedillows.org From: David Dillow Subject: [RFC BK 11/22] xfrm offload v2: Add offloading of inbound AH & ESP packets Message-Id: <20040110014300.20@ori.thedillows.org> References: <20040110014300.19@ori.thedillows.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 00:51:49-05:00 dave@thedillows.org # Add crypto offload for inbound IPv4 AH xfrms. # # Signed-off-by: David Dillow # # net/ipv4/esp4.c # 2005/01/10 00:51:33-05:00 dave@thedillows.org +30 -16 # Add crypto offload for inbound IPv4 AH xfrms. # # Signed-off-by: David Dillow # # net/ipv4/ah4.c # 2005/01/10 00:51:33-05:00 dave@thedillows.org +13 -4 # Add crypto offload for inbound IPv4 AH xfrms. # # Signed-off-by: David Dillow # diff -Nru a/net/ipv4/ah4.c b/net/ipv4/ah4.c --- a/net/ipv4/ah4.c 2005-01-10 01:18:35 -05:00 +++ b/net/ipv4/ah4.c 2005-01-10 01:18:35 -05:00 @@ -138,6 +138,7 @@ struct iphdr *iph; struct ip_auth_hdr *ah; struct ah_data *ahp; + int offload; char work_buf[60]; if (!pskb_may_pull(skb, sizeof(struct ip_auth_hdr))) @@ -164,6 +165,7 @@ ah = (struct ip_auth_hdr*)skb->data; iph = skb->nh.iph; + offload = skb_pop_xfrm_result(skb); memcpy(work_buf, iph, iph->ihl*4); @@ -181,10 +183,17 @@ memcpy(auth_data, ah->auth_data, ahp->icv_trunc_len); skb_push(skb, skb->data - skb->nh.raw); - ahp->icv(ahp, skb, ah->auth_data); - if (memcmp(ah->auth_data, auth_data, ahp->icv_trunc_len)) { - x->stats.integrity_failed++; - goto out; + if (offload & XFRM_OFFLOAD_AUTH) { + if (unlikely(offload & XFRM_OFFLOAD_AUTH_FAIL)) { + x->stats.integrity_failed++; + goto out; + } + } else { + ahp->icv(ahp, skb, ah->auth_data); + if (memcmp(ah->auth_data, auth_data, ahp->icv_trunc_len)) { + x->stats.integrity_failed++; + goto out; + } } } ((struct iphdr*)work_buf)->protocol = ah->nexthdr; diff -Nru a/net/ipv4/esp4.c b/net/ipv4/esp4.c --- a/net/ipv4/esp4.c 2005-01-10 01:18:35 -05:00 +++ b/net/ipv4/esp4.c 2005-01-10 01:18:35 -05:00 @@ -164,6 +164,7 @@ int elen = skb->len - sizeof(struct ip_esp_hdr) - esp->conf.ivlen - alen; int nfrags; int encap_len = 0; + int offload; if (!pskb_may_pull(skb, sizeof(struct ip_esp_hdr))) goto out; @@ -171,22 +172,32 @@ if (elen <= 0 || (elen & (blksize-1))) goto out; + offload = skb_pop_xfrm_result(skb); + /* If integrity check is required, do this. */ if (esp->auth.icv_full_len) { - u8 sum[esp->auth.icv_full_len]; - u8 sum1[alen]; + if (unlikely(offload & XFRM_OFFLOAD_AUTH_FAIL)) { + x->stats.integrity_failed++; + goto out; + } + + if (!(offload & XFRM_OFFLOAD_AUTH)) { + u8 sum[esp->auth.icv_full_len]; + u8 sum1[alen]; - esp->auth.icv(esp, skb, 0, skb->len-alen, sum); + esp->auth.icv(esp, skb, 0, skb->len-alen, sum); - if (skb_copy_bits(skb, skb->len-alen, sum1, alen)) - BUG(); + if (skb_copy_bits(skb, skb->len-alen, sum1, alen)) + BUG(); - if (unlikely(memcmp(sum, sum1, alen))) { - x->stats.integrity_failed++; - goto out; + if (unlikely(memcmp(sum, sum1, alen))) { + x->stats.integrity_failed++; + goto out; + } } } + /* XXX I think this can be moved to the !offload case */ if ((nfrags = skb_cow_data(skb, 0, &trailer)) < 0) goto out; @@ -195,15 +206,12 @@ esph = (struct ip_esp_hdr*)skb->data; iph = skb->nh.iph; - /* Get ivec. This can be wrong, check against another impls. */ - if (esp->conf.ivlen) - crypto_cipher_set_iv(esp->conf.tfm, esph->enc_data, crypto_tfm_alg_ivsize(esp->conf.tfm)); - - { - u8 nexthdr[2]; + if (!(offload & XFRM_OFFLOAD_CONF)) { struct scatterlist *sg = &esp->sgbuf[0]; - u8 workbuf[60]; - int padlen; + + /* Get ivec. This can be wrong, check against another impls. */ + if (esp->conf.ivlen) + crypto_cipher_set_iv(esp->conf.tfm, esph->enc_data, crypto_tfm_alg_ivsize(esp->conf.tfm)); if (unlikely(nfrags > ESP_NUM_FAST_SG)) { sg = kmalloc(sizeof(struct scatterlist)*nfrags, GFP_ATOMIC); @@ -214,6 +222,12 @@ crypto_cipher_decrypt(esp->conf.tfm, sg, sg, elen); if (unlikely(sg != &esp->sgbuf[0])) kfree(sg); + } + + { + u8 nexthdr[2]; + u8 workbuf[60]; + int padlen; if (skb_copy_bits(skb, skb->len-alen-2, nexthdr, 2)) BUG(); From dave@thedillows.org Sun Jan 9 19:37:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 19:38:21 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A3bAWm000702 for ; Sun, 9 Jan 2005 19:37:11 -0800 Received: (qmail 12784 invoked by uid 0); 10 Jan 2005 15:45:40 -0000 Received: from user-69-1-45-93.knology.net (HELO ori.thedillows.org) (69.1.45.93) by smtp7.knology.net with SMTP; 10 Jan 2005 15:45:40 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0AFb2Zu028675; Mon, 10 Jan 2005 10:37:02 -0500 Received: (from root@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0AFb2rX028674; Mon, 10 Jan 2005 10:37:02 -0500 Date: Mon, 10 Jan 2005 10:37:02 -0500 To: netdev@oss.sgi.com Cc: dave@thedillows.org From: David Dillow Subject: [RFC BK 16/22] xfrm offload v2: typhoon: collect crypto offload capabilities Message-Id: <20040110014300.25@ori.thedillows.org> References: <20040110014300.24@ori.thedillows.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 9 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 00:57:15-05:00 dave@thedillows.org # Collect some information about the Typhoon's offload capabilities, # and store it for future use. # # Signed-off-by: David Dillow # # drivers/net/typhoon.h # 2005/01/10 00:56:57-05:00 dave@thedillows.org +14 -0 # Add the reply message format for the crypto capability query command. # # Signed-off-by: David Dillow # # drivers/net/typhoon.c # 2005/01/10 00:56:57-05:00 dave@thedillows.org +56 -0 # Collect some information about the Typhoon's offload capabilities, # and store it for future use. # # Signed-off-by: David Dillow # diff -Nru a/drivers/net/typhoon.c b/drivers/net/typhoon.c --- a/drivers/net/typhoon.c 2005-01-10 01:17:33 -05:00 +++ b/drivers/net/typhoon.c 2005-01-10 01:17:33 -05:00 @@ -304,6 +304,12 @@ u16 wol_events; u32 offload; + u16 tx_sa_max; + u16 rx_sa_max; + u16 tx_sa_avail; + u16 rx_sa_avail; + int sa_count; + /* unused stuff (future use) */ int capabilities; struct transmit_ring txHiRing; @@ -2104,6 +2110,53 @@ return 0; } +static inline int +typhoon_ipsec_init(struct typhoon *tp) +{ + struct cmd_desc xp_cmd; + struct resp_desc xp_resp; + struct ipsec_info_desc *info = (struct ipsec_info_desc *) &xp_resp; + u16 last_tx, last_rx, last_cap; + int err; + + last_tx = tp->tx_sa_max; + last_rx = tp->rx_sa_max; + last_cap = tp->capabilities; + + INIT_COMMAND_WITH_RESPONSE(&xp_cmd, TYPHOON_CMD_READ_IPSEC_INFO); + err = typhoon_issue_command(tp, 1, &xp_cmd, 1, &xp_resp); + if(err < 0) + goto out; + + /* We're not up yet, so no need to lock this -- we cannot modify + * these fields yet. + */ + tp->tx_sa_avail = tp->tx_sa_max = le16_to_cpu(info->tx_sa_max); + tp->rx_sa_avail = tp->rx_sa_max = le16_to_cpu(info->rx_sa_max); + tp->sa_count = 0; + + /* Typhoon2 was originally going to have variable crypto capabilities, + * subject to registration with 3Com. It appears they have decided + * to just enable 3DES as well. + */ + if(tp->capabilities & TYPHOON_CRYPTO_VARIABLE) { + tp->capabilities &= ~TYPHOON_CRYPTO_VARIABLE; + tp->capabilities |= TYPHOON_CRYPTO_DES | TYPHOON_CRYPTO_3DES; + } + + if(last_tx != tp->tx_sa_max || last_rx != tp->rx_sa_max || + last_cap != tp->capabilities) { + printk(KERN_INFO "%s: IPSEC offload %s%s %d Tx %d Rx\n", + tp->name, + tp->capabilities & TYPHOON_CRYPTO_DES ? "DES " : "", + tp->capabilities & TYPHOON_CRYPTO_3DES ? "3DES" : "", + tp->tx_sa_max, tp->rx_sa_max); + } + +out: + return err; +} + static int typhoon_start_runtime(struct typhoon *tp) { @@ -2126,6 +2179,9 @@ err = -EIO; goto error_out; } + + if(typhoon_ipsec_init(tp)) + goto error_out; INIT_COMMAND_NO_RESPONSE(&xp_cmd, TYPHOON_CMD_SET_MAX_PKT_SIZE); xp_cmd.parm1 = cpu_to_le16(PKT_BUF_SZ); diff -Nru a/drivers/net/typhoon.h b/drivers/net/typhoon.h --- a/drivers/net/typhoon.h 2005-01-10 01:17:33 -05:00 +++ b/drivers/net/typhoon.h 2005-01-10 01:17:33 -05:00 @@ -487,6 +487,20 @@ u32 unused2; } __attribute__ ((packed)); +/* TYPHOON_CMD_READ_IPSEC_INFO response descriptor + */ +struct ipsec_info_desc { + u8 flags; + u8 numDesc; + u16 cmd; + u16 seqNo; + u16 des_enabled; + u16 tx_sa_max; + u16 rx_sa_max; + u16 tx_sa_count; + u16 rx_sa_count; +} __attribute__ ((packed)); + /* TYPHOON_CMD_SET_OFFLOAD_TASKS bits (cmd.parm2 (Tx) & cmd.parm3 (Rx)) * This is all for IPv4. */ From dave@thedillows.org Sun Jan 9 19:37:10 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 19:38:17 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A3b9DR000663 for ; Sun, 9 Jan 2005 19:37:09 -0800 Received: (qmail 1444 invoked by uid 0); 10 Jan 2005 15:37:23 -0000 Received: from user-69-1-45-93.knology.net (HELO ori.thedillows.org) (69.1.45.93) by smtp2.knology.net with SMTP; 10 Jan 2005 15:37:23 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0AFb16D028651; Mon, 10 Jan 2005 10:37:01 -0500 Received: (from root@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0AFb1tw028650; Mon, 10 Jan 2005 10:37:01 -0500 Date: Mon, 10 Jan 2005 10:37:01 -0500 To: netdev@oss.sgi.com Cc: dave@thedillows.org From: David Dillow Subject: [RFC BK 10/22] xfrm offload v2: Add offloading of outbound AH & ESP packets Message-Id: <20040110014300.19@ori.thedillows.org> References: <20040110014300.18@ori.thedillows.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13652 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 00:50:28-05:00 dave@thedillows.org # Add crypto processing for outbound AH and ESP xfrms (IPv4). # # Signed-off-by: David Dillow # # net/ipv4/esp4.c # 2005/01/10 00:50:12-05:00 dave@thedillows.org +35 -21 # Add crypto offload for outbound ESP (IPv4) xfrms. Note that we always # generate a random IV, as we are not guaranteed to have any state in # the software crypto engine (we may have always been offloaded), and # we cannot rely on secure IV generation by the NIC driver/hw. # # Signed-off-by: David Dillow # # net/ipv4/ah4.c # 2005/01/10 00:50:12-05:00 dave@thedillows.org +31 -21 # Add crypto offload for outbound AH (IPv4) xfrms. Note that the NIC # driver/hw is responsible for zeroing the mutable IP header fields. # # Signed-off-by: David Dillow # diff -Nru a/net/ipv4/ah4.c b/net/ipv4/ah4.c --- a/net/ipv4/ah4.c 2005-01-10 01:18:48 -05:00 +++ b/net/ipv4/ah4.c 2005-01-10 01:18:48 -05:00 @@ -83,31 +83,41 @@ ah->spi = x->id.spi; ah->seq_no = htonl(x->replay.oseq + 1); - iph->tos = top_iph->tos; - iph->ttl = top_iph->ttl; - iph->frag_off = top_iph->frag_off; - - if (top_iph->ihl != 5) { - iph->daddr = top_iph->daddr; - memcpy(iph+1, top_iph+1, top_iph->ihl*4 - sizeof(struct iphdr)); - err = ip_clear_mutable_options(top_iph, &top_iph->daddr); - if (err) + if (dst->xfrm_offload) { + err = -ENOMEM; + xfrm_offload_hold(dst->xfrm_offload); + if (skb_push_xfrm_offload(skb, dst->xfrm_offload)) { + xfrm_offload_release(dst->xfrm_offload); goto error; - } + } + } else { + /* Not offloaded, manually calculate the auth hash */ + iph->tos = top_iph->tos; + iph->ttl = top_iph->ttl; + iph->frag_off = top_iph->frag_off; + + if (top_iph->ihl != 5) { + iph->daddr = top_iph->daddr; + memcpy(iph+1, top_iph+1, top_iph->ihl*4 - sizeof(struct iphdr)); + err = ip_clear_mutable_options(top_iph, &top_iph->daddr); + if (err) + goto error; + } - top_iph->tos = 0; - top_iph->frag_off = 0; - top_iph->ttl = 0; - top_iph->check = 0; + top_iph->tos = 0; + top_iph->frag_off = 0; + top_iph->ttl = 0; + top_iph->check = 0; - ahp->icv(ahp, skb, ah->auth_data); + ahp->icv(ahp, skb, ah->auth_data); - top_iph->tos = iph->tos; - top_iph->ttl = iph->ttl; - top_iph->frag_off = iph->frag_off; - if (top_iph->ihl != 5) { - top_iph->daddr = iph->daddr; - memcpy(top_iph+1, iph+1, top_iph->ihl*4 - sizeof(struct iphdr)); + top_iph->tos = iph->tos; + top_iph->ttl = iph->ttl; + top_iph->frag_off = iph->frag_off; + if (top_iph->ihl != 5) { + top_iph->daddr = iph->daddr; + memcpy(top_iph+1, iph+1, top_iph->ihl*4 - sizeof(struct iphdr)); + } } /* Delay incrementing the replay sequence until we know we're going diff -Nru a/net/ipv4/esp4.c b/net/ipv4/esp4.c --- a/net/ipv4/esp4.c 2005-01-10 01:18:48 -05:00 +++ b/net/ipv4/esp4.c 2005-01-10 01:18:48 -05:00 @@ -98,33 +98,47 @@ esph->spi = x->id.spi; esph->seq_no = htonl(++x->replay.oseq); - if (esp->conf.ivlen) - crypto_cipher_set_iv(tfm, esp->conf.ivec, crypto_tfm_alg_ivsize(tfm)); + if (dst->xfrm_offload) { + xfrm_offload_hold(dst->xfrm_offload); + if (skb_push_xfrm_offload(skb, dst->xfrm_offload)) { + xfrm_offload_release(dst->xfrm_offload); + goto error; + } + + if (esp->conf.ivlen) + get_random_bytes(esph->enc_data, esp->conf.ivlen); + } else { + if (esp->conf.ivlen) + crypto_cipher_set_iv(tfm, esp->conf.ivec, crypto_tfm_alg_ivsize(tfm)); + + do { + struct scatterlist *sg = &esp->sgbuf[0]; - do { - struct scatterlist *sg = &esp->sgbuf[0]; + if (unlikely(nfrags > ESP_NUM_FAST_SG)) { + sg = kmalloc(sizeof(struct scatterlist)*nfrags, GFP_ATOMIC); + if (!sg) + goto error; + } + skb_to_sgvec(skb, sg, esph->enc_data+esp->conf.ivlen-skb->data, clen); + crypto_cipher_encrypt(tfm, sg, sg, clen); + if (unlikely(sg != &esp->sgbuf[0])) + kfree(sg); + } while (0); - if (unlikely(nfrags > ESP_NUM_FAST_SG)) { - sg = kmalloc(sizeof(struct scatterlist)*nfrags, GFP_ATOMIC); - if (!sg) - goto error; + if (esp->conf.ivlen) { + memcpy(esph->enc_data, esp->conf.ivec, crypto_tfm_alg_ivsize(tfm)); + crypto_cipher_get_iv(tfm, esp->conf.ivec, crypto_tfm_alg_ivsize(tfm)); + } + + if (esp->auth.icv_full_len) { + esp->auth.icv(esp, skb, (u8*)esph-skb->data, + sizeof(struct ip_esp_hdr) + esp->conf.ivlen+clen, trailer->tail); } - skb_to_sgvec(skb, sg, esph->enc_data+esp->conf.ivlen-skb->data, clen); - crypto_cipher_encrypt(tfm, sg, sg, clen); - if (unlikely(sg != &esp->sgbuf[0])) - kfree(sg); - } while (0); - - if (esp->conf.ivlen) { - memcpy(esph->enc_data, esp->conf.ivec, crypto_tfm_alg_ivsize(tfm)); - crypto_cipher_get_iv(tfm, esp->conf.ivec, crypto_tfm_alg_ivsize(tfm)); } - if (esp->auth.icv_full_len) { - esp->auth.icv(esp, skb, (u8*)esph-skb->data, - sizeof(struct ip_esp_hdr) + esp->conf.ivlen+clen, trailer->tail); + /* Need to account for auth data, offloading or not... */ + if (esp->auth.icv_full_len) pskb_put(skb, trailer, alen); - } ip_send_check(top_iph); From dave@thedillows.org Sun Jan 9 19:37:12 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 19:38:17 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A3bBod000728 for ; Sun, 9 Jan 2005 19:37:12 -0800 Received: (qmail 1456 invoked by uid 0); 10 Jan 2005 15:37:25 -0000 Received: from user-69-1-45-93.knology.net (HELO ori.thedillows.org) (69.1.45.93) by smtp2.knology.net with SMTP; 10 Jan 2005 15:37:25 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0AFb2iO028687; Mon, 10 Jan 2005 10:37:02 -0500 Received: (from root@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0AFb2H8028686; Mon, 10 Jan 2005 10:37:02 -0500 Date: Mon, 10 Jan 2005 10:37:02 -0500 To: netdev@oss.sgi.com Cc: dave@thedillows.org From: David Dillow Subject: [RFC BK 19/22] xfrm offload v2: typhoon: add loading of xfrm_states to hardware Message-Id: <20040110014300.28@ori.thedillows.org> References: <20040110014300.27@ori.thedillows.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13652 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 01:00:58-05:00 dave@thedillows.org # Teach the Typhoon driver how to add and remove xfrm_states to # the 3XP for later packet processing. # # When the first xfrm_state is added, we turn on IPSEC offloads # for the 3XP, and we turn it off when the last one is removed. # # Signed-off-by: David Dillow # # drivers/net/typhoon.c # 2005/01/10 01:00:40-05:00 dave@thedillows.org +167 -0 # Teach the Typhoon driver how to add and remove xfrm_states to # the 3XP for later packet processing. # # When the first xfrm_state is added, we turn on IPSEC offloads # for the 3XP, and we turn it off when the last one is removed. # # Signed-off-by: David Dillow # diff -Nru a/drivers/net/typhoon.c b/drivers/net/typhoon.c --- a/drivers/net/typhoon.c 2005-01-10 01:16:56 -05:00 +++ b/drivers/net/typhoon.c 2005-01-10 01:16:56 -05:00 @@ -2419,6 +2419,173 @@ #undef REQUIRED #undef UNSUPPORTED +static struct xfrm_offload * +typhoon_offload_ipsec(struct typhoon *tp, struct xfrm_state *x) +{ + struct cmd_desc xp_cmd[5]; + struct resp_desc xp_resp; + struct sa_descriptor *sa = (struct sa_descriptor *)xp_cmd; + struct xfrm_offload *xol; + struct typhoon_xfrm_offload *txo; + u16 *dir_sa_avail = &tp->rx_sa_avail; + u16 cookie; + int keylen, err; + + if(!typhoon_validate_xfrm(tp, x)) + goto error; + + memset(xp_cmd, 0, 5 * sizeof(xp_cmd[0])); + INIT_COMMAND_WITH_RESPONSE(xp_cmd, TYPHOON_CMD_CREATE_SA); + sa->numDesc = 4; + + sa->mode = TYPHOON_SA_MODE_AH; + if(x->type->proto == IPPROTO_ESP) + sa->mode = TYPHOON_SA_MODE_ESP; + + if(x->dir == XFRM_STATE_DIR_OUT) { + sa->direction = TYPHOON_SA_DIR_TX; + dir_sa_avail = &tp->tx_sa_avail; + } + + spin_lock_bh(&tp->offload_lock); + if(!*dir_sa_avail) { + spin_unlock_bh(&tp->offload_lock); + goto error; + } + *dir_sa_avail--; + if(!tp->sa_count++) { + tp->offload |= TYPHOON_OFFLOAD_IPSEC; + err = typhoon_set_offload(tp); + if(err < 0) { + spin_unlock_bh(&tp->offload_lock); + printk(KERN_ERR "%s: unable to enable IPSEC " + "offload (%d)\n", tp->name, -err); + goto error_counted; + } + } + spin_unlock_bh(&tp->offload_lock); + + if(x->props.aalgo != SADB_X_AALG_NULL && x->aalg) { + keylen = (x->aalg->alg_key_len + 7) / 8; + + sa->hashFlags = TYPHOON_SA_HASH_SHA1; + if(x->props.aalgo == SADB_AALG_MD5HMAC) + sa->hashFlags = TYPHOON_SA_HASH_MD5; + sa->hashFlags |= TYPHOON_SA_HASH_ENABLE; + + memcpy(sa->integKey, x->aalg->alg_key, keylen); + } + + if(x->props.ealgo != SADB_EALG_NULL && x->ealg) { + keylen = (x->ealg->alg_key_len + 7) / 8; + + sa->encryptionFlags = TYPHOON_SA_ENCRYPT_ENABLE | + TYPHOON_SA_ENCRYPT_CBC; + if(x->props.ealgo == SADB_EALG_DESCBC) + sa->encryptionFlags |= TYPHOON_SA_ENCRYPT_DES; + else if(x->ealg->alg_key_len == 192) + sa->encryptionFlags |= TYPHOON_SA_ENCRYPT_3DES_3KEY; + else { + sa->encryptionFlags |= TYPHOON_SA_ENCRYPT_3DES_2KEY; + memcpy(&sa->confKey[16], x->ealg->alg_key, 8); + } + + memcpy(sa->confKey, x->ealg->alg_key, keylen); + } + + /* The 3XP expects the SPI to be in host order, litte endian. + * It expects the address to be in network order. + */ + sa->SPI = cpu_to_le32(ntohl(x->id.spi)); + sa->destAddr = x->id.daddr.a4; + sa->destMask = (u32) ~0UL; + + err = typhoon_issue_command(tp, 5, xp_cmd, 1, &xp_resp); + cookie = le16_to_cpu(xp_resp.parm1); + if(err < 0 || !cookie || cookie == 0xffff) + goto error_counted; + + xol = xfrm_offload_alloc(sizeof(*txo), tp->dev, GFP_KERNEL); + if(!xol) + goto error_cookie; + + txo = xfrm_offload_priv(xol); + txo->sa_cookie = cookie; + txo->tunnel = !!x->props.mode; + txo->ah = (x->id.proto == IPPROTO_AH); + txo->inbound = (x->dir == XFRM_STATE_DIR_IN); + + xfrm_state_offload_add(x, xol); + + return xol; + +error_cookie: + INIT_COMMAND_NO_RESPONSE(xp_cmd, TYPHOON_CMD_DELETE_SA); + xp_cmd[0].parm1 = xp_resp.parm1; + typhoon_issue_command(tp, 1, xp_cmd, 0, NULL); + +error_counted: + spin_lock_bh(&tp->offload_lock); + *dir_sa_avail++; + tp->sa_count--; + if(!tp->sa_count) { + tp->offload &= ~TYPHOON_OFFLOAD_IPSEC; + err = typhoon_set_offload(tp); + if(err < 0) + printk(KERN_ERR "%s: unable to disable IPSEC " + "offload (%d)\n", tp->name, -err); + } + spin_unlock_bh(&tp->offload_lock); + +error: + return NULL; +} + +static void +typhoon_xfrm_state_add(struct net_device *dev, struct xfrm_state *x) +{ + struct typhoon *tp = netdev_priv(dev); + + smp_rmb(); + if(tp->card_state == Running) + typhoon_offload_ipsec(tp, x); +} + +static void +typhoon_xfrm_state_del(struct net_device *dev, struct xfrm_offload *xol) +{ + struct typhoon *tp = netdev_priv(dev); + struct typhoon_xfrm_offload *txo = xfrm_offload_priv(xol); + struct cmd_desc xp_cmd; + int err; + + smp_rmb(); + if(tp->card_state != Running) + return; + + INIT_COMMAND_NO_RESPONSE(&xp_cmd, TYPHOON_CMD_DELETE_SA); + xp_cmd.parm1 = cpu_to_le16(txo->sa_cookie); + if(typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL) < 0) { + printk(KERN_ERR "%s: unable to remove offloaded SA 0x%04x\n", + tp->name, txo->sa_cookie); + } + + spin_lock_bh(&tp->offload_lock); + if(txo->inbound) + tp->rx_sa_avail++; + else + tp->tx_sa_avail++; + tp->sa_count--; + if(!tp->sa_count) { + tp->offload &= ~TYPHOON_OFFLOAD_IPSEC; + err = typhoon_set_offload(tp); + if(err < 0) + printk(KERN_ERR "%s: unable to disable IPSEC " + "offload (%d)\n", tp->name, -err); + } + spin_unlock_bh(&tp->offload_lock); +} + static void typhoon_tx_timeout(struct net_device *dev) { From dave@thedillows.org Sun Jan 9 19:37:12 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 19:38:23 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A3bBdK000727 for ; Sun, 9 Jan 2005 19:37:11 -0800 Received: (qmail 24709 invoked by uid 0); 10 Jan 2005 15:43:12 -0000 Received: from user-69-1-45-93.knology.net (HELO ori.thedillows.org) (69.1.45.93) by smtp8.knology.net with SMTP; 10 Jan 2005 15:43:12 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0AFb34P028695; Mon, 10 Jan 2005 10:37:03 -0500 Received: (from root@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0AFb3lc028694; Mon, 10 Jan 2005 10:37:03 -0500 Date: Mon, 10 Jan 2005 10:37:03 -0500 To: netdev@oss.sgi.com Cc: dave@thedillows.org From: David Dillow Subject: [RFC BK 21/22] xfrm offload v2: typhoon: add callbacks to support crypto offload Message-Id: <20040110014300.30@ori.thedillows.org> References: <20040110014300.29@ori.thedillows.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 11 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 01:08:03-05:00 dave@thedillows.org # Export the xfrm offload callbacks, and let the world know we # support IPSEC offload. # # While we're at it, allow this to controlled by ethtool. # # Signed-off-by: David Dillow # # drivers/net/typhoon.c # 2005/01/10 01:07:47-05:00 dave@thedillows.org +23 -4 # Export the xfrm offload callbacks, and let the world know we # support IPSEC offload. # # While we're at it, allow this to controlled by ethtool. # # Signed-off-by: David Dillow # diff -Nru a/drivers/net/typhoon.c b/drivers/net/typhoon.c --- a/drivers/net/typhoon.c 2005-01-10 01:16:31 -05:00 +++ b/drivers/net/typhoon.c 2005-01-10 01:16:31 -05:00 @@ -33,9 +33,12 @@ *) Waiting for a command response takes 8ms due to non-preemptable polling. Only significant for getting stats and creating SAs, but an ugly wart never the less. + *) Inbound IPSEC packets of the form outer ESP transport, inner + ESP tunnel seems to fail the hash on the inner ESP + *) Inbound IPSEC packets of the form outer AH transport, inner + AH tunnel seems to fail the hash on the outer AH TODO: - *) Doesn't do IPSEC offloading. Yet. Keep yer pants on, it's coming. *) Add more support for ethtool (especially for NIC stats) *) Allow disabling of RX checksum offloading *) Fix MAC changing to work while the interface is up @@ -100,8 +103,8 @@ #define PKT_BUF_SZ 1536 #define DRV_MODULE_NAME "typhoon" -#define DRV_MODULE_VERSION "1.5.7" -#define DRV_MODULE_RELDATE "05/01/07" +#define DRV_MODULE_VERSION "1.5.7-ipsec" +#define DRV_MODULE_RELDATE "05/01/10" #define PFX DRV_MODULE_NAME ": " #define ERR_PFX KERN_ERR PFX @@ -1411,6 +1414,8 @@ .get_tso = ethtool_op_get_tso, .set_tso = ethtool_op_set_tso, .get_ringparam = typhoon_get_ringparam, + .get_ipsec = ethtool_op_get_ipsec, + .set_ipsec = ethtool_op_set_ipsec, }; static int @@ -2258,6 +2263,9 @@ tp->card_state = Running; smp_wmb(); + if(dev->features & NETIF_F_IPSEC) + xfrm_accel_add(dev); + iowrite32(TYPHOON_INTR_ENABLE_ALL, ioaddr + TYPHOON_REG_INTR_ENABLE); iowrite32(TYPHOON_INTR_NONE, ioaddr + TYPHOON_REG_INTR_MASK); typhoon_post_pci_writes(ioaddr); @@ -2332,6 +2340,14 @@ typhoon_clean_tx(tp, &tp->txLoRing, &indexes->txLoCleared); } + if(tp->dev->features & NETIF_F_IPSEC) + xfrm_accel_flush(tp->dev); + + /* tp->card_state != Running, so nothing will change this out + * from under us. + */ + tp->offload &= ~TYPHOON_OFFLOAD_IPSEC; + return 0; } @@ -3215,6 +3231,9 @@ dev->set_mac_address = typhoon_set_mac_address; dev->vlan_rx_register = typhoon_vlan_rx_register; dev->vlan_rx_kill_vid = typhoon_vlan_rx_kill_vid; + dev->xfrm_state_add = typhoon_xfrm_state_add; + dev->xfrm_state_del = typhoon_xfrm_state_del; + dev->xfrm_bundle_add = typhoon_xfrm_bundle_add; SET_ETHTOOL_OPS(dev, &typhoon_ethtool_ops); /* We can handle scatter gather, up to 16 entries, and @@ -3222,7 +3241,7 @@ */ dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; - dev->features |= NETIF_F_TSO; + dev->features |= NETIF_F_TSO | NETIF_F_IPSEC; if(register_netdev(dev) < 0) goto error_out_reset; From dave@thedillows.org Sun Jan 9 19:37:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 19:38:19 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A3bA1t000684 for ; Sun, 9 Jan 2005 19:37:10 -0800 Received: (qmail 24697 invoked by uid 0); 10 Jan 2005 15:43:11 -0000 Received: from user-69-1-45-93.knology.net (HELO ori.thedillows.org) (69.1.45.93) by smtp8.knology.net with SMTP; 10 Jan 2005 15:43:11 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0AFb1vd028663; Mon, 10 Jan 2005 10:37:01 -0500 Received: (from root@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0AFb1nD028662; Mon, 10 Jan 2005 10:37:01 -0500 Date: Mon, 10 Jan 2005 10:37:01 -0500 To: netdev@oss.sgi.com Cc: dave@thedillows.org From: David Dillow Subject: [RFC BK 13/22] xfrm offload v2: typhoon: Make the ipsec descriptor match actual usage Message-Id: <20040110014300.22@ori.thedillows.org> References: <20040110014300.21@ori.thedillows.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 4 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 00:53:50-05:00 dave@thedillows.org # Make the crypto structures better match actual usage. # # Signed-off-by: David Dillow # # drivers/net/typhoon.h # 2005/01/10 00:53:33-05:00 dave@thedillows.org +13 -11 # Make the crypto structures better match actual usage. # # Signed-off-by: David Dillow # diff -Nru a/drivers/net/typhoon.h b/drivers/net/typhoon.h --- a/drivers/net/typhoon.h 2005-01-10 01:18:11 -05:00 +++ b/drivers/net/typhoon.h 2005-01-10 01:18:11 -05:00 @@ -210,7 +210,10 @@ * flags: descriptor type * numDesc: must be 1 * ipsecFlags: bit 0: 0 -- generate IV, 1 -- use supplied IV - * sa1, sa2: Security Association IDs for this packet + * sa[0]: the inner AH header offload cookie (or ESP if no AH) + * sa[1]: the inner ESP header offload cookie (or 0 if no AH) + * sa[2]: the outer AH header offload cookie (or ESP if no AH) + * sa[3]: the outer ESP header offload cookie (or 0 if no AH) * reserved: set to 0 */ struct ipsec_desc { @@ -219,8 +222,7 @@ u16 ipsecFlags; #define TYPHOON_IPSEC_GEN_IV __constant_cpu_to_le16(0x0000) #define TYPHOON_IPSEC_USE_IV __constant_cpu_to_le16(0x0001) - u32 sa1; - u32 sa2; + u16 sa[4]; u32 reserved; } __attribute__ ((packed)); @@ -268,14 +270,14 @@ #define TYPHOON_RX_FILTER_MASK __constant_cpu_to_le16(0x7fff) #define TYPHOON_RX_FILTERED __constant_cpu_to_le16(0x8000) u16 ipsecResults; -#define TYPHOON_RX_OUTER_AH_GOOD __constant_cpu_to_le16(0x0001) -#define TYPHOON_RX_OUTER_ESP_GOOD __constant_cpu_to_le16(0x0002) -#define TYPHOON_RX_INNER_AH_GOOD __constant_cpu_to_le16(0x0004) -#define TYPHOON_RX_INNER_ESP_GOOD __constant_cpu_to_le16(0x0008) -#define TYPHOON_RX_OUTER_AH_FAIL __constant_cpu_to_le16(0x0010) -#define TYPHOON_RX_OUTER_ESP_FAIL __constant_cpu_to_le16(0x0020) -#define TYPHOON_RX_INNER_AH_FAIL __constant_cpu_to_le16(0x0040) -#define TYPHOON_RX_INNER_ESP_FAIL __constant_cpu_to_le16(0x0080) +#define TYPHOON_RX_AH1_GOOD __constant_cpu_to_le16(0x0001) +#define TYPHOON_RX_ESP1_GOOD __constant_cpu_to_le16(0x0002) +#define TYPHOON_RX_AH2_GOOD __constant_cpu_to_le16(0x0004) +#define TYPHOON_RX_ESP2_GOOD __constant_cpu_to_le16(0x0008) +#define TYPHOON_RX_AH1_FAIL __constant_cpu_to_le16(0x0010) +#define TYPHOON_RX_ESP1_FAIL __constant_cpu_to_le16(0x0020) +#define TYPHOON_RX_AH2_FAIL __constant_cpu_to_le16(0x0040) +#define TYPHOON_RX_ESP2_FAIL __constant_cpu_to_le16(0x0080) #define TYPHOON_RX_UNKNOWN_SA __constant_cpu_to_le16(0x0100) #define TYPHOON_RX_ESP_FORMAT_ERR __constant_cpu_to_le16(0x0200) u32 vlanTag; From dave@thedillows.org Sun Jan 9 19:37:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 19:38:17 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A3b8FW000630 for ; Sun, 9 Jan 2005 19:37:08 -0800 Received: (qmail 1429 invoked by uid 0); 10 Jan 2005 15:37:21 -0000 Received: from user-69-1-45-93.knology.net (HELO ori.thedillows.org) (69.1.45.93) by smtp2.knology.net with SMTP; 10 Jan 2005 15:37:21 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0AFaxQu028611; Mon, 10 Jan 2005 10:36:59 -0500 Received: (from root@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0AFaw3M028610; Mon, 10 Jan 2005 10:36:58 -0500 Date: Mon, 10 Jan 2005 10:36:58 -0500 To: netdev@oss.sgi.com Cc: dave@thedillows.org From: David Dillow Subject: [RFC BK 0/22] xfrm offload v2: Add hardware assist for IPSEC crypto Message-Id: <20040110014300.01@ori.thedillows.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13652 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev The following patch set adds hardware offload of the crypto operations for IPv4 IPSEC processing. It gives a noticible speedup on my (admittedly older) hardware, but given the recent numbers posted, can be a speedup even for more recent hardware. There are a few known issues with the current patchset, but I think it is ready for wider review. This version incorporates a few comments from the mailing lists, and removes GFP_ATOMIC allocations. * Only the 3Com 3CR990 family of NICs are supported. I don't have hardware or documentation for the Intel cards. * Doesn't do IPv6. Need someone to implement map_direction(), and AH/ESP handling, as well as come up with a card that supports it. * linux/skbuff.h cannot include net/xfrm.h currently, so there are redundant defines (requires some header cleanup, which I'm not very inclined to tackle at the moment.) * TCP Segmentation offload seems broken by firmware 03.001.008. It could be my changes to support the offload, but that seems unlikely. I will have to investigate this. * Latency suffers somewhat on smaller packets, it may be advisable to have a minimum packet size to offload. * No real feedback on which xfrm_states have been offloaded or not. * No individual control over which xfrm_states are allowed to be offloaded. The patch set will be sent as follow-ups to this post, or is available via: bk pull http://typhoon.bkbits.net/ipsec-2.6 If you have pulled from there before, you will need to reclone, as the repository has been recreated. It will update the following files: Documentation/networking/netdevices.txt | 16 drivers/net/typhoon.c | 720 +++++++++++++++++++++++++++++++- drivers/net/typhoon.h | 38 + include/linux/ethtool.h | 8 include/linux/netdevice.h | 10 include/linux/skbuff.h | 55 ++ include/net/dst.h | 2 include/net/xfrm.h | 102 ++++ net/core/ethtool.c | 54 ++ net/core/skbuff.c | 31 + net/ipv4/ah4.c | 99 ++-- net/ipv4/esp4.c | 102 ++-- net/ipv4/xfrm4_state.c | 9 net/ipv6/xfrm6_state.c | 10 net/xfrm/xfrm_export.c | 4 net/xfrm/xfrm_policy.c | 85 +++ net/xfrm/xfrm_state.c | 99 ++++ 17 files changed, 1329 insertions(+), 115 deletions(-) If you work from the mailed patches, you will want the netdev-2.6 updates to the typhoon driver, as the 3CR990B series needs the newest firmware to correctly offload IPSEC processing. That patch is available from http://www.thedillows.org/typhoon-netdev-2.6.patch.bz2 The following results were generated using a dual processor PIII 1GHz/512MB with a 3CR990SVR97 (ori) and an Athlon 550 MHz/256MB with a 3CR990B (tank). Latency testing was performed with lmbench's lat_tcp, and bandwith testing was performed with Andrew Morton's zcc/zcs/cyclesoak. I ran the tests multiple times, and picked the median results to report. There was not much deviation in the results (+/- 1.5 us +/- 50KBytes/s +/- 1.5% CPU usage). TCP Latency tests (1 byte msg) Config Latency No IPSEC 196 us AH/SHA1 (sw) 256 us AH/SHA1 (hw) 317 us ESP/3DES,SHA1 (sw) 333 us ESP/3DES,SHA1 (hw) 347 us ESP-AH/3DES,SHA1-SHA1 (sw) 387 us ESP-AH/3DES,SHA1-SHA1 (hw) 467 us TCP Latency tests (1024 byte msg) Config Latency No IPSEC 625 us AH/SHA1 (sw) 771 us AH/SHA1 (hw) 858 us ESP/3DES,SHA1 (sw) 1999 us ESP/3DES,SHA1 (hw) 902 us ESP-AH/3DES,SHA1-SHA1 (sw) 2140 us ESP-AH/3DES,SHA1-SHA1 (hw) 1131 us Bandwidth tests Config (sender -> receiver) Bandwidth ori CPU tank CPU No IPSEC (tank->ori) 11494 KB/s 11.9% 18.7% No IPSEC (ori->tank) 11492 KB/s 9.5% 34.3% AH/SHA1 (sw) (tank->ori) 11303 KB/s 29.2% 79.3% AH/SHA1 (sw) (ori->tank) 11302 KB/s 28.6% 91.1% ESP/3DES,SHA1 (sw) (tank->ori) 2130 KB/s 29.6% 100% ESP/3DES,SHA1 (sw) (ori->tank) 2263 KB/s 29.3% 99.7% ESP-AH/3DES,SHA1-SHA1 (sw) (tank->ori) 1906 KB/s 29.1% 100% ESP-AH/3DES,SHA1-SHA1 (sw) (ori->tank) 2051 KB/s 29.3% 99.7% AH/SHA1 (hw) (tank->ori) 11303 KB/s 14.0% 30.2% AH/SHA1 (hw) (ori->tank) 11301 KB/s 14.1% 39.8% ESP/3DES,SHA1 (hw) (tank->ori) 11221 KB/s 15.4% 44.9% ESP/3DES,SHA1 (hw) (ori->tank) 11220 KB/s 21.5% 48.1% ESP-AH/3DES,SHA1-SHA1 (hw) (tank->ori) 5920 KB/s 10.8% 35.9% ESP-AH/3DES,SHA1-SHA1 (hw) (ori->tank) 7189 KB/s 14.3% 35.4% The last line seems suspicious, and should probably be retested. From dave@thedillows.org Sun Jan 9 19:37:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 19:38:19 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A3bAK5000696 for ; Sun, 9 Jan 2005 19:37:10 -0800 Received: (qmail 24696 invoked by uid 0); 10 Jan 2005 15:43:11 -0000 Received: from user-69-1-45-93.knology.net (HELO ori.thedillows.org) (69.1.45.93) by smtp8.knology.net with SMTP; 10 Jan 2005 15:43:11 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0AFb0fT028635; Mon, 10 Jan 2005 10:37:00 -0500 Received: (from root@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0AFb0Em028634; Mon, 10 Jan 2005 10:37:00 -0500 Date: Mon, 10 Jan 2005 10:37:00 -0500 To: netdev@oss.sgi.com Cc: dave@thedillows.org From: David Dillow Subject: [RFC BK 6/22] xfrm offload v2: add a parameter to xfrm_prune_bundles() Message-Id: <20040110014300.15@ori.thedillows.org> References: <20040110014300.14@ori.thedillows.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 7 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 00:44:12-05:00 dave@thedillows.org # Add a parameter to the decision function(s) used by # xfrm_prune_bundles(). This will allow us to have more # fine grained selection of bundles pruned (like, say, # per device.) # # Signed-off-by: David Dillow # # net/xfrm/xfrm_policy.c # 2005/01/10 00:43:55-05:00 dave@thedillows.org +11 -10 # Add a parameter to the decision function(s) used by # xfrm_prune_bundles(). This will allow us to have more # fine grained selection of bundles pruned (like, say, # per device.) # # Signed-off-by: David Dillow # diff -Nru a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c --- a/net/xfrm/xfrm_policy.c 2005-01-10 01:19:37 -05:00 +++ b/net/xfrm/xfrm_policy.c 2005-01-10 01:19:37 -05:00 @@ -724,7 +724,7 @@ } } -static int stale_bundle(struct dst_entry *dst); +static int stale_bundle(struct dst_entry *dst, void *unused); static void xfrm_accel_task(void *data) { @@ -744,7 +744,7 @@ /* stale_bundle() validates that we have a dev, and that it * is currently running. */ - if (!stale_bundle(dst) && (dev->features & NETIF_F_IPSEC)) + if (!stale_bundle(dst, NULL) && (dev->features & NETIF_F_IPSEC)) dev->xfrm_bundle_add(dev, dst); dst_release(dst); @@ -861,7 +861,7 @@ } write_lock_bh(&policy->lock); - if (unlikely(policy->dead || stale_bundle(dst))) { + if (unlikely(policy->dead || stale_bundle(dst, NULL))) { /* Wow! While we worked on resolving, this * policy has gone. Retry. It is not paranoia, * we just cannot enlist new bundle to dead object. @@ -1042,14 +1042,14 @@ static struct dst_entry *xfrm_dst_check(struct dst_entry *dst, u32 cookie) { - if (!stale_bundle(dst)) + if (!stale_bundle(dst, NULL)) return dst; dst_release(dst); return NULL; } -static int stale_bundle(struct dst_entry *dst) +static int stale_bundle(struct dst_entry *dst, void *unused) { struct dst_entry *child = dst; @@ -1092,7 +1092,8 @@ return dst; } -static void xfrm_prune_bundles(int (*func)(struct dst_entry *)) +static void xfrm_prune_bundles(int (*func)(struct dst_entry *, void *), + void *data) { int i; struct xfrm_policy *pol; @@ -1104,7 +1105,7 @@ write_lock(&pol->lock); dstp = &pol->bundles; while ((dst=*dstp) != NULL) { - if (func(dst)) { + if (func(dst, data)) { *dstp = dst->next; dst->next = gc_list; gc_list = dst; @@ -1124,19 +1125,19 @@ } } -static int unused_bundle(struct dst_entry *dst) +static int unused_bundle(struct dst_entry *dst, void *unused) { return !atomic_read(&dst->__refcnt); } static void __xfrm_garbage_collect(void) { - xfrm_prune_bundles(unused_bundle); + xfrm_prune_bundles(unused_bundle, NULL); } int xfrm_flush_bundles(void) { - xfrm_prune_bundles(stale_bundle); + xfrm_prune_bundles(stale_bundle, NULL); return 0; } From dave@thedillows.org Sun Jan 9 19:37:10 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 19:38:19 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A3b9Pf000659 for ; Sun, 9 Jan 2005 19:37:09 -0800 Received: (qmail 1437 invoked by uid 0); 10 Jan 2005 15:37:22 -0000 Received: from user-69-1-45-93.knology.net (HELO ori.thedillows.org) (69.1.45.93) by smtp2.knology.net with SMTP; 10 Jan 2005 15:37:22 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0AFb0hF028639; Mon, 10 Jan 2005 10:37:00 -0500 Received: (from root@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0AFb0iA028638; Mon, 10 Jan 2005 10:37:00 -0500 Date: Mon, 10 Jan 2005 10:37:00 -0500 To: netdev@oss.sgi.com Cc: dave@thedillows.org From: David Dillow Subject: [RFC BK 7/22] xfrm offload v2: Allow device drivers to force recalculation of offloads Message-Id: <20040110014300.16@ori.thedillows.org> References: <20040110014300.15@ori.thedillows.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 5 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 00:46:32-05:00 dave@thedillows.org # Give device drivers a method to allow the use of crypto # offload features for existing xfrm_states and bundles, as # well as dynamically remove crypto offload capabilities. # # Signed-off-by: David Dillow # # net/xfrm/xfrm_state.c # 2005/01/10 00:46:14-05:00 dave@thedillows.org +39 -0 # When we've been informed of a new device that can offload # xfrm crypto operations, go ahead and offload existing inbound # xfrm_states to it. # # When we're removing crypto offload capabilities, remove every # offload instance for that device. # # Signed-off-by: David Dillow # # net/xfrm/xfrm_policy.c # 2005/01/10 00:46:14-05:00 dave@thedillows.org +17 -0 # When adding/removing xfrm offload capable device, give the xfrm_state # engine a chance to make the changes it needs, then flush any existing # bundles that use the device so that future flows get a chance to use # the offload features (for add), or resume using the software crypto # routines (for remove). # # Signed-off-by: David Dillow # # net/xfrm/xfrm_export.c # 2005/01/10 00:46:14-05:00 dave@thedillows.org +2 -0 # Export the driver-visible API. # # Signed-off-by: David Dillow # # include/net/xfrm.h # 2005/01/10 00:46:14-05:00 dave@thedillows.org +4 -0 # Prototypes for the new routines. # # Signed-off-by: David Dillow # diff -Nru a/include/net/xfrm.h b/include/net/xfrm.h --- a/include/net/xfrm.h 2005-01-10 01:19:25 -05:00 +++ b/include/net/xfrm.h 2005-01-10 01:19:25 -05:00 @@ -826,6 +826,8 @@ extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq); extern void xfrm_state_delete(struct xfrm_state *x); extern void xfrm_state_flush(u8 proto); +extern void xfrm_state_accel_add(struct net_device *dev); +extern void xfrm_state_accel_flush(struct net_device *dev); extern int xfrm_replay_check(struct xfrm_state *x, u32 seq); extern void xfrm_replay_advance(struct xfrm_state *x, u32 seq); extern int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb); @@ -879,6 +881,8 @@ extern void xfrm_policy_flush(void); extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); extern int xfrm_flush_bundles(void); +extern void xfrm_accel_add(struct net_device *dev); +extern void xfrm_accel_flush(struct net_device *dev); extern wait_queue_head_t km_waitq; extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, u16 sport); diff -Nru a/net/xfrm/xfrm_export.c b/net/xfrm/xfrm_export.c --- a/net/xfrm/xfrm_export.c 2005-01-10 01:19:25 -05:00 +++ b/net/xfrm/xfrm_export.c 2005-01-10 01:19:25 -05:00 @@ -62,3 +62,5 @@ EXPORT_SYMBOL_GPL(skb_icv_walk); EXPORT_SYMBOL_GPL(xfrm_state_offload_add); +EXPORT_SYMBOL_GPL(xfrm_accel_add); +EXPORT_SYMBOL_GPL(xfrm_accel_flush); diff -Nru a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c --- a/net/xfrm/xfrm_policy.c 2005-01-10 01:19:25 -05:00 +++ b/net/xfrm/xfrm_policy.c 2005-01-10 01:19:25 -05:00 @@ -1141,6 +1141,23 @@ return 0; } +static int bundle_uses_dev(struct dst_entry *dst, void *dev) +{ + return (dst->dev == dev); +} + +void xfrm_accel_add(struct net_device *dev) +{ + xfrm_state_accel_add(dev); + xfrm_prune_bundles(bundle_uses_dev, dev); +} + +void xfrm_accel_flush(struct net_device *dev) +{ + xfrm_state_accel_flush(dev); + xfrm_prune_bundles(bundle_uses_dev, dev); +} + /* Well... that's _TASK_. We need to scan through transformation * list and figure out what mss tcp should generate in order to * final datagram fit to mtu. Mama mia... :-) diff -Nru a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c --- a/net/xfrm/xfrm_state.c 2005-01-10 01:19:25 -05:00 +++ b/net/xfrm/xfrm_state.c 2005-01-10 01:19:25 -05:00 @@ -999,6 +999,45 @@ xfrm_offload_release(old); } +static int try_new_accel(struct xfrm_state *x, int unused, void *data) +{ + struct net_device *dev = data; + + if (x->dir == XFRM_STATE_DIR_IN) + dev->xfrm_state_add(dev, x); + return 0; +} + +static int remove_stale_accel(struct xfrm_state *x, int unused, void *dev) +{ + struct xfrm_offload *xol, *entry = NULL; + + spin_lock(&x->lock); + list_for_each_entry(xol, &x->offloads, bydev) { + if (xol->dev == dev) { + list_del(&xol->bydev); + entry = xol; + break; + } + } + spin_unlock(&x->lock); + + if (entry) + xfrm_offload_release(entry); + + return 0; +} + +void xfrm_state_accel_add(struct net_device *dev) +{ + xfrm_state_walk(IPSEC_PROTO_ANY, try_new_accel, dev); +} + +void xfrm_state_accel_flush(struct net_device *dev) +{ + xfrm_state_walk(IPSEC_PROTO_ANY, remove_stale_accel, dev); +} + void __init xfrm_state_init(void) { int i; From dave@thedillows.org Sun Jan 9 19:37:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 19:38:17 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A3b8D9000631 for ; Sun, 9 Jan 2005 19:37:08 -0800 Received: (qmail 12946 invoked by uid 0); 10 Jan 2005 15:37:22 -0000 Received: from user-69-1-45-93.knology.net (HELO ori.thedillows.org) (69.1.45.93) by smtp6.knology.net with SMTP; 10 Jan 2005 15:37:22 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0AFaxMu028619; Mon, 10 Jan 2005 10:36:59 -0500 Received: (from root@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0AFaxtn028618; Mon, 10 Jan 2005 10:36:59 -0500 Date: Mon, 10 Jan 2005 10:36:59 -0500 To: netdev@oss.sgi.com Cc: dave@thedillows.org From: David Dillow Subject: [RFC BK 2/22] xfrm offload v2: Add xfrm offload management calls to struct netdevice Message-Id: <20040110014300.11@ori.thedillows.org> References: <20040110014300.10@ori.thedillows.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13652 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 00:02:31-05:00 dave@thedillows.org # Add the xfrm offload management calls to struct netdevice. # # xfrm_state_add() is called for inbound xfrm states # xfrm_bundle_add() is called for outbound xfrm bundles # xfrm_state_del() is called for all offloaded xfrms, # inbound or outbound. # # If a driver adds NETIF_F_IPSEC to its features, it must # provide all three callbacks. # # Signed-off-by: David Dillow # # include/linux/netdevice.h # 2005/01/10 00:02:15-05:00 dave@thedillows.org +10 -0 # Add the xfrm offload management calls to struct netdevice. # # xfrm_state_add() is called for inbound xfrm states # xfrm_bundle_add() is called for outbound xfrm bundles # xfrm_state_del() is called for all offloaded xfrms, # inbound or outbound. # # If a driver adds NETIF_F_IPSEC to its features, it must # provide all three callbacks. # # Signed-off-by: David Dillow # diff -Nru a/include/linux/netdevice.h b/include/linux/netdevice.h --- a/include/linux/netdevice.h 2005-01-10 01:20:27 -05:00 +++ b/include/linux/netdevice.h 2005-01-10 01:20:27 -05:00 @@ -250,6 +250,8 @@ }; #define NETDEV_BOOT_SETUP_MAX 8 +struct xfrm_state; +struct xfrm_offload; /* * The DEVICE structure. @@ -415,6 +417,7 @@ #define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ #define NETIF_F_TSO 2048 /* Can offload TCP/IP segmentation */ #define NETIF_F_LLTX 4096 /* LockLess TX */ +#define NETIF_F_IPSEC 8192 /* Can offload IPSEC crypto */ /* Called after device is detached from network. */ void (*uninit)(struct net_device *dev); @@ -464,6 +467,13 @@ unsigned short vid); void (*vlan_rx_kill_vid)(struct net_device *dev, unsigned short vid); + + void (*xfrm_state_add)(struct net_device *dev, + struct xfrm_state *x); + void (*xfrm_bundle_add)(struct net_device *dev, + struct dst_entry *bundle); + void (*xfrm_state_del)(struct net_device *dev, + struct xfrm_offload *xol); int (*hard_header_parse)(struct sk_buff *skb, unsigned char *haddr); From dave@thedillows.org Sun Jan 9 19:37:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 19:38:19 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A3b96j000653 for ; Sun, 9 Jan 2005 19:37:09 -0800 Received: (qmail 12777 invoked by uid 0); 10 Jan 2005 15:45:39 -0000 Received: from user-69-1-45-93.knology.net (HELO ori.thedillows.org) (69.1.45.93) by smtp7.knology.net with SMTP; 10 Jan 2005 15:45:39 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0AFb0Vc028643; Mon, 10 Jan 2005 10:37:00 -0500 Received: (from root@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0AFb0jn028642; Mon, 10 Jan 2005 10:37:00 -0500 Date: Mon, 10 Jan 2005 10:37:00 -0500 To: netdev@oss.sgi.com Cc: dave@thedillows.org From: David Dillow Subject: [RFC BK 8/22] xfrm offload v2: Add routines to manage applied offloads per skb Message-Id: <20040110014300.17@ori.thedillows.org> References: <20040110014300.16@ori.thedillows.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 3 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 00:49:03-05:00 dave@thedillows.org # Add fields to sk_buff to track offloaded xfrm_states for this # packet. On Tx, these will be pointers to struct xfrm_offload. # On Rx, these will be a 4 bit bitfield indicating what operations # were performed, and the result of those operations. # # skb_push_xfrm_offload() records an offloaded xfrm on Tx. It will # return an error code if it is unable to record the offload. # skb_get_xfrm_offload() returns the xfrm_offload struct at the # given position on the stack. It will return NULL if there # are no more offloads available. # skb_has_xfrm_offload() returns true if the sk_buff has offload # information available. # skb_put_xfrm_result() records an offload result on Rx at the given # index. It will return an error code if it is unable to # record the result. # skb_pop_xfrm_result() pops the current offload result from the. # stack. If there are no more results, it will return # XFRM_OFFLOAD_NONE. # # Signed-off-by: David Dillow # # net/core/skbuff.c # 2005/01/10 00:48:46-05:00 dave@thedillows.org +31 -0 # When an sk_buff is cloned, we must gain a reference to each # xfrm_offload that it references. # # When an sk_buff is freed, we must release our references # to the xfrm_offloads attached to it. # # Signed-off-by: David Dillow # # include/net/xfrm.h # 2005/01/10 00:48:46-05:00 dave@thedillows.org +9 -0 # Add the values for the result bitfield. # # Signed-off-by: David Dillow # # include/linux/skbuff.h # 2005/01/10 00:48:46-05:00 dave@thedillows.org +55 -0 # Add the fields and functins to track offloads and results, as # well as the current position in the stack. # # Signed-off-by: David Dillow # diff -Nru a/include/linux/skbuff.h b/include/linux/skbuff.h --- a/include/linux/skbuff.h 2005-01-10 01:19:13 -05:00 +++ b/include/linux/skbuff.h 2005-01-10 01:19:13 -05:00 @@ -146,6 +146,14 @@ skb_frag_t frags[MAX_SKB_FRAGS]; }; +/* XXX UGH. We cannot include in this file without some + * header file surgery, so define our own max xfrm depth. This should + * be kept >= XFRM_MAX_DEPTH until we fix the includes, and it can + * go away. + */ +#define SKB_XFRM_MAX_DEPTH 4 +struct xfrm_offload; + /** * struct sk_buff - socket buffer * @next: Next buffer in list @@ -187,6 +195,8 @@ * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c * @private: Data which is private to the HIPPI implementation * @tc_index: Traffic control index + * @xfrm_offload: Tx offload info, Rx offload results + * @xfrm_offload_idx: The number of cookies/results stored currently */ struct sk_buff { @@ -272,6 +282,8 @@ #endif + int xfrm_offload_idx; + struct xfrm_offload * xfrm_offload[SKB_XFRM_MAX_DEPTH]; /* These elements must be at the end, see alloc_skb() for details. */ unsigned int truesize; @@ -1184,6 +1196,49 @@ #else /* CONFIG_NETFILTER */ static inline void nf_reset(struct sk_buff *skb) {} #endif /* CONFIG_NETFILTER */ + +static inline int skb_push_xfrm_offload(struct sk_buff *skb, + struct xfrm_offload *xol) +{ + if (likely(skb->xfrm_offload_idx < SKB_XFRM_MAX_DEPTH)) { + skb->xfrm_offload[skb->xfrm_offload_idx++] = xol; + return 0; + } + + return -ENOMEM; +} + +static inline struct xfrm_offload * +skb_get_xfrm_offload(const struct sk_buff *skb, int idx) +{ + if (likely(idx < skb->xfrm_offload_idx)) + return skb->xfrm_offload[idx]; + else + return NULL; +} + +static inline int skb_has_xfrm_offload(const struct sk_buff *skb) +{ + return !!skb_get_xfrm_offload(skb, 0); +} + +static inline int skb_put_xfrm_result(struct sk_buff *skb, int result, int idx) +{ + if (likely(idx < SKB_XFRM_MAX_DEPTH)) { + skb->xfrm_offload[idx] = (struct xfrm_offload *) result; + return 0; + } + return -ENOMEM; +} + +static inline int skb_pop_xfrm_result(struct sk_buff *skb) +{ + /* XXX XFRM_OFFLOAD_NONE == 0, but cannot include */ + int res = 0; + if (likely(skb->xfrm_offload_idx < SKB_XFRM_MAX_DEPTH)) + res = (int) skb->xfrm_offload[skb->xfrm_offload_idx++]; + return res; +} #endif /* __KERNEL__ */ #endif /* _LINUX_SKBUFF_H */ diff -Nru a/include/net/xfrm.h b/include/net/xfrm.h --- a/include/net/xfrm.h 2005-01-10 01:19:12 -05:00 +++ b/include/net/xfrm.h 2005-01-10 01:19:12 -05:00 @@ -171,6 +171,15 @@ XFRM_STATE_DIR_OUT, }; +enum { + XFRM_OFFLOAD_NONE = 0, + XFRM_OFFLOAD_CONF = 1, + XFRM_OFFLOAD_AUTH = 2, + XFRM_OFFLOAD_AUTH_OK = 4, + XFRM_OFFLOAD_AUTH_FAIL = 8, + XFRM_OFFLOAD_FIELD = 0x0f +}; + struct xfrm_offload { struct list_head bydev; diff -Nru a/net/core/skbuff.c b/net/core/skbuff.c --- a/net/core/skbuff.c 2005-01-10 01:19:12 -05:00 +++ b/net/core/skbuff.c 2005-01-10 01:19:12 -05:00 @@ -283,6 +283,14 @@ dst_release(skb->dst); #ifdef CONFIG_XFRM + { + int i = 0; + struct xfrm_offload *xol; + while ((xol = skb_get_xfrm_offload(skb, i++)) != NULL) { + if ((unsigned long) xol > XFRM_OFFLOAD_FIELD) + xfrm_offload_release(xol); + } + } secpath_put(skb->sp); #endif if(skb->destructor) { @@ -387,6 +395,17 @@ #endif #endif + C(xfrm_offload_idx); + memcpy(n->xfrm_offload, skb->xfrm_offload, + sizeof(struct xfrm_offload *) * SKB_XFRM_MAX_DEPTH); + { + int i = 0; + struct xfrm_offload *xol; + while ((xol = skb_get_xfrm_offload(skb, i++)) != NULL) { + if ((unsigned long) xol > XFRM_OFFLOAD_FIELD) + xfrm_offload_hold(xol); + } + } C(truesize); atomic_set(&n->users, 1); C(head); @@ -449,6 +468,18 @@ atomic_set(&new->users, 1); skb_shinfo(new)->tso_size = skb_shinfo(old)->tso_size; skb_shinfo(new)->tso_segs = skb_shinfo(old)->tso_segs; + + new->xfrm_offload_idx = old->xfrm_offload_idx; + memcpy(new->xfrm_offload, old->xfrm_offload, + sizeof(struct xfrm_offload *) * SKB_XFRM_MAX_DEPTH); + { + int i = 0; + struct xfrm_offload *xol; + while ((xol = skb_get_xfrm_offload(old, i++)) != NULL) { + if ((unsigned long) xol > XFRM_OFFLOAD_FIELD) + xfrm_offload_hold(xol); + } + } } /** From dave@thedillows.org Sun Jan 9 19:37:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 19:38:22 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A3bBsK000711 for ; Sun, 9 Jan 2005 19:37:11 -0800 Received: (qmail 30251 invoked by uid 0); 10 Jan 2005 15:36:49 -0000 Received: from user-69-1-45-93.knology.net (HELO ori.thedillows.org) (69.1.45.93) by smtp1.knology.net with SMTP; 10 Jan 2005 15:36:49 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0AFb2BR028683; Mon, 10 Jan 2005 10:37:02 -0500 Received: (from root@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0AFb2gD028682; Mon, 10 Jan 2005 10:37:02 -0500 Date: Mon, 10 Jan 2005 10:37:02 -0500 To: netdev@oss.sgi.com Cc: dave@thedillows.org From: David Dillow Subject: [RFC BK 18/22] xfrm offload v2: typhoon: add validation of offloaded xfrm_states Message-Id: <20040110014300.27@ori.thedillows.org> References: <20040110014300.26@ori.thedillows.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 10 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 00:58:39-05:00 dave@thedillows.org # Add routines to validate that the xfrm_state passed to them is # one that we can offload to the 3XP. # # Signed-off-by: David Dillow # # drivers/net/typhoon.c # 2005/01/10 00:58:23-05:00 dave@thedillows.org +90 -0 # Add routines to validate that the xfrm_state passed to them is # one that we can offload to the 3XP. # # Signed-off-by: David Dillow # diff -Nru a/drivers/net/typhoon.c b/drivers/net/typhoon.c --- a/drivers/net/typhoon.c 2005-01-10 01:17:08 -05:00 +++ b/drivers/net/typhoon.c 2005-01-10 01:17:08 -05:00 @@ -2329,6 +2329,96 @@ return 0; } +#define UNSUPPORTED goto unsupported +#define REQUIRED(x) if(!(x)) goto unsupported + +static inline int +typhoon_validate_ealgo(struct typhoon *tp, struct xfrm_state *x) +{ + switch(x->props.ealgo) { + case SADB_EALG_NULL: + break; + case SADB_EALG_DESCBC: + REQUIRED(x->ealg); + REQUIRED(tp->capabilities & TYPHOON_CRYPTO_DES); + REQUIRED(x->ealg->alg_key_len == 64); + break; + case SADB_EALG_3DESCBC: + REQUIRED(x->ealg); + REQUIRED(tp->capabilities & TYPHOON_CRYPTO_3DES); + REQUIRED(x->ealg->alg_key_len == 128 || + x->ealg->alg_key_len == 192); + break; + default: + UNSUPPORTED; + } + + return 1; + +unsupported: + return 0; +} + +static inline int +typhoon_validate_aalgo(struct typhoon *tp, struct xfrm_state *x) +{ + switch(x->props.aalgo) { + case SADB_X_AALG_NULL: + break; + case SADB_AALG_MD5HMAC: + REQUIRED(x->aalg); + REQUIRED(x->aalg->alg_key_len == 128); + break; + case SADB_AALG_SHA1HMAC: + REQUIRED(x->aalg); + REQUIRED(x->aalg->alg_key_len == 160); + break; + default: + UNSUPPORTED; + } + + return 1; + +unsupported: + return 0; +} + +static inline int +typhoon_validate_xfrm(struct typhoon *tp, struct xfrm_state *x) +{ + u8 ealgo, aalgo, need_auth = 1; + + REQUIRED(x->props.family == AF_INET); + REQUIRED(x->dir == XFRM_STATE_DIR_OUT || x->dir == XFRM_STATE_DIR_IN); + REQUIRED(!x->encap); + + aalgo = x->props.aalgo; + ealgo = x->props.ealgo; + + switch(x->type->proto) { + case IPPROTO_ESP: + need_auth = 0; + REQUIRED(aalgo != SADB_X_AALG_NULL || ealgo != SADB_EALG_NULL); + REQUIRED(typhoon_validate_ealgo(tp, x)); + /* fall through to validate auth algorithm */ + case IPPROTO_AH: + REQUIRED(typhoon_validate_aalgo(tp, x)); + if(need_auth) + REQUIRED(aalgo != SADB_X_AALG_NULL); + break; + default: + UNSUPPORTED; + } + + return 1; + +unsupported: + return 0; +} + +#undef REQUIRED +#undef UNSUPPORTED + static void typhoon_tx_timeout(struct net_device *dev) { From dave@thedillows.org Sun Jan 9 19:37:12 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 19:38:20 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A3bBOq000733 for ; Sun, 9 Jan 2005 19:37:12 -0800 Received: (qmail 30258 invoked by uid 0); 10 Jan 2005 15:36:50 -0000 Received: from user-69-1-45-93.knology.net (HELO ori.thedillows.org) (69.1.45.93) by smtp1.knology.net with SMTP; 10 Jan 2005 15:36:50 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0AFb3lf028699; Mon, 10 Jan 2005 10:37:03 -0500 Received: (from root@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0AFb3vw028698; Mon, 10 Jan 2005 10:37:03 -0500 Date: Mon, 10 Jan 2005 10:37:03 -0500 To: netdev@oss.sgi.com Cc: dave@thedillows.org From: David Dillow Subject: [RFC BK 22/22] xfrm offload v2: Add some documentation for the IPSEC crypto offload Message-Id: <20040110014300.31@ori.thedillows.org> References: <20040110014300.30@ori.thedillows.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 8 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 01:09:16-05:00 dave@thedillows.org # Add some documentation for the IPSEC crypto offload. # # Signed-off-by: David Dillow # # Documentation/networking/netdevices.txt # 2005/01/10 01:09:00-05:00 dave@thedillows.org +16 -0 # Add some documentation for the IPSEC crypto offload. # # Signed-off-by: David Dillow # diff -Nru a/Documentation/networking/netdevices.txt b/Documentation/networking/netdevices.txt --- a/Documentation/networking/netdevices.txt 2005-01-10 01:16:18 -05:00 +++ b/Documentation/networking/netdevices.txt 2005-01-10 01:16:18 -05:00 @@ -73,3 +73,19 @@ dev_close code and comments in net/core/dev.c for more info. Context: softirq +dev->xfrm_state_add: + Synchronization: rtnl_lock() semaphore. + Context: process + Notes: Only called for inbound xfrm_state(s). Can be invoked during + xfrm_accel_add() call. + +dev->xfrm_state_del: + Synchronization: None, but can be called inside dev->xmit_lock spinlock. + Context: BHs disabled/softirq + Notes: Called for all offloaded xfrm_state(s). Can be invoked during + xfrm_accel_flush() call. And possibly after dev->close... + +dev->xfrm_bundle_add: + Synchronization: None + Context: process + Notes: Called for newly created outbound xfrm bundles. From dave@thedillows.org Sun Jan 9 19:37:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 19:38:17 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A3bAga000704 for ; Sun, 9 Jan 2005 19:37:11 -0800 Received: (qmail 24704 invoked by uid 0); 10 Jan 2005 15:43:11 -0000 Received: from user-69-1-45-93.knology.net (HELO ori.thedillows.org) (69.1.45.93) by smtp8.knology.net with SMTP; 10 Jan 2005 15:43:11 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0AFb2De028679; Mon, 10 Jan 2005 10:37:02 -0500 Received: (from root@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0AFb2g7028678; Mon, 10 Jan 2005 10:37:02 -0500 Date: Mon, 10 Jan 2005 10:37:02 -0500 To: netdev@oss.sgi.com Cc: dave@thedillows.org From: David Dillow Subject: [RFC BK 17/22] xfrm offload v2: typhoon: split out setting of offloaded tasks Message-Id: <20040110014300.26@ori.thedillows.org> References: <20040110014300.25@ori.thedillows.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13652 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 00:57:58-05:00 dave@thedillows.org # Move the setting of the currently offloaded tasks to its own # function, as we'll be making use of it to change the crypto # offload status when adding/removing xfrms. # # Signed-off-by: David Dillow # # drivers/net/typhoon.c # 2005/01/10 00:57:41-05:00 dave@thedillows.org +26 -15 # Move the setting of the currently offloaded tasks to its own # function, as we'll be making use of it to change the crypto # offload status when adding/removing xfrms. # # Signed-off-by: David Dillow # diff -Nru a/drivers/net/typhoon.c b/drivers/net/typhoon.c --- a/drivers/net/typhoon.c 2005-01-10 01:17:21 -05:00 +++ b/drivers/net/typhoon.c 2005-01-10 01:17:21 -05:00 @@ -303,6 +303,7 @@ u16 xcvr_select; u16 wol_events; u32 offload; + spinlock_t offload_lock; u16 tx_sa_max; u16 rx_sa_max; @@ -724,11 +725,28 @@ return err; } +static int +typhoon_set_offload(struct typhoon *tp) +{ + /* Caller should hold tp->offload_lock, or otherwise guarantee + * exclusitivity to this routine. + */ + struct cmd_desc xp_cmd; + + smp_rmb(); + if(tp->card_state != Running) + return 0; + + INIT_COMMAND_WITH_RESPONSE(&xp_cmd, TYPHOON_CMD_SET_OFFLOAD_TASKS); + xp_cmd.parm2 = tp->offload; + xp_cmd.parm3 = tp->offload; + return typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); +} + static void typhoon_vlan_rx_register(struct net_device *dev, struct vlan_group *grp) { struct typhoon *tp = netdev_priv(dev); - struct cmd_desc xp_cmd; int err; spin_lock_bh(&tp->state_lock); @@ -736,25 +754,16 @@ /* We've either been turned on for the first time, or we've * been turned off. Update the 3XP. */ + spin_lock_bh(&tp->offload_lock); if(grp) tp->offload |= TYPHOON_OFFLOAD_VLAN; else tp->offload &= ~TYPHOON_OFFLOAD_VLAN; + err = typhoon_set_offload(tp); + spin_unlock_bh(&tp->offload_lock); - /* If the interface is up, the runtime is running -- and we - * must be up for the vlan core to call us. - * - * Do the command outside of the spin lock, as it is slow. - */ - INIT_COMMAND_WITH_RESPONSE(&xp_cmd, - TYPHOON_CMD_SET_OFFLOAD_TASKS); - xp_cmd.parm2 = tp->offload; - xp_cmd.parm3 = tp->offload; - spin_unlock_bh(&tp->state_lock); - err = typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); if(err < 0) printk("%s: vlan offload error %d\n", tp->name, -err); - spin_lock_bh(&tp->state_lock); } /* now make the change visible */ @@ -1485,6 +1494,7 @@ spin_lock_init(&tp->command_lock); spin_lock_init(&tp->state_lock); + spin_lock_init(&tp->offload_lock); } static void @@ -2217,12 +2227,13 @@ if(err < 0) goto error_out; + /* tp->card_state != Running, so nothing will change this out + * from under us. + */ INIT_COMMAND_NO_RESPONSE(&xp_cmd, TYPHOON_CMD_SET_OFFLOAD_TASKS); - spin_lock_bh(&tp->state_lock); xp_cmd.parm2 = tp->offload; xp_cmd.parm3 = tp->offload; err = typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL); - spin_unlock_bh(&tp->state_lock); if(err < 0) goto error_out; From dave@thedillows.org Sun Jan 9 19:37:12 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 19:38:17 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A3bBWC000720 for ; Sun, 9 Jan 2005 19:37:11 -0800 Received: (qmail 1934 invoked by uid 0); 10 Jan 2005 15:35:21 -0000 Received: from user-69-1-45-93.knology.net (HELO ori.thedillows.org) (69.1.45.93) by smtp5.knology.net with SMTP; 10 Jan 2005 15:35:21 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0AFb3CW028691; Mon, 10 Jan 2005 10:37:03 -0500 Received: (from root@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0AFb2IG028690; Mon, 10 Jan 2005 10:37:02 -0500 Date: Mon, 10 Jan 2005 10:37:02 -0500 To: netdev@oss.sgi.com Cc: dave@thedillows.org From: David Dillow Subject: [RFC BK 20/22] xfrm offload v2: typhoon: add management of outbound bundles Message-Id: <20040110014300.29@ori.thedillows.org> References: <20040110014300.28@ori.thedillows.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 2 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 01:05:38-05:00 dave@thedillows.org # Add the offloading of outbound bundles. # # This is a tricky business, because there are restrictions on # the types and order of the xfrms we can offload. Some combinations # also yield incorrect results, so we have to reduce the amount of # offloading we do in those cases. # # Signed-off-by: David Dillow # # drivers/net/typhoon.c # 2005/01/10 01:05:20-05:00 dave@thedillows.org +167 -0 # Add the offloading of outbound bundles. # # This is a tricky business, because there are restrictions on # the types and order of the xfrms we can offload. Some combinations # also yield incorrect results, so we have to reduce the amount of # offloading we do in those cases. # # Signed-off-by: David Dillow # diff -Nru a/drivers/net/typhoon.c b/drivers/net/typhoon.c --- a/drivers/net/typhoon.c 2005-01-10 01:16:43 -05:00 +++ b/drivers/net/typhoon.c 2005-01-10 01:16:43 -05:00 @@ -358,6 +358,12 @@ #define TSO_OFFLOAD_ON 0 #endif +/* We need room for a maximum of 5 dst_entries -- the longest chain of + * headers we support for offloading is (inner -> outer): + * ESP AH IP2 ESP AH IP1 -- and IP2 is part of the second ESP dst + * (tunnel mode) + */ +#define TYPHOON_MAX_HEADERS 5 #define IPSEC_NUM_DESCRIPTORS 1 struct typhoon_xfrm_offload { @@ -2584,6 +2590,167 @@ "offload (%d)\n", tp->name, -err); } spin_unlock_bh(&tp->offload_lock); +} + +static int inline +typhoon_bundle_list(struct dst_entry *bundle, struct dst_entry *dst_list[], + int max_entries) +{ + /* While putting the bundle into the dst_list so we can iterate it + * in reverse, scan for problematic offload sequences. Skip over + * the last xfrm in the sequence, so that we still offload as much + * as possible. + * + * This list was generated using runtime 03.001.002, but the + * problems are still present in 03.001.008. I have not re-investigated + * the problems to determine if the symptoms have changed. + * + * inner AH tunnel, outer AH transport + * --> 3XP seems to put the inner hash at the wrong location + * inner AH tunnel, outer ESP tunnel + * --> 3XP corrupts outer hash, maybe wrong place? + * inner AH transport, outer ESP tunnel + * --> 3XP seems to encrypt the wrong portion of the packet + * inner ESP transport, outer AH tunnel + * --> 3XP lockup, requires reset + * + * No problematic offloads start with ESP in tunnel mode, so pretend + * that was the last one we looked at. + */ + int last_was_ah = 0, last_was_tunnel = 1; + struct dst_entry *dst = bundle; + struct xfrm_state *x; + int start = max_entries; + int bundle_size = 0; + int proto, problem; + + while(bundle) { + x = bundle->xfrm; + proto = x ? x->type->proto : IPPROTO_IP; + + problem = 0; + if(proto == IPPROTO_AH && !x->props.mode && + (last_was_ah && last_was_tunnel)) + problem = 1; + else if(proto == IPPROTO_AH && x->props.mode && + !(last_was_ah || last_was_tunnel)) + problem = 1; + else if(proto == IPPROTO_ESP && x->props.mode && last_was_ah) + problem = 1; + + if(problem) { + /* We hit a snag -- forget about the xfrms we've + * seen before the current one. + */ + bundle_size = 1; + dst = bundle; + } else { + bundle_size++; + if(bundle_size > max_entries) + dst = dst->child; + } + + last_was_ah = (proto == IPPROTO_AH); + last_was_tunnel = x ? x->props.mode : 0; + bundle = bundle->child; + } + + if(bundle_size < max_entries) + start = bundle_size; + + bundle_size = 0; + while(dst) { + dst_list[--start] = dst; + dst = dst->child; + bundle_size++; + } + + return bundle_size; +} + +static void +typhoon_xfrm_bundle_add(struct net_device *dev, struct dst_entry *bundle) +{ + /* Walk from the outermost dst back up the chain, offloading + * until we hit something we cannot deal with. + */ + struct typhoon *tp = netdev_priv(dev); + struct xfrm_state *x; + struct xfrm_offload *xol; + struct typhoon_xfrm_offload *txo; + struct dst_entry *dst_list[TYPHOON_MAX_HEADERS]; + struct dst_entry *dst; + int list_size; + int i, proto; + int level = 0; + int last = -1; + + smp_rmb(); + if(tp->card_state != Running) + return; + + list_size = typhoon_bundle_list(bundle, dst_list, TYPHOON_MAX_HEADERS); + + for(i = 0; i < list_size; i++) { + dst = dst_list[i]; + x = dst->xfrm; + + /* Only support IPv4 */ + if(dst->ops->family != AF_INET) + goto cannot_offload; + + proto = x ? x->type->proto : IPPROTO_IP; + + switch(proto) { + case IPPROTO_IP: + case IPPROTO_IPIP: + if(last == IPPROTO_IP || last == IPPROTO_IPIP) + goto cannot_offload; + if(level) + level++; + last = proto; + continue; + case IPPROTO_ESP: + if(last != IPPROTO_AH) + level++; + break; + case IPPROTO_AH: + level++; + break; + default: + goto cannot_offload; + } + + last = proto; + + /* We only support two layers of IPSEC, seperated by + * an IP header. Given AH3 IP3 AH2 IP2 AH1 IP1, only + * offload AH1 and AH2, etc. + */ + if(level > 2) + goto cannot_offload; + + if(dst->xfrm_offload) + continue; + + xol = xfrm_offload_get(x, dev); + if(!xol) { + xol = typhoon_offload_ipsec(tp, x); + if(xol) + xfrm_offload_hold(xol); + } + + if(!xol) + goto cannot_offload; + + dst->xfrm_offload = xol; + txo = xfrm_offload_priv(xol); + if(txo->tunnel) + last = IPPROTO_IPIP; + } + +cannot_offload: + return; } static void From dave@thedillows.org Sun Jan 9 19:37:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 19:38:17 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A3b8kA000634 for ; Sun, 9 Jan 2005 19:37:08 -0800 Received: (qmail 1432 invoked by uid 0); 10 Jan 2005 15:37:22 -0000 Received: from user-69-1-45-93.knology.net (HELO ori.thedillows.org) (69.1.45.93) by smtp2.knology.net with SMTP; 10 Jan 2005 15:37:22 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0AFaxZO028627; Mon, 10 Jan 2005 10:36:59 -0500 Received: (from root@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0AFaxWJ028626; Mon, 10 Jan 2005 10:36:59 -0500 Date: Mon, 10 Jan 2005 10:36:59 -0500 To: netdev@oss.sgi.com Cc: dave@thedillows.org From: David Dillow Subject: [RFC BK 4/22] xfrm offload v2: Try to offload inbound xfrm_states Message-Id: <20040110014300.13@ori.thedillows.org> References: <20040110014300.12@ori.thedillows.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13652 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 00:08:02-05:00 dave@thedillows.org # Plumb in offloading of inbound xfrm_states. # # Signed-off-by: David Dillow # # net/xfrm/xfrm_state.c # 2005/01/10 00:07:45-05:00 dave@thedillows.org +26 -1 # Try to offload an inbound xfrm_state when it is added or updated. # Since it could potentially come in from any interface, try to # offload it on all devices that support it. # # Signed-off-by: David Dillow # diff -Nru a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c --- a/net/xfrm/xfrm_state.c 2005-01-10 01:20:02 -05:00 +++ b/net/xfrm/xfrm_state.c 2005-01-10 01:20:02 -05:00 @@ -401,6 +401,24 @@ spin_unlock_bh(&xfrm_state_lock); } +static void xfrm_state_inbound_accel(struct xfrm_state *x) +{ + /* Only called for an inbound xfrm_state. Since it could + * possibly arrive on any interface, try to offload it + * on all devices that are capable. + */ + struct net_device *dev; + + rtnl_lock(); + dev = dev_base; + while (dev) { + if (netif_running(dev) && (dev->features & NETIF_F_IPSEC)) + dev->xfrm_state_add(dev, x); + dev = dev->next; + } + rtnl_unlock(); +} + static struct xfrm_state *__xfrm_find_acq_byseq(u32 seq); int xfrm_state_add(struct xfrm_state *x) @@ -447,6 +465,9 @@ spin_unlock_bh(&xfrm_state_lock); xfrm_state_put_afinfo(afinfo); + if (!err && x->dir == XFRM_STATE_DIR_IN) + xfrm_state_inbound_accel(x); + if (x1) { xfrm_state_delete(x1); xfrm_state_put(x1); @@ -458,7 +479,7 @@ int xfrm_state_update(struct xfrm_state *x) { struct xfrm_state_afinfo *afinfo; - struct xfrm_state *x1; + struct xfrm_state *x1, *accel = NULL; int err; afinfo = xfrm_state_get_afinfo(x->props.family); @@ -482,6 +503,7 @@ if (x1->km.state == XFRM_STATE_ACQ) { __xfrm_state_insert(x); + accel = x; x = NULL; } err = 0; @@ -492,6 +514,9 @@ if (err) return err; + + if (accel && accel->dir == XFRM_STATE_DIR_IN) + xfrm_state_inbound_accel(accel); if (!x) { xfrm_state_delete(x1); From dave@thedillows.org Sun Jan 9 19:37:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 19:38:17 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A3b9BW000651 for ; Sun, 9 Jan 2005 19:37:09 -0800 Received: (qmail 12772 invoked by uid 0); 10 Jan 2005 15:45:38 -0000 Received: from user-69-1-45-93.knology.net (HELO ori.thedillows.org) (69.1.45.93) by smtp7.knology.net with SMTP; 10 Jan 2005 15:45:38 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0AFb0FQ028631; Mon, 10 Jan 2005 10:37:00 -0500 Received: (from root@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0AFb0Gg028630; Mon, 10 Jan 2005 10:37:00 -0500 Date: Mon, 10 Jan 2005 10:37:00 -0500 To: netdev@oss.sgi.com Cc: dave@thedillows.org From: David Dillow Subject: [RFC BK 5/22] xfrm offload v2: Attempt to offload bundled xfrm_states for outbound xfrms Message-Id: <20040110014300.14@ori.thedillows.org> References: <20040110014300.13@ori.thedillows.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13653 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 00:39:35-05:00 dave@thedillows.org # Plumb in offloading new bundles for outgoing packets. # # Signed-off-by: David Dillow # # net/xfrm/xfrm_policy.c # 2005/01/10 00:39:18-05:00 dave@thedillows.org +47 -0 # When we create a new bundle for an outbound flow, try to # offload as much as the destination driver will allow. # # Don't forget to clean up.... # # Signed-off-by: David Dillow # # include/net/dst.h # 2005/01/10 00:39:18-05:00 dave@thedillows.org +2 -0 # Add a field to store the offload information for this part # of the outgoing bundle (non-NULL if this dst is offloaded.) # # Signed-off-by: David Dillow # diff -Nru a/include/net/dst.h b/include/net/dst.h --- a/include/net/dst.h 2005-01-10 01:19:50 -05:00 +++ b/include/net/dst.h 2005-01-10 01:19:50 -05:00 @@ -65,6 +65,8 @@ struct neighbour *neighbour; struct hh_cache *hh; struct xfrm_state *xfrm; + struct xfrm_offload *xfrm_offload; + struct dst_entry *offload_next; int (*input)(struct sk_buff*); int (*output)(struct sk_buff*); diff -Nru a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c --- a/net/xfrm/xfrm_policy.c 2005-01-10 01:19:50 -05:00 +++ b/net/xfrm/xfrm_policy.c 2005-01-10 01:19:50 -05:00 @@ -40,6 +40,10 @@ LIST_HEAD_INIT(xfrm_policy_gc_list); static spinlock_t xfrm_policy_gc_lock = SPIN_LOCK_UNLOCKED; +static struct work_struct xfrm_accel_work; +static struct dst_entry *xfrm_accel_list; +static spinlock_t xfrm_accel_lock = SPIN_LOCK_UNLOCKED; + static struct xfrm_policy_afinfo *xfrm_policy_get_afinfo(unsigned short family); static void xfrm_policy_put_afinfo(struct xfrm_policy_afinfo *afinfo); @@ -707,8 +711,47 @@ }; } +static void xfrm_accel_bundle(struct dst_entry *dst) +{ + if (dst->dev && (dst->dev->features & NETIF_F_IPSEC)) { + dst_hold(dst); + + spin_lock_bh(&xfrm_accel_lock); + dst->offload_next = xfrm_accel_list; + xfrm_accel_list = dst; + spin_unlock_bh(&xfrm_accel_lock); + schedule_work(&xfrm_accel_work); + } +} + static int stale_bundle(struct dst_entry *dst); +static void xfrm_accel_task(void *data) +{ + struct dst_entry *dst, *next; + struct net_device *dev; + + spin_lock_bh(&xfrm_accel_lock); + dst = xfrm_accel_list; + xfrm_accel_list = NULL; + spin_unlock_bh(&xfrm_accel_lock); + + while (dst) { + next = dst->offload_next; + dst->offload_next = NULL; + dev = dst->dev; + + /* stale_bundle() validates that we have a dev, and that it + * is currently running. + */ + if (!stale_bundle(dst) && (dev->features & NETIF_F_IPSEC)) + dev->xfrm_bundle_add(dev, dst); + + dst_release(dst); + dst = next; + } +} + /* Main function: finds/creates a bundle for given flow. * * At the moment we eat a raw IP route. Mostly to speed up lookups @@ -834,6 +877,7 @@ dst->next = policy->bundles; policy->bundles = dst; dst_hold(dst); + xfrm_accel_bundle(dst); write_unlock_bh(&policy->lock); } *dst_p = dst; @@ -1025,8 +1069,10 @@ { if (!dst->xfrm) return; + xfrm_offload_release(dst->xfrm_offload); xfrm_state_put(dst->xfrm); dst->xfrm = NULL; + dst->xfrm_offload = NULL; } static void xfrm_link_failure(struct sk_buff *skb) @@ -1238,6 +1284,7 @@ panic("XFRM: failed to allocate xfrm_dst_cache\n"); INIT_WORK(&xfrm_policy_gc_work, xfrm_policy_gc_task, NULL); + INIT_WORK(&xfrm_accel_work, xfrm_accel_task, NULL); register_netdevice_notifier(&xfrm_dev_notifier); } From dave@thedillows.org Sun Jan 9 19:37:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 19:38:17 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A3bABn000700 for ; Sun, 9 Jan 2005 19:37:11 -0800 Received: (qmail 1451 invoked by uid 0); 10 Jan 2005 15:37:24 -0000 Received: from user-69-1-45-93.knology.net (HELO ori.thedillows.org) (69.1.45.93) by smtp2.knology.net with SMTP; 10 Jan 2005 15:37:24 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0AFb1Oo028667; Mon, 10 Jan 2005 10:37:01 -0500 Received: (from root@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0AFb132028666; Mon, 10 Jan 2005 10:37:01 -0500 Date: Mon, 10 Jan 2005 10:37:01 -0500 To: netdev@oss.sgi.com Cc: dave@thedillows.org From: David Dillow Subject: [RFC BK 14/22] xfrm offload v2: typhoon: add inbound offload result processing Message-Id: <20040110014300.23@ori.thedillows.org> References: <20040110014300.22@ori.thedillows.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13652 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 00:54:54-05:00 dave@thedillows.org # Add inbound packet crypto result processing to the Typhoon driver. # # Signed-off-by: David Dillow # # drivers/net/typhoon.c # 2005/01/10 00:54:37-05:00 dave@thedillows.org +42 -0 # Add inbound packet crypto result processing to the Typhoon driver. # # Signed-off-by: David Dillow # diff -Nru a/drivers/net/typhoon.c b/drivers/net/typhoon.c --- a/drivers/net/typhoon.c 2005-01-10 01:17:58 -05:00 +++ b/drivers/net/typhoon.c 2005-01-10 01:17:58 -05:00 @@ -130,6 +130,7 @@ #include #include #include +#include #include "typhoon.h" #include "typhoon-firmware.h" @@ -1680,6 +1681,43 @@ return 0; } +static inline void +typhoon_ipsec_rx(struct sk_buff *skb, u16 results) +{ +#define CHECK_OFFLOAD(good, bad) \ + do { if(results & (good|bad)) { \ + unsigned int tmp = XFRM_OFFLOAD_CONF | XFRM_OFFLOAD_AUTH; \ + tmp |= (results & good) ? XFRM_OFFLOAD_AUTH_OK : \ + XFRM_OFFLOAD_AUTH_FAIL; \ + if(skb_put_xfrm_result(skb, tmp, i)) \ + return; \ + i++; \ + } } while(0) + + /* We have no way to determine what the order of the SAs were on + * the wire, just the 1st AH seen, the 1st ESP seen, etc. + * + * We just walk the stack, and pretend that AH SAs get decypted + * so that if we get the order wrong, the worst case scenerio is + * that we indicate the failure on the wrong SA, since we'll need + * to match all SAs against the policy. + * + * We get a "ESP good" indication for null auth hash on ESP. + */ + /* XXX think more about security indications -- can I craft a + * packet to do bad things -- maybe a NULL auth ESP packet, + * and a failed AH packet? + */ + int i = 0; + + CHECK_OFFLOAD(TYPHOON_RX_AH1_GOOD, TYPHOON_RX_AH1_FAIL); + CHECK_OFFLOAD(TYPHOON_RX_ESP1_GOOD, TYPHOON_RX_ESP1_FAIL); + CHECK_OFFLOAD(TYPHOON_RX_AH2_GOOD, TYPHOON_RX_AH2_FAIL); + CHECK_OFFLOAD(TYPHOON_RX_ESP2_GOOD, TYPHOON_RX_ESP2_FAIL); + +#undef CHECK_OFFLOAD +} + static int typhoon_rx(struct typhoon *tp, struct basic_ring *rxRing, volatile u32 * ready, volatile u32 * cleared, int budget) @@ -1744,6 +1782,10 @@ new_skb->ip_summed = CHECKSUM_UNNECESSARY; } else new_skb->ip_summed = CHECKSUM_NONE; + + if((rx->rxStatus & TYPHOON_RX_IPSEC) && + !(rx->rxStatus & TYPHOON_RX_IP_FRAG)) + typhoon_ipsec_rx(new_skb, rx->ipsecResults); spin_lock(&tp->state_lock); if(tp->vlgrp != NULL && rx->rxStatus & TYPHOON_RX_VLAN) From dave@thedillows.org Sun Jan 9 19:37:10 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 19:38:17 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A3b9Ge000671 for ; Sun, 9 Jan 2005 19:37:10 -0800 Received: (qmail 12958 invoked by uid 0); 10 Jan 2005 15:37:23 -0000 Received: from user-69-1-45-93.knology.net (HELO ori.thedillows.org) (69.1.45.93) by smtp6.knology.net with SMTP; 10 Jan 2005 15:37:23 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0AFb1RN028659; Mon, 10 Jan 2005 10:37:01 -0500 Received: (from root@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0AFb1wh028658; Mon, 10 Jan 2005 10:37:01 -0500 Date: Mon, 10 Jan 2005 10:37:01 -0500 To: netdev@oss.sgi.com Cc: dave@thedillows.org From: David Dillow Subject: [RFC BK 12/22] xfrm offload v2: Add ethtool support for crypto offload control Message-Id: <20040110014300.21@ori.thedillows.org> References: <20040110014300.20@ori.thedillows.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13652 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 00:52:57-05:00 dave@thedillows.org # Add support for querying and changing the status of the # IPSEC crypto offload feature of a NIC. # # Signed-off-by: David Dillow # # net/core/ethtool.c # 2005/01/10 00:52:40-05:00 dave@thedillows.org +54 -0 # Add support for querying and changing the status of the IPSEC # crypto offload feature of a NIC. # # Turn on/off the feature flag before informing the xfrm engine # of the change so that existing xfrms get the new settings. # # Signed-off-by: David Dillow # # include/linux/ethtool.h # 2005/01/10 00:52:40-05:00 dave@thedillows.org +8 -0 # Add support for querying and changing the status of the # IPSEC crypto offload feature of a NIC. # # Signed-off-by: David Dillow # diff -Nru a/include/linux/ethtool.h b/include/linux/ethtool.h --- a/include/linux/ethtool.h 2005-01-10 01:18:23 -05:00 +++ b/include/linux/ethtool.h 2005-01-10 01:18:23 -05:00 @@ -260,6 +260,8 @@ int ethtool_op_set_sg(struct net_device *dev, u32 data); u32 ethtool_op_get_tso(struct net_device *dev); int ethtool_op_set_tso(struct net_device *dev, u32 data); +u32 ethtool_op_get_ipsec(struct net_device *dev); +int ethtool_op_set_ipsec(struct net_device *dev, u32 data); /** * ðtool_ops - Alter and report network device settings @@ -293,6 +295,8 @@ * get_strings: Return a set of strings that describe the requested objects * phys_id: Identify the device * get_stats: Return statistics about the device + * get_ipsec: Report whether IPSEC crypto offload is enabled + * set_ipsec: Turn IPSEC crypto offload on or off * * Description: * @@ -345,6 +349,8 @@ int (*set_sg)(struct net_device *, u32); u32 (*get_tso)(struct net_device *); int (*set_tso)(struct net_device *, u32); + u32 (*get_ipsec)(struct net_device *); + int (*set_ipsec)(struct net_device *, u32); int (*self_test_count)(struct net_device *); void (*self_test)(struct net_device *, struct ethtool_test *, u64 *); void (*get_strings)(struct net_device *, u32 stringset, u8 *); @@ -388,6 +394,8 @@ #define ETHTOOL_GSTATS 0x0000001d /* get NIC-specific statistics */ #define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */ #define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */ +#define ETHTOOL_GIPSEC 0x00000020 /* Get IPSEC enable (ethtool_value) */ +#define ETHTOOL_SIPSEC 0x00000021 /* Set IPSEC enable (ethtool_value) */ /* compatibility with older code */ #define SPARC_ETH_GSET ETHTOOL_GSET diff -Nru a/net/core/ethtool.c b/net/core/ethtool.c --- a/net/core/ethtool.c 2005-01-10 01:18:23 -05:00 +++ b/net/core/ethtool.c 2005-01-10 01:18:23 -05:00 @@ -14,6 +14,7 @@ #include #include #include +#include #include /* @@ -72,6 +73,24 @@ return 0; } +u32 ethtool_op_get_ipsec(struct net_device *dev) +{ + return (dev->features & NETIF_F_IPSEC) != 0; +} + +int ethtool_op_set_ipsec(struct net_device *dev, u32 data) +{ + if (data) { + dev->features |= NETIF_F_IPSEC; + xfrm_accel_add(dev); + } else { + dev->features &= ~NETIF_F_IPSEC; + xfrm_accel_flush(dev); + } + + return 0; +} + /* Handlers for each ethtool command */ static int ethtool_get_settings(struct net_device *dev, void __user *useraddr) @@ -548,6 +567,33 @@ return dev->ethtool_ops->set_tso(dev, edata.data); } +static int ethtool_get_ipsec(struct net_device *dev, char __user *useraddr) +{ + struct ethtool_value edata = { ETHTOOL_GIPSEC }; + + if (!dev->ethtool_ops->get_ipsec) + return -EOPNOTSUPP; + + edata.data = dev->ethtool_ops->get_ipsec(dev); + + if (copy_to_user(useraddr, &edata, sizeof(edata))) + return -EFAULT; + return 0; +} + +static int ethtool_set_ipsec(struct net_device *dev, char __user *useraddr) +{ + struct ethtool_value edata; + + if (!dev->ethtool_ops->set_ipsec) + return -EOPNOTSUPP; + + if (copy_from_user(&edata, useraddr, sizeof(edata))) + return -EFAULT; + + return dev->ethtool_ops->set_ipsec(dev, edata.data); +} + static int ethtool_self_test(struct net_device *dev, char __user *useraddr) { struct ethtool_test test; @@ -783,6 +829,12 @@ case ETHTOOL_STSO: rc = ethtool_set_tso(dev, useraddr); break; + case ETHTOOL_GIPSEC: + rc = ethtool_get_ipsec(dev, useraddr); + break; + case ETHTOOL_SIPSEC: + rc = ethtool_set_ipsec(dev, useraddr); + break; case ETHTOOL_TEST: rc = ethtool_self_test(dev, useraddr); break; @@ -813,7 +865,9 @@ EXPORT_SYMBOL(ethtool_op_get_link); EXPORT_SYMBOL(ethtool_op_get_sg); EXPORT_SYMBOL(ethtool_op_get_tso); +EXPORT_SYMBOL(ethtool_op_get_ipsec); EXPORT_SYMBOL(ethtool_op_get_tx_csum); EXPORT_SYMBOL(ethtool_op_set_sg); EXPORT_SYMBOL(ethtool_op_set_tso); +EXPORT_SYMBOL(ethtool_op_set_ipsec); EXPORT_SYMBOL(ethtool_op_set_tx_csum); From dave@thedillows.org Sun Jan 9 19:37:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 19:38:19 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A3b7UB000628 for ; Sun, 9 Jan 2005 19:37:08 -0800 Received: (qmail 1915 invoked by uid 0); 10 Jan 2005 15:35:17 -0000 Received: from user-69-1-45-93.knology.net (HELO ori.thedillows.org) (69.1.45.93) by smtp5.knology.net with SMTP; 10 Jan 2005 15:35:17 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0AFax6T028615; Mon, 10 Jan 2005 10:36:59 -0500 Received: (from root@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0AFaxvb028614; Mon, 10 Jan 2005 10:36:59 -0500 Date: Mon, 10 Jan 2005 10:36:59 -0500 To: netdev@oss.sgi.com Cc: dave@thedillows.org From: David Dillow Subject: [RFC BK 1/22] xfrm offload v2: Add direction information to xfrm_state Message-Id: <20040110014300.10@ori.thedillows.org> References: <20040110014300.01@ori.thedillows.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 6 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/09 23:59:53-05:00 dave@thedillows.org # Add direction information to xfrm_state. This will be needed to # offload xfrm processing to the NIC. # # Signed-off-by: David Dillow # # net/xfrm/xfrm_state.c # 2005/01/09 23:59:35-05:00 dave@thedillows.org +5 -0 # Add direction information to xfrm_state. This will be needed to # offload xfrm processing to the NIC. # # Signed-off-by: David Dillow # # net/ipv6/xfrm6_state.c # 2005/01/09 23:59:35-05:00 dave@thedillows.org +10 -0 # Place holder for adding IPv6 direction mapping routine. # # net/ipv4/xfrm4_state.c # 2005/01/09 23:59:35-05:00 dave@thedillows.org +9 -0 # Add direction information to xfrm_state. This will be needed to # offload xfrm processing to the NIC. # # Signed-off-by: David Dillow # # include/net/xfrm.h # 2005/01/09 23:59:35-05:00 dave@thedillows.org +10 -0 # Add direction information to xfrm_state. This will be needed to # offload xfrm processing to the NIC. # # Signed-off-by: David Dillow # diff -Nru a/include/net/xfrm.h b/include/net/xfrm.h --- a/include/net/xfrm.h 2005-01-10 01:20:40 -05:00 +++ b/include/net/xfrm.h 2005-01-10 01:20:40 -05:00 @@ -146,6 +146,9 @@ /* Private data of this transformer, format is opaque, * interpreted by xfrm_type methods. */ void *data; + + /* Intended direction of this state, used for offloading */ + u8 dir; }; enum { @@ -157,6 +160,12 @@ XFRM_STATE_DEAD }; +enum { + XFRM_STATE_DIR_UNKNOWN, + XFRM_STATE_DIR_IN, + XFRM_STATE_DIR_OUT, +}; + struct xfrm_type; struct xfrm_dst; struct xfrm_policy_afinfo { @@ -194,6 +203,7 @@ struct xfrm_state *(*find_acq)(u8 mode, u32 reqid, u8 proto, xfrm_address_t *daddr, xfrm_address_t *saddr, int create); + u8 (*direction)(struct xfrm_state *xfrm); }; extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo); diff -Nru a/net/ipv4/xfrm4_state.c b/net/ipv4/xfrm4_state.c --- a/net/ipv4/xfrm4_state.c 2005-01-10 01:20:40 -05:00 +++ b/net/ipv4/xfrm4_state.c 2005-01-10 01:20:40 -05:00 @@ -106,12 +106,21 @@ return x0; } +static u8 +__xfrm4_direction(struct xfrm_state *x) +{ + if (inet_addr_type(x->id.daddr.a4) == RTN_LOCAL) + return XFRM_STATE_DIR_IN; + return XFRM_STATE_DIR_OUT; +} + static struct xfrm_state_afinfo xfrm4_state_afinfo = { .family = AF_INET, .lock = RW_LOCK_UNLOCKED, .init_tempsel = __xfrm4_init_tempsel, .state_lookup = __xfrm4_state_lookup, .find_acq = __xfrm4_find_acq, + .direction = __xfrm4_direction, }; void __init xfrm4_state_init(void) diff -Nru a/net/ipv6/xfrm6_state.c b/net/ipv6/xfrm6_state.c --- a/net/ipv6/xfrm6_state.c 2005-01-10 01:20:40 -05:00 +++ b/net/ipv6/xfrm6_state.c 2005-01-10 01:20:40 -05:00 @@ -116,12 +116,22 @@ return x0; } +static u8 +__xfrm6_direction(struct xfrm_state *x) +{ + /* XXX This needs to be implemented by someone who knows + * IPv6 better then I. + */ + return XFRM_STATE_DIR_UNKNOWN; +} + static struct xfrm_state_afinfo xfrm6_state_afinfo = { .family = AF_INET6, .lock = RW_LOCK_UNLOCKED, .init_tempsel = __xfrm6_init_tempsel, .state_lookup = __xfrm6_state_lookup, .find_acq = __xfrm6_find_acq, + .direction = __xfrm6_direction, }; void __init xfrm6_state_init(void) diff -Nru a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c --- a/net/xfrm/xfrm_state.c 2005-01-10 01:20:40 -05:00 +++ b/net/xfrm/xfrm_state.c 2005-01-10 01:20:40 -05:00 @@ -189,6 +189,7 @@ x->lft.soft_packet_limit = XFRM_INF; x->lft.hard_byte_limit = XFRM_INF; x->lft.hard_packet_limit = XFRM_INF; + x->dir = XFRM_STATE_DIR_UNKNOWN; spin_lock_init(&x->lock); } return x; @@ -407,6 +408,8 @@ if (unlikely(afinfo == NULL)) return -EAFNOSUPPORT; + x->dir = afinfo->direction(x); + spin_lock_bh(&xfrm_state_lock); x1 = afinfo->state_lookup(&x->id.daddr, x->id.spi, x->id.proto); @@ -454,6 +457,8 @@ afinfo = xfrm_state_get_afinfo(x->props.family); if (unlikely(afinfo == NULL)) return -EAFNOSUPPORT; + + x->dir = afinfo->direction(x); spin_lock_bh(&xfrm_state_lock); x1 = afinfo->state_lookup(&x->id.daddr, x->id.spi, x->id.proto); From dave@thedillows.org Sun Jan 9 19:37:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 19:38:17 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A3bAs0000689 for ; Sun, 9 Jan 2005 19:37:10 -0800 Received: (qmail 12963 invoked by uid 0); 10 Jan 2005 15:37:24 -0000 Received: from user-69-1-45-93.knology.net (HELO ori.thedillows.org) (69.1.45.93) by smtp6.knology.net with SMTP; 10 Jan 2005 15:37:24 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0AFb2qc028671; Mon, 10 Jan 2005 10:37:02 -0500 Received: (from root@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0AFb1tb028670; Mon, 10 Jan 2005 10:37:01 -0500 Date: Mon, 10 Jan 2005 10:37:01 -0500 To: netdev@oss.sgi.com Cc: dave@thedillows.org From: David Dillow Subject: [RFC BK 15/22] xfrm offload v2: typhoon: add outbound offload processing Message-Id: <20040110014300.24@ori.thedillows.org> References: <20040110014300.23@ori.thedillows.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13652 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 00:56:27-05:00 dave@thedillows.org # Add outbound xfrm crypto offload processing to the packet path. # # Signed-off-by: David Dillow # # drivers/net/typhoon.c # 2005/01/10 00:56:11-05:00 dave@thedillows.org +130 -0 # Add outbound xfrm crypto offload processing to the packet path. # # Signed-off-by: David Dillow # diff -Nru a/drivers/net/typhoon.c b/drivers/net/typhoon.c --- a/drivers/net/typhoon.c 2005-01-10 01:17:46 -05:00 +++ b/drivers/net/typhoon.c 2005-01-10 01:17:46 -05:00 @@ -351,6 +351,15 @@ #define TSO_OFFLOAD_ON 0 #endif +#define IPSEC_NUM_DESCRIPTORS 1 + +struct typhoon_xfrm_offload { + u16 sa_cookie; + u16 tunnel:1, + ah:1, + inbound:1; +}; + static inline void typhoon_inc_index(u32 *index, const int count, const int num_entries) { @@ -778,12 +787,115 @@ tcpd->status = 0; } +static inline int +typhoon_ipsec_fill(struct typhoon *tp, struct sk_buff *skb, + struct transmit_ring *txRing) +{ + struct xfrm_offload *xol; + struct typhoon_xfrm_offload *txo; + struct ipsec_desc *ipsec; + int last_was_esp = 0; + int i, entry; + u32 sa[3]; + + ipsec = (struct ipsec_desc *) (txRing->ringBase + txRing->lastWrite); + typhoon_inc_tx_index(&txRing->lastWrite, 1); + + ipsec->flags = TYPHOON_OPT_DESC | TYPHOON_OPT_IPSEC; + ipsec->numDesc = 1; + ipsec->ipsecFlags = TYPHOON_IPSEC_USE_IV; + ipsec->reserved = 0; + sa[0] = sa[1] = sa[2] = 0; + + /* Fill the offload descriptor with the cookies to indicate + * which key set to use when. While we're looping through the + * offloaded xfrms, if the last xfrm was ESP, and we're doing + * AH now, * then we can move the ESP part to the top of the + * descriptor. Otherwise, we'll need to move to the next one. + * We overrun into sa[2] to prevent needing to check the entry + * limit in the middile of things. + */ + entry = i = 0; + xol = skb_get_xfrm_offload(skb, i++); + while(xol && entry < 2) { + xfrm_offload_hold(xol); + txo = xfrm_offload_priv(xol); + if(sa[entry] && txo->tunnel) + entry++; + if(sa[entry] & 0xffff) { + if(last_was_esp && txo->ah) + sa[entry] <<= 16; + else + entry++; + } + + sa[entry] |= txo->sa_cookie; + last_was_esp = !txo->ah; + + xol = skb_get_xfrm_offload(skb, i++); + } + + /* Make sure we used all of the xfrms that were offloaded. + */ + if(unlikely(entry == 2 && xol)) { + if(net_ratelimit()) + printk(KERN_ERR "%s: failing to offload IPSEC packet " + "with too many xfrms!\n", tp->name); + goto bad_packet; + } + + ipsec->sa[0] = cpu_to_le16(sa[0] & 0xffff); + ipsec->sa[1] = cpu_to_le16(sa[0] >> 16); + ipsec->sa[2] = cpu_to_le16(sa[1] & 0xffff); + ipsec->sa[3] = cpu_to_le16(sa[1] >> 16); + + /* The current 3XP firmware seems to hang if we try to feed it + * the same (non-zero) SA twice on the same packet. So, detect + * and drop those packets as it is likely a stack bug, or + * misconfiguration of policy. + * + * I.e., we should never hit this. + */ + if(unlikely(ipsec->sa[2])) { + if(unlikely(ipsec->sa[2] == ipsec->sa[3])) + goto avoiding_sa_hang; + if(unlikely(ipsec->sa[2] == ipsec->sa[0] || + ipsec->sa[2] == ipsec->sa[1])) + goto avoiding_sa_hang; + if(unlikely(ipsec->sa[3] && (ipsec->sa[3] == ipsec->sa[0] || + ipsec->sa[3] == ipsec->sa[1]))) + goto avoiding_sa_hang; + } + + if(unlikely(ipsec->sa[1] && ipsec->sa[0] == ipsec->sa[1])) + goto avoiding_sa_hang; + + return 0; + +avoiding_sa_hang: + if(net_ratelimit()) + printk(KERN_ERR "%s: failing attempted IPSEC offload with " + "duplicate SAs %08x %08x\n", tp->name, + sa[0], sa[1]); + +bad_packet: + /* Any xfrm_offloads we've attached to this skb will be + * released for us when typhoon_start_tx() calls dev_kfree_skb_any() + * on it. + * + * Return an error to indicate this packet cannot be offloaded as + * specified and should never make it to the wire. + */ + return -EINVAL; +} + static int typhoon_start_tx(struct sk_buff *skb, struct net_device *dev) { struct typhoon *tp = netdev_priv(dev); struct transmit_ring *txRing; struct tx_desc *txd, *first_txd; + u32 origLastWrite; dma_addr_t skb_dma; int numDesc; @@ -810,6 +922,9 @@ if(skb_tso_size(skb)) numDesc++; + if(skb_has_xfrm_offload(skb)) + numDesc++; + /* When checking for free space in the ring, we need to also * account for the initial Tx descriptor, and we always must leave * at least one descriptor unused in the ring so that it doesn't @@ -822,6 +937,7 @@ while(unlikely(typhoon_num_free_tx(txRing) < (numDesc + 2))) smp_rmb(); + origLastWrite = txRing->lastWrite; first_txd = (struct tx_desc *) (txRing->ringBase + txRing->lastWrite); typhoon_inc_tx_index(&txRing->lastWrite, 1); @@ -854,6 +970,14 @@ typhoon_tso_fill(skb, txRing, tp->txlo_dma_addr); } + if(skb_has_xfrm_offload(skb)) { + first_txd->processFlags |= TYPHOON_TX_PF_IPSEC; + first_txd->numDesc++; + + if(typhoon_ipsec_fill(tp, skb, txRing)) + goto error; + } + txd = (struct tx_desc *) (txRing->ringBase + txRing->lastWrite); typhoon_inc_tx_index(&txRing->lastWrite, 1); @@ -914,6 +1038,7 @@ * Tx header. */ numDesc = MAX_SKB_FRAGS + TSO_NUM_DESCRIPTORS + 1; + numDesc += IPSEC_NUM_DESCRIPTORS; if(typhoon_num_free_tx(txRing) < (numDesc + 2)) { netif_stop_queue(dev); @@ -926,6 +1051,11 @@ netif_wake_queue(dev); } + return 0; + +error: + txRing->lastWrite = origLastWrite; + dev_kfree_skb_any(skb); return 0; } From adobriyan@mail.ru Sun Jan 9 20:48:39 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 20:48:43 -0800 (PST) Received: from mx1.mail.ru (mx1.mail.ru [194.67.23.121]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A4mcBe015998 for ; Sun, 9 Jan 2005 20:48:39 -0800 Received: from [217.10.38.130] (port=33866 helo=mipter.zuzino.mipt.ru) by mx1.mail.ru with esmtp id 1Co2iU-000AbM-00; Mon, 10 Jan 2005 19:48:30 +0300 From: Alexey Dobriyan To: Adam Anthony Subject: Re: [PATCH] /driver/net/wan/sbs520 Date: Mon, 10 Jan 2005 19:47:33 +0200 User-Agent: KMail/1.6.2 Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200501101947.33917.adobriyan@mail.ru> X-Spam: Not detected X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 12 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: adobriyan@mail.ru Precedence: bulk X-list: netdev On Mon, 10 Jan 2005 07:46:52 -0700, Adam Anthony wrote: > With the permission of my employer, SBS Technologies, Inc., I have > released a patch for 2.4 kernels that supports the 520 Series of WAN > adapters. My editor shows ^M at the end of every line of new Documentation/Configure.help, MAINTAINERS (add ~63400 bogus lines!). Please, look at the patch _after_ generating it. > +obj-$(CONFIG_LANMEDIA) += syncppp.o^M > +subdir-$(CONFIG_LANMEDIA) += lmc^M Also random ^M's. --- linux-2.4.28-virgin/drivers/net/wan/sbs520/lnxosl.c +++ /usr/src/linux-2.4.28/drivers/net/wan/sbs520/lnxosl.c > +// Programming Language: C^M > +// Target Processor: Any^M > +// Target Operating System: Linux^M Well, this is pretty obvious to everyone here. :-) > +// This software may be used and distributed according to the terms^M > +// of the GNU General Public License, incorporated herein by reference.^M Stupid question: do you mean GPL version 2 or something else? Alexey From matthias.christian@tiscali.de Sun Jan 9 21:26:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 21:26:09 -0800 (PST) Received: from webmail.tiscali.de (relay1.tiscali.de [62.26.116.129]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A5Q2gf017308 for ; Sun, 9 Jan 2005 21:26:02 -0800 Received: from [169.254.101.1] (213.54.102.125) by webmail.tiscali.de (7.0.036.1) (authenticated as matthias.christian@tiscali.de) id 41B8B6EA00155E24; Mon, 10 Jan 2005 18:25:50 +0100 Message-ID: <41E2BAAB.3070805@tiscali.de> Date: Mon, 10 Jan 2005 18:26:03 +0100 From: Matthias-Christian Ott User-Agent: Mozilla Thunderbird 0.8 (X11/20040916) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Alexey Dobriyan CC: Adam Anthony , netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] /driver/net/wan/sbs520 References: <200501101947.33917.adobriyan@mail.ru> In-Reply-To: <200501101947.33917.adobriyan@mail.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 13 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: matthias.christian@tiscali.de Precedence: bulk X-list: netdev Alexey Dobriyan wrote: >On Mon, 10 Jan 2005 07:46:52 -0700, Adam Anthony wrote: > > > >>With the permission of my employer, SBS Technologies, Inc., I have >>released a patch for 2.4 kernels that supports the 520 Series of WAN >>adapters. >> >> > >My editor shows ^M at the end of every line of new Documentation/Configure.help, >MAINTAINERS (add ~63400 bogus lines!). Please, look at the patch _after_ >generating it. > > > >>+obj-$(CONFIG_LANMEDIA) += syncppp.o^M >> >> > > > >>+subdir-$(CONFIG_LANMEDIA) += lmc^M >> >> > >Also random ^M's. > >--- linux-2.4.28-virgin/drivers/net/wan/sbs520/lnxosl.c >+++ /usr/src/linux-2.4.28/drivers/net/wan/sbs520/lnxosl.c > > > >>+// Programming Language: C^M >>+// Target Processor: Any^M >>+// Target Operating System: Linux^M >> >> > >Well, this is pretty obvious to everyone here. :-) > > > >>+// This software may be used and distributed according to the terms^M >>+// of the GNU General Public License, incorporated herein by reference.^M >> >> > >Stupid question: do you mean GPL version 2 or something else? > > Alexey >- >To unsubscribe from this list: send the line "unsubscribe linux-kernel" in >the body of a message to majordomo@vger.kernel.org >More majordomo info at http://vger.kernel.org/majordomo-info.html >Please read the FAQ at http://www.tux.org/lkml/ > > > That's ugly, that are Microsoft line endings. Matthias-Christian Ott From romieu@fr.zoreil.com Sun Jan 9 22:05:12 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 22:05:18 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A65AXr018468 for ; Sun, 9 Jan 2005 22:05:11 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.13.1/8.12.1) with ESMTP id j0AI0vKW028256; Mon, 10 Jan 2005 19:00:57 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.13.1/8.13.1/Submit) id j0AI0qsu028255; Mon, 10 Jan 2005 19:00:52 +0100 Date: Mon, 10 Jan 2005 19:00:52 +0100 From: Francois Romieu To: Adam Anthony Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] /driver/net/wan/sbs520 Message-ID: <20050110180052.GA27528@electric-eye.fr.zoreil.com> References: <4F23E557A0317D45864097982DE907941A32B1@pilotmail.sbscorp.sbs.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F23E557A0317D45864097982DE907941A32B1@pilotmail.sbscorp.sbs.com> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 14 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Adam Anthony : [...] > It would be great to receive some feedback on our work, and we hope > that this driver will eventually be added to the kernel. It will probably require a few extra steps: - read Documentation/CodingStyle (mixed case, typedef from hell, ugly #ifdef); - grep ^static -> no static functions ? Uh ? - use non-obsolete API (pci_find_device in 2005 ?); - convert the os independant wrappers. Btw it would probably make sense 1) to figure out what can be merged with the in-tree DSCC4 driver and 2) to integrate the driver with the existing hdlc stack. Imho there is some duplicated work/code. -- Ueimor From kaber@trash.net Sun Jan 9 23:37:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 23:37:52 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A7bktm020847 for ; Sun, 9 Jan 2005 23:37:47 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Co5M7-0005Ra-0w; Mon, 10 Jan 2005 20:37:35 +0100 Message-ID: <41E2D97E.7050809@trash.net> Date: Mon, 10 Jan 2005 20:37:34 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: jamal CC: Maillist netdev Subject: [PATCH PKT_SCHED 1/22]: Restore net/sched/ipt.c After iptables Kmod Cleanup Content-Type: multipart/mixed; boundary="------------000107070700000802010309" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 16 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------000107070700000802010309 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Rusty's patch clashed with my changes, so I put it into my tree and fixed a missing EXPORT_SYMBOL. --------------000107070700000802010309 Content-Type: text/x-patch; name="01.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="01.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/09 20:29:31+01:00 rusty@rustcorp.com.au # [PKT_SCHED]: Restore net/sched/ipt.c After iptables Kmod Cleanup # # Thomas Graf points out that I broke net/sched/ipt.c when I removed # __ipt_find_target_lock. In fact, those routines don't need to keep # the lock held, so we can simplify them, and expose an interface # (ipt_find_target) which does module loading correctly for # net/sched/ipt.c. # # Signed-off-by: Rusty Russell # Signed-off-by: Patrick McHardy # # net/sched/ipt.c # 2005/01/09 20:29:23+01:00 rusty@rustcorp.com.au +8 -12 # [PKT_SCHED]: Restore net/sched/ipt.c After iptables Kmod Cleanup # # Thomas Graf points out that I broke net/sched/ipt.c when I removed # __ipt_find_target_lock. In fact, those routines don't need to keep # the lock held, so we can simplify them, and expose an interface # (ipt_find_target) which does module loading correctly for # net/sched/ipt.c. # # Signed-off-by: Rusty Russell # Signed-off-by: Patrick McHardy # # net/ipv4/netfilter/ip_tables.c # 2005/01/09 20:29:23+01:00 rusty@rustcorp.com.au +32 -32 # [PKT_SCHED]: Restore net/sched/ipt.c After iptables Kmod Cleanup # # Thomas Graf points out that I broke net/sched/ipt.c when I removed # __ipt_find_target_lock. In fact, those routines don't need to keep # the lock held, so we can simplify them, and expose an interface # (ipt_find_target) which does module loading correctly for # net/sched/ipt.c. # # Signed-off-by: Rusty Russell # Signed-off-by: Patrick McHardy # # include/linux/netfilter_ipv4/ip_tables.h # 2005/01/09 20:29:23+01:00 rusty@rustcorp.com.au +3 -0 # [PKT_SCHED]: Restore net/sched/ipt.c After iptables Kmod Cleanup # # Thomas Graf points out that I broke net/sched/ipt.c when I removed # __ipt_find_target_lock. In fact, those routines don't need to keep # the lock held, so we can simplify them, and expose an interface # (ipt_find_target) which does module loading correctly for # net/sched/ipt.c. # # Signed-off-by: Rusty Russell # Signed-off-by: Patrick McHardy # diff -Nru a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h --- a/include/linux/netfilter_ipv4/ip_tables.h 2005-01-10 06:21:42 +01:00 +++ b/include/linux/netfilter_ipv4/ip_tables.h 2005-01-10 06:21:42 +01:00 @@ -456,6 +456,9 @@ struct module *me; }; +/* net/sched/ipt.c: Gimme access to your targets! Gets target->me. */ +extern struct ipt_target *ipt_find_target(const char *name, u8 revision); + extern int ipt_register_table(struct ipt_table *table); extern void ipt_unregister_table(struct ipt_table *table); extern unsigned int ipt_do_table(struct sk_buff **pskb, diff -Nru a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c --- a/net/ipv4/netfilter/ip_tables.c 2005-01-10 06:21:42 +01:00 +++ b/net/ipv4/netfilter/ip_tables.c 2005-01-10 06:21:42 +01:00 @@ -430,62 +430,63 @@ return NULL; } -/* Find match, grabs mutex & ref. Returns ERR_PTR() on error. */ -static inline struct ipt_match *find_match_lock(const char *name, u8 revision) +/* Find match, grabs ref. Returns ERR_PTR() on error. */ +static inline struct ipt_match *find_match(const char *name, u8 revision) { struct ipt_match *m; - int found = 0; + int err = 0; if (down_interruptible(&ipt_mutex) != 0) return ERR_PTR(-EINTR); list_for_each_entry(m, &ipt_match, list) { if (strcmp(m->name, name) == 0) { - found = 1; if (m->revision == revision) { - if (!try_module_get(m->me)) - found = 0; - else + if (try_module_get(m->me)) { + up(&ipt_mutex); return m; - } + } + } else + err = -EPROTOTYPE; /* Found something. */ } } up(&ipt_mutex); - - /* Not found at all? NULL so try_then_request_module loads module. */ - if (!found) - return NULL; - - return ERR_PTR(-EPROTOTYPE); + return ERR_PTR(err); } -/* Find target, grabs mutex & ref. Returns ERR_PTR() on error. */ -static inline struct ipt_target *find_target_lock(const char *name, u8 revision) +/* Find target, grabs ref. Returns ERR_PTR() on error. */ +static inline struct ipt_target *find_target(const char *name, u8 revision) { struct ipt_target *t; - int found = 0; + int err = 0; if (down_interruptible(&ipt_mutex) != 0) return ERR_PTR(-EINTR); list_for_each_entry(t, &ipt_target, list) { if (strcmp(t->name, name) == 0) { - found = 1; if (t->revision == revision) { - if (!try_module_get(t->me)) - found = 0; - else + if (try_module_get(t->me)) { + up(&ipt_mutex); return t; - } + } + } else + err = -EPROTOTYPE; /* Found something. */ } } up(&ipt_mutex); + return ERR_PTR(err); +} - /* Not found at all? NULL so try_then_request_module loads module. */ - if (!found) - return NULL; +struct ipt_target *ipt_find_target(const char *name, u8 revision) +{ + struct ipt_target *target; - return ERR_PTR(-EPROTOTYPE); + target = try_then_request_module(find_target(name, revision), + "ipt_%s", name); + if (IS_ERR(target) || !target) + return NULL; + return target; } static int match_revfn(const char *name, u8 revision, int *bestp) @@ -708,15 +709,14 @@ { struct ipt_match *match; - match = try_then_request_module(find_match_lock(m->u.user.name, - m->u.user.revision), + match = try_then_request_module(find_match(m->u.user.name, + m->u.user.revision), "ipt_%s", m->u.user.name); if (IS_ERR(match) || !match) { duprintf("check_match: `%s' not found\n", m->u.user.name); return match ? PTR_ERR(match) : -ENOENT; } m->u.kernel.match = match; - up(&ipt_mutex); if (m->u.kernel.match->checkentry && !m->u.kernel.match->checkentry(name, ip, m->data, @@ -754,8 +754,8 @@ goto cleanup_matches; t = ipt_get_target(e); - target = try_then_request_module(find_target_lock(t->u.user.name, - t->u.user.revision), + target = try_then_request_module(find_target(t->u.user.name, + t->u.user.revision), "ipt_%s", t->u.user.name); if (IS_ERR(target) || !target) { duprintf("check_entry: `%s' not found\n", t->u.user.name); @@ -763,7 +763,6 @@ goto cleanup_matches; } t->u.kernel.target = target; - up(&ipt_mutex); if (t->u.kernel.target == &ipt_standard_target) { if (!standard_check(t, size)) { @@ -1959,6 +1958,7 @@ EXPORT_SYMBOL(ipt_do_table); EXPORT_SYMBOL(ipt_register_target); EXPORT_SYMBOL(ipt_unregister_target); +EXPORT_SYMBOL(ipt_find_target); module_init(init); module_exit(fini); diff -Nru a/net/sched/ipt.c b/net/sched/ipt.c --- a/net/sched/ipt.c 2005-01-10 06:21:42 +01:00 +++ b/net/sched/ipt.c 2005-01-10 06:21:42 +01:00 @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -60,32 +61,23 @@ struct ipt_target *target; int ret = 0; struct ipt_entry_target *t = p->t; - target = __ipt_find_target_lock(t->u.user.name, &ret); + target = ipt_find_target(t->u.user.name, t->u.user.revision); if (!target) { printk("init_targ: Failed to find %s\n", t->u.user.name); return -1; } DPRINTK("init_targ: found %s\n", target->name); - /* we really need proper ref counting - seems to be only needed for modules?? Talk to laforge */ -/* if (target->me) - __MOD_INC_USE_COUNT(target->me); -*/ t->u.kernel.target = target; - __ipt_mutex_up(); - if (t->u.kernel.target->checkentry && !t->u.kernel.target->checkentry(p->tname, NULL, t->data, t->u.target_size - sizeof (*t), p->hook)) { -/* if (t->u.kernel.target->me) - __MOD_DEC_USE_COUNT(t->u.kernel.target->me); -*/ DPRINTK("ip_tables: check failed for `%s'.\n", t->u.kernel.target->name); + module_put(t->u.kernel.target->me); ret = -EINVAL; } @@ -235,8 +227,12 @@ { struct tcf_ipt *p; p = PRIV(a,ipt); - if (NULL != p) + if (NULL != p) { + struct ipt_entry_target *t = p->t; + if (t && t->u.kernel.target) + module_put(t->u.kernel.target->me); return tcf_hash_release(p, bind); + } return 0; } --------------000107070700000802010309-- From kaber@trash.net Sun Jan 9 23:37:45 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 23:37:50 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A7bjI8020844 for ; Sun, 9 Jan 2005 23:37:45 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Co5M3-0005RW-21; Mon, 10 Jan 2005 20:37:31 +0100 Message-ID: <41E2D97A.1060400@trash.net> Date: Mon, 10 Jan 2005 20:37:30 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: jamal CC: Maillist netdev Subject: [PATCH PKT_SCHED 0/22]: tc action cleanups Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 15 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Hi Jamal, following are the reorganized tc action cleanup patches with some additional fixes. Please review and comment, I would like to ask Dave to pull them in soon so I don't get more clashes. bk-tree is at: bk://212.42.230.204/net-2.6-sched Patrick McHardy: o [PKT_SCHED]: Don't export ing_filter o [PKT_SCHED]: act_api.c: sync multi action order processing o [PKT_SCHED]: act_api.c: push memory allocation to tcf_action_get_1 o [PKT_SCHED]: act_api.c: remove module loading from get/delete operations o [PKT_SCHED]: ipt action: fix module refcnt underflow/mem leaks in tcf_ipt_cleanup o [PKT_SCHED]: tc actions: remove unnecessary locking for refcnt changes o [PKT_SCHED]: ipt action: fix missing unlock on error path o [PKT_SCHED]: police action: fix multiple bugs in init path o [PKT_SCHED]: pedit action: fix multiple bugs in init path o [PKT_SCHED]: mirred action: fix multiple bugs in init path o [PKT_SCHED]: ipt action: fix multiple bugs in init path o [PKT_SCHED]: gact action: fix multiple bugs in init path o [PKT_SCHED]: tc actions: remove checks for impossible conditions o [PKT_SCHED]: tc actions: whitespace and coding style cleanup o [PKT_SCHED]: act_api.c: clean up init path, propagate errors properly o [RTNETLINK]: Use rtattr_strcmp where appropriate o [RTNETLINK]: Add rtattr_strlcpy, use it where appropriate o [PKT_SCHED]: act_api.c: remove unnecessary initializations o [PKT_SCHED]: act_api.c: remove checks for impossible conditions o [PKT_SCHED]: act_api.c: use consistent comparision style o [PKT_SCHED]: act_api.c: whitespace and coding style cleanup Rusty Russell: o [PKT_SCHED]: Restore net/sched/ipt.c After iptables Kmod Cleanup From kaber@trash.net Sun Jan 9 23:37:57 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 23:38:05 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A7buPN020865 for ; Sun, 9 Jan 2005 23:37:56 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Co5MG-0005Re-C0; Mon, 10 Jan 2005 20:37:44 +0100 Message-ID: <41E2D988.4090503@trash.net> Date: Mon, 10 Jan 2005 20:37:44 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: jamal CC: Maillist netdev Subject: [PATCH PKT_SCHED 2/22]: act_api.c: whitespace and coding style cleanup Content-Type: multipart/mixed; boundary="------------090101090401050203030104" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 17 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------090101090401050203030104 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------090101090401050203030104 Content-Type: text/x-patch; name="02.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="02.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/09 20:39:27+01:00 kaber@coreworks.de # [PKT_SCHED]: act_api.c: whitespace and coding style cleanup # # Signed-off-by: Patrick McHardy # # net/sched/act_api.c # 2005/01/09 20:39:18+01:00 kaber@coreworks.de +141 -184 # [PKT_SCHED]: act_api.c: whitespace and coding style cleanup # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/act_api.c b/net/sched/act_api.c --- a/net/sched/act_api.c 2005-01-10 06:21:47 +01:00 +++ b/net/sched/act_api.c 2005-01-10 06:21:47 +01:00 @@ -35,14 +35,14 @@ #include #if 1 /* control */ -#define DPRINTK(format,args...) printk(KERN_DEBUG format,##args) +#define DPRINTK(format, args...) printk(KERN_DEBUG format, ##args) #else -#define DPRINTK(format,args...) +#define DPRINTK(format, args...) #endif #if 0 /* data */ -#define D2PRINTK(format,args...) printk(KERN_DEBUG format,##args) +#define D2PRINTK(format, args...) printk(KERN_DEBUG format, ##args) #else -#define D2PRINTK(format,args...) +#define D2PRINTK(format, args...) #endif static struct tc_action_ops *act_base = NULL; @@ -53,18 +53,15 @@ struct tc_action_ops *a, **ap; write_lock(&act_mod_lock); - for (ap = &act_base; (a=*ap)!=NULL; ap = &a->next) { + for (ap = &act_base; (a = *ap) != NULL; ap = &a->next) { if (act->type == a->type || (strcmp(act->kind, a->kind) == 0)) { write_unlock(&act_mod_lock); return -EEXIST; } } - - act->next = NULL; + act->next = NULL; *ap = act; - write_unlock(&act_mod_lock); - return 0; } @@ -74,10 +71,9 @@ int err = -ENOENT; write_lock(&act_mod_lock); - for (ap = &act_base; (a=*ap)!=NULL; ap = &a->next) - if(a == act) + for (ap = &act_base; (a = *ap) != NULL; ap = &a->next) + if (a == act) break; - if (a) { *ap = a->next; a->next = NULL; @@ -90,47 +86,42 @@ /* lookup by name */ static struct tc_action_ops *tc_lookup_action_n(char *kind) { - struct tc_action_ops *a = NULL; if (kind) { read_lock(&act_mod_lock); for (a = act_base; a; a = a->next) { - if (strcmp(kind,a->kind) == 0) { + if (strcmp(kind, a->kind) == 0) { if (!try_module_get(a->owner)) { read_unlock(&act_mod_lock); return NULL; - } + } break; } } read_unlock(&act_mod_lock); } - return a; } /* lookup by rtattr */ static struct tc_action_ops *tc_lookup_action(struct rtattr *kind) { - struct tc_action_ops *a = NULL; if (kind) { read_lock(&act_mod_lock); for (a = act_base; a; a = a->next) { - - if (strcmp((char*)RTA_DATA(kind),a->kind) == 0){ + if (strcmp((char*)RTA_DATA(kind), a->kind) == 0) { if (!try_module_get(a->owner)) { read_unlock(&act_mod_lock); return NULL; - } + } break; } } read_unlock(&act_mod_lock); } - return a; } @@ -147,55 +138,52 @@ if (!try_module_get(a->owner)) { read_unlock(&act_mod_lock); return NULL; - } + } break; } } read_unlock(&act_mod_lock); } - return a; } #endif -int tcf_action_exec(struct sk_buff *skb,struct tc_action *act, struct tcf_result *res) +int tcf_action_exec(struct sk_buff *skb, struct tc_action *act, + struct tcf_result *res) { - struct tc_action *a; - int ret = -1; + int ret = -1; if (skb->tc_verd & TC_NCLS) { skb->tc_verd = CLR_TC_NCLS(skb->tc_verd); - D2PRINTK("(%p)tcf_action_exec: cleared TC_NCLS in %s out %s\n",skb,skb->input_dev?skb->input_dev->name:"xxx",skb->dev->name); + D2PRINTK("(%p)tcf_action_exec: cleared TC_NCLS in %s out %s\n", + skb, skb->input_dev ? skb->input_dev->name : "xxx", + skb->dev->name); ret = TC_ACT_OK; goto exec_done; } while ((a = act) != NULL) { repeat: if (a->ops && a->ops->act) { - ret = a->ops->act(&skb,a); - if (TC_MUNGED & skb->tc_verd) { - /* copied already, allow trampling */ - skb->tc_verd = SET_TC_OK2MUNGE(skb->tc_verd); - skb->tc_verd = CLR_TC_MUNGED(skb->tc_verd); - } - + ret = a->ops->act(&skb, a); + if (TC_MUNGED & skb->tc_verd) { + /* copied already, allow trampling */ + skb->tc_verd = SET_TC_OK2MUNGE(skb->tc_verd); + skb->tc_verd = CLR_TC_MUNGED(skb->tc_verd); + } if (ret != TC_ACT_PIPE) goto exec_done; if (ret == TC_ACT_REPEAT) goto repeat; /* we need a ttl - JHS */ - } act = a->next; } - exec_done: if (skb->tc_classid > 0) { res->classid = skb->tc_classid; res->class = 0; skb->tc_classid = 0; } - return ret; } @@ -205,54 +193,51 @@ for (a = act; act; a = act) { if (a && a->ops && a->ops->cleanup) { - DPRINTK("tcf_action_destroy destroying %p next %p\n", a,a->next?a->next:NULL); + DPRINTK("tcf_action_destroy destroying %p next %p\n", + a, a->next ? a->next : NULL); act = act->next; - if (ACT_P_DELETED == a->ops->cleanup(a, bind)) { + if (ACT_P_DELETED == a->ops->cleanup(a, bind)) module_put(a->ops->owner); - } - a->ops = NULL; + a->ops = NULL; kfree(a); } else { /*FIXME: Remove later - catch insertion bugs*/ - printk("tcf_action_destroy: BUG? destroying NULL ops \n"); + printk("tcf_action_destroy: BUG? destroying NULL ops\n"); if (a) { act = act->next; kfree(a); } else { - printk("tcf_action_destroy: BUG? destroying NULL action! \n"); + printk("tcf_action_destroy: BUG? destroying " + "NULL action!\n"); break; } } } } -int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int bind, int ref) +int +tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int bind, int ref) { int err = -EINVAL; - - if ( (NULL == a) || (NULL == a->ops) - || (NULL == a->ops->dump) ) + if ((NULL == a) || (NULL == a->ops) || (NULL == a->ops->dump)) return err; return a->ops->dump(skb, a, bind, ref); - } - -int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref) +int +tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref) { int err = -EINVAL; - unsigned char *b = skb->tail; + unsigned char *b = skb->tail; struct rtattr *r; - - if ( (NULL == a) || (NULL == a->ops) - || (NULL == a->ops->dump) || (NULL == a->ops->kind)) + if ((NULL == a) || (NULL == a->ops) || (NULL == a->ops->dump) || + (NULL == a->ops->kind)) return err; - RTA_PUT(skb, TCA_KIND, IFNAMSIZ, a->ops->kind); - if (tcf_action_copy_stats(skb,a)) + if (tcf_action_copy_stats(skb, a)) goto rtattr_failure; r = (struct rtattr*) skb->tail; RTA_PUT(skb, TCA_OPTIONS, 0, NULL); @@ -261,18 +246,17 @@ return err; } - rtattr_failure: skb_trim(skb, b - skb->data); return -1; - } -int tcf_action_dump(struct sk_buff *skb, struct tc_action *act, int bind, int ref) +int +tcf_action_dump(struct sk_buff *skb, struct tc_action *act, int bind, int ref) { struct tc_action *a; int err = -EINVAL; - unsigned char *b = skb->tail; + unsigned char *b = skb->tail; struct rtattr *r ; while ((a = act) != NULL) { @@ -280,9 +264,8 @@ act = a->next; RTA_PUT(skb, a->order, 0, NULL); err = tcf_action_dump_1(skb, a, bind, ref); - if (0 > err) + if (0 > err) goto rtattr_failure; - r->rta_len = skb->tail - (u8*)r; } @@ -291,7 +274,6 @@ rtattr_failure: skb_trim(skb, b - skb->data); return -err; - } struct tc_action *tcf_action_init_1(struct rtattr *rta, struct rtattr *est, @@ -306,16 +288,17 @@ *err = -EINVAL; if (NULL == name) { - if (rtattr_parse(tb, TCA_ACT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta))<0) + if (rtattr_parse(tb, TCA_ACT_MAX, RTA_DATA(rta), + RTA_PAYLOAD(rta)) < 0) goto err_out; kind = tb[TCA_ACT_KIND-1]; if (NULL != kind) { sprintf(act_name, "%s", (char*)RTA_DATA(kind)); if (RTA_PAYLOAD(kind) >= IFNAMSIZ) { - printk(" Action %s bad\n", (char*)RTA_DATA(kind)); + printk("Action %s bad\n", + (char*)RTA_DATA(kind)); goto err_out; } - } else { printk("Action bad kind\n"); goto err_out; @@ -323,19 +306,20 @@ a_o = tc_lookup_action(kind); } else { sprintf(act_name, "%s", name); - DPRINTK("tcf_action_init_1: finding %s\n",act_name); + DPRINTK("tcf_action_init_1: finding %s\n", act_name); a_o = tc_lookup_action_n(name); } #ifdef CONFIG_KMOD if (NULL == a_o) { - DPRINTK("tcf_action_init_1: trying to load module %s\n",act_name); - request_module (act_name); + DPRINTK("tcf_action_init_1: trying to load module %s\n", + act_name); + request_module(act_name); a_o = tc_lookup_action_n(act_name); } #endif if (NULL == a_o) { - printk("failed to find %s\n",act_name); + printk("failed to find %s\n", act_name); goto err_out; } @@ -363,12 +347,12 @@ /* module count goes up only when brand new policy is created if it exists and is only bound to in a_o->init() then - ACT_P_CREATED is not returned (a zero is). - */ + ACT_P_CREATED is not returned (a zero is). + */ if (*err != ACT_P_CREATED) module_put(a_o->owner); a->ops = a_o; - DPRINTK("tcf_action_init_1: successfull %s \n",act_name); + DPRINTK("tcf_action_init_1: successfull %s\n", act_name); *err = 0; return a; @@ -396,7 +380,8 @@ for (i=0; i < TCA_ACT_MAX_PRIO; i++) { if (tb[i]) { - act = tcf_action_init_1(tb[i], est, name, ovr, bind, err); + act = tcf_action_init_1(tb[i], est, name, ovr, bind, + err); if (act == NULL) { printk("Error processing action order %d\n", i); goto bad_ret; @@ -419,7 +404,7 @@ return NULL; } -int tcf_action_copy_stats (struct sk_buff *skb,struct tc_action *a) +int tcf_action_copy_stats(struct sk_buff *skb, struct tc_action *a) { int err; struct gnet_dump d; @@ -462,14 +447,13 @@ return -1; } - static int -tca_get_fill(struct sk_buff *skb, struct tc_action *a, - u32 pid, u32 seq, unsigned flags, int event, int bind, int ref) +tca_get_fill(struct sk_buff *skb, struct tc_action *a, u32 pid, u32 seq, + unsigned flags, int event, int bind, int ref) { struct tcamsg *t; - struct nlmsghdr *nlh; - unsigned char *b = skb->tail; + struct nlmsghdr *nlh; + unsigned char *b = skb->tail; struct rtattr *x; nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*t)); @@ -480,9 +464,8 @@ x = (struct rtattr*) skb->tail; RTA_PUT(skb, TCA_ACT_TAB, 0, NULL); - if (0 > tcf_action_dump(skb, a, bind, ref)) { + if (0 > tcf_action_dump(skb, a, bind, ref)) goto rtattr_failure; - } x->rta_len = skb->tail - (u8*)x; @@ -495,58 +478,53 @@ return -1; } -static int act_get_notify(u32 pid, struct nlmsghdr *n, - struct tc_action *a, int event) +static int +act_get_notify(u32 pid, struct nlmsghdr *n, struct tc_action *a, int event) { struct sk_buff *skb; - int err = 0; skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); if (!skb) return -ENOBUFS; - - if (tca_get_fill(skb, a, pid, n->nlmsg_seq, 0, event, 0, 0) <= 0) { + if (tca_get_fill(skb, a, pid, n->nlmsg_seq, 0, event, 0, 0) <= 0) { kfree_skb(skb); return -EINVAL; } - - err = netlink_unicast(rtnl,skb, pid, MSG_DONTWAIT); + err = netlink_unicast(rtnl, skb, pid, MSG_DONTWAIT); if (err > 0) err = 0; return err; } -static int tcf_action_get_1(struct rtattr *rta, struct tc_action *a, struct nlmsghdr *n, u32 pid) +static int tcf_action_get_1(struct rtattr *rta, struct tc_action *a, + struct nlmsghdr *n, u32 pid) { struct tc_action_ops *a_o; char act_name[4 + IFNAMSIZ + 1]; struct rtattr *tb[TCA_ACT_MAX+1]; struct rtattr *kind = NULL; int index; - int err = -EINVAL; - if (rtattr_parse(tb, TCA_ACT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta))<0) + if (rtattr_parse(tb, TCA_ACT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0) goto err_out; - - kind = tb[TCA_ACT_KIND-1]; if (NULL != kind) { sprintf(act_name, "%s", (char*)RTA_DATA(kind)); if (RTA_PAYLOAD(kind) >= IFNAMSIZ) { - printk("tcf_action_get_1: action %s bad\n", (char*)RTA_DATA(kind)); + printk("tcf_action_get_1: action %s bad\n", + (char*)RTA_DATA(kind)); goto err_out; } - } else { printk("tcf_action_get_1: action bad kind\n"); goto err_out; } - if (tb[TCA_ACT_INDEX - 1]) { + if (tb[TCA_ACT_INDEX - 1]) index = *(int *)RTA_DATA(tb[TCA_ACT_INDEX - 1]); - } else { + else { printk("tcf_action_get_1: index not received\n"); goto err_out; } @@ -557,16 +535,13 @@ request_module (act_name); a_o = tc_lookup_action_n(act_name); } - #endif if (NULL == a_o) { - printk("failed to find %s\n",act_name); + printk("failed to find %s\n", act_name); goto err_out; } - - if (NULL == a) { + if (NULL == a) goto err_mod; - } a->ops = a_o; @@ -584,7 +559,7 @@ return err; } -static void cleanup_a (struct tc_action *act) +static void cleanup_a(struct tc_action *act) { struct tc_action *a; @@ -594,9 +569,8 @@ a->ops = NULL; a->priv = NULL; kfree(a); - } else { + } else printk("cleanup_a: BUG? empty action\n"); - } } } @@ -608,10 +582,10 @@ if (NULL != kind) { sprintf(act_name, "%s", (char*)RTA_DATA(kind)); if (RTA_PAYLOAD(kind) >= IFNAMSIZ) { - printk("get_ao: action %s bad\n", (char*)RTA_DATA(kind)); + printk("get_ao: action %s bad\n", + (char*)RTA_DATA(kind)); return NULL; } - } else { printk("get_ao: action bad kind\n"); return NULL; @@ -620,14 +594,14 @@ a_o = tc_lookup_action(kind); #ifdef CONFIG_KMOD if (NULL == a_o) { - DPRINTK("get_ao: trying to load module %s\n",act_name); - request_module (act_name); + DPRINTK("get_ao: trying to load module %s\n", act_name); + request_module(act_name); a_o = tc_lookup_action_n(act_name); } #endif if (NULL == a_o) { - printk("get_ao: failed to find %s\n",act_name); + printk("get_ao: failed to find %s\n", act_name); return NULL; } @@ -639,16 +613,13 @@ { struct tc_action *act = NULL; - act = kmalloc(sizeof(*act),GFP_KERNEL); + act = kmalloc(sizeof(*act), GFP_KERNEL); if (NULL == act) { /* grrr .. */ - printk("create_a: failed to alloc! \n"); + printk("create_a: failed to alloc!\n"); return NULL; } - - memset(act, 0,sizeof(*act)); - + memset(act, 0, sizeof(*act)); act->order = i; - return act; } @@ -679,16 +650,14 @@ b = (unsigned char *)skb->tail; - if (rtattr_parse(tb, TCA_ACT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta))<0) { + if (rtattr_parse(tb, TCA_ACT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0) goto err_out; - } kind = tb[TCA_ACT_KIND-1]; - if (NULL == get_ao(kind, a)) { + if (NULL == get_ao(kind, a)) goto err_out; - } - nlh = NLMSG_PUT(skb, pid, n->nlmsg_seq, RTM_DELACTION, sizeof (*t)); + nlh = NLMSG_PUT(skb, pid, n->nlmsg_seq, RTM_DELACTION, sizeof(*t)); t = NLMSG_DATA(nlh); t->tca_family = AF_UNSPEC; @@ -696,9 +665,8 @@ RTA_PUT(skb, TCA_ACT_TAB, 0, NULL); err = a->ops->walk(skb, &dcb, RTM_DELACTION, a); - if (0 > err ) { + if (0 > err) goto rtattr_failure; - } x->rta_len = skb->tail - (u8 *) x; @@ -722,61 +690,55 @@ return err; } -static int tca_action_gd(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int event ) +static int +tca_action_gd(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int event) { - int s = 0; int i, ret = 0; struct tc_action *act = NULL; struct rtattr *tb[TCA_ACT_MAX_PRIO+1]; struct tc_action *a = NULL, *a_s = NULL; - if (event != RTM_GETACTION && event != RTM_DELACTION) + if (event != RTM_GETACTION && event != RTM_DELACTION) ret = -EINVAL; - if (rtattr_parse(tb, TCA_ACT_MAX_PRIO, RTA_DATA(rta), RTA_PAYLOAD(rta))<0) { + if (rtattr_parse(tb, TCA_ACT_MAX_PRIO, RTA_DATA(rta), + RTA_PAYLOAD(rta)) < 0) { ret = -EINVAL; goto nlmsg_failure; } if (event == RTM_DELACTION && n->nlmsg_flags&NLM_F_ROOT) { - if (NULL != tb[0] && NULL == tb[1]) { - return tca_action_flush(tb[0],n,pid); - } + if (NULL != tb[0] && NULL == tb[1]) + return tca_action_flush(tb[0], n, pid); } - for (i=0; i < TCA_ACT_MAX_PRIO ; i++) { - + for (i=0; i < TCA_ACT_MAX_PRIO; i++) { if (NULL == tb[i]) break; - act = create_a(i+1); if (NULL != a && a != act) { a->next = act; a = act; - } else { + } else a = act; - } if (!s) { s = 1; a_s = a; } - ret = tcf_action_get_1(tb[i],act,n,pid); + ret = tcf_action_get_1(tb[i], act, n, pid); if (ret < 0) { - printk("tcf_action_get: failed to get! \n"); + printk("tcf_action_get: failed to get!\n"); ret = -EINVAL; goto rtattr_failure; } - } - - if (RTM_GETACTION == event) { + if (RTM_GETACTION == event) ret = act_get_notify(pid, n, a_s, event); - } else { /* delete */ - + else { /* delete */ struct sk_buff *skb; skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); @@ -785,7 +747,8 @@ goto nlmsg_failure; } - if (tca_get_fill(skb, a_s, pid, n->nlmsg_seq, 0, event, 0 , 1) <= 0) { + if (tca_get_fill(skb, a_s, pid, n->nlmsg_seq, 0, event, + 0, 1) <= 0) { kfree_skb(skb); ret = -EINVAL; goto nlmsg_failure; @@ -793,8 +756,8 @@ /* now do the delete */ tcf_action_destroy(a_s, 0); - - ret = rtnetlink_send(skb, pid, RTMGRP_TC, n->nlmsg_flags&NLM_F_ECHO); + ret = rtnetlink_send(skb, pid, RTMGRP_TC, + n->nlmsg_flags&NLM_F_ECHO); if (ret > 0) return 0; return ret; @@ -805,16 +768,14 @@ return ret; } - -static int tcf_add_notify(struct tc_action *a, u32 pid, u32 seq, int event, unsigned flags) +static int tcf_add_notify(struct tc_action *a, u32 pid, u32 seq, int event, + unsigned flags) { struct tcamsg *t; - struct nlmsghdr *nlh; + struct nlmsghdr *nlh; struct sk_buff *skb; struct rtattr *x; unsigned char *b; - - int err = 0; skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); @@ -831,9 +792,8 @@ x = (struct rtattr*) skb->tail; RTA_PUT(skb, TCA_ACT_TAB, 0, NULL); - if (0 > tcf_action_dump(skb, a, 0, 0)) { + if (0 > tcf_action_dump(skb, a, 0, 0)) goto rtattr_failure; - } x->rta_len = skb->tail - (u8*)x; @@ -843,7 +803,6 @@ err = rtnetlink_send(skb, pid, RTMGRP_TC, flags&NLM_F_ECHO); if (err > 0) err = 0; - return err; rtattr_failure: @@ -853,7 +812,8 @@ } -static int tcf_action_add(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int ovr ) +static int +tcf_action_add(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int ovr) { int ret = 0; struct tc_action *act = NULL; @@ -867,16 +827,15 @@ /* dump then free all the actions after update; inserted policy * stays intact * */ - ret = tcf_add_notify(act, pid, seq, RTM_NEWACTION, n->nlmsg_flags); + ret = tcf_add_notify(act, pid, seq, RTM_NEWACTION, n->nlmsg_flags); for (a = act; act; a = act) { if (a) { act = act->next; a->ops = NULL; a->priv = NULL; kfree(a); - } else { + } else printk("tcf_action_add: BUG? empty action\n"); - } } done: return ret; @@ -886,37 +845,35 @@ { struct rtattr **tca = arg; u32 pid = skb ? NETLINK_CB(skb).pid : 0; - int ret = 0, ovr = 0; if (NULL == tca[TCA_ACT_TAB-1]) { - printk("tc_ctl_action: received NO action attribs\n"); - return -EINVAL; + printk("tc_ctl_action: received NO action attribs\n"); + return -EINVAL; } /* n->nlmsg_flags&NLM_F_CREATE * */ switch (n->nlmsg_type) { - case RTM_NEWACTION: + case RTM_NEWACTION: /* we are going to assume all other flags * imply create only if it doesnt exist * Note that CREATE | EXCL implies that * but since we want avoid ambiguity (eg when flags * is zero) then just set this */ - if (n->nlmsg_flags&NLM_F_REPLACE) { + if (n->nlmsg_flags&NLM_F_REPLACE) ovr = 1; - } - ret = tcf_action_add(tca[TCA_ACT_TAB-1], n, pid, ovr); + ret = tcf_action_add(tca[TCA_ACT_TAB-1], n, pid, ovr); break; case RTM_DELACTION: - ret = tca_action_gd(tca[TCA_ACT_TAB-1], n, pid,RTM_DELACTION); + ret = tca_action_gd(tca[TCA_ACT_TAB-1], n, pid, RTM_DELACTION); break; case RTM_GETACTION: - ret = tca_action_gd(tca[TCA_ACT_TAB-1], n, pid,RTM_GETACTION); + ret = tca_action_gd(tca[TCA_ACT_TAB-1], n, pid, RTM_GETACTION); break; default: - printk(" Unknown cmd was detected\n"); + printk("Unknown cmd was detected\n"); break; } @@ -930,8 +887,7 @@ struct rtattr *tb[TCA_ACT_MAX_PRIO + 1]; struct rtattr *rta[TCAA_MAX + 1]; struct rtattr *kind = NULL; - int min_len = NLMSG_LENGTH(sizeof (struct tcamsg)); - + int min_len = NLMSG_LENGTH(sizeof(struct tcamsg)); int attrlen = n->nlmsg_len - NLMSG_ALIGN(min_len); struct rtattr *attr = (void *) n + NLMSG_ALIGN(min_len); @@ -942,12 +898,14 @@ return NULL; } - if (rtattr_parse(tb, TCA_ACT_MAX_PRIO, RTA_DATA(tb1), NLMSG_ALIGN(RTA_PAYLOAD(tb1))) < 0) + if (rtattr_parse(tb, TCA_ACT_MAX_PRIO, RTA_DATA(tb1), + NLMSG_ALIGN(RTA_PAYLOAD(tb1))) < 0) return NULL; - if (NULL == tb[0]) + if (NULL == tb[0]) return NULL; - if (rtattr_parse(tb2, TCA_ACT_MAX, RTA_DATA(tb[0]), RTA_PAYLOAD(tb[0]))<0) + if (rtattr_parse(tb2, TCA_ACT_MAX, RTA_DATA(tb[0]), + RTA_PAYLOAD(tb[0])) < 0) return NULL; kind = tb2[TCA_ACT_KIND-1]; @@ -963,30 +921,30 @@ struct tc_action_ops *a_o; struct tc_action a; int ret = 0; - struct tcamsg *t = (struct tcamsg *) NLMSG_DATA(cb->nlh); char *kind = find_dump_kind(cb->nlh); + if (NULL == kind) { printk("tc_dump_action: action bad kind\n"); return 0; } a_o = tc_lookup_action_n(kind); - if (NULL == a_o) { printk("failed to find %s\n", kind); return 0; } - memset(&a,0,sizeof(struct tc_action)); + memset(&a, 0, sizeof(struct tc_action)); a.ops = a_o; if (NULL == a_o->walk) { - printk("tc_dump_action: %s !capable of dumping table\n",kind); + printk("tc_dump_action: %s !capable of dumping table\n", kind); goto rtattr_failure; } - nlh = NLMSG_PUT(skb, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq, cb->nlh->nlmsg_type, sizeof (*t)); + nlh = NLMSG_PUT(skb, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq, + cb->nlh->nlmsg_type, sizeof(*t)); t = NLMSG_DATA(nlh); t->tca_family = AF_UNSPEC; @@ -994,19 +952,17 @@ RTA_PUT(skb, TCA_ACT_TAB, 0, NULL); ret = a_o->walk(skb, cb, RTM_GETACTION, &a); - if (0 > ret ) { + if (0 > ret) goto rtattr_failure; - } if (ret > 0) { x->rta_len = skb->tail - (u8 *) x; ret = skb->len; - } else { + } else skb_trim(skb, (u8*)x - skb->data); - } nlh->nlmsg_len = skb->tail - b; - if (NETLINK_CB(cb->skb).pid && ret) + if (NETLINK_CB(cb->skb).pid && ret) nlh->nlmsg_flags |= NLM_F_MULTI; module_put(a_o->owner); return skb->len; @@ -1029,7 +985,8 @@ link_p[RTM_GETACTION-RTM_BASE].dumpit = tc_dump_action; } - printk("TC classifier action (bugs to netdev@oss.sgi.com cc hadi@cyberus.ca)\n"); + printk("TC classifier action (bugs to netdev@oss.sgi.com cc " + "hadi@cyberus.ca)\n"); return 0; } --------------090101090401050203030104-- From kaber@trash.net Sun Jan 9 23:37:59 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 23:38:10 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A7bwba020894 for ; Sun, 9 Jan 2005 23:37:58 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Co5MI-0005Ri-Fd; Mon, 10 Jan 2005 20:37:46 +0100 Message-ID: <41E2D98A.1030801@trash.net> Date: Mon, 10 Jan 2005 20:37:46 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: jamal CC: Maillist netdev Subject: [PATCH PKT_SCHED 3/22]: act_api.c: use consistent comparision style Content-Type: multipart/mixed; boundary="------------090101080101070505020400" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 18 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------090101080101070505020400 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------090101080101070505020400 Content-Type: text/x-patch; name="03.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="03.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/09 20:41:48+01:00 kaber@coreworks.de # [PKT_SCHED]: act_api.c: use consistent comparision style # # Signed-off-by: Patrick McHardy # # net/sched/act_api.c # 2005/01/09 20:41:41+01:00 kaber@coreworks.de +37 -40 # [PKT_SCHED]: act_api.c: use consistent comparision style # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/act_api.c b/net/sched/act_api.c --- a/net/sched/act_api.c 2005-01-10 06:21:51 +01:00 +++ b/net/sched/act_api.c 2005-01-10 06:21:51 +01:00 @@ -196,7 +196,7 @@ DPRINTK("tcf_action_destroy destroying %p next %p\n", a, a->next ? a->next : NULL); act = act->next; - if (ACT_P_DELETED == a->ops->cleanup(a, bind)) + if (a->ops->cleanup(a, bind) == ACT_P_DELETED) module_put(a->ops->owner); a->ops = NULL; @@ -220,7 +220,7 @@ { int err = -EINVAL; - if ((NULL == a) || (NULL == a->ops) || (NULL == a->ops->dump)) + if ((a == NULL) || (a->ops == NULL) || (a->ops->dump == NULL)) return err; return a->ops->dump(skb, a, bind, ref); } @@ -232,8 +232,8 @@ unsigned char *b = skb->tail; struct rtattr *r; - if ((NULL == a) || (NULL == a->ops) || (NULL == a->ops->dump) || - (NULL == a->ops->kind)) + if ((a == NULL) || (a->ops == NULL) || (a->ops->dump == NULL) || + (a->ops->kind == NULL)) return err; RTA_PUT(skb, TCA_KIND, IFNAMSIZ, a->ops->kind); @@ -264,7 +264,7 @@ act = a->next; RTA_PUT(skb, a->order, 0, NULL); err = tcf_action_dump_1(skb, a, bind, ref); - if (0 > err) + if (err < 0) goto rtattr_failure; r->rta_len = skb->tail - (u8*)r; } @@ -287,12 +287,12 @@ *err = -EINVAL; - if (NULL == name) { + if (name == NULL) { if (rtattr_parse(tb, TCA_ACT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0) goto err_out; kind = tb[TCA_ACT_KIND-1]; - if (NULL != kind) { + if (kind != NULL) { sprintf(act_name, "%s", (char*)RTA_DATA(kind)); if (RTA_PAYLOAD(kind) >= IFNAMSIZ) { printk("Action %s bad\n", @@ -310,7 +310,7 @@ a_o = tc_lookup_action_n(name); } #ifdef CONFIG_KMOD - if (NULL == a_o) { + if (a_o == NULL) { DPRINTK("tcf_action_init_1: trying to load module %s\n", act_name); request_module(act_name); @@ -318,7 +318,7 @@ } #endif - if (NULL == a_o) { + if (a_o == NULL) { printk("failed to find %s\n", act_name); goto err_out; } @@ -331,7 +331,7 @@ memset(a, 0, sizeof(*a)); /* backward compatibility for policer */ - if (NULL == name) { + if (name == NULL) { *err = a_o->init(tb[TCA_ACT_OPTIONS-1], est, a, ovr, bind); if (*err < 0) { *err = -EINVAL; @@ -414,7 +414,7 @@ /* place holder */ #endif - if (NULL == h) + if (h == NULL) goto errout; if (a->type == TCA_OLD_COMPAT) @@ -427,7 +427,7 @@ if (err < 0) goto errout; - if (NULL != a->ops && NULL != a->ops->get_stats) + if (a->ops != NULL && a->ops->get_stats != NULL) if (a->ops->get_stats(skb, a) < 0) goto errout; @@ -464,7 +464,7 @@ x = (struct rtattr*) skb->tail; RTA_PUT(skb, TCA_ACT_TAB, 0, NULL); - if (0 > tcf_action_dump(skb, a, bind, ref)) + if (tcf_action_dump(skb, a, bind, ref) < 0) goto rtattr_failure; x->rta_len = skb->tail - (u8*)x; @@ -510,7 +510,7 @@ if (rtattr_parse(tb, TCA_ACT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0) goto err_out; kind = tb[TCA_ACT_KIND-1]; - if (NULL != kind) { + if (kind != NULL) { sprintf(act_name, "%s", (char*)RTA_DATA(kind)); if (RTA_PAYLOAD(kind) >= IFNAMSIZ) { printk("tcf_action_get_1: action %s bad\n", @@ -531,21 +531,21 @@ a_o = tc_lookup_action(kind); #ifdef CONFIG_KMOD - if (NULL == a_o) { + if (a_o == NULL) { request_module (act_name); a_o = tc_lookup_action_n(act_name); } #endif - if (NULL == a_o) { + if (a_o == NULL) { printk("failed to find %s\n", act_name); goto err_out; } - if (NULL == a) + if (a == NULL) goto err_mod; a->ops = a_o; - if (NULL == a_o->lookup || 0 == a_o->lookup(a, index)) { + if (a_o->lookup == NULL || a_o->lookup(a, index) == 0) { a->ops = NULL; err = -EINVAL; goto err_mod; @@ -579,7 +579,7 @@ char act_name[4 + IFNAMSIZ + 1]; struct tc_action_ops *a_o = NULL; - if (NULL != kind) { + if (kind != NULL) { sprintf(act_name, "%s", (char*)RTA_DATA(kind)); if (RTA_PAYLOAD(kind) >= IFNAMSIZ) { printk("get_ao: action %s bad\n", @@ -593,14 +593,13 @@ a_o = tc_lookup_action(kind); #ifdef CONFIG_KMOD - if (NULL == a_o) { + if (a_o == NULL) { DPRINTK("get_ao: trying to load module %s\n", act_name); request_module(act_name); a_o = tc_lookup_action_n(act_name); } #endif - - if (NULL == a_o) { + if (a_o == NULL) { printk("get_ao: failed to find %s\n", act_name); return NULL; } @@ -614,7 +613,7 @@ struct tc_action *act = NULL; act = kmalloc(sizeof(*act), GFP_KERNEL); - if (NULL == act) { /* grrr .. */ + if (act == NULL) { printk("create_a: failed to alloc!\n"); return NULL; } @@ -636,7 +635,7 @@ struct tc_action *a = create_a(0); int err = -EINVAL; - if (NULL == a) { + if (a == NULL) { printk("tca_action_flush: couldnt create tc_action\n"); return err; } @@ -654,7 +653,7 @@ goto err_out; kind = tb[TCA_ACT_KIND-1]; - if (NULL == get_ao(kind, a)) + if (get_ao(kind, a) == NULL) goto err_out; nlh = NLMSG_PUT(skb, pid, n->nlmsg_seq, RTM_DELACTION, sizeof(*t)); @@ -665,7 +664,7 @@ RTA_PUT(skb, TCA_ACT_TAB, 0, NULL); err = a->ops->walk(skb, &dcb, RTM_DELACTION, a); - if (0 > err) + if (err < 0) goto rtattr_failure; x->rta_len = skb->tail - (u8 *) x; @@ -680,7 +679,6 @@ return err; - rtattr_failure: module_put(a->ops->owner); nlmsg_failure: @@ -709,15 +707,15 @@ } if (event == RTM_DELACTION && n->nlmsg_flags&NLM_F_ROOT) { - if (NULL != tb[0] && NULL == tb[1]) + if (tb[0] != NULL && tb[1] == NULL) return tca_action_flush(tb[0], n, pid); } for (i=0; i < TCA_ACT_MAX_PRIO; i++) { - if (NULL == tb[i]) + if (tb[i] == NULL) break; act = create_a(i+1); - if (NULL != a && a != act) { + if (a != NULL && a != act) { a->next = act; a = act; } else @@ -736,7 +734,7 @@ } } - if (RTM_GETACTION == event) + if (event == RTM_GETACTION) ret = act_get_notify(pid, n, a_s, event); else { /* delete */ struct sk_buff *skb; @@ -792,7 +790,7 @@ x = (struct rtattr*) skb->tail; RTA_PUT(skb, TCA_ACT_TAB, 0, NULL); - if (0 > tcf_action_dump(skb, a, 0, 0)) + if (tcf_action_dump(skb, a, 0, 0) < 0) goto rtattr_failure; x->rta_len = skb->tail - (u8*)x; @@ -847,7 +845,7 @@ u32 pid = skb ? NETLINK_CB(skb).pid : 0; int ret = 0, ovr = 0; - if (NULL == tca[TCA_ACT_TAB-1]) { + if (tca[TCA_ACT_TAB-1] == NULL) { printk("tc_ctl_action: received NO action attribs\n"); return -EINVAL; } @@ -894,14 +892,13 @@ if (rtattr_parse(rta, TCAA_MAX, attr, attrlen) < 0) return NULL; tb1 = rta[TCA_ACT_TAB - 1]; - if (NULL == tb1) { + if (tb1 == NULL) return NULL; - } if (rtattr_parse(tb, TCA_ACT_MAX_PRIO, RTA_DATA(tb1), NLMSG_ALIGN(RTA_PAYLOAD(tb1))) < 0) return NULL; - if (NULL == tb[0]) + if (tb[0] == NULL) return NULL; if (rtattr_parse(tb2, TCA_ACT_MAX, RTA_DATA(tb[0]), @@ -924,13 +921,13 @@ struct tcamsg *t = (struct tcamsg *) NLMSG_DATA(cb->nlh); char *kind = find_dump_kind(cb->nlh); - if (NULL == kind) { + if (kind == NULL) { printk("tc_dump_action: action bad kind\n"); return 0; } a_o = tc_lookup_action_n(kind); - if (NULL == a_o) { + if (a_o == NULL) { printk("failed to find %s\n", kind); return 0; } @@ -938,7 +935,7 @@ memset(&a, 0, sizeof(struct tc_action)); a.ops = a_o; - if (NULL == a_o->walk) { + if (a_o->walk == NULL) { printk("tc_dump_action: %s !capable of dumping table\n", kind); goto rtattr_failure; } @@ -952,7 +949,7 @@ RTA_PUT(skb, TCA_ACT_TAB, 0, NULL); ret = a_o->walk(skb, cb, RTM_GETACTION, &a); - if (0 > ret) + if (ret < 0) goto rtattr_failure; if (ret > 0) { --------------090101080101070505020400-- From kaber@trash.net Sun Jan 9 23:38:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 23:38:11 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A7c1MH020937 for ; Sun, 9 Jan 2005 23:38:01 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Co5ML-0005Rm-9y; Mon, 10 Jan 2005 20:37:49 +0100 Message-ID: <41E2D98D.8050609@trash.net> Date: Mon, 10 Jan 2005 20:37:49 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: jamal CC: Maillist netdev Subject: [PATCH PKT_SCHED 4/22]: act_api.c: remove checks for impossible conditions Content-Type: multipart/mixed; boundary="------------070600040905060400070801" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 19 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------070600040905060400070801 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------070600040905060400070801 Content-Type: text/x-patch; name="04.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="04.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/09 22:51:34+01:00 kaber@coreworks.de # [PKT_SCHED]: act_api.c: remove checks for impossible conditions # # Signed-off-by: Patrick McHardy # # net/sched/act_api.c # 2005/01/09 22:51:25+01:00 kaber@coreworks.de +15 -34 # [PKT_SCHED]: act_api.c: remove checks for impossible conditions # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/act_api.c b/net/sched/act_api.c --- a/net/sched/act_api.c 2005-01-10 06:21:56 +01:00 +++ b/net/sched/act_api.c 2005-01-10 06:21:56 +01:00 @@ -191,26 +191,18 @@ { struct tc_action *a; - for (a = act; act; a = act) { - if (a && a->ops && a->ops->cleanup) { + for (a = act; a; a = act) { + if (a->ops && a->ops->cleanup) { DPRINTK("tcf_action_destroy destroying %p next %p\n", - a, a->next ? a->next : NULL); - act = act->next; + a, a->next); if (a->ops->cleanup(a, bind) == ACT_P_DELETED) module_put(a->ops->owner); - - a->ops = NULL; + act = act->next; kfree(a); } else { /*FIXME: Remove later - catch insertion bugs*/ printk("tcf_action_destroy: BUG? destroying NULL ops\n"); - if (a) { - act = act->next; - kfree(a); - } else { - printk("tcf_action_destroy: BUG? destroying " - "NULL action!\n"); - break; - } + act = act->next; + kfree(a); } } } @@ -220,7 +212,7 @@ { int err = -EINVAL; - if ((a == NULL) || (a->ops == NULL) || (a->ops->dump == NULL)) + if (a->ops == NULL || a->ops->dump == NULL) return err; return a->ops->dump(skb, a, bind, ref); } @@ -232,8 +224,7 @@ unsigned char *b = skb->tail; struct rtattr *r; - if ((a == NULL) || (a->ops == NULL) || (a->ops->dump == NULL) || - (a->ops->kind == NULL)) + if (a->ops == NULL || a->ops->dump == NULL) return err; RTA_PUT(skb, TCA_KIND, IFNAMSIZ, a->ops->kind); @@ -563,14 +554,9 @@ { struct tc_action *a; - for (a = act; act; a = act) { - if (a) { - act = act->next; - a->ops = NULL; - a->priv = NULL; - kfree(a); - } else - printk("cleanup_a: BUG? empty action\n"); + for (a = act; a; a = act) { + act = a->next; + kfree(a); } } @@ -715,7 +701,7 @@ if (tb[i] == NULL) break; act = create_a(i+1); - if (a != NULL && a != act) { + if (a != NULL) { a->next = act; a = act; } else @@ -826,14 +812,9 @@ * stays intact * */ ret = tcf_add_notify(act, pid, seq, RTM_NEWACTION, n->nlmsg_flags); - for (a = act; act; a = act) { - if (a) { - act = act->next; - a->ops = NULL; - a->priv = NULL; - kfree(a); - } else - printk("tcf_action_add: BUG? empty action\n"); + for (a = act; a; a = act) { + act = a->next; + kfree(a); } done: return ret; --------------070600040905060400070801-- From kaber@trash.net Sun Jan 9 23:38:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 23:38:19 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A7c39m020967 for ; Sun, 9 Jan 2005 23:38:03 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Co5MN-0005Rq-1r; Mon, 10 Jan 2005 20:37:51 +0100 Message-ID: <41E2D98F.7050405@trash.net> Date: Mon, 10 Jan 2005 20:37:51 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: jamal CC: Maillist netdev Subject: [PATCH PKT_SCHED 5/22]: act_api.c: remove unnecessary initializations Content-Type: multipart/mixed; boundary="------------050805080104040606000706" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 20 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------050805080104040606000706 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------050805080104040606000706 Content-Type: text/x-patch; name="05.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="05.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/09 22:52:33+01:00 kaber@coreworks.de # [PKT_SCHED]: act_api.c: remove unnecessary initializations # # Signed-off-by: Patrick McHardy # # net/sched/act_api.c # 2005/01/09 22:52:25+01:00 kaber@coreworks.de +10 -13 # [PKT_SCHED]: act_api.c: remove unnecessary initializations # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/act_api.c b/net/sched/act_api.c --- a/net/sched/act_api.c 2005-01-10 06:22:01 +01:00 +++ b/net/sched/act_api.c 2005-01-10 06:22:01 +01:00 @@ -274,7 +274,7 @@ struct tc_action_ops *a_o; char act_name[4 + IFNAMSIZ + 1]; struct rtattr *tb[TCA_ACT_MAX+1]; - struct rtattr *kind = NULL; + struct rtattr *kind; *err = -EINVAL; @@ -494,7 +494,7 @@ struct tc_action_ops *a_o; char act_name[4 + IFNAMSIZ + 1]; struct rtattr *tb[TCA_ACT_MAX+1]; - struct rtattr *kind = NULL; + struct rtattr *kind; int index; int err = -EINVAL; @@ -563,7 +563,7 @@ static struct tc_action_ops *get_ao(struct rtattr *kind, struct tc_action *a) { char act_name[4 + IFNAMSIZ + 1]; - struct tc_action_ops *a_o = NULL; + struct tc_action_ops *a_o; if (kind != NULL) { sprintf(act_name, "%s", (char*)RTA_DATA(kind)); @@ -596,7 +596,7 @@ static struct tc_action *create_a(int i) { - struct tc_action *act = NULL; + struct tc_action *act; act = kmalloc(sizeof(*act), GFP_KERNEL); if (act == NULL) { @@ -617,7 +617,7 @@ struct netlink_callback dcb; struct rtattr *x; struct rtattr *tb[TCA_ACT_MAX+1]; - struct rtattr *kind = NULL; + struct rtattr *kind; struct tc_action *a = create_a(0); int err = -EINVAL; @@ -677,9 +677,8 @@ static int tca_action_gd(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int event) { - int s = 0; int i, ret = 0; - struct tc_action *act = NULL; + struct tc_action *act; struct rtattr *tb[TCA_ACT_MAX_PRIO+1]; struct tc_action *a = NULL, *a_s = NULL; @@ -707,10 +706,8 @@ } else a = act; - if (!s) { - s = 1; + if (a_s == NULL) a_s = a; - } ret = tcf_action_get_1(tb[i], act, n, pid); if (ret < 0) { @@ -800,8 +797,8 @@ tcf_action_add(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int ovr) { int ret = 0; - struct tc_action *act = NULL; - struct tc_action *a = NULL; + struct tc_action *act; + struct tc_action *a; u32 seq = n->nlmsg_seq; act = tcf_action_init(rta, NULL, NULL, ovr, 0, &ret); @@ -865,7 +862,7 @@ struct rtattr *tb1, *tb2[TCA_ACT_MAX+1]; struct rtattr *tb[TCA_ACT_MAX_PRIO + 1]; struct rtattr *rta[TCAA_MAX + 1]; - struct rtattr *kind = NULL; + struct rtattr *kind; int min_len = NLMSG_LENGTH(sizeof(struct tcamsg)); int attrlen = n->nlmsg_len - NLMSG_ALIGN(min_len); struct rtattr *attr = (void *) n + NLMSG_ALIGN(min_len); --------------050805080104040606000706-- From kaber@trash.net Sun Jan 9 23:38:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 23:38:40 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A7c8XC021008 for ; Sun, 9 Jan 2005 23:38:08 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Co5MS-0005S2-7p; Mon, 10 Jan 2005 20:37:56 +0100 Message-ID: <41E2D994.6070304@trash.net> Date: Mon, 10 Jan 2005 20:37:56 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: jamal CC: Maillist netdev Subject: [PATCH PKT_SCHED 8/22]: act_api.c: clean up init path, propagate errors properly Content-Type: multipart/mixed; boundary="------------000909040505000102080502" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 22 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------000909040505000102080502 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------000909040505000102080502 Content-Type: text/x-patch; name="08.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="08.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/09 23:31:15+01:00 kaber@coreworks.de # [PKT_SCHED]: act_api.c: clean up init path, propagate errors properly # # Signed-off-by: Patrick McHardy # # net/sched/act_api.c # 2005/01/09 23:31:08+01:00 kaber@coreworks.de +17 -36 # [PKT_SCHED]: act_api.c: clean up init path, propagate errors properly # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/act_api.c b/net/sched/act_api.c --- a/net/sched/act_api.c 2005-01-10 06:22:15 +01:00 +++ b/net/sched/act_api.c 2005-01-10 06:22:15 +01:00 @@ -283,55 +283,39 @@ RTA_PAYLOAD(rta)) < 0) goto err_out; kind = tb[TCA_ACT_KIND-1]; - if (kind != NULL) { - if (rtattr_strlcpy(act_name, kind, - IFNAMSIZ) >= IFNAMSIZ) - goto err_out; - } else { - printk("Action bad kind\n"); + if (kind == NULL) + goto err_out; + if (rtattr_strlcpy(act_name, kind, IFNAMSIZ) >= IFNAMSIZ) goto err_out; - } - a_o = tc_lookup_action(kind); } else { - sprintf(act_name, "%s", name); - DPRINTK("tcf_action_init_1: finding %s\n", act_name); - a_o = tc_lookup_action_n(name); + if (strlcpy(act_name, name, IFNAMSIZ) >= IFNAMSIZ) + goto err_out; } + + *err = -ENOENT; + a_o = tc_lookup_action_n(act_name); #ifdef CONFIG_KMOD if (a_o == NULL) { - DPRINTK("tcf_action_init_1: trying to load module %s\n", - act_name); request_module(act_name); a_o = tc_lookup_action_n(act_name); } - #endif - if (a_o == NULL) { - printk("failed to find %s\n", act_name); + if (a_o == NULL) goto err_out; - } + *err = -ENOMEM; a = kmalloc(sizeof(*a), GFP_KERNEL); - if (a == NULL) { - *err = -ENOMEM; + if (a == NULL) goto err_mod; - } memset(a, 0, sizeof(*a)); /* backward compatibility for policer */ - if (name == NULL) { + if (name == NULL) *err = a_o->init(tb[TCA_ACT_OPTIONS-1], est, a, ovr, bind); - if (*err < 0) { - *err = -EINVAL; - goto err_free; - } - } else { + else *err = a_o->init(rta, est, a, ovr, bind); - if (*err < 0) { - *err = -EINVAL; - goto err_free; - } - } + if (*err < 0) + goto err_free; /* module count goes up only when brand new policy is created if it exists and is only bound to in a_o->init() then @@ -370,10 +354,8 @@ if (tb[i]) { act = tcf_action_init_1(tb[i], est, name, ovr, bind, err); - if (act == NULL) { - printk("Error processing action order %d\n", i); + if (act == NULL) goto bad_ret; - } act->order = i+1; if (a == NULL) @@ -838,8 +820,7 @@ ret = tca_action_gd(tca[TCA_ACT_TAB-1], n, pid, RTM_GETACTION); break; default: - printk("Unknown cmd was detected\n"); - break; + BUG(); } return ret; --------------000909040505000102080502-- From kaber@trash.net Sun Jan 9 23:38:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 23:38:37 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A7c6VS021002 for ; Sun, 9 Jan 2005 23:38:06 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Co5MQ-0005Ry-Hq; Mon, 10 Jan 2005 20:37:54 +0100 Message-ID: <41E2D992.7000300@trash.net> Date: Mon, 10 Jan 2005 20:37:54 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: jamal CC: Maillist netdev Subject: [PATCH PKT_SCHED 7/22]: Use rtattr_strcmp where appropriate Content-Type: multipart/mixed; boundary="------------010606020202010102000701" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 21 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------010606020202010102000701 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------010606020202010102000701 Content-Type: text/x-patch; name="07.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="07.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/09 22:54:01+01:00 kaber@coreworks.de # [RTNETLINK]: Use rtattr_strcmp where appropriate # # Signed-off-by: Patrick McHardy # # net/sched/act_api.c # 2005/01/09 22:53:52+01:00 kaber@coreworks.de +1 -1 # [RTNETLINK]: Use rtattr_strcmp where appropriate # # Signed-off-by: Patrick McHardy # # net/ipv4/fib_rules.c # 2005/01/09 22:53:52+01:00 kaber@coreworks.de +1 -1 # [RTNETLINK]: Use rtattr_strcmp where appropriate # # Signed-off-by: Patrick McHardy # # net/ipv4/devinet.c # 2005/01/09 22:53:52+01:00 kaber@coreworks.de +1 -1 # [RTNETLINK]: Use rtattr_strcmp where appropriate # # Signed-off-by: Patrick McHardy # # net/decnet/dn_rules.c # 2005/01/09 22:53:52+01:00 kaber@coreworks.de +1 -1 # [RTNETLINK]: Use rtattr_strcmp where appropriate # # Signed-off-by: Patrick McHardy # # net/decnet/dn_dev.c # 2005/01/09 22:53:52+01:00 kaber@coreworks.de +1 -1 # [RTNETLINK]: Use rtattr_strcmp where appropriate # # Signed-off-by: Patrick McHardy # diff -Nru a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c --- a/net/decnet/dn_dev.c 2005-01-10 06:22:11 +01:00 +++ b/net/decnet/dn_dev.c 2005-01-10 06:22:11 +01:00 @@ -662,7 +662,7 @@ for(ifap = &dn_db->ifa_list; (ifa=*ifap) != NULL; ifap = &ifa->ifa_next) { void *tmp = rta[IFA_LOCAL-1]; if ((tmp && memcmp(RTA_DATA(tmp), &ifa->ifa_local, 2)) || - (rta[IFA_LABEL-1] && strcmp(RTA_DATA(rta[IFA_LABEL-1]), ifa->ifa_label))) + (rta[IFA_LABEL-1] && rtattr_strcmp(rta[IFA_LABEL-1], ifa->ifa_label))) continue; dn_dev_del_ifa(dn_db, ifap, 1); diff -Nru a/net/decnet/dn_rules.c b/net/decnet/dn_rules.c --- a/net/decnet/dn_rules.c 2005-01-10 06:22:11 +01:00 +++ b/net/decnet/dn_rules.c 2005-01-10 06:22:11 +01:00 @@ -88,7 +88,7 @@ #endif (!rtm->rtm_type || rtm->rtm_type == r->r_action) && (!rta[RTA_PRIORITY-1] || memcmp(RTA_DATA(rta[RTA_PRIORITY-1]), &r->r_preference, 4) == 0) && - (!rta[RTA_IIF-1] || strcmp(RTA_DATA(rta[RTA_IIF-1]), r->r_ifname) == 0) && + (!rta[RTA_IIF-1] || rtattr_strcmp(rta[RTA_IIF-1], r->r_ifname) == 0) && (!rtm->rtm_table || (r && rtm->rtm_table == r->r_table))) { err = -EPERM; diff -Nru a/net/ipv4/devinet.c b/net/ipv4/devinet.c --- a/net/ipv4/devinet.c 2005-01-10 06:22:11 +01:00 +++ b/net/ipv4/devinet.c 2005-01-10 06:22:11 +01:00 @@ -399,7 +399,7 @@ memcmp(RTA_DATA(rta[IFA_LOCAL - 1]), &ifa->ifa_local, 4)) || (rta[IFA_LABEL - 1] && - strcmp(RTA_DATA(rta[IFA_LABEL - 1]), ifa->ifa_label)) || + rtattr_strcmp(rta[IFA_LABEL - 1], ifa->ifa_label)) || (rta[IFA_ADDRESS - 1] && (ifm->ifa_prefixlen != ifa->ifa_prefixlen || !inet_ifa_match(*(u32*)RTA_DATA(rta[IFA_ADDRESS - 1]), diff -Nru a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c --- a/net/ipv4/fib_rules.c 2005-01-10 06:22:11 +01:00 +++ b/net/ipv4/fib_rules.c 2005-01-10 06:22:11 +01:00 @@ -119,7 +119,7 @@ #endif (!rtm->rtm_type || rtm->rtm_type == r->r_action) && (!rta[RTA_PRIORITY-1] || memcmp(RTA_DATA(rta[RTA_PRIORITY-1]), &r->r_preference, 4) == 0) && - (!rta[RTA_IIF-1] || strcmp(RTA_DATA(rta[RTA_IIF-1]), r->r_ifname) == 0) && + (!rta[RTA_IIF-1] || rtattr_strcmp(rta[RTA_IIF-1], r->r_ifname) == 0) && (!rtm->rtm_table || (r && rtm->rtm_table == r->r_table))) { err = -EPERM; if (r == &local_rule) diff -Nru a/net/sched/act_api.c b/net/sched/act_api.c --- a/net/sched/act_api.c 2005-01-10 06:22:11 +01:00 +++ b/net/sched/act_api.c 2005-01-10 06:22:11 +01:00 @@ -112,7 +112,7 @@ if (kind) { read_lock(&act_mod_lock); for (a = act_base; a; a = a->next) { - if (strcmp((char*)RTA_DATA(kind), a->kind) == 0) { + if (rtattr_strcmp(kind, a->kind) == 0) { if (!try_module_get(a->owner)) { read_unlock(&act_mod_lock); return NULL; --------------010606020202010102000701-- From kaber@trash.net Sun Jan 9 23:38:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 23:39:06 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A7cK6q021235 for ; Sun, 9 Jan 2005 23:38:20 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Co5Me-0005SU-KH; Mon, 10 Jan 2005 20:38:08 +0100 Message-ID: <41E2D9A0.3060903@trash.net> Date: Mon, 10 Jan 2005 20:38:08 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: jamal CC: Maillist netdev Subject: [PATCH PKT_SCHED 15/22]: police action: fix multiple bugs in init path Content-Type: multipart/mixed; boundary="------------000505020205030308060704" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 30 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------000505020205030308060704 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------000505020205030308060704 Content-Type: text/x-patch; name="15.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="15.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 02:43:13+01:00 kaber@coreworks.de # [PKT_SCHED]: police action: fix multiple bugs in init path # # - Return proper error codes # - Some attribute sizes are not checked # - rta may by NULL # - multiple leaks # - possible unbalanced unlock # - used action is freed after if an error happens while trying to replace # - estimator can't be replaced # # This patch makes replacement atomic, so the old action is either # replaced entirely or not touched at all. # # Signed-off-by: Patrick McHardy # # net/sched/police.c # 2005/01/10 02:43:06+01:00 kaber@coreworks.de +49 -37 # [PKT_SCHED]: police action: fix multiple bugs in init path # # - Return proper error codes # - Some attribute sizes are not checked # - rta may by NULL # - multiple leaks # - possible unbalanced unlock # - used action is freed after if an error happens while trying to replace # - estimator can't be replaced # # This patch makes replacement atomic, so the old action is either # replaced entirely or not touched at all. # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/police.c b/net/sched/police.c --- a/net/sched/police.c 2005-01-10 06:22:48 +01:00 +++ b/net/sched/police.c 2005-01-10 06:22:48 +01:00 @@ -165,20 +165,28 @@ struct tc_action *a, int ovr, int bind) { unsigned h; - int ret = 0; + int ret = 0, err; struct rtattr *tb[TCA_POLICE_MAX]; struct tc_police *parm; struct tcf_police *p; + struct qdisc_rate_table *R_tab = NULL, *P_tab = NULL; - if (rtattr_parse(tb, TCA_POLICE_MAX, RTA_DATA(rta), - RTA_PAYLOAD(rta)) < 0) - return -1; + if (rta == NULL || rtattr_parse(tb, TCA_POLICE_MAX, RTA_DATA(rta), + RTA_PAYLOAD(rta)) < 0) + return -EINVAL; if (tb[TCA_POLICE_TBF-1] == NULL || RTA_PAYLOAD(tb[TCA_POLICE_TBF-1]) != sizeof(*parm)) - return -1; - + return -EINVAL; parm = RTA_DATA(tb[TCA_POLICE_TBF-1]); + + if (tb[TCA_POLICE_RESULT-1] != NULL && + RTA_PAYLOAD(tb[TCA_POLICE_RESULT-1]) != sizeof(u32)) + return -EINVAL; + if (tb[TCA_POLICE_RESULT-1] != NULL && + RTA_PAYLOAD(tb[TCA_POLICE_RESULT-1]) != sizeof(u32)) + return -EINVAL; + if (parm->index && (p = tcf_police_lookup(parm->index)) != NULL) { a->priv = p; spin_lock(&p->lock); @@ -186,18 +194,18 @@ p->bindcnt += 1; p->refcnt += 1; } + spin_unlock(&p->lock); if (ovr) goto override; - spin_unlock(&p->lock); return ret; } p = kmalloc(sizeof(*p), GFP_KERNEL); if (p == NULL) - return -1; + return -ENOMEM; memset(p, 0, sizeof(*p)); - ret = 1; + ret = ACT_P_CREATED; p->refcnt = 1; spin_lock_init(&p->lock); p->stats_lock = &p->lock; @@ -205,28 +213,32 @@ p->bindcnt = 1; override: if (parm->rate.rate) { - p->R_tab = qdisc_get_rtab(&parm->rate, tb[TCA_POLICE_RATE-1]); - if (p->R_tab == NULL) + err = -ENOMEM; + R_tab = qdisc_get_rtab(&parm->rate, tb[TCA_POLICE_RATE-1]); + if (R_tab == NULL) goto failure; if (parm->peakrate.rate) { - p->P_tab = qdisc_get_rtab(&parm->peakrate, - tb[TCA_POLICE_PEAKRATE-1]); - if (p->P_tab == NULL) + P_tab = qdisc_get_rtab(&parm->peakrate, + tb[TCA_POLICE_PEAKRATE-1]); + if (p->P_tab == NULL) { + qdisc_put_rtab(R_tab); goto failure; + } } } - if (tb[TCA_POLICE_RESULT-1]) { - if (RTA_PAYLOAD(tb[TCA_POLICE_RESULT-1]) != sizeof(u32)) - goto failure; - p->result = *(u32*)RTA_DATA(tb[TCA_POLICE_RESULT-1]); + /* No failure allowed after this point */ + spin_lock(&p->lock); + if (R_tab != NULL) { + qdisc_put_rtab(p->R_tab); + p->R_tab = R_tab; } -#ifdef CONFIG_NET_ESTIMATOR - if (tb[TCA_POLICE_AVRATE-1]) { - if (RTA_PAYLOAD(tb[TCA_POLICE_AVRATE-1]) != sizeof(u32)) - goto failure; - p->ewma_rate = *(u32*)RTA_DATA(tb[TCA_POLICE_AVRATE-1]); + if (P_tab != NULL) { + qdisc_put_rtab(p->P_tab); + p->P_tab = P_tab; } -#endif + + if (tb[TCA_POLICE_RESULT-1]) + p->result = *(u32*)RTA_DATA(tb[TCA_POLICE_RESULT-1]); p->toks = p->burst = parm->burst; p->mtu = parm->mtu; if (p->mtu == 0) { @@ -238,16 +250,19 @@ p->ptoks = L2T_P(p, p->mtu); p->action = parm->action; - if (ovr) { - spin_unlock(&p->lock); - return ret; - } - PSCHED_GET_TIME(p->t_c); - p->index = parm->index ? : tcf_police_new_index(); #ifdef CONFIG_NET_ESTIMATOR + if (tb[TCA_POLICE_AVRATE-1]) + p->ewma_rate = *(u32*)RTA_DATA(tb[TCA_POLICE_AVRATE-1]); if (est) - gen_new_estimator(&p->bstats, &p->rate_est, p->stats_lock, est); + gen_replace_estimator(&p->bstats, &p->rate_est, p->stats_lock, est); #endif + + spin_unlock(&p->lock); + if (ret != ACT_P_CREATED) + return ret; + + PSCHED_GET_TIME(p->t_c); + p->index = parm->index ? : tcf_police_new_index(); h = tcf_police_hash(p->index); write_lock_bh(&police_lock); p->next = tcf_police_ht[h]; @@ -258,12 +273,9 @@ return ret; failure: - if (p->R_tab) - qdisc_put_rtab(p->R_tab); - if (ovr) - spin_unlock(&p->lock); - kfree(p); - return -1; + if (ret == ACT_P_CREATED) + kfree(p); + return err; } static int tcf_act_police_cleanup(struct tc_action *a, int bind) --------------000505020205030308060704-- From kaber@trash.net Sun Jan 9 23:38:12 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 23:38:56 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A7cBLO021022 for ; Sun, 9 Jan 2005 23:38:12 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Co5MW-0005SA-15; Mon, 10 Jan 2005 20:38:00 +0100 Message-ID: <41E2D997.3060401@trash.net> Date: Mon, 10 Jan 2005 20:37:59 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: jamal CC: Maillist netdev Subject: [PATCH PKT_SCHED 10/22]: tc actions: remove checks for impossible conditions Content-Type: multipart/mixed; boundary="------------030509010300020508090902" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 24 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------030509010300020508090902 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------030509010300020508090902 Content-Type: text/x-patch; name="10.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="10.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/09 23:37:54+01:00 kaber@coreworks.de # [PKT_SCHED]: tc actions: remove checks for impossible conditions # # Signed-off-by: Patrick McHardy # # net/sched/police.c # 2005/01/09 23:37:48+01:00 kaber@coreworks.de +0 -17 # [PKT_SCHED]: tc actions: remove checks for impossible conditions # # Signed-off-by: Patrick McHardy # # net/sched/pedit.c # 2005/01/09 23:37:48+01:00 kaber@coreworks.de +1 -11 # [PKT_SCHED]: tc actions: remove checks for impossible conditions # # Signed-off-by: Patrick McHardy # # net/sched/mirred.c # 2005/01/09 23:37:48+01:00 kaber@coreworks.de +3 -20 # [PKT_SCHED]: tc actions: remove checks for impossible conditions # # Signed-off-by: Patrick McHardy # # net/sched/ipt.c # 2005/01/09 23:37:48+01:00 kaber@coreworks.de +1 -8 # [PKT_SCHED]: tc actions: remove checks for impossible conditions # # Signed-off-by: Patrick McHardy # # net/sched/gact.c # 2005/01/09 23:37:48+01:00 kaber@coreworks.de +1 -12 # [PKT_SCHED]: tc actions: remove checks for impossible conditions # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/gact.c b/net/sched/gact.c --- a/net/sched/gact.c 2005-01-10 06:22:25 +01:00 +++ b/net/sched/gact.c 2005-01-10 06:22:25 +01:00 @@ -85,7 +85,7 @@ if (rtattr_parse(tb, TCA_GACT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0) return -1; - if (a == NULL || tb[TCA_GACT_PARMS - 1] == NULL) { + if (tb[TCA_GACT_PARMS - 1] == NULL) { printk("BUG: tcf_gact_init called with NULL params\n"); return -1; } @@ -140,12 +140,6 @@ struct sk_buff *skb = *pskb; int action = TC_ACT_SHOT; - if (p == NULL) { - if (net_ratelimit()) - printk("BUG: tcf_gact called with NULL params\n"); - return -1; - } - spin_lock(&p->lock); #ifdef CONFIG_GACT_PROB if (p->ptype && gact_rand[p->ptype] != NULL) @@ -172,11 +166,6 @@ struct tc_gact opt; struct tcf_gact *p = PRIV(a, gact); struct tcf_t t; - - if (p == NULL) { - printk("BUG: tcf_gact_dump called with NULL params\n"); - goto rtattr_failure; - } opt.index = p->index; opt.refcnt = p->refcnt - ref; diff -Nru a/net/sched/ipt.c b/net/sched/ipt.c --- a/net/sched/ipt.c 2005-01-10 06:22:25 +01:00 +++ b/net/sched/ipt.c 2005-01-10 06:22:25 +01:00 @@ -96,7 +96,7 @@ u32 index = 0; u32 hook = 0; - if (a == NULL || rta == NULL || + if (rta == NULL || rtattr_parse(tb, TCA_IPT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0) return -1; @@ -238,9 +238,6 @@ struct tcf_ipt *p = PRIV(a, ipt); struct sk_buff *skb = *pskb; - if (p == NULL || skb == NULL) - return -1; - spin_lock(&p->lock); p->tm.lastuse = jiffies; @@ -288,10 +285,6 @@ unsigned char *b = skb->tail; struct tcf_ipt *p = PRIV(a, ipt); - if (p == NULL) { - printk("BUG: tcf_ipt_dump called with NULL params\n"); - goto rtattr_failure; - } /* for simple targets kernel size == user size ** user name = target name ** for foolproof you need to not assume this diff -Nru a/net/sched/mirred.c b/net/sched/mirred.c --- a/net/sched/mirred.c 2005-01-10 06:22:25 +01:00 +++ b/net/sched/mirred.c 2005-01-10 06:22:25 +01:00 @@ -90,7 +90,7 @@ return -1; } - if (a == NULL || tb[TCA_MIRRED_PARMS - 1] == NULL) { + if (tb[TCA_MIRRED_PARMS - 1] == NULL) { DPRINTK("BUG: tcf_mirred_init called with NULL params\n"); return -1; } @@ -169,27 +169,15 @@ struct sk_buff *skb = *pskb; u32 at = G_TC_AT(skb->tc_verd); - if (a == NULL) { - if (net_ratelimit()) - printk("BUG: tcf_mirred called with NULL action!\n"); - return -1; - } - - if (p == NULL) { - if (net_ratelimit()) - printk("BUG: tcf_mirred called with NULL params\n"); - return -1; - } - spin_lock(&p->lock); dev = p->dev; p->tm.lastuse = jiffies; - if (dev == NULL || !(dev->flags&IFF_UP) ) { + if (!(dev->flags&IFF_UP) ) { if (net_ratelimit()) printk("mirred to Houston: device %s is gone!\n", - dev ? dev->name : ""); + dev->name); bad_mirred: if (skb2 != NULL) kfree_skb(skb2); @@ -236,11 +224,6 @@ struct tc_mirred opt; struct tcf_mirred *p = PRIV(a, mirred); struct tcf_t t; - - if (p == NULL) { - printk("BUG: tcf_mirred_dump called with NULL params\n"); - goto rtattr_failure; - } opt.index = p->index; opt.action = p->action; diff -Nru a/net/sched/pedit.c b/net/sched/pedit.c --- a/net/sched/pedit.c 2005-01-10 06:22:25 +01:00 +++ b/net/sched/pedit.c 2005-01-10 06:22:25 +01:00 @@ -65,7 +65,7 @@ if (rtattr_parse(tb, TCA_PEDIT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0) return -1; - if (a == NULL || tb[TCA_PEDIT_PARMS - 1] == NULL) { + if (tb[TCA_PEDIT_PARMS - 1] == NULL) { printk("BUG: tcf_pedit_init called with NULL params\n"); return -1; } @@ -113,11 +113,6 @@ int i, munged = 0; u8 *pptr; - if (p == NULL) { - printk("BUG: tcf_pedit called with NULL params\n"); - return -1; /* change to something symbolic */ - } - if (!(skb->tc_verd & TC_OK2MUNGE)) { /* should we set skb->cloned? */ if (pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) { @@ -189,11 +184,6 @@ struct tcf_t t; int s; - if (p == NULL) { - printk("BUG: tcf_pedit_dump called with NULL params\n"); - goto rtattr_failure; - } - s = sizeof(*opt) + p->nkeys * sizeof(struct tc_pedit_key); /* netlink spinlocks held above us - must use ATOMIC */ diff -Nru a/net/sched/police.c b/net/sched/police.c --- a/net/sched/police.c 2005-01-10 06:22:25 +01:00 +++ b/net/sched/police.c 2005-01-10 06:22:25 +01:00 @@ -170,13 +170,6 @@ struct tc_police *parm; struct tcf_police *p; - if (a == NULL) { - if (net_ratelimit()) - printk("BUG: tcf_police_locate called with NULL " - "params\n"); - return -1; - } - if (rtattr_parse(tb, TCA_POLICE_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0) return -1; @@ -290,11 +283,6 @@ long toks; long ptoks = 0; - if (p == NULL) { - printk("BUG: tcf_police called with NULL params\n"); - return -1; - } - spin_lock(&p->lock); p->bstats.bytes += skb->len; @@ -349,11 +337,6 @@ unsigned char *b = skb->tail; struct tc_police opt; struct tcf_police *p = PRIV(a); - - if (p == NULL) { - printk("BUG: tcf_police_dump called with NULL params\n"); - goto rtattr_failure; - } opt.index = p->index; opt.action = p->action; --------------030509010300020508090902-- From kaber@trash.net Sun Jan 9 23:38:06 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 23:38:44 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A7c4nq020987 for ; Sun, 9 Jan 2005 23:38:05 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Co5MO-0005Ru-TX; Mon, 10 Jan 2005 20:37:52 +0100 Message-ID: <41E2D990.6040406@trash.net> Date: Mon, 10 Jan 2005 20:37:52 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: jamal CC: Maillist netdev Subject: [PATCH PKT_SCHED 6/22]: Add rtattr_strlcpy, use it where appropriate Content-Type: multipart/mixed; boundary="------------000600010406060406060801" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 23 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------000600010406060406060801 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------000600010406060406060801 Content-Type: text/x-patch; name="06.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="06.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/09 22:53:27+01:00 kaber@coreworks.de # [RTNETLINK]: Add rtattr_strlcpy, use it where appropriate # # Add rtattr_strlcpy to handle unterminated strings. The destination # is nulled out entirely to avoid possible leaks when dumping. The # return value can be checked for >= size to detect truncated strings. # Currently strings equal to the size of the destination are accepted # everywhere even if not null-terminated. Sometimes they are silently # truncated, sometimes the unterminated string is used. # # Signed-off-by: Patrick McHardy # # net/sched/sch_api.c # 2005/01/09 22:53:18+01:00 kaber@coreworks.de +3 -2 # [RTNETLINK]: Add rtattr_strlcpy, use it where appropriate # # Add rtattr_strlcpy to handle unterminated strings. The destination # is nulled out entirely to avoid possible leaks when dumping. The # return value can be checked for >= size to detect truncated strings. # Currently strings equal to the size of the destination are accepted # everywhere even if not null-terminated. Sometimes they are silently # truncated, sometimes the unterminated string is used. # # Signed-off-by: Patrick McHardy # # net/sched/cls_api.c # 2005/01/09 22:53:18+01:00 kaber@coreworks.de +3 -2 # [RTNETLINK]: Add rtattr_strlcpy, use it where appropriate # # Add rtattr_strlcpy to handle unterminated strings. The destination # is nulled out entirely to avoid possible leaks when dumping. The # return value can be checked for >= size to detect truncated strings. # Currently strings equal to the size of the destination are accepted # everywhere even if not null-terminated. Sometimes they are silently # truncated, sometimes the unterminated string is used. # # Signed-off-by: Patrick McHardy # # net/sched/act_api.c # 2005/01/09 22:53:18+01:00 kaber@coreworks.de +7 -18 # [RTNETLINK]: Add rtattr_strlcpy, use it where appropriate # # Add rtattr_strlcpy to handle unterminated strings. The destination # is nulled out entirely to avoid possible leaks when dumping. The # return value can be checked for >= size to detect truncated strings. # Currently strings equal to the size of the destination are accepted # everywhere even if not null-terminated. Sometimes they are silently # truncated, sometimes the unterminated string is used. # # Signed-off-by: Patrick McHardy # # net/ipv4/fib_rules.c # 2005/01/09 22:53:18+01:00 kaber@coreworks.de +1 -2 # [RTNETLINK]: Add rtattr_strlcpy, use it where appropriate # # Add rtattr_strlcpy to handle unterminated strings. The destination # is nulled out entirely to avoid possible leaks when dumping. The # return value can be checked for >= size to detect truncated strings. # Currently strings equal to the size of the destination are accepted # everywhere even if not null-terminated. Sometimes they are silently # truncated, sometimes the unterminated string is used. # # Signed-off-by: Patrick McHardy # # net/ipv4/devinet.c # 2005/01/09 22:53:18+01:00 kaber@coreworks.de +1 -1 # [RTNETLINK]: Add rtattr_strlcpy, use it where appropriate # # Add rtattr_strlcpy to handle unterminated strings. The destination # is nulled out entirely to avoid possible leaks when dumping. The # return value can be checked for >= size to detect truncated strings. # Currently strings equal to the size of the destination are accepted # everywhere even if not null-terminated. Sometimes they are silently # truncated, sometimes the unterminated string is used. # # Signed-off-by: Patrick McHardy # # net/decnet/dn_rules.c # 2005/01/09 22:53:18+01:00 kaber@coreworks.de +1 -2 # [RTNETLINK]: Add rtattr_strlcpy, use it where appropriate # # Add rtattr_strlcpy to handle unterminated strings. The destination # is nulled out entirely to avoid possible leaks when dumping. The # return value can be checked for >= size to detect truncated strings. # Currently strings equal to the size of the destination are accepted # everywhere even if not null-terminated. Sometimes they are silently # truncated, sometimes the unterminated string is used. # # Signed-off-by: Patrick McHardy # # net/decnet/dn_dev.c # 2005/01/09 22:53:18+01:00 kaber@coreworks.de +1 -1 # [RTNETLINK]: Add rtattr_strlcpy, use it where appropriate # # Add rtattr_strlcpy to handle unterminated strings. The destination # is nulled out entirely to avoid possible leaks when dumping. The # return value can be checked for >= size to detect truncated strings. # Currently strings equal to the size of the destination are accepted # everywhere even if not null-terminated. Sometimes they are silently # truncated, sometimes the unterminated string is used. # # Signed-off-by: Patrick McHardy # # net/core/rtnetlink.c # 2005/01/09 22:53:18+01:00 kaber@coreworks.de +20 -14 # [RTNETLINK]: Add rtattr_strlcpy, use it where appropriate # # Add rtattr_strlcpy to handle unterminated strings. The destination # is nulled out entirely to avoid possible leaks when dumping. The # return value can be checked for >= size to detect truncated strings. # Currently strings equal to the size of the destination are accepted # everywhere even if not null-terminated. Sometimes they are silently # truncated, sometimes the unterminated string is used. # # Signed-off-by: Patrick McHardy # # include/net/pkt_cls.h # 2005/01/09 22:53:18+01:00 kaber@coreworks.de +1 -7 # [RTNETLINK]: Add rtattr_strlcpy, use it where appropriate # # Add rtattr_strlcpy to handle unterminated strings. The destination # is nulled out entirely to avoid possible leaks when dumping. The # return value can be checked for >= size to detect truncated strings. # Currently strings equal to the size of the destination are accepted # everywhere even if not null-terminated. Sometimes they are silently # truncated, sometimes the unterminated string is used. # # Signed-off-by: Patrick McHardy # # include/linux/rtnetlink.h # 2005/01/09 22:53:18+01:00 kaber@coreworks.de +1 -0 # [RTNETLINK]: Add rtattr_strlcpy, use it where appropriate # # Add rtattr_strlcpy to handle unterminated strings. The destination # is nulled out entirely to avoid possible leaks when dumping. The # return value can be checked for >= size to detect truncated strings. # Currently strings equal to the size of the destination are accepted # everywhere even if not null-terminated. Sometimes they are silently # truncated, sometimes the unterminated string is used. # # Signed-off-by: Patrick McHardy # diff -Nru a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h --- a/include/linux/rtnetlink.h 2005-01-10 06:22:06 +01:00 +++ b/include/linux/rtnetlink.h 2005-01-10 06:22:06 +01:00 @@ -748,6 +748,7 @@ #include +extern size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size); static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) { int len = strlen(str) + 1; diff -Nru a/include/net/pkt_cls.h b/include/net/pkt_cls.h --- a/include/net/pkt_cls.h 2005-01-10 06:22:06 +01:00 +++ b/include/net/pkt_cls.h 2005-01-10 06:22:06 +01:00 @@ -148,14 +148,8 @@ static inline int tcf_change_indev(struct tcf_proto *tp, char *indev, struct rtattr *indev_tlv) { - if (RTA_PAYLOAD(indev_tlv) >= IFNAMSIZ) { - printk("cls: bad indev name %s\n", (char *) RTA_DATA(indev_tlv)); + if (rtattr_strlcpy(indev, indev_tlv, IFNAMSIZ) >= IFNAMSIZ) return -EINVAL; - } - - memset(indev, 0, IFNAMSIZ); - sprintf(indev, "%s", (char *) RTA_DATA(indev_tlv)); - return 0; } diff -Nru a/net/core/rtnetlink.c b/net/core/rtnetlink.c --- a/net/core/rtnetlink.c 2005-01-10 06:22:06 +01:00 +++ b/net/core/rtnetlink.c 2005-01-10 06:22:06 +01:00 @@ -119,6 +119,21 @@ memcpy(RTA_DATA(rta), data, attrlen); } +size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size) +{ + size_t ret = RTA_PAYLOAD(rta); + char *src = RTA_DATA(rta); + + if (ret > 0 && src[ret - 1] == '\0') + ret--; + if (size > 0) { + size_t len = (ret >= size) ? size - 1 : ret; + memset(dest, 0, size); + memcpy(dest, src, len); + } + return ret; +} + int rtnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, int echo) { int err = 0; @@ -272,13 +287,9 @@ else if (ida[IFLA_IFNAME - 1]) { char ifname[IFNAMSIZ]; - if (RTA_PAYLOAD(ida[IFLA_IFNAME - 1]) > RTA_ALIGN(sizeof(ifname))) + if (rtattr_strlcpy(ifname, ida[IFLA_IFNAME - 1], + IFNAMSIZ) >= IFNAMSIZ) return -EINVAL; - - memset(ifname, 0, sizeof(ifname)); - memcpy(ifname, RTA_DATA(ida[IFLA_IFNAME - 1]), - RTA_PAYLOAD(ida[IFLA_IFNAME - 1])); - ifname[IFNAMSIZ - 1] = '\0'; dev = dev_get_by_name(ifname); } else return -EINVAL; @@ -376,16 +387,10 @@ if (ifm->ifi_index >= 0 && ida[IFLA_IFNAME - 1]) { char ifname[IFNAMSIZ]; - if (RTA_PAYLOAD(ida[IFLA_IFNAME - 1]) > RTA_ALIGN(sizeof(ifname))) + if (rtattr_strlcpy(ifname, ida[IFLA_IFNAME - 1], + IFNAMSIZ) >= IFNAMSIZ) goto out; - - memset(ifname, 0, sizeof(ifname)); - memcpy(ifname, RTA_DATA(ida[IFLA_IFNAME - 1]), - RTA_PAYLOAD(ida[IFLA_IFNAME - 1])); - ifname[IFNAMSIZ - 1] = '\0'; - err = dev_change_name(dev, ifname); - if (err) goto out; } @@ -690,6 +695,7 @@ } EXPORT_SYMBOL(__rta_fill); +EXPORT_SYMBOL(rtattr_strlcpy); EXPORT_SYMBOL(rtattr_parse); EXPORT_SYMBOL(rtnetlink_dump_ifinfo); EXPORT_SYMBOL(rtnetlink_links); diff -Nru a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c --- a/net/decnet/dn_dev.c 2005-01-10 06:22:06 +01:00 +++ b/net/decnet/dn_dev.c 2005-01-10 06:22:06 +01:00 @@ -705,7 +705,7 @@ ifa->ifa_scope = ifm->ifa_scope; ifa->ifa_dev = dn_db; if (rta[IFA_LABEL-1]) - memcpy(ifa->ifa_label, RTA_DATA(rta[IFA_LABEL-1]), IFNAMSIZ); + rtattr_strlcpy(ifa->ifa_label, rta[IFA_LABEL-1], IFNAMSIZ); else memcpy(ifa->ifa_label, dev->name, IFNAMSIZ); diff -Nru a/net/decnet/dn_rules.c b/net/decnet/dn_rules.c --- a/net/decnet/dn_rules.c 2005-01-10 06:22:06 +01:00 +++ b/net/decnet/dn_rules.c 2005-01-10 06:22:06 +01:00 @@ -170,8 +170,7 @@ new_r->r_table = table_id; if (rta[RTA_IIF-1]) { struct net_device *dev; - memcpy(new_r->r_ifname, RTA_DATA(rta[RTA_IIF-1]), IFNAMSIZ); - new_r->r_ifname[IFNAMSIZ-1] = 0; + rtattr_strlcpy(new_r->r_ifname, rta[RTA_IIF-1], IFNAMSIZ); new_r->r_ifindex = -1; dev = dev_get_by_name(new_r->r_ifname); if (dev) { diff -Nru a/net/ipv4/devinet.c b/net/ipv4/devinet.c --- a/net/ipv4/devinet.c 2005-01-10 06:22:06 +01:00 +++ b/net/ipv4/devinet.c 2005-01-10 06:22:06 +01:00 @@ -456,7 +456,7 @@ in_dev_hold(in_dev); ifa->ifa_dev = in_dev; if (rta[IFA_LABEL - 1]) - memcpy(ifa->ifa_label, RTA_DATA(rta[IFA_LABEL - 1]), IFNAMSIZ); + rtattr_strlcpy(ifa->ifa_label, rta[IFA_LABEL - 1], IFNAMSIZ); else memcpy(ifa->ifa_label, dev->name, IFNAMSIZ); diff -Nru a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c --- a/net/ipv4/fib_rules.c 2005-01-10 06:22:06 +01:00 +++ b/net/ipv4/fib_rules.c 2005-01-10 06:22:06 +01:00 @@ -209,8 +209,7 @@ new_r->r_table = table_id; if (rta[RTA_IIF-1]) { struct net_device *dev; - memcpy(new_r->r_ifname, RTA_DATA(rta[RTA_IIF-1]), IFNAMSIZ); - new_r->r_ifname[IFNAMSIZ-1] = 0; + rtattr_strlcpy(new_r->r_ifname, rta[RTA_IIF-1], IFNAMSIZ); new_r->r_ifindex = -1; dev = __dev_get_by_name(new_r->r_ifname); if (dev) diff -Nru a/net/sched/act_api.c b/net/sched/act_api.c --- a/net/sched/act_api.c 2005-01-10 06:22:06 +01:00 +++ b/net/sched/act_api.c 2005-01-10 06:22:06 +01:00 @@ -272,7 +272,7 @@ { struct tc_action *a; struct tc_action_ops *a_o; - char act_name[4 + IFNAMSIZ + 1]; + char act_name[IFNAMSIZ]; struct rtattr *tb[TCA_ACT_MAX+1]; struct rtattr *kind; @@ -284,12 +284,9 @@ goto err_out; kind = tb[TCA_ACT_KIND-1]; if (kind != NULL) { - sprintf(act_name, "%s", (char*)RTA_DATA(kind)); - if (RTA_PAYLOAD(kind) >= IFNAMSIZ) { - printk("Action %s bad\n", - (char*)RTA_DATA(kind)); + if (rtattr_strlcpy(act_name, kind, + IFNAMSIZ) >= IFNAMSIZ) goto err_out; - } } else { printk("Action bad kind\n"); goto err_out; @@ -492,7 +489,7 @@ struct nlmsghdr *n, u32 pid) { struct tc_action_ops *a_o; - char act_name[4 + IFNAMSIZ + 1]; + char act_name[IFNAMSIZ]; struct rtattr *tb[TCA_ACT_MAX+1]; struct rtattr *kind; int index; @@ -502,12 +499,8 @@ goto err_out; kind = tb[TCA_ACT_KIND-1]; if (kind != NULL) { - sprintf(act_name, "%s", (char*)RTA_DATA(kind)); - if (RTA_PAYLOAD(kind) >= IFNAMSIZ) { - printk("tcf_action_get_1: action %s bad\n", - (char*)RTA_DATA(kind)); + if (rtattr_strlcpy(act_name, kind, IFNAMSIZ) >= IFNAMSIZ) goto err_out; - } } else { printk("tcf_action_get_1: action bad kind\n"); goto err_out; @@ -562,16 +555,12 @@ static struct tc_action_ops *get_ao(struct rtattr *kind, struct tc_action *a) { - char act_name[4 + IFNAMSIZ + 1]; + char act_name[IFNAMSIZ]; struct tc_action_ops *a_o; if (kind != NULL) { - sprintf(act_name, "%s", (char*)RTA_DATA(kind)); - if (RTA_PAYLOAD(kind) >= IFNAMSIZ) { - printk("get_ao: action %s bad\n", - (char*)RTA_DATA(kind)); + if (rtattr_strlcpy(act_name, kind, IFNAMSIZ) >= IFNAMSIZ) return NULL; - } } else { printk("get_ao: action bad kind\n"); return NULL; diff -Nru a/net/sched/cls_api.c b/net/sched/cls_api.c --- a/net/sched/cls_api.c 2005-01-10 06:22:06 +01:00 +++ b/net/sched/cls_api.c 2005-01-10 06:22:06 +01:00 @@ -215,9 +215,10 @@ #ifdef CONFIG_KMOD if (tp_ops==NULL && tca[TCA_KIND-1] != NULL) { struct rtattr *kind = tca[TCA_KIND-1]; + char name[IFNAMSIZ]; - if (RTA_PAYLOAD(kind) <= IFNAMSIZ) { - request_module("cls_%s", (char*)RTA_DATA(kind)); + if (rtattr_strlcpy(name, kind, IFNAMSIZ) < IFNAMSIZ) { + request_module("cls_%s", name); tp_ops = tcf_proto_lookup_ops(kind); } } diff -Nru a/net/sched/sch_api.c b/net/sched/sch_api.c --- a/net/sched/sch_api.c 2005-01-10 06:22:06 +01:00 +++ b/net/sched/sch_api.c 2005-01-10 06:22:06 +01:00 @@ -407,8 +407,9 @@ ops = qdisc_lookup_ops(kind); #ifdef CONFIG_KMOD if (ops==NULL && tca[TCA_KIND-1] != NULL) { - if (RTA_PAYLOAD(kind) <= IFNAMSIZ) { - request_module("sch_%s", (char*)RTA_DATA(kind)); + char name[IFNAMSIZ]; + if (rtattr_strlcpy(name, kind, IFNAMSIZ) < IFNAMSIZ) { + request_module("sch_%s", name); ops = qdisc_lookup_ops(kind); } } --------------000600010406060406060801-- From kaber@trash.net Sun Jan 9 23:38:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 23:39:10 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A7cRkq021415 for ; Sun, 9 Jan 2005 23:38:27 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Co5Ml-0005Sk-EG; Mon, 10 Jan 2005 20:38:15 +0100 Message-ID: <41E2D9A7.7090909@trash.net> Date: Mon, 10 Jan 2005 20:38:15 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: jamal CC: Maillist netdev Subject: [PATCH PKT_SCHED 19/22]: act_api.c: remove module loading from get/delete operations Content-Type: multipart/mixed; boundary="------------020005010809070002090708" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 35 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------020005010809070002090708 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit If get/delete can't find the action we can assume there is nothing to get/delete. --------------020005010809070002090708 Content-Type: text/x-patch; name="19.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="19.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 05:31:11+01:00 kaber@coreworks.de # [PKT_SCHED]: act_api.c: remove module loading from get/delete operations # # Signed-off-by: Patrick McHardy # # net/sched/act_api.c # 2005/01/10 05:31:05+01:00 kaber@coreworks.de +15 -79 # [PKT_SCHED]: act_api.c: remove module loading from get/delete operations # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/act_api.c b/net/sched/act_api.c --- a/net/sched/act_api.c 2005-01-10 06:23:07 +01:00 +++ b/net/sched/act_api.c 2005-01-10 06:23:07 +01:00 @@ -380,10 +380,6 @@ struct gnet_dump d; struct tcf_act_hdr *h = a->priv; -#ifdef CONFIG_KMOD - /* place holder */ -#endif - if (h == NULL) goto errout; @@ -470,58 +466,27 @@ static int tcf_action_get_1(struct rtattr *rta, struct tc_action *a, struct nlmsghdr *n, u32 pid) { - struct tc_action_ops *a_o; - char act_name[IFNAMSIZ]; struct rtattr *tb[TCA_ACT_MAX+1]; - struct rtattr *kind; int index; - int err = -EINVAL; + int err = 0; if (rtattr_parse(tb, TCA_ACT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0) - goto err_out; - kind = tb[TCA_ACT_KIND-1]; - if (kind != NULL) { - if (rtattr_strlcpy(act_name, kind, IFNAMSIZ) >= IFNAMSIZ) - goto err_out; - } else { - printk("tcf_action_get_1: action bad kind\n"); - goto err_out; - } - - if (tb[TCA_ACT_INDEX - 1]) - index = *(int *)RTA_DATA(tb[TCA_ACT_INDEX - 1]); - else { - printk("tcf_action_get_1: index not received\n"); - goto err_out; - } - - a_o = tc_lookup_action(kind); -#ifdef CONFIG_KMOD - if (a_o == NULL) { - request_module (act_name); - a_o = tc_lookup_action_n(act_name); - } -#endif - if (a_o == NULL) { - printk("failed to find %s\n", act_name); - goto err_out; - } - if (a == NULL) - goto err_mod; + return -EINVAL; - a->ops = a_o; + if (tb[TCA_ACT_INDEX - 1] == NULL || + RTA_PAYLOAD(tb[TCA_ACT_INDEX - 1]) < sizeof(index)) + return -EINVAL; + index = *(int *)RTA_DATA(tb[TCA_ACT_INDEX - 1]); - if (a_o->lookup == NULL || a_o->lookup(a, index) == 0) { - a->ops = NULL; + a->ops = tc_lookup_action(tb[TCA_ACT_KIND - 1]); + if (a->ops == NULL) + return -EINVAL; + if (a->ops->lookup == NULL) err = -EINVAL; - goto err_mod; - } + else if (a->ops->lookup(a, index) == 0) + err = -ENOENT; - module_put(a_o->owner); - return 0; -err_mod: - module_put(a_o->owner); -err_out: + module_put(a->ops->owner); return err; } @@ -535,36 +500,6 @@ } } -static struct tc_action_ops *get_ao(struct rtattr *kind, struct tc_action *a) -{ - char act_name[IFNAMSIZ]; - struct tc_action_ops *a_o; - - if (kind != NULL) { - if (rtattr_strlcpy(act_name, kind, IFNAMSIZ) >= IFNAMSIZ) - return NULL; - } else { - printk("get_ao: action bad kind\n"); - return NULL; - } - - a_o = tc_lookup_action(kind); -#ifdef CONFIG_KMOD - if (a_o == NULL) { - DPRINTK("get_ao: trying to load module %s\n", act_name); - request_module(act_name); - a_o = tc_lookup_action_n(act_name); - } -#endif - if (a_o == NULL) { - printk("get_ao: failed to find %s\n", act_name); - return NULL; - } - - a->ops = a_o; - return a_o; -} - static struct tc_action *create_a(int i) { struct tc_action *act; @@ -610,7 +545,8 @@ goto err_out; kind = tb[TCA_ACT_KIND-1]; - if (get_ao(kind, a) == NULL) + a->ops = tc_lookup_action(kind); + if (a->ops == NULL) goto err_out; nlh = NLMSG_PUT(skb, pid, n->nlmsg_seq, RTM_DELACTION, sizeof(*t)); --------------020005010809070002090708-- From kaber@trash.net Sun Jan 9 23:38:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 23:39:07 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A7cODQ021337 for ; Sun, 9 Jan 2005 23:38:24 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Co5Mi-0005Sc-4H; Mon, 10 Jan 2005 20:38:12 +0100 Message-ID: <41E2D9A4.6050004@trash.net> Date: Mon, 10 Jan 2005 20:38:12 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: jamal CC: Maillist netdev Subject: [PATCH PKT_SCHED 17/22]: tc actions: remove unnecessary locking for refcnt changes Content-Type: multipart/mixed; boundary="------------060200080706030502010007" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 31 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------060200080706030502010007 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit BTW: This part in pkt_act.h looks kind of strange: tcf_hash_check: if (bind) { p->bindcnt++; p->refcnt++; } but tcf_hash_release: if (bind) { p->bindcnt--; } p->refcnt--; Shouldn't refcnt be incremented unconditionally ? --------------060200080706030502010007 Content-Type: text/x-patch; name="17.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="17.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 03:14:38+01:00 kaber@coreworks.de # [PKT_SCHED]: tc actions: remove unnecessary locking for refcnt changes # # refcnt/bindcnt are only used in user context under the rtnl, no additional # locking is necessary. Besides it was only done in some places, so kill it. # # Signed-off-by: Patrick McHardy # # net/sched/police.c # 2005/01/10 03:14:31+01:00 kaber@coreworks.de +0 -2 # [PKT_SCHED]: tc actions: remove unnecessary locking for refcnt changes # # refcnt/bindcnt are only used in user context under the rtnl, no additional # locking is necessary. Besides it was only done in some places, so kill it. # # Signed-off-by: Patrick McHardy # # include/net/pkt_act.h # 2005/01/10 03:14:31+01:00 kaber@coreworks.de +1 -3 # [PKT_SCHED]: tc actions: remove unnecessary locking for refcnt changes # # refcnt/bindcnt are only used in user context under the rtnl, no additional # locking is necessary. Besides it was only done in some places, so kill it. # # Signed-off-by: Patrick McHardy # diff -Nru a/include/net/pkt_act.h b/include/net/pkt_act.h --- a/include/net/pkt_act.h 2005-01-10 06:22:58 +01:00 +++ b/include/net/pkt_act.h 2005-01-10 06:22:58 +01:00 @@ -222,13 +222,11 @@ { struct tcf_st *p = NULL; if (index && (p = tcf_hash_lookup(index)) != NULL) { - spin_lock(&p->lock); if (bind) { p->bindcnt++; p->refcnt++; } - spin_unlock(&p->lock); - a->priv = (void *) p; + a->priv = p; } return p; } diff -Nru a/net/sched/police.c b/net/sched/police.c --- a/net/sched/police.c 2005-01-10 06:22:58 +01:00 +++ b/net/sched/police.c 2005-01-10 06:22:58 +01:00 @@ -189,12 +189,10 @@ if (parm->index && (p = tcf_police_lookup(parm->index)) != NULL) { a->priv = p; - spin_lock(&p->lock); if (bind) { p->bindcnt += 1; p->refcnt += 1; } - spin_unlock(&p->lock); if (ovr) goto override; return ret; --------------060200080706030502010007-- From kaber@trash.net Sun Jan 9 23:38:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 23:39:08 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A7cPiM021380 for ; Sun, 9 Jan 2005 23:38:26 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Co5Mj-0005Sg-Qu; Mon, 10 Jan 2005 20:38:13 +0100 Message-ID: <41E2D9A5.4070006@trash.net> Date: Mon, 10 Jan 2005 20:38:13 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: jamal CC: Maillist netdev Subject: [PATCH PKT_SCHED 18/22]: ipt action: fix module refcnt underflow/mem leaks in tcf_ipt_cleanup Content-Type: multipart/mixed; boundary="------------070006030409040304080401" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 33 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------070006030409040304080401 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------070006030409040304080401 Content-Type: text/x-patch; name="18.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="18.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 03:28:14+01:00 kaber@coreworks.de # [PKT_SCHED]: ipt action: fix module refcnt underflow/mem leaks in tcf_ipt_cleanup # # Signed-off-by: Patrick McHardy # # net/sched/ipt.c # 2005/01/10 03:28:07+01:00 kaber@coreworks.de +22 -10 # [PKT_SCHED]: ipt action: fix module refcnt underflow/mem leaks in tcf_ipt_cleanup # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/ipt.c b/net/sched/ipt.c --- a/net/sched/ipt.c 2005-01-10 06:23:03 +01:00 +++ b/net/sched/ipt.c 2005-01-10 06:23:03 +01:00 @@ -92,6 +92,25 @@ } static int +tcf_ipt_release(struct tcf_ipt *p, int bind) +{ + int ret = 0; + if (p) { + if (bind) + p->bindcnt--; + p->refcnt--; + if (p->bindcnt <= 0 && p->refcnt <= 0) { + ipt_destroy_target(p->t); + kfree(p->tname); + kfree(p->t); + tcf_hash_destroy(p); + ret = ACT_P_DELETED; + } + } + return ret; +} + +static int tcf_ipt_init(struct rtattr *rta, struct rtattr *est, struct tc_action *a, int ovr, int bind) { @@ -129,7 +148,7 @@ ret = ACT_P_CREATED; } else { if (!ovr) { - tcf_hash_release(p, bind); + tcf_ipt_release(p, bind); return -EEXIST; } } @@ -178,15 +197,8 @@ static int tcf_ipt_cleanup(struct tc_action *a, int bind) { - struct tcf_ipt *p = PRIV(a,ipt); - - if (NULL != p) { - struct ipt_entry_target *t = p->t; - if (t && t->u.kernel.target) - module_put(t->u.kernel.target->me); - return tcf_hash_release(p, bind); - } - return 0; + struct tcf_ipt *p = PRIV(a, ipt); + return tcf_ipt_release(p, bind); } static int --------------070006030409040304080401-- From kaber@trash.net Sun Jan 9 23:38:23 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 23:39:02 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A7cMoq021292 for ; Sun, 9 Jan 2005 23:38:22 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Co5Mg-0005SY-Ef; Mon, 10 Jan 2005 20:38:10 +0100 Message-ID: <41E2D9A2.305@trash.net> Date: Mon, 10 Jan 2005 20:38:10 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: jamal CC: Maillist netdev Subject: [PATCH PKT_SCHED 16/22]: ipt action: fix missing unlock on error path Content-Type: multipart/mixed; boundary="------------080703090404030106050201" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 26 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------080703090404030106050201 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------080703090404030106050201 Content-Type: text/x-patch; name="16.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="16.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 02:54:57+01:00 kaber@coreworks.de # [PKT_SCHED]: ipt action: fix missing unlock on error path # # Simply kill the pskb_expand_head, iptables targets already take care # of cloned packets. # # Signed-off-by: Patrick McHardy # # net/sched/ipt.c # 2005/01/10 02:50:16+01:00 kaber@coreworks.de +0 -4 # [PKT_SCHED]: ipt_action: fix missing unlock on error path # # Simply kill the pskb_expand_head, iptables targets already take care # of cloned packets. # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/ipt.c b/net/sched/ipt.c --- a/net/sched/ipt.c 2005-01-10 06:22:53 +01:00 +++ b/net/sched/ipt.c 2005-01-10 06:22:53 +01:00 @@ -202,10 +202,6 @@ p->bstats.bytes += skb->len; p->bstats.packets++; - if (skb_cloned(skb) ) { - if (pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) - return -1; - } /* yes, we have to worry about both in and out dev worry later - danger - this API seems to have changed from earlier kernels */ --------------080703090404030106050201-- From kaber@trash.net Sun Jan 9 23:38:14 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 23:39:06 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A7cDHI021059 for ; Sun, 9 Jan 2005 23:38:13 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Co5MX-0005SE-FG; Mon, 10 Jan 2005 20:38:01 +0100 Message-ID: <41E2D999.2080107@trash.net> Date: Mon, 10 Jan 2005 20:38:01 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: jamal CC: Maillist netdev Subject: [PATCH PKT_SCHED 11/22]: gact action: fix multiple bugs in init path Content-Type: multipart/mixed; boundary="------------010700010109080507030301" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 29 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------010700010109080507030301 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------010700010109080507030301 Content-Type: text/x-patch; name="11.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="11.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 02:06:29+01:00 kaber@coreworks.de # [PKT_SCHED]: gact action: fix multiple bugs in init path # # - rta can be NULL # - Attribute sizes are not checked # - No locking when replacing an action # - The action is inserted into the hash before its parameters are set # # Also return proper error codes. # # Signed-off-by: Patrick McHardy # # # net/sched/gact.c # 2005/01/10 02:06:22+01:00 kaber@coreworks.de +34 -32 # [PKT_SCHED]: gact action: fix multiple bugs in init path # # - rta can be NULL # - Attribute sizes are not checked # - No locking when replacing an action # - The action is inserted into the hash before its parameters are set # # Also return proper error codes. # # Signed-off-by: Patrick McHardy # # # include/net/pkt_act.h # 2005/01/10 02:06:22+01:00 kaber@coreworks.de +10 -17 # [PKT_SCHED]: gact action: fix multiple bugs in init path # # - rta can be NULL # - Attribute sizes are not checked # - No locking when replacing an action # - The action is inserted into the hash before its parameters are set # # Also return proper error codes. # # Signed-off-by: Patrick McHardy # # diff -Nru a/include/net/pkt_act.h b/include/net/pkt_act.h --- a/include/net/pkt_act.h 2005-01-10 06:22:29 +01:00 +++ b/include/net/pkt_act.h 2005-01-10 06:22:29 +01:00 @@ -218,10 +218,10 @@ #ifdef CONFIG_NET_ACT_INIT static inline struct tcf_st * -tcf_hash_check(struct tc_st *parm, struct tc_action *a, int ovr, int bind) +tcf_hash_check(u32 index, struct tc_action *a, int ovr, int bind) { struct tcf_st *p = NULL; - if (parm->index && (p = tcf_hash_lookup(parm->index)) != NULL) { + if (index && (p = tcf_hash_lookup(index)) != NULL) { spin_lock(&p->lock); if (bind) { p->bindcnt++; @@ -234,9 +234,8 @@ } static inline struct tcf_st * -tcf_hash_create(struct tc_st *parm, struct rtattr *est, struct tc_action *a, int size, int ovr, int bind) +tcf_hash_create(u32 index, struct rtattr *est, struct tc_action *a, int size, int ovr, int bind) { - unsigned h; struct tcf_st *p = NULL; p = kmalloc(size, GFP_KERNEL); @@ -252,31 +251,25 @@ spin_lock_init(&p->lock); p->stats_lock = &p->lock; - p->index = parm->index ? : tcf_hash_new_index(); + p->index = index ? : tcf_hash_new_index(); p->tm.install = jiffies; p->tm.lastuse = jiffies; #ifdef CONFIG_NET_ESTIMATOR if (est) gen_new_estimator(&p->bstats, &p->rate_est, p->stats_lock, est); #endif - h = tcf_hash(p->index); - write_lock_bh(&tcf_t_lock); - p->next = tcf_ht[h]; - tcf_ht[h] = p; - write_unlock_bh(&tcf_t_lock); - a->priv = (void *) p; return p; } -static inline struct tcf_st * -tcf_hash_init(struct tc_st *parm, struct rtattr *est, struct tc_action *a, int size, int ovr, int bind) +static inline void tcf_hash_insert(struct tcf_st *p) { - struct tcf_st *p = tcf_hash_check (parm,a,ovr,bind); + unsigned h = tcf_hash(p->index); - if (!p) - p = tcf_hash_create(parm, est, a, size, ovr, bind); - return p; + write_lock_bh(&tcf_t_lock); + p->next = tcf_ht[h]; + tcf_ht[h] = p; + write_unlock_bh(&tcf_t_lock); } #endif diff -Nru a/net/sched/gact.c b/net/sched/gact.c --- a/net/sched/gact.c 2005-01-10 06:22:29 +01:00 +++ b/net/sched/gact.c 2005-01-10 06:22:29 +01:00 @@ -75,51 +75,53 @@ struct tc_action *a, int ovr, int bind) { struct rtattr *tb[TCA_GACT_MAX]; - struct tc_gact *parm = NULL; -#ifdef CONFIG_GACT_PROB - struct tc_gact_p *p_parm = NULL; -#endif - struct tcf_gact *p = NULL; + struct tc_gact *parm; + struct tcf_gact *p; int ret = 0; - if (rtattr_parse(tb, TCA_GACT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0) - return -1; - - if (tb[TCA_GACT_PARMS - 1] == NULL) { - printk("BUG: tcf_gact_init called with NULL params\n"); - return -1; - } + if (rta == NULL || + rtattr_parse(tb, TCA_GACT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0) + return -EINVAL; + if (tb[TCA_GACT_PARMS - 1] == NULL || + RTA_PAYLOAD(tb[TCA_GACT_PARMS - 1]) < sizeof(*parm)) + return -EINVAL; parm = RTA_DATA(tb[TCA_GACT_PARMS - 1]); + + if (tb[TCA_GACT_PROB-1] != NULL) #ifdef CONFIG_GACT_PROB - if (tb[TCA_GACT_PROB - 1] != NULL) - p_parm = RTA_DATA(tb[TCA_GACT_PROB - 1]); + if (RTA_PAYLOAD(tb[TCA_GACT_PROB-1]) < sizeof(struct tc_gact_p)) + return -EINVAL; +#else + return -EOPNOTSUPP; #endif - p = tcf_hash_check(parm, a, ovr, bind); + + p = tcf_hash_check(parm->index, a, ovr, bind); if (p == NULL) { - p = tcf_hash_create(parm, est, a, sizeof(*p), ovr, bind); + p = tcf_hash_create(parm->index, est, a, sizeof(*p), ovr, bind); if (p == NULL) - return -1; - else { - p->refcnt = 1; - ret = 1; - goto override; + return -ENOMEM; + ret = ACT_P_CREATED; + } else { + if (!ovr) { + tcf_hash_release(p, bind); + return -EEXIST; } } - if (ovr) { -override: - p->action = parm->action; + spin_lock_bh(&p->lock); + p->action = parm->action; #ifdef CONFIG_GACT_PROB - if (p_parm != NULL) { - p->paction = p_parm->paction; - p->pval = p_parm->pval; - p->ptype = p_parm->ptype; - } else { - p->paction = p->pval = p->ptype = 0; - } -#endif + if (tb[TCA_GACT_PROB-1] != NULL) { + struct tc_gact_p *p_parm = RTA_DATA(tb[TCA_GACT_PROB-1]); + p->paction = p_parm->paction; + p->pval = p_parm->pval; + p->ptype = p_parm->ptype; } +#endif + spin_unlock_bh(&p->lock); + if (ret == ACT_P_CREATED) + tcf_hash_insert(p); return ret; } --------------010700010109080507030301-- From kaber@trash.net Sun Jan 9 23:38:33 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 23:39:10 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A7cU23021488 for ; Sun, 9 Jan 2005 23:38:32 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Co5Mo-0005Ss-Lh; Mon, 10 Jan 2005 20:38:18 +0100 Message-ID: <41E2D9AA.6090709@trash.net> Date: Mon, 10 Jan 2005 20:38:18 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: jamal CC: Maillist netdev Subject: [PATCH PKT_SCHED 21/22]: act_api.c: sync multi action order processing Content-Type: multipart/mixed; boundary="------------090705080909070608000401" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 36 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------090705080909070608000401 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------090705080909070608000401 Content-Type: text/x-patch; name="21.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="21.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 06:08:56+01:00 kaber@coreworks.de # [PKT_SCHED]: act_api.c: sync multi action order processing # # Sync tcf_action_init and tca_action_gd. Rename a few variables # to make the code more easily understandable and rename the # rtattr_failure/nlmsg_failure labels. These are usually called # from the netlink macros, it is misleading to use them in a # larger function without actually using netlink macros. # # Multi action orders were processed differently before, # tcf_action_init skipped empty ones while tca_action_gd stopped # at the first empty one. This patch makes both stop at the first # empty one. # # Signed-off-by: Patrick McHardy # # net/sched/act_api.c # 2005/01/10 06:08:50+01:00 kaber@coreworks.de +35 -51 # [PKT_SCHED]: act_api.c: sync multi action order processing # # Sync tcf_action_init and tca_action_gd. Rename a few variables # to make the code more easily understandable and rename the # rtattr_failure/nlmsg_failure labels. These are usually called # from the netlink macros, it is misleading to use them in a # larger function without actually using netlink macros. # # Multi action orders were processed differently before, # tcf_action_init skipped empty ones while tca_action_gd stopped # at the first empty one. This patch makes both stop at the first # empty one. # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/act_api.c b/net/sched/act_api.c --- a/net/sched/act_api.c 2005-01-10 06:23:17 +01:00 +++ b/net/sched/act_api.c 2005-01-10 06:23:17 +01:00 @@ -341,36 +341,32 @@ char *name, int ovr, int bind, int *err) { struct rtattr *tb[TCA_ACT_MAX_PRIO+1]; - struct tc_action *a = NULL, *act, *act_prev = NULL; + struct tc_action *head = NULL, *act, *act_prev = NULL; int i; if (rtattr_parse(tb, TCA_ACT_MAX_PRIO, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0) { *err = -EINVAL; - return a; + return head; } - for (i=0; i < TCA_ACT_MAX_PRIO; i++) { - if (tb[i]) { - act = tcf_action_init_1(tb[i], est, name, ovr, bind, - err); - if (act == NULL) - goto bad_ret; - - act->order = i+1; - if (a == NULL) - a = act; - else - act_prev->next = act; - act_prev = act; - } - - } - return a; + for (i=0; i < TCA_ACT_MAX_PRIO && tb[i]; i++) { + act = tcf_action_init_1(tb[i], est, name, ovr, bind, err); + if (act == NULL) + goto err; + act->order = i+1; -bad_ret: - if (a != NULL) - tcf_action_destroy(a, bind); + if (head == NULL) + head = act; + else + act_prev->next = act; + act_prev = act; + } + return head; + +err: + if (head != NULL) + tcf_action_destroy(head, bind); return NULL; } @@ -600,71 +596,59 @@ tca_action_gd(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int event) { int i, ret = 0; - struct tc_action *act; struct rtattr *tb[TCA_ACT_MAX_PRIO+1]; - struct tc_action *a = NULL, *a_s = NULL; - - if (event != RTM_GETACTION && event != RTM_DELACTION) - ret = -EINVAL; + struct tc_action *head = NULL, *act, *act_prev = NULL; if (rtattr_parse(tb, TCA_ACT_MAX_PRIO, RTA_DATA(rta), - RTA_PAYLOAD(rta)) < 0) { - ret = -EINVAL; - goto nlmsg_failure; - } + RTA_PAYLOAD(rta)) < 0) + return -EINVAL; if (event == RTM_DELACTION && n->nlmsg_flags&NLM_F_ROOT) { if (tb[0] != NULL && tb[1] == NULL) return tca_action_flush(tb[0], n, pid); } - for (i=0; i < TCA_ACT_MAX_PRIO; i++) { - if (tb[i] == NULL) - break; + for (i=0; i < TCA_ACT_MAX_PRIO && tb[i]; i++) { act = tcf_action_get_1(tb[i], n, pid, &ret); if (act == NULL) - goto rtattr_failure; + goto err; act->order = i+1; - if (a != NULL) { - a->next = act; - a = act; - } else - a = act; - - if (a_s == NULL) - a_s = a; + if (head == NULL) + head = act; + else + act_prev->next = act; + act_prev = act; } if (event == RTM_GETACTION) - ret = act_get_notify(pid, n, a_s, event); + ret = act_get_notify(pid, n, head, event); else { /* delete */ struct sk_buff *skb; skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); if (!skb) { ret = -ENOBUFS; - goto nlmsg_failure; + goto err; } - if (tca_get_fill(skb, a_s, pid, n->nlmsg_seq, 0, event, + if (tca_get_fill(skb, head, pid, n->nlmsg_seq, 0, event, 0, 1) <= 0) { kfree_skb(skb); ret = -EINVAL; - goto nlmsg_failure; + goto err; } /* now do the delete */ - tcf_action_destroy(a_s, 0); + tcf_action_destroy(head, 0); ret = rtnetlink_send(skb, pid, RTMGRP_TC, n->nlmsg_flags&NLM_F_ECHO); if (ret > 0) return 0; return ret; } -rtattr_failure: -nlmsg_failure: - cleanup_a(a_s); +err: + cleanup_a(head); return ret; } --------------090705080909070608000401-- From kaber@trash.net Sun Jan 9 23:38:19 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 23:39:04 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A7cI4U021190 for ; Sun, 9 Jan 2005 23:38:19 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Co5Mc-0005SQ-T6; Mon, 10 Jan 2005 20:38:06 +0100 Message-ID: <41E2D99E.3060704@trash.net> Date: Mon, 10 Jan 2005 20:38:06 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: jamal CC: Maillist netdev Subject: [PATCH PKT_SCHED 14/22]: pedit action: fix multiple bugs in init path Content-Type: multipart/mixed; boundary="------------050207030106090207020901" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 28 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------050207030106090207020901 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------050207030106090207020901 Content-Type: text/x-patch; name="14.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="14.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 02:34:15+01:00 kaber@coreworks.de # [PKT_SCHED]: pedit action: fix multiple bugs in init path # # - Return proper error codes # - Attribute sizes are not checked # - rta may by NULL # - The action is inserted into the hash before its parameters are set # - replacement happens without locking # - no reallocation on replacement for possibly changed numbers of keys # # Signed-off-by: Patrick McHardy # # net/sched/pedit.c # 2005/01/10 02:34:07+01:00 kaber@coreworks.de +53 -28 # [PKT_SCHED]: pedit action: fix multiple bugs in init path # # - Return proper error codes # - Attribute sizes are not checked # - rta may by NULL # - The action is inserted into the hash before its parameters are set # - replacement happens without locking # - no reallocation on replacement for possibly changed numbers of keys # # Signed-off-by: Patrick McHardy # # include/net/tc_act/tc_pedit.h # 2005/01/10 02:34:07+01:00 kaber@coreworks.de +1 -1 # [PKT_SCHED]: pedit action: fix multiple bugs in init path # # - Return proper error codes # - Attribute sizes are not checked # - rta may by NULL # - The action is inserted into the hash before its parameters are set # - replacement happens without locking # - no reallocation on replacement for possibly changed numbers of keys # # Signed-off-by: Patrick McHardy # diff -Nru a/include/net/tc_act/tc_pedit.h b/include/net/tc_act/tc_pedit.h --- a/include/net/tc_act/tc_pedit.h 2005-01-10 06:22:44 +01:00 +++ b/include/net/tc_act/tc_pedit.h 2005-01-10 06:22:44 +01:00 @@ -8,7 +8,7 @@ tca_gen(pedit); unsigned char nkeys; unsigned char flags; - struct tc_pedit_key keys[0]; + struct tc_pedit_key *keys; }; #endif diff -Nru a/net/sched/pedit.c b/net/sched/pedit.c --- a/net/sched/pedit.c 2005-01-10 06:22:44 +01:00 +++ b/net/sched/pedit.c 2005-01-10 06:22:44 +01:00 @@ -58,40 +58,60 @@ { struct rtattr *tb[TCA_PEDIT_MAX]; struct tc_pedit *parm; - int size = 0; int ret = 0; struct tcf_pedit *p; + struct tc_pedit_key *keys = NULL; + int ksize; - if (rtattr_parse(tb, TCA_PEDIT_MAX, RTA_DATA(rta), - RTA_PAYLOAD(rta)) < 0) - return -1; - if (tb[TCA_PEDIT_PARMS - 1] == NULL) { - printk("BUG: tcf_pedit_init called with NULL params\n"); - return -1; - } + if (rta == NULL || rtattr_parse(tb, TCA_PEDIT_MAX, RTA_DATA(rta), + RTA_PAYLOAD(rta)) < 0) + return -EINVAL; + + if (tb[TCA_PEDIT_PARMS - 1] == NULL || + RTA_PAYLOAD(tb[TCA_PEDIT_PARMS-1]) < sizeof(*parm)) + return -EINVAL; + parm = RTA_DATA(tb[TCA_PEDIT_PARMS-1]); + ksize = parm->nkeys * sizeof(struct tc_pedit_key); + if (RTA_PAYLOAD(tb[TCA_PEDIT_PARMS-1]) < sizeof(*parm) + ksize) + return -EINVAL; - parm = RTA_DATA(tb[TCA_PEDIT_PARMS - 1]); - p = tcf_hash_check(parm, a, ovr, bind); - if (p == NULL) { /* new */ + p = tcf_hash_check(parm->index, a, ovr, bind); + if (p == NULL) { if (!parm->nkeys) - return -1; - size = sizeof(*p) + parm->nkeys * sizeof(struct tc_pedit_key); - p = tcf_hash_create(parm, est, a, size, ovr, bind); + return -EINVAL; + p = tcf_hash_create(parm->index, est, a, sizeof(*p), ovr, bind); if (p == NULL) - return -1; - ret = 1; - goto override; - } - - if (ovr) { -override: - p->flags = parm->flags; - p->nkeys = parm->nkeys; - p->action = parm->action; - memcpy(p->keys, parm->keys, - parm->nkeys * sizeof(struct tc_pedit_key)); + return -ENOMEM; + keys = kmalloc(ksize, GFP_KERNEL); + if (keys == NULL) { + kfree(p); + return -ENOMEM; + } + ret = ACT_P_CREATED; + } else { + if (!ovr) { + tcf_hash_release(p, bind); + return -EEXIST; + } + if (p->nkeys && p->nkeys != parm->nkeys) { + keys = kmalloc(ksize, GFP_KERNEL); + if (keys == NULL) + return -ENOMEM; + } } + spin_lock_bh(&p->lock); + p->flags = parm->flags; + p->action = parm->action; + if (keys) { + kfree(p->keys); + p->keys = keys; + p->nkeys = parm->nkeys; + } + memcpy(p->keys, parm->keys, ksize); + spin_unlock_bh(&p->lock); + if (ret == ACT_P_CREATED) + tcf_hash_insert(p); return ret; } @@ -100,8 +120,13 @@ { struct tcf_pedit *p = PRIV(a, pedit); - if (NULL != p) - return tcf_hash_release(p, bind); + if (p != NULL) { + struct tc_pedit_key *keys = p->keys; + if (tcf_hash_release(p, bind)) { + kfree(keys); + return 1; + } + } return 0; } --------------050207030106090207020901-- From kaber@trash.net Sun Jan 9 23:38:17 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 23:39:01 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A7cFHQ021106 for ; Sun, 9 Jan 2005 23:38:15 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Co5MZ-0005SI-Fn; Mon, 10 Jan 2005 20:38:03 +0100 Message-ID: <41E2D99B.3040100@trash.net> Date: Mon, 10 Jan 2005 20:38:03 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: jamal CC: Maillist netdev Subject: [PATCH PKT_SCHED 12/22]: ipt action: fix multiple bugs in init path Content-Type: multipart/mixed; boundary="------------090604020609090608000005" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 25 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------090604020609090608000005 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------090604020609090608000005 Content-Type: text/x-patch; name="12.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="12.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 02:10:14+01:00 kaber@coreworks.de # [PKT_SCHED]: ipt action: fix multiple bugs in init path # # - Return proper error codes # - Attribute sizes are not checked # - rta may be NULL # - Several leaks and locking errors # - When replacement fails the old action is freed while in use # # This patch makes replacement atomic, so the old action is either # replaced entirely or not touched at all. # # Signed-off-by: Patrick McHardy # # net/sched/ipt.c # 2005/01/10 02:10:08+01:00 kaber@coreworks.de +80 -122 # [PKT_SCHED]: ipt action: fix multiple bugs in init path # # - Return proper error codes # - Attribute sizes are not checked # - rta may be NULL # - Several leaks and locking errors # - When replacement fails the old action is freed while in use # # This patch makes replacement atomic, so the old action is either # replaced entirely or not touched at all. # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/ipt.c b/net/sched/ipt.c --- a/net/sched/ipt.c 2005-01-10 06:22:34 +01:00 +++ b/net/sched/ipt.c 2005-01-10 06:22:34 +01:00 @@ -53,29 +53,27 @@ #define tcf_t_lock ipt_lock #define tcf_ht tcf_ipt_ht +#define CONFIG_NET_ACT_INIT #include -static inline int -init_targ(struct tcf_ipt *p) +static int +ipt_init_target(struct ipt_entry_target *t, char *table, unsigned int hook) { struct ipt_target *target; int ret = 0; - struct ipt_entry_target *t = p->t; target = ipt_find_target(t->u.user.name, t->u.user.revision); - if (!target) { - printk("init_targ: Failed to find %s\n", t->u.user.name); - return -1; - } + if (!target) + return -ENOENT; - DPRINTK("init_targ: found %s\n", target->name); + DPRINTK("ipt_init_target: found %s\n", target->name); t->u.kernel.target = target; if (t->u.kernel.target->checkentry - && !t->u.kernel.target->checkentry(p->tname, NULL, t->data, + && !t->u.kernel.target->checkentry(table, NULL, t->data, t->u.target_size - sizeof(*t), - p->hook)) { - DPRINTK("ip_tables: check failed for `%s'.\n", + hook)) { + DPRINTK("ipt_init_target: check failed for `%s'.\n", t->u.kernel.target->name); module_put(t->u.kernel.target->me); ret = -EINVAL; @@ -84,137 +82,97 @@ return ret; } +static void +ipt_destroy_target(struct ipt_entry_target *t) +{ + if (t->u.kernel.target->destroy) + t->u.kernel.target->destroy(t->data, + t->u.target_size - sizeof(*t)); + module_put(t->u.kernel.target->me); +} + static int tcf_ipt_init(struct rtattr *rta, struct rtattr *est, struct tc_action *a, int ovr, int bind) { - struct ipt_entry_target *t; - unsigned h; struct rtattr *tb[TCA_IPT_MAX]; struct tcf_ipt *p; - int ret = 0; - u32 index = 0; + struct ipt_entry_target *td, *t; + char *tname; + int ret = 0, err; u32 hook = 0; + u32 index = 0; if (rta == NULL || rtattr_parse(tb, TCA_IPT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0) - return -1; - - if (tb[TCA_IPT_INDEX - 1]) { - index = *(u32 *) RTA_DATA(tb[TCA_IPT_INDEX - 1]); - DPRINTK("ipt index %d\n", index); - } - - if (index && (p = tcf_hash_lookup(index)) != NULL) { - a->priv = (void *) p; - spin_lock(&p->lock); - if (bind) { - p->bindcnt += 1; - p->refcnt += 1; - } - if (ovr) - goto override; - spin_unlock(&p->lock); - return ret; - } + return -EINVAL; - if (tb[TCA_IPT_TARG - 1] == NULL || tb[TCA_IPT_HOOK - 1] == NULL) - return -1; - - p = kmalloc(sizeof(*p), GFP_KERNEL); - if (p == NULL) - return -1; - memset(p, 0, sizeof(*p)); - p->refcnt = 1; - ret = 1; - spin_lock_init(&p->lock); - p->stats_lock = &p->lock; - if (bind) - p->bindcnt = 1; - -override: - hook = *(u32 *) RTA_DATA(tb[TCA_IPT_HOOK - 1]); - - t = (struct ipt_entry_target *) RTA_DATA(tb[TCA_IPT_TARG - 1]); - - p->t = kmalloc(t->u.target_size, GFP_KERNEL); - if (p->t == NULL) { - if (ovr) { - printk("ipt policy messed up \n"); - spin_unlock(&p->lock); - return -1; - } - kfree(p); - return -1; - } - - memcpy(p->t, RTA_DATA(tb[TCA_IPT_TARG - 1]), t->u.target_size); - DPRINTK(" target NAME %s size %d data[0] %x data[1] %x\n", - t->u.user.name, t->u.target_size, t->data[0], t->data[1]); - - p->tname = kmalloc(IFNAMSIZ, GFP_KERNEL); - - if (p->tname == NULL) { - if (ovr) { - printk("ipt policy messed up 2 \n"); - spin_unlock(&p->lock); - return -1; - } - kfree(p->t); - kfree(p); - return -1; + if (tb[TCA_IPT_HOOK-1] == NULL || + RTA_PAYLOAD(tb[TCA_IPT_HOOK-1]) < sizeof(u32)) + return -EINVAL; + if (tb[TCA_IPT_TARG-1] == NULL || + RTA_PAYLOAD(tb[TCA_IPT_TARG-1]) < sizeof(*t)) + return -EINVAL; + td = (struct ipt_entry_target *)RTA_DATA(tb[TCA_IPT_TARG-1]); + if (RTA_PAYLOAD(tb[TCA_IPT_TARG-1]) < td->u.target_size) + return -EINVAL; + + if (tb[TCA_IPT_INDEX-1] != NULL && + RTA_PAYLOAD(tb[TCA_IPT_INDEX-1]) >= sizeof(u32)) + index = *(u32 *)RTA_DATA(tb[TCA_IPT_INDEX-1]); + + p = tcf_hash_check(index, a, ovr, bind); + if (p == NULL) { + p = tcf_hash_create(index, est, a, sizeof(*p), ovr, bind); + if (p == NULL) + return -ENOMEM; + ret = ACT_P_CREATED; } else { - int csize = IFNAMSIZ - 1; - - memset(p->tname, 0, IFNAMSIZ); - if (tb[TCA_IPT_TABLE - 1]) { - if (strlen((char *) RTA_DATA(tb[TCA_IPT_TABLE - 1])) < - csize) - csize = strlen(RTA_DATA(tb[TCA_IPT_TABLE - 1])); - strncpy(p->tname, RTA_DATA(tb[TCA_IPT_TABLE - 1]), - csize); - DPRINTK("table name %s\n", p->tname); - } else { - strncpy(p->tname, "mangle", 1 + strlen("mangle")); + if (!ovr) { + tcf_hash_release(p, bind); + return -EEXIST; } } - if (init_targ(p) < 0) { - if (ovr) { - printk("ipt policy messed up 2 \n"); - spin_unlock(&p->lock); - return -1; - } + hook = *(u32 *)RTA_DATA(tb[TCA_IPT_HOOK-1]); + + err = -ENOMEM; + tname = kmalloc(IFNAMSIZ, GFP_KERNEL); + if (tname == NULL) + goto err1; + if (tb[TCA_IPT_TABLE - 1] == NULL || + rtattr_strlcpy(tname, tb[TCA_IPT_TABLE-1], IFNAMSIZ) >= IFNAMSIZ) + strcpy(tname, "mangle"); + + t = kmalloc(td->u.target_size, GFP_KERNEL); + if (t == NULL) + goto err2; + memcpy(t, td, td->u.target_size); + + if ((err = ipt_init_target(t, tname, hook)) < 0) + goto err3; + + spin_lock_bh(&p->lock); + if (ret != ACT_P_CREATED) { + ipt_destroy_target(p->t); kfree(p->tname); kfree(p->t); - kfree(p); - return -1; - } - - if (ovr) { - spin_unlock(&p->lock); - return -1; } - - p->index = index ? : tcf_hash_new_index(); - - p->tm.lastuse = jiffies; - /* - p->tm.expires = jiffies; - */ - p->tm.install = jiffies; -#ifdef CONFIG_NET_ESTIMATOR - if (est) - gen_new_estimator(&p->bstats, &p->rate_est, p->stats_lock, est); -#endif - h = tcf_hash(p->index); - write_lock_bh(&ipt_lock); - p->next = tcf_ipt_ht[h]; - tcf_ipt_ht[h] = p; - write_unlock_bh(&ipt_lock); - a->priv = p; + p->tname = tname; + p->t = t; + p->hook = hook; + spin_unlock_bh(&p->lock); + if (ret == ACT_P_CREATED) + tcf_hash_insert(p); return ret; +err3: + kfree(t); +err2: + kfree(tname); +err1: + kfree(p); + return err; } static int --------------090604020609090608000005-- From kaber@trash.net Sun Jan 9 23:38:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 23:39:09 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A7cS1O021460 for ; Sun, 9 Jan 2005 23:38:29 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Co5Mn-0005So-14; Mon, 10 Jan 2005 20:38:17 +0100 Message-ID: <41E2D9A8.9080003@trash.net> Date: Mon, 10 Jan 2005 20:38:16 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: jamal CC: Maillist netdev Subject: [PATCH PKT_SCHED 20/22]: act_api.c: push memory allocation to tcf_action_get_1 Content-Type: multipart/mixed; boundary="------------040200000705010208020307" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 34 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------040200000705010208020307 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------040200000705010208020307 Content-Type: text/x-patch; name="20.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="20.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 05:47:32+01:00 kaber@coreworks.de # [PKT_SCHED]: act_api.c: push memory allocation to tcf_action_get_1 # # Signed-off-by: Patrick McHardy # # net/sched/act_api.c # 2005/01/10 05:47:25+01:00 kaber@coreworks.de +30 -18 # [PKT_SCHED]: act_api.c: push memory allocation to tcf_action_get_1 # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/act_api.c b/net/sched/act_api.c --- a/net/sched/act_api.c 2005-01-10 06:23:12 +01:00 +++ b/net/sched/act_api.c 2005-01-10 06:23:12 +01:00 @@ -463,31 +463,46 @@ return err; } -static int tcf_action_get_1(struct rtattr *rta, struct tc_action *a, - struct nlmsghdr *n, u32 pid) +static struct tc_action * +tcf_action_get_1(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int *err) { struct rtattr *tb[TCA_ACT_MAX+1]; + struct tc_action *a; int index; - int err = 0; + *err = -EINVAL; if (rtattr_parse(tb, TCA_ACT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0) - return -EINVAL; + return NULL; if (tb[TCA_ACT_INDEX - 1] == NULL || RTA_PAYLOAD(tb[TCA_ACT_INDEX - 1]) < sizeof(index)) - return -EINVAL; + return NULL; index = *(int *)RTA_DATA(tb[TCA_ACT_INDEX - 1]); + *err = -ENOMEM; + a = kmalloc(sizeof(struct tc_action), GFP_KERNEL); + if (a == NULL) + return NULL; + memset(a, 0, sizeof(struct tc_action)); + + *err = -EINVAL; a->ops = tc_lookup_action(tb[TCA_ACT_KIND - 1]); if (a->ops == NULL) - return -EINVAL; + goto err_free; if (a->ops->lookup == NULL) - err = -EINVAL; - else if (a->ops->lookup(a, index) == 0) - err = -ENOENT; + goto err_mod; + *err = -ENOENT; + if (a->ops->lookup(a, index) == 0) + goto err_mod; module_put(a->ops->owner); - return err; + *err = 0; + return a; +err_mod: + module_put(a->ops->owner); +err_free: + kfree(a); + return NULL; } static void cleanup_a(struct tc_action *act) @@ -606,7 +621,11 @@ for (i=0; i < TCA_ACT_MAX_PRIO; i++) { if (tb[i] == NULL) break; - act = create_a(i+1); + act = tcf_action_get_1(tb[i], n, pid, &ret); + if (act == NULL) + goto rtattr_failure; + act->order = i+1; + if (a != NULL) { a->next = act; a = act; @@ -615,13 +634,6 @@ if (a_s == NULL) a_s = a; - - ret = tcf_action_get_1(tb[i], act, n, pid); - if (ret < 0) { - printk("tcf_action_get: failed to get!\n"); - ret = -EINVAL; - goto rtattr_failure; - } } if (event == RTM_GETACTION) --------------040200000705010208020307-- From kaber@trash.net Sun Jan 9 23:38:18 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 23:39:03 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A7cHLj021154 for ; Sun, 9 Jan 2005 23:38:17 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Co5Mb-0005SM-5s; Mon, 10 Jan 2005 20:38:05 +0100 Message-ID: <41E2D99D.5000102@trash.net> Date: Mon, 10 Jan 2005 20:38:05 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: jamal CC: Maillist netdev Subject: [PATCH PKT_SCHED 13/22]: mirred action: fix multiple bugs in init path Content-Type: multipart/mixed; boundary="------------080007020007070900030002" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 27 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------080007020007070900030002 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------080007020007070900030002 Content-Type: text/x-patch; name="13.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="13.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 02:19:52+01:00 kaber@coreworks.de # [PKT_SCHED]: mirred action: fix multiple bugs in init path # # - Return proper error codes # - Attribute sizes are not checked # - rta may by NULL # - The action is inserted into the hash before its parameters are set # - action in hash is freed on error path # - action is modified outside of the locked section # # This patch makes replacement atomic, so the old action is either # replaced entirely or not touched at all. # # Signed-off-by: Patrick McHardy # # net/sched/mirred.c # 2005/01/10 02:19:45+01:00 kaber@coreworks.de +43 -45 # [PKT_SCHED]: mirred action: fix multiple bugs in init path # # - Return proper error codes # - Attribute sizes are not checked # - rta may by NULL # - The action is inserted into the hash before its parameters are set # - action in hash is freed on error path # - action is modified outside of the locked section # # This patch makes replacement atomic, so the old action is either # replaced entirely or not touched at all. # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/mirred.c b/net/sched/mirred.c --- a/net/sched/mirred.c 2005-01-10 06:22:39 +01:00 +++ b/net/sched/mirred.c 2005-01-10 06:22:39 +01:00 @@ -81,36 +81,22 @@ struct tc_mirred *parm; struct tcf_mirred *p; struct net_device *dev = NULL; - int size = sizeof(*p), new = 0; + int ret = 0; + int ok_push = 0; - if (rtattr_parse(tb, TCA_MIRRED_MAX, RTA_DATA(rta), - RTA_PAYLOAD(rta)) < 0) { - DPRINTK("tcf_mirred_init BUG in user space couldnt parse " - "properly\n"); - return -1; - } - - if (tb[TCA_MIRRED_PARMS - 1] == NULL) { - DPRINTK("BUG: tcf_mirred_init called with NULL params\n"); - return -1; - } - - parm = RTA_DATA(tb[TCA_MIRRED_PARMS - 1]); - - p = tcf_hash_check(parm, a, ovr, bind); - if (p == NULL) { /* new */ - p = tcf_hash_create(parm, est, a, size, ovr, bind); - if (p == NULL) - return -1; - new = 1; - } + if (rta == NULL || rtattr_parse(tb, TCA_MIRRED_MAX, RTA_DATA(rta), + RTA_PAYLOAD(rta)) < 0) + return -EINVAL; + + if (tb[TCA_MIRRED_PARMS-1] == NULL || + RTA_PAYLOAD(tb[TCA_MIRRED_PARMS-1]) < sizeof(*parm)) + return -EINVAL; + parm = RTA_DATA(tb[TCA_MIRRED_PARMS-1]); if (parm->ifindex) { - dev = dev_get_by_index(parm->ifindex); - if (dev == NULL) { - printk("BUG: tcf_mirred_init called with bad device\n"); - return -1; - } + dev = __dev_get_by_index(parm->ifindex); + if (dev == NULL) + return -ENODEV; switch (dev->type) { case ARPHRD_TUNNEL: case ARPHRD_TUNNEL6: @@ -118,36 +104,48 @@ case ARPHRD_IPGRE: case ARPHRD_VOID: case ARPHRD_NONE: - p->ok_push = 0; + ok_push = 0; break; default: - p->ok_push = 1; + ok_push = 1; break; } - } else { - if (new) { - kfree(p); - return -1; - } } - if (new || ovr) { - spin_lock(&p->lock); - p->action = parm->action; - p->eaction = parm->eaction; - if (parm->ifindex) { - p->ifindex = parm->ifindex; - if (ovr) - dev_put(p->dev); - p->dev = dev; + p = tcf_hash_check(parm->index, a, ovr, bind); + if (p == NULL) { + if (!parm->ifindex) + return -EINVAL; + p = tcf_hash_create(parm->index, est, a, sizeof(*p), ovr, bind); + if (p == NULL) + return -ENOMEM; + ret = ACT_P_CREATED; + } else { + if (!ovr) { + tcf_mirred_release(p, bind); + return -EEXIST; } - spin_unlock(&p->lock); } + spin_lock(&p->lock); + p->action = parm->action; + p->eaction = parm->eaction; + if (parm->ifindex) { + p->ifindex = parm->ifindex; + if (ret != ACT_P_CREATED) + dev_put(p->dev); + p->dev = dev; + dev_hold(dev); + p->ok_push = ok_push; + } + spin_unlock(&p->lock); + if (ret == ACT_P_CREATED) + tcf_hash_insert(p); + DPRINTK("tcf_mirred_init index %d action %d eaction %d device %s " "ifindex %d\n", parm->index, parm->action, parm->eaction, dev->name, parm->ifindex); - return new; + return ret; } static int --------------080007020007070900030002-- From kaber@trash.net Sun Jan 9 23:38:33 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 23:39:11 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A7cWJD021520 for ; Sun, 9 Jan 2005 23:38:32 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Co5Mq-0005Sw-HO; Mon, 10 Jan 2005 20:38:20 +0100 Message-ID: <41E2D9AC.6020200@trash.net> Date: Mon, 10 Jan 2005 20:38:20 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: jamal CC: Maillist netdev Subject: [PATCH PKT_SCHED 22/22]: Don't export ing_filter Content-Type: multipart/mixed; boundary="------------070207040900080702020703" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 37 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------070207040900080702020703 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------070207040900080702020703 Content-Type: text/x-patch; name="22.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="22.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/10 06:10:27+01:00 kaber@coreworks.de # [PKT_SCHED]: Don't export ing_filter # # Signed-off-by: Patrick McHardy # # net/core/dev.c # 2005/01/10 06:10:20+01:00 kaber@coreworks.de +0 -5 # [PKT_SCHED]: Don't export ing_filter # # Signed-off-by: Patrick McHardy # # include/net/pkt_cls.h # 2005/01/10 06:10:20+01:00 kaber@coreworks.de +0 -1 # [PKT_SCHED]: Don't export ing_filter # # Signed-off-by: Patrick McHardy # diff -Nru a/include/net/pkt_cls.h b/include/net/pkt_cls.h --- a/include/net/pkt_cls.h 2005-01-10 06:23:22 +01:00 +++ b/include/net/pkt_cls.h 2005-01-10 06:23:22 +01:00 @@ -17,7 +17,6 @@ extern int register_tcf_proto_ops(struct tcf_proto_ops *ops); extern int unregister_tcf_proto_ops(struct tcf_proto_ops *ops); -extern int ing_filter(struct sk_buff *skb); static inline unsigned long __cls_set_class(unsigned long *clp, unsigned long cl) diff -Nru a/net/core/dev.c b/net/core/dev.c --- a/net/core/dev.c 2005-01-10 06:23:22 +01:00 +++ b/net/core/dev.c 2005-01-10 06:23:22 +01:00 @@ -3346,9 +3346,4 @@ EXPORT_SYMBOL(dev_load); #endif -#ifdef CONFIG_NET_CLS_ACT -EXPORT_SYMBOL(ing_filter); -#endif - - EXPORT_PER_CPU_SYMBOL(softnet_data); --------------070207040900080702020703-- From kaber@trash.net Sun Jan 9 23:38:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 23:39:08 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A7c9aN021013 for ; Sun, 9 Jan 2005 23:38:10 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Co5MT-0005S6-S7; Mon, 10 Jan 2005 20:37:57 +0100 Message-ID: <41E2D995.4000501@trash.net> Date: Mon, 10 Jan 2005 20:37:57 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: jamal CC: Maillist netdev Subject: [PATCH PKT_SCHED 9/22]: tc actions: whitespace and coding style cleanup Content-Type: multipart/mixed; boundary="------------030809080002090402080508" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 32 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------030809080002090402080508 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------030809080002090402080508 Content-Type: text/x-patch; name="09.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="09.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/09 23:35:01+01:00 kaber@coreworks.de # [PKT_SCHED]: tc actions: whitespace and coding style cleanup # # Signed-off-by: Patrick McHardy # # net/sched/police.c # 2005/01/09 23:34:55+01:00 kaber@coreworks.de +49 -48 # [PKT_SCHED]: tc actions: whitespace and coding style cleanup # # Signed-off-by: Patrick McHardy # # net/sched/pedit.c # 2005/01/09 23:34:55+01:00 kaber@coreworks.de +36 -52 # [PKT_SCHED]: tc actions: whitespace and coding style cleanup # # Signed-off-by: Patrick McHardy # # net/sched/mirred.c # 2005/01/09 23:34:55+01:00 kaber@coreworks.de +48 -58 # [PKT_SCHED]: tc actions: whitespace and coding style cleanup # # Signed-off-by: Patrick McHardy # # net/sched/ipt.c # 2005/01/09 23:34:55+01:00 kaber@coreworks.de +28 -41 # [PKT_SCHED]: tc actions: whitespace and coding style cleanup # # Signed-off-by: Patrick McHardy # # net/sched/gact.c # 2005/01/09 23:34:55+01:00 kaber@coreworks.de +35 -47 # [PKT_SCHED]: tc actions: whitespace and coding style cleanup # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/gact.c b/net/sched/gact.c --- a/net/sched/gact.c 2005-01-10 06:22:20 +01:00 +++ b/net/sched/gact.c 2005-01-10 06:22:20 +01:00 @@ -38,41 +38,41 @@ /* use generic hash table */ #define MY_TAB_SIZE 16 #define MY_TAB_MASK 15 + static u32 idx_gen; static struct tcf_gact *tcf_gact_ht[MY_TAB_SIZE]; static rwlock_t gact_lock = RW_LOCK_UNLOCKED; /* ovewrride the defaults */ -#define tcf_st tcf_gact -#define tc_st tc_gact -#define tcf_t_lock gact_lock -#define tcf_ht tcf_gact_ht +#define tcf_st tcf_gact +#define tc_st tc_gact +#define tcf_t_lock gact_lock +#define tcf_ht tcf_gact_ht #define CONFIG_NET_ACT_INIT 1 #include #ifdef CONFIG_GACT_PROB -typedef int (*g_rand)(struct tcf_gact *p); -static int -gact_net_rand(struct tcf_gact *p) { +static int gact_net_rand(struct tcf_gact *p) +{ if (net_random()%p->pval) return p->action; return p->paction; } -static int -gact_determ(struct tcf_gact *p) { +static int gact_determ(struct tcf_gact *p) +{ if (p->bstats.packets%p->pval) return p->action; return p->paction; } - -static g_rand gact_rand[MAX_RAND]= { NULL,gact_net_rand, gact_determ}; - +typedef int (*g_rand)(struct tcf_gact *p); +static g_rand gact_rand[MAX_RAND]= { NULL, gact_net_rand, gact_determ }; #endif -static int -tcf_gact_init(struct rtattr *rta, struct rtattr *est, struct tc_action *a,int ovr,int bind) + +static int tcf_gact_init(struct rtattr *rta, struct rtattr *est, + struct tc_action *a, int ovr, int bind) { struct rtattr *tb[TCA_GACT_MAX]; struct tc_gact *parm = NULL; @@ -81,31 +81,26 @@ #endif struct tcf_gact *p = NULL; int ret = 0; - int size = sizeof (*p); if (rtattr_parse(tb, TCA_GACT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0) return -1; - if (NULL == a || NULL == tb[TCA_GACT_PARMS - 1]) { + if (a == NULL || tb[TCA_GACT_PARMS - 1] == NULL) { printk("BUG: tcf_gact_init called with NULL params\n"); return -1; } parm = RTA_DATA(tb[TCA_GACT_PARMS - 1]); #ifdef CONFIG_GACT_PROB - if (NULL != tb[TCA_GACT_PROB - 1]) { + if (tb[TCA_GACT_PROB - 1] != NULL) p_parm = RTA_DATA(tb[TCA_GACT_PROB - 1]); - } #endif - p = tcf_hash_check(parm, a, ovr, bind); - - if (NULL == p) { - p = tcf_hash_create(parm,est,a,size,ovr, bind); - - if (NULL == p) { + if (p == NULL) { + p = tcf_hash_create(parm, est, a, sizeof(*p), ovr, bind); + if (p == NULL) return -1; - } else { + else { p->refcnt = 1; ret = 1; goto override; @@ -116,7 +111,7 @@ override: p->action = parm->action; #ifdef CONFIG_GACT_PROB - if (NULL != p_parm) { + if (p_parm != NULL) { p->paction = p_parm->paction; p->pval = p_parm->pval; p->ptype = p_parm->ptype; @@ -125,16 +120,15 @@ } #endif } - return ret; } static int tcf_gact_cleanup(struct tc_action *a, int bind) { - struct tcf_gact *p; - p = PRIV(a,gact); - if (NULL != p) + struct tcf_gact *p = PRIV(a, gact); + + if (p != NULL) return tcf_hash_release(p, bind); return 0; } @@ -142,13 +136,11 @@ static int tcf_gact(struct sk_buff **pskb, struct tc_action *a) { - struct tcf_gact *p; + struct tcf_gact *p = PRIV(a, gact); struct sk_buff *skb = *pskb; int action = TC_ACT_SHOT; - p = PRIV(a,gact); - - if (NULL == p) { + if (p == NULL) { if (net_ratelimit()) printk("BUG: tcf_gact called with NULL params\n"); return -1; @@ -156,7 +148,7 @@ spin_lock(&p->lock); #ifdef CONFIG_GACT_PROB - if (p->ptype && NULL != gact_rand[p->ptype]) + if (p->ptype && gact_rand[p->ptype] != NULL) action = gact_rand[p->ptype](p); else action = p->action; @@ -165,7 +157,7 @@ #endif p->bstats.bytes += skb->len; p->bstats.packets++; - if (TC_ACT_SHOT == action) + if (action == TC_ACT_SHOT) p->qstats.drops++; p->tm.lastuse = jiffies; spin_unlock(&p->lock); @@ -178,14 +170,10 @@ { unsigned char *b = skb->tail; struct tc_gact opt; -#ifdef CONFIG_GACT_PROB - struct tc_gact_p p_opt; -#endif - struct tcf_gact *p; + struct tcf_gact *p = PRIV(a, gact); struct tcf_t t; - p = PRIV(a,gact); - if (NULL == p) { + if (p == NULL) { printk("BUG: tcf_gact_dump called with NULL params\n"); goto rtattr_failure; } @@ -194,19 +182,20 @@ opt.refcnt = p->refcnt - ref; opt.bindcnt = p->bindcnt - bind; opt.action = p->action; - RTA_PUT(skb, TCA_GACT_PARMS, sizeof (opt), &opt); + RTA_PUT(skb, TCA_GACT_PARMS, sizeof(opt), &opt); #ifdef CONFIG_GACT_PROB if (p->ptype) { + struct tc_gact_p p_opt; p_opt.paction = p->paction; p_opt.pval = p->pval; p_opt.ptype = p->ptype; - RTA_PUT(skb, TCA_GACT_PROB, sizeof (p_opt), &p_opt); - } + RTA_PUT(skb, TCA_GACT_PROB, sizeof(p_opt), &p_opt); + } #endif t.install = jiffies_to_clock_t(jiffies - p->tm.install); t.lastuse = jiffies_to_clock_t(jiffies - p->tm.lastuse); t.expires = jiffies_to_clock_t(p->tm.expires); - RTA_PUT(skb, TCA_GACT_TM, sizeof (t), &t); + RTA_PUT(skb, TCA_GACT_TM, sizeof(t), &t); return skb->len; rtattr_failure: @@ -215,7 +204,6 @@ } static struct tc_action_ops act_gact_ops = { - .next = NULL, .kind = "gact", .type = TCA_ACT_GACT, .capab = TCA_CAP_NONE, diff -Nru a/net/sched/ipt.c b/net/sched/ipt.c --- a/net/sched/ipt.c 2005-01-10 06:22:20 +01:00 +++ b/net/sched/ipt.c 2005-01-10 06:22:20 +01:00 @@ -49,9 +49,9 @@ static rwlock_t ipt_lock = RW_LOCK_UNLOCKED; /* ovewrride the defaults */ -#define tcf_st tcf_ipt -#define tcf_t_lock ipt_lock -#define tcf_ht tcf_ipt_ht +#define tcf_st tcf_ipt +#define tcf_t_lock ipt_lock +#define tcf_ht tcf_ipt_ht #include @@ -73,8 +73,8 @@ if (t->u.kernel.target->checkentry && !t->u.kernel.target->checkentry(p->tname, NULL, t->data, - t->u.target_size - - sizeof (*t), p->hook)) { + t->u.target_size - sizeof(*t), + p->hook)) { DPRINTK("ip_tables: check failed for `%s'.\n", t->u.kernel.target->name); module_put(t->u.kernel.target->me); @@ -85,7 +85,8 @@ } static int -tcf_ipt_init(struct rtattr *rta, struct rtattr *est, struct tc_action *a, int ovr, int bind) +tcf_ipt_init(struct rtattr *rta, struct rtattr *est, struct tc_action *a, + int ovr, int bind) { struct ipt_entry_target *t; unsigned h; @@ -95,12 +96,9 @@ u32 index = 0; u32 hook = 0; - if (NULL == a || NULL == rta || - (rtattr_parse(tb, TCA_IPT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < - 0)) { + if (a == NULL || rta == NULL || + rtattr_parse(tb, TCA_IPT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0) return -1; - } - if (tb[TCA_IPT_INDEX - 1]) { index = *(u32 *) RTA_DATA(tb[TCA_IPT_INDEX - 1]); @@ -114,22 +112,19 @@ p->bindcnt += 1; p->refcnt += 1; } - if (ovr) { + if (ovr) goto override; - } spin_unlock(&p->lock); return ret; } - if (NULL == tb[TCA_IPT_TARG - 1] || NULL == tb[TCA_IPT_HOOK - 1]) { + if (tb[TCA_IPT_TARG - 1] == NULL || tb[TCA_IPT_HOOK - 1] == NULL) return -1; - } - p = kmalloc(sizeof (*p), GFP_KERNEL); + p = kmalloc(sizeof(*p), GFP_KERNEL); if (p == NULL) return -1; - - memset(p, 0, sizeof (*p)); + memset(p, 0, sizeof(*p)); p->refcnt = 1; ret = 1; spin_lock_init(&p->lock); @@ -184,7 +179,7 @@ } } - if (0 > init_targ(p)) { + if (init_targ(p) < 0) { if (ovr) { printk("ipt policy messed up 2 \n"); spin_unlock(&p->lock); @@ -217,7 +212,7 @@ p->next = tcf_ipt_ht[h]; tcf_ipt_ht[h] = p; write_unlock_bh(&ipt_lock); - a->priv = (void *) p; + a->priv = p; return ret; } @@ -225,8 +220,8 @@ static int tcf_ipt_cleanup(struct tc_action *a, int bind) { - struct tcf_ipt *p; - p = PRIV(a,ipt); + struct tcf_ipt *p = PRIV(a,ipt); + if (NULL != p) { struct ipt_entry_target *t = p->t; if (t && t->u.kernel.target) @@ -240,14 +235,11 @@ tcf_ipt(struct sk_buff **pskb, struct tc_action *a) { int ret = 0, result = 0; - struct tcf_ipt *p; + struct tcf_ipt *p = PRIV(a, ipt); struct sk_buff *skb = *pskb; - p = PRIV(a,ipt); - - if (NULL == p || NULL == skb) { + if (p == NULL || skb == NULL) return -1; - } spin_lock(&p->lock); @@ -256,16 +248,15 @@ p->bstats.packets++; if (skb_cloned(skb) ) { - if (pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) { + if (pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) return -1; - } } /* yes, we have to worry about both in and out dev worry later - danger - this API seems to have changed from earlier kernels */ ret = p->t->u.kernel.target->target(&skb, skb->dev, NULL, - p->hook, p->t->data, (void *)NULL); + p->hook, p->t->data, NULL); switch (ret) { case NF_ACCEPT: result = TC_ACT_OK; @@ -295,11 +286,9 @@ struct tcf_t tm; struct tc_cnt c; unsigned char *b = skb->tail; + struct tcf_ipt *p = PRIV(a, ipt); - struct tcf_ipt *p; - - p = PRIV(a,ipt); - if (NULL == p) { + if (p == NULL) { printk("BUG: tcf_ipt_dump called with NULL params\n"); goto rtattr_failure; } @@ -309,8 +298,7 @@ */ t = kmalloc(p->t->u.user.target_size, GFP_ATOMIC); - - if (NULL == t) + if (t == NULL) goto rtattr_failure; c.bindcnt = p->bindcnt - bind; @@ -320,10 +308,10 @@ DPRINTK("\ttcf_ipt_dump tablename %s length %d\n", p->tname, strlen(p->tname)); - DPRINTK - ("\tdump target name %s size %d size user %d data[0] %x data[1] %x\n", - p->t->u.kernel.target->name, p->t->u.target_size, p->t->u.user.target_size, - p->t->data[0], p->t->data[1]); + DPRINTK("\tdump target name %s size %d size user %d " + "data[0] %x data[1] %x\n", p->t->u.kernel.target->name, + p->t->u.target_size, p->t->u.user.target_size, + p->t->data[0], p->t->data[1]); RTA_PUT(skb, TCA_IPT_TARG, p->t->u.user.target_size, t); RTA_PUT(skb, TCA_IPT_INDEX, 4, &p->index); RTA_PUT(skb, TCA_IPT_HOOK, 4, &p->hook); @@ -341,7 +329,6 @@ } static struct tc_action_ops act_ipt_ops = { - .next = NULL, .kind = "ipt", .type = TCA_ACT_IPT, .capab = TCA_CAP_NONE, diff -Nru a/net/sched/mirred.c b/net/sched/mirred.c --- a/net/sched/mirred.c 2005-01-10 06:22:20 +01:00 +++ b/net/sched/mirred.c 2005-01-10 06:22:20 +01:00 @@ -49,10 +49,10 @@ static rwlock_t mirred_lock = RW_LOCK_UNLOCKED; /* ovewrride the defaults */ -#define tcf_st tcf_mirred -#define tc_st tc_mirred -#define tcf_t_lock mirred_lock -#define tcf_ht tcf_mirred_ht +#define tcf_st tcf_mirred +#define tc_st tc_mirred +#define tcf_t_lock mirred_lock +#define tcf_ht tcf_mirred_ht #define CONFIG_NET_ACT_INIT 1 #include @@ -61,10 +61,8 @@ tcf_mirred_release(struct tcf_mirred *p, int bind) { if (p) { - if (bind) { + if (bind) p->bindcnt--; - } - p->refcnt--; if(!p->bindcnt && p->refcnt <= 0) { dev_put(p->dev); @@ -72,26 +70,27 @@ return 1; } } - return 0; } static int -tcf_mirred_init(struct rtattr *rta, struct rtattr *est, struct tc_action *a,int ovr, int bind) +tcf_mirred_init(struct rtattr *rta, struct rtattr *est, struct tc_action *a, + int ovr, int bind) { struct rtattr *tb[TCA_MIRRED_MAX]; struct tc_mirred *parm; struct tcf_mirred *p; struct net_device *dev = NULL; - int size = sizeof (*p), new = 0; + int size = sizeof(*p), new = 0; - - if (rtattr_parse(tb, TCA_MIRRED_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0) { - DPRINTK("tcf_mirred_init BUG in user space couldnt parse properly\n"); + if (rtattr_parse(tb, TCA_MIRRED_MAX, RTA_DATA(rta), + RTA_PAYLOAD(rta)) < 0) { + DPRINTK("tcf_mirred_init BUG in user space couldnt parse " + "properly\n"); return -1; } - if (NULL == a || NULL == tb[TCA_MIRRED_PARMS - 1]) { + if (a == NULL || tb[TCA_MIRRED_PARMS - 1] == NULL) { DPRINTK("BUG: tcf_mirred_init called with NULL params\n"); return -1; } @@ -99,16 +98,16 @@ parm = RTA_DATA(tb[TCA_MIRRED_PARMS - 1]); p = tcf_hash_check(parm, a, ovr, bind); - if (NULL == p) { /* new */ - p = tcf_hash_create(parm,est,a,size,ovr,bind); - new = 1; - if (NULL == p) + if (p == NULL) { /* new */ + p = tcf_hash_create(parm, est, a, size, ovr, bind); + if (p == NULL) return -1; + new = 1; } if (parm->ifindex) { dev = dev_get_by_index(parm->ifindex); - if (NULL == dev) { + if (dev == NULL) { printk("BUG: tcf_mirred_init called with bad device\n"); return -1; } @@ -145,18 +144,18 @@ spin_unlock(&p->lock); } - - DPRINTK(" tcf_mirred_init index %d action %d eaction %d device %s ifndex %d\n",parm->index,parm->action,parm->eaction,dev->name,parm->ifindex); + DPRINTK("tcf_mirred_init index %d action %d eaction %d device %s " + "ifindex %d\n", parm->index, parm->action, parm->eaction, + dev->name, parm->ifindex); return new; - } static int tcf_mirred_cleanup(struct tc_action *a, int bind) { - struct tcf_mirred *p; - p = PRIV(a,mirred); - if (NULL != p) + struct tcf_mirred *p = PRIV(a, mirred); + + if (p != NULL) return tcf_mirred_release(p, bind); return 0; } @@ -164,21 +163,19 @@ static int tcf_mirred(struct sk_buff **pskb, struct tc_action *a) { - struct tcf_mirred *p; + struct tcf_mirred *p = PRIV(a, mirred); struct net_device *dev; struct sk_buff *skb2 = NULL; struct sk_buff *skb = *pskb; - __u32 at = G_TC_AT(skb->tc_verd); + u32 at = G_TC_AT(skb->tc_verd); - if (NULL == a) { + if (a == NULL) { if (net_ratelimit()) printk("BUG: tcf_mirred called with NULL action!\n"); return -1; } - p = PRIV(a,mirred); - - if (NULL == p) { + if (p == NULL) { if (net_ratelimit()) printk("BUG: tcf_mirred called with NULL params\n"); return -1; @@ -186,48 +183,44 @@ spin_lock(&p->lock); - dev = p->dev; + dev = p->dev; p->tm.lastuse = jiffies; - if (NULL == dev || !(dev->flags&IFF_UP) ) { + if (dev == NULL || !(dev->flags&IFF_UP) ) { if (net_ratelimit()) printk("mirred to Houston: device %s is gone!\n", - dev?dev->name:""); + dev ? dev->name : ""); bad_mirred: - if (NULL != skb2) + if (skb2 != NULL) kfree_skb(skb2); p->qstats.overlimits++; p->bstats.bytes += skb->len; p->bstats.packets++; spin_unlock(&p->lock); /* should we be asking for packet to be dropped? - * may make sense for redirect case only + * may make sense for redirect case only */ return TC_ACT_SHOT; - } + } skb2 = skb_clone(skb, GFP_ATOMIC); - if (skb2 == NULL) { + if (skb2 == NULL) goto bad_mirred; - } - if (TCA_EGRESS_MIRROR != p->eaction && - TCA_EGRESS_REDIR != p->eaction) { + if (p->eaction != TCA_EGRESS_MIRROR && p->eaction != TCA_EGRESS_REDIR) { if (net_ratelimit()) - printk("tcf_mirred unknown action %d\n",p->eaction); + printk("tcf_mirred unknown action %d\n", p->eaction); goto bad_mirred; } p->bstats.bytes += skb2->len; p->bstats.packets++; - if ( !(at & AT_EGRESS)) { - if (p->ok_push) { + if (!(at & AT_EGRESS)) + if (p->ok_push) skb_push(skb2, skb2->dev->hard_header_len); - } - } /* mirror is always swallowed */ - if (TCA_EGRESS_MIRROR != p->eaction) - skb2->tc_verd = SET_TC_FROM(skb2->tc_verd,at); + if (p->eaction != TCA_EGRESS_MIRROR) + skb2->tc_verd = SET_TC_FROM(skb2->tc_verd, at); skb2->dev = dev; skb2->input_dev = skb->dev; @@ -237,15 +230,14 @@ } static int -tcf_mirred_dump(struct sk_buff *skb, struct tc_action *a,int bind, int ref) +tcf_mirred_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) { unsigned char *b = skb->tail; struct tc_mirred opt; - struct tcf_mirred *p; + struct tcf_mirred *p = PRIV(a, mirred); struct tcf_t t; - p = PRIV(a,mirred); - if (NULL == p) { + if (p == NULL) { printk("BUG: tcf_mirred_dump called with NULL params\n"); goto rtattr_failure; } @@ -256,12 +248,13 @@ opt.bindcnt = p->bindcnt - bind; opt.eaction = p->eaction; opt.ifindex = p->ifindex; - DPRINTK(" tcf_mirred_dump index %d action %d eaction %d ifndex %d\n",p->index,p->action,p->eaction,p->ifindex); - RTA_PUT(skb, TCA_MIRRED_PARMS, sizeof (opt), &opt); + DPRINTK("tcf_mirred_dump index %d action %d eaction %d ifindex %d\n", + p->index, p->action, p->eaction, p->ifindex); + RTA_PUT(skb, TCA_MIRRED_PARMS, sizeof(opt), &opt); t.install = jiffies_to_clock_t(jiffies - p->tm.install); t.lastuse = jiffies_to_clock_t(jiffies - p->tm.lastuse); t.expires = jiffies_to_clock_t(p->tm.expires); - RTA_PUT(skb, TCA_MIRRED_TM, sizeof (t), &t); + RTA_PUT(skb, TCA_MIRRED_TM, sizeof(t), &t); return skb->len; rtattr_failure: @@ -270,7 +263,6 @@ } static struct tc_action_ops act_mirred_ops = { - .next = NULL, .kind = "mirred", .type = TCA_ACT_MIRRED, .capab = TCA_CAP_NONE, @@ -287,7 +279,6 @@ MODULE_DESCRIPTION("Device Mirror/redirect actions"); MODULE_LICENSE("GPL"); - static int __init mirred_init_module(void) { @@ -303,4 +294,3 @@ module_init(mirred_init_module); module_exit(mirred_cleanup_module); - diff -Nru a/net/sched/pedit.c b/net/sched/pedit.c --- a/net/sched/pedit.c 2005-01-10 06:22:20 +01:00 +++ b/net/sched/pedit.c 2005-01-10 06:22:20 +01:00 @@ -44,46 +44,40 @@ static struct tcf_pedit *tcf_pedit_ht[MY_TAB_SIZE]; static rwlock_t pedit_lock = RW_LOCK_UNLOCKED; -#define tcf_st tcf_pedit -#define tc_st tc_pedit -#define tcf_t_lock pedit_lock -#define tcf_ht tcf_pedit_ht +#define tcf_st tcf_pedit +#define tc_st tc_pedit +#define tcf_t_lock pedit_lock +#define tcf_ht tcf_pedit_ht #define CONFIG_NET_ACT_INIT 1 #include - static int -tcf_pedit_init(struct rtattr *rta, struct rtattr *est, struct tc_action *a,int ovr, int bind) +tcf_pedit_init(struct rtattr *rta, struct rtattr *est, struct tc_action *a, + int ovr, int bind) { struct rtattr *tb[TCA_PEDIT_MAX]; struct tc_pedit *parm; int size = 0; int ret = 0; - struct tcf_pedit *p = NULL; + struct tcf_pedit *p; - if (rtattr_parse(tb, TCA_PEDIT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0) + if (rtattr_parse(tb, TCA_PEDIT_MAX, RTA_DATA(rta), + RTA_PAYLOAD(rta)) < 0) return -1; - - if (NULL == a || NULL == tb[TCA_PEDIT_PARMS - 1]) { + if (a == NULL || tb[TCA_PEDIT_PARMS - 1] == NULL) { printk("BUG: tcf_pedit_init called with NULL params\n"); return -1; } parm = RTA_DATA(tb[TCA_PEDIT_PARMS - 1]); - p = tcf_hash_check(parm, a, ovr, bind); - - if (NULL == p) { /* new */ - + if (p == NULL) { /* new */ if (!parm->nkeys) return -1; - - size = sizeof (*p)+ (parm->nkeys*sizeof(struct tc_pedit_key)); - - p = tcf_hash_create(parm,est,a,size,ovr,bind); - - if (NULL == p) + size = sizeof(*p) + parm->nkeys * sizeof(struct tc_pedit_key); + p = tcf_hash_create(parm, est, a, size, ovr, bind); + if (p == NULL) return -1; ret = 1; goto override; @@ -94,7 +88,8 @@ p->flags = parm->flags; p->nkeys = parm->nkeys; p->action = parm->action; - memcpy(p->keys,parm->keys,parm->nkeys*(sizeof(struct tc_pedit_key))); + memcpy(p->keys, parm->keys, + parm->nkeys * sizeof(struct tc_pedit_key)); } return ret; @@ -103,27 +98,22 @@ static int tcf_pedit_cleanup(struct tc_action *a, int bind) { - struct tcf_pedit *p; - p = PRIV(a,pedit); + struct tcf_pedit *p = PRIV(a, pedit); + if (NULL != p) - return tcf_hash_release(p, bind); + return tcf_hash_release(p, bind); return 0; } -/* -** -*/ static int tcf_pedit(struct sk_buff **pskb, struct tc_action *a) { - struct tcf_pedit *p; + struct tcf_pedit *p = PRIV(a, pedit); struct sk_buff *skb = *pskb; int i, munged = 0; u8 *pptr; - p = PRIV(a,pedit); - - if (NULL == p) { + if (p == NULL) { printk("BUG: tcf_pedit called with NULL params\n"); return -1; /* change to something symbolic */ } @@ -141,17 +131,18 @@ p->tm.lastuse = jiffies; - if (0 < p->nkeys) { + if (p->nkeys > 0) { struct tc_pedit_key *tkey = p->keys; for (i = p->nkeys; i > 0; i--, tkey++) { - u32 *ptr ; - + u32 *ptr; int offset = tkey->off; + if (tkey->offmask) { if (skb->len > tkey->at) { - char *j = pptr+tkey->at; - offset +=((*j&tkey->offmask)>>tkey->shift); + char *j = pptr + tkey->at; + offset += ((*j & tkey->offmask) >> + tkey->shift); } else { goto bad; } @@ -161,14 +152,12 @@ printk("offset must be on 32 bit boundaries\n"); goto bad; } - if (skb->len < 0 || (offset > 0 && offset > skb->len)) { printk("offset %d cant exceed pkt length %d\n", - offset, skb->len); + offset, skb->len); goto bad; } - ptr = (u32 *)(pptr+offset); /* just do it, baby */ *ptr = ((*ptr & tkey->mask) ^ tkey->val); @@ -196,29 +185,24 @@ { unsigned char *b = skb->tail; struct tc_pedit *opt; - struct tcf_pedit *p; + struct tcf_pedit *p = PRIV(a, pedit); struct tcf_t t; int s; - - p = PRIV(a,pedit); - - if (NULL == p) { + if (p == NULL) { printk("BUG: tcf_pedit_dump called with NULL params\n"); goto rtattr_failure; } - s = sizeof (*opt)+(p->nkeys*sizeof(struct tc_pedit_key)); + s = sizeof(*opt) + p->nkeys * sizeof(struct tc_pedit_key); - /* netlink spinlocks held above us - must use ATOMIC - * */ + /* netlink spinlocks held above us - must use ATOMIC */ opt = kmalloc(s, GFP_ATOMIC); if (opt == NULL) return -ENOBUFS; - memset(opt, 0, s); - memcpy(opt->keys,p->keys,p->nkeys*(sizeof(struct tc_pedit_key))); + memcpy(opt->keys, p->keys, p->nkeys * sizeof(struct tc_pedit_key)); opt->index = p->index; opt->nkeys = p->nkeys; opt->flags = p->flags; @@ -239,15 +223,15 @@ (unsigned int)key->off, (unsigned int)key->val, (unsigned int)key->mask); - } - } + } + } #endif RTA_PUT(skb, TCA_PEDIT_PARMS, s, opt); t.install = jiffies_to_clock_t(jiffies - p->tm.install); t.lastuse = jiffies_to_clock_t(jiffies - p->tm.lastuse); t.expires = jiffies_to_clock_t(p->tm.expires); - RTA_PUT(skb, TCA_PEDIT_TM, sizeof (t), &t); + RTA_PUT(skb, TCA_PEDIT_TM, sizeof(t), &t); return skb->len; rtattr_failure: diff -Nru a/net/sched/police.c b/net/sched/police.c --- a/net/sched/police.c 2005-01-10 06:22:20 +01:00 +++ b/net/sched/police.c 2005-01-10 06:22:20 +01:00 @@ -66,11 +66,12 @@ } #ifdef CONFIG_NET_CLS_ACT -static __inline__ int tcf_generic_walker(struct sk_buff *skb, struct netlink_callback *cb, int type, struct tc_action *a) +static int tcf_generic_walker(struct sk_buff *skb, struct netlink_callback *cb, + int type, struct tc_action *a) { struct tcf_police *p; - int err =0, index = -1,i= 0, s_i = 0, n_i = 0; - struct rtattr *r ; + int err = 0, index = -1, i = 0, s_i = 0, n_i = 0; + struct rtattr *r; read_lock(&police_lock); @@ -91,7 +92,7 @@ err = tcf_action_dump_1(skb, a, 0, 1); else err = tcf_action_dump_1(skb, a, 0, 0); - if (0 > err) { + if (err < 0) { index--; skb_trim(skb, (u8*)r - skb->data); goto done; @@ -123,11 +124,9 @@ return 0; } } - - #endif -static __inline__ u32 tcf_police_new_index(void) +static inline u32 tcf_police_new_index(void) { do { if (++idx_gen == 0) @@ -137,7 +136,6 @@ return idx_gen; } - void tcf_police_destroy(struct tcf_police *p) { unsigned h = tcf_police_hash(p->index); @@ -163,7 +161,8 @@ } #ifdef CONFIG_NET_CLS_ACT -static int tcf_act_police_locate(struct rtattr *rta, struct rtattr *est,struct tc_action *a, int ovr, int bind) +static int tcf_act_police_locate(struct rtattr *rta, struct rtattr *est, + struct tc_action *a, int ovr, int bind) { unsigned h; int ret = 0; @@ -171,13 +170,15 @@ struct tc_police *parm; struct tcf_police *p; - if (NULL == a) { + if (a == NULL) { if (net_ratelimit()) - printk("BUG: tcf_police_locate called with NULL params\n"); - return -1; + printk("BUG: tcf_police_locate called with NULL " + "params\n"); + return -1; } - if (rtattr_parse(tb, TCA_POLICE_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0) + if (rtattr_parse(tb, TCA_POLICE_MAX, RTA_DATA(rta), + RTA_PAYLOAD(rta)) < 0) return -1; if (tb[TCA_POLICE_TBF-1] == NULL || @@ -185,26 +186,24 @@ return -1; parm = RTA_DATA(tb[TCA_POLICE_TBF-1]); - if (parm->index && (p = tcf_police_lookup(parm->index)) != NULL) { - a->priv = (void *)p; + a->priv = p; spin_lock(&p->lock); if (bind) { p->bindcnt += 1; p->refcnt += 1; } - if (ovr) { + if (ovr) goto override; - } spin_unlock(&p->lock); - return ret; + return ret; } p = kmalloc(sizeof(*p), GFP_KERNEL); if (p == NULL) return -1; - memset(p, 0, sizeof(*p)); + ret = 1; p->refcnt = 1; spin_lock_init(&p->lock); @@ -213,12 +212,14 @@ p->bindcnt = 1; override: if (parm->rate.rate) { - if ((p->R_tab = qdisc_get_rtab(&parm->rate, tb[TCA_POLICE_RATE-1])) == NULL) { - goto failure; - } - if (parm->peakrate.rate && - (p->P_tab = qdisc_get_rtab(&parm->peakrate, tb[TCA_POLICE_PEAKRATE-1])) == NULL) { + p->R_tab = qdisc_get_rtab(&parm->rate, tb[TCA_POLICE_RATE-1]); + if (p->R_tab == NULL) goto failure; + if (parm->peakrate.rate) { + p->P_tab = qdisc_get_rtab(&parm->peakrate, + tb[TCA_POLICE_PEAKRATE-1]); + if (p->P_tab == NULL) + goto failure; } } if (tb[TCA_POLICE_RESULT-1]) { @@ -260,8 +261,8 @@ tcf_police_ht[h] = p; write_unlock_bh(&police_lock); - a->priv = (void *)p; - return ret; + a->priv = p; + return ret; failure: if (p->R_tab) @@ -274,11 +275,10 @@ static int tcf_act_police_cleanup(struct tc_action *a, int bind) { - struct tcf_police *p; - p = PRIV(a); - if (NULL != p) - return tcf_police_release(p, bind); + struct tcf_police *p = PRIV(a); + if (p != NULL) + return tcf_police_release(p, bind); return 0; } @@ -286,15 +286,13 @@ { psched_time_t now; struct sk_buff *skb = *pskb; - struct tcf_police *p; + struct tcf_police *p = PRIV(a); long toks; long ptoks = 0; - p = PRIV(a); - - if (NULL == p) { + if (p == NULL) { printk("BUG: tcf_police called with NULL params\n"); - return -1; + return -1; } spin_lock(&p->lock); @@ -345,14 +343,14 @@ return p->action; } -static int tcf_act_police_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) +static int +tcf_act_police_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) { unsigned char *b = skb->tail; struct tc_police opt; - struct tcf_police *p; + struct tcf_police *p = PRIV(a); - p = PRIV(a); - if (NULL == p) { + if (p == NULL) { printk("BUG: tcf_police_dump called with NULL params\n"); goto rtattr_failure; } @@ -389,12 +387,10 @@ MODULE_DESCRIPTION("Policing actions"); MODULE_LICENSE("GPL"); - static struct tc_action_ops act_police_ops = { - .next = NULL, .kind = "police", - .type = TCA_ID_POLICE, - .capab = TCA_CAP_NONE, + .type = TCA_ID_POLICE, + .capab = TCA_CAP_NONE, .owner = THIS_MODULE, .act = tcf_act_police, .dump = tcf_act_police_dump, @@ -428,7 +424,8 @@ struct rtattr *tb[TCA_POLICE_MAX]; struct tc_police *parm; - if (rtattr_parse(tb, TCA_POLICE_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0) + if (rtattr_parse(tb, TCA_POLICE_MAX, RTA_DATA(rta), + RTA_PAYLOAD(rta)) < 0) return NULL; if (tb[TCA_POLICE_TBF-1] == NULL || @@ -451,11 +448,15 @@ spin_lock_init(&p->lock); p->stats_lock = &p->lock; if (parm->rate.rate) { - if ((p->R_tab = qdisc_get_rtab(&parm->rate, tb[TCA_POLICE_RATE-1])) == NULL) - goto failure; - if (parm->peakrate.rate && - (p->P_tab = qdisc_get_rtab(&parm->peakrate, tb[TCA_POLICE_PEAKRATE-1])) == NULL) + p->R_tab = qdisc_get_rtab(&parm->rate, tb[TCA_POLICE_RATE-1]); + if (p->R_tab == NULL) goto failure; + if (parm->peakrate.rate) { + p->P_tab = qdisc_get_rtab(&parm->peakrate, + tb[TCA_POLICE_PEAKRATE-1]); + if (p->P_tab == NULL) + goto failure; + } } if (tb[TCA_POLICE_RESULT-1]) { if (RTA_PAYLOAD(tb[TCA_POLICE_RESULT-1]) != sizeof(u32)) --------------030809080002090402080508-- From AAnthony@sbs.com Sun Jan 9 23:49:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 09 Jan 2005 23:49:51 -0800 (PST) Received: from mail108.messagelabs.com (mail108.messagelabs.com [216.82.255.115]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A7nkLD031408 for ; Sun, 9 Jan 2005 23:49:46 -0800 X-VirusChecked: Checked X-Env-Sender: AAnthony@sbs.com X-Msg-Ref: server-7.tower-108.messagelabs.com!1105386571!7045362!1 X-StarScan-Version: 5.4.5; banners=sbs.com,-,- X-Originating-IP: [204.255.71.6] Received: (qmail 22910 invoked from network); 10 Jan 2005 19:49:32 -0000 Received: from user6.sbs.com (HELO abqex.sbscorp.sbs.com) (204.255.71.6) by server-7.tower-108.messagelabs.com with SMTP; 10 Jan 2005 19:49:32 -0000 Received: by abqex.sbscorp.sbs.com with Internet Mail Service (5.5.2657.72) id ; Mon, 10 Jan 2005 12:49:31 -0700 Message-ID: <4F23E557A0317D45864097982DE907941A3383@pilotmail.sbscorp.sbs.com> From: Adam Anthony To: Matthias-Christian Ott , Alexey Dobriyan Cc: Adam Anthony , netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: RE: [PATCH] /driver/net/wan/sbs520 Date: Mon, 10 Jan 2005 12:49:23 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 38 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: AAnthony@sbs.com Precedence: bulk X-list: netdev Thank you for the heads up A&M. I have destroyed the evil [^M]'s, and updated the package. http://prdownloads.sourceforge.net/sbs520lnxdrv/sbs520patch.bz2?download -AA -----Original Message----- From: Matthias-Christian Ott [mailto:matthias.christian@tiscali.de] Sent: Monday, January 10, 2005 12:26 PM To: Alexey Dobriyan Cc: Adam Anthony; netdev@oss.sgi.com; linux-kernel@vger.kernel.org Subject: Re: [PATCH] /driver/net/wan/sbs520 Alexey Dobriyan wrote: >On Mon, 10 Jan 2005 07:46:52 -0700, Adam Anthony wrote: > > > >>With the permission of my employer, SBS Technologies, Inc., I have >>released a patch for 2.4 kernels that supports the 520 Series of WAN >>adapters. >> >> > >My editor shows ^M at the end of every line of new Documentation/Configure.help, >MAINTAINERS (add ~63400 bogus lines!). Please, look at the patch _after_ >generating it. > > > >>+obj-$(CONFIG_LANMEDIA) += syncppp.o^M >> >> > > > >>+subdir-$(CONFIG_LANMEDIA) += lmc^M >> >> > >Also random ^M's. > >--- linux-2.4.28-virgin/drivers/net/wan/sbs520/lnxosl.c >+++ /usr/src/linux-2.4.28/drivers/net/wan/sbs520/lnxosl.c > > > >>+// Programming Language: C^M >>+// Target Processor: Any^M >>+// Target Operating System: Linux^M >> >> > >Well, this is pretty obvious to everyone here. :-) > > > >>+// This software may be used and distributed according to the terms^M >>+// of the GNU General Public License, incorporated herein by reference.^M >> >> > >Stupid question: do you mean GPL version 2 or something else? > > Alexey >- >To unsubscribe from this list: send the line "unsubscribe linux-kernel" in >the body of a message to majordomo@vger.kernel.org >More majordomo info at http://vger.kernel.org/majordomo-info.html >Please read the FAQ at http://www.tux.org/lkml/ > > > That's ugly, that are Microsoft line endings. Matthias-Christian Ott ***This message has been scanned for virus, spam, and undesirable content.*** ***For further information, contact your mail administrator.*** For limitations on the use and distribution of this message, please visit www.sbs.com/emaildisclaimer. From romieu@fr.zoreil.com Mon Jan 10 00:33:19 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 00:33:25 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A8XHhq003722 for ; Mon, 10 Jan 2005 00:33:18 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.13.1/8.12.1) with ESMTP id j0AKTshK031764; Mon, 10 Jan 2005 21:29:54 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.13.1/8.13.1/Submit) id j0AKTlBw031763; Mon, 10 Jan 2005 21:29:47 +0100 Date: Mon, 10 Jan 2005 21:29:47 +0100 From: Francois Romieu To: Adam Anthony Cc: Matthias-Christian Ott , Alexey Dobriyan , netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] /driver/net/wan/sbs520 Message-ID: <20050110202947.GA31426@electric-eye.fr.zoreil.com> References: <4F23E557A0317D45864097982DE907941A3383@pilotmail.sbscorp.sbs.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F23E557A0317D45864097982DE907941A3383@pilotmail.sbscorp.sbs.com> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 39 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Adam Anthony : > Thank you for the heads up A&M. I have destroyed the evil [^M]'s, and > updated the package. > http://prdownloads.sourceforge.net/sbs520lnxdrv/sbs520patch.bz2?download o OsMapPhysToVirt -> should be ioremap/pci_iomap() o OsUnMapVirt -> iounmap, etc. o OsAllocateNonPagedMemory/OsMemcpy/OsStall/OsSleep/OsZeroMem -> useless wrappers. o OsAllocateDeviceMemory Yuck, virt_to_bus ! Please read: - linux-2.6.x/Documentation/DMA-mapping.txt - linux-2.6.x/Documentation/DMA-API.txt drivers/net/*.c provides a lot of good examples for recent PCI devices. o OsReadPciConfiguration Please see pci_resource_{start/len} and friends. At this point, lnxosl.c will be removable and nobody will regret it. -- Ueimor From davem@davemloft.net Mon Jan 10 00:39:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 00:39:43 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A8dbs8004260 for ; Mon, 10 Jan 2005 00:39:37 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Co6EN-0006oq-00; Mon, 10 Jan 2005 12:33:39 -0800 Date: Mon, 10 Jan 2005 12:33:38 -0800 From: "David S. Miller" To: Sridhar Samudrala Cc: netdev@oss.sgi.com, lksctp-developers@lists.sourceforge.net Subject: Re: [BK PATCH] 2.6 and 2.4 SCTP updates Message-Id: <20050110123338.20363b62.davem@davemloft.net> In-Reply-To: References: X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 40 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Thu, 30 Dec 2004 16:53:56 -0800 (PST) Sridhar Samudrala wrote: > Please do a > bk pull http://linux-lksctp.bkbits.net/lksctp-2.5.work & > bk pull http://linux-lksctp.bkbits.net/lksctp-2.4.work > > to get the following SCTP updates to 2.6 and 2.4. > > The 2.4 csets include a patch that gets rid of sk_xxx macros that were > causing backporting issues for other networking components. All pulled, thanks Sridhar. From davem@davemloft.net Mon Jan 10 00:49:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 00:49:16 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A8n9GT004921 for ; Mon, 10 Jan 2005 00:49:09 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Co6NX-0006qQ-00; Mon, 10 Jan 2005 12:43:08 -0800 Date: Mon, 10 Jan 2005 12:43:07 -0800 From: "David S. Miller" To: Wensong Zhang Cc: netdev@oss.sgi.com Subject: Re: [PATCH] [IPVS] run master/backup sync daemon at a time Message-Id: <20050110124307.0a55d3f7.davem@davemloft.net> In-Reply-To: References: X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 41 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Tue, 4 Jan 2005 00:40:25 +0800 (CST) Wensong Zhang wrote: > Here is the back port patch from kernel 2.6, which is to run master/backup > sync daemon at a time with SyncID support. Please check and apply it to > kernel 2.4. Applied, thanks Wensong. From AAnthony@sbs.com Mon Jan 10 00:50:17 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 00:50:24 -0800 (PST) Received: from mail108.messagelabs.com (mail108.messagelabs.com [216.82.255.115]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0A8oH0C005242 for ; Mon, 10 Jan 2005 00:50:17 -0800 X-VirusChecked: Checked X-Env-Sender: AAnthony@sbs.com X-Msg-Ref: server-11.tower-108.messagelabs.com!1105390203!0!1 X-StarScan-Version: 5.4.5; banners=sbs.com,-,- X-Originating-IP: [204.255.71.6] Received: (qmail 30361 invoked from network); 10 Jan 2005 20:50:04 -0000 Received: from user6.sbs.com (HELO abqex.sbscorp.sbs.com) (204.255.71.6) by server-11.tower-108.messagelabs.com with SMTP; 10 Jan 2005 20:50:04 -0000 Received: by abqex.sbscorp.sbs.com with Internet Mail Service (5.5.2657.72) id ; Mon, 10 Jan 2005 13:50:03 -0700 Message-ID: <4F23E557A0317D45864097982DE907941A33AD@pilotmail.sbscorp.sbs.com> From: Adam Anthony To: Francois Romieu Cc: Matthias-Christian Ott , Alexey Dobriyan , netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: RE: [PATCH] /driver/net/wan/sbs520 Date: Mon, 10 Jan 2005 13:49:55 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 42 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: AAnthony@sbs.com Precedence: bulk X-list: netdev The SBS Communications group structured their software this way (w/useless wrappers) to make files portable from one operating system to another. Now that this package will be taking a life of its own, the change you propose makes perfect sense. Thanks, Adam -----Original Message----- From: Francois Romieu [mailto:romieu@fr.zoreil.com] Sent: Monday, January 10, 2005 3:30 PM To: Adam Anthony Cc: Matthias-Christian Ott; Alexey Dobriyan; netdev@oss.sgi.com; linux-kernel@vger.kernel.org Subject: Re: [PATCH] /driver/net/wan/sbs520 o OsMapPhysToVirt -> should be ioremap/pci_iomap() o OsUnMapVirt -> iounmap, etc. o OsAllocateNonPagedMemory/OsMemcpy/OsStall/OsSleep/OsZeroMem -> useless wrappers. o OsAllocateDeviceMemory Yuck, virt_to_bus ! Please read: - linux-2.6.x/Documentation/DMA-mapping.txt - linux-2.6.x/Documentation/DMA-API.txt drivers/net/*.c provides a lot of good examples for recent PCI devices. o OsReadPciConfiguration Please see pci_resource_{start/len} and friends. At this point, lnxosl.c will be removable and nobody will regret it. -- Ueimor For limitations on the use and distribution of this message, please visit www.sbs.com/emaildisclaimer. From davem@davemloft.net Mon Jan 10 00:54:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 00:54:18 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A8sDY1005937 for ; Mon, 10 Jan 2005 00:54:13 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Co6SU-0006sE-00; Mon, 10 Jan 2005 12:48:14 -0800 Date: Mon, 10 Jan 2005 12:48:14 -0800 From: "David S. Miller" To: Adrian Bunk Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [2.6 patch] net/core/: misc possible cleanups Message-Id: <20050110124814.2b513f00.davem@davemloft.net> In-Reply-To: <20050103235127.GQ2980@stusta.de> References: <20041214045758.GA23151@stusta.de> <20041227190249.6afda3df.davem@davemloft.net> <20050103235127.GQ2980@stusta.de> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 43 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Tue, 4 Jan 2005 00:51:27 +0100 Adrian Bunk wrote: > OK, updated patch: ... > Signed-off-by: Adrian Bunk Applied, thanks Adrian. From davem@davemloft.net Mon Jan 10 00:56:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 00:56:08 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A8u2PX006453 for ; Mon, 10 Jan 2005 00:56:02 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Co6UD-0006sW-00; Mon, 10 Jan 2005 12:50:01 -0800 Date: Mon, 10 Jan 2005 12:50:01 -0800 From: "David S. Miller" To: akepner@sgi.com Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH bk-2.6.10] tg3:align IP headers from 5701 in PCI-X mode Message-Id: <20050110125001.4fe4d00b.davem@davemloft.net> In-Reply-To: References: X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 44 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Mon, 3 Jan 2005 17:45:01 -0800 (PST) akepner@sgi.com wrote: > We still have customers using 5701 cards, and their syslogs fill with > "kernel unaligned access" messages. They may also see a significant > performance degradation due to the expense of unaligned accesses on > ia64. Here's a patch to address this (it is almost the same as the > patch which was discussed in > http://marc.theaimsgroup.com/?l=linux-netdev&m=109770128816605&w=2). > > In a quick throughput test, I found that this could improve throughput > by ~30% on an Altix. Let's just do this all the time for this case, adding new config options for stuff like this does nothing more than create confusion. From davem@davemloft.net Mon Jan 10 00:58:06 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 00:58:11 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A8w66H006923 for ; Mon, 10 Jan 2005 00:58:06 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Co6WE-0006sp-00; Mon, 10 Jan 2005 12:52:06 -0800 Date: Mon, 10 Jan 2005 12:52:06 -0800 From: "David S. Miller" To: Olaf Kirch Cc: netdev@oss.sgi.com Subject: Re: [PATCH] Problem with recent CMSG_COMPAT_OK fix Message-Id: <20050110125206.05ee6cfe.davem@davemloft.net> In-Reply-To: <20050104165934.GJ7761@suse.de> References: <20050104165934.GJ7761@suse.de> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 45 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Tue, 4 Jan 2005 17:59:34 +0100 Olaf Kirch wrote: > The recent fixes for cmsg_len handling seem to break 32bit compatibility > at least on x86_64. The new CMSG_COMPAT_OK macro requires that cmsg_len > is greater or equal the size of struct cmsghdr, which is the 64bit > version of the struct. The code should really check against the size > of struct compat_cmsghdr. > > Signed-off-by: Olaf Kirch Applied, thanks Olaf. From jgarzik@pobox.com Mon Jan 10 01:02:30 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 01:02:35 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A92UpQ007428 for ; Mon, 10 Jan 2005 01:02:30 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1Co6g9-0002fz-39; Mon, 10 Jan 2005 21:02:21 +0000 Message-ID: <41E2ED47.9080909@pobox.com> Date: Mon, 10 Jan 2005 16:01:59 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: akepner@sgi.com, netdev@oss.sgi.com Subject: Re: [PATCH bk-2.6.10] tg3:align IP headers from 5701 in PCI-X mode References: <20050110125001.4fe4d00b.davem@davemloft.net> In-Reply-To: <20050110125001.4fe4d00b.davem@davemloft.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 46 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev David S. Miller wrote: > On Mon, 3 Jan 2005 17:45:01 -0800 (PST) > akepner@sgi.com wrote: > > >>We still have customers using 5701 cards, and their syslogs fill with >>"kernel unaligned access" messages. They may also see a significant >>performance degradation due to the expense of unaligned accesses on >>ia64. Here's a patch to address this (it is almost the same as the >>patch which was discussed in >>http://marc.theaimsgroup.com/?l=linux-netdev&m=109770128816605&w=2). >> >>In a quick throughput test, I found that this could improve throughput >>by ~30% on an Altix. > > > Let's just do this all the time for this case, adding new config > options for stuff like this does nothing more than create confusion. agreed. Jeff From hadi@cyberus.ca Mon Jan 10 01:08:40 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 01:08:44 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A98dAI008032 for ; Mon, 10 Jan 2005 01:08:39 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1Co6m5-0008DN-Tb for netdev@oss.sgi.com; Mon, 10 Jan 2005 16:08:29 -0500 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Co6m0-0008MN-DA; Mon, 10 Jan 2005 16:08:24 -0500 Subject: Re: [PATCH PKT_SCHED 0/22]: tc action cleanups From: jamal Reply-To: hadi@cyberus.ca To: Patrick McHardy Cc: Maillist netdev In-Reply-To: <41E2D97A.1060400@trash.net> References: <41E2D97A.1060400@trash.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105391297.1084.54.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 10 Jan 2005 16:08:18 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 47 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Mon, 2005-01-10 at 14:37, Patrick McHardy wrote: > Hi Jamal, > > following are the reorganized tc action cleanup patches with some > additional fixes. Please review and comment, I would like to ask > Dave to pull them in soon so I don't get more clashes. > Other than the ipt breakage fix - Is there anything new since our last discussion that you want me to pay attention to? Sorry dont have the cycles to pay close attention today. Will do tommorow. You seem to also have touched some police code this time (I suppose the LinuxWay payoff time is here).So, if you want me to pay close attention to specific items i will; otherwise i would suggest that Dave sucks them in, then we can resolve things later. cheers, jamal From jeremy.guthrie@berbee.com Mon Jan 10 01:11:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 01:11:28 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A9BKr9008498 for ; Mon, 10 Jan 2005 01:11:21 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Mon, 10 Jan 2005 15:11:07 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Mon, 10 Jan 2005 15:11:02 -0600 User-Agent: KMail/1.7.2 Cc: Jesse Brandeburg , Robert.Olsson@data.slu.se, shemminger@osdl.org References: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3504373.GH3shJKScU"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501101511.07164.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 10 Jan 2005 21:11:07.0878 (UTC) FILETIME=[E70CE060:01C4F758] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 48 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart3504373.GH3shJKScU Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I rebound the card with 2048 RxDescriptors. There appears to be a burst=20 errors right when the port comes online. Down below is an ifconfig ; sleep= =20 60 ; ifconfig. I'll be tesitng Robert's patch shortly. ethtool -S eth2 NIC statistics: rx_packets: 0 tx_packets: 7295976 rx_bytes: 0 tx_bytes: 3413882143 rx_errors: 0 tx_errors: 0 rx_dropped: 0 tx_dropped: 0 multicast: 0 collisions: 0 rx_length_errors: 0 rx_over_errors: 0 rx_crc_errors: 0 rx_frame_errors: 0 rx_fifo_errors: 0 rx_missed_errors: 0 tx_aborted_errors: 0 tx_carrier_errors: 0 tx_fifo_errors: 0 tx_heartbeat_errors: 0 tx_window_errors: 0 tx_abort_late_coll: 0 tx_deferred_ok: 0 tx_single_coll_ok: 0 tx_multi_coll_ok: 0 rx_long_length_errors: 0 rx_short_length_errors: 0 rx_align_errors: 0 tx_tcp_seg_good: 0 tx_tcp_seg_failed: 0 rx_flow_control_xon: 0 rx_flow_control_xoff: 0 tx_flow_control_xon: 0 tx_flow_control_xoff: 0 rx_long_byte_count: 0 rx_csum_offload_good: 0 rx_csum_offload_errors: 0 ethtool -S eth3 NIC statistics: rx_packets: 19231078 tx_packets: 5 rx_bytes: 1350479823 tx_bytes: 398 rx_errors: 522159 tx_errors: 0 rx_dropped: 320198 tx_dropped: 0 multicast: 0 collisions: 0 rx_length_errors: 0 rx_over_errors: 0 rx_crc_errors: 0 rx_frame_errors: 0 rx_fifo_errors: 201961 rx_missed_errors: 201961 tx_aborted_errors: 0 tx_carrier_errors: 0 tx_fifo_errors: 0 tx_heartbeat_errors: 0 tx_window_errors: 0 tx_abort_late_coll: 0 tx_deferred_ok: 0 tx_single_coll_ok: 0 tx_multi_coll_ok: 0 rx_long_length_errors: 0 rx_short_length_errors: 0 rx_align_errors: 0 tx_tcp_seg_good: 0 tx_tcp_seg_failed: 0 rx_flow_control_xon: 0 rx_flow_control_xoff: 0 tx_flow_control_xon: 0 tx_flow_control_xoff: 0 rx_long_byte_count: 9940414415 rx_csum_offload_good: 17879204 rx_csum_offload_errors: 8537 Mon Jan 10 15:06:26 CST 2005 eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255.0 inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:67183383 errors:583215 dropped:583215 overruns:247258= =20 frame:0 TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1120957705 (1069.0 Mb) TX bytes:398 (398.0 b) Base address:0x22a0 Memory:eff80000-effa0000 Mon Jan 10 15:07:26 CST 2005 eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255.0 inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:73275567 errors:616520 dropped:616520 overruns:262517= =20 frame:0 TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:337437991 (321.8 Mb) TX bytes:398 (398.0 b) Base address:0x22a0 Memory:eff80000-effa0000 On Friday 07 January 2005 05:23 pm, Jesse Brandeburg wrote: > On Fri, 7 Jan 2005, Jeremy M. Guthrie wrote: > > > Very interesting that with your workload the napi driver doesn't keep > > > up (from looking at your posts in netdev) and yet the interrupt mode > > > driver can. > > > > Well, I need to do more digging. One scenario the interrupt mode can > > hand stuff off to the CPU but the network stack still drops. The other > > scenario, the card drops. > > > > ethtool -S eth2 > > NIC statistics: > > > > > tx_packets: 314550698 > > tx_bytes: 4290523139 > > ethtool -S eth3 > > NIC statistics: > > > > > rx_packets: 719847127 > > tx_packets: 5 > > rx_bytes: 1880301945 > > tx_bytes: 398 > > rx_errors: 3368295 > > rx_dropped: 1478044 > > rx_fifo_errors: 1890251 > > rx_missed_errors: 1890251 > > rx_long_byte_count: 379837423993 > > rx_csum_offload_good: 672891990 > > rx_csum_offload_errors: 178666 > > Okay, well, rx_dropped means "receive no buffers count" in our driver, but > doesn't necessarily mean that the packet was completely dropped it just > means that the fifo may have had to queue up the packet on the adapter as > best it could and wait for the OS to provide more skb's, this may or may > not lead to further errors... > > Now, the rx_fifo errors is from hardware counter "missed packet count" > which means that a packet was dropped because the fifo was full (probably > indicated at least some of the time because the card was in "receive no > buffers" state) btw fifo errors and rx_missed are both being fed by the > same hardware counter. > > rx_csum_offload_errors is somewhat worrisome because it means that you're > receiving packets that appear to be corrupted. This could be from any > number of sources, but is most likely a misconfigured station on your lan > or something is corrupting checksums (a tcpdump would help debug here, but > would really slow things down) The packets are NOT dropped, but handed to > the stack to decide what to do. > > So, to mitigate the rnbc "receive no buffers count" a little you can > provide some more buffering on the receive side by loading the module with > RxDescriptors=3D2048 or something larger than the default of 256. this w= ill > help (if you haven't already) but will also probably increase the amount > of work your system has to do, as more packets will be able to be stored > up. =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart3504373.GH3shJKScU Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB4u9rqtjaBHGZBeURAv0yAJ9c7cSKfASuSPohBZa3oQULETdLuwCfWcLa 9M0cO9ukxBaJo3d6vEbdAdw= =5So+ -----END PGP SIGNATURE----- --nextPart3504373.GH3shJKScU-- From tgraf@suug.ch Mon Jan 10 01:17:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 01:17:43 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A9HaVk009071 for ; Mon, 10 Jan 2005 01:17:37 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id C4456F; Mon, 10 Jan 2005 22:17:04 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id DE6491C0EA; Mon, 10 Jan 2005 22:17:47 +0100 (CET) Date: Mon, 10 Jan 2005 22:17:47 +0100 From: Thomas Graf To: jamal Cc: netdev@oss.sgi.com Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier Message-ID: <20050110211747.GA26856@postel.suug.ch> References: <20050104223612.GN26856@postel.suug.ch> <1104894728.1117.56.camel@jzny.localdomain> <20050105110048.GO26856@postel.suug.ch> <1104931991.1117.152.camel@jzny.localdomain> <20050105144514.GQ26856@postel.suug.ch> <1105019225.2312.7.camel@jzny.localdomain> <20050106194102.GW26856@postel.suug.ch> <1105105511.1046.77.camel@jzny.localdomain> <20050108145457.GZ26856@postel.suug.ch> <1105363582.1041.162.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1105363582.1041.162.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 49 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1105363582.1041.162.camel@jzny.localdomain> 2005-01-10 08:26 > I think its _a hack_ Thomas ;-> Mostly because it has dependency on u32. > off2 doesnt exist on any other classifier and the basic ematch should be > usable by any classifier. It does not, u32 does have a dependency on em_u32 but not vice versa. em_u32 is perfectly useful even without nexthdr functionality since this is the way it is used today in 90% of the cases and it should be a little bit faster than em_cmp but also a bit less powerful. On top of that, rsvp could provide this information as well so one could extend rsvp with em_u32 ematches. I think we should not think of it as being dependant on off2 but rather as it is able to use information from a underlying layer. > Why not just have a check to see if it is native match then not to call > up any ematch executing code. Have the native match maybe be of kind 0. > Have the return code for ematch lookup return something that indicates > that you need to match using local u32 instead of ematch. This limits the number of native ematches to 1 or any other reserved number and complicates userspace part for no reason. Is there any advantage besides that it fits into layerrs more nicely? I can tell you the disavantages and then we can compare ;-> - additional code is required in the classifier which would not be required otherwise. - given we define 0 as native ematch, what happens if we need another native one? reserve a number in the namespace and make a comment, "please do not use" or will we just say, well, we can make it a regular ematch, it's not perfectly clean but it works perfectly fine? - making it a little bit generic such as em_u32 makes it useable by other classifiers. One example is the above mentioned rsvp which parses headers or there might be other specialized classifiers having use for it. we can't have this if its put into the classifier itself. - userspace needs additional special handling and this will get ugly once we need more than 1 native ematch, we'd need some register api so ematch modules could tell which numbers are native for them. - did i state it's more work already? ;-> From kaber@trash.net Mon Jan 10 01:21:19 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 01:21:22 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A9LI4v009580 for ; Mon, 10 Jan 2005 01:21:19 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Co6yG-0004hg-Gc; Mon, 10 Jan 2005 22:21:04 +0100 Message-ID: <41E2F1C0.90505@trash.net> Date: Mon, 10 Jan 2005 22:21:04 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: hadi@cyberus.ca CC: Maillist netdev , "David S. Miller" Subject: Re: [PATCH PKT_SCHED 0/22]: tc action cleanups References: <41E2D97A.1060400@trash.net> <1105391297.1084.54.camel@jzny.localdomain> In-Reply-To: <1105391297.1084.54.camel@jzny.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 50 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev jamal wrote: >On Mon, 2005-01-10 at 14:37, Patrick McHardy wrote: > >>Hi Jamal, >> >>following are the reorganized tc action cleanup patches with some >>additional fixes. Please review and comment, I would like to ask >>Dave to pull them in soon so I don't get more clashes. >> >> > >Other than the ipt breakage fix - Is there anything new since our last >discussion that you want me to pay attention to? >Sorry dont have the cycles to pay close attention today. Will do >tommorow. > There are a couple of new things, more noteable more action init fixes, but nothing that needs special attention. >You seem to also have touched some police code this time (I suppose the >LinuxWay payoff time is here).So, if you want me to pay close attention >to specific items i will; otherwise i would suggest that Dave sucks them >in, then we can resolve things later. > The police fixes are basically the same as for the other actions. Some more review can't hurt, but I think we can put them in now. Dave, please pull in the changes from bk://212.42.230.204/net-2.6-sched Regards Patrick From davem@davemloft.net Mon Jan 10 01:43:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 01:43:26 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A9hH8w010441 for ; Mon, 10 Jan 2005 01:43:21 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Co7Du-00071T-00; Mon, 10 Jan 2005 13:37:14 -0800 Date: Mon, 10 Jan 2005 13:37:14 -0800 From: "David S. Miller" To: Christoph Hellwig Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH 2/2] use rtnl_lock_interruptible in 8139 to avoid shutdown hang Message-Id: <20050110133714.023aa21b.davem@davemloft.net> In-Reply-To: <20050109121630.GB19599@lst.de> References: <20050109121630.GB19599@lst.de> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 51 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Sun, 9 Jan 2005 13:16:30 +0100 Christoph Hellwig wrote: > The 8139too thread needs to use rtnl_lock_interruptible so it can avoid > doing the actual work once it's been kill_proc()ed on module removal > time. > > Based on debugging and an earlier patch that adds a driver-private > semaphore from Herbert Xu. I've applied these two patches, they look perfectly fine. Thanks Christoph. From hch@lst.de Mon Jan 10 01:45:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 01:45:40 -0800 (PST) Received: from mail.lst.de (verein.lst.de [213.95.11.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A9jYpS010964 for ; Mon, 10 Jan 2005 01:45:35 -0800 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id j0ALjN6t017486 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Mon, 10 Jan 2005 22:45:23 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id j0ALjMdD017484; Mon, 10 Jan 2005 22:45:22 +0100 Date: Mon, 10 Jan 2005 22:45:22 +0100 From: Christoph Hellwig To: "David S. Miller" Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH 2/2] use rtnl_lock_interruptible in 8139 to avoid shutdown hang Message-ID: <20050110214522.GA17463@lst.de> References: <20050109121630.GB19599@lst.de> <20050110133714.023aa21b.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050110133714.023aa21b.davem@davemloft.net> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 52 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: netdev On Mon, Jan 10, 2005 at 01:37:14PM -0800, David S. Miller wrote: > On Sun, 9 Jan 2005 13:16:30 +0100 > Christoph Hellwig wrote: > > > The 8139too thread needs to use rtnl_lock_interruptible so it can avoid > > doing the actual work once it's been kill_proc()ed on module removal > > time. > > > > Based on debugging and an earlier patch that adds a driver-private > > semaphore from Herbert Xu. > > I've applied these two patches, they look perfectly fine. > Thanks Christoph. Btw, there's some confusing between rtnl_lock and rtnl_shlock (similar for the other variants). Is there an agenda behind this versions or would you take a patch that unifies the lock assecors? From juhl-lkml@dif.dk Mon Jan 10 01:48:19 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 01:48:27 -0800 (PST) Received: from mail.dif.dk (mail.dif.dk [193.138.115.101]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A9mGbs011433 for ; Mon, 10 Jan 2005 01:48:19 -0800 Received: from localhost (localhost [127.0.0.1]) by mail.dif.dk (Postfix) with ESMTP id 0D341FFC73 for ; Mon, 10 Jan 2005 22:52:32 +0100 (CET) Received: from mail.dif.dk ([127.0.0.1]) by localhost (saerimmer [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 17321-05 for ; Mon, 10 Jan 2005 22:52:31 +0100 (CET) Received: from diftmgw2.backbone.dif.dk (diftmgw2.backbone.dif.dk [10.227.136.246]) by mail.dif.dk (Postfix) with ESMTP id EBDF4FFC70 for ; Mon, 10 Jan 2005 22:52:30 +0100 (CET) Received: from DIFPST1A.backbone.dif.dk ([10.227.136.220]) by diftmgw2.backbone.dif.dk with InterScan Messaging Security Suite; Mon, 10 Jan 2005 22:47:27 +0100 Received: from [172.16.2.11] (10.227.136.29 [10.227.136.29]) by DIFPST1A.backbone.dif.dk with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2657.72) id CHBN38HB; Mon, 10 Jan 2005 22:48:00 +0100 Date: Mon, 10 Jan 2005 22:50:34 +0100 (CET) From: Jesper Juhl To: linux-kernel Cc: linux-net , netdev , Olaf Kirch Subject: [PATCH] remove unused variables in net/sunrpc/auth.c Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: by amavisd-new at dif.dk X-Virus-Status: Clean X-archive-position: 53 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: juhl-lkml@dif.dk Precedence: bulk X-list: netdev We have a few unused variables in net/sunrpc/auth.c:320: net/sunrpc/auth.c:320: warning: unused variable `auth' net/sunrpc/auth.c:333: warning: unused variable `auth' net/sunrpc/auth.c:345: warning: unused variable `auth' net/sunrpc/auth.c:385: warning: unused variable `auth' As far as I can see, the patch that caused them to become unused is this one (which btw is ~36 months old) : http://linux.bkbits.net:8080/linux-2.6/diffs/net/sunrpc/auth.c@1.4?nav=index.html|src/|src/net|src/net/sunrpc|hist/net/sunrpc/auth.c Here is a patch to get rid of them (compile tested only). Signed-off-by: Jesper Juhl diff -up linux-2.6.10-bk13-orig/net/sunrpc/auth.c linux-2.6.10-bk13/net/sunrpc/auth.c --- linux-2.6.10-bk13-orig/net/sunrpc/auth.c 2005-01-10 22:09:22.000000000 +0100 +++ linux-2.6.10-bk13/net/sunrpc/auth.c 2005-01-10 22:37:55.000000000 +0100 @@ -317,7 +317,6 @@ put_rpccred(struct rpc_cred *cred) void rpcauth_unbindcred(struct rpc_task *task) { - struct rpc_auth *auth = task->tk_auth; struct rpc_cred *cred = task->tk_msg.rpc_cred; dprintk("RPC: %4d releasing %s cred %p\n", @@ -330,7 +329,6 @@ rpcauth_unbindcred(struct rpc_task *task u32 * rpcauth_marshcred(struct rpc_task *task, u32 *p) { - struct rpc_auth *auth = task->tk_auth; struct rpc_cred *cred = task->tk_msg.rpc_cred; dprintk("RPC: %4d marshaling %s cred %p\n", @@ -342,7 +340,6 @@ rpcauth_marshcred(struct rpc_task *task, u32 * rpcauth_checkverf(struct rpc_task *task, u32 *p) { - struct rpc_auth *auth = task->tk_auth; struct rpc_cred *cred = task->tk_msg.rpc_cred; dprintk("RPC: %4d validating %s cred %p\n", @@ -382,7 +379,6 @@ rpcauth_unwrap_resp(struct rpc_task *tas int rpcauth_refreshcred(struct rpc_task *task) { - struct rpc_auth *auth = task->tk_auth; struct rpc_cred *cred = task->tk_msg.rpc_cred; dprintk("RPC: %4d refreshing %s cred %p\n", PS. please keep me on CC From davem@davemloft.net Mon Jan 10 01:51:58 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 01:52:04 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0A9pve6012133 for ; Mon, 10 Jan 2005 01:51:58 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Co7MI-00072w-00; Mon, 10 Jan 2005 13:45:54 -0800 Date: Mon, 10 Jan 2005 13:45:53 -0800 From: "David S. Miller" To: Patrick McHardy Cc: hadi@cyberus.ca, netdev@oss.sgi.com Subject: Re: [PATCH PKT_SCHED 0/22]: tc action cleanups Message-Id: <20050110134553.63d57dd3.davem@davemloft.net> In-Reply-To: <41E2D97A.1060400@trash.net> References: <41E2D97A.1060400@trash.net> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 54 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Mon, 10 Jan 2005 20:37:30 +0100 Patrick McHardy wrote: > following are the reorganized tc action cleanup patches with some > additional fixes. Please review and comment, I would like to ask > Dave to pull them in soon so I don't get more clashes. Lots of activity in this area :-) I'll try to put Thomas's tcf_exts patches in, then Patrick's on top. I'll do merge conflict resolution as necessary but if it gets too hairy we'll need to work on redoing these patches. From davem@davemloft.net Mon Jan 10 02:02:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 02:02:53 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0AA2nlp012706 for ; Mon, 10 Jan 2005 02:02:49 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Co7Wo-00075p-00; Mon, 10 Jan 2005 13:56:46 -0800 Date: Mon, 10 Jan 2005 13:56:46 -0800 From: "David S. Miller" To: Thomas Graf Cc: hadi@cyberus.ca, kaber@trash.net, netdev@oss.sgi.com Subject: Re: [RESEND 9/9] PKT_SCHED: Actions are now available for all classifiers & Fix police Kconfig dependencies Message-Id: <20050110135646.59c5a46b.davem@davemloft.net> In-Reply-To: <20041231141721.GL32419@postel.suug.ch> References: <20041230122652.GM32419@postel.suug.ch> <20041230123617.GV32419@postel.suug.ch> <20041231141721.GL32419@postel.suug.ch> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 55 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Ok, all 9 patches are in my tree now Thomas. Thanks. Let's now see how merging in Patrick's stuff goes. From markb@wetlettuce.com Mon Jan 10 02:04:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 02:04:13 -0800 (PST) Received: from piglet.wetlettuce.com (piglet.wetlettuce.com [82.68.149.69]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0AA46k4013093 for ; Mon, 10 Jan 2005 02:04:07 -0800 Received: from robin ([127.0.0.1] helo=wetlettuce.com ident=www-data) by piglet.wetlettuce.com with smtp (Exim 3.35 #1 (Debian)) id 1Co7d4-0000xf-00; Mon, 10 Jan 2005 22:03:14 +0000 Received: from 82.68.149.65 (SquirrelMail authenticated user lists) by webmail.wetlettuce.com with HTTP; Mon, 10 Jan 2005 22:03:14 -0000 (GMT) Message-ID: <35248.82.68.149.65.1105394594.squirrel@webmail.wetlettuce.com> Date: Mon, 10 Jan 2005 22:03:14 -0000 (GMT) Subject: Re: Followup to netpoll issues From: "Mark Broadbent" To: In-Reply-To: <20050107231815.GC17317@electric-eye.fr.zoreil.com> References: <1105045914.7687.3.camel@tigger> <20050107002053.GD27896@electric-eye.fr.zoreil.com> <1105128887.3814.20.camel@localhost> <20050107231815.GC17317@electric-eye.fr.zoreil.com> X-Priority: 3 Importance: Normal X-MSMail-Priority: Normal Cc: , Reply-To: markb@wetlettuce.com X-Mailer: SquirrelMail (version 1.2.6) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-MailScanner: Mail is clear of Viree X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 56 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: markb@wetlettuce.com Precedence: bulk X-list: netdev Francois Romieu said: > Mark Broadbent : > [...] >> No need, if netpoll_cleanup is called whilst a retry is pending the tx >> list lock is taken. All the references to the netpoll pointer are >> deleted from the pending list before the lock is released. > > I may be a bit dense but: > > t0 : tx_retry_wq().queue_delayed_work(tx_wq, &tx_wq_obj, > HZ/100); > > t0 + 10*HZ/1000: tx_retry_wq() is done (it was not fast for sure) > > t0 + 20*HZ/1000: netpoll_cleanup() + module removal > > t0 + HZ/100 : tx_retry_wq() <- Where are its code and data ? You logic is correct but I'm positive that netpoll.o is always built into the kernel image and hence cannot be unloaded. > [...] Thanks Mark -- Mark Broadbent Web: http://www.wetlettuce.com From hadi@cyberus.ca Mon Jan 10 02:06:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 02:06:15 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0AA6AKu013676 for ; Mon, 10 Jan 2005 02:06:11 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1Co7fn-0001bh-KF for netdev@oss.sgi.com; Mon, 10 Jan 2005 17:06:03 -0500 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Co7fS-0001Aq-T7; Mon, 10 Jan 2005 17:05:43 -0500 Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: netdev@oss.sgi.com In-Reply-To: <20050110211747.GA26856@postel.suug.ch> References: <20050104223612.GN26856@postel.suug.ch> <1104894728.1117.56.camel@jzny.localdomain> <20050105110048.GO26856@postel.suug.ch> <1104931991.1117.152.camel@jzny.localdomain> <20050105144514.GQ26856@postel.suug.ch> <1105019225.2312.7.camel@jzny.localdomain> <20050106194102.GW26856@postel.suug.ch> <1105105511.1046.77.camel@jzny.localdomain> <20050108145457.GZ26856@postel.suug.ch> <1105363582.1041.162.camel@jzny.localdomain> <20050110211747.GA26856@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105394738.1085.63.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 10 Jan 2005 17:05:38 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 57 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Mon, 2005-01-10 at 16:17, Thomas Graf wrote: > * jamal <1105363582.1041.162.camel@jzny.localdomain> 2005-01-10 08:26 > > I think its _a hack_ Thomas ;-> Mostly because it has dependency on u32. > > off2 doesnt exist on any other classifier and the basic ematch should be > > usable by any classifier. > > It does not, u32 does have a dependency on em_u32 but not vice versa. > em_u32 is perfectly useful even without nexthdr functionality since > this is the way it is used today in 90% of the cases and it should be > a little bit faster than em_cmp but also a bit less powerful. On top > of that, rsvp could provide this information as well so one could > extend rsvp with em_u32 ematches. I think we should not think of it > as being dependant on off2 but rather as it is able to use information > from a underlying layer. Ok, you make a convincing arguement ;-> No more concerns from my side. Churn that code! cheers, jamal From akepner@sgi.com Mon Jan 10 02:09:52 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 02:09:57 -0800 (PST) Received: from omx1.americas.sgi.com (omx1-ext.sgi.com [192.48.179.11]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0AA9n7T014208 for ; Mon, 10 Jan 2005 02:09:51 -0800 Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) by omx1.americas.sgi.com (8.12.10/8.12.9/linux-outbound_gateway-1.1) with ESMTP id j0AM9fxT032018 for ; Mon, 10 Jan 2005 16:09:41 -0600 Received: from [192.168.2.20] (IDENT:akepner@mtv-vpn-sw-corp-0-95.corp.sgi.com [134.15.0.95]) by cthulhu.engr.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id j0AM9XtX7148301; Mon, 10 Jan 2005 14:09:33 -0800 (PST) Date: Sun, 9 Jan 2005 19:59:11 -0600 (CST) From: "Arthur D. Kepner" X-Sender: akepner@localhost.localdomain To: "David S. Miller" cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH bk-2.6.10] tg3:align IP headers from 5701 in PCI-X mode In-Reply-To: <20050110125001.4fe4d00b.davem@davemloft.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 58 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akepner@sgi.com Precedence: bulk X-list: netdev On Mon, 10 Jan 2005, David S. Miller wrote: > Let's just do this all the time for this case, adding new config > options for stuff like this does nothing more than create confusion. OK, you mean like the following? diffstats: tg3.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletion(-) Signed-off-by: Arthur Kepner ===== drivers/net/tg3.c 1.222 vs edited ===== --- 1.222/drivers/net/tg3.c 2004-11-15 15:53:08 -08:00 +++ edited/drivers/net/tg3.c 2005-01-10 13:35:33 -08:00 @@ -2702,7 +2702,11 @@ static int tg3_rx(struct tg3 *tp, int bu len = ((desc->idx_len & RXD_LEN_MASK) >> RXD_LEN_SHIFT) - 4; /* omit crc */ - if (len > RX_COPY_THRESHOLD) { + if (len > RX_COPY_THRESHOLD + && tp->rx_offset == 2 + /* rx_offset != 2 iff this is a 5701 card running + * in PCI-X mode [see tg3_get_invariants()] */ + ) { int skb_size; skb_size = tg3_alloc_rx_skb(tp, opaque_key, -- Arthur From bunk@stusta.de Mon Jan 10 02:17:12 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 02:17:18 -0800 (PST) Received: from mailout.stusta.mhn.de (emailhub.stusta.mhn.de [141.84.69.5]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0AAHBaN014753 for ; Mon, 10 Jan 2005 02:17:12 -0800 Received: (qmail 723 invoked from network); 10 Jan 2005 22:16:57 -0000 Received: from r063144.stusta.swh.mhn.de (10.150.63.144) by mailhub.stusta.mhn.de with SMTP; 10 Jan 2005 22:16:57 -0000 Received: by r063144.stusta.swh.mhn.de (Postfix, from userid 1000) id 3946BBB4BD; Mon, 10 Jan 2005 23:16:51 +0100 (CET) Date: Mon, 10 Jan 2005 23:16:51 +0100 From: Adrian Bunk To: Jesper Juhl Cc: linux-kernel , linux-net , netdev Subject: Re: [PATCH] remove unused variables in net/sunrpc/auth.c Message-ID: <20050110221651.GA29578@stusta.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 59 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bunk@stusta.de Precedence: bulk X-list: netdev On Mon, Jan 10, 2005 at 10:50:34PM +0100, Jesper Juhl wrote: > > We have a few unused variables in net/sunrpc/auth.c:320: > > net/sunrpc/auth.c:320: warning: unused variable `auth' > net/sunrpc/auth.c:333: warning: unused variable `auth' > net/sunrpc/auth.c:345: warning: unused variable `auth' > net/sunrpc/auth.c:385: warning: unused variable `auth' > > As far as I can see, the patch that caused them to become unused is this > one (which btw is ~36 months old) : > http://linux.bkbits.net:8080/linux-2.6/diffs/net/sunrpc/auth.c@1.4?nav=index.html|src/|src/net|src/net/sunrpc|hist/net/sunrpc/auth.c > > Here is a patch to get rid of them (compile tested only). >... Doesn't this break with CONFIG_SYSCTL=y? cu Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed From davem@davemloft.net Mon Jan 10 02:29:57 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 02:30:00 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0AATusS015555 for ; Mon, 10 Jan 2005 02:29:56 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Co7x6-0007D1-00; Mon, 10 Jan 2005 14:23:56 -0800 Date: Mon, 10 Jan 2005 14:23:56 -0800 From: "David S. Miller" To: Patrick McHardy Cc: hadi@cyberus.ca, netdev@oss.sgi.com Subject: Re: [PATCH PKT_SCHED 22/22]: Don't export ing_filter Message-Id: <20050110142356.157d9a41.davem@davemloft.net> In-Reply-To: <41E2D9AC.6020200@trash.net> References: <41E2D9AC.6020200@trash.net> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 60 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Ok, all applied. I'm doing test builds and pushing this up to my usual spot: bk://kernel.bkbits.net/davem/net-2.6 I plan to push this upstream to Linus either tonight or tomorrow. Let me know if anything explodes. Thanks guys. From rddunlap@osdl.org Mon Jan 10 03:16:52 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 03:16:58 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ABGoZ2018636 for ; Mon, 10 Jan 2005 03:16:51 -0800 Received: from gargoyle.pdx.osdl.net (gargoyle.pdx.osdl.net [172.20.1.49]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id j0ANGMd24260; Mon, 10 Jan 2005 15:16:22 -0800 Date: Mon, 10 Jan 2005 15:04:11 -0800 From: "Randy.Dunlap" To: jgarzik , acme@conectiva.com.br Cc: netdev Subject: [PATCH] wl3501: fix module_param types/warnings Message-Id: <20050110150411.4bbef660.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; i386-vine-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 61 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Linux 2.6.10-bk13 Fix gcc warning: drivers/net/wireless/wl3501_cs.c:2282: warning: return from incompatible pointer type module_param() isn't happy about different types for irq_mask; unsigned long vs. int. Make it uint consistently. Signed-off-by: Randy Dunlap diffstat:= drivers/net/wireless/wl3501_cs.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff -Naurp ./drivers/net/wireless/wl3501_cs.c~wl3501_types ./drivers/net/wireless/wl3501_cs.c --- ./drivers/net/wireless/wl3501_cs.c~wl3501_types 2005-01-10 10:38:39.908438288 -0800 +++ ./drivers/net/wireless/wl3501_cs.c 2005-01-10 12:40:44.175980376 -0800 @@ -100,7 +100,7 @@ module_param(pc_debug, int, 0); /* Parameters that can be set with 'insmod' */ /* Bit map of interrupts to choose from */ /* This means pick from 15, 14, 12, 11, 10, 9, 7, 5, 4, and 3 */ -static unsigned long wl3501_irq_mask = 0xdeb8; +static unsigned int wl3501_irq_mask = 0xdeb8; static int wl3501_irq_list[4] = { -1 }; /* @@ -2279,7 +2279,7 @@ static void __exit wl3501_exit_module(vo module_init(wl3501_init_module); module_exit(wl3501_exit_module); -module_param(wl3501_irq_mask, int, 0); +module_param(wl3501_irq_mask, uint, 0); module_param_array(wl3501_irq_list, int, NULL, 0); MODULE_AUTHOR("Fox Chen , " "Arnaldo Carvalho de Melo ," --- From tgraf@suug.ch Mon Jan 10 03:30:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 03:30:40 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ABUZVD019263 for ; Mon, 10 Jan 2005 03:30:35 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 0195CF; Tue, 11 Jan 2005 00:30:04 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 967F31C0EA; Tue, 11 Jan 2005 00:30:47 +0100 (CET) Date: Tue, 11 Jan 2005 00:30:47 +0100 From: Thomas Graf To: jamal Cc: netdev@oss.sgi.com Subject: Re: [RFC] ematch API, u32 ematch, nbyte ematch, basic classifier Message-ID: <20050110233047.GC26856@postel.suug.ch> References: <20050105110048.GO26856@postel.suug.ch> <1104931991.1117.152.camel@jzny.localdomain> <20050105144514.GQ26856@postel.suug.ch> <1105019225.2312.7.camel@jzny.localdomain> <20050106194102.GW26856@postel.suug.ch> <1105105511.1046.77.camel@jzny.localdomain> <20050108145457.GZ26856@postel.suug.ch> <1105363582.1041.162.camel@jzny.localdomain> <20050110211747.GA26856@postel.suug.ch> <1105394738.1085.63.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1105394738.1085.63.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 62 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1105394738.1085.63.camel@jzny.localdomain> 2005-01-10 17:05 > On Mon, 2005-01-10 at 16:17, Thomas Graf wrote: > > * jamal <1105363582.1041.162.camel@jzny.localdomain> 2005-01-10 08:26 > > > I think its _a hack_ Thomas ;-> Mostly because it has dependency on u32. > > > off2 doesnt exist on any other classifier and the basic ematch should be > > > usable by any classifier. > > > > It does not, u32 does have a dependency on em_u32 but not vice versa. > > em_u32 is perfectly useful even without nexthdr functionality since > > this is the way it is used today in 90% of the cases and it should be > > a little bit faster than em_cmp but also a bit less powerful. On top > > of that, rsvp could provide this information as well so one could > > extend rsvp with em_u32 ematches. I think we should not think of it > > as being dependant on off2 but rather as it is able to use information > > from a underlying layer. > > Ok, you make a convincing arguement ;-> No more concerns from my side. > Churn that code! I started testing via the basic classifier but will do the cls_u32 changes soon and then remerge and do the final tests once all the other pkt_sched changes have made it into linus's tree and I can work from a fresh bk tree. I'll also try to find the time this week to do the iproute2 changes for the tcf_exts changset so iproute2 is actually capable of configuring actions for all classifiers. From jt@bougret.hpl.hp.com Mon Jan 10 04:44:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 04:44:09 -0800 (PST) Received: from palrel13.hp.com (palrel13.hp.com [156.153.255.238]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ACi3pu013173 for ; Mon, 10 Jan 2005 04:44:03 -0800 Received: from tomil.hpl.hp.com (tomil.hpl.hp.com [15.0.152.100]) by palrel13.hp.com (Postfix) with ESMTP id 6EC8D1C0B06A; Mon, 10 Jan 2005 16:43:55 -0800 (PST) Received: from bougret.hpl.hp.com (bougret.hpl.hp.com [15.4.92.227]) by tomil.hpl.hp.com (8.9.3 (PHNE_29774)/8.9.3 HPLabs Timeshare Server) with ESMTP id QAA29157; Mon, 10 Jan 2005 16:45:16 -0800 (PST) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 1CoA8Y-0004eW-00; Mon, 10 Jan 2005 16:43:54 -0800 Date: Mon, 10 Jan 2005 16:43:54 -0800 To: "Randy.Dunlap" Cc: netdev@oss.sgi.com, jgarzik Subject: Re: [PATCH[ via-ircc: fix exit section usage Message-ID: <20050111004354.GO14400@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com References: <20050106230803.00714c45.rddunlap@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050106230803.00714c45.rddunlap@osdl.org> User-Agent: Mutt/1.3.28i Organisation: HP Labs Palo Alto Address: HP Labs, 1U-17, 1501 Page Mill road, Palo Alto, CA 94304, USA. E-mail: jt@hpl.hp.com From: Jean Tourrilhes X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 63 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jt@bougret.hpl.hp.com Precedence: bulk X-list: netdev On Thu, Jan 06, 2005 at 11:08:03PM -0800, Randy.Dunlap wrote: > > Fix exit section usage, starting with this Error > from reference_discarded.pl (make buildcheck): > Error: ./drivers/net/irda/via-ircc.o .data refers to 000000f8 R_386_32 .exit.text > > Signed-off-by: Randy Dunlap Sounds good to me ;-) Jean > diffstat:= > drivers/net/irda/via-ircc.c | 12 ++++++------ > 1 files changed, 6 insertions(+), 6 deletions(-) > > diff -Naurp ./drivers/net/irda/via-ircc.c~irda_via_devexit ./drivers/net/irda/via-ircc.c > --- ./drivers/net/irda/via-ircc.c~irda_via_devexit 2004-12-24 13:33:47.000000000 -0800 > +++ ./drivers/net/irda/via-ircc.c 2005-01-06 21:18:49.742203456 -0800 > @@ -83,7 +83,7 @@ static struct via_ircc_cb *dev_self[] = > > /* Some prototypes */ > static int via_ircc_open(int i, chipio_t * info, unsigned int id); > -static int __exit via_ircc_close(struct via_ircc_cb *self); > +static int via_ircc_close(struct via_ircc_cb *self); > static int via_ircc_dma_receive(struct via_ircc_cb *self); > static int via_ircc_dma_receive_complete(struct via_ircc_cb *self, > int iobase); > @@ -111,7 +111,7 @@ static void hwreset(struct via_ircc_cb * > static int via_ircc_dma_xmit(struct via_ircc_cb *self, u16 iobase); > static int upload_rxdata(struct via_ircc_cb *self, int iobase); > static int __devinit via_init_one (struct pci_dev *pcidev, const struct pci_device_id *id); > -static void __exit via_remove_one (struct pci_dev *pdev); > +static void __devexit via_remove_one (struct pci_dev *pdev); > > /* FIXME : Should use udelay() instead, even if we are x86 only - Jean II */ > static void iodelay(int udelay) > @@ -140,7 +140,7 @@ static struct pci_driver via_driver = { > .name = VIA_MODULE_NAME, > .id_table = via_pci_tbl, > .probe = via_init_one, > - .remove = via_remove_one, > + .remove = __devexit_p(via_remove_one), > }; > > > @@ -273,7 +273,7 @@ static int __devinit via_init_one (struc > * Close all configured chips > * > */ > -static void __exit via_ircc_clean(void) > +static void via_ircc_clean(void) > { > int i; > > @@ -285,7 +285,7 @@ static void __exit via_ircc_clean(void) > } > } > > -static void __exit via_remove_one (struct pci_dev *pdev) > +static void __devexit via_remove_one (struct pci_dev *pdev) > { > IRDA_DEBUG(3, "%s()\n", __FUNCTION__); > > @@ -468,7 +468,7 @@ static __devinit int via_ircc_open(int i > * Close driver instance > * > */ > -static int __exit via_ircc_close(struct via_ircc_cb *self) > +static int via_ircc_close(struct via_ircc_cb *self) > { > int iobase; > > > --- From davem@davemloft.net Mon Jan 10 05:56:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 05:56:53 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ADumWA015367 for ; Mon, 10 Jan 2005 05:56:48 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CoBBC-0007gw-00; Mon, 10 Jan 2005 17:50:42 -0800 Date: Mon, 10 Jan 2005 17:50:42 -0800 From: "David S. Miller" To: Christoph Hellwig Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH 2/2] use rtnl_lock_interruptible in 8139 to avoid shutdown hang Message-Id: <20050110175042.53eaa3c1.davem@davemloft.net> In-Reply-To: <20050110214522.GA17463@lst.de> References: <20050109121630.GB19599@lst.de> <20050110133714.023aa21b.davem@davemloft.net> <20050110214522.GA17463@lst.de> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 64 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Mon, 10 Jan 2005 22:45:22 +0100 Christoph Hellwig wrote: > Btw, there's some confusing between rtnl_lock and rtnl_shlock (similar > for the other variants). Is there an agenda behind this versions or > would you take a patch that unifies the lock assecors? What exactly do you plan to change? From kaber@trash.net Mon Jan 10 07:05:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 07:05:41 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0AF5asV018007 for ; Mon, 10 Jan 2005 07:05:37 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CoCKw-0008DW-9D; Tue, 11 Jan 2005 04:04:50 +0100 Message-ID: <41E34252.504@trash.net> Date: Tue, 11 Jan 2005 04:04:50 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: Herbert Xu , netdev@oss.sgi.com Subject: Re: request_module while holding rtnl semaphore References: <41899DCF.3050804@trash.net> <20041109161126.376f755c.davem@davemloft.net> In-Reply-To: <20041109161126.376f755c.davem@davemloft.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 65 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev David S. Miller wrote: >Therefore I suggest we just implement the fix for this inside of >the packet scheduler layer itself. Simply by dropping the RTNL >semaphore during the module request, and then regrabbing the RTNL >semaphore and replaying the request from the beginning. > >The net/sched/sch_api.c version of the fix would look like the >following. The act_api.c case would require a bit more surgery, >but with the right restructuring it can be done too. > > This patch got lost somehow. The act_api.c changes are actually even more complicated because besides the action init path, changes can also be made from classifiers in a deep call-chain. I hope Thomas's recent changes make it easier to fix this, but I think this patch should go in now anyway. Regards Patrick >===== net/sched/sch_api.c 1.41 vs edited ===== >--- 1.41/net/sched/sch_api.c 2004-11-05 16:34:45 -08:00 >+++ edited/net/sched/sch_api.c 2004-11-09 15:57:19 -08:00 >@@ -396,17 +396,30 @@ > struct Qdisc_ops *ops; > int size; > >+ err = -EINVAL; > ops = qdisc_lookup_ops(kind); > #ifdef CONFIG_KMOD > if (ops==NULL && tca[TCA_KIND-1] != NULL) { > if (RTA_PAYLOAD(kind) <= IFNAMSIZ) { >+ rtnl_unlock(); > request_module("sch_%s", (char*)RTA_DATA(kind)); >+ rtnl_lock(); >+ > ops = qdisc_lookup_ops(kind); >+ >+ /* We dropped the RTNL semaphore in order to >+ * perform the module load. So, even if we >+ * succeeded in loading the module we have to >+ * tell the caller to replay the request. We >+ * indicate this using -EAGAIN. >+ */ >+ if (ops != NULL) >+ err = -EAGAIN; >+ goto err_out; > } > } > #endif > >- err = -EINVAL; > if (ops == NULL) > goto err_out; > err = -EBUSY; >@@ -600,14 +613,19 @@ > > static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n, void *arg) > { >- struct tcmsg *tcm = NLMSG_DATA(n); >- struct rtattr **tca = arg; >+ struct tcmsg *tcm; >+ struct rtattr **tca; > struct net_device *dev; >- u32 clid = tcm->tcm_parent; >- struct Qdisc *q = NULL; >- struct Qdisc *p = NULL; >+ u32 clid; >+ struct Qdisc *q, *p; > int err; > >+replay: >+ tcm = NLMSG_DATA(n); >+ tca = arg; >+ clid = tcm->tcm_parent; >+ q = p = NULL; >+ > if ((dev = __dev_get_by_index(tcm->tcm_ifindex)) == NULL) > return -ENODEV; > >@@ -701,8 +719,14 @@ > q = qdisc_create(dev, tcm->tcm_parent, tca, &err); > else > q = qdisc_create(dev, tcm->tcm_handle, tca, &err); >- if (q == NULL) >+ if (q == NULL) { >+ if (err == -EAGAIN) { >+ /* Replay the request. */ >+ dev_put(dev); >+ goto replay; >+ } > return err; >+ } > > graft: > if (1) { > > > From nakam@linux-ipv6.org Mon Jan 10 08:16:30 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 08:16:34 -0800 (PST) Received: from mail206.noc.n-bone.net (mail2.noc.n-bone.net [138.243.50.142]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0AGGTT6020049 for ; Mon, 10 Jan 2005 08:16:30 -0800 Received: from localhost (polaris.linux-ipv6.org [203.178.140.10]) by mail206.noc.n-bone.net (NBONE-MTA) with ESMTP id 7A5DCF11; Tue, 11 Jan 2005 13:16:15 +0900 (JST) Date: Tue, 11 Jan 2005 13:16:37 +0900 From: Masahide Nakamura To: Stephen Hemminger Cc: netdev@oss.sgi.com, linux-net@vger.kernel.org, nakam@linux-ipv6.org Subject: [PATCH] [iproute2] MONITOR: show IPv6 prefix list Message-ID: <20050111131637.7d1fe805@localhost> X-Mailer: Sylpheed-Claws 0.9.12b (GTK+ 1.2.10; i386-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 67 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nakam@linux-ipv6.org Precedence: bulk X-list: netdev Hi, This is also iproute2 patch, ipmonitor shows IPv6 prefix list notification from kernel (tested on 2.6.10). Please apply it. The ChangeSet is also available at: Regards, # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/11 12:45:13+09:00 nakam@linux-ipv6.org # ipmonitor: show prefix information. # # ip/ipprefix.c # 2005/01/11 12:45:12+09:00 nakam@linux-ipv6.org +107 -0 # # BitKeeper/etc/logging_ok # 2005/01/11 12:45:13+09:00 nakam@linux-ipv6.org +1 -0 # Logging to logging@openlogging.org accepted # # ip/ipprefix.c # 2005/01/11 12:45:12+09:00 nakam@linux-ipv6.org +0 -0 # BitKeeper file /home/nakam/src/bk/iproute2-prefix/ip/ipprefix.c # # ip/ipmonitor.c # 2005/01/11 12:45:12+09:00 nakam@linux-ipv6.org +12 -0 # support prefix information. # # ip/ip_common.h # 2005/01/11 12:45:12+09:00 nakam@linux-ipv6.org +2 -0 # print prefix information. # # ip/Makefile # 2005/01/11 12:45:12+09:00 nakam@linux-ipv6.org +1 -1 # add a file for prefix information. # diff -Nru a/ip/Makefile b/ip/Makefile --- a/ip/Makefile Tue Jan 11 13:11:20 2005 +++ b/ip/Makefile Tue Jan 11 13:11:20 2005 @@ -1,6 +1,6 @@ IPOBJ=ip.o ipaddress.o iproute.o iprule.o \ rtm_map.o iptunnel.o ipneigh.o iplink.o \ - ipmaddr.o ipmonitor.o ipmroute.o \ + ipmaddr.o ipmonitor.o ipmroute.o ipprefix.o \ ipxfrm.o xfrm_state.o xfrm_policy.o RTMONOBJ=rtmon.o diff -Nru a/ip/ip_common.h b/ip/ip_common.h --- a/ip/ip_common.h Tue Jan 11 13:11:20 2005 +++ b/ip/ip_common.h Tue Jan 11 13:11:20 2005 @@ -15,6 +15,8 @@ extern void ipneigh_reset_filter(void); extern int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg); +extern int print_prefix(const struct sockaddr_nl *who, + struct nlmsghdr *n, void *arg); extern int do_ipaddr(int argc, char **argv); extern int do_iproute(int argc, char **argv); extern int do_iprule(int argc, char **argv); diff -Nru a/ip/ipmonitor.c b/ip/ipmonitor.c --- a/ip/ipmonitor.c Tue Jan 11 13:11:20 2005 +++ b/ip/ipmonitor.c Tue Jan 11 13:11:20 2005 @@ -55,6 +55,10 @@ print_neigh(who, n, arg); return 0; } + if (n->nlmsg_type == RTM_NEWPREFIX) { + print_prefix(who, n, arg); + return 0; + } if (n->nlmsg_type == 15) { char *tstr; time_t secs = ((__u32*)NLMSG_DATA(n))[0]; @@ -87,6 +91,7 @@ int llink=0; int laddr=0; int lroute=0; + int lprefix=0; ipaddr_reset_filter(1); iproute_reset_filter(); @@ -105,6 +110,9 @@ } else if (matches(*argv, "route") == 0) { lroute=1; groups = 0; + } else if (matches(*argv, "prefix") == 0) { + lprefix=1; + groups = 0; } else if (strcmp(*argv, "all") == 0) { groups = ~RTMGRP_TC; } else if (matches(*argv, "help") == 0) { @@ -129,6 +137,10 @@ groups |= RTMGRP_IPV4_ROUTE; if (!preferred_family || preferred_family == AF_INET6) groups |= RTMGRP_IPV6_ROUTE; + } + if (lprefix) { + if (!preferred_family || preferred_family == AF_INET6) + groups |= RTMGRP_IPV6_PREFIX; } if (file) { diff -Nru a/ip/ipprefix.c b/ip/ipprefix.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/ip/ipprefix.c Tue Jan 11 13:11:20 2005 @@ -0,0 +1,107 @@ +/* + * Copyright (C)2005 USAGI/WIDE Project + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +/* + * based on ip.c, iproute.c + */ +/* + * Authors: + * Masahide NAKAMURA @USAGI + */ + +#include +#include +#include +#include +#include "utils.h" + +/* prefix flags; see kernel's net/ipv6/addrconf.c and include/net/if_inet6.h */ +#define IF_PREFIX_ONLINK 0x01 +#define IF_PREFIX_AUTOCONF 0x02 + +int print_prefix(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) +{ + FILE *fp = (FILE*)arg; + struct prefixmsg *prefix = NLMSG_DATA(n); + int len = n->nlmsg_len; + struct rtattr * tb[RTA_MAX+1]; + int family = preferred_family; + + if (n->nlmsg_type != RTM_NEWPREFIX) { + fprintf(stderr, "Not a prefix: %08x %08x %08x\n", + n->nlmsg_len, n->nlmsg_type, n->nlmsg_flags); + return 0; + } + + len -= NLMSG_LENGTH(sizeof(*prefix)); + if (len < 0) { + fprintf(stderr, "BUG: wrong nlmsg len %d\n", len); + return -1; + } + + if (family == AF_UNSPEC) + family = AF_INET6; + if (family != AF_INET6) + return 0; + + if (prefix->prefix_family != AF_INET6) { + fprintf(stderr, "wrong family %d\n", prefix->prefix_family); + return 0; + } + if (prefix->prefix_type != ND_OPT_PREFIX_INFORMATION) { + fprintf(stderr, "wrong ND type %d\n", prefix->prefix_type); + return 0; + } + + memset(tb, 0, sizeof(tb)); + parse_rtattr(tb, RTA_MAX, RTM_RTA(prefix), len); + + fprintf(fp, "prefix "); + + if (tb[PREFIX_ADDRESS]) { + struct in6_addr *pfx; + char abuf[256]; + + pfx = (struct in6_addr *)RTA_DATA(tb[PREFIX_ADDRESS]); + + memset(abuf, '\0', sizeof(abuf)); + fprintf(fp, "%s", rt_addr_n2a(family, sizeof(*pfx), pfx, + abuf, sizeof(abuf))); + } + fprintf(fp, "/%u ", prefix->prefix_len); + + fprintf(fp, "dev %s ", ll_index_to_name(prefix->prefix_ifindex)); + + if (prefix->prefix_flags & IF_PREFIX_ONLINK) + fprintf(fp, "onlink "); + if (prefix->prefix_flags & IF_PREFIX_AUTOCONF) + fprintf(fp, "autoconf "); + + if (tb[PREFIX_CACHEINFO]) { + struct prefix_cacheinfo *pc; + pc = (struct prefix_cacheinfo *)tb[PREFIX_CACHEINFO]; + + fprintf(fp, "valid %u ", pc->valid_time); + fprintf(fp, "preferred %u ", pc->preferred_time); + } + + fprintf(fp, "\n"); + fflush(fp); + + return 0; +} + -- Masahide NAKAMURA From nakam@linux-ipv6.org Mon Jan 10 08:15:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 08:16:02 -0800 (PST) Received: from mail406.noc.n-bone.net (mail4.noc.n-bone.net [138.243.50.144]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0AGFqZf019979 for ; Mon, 10 Jan 2005 08:15:53 -0800 Received: from localhost (polaris.linux-ipv6.org [203.178.140.10]) by mail406.noc.n-bone.net (NBONE-MTA) with ESMTP id 085ED1745; Tue, 11 Jan 2005 13:15:39 +0900 (JST) Date: Tue, 11 Jan 2005 13:15:55 +0900 From: Masahide Nakamura To: Stephen Hemminger Cc: netdev@oss.sgi.com, linux-net@vger.kernel.org, nakam@linux-ipv6.org Subject: [PATCH] [iproute2] XFRM: replay-window and DECAP_DSCP flag Message-ID: <20050111131555.06dd9144@localhost> X-Mailer: Sylpheed-Claws 0.9.12b (GTK+ 1.2.10; i386-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 66 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nakam@linux-ipv6.org Precedence: bulk X-list: netdev Hello Stephen, This is an update for iproute2 xfrm. - add an interface to specify replay-window. - support DECAP_DSCP flag. - minor fixes. (Mainly it improves output format.) I've tested with 2.6.10. Please apply it. The ChangeSet is also available at: Regards, # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/09 15:21:35+09:00 nakam@linux-ipv6.org # add an interface to specify replay-window. # support DECAP_DSCP flag. # minor fixes. # # BitKeeper/etc/logging_ok # 2005/01/09 15:21:35+09:00 nakam@linux-ipv6.org +1 -0 # Logging to logging@openlogging.org accepted # # ip/xfrm_state.c # 2005/01/09 15:21:30+09:00 nakam@linux-ipv6.org +41 -26 # fix to compare addresses correctly. # improve output style. # add an interface to specify replay-window. # support DECAP_DSCP flag. # # ip/xfrm_policy.c # 2005/01/09 15:21:30+09:00 nakam@linux-ipv6.org +7 -11 # fix to compare addresses correctly. # improve output style. # # ip/xfrm.h # 2005/01/09 15:21:30+09:00 nakam@linux-ipv6.org +26 -16 # improve output style. # # ip/ipxfrm.c # 2005/01/09 15:21:30+09:00 nakam@linux-ipv6.org +152 -96 # fix to verify lengh of RTA_DATA before print it. # improve output style. # add a function to compare xfrm address. # diff -Nru a/ip/ipxfrm.c b/ip/ipxfrm.c --- a/ip/ipxfrm.c 2005-01-09 15:31:16 +09:00 +++ b/ip/ipxfrm.c 2005-01-09 15:31:16 +09:00 @@ -52,14 +52,43 @@ exit(-1); } +/* This is based on utils.c(inet_addr_match) */ +int xfrm_addr_match(xfrm_address_t *x1, xfrm_address_t *x2, int bits) +{ + __u32 *a1 = (__u32 *)x1; + __u32 *a2 = (__u32 *)x2; + int words = bits >> 0x05; + + bits &= 0x1f; + + if (words) + if (memcmp(a1, a2, words << 2)) + return -1; + + if (bits) { + __u32 w1, w2; + __u32 mask; + + w1 = a1[words]; + w2 = a2[words]; + + mask = htonl((0xffffffff) << (0x20 - bits)); + + if ((w1 ^ w2) & mask) + return 1; + } + + return 0; +} + struct typeent { const char *t_name; int t_type; }; static const struct typeent xfrmproto_types[]= { - { "esp", IPPROTO_ESP }, { "ah", IPPROTO_AH }, - { "comp", IPPROTO_COMP }, { NULL, -1 } + { "esp", IPPROTO_ESP }, { "ah", IPPROTO_AH }, { "comp", IPPROTO_COMP }, + { NULL, -1 } }; int xfrm_xfrmproto_getbyname(char *name) @@ -131,20 +160,29 @@ return NULL; } -const char *strxf_flags(__u8 flags) +const char *strxf_mask8(__u8 mask) { static char str[16]; - const int sn = sizeof(flags) * 8 - 1; + const int sn = sizeof(mask) * 8 - 1; __u8 b; int i = 0; for (b = (1 << sn); b > 0; b >>= 1) - str[i++] = ((b & flags) ? '1' : '0'); + str[i++] = ((b & mask) ? '1' : '0'); str[i] = '\0'; return str; } +const char *strxf_mask32(__u32 mask) +{ + static char str[16]; + + sprintf(str, "%.8x", mask); + + return str; +} + const char *strxf_share(__u8 share) { static char str[32]; @@ -163,7 +201,7 @@ strcpy(str, "unique"); break; default: - sprintf(str, "%d", share); + sprintf(str, "%u", share); break; } @@ -180,7 +218,7 @@ if (pp) p = pp->p_name; else { - sprintf(buf, "%d", proto); + sprintf(buf, "%u", proto); p = buf; } @@ -188,11 +226,10 @@ } void xfrm_id_info_print(xfrm_address_t *saddr, struct xfrm_id *id, - __u8 mode, __u32 reqid, __u16 family, FILE *fp, - const char *prefix) + __u8 mode, __u32 reqid, __u16 family, int force_spi, + FILE *fp, const char *prefix) { char abuf[256]; - __u32 spi; if (prefix) fprintf(fp, prefix); @@ -211,11 +248,14 @@ fprintf(fp, "proto %s ", strxf_xfrmproto(id->proto)); - spi = ntohl(id->spi); - fprintf(fp, "spi 0x%08x", spi); - if (show_stats > 0) - fprintf(fp, "(%u)", spi); - fprintf(fp, " "); + + if (show_stats > 0 || force_spi || id->spi) { + __u32 spi = ntohl(id->spi); + fprintf(fp, "spi 0x%08x", spi); + if (show_stats > 0) + fprintf(fp, "(%u)", spi); + fprintf(fp, " "); + } fprintf(fp, "reqid %u", reqid); if (show_stats > 0) @@ -258,9 +298,9 @@ if (prefix) fprintf(fp, prefix); fprintf(fp, " "); - fprintf(fp, "replay-window %d ", s->replay_window); - fprintf(fp, "replay %d ", s->replay); - fprintf(fp, "failed %d", s->integrity_failed); + fprintf(fp, "replay-window %u ", s->replay_window); + fprintf(fp, "replay %u ", s->replay); + fprintf(fp, "failed %u", s->integrity_failed); fprintf(fp, "%s", _SL_); } @@ -378,12 +418,12 @@ fprintf(fp, prefix); memset(abuf, '\0', sizeof(abuf)); - fprintf(fp, "src %s/%d ", rt_addr_n2a(f, sizeof(sel->saddr), + fprintf(fp, "src %s/%u ", rt_addr_n2a(f, sizeof(sel->saddr), &sel->saddr, abuf, sizeof(abuf)), sel->prefixlen_s); memset(abuf, '\0', sizeof(abuf)); - fprintf(fp, "dst %s/%d ", rt_addr_n2a(f, sizeof(sel->daddr), + fprintf(fp, "dst %s/%u ", rt_addr_n2a(f, sizeof(sel->daddr), &sel->daddr, abuf, sizeof(abuf)), sel->prefixlen_d); @@ -423,65 +463,56 @@ fprintf(fp, "%s", _SL_); } -static void xfrm_algo_print(struct xfrm_algo *algo, int type, FILE *fp, - const char *prefix) +static void xfrm_algo_print(struct xfrm_algo *algo, int type, int len, + FILE *fp, const char *prefix) { - int len; + int keylen; int i; if (prefix) fprintf(fp, prefix); fprintf(fp, "%s ", strxf_algotype(type)); + + if (len < sizeof(*algo)) { + fprintf(fp, "(ERROR truncated)"); + goto fin; + } + len -= sizeof(*algo); + fprintf(fp, "%s ", algo->alg_name); + keylen = algo->alg_key_len / 8; + if (len < keylen) { + fprintf(fp, "(ERROR truncated)"); + goto fin; + } + fprintf(fp, "0x"); - len = algo->alg_key_len / 8; - for (i = 0; i < len; i ++) + for (i = 0; i < keylen; i ++) fprintf(fp, "%.2x", (unsigned char)algo->alg_key[i]); if (show_stats > 0) fprintf(fp, " (%d bits)", algo->alg_key_len); + fin: fprintf(fp, "%s", _SL_); } -static const char *strxf_mask(__u32 mask) -{ - static char str[128]; - const int sn = sizeof(mask) * 8 - 1; - __u32 b; - int finish = 0; - int broken = 0; - int i = 0; - - for (b = (1 << sn); b > 0; b >>= 1) { - if ((b & mask) == 0) { - if (!finish) - finish = 1; - } else { - if (!finish) - i ++; - else { - broken = 1; - break; - } - } - } - - if (!broken) - sprintf(str, "%u", i); - else - sprintf(str, "broken(%u)", mask); - - return str; -} - -static void xfrm_tmpl_print(struct xfrm_user_tmpl *tmpls, int ntmpls, +static void xfrm_tmpl_print(struct xfrm_user_tmpl *tmpls, int len, __u16 family, FILE *fp, const char *prefix) { + int ntmpls = len / sizeof(struct xfrm_user_tmpl); int i; + if (ntmpls <= 0) { + if (prefix) + fprintf(fp, prefix); + fprintf(fp, "(ERROR \"tmpl\" truncated)"); + fprintf(fp, "%s", _SL_); + return; + } + for (i = 0; i < ntmpls; i++) { struct xfrm_user_tmpl *tmpl = &tmpls[i]; @@ -490,38 +521,47 @@ fprintf(fp, "tmpl"); xfrm_id_info_print(&tmpl->saddr, &tmpl->id, tmpl->mode, - tmpl->reqid, family, fp, prefix); + tmpl->reqid, family, 0, fp, prefix); + + if (show_stats > 0 || tmpl->optional) { + if (prefix) + fprintf(fp, prefix); + fprintf(fp, "\t"); + switch (tmpl->optional) { + case 0: + if (show_stats > 0) + fprintf(fp, "level required "); + break; + case 1: + fprintf(fp, "level use "); + break; + default: + fprintf(fp, "level %u ", tmpl->optional); + break; + } - if (prefix) - fprintf(fp, prefix); - fprintf(fp, "\t"); - switch (tmpl->optional) { - case 0: if (show_stats > 0) - fprintf(fp, "level required "); - break; - case 1: - fprintf(fp, "level use "); - break; - default: - fprintf(fp, "level %d ", tmpl->optional); - break; + fprintf(fp, "share %s ", strxf_share(tmpl->share)); + + fprintf(fp, "%s", _SL_); } if (show_stats > 0) { - fprintf(fp, "share %s ", strxf_share(tmpl->share)); - fprintf(fp, "algo-mask:"); - fprintf(fp, "%s=%s, ", + if (prefix) + fprintf(fp, prefix); + fprintf(fp, "\t"); + fprintf(fp, "%s-mask %s ", strxf_algotype(XFRMA_ALG_CRYPT), - strxf_mask(tmpl->ealgos)); - fprintf(fp, "%s=%s, ", + strxf_mask32(tmpl->ealgos)); + fprintf(fp, "%s-mask %s ", strxf_algotype(XFRMA_ALG_AUTH), - strxf_mask(tmpl->aalgos)); - fprintf(fp, "%s=%s", + strxf_mask32(tmpl->aalgos)); + fprintf(fp, "%s-mask %s", strxf_algotype(XFRMA_ALG_COMP), - strxf_mask(tmpl->calgos)); + strxf_mask32(tmpl->calgos)); + + fprintf(fp, "%s", _SL_); } - fprintf(fp, "%s", _SL_); } } @@ -532,31 +572,47 @@ for (i = 0; i < ntb; i++) { __u16 type = tb[i]->rta_type; + int len = RTA_PAYLOAD(tb[i]); void *data = RTA_DATA(tb[i]); switch (type) { case XFRMA_ALG_CRYPT: case XFRMA_ALG_AUTH: case XFRMA_ALG_COMP: - xfrm_algo_print((struct xfrm_algo *)data, type, fp, - prefix); + xfrm_algo_print((struct xfrm_algo *)data, type, len, + fp, prefix); break; case XFRMA_ENCAP: + { + struct xfrm_encap_tmpl *e; + char abuf[256]; + if (prefix) fprintf(fp, prefix); - /* XXX */ - fprintf(fp, "encap (not implemented yet!)"); + fprintf(fp, "encap "); + + if (len < sizeof(*e)) { + fprintf(fp, "(ERROR truncated)"); + fprintf(fp, "%s", _SL_); + break; + } + e = (struct xfrm_encap_tmpl *)data; + + fprintf(fp, "type %u ", e->encap_type); + fprintf(fp, "sport %u ", ntohs(e->encap_sport)); + fprintf(fp, "dport %u ", ntohs(e->encap_dport)); + + memset(abuf, '\0', sizeof(abuf)); + fprintf(fp, "addr %s", + rt_addr_n2a(family, sizeof(e->encap_oa), + &e->encap_oa, abuf, sizeof(abuf))); fprintf(fp, "%s", _SL_); break; + } case XFRMA_TMPL: - { - int len = tb[i]->rta_len; - int ntmpls = len / sizeof(struct xfrm_user_tmpl); - xfrm_tmpl_print((struct xfrm_user_tmpl *)data, - ntmpls, family, fp, prefix); + len, family, fp, prefix); break; - } default: if (prefix) fprintf(fp, prefix); @@ -584,7 +640,7 @@ get_prefix(&src, *argv, preferred_family); if (src.family == AF_UNSPEC) - invarg("\"SADDR\" address family is AF_UNSPEC", *argv); + invarg("\"src\" address family is AF_UNSPEC", *argv); if (family) *family = src.family; @@ -597,7 +653,7 @@ get_prefix(&dst, *argv, preferred_family); if (dst.family == AF_UNSPEC) - invarg("\"DADDR\" address family is AF_UNSPEC", *argv); + invarg("\"dst\" address family is AF_UNSPEC", *argv); if (family) *family = dst.family; @@ -641,7 +697,7 @@ } if (src.family && dst.family && (src.family != dst.family)) - invarg("the same address family is required between \"SADDR\" and \"DADDR\"", *argv); + invarg("the same address family is required between \"src\" and \"dst\"", *argv); if (loose == 0 && id->proto == 0) missarg("XFRM_PROTO"); @@ -828,7 +884,7 @@ get_prefix(&src, *argv, preferred_family); if (src.family == AF_UNSPEC) - invarg("\"SADDR\" address family is AF_UNSPEC", *argv); + invarg("\"src\" address family is AF_UNSPEC", *argv); sel->family = src.family; memcpy(&sel->saddr, &src.data, sizeof(sel->saddr)); @@ -841,7 +897,7 @@ get_prefix(&dst, *argv, preferred_family); if (dst.family == AF_UNSPEC) - invarg("\"DADDR\" address family is AF_UNSPEC", *argv); + invarg("\"dst\" address family is AF_UNSPEC", *argv); sel->family = dst.family; memcpy(&sel->daddr, &dst.data, sizeof(sel->daddr)); @@ -882,7 +938,7 @@ } if (src.family && dst.family && (src.family != dst.family)) - invarg("the same address family is required between \"SADDR\" and \"DADDR\"", *argv); + invarg("the same address family is required between \"src\" and \"dst\"", *argv); if (argc == *argcp) missarg("SELECTOR"); diff -Nru a/ip/xfrm.h b/ip/xfrm.h --- a/ip/xfrm.h 2005-01-09 15:31:16 +09:00 +++ b/ip/xfrm.h 2005-01-09 15:31:16 +09:00 @@ -41,6 +41,14 @@ #define XFRMP_RTA(x) ((struct rtattr*)(((char*)(x)) + NLMSG_ALIGN(sizeof(struct xfrm_userpolicy_info)))) #define XFRMP_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct xfrm_userpoilcy_info)) +#define XFRM_FLAG_PRINT(fp, flags, f, s) \ + do { \ + if (flags & f) { \ + flags &= ~f; \ + fprintf(fp, s "%s", (flags ? " " : "")); \ + } \ + } while(0) + struct xfrm_buffer { char *buf; int size; @@ -54,43 +62,45 @@ int use; struct xfrm_usersa_info xsinfo; - __u32 id_src_mask; - __u32 id_dst_mask; - __u32 id_proto_mask; + __u8 id_src_mask; + __u8 id_dst_mask; + __u8 id_proto_mask; __u32 id_spi_mask; - __u32 mode_mask; + __u8 mode_mask; __u32 reqid_mask; - __u32 state_flags_mask; + __u8 state_flags_mask; struct xfrm_userpolicy_info xpinfo; - __u32 dir_mask; - __u32 sel_src_mask; - __u32 sel_dst_mask; + __u8 dir_mask; + __u8 sel_src_mask; + __u8 sel_dst_mask; __u32 sel_dev_mask; - __u32 upspec_proto_mask; - __u32 upspec_sport_mask; - __u32 upspec_dport_mask; + __u8 upspec_proto_mask; + __u16 upspec_sport_mask; + __u16 upspec_dport_mask; __u32 index_mask; - __u32 action_mask; + __u8 action_mask; __u32 priority_mask; }; -#define XFRM_FILTER_MASK_FULL (~(__u32)0) +#define XFRM_FILTER_MASK_FULL (~0) extern struct xfrm_filter filter; int do_xfrm_state(int argc, char **argv); int do_xfrm_policy(int argc, char **argv); +int xfrm_addr_match(xfrm_address_t *x1, xfrm_address_t *x2, int bits); int xfrm_xfrmproto_getbyname(char *name); int xfrm_algotype_getbyname(char *name); const char *strxf_xfrmproto(__u8 proto); const char *strxf_algotype(int type); -const char *strxf_flags(__u8 flags); +const char *strxf_mask8(__u8 mask); +const char *strxf_mask32(__u32 mask); const char *strxf_share(__u8 share); const char *strxf_proto(__u8 proto); void xfrm_id_info_print(xfrm_address_t *saddr, struct xfrm_id *id, - __u8 mode, __u32 reqid, __u16 family, FILE *fp, - const char *prefix); + __u8 mode, __u32 reqid, __u16 family, int force_spi, + FILE *fp, const char *prefix); void xfrm_stats_print(struct xfrm_stats *s, FILE *fp, const char *prefix); void xfrm_lifetime_print(struct xfrm_lifetime_cfg *cfg, struct xfrm_lifetime_cur *cur, diff -Nru a/ip/xfrm_policy.c b/ip/xfrm_policy.c --- a/ip/xfrm_policy.c 2005-01-09 15:31:16 +09:00 +++ b/ip/xfrm_policy.c 2005-01-09 15:31:16 +09:00 @@ -292,18 +292,14 @@ return 0; if (filter.sel_src_mask) { - if (memcmp(&xpinfo->sel.saddr, &filter.xpinfo.sel.saddr, - filter.sel_src_mask) != 0) - return 0; - if (xpinfo->sel.prefixlen_s != filter.xpinfo.sel.prefixlen_s) + if (xfrm_addr_match(&xpinfo->sel.saddr, &filter.xpinfo.sel.saddr, + filter.sel_src_mask)) return 0; } if (filter.sel_dst_mask) { - if (memcmp(&xpinfo->sel.daddr, &filter.xpinfo.sel.daddr, - filter.sel_dst_mask) != 0) - return 0; - if (xpinfo->sel.prefixlen_d != filter.xpinfo.sel.prefixlen_d) + if (xfrm_addr_match(&xpinfo->sel.daddr, &filter.xpinfo.sel.daddr, + filter.sel_dst_mask)) return 0; } @@ -381,7 +377,7 @@ fprintf(fp, "fwd"); break; default: - fprintf(fp, "%d", xpinfo->dir); + fprintf(fp, "%u", xpinfo->dir); break; } fprintf(fp, " "); @@ -395,7 +391,7 @@ fprintf(fp, "action block "); break; default: - fprintf(fp, "action %d ", xpinfo->action); + fprintf(fp, "action %u ", xpinfo->action); break; } @@ -404,7 +400,7 @@ fprintf(fp, "priority %u ", xpinfo->priority); if (show_stats > 0) { fprintf(fp, "share %s ", strxf_share(xpinfo->share)); - fprintf(fp, "flags 0x%s", strxf_flags(xpinfo->flags)); + fprintf(fp, "flag 0x%s", strxf_mask8(xpinfo->flags)); } fprintf(fp, "%s", _SL_); diff -Nru a/ip/xfrm_state.c b/ip/xfrm_state.c --- a/ip/xfrm_state.c 2005-01-09 15:31:16 +09:00 +++ b/ip/xfrm_state.c 2005-01-09 15:31:16 +09:00 @@ -56,11 +56,12 @@ static void usage(void) { fprintf(stderr, "Usage: ip xfrm state { add | update } ID [ ALGO-LIST ] [ mode MODE ]\n"); - fprintf(stderr, " [ reqid REQID ] [ FLAG-LIST ] [ sel SELECTOR ] [ LIMIT-LIST ]\n"); + fprintf(stderr, " [ reqid REQID ] [ replay-window SIZE ] [ flag FLAG-LIST ]\n"); + fprintf(stderr, " [ sel SELECTOR ] [ LIMIT-LIST ]\n"); fprintf(stderr, "Usage: ip xfrm state { delete | get } ID\n"); fprintf(stderr, "Usage: ip xfrm state { flush | list } [ ID ] [ mode MODE ] [ reqid REQID ]\n"); - fprintf(stderr, " [ FLAG_LIST ]\n"); + fprintf(stderr, " [ flag FLAG_LIST ]\n"); fprintf(stderr, "ID := [ src ADDR ] [ dst ADDR ] [ proto XFRM_PROTO ] [ spi SPI ]\n"); //fprintf(stderr, "XFRM_PROTO := [ esp | ah | comp ]\n"); @@ -75,8 +76,8 @@ fprintf(stderr, "MODE := [ transport | tunnel ](default=transport)\n"); //fprintf(stderr, "REQID - number(default=0)\n"); - fprintf(stderr, "FLAG-LIST := [ FLAG-LIST ] [ flag FLAG ]\n"); - fprintf(stderr, "FLAG := [ noecn ]\n"); + fprintf(stderr, "FLAG-LIST := [ FLAG-LIST ] FLAG\n"); + fprintf(stderr, "FLAG := [ noecn | decap-dscp ]\n"); fprintf(stderr, "ALGO-LIST := [ ALGO-LIST ] | [ ALGO ]\n"); fprintf(stderr, "ALGO := ALGO_TYPE ALGO_NAME ALGO_KEY\n"); @@ -89,7 +90,7 @@ //fprintf(stderr, "ALGO_NAME - algorithm name\n"); //fprintf(stderr, "ALGO_KEY - algorithm key\n"); - fprintf(stderr, "SELECTOR := src ADDR[/PLEN] dst ADDR[/PLEN] [ upspec UPSPEC ] [ dev DEV ]\n"); + fprintf(stderr, "SELECTOR := src ADDR[/PLEN] dst ADDR[/PLEN] [ UPSPEC ] [ dev DEV ]\n"); fprintf(stderr, "UPSPEC := proto PROTO [ [ sport PORT ] [ dport PORT ] |\n"); fprintf(stderr, " [ type NUMBER ] [ code NUMBER ] ]\n"); @@ -108,7 +109,7 @@ int len; int slen = strlen(key); -#if 1 +#if 0 /* XXX: verifying both name and key is required! */ fprintf(stderr, "warning: ALGONAME/ALGOKEY will send to kernel promiscuously!(verifying them isn't implemented yet)\n"); #endif @@ -173,10 +174,20 @@ invarg("\"FLAG\" is invalid", *argv); *flags = val; } else { - if (strcmp(*argv, "noecn") == 0) - *flags |= XFRM_STATE_NOECN; - else - invarg("\"FLAG\" is invalid", *argv); + while (1) { + if (strcmp(*argv, "noecn") == 0) + *flags |= XFRM_STATE_NOECN; + else if (strcmp(*argv, "decap-dscp") == 0) + *flags |= XFRM_STATE_DECAP_DSCP; + else { + PREV_ARG(); /* back track */ + break; + } + + if (!NEXT_ARG_OK()) + break; + NEXT_ARG(); + } } filter.state_flags_mask = XFRM_FILTER_MASK_FULL; @@ -219,6 +230,10 @@ } else if (strcmp(*argv, "reqid") == 0) { NEXT_ARG(); xfrm_reqid_parse(&req.xsinfo.reqid, &argc, &argv); + } else if (strcmp(*argv, "replay-window") == 0) { + NEXT_ARG(); + if (get_u8(&req.xsinfo.replay_window, *argv, 0)) + invarg("\"replay-window\" value is invalid", *argv); } else if (strcmp(*argv, "flag") == 0) { NEXT_ARG(); xfrm_state_flag_parse(&req.xsinfo.flags, &argc, &argv); @@ -343,12 +358,12 @@ return 1; if (filter.id_src_mask) - if (memcmp(&xsinfo->saddr, &filter.xsinfo.saddr, - filter.id_src_mask) != 0) + if (xfrm_addr_match(&xsinfo->saddr, &filter.xsinfo.saddr, + filter.id_src_mask)) return 0; if (filter.id_dst_mask) - if (memcmp(&xsinfo->id.daddr, &filter.xsinfo.id.daddr, - filter.id_dst_mask) != 0) + if (xfrm_addr_match(&xsinfo->id.daddr, &filter.xsinfo.id.daddr, + filter.id_dst_mask)) return 0; if ((xsinfo->id.proto^filter.xsinfo.id.proto)&filter.id_proto_mask) return 0; @@ -407,22 +422,22 @@ fprintf(fp, "Deleted "); xfrm_id_info_print(&xsinfo->saddr, &xsinfo->id, xsinfo->mode, - xsinfo->reqid, xsinfo->family, fp, NULL); + xsinfo->reqid, xsinfo->family, 1, fp, NULL); fprintf(fp, "\t"); - fprintf(fp, "replay-window %d ", xsinfo->replay_window); + fprintf(fp, "replay-window %u ", xsinfo->replay_window); if (show_stats > 0) fprintf(fp, "seq 0x%08u ", xsinfo->seq); - if (xsinfo->flags) { - fprintf(fp, "flag 0x%s", strxf_flags(xsinfo->flags)); - if (show_stats > 0) { - if (xsinfo->flags) { - fprintf(fp, "("); - if (xsinfo->flags & XFRM_STATE_NOECN) - fprintf(fp, "noecn"); - fprintf(fp, ")"); - } - } + if (show_stats > 0 || xsinfo->flags) { + __u8 flags = xsinfo->flags; + + fprintf(fp, "flag "); + XFRM_FLAG_PRINT(fp, flags, XFRM_STATE_NOECN, "noecn"); + XFRM_FLAG_PRINT(fp, flags, XFRM_STATE_DECAP_DSCP, "decap-dscp"); + if (flags) + fprintf(fp, "%x", flags); + if (show_stats > 0) + fprintf(fp, " (0x%s)", strxf_mask8(flags)); } fprintf(fp, "%s", _SL_); -- Masahide NAKAMURA From jgarzik@pobox.com Mon Jan 10 09:02:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 09:02:44 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0AH2Mfi032153 for ; Mon, 10 Jan 2005 09:02:23 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CoEAR-0000UP-Dl; Tue, 11 Jan 2005 05:02:13 +0000 Message-ID: <41E35DB8.3090004@pobox.com> Date: Tue, 11 Jan 2005 00:01:44 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrew Morton , Linus Torvalds CC: Netdev Subject: [BK PATCHES] 2.6.x net driver updates Content-Type: multipart/mixed; boundary="------------090609000705090202000403" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 68 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------090609000705090202000403 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit gcc 4 fixes, driver updates: ixgb, eepro, emac, ... --------------090609000705090202000403 Content-Type: text/plain; name="changelog.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="changelog.txt" Please do a bk pull bk://gkernel.bkbits.net/net-drivers-2.6 This will update the following files: drivers/net/arcnet/arcnet.c | 3 drivers/net/eepro.c | 144 +++++-- drivers/net/ibm_emac/ibm_emac.h | 2 drivers/net/ibm_emac/ibm_emac_core.c | 15 drivers/net/ibm_emac/ibm_emac_phy.c | 19 drivers/net/ixgb/ixgb.h | 25 + drivers/net/ixgb/ixgb_ee.c | 192 +++++---- drivers/net/ixgb/ixgb_ethtool.c | 518 ++++++++++++++++--------- drivers/net/ixgb/ixgb_hw.c | 231 ++++++----- drivers/net/ixgb/ixgb_hw.h | 50 +- drivers/net/ixgb/ixgb_ids.h | 21 - drivers/net/ixgb/ixgb_main.c | 705 +++++++++++++++++------------------ drivers/net/ixgb/ixgb_osdep.h | 10 drivers/net/ixgb/ixgb_param.c | 316 +++++++-------- drivers/net/s2io.c | 22 - drivers/net/s2io.h | 4 drivers/net/smc-ultra.c | 2 drivers/net/smc91x.c | 16 drivers/net/wireless/orinoco.c | 203 +++------- drivers/net/wireless/wl3501_cs.c | 4 include/linux/arcdevice.h | 1 21 files changed, 1415 insertions(+), 1088 deletions(-) through these ChangeSets: Andi Kleen: o Fix gcc4 compilation in s2io net driver Aristeu Sergio Rozanski Filho: o eepro: fix auto-detection option o eepro: fix return value in init_module() o eepro: basic ethtool support o eepro: use module_param macros o eepro: cache EEPROM values Christoph Hellwig: o mark arcdev_setup static David Gibson: o Another trivial orinoco update Ganesh Venkatesan: o ixgb: White space corrections o ixgb: Driver version number update o ixgb: Support for 2.6.x style module parameters o ixgb: Fix Tx cleanup logic o ixgb: Shrink size and fix ordering of elements in ixgb_buffer o ixgb: ethtool_ops support o ixgb: Replace kmalloc with vmalloc (one time alloc) o ixgb: Remove support for RAIDC interrupt mitigation o ixgb: Limit Rx Address Filter Array entries to 3 o ixgb: Fix infinite loop trying to re-establish link o ixgb: Fix error in setting MFS register o ixgb: Poll Routine cleanup o ixgb: Fix memory leak in NAPI mode o ixgb: Fix VLAN filter setup errors (while running on PPC) o ixgb: Add support for 10GbE LR device ID o ixgb: Enable Message Signalled Interrupts o ixgb: Limit number of Rx Descriptors to 512 Hirokazu Takata: o net: netconsole support for smc91x Matt Porter: o Add netpoll support o allow rx of the maximum sized VLAN tagged packets o EMAC: fix ibm_emac autonegotiation result parsing Paul Gortmaker: o smc-ultra.c too-verbose driver Raghavendra Koushik: o S2io: fixes in free_shared_mem function Randy Dunlap: o wl3501: fix module_param types/warnings --------------090609000705090202000403 Content-Type: text/plain; name="patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch" diff -Nru a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c --- a/drivers/net/arcnet/arcnet.c 2005-01-10 23:54:12 -05:00 +++ b/drivers/net/arcnet/arcnet.c 2005-01-10 23:54:12 -05:00 @@ -93,7 +93,6 @@ EXPORT_SYMBOL(arc_proto_null); EXPORT_SYMBOL(arcnet_unregister_proto); EXPORT_SYMBOL(arcnet_debug); -EXPORT_SYMBOL(arcdev_setup); EXPORT_SYMBOL(alloc_arcdev); EXPORT_SYMBOL(arcnet_interrupt); @@ -317,7 +316,7 @@ /* Setup a struct device for ARCnet. */ -void arcdev_setup(struct net_device *dev) +static void arcdev_setup(struct net_device *dev) { dev->type = ARPHRD_ARCNET; dev->hard_header_len = sizeof(struct archdr); diff -Nru a/drivers/net/eepro.c b/drivers/net/eepro.c --- a/drivers/net/eepro.c 2005-01-10 23:54:12 -05:00 +++ b/drivers/net/eepro.c 2005-01-10 23:54:12 -05:00 @@ -23,6 +23,7 @@ This is a compatibility hardware problem. Versions: + 0.13b basic ethtool support (aris, 09/13/2004) 0.13a in memory shortage, drop packets also in board (Michael Westermann , 07/30/2002) 0.13 irq sharing, rewrote probe function, fixed a nasty bug in @@ -104,7 +105,7 @@ */ static const char version[] = - "eepro.c: v0.13 11/08/2001 aris@cathedrallabs.org\n"; + "eepro.c: v0.13b 09/13/2004 aris@cathedrallabs.org\n"; #include @@ -146,19 +147,21 @@ #include #include #include +#include #include #include #include #define DRV_NAME "eepro" +#define DRV_VERSION "0.13b" #define compat_dev_kfree_skb( skb, mode ) dev_kfree_skb( (skb) ) /* I had reports of looong delays with SLOW_DOWN defined as udelay(2) */ #define SLOW_DOWN inb(0x80) /* udelay(2) */ #define compat_init_data __initdata - +enum iftype { AUI=0, BNC=1, TPE=2 }; /* First, a few definitions that the brave might change. */ /* A zero-terminated list of I/O addresses to be probed. */ @@ -214,6 +217,7 @@ short rcv_lower_limit; short rcv_upper_limit; unsigned char eeprom_reg; + unsigned short word[8]; }; /* The station (ethernet) address prefix, used for IDing the board. */ @@ -608,16 +612,22 @@ } #endif -static void __init printEEPROMInfo(short ioaddr, struct net_device *dev) +static void __init printEEPROMInfo(struct net_device *dev) { + struct eepro_local *lp = (struct eepro_local *)dev->priv; + int ioaddr = dev->base_addr; unsigned short Word; int i,j; - for (i=0, j=ee_Checksum; iword[i]; + for ( ; i < ee_SIZE; i++) + j += read_eeprom(ioaddr, i, dev); + printk(KERN_DEBUG "Checksum: %#x\n",j&0xffff); - Word=read_eeprom(ioaddr, 0, dev); + Word = lp->word[0]; printk(KERN_DEBUG "Word0:\n"); printk(KERN_DEBUG " Plug 'n Pray: %d\n",GetBit(Word,ee_PnP)); printk(KERN_DEBUG " Buswidth: %d\n",(GetBit(Word,ee_BusWidth)+1)*8 ); @@ -625,7 +635,7 @@ printk(KERN_DEBUG " IO Address: %#x\n", (Word>>ee_IO0)<<4); if (net_debug>4) { - Word=read_eeprom(ioaddr, 1, dev); + Word = lp->word[1]; printk(KERN_DEBUG "Word1:\n"); printk(KERN_DEBUG " INT: %d\n", Word & ee_IntMask); printk(KERN_DEBUG " LI: %d\n", GetBit(Word,ee_LI)); @@ -636,7 +646,7 @@ printk(KERN_DEBUG " Duplex: %d\n", GetBit(Word,ee_Duplex)); } - Word=read_eeprom(ioaddr, 5, dev); + Word = lp->word[5]; printk(KERN_DEBUG "Word5:\n"); printk(KERN_DEBUG " BNC: %d\n",GetBit(Word,ee_BNC_TPE)); printk(KERN_DEBUG " NumConnectors: %d\n",GetBit(Word,ee_NumConn)); @@ -646,12 +656,12 @@ if (GetBit(Word,ee_PortAUI)) printk(KERN_DEBUG "AUI "); printk(KERN_DEBUG "port(s) \n"); - Word=read_eeprom(ioaddr, 6, dev); + Word = lp->word[6]; printk(KERN_DEBUG "Word6:\n"); printk(KERN_DEBUG " Stepping: %d\n",Word & ee_StepMask); printk(KERN_DEBUG " BoardID: %d\n",Word>>ee_BoardID); - Word=read_eeprom(ioaddr, 7, dev); + Word = lp->word[7]; printk(KERN_DEBUG "Word7:\n"); printk(KERN_DEBUG " INT to IRQ:\n"); @@ -725,7 +735,7 @@ printk(", %s.\n", ifmap[dev->if_port]); if (net_debug > 3) { - i = read_eeprom(dev->base_addr, 5, dev); + i = lp->word[5]; if (i & 0x2000) /* bit 13 of EEPROM word 5 */ printk(KERN_DEBUG "%s: Concurrent Processing is " "enabled but not used!\n", dev->name); @@ -733,19 +743,20 @@ /* Check the station address for the manufacturer's code */ if (net_debug>3) - printEEPROMInfo(dev->base_addr, dev); + printEEPROMInfo(dev); } +static struct ethtool_ops eepro_ethtool_ops; + /* This is the real probe routine. Linux has a history of friendly device probes on the ISA bus. A good device probe avoids doing writes, and verifies that the correct device exists and functions. */ static int __init eepro_probe1(struct net_device *dev, int autoprobe) { - unsigned short station_addr[6], id, counter; + unsigned short station_addr[3], id, counter; int i; struct eepro_local *lp; - enum iftype { AUI=0, BNC=1, TPE=2 }; int ioaddr = dev->base_addr; /* Grab the region so we can find another board if autoIRQ fails. */ @@ -796,11 +807,16 @@ lp->xmt_bar = XMT_BAR_10; station_addr[0] = read_eeprom(ioaddr, 2, dev); } - station_addr[1] = read_eeprom(ioaddr, 3, dev); - station_addr[2] = read_eeprom(ioaddr, 4, dev); + + /* get all words at once. will be used here and for ethtool */ + for (i = 0; i < 8; i++) { + lp->word[i] = read_eeprom(ioaddr, i, dev); + } + station_addr[1] = lp->word[3]; + station_addr[2] = lp->word[4]; if (!lp->eepro) { - if (read_eeprom(ioaddr,7,dev)== ee_FX_INT2IRQ) + if (lp->word[7] == ee_FX_INT2IRQ) lp->eepro = 2; else if (station_addr[2] == SA_ADDR1) lp->eepro = 1; @@ -817,15 +833,15 @@ /* calculate {xmt,rcv}_{lower,upper}_limit */ eepro_recalc(dev); - if (GetBit( read_eeprom(ioaddr, 5, dev),ee_BNC_TPE)) + if (GetBit(lp->word[5], ee_BNC_TPE)) dev->if_port = BNC; else dev->if_port = TPE; if (dev->irq < 2 && lp->eepro != 0) { /* Mask off INT number */ - int count = read_eeprom(ioaddr, 1, dev) & 7; - unsigned irqMask = read_eeprom(ioaddr, 7, dev); + int count = lp->word[1] & 7; + unsigned irqMask = lp->word[7]; while (count--) irqMask &= irqMask - 1; @@ -850,6 +866,7 @@ dev->set_multicast_list = &set_multicast_list; dev->tx_timeout = eepro_tx_timeout; dev->watchdog_timeo = TX_TIMEOUT; + dev->ethtool_ops = &eepro_ethtool_ops; /* print boot time info */ eepro_print_info(dev); @@ -941,7 +958,7 @@ if (net_debug > 3) printk(KERN_DEBUG "%s: entering eepro_open routine.\n", dev->name); - irqMask = read_eeprom(ioaddr,7,dev); + irqMask = lp->word[7]; if (lp->eepro == LAN595FX_10ISA) { if (net_debug > 3) printk(KERN_DEBUG "p->eepro = 3;\n"); @@ -1070,8 +1087,6 @@ old9 = inb(ioaddr + 9); if (irqMask==ee_FX_INT2IRQ) { - enum iftype { AUI=0, BNC=1, TPE=2 }; - if (net_debug > 3) { printk(KERN_DEBUG "IrqMask: %#x\n",irqMask); printk(KERN_DEBUG "i82595FX detected!\n"); @@ -1701,12 +1716,72 @@ } } +static int eepro_ethtool_get_settings(struct net_device *dev, + struct ethtool_cmd *cmd) +{ + struct eepro_local *lp = (struct eepro_local *)dev->priv; + + cmd->supported = SUPPORTED_10baseT_Half | + SUPPORTED_10baseT_Full | + SUPPORTED_Autoneg; + cmd->advertising = ADVERTISED_10baseT_Half | + ADVERTISED_10baseT_Full | + ADVERTISED_Autoneg; + + if (GetBit(lp->word[5], ee_PortTPE)) { + cmd->supported |= SUPPORTED_TP; + cmd->advertising |= ADVERTISED_TP; + } + if (GetBit(lp->word[5], ee_PortBNC)) { + cmd->supported |= SUPPORTED_BNC; + cmd->advertising |= ADVERTISED_BNC; + } + if (GetBit(lp->word[5], ee_PortAUI)) { + cmd->supported |= SUPPORTED_AUI; + cmd->advertising |= ADVERTISED_AUI; + } + + cmd->speed = SPEED_10; + + if (dev->if_port == TPE && lp->word[1] & ee_Duplex) { + cmd->duplex = DUPLEX_FULL; + } + else { + cmd->duplex = DUPLEX_HALF; + } + + cmd->port = dev->if_port; + cmd->phy_address = dev->base_addr; + cmd->transceiver = XCVR_INTERNAL; + + if (lp->word[0] & ee_AutoNeg) { + cmd->autoneg = 1; + } + + return 0; +} + +static void eepro_ethtool_get_drvinfo(struct net_device *dev, + struct ethtool_drvinfo *drvinfo) +{ + strcpy(drvinfo->driver, DRV_NAME); + strcpy(drvinfo->version, DRV_VERSION); + sprintf(drvinfo->bus_info, "ISA 0x%lx", dev->base_addr); +} + +static struct ethtool_ops eepro_ethtool_ops = { + .get_settings = eepro_ethtool_get_settings, + .get_drvinfo = eepro_ethtool_get_drvinfo, +}; + #ifdef MODULE #define MAX_EEPRO 8 static struct net_device *dev_eepro[MAX_EEPRO]; -static int io[MAX_EEPRO]; +static int io[MAX_EEPRO] = { + [0 ... MAX_EEPRO-1] = -1 +}; static int irq[MAX_EEPRO]; static int mem[MAX_EEPRO] = { /* Size of the rx buffer in KB */ [0 ... MAX_EEPRO-1] = RCV_DEFAULT_RAM/1024 @@ -1716,14 +1791,15 @@ static int n_eepro; /* For linux 2.1.xx */ -MODULE_AUTHOR("Pascal Dupuis, and aris@cathedrallabs.org"); +MODULE_AUTHOR("Pascal Dupuis and others"); MODULE_DESCRIPTION("Intel i82595 ISA EtherExpressPro10/10+ driver"); MODULE_LICENSE("GPL"); -MODULE_PARM(io, "1-" __MODULE_STRING(MAX_EEPRO) "i"); -MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_EEPRO) "i"); -MODULE_PARM(mem, "1-" __MODULE_STRING(MAX_EEPRO) "i"); -MODULE_PARM(autodetect, "1-" __MODULE_STRING(1) "i"); +static int num_params; +module_param_array(io, int, num_params, 0); +module_param_array(irq, int, num_params, 0); +module_param_array(mem, int, num_params, 0); +module_param(autodetect, int, 0); MODULE_PARM_DESC(io, "EtherExpress Pro/10 I/O base addres(es)"); MODULE_PARM_DESC(irq, "EtherExpress Pro/10 IRQ number(s)"); MODULE_PARM_DESC(mem, "EtherExpress Pro/10 Rx buffer size(es) in kB (3-29)"); @@ -1734,19 +1810,21 @@ { struct net_device *dev; int i; - if (io[0] == 0 && autodetect == 0) { + if (io[0] == -1 && autodetect == 0) { printk(KERN_WARNING "eepro_init_module: Probe is very dangerous in ISA boards!\n"); printk(KERN_WARNING "eepro_init_module: Please add \"autodetect=1\" to force probe\n"); - return 1; + return -ENODEV; } else if (autodetect) { /* if autodetect is set then we must force detection */ - io[0] = 0; + for (i = 0; i < MAX_EEPRO; i++) { + io[i] = 0; + } printk(KERN_INFO "eepro_init_module: Auto-detecting boards (May God protect us...)\n"); } - for (i = 0; i < MAX_EEPRO; i++) { + for (i = 0; io[i] != -1 && i < MAX_EEPRO; i++) { dev = alloc_etherdev(sizeof(struct eepro_local)); if (!dev) break; diff -Nru a/drivers/net/ibm_emac/ibm_emac.h b/drivers/net/ibm_emac/ibm_emac.h --- a/drivers/net/ibm_emac/ibm_emac.h 2005-01-10 23:54:12 -05:00 +++ b/drivers/net/ibm_emac/ibm_emac.h 2005-01-10 23:54:12 -05:00 @@ -98,7 +98,7 @@ #endif /* CONFIG_IBM_EMAC4 */ #define EMAC_M1_BASE (EMAC_M1_TX_FIFO_2K | \ EMAC_M1_APP | \ - EMAC_M1_TR) + EMAC_M1_TR | EMAC_M1_VLE) /* Transmit Mode Register 0 */ #define EMAC_TMR0_GNP0 0x80000000 diff -Nru a/drivers/net/ibm_emac/ibm_emac_core.c b/drivers/net/ibm_emac/ibm_emac_core.c --- a/drivers/net/ibm_emac/ibm_emac_core.c 2005-01-10 23:54:12 -05:00 +++ b/drivers/net/ibm_emac/ibm_emac_core.c 2005-01-10 23:54:12 -05:00 @@ -1363,6 +1363,9 @@ /* set frame gap */ out_be32(&emacp->em0ipgvr, CONFIG_IBM_EMAC_FGAP); + + /* set VLAN Tag Protocol Identifier */ + out_be32(&emacp->em0vtpid, 0x8100); /* Init ring buffers */ emac_init_rings(fep->ndev); @@ -1700,6 +1703,15 @@ .rxde = &emac_rxde_dev, }; +#ifdef CONFIG_NET_POLL_CONTROLLER +static int emac_netpoll(struct net_device *ndev) +{ + emac_rxeob_dev((void *)ndev, 0); + emac_txeob_dev((void *)ndev, 0); + return 0; +} +#endif + static int emac_init_device(struct ocp_device *ocpdev, struct ibm_ocp_mal *mal) { int deferred_init = 0; @@ -1882,6 +1894,9 @@ SET_ETHTOOL_OPS(ndev, &emac_ethtool_ops); if (emacdata->tah_idx >= 0) ndev->features = NETIF_F_IP_CSUM | NETIF_F_SG; +#ifdef CONFIG_NET_POLL_CONTROLLER + ndev->poll_controller = emac_netpoll; +#endif SET_MODULE_OWNER(ndev); diff -Nru a/drivers/net/ibm_emac/ibm_emac_phy.c b/drivers/net/ibm_emac/ibm_emac_phy.c --- a/drivers/net/ibm_emac/ibm_emac_phy.c 2005-01-10 23:54:12 -05:00 +++ b/drivers/net/ibm_emac/ibm_emac_phy.c 2005-01-10 23:54:12 -05:00 @@ -191,17 +191,18 @@ u16 lpa; if (phy->autoneg) { - lpa = phy_read(phy, MII_LPA); + lpa = phy_read(phy, MII_LPA) & phy_read(phy, MII_ADVERTISE); - if (lpa & (LPA_10FULL | LPA_100FULL)) - phy->duplex = DUPLEX_FULL; - else - phy->duplex = DUPLEX_HALF; - if (lpa & (LPA_100FULL | LPA_100HALF)) - phy->speed = SPEED_100; - else - phy->speed = SPEED_10; + phy->speed = SPEED_10; + phy->duplex = DUPLEX_HALF; phy->pause = 0; + + if (lpa & (LPA_100FULL | LPA_100HALF)) { + phy->speed = SPEED_100; + if (lpa & LPA_100FULL) + phy->duplex = DUPLEX_FULL; + } else if (lpa & LPA_10FULL) + phy->duplex = DUPLEX_FULL; } /* On non-aneg, we assume what we put in BMCR is the speed, * though magic-aneg shouldn't prevent this case from occurring diff -Nru a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h --- a/drivers/net/ixgb/ixgb.h 2005-01-10 23:54:12 -05:00 +++ b/drivers/net/ixgb/ixgb.h 2005-01-10 23:54:12 -05:00 @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -85,6 +86,20 @@ #define IXGB_ERR(args...) printk(KERN_ERR "ixgb: " args) +/* TX/RX descriptor defines */ +#define DEFAULT_TXD 256 +#define MAX_TXD 4096 +#define MIN_TXD 64 + +/* hardware cannot reliably support more than 512 descriptors owned by + * hardware descrioptor cache otherwise an unreliable ring under heavy + * recieve load may result */ +/* #define DEFAULT_RXD 1024 */ +/* #define MAX_RXD 4096 */ +#define DEFAULT_RXD 512 +#define MAX_RXD 512 +#define MIN_RXD 64 + /* Supported Rx Buffer Sizes */ #define IXGB_RXBUFFER_2048 2048 #define IXGB_RXBUFFER_4096 4096 @@ -105,9 +120,9 @@ struct ixgb_buffer { struct sk_buff *skb; uint64_t dma; - unsigned long length; unsigned long time_stamp; - unsigned int next_to_watch; + uint16_t length; + uint16_t next_to_watch; }; struct ixgb_desc_ring { @@ -167,7 +182,6 @@ uint64_t hw_csum_rx_error; uint64_t hw_csum_rx_good; uint32_t rx_int_delay; - boolean_t raidc; boolean_t rx_csum; /* OS defined structs */ @@ -178,5 +192,8 @@ /* structs defined in ixgb_hw.h */ struct ixgb_hw hw; struct ixgb_hw_stats stats; +#ifdef CONFIG_PCI_MSI + boolean_t have_msi; +#endif }; -#endif /* _IXGB_H_ */ +#endif /* _IXGB_H_ */ diff -Nru a/drivers/net/ixgb/ixgb_ee.c b/drivers/net/ixgb/ixgb_ee.c --- a/drivers/net/ixgb/ixgb_ee.c 2005-01-10 23:54:12 -05:00 +++ b/drivers/net/ixgb/ixgb_ee.c 2005-01-10 23:54:12 -05:00 @@ -32,7 +32,8 @@ static uint16_t ixgb_shift_in_bits(struct ixgb_hw *hw); static void ixgb_shift_out_bits(struct ixgb_hw *hw, - uint16_t data, uint16_t count); + uint16_t data, + uint16_t count); static void ixgb_standby_eeprom(struct ixgb_hw *hw); static boolean_t ixgb_wait_eeprom_command(struct ixgb_hw *hw); @@ -45,7 +46,9 @@ * hw - Struct containing variables accessed by shared code * eecd_reg - EECD's current value *****************************************************************************/ -static void ixgb_raise_clock(struct ixgb_hw *hw, uint32_t * eecd_reg) +static void +ixgb_raise_clock(struct ixgb_hw *hw, + uint32_t *eecd_reg) { /* Raise the clock input to the EEPROM (by setting the SK bit), and then * wait 50 microseconds. @@ -62,7 +65,9 @@ * hw - Struct containing variables accessed by shared code * eecd_reg - EECD's current value *****************************************************************************/ -static void ixgb_lower_clock(struct ixgb_hw *hw, uint32_t * eecd_reg) +static void +ixgb_lower_clock(struct ixgb_hw *hw, + uint32_t *eecd_reg) { /* Lower the clock input to the EEPROM (by clearing the SK bit), and then * wait 50 microseconds. @@ -81,7 +86,9 @@ * count - number of bits to shift out *****************************************************************************/ static void -ixgb_shift_out_bits(struct ixgb_hw *hw, uint16_t data, uint16_t count) +ixgb_shift_out_bits(struct ixgb_hw *hw, + uint16_t data, + uint16_t count) { uint32_t eecd_reg; uint32_t mask; @@ -101,7 +108,7 @@ */ eecd_reg &= ~IXGB_EECD_DI; - if (data & mask) + if(data & mask) eecd_reg |= IXGB_EECD_DI; IXGB_WRITE_REG(hw, EECD, eecd_reg); @@ -113,7 +120,7 @@ mask = mask >> 1; - } while (mask); + } while(mask); /* We leave the "DI" bit set to "0" when we leave this routine. */ eecd_reg &= ~IXGB_EECD_DI; @@ -126,7 +133,8 @@ * * hw - Struct containing variables accessed by shared code *****************************************************************************/ -static uint16_t ixgb_shift_in_bits(struct ixgb_hw *hw) +static uint16_t +ixgb_shift_in_bits(struct ixgb_hw *hw) { uint32_t eecd_reg; uint32_t i; @@ -144,14 +152,14 @@ eecd_reg &= ~(IXGB_EECD_DO | IXGB_EECD_DI); data = 0; - for (i = 0; i < 16; i++) { + for(i = 0; i < 16; i++) { data = data << 1; ixgb_raise_clock(hw, &eecd_reg); eecd_reg = IXGB_READ_REG(hw, EECD); eecd_reg &= ~(IXGB_EECD_DI); - if (eecd_reg & IXGB_EECD_DO) + if(eecd_reg & IXGB_EECD_DO) data |= 1; ixgb_lower_clock(hw, &eecd_reg); @@ -168,7 +176,8 @@ * Lowers EEPROM clock. Clears input pin. Sets the chip select pin. This * function should be called before issuing a command to the EEPROM. *****************************************************************************/ -static void ixgb_setup_eeprom(struct ixgb_hw *hw) +static void +ixgb_setup_eeprom(struct ixgb_hw *hw) { uint32_t eecd_reg; @@ -189,7 +198,8 @@ * * hw - Struct containing variables accessed by shared code *****************************************************************************/ -static void ixgb_standby_eeprom(struct ixgb_hw *hw) +static void +ixgb_standby_eeprom(struct ixgb_hw *hw) { uint32_t eecd_reg; @@ -222,7 +232,8 @@ * * hw - Struct containing variables accessed by shared code *****************************************************************************/ -static void ixgb_clock_eeprom(struct ixgb_hw *hw) +static void +ixgb_clock_eeprom(struct ixgb_hw *hw) { uint32_t eecd_reg; @@ -245,7 +256,8 @@ * * hw - Struct containing variables accessed by shared code *****************************************************************************/ -static void ixgb_cleanup_eeprom(struct ixgb_hw *hw) +static void +ixgb_cleanup_eeprom(struct ixgb_hw *hw) { uint32_t eecd_reg; @@ -270,7 +282,8 @@ * TRUE: EEPROM data pin is high before timeout. * FALSE: Time expired. *****************************************************************************/ -static boolean_t ixgb_wait_eeprom_command(struct ixgb_hw *hw) +static boolean_t +ixgb_wait_eeprom_command(struct ixgb_hw *hw) { uint32_t eecd_reg; uint32_t i; @@ -284,10 +297,10 @@ * signal that the command has been completed by raising the DO signal. * If DO does not go high in 10 milliseconds, then error out. */ - for (i = 0; i < 200; i++) { + for(i = 0; i < 200; i++) { eecd_reg = IXGB_READ_REG(hw, EECD); - if (eecd_reg & IXGB_EECD_DO) + if(eecd_reg & IXGB_EECD_DO) return (TRUE); udelay(50); @@ -309,15 +322,16 @@ * TRUE: Checksum is valid * FALSE: Checksum is not valid. *****************************************************************************/ -boolean_t ixgb_validate_eeprom_checksum(struct ixgb_hw * hw) +boolean_t +ixgb_validate_eeprom_checksum(struct ixgb_hw *hw) { uint16_t checksum = 0; uint16_t i; - for (i = 0; i < (EEPROM_CHECKSUM_REG + 1); i++) + for(i = 0; i < (EEPROM_CHECKSUM_REG + 1); i++) checksum += ixgb_read_eeprom(hw, i); - if (checksum == (uint16_t) EEPROM_SUM) + if(checksum == (uint16_t) EEPROM_SUM) return (TRUE); else return (FALSE); @@ -331,12 +345,13 @@ * Sums the first 63 16 bit words of the EEPROM. Subtracts the sum from 0xBABA. * Writes the difference to word offset 63 of the EEPROM. *****************************************************************************/ -void ixgb_update_eeprom_checksum(struct ixgb_hw *hw) +void +ixgb_update_eeprom_checksum(struct ixgb_hw *hw) { uint16_t checksum = 0; uint16_t i; - for (i = 0; i < EEPROM_CHECKSUM_REG; i++) + for(i = 0; i < EEPROM_CHECKSUM_REG; i++) checksum += ixgb_read_eeprom(hw, i); checksum = (uint16_t) EEPROM_SUM - checksum; @@ -356,7 +371,10 @@ * EEPROM will most likely contain an invalid checksum. * *****************************************************************************/ -void ixgb_write_eeprom(struct ixgb_hw *hw, uint16_t offset, uint16_t data) +void +ixgb_write_eeprom(struct ixgb_hw *hw, + uint16_t offset, + uint16_t data) { /* Prepare the EEPROM for writing */ ixgb_setup_eeprom(hw); @@ -404,7 +422,9 @@ * Returns: * The 16-bit value read from the eeprom *****************************************************************************/ -uint16_t ixgb_read_eeprom(struct ixgb_hw * hw, uint16_t offset) +uint16_t +ixgb_read_eeprom(struct ixgb_hw *hw, + uint16_t offset) { uint16_t data; @@ -437,7 +457,8 @@ * TRUE: if eeprom read is successful * FALSE: otherwise. *****************************************************************************/ -boolean_t ixgb_get_eeprom_data(struct ixgb_hw * hw) +boolean_t +ixgb_get_eeprom_data(struct ixgb_hw *hw) { uint16_t i; uint16_t checksum = 0; @@ -448,7 +469,7 @@ ee_map = (struct ixgb_ee_map_type *)hw->eeprom; DEBUGOUT("ixgb_ee: Reading eeprom data\n"); - for (i = 0; i < IXGB_EEPROM_SIZE; i++) { + for(i = 0; i < IXGB_EEPROM_SIZE ; i++) { uint16_t ee_data; ee_data = ixgb_read_eeprom(hw, i); checksum += ee_data; @@ -461,12 +482,12 @@ } if ((ee_map->init_ctrl_reg_1 & le16_to_cpu(EEPROM_ICW1_SIGNATURE_MASK)) - != le16_to_cpu(EEPROM_ICW1_SIGNATURE_VALID)) { + != le16_to_cpu(EEPROM_ICW1_SIGNATURE_VALID)) { DEBUGOUT("ixgb_ee: Signature invalid.\n"); - return (FALSE); + return(FALSE); } - return (TRUE); + return(TRUE); } /****************************************************************************** @@ -479,7 +500,8 @@ * TRUE: eeprom signature was good and the eeprom read was successful * FALSE: otherwise. ******************************************************************************/ -static boolean_t ixgb_check_and_get_eeprom_data(struct ixgb_hw *hw) +static boolean_t +ixgb_check_and_get_eeprom_data (struct ixgb_hw* hw) { struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; @@ -500,15 +522,16 @@ * Returns: * Word at indexed offset in eeprom, if valid, 0 otherwise. ******************************************************************************/ -uint16_t ixgb_get_eeprom_word(struct ixgb_hw * hw, uint16_t index) +uint16_t +ixgb_get_eeprom_word(struct ixgb_hw *hw, uint16_t index) { if ((index < IXGB_EEPROM_SIZE) && - (ixgb_check_and_get_eeprom_data(hw) == TRUE)) { - return (hw->eeprom[index]); + (ixgb_check_and_get_eeprom_data(hw) == TRUE)) { + return(hw->eeprom[index]); } - return (0); + return(0); } /****************************************************************************** @@ -519,7 +542,9 @@ * * Returns: None. ******************************************************************************/ -void ixgb_get_ee_mac_addr(struct ixgb_hw *hw, uint8_t * mac_addr) +void +ixgb_get_ee_mac_addr(struct ixgb_hw *hw, + uint8_t *mac_addr) { int i; struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; @@ -542,14 +567,15 @@ * Returns: * compatibility flags if EEPROM contents are valid, 0 otherwise ******************************************************************************/ -uint16_t ixgb_get_ee_compatibility(struct ixgb_hw *hw) +uint16_t +ixgb_get_ee_compatibility(struct ixgb_hw *hw) { struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; - if (ixgb_check_and_get_eeprom_data(hw) == TRUE) - return (ee_map->compatibility); + if(ixgb_check_and_get_eeprom_data(hw) == TRUE) + return(ee_map->compatibility); - return (0); + return(0); } /****************************************************************************** @@ -560,13 +586,14 @@ * Returns: * PBA number if EEPROM contents are valid, 0 otherwise ******************************************************************************/ -uint32_t ixgb_get_ee_pba_number(struct ixgb_hw * hw) +uint32_t +ixgb_get_ee_pba_number(struct ixgb_hw *hw) { - if (ixgb_check_and_get_eeprom_data(hw) == TRUE) + if(ixgb_check_and_get_eeprom_data(hw) == TRUE) return (le16_to_cpu(hw->eeprom[EEPROM_PBA_1_2_REG]) - | (le16_to_cpu(hw->eeprom[EEPROM_PBA_3_4_REG]) << 16)); + | (le16_to_cpu(hw->eeprom[EEPROM_PBA_3_4_REG])<<16)); - return (0); + return(0); } /****************************************************************************** @@ -577,14 +604,15 @@ * Returns: * Initialization Control Word 1 if EEPROM contents are valid, 0 otherwise ******************************************************************************/ -uint16_t ixgb_get_ee_init_ctrl_reg_1(struct ixgb_hw * hw) +uint16_t +ixgb_get_ee_init_ctrl_reg_1(struct ixgb_hw *hw) { struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; - if (ixgb_check_and_get_eeprom_data(hw) == TRUE) - return (ee_map->init_ctrl_reg_1); + if(ixgb_check_and_get_eeprom_data(hw) == TRUE) + return(ee_map->init_ctrl_reg_1); - return (0); + return(0); } /****************************************************************************** @@ -595,14 +623,15 @@ * Returns: * Initialization Control Word 2 if EEPROM contents are valid, 0 otherwise ******************************************************************************/ -uint16_t ixgb_get_ee_init_ctrl_reg_2(struct ixgb_hw * hw) +uint16_t +ixgb_get_ee_init_ctrl_reg_2(struct ixgb_hw *hw) { struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; - if (ixgb_check_and_get_eeprom_data(hw) == TRUE) - return (ee_map->init_ctrl_reg_2); + if(ixgb_check_and_get_eeprom_data(hw) == TRUE) + return(ee_map->init_ctrl_reg_2); - return (0); + return(0); } /****************************************************************************** @@ -613,14 +642,15 @@ * Returns: * Subsystem Id if EEPROM contents are valid, 0 otherwise ******************************************************************************/ -uint16_t ixgb_get_ee_subsystem_id(struct ixgb_hw * hw) +uint16_t +ixgb_get_ee_subsystem_id(struct ixgb_hw *hw) { struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; - if (ixgb_check_and_get_eeprom_data(hw) == TRUE) - return (ee_map->subsystem_id); + if(ixgb_check_and_get_eeprom_data(hw) == TRUE) + return(ee_map->subsystem_id); - return (0); + return(0); } /****************************************************************************** @@ -631,14 +661,15 @@ * Returns: * Sub Vendor Id if EEPROM contents are valid, 0 otherwise ******************************************************************************/ -uint16_t ixgb_get_ee_subvendor_id(struct ixgb_hw * hw) +uint16_t +ixgb_get_ee_subvendor_id(struct ixgb_hw *hw) { struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; - if (ixgb_check_and_get_eeprom_data(hw) == TRUE) - return (ee_map->subvendor_id); + if(ixgb_check_and_get_eeprom_data(hw) == TRUE) + return(ee_map->subvendor_id); - return (0); + return(0); } /****************************************************************************** @@ -649,14 +680,15 @@ * Returns: * Device Id if EEPROM contents are valid, 0 otherwise ******************************************************************************/ -uint16_t ixgb_get_ee_device_id(struct ixgb_hw * hw) +uint16_t +ixgb_get_ee_device_id(struct ixgb_hw *hw) { struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; - if (ixgb_check_and_get_eeprom_data(hw) == TRUE) - return (ee_map->device_id); + if(ixgb_check_and_get_eeprom_data(hw) == TRUE) + return(ee_map->device_id); - return (0); + return(0); } /****************************************************************************** @@ -667,14 +699,15 @@ * Returns: * Device Id if EEPROM contents are valid, 0 otherwise ******************************************************************************/ -uint16_t ixgb_get_ee_vendor_id(struct ixgb_hw * hw) +uint16_t +ixgb_get_ee_vendor_id(struct ixgb_hw *hw) { struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; - if (ixgb_check_and_get_eeprom_data(hw) == TRUE) - return (ee_map->vendor_id); + if(ixgb_check_and_get_eeprom_data(hw) == TRUE) + return(ee_map->vendor_id); - return (0); + return(0); } /****************************************************************************** @@ -685,14 +718,15 @@ * Returns: * SDP Register if EEPROM contents are valid, 0 otherwise ******************************************************************************/ -uint16_t ixgb_get_ee_swdpins_reg(struct ixgb_hw * hw) +uint16_t +ixgb_get_ee_swdpins_reg(struct ixgb_hw *hw) { struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; - if (ixgb_check_and_get_eeprom_data(hw) == TRUE) - return (ee_map->swdpins_reg); + if(ixgb_check_and_get_eeprom_data(hw) == TRUE) + return(ee_map->swdpins_reg); - return (0); + return(0); } /****************************************************************************** @@ -703,14 +737,15 @@ * Returns: * D3 Power Management Bits if EEPROM contents are valid, 0 otherwise ******************************************************************************/ -uint8_t ixgb_get_ee_d3_power(struct ixgb_hw * hw) +uint8_t +ixgb_get_ee_d3_power(struct ixgb_hw *hw) { struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; - if (ixgb_check_and_get_eeprom_data(hw) == TRUE) - return (ee_map->d3_power); + if(ixgb_check_and_get_eeprom_data(hw) == TRUE) + return(ee_map->d3_power); - return (0); + return(0); } /****************************************************************************** @@ -721,12 +756,13 @@ * Returns: * D0 Power Management Bits if EEPROM contents are valid, 0 otherwise ******************************************************************************/ -uint8_t ixgb_get_ee_d0_power(struct ixgb_hw * hw) +uint8_t +ixgb_get_ee_d0_power(struct ixgb_hw *hw) { struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; - if (ixgb_check_and_get_eeprom_data(hw) == TRUE) - return (ee_map->d0_power); + if(ixgb_check_and_get_eeprom_data(hw) == TRUE) + return(ee_map->d0_power); - return (0); + return(0); } diff -Nru a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c --- a/drivers/net/ixgb/ixgb_ethtool.c 2005-01-10 23:54:12 -05:00 +++ b/drivers/net/ixgb/ixgb_ethtool.c 2005-01-10 23:54:12 -05:00 @@ -37,6 +37,12 @@ extern int ixgb_up(struct ixgb_adapter *adapter); extern void ixgb_down(struct ixgb_adapter *adapter, boolean_t kill_watchdog); +extern void ixgb_reset(struct ixgb_adapter *adapter); +extern int ixgb_setup_rx_resources(struct ixgb_adapter *adapter); +extern int ixgb_setup_tx_resources(struct ixgb_adapter *adapter); +extern void ixgb_free_rx_resources(struct ixgb_adapter *adapter); +extern void ixgb_free_tx_resources(struct ixgb_adapter *adapter); +extern void ixgb_update_stats(struct ixgb_adapter *adapter); struct ixgb_stats { char stat_string[ETH_GSTRING_LEN]; @@ -89,7 +95,7 @@ sizeof(ixgb_gstrings_stats) / sizeof(struct ixgb_stats) static int -ixgb_ethtool_gset(struct net_device *netdev, struct ethtool_cmd *ecmd) +ixgb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) { struct ixgb_adapter *adapter = netdev->priv; ecmd->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE); @@ -97,7 +103,7 @@ ecmd->port = PORT_FIBRE; ecmd->transceiver = XCVR_EXTERNAL; - if (netif_carrier_ok(adapter->netdev)) { + if(netif_carrier_ok(adapter->netdev)) { ecmd->speed = SPEED_10000; ecmd->duplex = DUPLEX_FULL; } else { @@ -110,86 +116,140 @@ } static int -ixgb_ethtool_sset(struct net_device *netdev, struct ethtool_cmd *ecmd) +ixgb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) { struct ixgb_adapter *adapter = netdev->priv; - if (ecmd->autoneg == AUTONEG_ENABLE || - ecmd->speed + ecmd->duplex != SPEED_10000 + DUPLEX_FULL) + if(ecmd->autoneg == AUTONEG_ENABLE || + ecmd->speed + ecmd->duplex != SPEED_10000 + DUPLEX_FULL) return -EINVAL; - else { + + if(netif_running(adapter->netdev)) { ixgb_down(adapter, TRUE); + ixgb_reset(adapter); ixgb_up(adapter); - } + } else + ixgb_reset(adapter); + return 0; } static void -ixgb_ethtool_gpause(struct net_device *dev, - struct ethtool_pauseparam *epause) +ixgb_get_pauseparam(struct net_device *netdev, + struct ethtool_pauseparam *pause) { - struct ixgb_adapter *adapter = dev->priv; + struct ixgb_adapter *adapter = netdev->priv; struct ixgb_hw *hw = &adapter->hw; - - epause->autoneg = AUTONEG_DISABLE; - - if (hw->fc.type == ixgb_fc_rx_pause) - epause->rx_pause = 1; - else if (hw->fc.type == ixgb_fc_tx_pause) - epause->tx_pause = 1; - else if (hw->fc.type == ixgb_fc_full) { - epause->rx_pause = 1; - epause->tx_pause = 1; + + pause->autoneg = AUTONEG_DISABLE; + + if(hw->fc.type == ixgb_fc_rx_pause) + pause->rx_pause = 1; + else if(hw->fc.type == ixgb_fc_tx_pause) + pause->tx_pause = 1; + else if(hw->fc.type == ixgb_fc_full) { + pause->rx_pause = 1; + pause->tx_pause = 1; } } static int -ixgb_ethtool_spause(struct net_device *dev, - struct ethtool_pauseparam *epause) +ixgb_set_pauseparam(struct net_device *netdev, + struct ethtool_pauseparam *pause) { - struct ixgb_adapter *adapter = dev->priv; + struct ixgb_adapter *adapter = netdev->priv; struct ixgb_hw *hw = &adapter->hw; - - if (epause->autoneg == AUTONEG_ENABLE) + + if(pause->autoneg == AUTONEG_ENABLE) return -EINVAL; - if (epause->rx_pause && epause->tx_pause) + if(pause->rx_pause && pause->tx_pause) hw->fc.type = ixgb_fc_full; - else if (epause->rx_pause && !epause->tx_pause) + else if(pause->rx_pause && !pause->tx_pause) hw->fc.type = ixgb_fc_rx_pause; - else if (!epause->rx_pause && epause->tx_pause) + else if(!pause->rx_pause && pause->tx_pause) hw->fc.type = ixgb_fc_tx_pause; - else if (!epause->rx_pause && !epause->tx_pause) + else if(!pause->rx_pause && !pause->tx_pause) hw->fc.type = ixgb_fc_none; - ixgb_down(adapter, TRUE); - ixgb_up(adapter); - + if(netif_running(adapter->netdev)) { + ixgb_down(adapter, TRUE); + ixgb_up(adapter); + } else + ixgb_reset(adapter); + return 0; } -static void -ixgb_ethtool_gdrvinfo(struct net_device *netdev, - struct ethtool_drvinfo *drvinfo) +static uint32_t +ixgb_get_rx_csum(struct net_device *netdev) { struct ixgb_adapter *adapter = netdev->priv; - strncpy(drvinfo->driver, ixgb_driver_name, 32); - strncpy(drvinfo->version, ixgb_driver_version, 32); - strncpy(drvinfo->fw_version, "N/A", 32); - strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32); + return adapter->rx_csum; } +static int +ixgb_set_rx_csum(struct net_device *netdev, uint32_t data) +{ + struct ixgb_adapter *adapter = netdev->priv; + adapter->rx_csum = data; + + if(netif_running(netdev)) { + ixgb_down(adapter,TRUE); + ixgb_up(adapter); + } else + ixgb_reset(adapter); + return 0; +} + +static uint32_t +ixgb_get_tx_csum(struct net_device *netdev) +{ + return (netdev->features & NETIF_F_HW_CSUM) != 0; +} + +static int +ixgb_set_tx_csum(struct net_device *netdev, uint32_t data) +{ + if (data) + netdev->features |= NETIF_F_HW_CSUM; + else + netdev->features &= ~NETIF_F_HW_CSUM; + + return 0; +} + +#ifdef NETIF_F_TSO +static int +ixgb_set_tso(struct net_device *netdev, uint32_t data) +{ + if(data) + netdev->features |= NETIF_F_TSO; + else + netdev->features &= ~NETIF_F_TSO; + return 0; +} +#endif /* NETIF_F_TSO */ + #define IXGB_GET_STAT(_A_, _R_) _A_->stats._R_ + +static int +ixgb_get_regs_len(struct net_device *netdev) +{ +#define IXGB_REG_DUMP_LEN 136*sizeof(uint32_t) + return IXGB_REG_DUMP_LEN; +} + static void -ixgb_ethtool_gregs(struct net_device *dev, struct ethtool_regs *regs, void *buf) +ixgb_get_regs(struct net_device *netdev, + struct ethtool_regs *regs, void *p) { - struct ixgb_adapter *adapter = dev->priv; + struct ixgb_adapter *adapter = netdev->priv; struct ixgb_hw *hw = &adapter->hw; - uint32_t *reg = buf; + uint32_t *reg = p; uint32_t *reg_start = reg; uint8_t i; - regs->version = - (adapter->hw.device_id << 16) | adapter->hw.subsystem_id; + regs->version = (adapter->hw.device_id << 16) | adapter->hw.subsystem_id; /* General Registers */ *reg++ = IXGB_READ_REG(hw, CTRL0); /* 0 */ @@ -219,8 +279,8 @@ *reg++ = IXGB_READ_REG(hw, RXCSUM); /* 20 */ for (i = 0; i < IXGB_RAR_ENTRIES; i++) { - *reg++ = IXGB_READ_REG_ARRAY(hw, RAL, (i << 1)); /*21,...,51 */ - *reg++ = IXGB_READ_REG_ARRAY(hw, RAH, (i << 1)); /*22,...,52 */ + *reg++ = IXGB_READ_REG_ARRAY(hw, RAL, (i << 1)); /*21,...,51 */ + *reg++ = IXGB_READ_REG_ARRAY(hw, RAH, (i << 1)); /*22,...,52 */ } /* Transmit */ @@ -316,73 +376,222 @@ } static int -ixgb_ethtool_geeprom(struct net_device *dev, - struct ethtool_eeprom *eeprom, u8 *data) +ixgb_get_eeprom_len(struct net_device *netdev) { - struct ixgb_adapter *adapter = dev->priv; + /* return size in bytes */ + return (IXGB_EEPROM_SIZE << 1); +} + +static int +ixgb_get_eeprom(struct net_device *netdev, + struct ethtool_eeprom *eeprom, uint8_t *bytes) +{ + struct ixgb_adapter *adapter = netdev->priv; struct ixgb_hw *hw = &adapter->hw; + uint16_t *eeprom_buff; + int i, max_len, first_word, last_word; + int ret_val = 0; + + if(eeprom->len == 0) { + ret_val = -EINVAL; + goto geeprom_error; + } eeprom->magic = hw->vendor_id | (hw->device_id << 16); - /* use our function to read the eeprom and update our cache */ - ixgb_get_eeprom_data(hw); - memcpy(data, (char *)hw->eeprom + eeprom->offset, eeprom->len); - return 0; + max_len = ixgb_get_eeprom_len(netdev); + + if(eeprom->offset > eeprom->offset + eeprom->len) { + ret_val = -EINVAL; + goto geeprom_error; + } + + if((eeprom->offset + eeprom->len) > max_len) + eeprom->len = (max_len - eeprom->offset); + + first_word = eeprom->offset >> 1; + last_word = (eeprom->offset + eeprom->len - 1) >> 1; + + eeprom_buff = kmalloc(sizeof(uint16_t) * + (last_word - first_word + 1), GFP_KERNEL); + if(!eeprom_buff) + return -ENOMEM; + + /* note the eeprom was good because the driver loaded */ + for(i = 0; i <= (last_word - first_word); i++) { + eeprom_buff[i] = ixgb_get_eeprom_word(hw, (first_word + i)); + } + + memcpy(bytes, (uint8_t *)eeprom_buff + (eeprom->offset & 1), + eeprom->len); + kfree(eeprom_buff); + +geeprom_error: + return ret_val; } static int -ixgb_ethtool_seeprom(struct net_device *dev, - struct ethtool_eeprom *eeprom, u8 *data) +ixgb_set_eeprom(struct net_device *netdev, + struct ethtool_eeprom *eeprom, uint8_t *bytes) { - struct ixgb_adapter *adapter = dev->priv; + struct ixgb_adapter *adapter = netdev->priv; struct ixgb_hw *hw = &adapter->hw; - /* We are under rtnl, so static is OK */ - static uint16_t eeprom_buff[IXGB_EEPROM_SIZE]; - int i, first_word, last_word; - char *ptr; + uint16_t *eeprom_buff; + void *ptr; + int max_len, first_word, last_word; + uint16_t i; + + if(eeprom->len == 0) + return -EINVAL; - if (eeprom->magic != (hw->vendor_id | (hw->device_id << 16))) + if(eeprom->magic != (hw->vendor_id | (hw->device_id << 16))) return -EFAULT; + max_len = ixgb_get_eeprom_len(netdev); + + if(eeprom->offset > eeprom->offset + eeprom->len) + return -EINVAL; + + if((eeprom->offset + eeprom->len) > max_len) + eeprom->len = (max_len - eeprom->offset); + first_word = eeprom->offset >> 1; last_word = (eeprom->offset + eeprom->len - 1) >> 1; - ptr = (char *)eeprom_buff; + eeprom_buff = kmalloc(max_len, GFP_KERNEL); + if(!eeprom_buff) + return -ENOMEM; + + ptr = (void *)eeprom_buff; - if (eeprom->offset & 1) { + if(eeprom->offset & 1) { /* need read/modify/write of first changed EEPROM word */ /* only the second byte of the word is being modified */ eeprom_buff[0] = ixgb_read_eeprom(hw, first_word); ptr++; } - if ((eeprom->offset + eeprom->len) & 1) { + if((eeprom->offset + eeprom->len) & 1) { /* need read/modify/write of last changed EEPROM word */ /* only the first byte of the word is being modified */ - eeprom_buff[last_word - first_word] - = ixgb_read_eeprom(hw, last_word); + eeprom_buff[last_word - first_word] + = ixgb_read_eeprom(hw, last_word); } - memcpy(ptr, data, eeprom->len); - for (i = 0; i <= (last_word - first_word); i++) + memcpy(ptr, bytes, eeprom->len); + for(i = 0; i <= (last_word - first_word); i++) ixgb_write_eeprom(hw, first_word + i, eeprom_buff[i]); /* Update the checksum over the first part of the EEPROM if needed */ - if (first_word <= EEPROM_CHECKSUM_REG) + if(first_word <= EEPROM_CHECKSUM_REG) ixgb_update_eeprom_checksum(hw); + kfree(eeprom_buff); return 0; } +static void +ixgb_get_drvinfo(struct net_device *netdev, + struct ethtool_drvinfo *drvinfo) +{ + struct ixgb_adapter *adapter = netdev->priv; + + strncpy(drvinfo->driver, ixgb_driver_name, 32); + strncpy(drvinfo->version, ixgb_driver_version, 32); + strncpy(drvinfo->fw_version, "N/A", 32); + strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32); + drvinfo->n_stats = IXGB_STATS_LEN; + drvinfo->regdump_len = ixgb_get_regs_len(netdev); + drvinfo->eedump_len = ixgb_get_eeprom_len(netdev); +} + +static void +ixgb_get_ringparam(struct net_device *netdev, + struct ethtool_ringparam *ring) +{ + struct ixgb_adapter *adapter = netdev->priv; + struct ixgb_desc_ring *txdr = &adapter->tx_ring; + struct ixgb_desc_ring *rxdr = &adapter->rx_ring; + + ring->rx_max_pending = MAX_RXD; + ring->tx_max_pending = MAX_TXD; + ring->rx_mini_max_pending = 0; + ring->rx_jumbo_max_pending = 0; + ring->rx_pending = rxdr->count; + ring->tx_pending = txdr->count; + ring->rx_mini_pending = 0; + ring->rx_jumbo_pending = 0; +} + +static int +ixgb_set_ringparam(struct net_device *netdev, + struct ethtool_ringparam *ring) +{ + struct ixgb_adapter *adapter = netdev->priv; + struct ixgb_desc_ring *txdr = &adapter->tx_ring; + struct ixgb_desc_ring *rxdr = &adapter->rx_ring; + struct ixgb_desc_ring tx_old, tx_new, rx_old, rx_new; + int err; + + tx_old = adapter->tx_ring; + rx_old = adapter->rx_ring; + + if((ring->rx_mini_pending) || (ring->rx_jumbo_pending)) + return -EINVAL; + + if(netif_running(adapter->netdev)) + ixgb_down(adapter,TRUE); + + rxdr->count = max(ring->rx_pending,(uint32_t)MIN_RXD); + rxdr->count = min(rxdr->count,(uint32_t)MAX_RXD); + IXGB_ROUNDUP(rxdr->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE); + + txdr->count = max(ring->tx_pending,(uint32_t)MIN_TXD); + txdr->count = min(txdr->count,(uint32_t)MAX_TXD); + IXGB_ROUNDUP(txdr->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE); + + if(netif_running(adapter->netdev)) { + /* Try to get new resources before deleting old */ + if((err = ixgb_setup_rx_resources(adapter))) + goto err_setup_rx; + if((err = ixgb_setup_tx_resources(adapter))) + goto err_setup_tx; + + /* save the new, restore the old in order to free it, + * then restore the new back again */ + + rx_new = adapter->rx_ring; + tx_new = adapter->tx_ring; + adapter->rx_ring = rx_old; + adapter->tx_ring = tx_old; + ixgb_free_rx_resources(adapter); + ixgb_free_tx_resources(adapter); + adapter->rx_ring = rx_new; + adapter->tx_ring = tx_new; + if((err = ixgb_up(adapter))) + return err; + } + + return 0; +err_setup_tx: + ixgb_free_rx_resources(adapter); +err_setup_rx: + adapter->rx_ring = rx_old; + adapter->tx_ring = tx_old; + ixgb_up(adapter); + return err; +} + /* toggle LED 4 times per second = 2 "blinks" per second */ #define IXGB_ID_INTERVAL (HZ/4) /* bit defines for adapter->led_status */ #define IXGB_LED_ON 0 -static void ixgb_led_blink_callback(unsigned long data) +static void +ixgb_led_blink_callback(unsigned long data) { struct ixgb_adapter *adapter = (struct ixgb_adapter *)data; - if (test_and_change_bit(IXGB_LED_ON, &adapter->led_status)) + if(test_and_change_bit(IXGB_LED_ON, &adapter->led_status)) ixgb_led_off(&adapter->hw); else ixgb_led_on(&adapter->hw); @@ -391,10 +600,14 @@ } static int -ixgb_ethtool_led_blink(struct net_device *netdev, u32 data) +ixgb_phys_id(struct net_device *netdev, uint32_t data) { struct ixgb_adapter *adapter = netdev->priv; - if (!adapter->blink_timer.function) { + + if(!data || data > (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ)) + data = (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ); + + if(!adapter->blink_timer.function) { init_timer(&adapter->blink_timer); adapter->blink_timer.function = ixgb_led_blink_callback; adapter->blink_timer.data = (unsigned long)adapter; @@ -403,7 +616,7 @@ mod_timer(&adapter->blink_timer, jiffies); set_current_state(TASK_INTERRUPTIBLE); - if (data) + if(data) schedule_timeout(data * HZ); else schedule_timeout(MAX_SCHEDULE_TIMEOUT); @@ -415,141 +628,74 @@ return 0; } -static int ixgb_nway_reset(struct net_device *netdev) -{ - if (netif_running(netdev)) { - struct ixgb_adapter *adapter = netdev->priv; - ixgb_down(adapter, TRUE); - ixgb_up(adapter); - } - return 0; -} - -static int ixgb_get_stats_count(struct net_device *dev) +static int +ixgb_get_stats_count(struct net_device *netdev) { return IXGB_STATS_LEN; } -static void ixgb_get_strings(struct net_device *dev, u32 stringset, u8 *data) +static void +ixgb_get_ethtool_stats(struct net_device *netdev, + struct ethtool_stats *stats, uint64_t *data) { + struct ixgb_adapter *adapter = netdev->priv; int i; - for (i = 0; i < IXGB_STATS_LEN; i++) { - memcpy(data + i * ETH_GSTRING_LEN, - ixgb_gstrings_stats[i].stat_string, - ETH_GSTRING_LEN); - } -} - -static int ixgb_get_regs_len(struct net_device *dev) -{ - return 136*sizeof(uint32_t); -} -static int ixgb_get_eeprom_len(struct net_device *dev) -{ - /* return size in bytes */ - return (IXGB_EEPROM_SIZE << 1); + ixgb_update_stats(adapter); + for(i = 0; i < IXGB_STATS_LEN; i++) { + char *p = (char *)adapter+ixgb_gstrings_stats[i].stat_offset; + data[i] = (ixgb_gstrings_stats[i].sizeof_stat == + sizeof(uint64_t)) ? *(uint64_t *)p : *(uint32_t *)p; + } } -static void get_ethtool_stats(struct net_device *dev, - struct ethtool_stats *stats, u64 *data) +static void +ixgb_get_strings(struct net_device *netdev, uint32_t stringset, uint8_t *data) { - struct ixgb_adapter *adapter = dev->priv; int i; - for (i = 0; i < IXGB_STATS_LEN; i++) { - void *p = (char *)adapter + ixgb_gstrings_stats[i].stat_offset; - stats->data[i] = - (ixgb_gstrings_stats[i].sizeof_stat == sizeof(uint64_t)) - ? *(uint64_t *) p - : *(uint32_t *) p; + switch(stringset) { + case ETH_SS_STATS: + for(i=0; i < IXGB_STATS_LEN; i++) { + memcpy(data + i * ETH_GSTRING_LEN, + ixgb_gstrings_stats[i].stat_string, + ETH_GSTRING_LEN); + } + break; } } -static u32 ixgb_get_rx_csum(struct net_device *dev) -{ - struct ixgb_adapter *adapter = dev->priv; - return adapter->rx_csum; -} - -static int ixgb_set_rx_csum(struct net_device *dev, u32 sum) -{ - struct ixgb_adapter *adapter = dev->priv; - adapter->rx_csum = sum; - ixgb_down(adapter, TRUE); - ixgb_up(adapter); - return 0; -} - -static u32 ixgb_get_tx_csum(struct net_device *dev) -{ - return (dev->features & NETIF_F_HW_CSUM) != 0; -} - -static int ixgb_set_tx_csum(struct net_device *dev, u32 sum) -{ - if (sum) - dev->features |= NETIF_F_HW_CSUM; - else - dev->features &= ~NETIF_F_HW_CSUM; - return 0; -} - -static u32 ixgb_get_sg(struct net_device *dev) -{ - return (dev->features & NETIF_F_SG) != 0; -} - -static int ixgb_set_sg(struct net_device *dev, u32 sum) -{ - if (sum) - dev->features |= NETIF_F_SG; - else - dev->features &= ~NETIF_F_SG; - return 0; -} - -#ifdef NETIF_F_TSO -static u32 ixgb_get_tso(struct net_device *dev) -{ - return (dev->features & NETIF_F_TSO) != 0; -} - -static int ixgb_set_tso(struct net_device *dev, u32 sum) -{ - if (sum) - dev->features |= NETIF_F_TSO; - else - dev->features &= ~NETIF_F_TSO; - return 0; -} -#endif - struct ethtool_ops ixgb_ethtool_ops = { - .get_settings = ixgb_ethtool_gset, - .set_settings = ixgb_ethtool_sset, - .get_drvinfo = ixgb_ethtool_gdrvinfo, - .nway_reset = ixgb_nway_reset, - .get_link = ethtool_op_get_link, - .phys_id = ixgb_ethtool_led_blink, - .get_strings = ixgb_get_strings, - .get_stats_count = ixgb_get_stats_count, - .get_regs = ixgb_ethtool_gregs, + .get_settings = ixgb_get_settings, + .set_settings = ixgb_set_settings, + .get_drvinfo = ixgb_get_drvinfo, .get_regs_len = ixgb_get_regs_len, + .get_regs = ixgb_get_regs, + .get_link = ethtool_op_get_link, .get_eeprom_len = ixgb_get_eeprom_len, - .get_eeprom = ixgb_ethtool_geeprom, - .set_eeprom = ixgb_ethtool_seeprom, - .get_pauseparam = ixgb_ethtool_gpause, - .set_pauseparam = ixgb_ethtool_spause, - .get_ethtool_stats = get_ethtool_stats, + .get_eeprom = ixgb_get_eeprom, + .set_eeprom = ixgb_set_eeprom, + .get_ringparam = ixgb_get_ringparam, + .set_ringparam = ixgb_set_ringparam, + .get_pauseparam = ixgb_get_pauseparam, + .set_pauseparam = ixgb_set_pauseparam, .get_rx_csum = ixgb_get_rx_csum, .set_rx_csum = ixgb_set_rx_csum, .get_tx_csum = ixgb_get_tx_csum, .set_tx_csum = ixgb_set_tx_csum, - .get_sg = ixgb_get_sg, - .set_sg = ixgb_set_sg, + .get_sg = ethtool_op_get_sg, + .set_sg = ethtool_op_set_sg, #ifdef NETIF_F_TSO - .get_tso = ixgb_get_tso, + .get_tso = ethtool_op_get_tso, .set_tso = ixgb_set_tso, #endif + .get_strings = ixgb_get_strings, + .phys_id = ixgb_phys_id, + .get_stats_count = ixgb_get_stats_count, + .get_ethtool_stats = ixgb_get_ethtool_stats, }; + +void set_ethtool_ops(struct net_device *netdev) +{ + SET_ETHTOOL_OPS(netdev, &ixgb_ethtool_ops); +} diff -Nru a/drivers/net/ixgb/ixgb_hw.c b/drivers/net/ixgb/ixgb_hw.c --- a/drivers/net/ixgb/ixgb_hw.c 2005-01-10 23:54:12 -05:00 +++ b/drivers/net/ixgb/ixgb_hw.c 2005-01-10 23:54:12 -05:00 @@ -53,9 +53,14 @@ { uint32_t ctrl_reg; - ctrl_reg = IXGB_CTRL0_RST | IXGB_CTRL0_SDP3_DIR | /* All pins are Output=1 */ - IXGB_CTRL0_SDP2_DIR | IXGB_CTRL0_SDP1_DIR | IXGB_CTRL0_SDP0_DIR | IXGB_CTRL0_SDP3 | /* Initial value 1101 */ - IXGB_CTRL0_SDP2 | IXGB_CTRL0_SDP0; + ctrl_reg = IXGB_CTRL0_RST | + IXGB_CTRL0_SDP3_DIR | /* All pins are Output=1 */ + IXGB_CTRL0_SDP2_DIR | + IXGB_CTRL0_SDP1_DIR | + IXGB_CTRL0_SDP0_DIR | + IXGB_CTRL0_SDP3 | /* Initial value 1101 */ + IXGB_CTRL0_SDP2 | + IXGB_CTRL0_SDP0; #ifdef HP_ZX1 /* Workaround for 82597EX reset errata */ @@ -84,7 +89,8 @@ * * hw - Struct containing variables accessed by shared code *****************************************************************************/ -boolean_t ixgb_adapter_stop(struct ixgb_hw * hw) +boolean_t +ixgb_adapter_stop(struct ixgb_hw *hw) { uint32_t ctrl_reg; uint32_t icr_reg; @@ -94,7 +100,7 @@ /* If we are stopped or resetting exit gracefully and wait to be * started again before accessing the hardware. */ - if (hw->adapter_stopped) { + if(hw->adapter_stopped) { DEBUGOUT("Exiting because the adapter is already stopped!!!\n"); return FALSE; } @@ -135,6 +141,7 @@ return (ctrl_reg & IXGB_CTRL0_RST); } + /****************************************************************************** * Identifies the vendor of the optics module on the adapter. The SR adapters * support two different types of XPAK optics, so it is necessary to determine @@ -144,7 +151,8 @@ * * Returns: the vendor of the XPAK optics module. *****************************************************************************/ -static ixgb_xpak_vendor ixgb_identify_xpak_vendor(struct ixgb_hw *hw) +static ixgb_xpak_vendor +ixgb_identify_xpak_vendor(struct ixgb_hw *hw) { uint32_t i; uint16_t vendor_name[5]; @@ -183,7 +191,8 @@ * * Returns: the phy type of the adapter. *****************************************************************************/ -static ixgb_phy_type ixgb_identify_phy(struct ixgb_hw *hw) +static ixgb_phy_type +ixgb_identify_phy(struct ixgb_hw *hw) { ixgb_phy_type phy_type; ixgb_xpak_vendor xpak_vendor; @@ -210,6 +219,11 @@ phy_type = ixgb_phy_type_g6005; } break; + case IXGB_DEVICE_ID_82597EX_LR: + DEBUGOUT("Identified G6104 optics\n"); + phy_type = ixgb_phy_type_g6104; + break; + default: DEBUGOUT("Unknown physical layer module\n"); @@ -237,7 +251,8 @@ * TRUE if successful, * FALSE if unrecoverable problems were encountered. *****************************************************************************/ -boolean_t ixgb_init_hw(struct ixgb_hw * hw) +boolean_t +ixgb_init_hw(struct ixgb_hw *hw) { uint32_t i; uint32_t ctrl_reg; @@ -266,7 +281,7 @@ msec_delay(IXGB_DELAY_AFTER_EE_RESET); if (ixgb_get_eeprom_data(hw) == FALSE) { - return (FALSE); + return(FALSE); } /* Use the device id to determine the type of phy/transceiver. */ @@ -284,7 +299,7 @@ */ if (!mac_addr_valid(hw->curr_mac_addr)) { DEBUGOUT("MAC address invalid after ixgb_init_rx_addrs\n"); - return (FALSE); + return(FALSE); } /* tell the routines in this file they can access hardware again */ @@ -295,7 +310,7 @@ /* Zero out the Multicast HASH table */ DEBUGOUT("Zeroing the MTA\n"); - for (i = 0; i < IXGB_MC_TBL_SIZE; i++) + for(i = 0; i < IXGB_MC_TBL_SIZE; i++) IXGB_WRITE_REG_ARRAY(hw, MTA, i, 0); /* Zero out the VLAN Filter Table Array */ @@ -322,7 +337,8 @@ * of the receive addresss registers. Clears the multicast table. Assumes * the receiver is in reset when the routine is called. *****************************************************************************/ -void ixgb_init_rx_addrs(struct ixgb_hw *hw) +void +ixgb_init_rx_addrs(struct ixgb_hw *hw) { uint32_t i; @@ -360,7 +376,7 @@ /* Zero out the other 15 receive addresses. */ DEBUGOUT("Clearing RAR[1-15]\n"); - for (i = 1; i < IXGB_RAR_ENTRIES; i++) { + for(i = 1; i < IXGB_RAR_ENTRIES; i++) { IXGB_WRITE_REG_ARRAY(hw, RA, (i << 1), 0); IXGB_WRITE_REG_ARRAY(hw, RA, ((i << 1) + 1), 0); } @@ -383,12 +399,13 @@ *****************************************************************************/ void ixgb_mc_addr_list_update(struct ixgb_hw *hw, - uint8_t * mc_addr_list, - uint32_t mc_addr_count, uint32_t pad) + uint8_t *mc_addr_list, + uint32_t mc_addr_count, + uint32_t pad) { uint32_t hash_value; uint32_t i; - uint32_t rar_used_count = 1; /* RAR[0] is used for our MAC address */ + uint32_t rar_used_count = 1; /* RAR[0] is used for our MAC address */ DEBUGFUNC("ixgb_mc_addr_list_update"); @@ -397,19 +414,19 @@ /* Clear RAR[1-15] */ DEBUGOUT(" Clearing RAR[1-15]\n"); - for (i = rar_used_count; i < IXGB_RAR_ENTRIES; i++) { + for(i = rar_used_count; i < IXGB_RAR_ENTRIES; i++) { IXGB_WRITE_REG_ARRAY(hw, RA, (i << 1), 0); IXGB_WRITE_REG_ARRAY(hw, RA, ((i << 1) + 1), 0); } /* Clear the MTA */ DEBUGOUT(" Clearing MTA\n"); - for (i = 0; i < IXGB_MC_TBL_SIZE; i++) { + for(i = 0; i < IXGB_MC_TBL_SIZE; i++) { IXGB_WRITE_REG_ARRAY(hw, MTA, i, 0); } /* Add the new addresses */ - for (i = 0; i < mc_addr_count; i++) { + for(i = 0; i < mc_addr_count; i++) { DEBUGOUT(" Adding the multicast addresses:\n"); DEBUGOUT7(" MC Addr #%d =%.2X %.2X %.2X %.2X %.2X %.2X\n", i, mc_addr_list[i * (IXGB_ETH_LENGTH_OF_ADDRESS + pad)], @@ -427,7 +444,7 @@ /* Place this multicast address in the RAR if there is room, * * else put it in the MTA */ - if (rar_used_count < IXGB_RAR_ENTRIES) { + if(rar_used_count < IXGB_RAR_ENTRIES) { ixgb_rar_set(hw, mc_addr_list + (i * (IXGB_ETH_LENGTH_OF_ADDRESS + pad)), @@ -460,7 +477,9 @@ * Returns: * The hash value *****************************************************************************/ -static uint32_t ixgb_hash_mc_addr(struct ixgb_hw *hw, uint8_t * mc_addr) +static uint32_t +ixgb_hash_mc_addr(struct ixgb_hw *hw, + uint8_t *mc_addr) { uint32_t hash_value = 0; @@ -506,7 +525,9 @@ * hw - Struct containing variables accessed by shared code * hash_value - Multicast address hash value *****************************************************************************/ -static void ixgb_mta_set(struct ixgb_hw *hw, uint32_t hash_value) +static void +ixgb_mta_set(struct ixgb_hw *hw, + uint32_t hash_value) { uint32_t hash_bit, hash_reg; uint32_t mta_reg; @@ -538,7 +559,10 @@ * addr - Address to put into receive address register * index - Receive address register to write *****************************************************************************/ -void ixgb_rar_set(struct ixgb_hw *hw, uint8_t * addr, uint32_t index) +void +ixgb_rar_set(struct ixgb_hw *hw, + uint8_t *addr, + uint32_t index) { uint32_t rar_low, rar_high; @@ -548,11 +572,13 @@ * from network order (big endian) to little endian */ rar_low = ((uint32_t) addr[0] | - ((uint32_t) addr[1] << 8) | - ((uint32_t) addr[2] << 16) | ((uint32_t) addr[3] << 24)); + ((uint32_t)addr[1] << 8) | + ((uint32_t)addr[2] << 16) | + ((uint32_t)addr[3] << 24)); rar_high = ((uint32_t) addr[4] | - ((uint32_t) addr[5] << 8) | IXGB_RAH_AV); + ((uint32_t)addr[5] << 8) | + IXGB_RAH_AV); IXGB_WRITE_REG_ARRAY(hw, RA, (index << 1), rar_low); IXGB_WRITE_REG_ARRAY(hw, RA, ((index << 1) + 1), rar_high); @@ -566,7 +592,10 @@ * offset - Offset in VLAN filer table to write * value - Value to write into VLAN filter table *****************************************************************************/ -void ixgb_write_vfta(struct ixgb_hw *hw, uint32_t offset, uint32_t value) +void +ixgb_write_vfta(struct ixgb_hw *hw, + uint32_t offset, + uint32_t value) { IXGB_WRITE_REG_ARRAY(hw, VFTA, offset, value); return; @@ -577,11 +606,12 @@ * * hw - Struct containing variables accessed by shared code *****************************************************************************/ -void ixgb_clear_vfta(struct ixgb_hw *hw) +void +ixgb_clear_vfta(struct ixgb_hw *hw) { uint32_t offset; - for (offset = 0; offset < IXGB_VLAN_FILTER_TBL_SIZE; offset++) + for(offset = 0; offset < IXGB_VLAN_FILTER_TBL_SIZE; offset++) IXGB_WRITE_REG_ARRAY(hw, VFTA, offset, 0); return; } @@ -592,10 +622,11 @@ * hw - Struct containing variables accessed by shared code *****************************************************************************/ -boolean_t ixgb_setup_fc(struct ixgb_hw * hw) +boolean_t +ixgb_setup_fc(struct ixgb_hw *hw) { uint32_t ctrl_reg; - uint32_t pap_reg = 0; /* by default, assume no pause time */ + uint32_t pap_reg = 0; /* by default, assume no pause time */ boolean_t status = TRUE; DEBUGFUNC("ixgb_setup_fc"); @@ -660,16 +691,16 @@ * ability to transmit pause frames in not enabled, then these * registers will be set to 0. */ - if (!(hw->fc.type & ixgb_fc_tx_pause)) { + if(!(hw->fc.type & ixgb_fc_tx_pause)) { IXGB_WRITE_REG(hw, FCRTL, 0); IXGB_WRITE_REG(hw, FCRTH, 0); } else { - /* We need to set up the Receive Threshold high and low water - * marks as well as (optionally) enabling the transmission of XON frames. - */ - if (hw->fc.send_xon) { + /* We need to set up the Receive Threshold high and low water + * marks as well as (optionally) enabling the transmission of XON + * frames. */ + if(hw->fc.send_xon) { IXGB_WRITE_REG(hw, FCRTL, - (hw->fc.low_water | IXGB_FCRTL_XONE)); + (hw->fc.low_water | IXGB_FCRTL_XONE)); } else { IXGB_WRITE_REG(hw, FCRTL, hw->fc.low_water); } @@ -694,9 +725,10 @@ * read command. *****************************************************************************/ uint16_t -ixgb_read_phy_reg(struct ixgb_hw * hw, - uint32_t reg_address, - uint32_t phy_address, uint32_t device_type) +ixgb_read_phy_reg(struct ixgb_hw *hw, + uint32_t reg_address, + uint32_t phy_address, + uint32_t device_type) { uint32_t i; uint32_t data; @@ -721,7 +753,8 @@ ** from the CPU Write to the Ready bit assertion. **************************************************************/ - for (i = 0; i < 10; i++) { + for(i = 0; i < 10; i++) + { udelay(10); command = IXGB_READ_REG(hw, MSCA); @@ -747,7 +780,8 @@ ** from the CPU Write to the Ready bit assertion. **************************************************************/ - for (i = 0; i < 10; i++) { + for(i = 0; i < 10; i++) + { udelay(10); command = IXGB_READ_REG(hw, MSCA); @@ -763,7 +797,7 @@ */ data = IXGB_READ_REG(hw, MSRWD); data >>= IXGB_MSRWD_READ_DATA_SHIFT; - return ((uint16_t) data); + return((uint16_t) data); } /****************************************************************************** @@ -785,8 +819,10 @@ *****************************************************************************/ void ixgb_write_phy_reg(struct ixgb_hw *hw, - uint32_t reg_address, - uint32_t phy_address, uint32_t device_type, uint16_t data) + uint32_t reg_address, + uint32_t phy_address, + uint32_t device_type, + uint16_t data) { uint32_t i; uint32_t command = 0; @@ -796,24 +832,25 @@ ASSERT(device_type <= IXGB_MAX_PHY_DEV_TYPE); /* Put the data in the MDIO Read/Write Data register */ - IXGB_WRITE_REG(hw, MSRWD, (uint32_t) data); + IXGB_WRITE_REG(hw, MSRWD, (uint32_t)data); /* Setup and write the address cycle command */ - command = ((reg_address << IXGB_MSCA_NP_ADDR_SHIFT) | - (device_type << IXGB_MSCA_DEV_TYPE_SHIFT) | - (phy_address << IXGB_MSCA_PHY_ADDR_SHIFT) | - (IXGB_MSCA_ADDR_CYCLE | IXGB_MSCA_MDI_COMMAND)); + command = ((reg_address << IXGB_MSCA_NP_ADDR_SHIFT) | + (device_type << IXGB_MSCA_DEV_TYPE_SHIFT) | + (phy_address << IXGB_MSCA_PHY_ADDR_SHIFT) | + (IXGB_MSCA_ADDR_CYCLE | IXGB_MSCA_MDI_COMMAND)); IXGB_WRITE_REG(hw, MSCA, command); - /************************************************************** - ** Check every 10 usec to see if the address cycle completed - ** The COMMAND bit will clear when the operation is complete. - ** This may take as long as 64 usecs (we'll wait 100 usecs max) - ** from the CPU Write to the Ready bit assertion. - **************************************************************/ + /************************************************************** + ** Check every 10 usec to see if the address cycle completed + ** The COMMAND bit will clear when the operation is complete. + ** This may take as long as 64 usecs (we'll wait 100 usecs max) + ** from the CPU Write to the Ready bit assertion. + **************************************************************/ - for (i = 0; i < 10; i++) { + for(i = 0; i < 10; i++) + { udelay(10); command = IXGB_READ_REG(hw, MSCA); @@ -825,21 +862,22 @@ ASSERT((command & IXGB_MSCA_MDI_COMMAND) == 0); /* Address cycle complete, setup and write the write command */ - command = ((reg_address << IXGB_MSCA_NP_ADDR_SHIFT) | - (device_type << IXGB_MSCA_DEV_TYPE_SHIFT) | - (phy_address << IXGB_MSCA_PHY_ADDR_SHIFT) | - (IXGB_MSCA_WRITE | IXGB_MSCA_MDI_COMMAND)); + command = ((reg_address << IXGB_MSCA_NP_ADDR_SHIFT) | + (device_type << IXGB_MSCA_DEV_TYPE_SHIFT) | + (phy_address << IXGB_MSCA_PHY_ADDR_SHIFT) | + (IXGB_MSCA_WRITE | IXGB_MSCA_MDI_COMMAND)); IXGB_WRITE_REG(hw, MSCA, command); - /************************************************************** - ** Check every 10 usec to see if the read command completed - ** The COMMAND bit will clear when the operation is complete. - ** The write may take as long as 64 usecs (we'll wait 100 usecs max) - ** from the CPU Write to the Ready bit assertion. - **************************************************************/ + /************************************************************** + ** Check every 10 usec to see if the read command completed + ** The COMMAND bit will clear when the operation is complete. + ** The write may take as long as 64 usecs (we'll wait 100 usecs max) + ** from the CPU Write to the Ready bit assertion. + **************************************************************/ - for (i = 0; i < 10; i++) { + for(i = 0; i < 10; i++) + { udelay(10); command = IXGB_READ_REG(hw, MSCA); @@ -860,7 +898,8 @@ * * Called by any function that needs to check the link status of the adapter. *****************************************************************************/ -void ixgb_check_for_link(struct ixgb_hw *hw) +void +ixgb_check_for_link(struct ixgb_hw *hw) { uint32_t status_reg; uint32_t xpcss_reg; @@ -922,14 +961,15 @@ * * hw - Struct containing variables accessed by shared code *****************************************************************************/ -void ixgb_clear_hw_cntrs(struct ixgb_hw *hw) +void +ixgb_clear_hw_cntrs(struct ixgb_hw *hw) { volatile uint32_t temp_reg; DEBUGFUNC("ixgb_clear_hw_cntrs"); /* if we are stopped or resetting exit gracefully */ - if (hw->adapter_stopped) { + if(hw->adapter_stopped) { DEBUGOUT("Exiting because the adapter is stopped!!!\n"); return; } @@ -1002,7 +1042,8 @@ * * hw - Struct containing variables accessed by shared code *****************************************************************************/ -void ixgb_led_on(struct ixgb_hw *hw) +void +ixgb_led_on(struct ixgb_hw *hw) { uint32_t ctrl0_reg = IXGB_READ_REG(hw, CTRL0); @@ -1017,7 +1058,8 @@ * * hw - Struct containing variables accessed by shared code *****************************************************************************/ -void ixgb_led_off(struct ixgb_hw *hw) +void +ixgb_led_off(struct ixgb_hw *hw) { uint32_t ctrl0_reg = IXGB_READ_REG(hw, CTRL0); @@ -1032,18 +1074,19 @@ * * hw - Struct containing variables accessed by shared code *****************************************************************************/ -static void ixgb_get_bus_info(struct ixgb_hw *hw) +static void +ixgb_get_bus_info(struct ixgb_hw *hw) { uint32_t status_reg; status_reg = IXGB_READ_REG(hw, STATUS); hw->bus.type = (status_reg & IXGB_STATUS_PCIX_MODE) ? - ixgb_bus_type_pcix : ixgb_bus_type_pci; + ixgb_bus_type_pcix : ixgb_bus_type_pci; if (hw->bus.type == ixgb_bus_type_pci) { hw->bus.speed = (status_reg & IXGB_STATUS_PCI_SPD) ? - ixgb_bus_speed_66 : ixgb_bus_speed_33; + ixgb_bus_speed_66 : ixgb_bus_speed_33; } else { switch (status_reg & IXGB_STATUS_PCIX_SPD_MASK) { case IXGB_STATUS_PCIX_SPD_66: @@ -1062,7 +1105,7 @@ } hw->bus.width = (status_reg & IXGB_STATUS_BUS64) ? - ixgb_bus_width_64 : ixgb_bus_width_32; + ixgb_bus_width_64 : ixgb_bus_width_32; return; } @@ -1073,7 +1116,8 @@ * mac_addr - pointer to MAC address. * *****************************************************************************/ -boolean_t mac_addr_valid(uint8_t * mac_addr) +boolean_t +mac_addr_valid(uint8_t *mac_addr) { boolean_t is_valid = TRUE; DEBUGFUNC("mac_addr_valid"); @@ -1090,9 +1134,11 @@ } /* Reject the zero address */ else if (mac_addr[0] == 0 && - mac_addr[1] == 0 && - mac_addr[2] == 0 && - mac_addr[3] == 0 && mac_addr[4] == 0 && mac_addr[5] == 0) { + mac_addr[1] == 0 && + mac_addr[2] == 0 && + mac_addr[3] == 0 && + mac_addr[4] == 0 && + mac_addr[5] == 0) { DEBUGOUT("MAC address is all zeros\n"); is_valid = FALSE; } @@ -1105,7 +1151,8 @@ * * hw - Struct containing variables accessed by shared code *****************************************************************************/ -boolean_t ixgb_link_reset(struct ixgb_hw * hw) +boolean_t +ixgb_link_reset(struct ixgb_hw *hw) { boolean_t link_status = FALSE; uint8_t wait_retries = MAX_RESET_ITERATIONS; @@ -1135,20 +1182,22 @@ * * hw - Struct containing variables accessed by shared code *****************************************************************************/ -void ixgb_optics_reset(struct ixgb_hw *hw) +void +ixgb_optics_reset(struct ixgb_hw *hw) { if (hw->phy_type == ixgb_phy_type_txn17401) { uint16_t mdio_reg; ixgb_write_phy_reg(hw, - MDIO_PMA_PMD_CR1, - IXGB_PHY_ADDRESS, - MDIO_PMA_PMD_DID, MDIO_PMA_PMD_CR1_RESET); - - mdio_reg = ixgb_read_phy_reg(hw, - MDIO_PMA_PMD_CR1, - IXGB_PHY_ADDRESS, - MDIO_PMA_PMD_DID); + MDIO_PMA_PMD_CR1, + IXGB_PHY_ADDRESS, + MDIO_PMA_PMD_DID, + MDIO_PMA_PMD_CR1_RESET); + + mdio_reg = ixgb_read_phy_reg( hw, + MDIO_PMA_PMD_CR1, + IXGB_PHY_ADDRESS, + MDIO_PMA_PMD_DID); } return; diff -Nru a/drivers/net/ixgb/ixgb_hw.h b/drivers/net/ixgb/ixgb_hw.h --- a/drivers/net/ixgb/ixgb_hw.h 2005-01-10 23:54:12 -05:00 +++ b/drivers/net/ixgb/ixgb_hw.h 2005-01-10 23:54:12 -05:00 @@ -616,17 +616,17 @@ #define IXGB_CONTEXT_DESC_STATUS_DD 0x01 /* Filters */ -#define IXGB_RAR_ENTRIES 16 /* Number of entries in Rx Address array */ #define IXGB_MC_TBL_SIZE 128 /* Multicast Filter Table (4096 bits) */ #define IXGB_VLAN_FILTER_TBL_SIZE 128 /* VLAN Filter Table (4096 bits) */ +#define IXGB_RAR_ENTRIES 3 /* Number of entries in Rx Address array */ #define IXGB_MEMORY_REGISTER_BASE_ADDRESS 0 -#define ENET_HEADER_SIZE 14 -#define ENET_FCS_LENGTH 4 -#define IXGB_MAX_NUM_MULTICAST_ADDRESSES 128 -#define IXGB_MIN_ENET_FRAME_SIZE_WITHOUT_FCS 60 -#define IXGB_MAX_ENET_FRAME_SIZE_WITHOUT_FCS 1514 -#define IXGB_MAX_JUMBO_FRAME_SIZE 0x3F00 +#define ENET_HEADER_SIZE 14 +#define ENET_FCS_LENGTH 4 +#define IXGB_MAX_NUM_MULTICAST_ADDRESSES 128 +#define IXGB_MIN_ENET_FRAME_SIZE_WITHOUT_FCS 60 +#define IXGB_MAX_ENET_FRAME_SIZE_WITHOUT_FCS 1514 +#define IXGB_MAX_JUMBO_FRAME_SIZE 0x3F00 /* Phy Addresses */ #define IXGB_OPTICAL_PHY_ADDR 0x0 /* Optical Module phy address */ @@ -789,32 +789,39 @@ extern boolean_t ixgb_check_for_bad_link(struct ixgb_hw *hw); extern boolean_t ixgb_setup_fc(struct ixgb_hw *hw); extern void ixgb_clear_hw_cntrs(struct ixgb_hw *hw); -extern boolean_t mac_addr_valid(uint8_t * mac_addr); +extern boolean_t mac_addr_valid(uint8_t *mac_addr); extern uint16_t ixgb_read_phy_reg(struct ixgb_hw *hw, - uint32_t reg_addr, - uint32_t phy_addr, uint32_t device_type); + uint32_t reg_addr, + uint32_t phy_addr, + uint32_t device_type); extern void ixgb_write_phy_reg(struct ixgb_hw *hw, - uint32_t reg_addr, - uint32_t phy_addr, - uint32_t device_type, uint16_t data); + uint32_t reg_addr, + uint32_t phy_addr, + uint32_t device_type, + uint16_t data); + +extern void ixgb_rar_set(struct ixgb_hw *hw, + uint8_t *addr, + uint32_t index); -extern void ixgb_rar_set(struct ixgb_hw *hw, uint8_t * addr, uint32_t index); /* Filters (multicast, vlan, receive) */ extern void ixgb_mc_addr_list_update(struct ixgb_hw *hw, - uint8_t * mc_addr_list, - uint32_t mc_addr_count, uint32_t pad); + uint8_t *mc_addr_list, + uint32_t mc_addr_count, + uint32_t pad); /* Vfta functions */ extern void ixgb_write_vfta(struct ixgb_hw *hw, - uint32_t offset, uint32_t value); + uint32_t offset, + uint32_t value); extern void ixgb_clear_vfta(struct ixgb_hw *hw); /* Access functions to eeprom data */ -void ixgb_get_ee_mac_addr(struct ixgb_hw *hw, uint8_t * mac_addr); +void ixgb_get_ee_mac_addr(struct ixgb_hw *hw, uint8_t *mac_addr); uint16_t ixgb_get_ee_compatibility(struct ixgb_hw *hw); uint32_t ixgb_get_ee_pba_number(struct ixgb_hw *hw); uint16_t ixgb_get_ee_init_ctrl_reg_1(struct ixgb_hw *hw); @@ -832,6 +839,9 @@ /* Everything else */ void ixgb_led_on(struct ixgb_hw *hw); void ixgb_led_off(struct ixgb_hw *hw); -void ixgb_write_pci_cfg(struct ixgb_hw *hw, uint32_t reg, uint16_t * value); +void ixgb_write_pci_cfg(struct ixgb_hw *hw, + uint32_t reg, + uint16_t * value); -#endif /* _IXGB_HW_H_ */ + +#endif /* _IXGB_HW_H_ */ diff -Nru a/drivers/net/ixgb/ixgb_ids.h b/drivers/net/ixgb/ixgb_ids.h --- a/drivers/net/ixgb/ixgb_ids.h 2005-01-10 23:54:12 -05:00 +++ b/drivers/net/ixgb/ixgb_ids.h 2005-01-10 23:54:12 -05:00 @@ -33,21 +33,16 @@ ** The Device and Vendor IDs for 10 Gigabit MACs **********************************************************************/ -#define INTEL_VENDOR_ID 0x8086 -#define INTEL_SUBVENDOR_ID 0x8086 +#define INTEL_VENDOR_ID 0x8086 +#define INTEL_SUBVENDOR_ID 0x8086 -#define IXGB_DEVICE_ID_82597EX 0x1048 -#define IXGB_DEVICE_ID_82597EX_SR 0x1A48 -#define IXGB_SUBDEVICE_ID_A11F 0xA11F -#define IXGB_SUBDEVICE_ID_A01F 0xA01F +#define IXGB_DEVICE_ID_82597EX 0x1048 +#define IXGB_DEVICE_ID_82597EX_SR 0x1A48 +#define IXGB_DEVICE_ID_82597EX_LR 0x1B48 +#define IXGB_SUBDEVICE_ID_A11F 0xA11F +#define IXGB_SUBDEVICE_ID_A01F 0xA01F -#define IXGB_SUBDEVICE_ID_A15F 0xA15F -#define IXGB_SUBDEVICE_ID_A05F 0xA05F - -#define IXGB_SUBDEVICE_ID_A12F 0xA12F -#define IXGB_SUBDEVICE_ID_A02F 0xA02F - -#endif /* #ifndef _IXGB_IDS_H_ */ +#endif /* #ifndef _IXGB_IDS_H_ */ /* End of File */ diff -Nru a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c --- a/drivers/net/ixgb/ixgb_main.c 2005-01-10 23:54:12 -05:00 +++ b/drivers/net/ixgb/ixgb_main.c 2005-01-10 23:54:12 -05:00 @@ -28,10 +28,23 @@ #include "ixgb.h" +/* Change Log + * 1.0.84 10/26/04 + * - reset buffer_info->dma in Tx resource cleanup logic + * 1.0.83 10/12/04 + * - sparse cleanup - shemminger@osdl.org + * - fix tx resource cleanup logic + */ + char ixgb_driver_name[] = "ixgb"; char ixgb_driver_string[] = "Intel(R) PRO/10GbE Network Driver"; -char ixgb_driver_version[] = "1.0.66-k2"; -char ixgb_copyright[] = "Copyright (c) 2001-2004 Intel Corporation."; +#ifndef CONFIG_IXGB_NAPI +#define DRIVERNAPI +#else +#define DRIVERNAPI "-NAPI" +#endif +char ixgb_driver_version[] = "1.0.87-k2"DRIVERNAPI; +char ixgb_copyright[] = "Copyright (c) 1999-2004 Intel Corporation."; /* ixgb_pci_tbl - PCI Device ID Table * @@ -46,6 +59,8 @@ PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {INTEL_VENDOR_ID, IXGB_DEVICE_ID_82597EX_SR, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {INTEL_VENDOR_ID, IXGB_DEVICE_ID_82597EX_LR, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* required last entry */ {0,} @@ -55,11 +70,14 @@ /* Local Function Prototypes */ -static inline void ixgb_irq_disable(struct ixgb_adapter *adapter); -static inline void ixgb_irq_enable(struct ixgb_adapter *adapter); int ixgb_up(struct ixgb_adapter *adapter); void ixgb_down(struct ixgb_adapter *adapter, boolean_t kill_watchdog); void ixgb_reset(struct ixgb_adapter *adapter); +int ixgb_setup_tx_resources(struct ixgb_adapter *adapter); +int ixgb_setup_rx_resources(struct ixgb_adapter *adapter); +void ixgb_free_tx_resources(struct ixgb_adapter *adapter); +void ixgb_free_rx_resources(struct ixgb_adapter *adapter); +void ixgb_update_stats(struct ixgb_adapter *adapter); static int ixgb_init_module(void); static void ixgb_exit_module(void); @@ -68,27 +86,19 @@ static int ixgb_sw_init(struct ixgb_adapter *adapter); static int ixgb_open(struct net_device *netdev); static int ixgb_close(struct net_device *netdev); -static int ixgb_setup_tx_resources(struct ixgb_adapter *adapter); -static int ixgb_setup_rx_resources(struct ixgb_adapter *adapter); static void ixgb_configure_tx(struct ixgb_adapter *adapter); static void ixgb_configure_rx(struct ixgb_adapter *adapter); static void ixgb_setup_rctl(struct ixgb_adapter *adapter); static void ixgb_clean_tx_ring(struct ixgb_adapter *adapter); static void ixgb_clean_rx_ring(struct ixgb_adapter *adapter); -static void ixgb_free_tx_resources(struct ixgb_adapter *adapter); -static void ixgb_free_rx_resources(struct ixgb_adapter *adapter); static void ixgb_set_multi(struct net_device *netdev); static void ixgb_watchdog(unsigned long data); static int ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev); static struct net_device_stats *ixgb_get_stats(struct net_device *netdev); static int ixgb_change_mtu(struct net_device *netdev, int new_mtu); static int ixgb_set_mac(struct net_device *netdev, void *p); -static void ixgb_update_stats(struct ixgb_adapter *adapter); static irqreturn_t ixgb_intr(int irq, void *data, struct pt_regs *regs); static boolean_t ixgb_clean_tx_irq(struct ixgb_adapter *adapter); -static inline void ixgb_rx_checksum(struct ixgb_adapter *adapter, - struct ixgb_rx_desc *rx_desc, - struct sk_buff *skb); #ifdef CONFIG_IXGB_NAPI static int ixgb_clean(struct net_device *netdev, int *budget); static boolean_t ixgb_clean_rx_irq(struct ixgb_adapter *adapter, @@ -97,6 +107,7 @@ static boolean_t ixgb_clean_rx_irq(struct ixgb_adapter *adapter); #endif static void ixgb_alloc_rx_buffers(struct ixgb_adapter *adapter); +void set_ethtool_ops(struct net_device *netdev); static void ixgb_tx_timeout(struct net_device *dev); static void ixgb_tx_timeout_task(struct net_device *dev); static void ixgb_vlan_rx_register(struct net_device *netdev, @@ -123,7 +134,6 @@ /* Exported from other modules */ extern void ixgb_check_options(struct ixgb_adapter *adapter); -extern struct ethtool_ops ixgb_ethtool_ops; static struct pci_driver ixgb_driver = { .name = ixgb_driver_name, @@ -152,7 +162,8 @@ * loaded. All it does is register with the PCI subsystem. **/ -static int __init ixgb_init_module(void) +static int __init +ixgb_init_module(void) { int ret; printk(KERN_INFO "%s - version %s\n", @@ -161,7 +172,7 @@ printk(KERN_INFO "%s\n", ixgb_copyright); ret = pci_module_init(&ixgb_driver); - if (ret >= 0) { + if(ret >= 0) { register_reboot_notifier(&ixgb_notifier_reboot); } return ret; @@ -176,7 +187,8 @@ * from memory. **/ -static void __exit ixgb_exit_module(void) +static void __exit +ixgb_exit_module(void) { unregister_reboot_notifier(&ixgb_notifier_reboot); pci_unregister_driver(&ixgb_driver); @@ -189,7 +201,8 @@ * @adapter: board private structure **/ -static inline void ixgb_irq_disable(struct ixgb_adapter *adapter) +static inline void +ixgb_irq_disable(struct ixgb_adapter *adapter) { atomic_inc(&adapter->irq_sem); IXGB_WRITE_REG(&adapter->hw, IMC, ~0); @@ -202,17 +215,19 @@ * @adapter: board private structure **/ -static inline void ixgb_irq_enable(struct ixgb_adapter *adapter) +static inline void +ixgb_irq_enable(struct ixgb_adapter *adapter) { - if (atomic_dec_and_test(&adapter->irq_sem)) { + if(atomic_dec_and_test(&adapter->irq_sem)) { IXGB_WRITE_REG(&adapter->hw, IMS, - IXGB_INT_RXT0 | IXGB_INT_RXDMT0 | IXGB_INT_TXDW | - IXGB_INT_RXO | IXGB_INT_LSC); + IXGB_INT_RXT0 | IXGB_INT_RXDMT0 | IXGB_INT_TXDW | + IXGB_INT_RXO | IXGB_INT_LSC); IXGB_WRITE_FLUSH(&adapter->hw); } } -int ixgb_up(struct ixgb_adapter *adapter) +int +ixgb_up(struct ixgb_adapter *adapter) { struct net_device *netdev = adapter->netdev; int err; @@ -230,27 +245,44 @@ ixgb_configure_rx(adapter); ixgb_alloc_rx_buffers(adapter); - if ((err = request_irq(adapter->pdev->irq, &ixgb_intr, - SA_SHIRQ | SA_SAMPLE_RANDOM, - netdev->name, netdev))) +#ifdef CONFIG_PCI_MSI + { + boolean_t pcix = (IXGB_READ_REG(&adapter->hw, STATUS) & + IXGB_STATUS_PCIX_MODE) ? TRUE : FALSE; + adapter->have_msi = TRUE; + + if (!pcix) + adapter->have_msi = FALSE; + else if((err = pci_enable_msi(adapter->pdev))) { + printk (KERN_ERR + "Unable to allocate MSI interrupt Error: %d\n", err); + adapter->have_msi = FALSE; + /* proceed to try to request regular interrupt */ + } + } + +#endif + if((err = request_irq(adapter->pdev->irq, &ixgb_intr, + SA_SHIRQ | SA_SAMPLE_RANDOM, + netdev->name, netdev))) return err; /* disable interrupts and get the hardware into a known state */ IXGB_WRITE_REG(&adapter->hw, IMC, 0xffffffff); - if ((hw->max_frame_size != max_frame) || - (hw->max_frame_size != - (IXGB_READ_REG(hw, MFS) >> IXGB_MFS_SHIFT))) { + if((hw->max_frame_size != max_frame) || + (hw->max_frame_size != + (IXGB_READ_REG(hw, MFS) >> IXGB_MFS_SHIFT))) { hw->max_frame_size = max_frame; IXGB_WRITE_REG(hw, MFS, hw->max_frame_size << IXGB_MFS_SHIFT); - if (hw->max_frame_size > - IXGB_MAX_ENET_FRAME_SIZE_WITHOUT_FCS + ENET_FCS_LENGTH) { + if(hw->max_frame_size > + IXGB_MAX_ENET_FRAME_SIZE_WITHOUT_FCS + ENET_FCS_LENGTH) { uint32_t ctrl0 = IXGB_READ_REG(hw, CTRL0); - if (!(ctrl0 & IXGB_CTRL0_JFE)) { + if(!(ctrl0 & IXGB_CTRL0_JFE)) { ctrl0 |= IXGB_CTRL0_JFE; IXGB_WRITE_REG(hw, CTRL0, ctrl0); } @@ -263,13 +295,19 @@ return 0; } -void ixgb_down(struct ixgb_adapter *adapter, boolean_t kill_watchdog) +void +ixgb_down(struct ixgb_adapter *adapter, boolean_t kill_watchdog) { struct net_device *netdev = adapter->netdev; ixgb_irq_disable(adapter); free_irq(adapter->pdev->irq, netdev); - if (kill_watchdog) +#ifdef CONFIG_PCI_MSI + if(adapter->have_msi == TRUE) + pci_disable_msi(adapter->pdev); + +#endif + if(kill_watchdog) del_timer_sync(&adapter->watchdog_timer); adapter->link_speed = 0; adapter->link_duplex = 0; @@ -281,11 +319,12 @@ ixgb_clean_rx_ring(adapter); } -void ixgb_reset(struct ixgb_adapter *adapter) +void +ixgb_reset(struct ixgb_adapter *adapter) { ixgb_adapter_stop(&adapter->hw); - if (!ixgb_init_hw(&adapter->hw)) + if(!ixgb_init_hw(&adapter->hw)) IXGB_DBG("ixgb_init_hw failed.\n"); } @@ -302,7 +341,8 @@ **/ static int __devinit -ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) +ixgb_probe(struct pci_dev *pdev, + const struct pci_device_id *ent) { struct net_device *netdev = NULL; struct ixgb_adapter *adapter; @@ -313,26 +353,26 @@ int i; int err; - if ((err = pci_enable_device(pdev))) + if((err = pci_enable_device(pdev))) return err; - if (!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK))) { + if(!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK))) { pci_using_dac = 1; } else { - if ((err = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) { + if((err = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) { IXGB_ERR("No usable DMA configuration, aborting\n"); return err; } pci_using_dac = 0; } - if ((err = pci_request_regions(pdev, ixgb_driver_name))) + if((err = pci_request_regions(pdev, ixgb_driver_name))) return err; pci_set_master(pdev); netdev = alloc_etherdev(sizeof(struct ixgb_adapter)); - if (!netdev) { + if(!netdev) { err = -ENOMEM; goto err_alloc_etherdev; } @@ -350,15 +390,15 @@ mmio_len = pci_resource_len(pdev, BAR_0); adapter->hw.hw_addr = ioremap(mmio_start, mmio_len); - if (!adapter->hw.hw_addr) { + if(!adapter->hw.hw_addr) { err = -EIO; goto err_ioremap; } - for (i = BAR_1; i <= BAR_5; i++) { - if (pci_resource_len(pdev, i) == 0) + for(i = BAR_1; i <= BAR_5; i++) { + if(pci_resource_len(pdev, i) == 0) continue; - if (pci_resource_flags(pdev, i) & IORESOURCE_IO) { + if(pci_resource_flags(pdev, i) & IORESOURCE_IO) { adapter->hw.io_base = pci_resource_start(pdev, i); break; } @@ -371,9 +411,9 @@ netdev->set_multicast_list = &ixgb_set_multi; netdev->set_mac_address = &ixgb_set_mac; netdev->change_mtu = &ixgb_change_mtu; + set_ethtool_ops(netdev); netdev->tx_timeout = &ixgb_tx_timeout; netdev->watchdog_timeo = HZ; - SET_ETHTOOL_OPS(netdev, &ixgb_ethtool_ops); #ifdef CONFIG_IXGB_NAPI netdev->poll = &ixgb_clean; netdev->weight = 64; @@ -395,22 +435,24 @@ /* setup the private structure */ - if ((err = ixgb_sw_init(adapter))) + if((err = ixgb_sw_init(adapter))) goto err_sw_init; netdev->features = NETIF_F_SG | - NETIF_F_HW_CSUM | - NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER; + NETIF_F_HW_CSUM | + NETIF_F_HW_VLAN_TX | + NETIF_F_HW_VLAN_RX | + NETIF_F_HW_VLAN_FILTER; #ifdef NETIF_F_TSO netdev->features |= NETIF_F_TSO; #endif - if (pci_using_dac) + if(pci_using_dac) netdev->features |= NETIF_F_HIGHDMA; /* make sure the EEPROM is good */ - if (!ixgb_validate_eeprom_checksum(&adapter->hw)) { + if(!ixgb_validate_eeprom_checksum(&adapter->hw)) { printk(KERN_ERR "The EEPROM Checksum Is Not Valid\n"); err = -EIO; goto err_eeprom; @@ -418,7 +460,7 @@ ixgb_get_ee_mac_addr(&adapter->hw, netdev->dev_addr); - if (!is_valid_ether_addr(netdev->dev_addr)) { + if(!is_valid_ether_addr(netdev->dev_addr)) { err = -EIO; goto err_eeprom; } @@ -432,7 +474,7 @@ INIT_WORK(&adapter->tx_timeout_task, (void (*)(void *))ixgb_tx_timeout_task, netdev); - if ((err = register_netdev(netdev))) + if((err = register_netdev(netdev))) goto err_register; /* we're going to reset, so assume we have no link for now */ @@ -441,7 +483,7 @@ netif_stop_queue(netdev); printk(KERN_INFO "%s: Intel(R) PRO/10GbE Network Connection\n", - netdev->name); + netdev->name); ixgb_check_options(adapter); /* reset the hardware with the new settings */ @@ -450,13 +492,13 @@ cards_found++; return 0; - err_register: - err_sw_init: - err_eeprom: +err_register: +err_sw_init: +err_eeprom: iounmap(adapter->hw.hw_addr); - err_ioremap: +err_ioremap: free_netdev(netdev); - err_alloc_etherdev: +err_alloc_etherdev: pci_release_regions(pdev); return err; } @@ -471,7 +513,8 @@ * memory. **/ -static void __devexit ixgb_remove(struct pci_dev *pdev) +static void __devexit +ixgb_remove(struct pci_dev *pdev) { struct net_device *netdev = pci_get_drvdata(pdev); struct ixgb_adapter *adapter = netdev->priv; @@ -493,7 +536,8 @@ * OS network device settings (MTU size). **/ -static int __devinit ixgb_sw_init(struct ixgb_adapter *adapter) +static int __devinit +ixgb_sw_init(struct ixgb_adapter *adapter) { struct ixgb_hw *hw = &adapter->hw; struct net_device *netdev = adapter->netdev; @@ -510,9 +554,10 @@ hw->max_frame_size = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH; - if ((hw->device_id == IXGB_DEVICE_ID_82597EX) - || (hw->device_id == IXGB_DEVICE_ID_82597EX_SR)) - hw->mac_type = ixgb_82597; + if((hw->device_id == IXGB_DEVICE_ID_82597EX) + ||(hw->device_id == IXGB_DEVICE_ID_82597EX_LR) + ||(hw->device_id == IXGB_DEVICE_ID_82597EX_SR)) + hw->mac_type = ixgb_82597; else { /* should never have loaded on this device */ printk(KERN_ERR "ixgb: unsupported device id\n"); @@ -540,31 +585,32 @@ * and the stack is notified that the interface is ready. **/ -static int ixgb_open(struct net_device *netdev) +static int +ixgb_open(struct net_device *netdev) { struct ixgb_adapter *adapter = netdev->priv; int err; /* allocate transmit descriptors */ - if ((err = ixgb_setup_tx_resources(adapter))) + if((err = ixgb_setup_tx_resources(adapter))) goto err_setup_tx; /* allocate receive descriptors */ - if ((err = ixgb_setup_rx_resources(adapter))) + if((err = ixgb_setup_rx_resources(adapter))) goto err_setup_rx; - if ((err = ixgb_up(adapter))) + if((err = ixgb_up(adapter))) goto err_up; return 0; - err_up: +err_up: ixgb_free_rx_resources(adapter); - err_setup_rx: +err_setup_rx: ixgb_free_tx_resources(adapter); - err_setup_tx: +err_setup_tx: ixgb_reset(adapter); return err; @@ -582,7 +628,8 @@ * hardware, and all transmit and receive resources are freed. **/ -static int ixgb_close(struct net_device *netdev) +static int +ixgb_close(struct net_device *netdev) { struct ixgb_adapter *adapter = netdev->priv; @@ -601,15 +648,16 @@ * Return 0 on success, negative on failure **/ -static int ixgb_setup_tx_resources(struct ixgb_adapter *adapter) +int +ixgb_setup_tx_resources(struct ixgb_adapter *adapter) { struct ixgb_desc_ring *txdr = &adapter->tx_ring; struct pci_dev *pdev = adapter->pdev; int size; size = sizeof(struct ixgb_buffer) * txdr->count; - txdr->buffer_info = kmalloc(size, GFP_KERNEL); - if (!txdr->buffer_info) { + txdr->buffer_info = vmalloc(size); + if(!txdr->buffer_info) { return -ENOMEM; } memset(txdr->buffer_info, 0, size); @@ -620,8 +668,8 @@ IXGB_ROUNDUP(txdr->size, 4096); txdr->desc = pci_alloc_consistent(pdev, txdr->size, &txdr->dma); - if (!txdr->desc) { - kfree(txdr->buffer_info); + if(!txdr->desc) { + vfree(txdr->buffer_info); return -ENOMEM; } memset(txdr->desc, 0, txdr->size); @@ -639,7 +687,8 @@ * Configure the Tx unit of the MAC after a reset. **/ -static void ixgb_configure_tx(struct ixgb_adapter *adapter) +static void +ixgb_configure_tx(struct ixgb_adapter *adapter) { uint64_t tdba = adapter->tx_ring.dma; uint32_t tdlen = adapter->tx_ring.count * sizeof(struct ixgb_tx_desc); @@ -679,8 +728,8 @@ /* Setup Transmit Descriptor Settings for this adapter */ adapter->tx_cmd_type = - IXGB_TX_DESC_TYPE - | (adapter->tx_int_delay_enable ? IXGB_TX_DESC_CMD_IDE : 0); + IXGB_TX_DESC_TYPE + | (adapter->tx_int_delay_enable ? IXGB_TX_DESC_CMD_IDE : 0); } /** @@ -690,15 +739,16 @@ * Returns 0 on success, negative on failure **/ -static int ixgb_setup_rx_resources(struct ixgb_adapter *adapter) +int +ixgb_setup_rx_resources(struct ixgb_adapter *adapter) { struct ixgb_desc_ring *rxdr = &adapter->rx_ring; struct pci_dev *pdev = adapter->pdev; int size; size = sizeof(struct ixgb_buffer) * rxdr->count; - rxdr->buffer_info = kmalloc(size, GFP_KERNEL); - if (!rxdr->buffer_info) { + rxdr->buffer_info = vmalloc(size); + if(!rxdr->buffer_info) { return -ENOMEM; } memset(rxdr->buffer_info, 0, size); @@ -710,8 +760,8 @@ rxdr->desc = pci_alloc_consistent(pdev, rxdr->size, &rxdr->dma); - if (!rxdr->desc) { - kfree(rxdr->buffer_info); + if(!rxdr->desc) { + vfree(rxdr->buffer_info); return -ENOMEM; } memset(rxdr->desc, 0, rxdr->size); @@ -727,7 +777,8 @@ * @adapter: Board private structure **/ -static void ixgb_setup_rctl(struct ixgb_adapter *adapter) +static void +ixgb_setup_rctl(struct ixgb_adapter *adapter) { uint32_t rctl; @@ -736,9 +787,9 @@ rctl &= ~(3 << IXGB_RCTL_MO_SHIFT); rctl |= - IXGB_RCTL_BAM | IXGB_RCTL_RDMTS_1_2 | - IXGB_RCTL_RXEN | IXGB_RCTL_CFF | - (adapter->hw.mc_filter_type << IXGB_RCTL_MO_SHIFT); + IXGB_RCTL_BAM | IXGB_RCTL_RDMTS_1_2 | + IXGB_RCTL_RXEN | IXGB_RCTL_CFF | + (adapter->hw.mc_filter_type << IXGB_RCTL_MO_SHIFT); rctl |= IXGB_RCTL_SECRC; @@ -768,7 +819,8 @@ * Configure the Rx unit of the MAC after a reset. **/ -static void ixgb_configure_rx(struct ixgb_adapter *adapter) +static void +ixgb_configure_rx(struct ixgb_adapter *adapter) { uint64_t rdba = adapter->rx_ring.dma; uint32_t rdlen = adapter->rx_ring.count * sizeof(struct ixgb_rx_desc); @@ -797,51 +849,14 @@ IXGB_WRITE_REG(hw, RDH, 0); IXGB_WRITE_REG(hw, RDT, 0); - /* burst 16 or burst when RXT0 */ - rxdctl = RXDCTL_WTHRESH_DEFAULT << IXGB_RXDCTL_WTHRESH_SHIFT - | RXDCTL_HTHRESH_DEFAULT << IXGB_RXDCTL_HTHRESH_SHIFT - | RXDCTL_PTHRESH_DEFAULT << IXGB_RXDCTL_PTHRESH_SHIFT; + /* burst 16 or burst when RXT0*/ + rxdctl = RXDCTL_WTHRESH_DEFAULT << IXGB_RXDCTL_WTHRESH_SHIFT + | RXDCTL_HTHRESH_DEFAULT << IXGB_RXDCTL_HTHRESH_SHIFT + | RXDCTL_PTHRESH_DEFAULT << IXGB_RXDCTL_PTHRESH_SHIFT; IXGB_WRITE_REG(hw, RXDCTL, rxdctl); - if (adapter->raidc) { - uint32_t raidc; - uint8_t poll_threshold; - - /* Poll every rx_int_delay period, if RBD exists - * Receive Backlog Detection is set to - * Rx Descriptors - * max is 0x3F == set to poll when 504 RxDesc left - * min is 0 */ - - /* polling times are 1 == 0.8192us - 2 == 1.6384us - 3 == 3.2768us etc - ... - 511 == 418 us - */ -#define IXGB_RAIDC_POLL_DEFAULT 122 /* set to poll every ~100 us under load - also known as 10000 interrupts / sec */ - - /* divide this by 2^3 (8) to get a register size count */ - poll_threshold = ((adapter->rx_ring.count - 1) >> 3); - /* poll at half of that size */ - poll_threshold >>= 1; - /* make sure its not bigger than our max */ - poll_threshold &= 0x3F; - - raidc = IXGB_RAIDC_EN | /* turn on raidc style moderation */ - IXGB_RAIDC_RXT_GATE | /* don't interrupt with rxt0 while - in RBD mode (polling) */ - (IXGB_RAIDC_POLL_DEFAULT << IXGB_RAIDC_POLL_SHIFT) | - /* this sets the regular "min interrupt delay" */ - (adapter->rx_int_delay << IXGB_RAIDC_DELAY_SHIFT) | - poll_threshold; - - IXGB_WRITE_REG(hw, RAIDC, raidc); - } - /* Enable Receive Checksum Offload for TCP and UDP */ - if (adapter->rx_csum == TRUE) { + if(adapter->rx_csum == TRUE) { rxcsum = IXGB_READ_REG(hw, RXCSUM); rxcsum |= IXGB_RXCSUM_TUOFL; IXGB_WRITE_REG(hw, RXCSUM, rxcsum); @@ -859,13 +874,14 @@ * Free all transmit software resources **/ -static void ixgb_free_tx_resources(struct ixgb_adapter *adapter) +void +ixgb_free_tx_resources(struct ixgb_adapter *adapter) { struct pci_dev *pdev = adapter->pdev; ixgb_clean_tx_ring(adapter); - kfree(adapter->tx_ring.buffer_info); + vfree(adapter->tx_ring.buffer_info); adapter->tx_ring.buffer_info = NULL; pci_free_consistent(pdev, adapter->tx_ring.size, @@ -874,33 +890,42 @@ adapter->tx_ring.desc = NULL; } +static inline void +ixgb_unmap_and_free_tx_resource(struct ixgb_adapter *adapter, + struct ixgb_buffer *buffer_info) +{ + struct pci_dev *pdev = adapter->pdev; + if(buffer_info->dma) { + pci_unmap_page(pdev, + buffer_info->dma, + buffer_info->length, + PCI_DMA_TODEVICE); + buffer_info->dma = 0; + } + if(buffer_info->skb) { + dev_kfree_skb_any(buffer_info->skb); + buffer_info->skb = NULL; + } +} + /** * ixgb_clean_tx_ring - Free Tx Buffers * @adapter: board private structure **/ -static void ixgb_clean_tx_ring(struct ixgb_adapter *adapter) +static void +ixgb_clean_tx_ring(struct ixgb_adapter *adapter) { struct ixgb_desc_ring *tx_ring = &adapter->tx_ring; struct ixgb_buffer *buffer_info; - struct pci_dev *pdev = adapter->pdev; unsigned long size; unsigned int i; /* Free all the Tx ring sk_buffs */ - for (i = 0; i < tx_ring->count; i++) { + for(i = 0; i < tx_ring->count; i++) { buffer_info = &tx_ring->buffer_info[i]; - if (buffer_info->skb) { - - pci_unmap_page(pdev, - buffer_info->dma, - buffer_info->length, PCI_DMA_TODEVICE); - - dev_kfree_skb(buffer_info->skb); - - buffer_info->skb = NULL; - } + ixgb_unmap_and_free_tx_resource(adapter, buffer_info); } size = sizeof(struct ixgb_buffer) * tx_ring->count; @@ -924,14 +949,15 @@ * Free all receive software resources **/ -static void ixgb_free_rx_resources(struct ixgb_adapter *adapter) +void +ixgb_free_rx_resources(struct ixgb_adapter *adapter) { struct ixgb_desc_ring *rx_ring = &adapter->rx_ring; struct pci_dev *pdev = adapter->pdev; ixgb_clean_rx_ring(adapter); - kfree(rx_ring->buffer_info); + vfree(rx_ring->buffer_info); rx_ring->buffer_info = NULL; pci_free_consistent(pdev, rx_ring->size, rx_ring->desc, rx_ring->dma); @@ -944,7 +970,8 @@ * @adapter: board private structure **/ -static void ixgb_clean_rx_ring(struct ixgb_adapter *adapter) +static void +ixgb_clean_rx_ring(struct ixgb_adapter *adapter) { struct ixgb_desc_ring *rx_ring = &adapter->rx_ring; struct ixgb_buffer *buffer_info; @@ -954,9 +981,9 @@ /* Free all the Rx ring sk_buffs */ - for (i = 0; i < rx_ring->count; i++) { + for(i = 0; i < rx_ring->count; i++) { buffer_info = &rx_ring->buffer_info[i]; - if (buffer_info->skb) { + if(buffer_info->skb) { pci_unmap_single(pdev, buffer_info->dma, @@ -991,12 +1018,13 @@ * Returns 0 on success, negative on failure **/ -static int ixgb_set_mac(struct net_device *netdev, void *p) +static int +ixgb_set_mac(struct net_device *netdev, void *p) { struct ixgb_adapter *adapter = netdev->priv; struct sockaddr *addr = p; - if (!is_valid_ether_addr(addr->sa_data)) + if(!is_valid_ether_addr(addr->sa_data)) return -EADDRNOTAVAIL; memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); @@ -1016,7 +1044,8 @@ * promiscuous mode, and all-multi behavior. **/ -static void ixgb_set_multi(struct net_device *netdev) +static void +ixgb_set_multi(struct net_device *netdev) { struct ixgb_adapter *adapter = netdev->priv; struct ixgb_hw *hw = &adapter->hw; @@ -1028,16 +1057,16 @@ rctl = IXGB_READ_REG(hw, RCTL); - if (netdev->flags & IFF_PROMISC) { + if(netdev->flags & IFF_PROMISC) { rctl |= (IXGB_RCTL_UPE | IXGB_RCTL_MPE); - } else if (netdev->flags & IFF_ALLMULTI) { + } else if(netdev->flags & IFF_ALLMULTI) { rctl |= IXGB_RCTL_MPE; rctl &= ~IXGB_RCTL_UPE; } else { rctl &= ~(IXGB_RCTL_UPE | IXGB_RCTL_MPE); } - if (netdev->mc_count > IXGB_MAX_NUM_MULTICAST_ADDRESSES) { + if(netdev->mc_count > IXGB_MAX_NUM_MULTICAST_ADDRESSES) { rctl |= IXGB_RCTL_MPE; IXGB_WRITE_REG(hw, RCTL, rctl); } else { @@ -1045,10 +1074,10 @@ IXGB_WRITE_REG(hw, RCTL, rctl); - for (i = 0, mc_ptr = netdev->mc_list; mc_ptr; - i++, mc_ptr = mc_ptr->next) + for(i = 0, mc_ptr = netdev->mc_list; mc_ptr; + i++, mc_ptr = mc_ptr->next) memcpy(&mta[i * IXGB_ETH_LENGTH_OF_ADDRESS], - mc_ptr->dmi_addr, IXGB_ETH_LENGTH_OF_ADDRESS); + mc_ptr->dmi_addr, IXGB_ETH_LENGTH_OF_ADDRESS); ixgb_mc_addr_list_update(hw, mta, netdev->mc_count, 0); } @@ -1059,7 +1088,8 @@ * @data: pointer to netdev cast into an unsigned long **/ -static void ixgb_watchdog(unsigned long data) +static void +ixgb_watchdog(unsigned long data) { struct ixgb_adapter *adapter = (struct ixgb_adapter *)data; struct net_device *netdev = adapter->netdev; @@ -1073,21 +1103,22 @@ netif_stop_queue(netdev); } - if (adapter->hw.link_up) { - if (!netif_carrier_ok(netdev)) { + if(adapter->hw.link_up) { + if(!netif_carrier_ok(netdev)) { printk(KERN_INFO "ixgb: %s NIC Link is Up %d Mbps %s\n", - netdev->name, 10000, "Full Duplex"); + netdev->name, 10000, "Full Duplex"); adapter->link_speed = 10000; adapter->link_duplex = FULL_DUPLEX; netif_carrier_on(netdev); netif_wake_queue(netdev); } } else { - if (netif_carrier_ok(netdev)) { + if(netif_carrier_ok(netdev)) { adapter->link_speed = 0; adapter->link_duplex = 0; printk(KERN_INFO - "ixgb: %s NIC Link is Down\n", netdev->name); + "ixgb: %s NIC Link is Down\n", + netdev->name); netif_carrier_off(netdev); netif_stop_queue(netdev); @@ -1096,8 +1127,8 @@ ixgb_update_stats(adapter); - if (!netif_carrier_ok(netdev)) { - if (IXGB_DESC_UNUSED(txdr) + 1 < txdr->count) { + if(!netif_carrier_ok(netdev)) { + if(IXGB_DESC_UNUSED(txdr) + 1 < txdr->count) { /* We've lost link, so the controller stops DMA, * but we've got queued Tx work that's never going * to get done, so reset controller to flush Tx. @@ -1108,9 +1139,9 @@ /* Early detection of hung controller */ i = txdr->next_to_clean; - if (txdr->buffer_info[i].dma && - time_after(jiffies, txdr->buffer_info[i].time_stamp + HZ) && - !(IXGB_READ_REG(&adapter->hw, STATUS) & IXGB_STATUS_TXOFF)) + if(txdr->buffer_info[i].dma && + time_after(jiffies, txdr->buffer_info[i].time_stamp + HZ) && + !(IXGB_READ_REG(&adapter->hw, STATUS) & IXGB_STATUS_TXOFF)) netif_stop_queue(netdev); /* generate an interrupt to force clean up of any stragglers */ @@ -1133,7 +1164,7 @@ uint8_t ipcss, ipcso, tucss, tucso, hdr_len; uint16_t ipcse, tucse, mss; - if (likely(skb_shinfo(skb)->tso_size)) { + if(likely(skb_shinfo(skb)->tso_size)) { hdr_len = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2)); mss = skb_shinfo(skb)->tso_size; skb->nh.iph->tot_len = 0; @@ -1160,22 +1191,16 @@ context_desc->mss = cpu_to_le16(mss); context_desc->hdr_len = hdr_len; context_desc->status = 0; - context_desc->cmd_type_len = cpu_to_le32(IXGB_CONTEXT_DESC_TYPE - | - IXGB_CONTEXT_DESC_CMD_TSE - | - IXGB_CONTEXT_DESC_CMD_IP - | - IXGB_CONTEXT_DESC_CMD_TCP - | - IXGB_CONTEXT_DESC_CMD_RS - | - IXGB_CONTEXT_DESC_CMD_IDE - | (skb->len - - (hdr_len))); + context_desc->cmd_type_len = cpu_to_le32( + IXGB_CONTEXT_DESC_TYPE + | IXGB_CONTEXT_DESC_CMD_TSE + | IXGB_CONTEXT_DESC_CMD_IP + | IXGB_CONTEXT_DESC_CMD_TCP + | IXGB_CONTEXT_DESC_CMD_RS + | IXGB_CONTEXT_DESC_CMD_IDE + | (skb->len - (hdr_len))); - if (++i == adapter->tx_ring.count) - i = 0; + if(++i == adapter->tx_ring.count) i = 0; adapter->tx_ring.next_to_use = i; return TRUE; @@ -1192,7 +1217,7 @@ unsigned int i; uint8_t css, cso; - if (likely(skb->ip_summed == CHECKSUM_HW)) { + if(likely(skb->ip_summed == CHECKSUM_HW)) { css = skb->h.raw - skb->data; cso = (skb->h.raw + skb->csum) - skb->data; @@ -1203,16 +1228,16 @@ context_desc->tucso = cso; context_desc->tucse = 0; /* zero out any previously existing data in one instruction */ - *(uint32_t *) & (context_desc->ipcss) = 0; + *(uint32_t *)&(context_desc->ipcss) = 0; context_desc->status = 0; context_desc->hdr_len = 0; context_desc->mss = 0; context_desc->cmd_type_len = - cpu_to_le32(IXGB_CONTEXT_DESC_TYPE - | IXGB_TX_DESC_CMD_RS | IXGB_TX_DESC_CMD_IDE); + cpu_to_le32(IXGB_CONTEXT_DESC_TYPE + | IXGB_TX_DESC_CMD_RS + | IXGB_TX_DESC_CMD_IDE); - if (++i == adapter->tx_ring.count) - i = 0; + if(++i == adapter->tx_ring.count) i = 0; adapter->tx_ring.next_to_use = i; return TRUE; @@ -1239,45 +1264,46 @@ i = tx_ring->next_to_use; - while (len) { + while(len) { buffer_info = &tx_ring->buffer_info[i]; size = min(len, IXGB_MAX_JUMBO_FRAME_SIZE); buffer_info->length = size; buffer_info->dma = - pci_map_single(adapter->pdev, - skb->data + offset, size, PCI_DMA_TODEVICE); + pci_map_single(adapter->pdev, + skb->data + offset, + size, + PCI_DMA_TODEVICE); buffer_info->time_stamp = jiffies; len -= size; offset += size; count++; - if (++i == tx_ring->count) - i = 0; + if(++i == tx_ring->count) i = 0; } - for (f = 0; f < nr_frags; f++) { + for(f = 0; f < nr_frags; f++) { struct skb_frag_struct *frag; frag = &skb_shinfo(skb)->frags[f]; len = frag->size; offset = 0; - while (len) { + while(len) { buffer_info = &tx_ring->buffer_info[i]; size = min(len, IXGB_MAX_JUMBO_FRAME_SIZE); buffer_info->length = size; buffer_info->dma = - pci_map_page(adapter->pdev, - frag->page, - frag->page_offset + offset, - size, PCI_DMA_TODEVICE); + pci_map_page(adapter->pdev, + frag->page, + frag->page_offset + offset, + size, + PCI_DMA_TODEVICE); buffer_info->time_stamp = jiffies; len -= size; offset += size; count++; - if (++i == tx_ring->count) - i = 0; + if(++i == tx_ring->count) i = 0; } } i = (i == 0) ? tx_ring->count - 1 : i - 1; @@ -1288,8 +1314,7 @@ } static inline void -ixgb_tx_queue(struct ixgb_adapter *adapter, int count, int vlan_id, - int tx_flags) +ixgb_tx_queue(struct ixgb_adapter *adapter, int count, int vlan_id,int tx_flags) { struct ixgb_desc_ring *tx_ring = &adapter->tx_ring; struct ixgb_tx_desc *tx_desc = NULL; @@ -1299,36 +1324,35 @@ uint8_t popts = 0; unsigned int i; - if (tx_flags & IXGB_TX_FLAGS_TSO) { + if(tx_flags & IXGB_TX_FLAGS_TSO) { cmd_type_len |= IXGB_TX_DESC_CMD_TSE; popts |= (IXGB_TX_DESC_POPTS_IXSM | IXGB_TX_DESC_POPTS_TXSM); } - if (tx_flags & IXGB_TX_FLAGS_CSUM) + if(tx_flags & IXGB_TX_FLAGS_CSUM) popts |= IXGB_TX_DESC_POPTS_TXSM; - if (tx_flags & IXGB_TX_FLAGS_VLAN) { + if(tx_flags & IXGB_TX_FLAGS_VLAN) { cmd_type_len |= IXGB_TX_DESC_CMD_VLE; } i = tx_ring->next_to_use; - while (count--) { + while(count--) { buffer_info = &tx_ring->buffer_info[i]; tx_desc = IXGB_TX_DESC(*tx_ring, i); tx_desc->buff_addr = cpu_to_le64(buffer_info->dma); tx_desc->cmd_type_len = - cpu_to_le32(cmd_type_len | buffer_info->length); + cpu_to_le32(cmd_type_len | buffer_info->length); tx_desc->status = status; tx_desc->popts = popts; tx_desc->vlan = cpu_to_le16(vlan_id); - if (++i == tx_ring->count) - i = 0; + if(++i == tx_ring->count) i = 0; } - tx_desc->cmd_type_len |= cpu_to_le32(IXGB_TX_DESC_CMD_EOP - | IXGB_TX_DESC_CMD_RS); + tx_desc->cmd_type_len |= cpu_to_le32(IXGB_TX_DESC_CMD_EOP + | IXGB_TX_DESC_CMD_RS ); /* Force memory writes to complete before letting h/w * know there are new descriptors to fetch. (Only @@ -1346,7 +1370,8 @@ #define DESC_NEEDED TXD_USE_COUNT(IXGB_MAX_DATA_PER_TXD) + \ MAX_SKB_FRAGS * TXD_USE_COUNT(PAGE_SIZE) + 1 -static int ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) +static int +ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) { struct ixgb_adapter *adapter = netdev->priv; unsigned int first; @@ -1354,33 +1379,33 @@ unsigned long flags; int vlan_id = 0; - if (skb->len <= 0) { + if(skb->len <= 0) { dev_kfree_skb_any(skb); return 0; } spin_lock_irqsave(&adapter->tx_lock, flags); - if (unlikely(IXGB_DESC_UNUSED(&adapter->tx_ring) < DESC_NEEDED)) { + if(unlikely(IXGB_DESC_UNUSED(&adapter->tx_ring) < DESC_NEEDED)) { netif_stop_queue(netdev); spin_unlock_irqrestore(&adapter->tx_lock, flags); return 1; } spin_unlock_irqrestore(&adapter->tx_lock, flags); - if (adapter->vlgrp && vlan_tx_tag_present(skb)) { + if(adapter->vlgrp && vlan_tx_tag_present(skb)) { tx_flags |= IXGB_TX_FLAGS_VLAN; vlan_id = vlan_tx_tag_get(skb); } first = adapter->tx_ring.next_to_use; - - if (ixgb_tso(adapter, skb)) + + if(ixgb_tso(adapter, skb)) tx_flags |= IXGB_TX_FLAGS_TSO; - else if (ixgb_tx_csum(adapter, skb)) + else if(ixgb_tx_csum(adapter, skb)) tx_flags |= IXGB_TX_FLAGS_CSUM; ixgb_tx_queue(adapter, ixgb_tx_map(adapter, skb, first), vlan_id, - tx_flags); + tx_flags); netdev->trans_start = jiffies; @@ -1392,7 +1417,8 @@ * @netdev: network interface device structure **/ -static void ixgb_tx_timeout(struct net_device *netdev) +static void +ixgb_tx_timeout(struct net_device *netdev) { struct ixgb_adapter *adapter = netdev->priv; @@ -1400,14 +1426,13 @@ schedule_work(&adapter->tx_timeout_task); } -static void ixgb_tx_timeout_task(struct net_device *netdev) +static void +ixgb_tx_timeout_task(struct net_device *netdev) { struct ixgb_adapter *adapter = netdev->priv; - netif_device_detach(netdev); ixgb_down(adapter, TRUE); ixgb_up(adapter); - netif_device_attach(netdev); } /** @@ -1418,7 +1443,8 @@ * The statistics are actually updated from the timer callback. **/ -static struct net_device_stats *ixgb_get_stats(struct net_device *netdev) +static struct net_device_stats * +ixgb_get_stats(struct net_device *netdev) { struct ixgb_adapter *adapter = netdev->priv; @@ -1433,27 +1459,28 @@ * Returns 0 on success, negative on failure **/ -static int ixgb_change_mtu(struct net_device *netdev, int new_mtu) +static int +ixgb_change_mtu(struct net_device *netdev, int new_mtu) { struct ixgb_adapter *adapter = netdev->priv; - uint32_t old_mtu = adapter->rx_buffer_len; int max_frame = new_mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH; + int old_max_frame = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH; + - if ((max_frame < IXGB_MIN_ENET_FRAME_SIZE_WITHOUT_FCS + ENET_FCS_LENGTH) - || (max_frame > IXGB_MAX_JUMBO_FRAME_SIZE + ENET_FCS_LENGTH)) { + if((max_frame < IXGB_MIN_ENET_FRAME_SIZE_WITHOUT_FCS + ENET_FCS_LENGTH) + || (max_frame > IXGB_MAX_JUMBO_FRAME_SIZE + ENET_FCS_LENGTH)) { IXGB_ERR("Invalid MTU setting\n"); return -EINVAL; } - if ((max_frame <= - IXGB_MAX_ENET_FRAME_SIZE_WITHOUT_FCS + ENET_FCS_LENGTH) - || (max_frame <= IXGB_RXBUFFER_2048)) { + if((max_frame <= IXGB_MAX_ENET_FRAME_SIZE_WITHOUT_FCS + ENET_FCS_LENGTH) + || (max_frame <= IXGB_RXBUFFER_2048)) { adapter->rx_buffer_len = IXGB_RXBUFFER_2048; - } else if (max_frame <= IXGB_RXBUFFER_4096) { + } else if(max_frame <= IXGB_RXBUFFER_4096) { adapter->rx_buffer_len = IXGB_RXBUFFER_4096; - } else if (max_frame <= IXGB_RXBUFFER_8192) { + } else if(max_frame <= IXGB_RXBUFFER_8192) { adapter->rx_buffer_len = IXGB_RXBUFFER_8192; } else { @@ -1462,7 +1489,7 @@ netdev->mtu = new_mtu; - if (old_mtu != adapter->rx_buffer_len && netif_running(netdev)) { + if(old_max_frame != max_frame && netif_running(netdev)) { ixgb_down(adapter, TRUE); ixgb_up(adapter); @@ -1476,7 +1503,8 @@ * @adapter: board private structure **/ -static void ixgb_update_stats(struct ixgb_adapter *adapter) +void +ixgb_update_stats(struct ixgb_adapter *adapter) { adapter->stats.tprl += IXGB_READ_REG(&adapter->hw, TPRL); adapter->stats.tprh += IXGB_READ_REG(&adapter->hw, TPRH); @@ -1585,31 +1613,33 @@ * @pt_regs: CPU registers structure **/ -static irqreturn_t ixgb_intr(int irq, void *data, struct pt_regs *regs) +static irqreturn_t +ixgb_intr(int irq, void *data, struct pt_regs *regs) { struct net_device *netdev = data; struct ixgb_adapter *adapter = netdev->priv; struct ixgb_hw *hw = &adapter->hw; - uint32_t icr = IXGB_READ_REG(&adapter->hw, ICR); + uint32_t icr = IXGB_READ_REG(hw, ICR); #ifndef CONFIG_IXGB_NAPI unsigned int i; #endif - if (unlikely(!icr)) - return IRQ_NONE; /* Not our interrupt */ + if(unlikely(!icr)) + return IRQ_NONE; /* Not our interrupt */ - if (unlikely(icr & (IXGB_INT_RXSEQ | IXGB_INT_LSC))) { + if(unlikely(icr & (IXGB_INT_RXSEQ | IXGB_INT_LSC))) { mod_timer(&adapter->watchdog_timer, jiffies); } + #ifdef CONFIG_IXGB_NAPI - if (netif_rx_schedule_prep(netdev)) { + if(netif_rx_schedule_prep(netdev)) { /* Disable interrupts and register for poll. The flush - of the posted write is intentionally left out. - */ + of the posted write is intentionally left out. + */ atomic_inc(&adapter->irq_sem); - IXGB_WRITE_REG(hw, IMC, ~0); + IXGB_WRITE_REG(&adapter->hw, IMC, ~0); __netif_rx_schedule(netdev); } #else @@ -1621,16 +1651,7 @@ if(!ixgb_clean_rx_irq(adapter) & !ixgb_clean_tx_irq(adapter)) break; - /* if RAIDC:EN == 1 and ICR:RXDMT0 == 1, we need to - * set IMS:RXDMT0 to 1 to restart the RBD timer (POLL) - */ - if ((icr & IXGB_INT_RXDMT0) && adapter->raidc) { - /* ready the timer by writing the clear reg */ - IXGB_WRITE_REG(hw, IMC, IXGB_INT_RXDMT0); - /* now restart it, h/w will decide if its necessary */ - IXGB_WRITE_REG(hw, IMS, IXGB_INT_RXDMT0); - } -#endif +#endif return IRQ_HANDLED; } @@ -1640,25 +1661,32 @@ * @adapter: board private structure **/ -static int ixgb_clean(struct net_device *netdev, int *budget) +static int +ixgb_clean(struct net_device *netdev, int *budget) { struct ixgb_adapter *adapter = netdev->priv; int work_to_do = min(*budget, netdev->quota); + int tx_cleaned; int work_done = 0; + + if (!netif_carrier_ok(netdev)) + goto quit_polling; - ixgb_clean_tx_irq(adapter); + tx_cleaned = ixgb_clean_tx_irq(adapter); ixgb_clean_rx_irq(adapter, &work_done, work_to_do); *budget -= work_done; netdev->quota -= work_done; - - if (work_done < work_to_do || !netif_running(netdev)) { - netif_rx_complete(netdev); - /* RAIDC will be automatically restarted by irq_enable */ + + /* if no Tx cleanup and not enough Rx work done, exit the polling mode */ + if((!tx_cleaned && (work_done < work_to_do)) || + !netif_running(netdev)) { +quit_polling: netif_rx_complete(netdev); ixgb_irq_enable(adapter); + return 0; } - return (work_done >= work_to_do); + return 1; } #endif @@ -1667,11 +1695,11 @@ * @adapter: board private structure **/ -static boolean_t ixgb_clean_tx_irq(struct ixgb_adapter *adapter) +static boolean_t +ixgb_clean_tx_irq(struct ixgb_adapter *adapter) { struct ixgb_desc_ring *tx_ring = &adapter->tx_ring; struct net_device *netdev = adapter->netdev; - struct pci_dev *pdev = adapter->pdev; struct ixgb_tx_desc *tx_desc, *eop_desc; struct ixgb_buffer *buffer_info; unsigned int i, eop; @@ -1681,9 +1709,9 @@ eop = tx_ring->buffer_info[i].next_to_watch; eop_desc = IXGB_TX_DESC(*tx_ring, eop); - while (eop_desc->status & IXGB_TX_DESC_STATUS_DD) { + while(eop_desc->status & IXGB_TX_DESC_STATUS_DD) { - for (cleaned = FALSE; !cleaned;) { + for(cleaned = FALSE; !cleaned; ) { tx_desc = IXGB_TX_DESC(*tx_ring, i); buffer_info = &tx_ring->buffer_info[i]; @@ -1692,28 +1720,12 @@ IXGB_TX_DESC_POPTS_IXSM)) adapter->hw_csum_tx_good++; - if (buffer_info->dma) { - - pci_unmap_page(pdev, - buffer_info->dma, - buffer_info->length, - PCI_DMA_TODEVICE); - - buffer_info->dma = 0; - } - - if (buffer_info->skb) { - - dev_kfree_skb_any(buffer_info->skb); + ixgb_unmap_and_free_tx_resource(adapter, buffer_info); - buffer_info->skb = NULL; - } - - *(uint32_t *) & (tx_desc->status) = 0; + *(uint32_t *)&(tx_desc->status) = 0; cleaned = (i == eop); - if (++i == tx_ring->count) - i = 0; + if(++i == tx_ring->count) i = 0; } eop = tx_ring->buffer_info[i].next_to_watch; @@ -1723,8 +1735,8 @@ tx_ring->next_to_clean = i; spin_lock(&adapter->tx_lock); - if (cleaned && netif_queue_stopped(netdev) && netif_carrier_ok(netdev) - && (IXGB_DESC_UNUSED(tx_ring) > IXGB_TX_QUEUE_WAKE)) { + if(cleaned && netif_queue_stopped(netdev) && netif_carrier_ok(netdev) && + (IXGB_DESC_UNUSED(tx_ring) > IXGB_TX_QUEUE_WAKE)) { netif_wake_queue(netdev); } @@ -1742,20 +1754,21 @@ static inline void ixgb_rx_checksum(struct ixgb_adapter *adapter, - struct ixgb_rx_desc *rx_desc, struct sk_buff *skb) + struct ixgb_rx_desc *rx_desc, + struct sk_buff *skb) { /* Ignore Checksum bit is set OR * TCP Checksum has not been calculated */ - if ((rx_desc->status & IXGB_RX_DESC_STATUS_IXSM) || - (!(rx_desc->status & IXGB_RX_DESC_STATUS_TCPCS))) { + if((rx_desc->status & IXGB_RX_DESC_STATUS_IXSM) || + (!(rx_desc->status & IXGB_RX_DESC_STATUS_TCPCS))) { skb->ip_summed = CHECKSUM_NONE; return; } /* At this point we know the hardware did the TCP checksum */ /* now look at the TCP checksum error bit */ - if (rx_desc->errors & IXGB_RX_DESC_ERRORS_TCPE) { + if(rx_desc->errors & IXGB_RX_DESC_ERRORS_TCPE) { /* let the stack verify checksum errors */ skb->ip_summed = CHECKSUM_NONE; adapter->hw_csum_rx_error++; @@ -1792,18 +1805,22 @@ rx_desc = IXGB_RX_DESC(*rx_ring, i); buffer_info = &rx_ring->buffer_info[i]; - while (rx_desc->status & IXGB_RX_DESC_STATUS_DD) { + while(rx_desc->status & IXGB_RX_DESC_STATUS_DD) { +#ifdef CONFIG_IXGB_NAPI + if(*work_done >= work_to_do) + break; + + (*work_done)++; +#endif skb = buffer_info->skb; prefetch(skb->data); - if (++i == rx_ring->count) - i = 0; + if(++i == rx_ring->count) i = 0; next_rxd = IXGB_RX_DESC(*rx_ring, i); prefetch(next_rxd); - if ((j = i + 1) == rx_ring->count) - j = 0; + if((j = i + 1) == rx_ring->count) j = 0; next2_buffer = &rx_ring->buffer_info[j]; prefetch(next2_buffer); @@ -1811,27 +1828,22 @@ next_skb = next_buffer->skb; prefetch(next_skb); -#ifdef CONFIG_IXGB_NAPI - if (*work_done >= work_to_do) - break; - - (*work_done)++; -#endif cleaned = TRUE; pci_unmap_single(pdev, buffer_info->dma, - buffer_info->length, PCI_DMA_FROMDEVICE); + buffer_info->length, + PCI_DMA_FROMDEVICE); length = le16_to_cpu(rx_desc->length); - if (unlikely(!(rx_desc->status & IXGB_RX_DESC_STATUS_EOP))) { + if(unlikely(!(rx_desc->status & IXGB_RX_DESC_STATUS_EOP))) { /* All receives must fit into a single buffer */ IXGB_DBG("Receive packet consumed multiple buffers " - "length<%x>\n", length); + "length<%x>\n", length); dev_kfree_skb_irq(skb); rx_desc->status = 0; @@ -1864,26 +1876,22 @@ skb->protocol = eth_type_trans(skb, netdev); #ifdef CONFIG_IXGB_NAPI - if (adapter->vlgrp - && (rx_desc->status & IXGB_RX_DESC_STATUS_VP)) { + if(adapter->vlgrp && (rx_desc->status & IXGB_RX_DESC_STATUS_VP)) { vlan_hwaccel_receive_skb(skb, adapter->vlgrp, - le16_to_cpu(rx_desc-> - special & - IXGB_RX_DESC_SPECIAL_VLAN_MASK)); + le16_to_cpu(rx_desc->special) & + IXGB_RX_DESC_SPECIAL_VLAN_MASK); } else { netif_receive_skb(skb); } -#else /* CONFIG_IXGB_NAPI */ - if (adapter->vlgrp - && (rx_desc->status & IXGB_RX_DESC_STATUS_VP)) { +#else /* CONFIG_IXGB_NAPI */ + if(adapter->vlgrp && (rx_desc->status & IXGB_RX_DESC_STATUS_VP)) { vlan_hwaccel_rx(skb, adapter->vlgrp, - le16_to_cpu(rx_desc-> - special & - IXGB_RX_DESC_SPECIAL_VLAN_MASK)); + le16_to_cpu(rx_desc->special) & + IXGB_RX_DESC_SPECIAL_VLAN_MASK); } else { netif_rx(skb); } -#endif /* CONFIG_IXGB_NAPI */ +#endif /* CONFIG_IXGB_NAPI */ netdev->last_rx = jiffies; rx_desc->status = 0; @@ -1905,7 +1913,8 @@ * @adapter: address of board private structure **/ -static void ixgb_alloc_rx_buffers(struct ixgb_adapter *adapter) +static void +ixgb_alloc_rx_buffers(struct ixgb_adapter *adapter) { struct ixgb_desc_ring *rx_ring = &adapter->rx_ring; struct net_device *netdev = adapter->netdev; @@ -1921,19 +1930,15 @@ buffer_info = &rx_ring->buffer_info[i]; cleancount = IXGB_DESC_UNUSED(rx_ring); - /* lessen this to 4 if we're - * in the midst of raidc and rbd is occuring - * because we don't want to delay returning buffers when low - */ - num_group_tail_writes = adapter->raidc ? 4 : IXGB_RX_BUFFER_WRITE; + num_group_tail_writes = IXGB_RX_BUFFER_WRITE; /* leave one descriptor unused */ - while (--cleancount > 0) { + while(--cleancount > 0) { rx_desc = IXGB_RX_DESC(*rx_ring, i); skb = dev_alloc_skb(adapter->rx_buffer_len + NET_IP_ALIGN); - if (unlikely(!skb)) { + if(unlikely(!skb)) { /* Better luck next round */ break; } @@ -1949,13 +1954,14 @@ buffer_info->skb = skb; buffer_info->length = adapter->rx_buffer_len; buffer_info->dma = - pci_map_single(pdev, + pci_map_single(pdev, skb->data, - adapter->rx_buffer_len, PCI_DMA_FROMDEVICE); + adapter->rx_buffer_len, + PCI_DMA_FROMDEVICE); rx_desc->buff_addr = cpu_to_le64(buffer_info->dma); - if ((i & ~(num_group_tail_writes - 1)) == i) { + if((i & ~(num_group_tail_writes- 1)) == i) { /* Force memory writes to complete before letting h/w * know there are new descriptors to fetch. (Only * applicable for weak-ordered memory model archs, @@ -1965,8 +1971,7 @@ IXGB_WRITE_REG(&adapter->hw, RDT, i); } - if (++i == rx_ring->count) - i = 0; + if(++i == rx_ring->count) i = 0; buffer_info = &rx_ring->buffer_info[i]; } @@ -1988,7 +1993,7 @@ ixgb_irq_disable(adapter); adapter->vlgrp = grp; - if (grp) { + if(grp) { /* enable VLAN tag insert/strip */ ctrl = IXGB_READ_REG(&adapter->hw, CTRL0); ctrl |= IXGB_CTRL0_VME; @@ -2017,7 +2022,8 @@ ixgb_irq_enable(adapter); } -static void ixgb_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid) +static void +ixgb_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid) { struct ixgb_adapter *adapter = netdev->priv; uint32_t vfta, index; @@ -2030,19 +2036,20 @@ ixgb_write_vfta(&adapter->hw, index, vfta); } -static void ixgb_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid) +static void +ixgb_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid) { struct ixgb_adapter *adapter = netdev->priv; uint32_t vfta, index; ixgb_irq_disable(adapter); - if (adapter->vlgrp) + if(adapter->vlgrp) adapter->vlgrp->vlan_devices[vid] = NULL; ixgb_irq_enable(adapter); - /* remove VID from filter table */ + /* remove VID from filter table*/ index = (vid >> 5) & 0x7F; vfta = IXGB_READ_REG_ARRAY(&adapter->hw, VFTA, index); @@ -2050,14 +2057,15 @@ ixgb_write_vfta(&adapter->hw, index, vfta); } -static void ixgb_restore_vlan(struct ixgb_adapter *adapter) +static void +ixgb_restore_vlan(struct ixgb_adapter *adapter) { ixgb_vlan_rx_register(adapter->netdev, adapter->vlgrp); - if (adapter->vlgrp) { + if(adapter->vlgrp) { uint16_t vid; - for (vid = 0; vid < VLAN_GROUP_ARRAY_LEN; vid++) { - if (!adapter->vlgrp->vlan_devices[vid]) + for(vid = 0; vid < VLAN_GROUP_ARRAY_LEN; vid++) { + if(!adapter->vlgrp->vlan_devices[vid]) continue; ixgb_vlan_rx_add_vid(adapter->netdev, vid); } @@ -2075,7 +2083,7 @@ { struct pci_dev *pdev = NULL; - switch (event) { + switch(event) { case SYS_DOWN: case SYS_HALT: case SYS_POWER_OFF: @@ -2092,14 +2100,15 @@ * @param pdev pci driver structure used for passing to * @param state power state to enter **/ -static int ixgb_suspend(struct pci_dev *pdev, uint32_t state) +static int +ixgb_suspend(struct pci_dev *pdev, uint32_t state) { struct net_device *netdev = pci_get_drvdata(pdev); struct ixgb_adapter *adapter = netdev->priv; netif_device_detach(netdev); - if (netif_running(netdev)) + if(netif_running(netdev)) ixgb_down(adapter, TRUE); pci_save_state(pdev); diff -Nru a/drivers/net/ixgb/ixgb_osdep.h b/drivers/net/ixgb/ixgb_osdep.h --- a/drivers/net/ixgb/ixgb_osdep.h 2005-01-10 23:54:12 -05:00 +++ b/drivers/net/ixgb/ixgb_osdep.h 2005-01-10 23:54:12 -05:00 @@ -78,19 +78,19 @@ #define DEBUGOUT7 DEBUGOUT3 #define IXGB_WRITE_REG(a, reg, value) ( \ - writel((value), ((a)->hw_addr + IXGB_##reg))) + writel((value), ((a)->hw_addr + IXGB_##reg))) #define IXGB_READ_REG(a, reg) ( \ - readl((a)->hw_addr + IXGB_##reg)) + readl((a)->hw_addr + IXGB_##reg)) #define IXGB_WRITE_REG_ARRAY(a, reg, offset, value) ( \ - writel((value), ((a)->hw_addr + IXGB_##reg + ((offset) << 2)))) + writel((value), ((a)->hw_addr + IXGB_##reg + ((offset) << 2)))) #define IXGB_READ_REG_ARRAY(a, reg, offset) ( \ - readl((a)->hw_addr + IXGB_##reg + ((offset) << 2))) + readl((a)->hw_addr + IXGB_##reg + ((offset) << 2))) #define IXGB_WRITE_FLUSH(a) IXGB_READ_REG(a, STATUS) #define IXGB_MEMCPY memcpy -#endif /* _IXGB_OSDEP_H_ */ +#endif /* _IXGB_OSDEP_H_ */ diff -Nru a/drivers/net/ixgb/ixgb_param.c b/drivers/net/ixgb/ixgb_param.c --- a/drivers/net/ixgb/ixgb_param.c 2005-01-10 23:54:12 -05:00 +++ b/drivers/net/ixgb/ixgb_param.c 2005-01-10 23:54:12 -05:00 @@ -34,31 +34,21 @@ #define IXGB_MAX_NIC 8 -#define OPTION_UNSET -1 +#define OPTION_UNSET -1 #define OPTION_DISABLED 0 #define OPTION_ENABLED 1 -/* Module Parameters are always initialized to -1, so that the driver - * can tell the difference between no user specified value or the - * user asking for the default value. - * The true default values are loaded in when ixgb_check_options is called. - * - * This is a GCC extension to ANSI C. - * See the item "Labeled Elements in Initializers" in the section - * "Extensions to the C Language Family" of the GCC documentation. - */ - -#define IXGB_PARAM_INIT { [0 ... IXGB_MAX_NIC] = OPTION_UNSET } - /* All parameters are treated the same, as an integer array of values. * This macro just reduces the need to repeat the same declaration code * over and over (plus this helps to avoid typo bugs). */ -#define IXGB_PARAM(X, S) \ -static int __devinitdata X[IXGB_MAX_NIC + 1] = IXGB_PARAM_INIT; \ -module_param_array(X, int, NULL, 0); \ -MODULE_PARM_DESC(X, S); +#define IXGB_PARAM_INIT { [0 ... IXGB_MAX_NIC] = OPTION_UNSET } +#define IXGB_PARAM(X, desc) \ + static int __devinitdata X[IXGB_MAX_NIC+1] = IXGB_PARAM_INIT; \ + static int num_##X = 0; \ + module_param_array_named(X, X, int, &num_##X, 0); \ + MODULE_PARM_DESC(X, desc); /* Transmit Descriptor Count * @@ -121,15 +111,6 @@ IXGB_PARAM(RxIntDelay, "Receive Interrupt Delay"); -/* Receive Interrupt Moderation enable (uses RxIntDelay too) - * - * Valid Range: 0,1 - * - * Default Value: 1 - */ - -IXGB_PARAM(RAIDC, "Disable or enable Receive Interrupt Moderation"); - /* Receive Flow control high threshold (when we send a pause frame) * (FCRTH) * @@ -173,13 +154,6 @@ IXGB_PARAM(IntDelayEnable, "Transmit Interrupt Delay Enable"); -#define DEFAULT_TXD 256 -#define MAX_TXD 4096 -#define MIN_TXD 64 - -#define DEFAULT_RXD 1024 -#define MAX_RXD 4096 -#define MIN_RXD 64 #define DEFAULT_TIDV 32 #define MAX_TIDV 0xFFFF @@ -224,9 +198,10 @@ } arg; }; -static int __devinit ixgb_validate_option(int *value, struct ixgb_option *opt) +static int __devinit +ixgb_validate_option(int *value, struct ixgb_option *opt) { - if (*value == OPTION_UNSET) { + if(*value == OPTION_UNSET) { *value = opt->def; return 0; } @@ -243,32 +218,31 @@ } break; case range_option: - if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) { + if(*value >= opt->arg.r.min && *value <= opt->arg.r.max) { printk(KERN_INFO "%s set to %i\n", opt->name, *value); return 0; } break; - case list_option:{ - int i; - struct ixgb_opt_list *ent; - - for (i = 0; i < opt->arg.l.nr; i++) { - ent = &opt->arg.l.p[i]; - if (*value == ent->i) { - if (ent->str[0] != '\0') - printk(KERN_INFO "%s\n", - ent->str); - return 0; - } + case list_option: { + int i; + struct ixgb_opt_list *ent; + + for(i = 0; i < opt->arg.l.nr; i++) { + ent = &opt->arg.l.p[i]; + if(*value == ent->i) { + if(ent->str[0] != '\0') + printk(KERN_INFO "%s\n", ent->str); + return 0; } } + } break; default: BUG(); } printk(KERN_INFO "Invalid %s specified (%i) %s\n", - opt->name, *value, opt->err); + opt->name, *value, opt->err); *value = opt->def; return -1; } @@ -285,198 +259,218 @@ * in a variable in the adapter structure. **/ -void __devinit ixgb_check_options(struct ixgb_adapter *adapter) +void __devinit +ixgb_check_options(struct ixgb_adapter *adapter) { int bd = adapter->bd_number; - if (bd >= IXGB_MAX_NIC) { + if(bd >= IXGB_MAX_NIC) { printk(KERN_NOTICE - "Warning: no configuration for board #%i\n", bd); + "Warning: no configuration for board #%i\n", bd); printk(KERN_NOTICE "Using defaults for all values\n"); - bd = IXGB_MAX_NIC; } - { /* Transmit Descriptor Count */ + { /* Transmit Descriptor Count */ struct ixgb_option opt = { .type = range_option, .name = "Transmit Descriptors", - .err = "using default of " __MODULE_STRING(DEFAULT_TXD), - .def = DEFAULT_TXD, - .arg = {.r = {.min = MIN_TXD, - .max = MAX_TXD}} + .err = "using default of " __MODULE_STRING(DEFAULT_TXD), + .def = DEFAULT_TXD, + .arg = { .r = { .min = MIN_TXD, + .max = MAX_TXD}} }; struct ixgb_desc_ring *tx_ring = &adapter->tx_ring; - tx_ring->count = TxDescriptors[bd]; - ixgb_validate_option(&tx_ring->count, &opt); + if(num_TxDescriptors > bd) { + tx_ring->count = TxDescriptors[bd]; + ixgb_validate_option(&tx_ring->count, &opt); + } else { + tx_ring->count = opt.def; + } IXGB_ROUNDUP(tx_ring->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE); } - { /* Receive Descriptor Count */ + { /* Receive Descriptor Count */ struct ixgb_option opt = { .type = range_option, .name = "Receive Descriptors", - .err = "using default of " __MODULE_STRING(DEFAULT_RXD), - .def = DEFAULT_RXD, - .arg = {.r = {.min = MIN_RXD, - .max = MAX_RXD}} + .err = "using default of " __MODULE_STRING(DEFAULT_RXD), + .def = DEFAULT_RXD, + .arg = { .r = { .min = MIN_RXD, + .max = MAX_RXD}} }; struct ixgb_desc_ring *rx_ring = &adapter->rx_ring; - rx_ring->count = RxDescriptors[bd]; - ixgb_validate_option(&rx_ring->count, &opt); + if(num_RxDescriptors > bd) { + rx_ring->count = RxDescriptors[bd]; + ixgb_validate_option(&rx_ring->count, &opt); + } else { + rx_ring->count = opt.def; + } IXGB_ROUNDUP(rx_ring->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE); } - { /* Receive Checksum Offload Enable */ + { /* Receive Checksum Offload Enable */ struct ixgb_option opt = { .type = enable_option, .name = "Receive Checksum Offload", - .err = "defaulting to Enabled", - .def = OPTION_ENABLED + .err = "defaulting to Enabled", + .def = OPTION_ENABLED }; - int rx_csum = XsumRX[bd]; - ixgb_validate_option(&rx_csum, &opt); - adapter->rx_csum = rx_csum; + if(num_XsumRX > bd) { + int rx_csum = XsumRX[bd]; + ixgb_validate_option(&rx_csum, &opt); + adapter->rx_csum = rx_csum; + } else { + adapter->rx_csum = opt.def; + } } - { /* Flow Control */ + { /* Flow Control */ struct ixgb_opt_list fc_list[] = - { {ixgb_fc_none, "Flow Control Disabled"}, - {ixgb_fc_rx_pause, "Flow Control Receive Only"}, - {ixgb_fc_tx_pause, "Flow Control Transmit Only"}, - {ixgb_fc_full, "Flow Control Enabled"}, - {ixgb_fc_default, "Flow Control Hardware Default"} - }; + {{ ixgb_fc_none, "Flow Control Disabled" }, + { ixgb_fc_rx_pause,"Flow Control Receive Only" }, + { ixgb_fc_tx_pause,"Flow Control Transmit Only" }, + { ixgb_fc_full, "Flow Control Enabled" }, + { ixgb_fc_default, "Flow Control Hardware Default" }}; struct ixgb_option opt = { .type = list_option, .name = "Flow Control", - .err = "reading default settings from EEPROM", - .def = ixgb_fc_full, - .arg = {.l = {.nr = LIST_LEN(fc_list), - .p = fc_list}} + .err = "reading default settings from EEPROM", + .def = ixgb_fc_full, + .arg = { .l = { .nr = LIST_LEN(fc_list), + .p = fc_list }} }; - int fc = FlowControl[bd]; - ixgb_validate_option(&fc, &opt); - adapter->hw.fc.type = fc; + if(num_FlowControl > bd) { + int fc = FlowControl[bd]; + ixgb_validate_option(&fc, &opt); + adapter->hw.fc.type = fc; + } else { + adapter->hw.fc.type = opt.def; + } } - { /* Receive Flow Control High Threshold */ + { /* Receive Flow Control High Threshold */ struct ixgb_option opt = { .type = range_option, .name = "Rx Flow Control High Threshold", - .err = - "using default of " __MODULE_STRING(DEFAULT_FCRTH), - .def = DEFAULT_FCRTH, - .arg = {.r = {.min = MIN_FCRTH, - .max = MAX_FCRTH}} + .err = "using default of " __MODULE_STRING(DEFAULT_FCRTH), + .def = DEFAULT_FCRTH, + .arg = { .r = { .min = MIN_FCRTH, + .max = MAX_FCRTH}} }; - adapter->hw.fc.high_water = RxFCHighThresh[bd]; - ixgb_validate_option(&adapter->hw.fc.high_water, &opt); - if (!(adapter->hw.fc.type & ixgb_fc_rx_pause)) - printk(KERN_INFO - "Ignoring RxFCHighThresh when no RxFC\n"); + if(num_RxFCHighThresh > bd) { + adapter->hw.fc.high_water = RxFCHighThresh[bd]; + ixgb_validate_option(&adapter->hw.fc.high_water, &opt); + } else { + adapter->hw.fc.high_water = opt.def; + } + if(!(adapter->hw.fc.type & ixgb_fc_rx_pause) ) + printk (KERN_INFO + "Ignoring RxFCHighThresh when no RxFC\n"); } - { /* Receive Flow Control Low Threshold */ + { /* Receive Flow Control Low Threshold */ struct ixgb_option opt = { .type = range_option, .name = "Rx Flow Control Low Threshold", - .err = - "using default of " __MODULE_STRING(DEFAULT_FCRTL), - .def = DEFAULT_FCRTL, - .arg = {.r = {.min = MIN_FCRTL, - .max = MAX_FCRTL}} + .err = "using default of " __MODULE_STRING(DEFAULT_FCRTL), + .def = DEFAULT_FCRTL, + .arg = { .r = { .min = MIN_FCRTL, + .max = MAX_FCRTL}} }; - adapter->hw.fc.low_water = RxFCLowThresh[bd]; - ixgb_validate_option(&adapter->hw.fc.low_water, &opt); - if (!(adapter->hw.fc.type & ixgb_fc_rx_pause)) - printk(KERN_INFO - "Ignoring RxFCLowThresh when no RxFC\n"); + if(num_RxFCLowThresh > bd) { + adapter->hw.fc.low_water = RxFCLowThresh[bd]; + ixgb_validate_option(&adapter->hw.fc.low_water, &opt); + } else { + adapter->hw.fc.low_water = opt.def; + } + if(!(adapter->hw.fc.type & ixgb_fc_rx_pause) ) + printk (KERN_INFO + "Ignoring RxFCLowThresh when no RxFC\n"); } - { /* Flow Control Pause Time Request */ + { /* Flow Control Pause Time Request*/ struct ixgb_option opt = { .type = range_option, .name = "Flow Control Pause Time Request", - .err = - "using default of " - __MODULE_STRING(DEFAULT_FCPAUSE), - .def = DEFAULT_FCPAUSE, - .arg = {.r = {.min = MIN_FCPAUSE, - .max = MAX_FCPAUSE}} + .err = "using default of "__MODULE_STRING(DEFAULT_FCPAUSE), + .def = DEFAULT_FCPAUSE, + .arg = { .r = { .min = MIN_FCPAUSE, + .max = MAX_FCPAUSE}} }; - int pause_time = FCReqTimeout[bd]; - - ixgb_validate_option(&pause_time, &opt); - if (!(adapter->hw.fc.type & ixgb_fc_rx_pause)) - printk(KERN_INFO - "Ignoring FCReqTimeout when no RxFC\n"); - adapter->hw.fc.pause_time = pause_time; + if(num_FCReqTimeout > bd) { + int pause_time = FCReqTimeout[bd]; + ixgb_validate_option(&pause_time, &opt); + adapter->hw.fc.pause_time = pause_time; + } else { + adapter->hw.fc.pause_time = opt.def; + } + if(!(adapter->hw.fc.type & ixgb_fc_rx_pause) ) + printk (KERN_INFO + "Ignoring FCReqTimeout when no RxFC\n"); } /* high low and spacing check for rx flow control thresholds */ if (adapter->hw.fc.type & ixgb_fc_rx_pause) { /* high must be greater than low */ if (adapter->hw.fc.high_water < (adapter->hw.fc.low_water + 8)) { /* set defaults */ - printk(KERN_INFO - "RxFCHighThresh must be >= (RxFCLowThresh + 8), " - "Using Defaults\n"); + printk (KERN_INFO + "RxFCHighThresh must be >= (RxFCLowThresh + 8), " + "Using Defaults\n"); adapter->hw.fc.high_water = DEFAULT_FCRTH; - adapter->hw.fc.low_water = DEFAULT_FCRTL; + adapter->hw.fc.low_water = DEFAULT_FCRTL; } } - { /* Receive Interrupt Delay */ + { /* Receive Interrupt Delay */ struct ixgb_option opt = { .type = range_option, .name = "Receive Interrupt Delay", - .err = - "using default of " __MODULE_STRING(DEFAULT_RDTR), - .def = DEFAULT_RDTR, - .arg = {.r = {.min = MIN_RDTR, - .max = MAX_RDTR}} - }; - - adapter->rx_int_delay = RxIntDelay[bd]; - ixgb_validate_option(&adapter->rx_int_delay, &opt); - } - { /* Receive Interrupt Moderation */ - struct ixgb_option opt = { - .type = enable_option, - .name = "Advanced Receive Interrupt Moderation", - .err = "defaulting to Enabled", - .def = OPTION_ENABLED + .err = "using default of " __MODULE_STRING(DEFAULT_RDTR), + .def = DEFAULT_RDTR, + .arg = { .r = { .min = MIN_RDTR, + .max = MAX_RDTR}} }; - int raidc = RAIDC[bd]; - ixgb_validate_option(&raidc, &opt); - adapter->raidc = raidc; + if(num_RxIntDelay > bd) { + adapter->rx_int_delay = RxIntDelay[bd]; + ixgb_validate_option(&adapter->rx_int_delay, &opt); + } else { + adapter->rx_int_delay = opt.def; + } } - { /* Transmit Interrupt Delay */ + { /* Transmit Interrupt Delay */ struct ixgb_option opt = { .type = range_option, .name = "Transmit Interrupt Delay", - .err = - "using default of " __MODULE_STRING(DEFAULT_TIDV), - .def = DEFAULT_TIDV, - .arg = {.r = {.min = MIN_TIDV, - .max = MAX_TIDV}} + .err = "using default of " __MODULE_STRING(DEFAULT_TIDV), + .def = DEFAULT_TIDV, + .arg = { .r = { .min = MIN_TIDV, + .max = MAX_TIDV}} }; - adapter->tx_int_delay = TxIntDelay[bd]; - ixgb_validate_option(&adapter->tx_int_delay, &opt); + if(num_TxIntDelay > bd) { + adapter->tx_int_delay = TxIntDelay[bd]; + ixgb_validate_option(&adapter->tx_int_delay, &opt); + } else { + adapter->tx_int_delay = opt.def; + } } - { /* Transmit Interrupt Delay Enable */ + { /* Transmit Interrupt Delay Enable */ struct ixgb_option opt = { .type = enable_option, .name = "Tx Interrupt Delay Enable", - .err = "defaulting to Enabled", - .def = OPTION_ENABLED + .err = "defaulting to Enabled", + .def = OPTION_ENABLED }; - int ide = IntDelayEnable[bd]; - ixgb_validate_option(&ide, &opt); - adapter->tx_int_delay_enable = ide; + if(num_IntDelayEnable > bd) { + int ide = IntDelayEnable[bd]; + ixgb_validate_option(&ide, &opt); + adapter->tx_int_delay_enable = ide; + } else { + adapter->tx_int_delay_enable = opt.def; + } } } diff -Nru a/drivers/net/s2io.c b/drivers/net/s2io.c --- a/drivers/net/s2io.c 2005-01-10 23:54:12 -05:00 +++ b/drivers/net/s2io.c 2005-01-10 23:54:12 -05:00 @@ -560,21 +560,35 @@ for (i = 0; i < config->rx_ring_num; i++) { blk_cnt = config->rx_cfg[i].num_rxd / (MAX_RXDS_PER_BLOCK + 1); + if (!nic->ba[i]) + goto end_free; for (j = 0; j < blk_cnt; j++) { int k = 0; - if (!nic->ba[i][j]) - continue; + if (!nic->ba[i][j]) { + kfree(nic->ba[i]); + goto end_free; + } while (k != MAX_RXDS_PER_BLOCK) { buffAdd_t *ba = &nic->ba[i][j][k]; + if (!ba || !ba->ba_0_org || !ba->ba_1_org) + { + kfree(nic->ba[i]); + kfree(nic->ba[i][j]); + if(ba->ba_0_org) + kfree(ba->ba_0_org); + if(ba->ba_1_org) + kfree(ba->ba_1_org); + goto end_free; + } kfree(ba->ba_0_org); kfree(ba->ba_1_org); k++; } kfree(nic->ba[i][j]); } - if (nic->ba[i]) - kfree(nic->ba[i]); + kfree(nic->ba[i]); } +end_free: #endif if (mac_control->stats_mem) { diff -Nru a/drivers/net/s2io.h b/drivers/net/s2io.h --- a/drivers/net/s2io.h 2005-01-10 23:54:12 -05:00 +++ b/drivers/net/s2io.h 2005-01-10 23:54:12 -05:00 @@ -740,8 +740,8 @@ { u64 ret = 0; ret = readl(addr + 4); - (u64) ret <<= 32; - (u64) ret |= readl(addr); + ret <<= 32; + ret |= readl(addr); return ret; } diff -Nru a/drivers/net/smc-ultra.c b/drivers/net/smc-ultra.c --- a/drivers/net/smc-ultra.c 2005-01-10 23:54:12 -05:00 +++ b/drivers/net/smc-ultra.c 2005-01-10 23:54:12 -05:00 @@ -156,8 +156,6 @@ /* Look for any installed ISAPnP cards */ if (isapnp_present() && (ultra_probe_isapnp(dev) == 0)) return 0; - - printk(KERN_NOTICE "smc-ultra.c: No ISAPnP cards found, trying standard ones...\n"); #endif for (i = 0; ultra_portlist[i]; i++) { diff -Nru a/drivers/net/smc91x.c b/drivers/net/smc91x.c --- a/drivers/net/smc91x.c 2005-01-10 23:54:12 -05:00 +++ b/drivers/net/smc91x.c 2005-01-10 23:54:12 -05:00 @@ -1333,6 +1333,19 @@ return IRQ_HANDLED; } +#ifdef CONFIG_NET_POLL_CONTROLLER +/* + * Polling receive - used by netconsole and other diagnostic tools + * to allow network i/o with interrupts disabled. + */ +static void smc_poll_controller(struct net_device *dev) +{ + disable_irq(dev->irq); + smc_interrupt(dev->irq, dev, NULL); + enable_irq(dev->irq); +} +#endif + /* Our watchdog timed out. Called by the networking layer */ static void smc_timeout(struct net_device *dev) { @@ -1912,6 +1925,9 @@ dev->get_stats = smc_query_statistics; dev->set_multicast_list = smc_set_multicast_list; dev->ethtool_ops = &smc_ethtool_ops; +#ifdef CONFIG_NET_POLL_CONTROLLER + dev->poll_controller = smc_poll_controller; +#endif tasklet_init(&lp->tx_task, smc_hardware_send_pkt, (unsigned long)dev); INIT_WORK(&lp->phy_configure, smc_phy_configure, dev); diff -Nru a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c --- a/drivers/net/wireless/orinoco.c 2005-01-10 23:54:12 -05:00 +++ b/drivers/net/wireless/orinoco.c 2005-01-10 23:54:12 -05:00 @@ -617,9 +617,8 @@ unsigned long flags; int err; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; err = __orinoco_up(dev); @@ -671,10 +670,9 @@ return NULL; /* FIXME: Can we do better than this? */ } - err = orinoco_lock(priv, &flags); - if (err) - return NULL; /* FIXME: Erg, we've been signalled, how - * do we propagate this back up? */ + if (orinoco_lock(priv, &flags) != 0) + return NULL; /* FIXME: Erg, we've been signalled, how + * do we propagate this back up? */ if (priv->iw_mode == IW_MODE_ADHOC) { memset(&wstats->qual, 0, sizeof(wstats->qual)); @@ -1819,10 +1817,8 @@ return 0; } - err = orinoco_lock(priv, &flags); - if (err) - return err; - + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; err = hermes_disable_port(hw, 0); if (err) { @@ -1864,11 +1860,10 @@ { struct orinoco_private *priv = netdev_priv(dev); struct hermes *hw = &priv->hw; - int err; + int err = 0; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) + if (orinoco_lock(priv, &flags) != 0) /* When the hardware becomes available again, whatever * detects that is responsible for re-initializing * it. So no need for anything further */ @@ -2411,9 +2406,8 @@ int err = 0; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CURRENTBSSID, ETH_ALEN, NULL, buf); @@ -2433,9 +2427,8 @@ int len; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; if (strlen(priv->desired_essid) > 0) { /* We read the desired SSID from the hardware rather @@ -2486,9 +2479,8 @@ long freq = 0; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; err = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_CURRENTCHANNEL, &channel); if (err) @@ -2528,9 +2520,8 @@ int i; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_SUPPORTEDDATARATES, sizeof(list), NULL, &list); @@ -2568,9 +2559,8 @@ rrq->length = sizeof(range); - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; mode = priv->iw_mode; orinoco_unlock(priv, &flags); @@ -2639,9 +2629,8 @@ range.min_frag = 256; range.max_frag = 2346; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; if (priv->has_wep) { range.max_encoding_tokens = ORINOCO_MAX_KEYS; @@ -2706,10 +2695,9 @@ if (copy_from_user(keybuf, erq->pointer, erq->length)) return -EFAULT; } - - err = orinoco_lock(priv, &flags); - if (err) - return err; + + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; if (erq->pointer) { if (erq->length > ORINOCO_MAX_KEY_SIZE) { @@ -2788,12 +2776,10 @@ int index = (erq->flags & IW_ENCODE_INDEX) - 1; u16 xlen = 0; char keybuf[ORINOCO_MAX_KEY_SIZE]; - int err; unsigned long flags; - - err = orinoco_lock(priv, &flags); - if (err) - return err; + + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; if ((index < 0) || (index >= ORINOCO_MAX_KEYS)) index = priv->tx_key; @@ -2833,7 +2819,6 @@ { struct orinoco_private *priv = netdev_priv(dev); char essidbuf[IW_ESSID_MAX_SIZE+1]; - int err; unsigned long flags; /* Note : ESSID is ignored in Ad-Hoc demo mode, but we can set it @@ -2851,9 +2836,8 @@ essidbuf[erq->length] = '\0'; } - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; memcpy(priv->desired_essid, essidbuf, sizeof(priv->desired_essid)); @@ -2877,9 +2861,8 @@ if (err) return err; } else { - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; memcpy(essidbuf, priv->desired_essid, sizeof(essidbuf)); orinoco_unlock(priv, &flags); } @@ -2899,7 +2882,6 @@ { struct orinoco_private *priv = netdev_priv(dev); char nickbuf[IW_ESSID_MAX_SIZE+1]; - int err; unsigned long flags; if (nrq->length > IW_ESSID_MAX_SIZE) @@ -2912,9 +2894,8 @@ nickbuf[nrq->length] = '\0'; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; memcpy(priv->nick, nickbuf, sizeof(priv->nick)); @@ -2927,12 +2908,10 @@ { struct orinoco_private *priv = netdev_priv(dev); char nickbuf[IW_ESSID_MAX_SIZE+1]; - int err; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; memcpy(nickbuf, priv->nick, IW_ESSID_MAX_SIZE+1); orinoco_unlock(priv, &flags); @@ -2949,7 +2928,6 @@ { struct orinoco_private *priv = netdev_priv(dev); int chan = -1; - int err; unsigned long flags; /* We can only use this in Ad-Hoc demo mode to set the operating @@ -2978,9 +2956,8 @@ ! (priv->channel_mask & (1 << (chan-1)) ) ) return -EINVAL; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; priv->channel = chan; orinoco_unlock(priv, &flags); @@ -2998,9 +2975,8 @@ if (!priv->has_sensitivity) return -EOPNOTSUPP; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; err = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_CNFSYSTEMSCALE, &val); orinoco_unlock(priv, &flags); @@ -3018,7 +2994,6 @@ { struct orinoco_private *priv = netdev_priv(dev); int val = srq->value; - int err; unsigned long flags; if (!priv->has_sensitivity) @@ -3027,9 +3002,8 @@ if ((val < 1) || (val > 3)) return -EINVAL; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; priv->ap_density = val; orinoco_unlock(priv, &flags); @@ -3040,7 +3014,6 @@ { struct orinoco_private *priv = netdev_priv(dev); int val = rrq->value; - int err; unsigned long flags; if (rrq->disabled) @@ -3049,9 +3022,8 @@ if ( (val < 0) || (val > 2347) ) return -EINVAL; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; priv->rts_thresh = val; orinoco_unlock(priv, &flags); @@ -3065,9 +3037,8 @@ int err = 0; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; if (priv->has_mwo) { if (frq->disabled) @@ -3102,9 +3073,8 @@ u16 val; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; if (priv->has_mwo) { err = hermes_read_wordrec(hw, USER_BAP, @@ -3166,9 +3136,8 @@ if (ratemode == -1) return -EINVAL; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; priv->bitratemode = ratemode; orinoco_unlock(priv, &flags); @@ -3185,9 +3154,8 @@ u16 val; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; ratemode = priv->bitratemode; @@ -3247,9 +3215,8 @@ int err = 0; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; if (prq->disabled) { priv->pm_on = 0; @@ -3302,9 +3269,8 @@ u16 enable, period, timeout, mcast; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; err = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_CNFPMENABLED, &enable); if (err) @@ -3351,9 +3317,8 @@ u16 short_limit, long_limit, lifetime; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; err = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_SHORTRETRYLIMIT, &short_limit); @@ -3399,12 +3364,10 @@ { struct orinoco_private *priv = netdev_priv(dev); int val = *( (int *) wrq->u.name ); - int err; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; priv->ibss_port = val ; @@ -3419,12 +3382,10 @@ { struct orinoco_private *priv = netdev_priv(dev); int *val = (int *)wrq->u.name; - int err; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; *val = priv->ibss_port; orinoco_unlock(priv, &flags); @@ -3439,9 +3400,8 @@ int err = 0; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; switch (val) { case 0: /* Try to do IEEE ad-hoc mode */ @@ -3478,12 +3438,10 @@ { struct orinoco_private *priv = netdev_priv(dev); int *val = (int *)wrq->u.name; - int err; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; *val = priv->prefer_port3; orinoco_unlock(priv, &flags); @@ -3513,9 +3471,8 @@ } /* Make sure nobody mess with the structure while we do */ - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; /* orinoco_lock() doesn't disable interrupts, so make sure the * interrupt rx path don't get confused while we copy */ @@ -3546,12 +3503,10 @@ struct iw_quality spy_stat[IW_MAX_SPY]; int number; int i; - int err; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; number = priv->spy_number; if ((number > 0) && (srq->pointer)) { @@ -3621,9 +3576,8 @@ break; case SIOCSIWMODE: - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; switch (wrq->u.mode) { case IW_MODE_ADHOC: if (! (priv->has_ibss || priv->has_port3) ) @@ -3648,9 +3602,8 @@ break; case SIOCGIWMODE: - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; wrq->u.mode = priv->iw_mode; orinoco_unlock(priv, &flags); break; @@ -3865,9 +3818,8 @@ if(priv->has_preamble) { int val = *( (int *) wrq->u.name ); - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; if (val) priv->preamble = 1; else @@ -3882,9 +3834,8 @@ if(priv->has_preamble) { int *val = (int *)wrq->u.name; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; *val = priv->preamble; orinoco_unlock(priv, &flags); } else diff -Nru a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c --- a/drivers/net/wireless/wl3501_cs.c 2005-01-10 23:54:12 -05:00 +++ b/drivers/net/wireless/wl3501_cs.c 2005-01-10 23:54:12 -05:00 @@ -100,7 +100,7 @@ /* Parameters that can be set with 'insmod' */ /* Bit map of interrupts to choose from */ /* This means pick from 15, 14, 12, 11, 10, 9, 7, 5, 4, and 3 */ -static unsigned long wl3501_irq_mask = 0xdeb8; +static unsigned int wl3501_irq_mask = 0xdeb8; static int wl3501_irq_list[4] = { -1 }; /* @@ -2279,7 +2279,7 @@ module_init(wl3501_init_module); module_exit(wl3501_exit_module); -module_param(wl3501_irq_mask, int, 0); +module_param(wl3501_irq_mask, uint, 0); module_param_array(wl3501_irq_list, int, NULL, 0); MODULE_AUTHOR("Fox Chen , " "Arnaldo Carvalho de Melo ," diff -Nru a/include/linux/arcdevice.h b/include/linux/arcdevice.h --- a/include/linux/arcdevice.h 2005-01-10 23:54:12 -05:00 +++ b/include/linux/arcdevice.h 2005-01-10 23:54:12 -05:00 @@ -343,7 +343,6 @@ void arcnet_unregister_proto(struct ArcProto *proto); irqreturn_t arcnet_interrupt(int irq, void *dev_id, struct pt_regs *regs); -void arcdev_setup(struct net_device *dev); struct net_device *alloc_arcdev(char *name); void arcnet_rx(struct net_device *dev, int bufnum); --------------090609000705090202000403-- From acme@conectiva.com.br Mon Jan 10 10:47:59 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 10:48:06 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0AIlvgi002458 for ; Mon, 10 Jan 2005 10:47:58 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CoF4I-00031T-00; Tue, 11 Jan 2005 03:59:50 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 1CAFB1462D; Tue, 11 Jan 2005 04:47:47 -0200 (BRST) Message-ID: <41E37765.4030105@conectiva.com.br> Date: Tue, 11 Jan 2005 04:51:17 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" Cc: Networking Team Subject: [PATCH] merge udp_opt with udp_sock X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------000602060905070006080609" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 69 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------000602060905070006080609 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit David, Please consider pulling from: bk://kernel.bkbits.net/acme/connection_sock-2.6 Regards, - Arnaldo --------------000602060905070006080609 Content-Type: text/plain; name="udp.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="udp.patch" =================================================================== ChangeSet@1.2279, 2005-01-11 02:47:15-02:00, acme@conectiva.com.br [UDP] merge udp_sock with udp_opt No need for two structs, follow the new inet_sock layout style. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller include/linux/ipv6.h | 3 +-- include/linux/udp.h | 22 +++++++++------------- net/ipv4/udp.c | 16 ++++++++-------- net/ipv6/udp.c | 10 +++++----- 4 files changed, 23 insertions(+), 28 deletions(-) diff -Nru a/include/linux/ipv6.h b/include/linux/ipv6.h --- a/include/linux/ipv6.h 2005-01-11 04:45:45 -02:00 +++ b/include/linux/ipv6.h 2005-01-11 04:45:45 -02:00 @@ -262,8 +262,7 @@ }; struct udp6_sock { - struct inet_sock inet; - struct udp_opt udp; + struct udp_sock udp; struct ipv6_pinfo inet6; }; diff -Nru a/include/linux/udp.h b/include/linux/udp.h --- a/include/linux/udp.h 2005-01-11 04:45:45 -02:00 +++ b/include/linux/udp.h 2005-01-11 04:45:45 -02:00 @@ -40,26 +40,22 @@ #include #include -struct udp_opt { - int pending; /* Any pending frames ? */ - unsigned int corkflag; /* Cork is required */ - __u16 encap_type; /* Is this an Encapsulation socket? */ +struct udp_sock { + /* inet_sock has to be the first member */ + struct inet_sock inet; + int pending; /* Any pending frames ? */ + unsigned int corkflag; /* Cork is required */ + __u16 encap_type; /* Is this an Encapsulation socket? */ /* * Following member retains the infomation to create a UDP header * when the socket is uncorked. */ - __u16 len; /* total length of pending frames */ -}; - -/* WARNING: don't change the layout of the members in udp_sock! */ -struct udp_sock { - struct inet_sock inet; - struct udp_opt udp; + __u16 len; /* total length of pending frames */ }; -static inline struct udp_opt * udp_sk(const struct sock *__sk) +static inline struct udp_sock *udp_sk(const struct sock *sk) { - return &((struct udp_sock *)__sk)->udp; + return (struct udp_sock *)sk; } #endif diff -Nru a/net/ipv4/udp.c b/net/ipv4/udp.c --- a/net/ipv4/udp.c 2005-01-11 04:45:45 -02:00 +++ b/net/ipv4/udp.c 2005-01-11 04:45:45 -02:00 @@ -386,7 +386,7 @@ */ static void udp_flush_pending_frames(struct sock *sk) { - struct udp_opt *up = udp_sk(sk); + struct udp_sock *up = udp_sk(sk); if (up->pending) { up->len = 0; @@ -398,7 +398,7 @@ /* * Push out all pending data as one UDP datagram. Socket is locked. */ -static int udp_push_pending_frames(struct sock *sk, struct udp_opt *up) +static int udp_push_pending_frames(struct sock *sk, struct udp_sock *up) { struct inet_sock *inet = inet_sk(sk); struct flowi *fl = &inet->cork.fl; @@ -483,7 +483,7 @@ size_t len) { struct inet_sock *inet = inet_sk(sk); - struct udp_opt *up = udp_sk(sk); + struct udp_sock *up = udp_sk(sk); int ulen = len; struct ipcm_cookie ipc; struct rtable *rt = NULL; @@ -672,7 +672,7 @@ static int udp_sendpage(struct sock *sk, struct page *page, int offset, size_t size, int flags) { - struct udp_opt *up = udp_sk(sk); + struct udp_sock *up = udp_sk(sk); int ret; if (!up->pending) { @@ -902,7 +902,7 @@ #ifndef CONFIG_XFRM return 1; #else - struct udp_opt *up = udp_sk(sk); + struct udp_sock *up = udp_sk(sk); struct udphdr *uh = skb->h.uh; struct iphdr *iph; int iphlen, len; @@ -988,7 +988,7 @@ */ static int udp_queue_rcv_skb(struct sock * sk, struct sk_buff *skb) { - struct udp_opt *up = udp_sk(sk); + struct udp_sock *up = udp_sk(sk); /* * Charge it to the socket, dropping if the queue is full. @@ -1223,7 +1223,7 @@ static int udp_setsockopt(struct sock *sk, int level, int optname, char __user *optval, int optlen) { - struct udp_opt *up = udp_sk(sk); + struct udp_sock *up = udp_sk(sk); int val; int err = 0; @@ -1272,7 +1272,7 @@ static int udp_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen) { - struct udp_opt *up = udp_sk(sk); + struct udp_sock *up = udp_sk(sk); int val, len; if (level != SOL_UDP) diff -Nru a/net/ipv6/udp.c b/net/ipv6/udp.c --- a/net/ipv6/udp.c 2005-01-11 04:45:45 -02:00 +++ b/net/ipv6/udp.c 2005-01-11 04:45:45 -02:00 @@ -549,7 +549,7 @@ */ static void udp_v6_flush_pending_frames(struct sock *sk) { - struct udp_opt *up = udp_sk(sk); + struct udp_sock *up = udp_sk(sk); if (up->pending) { up->len = 0; @@ -562,7 +562,7 @@ * Sending */ -static int udp_v6_push_pending_frames(struct sock *sk, struct udp_opt *up) +static int udp_v6_push_pending_frames(struct sock *sk, struct udp_sock *up) { struct sk_buff *skb; struct udphdr *uh; @@ -623,7 +623,7 @@ struct msghdr *msg, size_t len) { struct ipv6_txoptions opt_space; - struct udp_opt *up = udp_sk(sk); + struct udp_sock *up = udp_sk(sk); struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) msg->msg_name; @@ -878,7 +878,7 @@ static int udpv6_setsockopt(struct sock *sk, int level, int optname, char __user *optval, int optlen) { - struct udp_opt *up = udp_sk(sk); + struct udp_sock *up = udp_sk(sk); int val; int err = 0; @@ -925,7 +925,7 @@ static int udpv6_getsockopt(struct sock *sk, int level, int optname, char __user *optval, int __user *optlen) { - struct udp_opt *up = udp_sk(sk); + struct udp_sock *up = udp_sk(sk); int val, len; if (level != SOL_UDP) --------------000602060905070006080609-- From tgraf@suug.ch Mon Jan 10 13:47:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 13:47:49 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ALlfL9010397 for ; Mon, 10 Jan 2005 13:47:42 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id B1058F; Tue, 11 Jan 2005 10:47:10 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id E24691C0EA; Tue, 11 Jan 2005 10:47:52 +0100 (CET) Date: Tue, 11 Jan 2005 10:47:52 +0100 From: Thomas Graf To: Patrick McHardy Cc: "David S. Miller" , Herbert Xu , netdev@oss.sgi.com Subject: Re: request_module while holding rtnl semaphore Message-ID: <20050111094752.GD26856@postel.suug.ch> References: <41899DCF.3050804@trash.net> <20041109161126.376f755c.davem@davemloft.net> <41E34252.504@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41E34252.504@trash.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 70 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * Patrick McHardy <41E34252.504@trash.net> 2005-01-11 04:04 > David S. Miller wrote: > > >Therefore I suggest we just implement the fix for this inside of > >the packet scheduler layer itself. Simply by dropping the RTNL > >semaphore during the module request, and then regrabbing the RTNL > >semaphore and replaying the request from the beginning. > > > >The net/sched/sch_api.c version of the fix would look like the > >following. The act_api.c case would require a bit more surgery, > >but with the right restructuring it can be done too. > > > > > This patch got lost somehow. The act_api.c changes are actually > even more complicated because besides the action init path, changes > can also be made from classifiers in a deep call-chain. I hope > Thomas's recent changes make it easier to fix this, but I think > this patch should go in now anyway. The action initialization is now done first and no classifier data is changed except for tp->root modifications which must not be undone so you can safely return EBUSY. rsvp might be an exception, I haven't looked too closely into it yet. tcindex returns EBUSY when a filter is changed which does not fit into the hashtable, so this must be changed. From wichert@levante.wiggy.net Mon Jan 10 16:58:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 16:58:43 -0800 (PST) Received: from mx1.wiggy.net (levante.wiggy.net [195.85.225.139]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0B0wZG5019004 for ; Mon, 10 Jan 2005 16:58:35 -0800 Received: from wichert by mx1.wiggy.net with local (Exim 4.34) id 1CoLbO-0006hU-SZ for netdev@oss.sgi.com; Tue, 11 Jan 2005 13:58:27 +0100 Date: Tue, 11 Jan 2005 13:58:26 +0100 From: Wichert Akkerman To: netdev@oss.sgi.com Subject: ipv6 tunnel stops accepting input Message-ID: <20050111125826.GA25169@wiggy.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-SA-Exim-Connect-IP: X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 71 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: wichert@wiggy.net Precedence: bulk X-list: netdev I have an interesting problem with an ipv6 tunnel, which has been present for some time now (at least 2.6.6 had the same problem, possibly older kernels as well). When I connect to my machine through a tunnel a icmp port unreachable is returned: 13:39:39.320316 IP ipv6-tb.xs4all.net > home.wiggy.net: 2001:960:6a6:1:240:caff:fe85:d77e.37399 > tornado.wiggy.net.ssh: S 3800196387:3800196387(0) win 5760 13:39:39.320539 IP home.wiggy.net > ipv6-tb.xs4all.net: icmp 108: home.wiggy.net protocol 41 port 0 unreachable but once I do a ping6 from my machine to the outside world: 13:39:53.264393 IP home.wiggy.net > ipv6-tb.xs4all.net: tunnel29.ipv6.xs4all.nl > irc.ipv6.xs4all.nl: icmp6: echo request seq 1 13:39:53.299071 IP ipv6-tb.xs4all.net > home.wiggy.net: irc.ipv6.xs4all.nl > tunnel29.ipv6.xs4all.nl: icmp6: echo reply seq 1 the tunnel suddenly accepts incoming traffic: 13:40:00.324220 IP ipv6-tb.xs4all.net > home.wiggy.net: 2001:960:6a6:1:240:caff:fe85:d77e.37399 > tornado.wiggy.net.ssh: S 3800196387:3800196387(0) win 5760 13:40:00.325950 IP home.wiggy.net > ipv6-tb.xs4all.net: tornado.wiggy.net.ssh > 2001:960:6a6:1:240:caff:fe85:d77e.37399: S 4249094159:4249094159(0) ack 3800196388 win 5712 If I do not generate any ipv6 for a while (I have not timed how long) things revert to the original state again and no incoming traffic is accepted until I generate some outgoing traffic. More complete tcpdump is below. Wichert. tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes 13:39:39.320316 IP ipv6-tb.xs4all.net > home.wiggy.net: 2001:960:6a6:1:240:caff:fe85:d77e.37399 > tornado.wiggy.net.ssh: S 3800196387:3800196387(0) win 5760 13:39:39.320539 IP home.wiggy.net > ipv6-tb.xs4all.net: icmp 108: home.wiggy.net protocol 41 port 0 unreachable 13:39:42.319721 IP ipv6-tb.xs4all.net > home.wiggy.net: 2001:960:6a6:1:240:caff:fe85:d77e.37399 > tornado.wiggy.net.ssh: S 3800196387:3800196387(0) win 5760 13:39:42.319917 IP home.wiggy.net > ipv6-tb.xs4all.net: icmp 108: home.wiggy.net protocol 41 port 0 unreachable 13:39:44.374037 IP ipv6-tb.xs4all.net > home.wiggy.net: xs4all29.ipv6.xs4all.nl > tunnel29.ipv6.xs4all.nl: [|icmp6] 13:39:44.374194 IP home.wiggy.net > ipv6-tb.xs4all.net: icmp 92: home.wiggy.net protocol 41 port 0 unreachable 13:39:45.371013 IP ipv6-tb.xs4all.net > home.wiggy.net: xs4all29.ipv6.xs4all.nl > tunnel29.ipv6.xs4all.nl: [|icmp6] 13:39:45.371164 IP home.wiggy.net > ipv6-tb.xs4all.net: icmp 92: home.wiggy.net protocol 41 port 0 unreachable 13:39:46.371279 IP ipv6-tb.xs4all.net > home.wiggy.net: xs4all29.ipv6.xs4all.nl > tunnel29.ipv6.xs4all.nl: [|icmp6] 13:39:46.371396 IP home.wiggy.net > ipv6-tb.xs4all.net: icmp 92: home.wiggy.net protocol 41 port 0 unreachable 13:39:48.318920 IP ipv6-tb.xs4all.net > home.wiggy.net: 2001:960:6a6:1:240:caff:fe85:d77e.37399 > tornado.wiggy.net.ssh: S 3800196387:3800196387(0) win 5760 13:39:48.319037 IP home.wiggy.net > ipv6-tb.xs4all.net: icmp 108: home.wiggy.net protocol 41 port 0 unreachable 13:39:53.264393 IP home.wiggy.net > ipv6-tb.xs4all.net: tunnel29.ipv6.xs4all.nl > irc.ipv6.xs4all.nl: icmp6: echo request seq 1 13:39:53.299071 IP ipv6-tb.xs4all.net > home.wiggy.net: irc.ipv6.xs4all.nl > tunnel29.ipv6.xs4all.nl: icmp6: echo reply seq 1 13:39:53.372094 IP ipv6-tb.xs4all.net > home.wiggy.net: xs4all29.ipv6.xs4all.nl > tunnel29.ipv6.xs4all.nl: [|icmp6] 13:39:53.372284 IP home.wiggy.net > ipv6-tb.xs4all.net: tunnel29.ipv6.xs4all.nl > xs4all29.ipv6.xs4all.nl: [|icmp6] 13:39:54.265389 IP home.wiggy.net > ipv6-tb.xs4all.net: tunnel29.ipv6.xs4all.nl > irc.ipv6.xs4all.nl: icmp6: echo request seq 2 13:39:54.278987 IP ipv6-tb.xs4all.net > home.wiggy.net: irc.ipv6.xs4all.nl > tunnel29.ipv6.xs4all.nl: icmp6: echo reply seq 2 13:39:55.267149 IP home.wiggy.net > ipv6-tb.xs4all.net: tunnel29.ipv6.xs4all.nl > irc.ipv6.xs4all.nl: icmp6: echo request seq 3 13:39:55.282790 IP ipv6-tb.xs4all.net > home.wiggy.net: irc.ipv6.xs4all.nl > tunnel29.ipv6.xs4all.nl: icmp6: echo reply seq 3 13:39:56.267934 IP home.wiggy.net > ipv6-tb.xs4all.net: tunnel29.ipv6.xs4all.nl > irc.ipv6.xs4all.nl: icmp6: echo request seq 4 13:39:56.282112 IP ipv6-tb.xs4all.net > home.wiggy.net: irc.ipv6.xs4all.nl > tunnel29.ipv6.xs4all.nl: icmp6: echo reply seq 4 13:39:57.268716 IP home.wiggy.net > ipv6-tb.xs4all.net: tunnel29.ipv6.xs4all.nl > irc.ipv6.xs4all.nl: icmp6: echo request seq 5 13:39:57.285870 IP ipv6-tb.xs4all.net > home.wiggy.net: irc.ipv6.xs4all.nl > tunnel29.ipv6.xs4all.nl: icmp6: echo reply seq 5 13:39:58.269504 IP home.wiggy.net > ipv6-tb.xs4all.net: tunnel29.ipv6.xs4all.nl > irc.ipv6.xs4all.nl: icmp6: echo request seq 6 13:39:58.286670 IP ipv6-tb.xs4all.net > home.wiggy.net: irc.ipv6.xs4all.nl > tunnel29.ipv6.xs4all.nl: icmp6: echo reply seq 6 13:40:00.324220 IP ipv6-tb.xs4all.net > home.wiggy.net: 2001:960:6a6:1:240:caff:fe85:d77e.37399 > tornado.wiggy.net.ssh: S 3800196387:3800196387(0) win 5760 13:40:00.325950 IP home.wiggy.net > ipv6-tb.xs4all.net: tornado.wiggy.net.ssh > 2001:960:6a6:1:240:caff:fe85:d77e.37399: S 4249094159:4249094159(0) ack 3800196388 win 5712 13:40:00.346751 IP ipv6-tb.xs4all.net > home.wiggy.net: 2001:960:6a6:1:240:caff:fe85:d77e.37399 > tornado.wiggy.net.ssh: . ack 1 win 5760 13:40:00.398508 IP home.wiggy.net > ipv6-tb.xs4all.net: tornado.wiggy.net.ssh > 2001:960:6a6:1:240:caff:fe85:d77e.37399: P 1:40(39) ack 1 win 45 13:40:00.438006 IP ipv6-tb.xs4all.net > home.wiggy.net: 2001:960:6a6:1:240:caff:fe85:d77e.37399 > tornado.wiggy.net.ssh: . ack 40 win 5760 13:40:00.438560 IP ipv6-tb.xs4all.net > home.wiggy.net: 2001:960:6a6:1:240:caff:fe85:d77e.37399 > tornado.wiggy.net.ssh: P 1:42(41) ack 40 win 5760 13:40:00.438904 IP home.wiggy.net > ipv6-tb.xs4all.net: tornado.wiggy.net.ssh > 2001:960:6a6:1:240:caff:fe85:d77e.37399: . ack 42 win 45 13:40:00.469593 IP ipv6-tb.xs4all.net > home.wiggy.net: 2001:960:6a6:1:240:caff:fe85:d77e.37399 > tornado.wiggy.net.ssh: P 42:650(608) ack 40 win 5760 13:40:00.498866 IP home.wiggy.net > ipv6-tb.xs4all.net: tornado.wiggy.net.ssh > 2001:960:6a6:1:240:caff:fe85:d77e.37399: P 40:584(544) ack 42 win 45 13:40:00.539856 IP home.wiggy.net > ipv6-tb.xs4all.net: tornado.wiggy.net.ssh > 2001:960:6a6:1:240:caff:fe85:d77e.37399: . ack 650 win 55 13:40:00.571197 IP ipv6-tb.xs4all.net > home.wiggy.net: 2001:960:6a6:1:240:caff:fe85:d77e.37399 > tornado.wiggy.net.ssh: P 650:674(24) ack 584 win 6528 13:40:00.571858 IP home.wiggy.net > ipv6-tb.xs4all.net: tornado.wiggy.net.ssh > 2001:960:6a6:1:240:caff:fe85:d77e.37399: . ack 674 win 55 13:40:00.595850 IP home.wiggy.net > ipv6-tb.xs4all.net: tornado.wiggy.net.ssh > 2001:960:6a6:1:240:caff:fe85:d77e.37399: P 584:736(152) ack 674 win 55 13:40:00.627863 IP ipv6-tb.xs4all.net > home.wiggy.net: 2001:960:6a6:1:240:caff:fe85:d77e.37399 > tornado.wiggy.net.ssh: P 674:818(144) ack 736 win 7616 13:40:00.667764 IP home.wiggy.net > ipv6-tb.xs4all.net: tornado.wiggy.net.ssh > 2001:960:6a6:1:240:caff:fe85:d77e.37399: . ack 818 win 55 13:40:00.680831 IP home.wiggy.net > ipv6-tb.xs4all.net: tornado.wiggy.net.ssh > 2001:960:6a6:1:240:caff:fe85:d77e.37399: P 736:1200(464) ack 818 win 55 13:40:00.756581 IP ipv6-tb.xs4all.net > home.wiggy.net: 2001:960:6a6:1:240:caff:fe85:d77e.37399 > tornado.wiggy.net.ssh: . ack 1200 win 8704 13:40:00.762006 IP ipv6-tb.xs4all.net > home.wiggy.net: 2001:960:6a6:1:240:caff:fe85:d77e.37399 > tornado.wiggy.net.ssh: P 818:834(16) ack 1200 win 8704 13:40:00.762355 IP home.wiggy.net > ipv6-tb.xs4all.net: tornado.wiggy.net.ssh > 2001:960:6a6:1:240:caff:fe85:d77e.37399: . ack 834 win 55 13:40:00.785322 IP ipv6-tb.xs4all.net > home.wiggy.net: 2001:960:6a6:1:240:caff:fe85:d77e.37399 > tornado.wiggy.net.ssh: P 834:882(48) ack 1200 win 8704 13:40:00.788806 IP home.wiggy.net > ipv6-tb.xs4all.net: tornado.wiggy.net.ssh > 2001:960:6a6:1:240:caff:fe85:d77e.37399: . ack 882 win 55 13:40:00.793799 IP home.wiggy.net > ipv6-tb.xs4all.net: tornado.wiggy.net.ssh > 2001:960:6a6:1:240:caff:fe85:d77e.37399: P 1200:1248(48) ack 882 win 55 13:40:00.821611 IP ipv6-tb.xs4all.net > home.wiggy.net: 2001:960:6a6:1:240:caff:fe85:d77e.37399 > tornado.wiggy.net.ssh: . ack 1248 win 8704 13:40:00.828011 IP ipv6-tb.xs4all.net > home.wiggy.net: 2001:960:6a6:1:240:caff:fe85:d77e.37399 > tornado.wiggy.net.ssh: P 882:946(64) ack 1248 win 8704 13:40:00.860787 IP home.wiggy.net > ipv6-tb.xs4all.net: tornado.wiggy.net.ssh > 2001:960:6a6:1:240:caff:fe85:d77e.37399: P 1248:1328(80) ack 946 win 55 13:40:00.885253 IP ipv6-tb.xs4all.net > home.wiggy.net: 2001:960:6a6:1:240:caff:fe85:d77e.37399 > tornado.wiggy.net.ssh: P 946:1042(96) ack 1328 win 8704 13:40:00.885878 IP home.wiggy.net > ipv6-tb.xs4all.net: tornado.wiggy.net.ssh > 2001:960:6a6:1:240:caff:fe85:d77e.37399: P 1328:1408(80) ack 1042 win 55 13:40:00.952432 IP ipv6-tb.xs4all.net > home.wiggy.net: 2001:960:6a6:1:240:caff:fe85:d77e.37399 > tornado.wiggy.net.ssh: . ack 1408 win 8704 ] -- Wichert Akkerman It is simple to make things. http://www.wiggy.net/ It is hard to make things simple. From christian.benvenuti@libero.it Mon Jan 10 17:01:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 17:01:24 -0800 (PST) Received: from smtp20.libero.it (smtp20.libero.it [193.70.192.147]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0B11JbX019364 for ; Mon, 10 Jan 2005 17:01:20 -0800 Received: from localhost (172.16.1.84) by smtp20.libero.it (7.0.027-DD01) id 41D02C9800263CF3 for netdev@oss.sgi.com; Tue, 11 Jan 2005 14:01:06 +0100 Received: from [192.168.1.101] (151.41.254.206) by smtp2.libero.it (7.0.027-DD01) (authenticated as christian.benvenuti@libero.it) id 41BF65E402145166 for netdev@oss.sgi.com; Tue, 11 Jan 2005 14:01:25 +0100 Subject: Default route selection and dead GW detection From: Christian Benvenuti To: netdev@oss.sgi.com Content-Type: text/plain Message-Id: <1105481030.2809.4160.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Tue, 11 Jan 2005 14:03:50 -0800 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: by amavisd-new at libero.it serv5 X-Virus-Status: Clean X-archive-position: 72 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: christian.benvenuti@libero.it Precedence: bulk X-list: netdev Hello, I am looking at how Linux selects a default route (when multipath is not configured), and in particular I am looking at: fn_hash_select_default / fib_detect_death (kernel 2.6.9) It seems to me this is the logic used: a) If there is only one default route defined (which would be the one previously selected by and saved in "res->fi"), that one would be used. b) If there is more than one route available, then: b1) the first default route whose next-hop is NUD_REACHABLE is selected. b2) if there is no NUD_REACHABLE GW, then b3) all eligible default routes are checked and the last one with a NUD_VALID GW is selected (if != fn_hash_last_dflt) b4) if there is no NUD_VALID GW, all default routes will be tried by , one by one, from first one to last one. Did I get the logic right? Supposing I did, I have a couple of questions about b3): 1) why does b3) check for (!=fn_hash_last_dflt) ? In other words, if you do not use the "fn_hash_last_dflt" GW for sometime, and therefore its NUD states goes to NUD_STALE, why would you select another NUD_VALID (but not NUD_REACHABLE) GW? 2) please see my second question below static int fib_detect_death(struct fib_info *fi, int order, struct fib_info **last_resort, int *last_idx) { struct neighbour *n; int state = NUD_NONE; n = neigh_lookup(&arp_tbl, &fi->fib_nh[0].nh_gw, fi->fib_dev); if (n) { state = n->nud_state; neigh_release(n); } if (state==NUD_REACHABLE) return 0; if ((state&NUD_VALID) && order != fn_hash_last_dflt) return 0; /* Why does the block below keep updating and * even when they are already initialized? * (e.g. from a previous invocation by ) * Is it just to make code simpler? */ if ((state&NUD_VALID) || (*last_idx<0 && order > fn_hash_last_dflt)) { *last_resort = fi; *last_idx = order; } return 1; } I also have a doubt about how the "classic" configuration of multiple default routes coexists with a multipath default route. Since multiple default GW are configurable both with multiple "route add default ..." commands, or with a single default multipath route like "ip route add default ..." am I correct if I say that those two forms are exclusive? You can configure default routes with both commands, the kernel does not complain, but it seems the routing routines do not take this possibility into account. For example: - selects the default route either with or : ... #ifdef CONFIG_IP_ROUTE_MULTIPATH if (res.fi->fib_nhs > 1 && fl.oif == 0) fib_select_multipath(&fl, &res); else #endif if (!res.prefixlen && res.type == RTN_UNICAST && !fl.oif) fib_select_default(&fl, &res); ... - does not call at all: ... #ifdef CONFIG_IP_ROUTE_MULTIPATH if (res.fi->fib_nhs > 1 && fl.oif == 0) fib_select_multipath(&fl, &res); #endif ... Thanks in advance -Christian From dhollis@davehollis.com Mon Jan 10 18:46:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 18:46:33 -0800 (PST) Received: from pop-a065c05.pas.sa.earthlink.net (pop-a065c05.pas.sa.earthlink.net [207.217.121.183]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0B2kQJe022714 for ; Mon, 10 Jan 2005 18:46:26 -0800 Received: from user-12hcjeo.cable.mindspring.com ([69.22.77.216] helo=bender.davehollis.com) by pop-a065c05.pas.sa.earthlink.net with esmtp (Exim 3.33 #1) id 1CoNHm-0003BX-00 for netdev@oss.sgi.com; Tue, 11 Jan 2005 06:46:18 -0800 Received: from 10.8.0.6 ([10.8.0.6]) (authenticated bits=0) by bender.davehollis.com (8.13.1/8.12.11) with ESMTP id j0BEkAB1019608 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Tue, 11 Jan 2005 09:46:15 -0500 Subject: [PATCH] tg3.h & b44.h ifndef ADVERTISE_PAUSE typo From: David Hollis To: Netdev Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-o4RiUs3lCqkUr5oeoFjS" Date: Tue, 11 Jan 2005 09:42:33 -0500 Message-Id: <1105454553.4264.4.camel@dhollis-lnx.centricconsulting.com> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) X-Scanned-By: MIMEDefang 2.49 on 10.8.0.1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 73 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dhollis@davehollis.com Precedence: bulk X-list: netdev --=-o4RiUs3lCqkUr5oeoFjS Content-Type: multipart/mixed; boundary="=-PkaztbHcB1OMnKtuQu/D" --=-PkaztbHcB1OMnKtuQu/D Content-Type: text/plain Content-Transfer-Encoding: quoted-printable tg3.h and b44.h define ADVERTISE_PAUSE_CAP if ADVERTISE_PAUSE is not defined. Both include a notation that these values should be added to mii.h. If ADVERTISE_PAUSE_CAP was added to mii.h, these defines would break since they are checking for ADVERTISE_PAUSE instead of ADVERTISE_PAUSE_CAP. --=20 David Hollis --=-PkaztbHcB1OMnKtuQu/D Content-Disposition: attachment; filename=b44_tg3_advertise_define.patch Content-Type: text/x-patch; name=b44_tg3_advertise_define.patch; charset=UTF-8 Content-Transfer-Encoding: base64 dGczLmggYW5kIGI0NC5oIGRlZmluZSBBRFZFUlRJU0VfUEFVU0VfQ0FQIGlmIEFEVkVSVElTRV9Q QVVTRQ0KaXMgbm90IGRlZmluZWQuICBCb3RoIGluY2x1ZGUgYSBub3RhdGlvbiB0aGF0IHRoZXNl IHZhbHVlcyBzaG91bGQNCmJlIGFkZGVkIHRvIG1paS5oLiAgSWYgQURWRVJUSVNFX1BBVVNFX0NB UCB3YXMgYWRkZWQgdG8gbWlpLmgsDQp0aGVzZSBkZWZpbmVzIHdvdWxkIGJyZWFrIHNpbmNlIHRo ZXkgYXJlIGNoZWNraW5nIGZvciBBRFZFUlRJU0VfUEFVU0UNCmluc3RlYWQgb2YgQURWRVJUSVNF X1BBVVNFX0NBUC4NCg0KU2lnbmVkLW9mZi1ieTogRGF2aWQgSG9sbGlzIDxkaG9sbGlzQGRhdmVo b2xsaXMuY29tPg0KDQogZHJpdmVycy9uZXQvYjQ0LmggfCAgICAyICstDQogZHJpdmVycy9uZXQv dGczLmggfCAgICAyICstDQogMiBmaWxlcyBjaGFuZ2VkLCAyIGluc2VydGlvbnMoKyksIDIgZGVs ZXRpb25zKC0pDQoNCi0tLSBhL2RyaXZlcnMvbmV0L2I0NC5oCTIwMDUtMDEtMTEgMDk6MzQ6Mzku MTc4NzM5NzI4IC0wNTAwDQorKysgYi9kcml2ZXJzL25ldC9iNDQuaAkyMDA1LTAxLTExIDA5OjM0 OjU0LjIxNTQ1MzgwMCAtMDUwMA0KQEAgLTMwMyw3ICszMDMsNyBAQA0KICNkZWZpbmUgIE1JSV9U TEVEQ1RSTF9FTkFCTEUJMHgwMDQwDQogDQogLyogWFhYIEFkZCB0aGlzIHRvIG1paS5oICovDQot I2lmbmRlZiBBRFZFUlRJU0VfUEFVU0UNCisjaWZuZGVmIEFEVkVSVElTRV9QQVVTRV9DQVANCiAj ZGVmaW5lIEFEVkVSVElTRV9QQVVTRV9DQVAJCTB4MDQwMA0KICNlbmRpZg0KICNpZm5kZWYgQURW RVJUSVNFX1BBVVNFX0FTWU0NCi0tLSBhL2RyaXZlcnMvbmV0L3RnMy5oCTIwMDUtMDEtMTEgMDk6 MzQ6NDMuNTYyMDczMzYwIC0wNTAwDQorKysgYi9kcml2ZXJzL25ldC90ZzMuaAkyMDA1LTAxLTEx IDA5OjM1OjAwLjc4NjQ1NDg1NiAtMDUwMA0KQEAgLTE1MzIsNyArMTUzMiw3IEBADQogI2RlZmlu ZSBNSUlfVEczX0lOVF9BTkVHX1BBR0VfUlgJMHgwNDAwDQogDQogLyogWFhYIEFkZCB0aGlzIHRv IG1paS5oICovDQotI2lmbmRlZiBBRFZFUlRJU0VfUEFVU0UNCisjaWZuZGVmIEFEVkVSVElTRV9Q QVVTRV9DQVANCiAjZGVmaW5lIEFEVkVSVElTRV9QQVVTRV9DQVAJCTB4MDQwMA0KICNlbmRpZg0K ICNpZm5kZWYgQURWRVJUSVNFX1BBVVNFX0FTWU0NCg== --=-PkaztbHcB1OMnKtuQu/D-- --=-o4RiUs3lCqkUr5oeoFjS Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQBB4+XYxasLqOyGHncRAp0jAJwKAqDdD6FwkI6RYY4xrzHVy1uV7wCfT3Xs isuZI5Zj6U+5ljhqqPb/RB8= =y/OI -----END PGP SIGNATURE----- --=-o4RiUs3lCqkUr5oeoFjS-- From jeremy.guthrie@berbee.com Mon Jan 10 19:12:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 19:12:21 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0B3CEpT023630 for ; Mon, 10 Jan 2005 19:12:14 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Tue, 11 Jan 2005 09:12:01 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Tue, 11 Jan 2005 09:11:57 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson , Stephen Hemminger References: <200501031455.26980.jeremy.guthrie@berbee.com> <200501071506.57811.jeremy.guthrie@berbee.com> <16862.65385.9009.742742@robur.slu.se> In-Reply-To: <16862.65385.9009.742742@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3699945.KmXMg9Morr"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501110912.00258.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 11 Jan 2005 15:12:01.0222 (UTC) FILETIME=[E6A7D660:01C4F7EF] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 74 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart3699945.KmXMg9Morr Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Friday 07 January 2005 03:30 pm, Robert Olsson wrote: > Jeremy M. Guthrie writes: > 85 kpps and 2287 lookups/sec as a 60 sec average. Pretty nice load yes. > Where did you get the load? > Try see if you fix lnstat :-) it would be nice to see the route dynamics. > Or use the try the rtstat I pointed to. > > And apply the e1000 patch I sent and make a test run. The code Jesse Brandeburg had me download has the patch in it. > I'll have a beer and give up for tonight... > > --ro =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart3699945.KmXMg9Morr Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB4+zAqtjaBHGZBeURAhH1AJ9oU0ebkBC77YW5p6Sf7gx6niOzkQCffqtY 0UA//hnquC7n/03upE/nPdg= =7XRY -----END PGP SIGNATURE----- --nextPart3699945.KmXMg9Morr-- From jeremy.guthrie@berbee.com Mon Jan 10 19:17:40 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 19:17:46 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0B3HeHV024174 for ; Mon, 10 Jan 2005 19:17:40 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Tue, 11 Jan 2005 09:17:27 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Tue, 11 Jan 2005 09:17:23 -0600 User-Agent: KMail/1.7.2 Cc: Stephen Hemminger , Jesse Brandeburg , Robert Olsson References: <200501071650.56423.jeremy.guthrie@berbee.com> <20050107145711.367aa159@dxpl.pdx.osdl.net> In-Reply-To: <20050107145711.367aa159@dxpl.pdx.osdl.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2263414.Vanlkf8AyK"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501110917.26621.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 11 Jan 2005 15:17:27.0362 (UTC) FILETIME=[A90CDA20:01C4F7F0] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 75 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart2263414.Vanlkf8AyK Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline date ; ifconfig eth3 ; cat /proc/net/softnet_stat ;=20 cat /proc/net/stat/rt_cache ; sleep 60 ; date ; ifconfig eth3 ;=20 cat /proc/net/softnet_stat ; cat /proc/net/stat/rt_cache Tue Jan 11 09:12:21 CST 2005 eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255.0 inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:3519452697 errors:5558592 dropped:5558592=20 overruns:4011523 frame:0 TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:497775695 (474.7 Mb) TX bytes:398 (398.0 b) Base address:0x22a0 Memory:eff80000-effa0000 f59427dc 150dc67c 00c562ab 000d2659 00000000 00000000 00000000 00000000=20 00547b5b 00038622 00000000 00000065 00000000 00000000 00000000 00000000 00000000=20 0006804f entries in_hit in_slow_tot in_no_route in_brd in_martian_dst in_martian_sr= c =20 out_hit out_slow_tot out_slow_mc gc_total gc_ignored gc_goal_miss=20 gc_dst_overflow in_hlist_search out_hlist_search 0000f3c2 aeca1565 272c383d 00000000 00000000 000089a8 00005298 00000002 =20 001db403 0003054f 00000000 230aa73c 22fe33eb 00000cf0 00000000 b37011dc=20 00957c14 0000f3c2 0000b975 00029703 00000000 00000000 000035a5 00000000 00000000 =20 00000015 00000083 00000002 000038c8 000038a3 00000000 00000000 0012a566=20 0000014d Tue Jan 11 09:13:21 CST 2005 eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255.0 inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:3524302561 errors:5571396 dropped:5571396=20 overruns:4022383 frame:0 TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3065327250 (2923.3 Mb) TX bytes:398 (398.0 b) Base address:0x22a0 Memory:eff80000-effa0000 f5de26f5 150dc67c 00c562b4 000d2659 00000000 00000000 00000000 00000000=20 00547ffd 00038632 00000000 00000065 00000000 00000000 00000000 00000000 00000000=20 0006807c entries in_hit in_slow_tot in_no_route in_brd in_martian_dst in_martian_sr= c =20 out_hit out_slow_tot out_slow_mc gc_total gc_ignored gc_goal_miss=20 gc_dst_overflow in_hlist_search out_hlist_search 0000fc1e af11f07b 272e58d3 00000000 00000000 000089a8 00005298 00000002 =20 001db571 00030572 00000000 230cc7f1 23005428 00000cf0 00000000 b4b5b529=20 009583b9 0000fc1e 0000b977 00029710 00000000 00000000 000035a7 00000000 00000000 =20 00000015 00000083 00000002 000038ca 000038a5 00000000 00000000 0012a5c8=20 0000014d =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart2263414.Vanlkf8AyK Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB4+4GqtjaBHGZBeURAggWAJ9Vg/ncAw2zbFU7NVuMJFIjJD4j1ACgh1WN ttbgF8WF1OkMrjSOFeuUybc= =XZFU -----END PGP SIGNATURE----- --nextPart2263414.Vanlkf8AyK-- From juhl-lkml@dif.dk Mon Jan 10 20:16:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 20:16:11 -0800 (PST) Received: from mail.dif.dk (mail.dif.dk [193.138.115.101]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0B4G2Gr029232 for ; Mon, 10 Jan 2005 20:16:03 -0800 Received: from localhost (localhost [127.0.0.1]) by mail.dif.dk (Postfix) with ESMTP id DBC47FFC5D for ; Tue, 11 Jan 2005 17:20:20 +0100 (CET) Received: from mail.dif.dk ([127.0.0.1]) by localhost (saerimmer [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 14674-09 for ; Tue, 11 Jan 2005 17:20:19 +0100 (CET) Received: from diftmgw2.backbone.dif.dk (diftmgw2.backbone.dif.dk [10.227.136.246]) by mail.dif.dk (Postfix) with ESMTP id C26E1FFC9C for ; Tue, 11 Jan 2005 17:20:19 +0100 (CET) Received: from DIFPST1A.backbone.dif.dk ([10.227.136.220]) by diftmgw2.backbone.dif.dk with InterScan Messaging Security Suite; Tue, 11 Jan 2005 17:15:13 +0100 Received: from [172.16.2.11] (10.227.136.29 [10.227.136.29]) by DIFPST1A.backbone.dif.dk with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2657.72) id CHBNPF9W; Tue, 11 Jan 2005 17:15:46 +0100 Date: Tue, 11 Jan 2005 17:18:22 +0100 (CET) From: Jesper Juhl To: Adrian Bunk Cc: Jesper Juhl , linux-kernel , linux-net , netdev Subject: Re: [PATCH] remove unused variables in net/sunrpc/auth.c In-Reply-To: <20050110221651.GA29578@stusta.de> Message-ID: References: <20050110221651.GA29578@stusta.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: by amavisd-new at dif.dk X-Virus-Status: Clean X-archive-position: 76 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: juhl-lkml@dif.dk Precedence: bulk X-list: netdev On Mon, 10 Jan 2005, Adrian Bunk wrote: > On Mon, Jan 10, 2005 at 10:50:34PM +0100, Jesper Juhl wrote: > > > > We have a few unused variables in net/sunrpc/auth.c:320: > > > > net/sunrpc/auth.c:320: warning: unused variable `auth' > > net/sunrpc/auth.c:333: warning: unused variable `auth' > > net/sunrpc/auth.c:345: warning: unused variable `auth' > > net/sunrpc/auth.c:385: warning: unused variable `auth' > > > > As far as I can see, the patch that caused them to become unused is this > > one (which btw is ~36 months old) : > > http://linux.bkbits.net:8080/linux-2.6/diffs/net/sunrpc/auth.c@1.4?nav=index.html|src/|src/net|src/net/sunrpc|hist/net/sunrpc/auth.c > > > > Here is a patch to get rid of them (compile tested only). > >... > > Doesn't this break with CONFIG_SYSCTL=y? > Yes, yes it does. I didn't see the CONFIG_SYSCTL connection and thus didn't test that :( Please disregard the patch, it's wrong. -- Jesper Juhl From jeremy.guthrie@berbee.com Mon Jan 10 21:18:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 10 Jan 2005 21:18:22 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0B5IE9d001670 for ; Mon, 10 Jan 2005 21:18:14 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Tue, 11 Jan 2005 11:18:01 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Tue, 11 Jan 2005 11:17:57 -0600 User-Agent: KMail/1.7.2 Cc: Stephen Hemminger , Jesse Brandeburg , Robert Olsson References: <20050107145711.367aa159@dxpl.pdx.osdl.net> <200501110917.26621.jeremy.guthrie@berbee.com> In-Reply-To: <200501110917.26621.jeremy.guthrie@berbee.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4008070.niflUrAN4L"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501111118.00601.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 11 Jan 2005 17:18:01.0399 (UTC) FILETIME=[80DF4C70:01C4F801] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 77 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart4008070.niflUrAN4L Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline ./rtstat size IN: hit tot mc no_rt bcast madst masrc OUT: hit tot = mc=20 GC: tot ignored goal_miss ovrf HASH: in_search out_search 63375 86092 2844 0 0 0 0 0 5 1=20 1610369017 2846 2844 0 0 386039 17 64870 84431 537031471 537492192 0 0 0 0 1 = 0 =20 0 2848 2846 0 0 386130 10 58707 87889 2715 0 0 0 0 0 7 1 = 0 =20 2716 2714 0 0 384782 13 60617 89993 2796 0 0 0 0 0 5 0 = 0 =20 2795 2793 0 0 384432 17 62458 93221 2772 0 0 0 0 0 3 0 = 0 =20 2772 2770 0 0 399579 9 63990 93792 2712 0 0 0 0 0 6 0 = 0 =20 2713 2711 0 0 422585 12 65499 94235 2846 0 0 0 0 0 2 0 = 0 =20 2846 2844 0 0 424341 9 59755 90992 2864 0 0 0 0 0 1 1 = 0 =20 2865 2863 0 0 385888 13 61702 87681 2798 0 0 0 0 0 6 2 = 0 =20 2800 2798 0 0 383276 34 63334 90557 2734 0 0 0 0 0 5 1 = 0 =20 2735 2733 0 0 422121 28 64798 88178 2732 0 0 0 0 0 1 0 = 0 =20 2732 2730 0 0 410772 11 58574 85910 2669 0 0 0 0 0 3 0 = 0 =20 2670 2668 0 0 393331 10 60538 87238 2705 0 0 0 0 0 4 0 = 0 =20 2705 2703 0 0 382161 20 62164 85738 2628 0 0 0 0 0 4 0 = 0 =20 2628 2626 0 0 373049 25 63759 78752 2638 0 0 0 0 0 2 0 = 0 =20 2638 2636 0 0 348411 5 65052 79832 2482 0 0 0 0 0 3 0 = 0 =20 2481 2479 0 0 365871 20 58986 82611 2549 0 0 0 0 0 4 1 = 0 =20 2550 2548 0 0 366429 24 60845 85340 2620 0 0 1 0 0 2 0 = 0 =20 2620 2618 0 0 369963 16 62465 83122 2591 0 0 0 0 0 5 0 = 0 =20 2591 2589 0 0 371261 18 size IN: hit tot mc no_rt bcast madst masrc OUT: hit tot = mc=20 GC: tot ignored goal_miss ovrf HASH: in_search out_search 63998 86141 2640 0 0 0 0 0 4 0=20 537114631 2640 2638 0 0 386452 15 65294 85989 2527 0 0 0 0 0 5 1=20 1610369017 2528 2526 0 0 379801 26 59241 84305 2662 0 0 0 0 0 7 0 = 0 =20 2662 2660 0 0 371925 35 61194 85397 2837 0 0 0 0 0 3 0 = 0 =20 2837 2835 0 0 374788 17 62908 88133 2688 0 0 1 0 0 4 1 = 0 =20 2689 2687 0 0 382411 19 64329 88495 2648 0 0 0 0 0 5 1 = 0 =20 2649 2647 0 0 398763 30 65560 84994 2447 0 0 1 0 0 6 2 = 0 =20 2449 2447 0 0 394745 33 59677 81478 2568 0 0 0 0 0 5 0 = 0 =20 2569 2567 0 0 341439 22 61459 81225 2623 0 0 0 0 0 5 0 = 0 =20 2623 2621 0 0 345996 30 63038 83660 2544 0 0 0 0 0 3 0 = 0 =20 2544 2542 0 0 381567 21 64494 86321 2620 0 0 0 0 0 4 0 = 0 =20 2620 2618 0 0 395278 19 65528 88754 2766 0 0 0 0 0 6 0 = 0 =20 2765 2763 0 0 421075 34 59948 86443 2990 0 0 0 0 0 5 0 = 0 =20 2990 2988 0 0 373605 29 61860 81912 2786 0 0 0 0 0 5 1 = 0 =20 2787 2785 0 0 354678 34 63630 80399 2981 0 0 0 0 0 4 0 = 0 =20 2979 2977 0 0 354983 32 65215 83600 2934 0 0 0 0 0 6 3 = 0 =20 2937 2935 0 0 371497 41 59322 85583 2821 0 0 0 0 0 7 0 = 0 =20 2822 2820 0 0 382896 40 61268 82602 2817 0 0 0 0 0 9 2 = 0 =20 2819 2817 0 0 368078 54 62989 85336 2760 0 0 1 0 0 9 0 = 0 =20 2760 2758 0 0 394212 39 64387 84861 2603 0 0 0 0 0 7 0 = 0 =20 2602 2600 0 0 390852 36 size IN: hit tot mc no_rt bcast madst masrc OUT: hit tot = mc=20 GC: tot ignored goal_miss ovrf HASH: in_search out_search 65681 82848 2625 0 0 0 0 0 8 0=20 537114631 2625 2623 0 0 370769 49 59923 82826 2685 0 0 0 0 0 6 0=20 1610369017 2685 2683 0 0 344094 41 61700 82705 2706 0 0 0 0 0 7 0 = 0 =20 2706 2704 0 0 368474 39 63247 91042 2592 0 0 0 0 0 9 1 = 0 =20 2593 2591 0 0 399393 57 64636 93050 2530 0 0 0 0 0 6 0 = 0 =20 2530 2528 0 0 405903 24 58301 90662 2554 0 0 0 0 0 5 0 = 0 =20 2555 2553 0 0 404296 39 60146 88405 2567 0 0 0 0 0 8 1 = 0 =20 2567 2565 0 0 370227 49 61822 86417 2579 0 0 0 0 0 7 1 = 0 =20 2580 2578 0 0 366323 43 63351 86517 2594 0 0 1 0 0 9 0 = 0 =20 2594 2592 0 0 363340 51 64739 87879 2669 0 0 0 0 0 3 0 = 0 =20 2670 2668 0 0 387580 26 58397 88297 2566 0 0 0 0 0 4 0 = 0 =20 2566 2564 0 0 396980 34 60352 85039 2707 0 0 0 0 0 6 1 = 0 =20 2709 2707 0 0 367790 47 62169 87083 2779 0 0 0 0 0 6 0 = 0 =20 2775 2773 0 0 377163 31 63808 88700 2752 0 0 0 0 0 4 0 = 0 =20 2751 2749 0 0 392830 28 65189 91242 2725 0 0 0 0 0 5 1 = 0 =20 2727 2725 0 0 416871 31 59326 84893 2834 0 0 0 0 0 5 1 = 0 =20 2828 2826 0 0 380811 28 61064 87351 2553 0 0 0 0 0 9 0 = 0 =20 2552 2550 0 0 382053 37 62637 88761 2551 0 0 0 0 0 5 1 = 0 =20 2553 2551 0 0 384974 29 =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart4008070.niflUrAN4L Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB5ApIqtjaBHGZBeURAhGLAJ93a2wgpFlElzFgBNjTQ8abukL++wCfVZAW CJgJPpVL4yl2/gGMqu9a4zY= =Y/U6 -----END PGP SIGNATURE----- --nextPart4008070.niflUrAN4L-- From jgarzik@pobox.com Tue Jan 11 10:57:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 10:57:38 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BIvUYS020861 for ; Tue, 11 Jan 2005 10:57:31 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CoRD9-0002va-Q2; Tue, 11 Jan 2005 18:57:48 +0000 Message-ID: <41E421A8.60203@pobox.com> Date: Tue, 11 Jan 2005 13:57:44 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Hollis CC: Netdev Subject: Re: [PATCH] tg3.h & b44.h ifndef ADVERTISE_PAUSE typo References: <1105454553.4264.4.camel@dhollis-lnx.centricconsulting.com> In-Reply-To: <1105454553.4264.4.camel@dhollis-lnx.centricconsulting.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 78 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev David Hollis wrote: > tg3.h and b44.h define ADVERTISE_PAUSE_CAP if ADVERTISE_PAUSE > is not defined. Both include a notation that these values should > be added to mii.h. If ADVERTISE_PAUSE_CAP was added to mii.h, > these defines would break since they are checking for ADVERTISE_PAUSE > instead of ADVERTISE_PAUSE_CAP. > > Signed-off-by: David Hollis > > drivers/net/b44.h | 2 +- > drivers/net/tg3.h | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > --- a/drivers/net/b44.h 2005-01-11 09:34:39.178739728 -0500 > +++ b/drivers/net/b44.h 2005-01-11 09:34:54.215453800 -0500 > @@ -303,7 +303,7 @@ > #define MII_TLEDCTRL_ENABLE 0x0040 > > /* XXX Add this to mii.h */ > -#ifndef ADVERTISE_PAUSE > +#ifndef ADVERTISE_PAUSE_CAP > #define ADVERTISE_PAUSE_CAP 0x0400 > #endif > #ifndef ADVERTISE_PAUSE_ASYM > --- a/drivers/net/tg3.h 2005-01-11 09:34:43.562073360 -0500 > +++ b/drivers/net/tg3.h 2005-01-11 09:35:00.786454856 -0500 > @@ -1532,7 +1532,7 @@ > #define MII_TG3_INT_ANEG_PAGE_RX 0x0400 > > /* XXX Add this to mii.h */ > -#ifndef ADVERTISE_PAUSE > +#ifndef ADVERTISE_PAUSE_CAP > #define ADVERTISE_PAUSE_CAP 0x0400 > #endif > #ifndef ADVERTISE_PAUSE_ASYM Just kill the ifdef and add it to mii.h. Jeff From shemminger@osdl.org Tue Jan 11 11:19:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 11:19:30 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BJJNNM021818 for ; Tue, 11 Jan 2005 11:19:23 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0BJJGY05015; Tue, 11 Jan 2005 11:19:16 -0800 Date: Tue, 11 Jan 2005 11:19:17 -0800 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (1/2) skfddi: initialization Message-ID: <20050111111917.52988b75@dxpl.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 79 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev When the skfddi driver was converted to the new PCI netdevice interface, it never got tested with real hardware. The initialization got broken, this should fix it. Signed-off-by: Stephen Hemminger diff -Nru a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c --- a/drivers/net/skfp/skfddi.c 2004-12-14 11:08:07 -08:00 +++ b/drivers/net/skfp/skfddi.c 2004-12-14 11:08:07 -08:00 @@ -205,7 +205,6 @@ { struct net_device *dev; struct s_smc *smc; /* board pointer */ - unsigned long port, len; void __iomem *mem; int err; @@ -216,62 +215,43 @@ err = pci_enable_device(pdev); if (err) + return err; + + err = pci_request_regions(pdev, "skfddi"); + if (err) goto err_out1; + pci_set_master(pdev); #ifdef MEM_MAPPED_IO if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) { printk(KERN_ERR "skfp: region is not an MMIO resource\n"); err = -EIO; - goto err_out1; + goto err_out2; } - port = pci_resource_start(pdev, 0); - len = pci_resource_len(pdev, 0); - if (len < 0x4000) { - printk(KERN_ERR "skfp: Invalid PCI region size: %lu\n", len); - err = -EIO; - goto err_out1; - } + mem = ioremap(pci_resource_start(pdev, 0), 0x4000); #else if (!(pci_resource_flags(pdev, 1) & IO_RESOURCE_IO)) { printk(KERN_ERR "skfp: region is not PIO resource\n"); err = -EIO; - goto err_out1; + goto err_out2; } - port = pci_resource_start(pdev, 1); - len = pci_resource_len(pdev, 1); - if (len < FP_IO_LEN) { - printk(KERN_ERR "skfp: Invalid PCI region size: %d\n", - io_len); + mem = ioport_map(pci_resource_start(pdev, 1), FP_IO_LEN); +#endif + if (!mem) { + printk(KERN_ERR "skfp: Unable to map register, " + "FDDI adapter will be disabled.\n"); err = -EIO; - goto err_out1; + goto err_out2; } -#endif - err = pci_request_regions(pdev, "skfddi"); - if (err) - goto err_out1; - - pci_set_master(pdev); dev = alloc_fddidev(sizeof(struct s_smc)); if (!dev) { printk(KERN_ERR "skfp: Unable to allocate fddi device, " "FDDI adapter will be disabled.\n"); err = -ENOMEM; - goto err_out2; - } - -#ifdef MEM_MAPPED_IO - mem = ioremap(port, len); -#else - mem =ioport_map(port, len); -#endif - if (!mem) { - printk(KERN_ERR "skfp: Unable to map register, " - "FDDI adapter will be disabled.\n"); - err = -EIO; goto err_out3; } @@ -331,16 +311,17 @@ pci_free_consistent(pdev, MAX_FRAME_SIZE, smc->os.LocalRxBuffer, smc->os.LocalRxBufferDMA); err_out4: + free_netdev(dev); +err_out3: #ifdef MEM_MAPPED_IO - iounmap(smc->hw.iop); + iounmap(mem); #else - ioport_unmap(smc->hw.iop); + ioport_unmap(mem); #endif -err_out3: - free_netdev(dev); err_out2: pci_release_regions(pdev); err_out1: + pci_disable_device(pdev); return err; } @@ -376,6 +357,7 @@ pci_release_regions(pdev); free_netdev(p); + pci_disable_device(pdev); pci_set_drvdata(pdev, NULL); } From shemminger@osdl.org Tue Jan 11 11:21:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 11:21:52 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BJLm3p022368 for ; Tue, 11 Jan 2005 11:21:48 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0BJLfY06005; Tue, 11 Jan 2005 11:21:41 -0800 Date: Tue, 11 Jan 2005 11:21:43 -0800 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (2/2) skfddi: netdev_priv and cast cleanup Message-ID: <20050111112143.64d56c78@dxpl.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 80 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Use netdev_priv() and get rid of the PRIV() macro by using the correct data element. Also eliminate casts, where type is correct. Signed-off-by: Stephen Hemminger diff -Nru a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c --- a/drivers/net/skfp/skfddi.c 2004-12-14 11:07:42 -08:00 +++ b/drivers/net/skfp/skfddi.c 2004-12-14 11:07:42 -08:00 @@ -169,8 +169,6 @@ #define PRINTK(s, args...) #endif // DRIVERDEBUG -#define PRIV(dev) (&(((struct s_smc *)dev->priv)->os)) - /* * ================= * = skfp_init_one = @@ -269,7 +267,7 @@ SET_NETDEV_DEV(dev, &pdev->dev); /* Initialize board structure with bus-specific info */ - smc = (struct s_smc *) dev->priv; + smc = netdev_priv(dev); smc->os.dev = dev; smc->os.bus_type = SK_BUS_TYPE_PCI; smc->os.pdev = *pdev; @@ -331,7 +329,7 @@ static void __devexit skfp_remove_one(struct pci_dev *pdev) { struct net_device *p = pci_get_drvdata(pdev); - struct s_smc *lp = p->priv; + struct s_smc *lp = netdev_priv(p); unregister_netdev(p); @@ -388,8 +386,8 @@ */ static int skfp_driver_init(struct net_device *dev) { - struct s_smc *smc = (struct s_smc *) dev->priv; - skfddi_priv *bp = PRIV(dev); + struct s_smc *smc = netdev_priv(dev); + skfddi_priv *bp = &smc->os; int err = -EIO; PRINTK(KERN_INFO "entering skfp_driver_init\n"); @@ -495,7 +493,7 @@ */ static int skfp_open(struct net_device *dev) { - struct s_smc *smc = (struct s_smc *) dev->priv; + struct s_smc *smc = netdev_priv(dev); int err; PRINTK(KERN_INFO "entering skfp_open\n"); @@ -562,8 +560,8 @@ */ static int skfp_close(struct net_device *dev) { - struct s_smc *smc = (struct s_smc *) dev->priv; - skfddi_priv *bp = PRIV(dev); + struct s_smc *smc = netdev_priv(dev); + skfddi_priv *bp = &smc->os; CLI_FBI(); smt_reset_defaults(smc, 1); @@ -622,15 +620,15 @@ { struct net_device *dev = (struct net_device *) dev_id; struct s_smc *smc; /* private board structure pointer */ - skfddi_priv *bp = PRIV(dev); - + skfddi_priv *bp; if (dev == NULL) { printk("%s: irq %d for unknown device\n", dev->name, irq); return IRQ_NONE; } - smc = (struct s_smc *) dev->priv; + smc = netdev_priv(dev); + bp = &smc->os; // IRQs enabled or disabled ? if (inpd(ADDR(B0_IMSK)) == 0) { @@ -692,7 +690,7 @@ */ struct net_device_stats *skfp_ctl_get_stats(struct net_device *dev) { - struct s_smc *bp = (struct s_smc *) dev->priv; + struct s_smc *bp = netdev_priv(dev); /* Fill the bp->stats structure with driver-maintained counters */ @@ -856,7 +854,8 @@ */ static void skfp_ctl_set_multicast_list(struct net_device *dev) { - skfddi_priv *bp = PRIV(dev); + struct s_smc *smc = netdev_priv(dev); + skfddi_priv *bp = &smc->os; unsigned long Flags; spin_lock_irqsave(&bp->DriverLock, Flags); @@ -869,7 +868,7 @@ static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev) { - struct s_smc *smc = (struct s_smc *) dev->priv; + struct s_smc *smc = netdev_priv(dev); struct dev_mc_list *dmi; /* ptr to multicast addr entry */ int i; @@ -952,9 +951,9 @@ */ static int skfp_ctl_set_mac_address(struct net_device *dev, void *addr) { - struct s_smc *smc = (struct s_smc *) dev->priv; + struct s_smc *smc = netdev_priv(dev); struct sockaddr *p_sockaddr = (struct sockaddr *) addr; - skfddi_priv *bp = (skfddi_priv *) & smc->os; + skfddi_priv *bp = &smc->os; unsigned long Flags; @@ -992,12 +991,14 @@ static int skfp_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { - skfddi_priv *lp = PRIV(dev); + struct s_smc *smc = netdev_priv(dev); + skfddi_priv *lp = &smc->os; struct s_skfp_ioctl ioc; int status = 0; if (copy_from_user(&ioc, rq->ifr_data, sizeof(struct s_skfp_ioctl))) return -EFAULT; + switch (ioc.cmd) { case SKFP_GET_STATS: /* Get the driver statistics */ ioc.len = sizeof(lp->MacStat); @@ -1070,7 +1071,8 @@ */ static int skfp_send_pkt(struct sk_buff *skb, struct net_device *dev) { - skfddi_priv *bp = PRIV(dev); + struct s_smc *smc = netdev_priv(dev); + skfddi_priv *bp = &smc->os; PRINTK(KERN_INFO "skfp_send_pkt\n"); @@ -1097,7 +1099,7 @@ } bp->QueueSkb--; skb_queue_tail(&bp->SendSkbQueue, skb); - send_queued_packets((struct s_smc *) dev->priv); + send_queued_packets(netdev_priv(dev)); if (bp->QueueSkb == 0) { netif_stop_queue(dev); } @@ -1132,7 +1134,7 @@ */ static void send_queued_packets(struct s_smc *smc) { - skfddi_priv *bp = (skfddi_priv *) & smc->os; + skfddi_priv *bp = &smc->os; struct sk_buff *skb; unsigned char fc; int queue; @@ -1304,7 +1306,7 @@ ************************/ void llc_restart_tx(struct s_smc *smc) { - skfddi_priv *bp = (skfddi_priv *) & smc->os; + skfddi_priv *bp = &smc->os; PRINTK(KERN_INFO "[llc_restart_tx]\n"); @@ -1488,7 +1490,7 @@ * unmap first, the hardware module could read inconsistent data. */ if (flag & DMA_WR) { - skfddi_priv *bp = (skfddi_priv *) & smc->os; + skfddi_priv *bp = &smc->os; volatile struct s_smt_fp_rxd *r = &descr->r; /* If SKB is NULL, we used the local buffer. */ @@ -1602,7 +1604,7 @@ void mac_drv_rx_complete(struct s_smc *smc, volatile struct s_smt_fp_rxd *rxd, int frag_count, int len) { - skfddi_priv *bp = (skfddi_priv *) & smc->os; + skfddi_priv *bp = &smc->os; struct sk_buff *skb; unsigned char *virt, *cp; unsigned short ri; @@ -1734,7 +1736,7 @@ printk("fddi: Multi-fragment requeue!\n"); - MaxFrameSize = ((skfddi_priv *) & smc->os)->MaxFrameSize; + MaxFrameSize = smc->os.MaxFrameSize; src_rxd = rxd; for (; frag_count > 0; frag_count--) { next_rxd = src_rxd->rxd_next; @@ -1810,7 +1812,7 @@ // Walk through the list of free receive buffers, passing receive // buffers to the HWM as long as RXDs are available. - MaxFrameSize = ((skfddi_priv *) & smc->os)->MaxFrameSize; + MaxFrameSize = smc->os.MaxFrameSize; // Check if there is any RXD left. while (HWM_GET_RX_FREE(smc) > 0) { PRINTK(KERN_INFO ".\n"); @@ -1879,7 +1881,7 @@ for (; frag_count > 0; frag_count--) { skb = rxd->rxd_os.skb; if (skb != NULL) { - skfddi_priv *bp = (skfddi_priv *) & smc->os; + skfddi_priv *bp = &smc->os; int MaxFrameSize = bp->MaxFrameSize; pci_unmap_single(&bp->pdev, rxd->rxd_os.dma_addr, @@ -1946,7 +1948,7 @@ memcpy(skb->data, look_ahead, len); // deliver frame to system - skb->protocol = fddi_type_trans(skb, ((skfddi_priv *) & smc->os)->dev); + skb->protocol = fddi_type_trans(skb, smc->os.dev); skb->dev->last_rx = jiffies; netif_rx(skb); From dhollis@davehollis.com Tue Jan 11 11:52:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 11:52:42 -0800 (PST) Received: from pop-a065d01.pas.sa.earthlink.net (pop-a065d01.pas.sa.earthlink.net [207.217.121.248]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BJqaLH023421 for ; Tue, 11 Jan 2005 11:52:36 -0800 Received: from user-12hcjeo.cable.mindspring.com ([69.22.77.216] helo=bender.davehollis.com) by pop-a065d01.pas.sa.earthlink.net with esmtp (Exim 3.33 #1) id 1CoS4B-00057u-00; Tue, 11 Jan 2005 11:52:35 -0800 Received: from 10.8.0.6 ([10.8.0.6]) (authenticated bits=0) by bender.davehollis.com (8.13.1/8.12.11) with ESMTP id j0BJqSiP021965 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Tue, 11 Jan 2005 14:52:30 -0500 Subject: Re: [PATCH] tg3.h & b44.h ifndef ADVERTISE_PAUSE typo From: David Hollis To: Jeff Garzik Cc: Netdev In-Reply-To: <41E421A8.60203@pobox.com> References: <1105454553.4264.4.camel@dhollis-lnx.centricconsulting.com> <41E421A8.60203@pobox.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-Z1Tl4mtyEz8e79VuuZsu" Date: Tue, 11 Jan 2005 14:48:49 -0500 Message-Id: <1105472929.6599.3.camel@dhollis-lnx.centricconsulting.com> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) X-Scanned-By: MIMEDefang 2.49 on 10.8.0.1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 81 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dhollis@davehollis.com Precedence: bulk X-list: netdev --=-Z1Tl4mtyEz8e79VuuZsu Content-Type: multipart/mixed; boundary="=-LnWs+4xZV+zMM9Tt+HZm" --=-LnWs+4xZV+zMM9Tt+HZm Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2005-01-11 at 13:57 -0500, Jeff Garzik wrote: > Just kill the ifdef and add it to mii.h. >=20 > Jeff >=20 Attached patch moves those defines to mii.h and removes them from tg3.h & b44.h. --=20 David Hollis --=-LnWs+4xZV+zMM9Tt+HZm Content-Disposition: attachment; filename=mii-advert-pause.patch Content-Transfer-Encoding: base64 Content-Type: text/x-patch; name=mii-advert-pause.patch; charset=utf-8 QWRkIGRlZmluZXMgZm9yIGZ1bGwtZHVwbGV4IHBhdXNlIGFkdmVydGlzZW1lbnRzIGFuZCBjYXBh YmlsaXR5IHRvIG1paS5oDQphbmQgcmVtb3ZlIGluZGl2aWR1YWwgZGVmaW5lcyBpbiBuZXR3b3Jr IGRyaXZlcnMuDQoNClNpZ25lZC1vZmYtYnk6IERhdmlkIEhvbGxpcyA8ZGhvbGxpc0BkYXZlaG9s bGlzLmNvbT4NCg0KIGRyaXZlcnMvbmV0L2I0NC5oICAgfCAgIDE0IC0tLS0tLS0tLS0tLS0tDQog ZHJpdmVycy9uZXQvdGczLmggICB8ICAgMTQgLS0tLS0tLS0tLS0tLS0NCiBpbmNsdWRlL2xpbnV4 L21paS5oIHwgICAgNCArKysrDQogMyBmaWxlcyBjaGFuZ2VkLCA0IGluc2VydGlvbnMoKyksIDI4 IGRlbGV0aW9ucygtKQ0KDQotLS0gaW5jbHVkZS9saW51eC9taWkuaC5vcmlnCTIwMDUtMDEtMTEg MTQ6NDI6MjQuOTkyMzMwMzA0IC0wNTAwDQorKysgaW5jbHVkZS9saW51eC9taWkuaAkyMDA1LTAx LTExIDE0OjQxOjQ5LjQ5OTcyNjAwMCAtMDUwMA0KQEAgLTY3LDYgKzY3LDggQEANCiAjZGVmaW5l IEFEVkVSVElTRV8xMDBIQUxGICAgICAgIDB4MDA4MCAgLyogVHJ5IGZvciAxMDBtYnBzIGhhbGYt ZHVwbGV4ICovDQogI2RlZmluZSBBRFZFUlRJU0VfMTAwRlVMTCAgICAgICAweDAxMDAgIC8qIFRy eSBmb3IgMTAwbWJwcyBmdWxsLWR1cGxleCAqLw0KICNkZWZpbmUgQURWRVJUSVNFXzEwMEJBU0U0 ICAgICAgMHgwMjAwICAvKiBUcnkgZm9yIDEwMG1icHMgNGsgcGFja2V0cyAgKi8NCisjZGVmaW5l IEFEVkVSVElTRV9QQVVTRV9DQVAJMHgwNDAwICAvKiBUcnkgZm9yIHBhdXNlICAgICAgICAgICAg ICAgKi8NCisjZGVmaW5lIEFEVkVSVElTRV9QQVVTRV9BU1lNCTB4MDgwMCAgLyogVHJ5IGZvciBh c3ltZXRyaWMgcGF1c2UgICAgICovDQogI2RlZmluZSBBRFZFUlRJU0VfUkVTViAgICAgICAgICAw eDFjMDAgIC8qIFVudXNlZC4uLiAgICAgICAgICAgICAgICAgICAqLw0KICNkZWZpbmUgQURWRVJU SVNFX1JGQVVMVCAgICAgICAgMHgyMDAwICAvKiBTYXkgd2UgY2FuIGRldGVjdCBmYXVsdHMgICAg Ki8NCiAjZGVmaW5lIEFEVkVSVElTRV9MUEFDSyAgICAgICAgIDB4NDAwMCAgLyogQWNrIGxpbmsg cGFydG5lcnMgcmVzcG9uc2UgICovDQpAQCAtODQsNiArODYsOCBAQA0KICNkZWZpbmUgTFBBXzEw MEhBTEYgICAgICAgICAgICAgMHgwMDgwICAvKiBDYW4gZG8gMTAwbWJwcyBoYWxmLWR1cGxleCAg Ki8NCiAjZGVmaW5lIExQQV8xMDBGVUxMICAgICAgICAgICAgIDB4MDEwMCAgLyogQ2FuIGRvIDEw MG1icHMgZnVsbC1kdXBsZXggICovDQogI2RlZmluZSBMUEFfMTAwQkFTRTQgICAgICAgICAgICAw eDAyMDAgIC8qIENhbiBkbyAxMDBtYnBzIDRrIHBhY2tldHMgICAqLw0KKyNkZWZpbmUgTFBBX1BB VVNFX0NBUAkJMHgwNDAwICAvKiBDYW4gcGF1c2UgICAgICAgICAgICAgICAgICAgKi8NCisjZGVm aW5lIExQQV9QQVVTRV9BU1lNCQkweDA4MDAJLyogQ2FuIHBhdXNlIGFzeW1ldHJpY2FsbHkgICAg ICovDQogI2RlZmluZSBMUEFfUkVTViAgICAgICAgICAgICAgICAweDFjMDAgIC8qIFVudXNlZC4u LiAgICAgICAgICAgICAgICAgICAqLw0KICNkZWZpbmUgTFBBX1JGQVVMVCAgICAgICAgICAgICAg MHgyMDAwICAvKiBMaW5rIHBhcnRuZXIgZmF1bHRlZCAgICAgICAgKi8NCiAjZGVmaW5lIExQQV9M UEFDSyAgICAgICAgICAgICAgIDB4NDAwMCAgLyogTGluayBwYXJ0bmVyIGFja2VkIHVzICAgICAg ICovDQotLS0gZHJpdmVycy9uZXQvYjQ0Lmgub3JpZwkyMDA1LTAxLTExIDA5OjM0OjM5LjAwMDAw MDAwMCAtMDUwMA0KKysrIGRyaXZlcnMvbmV0L2I0NC5oCTIwMDUtMDEtMTEgMTQ6MzY6NDMuMzcy MjY0NDQ4IC0wNTAwDQpAQCAtMzAyLDIwICszMDIsNiBAQA0KICNkZWZpbmUgQjQ0X01JSV9UTEVE Q1RSTAkyNwkvKiBUcmFmZmljIE1ldGVyIExFRCAqLw0KICNkZWZpbmUgIE1JSV9UTEVEQ1RSTF9F TkFCTEUJMHgwMDQwDQogDQotLyogWFhYIEFkZCB0aGlzIHRvIG1paS5oICovDQotI2lmbmRlZiBB RFZFUlRJU0VfUEFVU0UNCi0jZGVmaW5lIEFEVkVSVElTRV9QQVVTRV9DQVAJCTB4MDQwMA0KLSNl bmRpZg0KLSNpZm5kZWYgQURWRVJUSVNFX1BBVVNFX0FTWU0NCi0jZGVmaW5lIEFEVkVSVElTRV9Q QVVTRV9BU1lNCQkweDA4MDANCi0jZW5kaWYNCi0jaWZuZGVmIExQQV9QQVVTRQ0KLSNkZWZpbmUg TFBBX1BBVVNFX0NBUAkJCTB4MDQwMA0KLSNlbmRpZg0KLSNpZm5kZWYgTFBBX1BBVVNFX0FTWU0N Ci0jZGVmaW5lIExQQV9QQVVTRV9BU1lNCQkJMHgwODAwDQotI2VuZGlmDQotDQogc3RydWN0IGRt YV9kZXNjIHsNCiAJdTMyCWN0cmw7DQogCXUzMglhZGRyOw0KLS0tIGRyaXZlcnMvbmV0L3RnMy5o Lm9yaWcJMjAwNS0wMS0xMSAwOTozNDo0My4wMDAwMDAwMDAgLTA1MDANCisrKyBkcml2ZXJzL25l dC90ZzMuaAkyMDA1LTAxLTExIDE0OjM2OjU0LjE2OTYyMzAwMCAtMDUwMA0KQEAgLTE1MzEsMjAg KzE1MzEsNiBAQA0KICNkZWZpbmUgTUlJX1RHM19JTlRfRFVQTEVYQ0hHCQkweDAwMDgNCiAjZGVm aW5lIE1JSV9URzNfSU5UX0FORUdfUEFHRV9SWAkweDA0MDANCiANCi0vKiBYWFggQWRkIHRoaXMg dG8gbWlpLmggKi8NCi0jaWZuZGVmIEFEVkVSVElTRV9QQVVTRQ0KLSNkZWZpbmUgQURWRVJUSVNF X1BBVVNFX0NBUAkJMHgwNDAwDQotI2VuZGlmDQotI2lmbmRlZiBBRFZFUlRJU0VfUEFVU0VfQVNZ TQ0KLSNkZWZpbmUgQURWRVJUSVNFX1BBVVNFX0FTWU0JCTB4MDgwMA0KLSNlbmRpZg0KLSNpZm5k ZWYgTFBBX1BBVVNFDQotI2RlZmluZSBMUEFfUEFVU0VfQ0FQCQkJMHgwNDAwDQotI2VuZGlmDQot I2lmbmRlZiBMUEFfUEFVU0VfQVNZTQ0KLSNkZWZpbmUgTFBBX1BBVVNFX0FTWU0JCQkweDA4MDAN Ci0jZW5kaWYNCi0NCiAvKiBUaGVyZSBhcmUgdHdvIHdheXMgdG8gbWFuYWdlIHRoZSBUWCBkZXNj cmlwdG9ycyBvbiB0aGUgdGlnb24zLg0KICAqIEVpdGhlciB0aGUgZGVzY3JpcHRvcnMgYXJlIGlu IGhvc3QgRE1BJ2FibGUgbWVtb3J5LCBvciB0aGV5DQogICogZXhpc3Qgb25seSBpbiB0aGUgY2Fy ZHMgb24tY2hpcCBTUkFNLiAgQWxsIDE2IHNlbmQgYmRzIGFyZSB1bmRlcg0K --=-LnWs+4xZV+zMM9Tt+HZm-- --=-Z1Tl4mtyEz8e79VuuZsu Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQBB5C2hxasLqOyGHncRAj+0AJ0QQAs62O6wnOreK883pmuoW7pWyQCfb6jF 7kotOhPQXns/nfu3uYySsmg= =4ejc -----END PGP SIGNATURE----- --=-Z1Tl4mtyEz8e79VuuZsu-- From pb@bieringer.de Tue Jan 11 11:56:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 11:56:57 -0800 (PST) Received: from smtp2.aerasec.de (gromit.aerasec.de [195.226.187.57]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BJuleU023922 for ; Tue, 11 Jan 2005 11:56:47 -0800 Received: from localhost (localhost [127.0.0.1]) by smtp2.aerasec.de (Postfix) with SMTP id 506CA137EE; Tue, 11 Jan 2005 20:56:41 +0100 (CET) X-AV-Checked: Tue Jan 11 20:56:41 2005 smtp2.aerasec.de Received: from [192.168.1.2] (p54800BF3.dip.t-dialin.net [84.128.11.243]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client did not present a certificate) by smtp2.aerasec.de (Postfix) with ESMTP id B1CDF137EA; Tue, 11 Jan 2005 20:56:37 +0100 (CET) Date: Tue, 11 Jan 2005 20:56:35 +0100 From: Peter Bieringer To: usagi-users@linux-ipv6.org Cc: yasuyuki.kozakai@toshiba.co.jp, netdev@oss.sgi.com, laforge@gnumonks.org, kaber@trash.net, netfilter-devel@lists.netfilter.org Subject: Re: (usagi-users 03190) Re: netfilter6: ICMPv6 type 143 doesn't match Message-ID: <60EEE488578EBAD1D9924A43@worker.muc.bieringer.de> In-Reply-To: <20050110131709.GB16911@suse.de> References: <6050E336B1A0D7D8E70C66F3@t1mobil.muc.aerasec.de> <200412270417.iBR4HZRG021429@toshiba.co.jp> <20041227.100205.102356251.yoshfuji@linux-ipv6.org> <20050110131709.GB16911@suse.de> X-Mailer: Mulberry/3.1.6 (Linux/x86) X-URL: http://www.bieringer.de/pb/ X-OS: Linux MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 82 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pb@bieringer.de Precedence: bulk X-list: netdev --On Monday, January 10, 2005 02:17:09 PM +0100 Olaf Kirch wrote: > On Sat, Jan 08, 2005 at 12:45:14PM +0100, Peter Bieringer wrote: >> - ptr = IPV6_HDR_LEN; >> + ptr = ((u8*)skb->nh.raw - skb->data) + IPV6_HDR_LEN; > [...] >> But it won't help :-(( > > The following works for me on 2.6.8: > > ptr = ((char *) ipv6 - (char *) skb->data) + IPV6_HDR_LEN; > > Older 2.6 kernels also do not call ipv6_skip_exthdr() in icmp6_match(); > more recent kernels fix this. > > Olaf I'll be very happy now that I can report that on a recompiled 2.6.10 (latest Fedora Core 3 update), this patch works for me. I will file a RH bugzilla entry for that and the esp match problem. Thank you all very much for helping! Peter -- Dr. Peter Bieringer http://www.bieringer.de/pb/ GPG/PGP Key 0x958F422D mailto: pb at bieringer dot de Deep Space 6 Co-Founder and Core Member http://www.deepspace6.net/ From jgarzik@pobox.com Tue Jan 11 12:07:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 12:07:24 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BK7Jov024955 for ; Tue, 11 Jan 2005 12:07:19 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CoSIP-0004iH-Lq; Tue, 11 Jan 2005 20:07:17 +0000 Message-ID: <41E431F1.8040401@pobox.com> Date: Tue, 11 Jan 2005 15:07:13 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Hollis CC: Netdev , "David S. Miller" Subject: Re: [PATCH] tg3.h & b44.h ifndef ADVERTISE_PAUSE typo References: <1105454553.4264.4.camel@dhollis-lnx.centricconsulting.com> <41E421A8.60203@pobox.com> <1105472929.6599.3.camel@dhollis-lnx.centricconsulting.com> In-Reply-To: <1105472929.6599.3.camel@dhollis-lnx.centricconsulting.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 83 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev David Hollis wrote: > On Tue, 2005-01-11 at 13:57 -0500, Jeff Garzik wrote: > > >>Just kill the ifdef and add it to mii.h. >> >> Jeff >> > > > Attached patch moves those defines to mii.h and removes them from tg3.h > & b44.h. ACK, I'll merge this up David... Jeff From herbert@gondor.apana.org.au Tue Jan 11 12:37:45 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 12:37:52 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BKbhaX029440 for ; Tue, 11 Jan 2005 12:37:44 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CoSlQ-0000fO-00; Wed, 12 Jan 2005 07:37:16 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CoSkn-00058Z-00; Wed, 12 Jan 2005 07:36:37 +1100 From: Herbert Xu To: wichert@wiggy.net (Wichert Akkerman) Subject: Re: ipv6 tunnel stops accepting input Cc: netdev@oss.sgi.com Organization: Core In-Reply-To: <20050111125826.GA25169@wiggy.net> X-Newsgroups: apana.lists.os.linux.netdev User-Agent: tin/1.7.4-20040225 ("Benbecula") (UNIX) (Linux/2.4.27-hx-1-686-smp (i686)) Message-Id: Date: Wed, 12 Jan 2005 07:36:37 +1100 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 84 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Wichert Akkerman wrote: > > but once I do a ping6 from my machine to the outside world: > > 13:39:53.264393 IP home.wiggy.net > ipv6-tb.xs4all.net: tunnel29.ipv6.xs4all.nl > irc.ipv6.xs4all.nl: icmp6: echo request seq 1 > 13:39:53.299071 IP ipv6-tb.xs4all.net > home.wiggy.net: irc.ipv6.xs4all.nl > tunnel29.ipv6.xs4all.nl: icmp6: echo reply seq 1 > > the tunnel suddenly accepts incoming traffic: Do you have any netfilter rules? -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From akepner@sgi.com Tue Jan 11 12:49:56 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 12:50:01 -0800 (PST) Received: from omx1.americas.sgi.com (omx1-ext.sgi.com [192.48.179.11]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BKnt8Y030093 for ; Tue, 11 Jan 2005 12:49:55 -0800 Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) by omx1.americas.sgi.com (8.12.10/8.12.9/linux-outbound_gateway-1.1) with ESMTP id j0BKnsxT005821 for ; Tue, 11 Jan 2005 14:49:54 -0600 Received: from [192.168.2.20] (IDENT:akepner@mtv-vpn-sw-corp-0-74.corp.sgi.com [134.15.0.74]) by cthulhu.engr.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id j0BKnqtX7609310; Tue, 11 Jan 2005 12:49:53 -0800 (PST) Date: Tue, 11 Jan 2005 12:49:05 -0600 (CST) From: "Arthur D. Kepner" X-Sender: akepner@localhost.localdomain To: "David S. Miller" , jgarzik@pobox.com cc: netdev@oss.sgi.com Subject: Re: [PATCH bk-2.6.10] tg3:align IP headers from 5701 in PCI-X mode Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 85 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akepner@sgi.com Precedence: bulk X-list: netdev (Resend. Local clock was off and my archived reply appears to have been generated prior to the message to which I was responding.... ) On Mon, 10 Jan 2005, David S. Miller wrote: > Let's just do this all the time for this case, adding new config > options for stuff like this does nothing more than create confusion. OK, you mean like the following? diffstats: tg3.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletion(-) Signed-off-by: Arthur Kepner ===== drivers/net/tg3.c 1.222 vs edited ===== --- 1.222/drivers/net/tg3.c 2004-11-15 15:53:08 -08:00 +++ edited/drivers/net/tg3.c 2005-01-10 13:35:33 -08:00 @@ -2702,7 +2702,11 @@ static int tg3_rx(struct tg3 *tp, int bu len = ((desc->idx_len & RXD_LEN_MASK) >> RXD_LEN_SHIFT) - 4; /* omit crc */ - if (len > RX_COPY_THRESHOLD) { + if (len > RX_COPY_THRESHOLD + && tp->rx_offset == 2 + /* rx_offset != 2 iff this is a 5701 card running + * in PCI-X mode [see tg3_get_invariants()] */ + ) { int skb_size; skb_size = tg3_alloc_rx_skb(tp, opaque_key, -- Arthur From tommy.christensen@tpack.net Tue Jan 11 13:24:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 13:24:46 -0800 (PST) Received: from mail.tpack.net (ip18.tpack.net [213.173.228.18]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0BLOewJ031361 for ; Tue, 11 Jan 2005 13:24:41 -0800 Received: (qmail 16589 invoked from network); 11 Jan 2005 21:24:34 -0000 Received: from dhcp-162.cph.tpack.net (HELO ?172.17.159.11?) (192.168.0.162) by 0 with SMTP; 11 Jan 2005 21:24:34 -0000 Message-ID: <41E44476.20303@tpack.net> Date: Tue, 11 Jan 2005 22:26:14 +0100 From: Tommy Christensen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Simon Roscic CC: netdev@oss.sgi.com Subject: Re: Fwd: [2.6] ethertap and af_inet.c assertion failures References: <200412240002.13206.simon.roscic@chello.at> In-Reply-To: <200412240002.13206.simon.roscic@chello.at> Content-Type: multipart/mixed; boundary="------------080702090203030807050209" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 86 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tommy.christensen@tpack.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------080702090203030807050209 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Simon Roscic wrote: > hi, > > today i upgraded my kernel from 2.6.9-rc2 to 2.6.10-rc3-bk12, now i get the > following assertion failures while using the (closed source) phion vpn > client, the vpn client uses ethertap, there are no closed source kernel > modules or the like: > > KERNEL: assertion (!atomic_read(&sk->sk_wmem_alloc)) failed at > net/ipv4/af_inet.c (150) netlink has messed up the send buffer accounting, when trimming a skb. Patch below should fix this for ethertap. Could you give it a try? -Tommy --------------080702090203030807050209 Content-Type: text/plain; name="ethertap.c.patch" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="ethertap.c.patch" LS0tIGxpbnV4LTIuNi4xMC1iazE0L2RyaXZlcnMvbmV0L2V0aGVydGFwLmMJMjAwNC0xMi0y NCAyMjozNDoyNi4wMDAwMDAwMDAgKzAxMDAKKysrIGxpbnV4LTIuNi4xMC13b3JrL2RyaXZl cnMvbmV0L2V0aGVydGFwLmMJMjAwNS0wMS0xMSAyMjoxODoxOS4xMTMyOTUzMjQgKzAxMDAK QEAgLTIwNyw4ICsyMDcsOCBAQAogCQkJcmV0dXJuIDA7CiAJCX0KIAkgIAlkZXZfa2ZyZWVf c2tiKHNrYjIpOwotCX0KLQkvKiAuLi4gYnV0IGRvIG5vdCBvcnBoYW4gaXQgaGVyZSwgbmV0 bGluayBkb2VzIGl0IGluIGFueSBjYXNlLiAqLworCX0gZWxzZQorCQlza2Jfb3JwaGFuKHNr Yik7CiAKIAlscC0+c3RhdHMudHhfYnl0ZXMrPXNrYi0+bGVuOwogCWxwLT5zdGF0cy50eF9w YWNrZXRzKys7Cg== --------------080702090203030807050209-- From kaber@trash.net Tue Jan 11 13:26:52 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 13:26:59 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BLQqIl031855 for ; Tue, 11 Jan 2005 13:26:52 -0800 Received: from [127.0.0.1] (helo=[127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CoTCX-00013p-3Q; Tue, 11 Jan 2005 22:05:17 +0100 Message-ID: <41E43F83.1090503@trash.net> Date: Tue, 11 Jan 2005 22:05:07 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: Thomas Graf CC: "David S. Miller" , Herbert Xu , netdev@oss.sgi.com Subject: Re: request_module while holding rtnl semaphore References: <41899DCF.3050804@trash.net> <20041109161126.376f755c.davem@davemloft.net> <41E34252.504@trash.net> <20050111094752.GD26856@postel.suug.ch> In-Reply-To: <20050111094752.GD26856@postel.suug.ch> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 87 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Thomas Graf wrote: >* Patrick McHardy <41E34252.504@trash.net> 2005-01-11 04:04 > >>This patch got lost somehow. The act_api.c changes are actually >>even more complicated because besides the action init path, changes >>can also be made from classifiers in a deep call-chain. I hope >>Thomas's recent changes make it easier to fix this, but I think >>this patch should go in now anyway. >> > >The action initialization is now done first and no classifier >data is changed except for tp->root modifications which must not >be undone so you can safely return EBUSY. rsvp might be an exception, >I haven't looked too closely into it yet. > >tcindex returns EBUSY when a filter is changed which does not fit >into the hashtable, so this must be changed. > It's -EAGAIN, so no problem, nothing returns this currently. I'm going to send a patch later. Regards Patrick From kaber@trash.net Tue Jan 11 13:46:27 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 13:46:34 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BLkQuF000401 for ; Tue, 11 Jan 2005 13:46:27 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CoTqG-00013y-Hb; Tue, 11 Jan 2005 22:46:20 +0100 Message-ID: <41E4492C.7050703@trash.net> Date: Tue, 11 Jan 2005 22:46:20 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: Maillist netdev Subject: [PATCH PKT_SCHED 2/6]: Fix memory leaks in cls_u32.c error path Content-Type: multipart/mixed; boundary="------------080407090209000003070504" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 90 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------080407090209000003070504 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------080407090209000003070504 Content-Type: text/x-patch; name="02.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="02.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/11 20:25:26+01:00 kaber@coreworks.de # [PKT_SCHED]: Fix memory leaks in cls_u32.c error path # # Also silence an unused-variable warning when CONFIG_CLS_U32_MARK is not set. # # Signed-off-by: Patrick McHardy # # net/sched/cls_u32.c # 2005/01/11 20:25:16+01:00 kaber@coreworks.de +11 -5 # [PKT_SCHED]: Fix memory leaks in cls_u32.c error path # # Also silence an unused-variable warning when CONFIG_CLS_U32_MARK is not set. # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/cls_u32.c b/net/sched/cls_u32.c --- a/net/sched/cls_u32.c 2005-01-11 22:32:10 +01:00 +++ b/net/sched/cls_u32.c 2005-01-11 22:32:10 +01:00 @@ -549,7 +549,6 @@ struct tc_u_hnode *ht; struct tc_u_knode *n; struct tc_u32_sel *s; - struct tc_u32_mark *mark; struct rtattr *opt = tca[TCA_OPTIONS-1]; struct rtattr *tb[TCA_U32_MAX]; u32 htid; @@ -654,15 +653,22 @@ n->fshift = i; } -#ifdef CONFIG_CLS_U32_MARK +#ifdef CONFIG_CLS_U32_MARK if (tb[TCA_U32_MARK-1]) { - if (RTA_PAYLOAD(tb[TCA_U32_MARK-1]) < sizeof(struct tc_u32_mark)) + struct tc_u32_mark *mark; + + if (RTA_PAYLOAD(tb[TCA_U32_MARK-1]) < sizeof(struct tc_u32_mark)) { +#ifdef CONFIG_CLS_U32_PERF + kfree(n->pf); +#endif + kfree(n); return -EINVAL; + } mark = RTA_DATA(tb[TCA_U32_MARK-1]); memcpy(&n->mark, mark, sizeof(struct tc_u32_mark)); n->mark.success = 0; - } -#endif + } +#endif err = u32_set_parms(tp, base, ht, n, tb, tca[TCA_RATE-1]); if (err == 0) { --------------080407090209000003070504-- From kaber@trash.net Tue Jan 11 13:46:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 13:46:32 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BLkNRT000391 for ; Tue, 11 Jan 2005 13:46:24 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CoTqE-00013u-Dh; Tue, 11 Jan 2005 22:46:18 +0100 Message-ID: <41E4492A.8060601@trash.net> Date: Tue, 11 Jan 2005 22:46:18 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: Maillist netdev Subject: [PATCH PKT_SCHED 1/6]: Use rtattr_parse_nested where appropriate Content-Type: multipart/mixed; boundary="------------090704050901070002070602" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 89 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------090704050901070002070602 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------090704050901070002070602 Content-Type: text/x-patch; name="01.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="01.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/11 20:24:08+01:00 kaber@coreworks.de # [PKT_SCHED]: Use rtattr_parse_nested where appropriate # # Signed-off-by: Patrick McHardy # # net/sched/sch_tbf.c # 2005/01/11 20:24:00+01:00 kaber@coreworks.de +1 -1 # [PKT_SCHED]: Use rtattr_parse_nested where appropriate # # Signed-off-by: Patrick McHardy # # net/sched/sch_red.c # 2005/01/11 20:24:00+01:00 kaber@coreworks.de +1 -1 # [PKT_SCHED]: Use rtattr_parse_nested where appropriate # # Signed-off-by: Patrick McHardy # # net/sched/sch_htb.c # 2005/01/11 20:24:00+01:00 kaber@coreworks.de +2 -2 # [PKT_SCHED]: Use rtattr_parse_nested where appropriate # # Signed-off-by: Patrick McHardy # # net/sched/sch_hfsc.c # 2005/01/11 20:24:00+01:00 kaber@coreworks.de +1 -2 # [PKT_SCHED]: Use rtattr_parse_nested where appropriate # # Signed-off-by: Patrick McHardy # # net/sched/sch_gred.c # 2005/01/11 20:24:00+01:00 kaber@coreworks.de +6 -9 # [PKT_SCHED]: Use rtattr_parse_nested where appropriate # # Signed-off-by: Patrick McHardy # # net/sched/sch_dsmark.c # 2005/01/11 20:24:00+01:00 kaber@coreworks.de +1 -2 # [PKT_SCHED]: Use rtattr_parse_nested where appropriate # # Signed-off-by: Patrick McHardy # # net/sched/sch_cbq.c # 2005/01/11 20:24:00+01:00 kaber@coreworks.de +2 -3 # [PKT_SCHED]: Use rtattr_parse_nested where appropriate # # Signed-off-by: Patrick McHardy # # net/sched/sch_atm.c # 2005/01/11 20:24:00+01:00 kaber@coreworks.de +2 -2 # [PKT_SCHED]: Use rtattr_parse_nested where appropriate # # Signed-off-by: Patrick McHardy # # net/sched/police.c # 2005/01/11 20:24:00+01:00 kaber@coreworks.de +2 -4 # [PKT_SCHED]: Use rtattr_parse_nested where appropriate # # Signed-off-by: Patrick McHardy # # net/sched/pedit.c # 2005/01/11 20:24:00+01:00 kaber@coreworks.de +1 -2 # [PKT_SCHED]: Use rtattr_parse_nested where appropriate # # Signed-off-by: Patrick McHardy # # net/sched/mirred.c # 2005/01/11 20:24:00+01:00 kaber@coreworks.de +1 -2 # [PKT_SCHED]: Use rtattr_parse_nested where appropriate # # Signed-off-by: Patrick McHardy # # net/sched/ipt.c # 2005/01/11 20:24:00+01:00 kaber@coreworks.de +1 -2 # [PKT_SCHED]: Use rtattr_parse_nested where appropriate # # Signed-off-by: Patrick McHardy # # net/sched/gact.c # 2005/01/11 20:24:00+01:00 kaber@coreworks.de +1 -2 # [PKT_SCHED]: Use rtattr_parse_nested where appropriate # # Signed-off-by: Patrick McHardy # # net/sched/act_api.c # 2005/01/11 20:24:00+01:00 kaber@coreworks.de +5 -8 # [PKT_SCHED]: Use rtattr_parse_nested where appropriate # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/act_api.c b/net/sched/act_api.c --- a/net/sched/act_api.c 2005-01-11 22:32:05 +01:00 +++ b/net/sched/act_api.c 2005-01-11 22:32:05 +01:00 @@ -279,8 +279,7 @@ *err = -EINVAL; if (name == NULL) { - if (rtattr_parse(tb, TCA_ACT_MAX, RTA_DATA(rta), - RTA_PAYLOAD(rta)) < 0) + if (rtattr_parse_nested(tb, TCA_ACT_MAX, rta) < 0) goto err_out; kind = tb[TCA_ACT_KIND-1]; if (kind == NULL) @@ -344,8 +343,7 @@ struct tc_action *head = NULL, *act, *act_prev = NULL; int i; - if (rtattr_parse(tb, TCA_ACT_MAX_PRIO, RTA_DATA(rta), - RTA_PAYLOAD(rta)) < 0) { + if (rtattr_parse_nested(tb, TCA_ACT_MAX_PRIO, rta) < 0) { *err = -EINVAL; return head; } @@ -467,7 +465,7 @@ int index; *err = -EINVAL; - if (rtattr_parse(tb, TCA_ACT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0) + if (rtattr_parse_nested(tb, TCA_ACT_MAX, rta) < 0) return NULL; if (tb[TCA_ACT_INDEX - 1] == NULL || @@ -552,7 +550,7 @@ b = (unsigned char *)skb->tail; - if (rtattr_parse(tb, TCA_ACT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0) + if (rtattr_parse_nested(tb, TCA_ACT_MAX, rta) < 0) goto err_out; kind = tb[TCA_ACT_KIND-1]; @@ -599,8 +597,7 @@ struct rtattr *tb[TCA_ACT_MAX_PRIO+1]; struct tc_action *head = NULL, *act, *act_prev = NULL; - if (rtattr_parse(tb, TCA_ACT_MAX_PRIO, RTA_DATA(rta), - RTA_PAYLOAD(rta)) < 0) + if (rtattr_parse_nested(tb, TCA_ACT_MAX_PRIO, rta) < 0) return -EINVAL; if (event == RTM_DELACTION && n->nlmsg_flags&NLM_F_ROOT) { diff -Nru a/net/sched/gact.c b/net/sched/gact.c --- a/net/sched/gact.c 2005-01-11 22:32:05 +01:00 +++ b/net/sched/gact.c 2005-01-11 22:32:05 +01:00 @@ -79,8 +79,7 @@ struct tcf_gact *p; int ret = 0; - if (rta == NULL || - rtattr_parse(tb, TCA_GACT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0) + if (rta == NULL || rtattr_parse_nested(tb, TCA_GACT_MAX, rta) < 0) return -EINVAL; if (tb[TCA_GACT_PARMS - 1] == NULL || diff -Nru a/net/sched/ipt.c b/net/sched/ipt.c --- a/net/sched/ipt.c 2005-01-11 22:32:05 +01:00 +++ b/net/sched/ipt.c 2005-01-11 22:32:05 +01:00 @@ -122,8 +122,7 @@ u32 hook = 0; u32 index = 0; - if (rta == NULL || - rtattr_parse(tb, TCA_IPT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0) + if (rta == NULL || rtattr_parse_nested(tb, TCA_IPT_MAX, rta) < 0) return -EINVAL; if (tb[TCA_IPT_HOOK-1] == NULL || diff -Nru a/net/sched/mirred.c b/net/sched/mirred.c --- a/net/sched/mirred.c 2005-01-11 22:32:05 +01:00 +++ b/net/sched/mirred.c 2005-01-11 22:32:05 +01:00 @@ -84,8 +84,7 @@ int ret = 0; int ok_push = 0; - if (rta == NULL || rtattr_parse(tb, TCA_MIRRED_MAX, RTA_DATA(rta), - RTA_PAYLOAD(rta)) < 0) + if (rta == NULL || rtattr_parse_nested(tb, TCA_MIRRED_MAX, rta) < 0) return -EINVAL; if (tb[TCA_MIRRED_PARMS-1] == NULL || diff -Nru a/net/sched/pedit.c b/net/sched/pedit.c --- a/net/sched/pedit.c 2005-01-11 22:32:05 +01:00 +++ b/net/sched/pedit.c 2005-01-11 22:32:05 +01:00 @@ -63,8 +63,7 @@ struct tc_pedit_key *keys = NULL; int ksize; - if (rta == NULL || rtattr_parse(tb, TCA_PEDIT_MAX, RTA_DATA(rta), - RTA_PAYLOAD(rta)) < 0) + if (rta == NULL || rtattr_parse_nested(tb, TCA_PEDIT_MAX, rta) < 0) return -EINVAL; if (tb[TCA_PEDIT_PARMS - 1] == NULL || diff -Nru a/net/sched/police.c b/net/sched/police.c --- a/net/sched/police.c 2005-01-11 22:32:05 +01:00 +++ b/net/sched/police.c 2005-01-11 22:32:05 +01:00 @@ -171,8 +171,7 @@ struct tcf_police *p; struct qdisc_rate_table *R_tab = NULL, *P_tab = NULL; - if (rta == NULL || rtattr_parse(tb, TCA_POLICE_MAX, RTA_DATA(rta), - RTA_PAYLOAD(rta)) < 0) + if (rta == NULL || rtattr_parse_nested(tb, TCA_POLICE_MAX, rta) < 0) return -EINVAL; if (tb[TCA_POLICE_TBF-1] == NULL || @@ -417,8 +416,7 @@ struct rtattr *tb[TCA_POLICE_MAX]; struct tc_police *parm; - if (rtattr_parse(tb, TCA_POLICE_MAX, RTA_DATA(rta), - RTA_PAYLOAD(rta)) < 0) + if (rtattr_parse_nested(tb, TCA_POLICE_MAX, rta) < 0) return NULL; if (tb[TCA_POLICE_TBF-1] == NULL || diff -Nru a/net/sched/sch_atm.c b/net/sched/sch_atm.c --- a/net/sched/sch_atm.c 2005-01-11 22:32:05 +01:00 +++ b/net/sched/sch_atm.c 2005-01-11 22:32:05 +01:00 @@ -255,8 +255,8 @@ * later.) */ if (flow) return -EBUSY; - if (opt == NULL || rtattr_parse(tb,TCA_ATM_MAX,RTA_DATA(opt), - RTA_PAYLOAD(opt))) return -EINVAL; + if (opt == NULL || rtattr_parse_nested(tb, TCA_ATM_MAX, opt)) + return -EINVAL; if (!tb[TCA_ATM_FD-1] || RTA_PAYLOAD(tb[TCA_ATM_FD-1]) < sizeof(fd)) return -EINVAL; fd = *(int *) RTA_DATA(tb[TCA_ATM_FD-1]); diff -Nru a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c --- a/net/sched/sch_cbq.c 2005-01-11 22:32:05 +01:00 +++ b/net/sched/sch_cbq.c 2005-01-11 22:32:05 +01:00 @@ -1439,7 +1439,7 @@ struct rtattr *tb[TCA_CBQ_MAX]; struct tc_ratespec *r; - if (rtattr_parse(tb, TCA_CBQ_MAX, RTA_DATA(opt), RTA_PAYLOAD(opt)) < 0 || + if (rtattr_parse_nested(tb, TCA_CBQ_MAX, opt) < 0 || tb[TCA_CBQ_RTAB-1] == NULL || tb[TCA_CBQ_RATE-1] == NULL || RTA_PAYLOAD(tb[TCA_CBQ_RATE-1]) < sizeof(struct tc_ratespec)) return -EINVAL; @@ -1824,8 +1824,7 @@ struct cbq_class *parent; struct qdisc_rate_table *rtab = NULL; - if (opt==NULL || - rtattr_parse(tb, TCA_CBQ_MAX, RTA_DATA(opt), RTA_PAYLOAD(opt))) + if (opt==NULL || rtattr_parse_nested(tb, TCA_CBQ_MAX, opt)) return -EINVAL; if (tb[TCA_CBQ_OVL_STRATEGY-1] && diff -Nru a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c --- a/net/sched/sch_dsmark.c 2005-01-11 22:32:05 +01:00 +++ b/net/sched/sch_dsmark.c 2005-01-11 22:32:05 +01:00 @@ -125,8 +125,7 @@ "arg 0x%lx\n",sch,p,classid,parent,*arg); if (*arg > p->indices) return -ENOENT; - if (!opt || rtattr_parse(tb, TCA_DSMARK_MAX, RTA_DATA(opt), - RTA_PAYLOAD(opt))) + if (!opt || rtattr_parse_nested(tb, TCA_DSMARK_MAX, opt)) return -EINVAL; if (tb[TCA_DSMARK_MASK-1]) { if (!RTA_PAYLOAD(tb[TCA_DSMARK_MASK-1])) diff -Nru a/net/sched/sch_gred.c b/net/sched/sch_gred.c --- a/net/sched/sch_gred.c 2005-01-11 22:32:05 +01:00 +++ b/net/sched/sch_gred.c 2005-01-11 22:32:05 +01:00 @@ -332,13 +332,11 @@ struct rtattr *tb2[TCA_GRED_DPS]; int i; - if (opt == NULL || - rtattr_parse(tb, TCA_GRED_STAB, RTA_DATA(opt), RTA_PAYLOAD(opt)) ) - return -EINVAL; + if (opt == NULL || rtattr_parse_nested(tb, TCA_GRED_STAB, opt)) + return -EINVAL; if (tb[TCA_GRED_PARMS-1] == 0 && tb[TCA_GRED_STAB-1] == 0) { - rtattr_parse(tb2, TCA_GRED_DPS, RTA_DATA(opt), - RTA_PAYLOAD(opt)); + rtattr_parse_nested(tb2, TCA_GRED_DPS, opt); if (tb2[TCA_GRED_DPS-1] == 0) return -EINVAL; @@ -475,12 +473,11 @@ struct rtattr *tb[TCA_GRED_STAB]; struct rtattr *tb2[TCA_GRED_DPS]; - if (opt == NULL || - rtattr_parse(tb, TCA_GRED_STAB, RTA_DATA(opt), RTA_PAYLOAD(opt)) ) - return -EINVAL; + if (opt == NULL || rtattr_parse_nested(tb, TCA_GRED_STAB, opt)) + return -EINVAL; if (tb[TCA_GRED_PARMS-1] == 0 && tb[TCA_GRED_STAB-1] == 0) { - rtattr_parse(tb2, TCA_GRED_DPS, RTA_DATA(opt),RTA_PAYLOAD(opt)); + rtattr_parse_nested(tb2, TCA_GRED_DPS, opt); if (tb2[TCA_GRED_DPS-1] == 0) return -EINVAL; diff -Nru a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c --- a/net/sched/sch_hfsc.c 2005-01-11 22:32:05 +01:00 +++ b/net/sched/sch_hfsc.c 2005-01-11 22:32:05 +01:00 @@ -1046,8 +1046,7 @@ struct tc_service_curve *rsc = NULL, *fsc = NULL, *usc = NULL; u64 cur_time; - if (opt == NULL || - rtattr_parse(tb, TCA_HFSC_MAX, RTA_DATA(opt), RTA_PAYLOAD(opt))) + if (opt == NULL || rtattr_parse_nested(tb, TCA_HFSC_MAX, opt)) return -EINVAL; if (tb[TCA_HFSC_RSC-1]) { diff -Nru a/net/sched/sch_htb.c b/net/sched/sch_htb.c --- a/net/sched/sch_htb.c 2005-01-11 22:32:05 +01:00 +++ b/net/sched/sch_htb.c 2005-01-11 22:32:05 +01:00 @@ -1267,7 +1267,7 @@ printk(KERN_INFO "HTB init, kernel part version %d.%d\n", HTB_VER >> 16,HTB_VER & 0xffff); #endif - if (!opt || rtattr_parse(tb, TCA_HTB_INIT, RTA_DATA(opt), RTA_PAYLOAD(opt)) || + if (!opt || rtattr_parse_nested(tb, TCA_HTB_INIT, opt) || tb[TCA_HTB_INIT-1] == NULL || RTA_PAYLOAD(tb[TCA_HTB_INIT-1]) < sizeof(*gopt)) { printk(KERN_ERR "HTB: hey probably you have bad tc tool ?\n"); @@ -1559,7 +1559,7 @@ struct tc_htb_opt *hopt; /* extract all subattrs from opt attr */ - if (!opt || rtattr_parse(tb, TCA_HTB_RTAB, RTA_DATA(opt), RTA_PAYLOAD(opt)) || + if (!opt || rtattr_parse_nested(tb, TCA_HTB_RTAB, opt) || tb[TCA_HTB_PARMS-1] == NULL || RTA_PAYLOAD(tb[TCA_HTB_PARMS-1]) < sizeof(*hopt)) goto failure; diff -Nru a/net/sched/sch_red.c b/net/sched/sch_red.c --- a/net/sched/sch_red.c 2005-01-11 22:32:05 +01:00 +++ b/net/sched/sch_red.c 2005-01-11 22:32:05 +01:00 @@ -364,7 +364,7 @@ struct tc_red_qopt *ctl; if (opt == NULL || - rtattr_parse(tb, TCA_RED_STAB, RTA_DATA(opt), RTA_PAYLOAD(opt)) || + rtattr_parse_nested(tb, TCA_RED_STAB, opt) || tb[TCA_RED_PARMS-1] == 0 || tb[TCA_RED_STAB-1] == 0 || RTA_PAYLOAD(tb[TCA_RED_PARMS-1]) < sizeof(*ctl) || RTA_PAYLOAD(tb[TCA_RED_STAB-1]) < 256) diff -Nru a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c --- a/net/sched/sch_tbf.c 2005-01-11 22:32:05 +01:00 +++ b/net/sched/sch_tbf.c 2005-01-11 22:32:05 +01:00 @@ -310,7 +310,7 @@ struct Qdisc *child = NULL; int max_size,n; - if (rtattr_parse(tb, TCA_TBF_PTAB, RTA_DATA(opt), RTA_PAYLOAD(opt)) || + if (rtattr_parse_nested(tb, TCA_TBF_PTAB, opt) || tb[TCA_TBF_PARMS-1] == NULL || RTA_PAYLOAD(tb[TCA_TBF_PARMS-1]) < sizeof(*qopt)) goto done; --------------090704050901070002070602-- From kaber@trash.net Tue Jan 11 13:46:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 13:46:36 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BLkU4Y000408 for ; Tue, 11 Jan 2005 13:46:30 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CoTqK-000142-AL; Tue, 11 Jan 2005 22:46:24 +0100 Message-ID: <41E44930.5040106@trash.net> Date: Tue, 11 Jan 2005 22:46:24 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: Maillist netdev Subject: [PATCH PKT_SCHED 3/6]: tc actions: disable bhs while lock is held in init path Content-Type: multipart/mixed; boundary="------------080901000200000400060803" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 91 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------080901000200000400060803 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit The lock is also used in softirq context. --------------080901000200000400060803 Content-Type: text/x-patch; name="03.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="03.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/11 20:32:35+01:00 kaber@coreworks.de # [PKT_SCHED]: tc actions: disable bhs while lock is held in init path # # Signed-off-by: Patrick McHardy # # net/sched/police.c # 2005/01/11 20:32:28+01:00 kaber@coreworks.de +2 -2 # [PKT_SCHED]: tc actions: disable bhs while lock is held in init path # # Signed-off-by: Patrick McHardy # # net/sched/mirred.c # 2005/01/11 20:32:28+01:00 kaber@coreworks.de +2 -2 # [PKT_SCHED]: tc actions: disable bhs while lock is held in init path # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/mirred.c b/net/sched/mirred.c --- a/net/sched/mirred.c 2005-01-11 22:32:15 +01:00 +++ b/net/sched/mirred.c 2005-01-11 22:32:15 +01:00 @@ -126,7 +126,7 @@ } } - spin_lock(&p->lock); + spin_lock_bh(&p->lock); p->action = parm->action; p->eaction = parm->eaction; if (parm->ifindex) { @@ -137,7 +137,7 @@ dev_hold(dev); p->ok_push = ok_push; } - spin_unlock(&p->lock); + spin_unlock_bh(&p->lock); if (ret == ACT_P_CREATED) tcf_hash_insert(p); diff -Nru a/net/sched/police.c b/net/sched/police.c --- a/net/sched/police.c 2005-01-11 22:32:15 +01:00 +++ b/net/sched/police.c 2005-01-11 22:32:15 +01:00 @@ -224,7 +224,7 @@ } } /* No failure allowed after this point */ - spin_lock(&p->lock); + spin_lock_bh(&p->lock); if (R_tab != NULL) { qdisc_put_rtab(p->R_tab); p->R_tab = R_tab; @@ -254,7 +254,7 @@ gen_replace_estimator(&p->bstats, &p->rate_est, p->stats_lock, est); #endif - spin_unlock(&p->lock); + spin_unlock_bh(&p->lock); if (ret != ACT_P_CREATED) return ret; --------------080901000200000400060803-- From kaber@trash.net Tue Jan 11 13:46:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 13:46:25 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BLkKjQ000390 for ; Tue, 11 Jan 2005 13:46:21 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CoTqA-00013q-HX; Tue, 11 Jan 2005 22:46:14 +0100 Message-ID: <41E44926.5010701@trash.net> Date: Tue, 11 Jan 2005 22:46:14 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: Maillist netdev Subject: [PATCH PKT_SCHED 0/6]: assorted fixes Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 88 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Hi Dave, following are a couple of assorted fixes: a mem leak, locking bugs in two tc actions, your sch_api.c fix for holding the rtnl while loading modules ported to act_api.c, and a bug in tcf_exts that prevents using actions/policers without a rate estimator. You can pull all changes from bk://212.42.230.204/net-2.6-sched Regards Patrick Patrick McHardy: o [PKT_SCHED]: act_api.c: kill some exports o [PKT_SCHED]: tcf_exts: rate_tlv is optional o [PKT_SCHED]: act_api.c: drop rtnl for loading modules o [PKT_SCHED]: tc actions: disable bhs while lock is held in init path o [PKT_SCHED]: Fix memory leaks in cls_u32.c error path o [PKT_SCHED]: Use rtattr_parse_nested where appropriate From kaber@trash.net Tue Jan 11 13:46:38 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 13:46:47 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BLkcg6000495 for ; Tue, 11 Jan 2005 13:46:38 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CoTqS-00014A-M8; Tue, 11 Jan 2005 22:46:32 +0100 Message-ID: <41E44938.3070402@trash.net> Date: Tue, 11 Jan 2005 22:46:32 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: Maillist netdev Subject: [PATCH PKT_SCHED 5/6]: tcf_exts: rate_tlv is optional Content-Type: multipart/mixed; boundary="------------050003070005030004030600" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 92 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------050003070005030004030600 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit rate_tlv is optional, fixes using actions/policer without a rate estimator. --------------050003070005030004030600 Content-Type: text/x-patch; name="05.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="05.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/11 22:12:44+01:00 kaber@coreworks.de # [PKT_SCHED]: tcf_exts: rate_tlv is optional # # Signed-off-by: Patrick McHardy # # net/sched/cls_api.c # 2005/01/11 22:12:34+01:00 kaber@coreworks.de +3 -3 # [PKT_SCHED]: tcf_exts: rate_tlv is optional # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/cls_api.c b/net/sched/cls_api.c --- a/net/sched/cls_api.c 2005-01-11 22:32:25 +01:00 +++ b/net/sched/cls_api.c 2005-01-11 22:32:25 +01:00 @@ -479,7 +479,7 @@ int err; struct tc_action *act; - if (map->police && tb[map->police-1] && rate_tlv) { + if (map->police && tb[map->police-1]) { act = tcf_action_init_1(tb[map->police-1], rate_tlv, "police", TCA_ACT_NOREPLACE, TCA_ACT_BIND, &err); if (act == NULL) @@ -487,7 +487,7 @@ act->type = TCA_OLD_COMPAT; exts->action = act; - } else if (map->action && tb[map->action-1] && rate_tlv) { + } else if (map->action && tb[map->action-1]) { act = tcf_action_init(tb[map->action-1], rate_tlv, NULL, TCA_ACT_NOREPLACE, TCA_ACT_BIND, &err); if (act == NULL) @@ -496,7 +496,7 @@ exts->action = act; } #elif defined CONFIG_NET_CLS_POLICE - if (map->police && tb[map->police-1] && rate_tlv) { + if (map->police && tb[map->police-1]) { struct tcf_police *p; p = tcf_police_locate(tb[map->police-1], rate_tlv); --------------050003070005030004030600-- From kaber@trash.net Tue Jan 11 13:46:41 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 13:46:49 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BLkeZn000530 for ; Tue, 11 Jan 2005 13:46:41 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CoTqU-00014E-H6; Tue, 11 Jan 2005 22:46:34 +0100 Message-ID: <41E4493A.8000704@trash.net> Date: Tue, 11 Jan 2005 22:46:34 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: Maillist netdev Subject: [PATCH PKT_SCHED 6/6]: act_api.c: kill some exports Content-Type: multipart/mixed; boundary="------------010104040709050701000308" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 94 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------010104040709050701000308 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------010104040709050701000308 Content-Type: text/x-patch; name="06.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="06.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/11 22:22:57+01:00 kaber@coreworks.de # [PKT_SCHED]: act_api.c: kill some exports # # init, destroy, dump etc. should be performed through Thomas's tcf_exts, # don't export the act_api.c functions to modules. tcf_action_dump_1 # will follow once tcf_dump_walker is converted to callbacks. # # Signed-off-by: Patrick McHardy # # net/sched/act_api.c # 2005/01/11 22:22:49+01:00 kaber@coreworks.de +0 -6 # [PKT_SCHED]: act_api.c: kill some exports # # init, destroy, dump etc. should be performed through Thomas's tcf_exts, # don't export the act_api.c functions to modules. tcf_action_dump_1 # will follow once tcf_dump_walker is converted to callbacks. # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/act_api.c b/net/sched/act_api.c --- a/net/sched/act_api.c 2005-01-11 22:32:30 +01:00 +++ b/net/sched/act_api.c 2005-01-11 22:32:30 +01:00 @@ -883,11 +883,5 @@ EXPORT_SYMBOL(tcf_register_action); EXPORT_SYMBOL(tcf_unregister_action); -EXPORT_SYMBOL(tcf_action_init_1); -EXPORT_SYMBOL(tcf_action_init); -EXPORT_SYMBOL(tcf_action_destroy); EXPORT_SYMBOL(tcf_action_exec); -EXPORT_SYMBOL(tcf_action_copy_stats); -EXPORT_SYMBOL(tcf_action_dump); EXPORT_SYMBOL(tcf_action_dump_1); -EXPORT_SYMBOL(tcf_action_dump_old); --------------010104040709050701000308-- From kaber@trash.net Tue Jan 11 13:46:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 13:46:48 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BLkaU6000476 for ; Tue, 11 Jan 2005 13:46:36 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CoTqQ-000146-91; Tue, 11 Jan 2005 22:46:30 +0100 Message-ID: <41E44936.4020304@trash.net> Date: Tue, 11 Jan 2005 22:46:30 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: Maillist netdev Subject: [PATCH PKT_SCHED 4/6]: act_api.c: drop rtnl for loading modules Content-Type: multipart/mixed; boundary="------------090903010106030403090009" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 93 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------090903010106030403090009 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------090903010106030403090009 Content-Type: text/x-patch; name="04.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="04.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/11 22:10:34+01:00 kaber@coreworks.de # [PKT_SCHED]: act_api.c: drop rtnl for loading modules # # Signed-off-by: Patrick McHardy # # net/sched/cls_api.c # 2005/01/11 22:10:27+01:00 kaber@coreworks.de +18 -7 # [PKT_SCHED]: act_api.c: drop rtnl for loading modules # # Signed-off-by: Patrick McHardy # # net/sched/act_api.c # 2005/01/11 22:10:26+01:00 kaber@coreworks.de +19 -4 # [PKT_SCHED]: act_api.c: drop rtnl for loading modules # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/act_api.c b/net/sched/act_api.c --- a/net/sched/act_api.c 2005-01-11 22:32:20 +01:00 +++ b/net/sched/act_api.c 2005-01-11 22:32:20 +01:00 @@ -291,16 +291,28 @@ goto err_out; } - *err = -ENOENT; a_o = tc_lookup_action_n(act_name); -#ifdef CONFIG_KMOD if (a_o == NULL) { +#ifdef CONFIG_KMOD + rtnl_unlock(); request_module(act_name); + rtnl_lock(); + a_o = tc_lookup_action_n(act_name); - } + + /* We dropped the RTNL semaphore in order to + * perform the module load. So, even if we + * succeeded in loading the module we have to + * tell the caller to replay the request. We + * indicate this using -EAGAIN. + */ + if (a_o != NULL) { + *err = -EAGAIN; + goto err_mod; + } #endif - if (a_o == NULL) goto err_out; + } *err = -ENOMEM; a = kmalloc(sizeof(*a), GFP_KERNEL); @@ -740,7 +752,10 @@ */ if (n->nlmsg_flags&NLM_F_REPLACE) ovr = 1; +replay: ret = tcf_action_add(tca[TCA_ACT_TAB-1], n, pid, ovr); + if (ret == -EAGAIN) + goto replay; break; case RTM_DELACTION: ret = tca_action_gd(tca[TCA_ACT_TAB-1], n, pid, RTM_DELACTION); diff -Nru a/net/sched/cls_api.c b/net/sched/cls_api.c --- a/net/sched/cls_api.c 2005-01-11 22:32:20 +01:00 +++ b/net/sched/cls_api.c 2005-01-11 22:32:20 +01:00 @@ -130,22 +130,30 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg) { - struct rtattr **tca = arg; - struct tcmsg *t = NLMSG_DATA(n); - u32 protocol = TC_H_MIN(t->tcm_info); - u32 prio = TC_H_MAJ(t->tcm_info); - u32 nprio = prio; - u32 parent = t->tcm_parent; + struct rtattr **tca; + struct tcmsg *t; + u32 protocol; + u32 prio; + u32 nprio; + u32 parent; struct net_device *dev; struct Qdisc *q; struct tcf_proto **back, **chain; - struct tcf_proto *tp = NULL; + struct tcf_proto *tp; struct tcf_proto_ops *tp_ops; struct Qdisc_class_ops *cops; unsigned long cl = 0; unsigned long fh; int err; +replay: + tca = arg; + t = NLMSG_DATA(n); + protocol = TC_H_MIN(t->tcm_info); + prio = TC_H_MAJ(t->tcm_info); + nprio = prio; + parent = t->tcm_parent; + if (prio == 0) { /* If no priority is given, user wants we allocated it. */ if (n->nlmsg_type != RTM_NEWTFILTER || !(n->nlmsg_flags&NLM_F_CREATE)) @@ -294,6 +302,9 @@ errout: if (cl) cops->put(q, cl); + if (err == -EAGAIN) + /* Replay the request. */ + goto replay; return err; } --------------090903010106030403090009-- From tgraf@suug.ch Tue Jan 11 13:47:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 13:47:08 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BLl1KR001110 for ; Tue, 11 Jan 2005 13:47:02 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 4780DF; Tue, 11 Jan 2005 22:46:37 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 53CA31C0EA; Tue, 11 Jan 2005 22:47:20 +0100 (CET) Date: Tue, 11 Jan 2005 22:47:20 +0100 From: Thomas Graf To: Patrick McHardy Cc: "David S. Miller" , Herbert Xu , netdev@oss.sgi.com Subject: Re: request_module while holding rtnl semaphore Message-ID: <20050111214720.GF26856@postel.suug.ch> References: <41899DCF.3050804@trash.net> <20041109161126.376f755c.davem@davemloft.net> <41E34252.504@trash.net> <20050111094752.GD26856@postel.suug.ch> <41E43F83.1090503@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41E43F83.1090503@trash.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 95 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * Patrick McHardy <41E43F83.1090503@trash.net> 2005-01-11 22:05 > Thomas Graf wrote: > >tcindex returns EBUSY when a filter is changed which does not fit > >into the hashtable, so this must be changed. > > > It's -EAGAIN, so no problem, nothing returns this currently. I'm going to > send a patch later. Of course, then there is no problem. Will you fix the request_module in cls_api.c as well? From tgraf@suug.ch Tue Jan 11 13:50:38 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 13:50:45 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BLobVW004241 for ; Tue, 11 Jan 2005 13:50:37 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id AC77BF; Tue, 11 Jan 2005 22:50:14 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 9F7ED1C0EA; Tue, 11 Jan 2005 22:50:57 +0100 (CET) Date: Tue, 11 Jan 2005 22:50:57 +0100 From: Thomas Graf To: Patrick McHardy Cc: "David S. Miller" , Herbert Xu , netdev@oss.sgi.com Subject: Re: request_module while holding rtnl semaphore Message-ID: <20050111215057.GG26856@postel.suug.ch> References: <41899DCF.3050804@trash.net> <20041109161126.376f755c.davem@davemloft.net> <41E34252.504@trash.net> <20050111094752.GD26856@postel.suug.ch> <41E43F83.1090503@trash.net> <20050111214720.GF26856@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050111214720.GF26856@postel.suug.ch> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 96 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * Thomas Graf <20050111214720.GF26856@postel.suug.ch> 2005-01-11 22:47 > * Patrick McHardy <41E43F83.1090503@trash.net> 2005-01-11 22:05 > > Thomas Graf wrote: > > >tcindex returns EBUSY when a filter is changed which does not fit > > >into the hashtable, so this must be changed. > > > > > It's -EAGAIN, so no problem, nothing returns this currently. I'm going to > > send a patch later. > > Of course, then there is no problem. Will you fix the request_module in > cls_api.c as well? Just saw your patch, never mind. From tommy.christensen@tpack.net Tue Jan 11 14:16:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 14:16:25 -0800 (PST) Received: from mail.tpack.net (ip18.tpack.net [213.173.228.18]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0BMGIJ6005920 for ; Tue, 11 Jan 2005 14:16:19 -0800 Received: (qmail 25028 invoked from network); 11 Jan 2005 22:16:12 -0000 Received: from dhcp-162.cph.tpack.net (HELO ?172.17.159.11?) (192.168.0.162) by 0 with SMTP; 11 Jan 2005 22:16:12 -0000 Message-ID: <41E45091.7030208@tpack.net> Date: Tue, 11 Jan 2005 23:17:53 +0100 From: Tommy Christensen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: en-us, en MIME-Version: 1.0 To: stanislav@muhachev.petro.ru CC: Andrew Morton , netdev@oss.sgi.com Subject: Re: Fw: [Bugme-new] [Bug 3992] New: Bondig. Not correct work function ARP Monitoring. Broken link. References: <20050105133525.2bab2e09.akpm@osdl.org> In-Reply-To: <20050105133525.2bab2e09.akpm@osdl.org> Content-Type: multipart/mixed; boundary="------------030505010805030005000500" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 97 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tommy.christensen@tpack.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------030505010805030005000500 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit > http://bugme.osdl.org/show_bug.cgi?id=3992 > > Summary: Bondig. Not correct work function ARP Monitoring. Broken > link. > Kernel Version: 2.6.10 > Status: NEW > Severity: normal > Owner: jgarzik@pobox.com > Submitter: stanislav@muhachev.petro.ru > ... > > bonding vpn1 & vpn2 òî bond0 (bonding default setup -> nothing failover > setings) > link îê!(192.168.100.1-192.168.100.2) > > setting arp monitor in bonding (TUN/TAP driver not support Mii status) > link down! I am not sure I understand your setup completely ... But as stated in bonding.txt, the ARP monitor requires the underlying driver to update dev->trans_start and dev->last_rx. Since the TUN/TAP driver doesn't maintain these, it could very well explain the behavior you are seeing. The patch below adds the required functionality to the TUN/TAP driver. Please test if this helps in your case. -Tommy --------------030505010805030005000500 Content-Type: text/plain; name="tun.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="tun.c.patch" --- linux-2.6.10-bk14/drivers/net/tun.c 2005-01-10 16:28:48.000000000 +0100 +++ linux-2.6.10-work/drivers/net/tun.c 2005-01-11 23:05:56.759691345 +0100 @@ -92,6 +92,7 @@ goto drop; } skb_queue_tail(&tun->readq, skb); + dev->trans_start = jiffies; /* Notify and wake up reader process */ if (tun->flags & TUN_FASYNC) @@ -240,6 +241,7 @@ skb->ip_summed = CHECKSUM_UNNECESSARY; netif_rx_ni(skb); + tun->dev->last_rx = jiffies; tun->stats.rx_packets++; tun->stats.rx_bytes += len; --------------030505010805030005000500-- From kaber@trash.net Tue Jan 11 14:19:27 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 14:19:33 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BMJRoi006416 for ; Tue, 11 Jan 2005 14:19:27 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CoULh-0001g0-N5; Tue, 11 Jan 2005 23:18:49 +0100 Message-ID: <41E450C9.80800@trash.net> Date: Tue, 11 Jan 2005 23:18:49 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: Thomas Graf CC: "David S. Miller" , Herbert Xu , netdev@oss.sgi.com Subject: Re: request_module while holding rtnl semaphore References: <41899DCF.3050804@trash.net> <20041109161126.376f755c.davem@davemloft.net> <41E34252.504@trash.net> <20050111094752.GD26856@postel.suug.ch> <41E43F83.1090503@trash.net> <20050111214720.GF26856@postel.suug.ch> <20050111215057.GG26856@postel.suug.ch> In-Reply-To: <20050111215057.GG26856@postel.suug.ch> Content-Type: multipart/mixed; boundary="------------050403090701090801040501" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 98 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------050403090701090801040501 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Thomas Graf wrote: >>Of course, then there is no problem. Will you fix the request_module in >>cls_api.c as well? >> > >Just saw your patch, never mind. > Oops, embarassing :) The cls_api.c changes in my patch only deal with EAGAIN from act_api.c, but I didn't fix module loading in cls_api.c itself. Patch on top of the previous ones attached, I will also update the bitkeeper tree. Regards Patrick --------------050403090701090801040501 Content-Type: text/plain; name="x" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="x" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/11 23:15:28+01:00 kaber@coreworks.de # [PKT_SCHED]: cls_api.c: drop rtnl for loading modules # # Signed-off-by: Patrick McHardy # # net/sched/cls_api.c # 2005/01/11 23:15:20+01:00 kaber@coreworks.de +14 -5 # [PKT_SCHED]: cls_api.c: drop rtnl for loading modules # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/cls_api.c b/net/sched/cls_api.c --- a/net/sched/cls_api.c 2005-01-11 23:17:58 +01:00 +++ b/net/sched/cls_api.c 2005-01-11 23:17:58 +01:00 @@ -219,20 +219,29 @@ err = -ENOBUFS; if ((tp = kmalloc(sizeof(*tp), GFP_KERNEL)) == NULL) goto errout; + err = -EINVAL; tp_ops = tcf_proto_lookup_ops(tca[TCA_KIND-1]); + if (tp_ops == NULL) { #ifdef CONFIG_KMOD - if (tp_ops==NULL && tca[TCA_KIND-1] != NULL) { struct rtattr *kind = tca[TCA_KIND-1]; char name[IFNAMSIZ]; - if (rtattr_strlcpy(name, kind, IFNAMSIZ) < IFNAMSIZ) { + if (kind != NULL && + rtattr_strlcpy(name, kind, IFNAMSIZ) < IFNAMSIZ) { + rtnl_unlock(); request_module("cls_%s", name); + rtnl_lock(); tp_ops = tcf_proto_lookup_ops(kind); + /* We dropped the RTNL semaphore in order to + * perform the module load. So, even if we + * succeeded in loading the module we have to + * replay the request. We indicate this using + * -EAGAIN. + */ + if (tp_ops != NULL) + err = -EAGAIN; } - } #endif - if (tp_ops == NULL) { - err = -EINVAL; kfree(tp); goto errout; } --------------050403090701090801040501-- From oxymoron@waste.org Tue Jan 11 14:30:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 14:30:37 -0800 (PST) Received: from waste.org (waste.org [216.27.176.166]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BMUVPx007045 for ; Tue, 11 Jan 2005 14:30:31 -0800 Received: from waste.org (localhost [127.0.0.1]) by waste.org (8.12.3/8.12.3/Debian-7.1) with ESMTP id j0BMUNAT019906; Tue, 11 Jan 2005 16:30:23 -0600 Received: (from oxymoron@localhost) by waste.org (8.12.3/8.12.3/Debian-7.1) id j0BMUJeW019891; Tue, 11 Jan 2005 16:30:19 -0600 Date: Tue, 11 Jan 2005 14:30:19 -0800 From: Matt Mackall To: Andrew Morton Cc: netdev@oss.sgi.com Subject: [PATCH] netpoll: fix NAPI polling race on SMP Message-ID: <20050111223019.GC2940@waste.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: by amavisd-new X-Virus-Status: Clean X-archive-position: 99 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mpm@selenic.com Precedence: bulk X-list: netdev This avoids a nasty NAPI race by checking that work was actually scheduled for the CPU netpoll is running on and pulls the NAPI-specific code out into a separate function. Original idea from Jeff Moyer Tested by Andrew Tridgell Signed-off-by: Matt Mackall Index: netpoll/net/core/netpoll.c =================================================================== --- netpoll.orig/net/core/netpoll.c 2005-01-10 14:34:49.058616769 -0800 +++ netpoll/net/core/netpoll.c 2005-01-10 14:52:49.799833988 -0800 @@ -65,27 +65,25 @@ return csum_fold(skb_checksum(skb, 0, skb->len, skb->csum)); } -void netpoll_poll(struct netpoll *np) +/* + * Check whether delayed processing was scheduled for our current CPU, + * and then manually invoke NAPI polling to pump data off the card. + * + * In cases where there is bi-directional communications, reading only + * one message at a time can lead to packets being dropped by the + * network adapter, forcing superfluous retries and possibly timeouts. + * Thus, we set our budget to greater than 1. + */ +static void poll_napi(struct netpoll *np) { - /* - * In cases where there is bi-directional communications, reading - * only one message at a time can lead to packets being dropped by - * the network adapter, forcing superfluous retries and possibly - * timeouts. Thus, we set our budget to a more reasonable value. - */ int budget = 16; unsigned long flags; + struct softnet_data *queue; - if(!np->dev || !netif_running(np->dev) || !np->dev->poll_controller) - return; - - /* Process pending work on NIC */ - np->dev->poll_controller(np->dev); - - /* If scheduling is stopped, tickle NAPI bits */ spin_lock_irqsave(&netpoll_poll_lock, flags); - if (np->dev->poll && - test_bit(__LINK_STATE_RX_SCHED, &np->dev->state)) { + queue = &__get_cpu_var(softnet_data); + if (test_bit(__LINK_STATE_RX_SCHED, &np->dev->state) && + !list_empty(&queue->poll_list)) { np->dev->netpoll_rx |= NETPOLL_RX_DROP; atomic_inc(&trapped); @@ -95,6 +93,17 @@ np->dev->netpoll_rx &= ~NETPOLL_RX_DROP; } spin_unlock_irqrestore(&netpoll_poll_lock, flags); +} + +void netpoll_poll(struct netpoll *np) +{ + if(!np->dev || !netif_running(np->dev) || !np->dev->poll_controller) + return; + + /* Process pending work on NIC */ + np->dev->poll_controller(np->dev); + if (np->dev->poll) + poll_napi(np); zap_completion_queue(); } -- Mathematics is the supreme nostalgia of our time. From domen@coderock.org Tue Jan 11 14:53:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 14:53:54 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BMrkKP008321 for ; Tue, 11 Jan 2005 14:53:47 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id 053521F22A; Tue, 11 Jan 2005 23:53:43 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 485A11F226; Tue, 11 Jan 2005 23:53:43 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 3AA7E1F225; Tue, 11 Jan 2005 23:53:41 +0100 (CET) Subject: [patch 1/1] net/islpci_dev: replace schedule_timeout() with msleep() To: prism54-private@prism54.org Cc: netdev@oss.sgi.com, domen@coderock.org, nacc@us.ibm.com, janitor@sternwelten.at From: domen@coderock.org Date: Tue, 11 Jan 2005 23:53:40 +0100 Message-Id: <20050111225341.3AA7E1F225@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 100 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Any comments would be appreciated. Description: Use msleep() instead of schedule_timeout() to guarantee the task delays as expected. Also set_current_state() is inserted before schedule_timeout(). Signed-off-by: Nishanth Aravamudan Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/wireless/prism54/islpci_dev.c | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) diff -puN drivers/net/wireless/prism54/islpci_dev.c~msleep-drivers_net_wireless_prism54_islpci_dev drivers/net/wireless/prism54/islpci_dev.c --- kj/drivers/net/wireless/prism54/islpci_dev.c~msleep-drivers_net_wireless_prism54_islpci_dev 2005-01-10 18:00:03.000000000 +0100 +++ kj-domen/drivers/net/wireless/prism54/islpci_dev.c 2005-01-10 18:00:03.000000000 +0100 @@ -438,8 +438,7 @@ prism54_bring_down(islpci_private *priv) wmb(); /* wait a while for the device to reset */ - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(50*HZ/1000); + msleep(50); return 0; } _ From domen@coderock.org Tue Jan 11 15:00:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:00:26 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BN0D9R012530 for ; Tue, 11 Jan 2005 15:00:13 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id 984761F22A; Wed, 12 Jan 2005 00:00:11 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 9FBDE1F226; Wed, 12 Jan 2005 00:00:10 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id F3BCF1F225; Wed, 12 Jan 2005 00:00:07 +0100 (CET) Subject: [patch 1/1] net/3c505: replace schedule_timeout() with msleep() To: philb@gnu.org Cc: netdev@oss.sgi.com, domen@coderock.org, nacc@us.ibm.com, pb@nexus.co.uk, janitor@sternwelten.at From: domen@coderock.org Date: Wed, 12 Jan 2005 00:00:07 +0100 Message-Id: <20050111230007.F3BCF1F225@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 101 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Any comments would be appreciated. Description: Use msleep() instead of schedule_timeout() to guarantee the task delays as expected. Signed-off-by: Nishanth Aravamudan Acked-by: Phil Blundell Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/3c505.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff -puN drivers/net/3c505.c~msleep-drivers_net_3c505 drivers/net/3c505.c --- kj/drivers/net/3c505.c~msleep-drivers_net_3c505 2005-01-10 17:59:58.000000000 +0100 +++ kj-domen/drivers/net/3c505.c 2005-01-10 17:59:58.000000000 +0100 @@ -1317,8 +1317,7 @@ static int __init elp_sense(struct net_d if (orig_HSR & DIR) { /* If HCR.DIR is up, we pull it down. HSR.DIR should follow. */ outb(0, dev->base_addr + PORT_CONTROL); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(30*HZ/100); + msleep(300); if (inb_status(addr) & DIR) { if (elp_debug > 0) printk(notfound_msg, 2); @@ -1327,8 +1326,7 @@ static int __init elp_sense(struct net_d } else { /* If HCR.DIR is down, we pull it up. HSR.DIR should follow. */ outb(DIR, dev->base_addr + PORT_CONTROL); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(30*HZ/100); + msleep(300); if (!(inb_status(addr) & DIR)) { if (elp_debug > 0) printk(notfound_msg, 3); _ From domen@coderock.org Tue Jan 11 15:01:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:01:58 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BN1si5014855 for ; Tue, 11 Jan 2005 15:01:54 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id 5FD581F22A; Wed, 12 Jan 2005 00:01:53 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 72A831F226; Wed, 12 Jan 2005 00:01:52 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 1B6141F225; Wed, 12 Jan 2005 00:01:50 +0100 (CET) Subject: [patch 1/1] net/pcnet32: replace schedule_timeout() with msleep_interruptible() To: tsbogend@alpha.franken.de Cc: netdev@oss.sgi.com, domen@coderock.org, nacc@us.ibm.com, janitor@sternwelten.at From: domen@coderock.org Date: Wed, 12 Jan 2005 00:01:49 +0100 Message-Id: <20050111230150.1B6141F225@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 102 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Any comments would be appreciated. Description: Use msleep_interruptible() instead of schedule_timeout() to guarantee the task delays as expected. Signed-off-by: Nishanth Aravamudan Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/pcnet32.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN drivers/net/pcnet32.c~msleep_interruptible-drivers_net_pcnet32 drivers/net/pcnet32.c --- kj/drivers/net/pcnet32.c~msleep_interruptible-drivers_net_pcnet32 2005-01-10 18:00:07.000000000 +0100 +++ kj-domen/drivers/net/pcnet32.c 2005-01-10 18:00:07.000000000 +0100 @@ -847,7 +847,7 @@ static int pcnet32_phys_id(struct net_de if ((!data) || (data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ))) data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ); - schedule_timeout(data * HZ); + msleep_interruptible(data * 1000); del_timer_sync(&lp->blink_timer); /* Restore the original value of the bcrs */ _ From domen@coderock.org Tue Jan 11 15:03:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:03:51 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BN3jxq015856 for ; Tue, 11 Jan 2005 15:03:46 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id 9BCAB1F22A; Wed, 12 Jan 2005 00:03:44 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 9326A1F226; Wed, 12 Jan 2005 00:03:43 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id DBFA31F225; Wed, 12 Jan 2005 00:03:39 +0100 (CET) Subject: [patch 1/1] janitor: net/e1000: remove pci_find_device To: cramerj@intel.com Cc: john.ronciak@intel.com, netdev@oss.sgi.com, domen@coderock.org, sfeldma@pobox.com, janitor@sternwelten.at From: domen@coderock.org Date: Wed, 12 Jan 2005 00:03:39 +0100 Message-Id: <20050111230339.DBFA31F225@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 103 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Removing pci_find_device required removing driver's custom reboot notifier which walked the device list and replace it with standard driver ->shutdown method. Compiled and tested. Signed-off-by: Scott Feldman Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/e1000/e1000_main.c | 38 ++++++++------------------------ 1 files changed, 10 insertions(+), 28 deletions(-) diff -puN drivers/net/e1000/e1000_main.c~remove-pci-find-device-drivers_net_e1000_e1000_main drivers/net/e1000/e1000_main.c --- kj/drivers/net/e1000/e1000_main.c~remove-pci-find-device-drivers_net_e1000_e1000_main 2005-01-10 18:00:16.000000000 +0100 +++ kj-domen/drivers/net/e1000/e1000_main.c 2005-01-10 18:00:16.000000000 +0100 @@ -165,7 +165,7 @@ static void e1000_vlan_rx_add_vid(struct static void e1000_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid); static void e1000_restore_vlan(struct e1000_adapter *adapter); -static int e1000_notify_reboot(struct notifier_block *, unsigned long event, void *ptr); +static void e1000_shutdown(struct device *dev); static int e1000_suspend(struct pci_dev *pdev, uint32_t state); #ifdef CONFIG_PM static int e1000_resume(struct pci_dev *pdev); @@ -176,12 +176,6 @@ static int e1000_resume(struct pci_dev * static void e1000_netpoll (struct net_device *netdev); #endif -struct notifier_block e1000_notifier_reboot = { - .notifier_call = e1000_notify_reboot, - .next = NULL, - .priority = 0 -}; - /* Exported from other modules */ extern void e1000_check_options(struct e1000_adapter *adapter); @@ -194,8 +188,11 @@ static struct pci_driver e1000_driver = /* Power Managment Hooks */ #ifdef CONFIG_PM .suspend = e1000_suspend, - .resume = e1000_resume + .resume = e1000_resume, #endif + .driver = { + .shutdown = e1000_shutdown, + } }; MODULE_AUTHOR("Intel Corporation, "); @@ -216,17 +213,12 @@ MODULE_PARM_DESC(debug, "Debug level (0= static int __init e1000_init_module(void) { - int ret; printk(KERN_INFO "%s - version %s\n", e1000_driver_string, e1000_driver_version); printk(KERN_INFO "%s\n", e1000_copyright); - ret = pci_module_init(&e1000_driver); - if(ret >= 0) { - register_reboot_notifier(&e1000_notifier_reboot); - } - return ret; + return pci_module_init(&e1000_driver); } module_init(e1000_init_module); @@ -241,7 +233,6 @@ module_init(e1000_init_module); static void __exit e1000_exit_module(void) { - unregister_reboot_notifier(&e1000_notifier_reboot); pci_unregister_driver(&e1000_driver); } @@ -2783,21 +2774,12 @@ e1000_set_spd_dplx(struct e1000_adapter return 0; } -static int -e1000_notify_reboot(struct notifier_block *nb, unsigned long event, void *p) +static +void e1000_shutdown(struct device *dev) { - struct pci_dev *pdev = NULL; + struct pci_dev *pdev = container_of(dev, struct pci_dev, dev); - switch(event) { - case SYS_DOWN: - case SYS_HALT: - case SYS_POWER_OFF: - while((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev))) { - if(pci_dev_driver(pdev) == &e1000_driver) - e1000_suspend(pdev, 3); - } - } - return NOTIFY_DONE; + e1000_suspend(pdev, 3); } static int _ From domen@coderock.org Tue Jan 11 15:07:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:07:53 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BN7mrT016387 for ; Tue, 11 Jan 2005 15:07:49 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id 831691F22A; Wed, 12 Jan 2005 00:07:47 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 978841F226; Wed, 12 Jan 2005 00:07:46 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 403911F225; Wed, 12 Jan 2005 00:07:44 +0100 (CET) Subject: [patch 1/1] net/farsync: add set_current_state() before schedule_timeout() To: kevin.curtis@farsite.co.uk Cc: netdev@oss.sgi.com, domen@coderock.org, nacc@us.ibm.com, janitor@sternwelten.at From: domen@coderock.org Date: Wed, 12 Jan 2005 00:07:43 +0100 Message-Id: <20050111230744.403911F225@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 104 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Any comments would be appreciated. Description: Insert set_current_state() before schedule_timeout() so the function delays as expected. Without the addition, schedule_timeout() will return immediately. Signed-off-by: Nishanth Aravamudan Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/wan/farsync.c | 1 + 1 files changed, 1 insertion(+) diff -puN drivers/net/wan/farsync.c~set_current_state-drivers_net_wan_farsync drivers/net/wan/farsync.c --- kj/drivers/net/wan/farsync.c~set_current_state-drivers_net_wan_farsync 2005-01-10 18:00:19.000000000 +0100 +++ kj-domen/drivers/net/wan/farsync.c 2005-01-10 18:00:19.000000000 +0100 @@ -981,6 +981,7 @@ fst_issue_cmd(struct fst_port_info *port /* Wait for any previous command to complete */ while (mbval > NAK) { spin_unlock_irqrestore(&card->card_lock, flags); + set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(1); spin_lock_irqsave(&card->card_lock, flags); _ From domen@coderock.org Tue Jan 11 15:08:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:08:51 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BN8jCM016633 for ; Tue, 11 Jan 2005 15:08:45 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id 268BD1F22A; Wed, 12 Jan 2005 00:08:44 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 579681F226; Wed, 12 Jan 2005 00:08:43 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 2869F1F225; Wed, 12 Jan 2005 00:08:41 +0100 (CET) Subject: [patch 1/1] net/ltpc: replace schedule_timeout() with ssleep()/msleep() To: acme@conectiva.com.br Cc: netdev@oss.sgi.com, domen@coderock.org, nacc@us.ibm.com, janitor@sternwelten.at From: domen@coderock.org Date: Wed, 12 Jan 2005 00:08:40 +0100 Message-Id: <20050111230841.2869F1F225@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 105 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Any comments would be appreciated. Description: Use ssleep() / msleep() [as appropriate] instead of schedule_timeout() to guarantee the task delays as expected. Signed-off-by: Nishanth Aravamudan Acked-by: Arnaldo Carvalho de Melo Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/appletalk/ltpc.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff -puN drivers/net/appletalk/ltpc.c~msleep+ssleep-drivers_net_appletalk_ltpc drivers/net/appletalk/ltpc.c --- kj/drivers/net/appletalk/ltpc.c~msleep+ssleep-drivers_net_appletalk_ltpc 2005-01-10 18:00:14.000000000 +0100 +++ kj-domen/drivers/net/appletalk/ltpc.c 2005-01-10 18:00:14.000000000 +0100 @@ -1109,8 +1109,7 @@ struct net_device * __init ltpc_probe(vo inb_p(io+1); inb_p(io+3); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(2*HZ/100); + msleep(20); inb_p(io+0); inb_p(io+2); @@ -1120,8 +1119,7 @@ struct net_device * __init ltpc_probe(vo inb_p(io+5); /* enable dma */ inb_p(io+6); /* tri-state interrupt line */ - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ); + ssleep(1); /* now, figure out which dma channel we're using, unless it's already been specified */ _ From domen@coderock.org Tue Jan 11 15:10:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:10:17 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BNAC0Z017341 for ; Tue, 11 Jan 2005 15:10:12 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id 5D2831F22A; Wed, 12 Jan 2005 00:10:11 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id AF4B31F226; Wed, 12 Jan 2005 00:10:10 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id B3A551F225; Wed, 12 Jan 2005 00:10:08 +0100 (CET) Subject: [patch 01/19] list_for_each: net-ipv6-ip6_fib.c To: jgarzik@pobox.com Cc: netdev@oss.sgi.com, domen@coderock.org, janitor@sternwelten.at From: domen@coderock.org Date: Wed, 12 Jan 2005 00:10:08 +0100 Message-Id: <20050111231008.B3A551F225@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 106 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Hi. s/for/list_for_each/ Compile tested. Signed-off-by: Domen Puncer Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/net/ipv6/ip6_fib.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN net/ipv6/ip6_fib.c~list-for-each-drivers_net_ipv6_ip6_fib net/ipv6/ip6_fib.c --- kj/net/ipv6/ip6_fib.c~list-for-each-drivers_net_ipv6_ip6_fib 2005-01-10 17:59:48.000000000 +0100 +++ kj-domen/net/ipv6/ip6_fib.c 2005-01-10 17:59:48.000000000 +0100 @@ -99,7 +99,7 @@ struct fib6_walker_t fib6_walker_list = .next = &fib6_walker_list, }; -#define FOR_WALKERS(w) for ((w)=fib6_walker_list.next; (w) != &fib6_walker_list; (w)=(w)->next) +#define FOR_WALKERS(w) list_for_each((w), &fib6_walker_list) static __inline__ u32 fib6_new_sernum(void) { _ From domen@coderock.org Tue Jan 11 15:10:16 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:10:23 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BNAG99017349 for ; Tue, 11 Jan 2005 15:10:16 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id E2C4D1F22A; Wed, 12 Jan 2005 00:10:14 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 1096C1F226; Wed, 12 Jan 2005 00:10:14 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id DB77A1F225; Wed, 12 Jan 2005 00:10:11 +0100 (CET) Subject: [patch 02/19] list_for_each: drivers-net-tulip-de4x5.c To: jgarzik@pobox.com Cc: netdev@oss.sgi.com, domen@coderock.org, janitor@sternwelten.at From: domen@coderock.org Date: Wed, 12 Jan 2005 00:10:11 +0100 Message-Id: <20050111231011.DB77A1F225@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 107 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Hi. s/for/list_for_each/ Compile tested. Signed-off-by: Domen Puncer Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/tulip/de4x5.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff -puN drivers/net/tulip/de4x5.c~list-for-each-drivers_net_tulip_de4x5 drivers/net/tulip/de4x5.c --- kj/drivers/net/tulip/de4x5.c~list-for-each-drivers_net_tulip_de4x5 2005-01-10 17:59:48.000000000 +0100 +++ kj-domen/drivers/net/tulip/de4x5.c 2005-01-10 17:59:48.000000000 +0100 @@ -2143,9 +2143,9 @@ srom_search(struct net_device *dev, stru u_long iobase = 0; /* Clear upper 32 bits in Alphas */ int i, j, cfrv; struct de4x5_private *lp = netdev_priv(dev); - struct list_head *walk = &pdev->bus_list; + struct list_head *walk; - for (walk = walk->next; walk != &pdev->bus_list; walk = walk->next) { + list_for_each(walk, &pdev->bus_list) { struct pci_dev *this_dev = pci_dev_b(walk); /* Skip the pci_bus list entry */ _ From domen@coderock.org Tue Jan 11 15:10:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:10:24 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BNAJSK017373 for ; Tue, 11 Jan 2005 15:10:20 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id 5AB551F22A; Wed, 12 Jan 2005 00:10:18 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 6875A1F226; Wed, 12 Jan 2005 00:10:17 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 44F491F225; Wed, 12 Jan 2005 00:10:15 +0100 (CET) Subject: [patch 03/19] net/act2001-sir: replace schedule_timeout() with msleep() To: jgarzik@pobox.com Cc: netdev@oss.sgi.com, domen@coderock.org, nacc@us.ibm.com, janitor@sternwelten.at From: domen@coderock.org Date: Wed, 12 Jan 2005 00:10:14 +0100 Message-Id: <20050111231015.44F491F225@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 108 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Any comments would be appreciated. Description: Use msleep() instead of schedule_timeout() to guarantee the task delays as expected. Signed-off-by: Nishanth Aravamudan Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/irda/act200l-sir.c | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) diff -puN drivers/net/irda/act200l-sir.c~msleep-drivers_net_irda_act200l-sir drivers/net/irda/act200l-sir.c --- kj/drivers/net/irda/act200l-sir.c~msleep-drivers_net_irda_act200l-sir 2005-01-10 17:59:59.000000000 +0100 +++ kj-domen/drivers/net/irda/act200l-sir.c 2005-01-10 17:59:59.000000000 +0100 @@ -177,8 +177,7 @@ static int act200l_change_speed(struct s /* Write control bytes */ sirdev_raw_write(dev, control, 3); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(msecs_to_jiffies(5)); + msleep(5); /* Go back to normal mode */ sirdev_set_dtr_rts(dev, TRUE, TRUE); _ From domen@coderock.org Tue Jan 11 15:10:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:10:33 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BNARIP017502 for ; Tue, 11 Jan 2005 15:10:27 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id 071BC1F22B; Wed, 12 Jan 2005 00:10:25 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id C7AA71F226; Wed, 12 Jan 2005 00:10:24 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id B96BB1F22B; Wed, 12 Jan 2005 00:10:21 +0100 (CET) Subject: [patch 05/19] net/ma600-sir: replace schedule_timeout() with msleep() To: jgarzik@pobox.com Cc: netdev@oss.sgi.com, domen@coderock.org, nacc@us.ibm.com, janitor@sternwelten.at From: domen@coderock.org Date: Wed, 12 Jan 2005 00:10:21 +0100 Message-Id: <20050111231021.B96BB1F22B@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 110 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Any comments would be appreciated. Description: Use msleep() instead of schedule_timeout() to guarantee the task delays as expected. Signed-off-by: Nishanth Aravamudan Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/irda/ma600-sir.c | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-) diff -puN drivers/net/irda/ma600-sir.c~msleep-drivers_net_irda_ma600-sir drivers/net/irda/ma600-sir.c --- kj/drivers/net/irda/ma600-sir.c~msleep-drivers_net_irda_ma600-sir 2005-01-10 18:00:00.000000000 +0100 +++ kj-domen/drivers/net/irda/ma600-sir.c 2005-01-10 18:00:00.000000000 +0100 @@ -191,8 +191,7 @@ static int ma600_change_speed(struct sir sirdev_raw_write(dev, &byte, sizeof(byte)); /* Wait at least 10ms: fake wait_until_sent - 10 bits at 9600 baud*/ - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(msecs_to_jiffies(15)); /* old ma600 uses 15ms */ + msleep(15); /* old ma600 uses 15ms */ #if 1 /* read-back of the control byte. ma600 is the first dongle driver @@ -215,8 +214,7 @@ static int ma600_change_speed(struct sir sirdev_set_dtr_rts(dev, TRUE, TRUE); /* Wait at least 10ms */ - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(msecs_to_jiffies(10)); + msleep(10); /* dongle is now switched to the new speed */ dev->speed = speed; @@ -245,13 +243,11 @@ int ma600_reset(struct sir_dev *dev) /* Reset the dongle : set DTR low for 10 ms */ sirdev_set_dtr_rts(dev, FALSE, TRUE); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(msecs_to_jiffies(10)); + msleep(10); /* Go back to normal mode */ sirdev_set_dtr_rts(dev, TRUE, TRUE); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(msecs_to_jiffies(10)); + msleep(10); dev->speed = 9600; /* That's the dongle-default */ _ From domen@coderock.org Tue Jan 11 15:10:24 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:10:28 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BNANZh017411 for ; Tue, 11 Jan 2005 15:10:23 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id 00EA61F225; Wed, 12 Jan 2005 00:10:21 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id EEF5B1F226; Wed, 12 Jan 2005 00:10:20 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id A3ADB1F225; Wed, 12 Jan 2005 00:10:18 +0100 (CET) Subject: [patch 04/19] net/irtty-sir: replace schedule_timeout() with msleep() To: jgarzik@pobox.com Cc: netdev@oss.sgi.com, domen@coderock.org, nacc@us.ibm.com, janitor@sternwelten.at From: domen@coderock.org Date: Wed, 12 Jan 2005 00:10:18 +0100 Message-Id: <20050111231018.A3ADB1F225@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 109 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Any comments would be appreciated. Description: Use msleep() instead of schedule_timeout() to guarantee the task delays as expected. Signed-off-by: Nishanth Aravamudan Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/irda/irtty-sir.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff -puN drivers/net/irda/irtty-sir.c~msleep-drivers_net_irda_irtty-sir drivers/net/irda/irtty-sir.c --- kj/drivers/net/irda/irtty-sir.c~msleep-drivers_net_irda_irtty-sir 2005-01-10 17:59:59.000000000 +0100 +++ kj-domen/drivers/net/irda/irtty-sir.c 2005-01-10 17:59:59.000000000 +0100 @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -97,8 +98,7 @@ static void irtty_wait_until_sent(struct unlock_kernel(); } else { - set_task_state(current, TASK_UNINTERRUPTIBLE); - schedule_timeout(msecs_to_jiffies(USBSERIAL_TX_DONE_DELAY)); + msleep(USBSERIAL_TX_DONE_DELAY); } } _ From domen@coderock.org Tue Jan 11 15:10:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:10:43 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BNAZQU017712 for ; Tue, 11 Jan 2005 15:10:35 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id 2B8351F22B; Wed, 12 Jan 2005 00:10:34 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 48C381F226; Wed, 12 Jan 2005 00:10:33 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 03D691F225; Wed, 12 Jan 2005 00:10:27 +0100 (CET) Subject: [patch 07/19] net/sir_dev: replace schedule_timeout() with msleep() To: jgarzik@pobox.com Cc: netdev@oss.sgi.com, domen@coderock.org, nacc@us.ibm.com, janitor@sternwelten.at From: domen@coderock.org Date: Wed, 12 Jan 2005 00:10:27 +0100 Message-Id: <20050111231027.03D691F225@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 112 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Any comments would be appreciated. Description: Use msleep() instead of schedule_timeout() to guarantee the task delays as expected. Signed-off-by: Nishanth Aravamudan Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/irda/sir_dev.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff -puN drivers/net/irda/sir_dev.c~msleep-drivers_net_irda_sir_dev drivers/net/irda/sir_dev.c --- kj/drivers/net/irda/sir_dev.c~msleep-drivers_net_irda_sir_dev 2005-01-10 18:00:01.000000000 +0100 +++ kj-domen/drivers/net/irda/sir_dev.c 2005-01-10 18:00:01.000000000 +0100 @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -73,8 +74,7 @@ int sirdev_raw_write(struct sir_dev *dev spin_lock_irqsave(&dev->tx_lock, flags); /* serialize with other tx operations */ while (dev->tx_buff.len > 0) { /* wait until tx idle */ spin_unlock_irqrestore(&dev->tx_lock, flags); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(msecs_to_jiffies(10)); + msleep(10); spin_lock_irqsave(&dev->tx_lock, flags); } _ From domen@coderock.org Tue Jan 11 15:10:34 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:10:41 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BNAWnK017661 for ; Tue, 11 Jan 2005 15:10:33 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id C0F281F22E; Wed, 12 Jan 2005 00:10:31 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 9E27A1F226; Wed, 12 Jan 2005 00:10:30 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id CEF821F228; Wed, 12 Jan 2005 00:10:24 +0100 (CET) Subject: [patch 06/19] net/xirc2ps_cs: replace Wait() with msleep() To: jgarzik@pobox.com Cc: netdev@oss.sgi.com, domen@coderock.org, nacc@us.ibm.com, janitor@sternwelten.at From: domen@coderock.org Date: Wed, 12 Jan 2005 00:10:24 +0100 Message-Id: <20050111231024.CEF821F228@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 111 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Any comments would be appreciated. Description: Use msleep() instead of Wait() to guarantee the task delays as expected. Remove definition of Wait(). Signed-off-by: Nishanth Aravamudan Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/pcmcia/xirc2ps_cs.c | 23 +++++++++-------------- 1 files changed, 9 insertions(+), 14 deletions(-) diff -puN drivers/net/pcmcia/xirc2ps_cs.c~msleep-drivers_net_irda_pcmcia_xirc2ps_cs drivers/net/pcmcia/xirc2ps_cs.c --- kj/drivers/net/pcmcia/xirc2ps_cs.c~msleep-drivers_net_irda_pcmcia_xirc2ps_cs 2005-01-10 18:00:00.000000000 +0100 +++ kj-domen/drivers/net/pcmcia/xirc2ps_cs.c 2005-01-10 18:00:00.000000000 +0100 @@ -418,11 +418,6 @@ next_tuple(client_handle_t handle, tuple #define PutByte(reg,value) outb((value), ioaddr+(reg)) #define PutWord(reg,value) outw((value), ioaddr+(reg)) -#define Wait(n) do { \ - set_current_state(TASK_UNINTERRUPTIBLE); \ - schedule_timeout(n); \ -} while (0) - /*====== Functions used for debugging =================================*/ #if defined(PCMCIA_DEBUG) && 0 /* reading regs may change system status */ static void @@ -1716,12 +1711,12 @@ hardreset(struct net_device *dev) SelectPage(4); udelay(1); PutByte(XIRCREG4_GPR1, 0); /* clear bit 0: power down */ - Wait(HZ/25); /* wait 40 msec */ + msleep(40); /* wait 40 msec */ if (local->mohawk) PutByte(XIRCREG4_GPR1, 1); /* set bit 0: power up */ else PutByte(XIRCREG4_GPR1, 1 | 4); /* set bit 0: power up, bit 2: AIC */ - Wait(HZ/50); /* wait 20 msec */ + msleep(20); /* wait 20 msec */ } static void @@ -1735,9 +1730,9 @@ do_reset(struct net_device *dev, int ful hardreset(dev); PutByte(XIRCREG_CR, SoftReset); /* set */ - Wait(HZ/50); /* wait 20 msec */ + msleep(20); /* wait 20 msec */ PutByte(XIRCREG_CR, 0); /* clear */ - Wait(HZ/25); /* wait 40 msec */ + msleep(40); /* wait 40 msec */ if (local->mohawk) { SelectPage(4); /* set pin GP1 and GP2 to output (0x0c) @@ -1748,7 +1743,7 @@ do_reset(struct net_device *dev, int ful } /* give the circuits some time to power up */ - Wait(HZ/2); /* about 500ms */ + msleep(500); /* about 500ms */ local->last_ptr_value = 0; local->silicon = local->mohawk ? (GetByte(XIRCREG4_BOV) & 0x70) >> 4 @@ -1767,7 +1762,7 @@ do_reset(struct net_device *dev, int ful SelectPage(0x42); PutByte(XIRCREG42_SWC1, 0x80); } - Wait(HZ/25); /* wait 40 msec to let it complete */ + msleep(40); /* wait 40 msec to let it complete */ #ifdef PCMCIA_DEBUG if (pc_debug) { @@ -1826,7 +1821,7 @@ do_reset(struct net_device *dev, int ful printk(KERN_INFO "%s: MII selected\n", dev->name); SelectPage(2); PutByte(XIRCREG2_MSR, GetByte(XIRCREG2_MSR) | 0x08); - Wait(HZ/50); + msleep(20); } else { printk(KERN_INFO "%s: MII detected; using 10mbs\n", dev->name); @@ -1835,7 +1830,7 @@ do_reset(struct net_device *dev, int ful PutByte(XIRCREG42_SWC1, 0xC0); else /* enable 10BaseT */ PutByte(XIRCREG42_SWC1, 0x80); - Wait(HZ/25); /* wait 40 msec to let it complete */ + msleep(40); /* wait 40 msec to let it complete */ } if (full_duplex) PutByte(XIRCREG1_ECR, GetByte(XIRCREG1_ECR | FullDuplex)); @@ -1928,7 +1923,7 @@ init_mii(struct net_device *dev) * Fixme: Better to use a timer here! */ for (i=0; i < 35; i++) { - Wait(HZ/10); /* wait 100 msec */ + msleep(100); /* wait 100 msec */ status = mii_rd(ioaddr, 0, 1); if ((status & 0x0020) && (status & 0x0004)) break; _ From domen@coderock.org Tue Jan 11 15:10:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:10:49 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BNAfU1017833 for ; Tue, 11 Jan 2005 15:10:42 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id 848EA1F22F; Wed, 12 Jan 2005 00:10:40 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id AA54A1F226; Wed, 12 Jan 2005 00:10:39 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 838F71F225; Wed, 12 Jan 2005 00:10:34 +0100 (CET) Subject: [patch 09/19] net/ni65: replace schedule_timeout() with msleep() To: jgarzik@pobox.com Cc: netdev@oss.sgi.com, domen@coderock.org, nacc@us.ibm.com, janitor@sternwelten.at From: domen@coderock.org Date: Wed, 12 Jan 2005 00:10:34 +0100 Message-Id: <20050111231034.838F71F225@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 114 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Any comments would be appreciated. Description: Use msleep() instead of schedule_timeout() to guarantee the task delays as expected. Signed-off-by: Nishanth Aravamudan Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/ni65.c | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) diff -puN drivers/net/ni65.c~msleep-drivers_net_ni65 drivers/net/ni65.c --- kj/drivers/net/ni65.c~msleep-drivers_net_ni65 2005-01-10 18:00:02.000000000 +0100 +++ kj-domen/drivers/net/ni65.c 2005-01-10 18:00:02.000000000 +0100 @@ -526,8 +526,7 @@ static int __init ni65_probe1(struct net ni65_init_lance(p,dev->dev_addr,0,0); irq_mask = probe_irq_on(); writereg(CSR0_INIT|CSR0_INEA,CSR0); /* trigger interrupt */ - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ/50); + msleep(20); dev->irq = probe_irq_off(irq_mask); if(!dev->irq) { _ From domen@coderock.org Tue Jan 11 15:10:40 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:10:48 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BNAd4H017789 for ; Tue, 11 Jan 2005 15:10:40 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id 886791F230; Wed, 12 Jan 2005 00:10:38 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 4164E1F226; Wed, 12 Jan 2005 00:10:37 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 49F9D1F22A; Wed, 12 Jan 2005 00:10:31 +0100 (CET) Subject: [patch 08/19] net/ixgb_osdep: replace schedule_timeout() with msleep() To: jgarzik@pobox.com Cc: netdev@oss.sgi.com, domen@coderock.org, nacc@us.ibm.com, janitor@sternwelten.at From: domen@coderock.org Date: Wed, 12 Jan 2005 00:10:30 +0100 Message-Id: <20050111231031.49F9D1F22A@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 113 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Any comments would be appreciated. Description: Use msleep() instead of schedule_timeout() to guarantee the task delays as expected. I was told earlier that the in_interrupt() check is not necessary. It would be nice to get some verification of this (i.e. the driver functions the same without it). Signed-off-by: Nishanth Aravamudan Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/ixgb/ixgb_osdep.h | 8 +------- 1 files changed, 1 insertion(+), 7 deletions(-) diff -puN drivers/net/ixgb/ixgb_osdep.h~msleep-drivers_net_ixgb_ixgb_osdep drivers/net/ixgb/ixgb_osdep.h --- kj/drivers/net/ixgb/ixgb_osdep.h~msleep-drivers_net_ixgb_ixgb_osdep 2005-01-10 18:00:01.000000000 +0100 +++ kj-domen/drivers/net/ixgb/ixgb_osdep.h 2005-01-10 18:00:01.000000000 +0100 @@ -41,13 +41,7 @@ #include #ifndef msec_delay -#define msec_delay(x) do { if(in_interrupt()) { \ - /* Don't mdelay in interrupt context! */ \ - BUG(); \ - } else { \ - set_current_state(TASK_UNINTERRUPTIBLE); \ - schedule_timeout((x * HZ)/1000 + 2); \ - } } while(0) +#define msec_delay(x) msleep(x) #endif #define PCI_COMMAND_REGISTER PCI_COMMAND _ From domen@coderock.org Tue Jan 11 15:10:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:10:54 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BNAjr7017906 for ; Tue, 11 Jan 2005 15:10:46 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id 6ECB51F232; Wed, 12 Jan 2005 00:10:43 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 365671F226; Wed, 12 Jan 2005 00:10:43 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id B8C8A1F22A; Wed, 12 Jan 2005 00:10:37 +0100 (CET) Subject: [patch 10/19] net/ns83820: replace schedule_timeout() with msleep() To: jgarzik@pobox.com Cc: netdev@oss.sgi.com, domen@coderock.org, nacc@us.ibm.com, janitor@sternwelten.at From: domen@coderock.org Date: Wed, 12 Jan 2005 00:10:37 +0100 Message-Id: <20050111231037.B8C8A1F22A@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 115 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Any comments would be appreciated. Description: Use msleep() instead of schedule_timeout() to guarantee the task delays as expected. Signed-off-by: Nishanth Aravamudan Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/ns83820.c | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) diff -puN drivers/net/ns83820.c~msleep-drivers_net_ns83820 drivers/net/ns83820.c --- kj/drivers/net/ns83820.c~msleep-drivers_net_ns83820 2005-01-10 18:00:02.000000000 +0100 +++ kj-domen/drivers/net/ns83820.c 2005-01-10 18:00:02.000000000 +0100 @@ -2007,8 +2007,7 @@ static int __devinit ns83820_init_one(st if (reset_phy) { printk(KERN_INFO "%s: resetting phy\n", ndev->name); writel(dev->CFG_cache | CFG_PHY_RST, dev->base + CFG); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout((HZ+99)/100); + msleep(10); writel(dev->CFG_cache, dev->base + CFG); } _ From domen@coderock.org Tue Jan 11 15:10:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:10:56 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BNAmAe017969 for ; Tue, 11 Jan 2005 15:10:48 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id 1CC8A1F22A; Wed, 12 Jan 2005 00:10:46 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 32B331F226; Wed, 12 Jan 2005 00:10:46 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id E5DD51F225; Wed, 12 Jan 2005 00:10:40 +0100 (CET) Subject: [patch 11/19] net/tekram-sir: replace schedule_timeout() with msleep() To: jgarzik@pobox.com Cc: netdev@oss.sgi.com, domen@coderock.org, nacc@us.ibm.com, janitor@sternwelten.at From: domen@coderock.org Date: Wed, 12 Jan 2005 00:10:40 +0100 Message-Id: <20050111231040.E5DD51F225@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 116 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Any comments would be appreciated. Description: Use msleep() instead of schedule_timeout() to guarantee the task delays as expected. Signed-off-by: Nishanth Aravamudan Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/irda/tekram-sir.c | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) diff -puN drivers/net/irda/tekram-sir.c~msleep_interruptible-drivers_net_irda_tekram-sir drivers/net/irda/tekram-sir.c --- kj/drivers/net/irda/tekram-sir.c~msleep_interruptible-drivers_net_irda_tekram-sir 2005-01-10 18:00:06.000000000 +0100 +++ kj-domen/drivers/net/irda/tekram-sir.c 2005-01-10 18:00:06.000000000 +0100 @@ -210,8 +210,7 @@ static int tekram_reset(struct sir_dev * sirdev_set_dtr_rts(dev, FALSE, TRUE); /* Should sleep 1 ms */ - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(msecs_to_jiffies(1)); + msleep(1); /* Set DTR, Set RTS */ sirdev_set_dtr_rts(dev, TRUE, TRUE); _ From domen@coderock.org Tue Jan 11 15:10:52 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:11:00 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BNApof018050 for ; Tue, 11 Jan 2005 15:10:51 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id 382831F233; Wed, 12 Jan 2005 00:10:50 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 1A4D01F226; Wed, 12 Jan 2005 00:10:49 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 19A741F231; Wed, 12 Jan 2005 00:10:44 +0100 (CET) Subject: [patch 12/19] net/ixgb_ethtool: replace schedule_timeout() with msleep_interruptible() To: jgarzik@pobox.com Cc: netdev@oss.sgi.com, domen@coderock.org, nacc@us.ibm.com, janitor@sternwelten.at From: domen@coderock.org Date: Wed, 12 Jan 2005 00:10:43 +0100 Message-Id: <20050111231044.19A741F231@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 117 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Any comments would be appreciated. Description: Use msleep_interruptible() instead of schedule_timeout() to guarantee the task delays as expected. Signed-off-by: Nishanth Aravamudan Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/ixgb/ixgb_ethtool.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff -puN drivers/net/ixgb/ixgb_ethtool.c~msleep_interruptible-drivers_net_ixgb_ixgb_ethtool drivers/net/ixgb/ixgb_ethtool.c --- kj/drivers/net/ixgb/ixgb_ethtool.c~msleep_interruptible-drivers_net_ixgb_ixgb_ethtool 2005-01-10 18:00:06.000000000 +0100 +++ kj-domen/drivers/net/ixgb/ixgb_ethtool.c 2005-01-10 18:00:06.000000000 +0100 @@ -404,9 +404,9 @@ ixgb_ethtool_led_blink(struct net_device set_current_state(TASK_INTERRUPTIBLE); if (data) - schedule_timeout(data * HZ); + msleep_interruptible(data * 1000); else - schedule_timeout(MAX_SCHEDULE_TIMEOUT); + msleep_interruptible(jiffies_to_msecs(MAX_SCHEDULE_TIMEOUT)); del_timer_sync(&adapter->blink_timer); ixgb_led_off(&adapter->hw); _ From domen@coderock.org Tue Jan 11 15:11:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:11:07 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BNAwfY018268 for ; Tue, 11 Jan 2005 15:10:58 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id 2C5371F231; Wed, 12 Jan 2005 00:10:56 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id C52901F235; Wed, 12 Jan 2005 00:10:55 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id D3AD51F226; Wed, 12 Jan 2005 00:10:50 +0100 (CET) Subject: [patch 14/19] janitor: net/gt96100eth: pci_find_device to pci_get_device To: jgarzik@pobox.com Cc: netdev@oss.sgi.com, domen@coderock.org, sfeldma@pobox.com, janitor@sternwelten.at From: domen@coderock.org Date: Wed, 12 Jan 2005 00:10:50 +0100 Message-Id: <20050111231050.D3AD51F226@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 119 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Replace pci_find_device with pci_get_device/pci_dev_put to plug race with pci_find_device. Signed-off-by: Scott Feldman Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/gt96100eth.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff -puN drivers/net/gt96100eth.c~remove-pci-find-device-drivers_net_gt96100eth drivers/net/gt96100eth.c --- kj/drivers/net/gt96100eth.c~remove-pci-find-device-drivers_net_gt96100eth 2005-01-10 18:00:17.000000000 +0100 +++ kj-domen/drivers/net/gt96100eth.c 2005-01-10 18:00:17.000000000 +0100 @@ -615,9 +615,9 @@ static int gt96100_init_module(void) /* * Stupid probe because this really isn't a PCI device */ - if (!(pci = pci_find_device(PCI_VENDOR_ID_MARVELL, + if (!(pci = pci_get_device(PCI_VENDOR_ID_MARVELL, PCI_DEVICE_ID_MARVELL_GT96100, NULL)) && - !(pci = pci_find_device(PCI_VENDOR_ID_MARVELL, + !(pci = pci_get_device(PCI_VENDOR_ID_MARVELL, PCI_DEVICE_ID_MARVELL_GT96100A, NULL))) { printk(KERN_ERR __FILE__ ": GT96100 not found!\n"); return -ENODEV; @@ -627,12 +627,14 @@ static int gt96100_init_module(void) if (cpuConfig & (1<<12)) { printk(KERN_ERR __FILE__ ": must be in Big Endian mode!\n"); + pci_dev_put(pci); return -ENODEV; } for (i=0; i < NUM_INTERFACES; i++) retval |= gt96100_probe1(pci, i); + pci_dev_put(pci); return retval; } _ From domen@coderock.org Tue Jan 11 15:11:00 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:11:07 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BNAvP6018219 for ; Tue, 11 Jan 2005 15:10:57 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id EA0061F236; Wed, 12 Jan 2005 00:10:55 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id B86011F231; Wed, 12 Jan 2005 00:10:54 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 6E6501F225; Wed, 12 Jan 2005 00:10:47 +0100 (CET) Subject: [patch 13/19] net/cycx_drv: replace delay_cycx() with msleep_interruptible() To: jgarzik@pobox.com Cc: netdev@oss.sgi.com, domen@coderock.org, nacc@us.ibm.com, acme@conectiva.com.br, janitor@sternwelten.at From: domen@coderock.org Date: Wed, 12 Jan 2005 00:10:47 +0100 Message-Id: <20050111231047.6E6501F225@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 118 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Any comments would be appreciated. Description: Use msleep_interruptible() instead of delay_cycx() to guarantee the task delays as expected. Remove the prototype and definition of delay_cycx(). Signed-off-by: Nishanth Aravamudan Acked-by: Arnaldo Carvalho de Melo Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/wan/cycx_drv.c | 24 ++++++++---------------- 1 files changed, 8 insertions(+), 16 deletions(-) diff -puN drivers/net/wan/cycx_drv.c~msleep_interruptible-drivers_net_wan_cycx_drv drivers/net/wan/cycx_drv.c --- kj/drivers/net/wan/cycx_drv.c~msleep_interruptible-drivers_net_wan_cycx_drv 2005-01-10 18:00:08.000000000 +0100 +++ kj-domen/drivers/net/wan/cycx_drv.c 2005-01-10 18:00:08.000000000 +0100 @@ -56,7 +56,7 @@ #include /* for jiffies, HZ, etc. */ #include /* API definitions */ #include /* CYCX firmware module definitions */ -#include /* udelay */ +#include /* udelay, msleep */ #include /* read[wl], write[wl], ioremap, iounmap */ #define MOD_VERSION 0 @@ -74,7 +74,6 @@ static int reset_cyc2x(void __iomem *add static int detect_cyc2x(void __iomem *addr); /* Miscellaneous functions */ -static void delay_cycx(int sec); static int get_option_index(long *optlist, long optval); static u16 checksum(u8 *buf, u32 len); @@ -259,7 +258,7 @@ static int memory_exists(void __iomem *a if (readw(addr + 0x10) == TEST_PATTERN) return 1; - delay_cycx(1); + msleep_interruptible(1000); } return 0; @@ -316,7 +315,7 @@ static void cycx_reset_boot(void __iomem /* 80186 was in hold, go */ writeb(0, addr + START_CPU); - delay_cycx(1); + msleep_interruptible(1000); } /* Load data.bin file through boot (reset) interface. */ @@ -462,13 +461,13 @@ static int load_cyc2x(struct cycx_hw *hw cycx_reset_boot(hw->dpmbase, reset_image, img_hdr->reset_size); /* reset is waiting for boot */ writew(GEN_POWER_ON, pt_cycld); - delay_cycx(1); + msleep_interruptible(1000); for (j = 0 ; j < 3 ; j++) if (!readw(pt_cycld)) goto reset_loaded; else - delay_cycx(1); + msleep_interruptible(1000); } printk(KERN_ERR "%s: reset not started.\n", modname); @@ -495,7 +494,7 @@ reset_loaded: /* Arthur Ganzert's tip: wait a while after the firmware loading... seg abr 26 17:17:12 EST 1999 - acme */ - delay_cycx(7); + msleep_interruptible(7000); printk(KERN_INFO "%s: firmware loaded!\n", modname); /* enable interrupts */ @@ -547,20 +546,13 @@ static int get_option_index(long *optlis static int reset_cyc2x(void __iomem *addr) { writeb(0, addr + RST_ENABLE); - delay_cycx(2); + msleep_interruptible(2000); writeb(0, addr + RST_DISABLE); - delay_cycx(2); + msleep_interruptible(2000); return memory_exists(addr); } -/* Delay */ -static void delay_cycx(int sec) -{ - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(sec * HZ); -} - /* Calculate 16-bit CRC using CCITT polynomial. */ static u16 checksum(u8 *buf, u32 len) { _ From domen@coderock.org Tue Jan 11 15:11:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:11:20 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BNB5da018382 for ; Tue, 11 Jan 2005 15:11:06 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id DC7591F237; Wed, 12 Jan 2005 00:11:04 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 7222C1F231; Wed, 12 Jan 2005 00:11:03 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 52CDE1F225; Wed, 12 Jan 2005 00:10:57 +0100 (CET) Subject: [patch 16/19] janitor: net/tg3: pci_find_device to pci_dev_present To: jgarzik@pobox.com Cc: netdev@oss.sgi.com, domen@coderock.org, sfeldma@pobox.com, janitor@sternwelten.at From: domen@coderock.org Date: Wed, 12 Jan 2005 00:10:56 +0100 Message-Id: <20050111231057.52CDE1F225@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 120 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Replace pci_find_device with pci_dev_present. Compile tested. Signed-off-by: Scott Feldman Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/tg3.c | 24 ++++++++++++++---------- 1 files changed, 14 insertions(+), 10 deletions(-) diff -puN drivers/net/tg3.c~remove-pci-find-device-drivers_net_tg3 drivers/net/tg3.c --- kj/drivers/net/tg3.c~remove-pci-find-device-drivers_net_tg3 2005-01-10 18:00:18.000000000 +0100 +++ kj-domen/drivers/net/tg3.c 2005-01-10 18:00:18.000000000 +0100 @@ -7368,6 +7368,19 @@ static int __devinit tg3_is_sun_570X(str static int __devinit tg3_get_invariants(struct tg3 *tp) { + static struct pci_device_id write_reorder_chipsets[] = { + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82801AA_8) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82801AB_8) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82801BA_11) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82801BA_6) }, + { PCI_DEVICE(PCI_VENDOR_ID_AMD, + PCI_DEVICE_ID_AMD_FE_GATE_700C) }, + { }, + }; u32 misc_ctrl_reg; u32 cacheline_sz_reg; u32 pci_state_reg, grc_misc_cfg; @@ -7386,16 +7399,7 @@ static int __devinit tg3_get_invariants( * every mailbox register write to force the writes to be * posted to the chip in order. */ - if (pci_find_device(PCI_VENDOR_ID_INTEL, - PCI_DEVICE_ID_INTEL_82801AA_8, NULL) || - pci_find_device(PCI_VENDOR_ID_INTEL, - PCI_DEVICE_ID_INTEL_82801AB_8, NULL) || - pci_find_device(PCI_VENDOR_ID_INTEL, - PCI_DEVICE_ID_INTEL_82801BA_11, NULL) || - pci_find_device(PCI_VENDOR_ID_INTEL, - PCI_DEVICE_ID_INTEL_82801BA_6, NULL) || - pci_find_device(PCI_VENDOR_ID_AMD, - PCI_DEVICE_ID_AMD_FE_GATE_700C, NULL)) + if (pci_dev_present(write_reorder_chipsets)) tp->tg3_flags |= TG3_FLAG_MBOX_WRITE_REORDER; /* Force memory write invalidate off. If we leave it on, _ From domen@coderock.org Tue Jan 11 15:11:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:11:24 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BNB9ix018456 for ; Tue, 11 Jan 2005 15:11:10 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id D6C331F238; Wed, 12 Jan 2005 00:11:08 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id A7DB51F225; Wed, 12 Jan 2005 00:11:06 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 36CAF1F228; Wed, 12 Jan 2005 00:10:54 +0100 (CET) Subject: [patch 15/19] janitor: net/ixgb: remove pci_find_device To: jgarzik@pobox.com Cc: netdev@oss.sgi.com, domen@coderock.org, sfeldma@pobox.com, janitor@sternwelten.at From: domen@coderock.org Date: Wed, 12 Jan 2005 00:10:53 +0100 Message-Id: <20050111231054.36CAF1F228@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 123 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Removing pci_find_device required removing driver's custom reboot notifier which walked the device list and then called the suspend func. But, the suspend func isn't even hooked up to the driver's PM ->suspend hook! So it's vestigial (cut- and-paste from e1000). If ixgb ever implements PM hooks, and there is a need to call ->suspend during shutdown, then ->shutdown can be implemented. The need would be something like Wake-on-LAN (10GbE?) arming. Until then, all this code needs to go. Compile tested. Signed-off-by: Scott Feldman Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/ixgb/ixgb_main.c | 68 ---------------------------------- 1 files changed, 1 insertion(+), 67 deletions(-) diff -puN drivers/net/ixgb/ixgb_main.c~remove-pci-find-device-drivers_net_ixgb_ixgb_main drivers/net/ixgb/ixgb_main.c --- kj/drivers/net/ixgb/ixgb_main.c~remove-pci-find-device-drivers_net_ixgb_ixgb_main 2005-01-10 18:00:17.000000000 +0100 +++ kj-domen/drivers/net/ixgb/ixgb_main.c 2005-01-10 18:00:17.000000000 +0100 @@ -105,21 +105,11 @@ static void ixgb_vlan_rx_add_vid(struct static void ixgb_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid); static void ixgb_restore_vlan(struct ixgb_adapter *adapter); -static int ixgb_notify_reboot(struct notifier_block *, unsigned long event, - void *ptr); -static int ixgb_suspend(struct pci_dev *pdev, uint32_t state); - #ifdef CONFIG_NET_POLL_CONTROLLER /* for netdump / net console */ static void ixgb_netpoll(struct net_device *dev); #endif -struct notifier_block ixgb_notifier_reboot = { - .notifier_call = ixgb_notify_reboot, - .next = NULL, - .priority = 0 -}; - /* Exported from other modules */ extern void ixgb_check_options(struct ixgb_adapter *adapter); @@ -130,9 +120,6 @@ static struct pci_driver ixgb_driver = { .id_table = ixgb_pci_tbl, .probe = ixgb_probe, .remove = __devexit_p(ixgb_remove), - /* Power Managment Hooks */ - .suspend = NULL, - .resume = NULL }; MODULE_AUTHOR("Intel Corporation, "); @@ -154,17 +141,12 @@ MODULE_LICENSE("GPL"); static int __init ixgb_init_module(void) { - int ret; printk(KERN_INFO "%s - version %s\n", ixgb_driver_string, ixgb_driver_version); printk(KERN_INFO "%s\n", ixgb_copyright); - ret = pci_module_init(&ixgb_driver); - if (ret >= 0) { - register_reboot_notifier(&ixgb_notifier_reboot); - } - return ret; + return pci_module_init(&ixgb_driver); } module_init(ixgb_init_module); @@ -178,7 +160,6 @@ module_init(ixgb_init_module); static void __exit ixgb_exit_module(void) { - unregister_reboot_notifier(&ixgb_notifier_reboot); pci_unregister_driver(&ixgb_driver); } @@ -2064,53 +2045,6 @@ static void ixgb_restore_vlan(struct ixg } } -/** - * ixgb_notify_reboot - handles OS notification of reboot event. - * @param nb notifier block, unused - * @param event Event being passed to driver to act upon - * @param p A pointer to our net device - **/ -static int -ixgb_notify_reboot(struct notifier_block *nb, unsigned long event, void *p) -{ - struct pci_dev *pdev = NULL; - - switch (event) { - case SYS_DOWN: - case SYS_HALT: - case SYS_POWER_OFF: - while ((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev))) { - if (pci_dev_driver(pdev) == &ixgb_driver) - ixgb_suspend(pdev, 3); - } - } - return NOTIFY_DONE; -} - -/** - * ixgb_suspend - driver suspend function called from notify. - * @param pdev pci driver structure used for passing to - * @param state power state to enter - **/ -static int ixgb_suspend(struct pci_dev *pdev, uint32_t state) -{ - struct net_device *netdev = pci_get_drvdata(pdev); - struct ixgb_adapter *adapter = netdev->priv; - - netif_device_detach(netdev); - - if (netif_running(netdev)) - ixgb_down(adapter, TRUE); - - pci_save_state(pdev); - - state = (state > 0) ? 3 : 0; - pci_set_power_state(pdev, state); - msec_delay(200); - - return 0; -} - #ifdef CONFIG_NET_POLL_CONTROLLER /* * Polling 'interrupt' - used by things like netconsole to send skbs _ From domen@coderock.org Tue Jan 11 15:11:14 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:11:23 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BNBATi018482 for ; Tue, 11 Jan 2005 15:11:11 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id DE8B61F226; Wed, 12 Jan 2005 00:11:09 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 269E21F235; Wed, 12 Jan 2005 00:11:07 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 85B611F226; Wed, 12 Jan 2005 00:11:00 +0100 (CET) Subject: [patch 17/19] net/stir4200: replace direct assignment with set_current_state() To: jgarzik@pobox.com Cc: netdev@oss.sgi.com, domen@coderock.org, nacc@us.ibm.com, janitor@sternwelten.at From: domen@coderock.org Date: Wed, 12 Jan 2005 00:11:00 +0100 Message-Id: <20050111231100.85B611F226@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 121 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Any comments would be appreciated. Description: Use set_current_state() instead of direct assignment of current->state. Signed-off-by: Nishanth Aravamudan Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/irda/stir4200.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN drivers/net/irda/stir4200.c~set_current_state-drivers_net_irda_stir4200 drivers/net/irda/stir4200.c --- kj/drivers/net/irda/stir4200.c~set_current_state-drivers_net_irda_stir4200 2005-01-10 18:00:18.000000000 +0100 +++ kj-domen/drivers/net/irda/stir4200.c 2005-01-10 18:00:18.000000000 +0100 @@ -679,7 +679,7 @@ static void turnaround_delay(const struc ticks = us / (1000000 / HZ); if (ticks > 0) { - current->state = TASK_INTERRUPTIBLE; + set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(1 + ticks); } else udelay(us); _ From domen@coderock.org Tue Jan 11 15:11:16 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:11:24 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BNBEut018559 for ; Tue, 11 Jan 2005 15:11:15 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id ACF471F230; Wed, 12 Jan 2005 00:11:13 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id CA0381F225; Wed, 12 Jan 2005 00:11:12 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id C176C1F234; Wed, 12 Jan 2005 00:11:03 +0100 (CET) Subject: [patch 18/19] net/ewrk3: replace schedule_timeout() with msleep_interruptible() To: jgarzik@pobox.com Cc: netdev@oss.sgi.com, domen@coderock.org, nacc@us.ibm.com From: domen@coderock.org Date: Wed, 12 Jan 2005 00:11:03 +0100 Message-Id: <20050111231103.C176C1F234@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 122 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Any comments would be, as always, appreciated. -Nish Description: Uses msleep() instead of schedule_timeout() to guarantee the task delays as expected. Signed-off-by: Nishanth Aravamudan Signed-off-by: Domen Puncer --- kj-domen/drivers/net/ewrk3.c | 3 +-- 1 files changed, 1 insertion(+), 2 deletions(-) diff -puN drivers/net/ewrk3.c~msleep_interruptible-drivers_net_ewrk3 drivers/net/ewrk3.c --- kj/drivers/net/ewrk3.c~msleep_interruptible-drivers_net_ewrk3 2005-01-10 18:00:24.000000000 +0100 +++ kj-domen/drivers/net/ewrk3.c 2005-01-10 18:00:24.000000000 +0100 @@ -1654,8 +1654,7 @@ static int ewrk3_phys_id(struct net_devi /* Wait a little while */ spin_unlock_irqrestore(&lp->hw_lock, flags); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ>>2); + msleep(250); spin_lock_irqsave(&lp->hw_lock, flags); /* Exit if we got a signal */ _ From domen@coderock.org Tue Jan 11 15:12:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:12:41 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BNCGR2019896 for ; Tue, 11 Jan 2005 15:12:20 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id A2D4C1F226; Wed, 12 Jan 2005 00:12:15 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 6D2081F225; Wed, 12 Jan 2005 00:12:13 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 15F6D1F228; Wed, 12 Jan 2005 00:11:07 +0100 (CET) Subject: [patch 19/19] drivers/net/myri_code.h cleanup To: jgarzik@pobox.com Cc: netdev@oss.sgi.com, domen@coderock.org From: domen@coderock.org Date: Wed, 12 Jan 2005 00:11:06 +0100 Message-Id: <20050111231107.15F6D1F228@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 124 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Cleanup initialization to 0. Basically it does: -static unsigned char lanai4_data[20472] __initdata = { -0x00,0x00, - a bunch of zeroes -0x00,0x00, 0x00,0x00, 0x00,0x00, } ; +static unsigned char lanai4_data[20472] __initdata = { }; Signed-off-by: Domen Puncer --- kj-domen/drivers/net/myri_code.h | 1283 --------------------------------------- 1 files changed, 1 insertion(+), 1282 deletions(-) diff -puN drivers/net/myri_code.h~myri_code_cleanup drivers/net/myri_code.h --- kj/drivers/net/myri_code.h~myri_code_cleanup 2005-01-10 18:00:28.000000000 +0100 +++ kj-domen/drivers/net/myri_code.h 2005-01-10 18:00:28.000000000 +0100 @@ -4775,1288 +4775,7 @@ static unsigned char lanai4_code[76256] /* This is the LANai data */ static unsigned int lanai4_data_off = 0x94F0; /* half-word offset */ -static unsigned char lanai4_data[20472] __initdata = { -0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x01, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, 0x00,0x00, -0x00,0x00, 0x00,0x00, 0x00,0x00, } ; +static unsigned char lanai4_data[20472] __initdata = { }; #ifdef SYMBOL_DEFINES_COMPILED _ From Robert.Olsson@data.slu.se Tue Jan 11 15:41:32 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:41:40 -0800 (PST) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BNfVfH029856 for ; Tue, 11 Jan 2005 15:41:31 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.12.10/8.12.10) with ESMTP id j0BGebAe018835; Tue, 11 Jan 2005 17:41:15 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 8CE98EC1A0; Tue, 11 Jan 2005 17:40:29 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16868.381.537772.831831@robur.slu.se> Date: Tue, 11 Jan 2005 17:40:29 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Stephen Hemminger , Jesse Brandeburg , Robert Olsson Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501110917.26621.jeremy.guthrie@berbee.com> References: <200501071650.56423.jeremy.guthrie@berbee.com> <20050107145711.367aa159@dxpl.pdx.osdl.net> <200501110917.26621.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 125 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev About the same load as last time 80 kpps forwarded and droprate of ~200 pps and 2323 fib lookups/sec. Not so bad for PIII but it maybe tuned better. Did the e1000 patch cure the problem that interrupts got enabled for unidirectional traffic? Ring size? I've never seen any win in system performance w. RX rings larger than 256 at least not in lab. --ro Jeremy M. Guthrie writes: > date ; ifconfig eth3 ; cat /proc/net/softnet_stat ; > cat /proc/net/stat/rt_cache ; sleep 60 ; date ; ifconfig eth3 ; > cat /proc/net/softnet_stat ; cat /proc/net/stat/rt_cache > > Tue Jan 11 09:12:21 CST 2005 > eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 > inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255.0 > inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:3519452697 errors:5558592 dropped:5558592 > overruns:4011523 frame:0 > TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:1000 > RX bytes:497775695 (474.7 Mb) TX bytes:398 (398.0 b) > Base address:0x22a0 Memory:eff80000-effa0000 > > f59427dc 150dc67c 00c562ab 000d2659 00000000 00000000 00000000 00000000 > 00547b5b > 00038622 00000000 00000065 00000000 00000000 00000000 00000000 00000000 > 0006804f > entries in_hit in_slow_tot in_no_route in_brd in_martian_dst in_martian_src > out_hit out_slow_tot out_slow_mc gc_total gc_ignored gc_goal_miss > gc_dst_overflow in_hlist_search out_hlist_search > 0000f3c2 aeca1565 272c383d 00000000 00000000 000089a8 00005298 00000002 > 001db403 0003054f 00000000 230aa73c 22fe33eb 00000cf0 00000000 b37011dc > 00957c14 > 0000f3c2 0000b975 00029703 00000000 00000000 000035a5 00000000 00000000 > 00000015 00000083 00000002 000038c8 000038a3 00000000 00000000 0012a566 > 0000014d > > Tue Jan 11 09:13:21 CST 2005 > eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 > inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255.0 > inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:3524302561 errors:5571396 dropped:5571396 > overruns:4022383 frame:0 > TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:1000 > RX bytes:3065327250 (2923.3 Mb) TX bytes:398 (398.0 b) > Base address:0x22a0 Memory:eff80000-effa0000 > > f5de26f5 150dc67c 00c562b4 000d2659 00000000 00000000 00000000 00000000 > 00547ffd > 00038632 00000000 00000065 00000000 00000000 00000000 00000000 00000000 > 0006807c > entries in_hit in_slow_tot in_no_route in_brd in_martian_dst in_martian_src > out_hit out_slow_tot out_slow_mc gc_total gc_ignored gc_goal_miss > gc_dst_overflow in_hlist_search out_hlist_search > 0000fc1e af11f07b 272e58d3 00000000 00000000 000089a8 00005298 00000002 > 001db571 00030572 00000000 230cc7f1 23005428 00000cf0 00000000 b4b5b529 > 009583b9 > 0000fc1e 0000b977 00029710 00000000 00000000 000035a7 00000000 00000000 > 00000015 00000083 00000002 000038ca 000038a5 00000000 00000000 0012a5c8 > 0000014d > > -- > > -------------------------------------------------- > Jeremy M. Guthrie jeremy.guthrie@berbee.com > Senior Network Engineer Phone: 608-298-1061 > Berbee Fax: 608-288-3007 > 5520 Research Park Drive NOC: 608-298-1102 > Madison, WI 53711 From Robert.Olsson@data.slu.se Tue Jan 11 15:45:22 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 15:45:28 -0800 (PST) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0BNjLsr030353 for ; Tue, 11 Jan 2005 15:45:21 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.12.10/8.12.10) with ESMTP id j0BIkOAe005038; Tue, 11 Jan 2005 19:46:41 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 8EB3CEC1A0; Tue, 11 Jan 2005 19:46:24 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16868.7936.512676.178828@robur.slu.se> Date: Tue, 11 Jan 2005 19:46:24 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Stephen Hemminger , Jesse Brandeburg , Robert Olsson Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501111118.00601.jeremy.guthrie@berbee.com> References: <20050107145711.367aa159@dxpl.pdx.osdl.net> <200501110917.26621.jeremy.guthrie@berbee.com> <200501111118.00601.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 126 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Yes rtstats is what we estimated. How about RX ring size and the e1000 fix? We give up here? Or you want to try another setting of route hash? It's beyond the scope of this subject. You have to reboot if so. --ro Jeremy M. Guthrie writes: > ./rtstat > size IN: hit tot mc no_rt bcast madst masrc OUT: hit tot mc > GC: tot ignored goal_miss ovrf HASH: in_search out_search > 63375 86092 2844 0 0 0 0 0 5 1 > 1610369017 2846 2844 0 0 386039 17 > 64870 84431 537031471 537492192 0 0 0 0 1 0 > 0 2848 2846 0 0 386130 10 > 58707 87889 2715 0 0 0 0 0 7 1 0 > 2716 2714 0 0 384782 13 > 60617 89993 2796 0 0 0 0 0 5 0 0 > 2795 2793 0 0 384432 17 > 62458 93221 2772 0 0 0 0 0 3 0 0 > 2772 2770 0 0 399579 9 > 63990 93792 2712 0 0 0 0 0 6 0 0 > 2713 2711 0 0 422585 12 > 65499 94235 2846 0 0 0 0 0 2 0 0 > 2846 2844 0 0 424341 9 > 59755 90992 2864 0 0 0 0 0 1 1 0 > 2865 2863 0 0 385888 13 > 61702 87681 2798 0 0 0 0 0 6 2 0 > 2800 2798 0 0 383276 34 > 63334 90557 2734 0 0 0 0 0 5 1 0 > 2735 2733 0 0 422121 28 > 64798 88178 2732 0 0 0 0 0 1 0 0 > 2732 2730 0 0 410772 11 > 58574 85910 2669 0 0 0 0 0 3 0 0 > 2670 2668 0 0 393331 10 > 60538 87238 2705 0 0 0 0 0 4 0 0 > 2705 2703 0 0 382161 20 > 62164 85738 2628 0 0 0 0 0 4 0 0 > 2628 2626 0 0 373049 25 > 63759 78752 2638 0 0 0 0 0 2 0 0 > 2638 2636 0 0 348411 5 > 65052 79832 2482 0 0 0 0 0 3 0 0 > 2481 2479 0 0 365871 20 > 58986 82611 2549 0 0 0 0 0 4 1 0 > 2550 2548 0 0 366429 24 > 60845 85340 2620 0 0 1 0 0 2 0 0 > 2620 2618 0 0 369963 16 > 62465 83122 2591 0 0 0 0 0 5 0 0 > 2591 2589 0 0 371261 18 > size IN: hit tot mc no_rt bcast madst masrc OUT: hit tot mc > GC: tot ignored goal_miss ovrf HASH: in_search out_search > 63998 86141 2640 0 0 0 0 0 4 0 > 537114631 2640 2638 0 0 386452 15 > 65294 85989 2527 0 0 0 0 0 5 1 > 1610369017 2528 2526 0 0 379801 26 > 59241 84305 2662 0 0 0 0 0 7 0 0 > 2662 2660 0 0 371925 35 > 61194 85397 2837 0 0 0 0 0 3 0 0 > 2837 2835 0 0 374788 17 > 62908 88133 2688 0 0 1 0 0 4 1 0 > 2689 2687 0 0 382411 19 > 64329 88495 2648 0 0 0 0 0 5 1 0 > 2649 2647 0 0 398763 30 > 65560 84994 2447 0 0 1 0 0 6 2 0 > 2449 2447 0 0 394745 33 > 59677 81478 2568 0 0 0 0 0 5 0 0 > 2569 2567 0 0 341439 22 > 61459 81225 2623 0 0 0 0 0 5 0 0 > 2623 2621 0 0 345996 30 > 63038 83660 2544 0 0 0 0 0 3 0 0 > 2544 2542 0 0 381567 21 > 64494 86321 2620 0 0 0 0 0 4 0 0 > 2620 2618 0 0 395278 19 > 65528 88754 2766 0 0 0 0 0 6 0 0 > 2765 2763 0 0 421075 34 > 59948 86443 2990 0 0 0 0 0 5 0 0 > 2990 2988 0 0 373605 29 > 61860 81912 2786 0 0 0 0 0 5 1 0 > 2787 2785 0 0 354678 34 > 63630 80399 2981 0 0 0 0 0 4 0 0 > 2979 2977 0 0 354983 32 > 65215 83600 2934 0 0 0 0 0 6 3 0 > 2937 2935 0 0 371497 41 > 59322 85583 2821 0 0 0 0 0 7 0 0 > 2822 2820 0 0 382896 40 > 61268 82602 2817 0 0 0 0 0 9 2 0 > 2819 2817 0 0 368078 54 > 62989 85336 2760 0 0 1 0 0 9 0 0 > 2760 2758 0 0 394212 39 > 64387 84861 2603 0 0 0 0 0 7 0 0 > 2602 2600 0 0 390852 36 > size IN: hit tot mc no_rt bcast madst masrc OUT: hit tot mc > GC: tot ignored goal_miss ovrf HASH: in_search out_search > 65681 82848 2625 0 0 0 0 0 8 0 > 537114631 2625 2623 0 0 370769 49 > 59923 82826 2685 0 0 0 0 0 6 0 > 1610369017 2685 2683 0 0 344094 41 > 61700 82705 2706 0 0 0 0 0 7 0 0 > 2706 2704 0 0 368474 39 > 63247 91042 2592 0 0 0 0 0 9 1 0 > 2593 2591 0 0 399393 57 > 64636 93050 2530 0 0 0 0 0 6 0 0 > 2530 2528 0 0 405903 24 > 58301 90662 2554 0 0 0 0 0 5 0 0 > 2555 2553 0 0 404296 39 > 60146 88405 2567 0 0 0 0 0 8 1 0 > 2567 2565 0 0 370227 49 > 61822 86417 2579 0 0 0 0 0 7 1 0 > 2580 2578 0 0 366323 43 > 63351 86517 2594 0 0 1 0 0 9 0 0 > 2594 2592 0 0 363340 51 > 64739 87879 2669 0 0 0 0 0 3 0 0 > 2670 2668 0 0 387580 26 > 58397 88297 2566 0 0 0 0 0 4 0 0 > 2566 2564 0 0 396980 34 > 60352 85039 2707 0 0 0 0 0 6 1 0 > 2709 2707 0 0 367790 47 > 62169 87083 2779 0 0 0 0 0 6 0 0 > 2775 2773 0 0 377163 31 > 63808 88700 2752 0 0 0 0 0 4 0 0 > 2751 2749 0 0 392830 28 > 65189 91242 2725 0 0 0 0 0 5 1 0 > 2727 2725 0 0 416871 31 > 59326 84893 2834 0 0 0 0 0 5 1 0 > 2828 2826 0 0 380811 28 > 61064 87351 2553 0 0 0 0 0 9 0 0 > 2552 2550 0 0 382053 37 > 62637 88761 2551 0 0 0 0 0 5 1 0 > 2553 2551 0 0 384974 29 > > -- > > -------------------------------------------------- > Jeremy M. Guthrie jeremy.guthrie@berbee.com > Senior Network Engineer Phone: 608-298-1061 > Berbee Fax: 608-288-3007 > 5520 Research Park Drive NOC: 608-298-1102 > Madison, WI 53711 From brazilnut@us.ibm.com Tue Jan 11 16:05:56 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 16:06:02 -0800 (PST) Received: from e2.ny.us.ibm.com (e2.ny.us.ibm.com [32.97.182.142]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0C05nSC031692 for ; Tue, 11 Jan 2005 16:05:56 -0800 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e2.ny.us.ibm.com (8.12.10/8.12.10) with ESMTP id j0C05bBW007712 for ; Tue, 11 Jan 2005 19:05:37 -0500 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j0C05VvF284112 for ; Tue, 11 Jan 2005 19:05:31 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j0C05VLK028971 for ; Tue, 11 Jan 2005 19:05:31 -0500 Received: from DYN319661.beaverton.ibm.com (DYN319661.beaverton.ibm.com [9.47.22.144]) by d01av02.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j0C05UoC028954; Tue, 11 Jan 2005 19:05:31 -0500 Received: by DYN319661.beaverton.ibm.com (Postfix, from userid 1000) id 773D2229444; Tue, 11 Jan 2005 16:04:58 -0800 (PST) Date: Tue, 11 Jan 2005 16:04:58 -0800 From: Don Fry To: domen@coderock.org Cc: tsbogend@alpha.franken.de, netdev@oss.sgi.com, nacc@us.ibm.com, janitor@sternwelten.at Subject: Re: [patch 1/1] net/pcnet32: replace schedule_timeout() with msleep_interruptible() Message-ID: <20050112000458.GA17834@us.ibm.com> References: <20050111230150.1B6141F225@trashy.coderock.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050111230150.1B6141F225@trashy.coderock.org> User-Agent: Mutt/1.5.6i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 127 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brazilnut@us.ibm.com Precedence: bulk X-list: netdev Looks and runs fine. Signed-off-by: Don Fry On Wed, Jan 12, 2005 at 12:01:49AM +0100, domen@coderock.org wrote: > > > > Any comments would be appreciated. > > Description: Use msleep_interruptible() instead of schedule_timeout() to > guarantee the task delays as expected. > > Signed-off-by: Nishanth Aravamudan > Signed-off-by: Maximilian Attems > Signed-off-by: Domen Puncer > --- > > > kj-domen/drivers/net/pcnet32.c | 2 +- > 1 files changed, 1 insertion(+), 1 deletion(-) > > diff -puN drivers/net/pcnet32.c~msleep_interruptible-drivers_net_pcnet32 drivers/net/pcnet32.c > --- kj/drivers/net/pcnet32.c~msleep_interruptible-drivers_net_pcnet32 2005-01-10 18:00:07.000000000 +0100 > +++ kj-domen/drivers/net/pcnet32.c 2005-01-10 18:00:07.000000000 +0100 > @@ -847,7 +847,7 @@ static int pcnet32_phys_id(struct net_de > if ((!data) || (data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ))) > data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ); > > - schedule_timeout(data * HZ); > + msleep_interruptible(data * 1000); > del_timer_sync(&lp->blink_timer); > > /* Restore the original value of the bcrs */ > _ > > -- Don Fry brazilnut@us.ibm.com From jdmason@us.ibm.com Tue Jan 11 16:23:10 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 16:23:17 -0800 (PST) Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.133]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0C0N6oW003350 for ; Tue, 11 Jan 2005 16:23:06 -0800 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [9.17.195.107]) by e35.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j0C0N0Z7386680 for ; Tue, 11 Jan 2005 19:23:00 -0500 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay05.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j0C0N0U2217790 for ; Tue, 11 Jan 2005 17:23:00 -0700 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j0C0MxEr001423 for ; Tue, 11 Jan 2005 17:23:00 -0700 Received: from dreadnought.austin.ibm.com (dreadnought.austin.ibm.com [9.41.94.123]) by d03av01.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j0C0Mxlg001412; Tue, 11 Jan 2005 17:22:59 -0700 From: Jon Mason Organization: IBM To: Francois Romieu Subject: [PATCH] r8169: Large Send clean-up and slight MTU range increase Date: Tue, 11 Jan 2005 18:22:55 -0600 User-Agent: KMail/1.7.2 Cc: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501111822.56019.jdmason@us.ibm.com> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 128 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jdmason@us.ibm.com Precedence: bulk X-list: netdev Increase of the "safe" Large Send MTU from 7200 to 7808. This required modification of the value of the Early Tx Threshold register from 0x3F to 0x35. The value of 0x35 was determined through the "trial and error" method, and is necessary for all MTUs > 7400. Also, ignoring the RxRWT error (Receive Watchdog Timer Expired) as it is not valid if Large Send is enabled (though it only seems to log this error if the packet is > 7808 and not > 4096 as the documentation suggest). I can find no way of disabling that error. The other changes are self-explanatory. Tested on AMD64. Signed-off-by: Jon Mason --- --- drivers/net/r8169.c.orig 2005-01-11 17:05:58.000000000 -0600 +++ drivers/net/r8169.c 2005-01-11 17:27:45.000000000 -0600 @@ -105,14 +105,13 @@ static int multicast_filter_limit = 32; /* MAC address length*/ #define MAC_ADDR_LEN 6 -#define TX_FIFO_THRESH 256 /* In bytes */ - #define RX_FIFO_THRESH 7 /* 7 means NO threshold, Rx buffer level before first PCI xfer. */ #define RX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ #define TX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ #define EarlyTxThld 0x3F /* 0x3F means NO early transmit */ +#define LargeSendETT 0x35 #define RxPacketMaxSize 0x3FE8 /* 16K - 1 - ETH_HLEN - VLAN - CRC... */ -#define SafeMtu 0x1c20 /* ... actually life sucks beyond ~7k */ +#define SafeMtu 0x1E80 /* Packets > 7808 get broken into 2 desc */ #define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */ #define R8169_REGS_SIZE 256 @@ -1545,12 +1544,17 @@ rtl8169_hw_start(struct net_device *dev) RTL_W8(Cfg9346, Cfg9346_Unlock); RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); - RTL_W8(EarlyTxThres, EarlyTxThld); - // For gigabit rtl8169, MTU + header + CRC + VLAN + /* The default EarlyTxThres setting does not work for MTUs > 7400 */ + if (dev->mtu < 7400) + RTL_W8(EarlyTxThres, EarlyTxThld); + else + RTL_W8(EarlyTxThres, LargeSendETT); + + /* For gigabit rtl8169, MTU + header + CRC + VLAN */ RTL_W16(RxMaxSize, tp->rx_buf_sz); - // Set Rx Config register + /* Set Rx Config register */ i = rtl8169_rx_config | (RTL_R32(RxConfig) & rtl_chip_info[tp->chipset].RxConfigMask); RTL_W32(RxConfig, i); @@ -2138,8 +2142,9 @@ rtl8169_rx_interrupt(struct net_device * if (status & DescOwn) break; - if (status & RxRES) { - printk(KERN_INFO "%s: Rx ERROR!!!\n", dev->name); + + if (status & RxRES && !(status & RxRWT)) { + printk(KERN_INFO "%s: Rx ERROR %x!!!\n", dev->name, status); tp->stats.rx_errors++; if (status & (RxRWT | RxRUNT)) tp->stats.rx_length_errors++; @@ -2148,7 +2153,7 @@ rtl8169_rx_interrupt(struct net_device * } else { struct RxDesc *desc = tp->RxDescArray + entry; struct sk_buff *skb = tp->Rx_skbuff[entry]; - int pkt_size = (status & 0x00001FFF) - 4; + int pkt_size = (status & 0x00003FFF) - 4; void (*pci_action)(struct pci_dev *, dma_addr_t, size_t, int) = pci_dma_sync_single_for_device; @@ -2187,7 +2192,7 @@ rtl8169_rx_interrupt(struct net_device * tp->cur_rx = cur_rx; delta = rtl8169_rx_fill(tp, dev, tp->dirty_rx, tp->cur_rx); - if (delta < 0) { + if (delta < 1) { printk(KERN_INFO "%s: no Rx buffer allocated\n", dev->name); delta = 0; } From craiger@osdl.org Tue Jan 11 16:56:18 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 16:56:25 -0800 (PST) Received: from fire-1.osdl.org (fire.osdl.org [65.172.181.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0C0uHY1005087 for ; Tue, 11 Jan 2005 16:56:18 -0800 Received: from bullpen.pdx.osdl.net (fw.osdl.org [65.172.181.6]) (authenticated bits=0) by fire-1.osdl.org (8.12.8/8.12.8) with ESMTP id j0C0u77t032558 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Tue, 11 Jan 2005 16:56:07 -0800 Subject: Re: Fw: Network driver test suite? From: Craig Thomas To: netdev@oss.sgi.com Cc: dhollis@davehollis.com, cliffw@osdl.org, shemminger@osdl.org In-Reply-To: <20050105152635.290ad9c0@dxpl.pdx.osdl.net> References: <20050105152635.290ad9c0@dxpl.pdx.osdl.net> Content-Type: text/plain Message-Id: <1105493554.28674.49.camel@bullpen.pdx.osdl.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Tue, 11 Jan 2005 17:32:34 -0800 Content-Transfer-Encoding: 7bit X-MIMEDefang-Filter: osdl$Revision: 1.98 $ X-Scanned-By: MIMEDefang 2.36 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 129 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: craiger@osdl.org Precedence: bulk X-list: netdev On Wed, 2005-01-05 at 15:26, Stephen Hemminger wrote: > Begin forwarded message: > > Date: Wed, 05 Jan 2005 15:19:46 -0500 > From: David Hollis > To: Netdev > Subject: Network driver test suite? > > > Is there any kind of test suite (automated or list of tests) available > for testing Linux network drivers? I'm completing the addition of a few > new USB ethernet devices and would like to able to test all possible > scenarios instead of coming across them piece-meal in the future. I'm > not a big fan of the "works on my box" testing that I'm doing now. I'm > sure there are all kinds of things that I'm not testing that aren't > everyday types of things such as VLANs, multicasting, various > ethtool/mii-tool things, large packets, etc. Would there be a desire for someone to collect the tests or at least create an index to all their locations? If so, then developers can scan a library of potential tests to run against newly developed code. OSDL can start incorporating some of these tests into their test platform as well. > > If there isn't anything like this, maybe it would be a useful thing to > develop? At a minimum, maybe to set the treshhold for minimum features > that drivers support and the like. From jeremy.guthrie@berbee.com Tue Jan 11 17:27:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 17:27:34 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0C1RRtT007226 for ; Tue, 11 Jan 2005 17:27:28 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Tue, 11 Jan 2005 19:27:21 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Tue, 11 Jan 2005 19:27:13 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson , Stephen Hemminger , Jesse Brandeburg References: <200501110917.26621.jeremy.guthrie@berbee.com> <16868.381.537772.831831@robur.slu.se> In-Reply-To: <16868.381.537772.831831@robur.slu.se> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501111927.15574.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 12 Jan 2005 01:27:21.0811 (UTC) FILETIME=[DD0AA230:01C4F845] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 130 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev On Tuesday 11 January 2005 10:40 am, Robert Olsson wrote: > About the same load as last time 80 kpps forwarded and droprate of ~200 pps > and 2323 fib lookups/sec. Not so bad for PIII but it maybe tuned better. > > Did the e1000 patch cure the problem that interrupts got enabled for > unidirectional traffic? Ring size? I've never seen any win in system > performance w. RX rings larger than 256 at least not in lab. ETH3 Interrupts(calc'd from below): 1479968 ETH2 Interrupts: 261543 Packets RX'd on ETH3: 3892720 Packets dropped on RX on ETH3: 10305 This equates to about a 0.26% drop rate. W/ 256 packet RX ring size I see about a 0.42% drop rate. This is using both the newest Intel driver w/ your patch and an increased ring size of 2048. Tue Jan 11 19:15:04 CST 2005 eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255.0 inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2337377824 errors:14992144 dropped:14992144 overruns:9643826 frame:0 TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3984064976 (3799.5 Mb) TX bytes:398 (398.0 b) Base address:0x22a0 Memory:eff80000-effa0000 CPU0 CPU1 0: 93627934 353254270 IO-APIC-edge timer 1: 35 507 IO-APIC-edge i8042 7: 0 0 IO-APIC-level ohci_hcd 8: 0 2 IO-APIC-edge rtc 12: 73 145 IO-APIC-edge i8042 14: 120 313 IO-APIC-edge ide0 18: 2158179576 1815 IO-APIC-level eth3 20: 2 2136514988 IO-APIC-level eth2 27: 204201 371301 IO-APIC-level eth0 28: 14585 75320 IO-APIC-level aic7xxx 30: 0 0 IO-APIC-level acpi NMI: 0 0 LOC: 446922783 446921227 ERR: 0 MIS: 0 Tue Jan 11 19:16:05 CST 2005 eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255.0 inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2341270544 errors:15002449 dropped:15002449 overruns:9652393 frame:0 TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1664751812 (1587.6 Mb) TX bytes:398 (398.0 b) Base address:0x22a0 Memory:eff80000-effa0000 CPU0 CPU1 0: 93639955 353302319 IO-APIC-edge timer 1: 35 507 IO-APIC-edge i8042 7: 0 0 IO-APIC-level ohci_hcd 8: 0 2 IO-APIC-edge rtc 12: 73 145 IO-APIC-edge i8042 14: 120 313 IO-APIC-edge ide0 18: 2159659544 1815 IO-APIC-level eth3 20: 2 2136776531 IO-APIC-level eth2 27: 204245 371369 IO-APIC-level eth0 28: 14593 75343 IO-APIC-level aic7xxx 30: 0 0 IO-APIC-level acpi NMI: 0 0 LOC: 446982858 446981302 ERR: 0 MIS: 0 --ro > > Jeremy M. Guthrie writes: > > date ; ifconfig eth3 ; cat /proc/net/softnet_stat ; > > cat /proc/net/stat/rt_cache ; sleep 60 ; date ; ifconfig eth3 ; > > cat /proc/net/softnet_stat ; cat /proc/net/stat/rt_cache > > > > Tue Jan 11 09:12:21 CST 2005 > > eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 > > inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255.0 > > inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link > > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > > RX packets:3519452697 errors:5558592 dropped:5558592 > > overruns:4011523 frame:0 > > TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 > > collisions:0 txqueuelen:1000 > > RX bytes:497775695 (474.7 Mb) TX bytes:398 (398.0 b) > > Base address:0x22a0 Memory:eff80000-effa0000 > > > > f59427dc 150dc67c 00c562ab 000d2659 00000000 00000000 00000000 00000000 > > 00547b5b > > 00038622 00000000 00000065 00000000 00000000 00000000 00000000 00000000 > > 0006804f > > entries in_hit in_slow_tot in_no_route in_brd in_martian_dst > > in_martian_src out_hit out_slow_tot out_slow_mc gc_total gc_ignored > > gc_goal_miss gc_dst_overflow in_hlist_search out_hlist_search > > 0000f3c2 aeca1565 272c383d 00000000 00000000 000089a8 00005298 00000002 > > 001db403 0003054f 00000000 230aa73c 22fe33eb 00000cf0 00000000 b37011dc > > 00957c14 > > 0000f3c2 0000b975 00029703 00000000 00000000 000035a5 00000000 00000000 > > 00000015 00000083 00000002 000038c8 000038a3 00000000 00000000 0012a566 > > 0000014d > > > > Tue Jan 11 09:13:21 CST 2005 > > eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 > > inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255.0 > > inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link > > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > > RX packets:3524302561 errors:5571396 dropped:5571396 > > overruns:4022383 frame:0 > > TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 > > collisions:0 txqueuelen:1000 > > RX bytes:3065327250 (2923.3 Mb) TX bytes:398 (398.0 b) > > Base address:0x22a0 Memory:eff80000-effa0000 > > > > f5de26f5 150dc67c 00c562b4 000d2659 00000000 00000000 00000000 00000000 > > 00547ffd > > 00038632 00000000 00000065 00000000 00000000 00000000 00000000 00000000 > > 0006807c > > entries in_hit in_slow_tot in_no_route in_brd in_martian_dst > > in_martian_src out_hit out_slow_tot out_slow_mc gc_total gc_ignored > > gc_goal_miss gc_dst_overflow in_hlist_search out_hlist_search > > 0000fc1e af11f07b 272e58d3 00000000 00000000 000089a8 00005298 00000002 > > 001db571 00030572 00000000 230cc7f1 23005428 00000cf0 00000000 b4b5b529 > > 009583b9 > > 0000fc1e 0000b977 00029710 00000000 00000000 000035a7 00000000 00000000 > > 00000015 00000083 00000002 000038ca 000038a5 00000000 00000000 0012a5c8 > > 0000014d > > > > -- > > > > -------------------------------------------------- > > Jeremy M. Guthrie jeremy.guthrie@berbee.com > > Senior Network Engineer Phone: 608-298-1061 > > Berbee Fax: 608-288-3007 > > 5520 Research Park Drive NOC: 608-298-1102 > > Madison, WI 53711 -- -------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 From jeremy.guthrie@berbee.com Tue Jan 11 17:30:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 17:30:55 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0C1Ukif007761 for ; Tue, 11 Jan 2005 17:30:47 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Tue, 11 Jan 2005 19:30:41 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Tue, 11 Jan 2005 19:30:33 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson , Stephen Hemminger , Jesse Brandeburg References: <200501111118.00601.jeremy.guthrie@berbee.com> <16868.7936.512676.178828@robur.slu.se> In-Reply-To: <16868.7936.512676.178828@robur.slu.se> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501111930.35689.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 12 Jan 2005 01:30:41.0482 (UTC) FILETIME=[540E02A0:01C4F846] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 131 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev On Tuesday 11 January 2005 12:46 pm, Robert Olsson wrote: > We give up here? Or you want to try another setting of route hash? It's > beyond the scope of this subject. You have to reboot if so. I am up for pushing it if you do not think it is a waste of time. Based on what I am seeing it looks like I just need a faster CPU to do the work. My goal would be to hit zero dropped packets w/ 10-15% CPU to spare but I fail to see how that will happen on this box. Do you concur that it would be highly unlikely I would be able to get that kind of performance increase? > Jeremy M. Guthrie writes: > > ./rtstat > > size IN: hit tot mc no_rt bcast madst masrc OUT: hit tot > > mc GC: tot ignored goal_miss ovrf HASH: in_search out_search > > 63375 86092 2844 0 0 0 0 0 5 1 > > 1610369017 2846 2844 0 0 386039 17 > > 64870 84431 537031471 537492192 0 0 0 0 1 > > 0 0 2848 2846 0 0 386130 10 > > 58707 87889 2715 0 0 0 0 0 7 1 > > 0 2716 2714 0 0 384782 13 > > 60617 89993 2796 0 0 0 0 0 5 0 > > 0 2795 2793 0 0 384432 17 > > 62458 93221 2772 0 0 0 0 0 3 0 > > 0 2772 2770 0 0 399579 9 > > 63990 93792 2712 0 0 0 0 0 6 0 > > 0 2713 2711 0 0 422585 12 > > 65499 94235 2846 0 0 0 0 0 2 0 > > 0 2846 2844 0 0 424341 9 > > 59755 90992 2864 0 0 0 0 0 1 1 > > 0 2865 2863 0 0 385888 13 > > 61702 87681 2798 0 0 0 0 0 6 2 > > 0 2800 2798 0 0 383276 34 > > 63334 90557 2734 0 0 0 0 0 5 1 > > 0 2735 2733 0 0 422121 28 > > 64798 88178 2732 0 0 0 0 0 1 0 > > 0 2732 2730 0 0 410772 11 > > 58574 85910 2669 0 0 0 0 0 3 0 > > 0 2670 2668 0 0 393331 10 > > 60538 87238 2705 0 0 0 0 0 4 0 > > 0 2705 2703 0 0 382161 20 > > 62164 85738 2628 0 0 0 0 0 4 0 > > 0 2628 2626 0 0 373049 25 > > 63759 78752 2638 0 0 0 0 0 2 0 > > 0 2638 2636 0 0 348411 5 > > 65052 79832 2482 0 0 0 0 0 3 0 > > 0 2481 2479 0 0 365871 20 > > 58986 82611 2549 0 0 0 0 0 4 1 > > 0 2550 2548 0 0 366429 24 > > 60845 85340 2620 0 0 1 0 0 2 0 > > 0 2620 2618 0 0 369963 16 > > 62465 83122 2591 0 0 0 0 0 5 0 > > 0 2591 2589 0 0 371261 18 > > size IN: hit tot mc no_rt bcast madst masrc OUT: hit tot > > mc GC: tot ignored goal_miss ovrf HASH: in_search out_search > > 63998 86141 2640 0 0 0 0 0 4 0 > > 537114631 2640 2638 0 0 386452 15 > > 65294 85989 2527 0 0 0 0 0 5 1 > > 1610369017 2528 2526 0 0 379801 26 > > 59241 84305 2662 0 0 0 0 0 7 0 > > 0 2662 2660 0 0 371925 35 > > 61194 85397 2837 0 0 0 0 0 3 0 > > 0 2837 2835 0 0 374788 17 > > 62908 88133 2688 0 0 1 0 0 4 1 > > 0 2689 2687 0 0 382411 19 > > 64329 88495 2648 0 0 0 0 0 5 1 > > 0 2649 2647 0 0 398763 30 > > 65560 84994 2447 0 0 1 0 0 6 2 > > 0 2449 2447 0 0 394745 33 > > 59677 81478 2568 0 0 0 0 0 5 0 > > 0 2569 2567 0 0 341439 22 > > 61459 81225 2623 0 0 0 0 0 5 0 > > 0 2623 2621 0 0 345996 30 > > 63038 83660 2544 0 0 0 0 0 3 0 > > 0 2544 2542 0 0 381567 21 > > 64494 86321 2620 0 0 0 0 0 4 0 > > 0 2620 2618 0 0 395278 19 > > 65528 88754 2766 0 0 0 0 0 6 0 > > 0 2765 2763 0 0 421075 34 > > 59948 86443 2990 0 0 0 0 0 5 0 > > 0 2990 2988 0 0 373605 29 > > 61860 81912 2786 0 0 0 0 0 5 1 > > 0 2787 2785 0 0 354678 34 > > 63630 80399 2981 0 0 0 0 0 4 0 > > 0 2979 2977 0 0 354983 32 > > 65215 83600 2934 0 0 0 0 0 6 3 > > 0 2937 2935 0 0 371497 41 > > 59322 85583 2821 0 0 0 0 0 7 0 > > 0 2822 2820 0 0 382896 40 > > 61268 82602 2817 0 0 0 0 0 9 2 > > 0 2819 2817 0 0 368078 54 > > 62989 85336 2760 0 0 1 0 0 9 0 > > 0 2760 2758 0 0 394212 39 > > 64387 84861 2603 0 0 0 0 0 7 0 > > 0 2602 2600 0 0 390852 36 > > size IN: hit tot mc no_rt bcast madst masrc OUT: hit tot > > mc GC: tot ignored goal_miss ovrf HASH: in_search out_search > > 65681 82848 2625 0 0 0 0 0 8 0 > > 537114631 2625 2623 0 0 370769 49 > > 59923 82826 2685 0 0 0 0 0 6 0 > > 1610369017 2685 2683 0 0 344094 41 > > 61700 82705 2706 0 0 0 0 0 7 0 > > 0 2706 2704 0 0 368474 39 > > 63247 91042 2592 0 0 0 0 0 9 1 > > 0 2593 2591 0 0 399393 57 > > 64636 93050 2530 0 0 0 0 0 6 0 > > 0 2530 2528 0 0 405903 24 > > 58301 90662 2554 0 0 0 0 0 5 0 > > 0 2555 2553 0 0 404296 39 > > 60146 88405 2567 0 0 0 0 0 8 1 > > 0 2567 2565 0 0 370227 49 > > 61822 86417 2579 0 0 0 0 0 7 1 > > 0 2580 2578 0 0 366323 43 > > 63351 86517 2594 0 0 1 0 0 9 0 > > 0 2594 2592 0 0 363340 51 > > 64739 87879 2669 0 0 0 0 0 3 0 > > 0 2670 2668 0 0 387580 26 > > 58397 88297 2566 0 0 0 0 0 4 0 > > 0 2566 2564 0 0 396980 34 > > 60352 85039 2707 0 0 0 0 0 6 1 > > 0 2709 2707 0 0 367790 47 > > 62169 87083 2779 0 0 0 0 0 6 0 > > 0 2775 2773 0 0 377163 31 > > 63808 88700 2752 0 0 0 0 0 4 0 > > 0 2751 2749 0 0 392830 28 > > 65189 91242 2725 0 0 0 0 0 5 1 > > 0 2727 2725 0 0 416871 31 > > 59326 84893 2834 0 0 0 0 0 5 1 > > 0 2828 2826 0 0 380811 28 > > 61064 87351 2553 0 0 0 0 0 9 0 > > 0 2552 2550 0 0 382053 37 > > 62637 88761 2551 0 0 0 0 0 5 1 > > 0 2553 2551 0 0 384974 29 > > > > -- > > > > -------------------------------------------------- > > Jeremy M. Guthrie jeremy.guthrie@berbee.com > > Senior Network Engineer Phone: 608-298-1061 > > Berbee Fax: 608-288-3007 > > 5520 Research Park Drive NOC: 608-298-1102 > > Madison, WI 53711 -- -------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 From LISTSERV@HOME.EASE.LSOFT.COM Tue Jan 11 19:10:05 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 19:10:09 -0800 (PST) Received: from home.ease.lsoft.com (home.ease.lsoft.com [209.119.1.31]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0C3A3Cu016115 for ; Tue, 11 Jan 2005 19:10:04 -0800 Received: from home (home.ease.lsoft.com) by home.ease.lsoft.com (LSMTP for Windows NT v1.1b) with SMTP id <5.0089EA2D@home.ease.lsoft.com>; Tue, 11 Jan 2005 22:10:02 -0500 Date: Tue, 11 Jan 2005 22:10:02 -0500 From: "HOME.EASE.LSOFT.COM LISTSERV Server (14.3)" Subject: Re: Message Error To: netdev@OSS.SGI.COM Message-ID: X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 132 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: LISTSERV@HOME.EASE.LSOFT.COM Precedence: bulk X-list: netdev > Protected Mail System Test. Unknown command - "PROTECTED". Try HELP. Summary of resource utilization ------------------------------- CPU time: 0.000 sec Device I/O: 4 Overhead CPU: 0.000 sec Paging I/O: 0 CPU model: 1GHz Pentium III 256k (1152M) Job origin: netdev@OSS.SGI.COM From dgibson@ozlabs.org Tue Jan 11 21:29:57 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 21:30:11 -0800 (PST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0C5TuI7022954 for ; Tue, 11 Jan 2005 21:29:57 -0800 Received: by ozlabs.org (Postfix, from userid 1007) id 6EC972BF24; Wed, 12 Jan 2005 16:29:44 +1100 (EST) Date: Wed, 12 Jan 2005 16:27:41 +1100 From: David Gibson To: Jeff Garzik , orinoco-devel@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [5/8] orinoco: Cleanup low-level hermes code Message-ID: <20050112052741.GF30426@localhost.localdomain> Mail-Followup-To: Jeff Garzik , orinoco-devel@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org References: <20050112052352.GA30426@localhost.localdomain> <20050112052434.GB30426@localhost.localdomain> <20050112052543.GC30426@localhost.localdomain> <20050112052630.GD30426@localhost.localdomain> <20050112052711.GE30426@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050112052711.GE30426@localhost.localdomain> User-Agent: Mutt/1.5.6+20040523i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 138 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hermes@gibson.dropbear.id.au Precedence: bulk X-list: netdev Apply some cleanups to the low-level orinoco handling code in hermes.[ch]. This cleans up some error handling code, corrects an error code to something more accurate, and also increases a timeout value. This last can (when the hardware plays up) cause long delays with spinlocks held, which is bad, but is rather less prone to prematurely giving up, which has the unfortunate habit of fatally confusing the hardware in other ways :-/. Signed-off-by: David Gibson Index: working-2.6/drivers/net/wireless/hermes.c =================================================================== --- working-2.6.orig/drivers/net/wireless/hermes.c 2005-01-12 15:22:34.263633584 +1100 +++ working-2.6/drivers/net/wireless/hermes.c 2004-11-05 13:59:07.000000000 +1100 @@ -383,12 +383,17 @@ reg = hermes_read_reg(hw, oreg); } - if (reg & HERMES_OFFSET_BUSY) { - return -ETIMEDOUT; - } + if (reg != offset) { + printk(KERN_ERR "hermes @ %p: BAP%d offset %s: " + "reg=0x%x id=0x%x offset=0x%x\n", hw->iobase, bap, + (reg & HERMES_OFFSET_BUSY) ? "timeout" : "error", + reg, id, offset); + + if (reg & HERMES_OFFSET_BUSY) { + return -ETIMEDOUT; + } - if (reg & HERMES_OFFSET_ERR) { - return -EIO; + return -EIO; /* error or wrong offset */ } return 0; @@ -476,7 +481,7 @@ rlength = hermes_read_reg(hw, dreg); if (! rlength) - return -ENOENT; + return -ENODATA; rtype = hermes_read_reg(hw, dreg); Index: working-2.6/drivers/net/wireless/hermes.h =================================================================== --- working-2.6.orig/drivers/net/wireless/hermes.h 2005-01-12 11:13:41.000000000 +1100 +++ working-2.6/drivers/net/wireless/hermes.h 2004-11-05 13:53:55.000000000 +1100 @@ -340,7 +340,7 @@ #ifdef __KERNEL__ /* Timeouts */ -#define HERMES_BAP_BUSY_TIMEOUT (500) /* In iterations of ~1us */ +#define HERMES_BAP_BUSY_TIMEOUT (10000) /* In iterations of ~1us */ /* Basic control structure */ typedef struct hermes { -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist. NOT _the_ _other_ _way_ | _around_! http://www.ozlabs.org/people/dgibson From dgibson@ozlabs.org Tue Jan 11 21:29:51 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 21:30:07 -0800 (PST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0C5To5q022929 for ; Tue, 11 Jan 2005 21:29:51 -0800 Received: by ozlabs.org (Postfix, from userid 1007) id 541162BF1F; Wed, 12 Jan 2005 16:29:44 +1100 (EST) Date: Wed, 12 Jan 2005 16:26:30 +1100 From: David Gibson To: Jeff Garzik Cc: orinoco-devel@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [3/8] orinoco: Use mdelay()/ssleep() instead of more complex delays Message-ID: <20050112052630.GD30426@localhost.localdomain> Mail-Followup-To: Jeff Garzik , orinoco-devel@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org References: <20050112052352.GA30426@localhost.localdomain> <20050112052434.GB30426@localhost.localdomain> <20050112052543.GC30426@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050112052543.GC30426@localhost.localdomain> User-Agent: Mutt/1.5.6+20040523i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 135 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hermes@gibson.dropbear.id.au Precedence: bulk X-list: netdev Use mdelay() or ssleep() instead of various silly more complicated ways of delaying in the orinoco driver. Signed-off-by: David Gibson Index: working-2.6/drivers/net/wireless/orinoco_pci.c =================================================================== --- working-2.6.orig/drivers/net/wireless/orinoco_pci.c 2005-01-12 15:13:18.819073992 +1100 +++ working-2.6/drivers/net/wireless/orinoco_pci.c 2005-01-12 15:15:33.137654464 +1100 @@ -151,19 +151,11 @@ /* Assert the reset until the card notice */ hermes_write_regn(hw, PCI_COR, HERMES_PCI_COR_MASK); - timeout = jiffies + (HERMES_PCI_COR_ONT * HZ / 1000); - while(time_before(jiffies, timeout)) { - mdelay(1); - } - //mdelay(HERMES_PCI_COR_ONT); + mdelay(HERMES_PCI_COR_ONT); /* Give time for the card to recover from this hard effort */ hermes_write_regn(hw, PCI_COR, 0x0000); - timeout = jiffies + (HERMES_PCI_COR_OFFT * HZ / 1000); - while(time_before(jiffies, timeout)) { - mdelay(1); - } - //mdelay(HERMES_PCI_COR_OFFT); + mdelay(HERMES_PCI_COR_OFFT); /* The card is ready when it's no longer busy */ timeout = jiffies + (HERMES_PCI_COR_BUSYT * HZ / 1000); Index: working-2.6/drivers/net/wireless/orinoco_plx.c =================================================================== --- working-2.6.orig/drivers/net/wireless/orinoco_plx.c 2005-01-12 15:13:18.821073688 +1100 +++ working-2.6/drivers/net/wireless/orinoco_plx.c 2005-01-12 15:15:33.138654312 +1100 @@ -356,8 +356,7 @@ static void __exit orinoco_plx_exit(void) { pci_unregister_driver(&orinoco_plx_driver); - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ); + ssleep(1); } module_init(orinoco_plx_init); Index: working-2.6/drivers/net/wireless/orinoco_tmd.c =================================================================== --- working-2.6.orig/drivers/net/wireless/orinoco_tmd.c 2005-01-12 15:13:18.820073840 +1100 +++ working-2.6/drivers/net/wireless/orinoco_tmd.c 2005-01-12 15:16:05.897674184 +1100 @@ -225,8 +225,7 @@ static void __exit orinoco_tmd_exit(void) { pci_unregister_driver(&orinoco_tmd_driver); - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ); + ssleep(1); } module_init(orinoco_tmd_init); -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist. NOT _the_ _other_ _way_ | _around_! http://www.ozlabs.org/people/dgibson From dgibson@ozlabs.org Tue Jan 11 21:29:58 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 21:30:14 -0800 (PST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0C5TuwO022955 for ; Tue, 11 Jan 2005 21:29:57 -0800 Received: by ozlabs.org (Postfix, from userid 1007) id 7E4BF2BF26; Wed, 12 Jan 2005 16:29:44 +1100 (EST) Date: Wed, 12 Jan 2005 16:28:14 +1100 From: David Gibson To: Jeff Garzik , orinoco-devel@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [6/8] orinoco: Cleanup PCMCIA/PC-Card code Message-ID: <20050112052814.GG30426@localhost.localdomain> Mail-Followup-To: Jeff Garzik , orinoco-devel@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org References: <20050112052352.GA30426@localhost.localdomain> <20050112052434.GB30426@localhost.localdomain> <20050112052543.GC30426@localhost.localdomain> <20050112052630.GD30426@localhost.localdomain> <20050112052711.GE30426@localhost.localdomain> <20050112052741.GF30426@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050112052741.GF30426@localhost.localdomain> User-Agent: Mutt/1.5.6+20040523i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 141 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hermes@gibson.dropbear.id.au Precedence: bulk X-list: netdev Cleanup the various bits of initialization code for PCMCIA / PC-Card orinoco devices. This includes one important bugfix where we could fail to take the lock in some circumstances. Signed-off-by: David Gibson Index: working-2.6/drivers/net/wireless/orinoco_cs.c =================================================================== --- working-2.6.orig/drivers/net/wireless/orinoco_cs.c 2005-01-12 15:34:50.847655792 +1100 +++ working-2.6/drivers/net/wireless/orinoco_cs.c 2004-11-05 14:31:07.000000000 +1100 @@ -54,19 +54,11 @@ /* Module parameters */ -/* The old way: bit map of interrupts to choose from */ -/* This means pick from 15, 14, 12, 11, 10, 9, 7, 5, 4, and 3 */ -static uint irq_mask = 0xdeb8; -/* Newer, simpler way of listing specific interrupts */ -static int irq_list[4] = { -1 }; - /* Some D-Link cards have buggy CIS. They do work at 5v properly, but * don't have any CIS entry for it. This workaround it... */ static int ignore_cis_vcc; /* = 0 */ - -MODULE_PARM(irq_mask, "i"); -MODULE_PARM(irq_list, "1-4i"); -MODULE_PARM(ignore_cis_vcc, "i"); +module_param(ignore_cis_vcc, int, 0644); +MODULE_PARM_DESC(ignore_cis_vcc, "Allow voltage mismatch between card and socket"); /********************************************************************/ /* Magic constants */ @@ -136,6 +128,7 @@ if (err) return err; + msleep(100); clear_bit(0, &card->hard_reset_in_progress); return 0; @@ -161,7 +154,7 @@ struct orinoco_pccard *card; dev_link_t *link; client_reg_t client_reg; - int ret, i; + int ret; dev = alloc_orinocodev(sizeof(*card), orinoco_cs_hard_reset); if (! dev) @@ -174,14 +167,11 @@ link->priv = dev; /* Interrupt setup */ - link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; + link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT; link->irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_LEVEL_ID; - if (irq_list[0] == -1) - link->irq.IRQInfo2 = irq_mask; - else - for (i = 0; i < 4; i++) - link->irq.IRQInfo2 |= 1 << irq_list[i]; - link->irq.Handler = NULL; + link->irq.IRQInfo2 = 0xffffffff; /* Any ISA IRQ */ + link->irq.Handler = orinoco_interrupt; + link->irq.Instance = dev; /* General socket configuration defaults can go here. In this * client, we assume very little, and rely on the CIS for @@ -262,6 +252,9 @@ last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; \ } while (0) +#define CFG_CHECK(fn, ret) \ + if (ret != 0) goto next_entry + static void orinoco_cs_config(dev_link_t *link) { @@ -323,9 +316,8 @@ cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); cistpl_cftable_entry_t dflt = { .index = 0 }; - if (pcmcia_get_tuple_data(handle, &tuple) != 0 || - pcmcia_parse_tuple(handle, &tuple, &parse) != 0) - goto next_entry; + CFG_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); + CFG_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg; @@ -363,8 +355,7 @@ dflt.vpp1.param[CISTPL_POWER_VNOM] / 10000; /* Do we need to allocate an interrupt? */ - if (cfg->irq.IRQInfo1 || dflt.irq.IRQInfo1) - link->conf.Attributes |= CONF_ENABLE_IRQ; + link->conf.Attributes |= CONF_ENABLE_IRQ; /* IO window settings */ link->io.NumPorts1 = link->io.NumPorts2 = 0; @@ -390,8 +381,8 @@ } /* This reserves IO space but doesn't actually enable it */ - if (pcmcia_request_io(link->handle, &link->io) != 0) - goto next_entry; + CFG_CHECK(RequestIO, + pcmcia_request_io(link->handle, &link->io)); } @@ -416,22 +407,7 @@ * a handler to the interrupt, unless the 'Handler' member of * the irq structure is initialized. */ - if (link->conf.Attributes & CONF_ENABLE_IRQ) { - int i; - - link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT; - link->irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_LEVEL_ID; - if (irq_list[0] == -1) - link->irq.IRQInfo2 = irq_mask; - else - for (i=0; i<4; i++) - link->irq.IRQInfo2 |= 1 << irq_list[i]; - - link->irq.Handler = orinoco_interrupt; - link->irq.Instance = dev; - - CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); - } + CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); /* We initialize the hermes structure before completing PCMCIA * configuration just in case the interrupt handler gets @@ -456,8 +432,6 @@ SET_MODULE_OWNER(dev); card->node.major = card->node.minor = 0; - /* register_netdev will give us an ethX name */ - dev->name[0] = '\0'; /* Tell the stack we exist */ if (register_netdev(dev) != 0) { printk(KERN_ERR PFX "register_netdev() failed\n"); @@ -479,8 +453,7 @@ if (link->conf.Vpp1) printk(", Vpp %d.%d", link->conf.Vpp1 / 10, link->conf.Vpp1 % 10); - if (link->conf.Attributes & CONF_ENABLE_IRQ) - printk(", irq %d", link->irq.AssignedIRQ); + printk(", irq %d", link->irq.AssignedIRQ); if (link->io.NumPorts1) printk(", io 0x%04x-0x%04x", link->io.BasePort1, link->io.BasePort1 + link->io.NumPorts1 - 1); @@ -546,12 +519,12 @@ case CS_EVENT_CARD_REMOVAL: link->state &= ~DEV_PRESENT; if (link->state & DEV_CONFIG) { - orinoco_lock(priv, &flags); + unsigned long flags; + spin_lock_irqsave(&priv->lock, flags); netif_device_detach(dev); priv->hw_unavailable++; - - orinoco_unlock(priv, &flags); + spin_unlock_irqrestore(&priv->lock, flags); } break; -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist. NOT _the_ _other_ _way_ | _around_! http://www.ozlabs.org/people/dgibson From dgibson@ozlabs.org Tue Jan 11 21:29:57 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 21:30:12 -0800 (PST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0C5TvW9022956 for ; Tue, 11 Jan 2005 21:29:57 -0800 Received: by ozlabs.org (Postfix, from userid 1007) id 8B9C02BF27; Wed, 12 Jan 2005 16:29:44 +1100 (EST) Date: Wed, 12 Jan 2005 16:28:48 +1100 From: David Gibson To: Jeff Garzik , orinoco-devel@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [7/8] orinoco: Replace obsolete MODULE_PARM() Message-ID: <20050112052848.GH30426@localhost.localdomain> Mail-Followup-To: Jeff Garzik , orinoco-devel@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org References: <20050112052352.GA30426@localhost.localdomain> <20050112052434.GB30426@localhost.localdomain> <20050112052543.GC30426@localhost.localdomain> <20050112052630.GD30426@localhost.localdomain> <20050112052711.GE30426@localhost.localdomain> <20050112052741.GF30426@localhost.localdomain> <20050112052814.GG30426@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050112052814.GG30426@localhost.localdomain> User-Agent: Mutt/1.5.6+20040523i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 139 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hermes@gibson.dropbear.id.au Precedence: bulk X-list: netdev Replace obsolete MODULE_PARM() with module_param() in the orinoco driver. Signed-off-by: David Gibson Index: working-2.6/drivers/net/wireless/orinoco.c =================================================================== --- working-2.6.orig/drivers/net/wireless/orinoco.c 2005-01-12 15:47:48.215477920 +1100 +++ working-2.6/drivers/net/wireless/orinoco.c 2005-01-12 15:50:14.156291544 +1100 @@ -461,12 +461,14 @@ /* Level of debugging. Used in the macros in orinoco.h */ #ifdef ORINOCO_DEBUG int orinoco_debug = ORINOCO_DEBUG; -MODULE_PARM(orinoco_debug, "i"); +module_param(orinoco_debug, int, 0644); +MODULE_PARM_DESC(orinoco_debug, "Debug level"); EXPORT_SYMBOL(orinoco_debug); #endif static int suppress_linkstatus; /* = 0 */ -MODULE_PARM(suppress_linkstatus, "i"); +module_param(suppress_linkstatus, int, 0644); +MODULE_PARM_DESC(suppress_linkstatus, "Don't log link status changes"); /********************************************************************/ /* Compile time configuration and compatibility stuff */ -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist. NOT _the_ _other_ _way_ | _around_! http://www.ozlabs.org/people/dgibson From dgibson@ozlabs.org Tue Jan 11 21:29:51 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 21:30:04 -0800 (PST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0C5ToAm022926 for ; Tue, 11 Jan 2005 21:29:51 -0800 Received: by ozlabs.org (Postfix, from userid 1007) id 2AC2F2BF16; Wed, 12 Jan 2005 16:29:44 +1100 (EST) Date: Wed, 12 Jan 2005 16:23:52 +1100 From: David Gibson To: Jeff Garzik Cc: orinoco-devel@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [0/8] orinoco driver updates Message-ID: <20050112052352.GA30426@localhost.localdomain> Mail-Followup-To: Jeff Garzik , orinoco-devel@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040523i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 133 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: david@gibson.dropbear.id.au Precedence: bulk X-list: netdev Following are a bunch of patches which make a few more steps towards the long overdue merge of the CVS orinoco driver into mainline. These do make behavioural changes to the driver, but they should all be trivial and largely cosmetic. Jeff, please apply. Patches are against the netdev BK tree. orinoco-printks Update printk()s and other cosmetic strings orinoco-carrier Use netif_carrier_() functions instead of homegrown connected flag orinoco-delays Use mdelay() and ssleep() instead of schedule_timeout() and other more complicated idioms. orinoco-free-orinocodev Introduce free_orinocodev() function as a wrapper around free_netdev() orinoco-cleanup-hermes Make cleanups to low-level driver code orinoco-pccard-cleanups Cleanup initialization for PCMCIA/PC-Card devices. orinoco-modparm Replace obsolete MODULE_PARM() constructions from orinoco.c orinoco-pci-updates Cleanup initialization for PCI/PLX/TMD devices. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist. NOT _the_ _other_ _way_ | _around_! http://www.ozlabs.org/people/dgibson From dgibson@ozlabs.org Tue Jan 11 21:29:51 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 21:30:06 -0800 (PST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0C5To7W022928 for ; Tue, 11 Jan 2005 21:29:51 -0800 Received: by ozlabs.org (Postfix, from userid 1007) id 438D12BF1A; Wed, 12 Jan 2005 16:29:44 +1100 (EST) Date: Wed, 12 Jan 2005 16:25:43 +1100 From: David Gibson To: Jeff Garzik Cc: orinoco-devel@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [2/8] orinoco: Use netif_carrier functions instead of homegrown flag Message-ID: <20050112052543.GC30426@localhost.localdomain> Mail-Followup-To: Jeff Garzik , orinoco-devel@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org References: <20050112052352.GA30426@localhost.localdomain> <20050112052434.GB30426@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050112052434.GB30426@localhost.localdomain> User-Agent: Mutt/1.5.6+20040523i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 134 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hermes@gibson.dropbear.id.au Precedence: bulk X-list: netdev Removes the orinoco driver's custom and dodgy "connected" variable used to track whether or not we're associated with an AP. Replaces it instead with netif_carrier_ok() settings. Signed-off-by: David Gibson Index: working-2.6/drivers/net/wireless/orinoco.c =================================================================== --- working-2.6.orig/drivers/net/wireless/orinoco.c 2004-11-03 14:32:15.000000000 +1100 +++ working-2.6/drivers/net/wireless/orinoco.c 2004-11-03 16:16:57.000000000 +1100 @@ -784,7 +784,7 @@ return 1; } - if (! priv->connected) { + if (! netif_carrier_ok(dev)) { /* Oops, the firmware hasn't established a connection, silently drop the packet (this seems to be the safest approach). */ @@ -1271,6 +1271,7 @@ case HERMES_INQ_LINKSTATUS: { struct hermes_linkstatus linkstatus; u16 newstatus; + int connected; if (len != sizeof(linkstatus)) { printk(KERN_WARNING "%s: Unexpected size for linkstatus frame (%d bytes)\n", @@ -1282,15 +1283,14 @@ len / 2); newstatus = le16_to_cpu(linkstatus.linkstatus); - if ( (newstatus == HERMES_LINKSTATUS_CONNECTED) - || (newstatus == HERMES_LINKSTATUS_AP_CHANGE) - || (newstatus == HERMES_LINKSTATUS_AP_IN_RANGE) ) - priv->connected = 1; - else if ( (newstatus == HERMES_LINKSTATUS_NOT_CONNECTED) - || (newstatus == HERMES_LINKSTATUS_DISCONNECTED) - || (newstatus == HERMES_LINKSTATUS_AP_OUT_OF_RANGE) - || (newstatus == HERMES_LINKSTATUS_ASSOC_FAILED) ) - priv->connected = 0; + connected = (newstatus == HERMES_LINKSTATUS_CONNECTED) + || (newstatus == HERMES_LINKSTATUS_AP_CHANGE) + || (newstatus == HERMES_LINKSTATUS_AP_IN_RANGE); + + if (connected) + netif_carrier_on(dev); + else + netif_carrier_off(dev); if (newstatus != priv->last_linkstatus) print_linkstatus(dev, newstatus); @@ -1368,8 +1368,8 @@ } /* firmware will have to reassociate */ + netif_carrier_off(dev); priv->last_linkstatus = 0xffff; - priv->connected = 0; return 0; } @@ -1881,7 +1881,7 @@ priv->hw_unavailable++; priv->last_linkstatus = 0xffff; /* firmware will have to reassociate */ - priv->connected = 0; + netif_carrier_off(dev); orinoco_unlock(priv, &flags); @@ -2391,8 +2391,8 @@ * hardware */ INIT_WORK(&priv->reset_work, (void (*)(void *))orinoco_reset, dev); + netif_carrier_off(dev); priv->last_linkstatus = 0xffff; - priv->connected = 0; return dev; Index: working-2.6/drivers/net/wireless/orinoco.h =================================================================== --- working-2.6.orig/drivers/net/wireless/orinoco.h 2004-11-03 14:32:15.000000000 +1100 +++ working-2.6/drivers/net/wireless/orinoco.h 2004-11-03 16:12:40.000000000 +1100 @@ -42,7 +42,6 @@ /* driver state */ int open; u16 last_linkstatus; - int connected; /* Net device stuff */ struct net_device *ndev; -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist. NOT _the_ _other_ _way_ | _around_! http://www.ozlabs.org/people/dgibson From dgibson@ozlabs.org Tue Jan 11 21:29:52 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 21:30:10 -0800 (PST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0C5ToDt022927 for ; Tue, 11 Jan 2005 21:29:51 -0800 Received: by ozlabs.org (Postfix, from userid 1007) id 3A36C2BF18; Wed, 12 Jan 2005 16:29:44 +1100 (EST) Date: Wed, 12 Jan 2005 16:24:34 +1100 From: David Gibson To: Jeff Garzik Cc: orinoco-devel@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [1/8] orinoco driver updates Message-ID: <20050112052434.GB30426@localhost.localdomain> Mail-Followup-To: Jeff Garzik , orinoco-devel@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org References: <20050112052352.GA30426@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050112052352.GA30426@localhost.localdomain> User-Agent: Mutt/1.5.6+20040523i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 137 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hermes@gibson.dropbear.id.au Precedence: bulk X-list: netdev Reformats printk()s, comments, labels and other cosmetic strings in the orinoco driver. Also moves, removes, and adds ratelimiting in some places. Behavioural changes are trivial/cosmetic only. This reduces the cosmetic/trivial differences between the current kernel version, and the CVS version of the driver; one small step towards full merge. Signed-off-by: David Gibson Index: working-2.6/drivers/net/wireless/hermes.c =================================================================== --- working-2.6.orig/drivers/net/wireless/hermes.c 2005-01-12 11:13:41.000000000 +1100 +++ working-2.6/drivers/net/wireless/hermes.c 2005-01-12 14:47:25.791170120 +1100 @@ -48,6 +48,7 @@ #include #include #include +#include #include #include "hermes.h" @@ -232,13 +233,16 @@ err = hermes_issue_cmd(hw, cmd, parm0); if (err) { if (! hermes_present(hw)) { - printk(KERN_WARNING "hermes @ %p: " - "Card removed while issuing command.\n", - hw->iobase); + if (net_ratelimit()) + printk(KERN_WARNING "hermes @ %p: " + "Card removed while issuing command " + "0x%04x.\n", hw->iobase, cmd); err = -ENODEV; } else - printk(KERN_ERR "hermes @ %p: Error %d issuing command.\n", - hw->iobase, err); + if (net_ratelimit()) + printk(KERN_ERR "hermes @ %p: " + "Error %d issuing command 0x%04x.\n", + hw->iobase, err, cmd); goto out; } @@ -251,17 +255,16 @@ } if (! hermes_present(hw)) { - printk(KERN_WARNING "hermes @ %p: " - "Card removed while waiting for command completion.\n", - hw->iobase); + printk(KERN_WARNING "hermes @ %p: Card removed " + "while waiting for command 0x%04x completion.\n", + hw->iobase, cmd); err = -ENODEV; goto out; } if (! (reg & HERMES_EV_CMD)) { - printk(KERN_ERR "hermes @ %p: " - "Timeout waiting for command completion.\n", - hw->iobase); + printk(KERN_ERR "hermes @ %p: Timeout waiting for " + "command 0x%04x completion.\n", hw->iobase, cmd); err = -ETIMEDOUT; goto out; } @@ -481,14 +484,13 @@ *length = rlength; if (rtype != rid) - printk(KERN_WARNING "hermes @ %p: " - "hermes_read_ltv(): rid (0x%04x) does not match type (0x%04x)\n", - hw->iobase, rid, rtype); + printk(KERN_WARNING "hermes @ %p: %s(): " + "rid (0x%04x) does not match type (0x%04x)\n", + hw->iobase, __FUNCTION__, rid, rtype); if (HERMES_RECLEN_TO_BYTES(rlength) > bufsize) printk(KERN_WARNING "hermes @ %p: " "Truncating LTV record from %d to %d bytes. " - "(rid=0x%04x, len=0x%04x)\n", - hw->iobase, + "(rid=0x%04x, len=0x%04x)\n", hw->iobase, HERMES_RECLEN_TO_BYTES(rlength), bufsize, rid, rlength); nwords = min((unsigned)rlength - 1, bufsize / 2); Index: working-2.6/drivers/net/wireless/orinoco_pci.c =================================================================== --- working-2.6.orig/drivers/net/wireless/orinoco_pci.c 2005-01-12 11:13:41.000000000 +1100 +++ working-2.6/drivers/net/wireless/orinoco_pci.c 2005-01-12 14:47:25.792169968 +1100 @@ -151,24 +151,18 @@ /* Assert the reset until the card notice */ hermes_write_regn(hw, PCI_COR, HERMES_PCI_COR_MASK); - printk(KERN_NOTICE "Reset done"); timeout = jiffies + (HERMES_PCI_COR_ONT * HZ / 1000); while(time_before(jiffies, timeout)) { - printk("."); mdelay(1); } - printk(";\n"); //mdelay(HERMES_PCI_COR_ONT); /* Give time for the card to recover from this hard effort */ hermes_write_regn(hw, PCI_COR, 0x0000); - printk(KERN_NOTICE "Clear Reset"); timeout = jiffies + (HERMES_PCI_COR_OFFT * HZ / 1000); while(time_before(jiffies, timeout)) { - printk("."); mdelay(1); } - printk(";\n"); //mdelay(HERMES_PCI_COR_OFFT); /* The card is ready when it's no longer busy */ @@ -183,7 +177,6 @@ printk(KERN_ERR PFX "Busy timeout\n"); return -ETIMEDOUT; } - printk(KERN_NOTICE "pci_cor : reg = 0x%X - %lX - %lX\n", reg, timeout, jiffies); return 0; } @@ -202,15 +195,19 @@ struct net_device *dev = NULL; err = pci_enable_device(pdev); - if (err) - return -EIO; + if (err) { + printk(KERN_ERR PFX "Cannot enable PCI device\n"); + return err; + } /* Resource 0 is mapped to the hermes registers */ pci_iorange = pci_resource_start(pdev, 0); pci_iolen = pci_resource_len(pdev, 0); pci_ioaddr = ioremap(pci_iorange, pci_iolen); - if (! pci_iorange) + if (! pci_iorange) { + printk(KERN_ERR PFX "Cannot remap hardware registers\n"); goto fail; + } /* Allocate network device */ dev = alloc_orinocodev(0, NULL); @@ -226,18 +223,16 @@ SET_MODULE_OWNER(dev); SET_NETDEV_DEV(dev, &pdev->dev); - printk(KERN_DEBUG PFX - "Detected Orinoco/Prism2 PCI device at %s, mem:0x%lX to 0x%lX -> 0x%p, irq:%d\n", - pci_name(pdev), dev->mem_start, dev->mem_end, pci_ioaddr, pdev->irq); - hermes_struct_init(&priv->hw, pci_ioaddr, HERMES_32BIT_REGSPACING); pci_set_drvdata(pdev, dev); + printk(KERN_DEBUG PFX "Detected device %s, mem:0x%lx-0x%lx, irq %d\n", + pci_name(pdev), dev->mem_start, dev->mem_end, pdev->irq); + err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ, dev->name, dev); if (err) { - printk(KERN_ERR PFX "Error allocating IRQ %d.\n", - pdev->irq); + printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq); err = -EBUSY; goto fail; } @@ -245,7 +240,7 @@ /* Perform a COR reset to start the card */ if(orinoco_pci_cor_reset(priv) != 0) { - printk(KERN_ERR "%s: Failed to start the card\n", dev->name); + printk(KERN_ERR PFX "Initial reset failed\n"); err = -ETIMEDOUT; goto fail; } @@ -256,7 +251,7 @@ err = register_netdev(dev); if (err) { - printk(KERN_ERR "%s: Failed to register net device\n", dev->name); + printk(KERN_ERR PFX "Failed to register net device\n"); goto fail; } Index: working-2.6/drivers/net/wireless/orinoco.h =================================================================== --- working-2.6.orig/drivers/net/wireless/orinoco.h 2005-01-12 11:13:41.000000000 +1100 +++ working-2.6/drivers/net/wireless/orinoco.h 2005-01-12 14:47:25.792169968 +1100 @@ -127,7 +127,7 @@ { spin_lock_irqsave(&priv->lock, *flags); if (priv->hw_unavailable) { - printk(KERN_DEBUG "orinoco_lock() called with hw_unavailable (dev=%p)\n", + DEBUG(1, "orinoco_lock() called with hw_unavailable (dev=%p)\n", priv->ndev); spin_unlock_irqrestore(&priv->lock, *flags); return -EBUSY; Index: working-2.6/drivers/net/wireless/orinoco_tmd.c =================================================================== --- working-2.6.orig/drivers/net/wireless/orinoco_tmd.c 2005-01-12 11:13:41.000000000 +1100 +++ working-2.6/drivers/net/wireless/orinoco_tmd.c 2005-01-12 14:47:25.793169816 +1100 @@ -92,8 +92,10 @@ void __iomem *mem; err = pci_enable_device(pdev); - if (err) + if (err) { + printk(KERN_ERR PFX "Cannot enable PCI device\n"); return -EIO; + } printk(KERN_DEBUG PFX "TMD setup\n"); pccard_ioaddr = pci_resource_start(pdev, 2); @@ -117,6 +119,7 @@ /* Allocate network device */ dev = alloc_orinocodev(0, NULL); if (! dev) { + printk(KERN_ERR PFX "Cannot allocate network device\n"); err = -ENOMEM; goto out2; } @@ -132,26 +135,27 @@ SET_MODULE_OWNER(dev); SET_NETDEV_DEV(dev, &pdev->dev); + hermes_struct_init(&priv->hw, mem, HERMES_16BIT_REGSPACING); + pci_set_drvdata(pdev, dev); + printk(KERN_DEBUG PFX "Detected Orinoco/Prism2 TMD device " "at %s irq:%d, io addr:0x%lx\n", pci_name(pdev), pdev->irq, pccard_ioaddr); - hermes_struct_init(&(priv->hw), mem, HERMES_16BIT_REGSPACING); - pci_set_drvdata(pdev, dev); - err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ, dev->name, dev); if (err) { - printk(KERN_ERR PFX "Error allocating IRQ %d.\n", - pdev->irq); + printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq); err = -EBUSY; goto out4; } dev->irq = pdev->irq; err = register_netdev(dev); - if (err) + if (err) { + printk(KERN_ERR PFX "Cannot register network device\n"); goto out5; + } return 0; Index: working-2.6/drivers/net/wireless/orinoco_cs.c =================================================================== --- working-2.6.orig/drivers/net/wireless/orinoco_cs.c 2005-01-12 11:13:41.000000000 +1100 +++ working-2.6/drivers/net/wireless/orinoco_cs.c 2005-01-12 14:47:25.793169816 +1100 @@ -405,7 +405,7 @@ last_ret = pcmcia_get_next_tuple(handle, &tuple); if (last_ret == CS_NO_MORE_ITEMS) { printk(KERN_ERR PFX "GetNextTuple(): No matching " - "CIS configuration, maybe you need the " + "CIS configuration. Maybe you need the " "ignore_cis_vcc=1 parameter.\n"); goto cs_failed; } Index: working-2.6/drivers/net/wireless/airport.c =================================================================== --- working-2.6.orig/drivers/net/wireless/airport.c 2005-01-12 11:13:41.000000000 +1100 +++ working-2.6/drivers/net/wireless/airport.c 2005-01-12 14:47:25.793169816 +1100 @@ -28,7 +28,6 @@ #include #include #include -#include #include #include @@ -194,14 +193,14 @@ hermes_t *hw; if (macio_resource_count(mdev) < 1 || macio_irq_count(mdev) < 1) { - printk(KERN_ERR PFX "wrong interrupt/addresses in OF tree\n"); + printk(KERN_ERR PFX "Wrong interrupt/addresses in OF tree\n"); return -ENODEV; } /* Allocate space for private device-specific data */ dev = alloc_orinocodev(sizeof(*card), airport_hard_reset); if (! dev) { - printk(KERN_ERR PFX "can't allocate device datas\n"); + printk(KERN_ERR PFX "Cannot allocate network device\n"); return -ENODEV; } priv = netdev_priv(dev); @@ -224,11 +223,11 @@ /* Setup interrupts & base address */ dev->irq = macio_irq(mdev, 0); phys_addr = macio_resource_start(mdev, 0); /* Physical address */ - printk(KERN_DEBUG PFX "Airport at physical address %lx\n", phys_addr); + printk(KERN_DEBUG PFX "Physical address %lx\n", phys_addr); dev->base_addr = phys_addr; card->vaddr = ioremap(phys_addr, AIRPORT_IO_LEN); if (!card->vaddr) { - printk(PFX "ioremap() failed\n"); + printk(KERN_ERR PFX "ioremap() failed\n"); goto failed; } @@ -241,7 +240,7 @@ /* Reset it before we get the interrupt */ hermes_init(hw); - if (request_irq(dev->irq, orinoco_interrupt, 0, "Airport", dev)) { + if (request_irq(dev->irq, orinoco_interrupt, 0, dev->name, dev)) { printk(KERN_ERR PFX "Couldn't get IRQ %d\n", dev->irq); goto failed; } @@ -252,7 +251,7 @@ printk(KERN_ERR PFX "register_netdev() failed\n"); goto failed; } - printk(KERN_DEBUG PFX "card registered for interface %s\n", dev->name); + printk(KERN_DEBUG PFX "Card registered for interface %s\n", dev->name); card->ndev_registered = 1; return 0; failed: Index: working-2.6/drivers/net/wireless/orinoco_plx.c =================================================================== --- working-2.6.orig/drivers/net/wireless/orinoco_plx.c 2005-01-12 11:13:41.000000000 +1100 +++ working-2.6/drivers/net/wireless/orinoco_plx.c 2005-01-12 14:48:57.890168944 +1100 @@ -167,15 +167,17 @@ int i; err = pci_enable_device(pdev); - if (err) + if (err) { + printk(KERN_ERR PFX "Cannot enable PCI device\n"); return -EIO; + } /* Resource 2 is mapped to the PCMCIA space */ attr_mem = ioremap(pci_resource_start(pdev, 2), PAGE_SIZE); if (!attr_mem) - goto out; + goto fail_resources; - printk(KERN_DEBUG "orinoco_plx: CIS: "); + printk(KERN_DEBUG PFX "CIS: "); for (i = 0; i < 16; i++) { printk("%02X:", readw(attr_mem+i)); } @@ -185,10 +187,11 @@ /* FIXME: we probably need to be smarted about this */ memcpy_fromio(magic, attr_mem, 16); if (memcmp(magic, cis_magic, 16) != 0) { - printk(KERN_ERR "orinoco_plx: The CIS value of Prism2 PC card is invalid.\n"); + printk(KERN_ERR PFX "The CIS value of Prism2 PC " + "card is unexpected\n"); err = -EIO; iounmap(attr_mem); - goto out; + goto fail_resources; } /* PCMCIA COR is the first byte following CIS: this write should @@ -199,8 +202,8 @@ iounmap(attr_mem); if (reg != COR_VALUE) { - printk(KERN_ERR "orinoco_plx: Error setting COR value (reg=%x)\n", reg); - goto out; + printk(KERN_ERR PFX "Error setting COR value (reg=%x)\n", reg); + goto fail_resources; } /* bjoern: We need to tell the card to enable interrupts, in @@ -209,40 +212,39 @@ addr = pci_resource_start(pdev, 1); reg = inl(addr+PLX_INTCSR); if (reg & PLX_INTCSR_INTEN) - printk(KERN_DEBUG "orinoco_plx: " - "Local Interrupt already enabled\n"); + printk(KERN_DEBUG PFX "Local Interrupt already enabled\n"); else { reg |= PLX_INTCSR_INTEN; outl(reg, addr+PLX_INTCSR); reg = inl(addr+PLX_INTCSR); if(!(reg & PLX_INTCSR_INTEN)) { - printk(KERN_ERR "orinoco_plx: " - "Couldn't enable Local Interrupts\n"); - goto out; + printk(KERN_ERR PFX "Couldn't enable Local Interrupts\n"); + goto fail_resources; } } - /* and 3 to the PCMCIA slot I/O address space */ + /* Resource 3 is mapped to the PCMCIA I/O address space */ pccard_ioaddr = pci_resource_start(pdev, 3); pccard_iolen = pci_resource_len(pdev, 3); if (! request_region(pccard_ioaddr, pccard_iolen, DRIVER_NAME)) { - printk(KERN_ERR "orinoco_plx: I/O resource 0x%lx @ 0x%lx busy\n", + printk(KERN_ERR PFX "I/O resource 0x%lx @ 0x%lx busy\n", pccard_iolen, pccard_ioaddr); err = -EBUSY; - goto out; + goto fail_resources; } mem = pci_iomap(pdev, 3, 0); if (!mem) { err = -ENOMEM; - goto out1; + goto fail_map; } /* Allocate network device */ dev = alloc_orinocodev(0, NULL); if (!dev) { + printk(KERN_ERR PFX "Cannot allocate network device\n"); err = -ENOMEM; - goto out2; + goto fail_alloc; } priv = netdev_priv(dev); @@ -250,39 +252,41 @@ SET_MODULE_OWNER(dev); SET_NETDEV_DEV(dev, &pdev->dev); + hermes_struct_init(&priv->hw, mem, HERMES_16BIT_REGSPACING); + pci_set_drvdata(pdev, dev); + printk(KERN_DEBUG PFX "Detected Orinoco/Prism2 PLX device " "at %s irq:%d, io addr:0x%lx\n", pci_name(pdev), pdev->irq, pccard_ioaddr); - hermes_struct_init(&(priv->hw), mem, HERMES_16BIT_REGSPACING); - pci_set_drvdata(pdev, dev); - err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ, dev->name, dev); if (err) { - printk(KERN_ERR PFX "Error allocating IRQ %d.\n", pdev->irq); + printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq); err = -EBUSY; - goto out3; + goto fail_irq; } dev->irq = pdev->irq; err = register_netdev(dev); - if (err) - goto out4; + if (err) { + printk(KERN_ERR PFX "Cannot register network device\n"); + goto fail; + } return 0; -out4: + fail: free_irq(dev->irq, dev); -out3: + fail_irq: free_netdev(dev); -out2: + fail_alloc: pci_iounmap(pdev, mem); -out1: + fail_map: release_region(pccard_ioaddr, pccard_iolen); -out: + fail_resources: pci_disable_device(pdev); - printk(KERN_DEBUG PFX "init_one(), FAIL!\n"); + return err; } Index: working-2.6/drivers/net/wireless/orinoco.c =================================================================== --- working-2.6.orig/drivers/net/wireless/orinoco.c 2005-01-12 11:13:41.000000000 +1100 +++ working-2.6/drivers/net/wireless/orinoco.c 2005-01-12 14:47:25.796169360 +1100 @@ -805,8 +805,9 @@ desc.tx_control = cpu_to_le16(HERMES_TXCTRL_TX_OK | HERMES_TXCTRL_TX_EX); err = hermes_bap_pwrite(hw, USER_BAP, &desc, sizeof(desc), txfid, 0); if (err) { - printk(KERN_ERR "%s: Error %d writing Tx descriptor to BAP\n", - dev->name, err); + if (net_ratelimit()) + printk(KERN_ERR "%s: Error %d writing Tx descriptor " + "to BAP\n", dev->name, err); stats->tx_errors++; goto fail; } @@ -836,8 +837,9 @@ err = hermes_bap_pwrite(hw, USER_BAP, &hdr, sizeof(hdr), txfid, HERMES_802_3_OFFSET); if (err) { - printk(KERN_ERR "%s: Error %d writing packet header to BAP\n", - dev->name, err); + if (net_ratelimit()) + printk(KERN_ERR "%s: Error %d writing packet " + "header to BAP\n", dev->name, err); stats->tx_errors++; goto fail; } @@ -1297,8 +1299,8 @@ } break; default: - printk(KERN_DEBUG "%s: Unknown information frame received " - "(type %04x).\n", dev->name, type); + printk(KERN_DEBUG "%s: Unknown information frame received: " + "type 0x%04x, length %d\n", dev->name, type, len); /* We don't actually do anything about it */ break; } @@ -1307,7 +1309,7 @@ static void __orinoco_ev_infdrop(struct net_device *dev, hermes_t *hw) { if (net_ratelimit()) - printk(KERN_WARNING "%s: Information frame lost.\n", dev->name); + printk(KERN_DEBUG "%s: Information frame lost.\n", dev->name); } /********************************************************************/ @@ -1785,7 +1787,8 @@ } if (p) - printk(KERN_WARNING "Multicast list is longer than mc_count\n"); + printk(KERN_WARNING "%s: Multicast list is " + "longer than mc_count\n", dev->name); err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFGROUPADDRESSES, HERMES_BYTES_TO_RECLEN(priv->mc_count * ETH_ALEN), @@ -2053,7 +2056,7 @@ le16_to_cpus(&sta_id.variant); le16_to_cpus(&sta_id.major); le16_to_cpus(&sta_id.minor); - printk(KERN_DEBUG "%s: Station identity %04x:%04x:%04x:%04x\n", + printk(KERN_DEBUG "%s: Station identity %04x:%04x:%04x:%04x\n", dev->name, sta_id.id, sta_id.variant, sta_id.major, sta_id.minor); @@ -3045,8 +3048,9 @@ priv->mwo_robust = 0; else { if (frq->fixed) - printk(KERN_WARNING "%s: Fixed fragmentation not \ -supported on this firmware. Using MWO robust instead.\n", dev->name); + printk(KERN_WARNING "%s: Fixed fragmentation is " + "not supported on this firmware. " + "Using MWO robust instead.\n", dev->name); priv->mwo_robust = 1; } } else { @@ -3518,7 +3522,7 @@ } /* Copy stats */ /* In theory, we should disable irqs while copying the stats - * because the rx path migh update it in the middle... + * because the rx path might update it in the middle... * Bah, who care ? - Jean II */ memcpy(&spy_stat, priv->spy_stat, sizeof(struct iw_quality) * IW_MAX_SPY); -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist. NOT _the_ _other_ _way_ | _around_! http://www.ozlabs.org/people/dgibson From dgibson@ozlabs.org Tue Jan 11 21:29:51 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 21:30:09 -0800 (PST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0C5ToCO022930 for ; Tue, 11 Jan 2005 21:29:51 -0800 Received: by ozlabs.org (Postfix, from userid 1007) id 614872BF23; Wed, 12 Jan 2005 16:29:44 +1100 (EST) Date: Wed, 12 Jan 2005 16:27:11 +1100 From: David Gibson To: Jeff Garzik , orinoco-devel@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [4/8] orinoco: Introduce free_orinocodev() function Message-ID: <20050112052711.GE30426@localhost.localdomain> Mail-Followup-To: Jeff Garzik , orinoco-devel@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org References: <20050112052352.GA30426@localhost.localdomain> <20050112052434.GB30426@localhost.localdomain> <20050112052543.GC30426@localhost.localdomain> <20050112052630.GD30426@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050112052630.GD30426@localhost.localdomain> User-Agent: Mutt/1.5.6+20040523i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 136 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hermes@gibson.dropbear.id.au Precedence: bulk X-list: netdev Introduce a free_orinocodev() function into the orinoco driver, used by the hardware type/initialization modules to free the device structure in preference to directly calling free_netdev(). At the moment free_orinocodev() just calls free_netdev(). Future merges will make it clean up internal scanning state, so merging this now will reduce the diff noise. Signed-off-by: David Gibson Index: working-2.6/drivers/net/wireless/orinoco.h =================================================================== --- working-2.6.orig/drivers/net/wireless/orinoco.h 2005-01-12 15:22:34.300627960 +1100 +++ working-2.6/drivers/net/wireless/orinoco.h 2005-01-12 15:22:34.360618840 +1100 @@ -107,6 +107,7 @@ extern struct net_device *alloc_orinocodev(int sizeof_card, int (*hard_reset)(struct orinoco_private *)); +extern void free_orinocodev(struct net_device *dev); extern int __orinoco_up(struct net_device *dev); extern int __orinoco_down(struct net_device *dev); extern int orinoco_stop(struct net_device *dev); Index: working-2.6/drivers/net/wireless/orinoco.c =================================================================== --- working-2.6.orig/drivers/net/wireless/orinoco.c 2005-01-12 15:22:34.300627960 +1100 +++ working-2.6/drivers/net/wireless/orinoco.c 2005-01-12 15:22:34.362618536 +1100 @@ -2398,6 +2398,11 @@ } +void free_orinocodev(struct net_device *dev) +{ + free_netdev(dev); +} + /********************************************************************/ /* Wireless extensions */ /********************************************************************/ Index: working-2.6/drivers/net/wireless/orinoco_cs.c =================================================================== --- working-2.6.orig/drivers/net/wireless/orinoco_cs.c 2005-01-12 15:22:34.265633280 +1100 +++ working-2.6/drivers/net/wireless/orinoco_cs.c 2005-01-12 15:22:34.363618384 +1100 @@ -249,7 +249,7 @@ dev); unregister_netdev(dev); } - free_netdev(dev); + free_orinocodev(dev); } /* orinoco_cs_detach */ /* Index: working-2.6/drivers/net/wireless/orinoco_pci.c =================================================================== --- working-2.6.orig/drivers/net/wireless/orinoco_pci.c 2005-01-12 15:22:34.330623400 +1100 +++ working-2.6/drivers/net/wireless/orinoco_pci.c 2005-01-12 15:22:34.363618384 +1100 @@ -254,7 +254,7 @@ if (dev->irq) free_irq(dev->irq, dev); - free_netdev(dev); + free_orinocodev(dev); } if (pci_ioaddr) @@ -279,7 +279,7 @@ iounmap(priv->hw.iobase); pci_set_drvdata(pdev, NULL); - free_netdev(dev); + free_orinocodev(dev); pci_disable_device(pdev); } Index: working-2.6/drivers/net/wireless/orinoco_plx.c =================================================================== --- working-2.6.orig/drivers/net/wireless/orinoco_plx.c 2005-01-12 15:22:34.330623400 +1100 +++ working-2.6/drivers/net/wireless/orinoco_plx.c 2005-01-12 15:22:34.363618384 +1100 @@ -279,7 +279,7 @@ fail: free_irq(dev->irq, dev); fail_irq: - free_netdev(dev); + free_orinocodev(dev); fail_alloc: pci_iounmap(pdev, mem); fail_map: @@ -304,7 +304,7 @@ pci_set_drvdata(pdev, NULL); - free_netdev(dev); + free_orinocodev(dev); release_region(pci_resource_start(pdev, 3), pci_resource_len(pdev, 3)); Index: working-2.6/drivers/net/wireless/orinoco_tmd.c =================================================================== --- working-2.6.orig/drivers/net/wireless/orinoco_tmd.c 2005-01-12 15:22:34.331623248 +1100 +++ working-2.6/drivers/net/wireless/orinoco_tmd.c 2005-01-12 15:22:34.364618232 +1100 @@ -164,7 +164,7 @@ out4: pci_iounmap(pdev, mem); out3: - free_netdev(dev); + free_orinocodev(dev); out2: release_region(pccard_ioaddr, pccard_iolen); out: @@ -188,7 +188,7 @@ pci_set_drvdata(pdev, NULL); - free_netdev(dev); + free_orinocodev(dev); release_region(pci_resource_start(pdev, 2), pci_resource_len(pdev, 2)); Index: working-2.6/drivers/net/wireless/airport.c =================================================================== --- working-2.6.orig/drivers/net/wireless/airport.c 2005-01-12 15:22:34.265633280 +1100 +++ working-2.6/drivers/net/wireless/airport.c 2005-01-12 15:25:06.000000000 +1100 @@ -149,7 +149,7 @@ ssleep(1); macio_set_drvdata(mdev, NULL); - free_netdev(dev); + free_orinocodev(dev); return 0; } @@ -211,7 +211,7 @@ if (macio_request_resource(mdev, 0, "airport")) { printk(KERN_ERR PFX "can't request IO resource !\n"); - free_netdev(dev); + free_orinocodev(dev); return -EBUSY; } -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist. NOT _the_ _other_ _way_ | _around_! http://www.ozlabs.org/people/dgibson From dgibson@ozlabs.org Tue Jan 11 21:29:58 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 21:30:14 -0800 (PST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0C5TvuR022957 for ; Tue, 11 Jan 2005 21:29:57 -0800 Received: by ozlabs.org (Postfix, from userid 1007) id 97F1F2BF28; Wed, 12 Jan 2005 16:29:44 +1100 (EST) Date: Wed, 12 Jan 2005 16:29:35 +1100 From: David Gibson To: Jeff Garzik , orinoco-devel@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [8/8] orinoco: PCI/PLX/TMD driver updates Message-ID: <20050112052935.GI30426@localhost.localdomain> Mail-Followup-To: Jeff Garzik , orinoco-devel@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org References: <20050112052352.GA30426@localhost.localdomain> <20050112052434.GB30426@localhost.localdomain> <20050112052543.GC30426@localhost.localdomain> <20050112052630.GD30426@localhost.localdomain> <20050112052711.GE30426@localhost.localdomain> <20050112052741.GF30426@localhost.localdomain> <20050112052814.GG30426@localhost.localdomain> <20050112052848.GH30426@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050112052848.GH30426@localhost.localdomain> User-Agent: Mutt/1.5.6+20040523i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 140 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hermes@gibson.dropbear.id.au Precedence: bulk X-list: netdev Update the initialization code in the various PCI incarnations of the orinoco driver. This applies similar initialization and shutdown cleanups to the orinoco_pci, orinoco_plx and orinoco_tmd drivers. It also adds COR reset support to the orinoco_plx and orinoco_tmd drivers, improves PCI power management support in the orinoco_pci driver and adds a couple of extra supported cards to the ID tables. Signed-off-by: David Gibson Index: working-2.6/drivers/net/wireless/orinoco_pci.c =================================================================== --- working-2.6.orig/drivers/net/wireless/orinoco_pci.c 2005-01-12 15:47:48.215477920 +1100 +++ working-2.6/drivers/net/wireless/orinoco_pci.c 2005-01-12 16:10:57.324301280 +1100 @@ -129,6 +129,11 @@ #define HERMES_PCI_COR_OFFT (500) /* ms */ #define HERMES_PCI_COR_BUSYT (500) /* ms */ +/* Orinoco PCI specific data */ +struct orinoco_pci_card { + void __iomem *pci_ioaddr; +}; + /* * Do a soft reset of the PCI card using the Configuration Option Register * We need this to get going... @@ -164,8 +169,9 @@ mdelay(1); reg = hermes_read_regn(hw, CMD); } - /* Did we timeout ? */ - if(time_after_eq(jiffies, timeout)) { + + /* Still busy? */ + if (reg & HERMES_CMD_BUSY) { printk(KERN_ERR PFX "Busy timeout\n"); return -ETIMEDOUT; } @@ -184,6 +190,7 @@ u16 __iomem *pci_ioaddr = NULL; unsigned long pci_iolen; struct orinoco_private *priv = NULL; + struct orinoco_pci_card *card; struct net_device *dev = NULL; err = pci_enable_device(pdev); @@ -192,24 +199,31 @@ return err; } + err = pci_request_regions(pdev, DRIVER_NAME); + if (err != 0) { + printk(KERN_ERR PFX "Cannot obtain PCI resources\n"); + goto fail_resources; + } + /* Resource 0 is mapped to the hermes registers */ pci_iorange = pci_resource_start(pdev, 0); pci_iolen = pci_resource_len(pdev, 0); pci_ioaddr = ioremap(pci_iorange, pci_iolen); - if (! pci_iorange) { + if (!pci_iorange) { printk(KERN_ERR PFX "Cannot remap hardware registers\n"); - goto fail; + goto fail_map; } /* Allocate network device */ - dev = alloc_orinocodev(0, NULL); + dev = alloc_orinocodev(sizeof(*card), orinoco_pci_cor_reset); if (! dev) { err = -ENOMEM; - goto fail; + goto fail_alloc; } priv = netdev_priv(dev); - dev->base_addr = (unsigned long) pci_ioaddr; + card = priv->card; + card->pci_ioaddr = pci_ioaddr; dev->mem_start = pci_iorange; dev->mem_end = pci_iorange + pci_iolen - 1; SET_MODULE_OWNER(dev); @@ -226,14 +240,14 @@ if (err) { printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq); err = -EBUSY; - goto fail; + goto fail_irq; } dev->irq = pdev->irq; /* Perform a COR reset to start the card */ - if(orinoco_pci_cor_reset(priv) != 0) { + err = orinoco_pci_cor_reset(priv); + if (err) { printk(KERN_ERR PFX "Initial reset failed\n"); - err = -ETIMEDOUT; goto fail; } @@ -250,16 +264,19 @@ return 0; fail: - if (dev) { - if (dev->irq) - free_irq(dev->irq, dev); + free_irq(pdev->irq, dev); - free_orinocodev(dev); - } + fail_irq: + pci_set_drvdata(pdev, NULL); + free_orinocodev(dev); + + fail_alloc: + iounmap(pci_ioaddr); - if (pci_ioaddr) - iounmap(pci_ioaddr); + fail_map: + pci_release_regions(pdev); + fail_resources: pci_disable_device(pdev); return err; @@ -269,18 +286,14 @@ { struct net_device *dev = pci_get_drvdata(pdev); struct orinoco_private *priv = netdev_priv(dev); + struct orinoco_pci_card *card = priv->card; unregister_netdev(dev); - - if (dev->irq) - free_irq(dev->irq, dev); - - if (priv->hw.iobase) - iounmap(priv->hw.iobase); - + free_irq(dev->irq, dev); pci_set_drvdata(pdev, NULL); free_orinocodev(dev); - + iounmap(card->pci_ioaddr); + pci_release_regions(pdev); pci_disable_device(pdev); } @@ -312,6 +325,9 @@ orinoco_unlock(priv, &flags); + pci_save_state(pdev); + pci_set_power_state(pdev, 3); + return 0; } @@ -324,6 +340,9 @@ printk(KERN_DEBUG "%s: Orinoco-PCI waking up\n", dev->name); + pci_set_power_state(pdev, 0); + pci_restore_state(pdev); + err = orinoco_reinit_firmware(dev); if (err) { printk(KERN_ERR "%s: Error %d re-initializing firmware on orinoco_pci_resume()\n", @@ -354,6 +373,8 @@ {0x1260, 0x3872, PCI_ANY_ID, PCI_ANY_ID,}, /* Intersil Prism 2.5 */ {0x1260, 0x3873, PCI_ANY_ID, PCI_ANY_ID,}, + /* Samsung MagicLAN SWL-2210P */ + {0x167d, 0xa000, PCI_ANY_ID, PCI_ANY_ID,}, {0,}, }; Index: working-2.6/drivers/net/wireless/orinoco_plx.c =================================================================== --- working-2.6.orig/drivers/net/wireless/orinoco_plx.c 2005-01-12 15:47:48.216477768 +1100 +++ working-2.6/drivers/net/wireless/orinoco_plx.c 2004-11-05 14:20:30.000000000 +1100 @@ -142,26 +142,68 @@ #include "hermes.h" #include "orinoco.h" -#define COR_OFFSET (0x3e0/2) /* COR attribute offset of Prism2 PC card */ +#define COR_OFFSET (0x3e0) /* COR attribute offset of Prism2 PC card */ #define COR_VALUE (COR_LEVEL_REQ | COR_FUNC_ENA) /* Enable PC card with interrupt in level trigger */ +#define COR_RESET (0x80) /* reset bit in the COR register */ +#define PLX_RESET_TIME (500) /* milliseconds */ #define PLX_INTCSR 0x4c /* Interrupt Control & Status Register */ #define PLX_INTCSR_INTEN (1<<6) /* Interrupt Enable bit */ -static const u16 cis_magic[] = { - 0x0001, 0x0003, 0x0000, 0x0000, 0x00ff, 0x0017, 0x0004, 0x0067 +static const u8 cis_magic[] = { + 0x01, 0x03, 0x00, 0x00, 0xff, 0x17, 0x04, 0x67 }; +/* Orinoco PLX specific data */ +struct orinoco_plx_card { + void __iomem *attr_mem; +}; + +/* + * Do a soft reset of the card using the Configuration Option Register + */ +static int orinoco_plx_cor_reset(struct orinoco_private *priv) +{ + hermes_t *hw = &priv->hw; + struct orinoco_plx_card *card = priv->card; + u8 __iomem *attr_mem = card->attr_mem; + unsigned long timeout; + u16 reg; + + writeb(COR_VALUE | COR_RESET, attr_mem + COR_OFFSET); + mdelay(1); + + writeb(COR_VALUE, attr_mem + COR_OFFSET); + mdelay(1); + + /* Just in case, wait more until the card is no longer busy */ + timeout = jiffies + (PLX_RESET_TIME * HZ / 1000); + reg = hermes_read_regn(hw, CMD); + while (time_before(jiffies, timeout) && (reg & HERMES_CMD_BUSY)) { + mdelay(1); + reg = hermes_read_regn(hw, CMD); + } + + /* Did we timeout ? */ + if (reg & HERMES_CMD_BUSY) { + printk(KERN_ERR PFX "Busy timeout\n"); + return -ETIMEDOUT; + } + + return 0; +} + + static int orinoco_plx_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) { int err = 0; - u16 __iomem *attr_mem = NULL; - u32 reg, addr; + u8 __iomem *attr_mem = NULL; + u32 csr_reg, plx_addr; struct orinoco_private *priv = NULL; + struct orinoco_plx_card *card; unsigned long pccard_ioaddr = 0; unsigned long pccard_iolen = 0; - u16 magic[8]; struct net_device *dev = NULL; void __iomem *mem; int i; @@ -169,78 +211,38 @@ err = pci_enable_device(pdev); if (err) { printk(KERN_ERR PFX "Cannot enable PCI device\n"); - return -EIO; + return err; } - /* Resource 2 is mapped to the PCMCIA space */ - attr_mem = ioremap(pci_resource_start(pdev, 2), PAGE_SIZE); - if (!attr_mem) + err = pci_request_regions(pdev, DRIVER_NAME); + if (err != 0) { + printk(KERN_ERR PFX "Cannot obtain PCI resources\n"); goto fail_resources; - - printk(KERN_DEBUG PFX "CIS: "); - for (i = 0; i < 16; i++) { - printk("%02X:", readw(attr_mem+i)); } - printk("\n"); - - /* Verify whether PC card is present */ - /* FIXME: we probably need to be smarted about this */ - memcpy_fromio(magic, attr_mem, 16); - if (memcmp(magic, cis_magic, 16) != 0) { - printk(KERN_ERR PFX "The CIS value of Prism2 PC " - "card is unexpected\n"); - err = -EIO; - iounmap(attr_mem); - goto fail_resources; - } - - /* PCMCIA COR is the first byte following CIS: this write should - * enable I/O mode and select level-triggered interrupts */ - writew(COR_VALUE, attr_mem + COR_OFFSET); - mdelay(1); - reg = readw(attr_mem + COR_OFFSET); - iounmap(attr_mem); - if (reg != COR_VALUE) { - printk(KERN_ERR PFX "Error setting COR value (reg=%x)\n", reg); - goto fail_resources; - } + /* Resource 1 is mapped to PLX-specific registers */ + plx_addr = pci_resource_start(pdev, 1); - /* bjoern: We need to tell the card to enable interrupts, in - case the serial eprom didn't do this already. See the - PLX9052 data book, p8-1 and 8-24 for reference. */ - addr = pci_resource_start(pdev, 1); - reg = inl(addr+PLX_INTCSR); - if (reg & PLX_INTCSR_INTEN) - printk(KERN_DEBUG PFX "Local Interrupt already enabled\n"); - else { - reg |= PLX_INTCSR_INTEN; - outl(reg, addr+PLX_INTCSR); - reg = inl(addr+PLX_INTCSR); - if(!(reg & PLX_INTCSR_INTEN)) { - printk(KERN_ERR PFX "Couldn't enable Local Interrupts\n"); - goto fail_resources; - } + /* Resource 2 is mapped to the PCMCIA attribute memory */ + attr_mem = ioremap(pci_resource_start(pdev, 2), + pci_resource_len(pdev, 2)); + if (!attr_mem) { + printk(KERN_ERR PFX "Cannot remap PCMCIA space\n"); + goto fail_map_attr; } /* Resource 3 is mapped to the PCMCIA I/O address space */ pccard_ioaddr = pci_resource_start(pdev, 3); pccard_iolen = pci_resource_len(pdev, 3); - if (! request_region(pccard_ioaddr, pccard_iolen, DRIVER_NAME)) { - printk(KERN_ERR PFX "I/O resource 0x%lx @ 0x%lx busy\n", - pccard_iolen, pccard_ioaddr); - err = -EBUSY; - goto fail_resources; - } mem = pci_iomap(pdev, 3, 0); if (!mem) { err = -ENOMEM; - goto fail_map; + goto fail_map_io; } /* Allocate network device */ - dev = alloc_orinocodev(0, NULL); + dev = alloc_orinocodev(sizeof(*card), orinoco_plx_cor_reset); if (!dev) { printk(KERN_ERR PFX "Cannot allocate network device\n"); err = -ENOMEM; @@ -248,6 +250,8 @@ } priv = netdev_priv(dev); + card = priv->card; + card->attr_mem = attr_mem; dev->base_addr = pccard_ioaddr; SET_MODULE_OWNER(dev); SET_NETDEV_DEV(dev, &pdev->dev); @@ -268,6 +272,43 @@ } dev->irq = pdev->irq; + /* bjoern: We need to tell the card to enable interrupts, in + case the serial eprom didn't do this already. See the + PLX9052 data book, p8-1 and 8-24 for reference. */ + csr_reg = inl(plx_addr + PLX_INTCSR); + if (!(csr_reg & PLX_INTCSR_INTEN)) { + csr_reg |= PLX_INTCSR_INTEN; + outl(csr_reg, plx_addr + PLX_INTCSR); + csr_reg = inl(plx_addr + PLX_INTCSR); + if (!(csr_reg & PLX_INTCSR_INTEN)) { + printk(KERN_ERR PFX "Cannot enable interrupts\n"); + goto fail; + } + } + + err = orinoco_plx_cor_reset(priv); + if (err) { + printk(KERN_ERR PFX "Initial reset failed\n"); + goto fail; + } + + printk(KERN_DEBUG PFX "CIS: "); + for (i = 0; i < 16; i++) { + printk("%02X:", readb(attr_mem + 2*i)); + } + printk("\n"); + + /* Verify whether a supported PC card is present */ + /* FIXME: we probably need to be smarted about this */ + for (i = 0; i < sizeof(cis_magic); i++) { + if (cis_magic[i] != readb(attr_mem +2*i)) { + printk(KERN_ERR PFX "The CIS value of Prism2 PC " + "card is unexpected\n"); + err = -EIO; + goto fail; + } + } + err = register_netdev(dev); if (err) { printk(KERN_ERR PFX "Cannot register network device\n"); @@ -277,13 +318,21 @@ return 0; fail: - free_irq(dev->irq, dev); + free_irq(pdev->irq, dev); + fail_irq: + pci_set_drvdata(pdev, NULL); free_orinocodev(dev); + fail_alloc: pci_iounmap(pdev, mem); - fail_map: - release_region(pccard_ioaddr, pccard_iolen); + + fail_map_io: + iounmap(attr_mem); + + fail_map_attr: + pci_release_regions(pdev); + fail_resources: pci_disable_device(pdev); @@ -294,20 +343,18 @@ { struct net_device *dev = pci_get_drvdata(pdev); struct orinoco_private *priv = netdev_priv(dev); + struct orinoco_plx_card *card = priv->card; + u8 __iomem *attr_mem = card->attr_mem; - unregister_netdev(dev); - - if (dev->irq) - free_irq(dev->irq, dev); + BUG_ON(! dev); - pci_iounmap(pdev, priv->hw.iobase); - + unregister_netdev(dev); + free_irq(dev->irq, dev); pci_set_drvdata(pdev, NULL); - free_orinocodev(dev); - - release_region(pci_resource_start(pdev, 3), pci_resource_len(pdev, 3)); - + pci_iounmap(pdev, priv->hw.iobase); + iounmap(attr_mem); + pci_release_regions(pdev); pci_disable_device(pdev); } Index: working-2.6/drivers/net/wireless/orinoco_tmd.c =================================================================== --- working-2.6.orig/drivers/net/wireless/orinoco_tmd.c 2005-01-12 15:47:48.216477768 +1100 +++ working-2.6/drivers/net/wireless/orinoco_tmd.c 2004-11-05 14:37:35.000000000 +1100 @@ -79,59 +79,89 @@ #include "orinoco.h" #define COR_VALUE (COR_LEVEL_REQ | COR_FUNC_ENA) /* Enable PC card with interrupt in level trigger */ +#define COR_RESET (0x80) /* reset bit in the COR register */ +#define TMD_RESET_TIME (500) /* milliseconds */ + +/* Orinoco TMD specific data */ +struct orinoco_tmd_card { + u32 tmd_io; +}; + + +/* + * Do a soft reset of the card using the Configuration Option Register + */ +static int orinoco_tmd_cor_reset(struct orinoco_private *priv) +{ + hermes_t *hw = &priv->hw; + struct orinoco_tmd_card *card = priv->card; + u32 addr = card->tmd_io; + unsigned long timeout; + u16 reg; + + outb(COR_VALUE | COR_RESET, addr); + mdelay(1); + + outb(COR_VALUE, addr); + mdelay(1); + + /* Just in case, wait more until the card is no longer busy */ + timeout = jiffies + (TMD_RESET_TIME * HZ / 1000); + reg = hermes_read_regn(hw, CMD); + while (time_before(jiffies, timeout) && (reg & HERMES_CMD_BUSY)) { + mdelay(1); + reg = hermes_read_regn(hw, CMD); + } + + /* Did we timeout ? */ + if (reg & HERMES_CMD_BUSY) { + printk(KERN_ERR PFX "Busy timeout\n"); + return -ETIMEDOUT; + } + + return 0; +} + static int orinoco_tmd_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) { int err = 0; - u32 reg, addr; struct orinoco_private *priv = NULL; - unsigned long pccard_ioaddr = 0; - unsigned long pccard_iolen = 0; + struct orinoco_tmd_card *card; struct net_device *dev = NULL; void __iomem *mem; err = pci_enable_device(pdev); if (err) { printk(KERN_ERR PFX "Cannot enable PCI device\n"); - return -EIO; + return err; } - printk(KERN_DEBUG PFX "TMD setup\n"); - pccard_ioaddr = pci_resource_start(pdev, 2); - pccard_iolen = pci_resource_len(pdev, 2); - if (! request_region(pccard_ioaddr, pccard_iolen, DRIVER_NAME)) { - printk(KERN_ERR PFX "I/O resource at 0x%lx len 0x%lx busy\n", - pccard_ioaddr, pccard_iolen); - err = -EBUSY; - goto out; + err = pci_request_regions(pdev, DRIVER_NAME); + if (err != 0) { + printk(KERN_ERR PFX "Cannot obtain PCI resources\n"); + goto fail_resources; } - addr = pci_resource_start(pdev, 1); - outb(COR_VALUE, addr); - mdelay(1); - reg = inb(addr); - if (reg != COR_VALUE) { - printk(KERN_ERR PFX "Error setting TMD COR values %x should be %x\n", reg, COR_VALUE); - err = -EIO; - goto out2; + + mem = pci_iomap(pdev, 2, 0); + if (! mem) { + err = -ENOMEM; + goto fail_iomap; } /* Allocate network device */ - dev = alloc_orinocodev(0, NULL); + dev = alloc_orinocodev(sizeof(*card), orinoco_tmd_cor_reset); if (! dev) { printk(KERN_ERR PFX "Cannot allocate network device\n"); err = -ENOMEM; - goto out2; - } - - mem = pci_iomap(pdev, 2, 0); - if (!mem) { - err = -ENOMEM; - goto out3; + goto fail_alloc; } priv = netdev_priv(dev); - dev->base_addr = pccard_ioaddr; + card = priv->card; + card->tmd_io = pci_resource_start(pdev, 1); + dev->base_addr = pci_resource_start(pdev, 2); SET_MODULE_OWNER(dev); SET_NETDEV_DEV(dev, &pdev->dev); @@ -140,36 +170,46 @@ printk(KERN_DEBUG PFX "Detected Orinoco/Prism2 TMD device " "at %s irq:%d, io addr:0x%lx\n", pci_name(pdev), pdev->irq, - pccard_ioaddr); + dev->base_addr); err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ, dev->name, dev); if (err) { printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq); err = -EBUSY; - goto out4; + goto fail_irq; } dev->irq = pdev->irq; + err = orinoco_tmd_cor_reset(priv); + if (err) { + printk(KERN_ERR PFX "Initial reset failed\n"); + goto fail; + } + err = register_netdev(dev); if (err) { printk(KERN_ERR PFX "Cannot register network device\n"); - goto out5; + goto fail; } return 0; -out5: - free_irq(dev->irq, dev); -out4: - pci_iounmap(pdev, mem); -out3: + fail: + free_irq(pdev->irq, dev); + + fail_irq: + pci_set_drvdata(pdev, NULL); free_orinocodev(dev); -out2: - release_region(pccard_ioaddr, pccard_iolen); -out: + + fail_alloc: + pci_iounmap(pdev, mem); + + fail_iomap: + pci_release_regions(pdev); + + fail_resources: pci_disable_device(pdev); - printk(KERN_DEBUG PFX "init_one(), FAIL!\n"); return err; } @@ -177,21 +217,16 @@ static void __devexit orinoco_tmd_remove_one(struct pci_dev *pdev) { struct net_device *dev = pci_get_drvdata(pdev); - struct orinoco_private *priv = netdev_priv(dev); + struct orinoco_private *priv = dev->priv; - unregister_netdev(dev); - - if (dev->irq) - free_irq(dev->irq, dev); - - pci_iounmap(pdev, priv->hw.iobase); + BUG_ON(! dev); + unregister_netdev(dev); + free_irq(dev->irq, dev); pci_set_drvdata(pdev, NULL); - free_orinocodev(dev); - - release_region(pci_resource_start(pdev, 2), pci_resource_len(pdev, 2)); - + pci_iounmap(pdev, priv->hw.iobase); + pci_release_regions(pdev); pci_disable_device(pdev); } -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist. NOT _the_ _other_ _way_ | _around_! http://www.ozlabs.org/people/dgibson From jgarzik@pobox.com Tue Jan 11 22:35:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 11 Jan 2005 22:36:08 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0C6ZjPC028934 for ; Tue, 11 Jan 2005 22:35:46 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1Coc6W-00054p-Ho; Wed, 12 Jan 2005 06:35:44 +0000 Message-ID: <41E4C52F.5020108@pobox.com> Date: Wed, 12 Jan 2005 01:35:27 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrew Morton , Linus Torvalds CC: Netdev Subject: [BK PATCHES] 2.6.x net driver updates (updated) Content-Type: multipart/mixed; boundary="------------000607000805030206080607" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 142 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------000607000805030206080607 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit updated from when last sent, with akpm build/warning fixes. --------------000607000805030206080607 Content-Type: text/plain; name="changelog.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="changelog.txt" Please do a bk pull bk://gkernel.bkbits.net/net-drivers-2.6 This will update the following files: drivers/net/3c515.c | 2 drivers/net/arcnet/arcnet.c | 3 drivers/net/e1000/e1000_ethtool.c | 2 drivers/net/e1000/e1000_main.c | 4 drivers/net/eepro.c | 144 +++++-- drivers/net/ibm_emac/ibm_emac.h | 2 drivers/net/ibm_emac/ibm_emac_core.c | 15 drivers/net/ibm_emac/ibm_emac_phy.c | 19 drivers/net/ixgb/ixgb.h | 25 + drivers/net/ixgb/ixgb_ee.c | 192 +++++---- drivers/net/ixgb/ixgb_ethtool.c | 518 ++++++++++++++++--------- drivers/net/ixgb/ixgb_hw.c | 231 ++++++----- drivers/net/ixgb/ixgb_hw.h | 50 +- drivers/net/ixgb/ixgb_ids.h | 21 - drivers/net/ixgb/ixgb_main.c | 705 +++++++++++++++++------------------ drivers/net/ixgb/ixgb_osdep.h | 10 drivers/net/ixgb/ixgb_param.c | 316 +++++++-------- drivers/net/s2io.c | 22 - drivers/net/s2io.h | 4 drivers/net/smc-ultra.c | 2 drivers/net/smc91x.c | 16 drivers/net/wireless/orinoco.c | 203 +++------- drivers/net/wireless/wl3501_cs.c | 4 include/linux/arcdevice.h | 1 24 files changed, 1418 insertions(+), 1093 deletions(-) through these ChangeSets: Andi Kleen: o Fix gcc4 compilation in s2io net driver Andrew Morton: o 3c515 warning fix o ixgb whitespace fix o eepro build fix Aristeu Sergio Rozanski Filho: o eepro: fix auto-detection option o eepro: fix return value in init_module() o eepro: basic ethtool support o eepro: use module_param macros o eepro: cache EEPROM values Christoph Hellwig: o mark arcdev_setup static David Gibson: o Another trivial orinoco update Ganesh Venkatesan: o ixgb: White space corrections o ixgb: Driver version number update o ixgb: Support for 2.6.x style module parameters o ixgb: Fix Tx cleanup logic o ixgb: Shrink size and fix ordering of elements in ixgb_buffer o ixgb: ethtool_ops support o ixgb: Replace kmalloc with vmalloc (one time alloc) o ixgb: Remove support for RAIDC interrupt mitigation o ixgb: Limit Rx Address Filter Array entries to 3 o ixgb: Fix infinite loop trying to re-establish link o ixgb: Fix error in setting MFS register o ixgb: Poll Routine cleanup o ixgb: Fix memory leak in NAPI mode o ixgb: Fix VLAN filter setup errors (while running on PPC) o ixgb: Add support for 10GbE LR device ID o ixgb: Enable Message Signalled Interrupts o ixgb: Limit number of Rx Descriptors to 512 Hirokazu Takata: o net: netconsole support for smc91x Jeff Garzik: o e1000/ixgb net drivers: rename global symbol to fix 'make allyesconfig' Matt Porter: o Add netpoll support o allow rx of the maximum sized VLAN tagged packets o EMAC: fix ibm_emac autonegotiation result parsing Paul Gortmaker: o smc-ultra.c too-verbose driver Raghavendra Koushik: o S2io: fixes in free_shared_mem function Randy Dunlap: o wl3501: fix module_param types/warnings --------------000607000805030206080607 Content-Type: text/plain; name="patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch" diff -Nru a/drivers/net/3c515.c b/drivers/net/3c515.c --- a/drivers/net/3c515.c 2005-01-12 01:33:23 -05:00 +++ b/drivers/net/3c515.c 2005-01-12 01:33:23 -05:00 @@ -34,7 +34,7 @@ /* "Knobs" that adjust features and parameters. */ /* Set the copy breakpoint for the copy-only-tiny-frames scheme. Setting to > 1512 effectively disables this feature. */ -static const int rx_copybreak = 200; +static int rx_copybreak = 200; /* Allow setting MTU to a larger size, bypassing the normal ethernet setup. */ static const int mtu = 1500; diff -Nru a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c --- a/drivers/net/arcnet/arcnet.c 2005-01-12 01:33:23 -05:00 +++ b/drivers/net/arcnet/arcnet.c 2005-01-12 01:33:23 -05:00 @@ -93,7 +93,6 @@ EXPORT_SYMBOL(arc_proto_null); EXPORT_SYMBOL(arcnet_unregister_proto); EXPORT_SYMBOL(arcnet_debug); -EXPORT_SYMBOL(arcdev_setup); EXPORT_SYMBOL(alloc_arcdev); EXPORT_SYMBOL(arcnet_interrupt); @@ -317,7 +316,7 @@ /* Setup a struct device for ARCnet. */ -void arcdev_setup(struct net_device *dev) +static void arcdev_setup(struct net_device *dev) { dev->type = ARPHRD_ARCNET; dev->hard_header_len = sizeof(struct archdr); diff -Nru a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c --- a/drivers/net/e1000/e1000_ethtool.c 2005-01-12 01:33:23 -05:00 +++ b/drivers/net/e1000/e1000_ethtool.c 2005-01-12 01:33:23 -05:00 @@ -1666,7 +1666,7 @@ .get_ethtool_stats = e1000_get_ethtool_stats, }; -void set_ethtool_ops(struct net_device *netdev) +void e1000_set_ethtool_ops(struct net_device *netdev) { SET_ETHTOOL_OPS(netdev, &e1000_ethtool_ops); } diff -Nru a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c --- a/drivers/net/e1000/e1000_main.c 2005-01-12 01:33:23 -05:00 +++ b/drivers/net/e1000/e1000_main.c 2005-01-12 01:33:23 -05:00 @@ -151,7 +151,7 @@ static int e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd); static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd); -void set_ethtool_ops(struct net_device *netdev); +void e1000_set_ethtool_ops(struct net_device *netdev); static void e1000_enter_82542_rst(struct e1000_adapter *adapter); static void e1000_leave_82542_rst(struct e1000_adapter *adapter); static void e1000_tx_timeout(struct net_device *dev); @@ -475,7 +475,7 @@ netdev->set_mac_address = &e1000_set_mac; netdev->change_mtu = &e1000_change_mtu; netdev->do_ioctl = &e1000_ioctl; - set_ethtool_ops(netdev); + e1000_set_ethtool_ops(netdev); netdev->tx_timeout = &e1000_tx_timeout; netdev->watchdog_timeo = 5 * HZ; #ifdef CONFIG_E1000_NAPI diff -Nru a/drivers/net/eepro.c b/drivers/net/eepro.c --- a/drivers/net/eepro.c 2005-01-12 01:33:23 -05:00 +++ b/drivers/net/eepro.c 2005-01-12 01:33:23 -05:00 @@ -23,6 +23,7 @@ This is a compatibility hardware problem. Versions: + 0.13b basic ethtool support (aris, 09/13/2004) 0.13a in memory shortage, drop packets also in board (Michael Westermann , 07/30/2002) 0.13 irq sharing, rewrote probe function, fixed a nasty bug in @@ -104,7 +105,7 @@ */ static const char version[] = - "eepro.c: v0.13 11/08/2001 aris@cathedrallabs.org\n"; + "eepro.c: v0.13b 09/13/2004 aris@cathedrallabs.org\n"; #include @@ -146,19 +147,21 @@ #include #include #include +#include #include #include #include #define DRV_NAME "eepro" +#define DRV_VERSION "0.13b" #define compat_dev_kfree_skb( skb, mode ) dev_kfree_skb( (skb) ) /* I had reports of looong delays with SLOW_DOWN defined as udelay(2) */ #define SLOW_DOWN inb(0x80) /* udelay(2) */ #define compat_init_data __initdata - +enum iftype { AUI=0, BNC=1, TPE=2 }; /* First, a few definitions that the brave might change. */ /* A zero-terminated list of I/O addresses to be probed. */ @@ -214,6 +217,7 @@ short rcv_lower_limit; short rcv_upper_limit; unsigned char eeprom_reg; + unsigned short word[8]; }; /* The station (ethernet) address prefix, used for IDing the board. */ @@ -608,16 +612,22 @@ } #endif -static void __init printEEPROMInfo(short ioaddr, struct net_device *dev) +static void __init printEEPROMInfo(struct net_device *dev) { + struct eepro_local *lp = (struct eepro_local *)dev->priv; + int ioaddr = dev->base_addr; unsigned short Word; int i,j; - for (i=0, j=ee_Checksum; iword[i]; + for ( ; i < ee_SIZE; i++) + j += read_eeprom(ioaddr, i, dev); + printk(KERN_DEBUG "Checksum: %#x\n",j&0xffff); - Word=read_eeprom(ioaddr, 0, dev); + Word = lp->word[0]; printk(KERN_DEBUG "Word0:\n"); printk(KERN_DEBUG " Plug 'n Pray: %d\n",GetBit(Word,ee_PnP)); printk(KERN_DEBUG " Buswidth: %d\n",(GetBit(Word,ee_BusWidth)+1)*8 ); @@ -625,7 +635,7 @@ printk(KERN_DEBUG " IO Address: %#x\n", (Word>>ee_IO0)<<4); if (net_debug>4) { - Word=read_eeprom(ioaddr, 1, dev); + Word = lp->word[1]; printk(KERN_DEBUG "Word1:\n"); printk(KERN_DEBUG " INT: %d\n", Word & ee_IntMask); printk(KERN_DEBUG " LI: %d\n", GetBit(Word,ee_LI)); @@ -636,7 +646,7 @@ printk(KERN_DEBUG " Duplex: %d\n", GetBit(Word,ee_Duplex)); } - Word=read_eeprom(ioaddr, 5, dev); + Word = lp->word[5]; printk(KERN_DEBUG "Word5:\n"); printk(KERN_DEBUG " BNC: %d\n",GetBit(Word,ee_BNC_TPE)); printk(KERN_DEBUG " NumConnectors: %d\n",GetBit(Word,ee_NumConn)); @@ -646,12 +656,12 @@ if (GetBit(Word,ee_PortAUI)) printk(KERN_DEBUG "AUI "); printk(KERN_DEBUG "port(s) \n"); - Word=read_eeprom(ioaddr, 6, dev); + Word = lp->word[6]; printk(KERN_DEBUG "Word6:\n"); printk(KERN_DEBUG " Stepping: %d\n",Word & ee_StepMask); printk(KERN_DEBUG " BoardID: %d\n",Word>>ee_BoardID); - Word=read_eeprom(ioaddr, 7, dev); + Word = lp->word[7]; printk(KERN_DEBUG "Word7:\n"); printk(KERN_DEBUG " INT to IRQ:\n"); @@ -725,7 +735,7 @@ printk(", %s.\n", ifmap[dev->if_port]); if (net_debug > 3) { - i = read_eeprom(dev->base_addr, 5, dev); + i = lp->word[5]; if (i & 0x2000) /* bit 13 of EEPROM word 5 */ printk(KERN_DEBUG "%s: Concurrent Processing is " "enabled but not used!\n", dev->name); @@ -733,19 +743,20 @@ /* Check the station address for the manufacturer's code */ if (net_debug>3) - printEEPROMInfo(dev->base_addr, dev); + printEEPROMInfo(dev); } +static struct ethtool_ops eepro_ethtool_ops; + /* This is the real probe routine. Linux has a history of friendly device probes on the ISA bus. A good device probe avoids doing writes, and verifies that the correct device exists and functions. */ static int __init eepro_probe1(struct net_device *dev, int autoprobe) { - unsigned short station_addr[6], id, counter; + unsigned short station_addr[3], id, counter; int i; struct eepro_local *lp; - enum iftype { AUI=0, BNC=1, TPE=2 }; int ioaddr = dev->base_addr; /* Grab the region so we can find another board if autoIRQ fails. */ @@ -796,11 +807,16 @@ lp->xmt_bar = XMT_BAR_10; station_addr[0] = read_eeprom(ioaddr, 2, dev); } - station_addr[1] = read_eeprom(ioaddr, 3, dev); - station_addr[2] = read_eeprom(ioaddr, 4, dev); + + /* get all words at once. will be used here and for ethtool */ + for (i = 0; i < 8; i++) { + lp->word[i] = read_eeprom(ioaddr, i, dev); + } + station_addr[1] = lp->word[3]; + station_addr[2] = lp->word[4]; if (!lp->eepro) { - if (read_eeprom(ioaddr,7,dev)== ee_FX_INT2IRQ) + if (lp->word[7] == ee_FX_INT2IRQ) lp->eepro = 2; else if (station_addr[2] == SA_ADDR1) lp->eepro = 1; @@ -817,15 +833,15 @@ /* calculate {xmt,rcv}_{lower,upper}_limit */ eepro_recalc(dev); - if (GetBit( read_eeprom(ioaddr, 5, dev),ee_BNC_TPE)) + if (GetBit(lp->word[5], ee_BNC_TPE)) dev->if_port = BNC; else dev->if_port = TPE; if (dev->irq < 2 && lp->eepro != 0) { /* Mask off INT number */ - int count = read_eeprom(ioaddr, 1, dev) & 7; - unsigned irqMask = read_eeprom(ioaddr, 7, dev); + int count = lp->word[1] & 7; + unsigned irqMask = lp->word[7]; while (count--) irqMask &= irqMask - 1; @@ -850,6 +866,7 @@ dev->set_multicast_list = &set_multicast_list; dev->tx_timeout = eepro_tx_timeout; dev->watchdog_timeo = TX_TIMEOUT; + dev->ethtool_ops = &eepro_ethtool_ops; /* print boot time info */ eepro_print_info(dev); @@ -941,7 +958,7 @@ if (net_debug > 3) printk(KERN_DEBUG "%s: entering eepro_open routine.\n", dev->name); - irqMask = read_eeprom(ioaddr,7,dev); + irqMask = lp->word[7]; if (lp->eepro == LAN595FX_10ISA) { if (net_debug > 3) printk(KERN_DEBUG "p->eepro = 3;\n"); @@ -1070,8 +1087,6 @@ old9 = inb(ioaddr + 9); if (irqMask==ee_FX_INT2IRQ) { - enum iftype { AUI=0, BNC=1, TPE=2 }; - if (net_debug > 3) { printk(KERN_DEBUG "IrqMask: %#x\n",irqMask); printk(KERN_DEBUG "i82595FX detected!\n"); @@ -1701,12 +1716,72 @@ } } +static int eepro_ethtool_get_settings(struct net_device *dev, + struct ethtool_cmd *cmd) +{ + struct eepro_local *lp = (struct eepro_local *)dev->priv; + + cmd->supported = SUPPORTED_10baseT_Half | + SUPPORTED_10baseT_Full | + SUPPORTED_Autoneg; + cmd->advertising = ADVERTISED_10baseT_Half | + ADVERTISED_10baseT_Full | + ADVERTISED_Autoneg; + + if (GetBit(lp->word[5], ee_PortTPE)) { + cmd->supported |= SUPPORTED_TP; + cmd->advertising |= ADVERTISED_TP; + } + if (GetBit(lp->word[5], ee_PortBNC)) { + cmd->supported |= SUPPORTED_BNC; + cmd->advertising |= ADVERTISED_BNC; + } + if (GetBit(lp->word[5], ee_PortAUI)) { + cmd->supported |= SUPPORTED_AUI; + cmd->advertising |= ADVERTISED_AUI; + } + + cmd->speed = SPEED_10; + + if (dev->if_port == TPE && lp->word[1] & ee_Duplex) { + cmd->duplex = DUPLEX_FULL; + } + else { + cmd->duplex = DUPLEX_HALF; + } + + cmd->port = dev->if_port; + cmd->phy_address = dev->base_addr; + cmd->transceiver = XCVR_INTERNAL; + + if (lp->word[0] & ee_AutoNeg) { + cmd->autoneg = 1; + } + + return 0; +} + +static void eepro_ethtool_get_drvinfo(struct net_device *dev, + struct ethtool_drvinfo *drvinfo) +{ + strcpy(drvinfo->driver, DRV_NAME); + strcpy(drvinfo->version, DRV_VERSION); + sprintf(drvinfo->bus_info, "ISA 0x%lx", dev->base_addr); +} + +static struct ethtool_ops eepro_ethtool_ops = { + .get_settings = eepro_ethtool_get_settings, + .get_drvinfo = eepro_ethtool_get_drvinfo, +}; + #ifdef MODULE #define MAX_EEPRO 8 static struct net_device *dev_eepro[MAX_EEPRO]; -static int io[MAX_EEPRO]; +static int io[MAX_EEPRO] = { + [0 ... MAX_EEPRO-1] = -1 +}; static int irq[MAX_EEPRO]; static int mem[MAX_EEPRO] = { /* Size of the rx buffer in KB */ [0 ... MAX_EEPRO-1] = RCV_DEFAULT_RAM/1024 @@ -1716,14 +1791,15 @@ static int n_eepro; /* For linux 2.1.xx */ -MODULE_AUTHOR("Pascal Dupuis, and aris@cathedrallabs.org"); +MODULE_AUTHOR("Pascal Dupuis and others"); MODULE_DESCRIPTION("Intel i82595 ISA EtherExpressPro10/10+ driver"); MODULE_LICENSE("GPL"); -MODULE_PARM(io, "1-" __MODULE_STRING(MAX_EEPRO) "i"); -MODULE_PARM(irq, "1-" __MODULE_STRING(MAX_EEPRO) "i"); -MODULE_PARM(mem, "1-" __MODULE_STRING(MAX_EEPRO) "i"); -MODULE_PARM(autodetect, "1-" __MODULE_STRING(1) "i"); +static int num_params; +module_param_array(io, int, &num_params, 0); +module_param_array(irq, int, &num_params, 0); +module_param_array(mem, int, &num_params, 0); +module_param(autodetect, int, 0); MODULE_PARM_DESC(io, "EtherExpress Pro/10 I/O base addres(es)"); MODULE_PARM_DESC(irq, "EtherExpress Pro/10 IRQ number(s)"); MODULE_PARM_DESC(mem, "EtherExpress Pro/10 Rx buffer size(es) in kB (3-29)"); @@ -1734,19 +1810,21 @@ { struct net_device *dev; int i; - if (io[0] == 0 && autodetect == 0) { + if (io[0] == -1 && autodetect == 0) { printk(KERN_WARNING "eepro_init_module: Probe is very dangerous in ISA boards!\n"); printk(KERN_WARNING "eepro_init_module: Please add \"autodetect=1\" to force probe\n"); - return 1; + return -ENODEV; } else if (autodetect) { /* if autodetect is set then we must force detection */ - io[0] = 0; + for (i = 0; i < MAX_EEPRO; i++) { + io[i] = 0; + } printk(KERN_INFO "eepro_init_module: Auto-detecting boards (May God protect us...)\n"); } - for (i = 0; i < MAX_EEPRO; i++) { + for (i = 0; io[i] != -1 && i < MAX_EEPRO; i++) { dev = alloc_etherdev(sizeof(struct eepro_local)); if (!dev) break; diff -Nru a/drivers/net/ibm_emac/ibm_emac.h b/drivers/net/ibm_emac/ibm_emac.h --- a/drivers/net/ibm_emac/ibm_emac.h 2005-01-12 01:33:23 -05:00 +++ b/drivers/net/ibm_emac/ibm_emac.h 2005-01-12 01:33:23 -05:00 @@ -98,7 +98,7 @@ #endif /* CONFIG_IBM_EMAC4 */ #define EMAC_M1_BASE (EMAC_M1_TX_FIFO_2K | \ EMAC_M1_APP | \ - EMAC_M1_TR) + EMAC_M1_TR | EMAC_M1_VLE) /* Transmit Mode Register 0 */ #define EMAC_TMR0_GNP0 0x80000000 diff -Nru a/drivers/net/ibm_emac/ibm_emac_core.c b/drivers/net/ibm_emac/ibm_emac_core.c --- a/drivers/net/ibm_emac/ibm_emac_core.c 2005-01-12 01:33:23 -05:00 +++ b/drivers/net/ibm_emac/ibm_emac_core.c 2005-01-12 01:33:23 -05:00 @@ -1363,6 +1363,9 @@ /* set frame gap */ out_be32(&emacp->em0ipgvr, CONFIG_IBM_EMAC_FGAP); + + /* set VLAN Tag Protocol Identifier */ + out_be32(&emacp->em0vtpid, 0x8100); /* Init ring buffers */ emac_init_rings(fep->ndev); @@ -1700,6 +1703,15 @@ .rxde = &emac_rxde_dev, }; +#ifdef CONFIG_NET_POLL_CONTROLLER +static int emac_netpoll(struct net_device *ndev) +{ + emac_rxeob_dev((void *)ndev, 0); + emac_txeob_dev((void *)ndev, 0); + return 0; +} +#endif + static int emac_init_device(struct ocp_device *ocpdev, struct ibm_ocp_mal *mal) { int deferred_init = 0; @@ -1882,6 +1894,9 @@ SET_ETHTOOL_OPS(ndev, &emac_ethtool_ops); if (emacdata->tah_idx >= 0) ndev->features = NETIF_F_IP_CSUM | NETIF_F_SG; +#ifdef CONFIG_NET_POLL_CONTROLLER + ndev->poll_controller = emac_netpoll; +#endif SET_MODULE_OWNER(ndev); diff -Nru a/drivers/net/ibm_emac/ibm_emac_phy.c b/drivers/net/ibm_emac/ibm_emac_phy.c --- a/drivers/net/ibm_emac/ibm_emac_phy.c 2005-01-12 01:33:23 -05:00 +++ b/drivers/net/ibm_emac/ibm_emac_phy.c 2005-01-12 01:33:23 -05:00 @@ -191,17 +191,18 @@ u16 lpa; if (phy->autoneg) { - lpa = phy_read(phy, MII_LPA); + lpa = phy_read(phy, MII_LPA) & phy_read(phy, MII_ADVERTISE); - if (lpa & (LPA_10FULL | LPA_100FULL)) - phy->duplex = DUPLEX_FULL; - else - phy->duplex = DUPLEX_HALF; - if (lpa & (LPA_100FULL | LPA_100HALF)) - phy->speed = SPEED_100; - else - phy->speed = SPEED_10; + phy->speed = SPEED_10; + phy->duplex = DUPLEX_HALF; phy->pause = 0; + + if (lpa & (LPA_100FULL | LPA_100HALF)) { + phy->speed = SPEED_100; + if (lpa & LPA_100FULL) + phy->duplex = DUPLEX_FULL; + } else if (lpa & LPA_10FULL) + phy->duplex = DUPLEX_FULL; } /* On non-aneg, we assume what we put in BMCR is the speed, * though magic-aneg shouldn't prevent this case from occurring diff -Nru a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h --- a/drivers/net/ixgb/ixgb.h 2005-01-12 01:33:23 -05:00 +++ b/drivers/net/ixgb/ixgb.h 2005-01-12 01:33:23 -05:00 @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -85,6 +86,20 @@ #define IXGB_ERR(args...) printk(KERN_ERR "ixgb: " args) +/* TX/RX descriptor defines */ +#define DEFAULT_TXD 256 +#define MAX_TXD 4096 +#define MIN_TXD 64 + +/* hardware cannot reliably support more than 512 descriptors owned by + * hardware descrioptor cache otherwise an unreliable ring under heavy + * recieve load may result */ +/* #define DEFAULT_RXD 1024 */ +/* #define MAX_RXD 4096 */ +#define DEFAULT_RXD 512 +#define MAX_RXD 512 +#define MIN_RXD 64 + /* Supported Rx Buffer Sizes */ #define IXGB_RXBUFFER_2048 2048 #define IXGB_RXBUFFER_4096 4096 @@ -105,9 +120,9 @@ struct ixgb_buffer { struct sk_buff *skb; uint64_t dma; - unsigned long length; unsigned long time_stamp; - unsigned int next_to_watch; + uint16_t length; + uint16_t next_to_watch; }; struct ixgb_desc_ring { @@ -167,7 +182,6 @@ uint64_t hw_csum_rx_error; uint64_t hw_csum_rx_good; uint32_t rx_int_delay; - boolean_t raidc; boolean_t rx_csum; /* OS defined structs */ @@ -178,5 +192,8 @@ /* structs defined in ixgb_hw.h */ struct ixgb_hw hw; struct ixgb_hw_stats stats; +#ifdef CONFIG_PCI_MSI + boolean_t have_msi; +#endif }; -#endif /* _IXGB_H_ */ +#endif /* _IXGB_H_ */ diff -Nru a/drivers/net/ixgb/ixgb_ee.c b/drivers/net/ixgb/ixgb_ee.c --- a/drivers/net/ixgb/ixgb_ee.c 2005-01-12 01:33:23 -05:00 +++ b/drivers/net/ixgb/ixgb_ee.c 2005-01-12 01:33:23 -05:00 @@ -32,7 +32,8 @@ static uint16_t ixgb_shift_in_bits(struct ixgb_hw *hw); static void ixgb_shift_out_bits(struct ixgb_hw *hw, - uint16_t data, uint16_t count); + uint16_t data, + uint16_t count); static void ixgb_standby_eeprom(struct ixgb_hw *hw); static boolean_t ixgb_wait_eeprom_command(struct ixgb_hw *hw); @@ -45,7 +46,9 @@ * hw - Struct containing variables accessed by shared code * eecd_reg - EECD's current value *****************************************************************************/ -static void ixgb_raise_clock(struct ixgb_hw *hw, uint32_t * eecd_reg) +static void +ixgb_raise_clock(struct ixgb_hw *hw, + uint32_t *eecd_reg) { /* Raise the clock input to the EEPROM (by setting the SK bit), and then * wait 50 microseconds. @@ -62,7 +65,9 @@ * hw - Struct containing variables accessed by shared code * eecd_reg - EECD's current value *****************************************************************************/ -static void ixgb_lower_clock(struct ixgb_hw *hw, uint32_t * eecd_reg) +static void +ixgb_lower_clock(struct ixgb_hw *hw, + uint32_t *eecd_reg) { /* Lower the clock input to the EEPROM (by clearing the SK bit), and then * wait 50 microseconds. @@ -81,7 +86,9 @@ * count - number of bits to shift out *****************************************************************************/ static void -ixgb_shift_out_bits(struct ixgb_hw *hw, uint16_t data, uint16_t count) +ixgb_shift_out_bits(struct ixgb_hw *hw, + uint16_t data, + uint16_t count) { uint32_t eecd_reg; uint32_t mask; @@ -101,7 +108,7 @@ */ eecd_reg &= ~IXGB_EECD_DI; - if (data & mask) + if(data & mask) eecd_reg |= IXGB_EECD_DI; IXGB_WRITE_REG(hw, EECD, eecd_reg); @@ -113,7 +120,7 @@ mask = mask >> 1; - } while (mask); + } while(mask); /* We leave the "DI" bit set to "0" when we leave this routine. */ eecd_reg &= ~IXGB_EECD_DI; @@ -126,7 +133,8 @@ * * hw - Struct containing variables accessed by shared code *****************************************************************************/ -static uint16_t ixgb_shift_in_bits(struct ixgb_hw *hw) +static uint16_t +ixgb_shift_in_bits(struct ixgb_hw *hw) { uint32_t eecd_reg; uint32_t i; @@ -144,14 +152,14 @@ eecd_reg &= ~(IXGB_EECD_DO | IXGB_EECD_DI); data = 0; - for (i = 0; i < 16; i++) { + for(i = 0; i < 16; i++) { data = data << 1; ixgb_raise_clock(hw, &eecd_reg); eecd_reg = IXGB_READ_REG(hw, EECD); eecd_reg &= ~(IXGB_EECD_DI); - if (eecd_reg & IXGB_EECD_DO) + if(eecd_reg & IXGB_EECD_DO) data |= 1; ixgb_lower_clock(hw, &eecd_reg); @@ -168,7 +176,8 @@ * Lowers EEPROM clock. Clears input pin. Sets the chip select pin. This * function should be called before issuing a command to the EEPROM. *****************************************************************************/ -static void ixgb_setup_eeprom(struct ixgb_hw *hw) +static void +ixgb_setup_eeprom(struct ixgb_hw *hw) { uint32_t eecd_reg; @@ -189,7 +198,8 @@ * * hw - Struct containing variables accessed by shared code *****************************************************************************/ -static void ixgb_standby_eeprom(struct ixgb_hw *hw) +static void +ixgb_standby_eeprom(struct ixgb_hw *hw) { uint32_t eecd_reg; @@ -222,7 +232,8 @@ * * hw - Struct containing variables accessed by shared code *****************************************************************************/ -static void ixgb_clock_eeprom(struct ixgb_hw *hw) +static void +ixgb_clock_eeprom(struct ixgb_hw *hw) { uint32_t eecd_reg; @@ -245,7 +256,8 @@ * * hw - Struct containing variables accessed by shared code *****************************************************************************/ -static void ixgb_cleanup_eeprom(struct ixgb_hw *hw) +static void +ixgb_cleanup_eeprom(struct ixgb_hw *hw) { uint32_t eecd_reg; @@ -270,7 +282,8 @@ * TRUE: EEPROM data pin is high before timeout. * FALSE: Time expired. *****************************************************************************/ -static boolean_t ixgb_wait_eeprom_command(struct ixgb_hw *hw) +static boolean_t +ixgb_wait_eeprom_command(struct ixgb_hw *hw) { uint32_t eecd_reg; uint32_t i; @@ -284,10 +297,10 @@ * signal that the command has been completed by raising the DO signal. * If DO does not go high in 10 milliseconds, then error out. */ - for (i = 0; i < 200; i++) { + for(i = 0; i < 200; i++) { eecd_reg = IXGB_READ_REG(hw, EECD); - if (eecd_reg & IXGB_EECD_DO) + if(eecd_reg & IXGB_EECD_DO) return (TRUE); udelay(50); @@ -309,15 +322,16 @@ * TRUE: Checksum is valid * FALSE: Checksum is not valid. *****************************************************************************/ -boolean_t ixgb_validate_eeprom_checksum(struct ixgb_hw * hw) +boolean_t +ixgb_validate_eeprom_checksum(struct ixgb_hw *hw) { uint16_t checksum = 0; uint16_t i; - for (i = 0; i < (EEPROM_CHECKSUM_REG + 1); i++) + for(i = 0; i < (EEPROM_CHECKSUM_REG + 1); i++) checksum += ixgb_read_eeprom(hw, i); - if (checksum == (uint16_t) EEPROM_SUM) + if(checksum == (uint16_t) EEPROM_SUM) return (TRUE); else return (FALSE); @@ -331,12 +345,13 @@ * Sums the first 63 16 bit words of the EEPROM. Subtracts the sum from 0xBABA. * Writes the difference to word offset 63 of the EEPROM. *****************************************************************************/ -void ixgb_update_eeprom_checksum(struct ixgb_hw *hw) +void +ixgb_update_eeprom_checksum(struct ixgb_hw *hw) { uint16_t checksum = 0; uint16_t i; - for (i = 0; i < EEPROM_CHECKSUM_REG; i++) + for(i = 0; i < EEPROM_CHECKSUM_REG; i++) checksum += ixgb_read_eeprom(hw, i); checksum = (uint16_t) EEPROM_SUM - checksum; @@ -356,7 +371,10 @@ * EEPROM will most likely contain an invalid checksum. * *****************************************************************************/ -void ixgb_write_eeprom(struct ixgb_hw *hw, uint16_t offset, uint16_t data) +void +ixgb_write_eeprom(struct ixgb_hw *hw, + uint16_t offset, + uint16_t data) { /* Prepare the EEPROM for writing */ ixgb_setup_eeprom(hw); @@ -404,7 +422,9 @@ * Returns: * The 16-bit value read from the eeprom *****************************************************************************/ -uint16_t ixgb_read_eeprom(struct ixgb_hw * hw, uint16_t offset) +uint16_t +ixgb_read_eeprom(struct ixgb_hw *hw, + uint16_t offset) { uint16_t data; @@ -437,7 +457,8 @@ * TRUE: if eeprom read is successful * FALSE: otherwise. *****************************************************************************/ -boolean_t ixgb_get_eeprom_data(struct ixgb_hw * hw) +boolean_t +ixgb_get_eeprom_data(struct ixgb_hw *hw) { uint16_t i; uint16_t checksum = 0; @@ -448,7 +469,7 @@ ee_map = (struct ixgb_ee_map_type *)hw->eeprom; DEBUGOUT("ixgb_ee: Reading eeprom data\n"); - for (i = 0; i < IXGB_EEPROM_SIZE; i++) { + for(i = 0; i < IXGB_EEPROM_SIZE ; i++) { uint16_t ee_data; ee_data = ixgb_read_eeprom(hw, i); checksum += ee_data; @@ -461,12 +482,12 @@ } if ((ee_map->init_ctrl_reg_1 & le16_to_cpu(EEPROM_ICW1_SIGNATURE_MASK)) - != le16_to_cpu(EEPROM_ICW1_SIGNATURE_VALID)) { + != le16_to_cpu(EEPROM_ICW1_SIGNATURE_VALID)) { DEBUGOUT("ixgb_ee: Signature invalid.\n"); - return (FALSE); + return(FALSE); } - return (TRUE); + return(TRUE); } /****************************************************************************** @@ -479,7 +500,8 @@ * TRUE: eeprom signature was good and the eeprom read was successful * FALSE: otherwise. ******************************************************************************/ -static boolean_t ixgb_check_and_get_eeprom_data(struct ixgb_hw *hw) +static boolean_t +ixgb_check_and_get_eeprom_data (struct ixgb_hw* hw) { struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; @@ -500,15 +522,16 @@ * Returns: * Word at indexed offset in eeprom, if valid, 0 otherwise. ******************************************************************************/ -uint16_t ixgb_get_eeprom_word(struct ixgb_hw * hw, uint16_t index) +uint16_t +ixgb_get_eeprom_word(struct ixgb_hw *hw, uint16_t index) { if ((index < IXGB_EEPROM_SIZE) && - (ixgb_check_and_get_eeprom_data(hw) == TRUE)) { - return (hw->eeprom[index]); + (ixgb_check_and_get_eeprom_data(hw) == TRUE)) { + return(hw->eeprom[index]); } - return (0); + return(0); } /****************************************************************************** @@ -519,7 +542,9 @@ * * Returns: None. ******************************************************************************/ -void ixgb_get_ee_mac_addr(struct ixgb_hw *hw, uint8_t * mac_addr) +void +ixgb_get_ee_mac_addr(struct ixgb_hw *hw, + uint8_t *mac_addr) { int i; struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; @@ -542,14 +567,15 @@ * Returns: * compatibility flags if EEPROM contents are valid, 0 otherwise ******************************************************************************/ -uint16_t ixgb_get_ee_compatibility(struct ixgb_hw *hw) +uint16_t +ixgb_get_ee_compatibility(struct ixgb_hw *hw) { struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; - if (ixgb_check_and_get_eeprom_data(hw) == TRUE) - return (ee_map->compatibility); + if(ixgb_check_and_get_eeprom_data(hw) == TRUE) + return(ee_map->compatibility); - return (0); + return(0); } /****************************************************************************** @@ -560,13 +586,14 @@ * Returns: * PBA number if EEPROM contents are valid, 0 otherwise ******************************************************************************/ -uint32_t ixgb_get_ee_pba_number(struct ixgb_hw * hw) +uint32_t +ixgb_get_ee_pba_number(struct ixgb_hw *hw) { - if (ixgb_check_and_get_eeprom_data(hw) == TRUE) + if(ixgb_check_and_get_eeprom_data(hw) == TRUE) return (le16_to_cpu(hw->eeprom[EEPROM_PBA_1_2_REG]) - | (le16_to_cpu(hw->eeprom[EEPROM_PBA_3_4_REG]) << 16)); + | (le16_to_cpu(hw->eeprom[EEPROM_PBA_3_4_REG])<<16)); - return (0); + return(0); } /****************************************************************************** @@ -577,14 +604,15 @@ * Returns: * Initialization Control Word 1 if EEPROM contents are valid, 0 otherwise ******************************************************************************/ -uint16_t ixgb_get_ee_init_ctrl_reg_1(struct ixgb_hw * hw) +uint16_t +ixgb_get_ee_init_ctrl_reg_1(struct ixgb_hw *hw) { struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; - if (ixgb_check_and_get_eeprom_data(hw) == TRUE) - return (ee_map->init_ctrl_reg_1); + if(ixgb_check_and_get_eeprom_data(hw) == TRUE) + return(ee_map->init_ctrl_reg_1); - return (0); + return(0); } /****************************************************************************** @@ -595,14 +623,15 @@ * Returns: * Initialization Control Word 2 if EEPROM contents are valid, 0 otherwise ******************************************************************************/ -uint16_t ixgb_get_ee_init_ctrl_reg_2(struct ixgb_hw * hw) +uint16_t +ixgb_get_ee_init_ctrl_reg_2(struct ixgb_hw *hw) { struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; - if (ixgb_check_and_get_eeprom_data(hw) == TRUE) - return (ee_map->init_ctrl_reg_2); + if(ixgb_check_and_get_eeprom_data(hw) == TRUE) + return(ee_map->init_ctrl_reg_2); - return (0); + return(0); } /****************************************************************************** @@ -613,14 +642,15 @@ * Returns: * Subsystem Id if EEPROM contents are valid, 0 otherwise ******************************************************************************/ -uint16_t ixgb_get_ee_subsystem_id(struct ixgb_hw * hw) +uint16_t +ixgb_get_ee_subsystem_id(struct ixgb_hw *hw) { struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; - if (ixgb_check_and_get_eeprom_data(hw) == TRUE) - return (ee_map->subsystem_id); + if(ixgb_check_and_get_eeprom_data(hw) == TRUE) + return(ee_map->subsystem_id); - return (0); + return(0); } /****************************************************************************** @@ -631,14 +661,15 @@ * Returns: * Sub Vendor Id if EEPROM contents are valid, 0 otherwise ******************************************************************************/ -uint16_t ixgb_get_ee_subvendor_id(struct ixgb_hw * hw) +uint16_t +ixgb_get_ee_subvendor_id(struct ixgb_hw *hw) { struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; - if (ixgb_check_and_get_eeprom_data(hw) == TRUE) - return (ee_map->subvendor_id); + if(ixgb_check_and_get_eeprom_data(hw) == TRUE) + return(ee_map->subvendor_id); - return (0); + return(0); } /****************************************************************************** @@ -649,14 +680,15 @@ * Returns: * Device Id if EEPROM contents are valid, 0 otherwise ******************************************************************************/ -uint16_t ixgb_get_ee_device_id(struct ixgb_hw * hw) +uint16_t +ixgb_get_ee_device_id(struct ixgb_hw *hw) { struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; - if (ixgb_check_and_get_eeprom_data(hw) == TRUE) - return (ee_map->device_id); + if(ixgb_check_and_get_eeprom_data(hw) == TRUE) + return(ee_map->device_id); - return (0); + return(0); } /****************************************************************************** @@ -667,14 +699,15 @@ * Returns: * Device Id if EEPROM contents are valid, 0 otherwise ******************************************************************************/ -uint16_t ixgb_get_ee_vendor_id(struct ixgb_hw * hw) +uint16_t +ixgb_get_ee_vendor_id(struct ixgb_hw *hw) { struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; - if (ixgb_check_and_get_eeprom_data(hw) == TRUE) - return (ee_map->vendor_id); + if(ixgb_check_and_get_eeprom_data(hw) == TRUE) + return(ee_map->vendor_id); - return (0); + return(0); } /****************************************************************************** @@ -685,14 +718,15 @@ * Returns: * SDP Register if EEPROM contents are valid, 0 otherwise ******************************************************************************/ -uint16_t ixgb_get_ee_swdpins_reg(struct ixgb_hw * hw) +uint16_t +ixgb_get_ee_swdpins_reg(struct ixgb_hw *hw) { struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; - if (ixgb_check_and_get_eeprom_data(hw) == TRUE) - return (ee_map->swdpins_reg); + if(ixgb_check_and_get_eeprom_data(hw) == TRUE) + return(ee_map->swdpins_reg); - return (0); + return(0); } /****************************************************************************** @@ -703,14 +737,15 @@ * Returns: * D3 Power Management Bits if EEPROM contents are valid, 0 otherwise ******************************************************************************/ -uint8_t ixgb_get_ee_d3_power(struct ixgb_hw * hw) +uint8_t +ixgb_get_ee_d3_power(struct ixgb_hw *hw) { struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; - if (ixgb_check_and_get_eeprom_data(hw) == TRUE) - return (ee_map->d3_power); + if(ixgb_check_and_get_eeprom_data(hw) == TRUE) + return(ee_map->d3_power); - return (0); + return(0); } /****************************************************************************** @@ -721,12 +756,13 @@ * Returns: * D0 Power Management Bits if EEPROM contents are valid, 0 otherwise ******************************************************************************/ -uint8_t ixgb_get_ee_d0_power(struct ixgb_hw * hw) +uint8_t +ixgb_get_ee_d0_power(struct ixgb_hw *hw) { struct ixgb_ee_map_type *ee_map = (struct ixgb_ee_map_type *)hw->eeprom; - if (ixgb_check_and_get_eeprom_data(hw) == TRUE) - return (ee_map->d0_power); + if(ixgb_check_and_get_eeprom_data(hw) == TRUE) + return(ee_map->d0_power); - return (0); + return(0); } diff -Nru a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c --- a/drivers/net/ixgb/ixgb_ethtool.c 2005-01-12 01:33:23 -05:00 +++ b/drivers/net/ixgb/ixgb_ethtool.c 2005-01-12 01:33:23 -05:00 @@ -37,6 +37,12 @@ extern int ixgb_up(struct ixgb_adapter *adapter); extern void ixgb_down(struct ixgb_adapter *adapter, boolean_t kill_watchdog); +extern void ixgb_reset(struct ixgb_adapter *adapter); +extern int ixgb_setup_rx_resources(struct ixgb_adapter *adapter); +extern int ixgb_setup_tx_resources(struct ixgb_adapter *adapter); +extern void ixgb_free_rx_resources(struct ixgb_adapter *adapter); +extern void ixgb_free_tx_resources(struct ixgb_adapter *adapter); +extern void ixgb_update_stats(struct ixgb_adapter *adapter); struct ixgb_stats { char stat_string[ETH_GSTRING_LEN]; @@ -89,7 +95,7 @@ sizeof(ixgb_gstrings_stats) / sizeof(struct ixgb_stats) static int -ixgb_ethtool_gset(struct net_device *netdev, struct ethtool_cmd *ecmd) +ixgb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) { struct ixgb_adapter *adapter = netdev->priv; ecmd->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE); @@ -97,7 +103,7 @@ ecmd->port = PORT_FIBRE; ecmd->transceiver = XCVR_EXTERNAL; - if (netif_carrier_ok(adapter->netdev)) { + if(netif_carrier_ok(adapter->netdev)) { ecmd->speed = SPEED_10000; ecmd->duplex = DUPLEX_FULL; } else { @@ -110,86 +116,140 @@ } static int -ixgb_ethtool_sset(struct net_device *netdev, struct ethtool_cmd *ecmd) +ixgb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) { struct ixgb_adapter *adapter = netdev->priv; - if (ecmd->autoneg == AUTONEG_ENABLE || - ecmd->speed + ecmd->duplex != SPEED_10000 + DUPLEX_FULL) + if(ecmd->autoneg == AUTONEG_ENABLE || + ecmd->speed + ecmd->duplex != SPEED_10000 + DUPLEX_FULL) return -EINVAL; - else { + + if(netif_running(adapter->netdev)) { ixgb_down(adapter, TRUE); + ixgb_reset(adapter); ixgb_up(adapter); - } + } else + ixgb_reset(adapter); + return 0; } static void -ixgb_ethtool_gpause(struct net_device *dev, - struct ethtool_pauseparam *epause) +ixgb_get_pauseparam(struct net_device *netdev, + struct ethtool_pauseparam *pause) { - struct ixgb_adapter *adapter = dev->priv; + struct ixgb_adapter *adapter = netdev->priv; struct ixgb_hw *hw = &adapter->hw; - - epause->autoneg = AUTONEG_DISABLE; - - if (hw->fc.type == ixgb_fc_rx_pause) - epause->rx_pause = 1; - else if (hw->fc.type == ixgb_fc_tx_pause) - epause->tx_pause = 1; - else if (hw->fc.type == ixgb_fc_full) { - epause->rx_pause = 1; - epause->tx_pause = 1; + + pause->autoneg = AUTONEG_DISABLE; + + if(hw->fc.type == ixgb_fc_rx_pause) + pause->rx_pause = 1; + else if(hw->fc.type == ixgb_fc_tx_pause) + pause->tx_pause = 1; + else if(hw->fc.type == ixgb_fc_full) { + pause->rx_pause = 1; + pause->tx_pause = 1; } } static int -ixgb_ethtool_spause(struct net_device *dev, - struct ethtool_pauseparam *epause) +ixgb_set_pauseparam(struct net_device *netdev, + struct ethtool_pauseparam *pause) { - struct ixgb_adapter *adapter = dev->priv; + struct ixgb_adapter *adapter = netdev->priv; struct ixgb_hw *hw = &adapter->hw; - - if (epause->autoneg == AUTONEG_ENABLE) + + if(pause->autoneg == AUTONEG_ENABLE) return -EINVAL; - if (epause->rx_pause && epause->tx_pause) + if(pause->rx_pause && pause->tx_pause) hw->fc.type = ixgb_fc_full; - else if (epause->rx_pause && !epause->tx_pause) + else if(pause->rx_pause && !pause->tx_pause) hw->fc.type = ixgb_fc_rx_pause; - else if (!epause->rx_pause && epause->tx_pause) + else if(!pause->rx_pause && pause->tx_pause) hw->fc.type = ixgb_fc_tx_pause; - else if (!epause->rx_pause && !epause->tx_pause) + else if(!pause->rx_pause && !pause->tx_pause) hw->fc.type = ixgb_fc_none; - ixgb_down(adapter, TRUE); - ixgb_up(adapter); - + if(netif_running(adapter->netdev)) { + ixgb_down(adapter, TRUE); + ixgb_up(adapter); + } else + ixgb_reset(adapter); + return 0; } -static void -ixgb_ethtool_gdrvinfo(struct net_device *netdev, - struct ethtool_drvinfo *drvinfo) +static uint32_t +ixgb_get_rx_csum(struct net_device *netdev) { struct ixgb_adapter *adapter = netdev->priv; - strncpy(drvinfo->driver, ixgb_driver_name, 32); - strncpy(drvinfo->version, ixgb_driver_version, 32); - strncpy(drvinfo->fw_version, "N/A", 32); - strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32); + return adapter->rx_csum; } +static int +ixgb_set_rx_csum(struct net_device *netdev, uint32_t data) +{ + struct ixgb_adapter *adapter = netdev->priv; + adapter->rx_csum = data; + + if(netif_running(netdev)) { + ixgb_down(adapter,TRUE); + ixgb_up(adapter); + } else + ixgb_reset(adapter); + return 0; +} + +static uint32_t +ixgb_get_tx_csum(struct net_device *netdev) +{ + return (netdev->features & NETIF_F_HW_CSUM) != 0; +} + +static int +ixgb_set_tx_csum(struct net_device *netdev, uint32_t data) +{ + if (data) + netdev->features |= NETIF_F_HW_CSUM; + else + netdev->features &= ~NETIF_F_HW_CSUM; + + return 0; +} + +#ifdef NETIF_F_TSO +static int +ixgb_set_tso(struct net_device *netdev, uint32_t data) +{ + if(data) + netdev->features |= NETIF_F_TSO; + else + netdev->features &= ~NETIF_F_TSO; + return 0; +} +#endif /* NETIF_F_TSO */ + #define IXGB_GET_STAT(_A_, _R_) _A_->stats._R_ + +static int +ixgb_get_regs_len(struct net_device *netdev) +{ +#define IXGB_REG_DUMP_LEN 136*sizeof(uint32_t) + return IXGB_REG_DUMP_LEN; +} + static void -ixgb_ethtool_gregs(struct net_device *dev, struct ethtool_regs *regs, void *buf) +ixgb_get_regs(struct net_device *netdev, + struct ethtool_regs *regs, void *p) { - struct ixgb_adapter *adapter = dev->priv; + struct ixgb_adapter *adapter = netdev->priv; struct ixgb_hw *hw = &adapter->hw; - uint32_t *reg = buf; + uint32_t *reg = p; uint32_t *reg_start = reg; uint8_t i; - regs->version = - (adapter->hw.device_id << 16) | adapter->hw.subsystem_id; + regs->version = (adapter->hw.device_id << 16) | adapter->hw.subsystem_id; /* General Registers */ *reg++ = IXGB_READ_REG(hw, CTRL0); /* 0 */ @@ -219,8 +279,8 @@ *reg++ = IXGB_READ_REG(hw, RXCSUM); /* 20 */ for (i = 0; i < IXGB_RAR_ENTRIES; i++) { - *reg++ = IXGB_READ_REG_ARRAY(hw, RAL, (i << 1)); /*21,...,51 */ - *reg++ = IXGB_READ_REG_ARRAY(hw, RAH, (i << 1)); /*22,...,52 */ + *reg++ = IXGB_READ_REG_ARRAY(hw, RAL, (i << 1)); /*21,...,51 */ + *reg++ = IXGB_READ_REG_ARRAY(hw, RAH, (i << 1)); /*22,...,52 */ } /* Transmit */ @@ -316,73 +376,222 @@ } static int -ixgb_ethtool_geeprom(struct net_device *dev, - struct ethtool_eeprom *eeprom, u8 *data) +ixgb_get_eeprom_len(struct net_device *netdev) { - struct ixgb_adapter *adapter = dev->priv; + /* return size in bytes */ + return (IXGB_EEPROM_SIZE << 1); +} + +static int +ixgb_get_eeprom(struct net_device *netdev, + struct ethtool_eeprom *eeprom, uint8_t *bytes) +{ + struct ixgb_adapter *adapter = netdev->priv; struct ixgb_hw *hw = &adapter->hw; + uint16_t *eeprom_buff; + int i, max_len, first_word, last_word; + int ret_val = 0; + + if(eeprom->len == 0) { + ret_val = -EINVAL; + goto geeprom_error; + } eeprom->magic = hw->vendor_id | (hw->device_id << 16); - /* use our function to read the eeprom and update our cache */ - ixgb_get_eeprom_data(hw); - memcpy(data, (char *)hw->eeprom + eeprom->offset, eeprom->len); - return 0; + max_len = ixgb_get_eeprom_len(netdev); + + if(eeprom->offset > eeprom->offset + eeprom->len) { + ret_val = -EINVAL; + goto geeprom_error; + } + + if((eeprom->offset + eeprom->len) > max_len) + eeprom->len = (max_len - eeprom->offset); + + first_word = eeprom->offset >> 1; + last_word = (eeprom->offset + eeprom->len - 1) >> 1; + + eeprom_buff = kmalloc(sizeof(uint16_t) * + (last_word - first_word + 1), GFP_KERNEL); + if(!eeprom_buff) + return -ENOMEM; + + /* note the eeprom was good because the driver loaded */ + for(i = 0; i <= (last_word - first_word); i++) { + eeprom_buff[i] = ixgb_get_eeprom_word(hw, (first_word + i)); + } + + memcpy(bytes, (uint8_t *)eeprom_buff + (eeprom->offset & 1), + eeprom->len); + kfree(eeprom_buff); + +geeprom_error: + return ret_val; } static int -ixgb_ethtool_seeprom(struct net_device *dev, - struct ethtool_eeprom *eeprom, u8 *data) +ixgb_set_eeprom(struct net_device *netdev, + struct ethtool_eeprom *eeprom, uint8_t *bytes) { - struct ixgb_adapter *adapter = dev->priv; + struct ixgb_adapter *adapter = netdev->priv; struct ixgb_hw *hw = &adapter->hw; - /* We are under rtnl, so static is OK */ - static uint16_t eeprom_buff[IXGB_EEPROM_SIZE]; - int i, first_word, last_word; - char *ptr; + uint16_t *eeprom_buff; + void *ptr; + int max_len, first_word, last_word; + uint16_t i; + + if(eeprom->len == 0) + return -EINVAL; - if (eeprom->magic != (hw->vendor_id | (hw->device_id << 16))) + if(eeprom->magic != (hw->vendor_id | (hw->device_id << 16))) return -EFAULT; + max_len = ixgb_get_eeprom_len(netdev); + + if(eeprom->offset > eeprom->offset + eeprom->len) + return -EINVAL; + + if((eeprom->offset + eeprom->len) > max_len) + eeprom->len = (max_len - eeprom->offset); + first_word = eeprom->offset >> 1; last_word = (eeprom->offset + eeprom->len - 1) >> 1; - ptr = (char *)eeprom_buff; + eeprom_buff = kmalloc(max_len, GFP_KERNEL); + if(!eeprom_buff) + return -ENOMEM; + + ptr = (void *)eeprom_buff; - if (eeprom->offset & 1) { + if(eeprom->offset & 1) { /* need read/modify/write of first changed EEPROM word */ /* only the second byte of the word is being modified */ eeprom_buff[0] = ixgb_read_eeprom(hw, first_word); ptr++; } - if ((eeprom->offset + eeprom->len) & 1) { + if((eeprom->offset + eeprom->len) & 1) { /* need read/modify/write of last changed EEPROM word */ /* only the first byte of the word is being modified */ - eeprom_buff[last_word - first_word] - = ixgb_read_eeprom(hw, last_word); + eeprom_buff[last_word - first_word] + = ixgb_read_eeprom(hw, last_word); } - memcpy(ptr, data, eeprom->len); - for (i = 0; i <= (last_word - first_word); i++) + memcpy(ptr, bytes, eeprom->len); + for(i = 0; i <= (last_word - first_word); i++) ixgb_write_eeprom(hw, first_word + i, eeprom_buff[i]); /* Update the checksum over the first part of the EEPROM if needed */ - if (first_word <= EEPROM_CHECKSUM_REG) + if(first_word <= EEPROM_CHECKSUM_REG) ixgb_update_eeprom_checksum(hw); + kfree(eeprom_buff); return 0; } +static void +ixgb_get_drvinfo(struct net_device *netdev, + struct ethtool_drvinfo *drvinfo) +{ + struct ixgb_adapter *adapter = netdev->priv; + + strncpy(drvinfo->driver, ixgb_driver_name, 32); + strncpy(drvinfo->version, ixgb_driver_version, 32); + strncpy(drvinfo->fw_version, "N/A", 32); + strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32); + drvinfo->n_stats = IXGB_STATS_LEN; + drvinfo->regdump_len = ixgb_get_regs_len(netdev); + drvinfo->eedump_len = ixgb_get_eeprom_len(netdev); +} + +static void +ixgb_get_ringparam(struct net_device *netdev, + struct ethtool_ringparam *ring) +{ + struct ixgb_adapter *adapter = netdev->priv; + struct ixgb_desc_ring *txdr = &adapter->tx_ring; + struct ixgb_desc_ring *rxdr = &adapter->rx_ring; + + ring->rx_max_pending = MAX_RXD; + ring->tx_max_pending = MAX_TXD; + ring->rx_mini_max_pending = 0; + ring->rx_jumbo_max_pending = 0; + ring->rx_pending = rxdr->count; + ring->tx_pending = txdr->count; + ring->rx_mini_pending = 0; + ring->rx_jumbo_pending = 0; +} + +static int +ixgb_set_ringparam(struct net_device *netdev, + struct ethtool_ringparam *ring) +{ + struct ixgb_adapter *adapter = netdev->priv; + struct ixgb_desc_ring *txdr = &adapter->tx_ring; + struct ixgb_desc_ring *rxdr = &adapter->rx_ring; + struct ixgb_desc_ring tx_old, tx_new, rx_old, rx_new; + int err; + + tx_old = adapter->tx_ring; + rx_old = adapter->rx_ring; + + if((ring->rx_mini_pending) || (ring->rx_jumbo_pending)) + return -EINVAL; + + if(netif_running(adapter->netdev)) + ixgb_down(adapter,TRUE); + + rxdr->count = max(ring->rx_pending,(uint32_t)MIN_RXD); + rxdr->count = min(rxdr->count,(uint32_t)MAX_RXD); + IXGB_ROUNDUP(rxdr->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE); + + txdr->count = max(ring->tx_pending,(uint32_t)MIN_TXD); + txdr->count = min(txdr->count,(uint32_t)MAX_TXD); + IXGB_ROUNDUP(txdr->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE); + + if(netif_running(adapter->netdev)) { + /* Try to get new resources before deleting old */ + if((err = ixgb_setup_rx_resources(adapter))) + goto err_setup_rx; + if((err = ixgb_setup_tx_resources(adapter))) + goto err_setup_tx; + + /* save the new, restore the old in order to free it, + * then restore the new back again */ + + rx_new = adapter->rx_ring; + tx_new = adapter->tx_ring; + adapter->rx_ring = rx_old; + adapter->tx_ring = tx_old; + ixgb_free_rx_resources(adapter); + ixgb_free_tx_resources(adapter); + adapter->rx_ring = rx_new; + adapter->tx_ring = tx_new; + if((err = ixgb_up(adapter))) + return err; + } + + return 0; +err_setup_tx: + ixgb_free_rx_resources(adapter); +err_setup_rx: + adapter->rx_ring = rx_old; + adapter->tx_ring = tx_old; + ixgb_up(adapter); + return err; +} + /* toggle LED 4 times per second = 2 "blinks" per second */ #define IXGB_ID_INTERVAL (HZ/4) /* bit defines for adapter->led_status */ #define IXGB_LED_ON 0 -static void ixgb_led_blink_callback(unsigned long data) +static void +ixgb_led_blink_callback(unsigned long data) { struct ixgb_adapter *adapter = (struct ixgb_adapter *)data; - if (test_and_change_bit(IXGB_LED_ON, &adapter->led_status)) + if(test_and_change_bit(IXGB_LED_ON, &adapter->led_status)) ixgb_led_off(&adapter->hw); else ixgb_led_on(&adapter->hw); @@ -391,10 +600,14 @@ } static int -ixgb_ethtool_led_blink(struct net_device *netdev, u32 data) +ixgb_phys_id(struct net_device *netdev, uint32_t data) { struct ixgb_adapter *adapter = netdev->priv; - if (!adapter->blink_timer.function) { + + if(!data || data > (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ)) + data = (uint32_t)(MAX_SCHEDULE_TIMEOUT / HZ); + + if(!adapter->blink_timer.function) { init_timer(&adapter->blink_timer); adapter->blink_timer.function = ixgb_led_blink_callback; adapter->blink_timer.data = (unsigned long)adapter; @@ -403,7 +616,7 @@ mod_timer(&adapter->blink_timer, jiffies); set_current_state(TASK_INTERRUPTIBLE); - if (data) + if(data) schedule_timeout(data * HZ); else schedule_timeout(MAX_SCHEDULE_TIMEOUT); @@ -415,141 +628,74 @@ return 0; } -static int ixgb_nway_reset(struct net_device *netdev) -{ - if (netif_running(netdev)) { - struct ixgb_adapter *adapter = netdev->priv; - ixgb_down(adapter, TRUE); - ixgb_up(adapter); - } - return 0; -} - -static int ixgb_get_stats_count(struct net_device *dev) +static int +ixgb_get_stats_count(struct net_device *netdev) { return IXGB_STATS_LEN; } -static void ixgb_get_strings(struct net_device *dev, u32 stringset, u8 *data) +static void +ixgb_get_ethtool_stats(struct net_device *netdev, + struct ethtool_stats *stats, uint64_t *data) { + struct ixgb_adapter *adapter = netdev->priv; int i; - for (i = 0; i < IXGB_STATS_LEN; i++) { - memcpy(data + i * ETH_GSTRING_LEN, - ixgb_gstrings_stats[i].stat_string, - ETH_GSTRING_LEN); - } -} - -static int ixgb_get_regs_len(struct net_device *dev) -{ - return 136*sizeof(uint32_t); -} -static int ixgb_get_eeprom_len(struct net_device *dev) -{ - /* return size in bytes */ - return (IXGB_EEPROM_SIZE << 1); + ixgb_update_stats(adapter); + for(i = 0; i < IXGB_STATS_LEN; i++) { + char *p = (char *)adapter+ixgb_gstrings_stats[i].stat_offset; + data[i] = (ixgb_gstrings_stats[i].sizeof_stat == + sizeof(uint64_t)) ? *(uint64_t *)p : *(uint32_t *)p; + } } -static void get_ethtool_stats(struct net_device *dev, - struct ethtool_stats *stats, u64 *data) +static void +ixgb_get_strings(struct net_device *netdev, uint32_t stringset, uint8_t *data) { - struct ixgb_adapter *adapter = dev->priv; int i; - for (i = 0; i < IXGB_STATS_LEN; i++) { - void *p = (char *)adapter + ixgb_gstrings_stats[i].stat_offset; - stats->data[i] = - (ixgb_gstrings_stats[i].sizeof_stat == sizeof(uint64_t)) - ? *(uint64_t *) p - : *(uint32_t *) p; + switch(stringset) { + case ETH_SS_STATS: + for(i=0; i < IXGB_STATS_LEN; i++) { + memcpy(data + i * ETH_GSTRING_LEN, + ixgb_gstrings_stats[i].stat_string, + ETH_GSTRING_LEN); + } + break; } } -static u32 ixgb_get_rx_csum(struct net_device *dev) -{ - struct ixgb_adapter *adapter = dev->priv; - return adapter->rx_csum; -} - -static int ixgb_set_rx_csum(struct net_device *dev, u32 sum) -{ - struct ixgb_adapter *adapter = dev->priv; - adapter->rx_csum = sum; - ixgb_down(adapter, TRUE); - ixgb_up(adapter); - return 0; -} - -static u32 ixgb_get_tx_csum(struct net_device *dev) -{ - return (dev->features & NETIF_F_HW_CSUM) != 0; -} - -static int ixgb_set_tx_csum(struct net_device *dev, u32 sum) -{ - if (sum) - dev->features |= NETIF_F_HW_CSUM; - else - dev->features &= ~NETIF_F_HW_CSUM; - return 0; -} - -static u32 ixgb_get_sg(struct net_device *dev) -{ - return (dev->features & NETIF_F_SG) != 0; -} - -static int ixgb_set_sg(struct net_device *dev, u32 sum) -{ - if (sum) - dev->features |= NETIF_F_SG; - else - dev->features &= ~NETIF_F_SG; - return 0; -} - -#ifdef NETIF_F_TSO -static u32 ixgb_get_tso(struct net_device *dev) -{ - return (dev->features & NETIF_F_TSO) != 0; -} - -static int ixgb_set_tso(struct net_device *dev, u32 sum) -{ - if (sum) - dev->features |= NETIF_F_TSO; - else - dev->features &= ~NETIF_F_TSO; - return 0; -} -#endif - struct ethtool_ops ixgb_ethtool_ops = { - .get_settings = ixgb_ethtool_gset, - .set_settings = ixgb_ethtool_sset, - .get_drvinfo = ixgb_ethtool_gdrvinfo, - .nway_reset = ixgb_nway_reset, - .get_link = ethtool_op_get_link, - .phys_id = ixgb_ethtool_led_blink, - .get_strings = ixgb_get_strings, - .get_stats_count = ixgb_get_stats_count, - .get_regs = ixgb_ethtool_gregs, + .get_settings = ixgb_get_settings, + .set_settings = ixgb_set_settings, + .get_drvinfo = ixgb_get_drvinfo, .get_regs_len = ixgb_get_regs_len, + .get_regs = ixgb_get_regs, + .get_link = ethtool_op_get_link, .get_eeprom_len = ixgb_get_eeprom_len, - .get_eeprom = ixgb_ethtool_geeprom, - .set_eeprom = ixgb_ethtool_seeprom, - .get_pauseparam = ixgb_ethtool_gpause, - .set_pauseparam = ixgb_ethtool_spause, - .get_ethtool_stats = get_ethtool_stats, + .get_eeprom = ixgb_get_eeprom, + .set_eeprom = ixgb_set_eeprom, + .get_ringparam = ixgb_get_ringparam, + .set_ringparam = ixgb_set_ringparam, + .get_pauseparam = ixgb_get_pauseparam, + .set_pauseparam = ixgb_set_pauseparam, .get_rx_csum = ixgb_get_rx_csum, .set_rx_csum = ixgb_set_rx_csum, .get_tx_csum = ixgb_get_tx_csum, .set_tx_csum = ixgb_set_tx_csum, - .get_sg = ixgb_get_sg, - .set_sg = ixgb_set_sg, + .get_sg = ethtool_op_get_sg, + .set_sg = ethtool_op_set_sg, #ifdef NETIF_F_TSO - .get_tso = ixgb_get_tso, + .get_tso = ethtool_op_get_tso, .set_tso = ixgb_set_tso, #endif + .get_strings = ixgb_get_strings, + .phys_id = ixgb_phys_id, + .get_stats_count = ixgb_get_stats_count, + .get_ethtool_stats = ixgb_get_ethtool_stats, }; + +void ixgb_set_ethtool_ops(struct net_device *netdev) +{ + SET_ETHTOOL_OPS(netdev, &ixgb_ethtool_ops); +} diff -Nru a/drivers/net/ixgb/ixgb_hw.c b/drivers/net/ixgb/ixgb_hw.c --- a/drivers/net/ixgb/ixgb_hw.c 2005-01-12 01:33:23 -05:00 +++ b/drivers/net/ixgb/ixgb_hw.c 2005-01-12 01:33:23 -05:00 @@ -53,9 +53,14 @@ { uint32_t ctrl_reg; - ctrl_reg = IXGB_CTRL0_RST | IXGB_CTRL0_SDP3_DIR | /* All pins are Output=1 */ - IXGB_CTRL0_SDP2_DIR | IXGB_CTRL0_SDP1_DIR | IXGB_CTRL0_SDP0_DIR | IXGB_CTRL0_SDP3 | /* Initial value 1101 */ - IXGB_CTRL0_SDP2 | IXGB_CTRL0_SDP0; + ctrl_reg = IXGB_CTRL0_RST | + IXGB_CTRL0_SDP3_DIR | /* All pins are Output=1 */ + IXGB_CTRL0_SDP2_DIR | + IXGB_CTRL0_SDP1_DIR | + IXGB_CTRL0_SDP0_DIR | + IXGB_CTRL0_SDP3 | /* Initial value 1101 */ + IXGB_CTRL0_SDP2 | + IXGB_CTRL0_SDP0; #ifdef HP_ZX1 /* Workaround for 82597EX reset errata */ @@ -84,7 +89,8 @@ * * hw - Struct containing variables accessed by shared code *****************************************************************************/ -boolean_t ixgb_adapter_stop(struct ixgb_hw * hw) +boolean_t +ixgb_adapter_stop(struct ixgb_hw *hw) { uint32_t ctrl_reg; uint32_t icr_reg; @@ -94,7 +100,7 @@ /* If we are stopped or resetting exit gracefully and wait to be * started again before accessing the hardware. */ - if (hw->adapter_stopped) { + if(hw->adapter_stopped) { DEBUGOUT("Exiting because the adapter is already stopped!!!\n"); return FALSE; } @@ -135,6 +141,7 @@ return (ctrl_reg & IXGB_CTRL0_RST); } + /****************************************************************************** * Identifies the vendor of the optics module on the adapter. The SR adapters * support two different types of XPAK optics, so it is necessary to determine @@ -144,7 +151,8 @@ * * Returns: the vendor of the XPAK optics module. *****************************************************************************/ -static ixgb_xpak_vendor ixgb_identify_xpak_vendor(struct ixgb_hw *hw) +static ixgb_xpak_vendor +ixgb_identify_xpak_vendor(struct ixgb_hw *hw) { uint32_t i; uint16_t vendor_name[5]; @@ -183,7 +191,8 @@ * * Returns: the phy type of the adapter. *****************************************************************************/ -static ixgb_phy_type ixgb_identify_phy(struct ixgb_hw *hw) +static ixgb_phy_type +ixgb_identify_phy(struct ixgb_hw *hw) { ixgb_phy_type phy_type; ixgb_xpak_vendor xpak_vendor; @@ -210,7 +219,10 @@ phy_type = ixgb_phy_type_g6005; } break; - + case IXGB_DEVICE_ID_82597EX_LR: + DEBUGOUT("Identified G6104 optics\n"); + phy_type = ixgb_phy_type_g6104; + break; default: DEBUGOUT("Unknown physical layer module\n"); phy_type = ixgb_phy_type_unknown; @@ -237,7 +249,8 @@ * TRUE if successful, * FALSE if unrecoverable problems were encountered. *****************************************************************************/ -boolean_t ixgb_init_hw(struct ixgb_hw * hw) +boolean_t +ixgb_init_hw(struct ixgb_hw *hw) { uint32_t i; uint32_t ctrl_reg; @@ -266,7 +279,7 @@ msec_delay(IXGB_DELAY_AFTER_EE_RESET); if (ixgb_get_eeprom_data(hw) == FALSE) { - return (FALSE); + return(FALSE); } /* Use the device id to determine the type of phy/transceiver. */ @@ -284,7 +297,7 @@ */ if (!mac_addr_valid(hw->curr_mac_addr)) { DEBUGOUT("MAC address invalid after ixgb_init_rx_addrs\n"); - return (FALSE); + return(FALSE); } /* tell the routines in this file they can access hardware again */ @@ -295,7 +308,7 @@ /* Zero out the Multicast HASH table */ DEBUGOUT("Zeroing the MTA\n"); - for (i = 0; i < IXGB_MC_TBL_SIZE; i++) + for(i = 0; i < IXGB_MC_TBL_SIZE; i++) IXGB_WRITE_REG_ARRAY(hw, MTA, i, 0); /* Zero out the VLAN Filter Table Array */ @@ -322,7 +335,8 @@ * of the receive addresss registers. Clears the multicast table. Assumes * the receiver is in reset when the routine is called. *****************************************************************************/ -void ixgb_init_rx_addrs(struct ixgb_hw *hw) +void +ixgb_init_rx_addrs(struct ixgb_hw *hw) { uint32_t i; @@ -360,7 +374,7 @@ /* Zero out the other 15 receive addresses. */ DEBUGOUT("Clearing RAR[1-15]\n"); - for (i = 1; i < IXGB_RAR_ENTRIES; i++) { + for(i = 1; i < IXGB_RAR_ENTRIES; i++) { IXGB_WRITE_REG_ARRAY(hw, RA, (i << 1), 0); IXGB_WRITE_REG_ARRAY(hw, RA, ((i << 1) + 1), 0); } @@ -383,12 +397,13 @@ *****************************************************************************/ void ixgb_mc_addr_list_update(struct ixgb_hw *hw, - uint8_t * mc_addr_list, - uint32_t mc_addr_count, uint32_t pad) + uint8_t *mc_addr_list, + uint32_t mc_addr_count, + uint32_t pad) { uint32_t hash_value; uint32_t i; - uint32_t rar_used_count = 1; /* RAR[0] is used for our MAC address */ + uint32_t rar_used_count = 1; /* RAR[0] is used for our MAC address */ DEBUGFUNC("ixgb_mc_addr_list_update"); @@ -397,19 +412,19 @@ /* Clear RAR[1-15] */ DEBUGOUT(" Clearing RAR[1-15]\n"); - for (i = rar_used_count; i < IXGB_RAR_ENTRIES; i++) { + for(i = rar_used_count; i < IXGB_RAR_ENTRIES; i++) { IXGB_WRITE_REG_ARRAY(hw, RA, (i << 1), 0); IXGB_WRITE_REG_ARRAY(hw, RA, ((i << 1) + 1), 0); } /* Clear the MTA */ DEBUGOUT(" Clearing MTA\n"); - for (i = 0; i < IXGB_MC_TBL_SIZE; i++) { + for(i = 0; i < IXGB_MC_TBL_SIZE; i++) { IXGB_WRITE_REG_ARRAY(hw, MTA, i, 0); } /* Add the new addresses */ - for (i = 0; i < mc_addr_count; i++) { + for(i = 0; i < mc_addr_count; i++) { DEBUGOUT(" Adding the multicast addresses:\n"); DEBUGOUT7(" MC Addr #%d =%.2X %.2X %.2X %.2X %.2X %.2X\n", i, mc_addr_list[i * (IXGB_ETH_LENGTH_OF_ADDRESS + pad)], @@ -427,7 +442,7 @@ /* Place this multicast address in the RAR if there is room, * * else put it in the MTA */ - if (rar_used_count < IXGB_RAR_ENTRIES) { + if(rar_used_count < IXGB_RAR_ENTRIES) { ixgb_rar_set(hw, mc_addr_list + (i * (IXGB_ETH_LENGTH_OF_ADDRESS + pad)), @@ -460,7 +475,9 @@ * Returns: * The hash value *****************************************************************************/ -static uint32_t ixgb_hash_mc_addr(struct ixgb_hw *hw, uint8_t * mc_addr) +static uint32_t +ixgb_hash_mc_addr(struct ixgb_hw *hw, + uint8_t *mc_addr) { uint32_t hash_value = 0; @@ -506,7 +523,9 @@ * hw - Struct containing variables accessed by shared code * hash_value - Multicast address hash value *****************************************************************************/ -static void ixgb_mta_set(struct ixgb_hw *hw, uint32_t hash_value) +static void +ixgb_mta_set(struct ixgb_hw *hw, + uint32_t hash_value) { uint32_t hash_bit, hash_reg; uint32_t mta_reg; @@ -538,7 +557,10 @@ * addr - Address to put into receive address register * index - Receive address register to write *****************************************************************************/ -void ixgb_rar_set(struct ixgb_hw *hw, uint8_t * addr, uint32_t index) +void +ixgb_rar_set(struct ixgb_hw *hw, + uint8_t *addr, + uint32_t index) { uint32_t rar_low, rar_high; @@ -548,11 +570,13 @@ * from network order (big endian) to little endian */ rar_low = ((uint32_t) addr[0] | - ((uint32_t) addr[1] << 8) | - ((uint32_t) addr[2] << 16) | ((uint32_t) addr[3] << 24)); + ((uint32_t)addr[1] << 8) | + ((uint32_t)addr[2] << 16) | + ((uint32_t)addr[3] << 24)); rar_high = ((uint32_t) addr[4] | - ((uint32_t) addr[5] << 8) | IXGB_RAH_AV); + ((uint32_t)addr[5] << 8) | + IXGB_RAH_AV); IXGB_WRITE_REG_ARRAY(hw, RA, (index << 1), rar_low); IXGB_WRITE_REG_ARRAY(hw, RA, ((index << 1) + 1), rar_high); @@ -566,7 +590,10 @@ * offset - Offset in VLAN filer table to write * value - Value to write into VLAN filter table *****************************************************************************/ -void ixgb_write_vfta(struct ixgb_hw *hw, uint32_t offset, uint32_t value) +void +ixgb_write_vfta(struct ixgb_hw *hw, + uint32_t offset, + uint32_t value) { IXGB_WRITE_REG_ARRAY(hw, VFTA, offset, value); return; @@ -577,11 +604,12 @@ * * hw - Struct containing variables accessed by shared code *****************************************************************************/ -void ixgb_clear_vfta(struct ixgb_hw *hw) +void +ixgb_clear_vfta(struct ixgb_hw *hw) { uint32_t offset; - for (offset = 0; offset < IXGB_VLAN_FILTER_TBL_SIZE; offset++) + for(offset = 0; offset < IXGB_VLAN_FILTER_TBL_SIZE; offset++) IXGB_WRITE_REG_ARRAY(hw, VFTA, offset, 0); return; } @@ -592,10 +620,11 @@ * hw - Struct containing variables accessed by shared code *****************************************************************************/ -boolean_t ixgb_setup_fc(struct ixgb_hw * hw) +boolean_t +ixgb_setup_fc(struct ixgb_hw *hw) { uint32_t ctrl_reg; - uint32_t pap_reg = 0; /* by default, assume no pause time */ + uint32_t pap_reg = 0; /* by default, assume no pause time */ boolean_t status = TRUE; DEBUGFUNC("ixgb_setup_fc"); @@ -660,16 +689,16 @@ * ability to transmit pause frames in not enabled, then these * registers will be set to 0. */ - if (!(hw->fc.type & ixgb_fc_tx_pause)) { + if(!(hw->fc.type & ixgb_fc_tx_pause)) { IXGB_WRITE_REG(hw, FCRTL, 0); IXGB_WRITE_REG(hw, FCRTH, 0); } else { - /* We need to set up the Receive Threshold high and low water - * marks as well as (optionally) enabling the transmission of XON frames. - */ - if (hw->fc.send_xon) { + /* We need to set up the Receive Threshold high and low water + * marks as well as (optionally) enabling the transmission of XON + * frames. */ + if(hw->fc.send_xon) { IXGB_WRITE_REG(hw, FCRTL, - (hw->fc.low_water | IXGB_FCRTL_XONE)); + (hw->fc.low_water | IXGB_FCRTL_XONE)); } else { IXGB_WRITE_REG(hw, FCRTL, hw->fc.low_water); } @@ -694,9 +723,10 @@ * read command. *****************************************************************************/ uint16_t -ixgb_read_phy_reg(struct ixgb_hw * hw, - uint32_t reg_address, - uint32_t phy_address, uint32_t device_type) +ixgb_read_phy_reg(struct ixgb_hw *hw, + uint32_t reg_address, + uint32_t phy_address, + uint32_t device_type) { uint32_t i; uint32_t data; @@ -721,7 +751,8 @@ ** from the CPU Write to the Ready bit assertion. **************************************************************/ - for (i = 0; i < 10; i++) { + for(i = 0; i < 10; i++) + { udelay(10); command = IXGB_READ_REG(hw, MSCA); @@ -747,7 +778,8 @@ ** from the CPU Write to the Ready bit assertion. **************************************************************/ - for (i = 0; i < 10; i++) { + for(i = 0; i < 10; i++) + { udelay(10); command = IXGB_READ_REG(hw, MSCA); @@ -763,7 +795,7 @@ */ data = IXGB_READ_REG(hw, MSRWD); data >>= IXGB_MSRWD_READ_DATA_SHIFT; - return ((uint16_t) data); + return((uint16_t) data); } /****************************************************************************** @@ -785,8 +817,10 @@ *****************************************************************************/ void ixgb_write_phy_reg(struct ixgb_hw *hw, - uint32_t reg_address, - uint32_t phy_address, uint32_t device_type, uint16_t data) + uint32_t reg_address, + uint32_t phy_address, + uint32_t device_type, + uint16_t data) { uint32_t i; uint32_t command = 0; @@ -796,24 +830,25 @@ ASSERT(device_type <= IXGB_MAX_PHY_DEV_TYPE); /* Put the data in the MDIO Read/Write Data register */ - IXGB_WRITE_REG(hw, MSRWD, (uint32_t) data); + IXGB_WRITE_REG(hw, MSRWD, (uint32_t)data); /* Setup and write the address cycle command */ - command = ((reg_address << IXGB_MSCA_NP_ADDR_SHIFT) | - (device_type << IXGB_MSCA_DEV_TYPE_SHIFT) | - (phy_address << IXGB_MSCA_PHY_ADDR_SHIFT) | - (IXGB_MSCA_ADDR_CYCLE | IXGB_MSCA_MDI_COMMAND)); + command = ((reg_address << IXGB_MSCA_NP_ADDR_SHIFT) | + (device_type << IXGB_MSCA_DEV_TYPE_SHIFT) | + (phy_address << IXGB_MSCA_PHY_ADDR_SHIFT) | + (IXGB_MSCA_ADDR_CYCLE | IXGB_MSCA_MDI_COMMAND)); IXGB_WRITE_REG(hw, MSCA, command); - /************************************************************** - ** Check every 10 usec to see if the address cycle completed - ** The COMMAND bit will clear when the operation is complete. - ** This may take as long as 64 usecs (we'll wait 100 usecs max) - ** from the CPU Write to the Ready bit assertion. - **************************************************************/ + /************************************************************** + ** Check every 10 usec to see if the address cycle completed + ** The COMMAND bit will clear when the operation is complete. + ** This may take as long as 64 usecs (we'll wait 100 usecs max) + ** from the CPU Write to the Ready bit assertion. + **************************************************************/ - for (i = 0; i < 10; i++) { + for(i = 0; i < 10; i++) + { udelay(10); command = IXGB_READ_REG(hw, MSCA); @@ -825,21 +860,22 @@ ASSERT((command & IXGB_MSCA_MDI_COMMAND) == 0); /* Address cycle complete, setup and write the write command */ - command = ((reg_address << IXGB_MSCA_NP_ADDR_SHIFT) | - (device_type << IXGB_MSCA_DEV_TYPE_SHIFT) | - (phy_address << IXGB_MSCA_PHY_ADDR_SHIFT) | - (IXGB_MSCA_WRITE | IXGB_MSCA_MDI_COMMAND)); + command = ((reg_address << IXGB_MSCA_NP_ADDR_SHIFT) | + (device_type << IXGB_MSCA_DEV_TYPE_SHIFT) | + (phy_address << IXGB_MSCA_PHY_ADDR_SHIFT) | + (IXGB_MSCA_WRITE | IXGB_MSCA_MDI_COMMAND)); IXGB_WRITE_REG(hw, MSCA, command); - /************************************************************** - ** Check every 10 usec to see if the read command completed - ** The COMMAND bit will clear when the operation is complete. - ** The write may take as long as 64 usecs (we'll wait 100 usecs max) - ** from the CPU Write to the Ready bit assertion. - **************************************************************/ + /************************************************************** + ** Check every 10 usec to see if the read command completed + ** The COMMAND bit will clear when the operation is complete. + ** The write may take as long as 64 usecs (we'll wait 100 usecs max) + ** from the CPU Write to the Ready bit assertion. + **************************************************************/ - for (i = 0; i < 10; i++) { + for(i = 0; i < 10; i++) + { udelay(10); command = IXGB_READ_REG(hw, MSCA); @@ -860,7 +896,8 @@ * * Called by any function that needs to check the link status of the adapter. *****************************************************************************/ -void ixgb_check_for_link(struct ixgb_hw *hw) +void +ixgb_check_for_link(struct ixgb_hw *hw) { uint32_t status_reg; uint32_t xpcss_reg; @@ -922,14 +959,15 @@ * * hw - Struct containing variables accessed by shared code *****************************************************************************/ -void ixgb_clear_hw_cntrs(struct ixgb_hw *hw) +void +ixgb_clear_hw_cntrs(struct ixgb_hw *hw) { volatile uint32_t temp_reg; DEBUGFUNC("ixgb_clear_hw_cntrs"); /* if we are stopped or resetting exit gracefully */ - if (hw->adapter_stopped) { + if(hw->adapter_stopped) { DEBUGOUT("Exiting because the adapter is stopped!!!\n"); return; } @@ -1002,7 +1040,8 @@ * * hw - Struct containing variables accessed by shared code *****************************************************************************/ -void ixgb_led_on(struct ixgb_hw *hw) +void +ixgb_led_on(struct ixgb_hw *hw) { uint32_t ctrl0_reg = IXGB_READ_REG(hw, CTRL0); @@ -1017,7 +1056,8 @@ * * hw - Struct containing variables accessed by shared code *****************************************************************************/ -void ixgb_led_off(struct ixgb_hw *hw) +void +ixgb_led_off(struct ixgb_hw *hw) { uint32_t ctrl0_reg = IXGB_READ_REG(hw, CTRL0); @@ -1032,18 +1072,19 @@ * * hw - Struct containing variables accessed by shared code *****************************************************************************/ -static void ixgb_get_bus_info(struct ixgb_hw *hw) +static void +ixgb_get_bus_info(struct ixgb_hw *hw) { uint32_t status_reg; status_reg = IXGB_READ_REG(hw, STATUS); hw->bus.type = (status_reg & IXGB_STATUS_PCIX_MODE) ? - ixgb_bus_type_pcix : ixgb_bus_type_pci; + ixgb_bus_type_pcix : ixgb_bus_type_pci; if (hw->bus.type == ixgb_bus_type_pci) { hw->bus.speed = (status_reg & IXGB_STATUS_PCI_SPD) ? - ixgb_bus_speed_66 : ixgb_bus_speed_33; + ixgb_bus_speed_66 : ixgb_bus_speed_33; } else { switch (status_reg & IXGB_STATUS_PCIX_SPD_MASK) { case IXGB_STATUS_PCIX_SPD_66: @@ -1062,7 +1103,7 @@ } hw->bus.width = (status_reg & IXGB_STATUS_BUS64) ? - ixgb_bus_width_64 : ixgb_bus_width_32; + ixgb_bus_width_64 : ixgb_bus_width_32; return; } @@ -1073,7 +1114,8 @@ * mac_addr - pointer to MAC address. * *****************************************************************************/ -boolean_t mac_addr_valid(uint8_t * mac_addr) +boolean_t +mac_addr_valid(uint8_t *mac_addr) { boolean_t is_valid = TRUE; DEBUGFUNC("mac_addr_valid"); @@ -1090,9 +1132,11 @@ } /* Reject the zero address */ else if (mac_addr[0] == 0 && - mac_addr[1] == 0 && - mac_addr[2] == 0 && - mac_addr[3] == 0 && mac_addr[4] == 0 && mac_addr[5] == 0) { + mac_addr[1] == 0 && + mac_addr[2] == 0 && + mac_addr[3] == 0 && + mac_addr[4] == 0 && + mac_addr[5] == 0) { DEBUGOUT("MAC address is all zeros\n"); is_valid = FALSE; } @@ -1105,7 +1149,8 @@ * * hw - Struct containing variables accessed by shared code *****************************************************************************/ -boolean_t ixgb_link_reset(struct ixgb_hw * hw) +boolean_t +ixgb_link_reset(struct ixgb_hw *hw) { boolean_t link_status = FALSE; uint8_t wait_retries = MAX_RESET_ITERATIONS; @@ -1135,20 +1180,22 @@ * * hw - Struct containing variables accessed by shared code *****************************************************************************/ -void ixgb_optics_reset(struct ixgb_hw *hw) +void +ixgb_optics_reset(struct ixgb_hw *hw) { if (hw->phy_type == ixgb_phy_type_txn17401) { uint16_t mdio_reg; ixgb_write_phy_reg(hw, - MDIO_PMA_PMD_CR1, - IXGB_PHY_ADDRESS, - MDIO_PMA_PMD_DID, MDIO_PMA_PMD_CR1_RESET); - - mdio_reg = ixgb_read_phy_reg(hw, - MDIO_PMA_PMD_CR1, - IXGB_PHY_ADDRESS, - MDIO_PMA_PMD_DID); + MDIO_PMA_PMD_CR1, + IXGB_PHY_ADDRESS, + MDIO_PMA_PMD_DID, + MDIO_PMA_PMD_CR1_RESET); + + mdio_reg = ixgb_read_phy_reg( hw, + MDIO_PMA_PMD_CR1, + IXGB_PHY_ADDRESS, + MDIO_PMA_PMD_DID); } return; diff -Nru a/drivers/net/ixgb/ixgb_hw.h b/drivers/net/ixgb/ixgb_hw.h --- a/drivers/net/ixgb/ixgb_hw.h 2005-01-12 01:33:23 -05:00 +++ b/drivers/net/ixgb/ixgb_hw.h 2005-01-12 01:33:23 -05:00 @@ -616,17 +616,17 @@ #define IXGB_CONTEXT_DESC_STATUS_DD 0x01 /* Filters */ -#define IXGB_RAR_ENTRIES 16 /* Number of entries in Rx Address array */ #define IXGB_MC_TBL_SIZE 128 /* Multicast Filter Table (4096 bits) */ #define IXGB_VLAN_FILTER_TBL_SIZE 128 /* VLAN Filter Table (4096 bits) */ +#define IXGB_RAR_ENTRIES 3 /* Number of entries in Rx Address array */ #define IXGB_MEMORY_REGISTER_BASE_ADDRESS 0 -#define ENET_HEADER_SIZE 14 -#define ENET_FCS_LENGTH 4 -#define IXGB_MAX_NUM_MULTICAST_ADDRESSES 128 -#define IXGB_MIN_ENET_FRAME_SIZE_WITHOUT_FCS 60 -#define IXGB_MAX_ENET_FRAME_SIZE_WITHOUT_FCS 1514 -#define IXGB_MAX_JUMBO_FRAME_SIZE 0x3F00 +#define ENET_HEADER_SIZE 14 +#define ENET_FCS_LENGTH 4 +#define IXGB_MAX_NUM_MULTICAST_ADDRESSES 128 +#define IXGB_MIN_ENET_FRAME_SIZE_WITHOUT_FCS 60 +#define IXGB_MAX_ENET_FRAME_SIZE_WITHOUT_FCS 1514 +#define IXGB_MAX_JUMBO_FRAME_SIZE 0x3F00 /* Phy Addresses */ #define IXGB_OPTICAL_PHY_ADDR 0x0 /* Optical Module phy address */ @@ -789,32 +789,39 @@ extern boolean_t ixgb_check_for_bad_link(struct ixgb_hw *hw); extern boolean_t ixgb_setup_fc(struct ixgb_hw *hw); extern void ixgb_clear_hw_cntrs(struct ixgb_hw *hw); -extern boolean_t mac_addr_valid(uint8_t * mac_addr); +extern boolean_t mac_addr_valid(uint8_t *mac_addr); extern uint16_t ixgb_read_phy_reg(struct ixgb_hw *hw, - uint32_t reg_addr, - uint32_t phy_addr, uint32_t device_type); + uint32_t reg_addr, + uint32_t phy_addr, + uint32_t device_type); extern void ixgb_write_phy_reg(struct ixgb_hw *hw, - uint32_t reg_addr, - uint32_t phy_addr, - uint32_t device_type, uint16_t data); + uint32_t reg_addr, + uint32_t phy_addr, + uint32_t device_type, + uint16_t data); + +extern void ixgb_rar_set(struct ixgb_hw *hw, + uint8_t *addr, + uint32_t index); -extern void ixgb_rar_set(struct ixgb_hw *hw, uint8_t * addr, uint32_t index); /* Filters (multicast, vlan, receive) */ extern void ixgb_mc_addr_list_update(struct ixgb_hw *hw, - uint8_t * mc_addr_list, - uint32_t mc_addr_count, uint32_t pad); + uint8_t *mc_addr_list, + uint32_t mc_addr_count, + uint32_t pad); /* Vfta functions */ extern void ixgb_write_vfta(struct ixgb_hw *hw, - uint32_t offset, uint32_t value); + uint32_t offset, + uint32_t value); extern void ixgb_clear_vfta(struct ixgb_hw *hw); /* Access functions to eeprom data */ -void ixgb_get_ee_mac_addr(struct ixgb_hw *hw, uint8_t * mac_addr); +void ixgb_get_ee_mac_addr(struct ixgb_hw *hw, uint8_t *mac_addr); uint16_t ixgb_get_ee_compatibility(struct ixgb_hw *hw); uint32_t ixgb_get_ee_pba_number(struct ixgb_hw *hw); uint16_t ixgb_get_ee_init_ctrl_reg_1(struct ixgb_hw *hw); @@ -832,6 +839,9 @@ /* Everything else */ void ixgb_led_on(struct ixgb_hw *hw); void ixgb_led_off(struct ixgb_hw *hw); -void ixgb_write_pci_cfg(struct ixgb_hw *hw, uint32_t reg, uint16_t * value); +void ixgb_write_pci_cfg(struct ixgb_hw *hw, + uint32_t reg, + uint16_t * value); -#endif /* _IXGB_HW_H_ */ + +#endif /* _IXGB_HW_H_ */ diff -Nru a/drivers/net/ixgb/ixgb_ids.h b/drivers/net/ixgb/ixgb_ids.h --- a/drivers/net/ixgb/ixgb_ids.h 2005-01-12 01:33:23 -05:00 +++ b/drivers/net/ixgb/ixgb_ids.h 2005-01-12 01:33:23 -05:00 @@ -33,21 +33,16 @@ ** The Device and Vendor IDs for 10 Gigabit MACs **********************************************************************/ -#define INTEL_VENDOR_ID 0x8086 -#define INTEL_SUBVENDOR_ID 0x8086 +#define INTEL_VENDOR_ID 0x8086 +#define INTEL_SUBVENDOR_ID 0x8086 -#define IXGB_DEVICE_ID_82597EX 0x1048 -#define IXGB_DEVICE_ID_82597EX_SR 0x1A48 -#define IXGB_SUBDEVICE_ID_A11F 0xA11F -#define IXGB_SUBDEVICE_ID_A01F 0xA01F +#define IXGB_DEVICE_ID_82597EX 0x1048 +#define IXGB_DEVICE_ID_82597EX_SR 0x1A48 +#define IXGB_DEVICE_ID_82597EX_LR 0x1B48 +#define IXGB_SUBDEVICE_ID_A11F 0xA11F +#define IXGB_SUBDEVICE_ID_A01F 0xA01F -#define IXGB_SUBDEVICE_ID_A15F 0xA15F -#define IXGB_SUBDEVICE_ID_A05F 0xA05F - -#define IXGB_SUBDEVICE_ID_A12F 0xA12F -#define IXGB_SUBDEVICE_ID_A02F 0xA02F - -#endif /* #ifndef _IXGB_IDS_H_ */ +#endif /* #ifndef _IXGB_IDS_H_ */ /* End of File */ diff -Nru a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c --- a/drivers/net/ixgb/ixgb_main.c 2005-01-12 01:33:23 -05:00 +++ b/drivers/net/ixgb/ixgb_main.c 2005-01-12 01:33:23 -05:00 @@ -28,10 +28,23 @@ #include "ixgb.h" +/* Change Log + * 1.0.84 10/26/04 + * - reset buffer_info->dma in Tx resource cleanup logic + * 1.0.83 10/12/04 + * - sparse cleanup - shemminger@osdl.org + * - fix tx resource cleanup logic + */ + char ixgb_driver_name[] = "ixgb"; char ixgb_driver_string[] = "Intel(R) PRO/10GbE Network Driver"; -char ixgb_driver_version[] = "1.0.66-k2"; -char ixgb_copyright[] = "Copyright (c) 2001-2004 Intel Corporation."; +#ifndef CONFIG_IXGB_NAPI +#define DRIVERNAPI +#else +#define DRIVERNAPI "-NAPI" +#endif +char ixgb_driver_version[] = "1.0.87-k2"DRIVERNAPI; +char ixgb_copyright[] = "Copyright (c) 1999-2004 Intel Corporation."; /* ixgb_pci_tbl - PCI Device ID Table * @@ -46,6 +59,8 @@ PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {INTEL_VENDOR_ID, IXGB_DEVICE_ID_82597EX_SR, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {INTEL_VENDOR_ID, IXGB_DEVICE_ID_82597EX_LR, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* required last entry */ {0,} @@ -55,11 +70,14 @@ /* Local Function Prototypes */ -static inline void ixgb_irq_disable(struct ixgb_adapter *adapter); -static inline void ixgb_irq_enable(struct ixgb_adapter *adapter); int ixgb_up(struct ixgb_adapter *adapter); void ixgb_down(struct ixgb_adapter *adapter, boolean_t kill_watchdog); void ixgb_reset(struct ixgb_adapter *adapter); +int ixgb_setup_tx_resources(struct ixgb_adapter *adapter); +int ixgb_setup_rx_resources(struct ixgb_adapter *adapter); +void ixgb_free_tx_resources(struct ixgb_adapter *adapter); +void ixgb_free_rx_resources(struct ixgb_adapter *adapter); +void ixgb_update_stats(struct ixgb_adapter *adapter); static int ixgb_init_module(void); static void ixgb_exit_module(void); @@ -68,27 +86,19 @@ static int ixgb_sw_init(struct ixgb_adapter *adapter); static int ixgb_open(struct net_device *netdev); static int ixgb_close(struct net_device *netdev); -static int ixgb_setup_tx_resources(struct ixgb_adapter *adapter); -static int ixgb_setup_rx_resources(struct ixgb_adapter *adapter); static void ixgb_configure_tx(struct ixgb_adapter *adapter); static void ixgb_configure_rx(struct ixgb_adapter *adapter); static void ixgb_setup_rctl(struct ixgb_adapter *adapter); static void ixgb_clean_tx_ring(struct ixgb_adapter *adapter); static void ixgb_clean_rx_ring(struct ixgb_adapter *adapter); -static void ixgb_free_tx_resources(struct ixgb_adapter *adapter); -static void ixgb_free_rx_resources(struct ixgb_adapter *adapter); static void ixgb_set_multi(struct net_device *netdev); static void ixgb_watchdog(unsigned long data); static int ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev); static struct net_device_stats *ixgb_get_stats(struct net_device *netdev); static int ixgb_change_mtu(struct net_device *netdev, int new_mtu); static int ixgb_set_mac(struct net_device *netdev, void *p); -static void ixgb_update_stats(struct ixgb_adapter *adapter); static irqreturn_t ixgb_intr(int irq, void *data, struct pt_regs *regs); static boolean_t ixgb_clean_tx_irq(struct ixgb_adapter *adapter); -static inline void ixgb_rx_checksum(struct ixgb_adapter *adapter, - struct ixgb_rx_desc *rx_desc, - struct sk_buff *skb); #ifdef CONFIG_IXGB_NAPI static int ixgb_clean(struct net_device *netdev, int *budget); static boolean_t ixgb_clean_rx_irq(struct ixgb_adapter *adapter, @@ -97,6 +107,7 @@ static boolean_t ixgb_clean_rx_irq(struct ixgb_adapter *adapter); #endif static void ixgb_alloc_rx_buffers(struct ixgb_adapter *adapter); +void ixgb_set_ethtool_ops(struct net_device *netdev); static void ixgb_tx_timeout(struct net_device *dev); static void ixgb_tx_timeout_task(struct net_device *dev); static void ixgb_vlan_rx_register(struct net_device *netdev, @@ -123,7 +134,6 @@ /* Exported from other modules */ extern void ixgb_check_options(struct ixgb_adapter *adapter); -extern struct ethtool_ops ixgb_ethtool_ops; static struct pci_driver ixgb_driver = { .name = ixgb_driver_name, @@ -152,7 +162,8 @@ * loaded. All it does is register with the PCI subsystem. **/ -static int __init ixgb_init_module(void) +static int __init +ixgb_init_module(void) { int ret; printk(KERN_INFO "%s - version %s\n", @@ -161,7 +172,7 @@ printk(KERN_INFO "%s\n", ixgb_copyright); ret = pci_module_init(&ixgb_driver); - if (ret >= 0) { + if(ret >= 0) { register_reboot_notifier(&ixgb_notifier_reboot); } return ret; @@ -176,7 +187,8 @@ * from memory. **/ -static void __exit ixgb_exit_module(void) +static void __exit +ixgb_exit_module(void) { unregister_reboot_notifier(&ixgb_notifier_reboot); pci_unregister_driver(&ixgb_driver); @@ -189,7 +201,8 @@ * @adapter: board private structure **/ -static inline void ixgb_irq_disable(struct ixgb_adapter *adapter) +static inline void +ixgb_irq_disable(struct ixgb_adapter *adapter) { atomic_inc(&adapter->irq_sem); IXGB_WRITE_REG(&adapter->hw, IMC, ~0); @@ -202,17 +215,19 @@ * @adapter: board private structure **/ -static inline void ixgb_irq_enable(struct ixgb_adapter *adapter) +static inline void +ixgb_irq_enable(struct ixgb_adapter *adapter) { - if (atomic_dec_and_test(&adapter->irq_sem)) { + if(atomic_dec_and_test(&adapter->irq_sem)) { IXGB_WRITE_REG(&adapter->hw, IMS, - IXGB_INT_RXT0 | IXGB_INT_RXDMT0 | IXGB_INT_TXDW | - IXGB_INT_RXO | IXGB_INT_LSC); + IXGB_INT_RXT0 | IXGB_INT_RXDMT0 | IXGB_INT_TXDW | + IXGB_INT_RXO | IXGB_INT_LSC); IXGB_WRITE_FLUSH(&adapter->hw); } } -int ixgb_up(struct ixgb_adapter *adapter) +int +ixgb_up(struct ixgb_adapter *adapter) { struct net_device *netdev = adapter->netdev; int err; @@ -230,27 +245,44 @@ ixgb_configure_rx(adapter); ixgb_alloc_rx_buffers(adapter); - if ((err = request_irq(adapter->pdev->irq, &ixgb_intr, - SA_SHIRQ | SA_SAMPLE_RANDOM, - netdev->name, netdev))) +#ifdef CONFIG_PCI_MSI + { + boolean_t pcix = (IXGB_READ_REG(&adapter->hw, STATUS) & + IXGB_STATUS_PCIX_MODE) ? TRUE : FALSE; + adapter->have_msi = TRUE; + + if (!pcix) + adapter->have_msi = FALSE; + else if((err = pci_enable_msi(adapter->pdev))) { + printk (KERN_ERR + "Unable to allocate MSI interrupt Error: %d\n", err); + adapter->have_msi = FALSE; + /* proceed to try to request regular interrupt */ + } + } + +#endif + if((err = request_irq(adapter->pdev->irq, &ixgb_intr, + SA_SHIRQ | SA_SAMPLE_RANDOM, + netdev->name, netdev))) return err; /* disable interrupts and get the hardware into a known state */ IXGB_WRITE_REG(&adapter->hw, IMC, 0xffffffff); - if ((hw->max_frame_size != max_frame) || - (hw->max_frame_size != - (IXGB_READ_REG(hw, MFS) >> IXGB_MFS_SHIFT))) { + if((hw->max_frame_size != max_frame) || + (hw->max_frame_size != + (IXGB_READ_REG(hw, MFS) >> IXGB_MFS_SHIFT))) { hw->max_frame_size = max_frame; IXGB_WRITE_REG(hw, MFS, hw->max_frame_size << IXGB_MFS_SHIFT); - if (hw->max_frame_size > - IXGB_MAX_ENET_FRAME_SIZE_WITHOUT_FCS + ENET_FCS_LENGTH) { + if(hw->max_frame_size > + IXGB_MAX_ENET_FRAME_SIZE_WITHOUT_FCS + ENET_FCS_LENGTH) { uint32_t ctrl0 = IXGB_READ_REG(hw, CTRL0); - if (!(ctrl0 & IXGB_CTRL0_JFE)) { + if(!(ctrl0 & IXGB_CTRL0_JFE)) { ctrl0 |= IXGB_CTRL0_JFE; IXGB_WRITE_REG(hw, CTRL0, ctrl0); } @@ -263,13 +295,19 @@ return 0; } -void ixgb_down(struct ixgb_adapter *adapter, boolean_t kill_watchdog) +void +ixgb_down(struct ixgb_adapter *adapter, boolean_t kill_watchdog) { struct net_device *netdev = adapter->netdev; ixgb_irq_disable(adapter); free_irq(adapter->pdev->irq, netdev); - if (kill_watchdog) +#ifdef CONFIG_PCI_MSI + if(adapter->have_msi == TRUE) + pci_disable_msi(adapter->pdev); + +#endif + if(kill_watchdog) del_timer_sync(&adapter->watchdog_timer); adapter->link_speed = 0; adapter->link_duplex = 0; @@ -281,11 +319,12 @@ ixgb_clean_rx_ring(adapter); } -void ixgb_reset(struct ixgb_adapter *adapter) +void +ixgb_reset(struct ixgb_adapter *adapter) { ixgb_adapter_stop(&adapter->hw); - if (!ixgb_init_hw(&adapter->hw)) + if(!ixgb_init_hw(&adapter->hw)) IXGB_DBG("ixgb_init_hw failed.\n"); } @@ -302,7 +341,8 @@ **/ static int __devinit -ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) +ixgb_probe(struct pci_dev *pdev, + const struct pci_device_id *ent) { struct net_device *netdev = NULL; struct ixgb_adapter *adapter; @@ -313,26 +353,26 @@ int i; int err; - if ((err = pci_enable_device(pdev))) + if((err = pci_enable_device(pdev))) return err; - if (!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK))) { + if(!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK))) { pci_using_dac = 1; } else { - if ((err = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) { + if((err = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) { IXGB_ERR("No usable DMA configuration, aborting\n"); return err; } pci_using_dac = 0; } - if ((err = pci_request_regions(pdev, ixgb_driver_name))) + if((err = pci_request_regions(pdev, ixgb_driver_name))) return err; pci_set_master(pdev); netdev = alloc_etherdev(sizeof(struct ixgb_adapter)); - if (!netdev) { + if(!netdev) { err = -ENOMEM; goto err_alloc_etherdev; } @@ -350,15 +390,15 @@ mmio_len = pci_resource_len(pdev, BAR_0); adapter->hw.hw_addr = ioremap(mmio_start, mmio_len); - if (!adapter->hw.hw_addr) { + if(!adapter->hw.hw_addr) { err = -EIO; goto err_ioremap; } - for (i = BAR_1; i <= BAR_5; i++) { - if (pci_resource_len(pdev, i) == 0) + for(i = BAR_1; i <= BAR_5; i++) { + if(pci_resource_len(pdev, i) == 0) continue; - if (pci_resource_flags(pdev, i) & IORESOURCE_IO) { + if(pci_resource_flags(pdev, i) & IORESOURCE_IO) { adapter->hw.io_base = pci_resource_start(pdev, i); break; } @@ -371,9 +411,9 @@ netdev->set_multicast_list = &ixgb_set_multi; netdev->set_mac_address = &ixgb_set_mac; netdev->change_mtu = &ixgb_change_mtu; + ixgb_set_ethtool_ops(netdev); netdev->tx_timeout = &ixgb_tx_timeout; netdev->watchdog_timeo = HZ; - SET_ETHTOOL_OPS(netdev, &ixgb_ethtool_ops); #ifdef CONFIG_IXGB_NAPI netdev->poll = &ixgb_clean; netdev->weight = 64; @@ -395,22 +435,24 @@ /* setup the private structure */ - if ((err = ixgb_sw_init(adapter))) + if((err = ixgb_sw_init(adapter))) goto err_sw_init; netdev->features = NETIF_F_SG | - NETIF_F_HW_CSUM | - NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER; + NETIF_F_HW_CSUM | + NETIF_F_HW_VLAN_TX | + NETIF_F_HW_VLAN_RX | + NETIF_F_HW_VLAN_FILTER; #ifdef NETIF_F_TSO netdev->features |= NETIF_F_TSO; #endif - if (pci_using_dac) + if(pci_using_dac) netdev->features |= NETIF_F_HIGHDMA; /* make sure the EEPROM is good */ - if (!ixgb_validate_eeprom_checksum(&adapter->hw)) { + if(!ixgb_validate_eeprom_checksum(&adapter->hw)) { printk(KERN_ERR "The EEPROM Checksum Is Not Valid\n"); err = -EIO; goto err_eeprom; @@ -418,7 +460,7 @@ ixgb_get_ee_mac_addr(&adapter->hw, netdev->dev_addr); - if (!is_valid_ether_addr(netdev->dev_addr)) { + if(!is_valid_ether_addr(netdev->dev_addr)) { err = -EIO; goto err_eeprom; } @@ -432,7 +474,7 @@ INIT_WORK(&adapter->tx_timeout_task, (void (*)(void *))ixgb_tx_timeout_task, netdev); - if ((err = register_netdev(netdev))) + if((err = register_netdev(netdev))) goto err_register; /* we're going to reset, so assume we have no link for now */ @@ -441,7 +483,7 @@ netif_stop_queue(netdev); printk(KERN_INFO "%s: Intel(R) PRO/10GbE Network Connection\n", - netdev->name); + netdev->name); ixgb_check_options(adapter); /* reset the hardware with the new settings */ @@ -450,13 +492,13 @@ cards_found++; return 0; - err_register: - err_sw_init: - err_eeprom: +err_register: +err_sw_init: +err_eeprom: iounmap(adapter->hw.hw_addr); - err_ioremap: +err_ioremap: free_netdev(netdev); - err_alloc_etherdev: +err_alloc_etherdev: pci_release_regions(pdev); return err; } @@ -471,7 +513,8 @@ * memory. **/ -static void __devexit ixgb_remove(struct pci_dev *pdev) +static void __devexit +ixgb_remove(struct pci_dev *pdev) { struct net_device *netdev = pci_get_drvdata(pdev); struct ixgb_adapter *adapter = netdev->priv; @@ -493,7 +536,8 @@ * OS network device settings (MTU size). **/ -static int __devinit ixgb_sw_init(struct ixgb_adapter *adapter) +static int __devinit +ixgb_sw_init(struct ixgb_adapter *adapter) { struct ixgb_hw *hw = &adapter->hw; struct net_device *netdev = adapter->netdev; @@ -510,9 +554,10 @@ hw->max_frame_size = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH; - if ((hw->device_id == IXGB_DEVICE_ID_82597EX) - || (hw->device_id == IXGB_DEVICE_ID_82597EX_SR)) - hw->mac_type = ixgb_82597; + if((hw->device_id == IXGB_DEVICE_ID_82597EX) + ||(hw->device_id == IXGB_DEVICE_ID_82597EX_LR) + ||(hw->device_id == IXGB_DEVICE_ID_82597EX_SR)) + hw->mac_type = ixgb_82597; else { /* should never have loaded on this device */ printk(KERN_ERR "ixgb: unsupported device id\n"); @@ -540,31 +585,32 @@ * and the stack is notified that the interface is ready. **/ -static int ixgb_open(struct net_device *netdev) +static int +ixgb_open(struct net_device *netdev) { struct ixgb_adapter *adapter = netdev->priv; int err; /* allocate transmit descriptors */ - if ((err = ixgb_setup_tx_resources(adapter))) + if((err = ixgb_setup_tx_resources(adapter))) goto err_setup_tx; /* allocate receive descriptors */ - if ((err = ixgb_setup_rx_resources(adapter))) + if((err = ixgb_setup_rx_resources(adapter))) goto err_setup_rx; - if ((err = ixgb_up(adapter))) + if((err = ixgb_up(adapter))) goto err_up; return 0; - err_up: +err_up: ixgb_free_rx_resources(adapter); - err_setup_rx: +err_setup_rx: ixgb_free_tx_resources(adapter); - err_setup_tx: +err_setup_tx: ixgb_reset(adapter); return err; @@ -582,7 +628,8 @@ * hardware, and all transmit and receive resources are freed. **/ -static int ixgb_close(struct net_device *netdev) +static int +ixgb_close(struct net_device *netdev) { struct ixgb_adapter *adapter = netdev->priv; @@ -601,15 +648,16 @@ * Return 0 on success, negative on failure **/ -static int ixgb_setup_tx_resources(struct ixgb_adapter *adapter) +int +ixgb_setup_tx_resources(struct ixgb_adapter *adapter) { struct ixgb_desc_ring *txdr = &adapter->tx_ring; struct pci_dev *pdev = adapter->pdev; int size; size = sizeof(struct ixgb_buffer) * txdr->count; - txdr->buffer_info = kmalloc(size, GFP_KERNEL); - if (!txdr->buffer_info) { + txdr->buffer_info = vmalloc(size); + if(!txdr->buffer_info) { return -ENOMEM; } memset(txdr->buffer_info, 0, size); @@ -620,8 +668,8 @@ IXGB_ROUNDUP(txdr->size, 4096); txdr->desc = pci_alloc_consistent(pdev, txdr->size, &txdr->dma); - if (!txdr->desc) { - kfree(txdr->buffer_info); + if(!txdr->desc) { + vfree(txdr->buffer_info); return -ENOMEM; } memset(txdr->desc, 0, txdr->size); @@ -639,7 +687,8 @@ * Configure the Tx unit of the MAC after a reset. **/ -static void ixgb_configure_tx(struct ixgb_adapter *adapter) +static void +ixgb_configure_tx(struct ixgb_adapter *adapter) { uint64_t tdba = adapter->tx_ring.dma; uint32_t tdlen = adapter->tx_ring.count * sizeof(struct ixgb_tx_desc); @@ -679,8 +728,8 @@ /* Setup Transmit Descriptor Settings for this adapter */ adapter->tx_cmd_type = - IXGB_TX_DESC_TYPE - | (adapter->tx_int_delay_enable ? IXGB_TX_DESC_CMD_IDE : 0); + IXGB_TX_DESC_TYPE + | (adapter->tx_int_delay_enable ? IXGB_TX_DESC_CMD_IDE : 0); } /** @@ -690,15 +739,16 @@ * Returns 0 on success, negative on failure **/ -static int ixgb_setup_rx_resources(struct ixgb_adapter *adapter) +int +ixgb_setup_rx_resources(struct ixgb_adapter *adapter) { struct ixgb_desc_ring *rxdr = &adapter->rx_ring; struct pci_dev *pdev = adapter->pdev; int size; size = sizeof(struct ixgb_buffer) * rxdr->count; - rxdr->buffer_info = kmalloc(size, GFP_KERNEL); - if (!rxdr->buffer_info) { + rxdr->buffer_info = vmalloc(size); + if(!rxdr->buffer_info) { return -ENOMEM; } memset(rxdr->buffer_info, 0, size); @@ -710,8 +760,8 @@ rxdr->desc = pci_alloc_consistent(pdev, rxdr->size, &rxdr->dma); - if (!rxdr->desc) { - kfree(rxdr->buffer_info); + if(!rxdr->desc) { + vfree(rxdr->buffer_info); return -ENOMEM; } memset(rxdr->desc, 0, rxdr->size); @@ -727,7 +777,8 @@ * @adapter: Board private structure **/ -static void ixgb_setup_rctl(struct ixgb_adapter *adapter) +static void +ixgb_setup_rctl(struct ixgb_adapter *adapter) { uint32_t rctl; @@ -736,9 +787,9 @@ rctl &= ~(3 << IXGB_RCTL_MO_SHIFT); rctl |= - IXGB_RCTL_BAM | IXGB_RCTL_RDMTS_1_2 | - IXGB_RCTL_RXEN | IXGB_RCTL_CFF | - (adapter->hw.mc_filter_type << IXGB_RCTL_MO_SHIFT); + IXGB_RCTL_BAM | IXGB_RCTL_RDMTS_1_2 | + IXGB_RCTL_RXEN | IXGB_RCTL_CFF | + (adapter->hw.mc_filter_type << IXGB_RCTL_MO_SHIFT); rctl |= IXGB_RCTL_SECRC; @@ -768,7 +819,8 @@ * Configure the Rx unit of the MAC after a reset. **/ -static void ixgb_configure_rx(struct ixgb_adapter *adapter) +static void +ixgb_configure_rx(struct ixgb_adapter *adapter) { uint64_t rdba = adapter->rx_ring.dma; uint32_t rdlen = adapter->rx_ring.count * sizeof(struct ixgb_rx_desc); @@ -797,51 +849,14 @@ IXGB_WRITE_REG(hw, RDH, 0); IXGB_WRITE_REG(hw, RDT, 0); - /* burst 16 or burst when RXT0 */ - rxdctl = RXDCTL_WTHRESH_DEFAULT << IXGB_RXDCTL_WTHRESH_SHIFT - | RXDCTL_HTHRESH_DEFAULT << IXGB_RXDCTL_HTHRESH_SHIFT - | RXDCTL_PTHRESH_DEFAULT << IXGB_RXDCTL_PTHRESH_SHIFT; + /* burst 16 or burst when RXT0*/ + rxdctl = RXDCTL_WTHRESH_DEFAULT << IXGB_RXDCTL_WTHRESH_SHIFT + | RXDCTL_HTHRESH_DEFAULT << IXGB_RXDCTL_HTHRESH_SHIFT + | RXDCTL_PTHRESH_DEFAULT << IXGB_RXDCTL_PTHRESH_SHIFT; IXGB_WRITE_REG(hw, RXDCTL, rxdctl); - if (adapter->raidc) { - uint32_t raidc; - uint8_t poll_threshold; - - /* Poll every rx_int_delay period, if RBD exists - * Receive Backlog Detection is set to - * Rx Descriptors - * max is 0x3F == set to poll when 504 RxDesc left - * min is 0 */ - - /* polling times are 1 == 0.8192us - 2 == 1.6384us - 3 == 3.2768us etc - ... - 511 == 418 us - */ -#define IXGB_RAIDC_POLL_DEFAULT 122 /* set to poll every ~100 us under load - also known as 10000 interrupts / sec */ - - /* divide this by 2^3 (8) to get a register size count */ - poll_threshold = ((adapter->rx_ring.count - 1) >> 3); - /* poll at half of that size */ - poll_threshold >>= 1; - /* make sure its not bigger than our max */ - poll_threshold &= 0x3F; - - raidc = IXGB_RAIDC_EN | /* turn on raidc style moderation */ - IXGB_RAIDC_RXT_GATE | /* don't interrupt with rxt0 while - in RBD mode (polling) */ - (IXGB_RAIDC_POLL_DEFAULT << IXGB_RAIDC_POLL_SHIFT) | - /* this sets the regular "min interrupt delay" */ - (adapter->rx_int_delay << IXGB_RAIDC_DELAY_SHIFT) | - poll_threshold; - - IXGB_WRITE_REG(hw, RAIDC, raidc); - } - /* Enable Receive Checksum Offload for TCP and UDP */ - if (adapter->rx_csum == TRUE) { + if(adapter->rx_csum == TRUE) { rxcsum = IXGB_READ_REG(hw, RXCSUM); rxcsum |= IXGB_RXCSUM_TUOFL; IXGB_WRITE_REG(hw, RXCSUM, rxcsum); @@ -859,13 +874,14 @@ * Free all transmit software resources **/ -static void ixgb_free_tx_resources(struct ixgb_adapter *adapter) +void +ixgb_free_tx_resources(struct ixgb_adapter *adapter) { struct pci_dev *pdev = adapter->pdev; ixgb_clean_tx_ring(adapter); - kfree(adapter->tx_ring.buffer_info); + vfree(adapter->tx_ring.buffer_info); adapter->tx_ring.buffer_info = NULL; pci_free_consistent(pdev, adapter->tx_ring.size, @@ -874,33 +890,42 @@ adapter->tx_ring.desc = NULL; } +static inline void +ixgb_unmap_and_free_tx_resource(struct ixgb_adapter *adapter, + struct ixgb_buffer *buffer_info) +{ + struct pci_dev *pdev = adapter->pdev; + if(buffer_info->dma) { + pci_unmap_page(pdev, + buffer_info->dma, + buffer_info->length, + PCI_DMA_TODEVICE); + buffer_info->dma = 0; + } + if(buffer_info->skb) { + dev_kfree_skb_any(buffer_info->skb); + buffer_info->skb = NULL; + } +} + /** * ixgb_clean_tx_ring - Free Tx Buffers * @adapter: board private structure **/ -static void ixgb_clean_tx_ring(struct ixgb_adapter *adapter) +static void +ixgb_clean_tx_ring(struct ixgb_adapter *adapter) { struct ixgb_desc_ring *tx_ring = &adapter->tx_ring; struct ixgb_buffer *buffer_info; - struct pci_dev *pdev = adapter->pdev; unsigned long size; unsigned int i; /* Free all the Tx ring sk_buffs */ - for (i = 0; i < tx_ring->count; i++) { + for(i = 0; i < tx_ring->count; i++) { buffer_info = &tx_ring->buffer_info[i]; - if (buffer_info->skb) { - - pci_unmap_page(pdev, - buffer_info->dma, - buffer_info->length, PCI_DMA_TODEVICE); - - dev_kfree_skb(buffer_info->skb); - - buffer_info->skb = NULL; - } + ixgb_unmap_and_free_tx_resource(adapter, buffer_info); } size = sizeof(struct ixgb_buffer) * tx_ring->count; @@ -924,14 +949,15 @@ * Free all receive software resources **/ -static void ixgb_free_rx_resources(struct ixgb_adapter *adapter) +void +ixgb_free_rx_resources(struct ixgb_adapter *adapter) { struct ixgb_desc_ring *rx_ring = &adapter->rx_ring; struct pci_dev *pdev = adapter->pdev; ixgb_clean_rx_ring(adapter); - kfree(rx_ring->buffer_info); + vfree(rx_ring->buffer_info); rx_ring->buffer_info = NULL; pci_free_consistent(pdev, rx_ring->size, rx_ring->desc, rx_ring->dma); @@ -944,7 +970,8 @@ * @adapter: board private structure **/ -static void ixgb_clean_rx_ring(struct ixgb_adapter *adapter) +static void +ixgb_clean_rx_ring(struct ixgb_adapter *adapter) { struct ixgb_desc_ring *rx_ring = &adapter->rx_ring; struct ixgb_buffer *buffer_info; @@ -954,9 +981,9 @@ /* Free all the Rx ring sk_buffs */ - for (i = 0; i < rx_ring->count; i++) { + for(i = 0; i < rx_ring->count; i++) { buffer_info = &rx_ring->buffer_info[i]; - if (buffer_info->skb) { + if(buffer_info->skb) { pci_unmap_single(pdev, buffer_info->dma, @@ -991,12 +1018,13 @@ * Returns 0 on success, negative on failure **/ -static int ixgb_set_mac(struct net_device *netdev, void *p) +static int +ixgb_set_mac(struct net_device *netdev, void *p) { struct ixgb_adapter *adapter = netdev->priv; struct sockaddr *addr = p; - if (!is_valid_ether_addr(addr->sa_data)) + if(!is_valid_ether_addr(addr->sa_data)) return -EADDRNOTAVAIL; memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); @@ -1016,7 +1044,8 @@ * promiscuous mode, and all-multi behavior. **/ -static void ixgb_set_multi(struct net_device *netdev) +static void +ixgb_set_multi(struct net_device *netdev) { struct ixgb_adapter *adapter = netdev->priv; struct ixgb_hw *hw = &adapter->hw; @@ -1028,16 +1057,16 @@ rctl = IXGB_READ_REG(hw, RCTL); - if (netdev->flags & IFF_PROMISC) { + if(netdev->flags & IFF_PROMISC) { rctl |= (IXGB_RCTL_UPE | IXGB_RCTL_MPE); - } else if (netdev->flags & IFF_ALLMULTI) { + } else if(netdev->flags & IFF_ALLMULTI) { rctl |= IXGB_RCTL_MPE; rctl &= ~IXGB_RCTL_UPE; } else { rctl &= ~(IXGB_RCTL_UPE | IXGB_RCTL_MPE); } - if (netdev->mc_count > IXGB_MAX_NUM_MULTICAST_ADDRESSES) { + if(netdev->mc_count > IXGB_MAX_NUM_MULTICAST_ADDRESSES) { rctl |= IXGB_RCTL_MPE; IXGB_WRITE_REG(hw, RCTL, rctl); } else { @@ -1045,10 +1074,10 @@ IXGB_WRITE_REG(hw, RCTL, rctl); - for (i = 0, mc_ptr = netdev->mc_list; mc_ptr; - i++, mc_ptr = mc_ptr->next) + for(i = 0, mc_ptr = netdev->mc_list; mc_ptr; + i++, mc_ptr = mc_ptr->next) memcpy(&mta[i * IXGB_ETH_LENGTH_OF_ADDRESS], - mc_ptr->dmi_addr, IXGB_ETH_LENGTH_OF_ADDRESS); + mc_ptr->dmi_addr, IXGB_ETH_LENGTH_OF_ADDRESS); ixgb_mc_addr_list_update(hw, mta, netdev->mc_count, 0); } @@ -1059,7 +1088,8 @@ * @data: pointer to netdev cast into an unsigned long **/ -static void ixgb_watchdog(unsigned long data) +static void +ixgb_watchdog(unsigned long data) { struct ixgb_adapter *adapter = (struct ixgb_adapter *)data; struct net_device *netdev = adapter->netdev; @@ -1073,21 +1103,22 @@ netif_stop_queue(netdev); } - if (adapter->hw.link_up) { - if (!netif_carrier_ok(netdev)) { + if(adapter->hw.link_up) { + if(!netif_carrier_ok(netdev)) { printk(KERN_INFO "ixgb: %s NIC Link is Up %d Mbps %s\n", - netdev->name, 10000, "Full Duplex"); + netdev->name, 10000, "Full Duplex"); adapter->link_speed = 10000; adapter->link_duplex = FULL_DUPLEX; netif_carrier_on(netdev); netif_wake_queue(netdev); } } else { - if (netif_carrier_ok(netdev)) { + if(netif_carrier_ok(netdev)) { adapter->link_speed = 0; adapter->link_duplex = 0; printk(KERN_INFO - "ixgb: %s NIC Link is Down\n", netdev->name); + "ixgb: %s NIC Link is Down\n", + netdev->name); netif_carrier_off(netdev); netif_stop_queue(netdev); @@ -1096,8 +1127,8 @@ ixgb_update_stats(adapter); - if (!netif_carrier_ok(netdev)) { - if (IXGB_DESC_UNUSED(txdr) + 1 < txdr->count) { + if(!netif_carrier_ok(netdev)) { + if(IXGB_DESC_UNUSED(txdr) + 1 < txdr->count) { /* We've lost link, so the controller stops DMA, * but we've got queued Tx work that's never going * to get done, so reset controller to flush Tx. @@ -1108,9 +1139,9 @@ /* Early detection of hung controller */ i = txdr->next_to_clean; - if (txdr->buffer_info[i].dma && - time_after(jiffies, txdr->buffer_info[i].time_stamp + HZ) && - !(IXGB_READ_REG(&adapter->hw, STATUS) & IXGB_STATUS_TXOFF)) + if(txdr->buffer_info[i].dma && + time_after(jiffies, txdr->buffer_info[i].time_stamp + HZ) && + !(IXGB_READ_REG(&adapter->hw, STATUS) & IXGB_STATUS_TXOFF)) netif_stop_queue(netdev); /* generate an interrupt to force clean up of any stragglers */ @@ -1133,7 +1164,7 @@ uint8_t ipcss, ipcso, tucss, tucso, hdr_len; uint16_t ipcse, tucse, mss; - if (likely(skb_shinfo(skb)->tso_size)) { + if(likely(skb_shinfo(skb)->tso_size)) { hdr_len = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2)); mss = skb_shinfo(skb)->tso_size; skb->nh.iph->tot_len = 0; @@ -1160,22 +1191,16 @@ context_desc->mss = cpu_to_le16(mss); context_desc->hdr_len = hdr_len; context_desc->status = 0; - context_desc->cmd_type_len = cpu_to_le32(IXGB_CONTEXT_DESC_TYPE - | - IXGB_CONTEXT_DESC_CMD_TSE - | - IXGB_CONTEXT_DESC_CMD_IP - | - IXGB_CONTEXT_DESC_CMD_TCP - | - IXGB_CONTEXT_DESC_CMD_RS - | - IXGB_CONTEXT_DESC_CMD_IDE - | (skb->len - - (hdr_len))); + context_desc->cmd_type_len = cpu_to_le32( + IXGB_CONTEXT_DESC_TYPE + | IXGB_CONTEXT_DESC_CMD_TSE + | IXGB_CONTEXT_DESC_CMD_IP + | IXGB_CONTEXT_DESC_CMD_TCP + | IXGB_CONTEXT_DESC_CMD_RS + | IXGB_CONTEXT_DESC_CMD_IDE + | (skb->len - (hdr_len))); - if (++i == adapter->tx_ring.count) - i = 0; + if(++i == adapter->tx_ring.count) i = 0; adapter->tx_ring.next_to_use = i; return TRUE; @@ -1192,7 +1217,7 @@ unsigned int i; uint8_t css, cso; - if (likely(skb->ip_summed == CHECKSUM_HW)) { + if(likely(skb->ip_summed == CHECKSUM_HW)) { css = skb->h.raw - skb->data; cso = (skb->h.raw + skb->csum) - skb->data; @@ -1203,16 +1228,16 @@ context_desc->tucso = cso; context_desc->tucse = 0; /* zero out any previously existing data in one instruction */ - *(uint32_t *) & (context_desc->ipcss) = 0; + *(uint32_t *)&(context_desc->ipcss) = 0; context_desc->status = 0; context_desc->hdr_len = 0; context_desc->mss = 0; context_desc->cmd_type_len = - cpu_to_le32(IXGB_CONTEXT_DESC_TYPE - | IXGB_TX_DESC_CMD_RS | IXGB_TX_DESC_CMD_IDE); + cpu_to_le32(IXGB_CONTEXT_DESC_TYPE + | IXGB_TX_DESC_CMD_RS + | IXGB_TX_DESC_CMD_IDE); - if (++i == adapter->tx_ring.count) - i = 0; + if(++i == adapter->tx_ring.count) i = 0; adapter->tx_ring.next_to_use = i; return TRUE; @@ -1239,45 +1264,46 @@ i = tx_ring->next_to_use; - while (len) { + while(len) { buffer_info = &tx_ring->buffer_info[i]; size = min(len, IXGB_MAX_JUMBO_FRAME_SIZE); buffer_info->length = size; buffer_info->dma = - pci_map_single(adapter->pdev, - skb->data + offset, size, PCI_DMA_TODEVICE); + pci_map_single(adapter->pdev, + skb->data + offset, + size, + PCI_DMA_TODEVICE); buffer_info->time_stamp = jiffies; len -= size; offset += size; count++; - if (++i == tx_ring->count) - i = 0; + if(++i == tx_ring->count) i = 0; } - for (f = 0; f < nr_frags; f++) { + for(f = 0; f < nr_frags; f++) { struct skb_frag_struct *frag; frag = &skb_shinfo(skb)->frags[f]; len = frag->size; offset = 0; - while (len) { + while(len) { buffer_info = &tx_ring->buffer_info[i]; size = min(len, IXGB_MAX_JUMBO_FRAME_SIZE); buffer_info->length = size; buffer_info->dma = - pci_map_page(adapter->pdev, - frag->page, - frag->page_offset + offset, - size, PCI_DMA_TODEVICE); + pci_map_page(adapter->pdev, + frag->page, + frag->page_offset + offset, + size, + PCI_DMA_TODEVICE); buffer_info->time_stamp = jiffies; len -= size; offset += size; count++; - if (++i == tx_ring->count) - i = 0; + if(++i == tx_ring->count) i = 0; } } i = (i == 0) ? tx_ring->count - 1 : i - 1; @@ -1288,8 +1314,7 @@ } static inline void -ixgb_tx_queue(struct ixgb_adapter *adapter, int count, int vlan_id, - int tx_flags) +ixgb_tx_queue(struct ixgb_adapter *adapter, int count, int vlan_id,int tx_flags) { struct ixgb_desc_ring *tx_ring = &adapter->tx_ring; struct ixgb_tx_desc *tx_desc = NULL; @@ -1299,36 +1324,35 @@ uint8_t popts = 0; unsigned int i; - if (tx_flags & IXGB_TX_FLAGS_TSO) { + if(tx_flags & IXGB_TX_FLAGS_TSO) { cmd_type_len |= IXGB_TX_DESC_CMD_TSE; popts |= (IXGB_TX_DESC_POPTS_IXSM | IXGB_TX_DESC_POPTS_TXSM); } - if (tx_flags & IXGB_TX_FLAGS_CSUM) + if(tx_flags & IXGB_TX_FLAGS_CSUM) popts |= IXGB_TX_DESC_POPTS_TXSM; - if (tx_flags & IXGB_TX_FLAGS_VLAN) { + if(tx_flags & IXGB_TX_FLAGS_VLAN) { cmd_type_len |= IXGB_TX_DESC_CMD_VLE; } i = tx_ring->next_to_use; - while (count--) { + while(count--) { buffer_info = &tx_ring->buffer_info[i]; tx_desc = IXGB_TX_DESC(*tx_ring, i); tx_desc->buff_addr = cpu_to_le64(buffer_info->dma); tx_desc->cmd_type_len = - cpu_to_le32(cmd_type_len | buffer_info->length); + cpu_to_le32(cmd_type_len | buffer_info->length); tx_desc->status = status; tx_desc->popts = popts; tx_desc->vlan = cpu_to_le16(vlan_id); - if (++i == tx_ring->count) - i = 0; + if(++i == tx_ring->count) i = 0; } - tx_desc->cmd_type_len |= cpu_to_le32(IXGB_TX_DESC_CMD_EOP - | IXGB_TX_DESC_CMD_RS); + tx_desc->cmd_type_len |= cpu_to_le32(IXGB_TX_DESC_CMD_EOP + | IXGB_TX_DESC_CMD_RS ); /* Force memory writes to complete before letting h/w * know there are new descriptors to fetch. (Only @@ -1346,7 +1370,8 @@ #define DESC_NEEDED TXD_USE_COUNT(IXGB_MAX_DATA_PER_TXD) + \ MAX_SKB_FRAGS * TXD_USE_COUNT(PAGE_SIZE) + 1 -static int ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) +static int +ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev) { struct ixgb_adapter *adapter = netdev->priv; unsigned int first; @@ -1354,33 +1379,33 @@ unsigned long flags; int vlan_id = 0; - if (skb->len <= 0) { + if(skb->len <= 0) { dev_kfree_skb_any(skb); return 0; } spin_lock_irqsave(&adapter->tx_lock, flags); - if (unlikely(IXGB_DESC_UNUSED(&adapter->tx_ring) < DESC_NEEDED)) { + if(unlikely(IXGB_DESC_UNUSED(&adapter->tx_ring) < DESC_NEEDED)) { netif_stop_queue(netdev); spin_unlock_irqrestore(&adapter->tx_lock, flags); return 1; } spin_unlock_irqrestore(&adapter->tx_lock, flags); - if (adapter->vlgrp && vlan_tx_tag_present(skb)) { + if(adapter->vlgrp && vlan_tx_tag_present(skb)) { tx_flags |= IXGB_TX_FLAGS_VLAN; vlan_id = vlan_tx_tag_get(skb); } first = adapter->tx_ring.next_to_use; - - if (ixgb_tso(adapter, skb)) + + if(ixgb_tso(adapter, skb)) tx_flags |= IXGB_TX_FLAGS_TSO; - else if (ixgb_tx_csum(adapter, skb)) + else if(ixgb_tx_csum(adapter, skb)) tx_flags |= IXGB_TX_FLAGS_CSUM; ixgb_tx_queue(adapter, ixgb_tx_map(adapter, skb, first), vlan_id, - tx_flags); + tx_flags); netdev->trans_start = jiffies; @@ -1392,7 +1417,8 @@ * @netdev: network interface device structure **/ -static void ixgb_tx_timeout(struct net_device *netdev) +static void +ixgb_tx_timeout(struct net_device *netdev) { struct ixgb_adapter *adapter = netdev->priv; @@ -1400,14 +1426,13 @@ schedule_work(&adapter->tx_timeout_task); } -static void ixgb_tx_timeout_task(struct net_device *netdev) +static void +ixgb_tx_timeout_task(struct net_device *netdev) { struct ixgb_adapter *adapter = netdev->priv; - netif_device_detach(netdev); ixgb_down(adapter, TRUE); ixgb_up(adapter); - netif_device_attach(netdev); } /** @@ -1418,7 +1443,8 @@ * The statistics are actually updated from the timer callback. **/ -static struct net_device_stats *ixgb_get_stats(struct net_device *netdev) +static struct net_device_stats * +ixgb_get_stats(struct net_device *netdev) { struct ixgb_adapter *adapter = netdev->priv; @@ -1433,27 +1459,28 @@ * Returns 0 on success, negative on failure **/ -static int ixgb_change_mtu(struct net_device *netdev, int new_mtu) +static int +ixgb_change_mtu(struct net_device *netdev, int new_mtu) { struct ixgb_adapter *adapter = netdev->priv; - uint32_t old_mtu = adapter->rx_buffer_len; int max_frame = new_mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH; + int old_max_frame = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH; + - if ((max_frame < IXGB_MIN_ENET_FRAME_SIZE_WITHOUT_FCS + ENET_FCS_LENGTH) - || (max_frame > IXGB_MAX_JUMBO_FRAME_SIZE + ENET_FCS_LENGTH)) { + if((max_frame < IXGB_MIN_ENET_FRAME_SIZE_WITHOUT_FCS + ENET_FCS_LENGTH) + || (max_frame > IXGB_MAX_JUMBO_FRAME_SIZE + ENET_FCS_LENGTH)) { IXGB_ERR("Invalid MTU setting\n"); return -EINVAL; } - if ((max_frame <= - IXGB_MAX_ENET_FRAME_SIZE_WITHOUT_FCS + ENET_FCS_LENGTH) - || (max_frame <= IXGB_RXBUFFER_2048)) { + if((max_frame <= IXGB_MAX_ENET_FRAME_SIZE_WITHOUT_FCS + ENET_FCS_LENGTH) + || (max_frame <= IXGB_RXBUFFER_2048)) { adapter->rx_buffer_len = IXGB_RXBUFFER_2048; - } else if (max_frame <= IXGB_RXBUFFER_4096) { + } else if(max_frame <= IXGB_RXBUFFER_4096) { adapter->rx_buffer_len = IXGB_RXBUFFER_4096; - } else if (max_frame <= IXGB_RXBUFFER_8192) { + } else if(max_frame <= IXGB_RXBUFFER_8192) { adapter->rx_buffer_len = IXGB_RXBUFFER_8192; } else { @@ -1462,7 +1489,7 @@ netdev->mtu = new_mtu; - if (old_mtu != adapter->rx_buffer_len && netif_running(netdev)) { + if(old_max_frame != max_frame && netif_running(netdev)) { ixgb_down(adapter, TRUE); ixgb_up(adapter); @@ -1476,7 +1503,8 @@ * @adapter: board private structure **/ -static void ixgb_update_stats(struct ixgb_adapter *adapter) +void +ixgb_update_stats(struct ixgb_adapter *adapter) { adapter->stats.tprl += IXGB_READ_REG(&adapter->hw, TPRL); adapter->stats.tprh += IXGB_READ_REG(&adapter->hw, TPRH); @@ -1585,31 +1613,33 @@ * @pt_regs: CPU registers structure **/ -static irqreturn_t ixgb_intr(int irq, void *data, struct pt_regs *regs) +static irqreturn_t +ixgb_intr(int irq, void *data, struct pt_regs *regs) { struct net_device *netdev = data; struct ixgb_adapter *adapter = netdev->priv; struct ixgb_hw *hw = &adapter->hw; - uint32_t icr = IXGB_READ_REG(&adapter->hw, ICR); + uint32_t icr = IXGB_READ_REG(hw, ICR); #ifndef CONFIG_IXGB_NAPI unsigned int i; #endif - if (unlikely(!icr)) - return IRQ_NONE; /* Not our interrupt */ + if(unlikely(!icr)) + return IRQ_NONE; /* Not our interrupt */ - if (unlikely(icr & (IXGB_INT_RXSEQ | IXGB_INT_LSC))) { + if(unlikely(icr & (IXGB_INT_RXSEQ | IXGB_INT_LSC))) { mod_timer(&adapter->watchdog_timer, jiffies); } + #ifdef CONFIG_IXGB_NAPI - if (netif_rx_schedule_prep(netdev)) { + if(netif_rx_schedule_prep(netdev)) { /* Disable interrupts and register for poll. The flush - of the posted write is intentionally left out. - */ + of the posted write is intentionally left out. + */ atomic_inc(&adapter->irq_sem); - IXGB_WRITE_REG(hw, IMC, ~0); + IXGB_WRITE_REG(&adapter->hw, IMC, ~0); __netif_rx_schedule(netdev); } #else @@ -1621,16 +1651,7 @@ if(!ixgb_clean_rx_irq(adapter) & !ixgb_clean_tx_irq(adapter)) break; - /* if RAIDC:EN == 1 and ICR:RXDMT0 == 1, we need to - * set IMS:RXDMT0 to 1 to restart the RBD timer (POLL) - */ - if ((icr & IXGB_INT_RXDMT0) && adapter->raidc) { - /* ready the timer by writing the clear reg */ - IXGB_WRITE_REG(hw, IMC, IXGB_INT_RXDMT0); - /* now restart it, h/w will decide if its necessary */ - IXGB_WRITE_REG(hw, IMS, IXGB_INT_RXDMT0); - } -#endif +#endif return IRQ_HANDLED; } @@ -1640,25 +1661,32 @@ * @adapter: board private structure **/ -static int ixgb_clean(struct net_device *netdev, int *budget) +static int +ixgb_clean(struct net_device *netdev, int *budget) { struct ixgb_adapter *adapter = netdev->priv; int work_to_do = min(*budget, netdev->quota); + int tx_cleaned; int work_done = 0; + + if (!netif_carrier_ok(netdev)) + goto quit_polling; - ixgb_clean_tx_irq(adapter); + tx_cleaned = ixgb_clean_tx_irq(adapter); ixgb_clean_rx_irq(adapter, &work_done, work_to_do); *budget -= work_done; netdev->quota -= work_done; - - if (work_done < work_to_do || !netif_running(netdev)) { - netif_rx_complete(netdev); - /* RAIDC will be automatically restarted by irq_enable */ + + /* if no Tx cleanup and not enough Rx work done, exit the polling mode */ + if((!tx_cleaned && (work_done < work_to_do)) || + !netif_running(netdev)) { +quit_polling: netif_rx_complete(netdev); ixgb_irq_enable(adapter); + return 0; } - return (work_done >= work_to_do); + return 1; } #endif @@ -1667,11 +1695,11 @@ * @adapter: board private structure **/ -static boolean_t ixgb_clean_tx_irq(struct ixgb_adapter *adapter) +static boolean_t +ixgb_clean_tx_irq(struct ixgb_adapter *adapter) { struct ixgb_desc_ring *tx_ring = &adapter->tx_ring; struct net_device *netdev = adapter->netdev; - struct pci_dev *pdev = adapter->pdev; struct ixgb_tx_desc *tx_desc, *eop_desc; struct ixgb_buffer *buffer_info; unsigned int i, eop; @@ -1681,9 +1709,9 @@ eop = tx_ring->buffer_info[i].next_to_watch; eop_desc = IXGB_TX_DESC(*tx_ring, eop); - while (eop_desc->status & IXGB_TX_DESC_STATUS_DD) { + while(eop_desc->status & IXGB_TX_DESC_STATUS_DD) { - for (cleaned = FALSE; !cleaned;) { + for(cleaned = FALSE; !cleaned; ) { tx_desc = IXGB_TX_DESC(*tx_ring, i); buffer_info = &tx_ring->buffer_info[i]; @@ -1692,28 +1720,12 @@ IXGB_TX_DESC_POPTS_IXSM)) adapter->hw_csum_tx_good++; - if (buffer_info->dma) { - - pci_unmap_page(pdev, - buffer_info->dma, - buffer_info->length, - PCI_DMA_TODEVICE); - - buffer_info->dma = 0; - } - - if (buffer_info->skb) { - - dev_kfree_skb_any(buffer_info->skb); + ixgb_unmap_and_free_tx_resource(adapter, buffer_info); - buffer_info->skb = NULL; - } - - *(uint32_t *) & (tx_desc->status) = 0; + *(uint32_t *)&(tx_desc->status) = 0; cleaned = (i == eop); - if (++i == tx_ring->count) - i = 0; + if(++i == tx_ring->count) i = 0; } eop = tx_ring->buffer_info[i].next_to_watch; @@ -1723,8 +1735,8 @@ tx_ring->next_to_clean = i; spin_lock(&adapter->tx_lock); - if (cleaned && netif_queue_stopped(netdev) && netif_carrier_ok(netdev) - && (IXGB_DESC_UNUSED(tx_ring) > IXGB_TX_QUEUE_WAKE)) { + if(cleaned && netif_queue_stopped(netdev) && netif_carrier_ok(netdev) && + (IXGB_DESC_UNUSED(tx_ring) > IXGB_TX_QUEUE_WAKE)) { netif_wake_queue(netdev); } @@ -1742,20 +1754,21 @@ static inline void ixgb_rx_checksum(struct ixgb_adapter *adapter, - struct ixgb_rx_desc *rx_desc, struct sk_buff *skb) + struct ixgb_rx_desc *rx_desc, + struct sk_buff *skb) { /* Ignore Checksum bit is set OR * TCP Checksum has not been calculated */ - if ((rx_desc->status & IXGB_RX_DESC_STATUS_IXSM) || - (!(rx_desc->status & IXGB_RX_DESC_STATUS_TCPCS))) { + if((rx_desc->status & IXGB_RX_DESC_STATUS_IXSM) || + (!(rx_desc->status & IXGB_RX_DESC_STATUS_TCPCS))) { skb->ip_summed = CHECKSUM_NONE; return; } /* At this point we know the hardware did the TCP checksum */ /* now look at the TCP checksum error bit */ - if (rx_desc->errors & IXGB_RX_DESC_ERRORS_TCPE) { + if(rx_desc->errors & IXGB_RX_DESC_ERRORS_TCPE) { /* let the stack verify checksum errors */ skb->ip_summed = CHECKSUM_NONE; adapter->hw_csum_rx_error++; @@ -1792,18 +1805,22 @@ rx_desc = IXGB_RX_DESC(*rx_ring, i); buffer_info = &rx_ring->buffer_info[i]; - while (rx_desc->status & IXGB_RX_DESC_STATUS_DD) { + while(rx_desc->status & IXGB_RX_DESC_STATUS_DD) { +#ifdef CONFIG_IXGB_NAPI + if(*work_done >= work_to_do) + break; + + (*work_done)++; +#endif skb = buffer_info->skb; prefetch(skb->data); - if (++i == rx_ring->count) - i = 0; + if(++i == rx_ring->count) i = 0; next_rxd = IXGB_RX_DESC(*rx_ring, i); prefetch(next_rxd); - if ((j = i + 1) == rx_ring->count) - j = 0; + if((j = i + 1) == rx_ring->count) j = 0; next2_buffer = &rx_ring->buffer_info[j]; prefetch(next2_buffer); @@ -1811,27 +1828,22 @@ next_skb = next_buffer->skb; prefetch(next_skb); -#ifdef CONFIG_IXGB_NAPI - if (*work_done >= work_to_do) - break; - - (*work_done)++; -#endif cleaned = TRUE; pci_unmap_single(pdev, buffer_info->dma, - buffer_info->length, PCI_DMA_FROMDEVICE); + buffer_info->length, + PCI_DMA_FROMDEVICE); length = le16_to_cpu(rx_desc->length); - if (unlikely(!(rx_desc->status & IXGB_RX_DESC_STATUS_EOP))) { + if(unlikely(!(rx_desc->status & IXGB_RX_DESC_STATUS_EOP))) { /* All receives must fit into a single buffer */ IXGB_DBG("Receive packet consumed multiple buffers " - "length<%x>\n", length); + "length<%x>\n", length); dev_kfree_skb_irq(skb); rx_desc->status = 0; @@ -1864,26 +1876,22 @@ skb->protocol = eth_type_trans(skb, netdev); #ifdef CONFIG_IXGB_NAPI - if (adapter->vlgrp - && (rx_desc->status & IXGB_RX_DESC_STATUS_VP)) { + if(adapter->vlgrp && (rx_desc->status & IXGB_RX_DESC_STATUS_VP)) { vlan_hwaccel_receive_skb(skb, adapter->vlgrp, - le16_to_cpu(rx_desc-> - special & - IXGB_RX_DESC_SPECIAL_VLAN_MASK)); + le16_to_cpu(rx_desc->special) & + IXGB_RX_DESC_SPECIAL_VLAN_MASK); } else { netif_receive_skb(skb); } -#else /* CONFIG_IXGB_NAPI */ - if (adapter->vlgrp - && (rx_desc->status & IXGB_RX_DESC_STATUS_VP)) { +#else /* CONFIG_IXGB_NAPI */ + if(adapter->vlgrp && (rx_desc->status & IXGB_RX_DESC_STATUS_VP)) { vlan_hwaccel_rx(skb, adapter->vlgrp, - le16_to_cpu(rx_desc-> - special & - IXGB_RX_DESC_SPECIAL_VLAN_MASK)); + le16_to_cpu(rx_desc->special) & + IXGB_RX_DESC_SPECIAL_VLAN_MASK); } else { netif_rx(skb); } -#endif /* CONFIG_IXGB_NAPI */ +#endif /* CONFIG_IXGB_NAPI */ netdev->last_rx = jiffies; rx_desc->status = 0; @@ -1905,7 +1913,8 @@ * @adapter: address of board private structure **/ -static void ixgb_alloc_rx_buffers(struct ixgb_adapter *adapter) +static void +ixgb_alloc_rx_buffers(struct ixgb_adapter *adapter) { struct ixgb_desc_ring *rx_ring = &adapter->rx_ring; struct net_device *netdev = adapter->netdev; @@ -1921,19 +1930,15 @@ buffer_info = &rx_ring->buffer_info[i]; cleancount = IXGB_DESC_UNUSED(rx_ring); - /* lessen this to 4 if we're - * in the midst of raidc and rbd is occuring - * because we don't want to delay returning buffers when low - */ - num_group_tail_writes = adapter->raidc ? 4 : IXGB_RX_BUFFER_WRITE; + num_group_tail_writes = IXGB_RX_BUFFER_WRITE; /* leave one descriptor unused */ - while (--cleancount > 0) { + while(--cleancount > 0) { rx_desc = IXGB_RX_DESC(*rx_ring, i); skb = dev_alloc_skb(adapter->rx_buffer_len + NET_IP_ALIGN); - if (unlikely(!skb)) { + if(unlikely(!skb)) { /* Better luck next round */ break; } @@ -1949,13 +1954,14 @@ buffer_info->skb = skb; buffer_info->length = adapter->rx_buffer_len; buffer_info->dma = - pci_map_single(pdev, + pci_map_single(pdev, skb->data, - adapter->rx_buffer_len, PCI_DMA_FROMDEVICE); + adapter->rx_buffer_len, + PCI_DMA_FROMDEVICE); rx_desc->buff_addr = cpu_to_le64(buffer_info->dma); - if ((i & ~(num_group_tail_writes - 1)) == i) { + if((i & ~(num_group_tail_writes- 1)) == i) { /* Force memory writes to complete before letting h/w * know there are new descriptors to fetch. (Only * applicable for weak-ordered memory model archs, @@ -1965,8 +1971,7 @@ IXGB_WRITE_REG(&adapter->hw, RDT, i); } - if (++i == rx_ring->count) - i = 0; + if(++i == rx_ring->count) i = 0; buffer_info = &rx_ring->buffer_info[i]; } @@ -1988,7 +1993,7 @@ ixgb_irq_disable(adapter); adapter->vlgrp = grp; - if (grp) { + if(grp) { /* enable VLAN tag insert/strip */ ctrl = IXGB_READ_REG(&adapter->hw, CTRL0); ctrl |= IXGB_CTRL0_VME; @@ -2017,7 +2022,8 @@ ixgb_irq_enable(adapter); } -static void ixgb_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid) +static void +ixgb_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid) { struct ixgb_adapter *adapter = netdev->priv; uint32_t vfta, index; @@ -2030,19 +2036,20 @@ ixgb_write_vfta(&adapter->hw, index, vfta); } -static void ixgb_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid) +static void +ixgb_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid) { struct ixgb_adapter *adapter = netdev->priv; uint32_t vfta, index; ixgb_irq_disable(adapter); - if (adapter->vlgrp) + if(adapter->vlgrp) adapter->vlgrp->vlan_devices[vid] = NULL; ixgb_irq_enable(adapter); - /* remove VID from filter table */ + /* remove VID from filter table*/ index = (vid >> 5) & 0x7F; vfta = IXGB_READ_REG_ARRAY(&adapter->hw, VFTA, index); @@ -2050,14 +2057,15 @@ ixgb_write_vfta(&adapter->hw, index, vfta); } -static void ixgb_restore_vlan(struct ixgb_adapter *adapter) +static void +ixgb_restore_vlan(struct ixgb_adapter *adapter) { ixgb_vlan_rx_register(adapter->netdev, adapter->vlgrp); - if (adapter->vlgrp) { + if(adapter->vlgrp) { uint16_t vid; - for (vid = 0; vid < VLAN_GROUP_ARRAY_LEN; vid++) { - if (!adapter->vlgrp->vlan_devices[vid]) + for(vid = 0; vid < VLAN_GROUP_ARRAY_LEN; vid++) { + if(!adapter->vlgrp->vlan_devices[vid]) continue; ixgb_vlan_rx_add_vid(adapter->netdev, vid); } @@ -2075,7 +2083,7 @@ { struct pci_dev *pdev = NULL; - switch (event) { + switch(event) { case SYS_DOWN: case SYS_HALT: case SYS_POWER_OFF: @@ -2092,14 +2100,15 @@ * @param pdev pci driver structure used for passing to * @param state power state to enter **/ -static int ixgb_suspend(struct pci_dev *pdev, uint32_t state) +static int +ixgb_suspend(struct pci_dev *pdev, uint32_t state) { struct net_device *netdev = pci_get_drvdata(pdev); struct ixgb_adapter *adapter = netdev->priv; netif_device_detach(netdev); - if (netif_running(netdev)) + if(netif_running(netdev)) ixgb_down(adapter, TRUE); pci_save_state(pdev); diff -Nru a/drivers/net/ixgb/ixgb_osdep.h b/drivers/net/ixgb/ixgb_osdep.h --- a/drivers/net/ixgb/ixgb_osdep.h 2005-01-12 01:33:23 -05:00 +++ b/drivers/net/ixgb/ixgb_osdep.h 2005-01-12 01:33:23 -05:00 @@ -78,19 +78,19 @@ #define DEBUGOUT7 DEBUGOUT3 #define IXGB_WRITE_REG(a, reg, value) ( \ - writel((value), ((a)->hw_addr + IXGB_##reg))) + writel((value), ((a)->hw_addr + IXGB_##reg))) #define IXGB_READ_REG(a, reg) ( \ - readl((a)->hw_addr + IXGB_##reg)) + readl((a)->hw_addr + IXGB_##reg)) #define IXGB_WRITE_REG_ARRAY(a, reg, offset, value) ( \ - writel((value), ((a)->hw_addr + IXGB_##reg + ((offset) << 2)))) + writel((value), ((a)->hw_addr + IXGB_##reg + ((offset) << 2)))) #define IXGB_READ_REG_ARRAY(a, reg, offset) ( \ - readl((a)->hw_addr + IXGB_##reg + ((offset) << 2))) + readl((a)->hw_addr + IXGB_##reg + ((offset) << 2))) #define IXGB_WRITE_FLUSH(a) IXGB_READ_REG(a, STATUS) #define IXGB_MEMCPY memcpy -#endif /* _IXGB_OSDEP_H_ */ +#endif /* _IXGB_OSDEP_H_ */ diff -Nru a/drivers/net/ixgb/ixgb_param.c b/drivers/net/ixgb/ixgb_param.c --- a/drivers/net/ixgb/ixgb_param.c 2005-01-12 01:33:23 -05:00 +++ b/drivers/net/ixgb/ixgb_param.c 2005-01-12 01:33:23 -05:00 @@ -34,31 +34,21 @@ #define IXGB_MAX_NIC 8 -#define OPTION_UNSET -1 +#define OPTION_UNSET -1 #define OPTION_DISABLED 0 #define OPTION_ENABLED 1 -/* Module Parameters are always initialized to -1, so that the driver - * can tell the difference between no user specified value or the - * user asking for the default value. - * The true default values are loaded in when ixgb_check_options is called. - * - * This is a GCC extension to ANSI C. - * See the item "Labeled Elements in Initializers" in the section - * "Extensions to the C Language Family" of the GCC documentation. - */ - -#define IXGB_PARAM_INIT { [0 ... IXGB_MAX_NIC] = OPTION_UNSET } - /* All parameters are treated the same, as an integer array of values. * This macro just reduces the need to repeat the same declaration code * over and over (plus this helps to avoid typo bugs). */ -#define IXGB_PARAM(X, S) \ -static int __devinitdata X[IXGB_MAX_NIC + 1] = IXGB_PARAM_INIT; \ -module_param_array(X, int, NULL, 0); \ -MODULE_PARM_DESC(X, S); +#define IXGB_PARAM_INIT { [0 ... IXGB_MAX_NIC] = OPTION_UNSET } +#define IXGB_PARAM(X, desc) \ + static int __devinitdata X[IXGB_MAX_NIC+1] = IXGB_PARAM_INIT; \ + static int num_##X = 0; \ + module_param_array_named(X, X, int, &num_##X, 0); \ + MODULE_PARM_DESC(X, desc); /* Transmit Descriptor Count * @@ -121,15 +111,6 @@ IXGB_PARAM(RxIntDelay, "Receive Interrupt Delay"); -/* Receive Interrupt Moderation enable (uses RxIntDelay too) - * - * Valid Range: 0,1 - * - * Default Value: 1 - */ - -IXGB_PARAM(RAIDC, "Disable or enable Receive Interrupt Moderation"); - /* Receive Flow control high threshold (when we send a pause frame) * (FCRTH) * @@ -173,13 +154,6 @@ IXGB_PARAM(IntDelayEnable, "Transmit Interrupt Delay Enable"); -#define DEFAULT_TXD 256 -#define MAX_TXD 4096 -#define MIN_TXD 64 - -#define DEFAULT_RXD 1024 -#define MAX_RXD 4096 -#define MIN_RXD 64 #define DEFAULT_TIDV 32 #define MAX_TIDV 0xFFFF @@ -224,9 +198,10 @@ } arg; }; -static int __devinit ixgb_validate_option(int *value, struct ixgb_option *opt) +static int __devinit +ixgb_validate_option(int *value, struct ixgb_option *opt) { - if (*value == OPTION_UNSET) { + if(*value == OPTION_UNSET) { *value = opt->def; return 0; } @@ -243,32 +218,31 @@ } break; case range_option: - if (*value >= opt->arg.r.min && *value <= opt->arg.r.max) { + if(*value >= opt->arg.r.min && *value <= opt->arg.r.max) { printk(KERN_INFO "%s set to %i\n", opt->name, *value); return 0; } break; - case list_option:{ - int i; - struct ixgb_opt_list *ent; - - for (i = 0; i < opt->arg.l.nr; i++) { - ent = &opt->arg.l.p[i]; - if (*value == ent->i) { - if (ent->str[0] != '\0') - printk(KERN_INFO "%s\n", - ent->str); - return 0; - } + case list_option: { + int i; + struct ixgb_opt_list *ent; + + for(i = 0; i < opt->arg.l.nr; i++) { + ent = &opt->arg.l.p[i]; + if(*value == ent->i) { + if(ent->str[0] != '\0') + printk(KERN_INFO "%s\n", ent->str); + return 0; } } + } break; default: BUG(); } printk(KERN_INFO "Invalid %s specified (%i) %s\n", - opt->name, *value, opt->err); + opt->name, *value, opt->err); *value = opt->def; return -1; } @@ -285,198 +259,218 @@ * in a variable in the adapter structure. **/ -void __devinit ixgb_check_options(struct ixgb_adapter *adapter) +void __devinit +ixgb_check_options(struct ixgb_adapter *adapter) { int bd = adapter->bd_number; - if (bd >= IXGB_MAX_NIC) { + if(bd >= IXGB_MAX_NIC) { printk(KERN_NOTICE - "Warning: no configuration for board #%i\n", bd); + "Warning: no configuration for board #%i\n", bd); printk(KERN_NOTICE "Using defaults for all values\n"); - bd = IXGB_MAX_NIC; } - { /* Transmit Descriptor Count */ + { /* Transmit Descriptor Count */ struct ixgb_option opt = { .type = range_option, .name = "Transmit Descriptors", - .err = "using default of " __MODULE_STRING(DEFAULT_TXD), - .def = DEFAULT_TXD, - .arg = {.r = {.min = MIN_TXD, - .max = MAX_TXD}} + .err = "using default of " __MODULE_STRING(DEFAULT_TXD), + .def = DEFAULT_TXD, + .arg = { .r = { .min = MIN_TXD, + .max = MAX_TXD}} }; struct ixgb_desc_ring *tx_ring = &adapter->tx_ring; - tx_ring->count = TxDescriptors[bd]; - ixgb_validate_option(&tx_ring->count, &opt); + if(num_TxDescriptors > bd) { + tx_ring->count = TxDescriptors[bd]; + ixgb_validate_option(&tx_ring->count, &opt); + } else { + tx_ring->count = opt.def; + } IXGB_ROUNDUP(tx_ring->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE); } - { /* Receive Descriptor Count */ + { /* Receive Descriptor Count */ struct ixgb_option opt = { .type = range_option, .name = "Receive Descriptors", - .err = "using default of " __MODULE_STRING(DEFAULT_RXD), - .def = DEFAULT_RXD, - .arg = {.r = {.min = MIN_RXD, - .max = MAX_RXD}} + .err = "using default of " __MODULE_STRING(DEFAULT_RXD), + .def = DEFAULT_RXD, + .arg = { .r = { .min = MIN_RXD, + .max = MAX_RXD}} }; struct ixgb_desc_ring *rx_ring = &adapter->rx_ring; - rx_ring->count = RxDescriptors[bd]; - ixgb_validate_option(&rx_ring->count, &opt); + if(num_RxDescriptors > bd) { + rx_ring->count = RxDescriptors[bd]; + ixgb_validate_option(&rx_ring->count, &opt); + } else { + rx_ring->count = opt.def; + } IXGB_ROUNDUP(rx_ring->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE); } - { /* Receive Checksum Offload Enable */ + { /* Receive Checksum Offload Enable */ struct ixgb_option opt = { .type = enable_option, .name = "Receive Checksum Offload", - .err = "defaulting to Enabled", - .def = OPTION_ENABLED + .err = "defaulting to Enabled", + .def = OPTION_ENABLED }; - int rx_csum = XsumRX[bd]; - ixgb_validate_option(&rx_csum, &opt); - adapter->rx_csum = rx_csum; + if(num_XsumRX > bd) { + int rx_csum = XsumRX[bd]; + ixgb_validate_option(&rx_csum, &opt); + adapter->rx_csum = rx_csum; + } else { + adapter->rx_csum = opt.def; + } } - { /* Flow Control */ + { /* Flow Control */ struct ixgb_opt_list fc_list[] = - { {ixgb_fc_none, "Flow Control Disabled"}, - {ixgb_fc_rx_pause, "Flow Control Receive Only"}, - {ixgb_fc_tx_pause, "Flow Control Transmit Only"}, - {ixgb_fc_full, "Flow Control Enabled"}, - {ixgb_fc_default, "Flow Control Hardware Default"} - }; + {{ ixgb_fc_none, "Flow Control Disabled" }, + { ixgb_fc_rx_pause,"Flow Control Receive Only" }, + { ixgb_fc_tx_pause,"Flow Control Transmit Only" }, + { ixgb_fc_full, "Flow Control Enabled" }, + { ixgb_fc_default, "Flow Control Hardware Default" }}; struct ixgb_option opt = { .type = list_option, .name = "Flow Control", - .err = "reading default settings from EEPROM", - .def = ixgb_fc_full, - .arg = {.l = {.nr = LIST_LEN(fc_list), - .p = fc_list}} + .err = "reading default settings from EEPROM", + .def = ixgb_fc_full, + .arg = { .l = { .nr = LIST_LEN(fc_list), + .p = fc_list }} }; - int fc = FlowControl[bd]; - ixgb_validate_option(&fc, &opt); - adapter->hw.fc.type = fc; + if(num_FlowControl > bd) { + int fc = FlowControl[bd]; + ixgb_validate_option(&fc, &opt); + adapter->hw.fc.type = fc; + } else { + adapter->hw.fc.type = opt.def; + } } - { /* Receive Flow Control High Threshold */ + { /* Receive Flow Control High Threshold */ struct ixgb_option opt = { .type = range_option, .name = "Rx Flow Control High Threshold", - .err = - "using default of " __MODULE_STRING(DEFAULT_FCRTH), - .def = DEFAULT_FCRTH, - .arg = {.r = {.min = MIN_FCRTH, - .max = MAX_FCRTH}} + .err = "using default of " __MODULE_STRING(DEFAULT_FCRTH), + .def = DEFAULT_FCRTH, + .arg = { .r = { .min = MIN_FCRTH, + .max = MAX_FCRTH}} }; - adapter->hw.fc.high_water = RxFCHighThresh[bd]; - ixgb_validate_option(&adapter->hw.fc.high_water, &opt); - if (!(adapter->hw.fc.type & ixgb_fc_rx_pause)) - printk(KERN_INFO - "Ignoring RxFCHighThresh when no RxFC\n"); + if(num_RxFCHighThresh > bd) { + adapter->hw.fc.high_water = RxFCHighThresh[bd]; + ixgb_validate_option(&adapter->hw.fc.high_water, &opt); + } else { + adapter->hw.fc.high_water = opt.def; + } + if(!(adapter->hw.fc.type & ixgb_fc_rx_pause) ) + printk (KERN_INFO + "Ignoring RxFCHighThresh when no RxFC\n"); } - { /* Receive Flow Control Low Threshold */ + { /* Receive Flow Control Low Threshold */ struct ixgb_option opt = { .type = range_option, .name = "Rx Flow Control Low Threshold", - .err = - "using default of " __MODULE_STRING(DEFAULT_FCRTL), - .def = DEFAULT_FCRTL, - .arg = {.r = {.min = MIN_FCRTL, - .max = MAX_FCRTL}} + .err = "using default of " __MODULE_STRING(DEFAULT_FCRTL), + .def = DEFAULT_FCRTL, + .arg = { .r = { .min = MIN_FCRTL, + .max = MAX_FCRTL}} }; - adapter->hw.fc.low_water = RxFCLowThresh[bd]; - ixgb_validate_option(&adapter->hw.fc.low_water, &opt); - if (!(adapter->hw.fc.type & ixgb_fc_rx_pause)) - printk(KERN_INFO - "Ignoring RxFCLowThresh when no RxFC\n"); + if(num_RxFCLowThresh > bd) { + adapter->hw.fc.low_water = RxFCLowThresh[bd]; + ixgb_validate_option(&adapter->hw.fc.low_water, &opt); + } else { + adapter->hw.fc.low_water = opt.def; + } + if(!(adapter->hw.fc.type & ixgb_fc_rx_pause) ) + printk (KERN_INFO + "Ignoring RxFCLowThresh when no RxFC\n"); } - { /* Flow Control Pause Time Request */ + { /* Flow Control Pause Time Request*/ struct ixgb_option opt = { .type = range_option, .name = "Flow Control Pause Time Request", - .err = - "using default of " - __MODULE_STRING(DEFAULT_FCPAUSE), - .def = DEFAULT_FCPAUSE, - .arg = {.r = {.min = MIN_FCPAUSE, - .max = MAX_FCPAUSE}} + .err = "using default of "__MODULE_STRING(DEFAULT_FCPAUSE), + .def = DEFAULT_FCPAUSE, + .arg = { .r = { .min = MIN_FCPAUSE, + .max = MAX_FCPAUSE}} }; - int pause_time = FCReqTimeout[bd]; - - ixgb_validate_option(&pause_time, &opt); - if (!(adapter->hw.fc.type & ixgb_fc_rx_pause)) - printk(KERN_INFO - "Ignoring FCReqTimeout when no RxFC\n"); - adapter->hw.fc.pause_time = pause_time; + if(num_FCReqTimeout > bd) { + int pause_time = FCReqTimeout[bd]; + ixgb_validate_option(&pause_time, &opt); + adapter->hw.fc.pause_time = pause_time; + } else { + adapter->hw.fc.pause_time = opt.def; + } + if(!(adapter->hw.fc.type & ixgb_fc_rx_pause) ) + printk (KERN_INFO + "Ignoring FCReqTimeout when no RxFC\n"); } /* high low and spacing check for rx flow control thresholds */ if (adapter->hw.fc.type & ixgb_fc_rx_pause) { /* high must be greater than low */ if (adapter->hw.fc.high_water < (adapter->hw.fc.low_water + 8)) { /* set defaults */ - printk(KERN_INFO - "RxFCHighThresh must be >= (RxFCLowThresh + 8), " - "Using Defaults\n"); + printk (KERN_INFO + "RxFCHighThresh must be >= (RxFCLowThresh + 8), " + "Using Defaults\n"); adapter->hw.fc.high_water = DEFAULT_FCRTH; - adapter->hw.fc.low_water = DEFAULT_FCRTL; + adapter->hw.fc.low_water = DEFAULT_FCRTL; } } - { /* Receive Interrupt Delay */ + { /* Receive Interrupt Delay */ struct ixgb_option opt = { .type = range_option, .name = "Receive Interrupt Delay", - .err = - "using default of " __MODULE_STRING(DEFAULT_RDTR), - .def = DEFAULT_RDTR, - .arg = {.r = {.min = MIN_RDTR, - .max = MAX_RDTR}} - }; - - adapter->rx_int_delay = RxIntDelay[bd]; - ixgb_validate_option(&adapter->rx_int_delay, &opt); - } - { /* Receive Interrupt Moderation */ - struct ixgb_option opt = { - .type = enable_option, - .name = "Advanced Receive Interrupt Moderation", - .err = "defaulting to Enabled", - .def = OPTION_ENABLED + .err = "using default of " __MODULE_STRING(DEFAULT_RDTR), + .def = DEFAULT_RDTR, + .arg = { .r = { .min = MIN_RDTR, + .max = MAX_RDTR}} }; - int raidc = RAIDC[bd]; - ixgb_validate_option(&raidc, &opt); - adapter->raidc = raidc; + if(num_RxIntDelay > bd) { + adapter->rx_int_delay = RxIntDelay[bd]; + ixgb_validate_option(&adapter->rx_int_delay, &opt); + } else { + adapter->rx_int_delay = opt.def; + } } - { /* Transmit Interrupt Delay */ + { /* Transmit Interrupt Delay */ struct ixgb_option opt = { .type = range_option, .name = "Transmit Interrupt Delay", - .err = - "using default of " __MODULE_STRING(DEFAULT_TIDV), - .def = DEFAULT_TIDV, - .arg = {.r = {.min = MIN_TIDV, - .max = MAX_TIDV}} + .err = "using default of " __MODULE_STRING(DEFAULT_TIDV), + .def = DEFAULT_TIDV, + .arg = { .r = { .min = MIN_TIDV, + .max = MAX_TIDV}} }; - adapter->tx_int_delay = TxIntDelay[bd]; - ixgb_validate_option(&adapter->tx_int_delay, &opt); + if(num_TxIntDelay > bd) { + adapter->tx_int_delay = TxIntDelay[bd]; + ixgb_validate_option(&adapter->tx_int_delay, &opt); + } else { + adapter->tx_int_delay = opt.def; + } } - { /* Transmit Interrupt Delay Enable */ + { /* Transmit Interrupt Delay Enable */ struct ixgb_option opt = { .type = enable_option, .name = "Tx Interrupt Delay Enable", - .err = "defaulting to Enabled", - .def = OPTION_ENABLED + .err = "defaulting to Enabled", + .def = OPTION_ENABLED }; - int ide = IntDelayEnable[bd]; - ixgb_validate_option(&ide, &opt); - adapter->tx_int_delay_enable = ide; + if(num_IntDelayEnable > bd) { + int ide = IntDelayEnable[bd]; + ixgb_validate_option(&ide, &opt); + adapter->tx_int_delay_enable = ide; + } else { + adapter->tx_int_delay_enable = opt.def; + } } } diff -Nru a/drivers/net/s2io.c b/drivers/net/s2io.c --- a/drivers/net/s2io.c 2005-01-12 01:33:23 -05:00 +++ b/drivers/net/s2io.c 2005-01-12 01:33:23 -05:00 @@ -560,21 +560,35 @@ for (i = 0; i < config->rx_ring_num; i++) { blk_cnt = config->rx_cfg[i].num_rxd / (MAX_RXDS_PER_BLOCK + 1); + if (!nic->ba[i]) + goto end_free; for (j = 0; j < blk_cnt; j++) { int k = 0; - if (!nic->ba[i][j]) - continue; + if (!nic->ba[i][j]) { + kfree(nic->ba[i]); + goto end_free; + } while (k != MAX_RXDS_PER_BLOCK) { buffAdd_t *ba = &nic->ba[i][j][k]; + if (!ba || !ba->ba_0_org || !ba->ba_1_org) + { + kfree(nic->ba[i]); + kfree(nic->ba[i][j]); + if(ba->ba_0_org) + kfree(ba->ba_0_org); + if(ba->ba_1_org) + kfree(ba->ba_1_org); + goto end_free; + } kfree(ba->ba_0_org); kfree(ba->ba_1_org); k++; } kfree(nic->ba[i][j]); } - if (nic->ba[i]) - kfree(nic->ba[i]); + kfree(nic->ba[i]); } +end_free: #endif if (mac_control->stats_mem) { diff -Nru a/drivers/net/s2io.h b/drivers/net/s2io.h --- a/drivers/net/s2io.h 2005-01-12 01:33:23 -05:00 +++ b/drivers/net/s2io.h 2005-01-12 01:33:23 -05:00 @@ -740,8 +740,8 @@ { u64 ret = 0; ret = readl(addr + 4); - (u64) ret <<= 32; - (u64) ret |= readl(addr); + ret <<= 32; + ret |= readl(addr); return ret; } diff -Nru a/drivers/net/smc-ultra.c b/drivers/net/smc-ultra.c --- a/drivers/net/smc-ultra.c 2005-01-12 01:33:23 -05:00 +++ b/drivers/net/smc-ultra.c 2005-01-12 01:33:23 -05:00 @@ -156,8 +156,6 @@ /* Look for any installed ISAPnP cards */ if (isapnp_present() && (ultra_probe_isapnp(dev) == 0)) return 0; - - printk(KERN_NOTICE "smc-ultra.c: No ISAPnP cards found, trying standard ones...\n"); #endif for (i = 0; ultra_portlist[i]; i++) { diff -Nru a/drivers/net/smc91x.c b/drivers/net/smc91x.c --- a/drivers/net/smc91x.c 2005-01-12 01:33:23 -05:00 +++ b/drivers/net/smc91x.c 2005-01-12 01:33:23 -05:00 @@ -1333,6 +1333,19 @@ return IRQ_HANDLED; } +#ifdef CONFIG_NET_POLL_CONTROLLER +/* + * Polling receive - used by netconsole and other diagnostic tools + * to allow network i/o with interrupts disabled. + */ +static void smc_poll_controller(struct net_device *dev) +{ + disable_irq(dev->irq); + smc_interrupt(dev->irq, dev, NULL); + enable_irq(dev->irq); +} +#endif + /* Our watchdog timed out. Called by the networking layer */ static void smc_timeout(struct net_device *dev) { @@ -1912,6 +1925,9 @@ dev->get_stats = smc_query_statistics; dev->set_multicast_list = smc_set_multicast_list; dev->ethtool_ops = &smc_ethtool_ops; +#ifdef CONFIG_NET_POLL_CONTROLLER + dev->poll_controller = smc_poll_controller; +#endif tasklet_init(&lp->tx_task, smc_hardware_send_pkt, (unsigned long)dev); INIT_WORK(&lp->phy_configure, smc_phy_configure, dev); diff -Nru a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c --- a/drivers/net/wireless/orinoco.c 2005-01-12 01:33:23 -05:00 +++ b/drivers/net/wireless/orinoco.c 2005-01-12 01:33:23 -05:00 @@ -617,9 +617,8 @@ unsigned long flags; int err; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; err = __orinoco_up(dev); @@ -671,10 +670,9 @@ return NULL; /* FIXME: Can we do better than this? */ } - err = orinoco_lock(priv, &flags); - if (err) - return NULL; /* FIXME: Erg, we've been signalled, how - * do we propagate this back up? */ + if (orinoco_lock(priv, &flags) != 0) + return NULL; /* FIXME: Erg, we've been signalled, how + * do we propagate this back up? */ if (priv->iw_mode == IW_MODE_ADHOC) { memset(&wstats->qual, 0, sizeof(wstats->qual)); @@ -1819,10 +1817,8 @@ return 0; } - err = orinoco_lock(priv, &flags); - if (err) - return err; - + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; err = hermes_disable_port(hw, 0); if (err) { @@ -1864,11 +1860,10 @@ { struct orinoco_private *priv = netdev_priv(dev); struct hermes *hw = &priv->hw; - int err; + int err = 0; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) + if (orinoco_lock(priv, &flags) != 0) /* When the hardware becomes available again, whatever * detects that is responsible for re-initializing * it. So no need for anything further */ @@ -2411,9 +2406,8 @@ int err = 0; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CURRENTBSSID, ETH_ALEN, NULL, buf); @@ -2433,9 +2427,8 @@ int len; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; if (strlen(priv->desired_essid) > 0) { /* We read the desired SSID from the hardware rather @@ -2486,9 +2479,8 @@ long freq = 0; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; err = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_CURRENTCHANNEL, &channel); if (err) @@ -2528,9 +2520,8 @@ int i; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_SUPPORTEDDATARATES, sizeof(list), NULL, &list); @@ -2568,9 +2559,8 @@ rrq->length = sizeof(range); - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; mode = priv->iw_mode; orinoco_unlock(priv, &flags); @@ -2639,9 +2629,8 @@ range.min_frag = 256; range.max_frag = 2346; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; if (priv->has_wep) { range.max_encoding_tokens = ORINOCO_MAX_KEYS; @@ -2706,10 +2695,9 @@ if (copy_from_user(keybuf, erq->pointer, erq->length)) return -EFAULT; } - - err = orinoco_lock(priv, &flags); - if (err) - return err; + + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; if (erq->pointer) { if (erq->length > ORINOCO_MAX_KEY_SIZE) { @@ -2788,12 +2776,10 @@ int index = (erq->flags & IW_ENCODE_INDEX) - 1; u16 xlen = 0; char keybuf[ORINOCO_MAX_KEY_SIZE]; - int err; unsigned long flags; - - err = orinoco_lock(priv, &flags); - if (err) - return err; + + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; if ((index < 0) || (index >= ORINOCO_MAX_KEYS)) index = priv->tx_key; @@ -2833,7 +2819,6 @@ { struct orinoco_private *priv = netdev_priv(dev); char essidbuf[IW_ESSID_MAX_SIZE+1]; - int err; unsigned long flags; /* Note : ESSID is ignored in Ad-Hoc demo mode, but we can set it @@ -2851,9 +2836,8 @@ essidbuf[erq->length] = '\0'; } - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; memcpy(priv->desired_essid, essidbuf, sizeof(priv->desired_essid)); @@ -2877,9 +2861,8 @@ if (err) return err; } else { - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; memcpy(essidbuf, priv->desired_essid, sizeof(essidbuf)); orinoco_unlock(priv, &flags); } @@ -2899,7 +2882,6 @@ { struct orinoco_private *priv = netdev_priv(dev); char nickbuf[IW_ESSID_MAX_SIZE+1]; - int err; unsigned long flags; if (nrq->length > IW_ESSID_MAX_SIZE) @@ -2912,9 +2894,8 @@ nickbuf[nrq->length] = '\0'; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; memcpy(priv->nick, nickbuf, sizeof(priv->nick)); @@ -2927,12 +2908,10 @@ { struct orinoco_private *priv = netdev_priv(dev); char nickbuf[IW_ESSID_MAX_SIZE+1]; - int err; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; memcpy(nickbuf, priv->nick, IW_ESSID_MAX_SIZE+1); orinoco_unlock(priv, &flags); @@ -2949,7 +2928,6 @@ { struct orinoco_private *priv = netdev_priv(dev); int chan = -1; - int err; unsigned long flags; /* We can only use this in Ad-Hoc demo mode to set the operating @@ -2978,9 +2956,8 @@ ! (priv->channel_mask & (1 << (chan-1)) ) ) return -EINVAL; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; priv->channel = chan; orinoco_unlock(priv, &flags); @@ -2998,9 +2975,8 @@ if (!priv->has_sensitivity) return -EOPNOTSUPP; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; err = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_CNFSYSTEMSCALE, &val); orinoco_unlock(priv, &flags); @@ -3018,7 +2994,6 @@ { struct orinoco_private *priv = netdev_priv(dev); int val = srq->value; - int err; unsigned long flags; if (!priv->has_sensitivity) @@ -3027,9 +3002,8 @@ if ((val < 1) || (val > 3)) return -EINVAL; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; priv->ap_density = val; orinoco_unlock(priv, &flags); @@ -3040,7 +3014,6 @@ { struct orinoco_private *priv = netdev_priv(dev); int val = rrq->value; - int err; unsigned long flags; if (rrq->disabled) @@ -3049,9 +3022,8 @@ if ( (val < 0) || (val > 2347) ) return -EINVAL; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; priv->rts_thresh = val; orinoco_unlock(priv, &flags); @@ -3065,9 +3037,8 @@ int err = 0; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; if (priv->has_mwo) { if (frq->disabled) @@ -3102,9 +3073,8 @@ u16 val; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; if (priv->has_mwo) { err = hermes_read_wordrec(hw, USER_BAP, @@ -3166,9 +3136,8 @@ if (ratemode == -1) return -EINVAL; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; priv->bitratemode = ratemode; orinoco_unlock(priv, &flags); @@ -3185,9 +3154,8 @@ u16 val; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; ratemode = priv->bitratemode; @@ -3247,9 +3215,8 @@ int err = 0; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; if (prq->disabled) { priv->pm_on = 0; @@ -3302,9 +3269,8 @@ u16 enable, period, timeout, mcast; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; err = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_CNFPMENABLED, &enable); if (err) @@ -3351,9 +3317,8 @@ u16 short_limit, long_limit, lifetime; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; err = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_SHORTRETRYLIMIT, &short_limit); @@ -3399,12 +3364,10 @@ { struct orinoco_private *priv = netdev_priv(dev); int val = *( (int *) wrq->u.name ); - int err; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; priv->ibss_port = val ; @@ -3419,12 +3382,10 @@ { struct orinoco_private *priv = netdev_priv(dev); int *val = (int *)wrq->u.name; - int err; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; *val = priv->ibss_port; orinoco_unlock(priv, &flags); @@ -3439,9 +3400,8 @@ int err = 0; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; switch (val) { case 0: /* Try to do IEEE ad-hoc mode */ @@ -3478,12 +3438,10 @@ { struct orinoco_private *priv = netdev_priv(dev); int *val = (int *)wrq->u.name; - int err; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; *val = priv->prefer_port3; orinoco_unlock(priv, &flags); @@ -3513,9 +3471,8 @@ } /* Make sure nobody mess with the structure while we do */ - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; /* orinoco_lock() doesn't disable interrupts, so make sure the * interrupt rx path don't get confused while we copy */ @@ -3546,12 +3503,10 @@ struct iw_quality spy_stat[IW_MAX_SPY]; int number; int i; - int err; unsigned long flags; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; number = priv->spy_number; if ((number > 0) && (srq->pointer)) { @@ -3621,9 +3576,8 @@ break; case SIOCSIWMODE: - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; switch (wrq->u.mode) { case IW_MODE_ADHOC: if (! (priv->has_ibss || priv->has_port3) ) @@ -3648,9 +3602,8 @@ break; case SIOCGIWMODE: - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; wrq->u.mode = priv->iw_mode; orinoco_unlock(priv, &flags); break; @@ -3865,9 +3818,8 @@ if(priv->has_preamble) { int val = *( (int *) wrq->u.name ); - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; if (val) priv->preamble = 1; else @@ -3882,9 +3834,8 @@ if(priv->has_preamble) { int *val = (int *)wrq->u.name; - err = orinoco_lock(priv, &flags); - if (err) - return err; + if (orinoco_lock(priv, &flags) != 0) + return -EBUSY; *val = priv->preamble; orinoco_unlock(priv, &flags); } else diff -Nru a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c --- a/drivers/net/wireless/wl3501_cs.c 2005-01-12 01:33:23 -05:00 +++ b/drivers/net/wireless/wl3501_cs.c 2005-01-12 01:33:23 -05:00 @@ -100,7 +100,7 @@ /* Parameters that can be set with 'insmod' */ /* Bit map of interrupts to choose from */ /* This means pick from 15, 14, 12, 11, 10, 9, 7, 5, 4, and 3 */ -static unsigned long wl3501_irq_mask = 0xdeb8; +static unsigned int wl3501_irq_mask = 0xdeb8; static int wl3501_irq_list[4] = { -1 }; /* @@ -2273,7 +2273,7 @@ module_init(wl3501_init_module); module_exit(wl3501_exit_module); -module_param(wl3501_irq_mask, int, 0); +module_param(wl3501_irq_mask, uint, 0); module_param_array(wl3501_irq_list, int, NULL, 0); MODULE_AUTHOR("Fox Chen , " "Arnaldo Carvalho de Melo ," diff -Nru a/include/linux/arcdevice.h b/include/linux/arcdevice.h --- a/include/linux/arcdevice.h 2005-01-12 01:33:23 -05:00 +++ b/include/linux/arcdevice.h 2005-01-12 01:33:23 -05:00 @@ -343,7 +343,6 @@ void arcnet_unregister_proto(struct ArcProto *proto); irqreturn_t arcnet_interrupt(int irq, void *dev_id, struct pt_regs *regs); -void arcdev_setup(struct net_device *dev); struct net_device *alloc_arcdev(char *name); void arcnet_rx(struct net_device *dev, int bufnum); --------------000607000805030206080607-- From kevin.curtis@farsite.co.uk Wed Jan 12 00:36:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 00:36:22 -0800 (PST) Received: from GENERAL.hq.farsitecommunications.com (pc9.faradsl.ftech.co.uk [212.32.46.170]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0C8a82U003450 for ; Wed, 12 Jan 2005 00:36:09 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" content-class: urn:content-classes:message X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 Subject: RE: [patch 1/1] net/farsync: add set_current_state() before schedule_timeout() Date: Wed, 12 Jan 2005 08:36:06 -0000 Message-ID: <7C078C66B7752B438B88E11E5E20E72E25D07D@general.hq.farsitecommunications.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [patch 1/1] net/farsync: add set_current_state() before schedule_timeout() Thread-Index: AcT4Ml6W068EQV4hRa2eg9PDK/aKLAAT0zLg From: "Kevin Curtis" To: , "Kevin Curtis" Cc: , , X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j0C8a82U003450 X-archive-position: 143 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kevin.curtis@farsite.co.uk Precedence: bulk X-list: netdev This looks fine to me. -----Original Message----- From: domen@coderock.org [mailto:domen@coderock.org] Sent: 11 January 2005 23:08 To: kevin.curtis@farsite.co.uk Cc: netdev@oss.sgi.com; domen@coderock.org; nacc@us.ibm.com; janitor@sternwelten.at Subject: [patch 1/1] net/farsync: add set_current_state() before schedule_timeout() Any comments would be appreciated. Description: Insert set_current_state() before schedule_timeout() so the function delays as expected. Without the addition, schedule_timeout() will return immediately. Signed-off-by: Nishanth Aravamudan Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/wan/farsync.c | 1 + 1 files changed, 1 insertion(+) diff -puN drivers/net/wan/farsync.c~set_current_state-drivers_net_wan_farsync drivers/net/wan/farsync.c --- kj/drivers/net/wan/farsync.c~set_current_state-drivers_net_wan_farsync 2005-01-10 18:00:19.000000000 +0100 +++ kj-domen/drivers/net/wan/farsync.c 2005-01-10 18:00:19.000000000 +0100 @@ -981,6 +981,7 @@ fst_issue_cmd(struct fst_port_info *port /* Wait for any previous command to complete */ while (mbval > NAK) { spin_unlock_irqrestore(&card->card_lock, flags); + set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(1); spin_lock_irqsave(&card->card_lock, flags); _ From MAILER-DAEMON Wed Jan 12 02:17:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 02:17:08 -0800 (PST) Received: from fw.c-side.com (gw.c-side.com [198.144.201.54]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CAH1CC006559 for ; Wed, 12 Jan 2005 02:17:02 -0800 Received: from lx.c-side.com (lx.c-side.com [198.144.194.170]) by fw.c-side.com (Postfix) with ESMTP id 8875917DF90 for ; Wed, 12 Jan 2005 02:16:56 -0800 (PST) Received: by lx.c-side.com (Postfix, from userid 201) id 748DE14D35; Wed, 12 Jan 2005 02:16:49 -0800 (PST) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline From: Neil Russell Subject: Please confirm your message Reply-To: neil-confirm-1105525009.16810.882ac8@c-side.com Date: Wed, 12 Jan 2005 02:16:49 -0800 (PST) Message-ID: <1105525009.16810.TMDA@lx.c-side.com> References: <20050112101640.6E33A5B3E5@server2.idiom.com> In-Reply-To: <20050112101640.6E33A5B3E5@server2.idiom.com> To: netdev@oss.sgi.com Precedence: normal Auto-Submitted: auto-replied X-Delivery-Agent: TMDA/1.0.3 (Seattle Slew) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 144 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: neil@c-side.com Precedence: bulk X-list: netdev Hi, The message you sent recently is being held because your address has not been verified. To confirm that your message was not junk-mail, please reply to this Email or send an empty message to this address: neil-confirm-1105525009.16810.882ac8@c-side.com You should only have to confirm your address once. Neil. From buytenh@wantstofly.org Wed Jan 12 04:23:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 04:23:06 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CCN1O3015691 for ; Wed, 12 Jan 2005 04:23:02 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id 2FE772B0EC; Wed, 12 Jan 2005 13:23:00 +0100 (MET) Date: Wed, 12 Jan 2005 13:23:00 +0100 From: Lennert Buytenhek To: netdev@oss.sgi.com Subject: race in net/ipv4/ipip.c ? Message-ID: <20050112122300.GA12155@xi.wantstofly.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 145 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev Hi! static void ipip_tunnel_link(struct ipip_tunnel *t) { struct ipip_tunnel **tp = ipip_bucket(t); t->next = *tp; write_lock_bh(&ipip_lock); *tp = t; write_unlock_bh(&ipip_lock); } Shouldn't the "t->next = *tp" be done inside the write lock? A similar race exists in ipip_tunnel_unlink, and ip_gre seems to have the same issues. cheers, Lennert From tgraf@suug.ch Wed Jan 12 04:53:17 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 04:53:23 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CCrG6D017229 for ; Wed, 12 Jan 2005 04:53:17 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 99611F; Wed, 12 Jan 2005 13:52:53 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 73DBF1C0EB; Wed, 12 Jan 2005 13:53:36 +0100 (CET) Date: Wed, 12 Jan 2005 13:53:36 +0100 From: Thomas Graf To: Lennert Buytenhek Cc: netdev@oss.sgi.com Subject: Re: race in net/ipv4/ipip.c ? Message-ID: <20050112125336.GH26856@postel.suug.ch> References: <20050112122300.GA12155@xi.wantstofly.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050112122300.GA12155@xi.wantstofly.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 146 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * Lennert Buytenhek <20050112122300.GA12155@xi.wantstofly.org> 2005-01-12 13:23 > Hi! > > static void ipip_tunnel_link(struct ipip_tunnel *t) > { > struct ipip_tunnel **tp = ipip_bucket(t); > > t->next = *tp; > write_lock_bh(&ipip_lock); > *tp = t; > write_unlock_bh(&ipip_lock); > } > > Shouldn't the "t->next = *tp" be done inside the write lock? Why do you think so? linking may only happen on new tunnels so they can't be found before they're assigned to the bucket. dev_hold is called correctly so dev->priv usage is safe as well. From yoshfuji@linux-ipv6.org Wed Jan 12 05:07:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 05:07:54 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CD7l3F017968 for ; Wed, 12 Jan 2005 05:07:48 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id 8368F33CC2; Wed, 12 Jan 2005 22:08:16 +0900 (JST) Date: Wed, 12 Jan 2005 22:08:16 +0900 (JST) Message-Id: <20050112.220816.56650893.yoshfuji@linux-ipv6.org> To: tgraf@suug.ch Cc: buytenh@wantstofly.org, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: race in net/ipv4/ipip.c ? From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20050112125336.GH26856@postel.suug.ch> References: <20050112122300.GA12155@xi.wantstofly.org> <20050112125336.GH26856@postel.suug.ch> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 147 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev In article <20050112125336.GH26856@postel.suug.ch> (at Wed, 12 Jan 2005 13:53:36 +0100), Thomas Graf says: > * Lennert Buytenhek <20050112122300.GA12155@xi.wantstofly.org> 2005-01-12 13:23 : > > static void ipip_tunnel_link(struct ipip_tunnel *t) > > { > > struct ipip_tunnel **tp = ipip_bucket(t); > > > > t->next = *tp; > > write_lock_bh(&ipip_lock); > > *tp = t; > > write_unlock_bh(&ipip_lock); > > } > > > > Shouldn't the "t->next = *tp" be done inside the write lock? > > Why do you think so? linking may only happen on new tunnels > so they can't be found before they're assigned to the bucket. > dev_hold is called correctly so dev->priv usage is safe as > well. How about adding multiple tunnels (with same ipip_bucket(t)) concurrently? :-) --yoshfuji From buytenh@wantstofly.org Wed Jan 12 05:09:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 05:09:45 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CD9f9d018456 for ; Wed, 12 Jan 2005 05:09:41 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id A689F2B0EC; Wed, 12 Jan 2005 14:09:40 +0100 (MET) Date: Wed, 12 Jan 2005 14:09:40 +0100 From: Lennert Buytenhek To: Thomas Graf Cc: netdev@oss.sgi.com Subject: Re: race in net/ipv4/ipip.c ? Message-ID: <20050112130940.GA12547@xi.wantstofly.org> References: <20050112122300.GA12155@xi.wantstofly.org> <20050112125336.GH26856@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050112125336.GH26856@postel.suug.ch> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 148 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev On Wed, Jan 12, 2005 at 01:53:36PM +0100, Thomas Graf wrote: > > static void ipip_tunnel_link(struct ipip_tunnel *t) > > { > > struct ipip_tunnel **tp = ipip_bucket(t); > > > > t->next = *tp; > > write_lock_bh(&ipip_lock); > > *tp = t; > > write_unlock_bh(&ipip_lock); > > } > > > > Shouldn't the "t->next = *tp" be done inside the write lock? > > Why do you think so? linking may only happen on new tunnels > so they can't be found before they're assigned to the bucket. > dev_hold is called correctly so dev->priv usage is safe as > well. What if you add two tunnels at the same time? (Or is that perhaps synchronised on a higher level?) --L From tgraf@suug.ch Wed Jan 12 05:21:06 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 05:21:12 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CDL5Xn019122 for ; Wed, 12 Jan 2005 05:21:06 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 23D48F; Wed, 12 Jan 2005 14:20:43 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 37AB01C0EA; Wed, 12 Jan 2005 14:21:26 +0100 (CET) Date: Wed, 12 Jan 2005 14:21:26 +0100 From: Thomas Graf To: "YOSHIFUJI Hideaki / ?$B5HF#1QL@" , Lennert Buytenhek Cc: netdev@oss.sgi.com Subject: Re: race in net/ipv4/ipip.c ? Message-ID: <20050112132126.GI26856@postel.suug.ch> References: <20050112122300.GA12155@xi.wantstofly.org> <20050112125336.GH26856@postel.suug.ch> <20050112130940.GA12547@xi.wantstofly.org> <20050112122300.GA12155@xi.wantstofly.org> <20050112125336.GH26856@postel.suug.ch> <20050112.220816.56650893.yoshfuji@linux-ipv6.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050112130940.GA12547@xi.wantstofly.org> <20050112.220816.56650893.yoshfuji@linux-ipv6.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 149 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * YOSHIFUJI Hideaki / ?$B5HF#1QL@ <20050112.220816.56650893.yoshfuji@linux-ipv6.org> 2005-01-12 22:08 > How about adding multiple tunnels (with same ipip_bucket(t)) > concurrently? :-) > * Lennert Buytenhek <20050112130940.GA12547@xi.wantstofly.org> 2005-01-12 14:09 > What if you add two tunnels at the same time? (Or is that perhaps > synchronised on a higher level?) Not possible, protected via rtnl semaphore acquired in default handler of dev_ioctl. From yoshfuji@linux-ipv6.org Wed Jan 12 05:35:30 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 05:35:46 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CDZTI8019834 for ; Wed, 12 Jan 2005 05:35:30 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id D026533CC2; Wed, 12 Jan 2005 22:36:00 +0900 (JST) Date: Wed, 12 Jan 2005 22:36:00 +0900 (JST) Message-Id: <20050112.223600.09187852.yoshfuji@linux-ipv6.org> To: davem@davemloft.net Cc: tgraf@suug.ch, buytenh@wantstofly.org, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: race in net/ipv4/ipip.c ? From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20050112132126.GI26856@postel.suug.ch> References: <20050112125336.GH26856@postel.suug.ch> <20050112.220816.56650893.yoshfuji@linux-ipv6.org> <20050112132126.GI26856@postel.suug.ch> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 150 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev In article <20050112132126.GI26856@postel.suug.ch> (at Wed, 12 Jan 2005 14:21:26 +0100), Thomas Graf says: > * YOSHIFUJI Hideaki / ?$B5HF#1QL@ <20050112.220816.56650893.yoshfuji@linux-ipv6.org> 2005-01-12 22:08 > > How about adding multiple tunnels (with same ipip_bucket(t)) > > concurrently? :-) > > > > * Lennert Buytenhek <20050112130940.GA12547@xi.wantstofly.org> 2005-01-12 14:09 > > What if you add two tunnels at the same time? (Or is that perhaps > > synchronised on a higher level?) > > Not possible, protected via rtnl semaphore acquired in default > handler of dev_ioctl. Good. David, I think we need to fix sit.c, anyway. Signed-off-by: Hideaki YOSHIFUJI ===== net/ipv6/sit.c 1.43 vs edited ===== --- 1.43/net/ipv6/sit.c 2004-10-04 07:03:07 +09:00 +++ edited/net/ipv6/sit.c 2005-01-12 22:29:32 +09:00 @@ -135,10 +135,10 @@ { struct ip_tunnel **tp = ipip6_bucket(t); - write_lock_bh(&ipip6_lock); t->next = *tp; - write_unlock_bh(&ipip6_lock); + write_lock_bh(&ipip6_lock); *tp = t; + write_unlock_bh(&ipip6_lock); } static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int create) --yoshfuji From Robert.Olsson@data.slu.se Wed Jan 12 07:30:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 07:30:26 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CFUKak029051 for ; Wed, 12 Jan 2005 07:30:21 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0CFU1WM004649; Wed, 12 Jan 2005 16:30:01 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 5798AEC1A1; Wed, 12 Jan 2005 16:11:55 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16869.15931.324875.264756@robur.slu.se> Date: Wed, 12 Jan 2005 16:11:55 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson , Stephen Hemminger , Jesse Brandeburg Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501111927.15574.jeremy.guthrie@berbee.com> References: <200501110917.26621.jeremy.guthrie@berbee.com> <16868.381.537772.831831@robur.slu.se> <200501111927.15574.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 151 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > > Did the e1000 patch cure the problem that interrupts got enabled for > > unidirectional traffic? Ring size? I've never seen any win in system > > performance w. RX rings larger than 256 at least not in lab. > ETH3 Interrupts(calc'd from below): 1479968 > ETH2 Interrupts: 261543 > Packets RX'd on ETH3: 3892720 > Packets dropped on RX on ETH3: 10305 Very strange... eth3 is bound to CPU0 which in turn has all packet load... If we were to believe your CPU0 was saturated (due to the drops). We should see no (RX) interrupts on eth3. But there is a lot... one irq per every three packet. Why? Can you investigate? e1000 has problem like this w. unidirectional traffic w/o the patch I sent. Or is your traffic so extremely bursty. No? --ro > This equates to about a 0.26% drop rate. W/ 256 packet RX ring size I see > about a 0.42% drop rate. > > This is using both the newest Intel driver w/ your patch and an increased ring > size of 2048. > > Tue Jan 11 19:15:04 CST 2005 > eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 > inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255.0 > inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:2337377824 errors:14992144 dropped:14992144 > overruns:9643826 frame:0 > TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:1000 > RX bytes:3984064976 (3799.5 Mb) TX bytes:398 (398.0 b) > Base address:0x22a0 Memory:eff80000-effa0000 > > CPU0 CPU1 > 0: 93627934 353254270 IO-APIC-edge timer > 1: 35 507 IO-APIC-edge i8042 > 7: 0 0 IO-APIC-level ohci_hcd > 8: 0 2 IO-APIC-edge rtc > 12: 73 145 IO-APIC-edge i8042 > 14: 120 313 IO-APIC-edge ide0 > 18: 2158179576 1815 IO-APIC-level eth3 > 20: 2 2136514988 IO-APIC-level eth2 > 27: 204201 371301 IO-APIC-level eth0 > 28: 14585 75320 IO-APIC-level aic7xxx > 30: 0 0 IO-APIC-level acpi > NMI: 0 0 > LOC: 446922783 446921227 > ERR: 0 > MIS: 0 > > Tue Jan 11 19:16:05 CST 2005 > eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 > inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255.0 > inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:2341270544 errors:15002449 dropped:15002449 > overruns:9652393 frame:0 > TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:1000 > RX bytes:1664751812 (1587.6 Mb) TX bytes:398 (398.0 b) > Base address:0x22a0 Memory:eff80000-effa0000 > > CPU0 CPU1 > 0: 93639955 353302319 IO-APIC-edge timer > 1: 35 507 IO-APIC-edge i8042 > 7: 0 0 IO-APIC-level ohci_hcd > 8: 0 2 IO-APIC-edge rtc > 12: 73 145 IO-APIC-edge i8042 > 14: 120 313 IO-APIC-edge ide0 > 18: 2159659544 1815 IO-APIC-level eth3 > 20: 2 2136776531 IO-APIC-level eth2 > 27: 204245 371369 IO-APIC-level eth0 > 28: 14593 75343 IO-APIC-level aic7xxx > 30: 0 0 IO-APIC-level acpi > NMI: 0 0 > LOC: 446982858 446981302 > ERR: 0 > MIS: 0 > > --ro > > > > Jeremy M. Guthrie writes: > > > date ; ifconfig eth3 ; cat /proc/net/softnet_stat ; > > > cat /proc/net/stat/rt_cache ; sleep 60 ; date ; ifconfig eth3 ; > > > cat /proc/net/softnet_stat ; cat /proc/net/stat/rt_cache > > > > > > Tue Jan 11 09:12:21 CST 2005 > > > eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 > > > inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255.0 > > > inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link > > > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > > > RX packets:3519452697 errors:5558592 dropped:5558592 > > > overruns:4011523 frame:0 > > > TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 > > > collisions:0 txqueuelen:1000 > > > RX bytes:497775695 (474.7 Mb) TX bytes:398 (398.0 b) > > > Base address:0x22a0 Memory:eff80000-effa0000 > > > > > > f59427dc 150dc67c 00c562ab 000d2659 00000000 00000000 00000000 00000000 > > > 00547b5b > > > 00038622 00000000 00000065 00000000 00000000 00000000 00000000 00000000 > > > 0006804f > > > entries in_hit in_slow_tot in_no_route in_brd in_martian_dst > > > in_martian_src out_hit out_slow_tot out_slow_mc gc_total gc_ignored > > > gc_goal_miss gc_dst_overflow in_hlist_search out_hlist_search > > > 0000f3c2 aeca1565 272c383d 00000000 00000000 000089a8 00005298 00000002 > > > 001db403 0003054f 00000000 230aa73c 22fe33eb 00000cf0 00000000 b37011dc > > > 00957c14 > > > 0000f3c2 0000b975 00029703 00000000 00000000 000035a5 00000000 00000000 > > > 00000015 00000083 00000002 000038c8 000038a3 00000000 00000000 0012a566 > > > 0000014d > > > > > > Tue Jan 11 09:13:21 CST 2005 > > > eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 > > > inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255.0 > > > inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link > > > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > > > RX packets:3524302561 errors:5571396 dropped:5571396 > > > overruns:4022383 frame:0 > > > TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 > > > collisions:0 txqueuelen:1000 > > > RX bytes:3065327250 (2923.3 Mb) TX bytes:398 (398.0 b) > > > Base address:0x22a0 Memory:eff80000-effa0000 > > > > > > f5de26f5 150dc67c 00c562b4 000d2659 00000000 00000000 00000000 00000000 > > > 00547ffd > > > 00038632 00000000 00000065 00000000 00000000 00000000 00000000 00000000 > > > 0006807c > > > entries in_hit in_slow_tot in_no_route in_brd in_martian_dst > > > in_martian_src out_hit out_slow_tot out_slow_mc gc_total gc_ignored > > > gc_goal_miss gc_dst_overflow in_hlist_search out_hlist_search > > > 0000fc1e af11f07b 272e58d3 00000000 00000000 000089a8 00005298 00000002 > > > 001db571 00030572 00000000 230cc7f1 23005428 00000cf0 00000000 b4b5b529 > > > 009583b9 > > > 0000fc1e 0000b977 00029710 00000000 00000000 000035a7 00000000 00000000 > > > 00000015 00000083 00000002 000038ca 000038a5 00000000 00000000 0012a5c8 > > > 0000014d > > > > > > -- > > > > > > -------------------------------------------------- > > > Jeremy M. Guthrie jeremy.guthrie@berbee.com > > > Senior Network Engineer Phone: 608-298-1061 > > > Berbee Fax: 608-288-3007 > > > 5520 Research Park Drive NOC: 608-298-1102 > > > Madison, WI 53711 > > -- > > -------------------------------------------------- > Jeremy M. Guthrie jeremy.guthrie@berbee.com > Senior Network Engineer Phone: 608-298-1061 > Berbee Fax: 608-288-3007 > 5520 Research Park Drive NOC: 608-298-1102 > Madison, WI 53711 From lxie@us.ibm.com Wed Jan 12 07:52:34 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 07:52:39 -0800 (PST) Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.133]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CFqNPp029964; Wed, 12 Jan 2005 07:52:30 -0800 Received: from westrelay03.boulder.ibm.com (westrelay03.boulder.ibm.com [9.17.195.12]) by e35.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j0CFqHZ7216322; Wed, 12 Jan 2005 10:52:17 -0500 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by westrelay03.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j0CFqHDg342174; Wed, 12 Jan 2005 08:52:17 -0700 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j0CFqESn027530; Wed, 12 Jan 2005 08:52:14 -0700 Received: from d03nm691.boulder.ibm.com (d03nm691.boulder.ibm.com [9.17.195.60]) by d03av03.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j0CFqDCf027509; Wed, 12 Jan 2005 08:52:13 -0700 In-Reply-To: <1105525009.16810.TMDA@lx.c-side.com> Subject: Re: Please confirm your message To: neil-confirm-1105525009.16810.882ac8@c-side.com Cc: netdev@oss.sgi.com, netdev-bounce@oss.sgi.com X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: Linda Xie Date: Wed, 12 Jan 2005 09:52:11 -0600 X-MIMETrack: Serialize by Router on D03NM691/03/M/IBM(Release 6.53HF56 | October 29, 2004) at 01/12/2005 08:52:13 MIME-Version: 1.0 Content-type: multipart/related; Boundary="0__=08BBE514DFC4A27A8f9e8a93df938690918c08BBE514DFC4A27A" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 152 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: lxie@us.ibm.com Precedence: bulk X-list: netdev --0__=08BBE514DFC4A27A8f9e8a93df938690918c08BBE514DFC4A27A Content-type: multipart/alternative; Boundary="1__=08BBE514DFC4A27A8f9e8a93df938690918c08BBE514DFC4A27A" --1__=08BBE514DFC4A27A8f9e8a93df938690918c08BBE514DFC4A27A Content-type: text/plain; charset=US-ASCII confirmed. Linda Neil Russell To: netdev@oss.sgi.com Sent by: cc: netdev-bounce@oss.sgi.com Subject: Please confirm your message 01/12/2005 04:16 AM Please respond to neil-confirm-1105525009.1 6810.882ac8 Hi, The message you sent recently is being held because your address has not been verified. To confirm that your message was not junk-mail, please reply to this Email or send an empty message to this address: neil-confirm-1105525009.16810.882ac8@c-side.com You should only have to confirm your address once. Neil. --1__=08BBE514DFC4A27A8f9e8a93df938690918c08BBE514DFC4A27A Content-type: text/html; charset=US-ASCII Content-Disposition: inline

confirmed.

Linda
Inactive hide details for Neil Russell <neil@c-side.com>Neil Russell <neil@c-side.com>




          Neil Russell <neil@c-side.com>
          Sent by: netdev-bounce@oss.sgi.com

          01/12/2005 04:16 AM
          Please respond to neil-confirm-1105525009.16810.882ac8



To: netdev@oss.sgi.com
cc:
Subject: Please confirm your message



Hi,


The message you sent recently is being held because your address
<netdev@oss.sgi.com> has not been verified.

To confirm that your message was not junk-mail, please reply to this
Email or send an empty message to this address:

  neil-confirm-1105525009.16810.882ac8@c-side.com

You should only have to confirm your address once.


Neil.

--1__=08BBE514DFC4A27A8f9e8a93df938690918c08BBE514DFC4A27A-- --0__=08BBE514DFC4A27A8f9e8a93df938690918c08BBE514DFC4A27A Content-type: image/gif; name="graycol.gif" Content-Disposition: inline; filename="graycol.gif" Content-ID: <10__=08BBE514DFC4A27A8f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 R0lGODlhEAAQAKECAMzMzAAAAP///wAAACH5BAEAAAIALAAAAAAQABAAAAIXlI+py+0PopwxUbpu ZRfKZ2zgSJbmSRYAIf4fT3B0aW1pemVkIGJ5IFVsZWFkIFNtYXJ0U2F2ZXIhAAA7 --0__=08BBE514DFC4A27A8f9e8a93df938690918c08BBE514DFC4A27A Content-type: image/gif; name="ecblank.gif" Content-Disposition: inline; filename="ecblank.gif" Content-ID: <20__=08BBE514DFC4A27A8f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 R0lGODlhEAABAIAAAAAAAP///yH5BAEAAAEALAAAAAAQAAEAAAIEjI8ZBQA7 --0__=08BBE514DFC4A27A8f9e8a93df938690918c08BBE514DFC4A27A Content-type: image/gif; name="pic26194.gif" Content-Disposition: inline; filename="pic26194.gif" Content-ID: <30__=08BBE514DFC4A27A8f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 R0lGODlhWABDALP/AAAAAK04Qf79/o+Gm7WuwlNObwoJFCsoSMDAwGFsmIuezf///wAAAAAAAAAA AAAAACH5BAEAAAgALAAAAABYAEMAQAT/EMlJq704682770RiFMRinqggEUNSHIchG0BCfHhOjAuh EDeUqTASLCbBhQrhG7xis2j0lssNDopE4jfIJhDaggI8YB1sZeZgLVA9YVCpnGagVjV171aRVrYR RghXcAGFhoUETwYxcXNyADJ3GlcSKGAwLwllVC1vjIUHBWsFilKQdI8GA5IcpApeJQt8L09lmgkH LZikoU5wjqcyAMMFrJIDPAKvCFletKSev1HBw8KrxtjZ2tvc3d5VyKtCKW3jfz4uMKmq3xu4N0nK BVoJQmx2LGVOmrqNjjJf2hHAQo/eDwJGTKhQMcgQEEAnEjFS98+RnW3smGkZU6ncCWav/4wYOnAI TihRL/4FEwbp28BXMMcoscQCVxlepL4IGDSCyJyVQOu0o7CjmLN50OZlqWmyFy5/6yBBuji0AxFR M00oQAqNIstqI6qKHUsWRAEAvagsmfUEAImyxgbmUpJk3IklNUtJOUAVLoUr1+wqDGTE4zk+T6FG uQb3SizBCwatiiUgCBN8vrz+zFjVyQ8FWkOlg4NQiZMB5QS8QO3mpOaKnL0Z2EKvNMSILEThKhCg zMKPVxYJh23qm9KNW7pArPynMqZDiErsTMqI+LRi3QAgkFUbXpuFKhSYZALd0O5RKa2z9EYKBbpb qxIKsjUPRgD7I2XYV6wyrOw92ykExP8NW4URhknC5dKGE4v4NENQj2jXjmfNgOZDaXb5glRmXQ33 YEWQYNcZFnrYcIQLNzyTFDQNkXIff0ExVlY4srziQk43inZgL4rwxxINMvpFFAz1KOODHiu+4aEw NEjFl5B3JIKWKF3k6I9bfUGp5ZZcdunll5IA4cuHvQQJ5gcsoCWOOUwgltIwAKRxJgbIkJAQZEq0 2YliZnpZZ4BH3CnYOXldOUOfQoYDqF1LFHbXCrO8xmRsfoXDXJ6ChjCAH3QlhJcT6VWE6FCkfCco CgrMFsROrIEX3o2whVjWDjoJccN3LdggSGXLCdLEgHr1lyU3O3QxhgohNKXJCWv8JQr/PDdaqd6w 2rj1inLiGeiCJoDspAoQlYE6QWLSECehcWIYxIQES6zhbn1iImTHEQyqJ4eIxJJoUBc+3CbBuwZE V5cJPPkIjFDdeEabQbd6WgICTxiiz0f5dBKquXF6k4senwEhYGnKEFJeGrxUZy8dB8gmAXI/sPvH ESfCwVt5hTgYiqQqtdRNHQIU1PJ33ZqmzgE90OwLaoJcnMop1WiMmgkPHQRIrwgFuNV90A3doNKT mrKIN07AnGcI9BQjhCBN4RfA1qIZnMqorJCogKfGQnxSCDilTVIA0yl5ciTovgLuBDKFUDE9aQcw 9SA+rjSNf9/M1gxrj6VwDTS0IUSElMzBfsj0NFXR2kwsV1A5IF1grLgLL/r1R40BZEnuBWgmQEyb jqRwSAt6bqMCOFkvKFN2GPPkUzIm/SCF8z8pVzpbjVnMsy0vOr1hw3SaSRUhpY09v0z0J1FnwzPl fmh+xl4WtR0zGu24I4KbMQm3lnVu2oNWxI9W/lcyzA+mCKF4DBikxb/+UWtOGRiFP8qEwAayIgIA Ow== --0__=08BBE514DFC4A27A8f9e8a93df938690918c08BBE514DFC4A27A-- From Robert.Olsson@data.slu.se Wed Jan 12 08:02:29 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 08:02:33 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CG2S0N030623 for ; Wed, 12 Jan 2005 08:02:29 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0CG2G9B008278; Wed, 12 Jan 2005 17:02:16 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 0D52AEC1A1; Wed, 12 Jan 2005 17:02:16 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16869.18952.22825.744294@robur.slu.se> Date: Wed, 12 Jan 2005 17:02:16 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson , Stephen Hemminger , Jesse Brandeburg Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501111930.35689.jeremy.guthrie@berbee.com> References: <200501111118.00601.jeremy.guthrie@berbee.com> <16868.7936.512676.178828@robur.slu.se> <200501111930.35689.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 153 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > I am up for pushing it if you do not think it is a waste of time. Based on > what I am seeing it looks like I just need a faster CPU to do the work. My > goal would be to hit zero dropped packets w/ 10-15% CPU to spare but I fail > to see how that will happen on this box. Do you concur that it would be > highly unlikely I would be able to get that kind of performance increase? Well we can try to decrease some of the linear search in the route hash once we understand why we see all the RX interrupts. --ro From jeremy.guthrie@berbee.com Wed Jan 12 08:25:12 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 08:25:18 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CGPA75002686 for ; Wed, 12 Jan 2005 08:25:11 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 12 Jan 2005 10:25:05 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Wed, 12 Jan 2005 10:24:59 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson , Stephen Hemminger , Jesse Brandeburg References: <200501111927.15574.jeremy.guthrie@berbee.com> <16869.15931.324875.264756@robur.slu.se> In-Reply-To: <16869.15931.324875.264756@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart9616339.dZIAtcjDUb"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501121025.03899.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 12 Jan 2005 16:25:05.0454 (UTC) FILETIME=[46464CE0:01C4F8C3] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 154 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart9616339.dZIAtcjDUb Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wednesday 12 January 2005 09:11 am, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > > Did the e1000 patch cure the problem that interrupts got enabled for > > > unidirectional traffic? Ring size? I've never seen any win in system > > > performance w. RX rings larger than 256 at least not in lab. > > > > ETH3 Interrupts(calc'd from below): 1479968 > > ETH2 Interrupts: 261543 > > Packets RX'd on ETH3: 3892720 > > Packets dropped on RX on ETH3: 10305 > > Very strange... > > eth3 is bound to CPU0 which in turn has all packet load... If we were > to believe your CPU0 was saturated (due to the drops). We should see no > (RX) interrupts on eth3. But there is a lot... one irq per every three > packet. Why? I have no idea why it would be doing this. > Can you investigate? e1000 has problem like this w. unidirectional traff= ic > w/o the patch I sent. This appears to be where this problem is getting beyond my expertise. I=20 verified NAPI is turned on. I also verified the patch is in place. I am=20 open to suggestions but otherwise I am not the worlds best coder.=20 > Or is your traffic so extremely bursty. No? By the nature of our business it can be very bursty. We just have so many= =20 sources/destinations for traffic that our traffic is generally pretty burst= y. =20 We might be running 300-400 mbps with spikes of 40-100 mbps. > --ro > > > This equates to about a 0.26% drop rate. W/ 256 packet RX ring size I > > see about a 0.42% drop rate. > > > > This is using both the newest Intel driver w/ your patch and an > > increased ring size of 2048. > > > > Tue Jan 11 19:15:04 CST 2005 > > eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 > > inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255= =2E0 > > inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link > > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > > RX packets:2337377824 errors:14992144 dropped:14992144 > > overruns:9643826 frame:0 > > TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 > > collisions:0 txqueuelen:1000 > > RX bytes:3984064976 (3799.5 Mb) TX bytes:398 (398.0 b) > > Base address:0x22a0 Memory:eff80000-effa0000 > > > > CPU0 CPU1 > > 0: 93627934 353254270 IO-APIC-edge timer > > 1: 35 507 IO-APIC-edge i8042 > > 7: 0 0 IO-APIC-level ohci_hcd > > 8: 0 2 IO-APIC-edge rtc > > 12: 73 145 IO-APIC-edge i8042 > > 14: 120 313 IO-APIC-edge ide0 > > 18: 2158179576 1815 IO-APIC-level eth3 > > 20: 2 2136514988 IO-APIC-level eth2 > > 27: 204201 371301 IO-APIC-level eth0 > > 28: 14585 75320 IO-APIC-level aic7xxx > > 30: 0 0 IO-APIC-level acpi > > NMI: 0 0 > > LOC: 446922783 446921227 > > ERR: 0 > > MIS: 0 > > > > Tue Jan 11 19:16:05 CST 2005 > > eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 > > inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255= =2E0 > > inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link > > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > > RX packets:2341270544 errors:15002449 dropped:15002449 > > overruns:9652393 frame:0 > > TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 > > collisions:0 txqueuelen:1000 > > RX bytes:1664751812 (1587.6 Mb) TX bytes:398 (398.0 b) > > Base address:0x22a0 Memory:eff80000-effa0000 > > > > CPU0 CPU1 > > 0: 93639955 353302319 IO-APIC-edge timer > > 1: 35 507 IO-APIC-edge i8042 > > 7: 0 0 IO-APIC-level ohci_hcd > > 8: 0 2 IO-APIC-edge rtc > > 12: 73 145 IO-APIC-edge i8042 > > 14: 120 313 IO-APIC-edge ide0 > > 18: 2159659544 1815 IO-APIC-level eth3 > > 20: 2 2136776531 IO-APIC-level eth2 > > 27: 204245 371369 IO-APIC-level eth0 > > 28: 14593 75343 IO-APIC-level aic7xxx > > 30: 0 0 IO-APIC-level acpi > > NMI: 0 0 > > LOC: 446982858 446981302 > > ERR: 0 > > MIS: 0 =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart9616339.dZIAtcjDUb Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB5U9fqtjaBHGZBeURAlDZAJsESGin954USIQg7WeStvEeoFqleACgnW0g n3EHNxl6YfkaK62IoVMu/hg= =rvzQ -----END PGP SIGNATURE----- --nextPart9616339.dZIAtcjDUb-- From dhollis@davehollis.com Wed Jan 12 08:28:16 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 08:28:24 -0800 (PST) Received: from pop-a065c10.pas.sa.earthlink.net (pop-a065c10.pas.sa.earthlink.net [207.217.121.184]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CGSG8E003212 for ; Wed, 12 Jan 2005 08:28:16 -0800 Received: from user-12hcjeo.cable.mindspring.com ([69.22.77.216] helo=bender.davehollis.com) by pop-a065c10.pas.sa.earthlink.net with esmtp (Exim 3.33 #1) id 1ColLx-0003eH-00; Wed, 12 Jan 2005 08:28:13 -0800 Received: from 10.8.0.6 ([10.8.0.6]) (authenticated bits=0) by bender.davehollis.com (8.13.1/8.12.11) with ESMTP id j0CGS6Q2004034 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Wed, 12 Jan 2005 11:28:10 -0500 Subject: Re: Fw: Network driver test suite? From: David Hollis To: Craig Thomas Cc: netdev@oss.sgi.com, cliffw@osdl.org, shemminger@osdl.org In-Reply-To: <1105493554.28674.49.camel@bullpen.pdx.osdl.net> References: <20050105152635.290ad9c0@dxpl.pdx.osdl.net> <1105493554.28674.49.camel@bullpen.pdx.osdl.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-YVP34LeWtuxlMyQ4Q1by" Date: Wed, 12 Jan 2005 11:24:24 -0500 Message-Id: <1105547064.5940.5.camel@dhollis-lnx.centricconsulting.com> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) X-Scanned-By: MIMEDefang 2.49 on 10.8.0.1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 155 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dhollis@davehollis.com Precedence: bulk X-list: netdev --=-YVP34LeWtuxlMyQ4Q1by Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2005-01-11 at 17:32 -0800, Craig Thomas wrote: >=20 > Would there be a desire for someone to collect the tests or at least > create an index to all their locations? If so, then developers can > scan a library of potential tests to run against newly developed code. >=20 > OSDL can start incorporating some of these tests into their test > platform as well. I would love to see a collection of the types of tests that should be performed. As it appears now, there is nothing defined that a driver author should do to verify that their driver performs properly, or supports the right capabilities etc. Some things may be difficult to automate, but simply having a checklist would be great. For the things that can be automated, that would be even better. --=20 David Hollis --=-YVP34LeWtuxlMyQ4Q1by Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQBB5U83xasLqOyGHncRAkaZAJ0Xr9DaurPOGiFGpTUZLiIa8Ech2QCeK0gn bwrt/78Ido63QRgggnCetZo= =bFzE -----END PGP SIGNATURE----- --=-YVP34LeWtuxlMyQ4Q1by-- From craiger@osdl.org Wed Jan 12 08:37:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 08:37:50 -0800 (PST) Received: from fire-1.osdl.org (fire.osdl.org [65.172.181.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CGbgH8003930 for ; Wed, 12 Jan 2005 08:37:44 -0800 Received: from bullpen.pdx.osdl.net (fw.osdl.org [65.172.181.6]) (authenticated bits=0) by fire-1.osdl.org (8.12.8/8.12.8) with ESMTP id j0CGbW7t010490 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Wed, 12 Jan 2005 08:37:33 -0800 Subject: Re: Fw: Network driver test suite? From: Craig Thomas To: David Hollis Cc: netdev@oss.sgi.com, cliff white , shemminger@osdl.org In-Reply-To: <1105547064.5940.5.camel@dhollis-lnx.centricconsulting.com> References: <20050105152635.290ad9c0@dxpl.pdx.osdl.net> <1105493554.28674.49.camel@bullpen.pdx.osdl.net> <1105547064.5940.5.camel@dhollis-lnx.centricconsulting.com> Content-Type: text/plain Message-Id: <1105550041.28674.53.camel@bullpen.pdx.osdl.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Wed, 12 Jan 2005 09:14:01 -0800 Content-Transfer-Encoding: 7bit X-MIMEDefang-Filter: osdl$Revision: 1.98 $ X-Scanned-By: MIMEDefang 2.36 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 156 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: craiger@osdl.org Precedence: bulk X-list: netdev On Wed, 2005-01-12 at 08:24, David Hollis wrote: > On Tue, 2005-01-11 at 17:32 -0800, Craig Thomas wrote: > > > > > Would there be a desire for someone to collect the tests or at least > > create an index to all their locations? If so, then developers can > > scan a library of potential tests to run against newly developed code. > > > > OSDL can start incorporating some of these tests into their test > > platform as well. > > I would love to see a collection of the types of tests that should be > performed. As it appears now, there is nothing defined that a driver > author should do to verify that their driver performs properly, or > supports the right capabilities etc. Some things may be difficult to > automate, but simply having a checklist would be great. For the things > that can be automated, that would be even better. Great. We can do some of this. I would like to ask, what mimimal types of tests do you expect to execute for a driver? If several can respond to the types of testing they perform, we can start a checklist. Then, additional items can be added to fill in the holes. I've asked Cliff White of OSDL to help put this together. From shemminger@osdl.org Wed Jan 12 10:10:10 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 10:10:16 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CIAA3Y006657 for ; Wed, 12 Jan 2005 10:10:10 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0CI9xY19060; Wed, 12 Jan 2005 10:09:59 -0800 Date: Wed, 12 Jan 2005 10:10:01 -0800 From: Stephen Hemminger To: Craig Thomas Cc: David Hollis , netdev@oss.sgi.com, cliff white Subject: Re: Network driver test suite? Message-ID: <20050112101001.20ccc59d@dxpl.pdx.osdl.net> In-Reply-To: <1105550041.28674.53.camel@bullpen.pdx.osdl.net> References: <20050105152635.290ad9c0@dxpl.pdx.osdl.net> <1105493554.28674.49.camel@bullpen.pdx.osdl.net> <1105547064.5940.5.camel@dhollis-lnx.centricconsulting.com> <1105550041.28674.53.camel@bullpen.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 157 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev On Wed, 12 Jan 2005 09:14:01 -0800 Craig Thomas wrote: > On Wed, 2005-01-12 at 08:24, David Hollis wrote: > > On Tue, 2005-01-11 at 17:32 -0800, Craig Thomas wrote: > > > > > > > > Would there be a desire for someone to collect the tests or at least > > > create an index to all their locations? If so, then developers can > > > scan a library of potential tests to run against newly developed code. > > > > > > OSDL can start incorporating some of these tests into their test > > > platform as well. > > > > I would love to see a collection of the types of tests that should be > > performed. As it appears now, there is nothing defined that a driver > > author should do to verify that their driver performs properly, or > > supports the right capabilities etc. Some things may be difficult to > > automate, but simply having a checklist would be great. For the things > > that can be automated, that would be even better. > > Great. We can do some of this. I would like to ask, what mimimal > types of tests do you expect to execute for a driver? If several > can respond to the types of testing they perform, we can start > a checklist. Then, additional items can be added to fill in the > holes. I've asked Cliff White of OSDL to help put this together. There are two types of tests that would be easy to set up. First is a full exercise of all the possible API transitions through ifconfig, ip link, and ethtool. These could be covered without any traffic going through. Then setup a standard test environment with a known good card and a crossover cable. The test could then use raw (and/or packet generator) to send packets down good card to card to be verified. Also testing, auto negotiation and transitions under load. From greearb@candelatech.com Wed Jan 12 10:15:41 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 10:15:47 -0800 (PST) Received: from www.lanforge.com (ns1.lanforge.com [66.165.47.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CIFfWQ007229 for ; Wed, 12 Jan 2005 10:15:41 -0800 Received: from [4.33.45.22] (evrtwa1-ar2-4-33-045-022.evrtwa1.dsl-verizon.net [4.33.45.22]) (authenticated bits=0) by www.lanforge.com (8.12.8/8.12.8) with ESMTP id j0CIW8LH007645; Wed, 12 Jan 2005 10:32:09 -0800 Message-ID: <41E56946.2050503@candelatech.com> Date: Wed, 12 Jan 2005 10:15:34 -0800 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041020 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Craig Thomas CC: David Hollis , netdev@oss.sgi.com, cliff white , shemminger@osdl.org Subject: Re: Fw: Network driver test suite? References: <20050105152635.290ad9c0@dxpl.pdx.osdl.net> <1105493554.28674.49.camel@bullpen.pdx.osdl.net> <1105547064.5940.5.camel@dhollis-lnx.centricconsulting.com> <1105550041.28674.53.camel@bullpen.pdx.osdl.net> In-Reply-To: <1105550041.28674.53.camel@bullpen.pdx.osdl.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 158 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Craig Thomas wrote: > On Wed, 2005-01-12 at 08:24, David Hollis wrote: > >>On Tue, 2005-01-11 at 17:32 -0800, Craig Thomas wrote: >> >> >>>Would there be a desire for someone to collect the tests or at least >>>create an index to all their locations? If so, then developers can >>>scan a library of potential tests to run against newly developed code. >>> >>>OSDL can start incorporating some of these tests into their test >>>platform as well. >> >>I would love to see a collection of the types of tests that should be >>performed. As it appears now, there is nothing defined that a driver >>author should do to verify that their driver performs properly, or >>supports the right capabilities etc. Some things may be difficult to >>automate, but simply having a checklist would be great. For the things >>that can be automated, that would be even better. > > > Great. We can do some of this. I would like to ask, what mimimal > types of tests do you expect to execute for a driver? If several > can respond to the types of testing they perform, we can start > a checklist. Then, additional items can be added to fill in the > holes. I've asked Cliff White of OSDL to help put this together. My wishlist includes: set and verify all supported link speeds (auto-negotiate, 10Mbps fixed, 100Mbps fixed, 1Gbps, full/half duplex, etc) set & verify various MTUs At each speed, generate maximum amount of packets: tx only rx only tx + rx Could use pktgen for this as it does not ARP or do other protocol things would complicate rx-only and tx-only testing. Could also do randomized packet sizes or step through a bunch of different sizes. Could randomize rates and other things with pktgen as well. Determine number of dropped & errored packets at each phase. This should be verified by counting the number of packets transmitted v/s received and coorelated against any drop/error counters that the driver reports. Generate TCP & UDP traffic at various speeds to make sure it handles protocols correctly too. Run a similar battery of tests against 802.1Q VLANS on the interfaces in question. I have a proprietary tool and some GPL kernel patches that can do most of this. A bash/perl script utilizing ethtool and and pktgen (especially a version of pktgen similar to the one in my patches which also receives packets and reports statistics on them) and a few other tcp & udp generating tools could also do this (and in a more transparent manner, probably.) Please contact me off the list if you want to discuss free use of the proprietary tool. Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From rddunlap@osdl.org Wed Jan 12 10:25:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 10:25:56 -0800 (PST) Received: from fire-1.osdl.org (fire.osdl.org [65.172.181.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CIPmUa007934 for ; Wed, 12 Jan 2005 10:25:48 -0800 Received: from [172.20.1.49] (fw.osdl.org [65.172.181.6]) (authenticated bits=0) by fire-1.osdl.org (8.12.8/8.12.8) with ESMTP id j0CIPc7s020687 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Wed, 12 Jan 2005 10:25:38 -0800 Message-ID: <41E56AA9.2060800@osdl.org> Date: Wed, 12 Jan 2005 10:21:29 -0800 From: "Randy.Dunlap" Organization: OSDL User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: Craig Thomas , David Hollis , netdev@oss.sgi.com, cliff white Subject: Re: Network driver test suite? References: <20050105152635.290ad9c0@dxpl.pdx.osdl.net> <1105493554.28674.49.camel@bullpen.pdx.osdl.net> <1105547064.5940.5.camel@dhollis-lnx.centricconsulting.com> <1105550041.28674.53.camel@bullpen.pdx.osdl.net> <20050112101001.20ccc59d@dxpl.pdx.osdl.net> In-Reply-To: <20050112101001.20ccc59d@dxpl.pdx.osdl.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-MIMEDefang-Filter: osdl$Revision: 1.98 $ X-Scanned-By: MIMEDefang 2.36 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 159 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Stephen Hemminger wrote: > On Wed, 12 Jan 2005 09:14:01 -0800 > Craig Thomas wrote: > > >>On Wed, 2005-01-12 at 08:24, David Hollis wrote: >> >>>On Tue, 2005-01-11 at 17:32 -0800, Craig Thomas wrote: >>> >>> >>>>Would there be a desire for someone to collect the tests or at least >>>>create an index to all their locations? If so, then developers can >>>>scan a library of potential tests to run against newly developed code. >>>> >>>>OSDL can start incorporating some of these tests into their test >>>>platform as well. >>> >>>I would love to see a collection of the types of tests that should be >>>performed. As it appears now, there is nothing defined that a driver >>>author should do to verify that their driver performs properly, or >>>supports the right capabilities etc. Some things may be difficult to >>>automate, but simply having a checklist would be great. For the things >>>that can be automated, that would be even better. >> >>Great. We can do some of this. I would like to ask, what mimimal >>types of tests do you expect to execute for a driver? If several >>can respond to the types of testing they perform, we can start >>a checklist. Then, additional items can be added to fill in the >>holes. I've asked Cliff White of OSDL to help put this together. > > > There are two types of tests that would be easy to set up. > First is a full exercise of all the possible API transitions through > ifconfig, ip link, and ethtool. These could be covered without any > traffic going through. > > Then setup a standard test environment with a known good card and a > crossover cable. The test could then use raw (and/or packet generator) > to send packets down good card to card to be verified. > > Also testing, auto negotiation and transitions under load. Other than API testing, stats interface testing, & link/speed verification, the most useful test that I ever did in NIC driver development (Natl Semi & Intel) was just traffic saturation: copy and compare files for hours, log (and optionally stop on) compare errors. -- ~Randy From davem@davemloft.net Wed Jan 12 11:08:50 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 11:08:57 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CJ8oR3009222 for ; Wed, 12 Jan 2005 11:08:50 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Conkw-0005Ry-00; Wed, 12 Jan 2005 11:02:10 -0800 Date: Wed, 12 Jan 2005 11:02:10 -0800 From: "David S. Miller" To: Thomas Graf Cc: yoshfuji@linux-ipv6.org, buytenh@wantstofly.org, netdev@oss.sgi.com Subject: Re: race in net/ipv4/ipip.c ? Message-Id: <20050112110210.18ccda02.davem@davemloft.net> In-Reply-To: <20050112132126.GI26856@postel.suug.ch> References: <20050112122300.GA12155@xi.wantstofly.org> <20050112125336.GH26856@postel.suug.ch> <20050112130940.GA12547@xi.wantstofly.org> <20050112122300.GA12155@xi.wantstofly.org> <20050112125336.GH26856@postel.suug.ch> <20050112.220816.56650893.yoshfuji@linux-ipv6.org> <20050112132126.GI26856@postel.suug.ch> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 160 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Wed, 12 Jan 2005 14:21:26 +0100 Thomas Graf wrote: > * YOSHIFUJI Hideaki / ?$B5HF#1QL@ <20050112.220816.56650893.yoshfuji@linux-ipv6.org> 2005-01-12 22:08 > > How about adding multiple tunnels (with same ipip_bucket(t)) > > concurrently? :-) > > > > * Lennert Buytenhek <20050112130940.GA12547@xi.wantstofly.org> 2005-01-12 14:09 > > What if you add two tunnels at the same time? (Or is that perhaps > > synchronised on a higher level?) > > Not possible, protected via rtnl semaphore acquired in default > handler of dev_ioctl. Yeah. Alexey does this trick everywhere, when we have the RTNL semaphore held we only need to lock for the actual linkage operation that adds the new object to the tree. From Robert.Olsson@data.slu.se Wed Jan 12 11:27:57 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 11:28:02 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CJRuTj013339 for ; Wed, 12 Jan 2005 11:27:57 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0CJRe6H029874; Wed, 12 Jan 2005 20:27:40 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 51EA7EC1A0; Wed, 12 Jan 2005 20:27:40 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16869.31276.256679.96845@robur.slu.se> Date: Wed, 12 Jan 2005 20:27:40 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson , Stephen Hemminger , Jesse Brandeburg Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501121025.03899.jeremy.guthrie@berbee.com> References: <200501111927.15574.jeremy.guthrie@berbee.com> <16869.15931.324875.264756@robur.slu.se> <200501121025.03899.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 161 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > > > ETH3 Interrupts(calc'd from below): 1479968 > > Very strange... > > > > eth3 is bound to CPU0 which in turn has all packet load... If we were > > to believe your CPU0 was saturated (due to the drops). We should see no > > (RX) interrupts on eth3. But there is a lot... one irq per every three > > packet. Why? > I have no idea why it would be doing this. Huh seems you didn't add the patch I sent. Below is diff from my editor to your e1000_main.c --ro --- e1000_main.c.jmg 2005-01-12 20:14:08.324168072 +0100 +++ e1000_main.c 2005-01-12 20:17:24.777302656 +0100 @@ -2264,14 +2264,13 @@ netdev->quota -= work_done; /* if no Rx and Tx cleanup work was done, exit the polling mode */ - if(!tx_cleaned || (work_done < work_to_do) || - !netif_running(netdev)) { + if( (!tx_cleaned && (work_done == 0)) || !netif_running(netdev)) { quit_polling: netif_rx_complete(netdev); e1000_irq_enable(adapter); return 0; } - return (work_done >= work_to_do); + return 1; } #endif From jeremy.guthrie@berbee.com Wed Jan 12 12:11:56 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 12:12:02 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CKBtrY014691 for ; Wed, 12 Jan 2005 12:11:56 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 12 Jan 2005 14:11:50 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Wed, 12 Jan 2005 14:11:44 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson , Stephen Hemminger , Jesse Brandeburg References: <200501121025.03899.jeremy.guthrie@berbee.com> <16869.31276.256679.96845@robur.slu.se> In-Reply-To: <16869.31276.256679.96845@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1147358.Q3c28OLpKu"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501121411.49293.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 12 Jan 2005 20:11:50.0204 (UTC) FILETIME=[F35667C0:01C4F8E2] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 162 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart1147358.Q3c28OLpKu Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Latest numbers after your patch Robert. Wed Jan 12 14:05:36 CST 2005 eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255.0 inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:21951496 errors:2412189 dropped:2412189 overruns:37709= 0=20 frame:0 TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3455362966 (3295.2 Mb) TX bytes:398 (398.0 b) Base address:0x22a0 Memory:eff80000-effa0000 95b83157 150dc67c 00c734a1 000d2659 00000000 00000000 00000000 00000000=20 0073cee4 00044494 00000000 00000075 00000000 00000000 00000000 00000000 00000000=20 00097c77 entries in_hit in_slow_tot in_no_route in_brd in_martian_dst in_martian_sr= c =20 out_hit out_slow_tot out_slow_mc gc_total gc_ignored gc_goal_miss=20 gc_dst_overflow in_hlist_search out_hlist_search 0000f8cd 41403122 34c30e49 00000000 00000000 0000b0dd 00006a38 00000002 =20 0027279d 0004147b 00000000 2f528a5f 2f42efcf 0000104f 00000000 81d262df=20 00c5d75c 0000f8cd 0000e332 0003238f 00000000 00000000 00004263 00000000 00000000 =20 0000001e 000000c0 00000002 00004650 00004626 00000000 00000000 0016b879=20 0000024c Wed Jan 12 14:06:36 CST 2005 eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255.0 inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:28053281 errors:2899869 dropped:2899869 overruns:42724= 3=20 frame:0 TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2607094069 (2486.3 Mb) TX bytes:398 (398.0 b) Base address:0x22a0 Memory:eff80000-effa0000 96154d20 150dc67c 00c78bc2 000d2659 00000000 00000000 00000000 00000000=20 0073d31d 00044499 00000000 00000075 00000000 00000000 00000000 00000000 00000000=20 00097d2d entries in_hit in_slow_tot in_no_route in_brd in_martian_dst in_martian_sr= c =20 out_hit out_slow_tot out_slow_mc gc_total gc_ignored gc_goal_miss=20 gc_dst_overflow in_hlist_search out_hlist_search 0000fc6a 419ad196 34c586ba 00000000 00000000 0000b0e0 00006a40 00000002 =20 002729c5 000414cb 00000000 2f5502ff 2f4567f7 0000104f 00000000 83790467=20 00c5e33c 0000fc6a 0000e333 00032393 00000000 00000000 00004263 00000000 00000000 =20 0000001e 000000c0 00000002 00004650 00004626 00000000 00000000 0016b898=20 0000024c On Wednesday 12 January 2005 01:27 pm, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > > > ETH3 Interrupts(calc'd from below): 1479968 > > > > > > Very strange... > > > > > > eth3 is bound to CPU0 which in turn has all packet load... If we we= re > > > to believe your CPU0 was saturated (due to the drops). We should see > > > no (RX) interrupts on eth3. But there is a lot... one irq per every > > > three packet. Why? > > > > I have no idea why it would be doing this. > > Huh seems you didn't add the patch I sent. Below is diff from my editor = to > your e1000_main.c > > --ro > > > --- e1000_main.c.jmg 2005-01-12 20:14:08.324168072 +0100 > +++ e1000_main.c 2005-01-12 20:17:24.777302656 +0100 > @@ -2264,14 +2264,13 @@ > netdev->quota -=3D work_done; > > /* if no Rx and Tx cleanup work was done, exit the polling mode */ > - if(!tx_cleaned || (work_done < work_to_do) || > - !netif_running(netdev)) { > + if( (!tx_cleaned && (work_done =3D=3D 0)) || !netif_running(netdev)) { > quit_polling: netif_rx_complete(netdev); > e1000_irq_enable(adapter); > return 0; > } > > - return (work_done >=3D work_to_do); > + return 1; > } > > #endif =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart1147358.Q3c28OLpKu Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB5YSFqtjaBHGZBeURAmUzAKCBI9kQoINrawyGtnZ33aAbEiFA6ACeKo1z +dxuYk0w+TvisnIe8CbPDFc= =xRTg -----END PGP SIGNATURE----- --nextPart1147358.Q3c28OLpKu-- From Robert.Olsson@data.slu.se Wed Jan 12 12:21:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 12:22:01 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CKLrJH018649 for ; Wed, 12 Jan 2005 12:21:54 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0CKLhIK002933; Wed, 12 Jan 2005 21:21:43 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 12348EC1A0; Wed, 12 Jan 2005 21:21:43 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16869.34519.31321.977100@robur.slu.se> Date: Wed, 12 Jan 2005 21:21:43 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson , Stephen Hemminger , Jesse Brandeburg Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501121411.49293.jeremy.guthrie@berbee.com> References: <200501121025.03899.jeremy.guthrie@berbee.com> <16869.31276.256679.96845@robur.slu.se> <200501121411.49293.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 163 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > > Latest numbers after your patch Robert. Did the RX interrupts go down? --ro > Wed Jan 12 14:05:36 CST 2005 > eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 > inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255.0 > inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:21951496 errors:2412189 dropped:2412189 overruns:377090 > frame:0 > TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:1000 > RX bytes:3455362966 (3295.2 Mb) TX bytes:398 (398.0 b) > Base address:0x22a0 Memory:eff80000-effa0000 > > 95b83157 150dc67c 00c734a1 000d2659 00000000 00000000 00000000 00000000 > 0073cee4 > 00044494 00000000 00000075 00000000 00000000 00000000 00000000 00000000 > 00097c77 > entries in_hit in_slow_tot in_no_route in_brd in_martian_dst in_martian_src > out_hit out_slow_tot out_slow_mc gc_total gc_ignored gc_goal_miss > gc_dst_overflow in_hlist_search out_hlist_search > 0000f8cd 41403122 34c30e49 00000000 00000000 0000b0dd 00006a38 00000002 > 0027279d 0004147b 00000000 2f528a5f 2f42efcf 0000104f 00000000 81d262df > 00c5d75c > 0000f8cd 0000e332 0003238f 00000000 00000000 00004263 00000000 00000000 > 0000001e 000000c0 00000002 00004650 00004626 00000000 00000000 0016b879 > 0000024c > > > > > > Wed Jan 12 14:06:36 CST 2005 > eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 > inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255.0 > inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > RX packets:28053281 errors:2899869 dropped:2899869 overruns:427243 > frame:0 > TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:1000 > RX bytes:2607094069 (2486.3 Mb) TX bytes:398 (398.0 b) > Base address:0x22a0 Memory:eff80000-effa0000 > > 96154d20 150dc67c 00c78bc2 000d2659 00000000 00000000 00000000 00000000 > 0073d31d > 00044499 00000000 00000075 00000000 00000000 00000000 00000000 00000000 > 00097d2d > entries in_hit in_slow_tot in_no_route in_brd in_martian_dst in_martian_src > out_hit out_slow_tot out_slow_mc gc_total gc_ignored gc_goal_miss > gc_dst_overflow in_hlist_search out_hlist_search > 0000fc6a 419ad196 34c586ba 00000000 00000000 0000b0e0 00006a40 00000002 > 002729c5 000414cb 00000000 2f5502ff 2f4567f7 0000104f 00000000 83790467 > 00c5e33c > 0000fc6a 0000e333 00032393 00000000 00000000 00004263 00000000 00000000 > 0000001e 000000c0 00000002 00004650 00004626 00000000 00000000 0016b898 > 0000024c > > > On Wednesday 12 January 2005 01:27 pm, Robert Olsson wrote: > > Jeremy M. Guthrie writes: > > > > > ETH3 Interrupts(calc'd from below): 1479968 > > > > > > > > Very strange... > > > > > > > > eth3 is bound to CPU0 which in turn has all packet load... If we were > > > > to believe your CPU0 was saturated (due to the drops). We should see > > > > no (RX) interrupts on eth3. But there is a lot... one irq per every > > > > three packet. Why? > > > > > > I have no idea why it would be doing this. > > > > Huh seems you didn't add the patch I sent. Below is diff from my editor to > > your e1000_main.c > > > > --ro > > > > > > --- e1000_main.c.jmg 2005-01-12 20:14:08.324168072 +0100 > > +++ e1000_main.c 2005-01-12 20:17:24.777302656 +0100 > > @@ -2264,14 +2264,13 @@ > > netdev->quota -= work_done; > > > > /* if no Rx and Tx cleanup work was done, exit the polling mode */ > > - if(!tx_cleaned || (work_done < work_to_do) || > > - !netif_running(netdev)) { > > + if( (!tx_cleaned && (work_done == 0)) || !netif_running(netdev)) { > > quit_polling: netif_rx_complete(netdev); > > e1000_irq_enable(adapter); > > return 0; > > } > > > > - return (work_done >= work_to_do); > > + return 1; > > } > > > > #endif > > -- > > -------------------------------------------------- > Jeremy M. Guthrie jeremy.guthrie@berbee.com > Senior Network Engineer Phone: 608-298-1061 > Berbee Fax: 608-288-3007 > 5520 Research Park Drive NOC: 608-298-1102 > Madison, WI 53711 From jeremy.guthrie@berbee.com Wed Jan 12 12:30:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 12:30:16 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CKUAtR019237 for ; Wed, 12 Jan 2005 12:30:10 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 12 Jan 2005 14:30:04 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Wed, 12 Jan 2005 14:30:00 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson , Stephen Hemminger , Jesse Brandeburg References: <200501121411.49293.jeremy.guthrie@berbee.com> <16869.34519.31321.977100@robur.slu.se> In-Reply-To: <16869.34519.31321.977100@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3725316.Z5xNv7sXvu"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501121430.03763.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 12 Jan 2005 20:30:04.0687 (UTC) FILETIME=[7FB341F0:01C4F8E5] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 164 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart3725316.Z5xNv7sXvu Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Sorry, here is the latest. BTW, it is VERY sluggish now. Wed Jan 12 14:25:03 CST 2005 eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 RX packets:32030222 errors:105026820 dropped:105026820=20 overruns:100748696 frame:0 9651ffeb 150dc67c 00c814c1 000d2659 00000000 00000000 00000000 00000000=20 0073d527 00044681 00000000 000000f8 00000000 00000000 00000000 00000000 00000000=20 00097d42 entries in_hit in_slow_tot in_no_route in_brd in_martian_dst in_martian_sr= c =20 out_hit out_slow_tot out_slow_mc gc_total gc_ignored gc_goal_miss=20 gc_dst_overflow in_hlist_search out_hlist_search 00020000 41c25a6f 34daaca8 00000000 00000000 0000b11d 00006a40 00000002 =20 00272af5 00041525 00000000 2f6a27e5 2f4b712d 000f2bd8 000f1b0e 84036c96=20 00c5e8a8 00020000 0000e336 0003256f 00000000 00000000 00004292 00000000 00000000 =20 0000001e 000000c0 00000002 00004762 0000462a 0000010e 0000010b 0016b898=20 0000024c CPU0 CPU1 18: 3586173518 1815 IO-APIC-level eth3 20: 2 2464382507 IO-APIC-level eth2 Wed Jan 12 14:26:03 CST 2005 eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 RX packets:32097966 errors:110579564 dropped:110579564=20 overruns:106248073 frame:0 965308aa 150dc67c 00c818e4 000d2659 00000000 00000000 00000000 00000000=20 0073d527 0004468b 00000000 000000f8 00000000 00000000 00000000 00000000 00000000=20 00097d42 entries in_hit in_slow_tot in_no_route in_brd in_martian_dst in_martian_sr= c =20 out_hit out_slow_tot out_slow_mc gc_total gc_ignored gc_goal_miss=20 gc_dst_overflow in_hlist_search out_hlist_search 00020000 41c2602e 34dbaf9f 00000000 00000000 0000b11e 00006a40 00000002 =20 00272af5 00041527 00000000 2f6b2ad8 2f4b9a88 00100571 000ff4a4 84036c9e=20 00c5e8a8 00020000 0000e336 00032578 00000000 00000000 00004292 00000000 00000000 =20 0000001e 000000c0 00000002 00004762 0000462a 0000010e 0000010b 0016b898=20 0000024c CPU0 CPU1 18: 3586173518 1815 IO-APIC-level eth3 20: 2 2464387985 IO-APIC-level eth2 On Wednesday 12 January 2005 02:21 pm, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > Latest numbers after your patch Robert. > > Did the RX interrupts go down? > > --ro > > > Wed Jan 12 14:05:36 CST 2005 > > eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 > > inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255= =2E0 > > inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link > > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > > RX packets:21951496 errors:2412189 dropped:2412189 > > overruns:377090 frame:0 > > TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 > > collisions:0 txqueuelen:1000 > > RX bytes:3455362966 (3295.2 Mb) TX bytes:398 (398.0 b) > > Base address:0x22a0 Memory:eff80000-effa0000 > > > > 95b83157 150dc67c 00c734a1 000d2659 00000000 00000000 00000000 00000000 > > 0073cee4 > > 00044494 00000000 00000075 00000000 00000000 00000000 00000000 00000000 > > 00097c77 > > entries in_hit in_slow_tot in_no_route in_brd in_martian_dst > > in_martian_src out_hit out_slow_tot out_slow_mc gc_total gc_ignored > > gc_goal_miss gc_dst_overflow in_hlist_search out_hlist_search > > 0000f8cd 41403122 34c30e49 00000000 00000000 0000b0dd 00006a38 000000= 02 > > 0027279d 0004147b 00000000 2f528a5f 2f42efcf 0000104f 00000000 81d262df > > 00c5d75c > > 0000f8cd 0000e332 0003238f 00000000 00000000 00004263 00000000 000000= 00 > > 0000001e 000000c0 00000002 00004650 00004626 00000000 00000000 0016b879 > > 0000024c > > > > > > > > > > > > Wed Jan 12 14:06:36 CST 2005 > > eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 > > inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255= =2E0 > > inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link > > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > > RX packets:28053281 errors:2899869 dropped:2899869 > > overruns:427243 frame:0 > > TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 > > collisions:0 txqueuelen:1000 > > RX bytes:2607094069 (2486.3 Mb) TX bytes:398 (398.0 b) > > Base address:0x22a0 Memory:eff80000-effa0000 > > > > 96154d20 150dc67c 00c78bc2 000d2659 00000000 00000000 00000000 00000000 > > 0073d31d > > 00044499 00000000 00000075 00000000 00000000 00000000 00000000 00000000 > > 00097d2d > > entries in_hit in_slow_tot in_no_route in_brd in_martian_dst > > in_martian_src out_hit out_slow_tot out_slow_mc gc_total gc_ignored > > gc_goal_miss gc_dst_overflow in_hlist_search out_hlist_search > > 0000fc6a 419ad196 34c586ba 00000000 00000000 0000b0e0 00006a40 000000= 02 > > 002729c5 000414cb 00000000 2f5502ff 2f4567f7 0000104f 00000000 83790467 > > 00c5e33c > > 0000fc6a 0000e333 00032393 00000000 00000000 00004263 00000000 000000= 00 > > 0000001e 000000c0 00000002 00004650 00004626 00000000 00000000 0016b898 > > 0000024c > > > > On Wednesday 12 January 2005 01:27 pm, Robert Olsson wrote: > > > Jeremy M. Guthrie writes: > > > > > > ETH3 Interrupts(calc'd from below): 1479968 > > > > > > > > > > Very strange... > > > > > > > > > > eth3 is bound to CPU0 which in turn has all packet load... If = we > > > > > were to believe your CPU0 was saturated (due to the drops). We > > > > > should see no (RX) interrupts on eth3. But there is a lot... one > > > > > irq per every three packet. Why? > > > > > > > > I have no idea why it would be doing this. > > > > > > Huh seems you didn't add the patch I sent. Below is diff from my > > > editor to your e1000_main.c > > > > > > --ro > > > > > > > > > --- e1000_main.c.jmg 2005-01-12 20:14:08.324168072 +0100 > > > +++ e1000_main.c 2005-01-12 20:17:24.777302656 +0100 > > > @@ -2264,14 +2264,13 @@ > > > netdev->quota -=3D work_done; > > > > > > /* if no Rx and Tx cleanup work was done, exit the polling mode */ > > > - if(!tx_cleaned || (work_done < work_to_do) || > > > - !netif_running(netdev)) { > > > + if( (!tx_cleaned && (work_done =3D=3D 0)) || !netif_running(netde= v)) { > > > quit_polling: netif_rx_complete(netdev); > > > e1000_irq_enable(adapter); > > > return 0; > > > } > > > > > > - return (work_done >=3D work_to_do); > > > + return 1; > > > } > > > > > > #endif > > > > -- > > > > -------------------------------------------------- > > Jeremy M. Guthrie jeremy.guthrie@berbee.com > > Senior Network Engineer Phone: 608-298-1061 > > Berbee Fax: 608-288-3007 > > 5520 Research Park Drive NOC: 608-298-1102 > > Madison, WI 53711 =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart3725316.Z5xNv7sXvu Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB5YjLqtjaBHGZBeURAsH+AJ0efVnD+xMKqNPI20V57D1VNckiFwCdGErU XYeWyG64OPtmrDUj7/SJQkU= =4akK -----END PGP SIGNATURE----- --nextPart3725316.Z5xNv7sXvu-- From jeremy.guthrie@berbee.com Wed Jan 12 12:45:59 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 12:46:05 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CKjwWF019975 for ; Wed, 12 Jan 2005 12:45:59 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 12 Jan 2005 14:45:52 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Wed, 12 Jan 2005 14:45:48 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson , Stephen Hemminger , Jesse Brandeburg References: <200501121411.49293.jeremy.guthrie@berbee.com> <16869.34519.31321.977100@robur.slu.se> In-Reply-To: <16869.34519.31321.977100@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart7627456.7K3XhOKuEN"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501121445.51780.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 12 Jan 2005 20:45:52.0762 (UTC) FILETIME=[B4CC05A0:01C4F8E7] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 165 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart7627456.7K3XhOKuEN Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline My throughput dropped from 500 mbps to 8mbps. 8( On Wednesday 12 January 2005 02:21 pm, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > Latest numbers after your patch Robert. > > Did the RX interrupts go down? > > --ro > > > Wed Jan 12 14:05:36 CST 2005 > > eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 > > inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255= =2E0 > > inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link > > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > > RX packets:21951496 errors:2412189 dropped:2412189 > > overruns:377090 frame:0 > > TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 > > collisions:0 txqueuelen:1000 > > RX bytes:3455362966 (3295.2 Mb) TX bytes:398 (398.0 b) > > Base address:0x22a0 Memory:eff80000-effa0000 > > > > 95b83157 150dc67c 00c734a1 000d2659 00000000 00000000 00000000 00000000 > > 0073cee4 > > 00044494 00000000 00000075 00000000 00000000 00000000 00000000 00000000 > > 00097c77 > > entries in_hit in_slow_tot in_no_route in_brd in_martian_dst > > in_martian_src out_hit out_slow_tot out_slow_mc gc_total gc_ignored > > gc_goal_miss gc_dst_overflow in_hlist_search out_hlist_search > > 0000f8cd 41403122 34c30e49 00000000 00000000 0000b0dd 00006a38 000000= 02 > > 0027279d 0004147b 00000000 2f528a5f 2f42efcf 0000104f 00000000 81d262df > > 00c5d75c > > 0000f8cd 0000e332 0003238f 00000000 00000000 00004263 00000000 000000= 00 > > 0000001e 000000c0 00000002 00004650 00004626 00000000 00000000 0016b879 > > 0000024c > > > > > > > > > > > > Wed Jan 12 14:06:36 CST 2005 > > eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 > > inet addr:10.253.0.1 Bcast:10.255.255.255 Mask:255.255.255= =2E0 > > inet6 addr: fe80::202:b3ff:fed5:7e30/64 Scope:Link > > UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 > > RX packets:28053281 errors:2899869 dropped:2899869 > > overruns:427243 frame:0 > > TX packets:5 errors:0 dropped:0 overruns:0 carrier:0 > > collisions:0 txqueuelen:1000 > > RX bytes:2607094069 (2486.3 Mb) TX bytes:398 (398.0 b) > > Base address:0x22a0 Memory:eff80000-effa0000 > > > > 96154d20 150dc67c 00c78bc2 000d2659 00000000 00000000 00000000 00000000 > > 0073d31d > > 00044499 00000000 00000075 00000000 00000000 00000000 00000000 00000000 > > 00097d2d > > entries in_hit in_slow_tot in_no_route in_brd in_martian_dst > > in_martian_src out_hit out_slow_tot out_slow_mc gc_total gc_ignored > > gc_goal_miss gc_dst_overflow in_hlist_search out_hlist_search > > 0000fc6a 419ad196 34c586ba 00000000 00000000 0000b0e0 00006a40 000000= 02 > > 002729c5 000414cb 00000000 2f5502ff 2f4567f7 0000104f 00000000 83790467 > > 00c5e33c > > 0000fc6a 0000e333 00032393 00000000 00000000 00004263 00000000 000000= 00 > > 0000001e 000000c0 00000002 00004650 00004626 00000000 00000000 0016b898 > > 0000024c > > > > On Wednesday 12 January 2005 01:27 pm, Robert Olsson wrote: > > > Jeremy M. Guthrie writes: > > > > > > ETH3 Interrupts(calc'd from below): 1479968 > > > > > > > > > > Very strange... > > > > > > > > > > eth3 is bound to CPU0 which in turn has all packet load... If = we > > > > > were to believe your CPU0 was saturated (due to the drops). We > > > > > should see no (RX) interrupts on eth3. But there is a lot... one > > > > > irq per every three packet. Why? > > > > > > > > I have no idea why it would be doing this. > > > > > > Huh seems you didn't add the patch I sent. Below is diff from my > > > editor to your e1000_main.c > > > > > > --ro > > > > > > > > > --- e1000_main.c.jmg 2005-01-12 20:14:08.324168072 +0100 > > > +++ e1000_main.c 2005-01-12 20:17:24.777302656 +0100 > > > @@ -2264,14 +2264,13 @@ > > > netdev->quota -=3D work_done; > > > > > > /* if no Rx and Tx cleanup work was done, exit the polling mode */ > > > - if(!tx_cleaned || (work_done < work_to_do) || > > > - !netif_running(netdev)) { > > > + if( (!tx_cleaned && (work_done =3D=3D 0)) || !netif_running(netde= v)) { > > > quit_polling: netif_rx_complete(netdev); > > > e1000_irq_enable(adapter); > > > return 0; > > > } > > > > > > - return (work_done >=3D work_to_do); > > > + return 1; > > > } > > > > > > #endif > > > > -- > > > > -------------------------------------------------- > > Jeremy M. Guthrie jeremy.guthrie@berbee.com > > Senior Network Engineer Phone: 608-298-1061 > > Berbee Fax: 608-288-3007 > > 5520 Research Park Drive NOC: 608-298-1102 > > Madison, WI 53711 =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart7627456.7K3XhOKuEN Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB5Yx/qtjaBHGZBeURAhVPAJwMiwM+Ziz+1diuBLP8T9A3+z8D8QCfZD2w Si9Pix2G10nqfI+aC0PEpbA= =ZRDB -----END PGP SIGNATURE----- --nextPart7627456.7K3XhOKuEN-- From shemminger@osdl.org Wed Jan 12 12:59:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 12:59:13 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CKx66t020701 for ; Wed, 12 Jan 2005 12:59:07 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0CKx1Y21736 for ; Wed, 12 Jan 2005 12:59:01 -0800 Date: Wed, 12 Jan 2005 12:59:03 -0800 From: Stephen Hemminger To: netdev@oss.sgi.com Subject: Iproute2: update Message-ID: <20050112125903.64d42737@dxpl.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 166 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev There is an new version of iproute2 for testing. http://developer.osdl.org/dev/iproute2/download/iproute2-2.6.10-ss050112.tar.gz Mostly simple merges, but could have some issues. Jamal did I get everything you sent? [Masahide Nakamura] ipmonitor shows IPv6 prefix list notification update to iproute2 xfrm for ipv6 [Stephen Hemminger] fix compile warnings when building 64bit system don't include warning about "ip route nat" no longer supported [Catalin(ux aka Dino) BOIE] fwmark in u32 filters [Andi Kleen] netlink manual page [Thomas Graf] tc testsuite [Jamal Hadi Salim] iptables tc support mirror and redirect actions -- Stephen Hemminger From Robert.Olsson@data.slu.se Wed Jan 12 14:02:32 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 14:02:36 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CM2UZl023292 for ; Wed, 12 Jan 2005 14:02:31 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0CM2KDH013285; Wed, 12 Jan 2005 23:02:21 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id B7102EC1A0; Wed, 12 Jan 2005 23:02:20 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16869.40556.711969.512311@robur.slu.se> Date: Wed, 12 Jan 2005 23:02:20 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson , Stephen Hemminger , Jesse Brandeburg Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501121445.51780.jeremy.guthrie@berbee.com> References: <200501121411.49293.jeremy.guthrie@berbee.com> <16869.34519.31321.977100@robur.slu.se> <200501121445.51780.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 167 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > My throughput dropped from 500 mbps to 8mbps. 8( Weird! > CPU0 CPU1 > 18: 3586173518 1815 IO-APIC-level eth3 > 20: 2 2464382507 IO-APIC-level eth2 > CPU0 CPU1 > 18: 3586173518 1815 IO-APIC-level eth3 > 20: 2 2464387985 IO-APIC-level eth2 There are no irq's on eth3 at all so RX softirq is constantly running. Which means it's deferred to ksoftirqd now and running under scheduler context. Do you have anything that competes with ksoftirqd for CPU0 on your system? It used be recommended to increase the priority of ksoftirqd but I wonder what's going on your system. We see interrupts on eth2... And tsquz (3:rd col) in /proc/net/sofnet_stat indicates there are very little activity from the RX softirq. It's soon time time up here. --ro From jeremy.guthrie@berbee.com Wed Jan 12 14:05:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 14:05:26 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CM5IdZ023663 for ; Wed, 12 Jan 2005 14:05:19 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 12 Jan 2005 16:05:13 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Wed, 12 Jan 2005 16:05:10 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson , Stephen Hemminger , Jesse Brandeburg References: <16869.34519.31321.977100@robur.slu.se> <200501121445.51780.jeremy.guthrie@berbee.com> In-Reply-To: <200501121445.51780.jeremy.guthrie@berbee.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1475013.13S5U77Ulm"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501121605.12943.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 12 Jan 2005 22:05:13.0600 (UTC) FILETIME=[CA7A4000:01C4F8F2] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 168 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart1475013.13S5U77Ulm Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I am now getting some push back from the project manager on this performanc= e=20 problem. I am wondering if you think faster CPUs will=20 a) help relieve the symptoms of this problem b) not help because now we will hit a '# of routes in the route-cache'=20 problem c) or will help to a point till the # interrupts come back and bite us. =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart1475013.13S5U77Ulm Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB5Z8YqtjaBHGZBeURAjZqAJ4nK8vrstZD1lJXDxNquBecJTNl1ACgnJT4 mIP36veghO/2h8tSjj5zohA= =YLhj -----END PGP SIGNATURE----- --nextPart1475013.13S5U77Ulm-- From jeremy.guthrie@berbee.com Wed Jan 12 14:21:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 14:21:39 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CMLUjV025207 for ; Wed, 12 Jan 2005 14:21:31 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 12 Jan 2005 16:21:24 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Wed, 12 Jan 2005 16:21:20 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson , Stephen Hemminger , Jesse Brandeburg References: <200501121445.51780.jeremy.guthrie@berbee.com> <16869.40556.711969.512311@robur.slu.se> In-Reply-To: <16869.40556.711969.512311@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2100738.tuNY47F5dT"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501121621.24259.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 12 Jan 2005 22:21:24.0833 (UTC) FILETIME=[0D60A510:01C4F8F5] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 169 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart2100738.tuNY47F5dT Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wednesday 12 January 2005 04:02 pm, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > My throughput dropped from 500 mbps to 8mbps. 8( > > Weird! > > > CPU0 CPU1 > > 18: 3586173518 1815 IO-APIC-level eth3 > > 20: 2 2464382507 IO-APIC-level eth2 > > > > CPU0 CPU1 > > 18: 3586173518 1815 IO-APIC-level eth3 > > 20: 2 2464387985 IO-APIC-level eth2 > > There are no irq's on eth3 at all so RX softirq is constantly running. > Which means it's deferred to ksoftirqd now and running under scheduler > context. Do you have anything that competes with ksoftirqd for CPU0 on > your system? This box is primarily routing. Nothing should be competing for CPU0 > It used be recommended to increase the priority of ksoftirqd but I wonder > what's going on your system. We see interrupts on eth2... > > And tsquz (3:rd col) in /proc/net/sofnet_stat indicates there are very > little activity from the RX softirq. It's soon time time up here. > > > --ro =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart2100738.tuNY47F5dT Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB5aLkqtjaBHGZBeURAqPUAKCY4On9c9TeGVvpWsAhsTl2H5LyMACeKHrh LhFPTb7EqMTqNcD/NhLpwog= =93SE -----END PGP SIGNATURE----- --nextPart2100738.tuNY47F5dT-- From Robert.Olsson@data.slu.se Wed Jan 12 14:23:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 14:23:12 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CMN7hK025442 for ; Wed, 12 Jan 2005 14:23:08 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0CMMv8m015010; Wed, 12 Jan 2005 23:22:58 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id DFC8DEC1A0; Wed, 12 Jan 2005 23:22:57 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16869.41793.881555.323604@robur.slu.se> Date: Wed, 12 Jan 2005 23:22:57 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson , Stephen Hemminger , Jesse Brandeburg Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501121605.12943.jeremy.guthrie@berbee.com> References: <16869.34519.31321.977100@robur.slu.se> <200501121445.51780.jeremy.guthrie@berbee.com> <200501121605.12943.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 170 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > I am now getting some push back from the project manager on this performance > problem. I am wondering if you think faster CPUs will > a) help relieve the symptoms of this problem > b) not help because now we will hit a '# of routes in the route-cache' > problem > c) or will help to a point till the # interrupts come back and bite us. Back out the patch I sent.and have hardirq's to run RX-softirq as you did before but something is very wrong. You didn't answer if there were other load on the machine... route-cache can probably be tuned you as have four times the linear seach I see in one PIII system at 110 kpps w. production traffic. Of course the non-engineering solution is to buy more CPU... :-) --ro From buytenh@wantstofly.org Wed Jan 12 14:24:39 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 14:24:47 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CMOc2F026162 for ; Wed, 12 Jan 2005 14:24:38 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id 116022B0EC; Wed, 12 Jan 2005 23:24:37 +0100 (MET) Date: Wed, 12 Jan 2005 23:24:37 +0100 From: Lennert Buytenhek To: netdev@oss.sgi.com Cc: shemminger@osdl.org, rhousley@rsasecurity.com, shollenbeck@verisign.com Subject: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling Message-ID: <20050112222437.GC14280@xi.wantstofly.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 171 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev Hi, After struggling with various userland VPN solutions for a while (and failing to make IPSEC tunnel mode do what I want), I decided to just implement ethernet-in-IP tunneling in the kernel and let IPSEC transport mode handle the rest. There appeared to be an RFC for ethernet-in-IP already, RFC 3378, so I just implemented that. It's very simple -- slap a 16-bit header (0x3000, which is 4 bits of etherip version number and 12 bits of padding) onto the beginning of the ethernet packet, and then wrap it in an IP packet. Below is what I came up with, against the latest Fedora Core 3 kernel, which is 2.6.10-something. It survives some fairly basic testing between a number of different machines, UP and SMP. (Corresponding iproute2 patch is available from http://www.wantstofly.org/~buytenh/etherip/ ) Notes: - daddr=0 tunnel mode is meaningless for generic ethernet tunneling, so I didn't implement that. Packets are just dropped on the floor if daddr==0 at the time of sending, which is the default mode for the etherip0 device. Issues and TODO: - Implement MULTICAST(daddr) tunnel mode, seems useful to have. - Perhaps we should always present a MTU=1500 device to the user and deal with fragmentation issues ourselves. - Don't take TTL of outer packet from inner packet. - Figure out what to do with DF. - Check whether ECN bits are correctly {en,de}capsulated. - Check out iffy-looking '2 * sizeof(struct etheriphdr)' construct (same problem in ip_gre.c?) Comments? I would like to see this upstream when the remaining issues have been sorted out. cheers, Lennert diff -urN linux-2.6.10.orig/include/linux/in.h linux-2.6.10/include/linux/in.h --- linux-2.6.10.orig/include/linux/in.h 2005-01-12 21:44:31.000000000 +0100 +++ linux-2.6.10/include/linux/in.h 2005-01-12 21:44:28.000000000 +0100 @@ -39,6 +39,7 @@ IPPROTO_ESP = 50, /* Encapsulation Security Payload protocol */ IPPROTO_AH = 51, /* Authentication Header protocol */ + IPPROTO_ETHERIP = 97, /* Ethernet-in-IP tunneling (rfc 3378) */ IPPROTO_PIM = 103, /* Protocol Independent Multicast */ IPPROTO_COMP = 108, /* Compression Header protocol */ diff -urN linux-2.6.10.orig/net/ipv4/etherip.c linux-2.6.10/net/ipv4/etherip.c --- linux-2.6.10.orig/net/ipv4/etherip.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.10/net/ipv4/etherip.c 2005-01-12 22:09:51.699077165 +0100 @@ -0,0 +1,758 @@ +/* + * Linux NET3: Ethernet over IP protocol decoder. + * + * Authors: Alexey Kuznetsov (kuznet@ms2.inr.ac.ru) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + */ + +/* + This version of net/ipv4/etherip.c created by Lennert Buytenhek + by mashing net/ipv4/ip_gre.c and net/ipv4/ipip.c together. + + For comments look at net/ipv4/ip_gre.c + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef CONFIG_IPV6 +#include +#include +#include +#endif + +struct etheriphdr +{ + struct iphdr iph; + u16 version; +} __attribute__((packed)); + +#define HASH_SIZE 16 +#define HASH(addr) ((addr^(addr>>4))&0xF) + +#define ETHERIP_VERSION 0x3000 + +static int etherip_fb_tunnel_init(struct net_device *dev); +static int etherip_tunnel_init(struct net_device *dev); +static void etherip_tunnel_setup(struct net_device *dev); + +static struct net_device *etherip_fb_tunnel_dev; + +static struct ip_tunnel *tunnels_r_l[HASH_SIZE]; +static struct ip_tunnel *tunnels_r[HASH_SIZE]; +static struct ip_tunnel *tunnels_l[HASH_SIZE]; +static struct ip_tunnel *tunnels_wc[1]; + +static struct ip_tunnel **tunnels[4] = { tunnels_wc, tunnels_l, tunnels_r, tunnels_r_l }; + +static rwlock_t etherip_lock = RW_LOCK_UNLOCKED; + +static struct ip_tunnel * etherip_tunnel_lookup(u32 remote, u32 local) +{ + unsigned h0 = HASH(remote); + unsigned h1 = HASH(local); + struct ip_tunnel *t; + + for (t = tunnels_r_l[h0^h1]; t; t = t->next) { + if (local == t->parms.iph.saddr && + remote == t->parms.iph.daddr && (t->dev->flags&IFF_UP)) + return t; + } + for (t = tunnels_r[h0]; t; t = t->next) { + if (remote == t->parms.iph.daddr && (t->dev->flags&IFF_UP)) + return t; + } + for (t = tunnels_l[h1]; t; t = t->next) { + if (local == t->parms.iph.saddr && (t->dev->flags&IFF_UP)) + return t; + } + if ((t = tunnels_wc[0]) != NULL && (t->dev->flags&IFF_UP)) + return t; + return NULL; +} + +static struct ip_tunnel **etherip_bucket(struct ip_tunnel *t) +{ + u32 remote = t->parms.iph.daddr; + u32 local = t->parms.iph.saddr; + unsigned h = 0; + int prio = 0; + + if (remote) { + prio |= 2; + h ^= HASH(remote); + } + if (local) { + prio |= 1; + h ^= HASH(local); + } + return &tunnels[prio][h]; +} + +static void etherip_tunnel_unlink(struct ip_tunnel *t) +{ + struct ip_tunnel **tp; + + for (tp = etherip_bucket(t); *tp; tp = &(*tp)->next) { + if (t == *tp) { + write_lock_bh(ðerip_lock); + *tp = t->next; + write_unlock_bh(ðerip_lock); + break; + } + } +} + +static void etherip_tunnel_link(struct ip_tunnel *t) +{ + struct ip_tunnel **tp = etherip_bucket(t); + + t->next = *tp; + write_lock_bh(ðerip_lock); + *tp = t; + write_unlock_bh(ðerip_lock); +} + +static struct ip_tunnel * etherip_tunnel_locate(struct ip_tunnel_parm *parms, int create) +{ + u32 remote = parms->iph.daddr; + u32 local = parms->iph.saddr; + struct ip_tunnel *t, **tp, *nt; + struct net_device *dev; + unsigned h = 0; + int prio = 0; + char name[IFNAMSIZ]; + + if (remote) { + prio |= 2; + h ^= HASH(remote); + } + if (local) { + prio |= 1; + h ^= HASH(local); + } + for (tp = &tunnels[prio][h]; (t = *tp) != NULL; tp = &t->next) { + if (local == t->parms.iph.saddr && remote == t->parms.iph.daddr) + return t; + } + if (!create) + return NULL; + + if (parms->name[0]) + strlcpy(name, parms->name, IFNAMSIZ); + else { + int i; + for (i=1; i<100; i++) { + sprintf(name, "etherip%d", i); + if (__dev_get_by_name(name) == NULL) + break; + } + if (i==100) + goto failed; + } + + dev = alloc_netdev(sizeof(*t), name, etherip_tunnel_setup); + if (!dev) + return NULL; + + nt = dev->priv; + SET_MODULE_OWNER(dev); + dev->init = etherip_tunnel_init; + nt->parms = *parms; + + if (register_netdevice(dev) < 0) { + free_netdev(dev); + goto failed; + } + + dev_hold(dev); + etherip_tunnel_link(nt); + /* Do not decrement MOD_USE_COUNT here. */ + return nt; + +failed: + return NULL; +} + +static void etherip_tunnel_uninit(struct net_device *dev) +{ + if (dev == etherip_fb_tunnel_dev) { + write_lock_bh(ðerip_lock); + tunnels_wc[0] = NULL; + write_unlock_bh(ðerip_lock); + } else + etherip_tunnel_unlink((struct ip_tunnel*)dev->priv); + dev_put(dev); +} + + +void etherip_err(struct sk_buff *skb, u32 info) +{ +#ifndef I_WISH_WORLD_WERE_PERFECT +/* It is not :-( All the routers (except for Linux) return only + 8 bytes of packet payload. It means, that precise relaying of + ICMP in the real Internet is absolutely infeasible. + */ + + struct iphdr *iph = (struct iphdr*)skb->data; + int type = skb->h.icmph->type; + int code = skb->h.icmph->code; + struct ip_tunnel *t; + + switch (type) { + default: + case ICMP_PARAMETERPROB: + return; + + case ICMP_DEST_UNREACH: + switch (code) { + case ICMP_SR_FAILED: + case ICMP_PORT_UNREACH: + /* Impossible event. */ + return; + case ICMP_FRAG_NEEDED: + /* Soft state for pmtu is maintained by IP core. */ + return; + default: + /* All others are translated to HOST_UNREACH. + rfc2003 contains "deep thoughts" about NET_UNREACH, + I believe they are just ether pollution. --ANK + */ + break; + } + break; + case ICMP_TIME_EXCEEDED: + if (code != ICMP_EXC_TTL) + return; + break; + } + + read_lock(ðerip_lock); + t = etherip_tunnel_lookup(iph->daddr, iph->saddr); + if (t == NULL || t->parms.iph.daddr == 0) + goto out; + if (t->parms.iph.ttl == 0 && type == ICMP_TIME_EXCEEDED) + goto out; + + if (jiffies - t->err_time < IPTUNNEL_ERR_TIMEO) + t->err_count++; + else + t->err_count = 1; + t->err_time = jiffies; +out: + read_unlock(ðerip_lock); + return; +#endif +} + +static inline void etherip_ecn_decapsulate(struct iphdr *iph, struct sk_buff *skb) +{ + if (INET_ECN_is_ce(iph->tos)) { + if (skb->protocol == htons(ETH_P_IP)) { + IP_ECN_set_ce(skb->nh.iph); + } else if (skb->protocol == htons(ETH_P_IPV6)) { + IP6_ECN_set_ce(skb->nh.ipv6h); + } + } +} + +static inline u8 +etherip_ecn_encapsulate(u8 tos, struct iphdr *old_iph, struct sk_buff *skb) +{ + u8 inner = 0; + if (skb->protocol == htons(ETH_P_IP)) + inner = old_iph->tos; + else if (skb->protocol == htons(ETH_P_IPV6)) + inner = ipv6_get_dsfield((struct ipv6hdr *)old_iph); + return INET_ECN_encapsulate(tos, inner); +} + +int etherip_rcv(struct sk_buff *skb) +{ + struct iphdr *iph; + struct ip_tunnel *tunnel; + struct etheriphdr *ethiph; + + if (!pskb_may_pull(skb, sizeof(struct etheriphdr))) + goto out; + + ethiph = (struct etheriphdr *)skb->nh.raw; + if (ethiph->version != htons(ETHERIP_VERSION)) { + kfree_skb(skb); + return 0; + } + + iph = skb->nh.iph; + + read_lock(ðerip_lock); + if ((tunnel = etherip_tunnel_lookup(iph->saddr, iph->daddr)) != NULL) { + secpath_reset(skb); + + /* Pull etherip header. */ + skb_pull(skb, 2); + skb->protocol = eth_type_trans(skb, tunnel->dev); + + memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options)); + + tunnel->stat.rx_packets++; + tunnel->stat.rx_bytes += skb->len; + skb->dev = tunnel->dev; + dst_release(skb->dst); + skb->dst = NULL; + nf_reset(skb); + etherip_ecn_decapsulate(iph, skb); + netif_rx(skb); + read_unlock(ðerip_lock); + return 0; + } + read_unlock(ðerip_lock); + +out: + return -1; +} + +static int etherip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) +{ + struct ip_tunnel *tunnel = (struct ip_tunnel*)dev->priv; + struct net_device_stats *stats = &tunnel->stat; + struct iphdr *old_iph = skb->nh.iph; + struct iphdr *tiph = &tunnel->parms.iph; + u8 tos; + u16 df; + struct rtable *rt; /* Route to the other host */ + struct net_device *tdev; /* Device to other host */ + struct etheriphdr *ethiph; + struct iphdr *iph; /* Our new IP header */ + int max_headroom; /* The extra header space needed */ + int mtu; + + if (tunnel->recursion++) { + stats->collisions++; + goto tx_error; + } + + /* Need valid non-multicast daddr. */ + if (tiph->daddr == 0 || MULTICAST(tiph->daddr)) + goto tx_error; + + tos = tiph->tos; + if (tos&1) { + if (skb->protocol == htons(ETH_P_IP)) + tos = old_iph->tos; + tos &= ~1; + } + + { + struct flowi fl = { .oif = tunnel->parms.link, + .nl_u = { .ip4_u = + { .daddr = tiph->daddr, + .saddr = tiph->saddr, + .tos = RT_TOS(tos) } }, + .proto = IPPROTO_ETHERIP }; + if (ip_route_output_key(&rt, &fl)) { + stats->tx_carrier_errors++; + goto tx_error_icmp; + } + } + tdev = rt->u.dst.dev; + + if (tdev == dev) { + ip_rt_put(rt); + stats->collisions++; + goto tx_error; + } + + df = tiph->frag_off; + if (df) + mtu = dst_pmtu(&rt->u.dst) - sizeof(struct etheriphdr); + else + mtu = skb->dst ? dst_pmtu(skb->dst) : dev->mtu; + + if (skb->dst) + skb->dst->ops->update_pmtu(skb->dst, mtu); + + if (skb->protocol == htons(ETH_P_IP)) { + df |= (old_iph->frag_off&htons(IP_DF)); + + if ((old_iph->frag_off & htons(IP_DF)) && + mtu < ntohs(old_iph->tot_len)) { + icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu)); + ip_rt_put(rt); + goto tx_error; + } + } +#ifdef CONFIG_IPV6 + else if (skb->protocol == htons(ETH_P_IPV6)) { + struct rt6_info *rt6 = (struct rt6_info*)skb->dst; + + if (rt6 && mtu < dst_pmtu(skb->dst) && mtu >= IPV6_MIN_MTU) { + if (tiph->daddr || rt6->rt6i_dst.plen == 128) { + rt6->rt6i_flags |= RTF_MODIFIED; + skb->dst->metrics[RTAX_MTU-1] = mtu; + } + } + + /* @@@ Is this correct? */ + if (mtu >= IPV6_MIN_MTU && mtu < skb->len - 2 * sizeof(struct etheriphdr)) { + icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, dev); + ip_rt_put(rt); + goto tx_error; + } + } +#endif + + if (tunnel->err_count > 0) { + if (jiffies - tunnel->err_time < IPTUNNEL_ERR_TIMEO) { + tunnel->err_count--; + dst_link_failure(skb); + } else + tunnel->err_count = 0; + } + + max_headroom = LL_RESERVED_SPACE(tdev) + sizeof(struct etheriphdr); + + if (skb_headroom(skb) < max_headroom || skb_cloned(skb) || skb_shared(skb)) { + struct sk_buff *new_skb = skb_realloc_headroom(skb, max_headroom); + if (!new_skb) { + ip_rt_put(rt); + stats->tx_dropped++; + dev_kfree_skb(skb); + tunnel->recursion--; + return 0; + } + if (skb->sk) + skb_set_owner_w(new_skb, skb->sk); + dev_kfree_skb(skb); + skb = new_skb; + old_iph = skb->nh.iph; + } + + skb->h.raw = skb->nh.raw; + skb->nh.raw = skb_push(skb, sizeof(struct etheriphdr)); + memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); + dst_release(skb->dst); + skb->dst = &rt->u.dst; + + /* + * Push down and install the etherip header. + */ + + ethiph = (struct etheriphdr *)skb->nh.iph; + + iph = ðiph->iph; + iph->version = 4; + iph->ihl = sizeof(struct iphdr) >> 2; + iph->frag_off = df; + iph->protocol = IPPROTO_ETHERIP; + iph->tos = etherip_ecn_encapsulate(tos, old_iph, skb); + iph->daddr = rt->rt_dst; + iph->saddr = rt->rt_src; + + ethiph->version = htons(ETHERIP_VERSION); + + if ((ethiph->iph.ttl = tiph->ttl) == 0) { + if (skb->protocol == htons(ETH_P_IP)) + ethiph->iph.ttl = old_iph->ttl; +#ifdef CONFIG_IPV6 + else if (skb->protocol == htons(ETH_P_IPV6)) + ethiph->iph.ttl = ((struct ipv6hdr*)old_iph)->hop_limit; +#endif + else + ethiph->iph.ttl = dst_metric(&rt->u.dst, RTAX_HOPLIMIT); + } + + nf_reset(skb); + + IPTUNNEL_XMIT(); + tunnel->recursion--; + return 0; + +tx_error_icmp: + dst_link_failure(skb); + +tx_error: + stats->tx_errors++; + dev_kfree_skb(skb); + tunnel->recursion--; + return 0; +} + +static int +etherip_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) +{ + int err = 0; + struct ip_tunnel_parm p; + struct ip_tunnel *t; + + switch (cmd) { + case SIOCGETTUNNEL: + t = NULL; + if (dev == etherip_fb_tunnel_dev) { + if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof(p))) { + err = -EFAULT; + break; + } + t = etherip_tunnel_locate(&p, 0); + } + if (t == NULL) + t = (struct ip_tunnel*)dev->priv; + memcpy(&p, &t->parms, sizeof(p)); + if (copy_to_user(ifr->ifr_ifru.ifru_data, &p, sizeof(p))) + err = -EFAULT; + break; + + case SIOCADDTUNNEL: + case SIOCCHGTUNNEL: + err = -EPERM; + if (!capable(CAP_NET_ADMIN)) + goto done; + + err = -EFAULT; + if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof(p))) + goto done; + + err = -EINVAL; + if (p.iph.version != 4 || p.iph.protocol != IPPROTO_ETHERIP || + p.iph.ihl != 5 || (p.iph.frag_off&htons(~IP_DF))) + goto done; + if (p.iph.ttl) + p.iph.frag_off |= htons(IP_DF); + + t = etherip_tunnel_locate(&p, cmd == SIOCADDTUNNEL); + + if (dev != etherip_fb_tunnel_dev && cmd == SIOCCHGTUNNEL) { + if (t != NULL) { + if (t->dev != dev) { + err = -EEXIST; + break; + } + } else { + if (!p.iph.daddr) { + err = -EINVAL; + break; + } + + t = (struct ip_tunnel*)dev->priv; + etherip_tunnel_unlink(t); + t->parms.iph.saddr = p.iph.saddr; + t->parms.iph.daddr = p.iph.daddr; + etherip_tunnel_link(t); + netdev_state_change(dev); + } + } + + if (t) { + err = 0; + if (cmd == SIOCCHGTUNNEL) { + t->parms.iph.ttl = p.iph.ttl; + t->parms.iph.tos = p.iph.tos; + t->parms.iph.frag_off = p.iph.frag_off; + } + if (copy_to_user(ifr->ifr_ifru.ifru_data, &t->parms, sizeof(p))) + err = -EFAULT; + } else + err = (cmd == SIOCADDTUNNEL ? -ENOBUFS : -ENOENT); + break; + + case SIOCDELTUNNEL: + err = -EPERM; + if (!capable(CAP_NET_ADMIN)) + goto done; + + if (dev == etherip_fb_tunnel_dev) { + err = -EFAULT; + if (copy_from_user(&p, ifr->ifr_ifru.ifru_data, sizeof(p))) + goto done; + err = -ENOENT; + if ((t = etherip_tunnel_locate(&p, 0)) == NULL) + goto done; + err = -EPERM; + if (t->dev == etherip_fb_tunnel_dev) + goto done; + dev = t->dev; + } + err = unregister_netdevice(dev); + break; + + default: + err = -EINVAL; + } + +done: + return err; +} + +static struct net_device_stats *etherip_tunnel_get_stats(struct net_device *dev) +{ + return &(((struct ip_tunnel*)dev->priv)->stat); +} + +static int etherip_tunnel_change_mtu(struct net_device *dev, int new_mtu) +{ + if (new_mtu < 68 || new_mtu > 0xFFF8 - sizeof(struct etheriphdr)) + return -EINVAL; + dev->mtu = new_mtu; + return 0; +} + +static void etherip_tunnel_setup(struct net_device *dev) +{ + SET_MODULE_OWNER(dev); + ether_setup(dev); + + dev->uninit = etherip_tunnel_uninit; + dev->destructor = free_netdev; + dev->hard_start_xmit = etherip_tunnel_xmit; + dev->get_stats = etherip_tunnel_get_stats; + dev->do_ioctl = etherip_tunnel_ioctl; + dev->change_mtu = etherip_tunnel_change_mtu; + + dev->hard_header_len = ETH_HLEN; // + sizeof(struct etheriphdr); + dev->tx_queue_len = 0; + random_ether_addr(dev->dev_addr); + + dev->iflink = 0; +} + +static int etherip_tunnel_init(struct net_device *dev) +{ + struct net_device *tdev = NULL; + struct ip_tunnel *tunnel; + struct iphdr *iph; + + tunnel = (struct ip_tunnel*)dev->priv; + iph = &tunnel->parms.iph; + + tunnel->dev = dev; + strcpy(tunnel->parms.name, dev->name); + + /* Guess output device to choose reasonable mtu and hard_header_len */ + if (iph->daddr) { + struct flowi fl = { .oif = tunnel->parms.link, + .nl_u = { .ip4_u = + { .daddr = iph->daddr, + .saddr = iph->saddr, + .tos = RT_TOS(iph->tos) } }, + .proto = IPPROTO_ETHERIP }; + struct rtable *rt; + if (!ip_route_output_key(&rt, &fl)) { + tdev = rt->u.dst.dev; + ip_rt_put(rt); + } + } + + if (!tdev && tunnel->parms.link) + tdev = __dev_get_by_index(tunnel->parms.link); + + if (tdev) { + dev->hard_header_len = tdev->hard_header_len + sizeof(struct etheriphdr); + dev->mtu = tdev->mtu - sizeof(struct etheriphdr); + } + dev->iflink = tunnel->parms.link; + + return 0; +} + +int __init etherip_fb_tunnel_init(struct net_device *dev) +{ + struct ip_tunnel *tunnel = (struct ip_tunnel*)dev->priv; + struct iphdr *iph = &tunnel->parms.iph; + + tunnel->dev = dev; + strcpy(tunnel->parms.name, dev->name); + + iph->version = 4; + iph->protocol = IPPROTO_ETHERIP; + iph->ihl = 5; + + dev_hold(dev); + tunnels_wc[0] = tunnel; + return 0; +} + + +static struct net_protocol etherip_protocol = { + .handler = etherip_rcv, + .err_handler = etherip_err, +}; + + +/* + * And now the modules code and kernel interface. + */ + +static int __init etherip_init(void) +{ + int err; + + printk(KERN_INFO "Ethernet over IPv4 tunneling driver\n"); + + if (inet_add_protocol(ðerip_protocol, IPPROTO_ETHERIP) < 0) { + printk(KERN_INFO "etherip init: can't add protocol\n"); + return -EAGAIN; + } + + etherip_fb_tunnel_dev = alloc_netdev(sizeof(struct ip_tunnel), + "etherip0", etherip_tunnel_setup); + if (!etherip_fb_tunnel_dev) { + err = -ENOMEM; + goto err1; + } + + etherip_fb_tunnel_dev->init = etherip_fb_tunnel_init; + + if ((err = register_netdev(etherip_fb_tunnel_dev))) + goto err2; +out: + return err; +err2: + free_netdev(etherip_fb_tunnel_dev); +err1: + inet_del_protocol(ðerip_protocol, IPPROTO_ETHERIP); + goto out; +} + +void etherip_fini(void) +{ + if (inet_del_protocol(ðerip_protocol, IPPROTO_ETHERIP) < 0) + printk(KERN_INFO "etherip close: can't remove protocol\n"); + + unregister_netdev(etherip_fb_tunnel_dev); +} + +module_init(etherip_init); +module_exit(etherip_fini); +MODULE_LICENSE("GPL"); diff -urN linux-2.6.10.orig/net/ipv4/Kconfig linux-2.6.10/net/ipv4/Kconfig --- linux-2.6.10.orig/net/ipv4/Kconfig 2005-01-12 21:48:11.000000000 +0100 +++ linux-2.6.10/net/ipv4/Kconfig 2005-01-12 21:53:51.063081266 +0100 @@ -202,6 +202,15 @@ Network), but can be distributed all over the Internet. If you want to do that, say Y here and to "IP multicast routing" below. +config NET_ETHERIP + tristate "IP: ethernet-in-IP tunneling" + depends on INET + help + Tunneling means encapsulating data of one protocol type within + another protocol and sending it over a channel that understands the + encapsulating protocol. This particular tunneling driver implements + the etherip Ethernet-in-IP protocol as described in RFC 3378. + config IP_MROUTE bool "IP: multicast routing" depends on IP_MULTICAST diff -urN linux-2.6.10.orig/net/ipv4/Makefile linux-2.6.10/net/ipv4/Makefile --- linux-2.6.10.orig/net/ipv4/Makefile 2004-12-24 22:34:26.000000000 +0100 +++ linux-2.6.10/net/ipv4/Makefile 2005-01-12 21:48:38.762364033 +0100 @@ -14,6 +14,7 @@ obj-$(CONFIG_IP_MROUTE) += ipmr.o obj-$(CONFIG_NET_IPIP) += ipip.o obj-$(CONFIG_NET_IPGRE) += ip_gre.o +obj-$(CONFIG_NET_ETHERIP) += etherip.o obj-$(CONFIG_SYN_COOKIES) += syncookies.o obj-$(CONFIG_INET_AH) += ah4.o obj-$(CONFIG_INET_ESP) += esp4.o From simon.roscic@chello.at Wed Jan 12 14:25:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 14:25:31 -0800 (PST) Received: from simon.segfault.info (chello213047247120.tirol.surfer.at [213.47.247.120]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CMPOHY026323 for ; Wed, 12 Jan 2005 14:25:25 -0800 Received: from workstation.lan (workstation.lan [192.168.5.2]) by simon.segfault.info (Postfix) with ESMTP id E88D73C00095; Wed, 12 Jan 2005 23:24:46 +0100 (CET) From: Simon Roscic To: Tommy Christensen Subject: Re: Fwd: [2.6] ethertap and af_inet.c assertion failures Date: Wed, 12 Jan 2005 23:25:23 +0100 User-Agent: KMail/1.7.1 References: <200412240002.13206.simon.roscic@chello.at> <41E44476.20303@tpack.net> In-Reply-To: <41E44476.20303@tpack.net> Cc: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501122325.23284.simon.roscic@chello.at> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 172 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: simon.roscic@chello.at Precedence: bulk X-list: netdev Tommy Christensen wrote: > netlink has messed up the send buffer accounting, when trimming a skb. > > Patch below should fix this for ethertap. Could you give it a try? > > -Tommy Thanks a lot! Your patch fixed the bug. bye, simon. From jeremy.guthrie@berbee.com Wed Jan 12 14:31:00 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 14:31:05 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CMUxib027181 for ; Wed, 12 Jan 2005 14:30:59 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 12 Jan 2005 16:30:53 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Wed, 12 Jan 2005 16:30:50 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson , Stephen Hemminger , Jesse Brandeburg References: <200501121605.12943.jeremy.guthrie@berbee.com> <16869.41793.881555.323604@robur.slu.se> In-Reply-To: <16869.41793.881555.323604@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1945889.UB1T3PPquv"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501121630.53099.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 12 Jan 2005 22:30:53.0784 (UTC) FILETIME=[607FAD80:01C4F8F6] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 173 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart1945889.UB1T3PPquv Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wednesday 12 January 2005 04:22 pm, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > I am now getting some push back from the project manager on this > > performance problem. I am wondering if you think faster CPUs will > > a) help relieve the symptoms of this problem > > b) not help because now we will hit a '# of routes in the route-cache' > > problem > > c) or will help to a point till the # interrupts come back and bite u= s. > > Back out the patch I sent.and have hardirq's to run RX-softirq as you > did before but something is very wrong. You didn't answer if there were > other load on the machine... I have backed out. As for the load, this box only does policy routing. An= y=20 other functions it performs are part of its automated system to download th= e=20 next days policy-routing config. > route-cache can probably be tuned you as have four times the linear seach > I see in one PIII system at 110 kpps w. production traffic. How would I go about tuning that? > Of course the non-engineering solution is to buy more CPU... :-) That is good to know. This will help me calm the situation a bit. 8) =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart1945889.UB1T3PPquv Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB5aUdqtjaBHGZBeURApEcAKCI5TZdl+4KHLboUT3Tw80TOjOkOQCggtPo +x1DUJ++tTezj8QtfRP/aIs= =X9P7 -----END PGP SIGNATURE----- --nextPart1945889.UB1T3PPquv-- From jeremy.guthrie@berbee.com Wed Jan 12 14:42:17 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 14:42:24 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CMgGMm031315 for ; Wed, 12 Jan 2005 14:42:17 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 12 Jan 2005 16:42:11 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Wed, 12 Jan 2005 16:42:07 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson References: <200501121621.24259.jeremy.guthrie@berbee.com> <16869.42247.126428.508479@robur.slu.se> In-Reply-To: <16869.42247.126428.508479@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4355522.dXn12orbkK"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501121642.10800.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 12 Jan 2005 22:42:11.0486 (UTC) FILETIME=[F470CBE0:01C4F8F7] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 174 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart4355522.dXn12orbkK Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Wed Jan 12 16:36:29 CST 2005 eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 RX packets:1868701 errors:894743 dropped:894743 overruns:410647=20 frame:0 ba659628 150dc67c 00c8ad95 000d2659 00000000 00000000 00000000 00000000=20 00764a9d 00045bd7 00000000 00000120 00000000 00000000 00000000 00000000 00000000=20 0009b5c4 entries in_hit in_slow_tot in_no_route in_brd in_martian_dst in_martian_sr= c =20 out_hit out_slow_tot out_slow_mc gc_total gc_ignored gc_goal_miss=20 gc_dst_overflow in_hlist_search out_hlist_search 00008e84 62d61b7d 37d9063a 00000000 00000000 0000b57e 00006c14 00000002 =20 0027d72c 00042dfa 00000000 307d209e 30505aea 001d0a7c 001cf933 108c7bfb=20 00c976a6 00008e84 0000f0af 00032cd5 00000000 00000000 00004360 00000000 00000000 =20 00000020 000000df 00000002 00004874 000046dd 0000016c 00000165 0016e55d=20 0000028f CPU0 CPU1 18: 3680079907 1815 IO-APIC-level eth3 20: 2 2490755322 IO-APIC-level eth2 Wed Jan 12 16:37:30 CST 2005 eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 RX packets:6313404 errors:1216174 dropped:1216174 overruns:509016= =20 frame:0 baa97098 150dc67c 00c8e8ac 000d2659 00000000 00000000 00000000 00000000=20 00764df1 00045be8 00000000 00000120 00000000 00000000 00000000 00000000 00000000=20 0009b650 entries in_hit in_slow_tot in_no_route in_brd in_martian_dst in_martian_sr= c =20 out_hit out_slow_tot out_slow_mc gc_total gc_ignored gc_goal_miss=20 gc_dst_overflow in_hlist_search out_hlist_search 0000e10e 63177e31 37db7aec 00000000 00000000 0000b587 00006c22 00000002 =20 0027d819 00042e29 00000000 307f9564 3052cf38 001d0a7f 001cf933 114eef21=20 00c97a1e 0000e10e 0000f0b5 00032ce0 00000000 00000000 00004360 00000000 00000000 =20 00000020 000000e0 00000002 00004875 000046de 0000016c 00000165 0016e5a1=20 00000295 CPU0 CPU1 18: 3680513406 1815 IO-APIC-level eth3 20: 2 2490979016 IO-APIC-level eth2 On Wednesday 12 January 2005 04:30 pm, Robert Olsson wrote: > Can you give this a last try. It's from an older driver > > > e1000_clean(struct net_device *netdev, int *budget) > { > struct e1000_adapter *adapter =3D netdev->priv; > int work_to_do =3D min(*budget, netdev->quota); > int work_done =3D 0; > > e1000_clean_tx_irq(adapter); > e1000_clean_rx_irq(adapter, &work_done, work_to_do); > > *budget -=3D work_done; > netdev->quota -=3D work_done; > > if(work_done < work_to_do) { > netif_rx_complete(netdev); > e1000_irq_enable(adapter); > } > > return (work_done >=3D work_to_do); > } =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart4355522.dXn12orbkK Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB5afCqtjaBHGZBeURAgpOAJ971p9Ju5uTAe+q+b+E2D0T9QDfVgCglf92 r7f9BzwNMV9GwYoKtx1IIWw= =2kyp -----END PGP SIGNATURE----- --nextPart4355522.dXn12orbkK-- From greearb@candelatech.com Wed Jan 12 14:42:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 14:42:59 -0800 (PST) Received: from www.lanforge.com (ns1.lanforge.com [66.165.47.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CMgqNq031451 for ; Wed, 12 Jan 2005 14:42:53 -0800 Received: from [4.33.45.22] (evrtwa1-ar2-4-33-045-022.evrtwa1.dsl-verizon.net [4.33.45.22]) (authenticated bits=0) by www.lanforge.com (8.12.8/8.12.8) with ESMTP id j0CMxPLH011097; Wed, 12 Jan 2005 14:59:26 -0800 Message-ID: <41E5A7E9.4030101@candelatech.com> Date: Wed, 12 Jan 2005 14:42:49 -0800 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041020 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Lennert Buytenhek CC: netdev@oss.sgi.com, shemminger@osdl.org, rhousley@rsasecurity.com, shollenbeck@verisign.com Subject: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling References: <20050112222437.GC14280@xi.wantstofly.org> In-Reply-To: <20050112222437.GC14280@xi.wantstofly.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 175 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Lennert Buytenhek wrote: > Hi, > > After struggling with various userland VPN solutions for a while (and > failing to make IPSEC tunnel mode do what I want), I decided to just > implement ethernet-in-IP tunneling in the kernel and let IPSEC transport > mode handle the rest. > > There appeared to be an RFC for ethernet-in-IP already, RFC 3378, so I > just implemented that. It's very simple -- slap a 16-bit header (0x3000, > which is 4 bits of etherip version number and 12 bits of padding) onto > the beginning of the ethernet packet, and then wrap it in an IP packet. > > Below is what I came up with, against the latest Fedora Core 3 kernel, > which is 2.6.10-something. It survives some fairly basic testing between > a number of different machines, UP and SMP. (Corresponding iproute2 > patch is available from http://www.wantstofly.org/~buytenh/etherip/ ) > > Notes: > - daddr=0 tunnel mode is meaningless for generic ethernet tunneling, > so I didn't implement that. Packets are just dropped on the floor > if daddr==0 at the time of sending, which is the default mode for > the etherip0 device. > > Issues and TODO: > - Implement MULTICAST(daddr) tunnel mode, seems useful to have. > - Perhaps we should always present a MTU=1500 device to the user and > deal with fragmentation issues ourselves. > - Don't take TTL of outer packet from inner packet. > - Figure out what to do with DF. > - Check whether ECN bits are correctly {en,de}capsulated. > - Check out iffy-looking '2 * sizeof(struct etheriphdr)' construct > (same problem in ip_gre.c?) > > Comments? I would like to see this upstream when the remaining issues > have been sorted out. Why do you add a single device when loading the module? Is this just so you have something to hook the ioctl to? My personal preference would be something where you do not automatically create an etherip0, but would have an etherip-config tool or similar to create/destroy interfaces. Also, could you add an ioctl that allowed one to query whether or not a particular device is an etherip device? I had always wished I had added this earlier to the VLAN code :) Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From jeremy.guthrie@berbee.com Wed Jan 12 14:47:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 14:47:43 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CMlaRZ032362 for ; Wed, 12 Jan 2005 14:47:37 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 12 Jan 2005 16:47:31 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Wed, 12 Jan 2005 16:47:28 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson References: <200501121621.24259.jeremy.guthrie@berbee.com> <16869.42247.126428.508479@robur.slu.se> In-Reply-To: <16869.42247.126428.508479@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1205900.ElXUU3VXJm"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501121647.30934.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 12 Jan 2005 22:47:31.0593 (UTC) FILETIME=[B33D3F90:01C4F8F8] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 176 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart1205900.ElXUU3VXJm Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Here is what it looked like I was getting before from the old driver... tha= t=20 took me down to 8mbps. "printk: 4624 messages suppressed. dst cache overflow printk: 4630 messages suppressed. dst cache overflow printk: 4631 messages suppressed. dst cache overflow printk: 4646 messages suppressed. dst cache overflow printk: 4645 messages suppressed. dst cache overflow" On Wednesday 12 January 2005 04:30 pm, Robert Olsson wrote: > Can you give this a last try. It's from an older driver > > > e1000_clean(struct net_device *netdev, int *budget) > { > struct e1000_adapter *adapter =3D netdev->priv; > int work_to_do =3D min(*budget, netdev->quota); > int work_done =3D 0; > > e1000_clean_tx_irq(adapter); > e1000_clean_rx_irq(adapter, &work_done, work_to_do); > > *budget -=3D work_done; > netdev->quota -=3D work_done; > > if(work_done < work_to_do) { > netif_rx_complete(netdev); > e1000_irq_enable(adapter); > } > > return (work_done >=3D work_to_do); > } =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart1205900.ElXUU3VXJm Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB5akCqtjaBHGZBeURAq5TAJ9iGI8IEFZa1JRlQvXywW4mgYlBbgCfSQJ8 e36cZNT6ZrUUymU4X0FkPkY= =Xf+f -----END PGP SIGNATURE----- --nextPart1205900.ElXUU3VXJm-- From buytenh@wantstofly.org Wed Jan 12 14:48:12 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 14:48:16 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CMmB0l032488 for ; Wed, 12 Jan 2005 14:48:12 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id 007472B0EC; Wed, 12 Jan 2005 23:48:10 +0100 (MET) Date: Wed, 12 Jan 2005 23:48:10 +0100 From: Lennert Buytenhek To: Ben Greear Cc: netdev@oss.sgi.com, shemminger@osdl.org, rhousley@rsasecurity.com, shollenbeck@verisign.com Subject: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling Message-ID: <20050112224810.GE14280@xi.wantstofly.org> References: <20050112222437.GC14280@xi.wantstofly.org> <41E5A7E9.4030101@candelatech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41E5A7E9.4030101@candelatech.com> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 177 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev On Wed, Jan 12, 2005 at 02:42:49PM -0800, Ben Greear wrote: > Why do you add a single device when loading the module? Is this just > so you have something to hook the ioctl to? > > My personal preference would be something where you do not automatically > create an etherip0, but would have an etherip-config tool or similar to > create/destroy interfaces. I modelled this after the way ipip/gre/sit do things -- they create tunl0/gre0/sit0, and have 'ip tunnel' send its ioctls to those devices. I wouldn't mind changing this to another mechanism, but 1) we'd have to agree on a mechanism, and 2) we'd have to change the other tunnel types over to this mechanism as well. > Also, could you add an ioctl that allowed one to query whether or not > a particular device is an etherip device? I had always wished I had added > this earlier to the VLAN code :) Hmmm. Bridge devices don't have this either, do they? Can you name an advantage of having this? cheers, Lennert From greearb@candelatech.com Wed Jan 12 15:11:51 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 15:11:59 -0800 (PST) Received: from www.lanforge.com (ns1.lanforge.com [66.165.47.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CNBpGK001824 for ; Wed, 12 Jan 2005 15:11:51 -0800 Received: from [4.33.45.22] (evrtwa1-ar2-4-33-045-022.evrtwa1.dsl-verizon.net [4.33.45.22]) (authenticated bits=0) by www.lanforge.com (8.12.8/8.12.8) with ESMTP id j0CNSGLH011501; Wed, 12 Jan 2005 15:28:16 -0800 Message-ID: <41E5AEAC.8060706@candelatech.com> Date: Wed, 12 Jan 2005 15:11:40 -0800 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041020 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Lennert Buytenhek CC: netdev@oss.sgi.com, shemminger@osdl.org, rhousley@rsasecurity.com, shollenbeck@verisign.com Subject: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling References: <20050112222437.GC14280@xi.wantstofly.org> <41E5A7E9.4030101@candelatech.com> <20050112224810.GE14280@xi.wantstofly.org> In-Reply-To: <20050112224810.GE14280@xi.wantstofly.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 178 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Lennert Buytenhek wrote: > On Wed, Jan 12, 2005 at 02:42:49PM -0800, Ben Greear wrote: > > >>Why do you add a single device when loading the module? Is this just >>so you have something to hook the ioctl to? >> >>My personal preference would be something where you do not automatically >>create an etherip0, but would have an etherip-config tool or similar to >>create/destroy interfaces. > > > I modelled this after the way ipip/gre/sit do things -- they create > tunl0/gre0/sit0, and have 'ip tunnel' send its ioctls to those devices. > > I wouldn't mind changing this to another mechanism, but 1) we'd have to > agree on a mechanism, and 2) we'd have to change the other tunnel types > over to this mechanism as well. Ok, it's not a big deal to me. >>Also, could you add an ioctl that allowed one to query whether or not >>a particular device is an etherip device? I had always wished I had added >>this earlier to the VLAN code :) > > > Hmmm. Bridge devices don't have this either, do they? Can you name > an advantage of having this? I got the request several times with regard to VLANs. Lots of people (and applications) will want to know the interface type for various reasons. If you don't give them a nice programatic thing like an IOCTL to call, they will undoubtedly start making assumptions based off of the device name... Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From buytenh@wantstofly.org Wed Jan 12 15:16:16 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 15:16:20 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CNGFpG002502 for ; Wed, 12 Jan 2005 15:16:16 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id 335B82B0EC; Thu, 13 Jan 2005 00:16:15 +0100 (MET) Date: Thu, 13 Jan 2005 00:16:15 +0100 From: Lennert Buytenhek To: Ben Greear Cc: netdev@oss.sgi.com, shemminger@osdl.org, shollenbeck@verisign.com Subject: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling Message-ID: <20050112231615.GF14280@xi.wantstofly.org> References: <20050112222437.GC14280@xi.wantstofly.org> <41E5A7E9.4030101@candelatech.com> <20050112224810.GE14280@xi.wantstofly.org> <41E5AEAC.8060706@candelatech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41E5AEAC.8060706@candelatech.com> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 179 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev On Wed, Jan 12, 2005 at 03:11:40PM -0800, Ben Greear wrote: > >>Also, could you add an ioctl that allowed one to query whether or not > >>a particular device is an etherip device? I had always wished I had added > >>this earlier to the VLAN code :) > > > >Hmmm. Bridge devices don't have this either, do they? Can you name > >an advantage of having this? > > I got the request several times with regard to VLANs. Lots of people > (and applications) will want to know the interface type for various > reasons. If you don't give them a nice programatic thing like an > IOCTL to call, they will undoubtedly start making assumptions based > off of the device name... Makes sense.. Unfortunately SIOCGETTUNNEL is (SIOCDEVPRIVATE + 3), otherwise we could just say something like "If an ARPHRD_ETHER device supports SIOCGETTUNNEL, it's an ether/ip tunnel." Any better ideas? I hate adding more ioctls. cheers, Lennert From Robert.Olsson@data.slu.se Wed Jan 12 15:19:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 15:19:12 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CNJ545003103 for ; Wed, 12 Jan 2005 15:19:07 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0CNJ2TI020108; Thu, 13 Jan 2005 00:19:02 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 47A12EC1A0; Thu, 13 Jan 2005 00:19:02 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16869.45158.194375.398326@robur.slu.se> Date: Thu, 13 Jan 2005 00:19:02 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501121647.30934.jeremy.guthrie@berbee.com> References: <200501121621.24259.jeremy.guthrie@berbee.com> <16869.42247.126428.508479@robur.slu.se> <200501121647.30934.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 180 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > Here is what it looked like I was getting before from the old driver... that > took me down to 8mbps. > > "printk: 4624 messages suppressed. > dst cache overflow > printk: 4630 messages suppressed. > dst cache overflow > printk: 4631 messages suppressed. > dst cache overflow > printk: 4646 messages suppressed. > dst cache overflow > printk: 4645 messages suppressed. > dst cache overflow" Thanks! This a known problem. Remember I asked you about this. We're now in the RCU route-hash problem again. This is not necessary solved by more CPU as higher t-put forces more dst-entries to be freed aand we get closer to max_size. As your traffic looks sane double your bucket size of the route hash to start with. Use the boot option w. rhash_entries. look at rtstat --ro. From jeremy.guthrie@berbee.com Wed Jan 12 15:23:29 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 15:23:36 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CNNSIa004060 for ; Wed, 12 Jan 2005 15:23:29 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 12 Jan 2005 17:23:23 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Wed, 12 Jan 2005 17:23:18 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson References: <200501121647.30934.jeremy.guthrie@berbee.com> <16869.45158.194375.398326@robur.slu.se> In-Reply-To: <16869.45158.194375.398326@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1388314.TvAxB0A7hL"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501121723.21969.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 12 Jan 2005 23:23:23.0367 (UTC) FILETIME=[B5CBE770:01C4F8FD] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 181 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart1388314.TvAxB0A7hL Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wednesday 12 January 2005 05:19 pm, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > Here is what it looked like I was getting before from the old driver... > > that took me down to 8mbps. > > > > "printk: 4624 messages suppressed. > > dst cache overflow > > printk: 4630 messages suppressed. > > dst cache overflow > > printk: 4631 messages suppressed. > > dst cache overflow > > printk: 4646 messages suppressed. > > dst cache overflow > > printk: 4645 messages suppressed. > > dst cache overflow" > > Thanks! > > This a known problem. Remember I asked you about this. We're now in the > RCU route-hash problem again. This is not necessary solved by more CPU > as higher t-put forces more dst-entries to be freed aand we get > closer to max_size. > > As your traffic looks sane double your bucket size of the route hash to > start with. Use the boot option w. rhash_entries. look at rtstat Does it make sense that the driver would kill throughput and force us to=20 output these types of messages? =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart1388314.TvAxB0A7hL Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB5bFpqtjaBHGZBeURAlTAAJ0Rr8D4lKpObZ+keb8zLq5d5v0FKACgnKXD /3Lh4StZBXdA6uCqhjlTO4Y= =UdhW -----END PGP SIGNATURE----- --nextPart1388314.TvAxB0A7hL-- From greearb@candelatech.com Wed Jan 12 15:43:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 15:43:59 -0800 (PST) Received: from www.lanforge.com (ns1.lanforge.com [66.165.47.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CNhqQX008784 for ; Wed, 12 Jan 2005 15:43:53 -0800 Received: from [4.33.45.22] (evrtwa1-ar2-4-33-045-022.evrtwa1.dsl-verizon.net [4.33.45.22]) (authenticated bits=0) by www.lanforge.com (8.12.8/8.12.8) with ESMTP id j0D00SLH012047; Wed, 12 Jan 2005 16:00:28 -0800 Message-ID: <41E5B638.8070007@candelatech.com> Date: Wed, 12 Jan 2005 15:43:52 -0800 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041020 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Lennert Buytenhek CC: netdev@oss.sgi.com Subject: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling References: <20050112222437.GC14280@xi.wantstofly.org> <41E5A7E9.4030101@candelatech.com> <20050112224810.GE14280@xi.wantstofly.org> <41E5AEAC.8060706@candelatech.com> <20050112231615.GF14280@xi.wantstofly.org> In-Reply-To: <20050112231615.GF14280@xi.wantstofly.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 183 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Lennert Buytenhek wrote: > On Wed, Jan 12, 2005 at 03:11:40PM -0800, Ben Greear wrote: > > >>>>Also, could you add an ioctl that allowed one to query whether or not >>>>a particular device is an etherip device? I had always wished I had added >>>>this earlier to the VLAN code :) >>> >>>Hmmm. Bridge devices don't have this either, do they? Can you name >>>an advantage of having this? >> >>I got the request several times with regard to VLANs. Lots of people >>(and applications) will want to know the interface type for various >>reasons. If you don't give them a nice programatic thing like an >>IOCTL to call, they will undoubtedly start making assumptions based >>off of the device name... > > > Makes sense.. > > Unfortunately SIOCGETTUNNEL is (SIOCDEVPRIVATE + 3), otherwise we could > just say something like "If an ARPHRD_ETHER device supports SIOCGETTUNNEL, > it's an ether/ip tunnel." > > Any better ideas? I hate adding more ioctls. How about add one IOCTL that takes a small (naturally packed/aligned, fixed-size!) struct that has within it an enumeration of specific commands and whatever fields are needed for arguments. Then you only need to add a single IOCTL to the system, and you can add more commands at will. Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From tgraf@suug.ch Wed Jan 12 15:43:27 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 15:43:35 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CNhQkt008654 for ; Wed, 12 Jan 2005 15:43:27 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 7F427F; Thu, 13 Jan 2005 00:43:02 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 121381C0EA; Thu, 13 Jan 2005 00:43:45 +0100 (CET) Date: Thu, 13 Jan 2005 00:43:44 +0100 From: Thomas Graf To: Lennert Buytenhek Cc: Ben Greear , netdev@oss.sgi.com, shemminger@osdl.org, shollenbeck@verisign.com Subject: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling Message-ID: <20050112234344.GM26856@postel.suug.ch> References: <20050112222437.GC14280@xi.wantstofly.org> <41E5A7E9.4030101@candelatech.com> <20050112224810.GE14280@xi.wantstofly.org> <41E5AEAC.8060706@candelatech.com> <20050112231615.GF14280@xi.wantstofly.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050112231615.GF14280@xi.wantstofly.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 182 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * Lennert Buytenhek <20050112231615.GF14280@xi.wantstofly.org> 2005-01-13 00:16 > On Wed, Jan 12, 2005 at 03:11:40PM -0800, Ben Greear wrote: > > > >>Also, could you add an ioctl that allowed one to query whether or not > > >>a particular device is an etherip device? I had always wished I had added > > >>this earlier to the VLAN code :) > > > > > >Hmmm. Bridge devices don't have this either, do they? Can you name > > >an advantage of having this? > > > > I got the request several times with regard to VLANs. Lots of people > > (and applications) will want to know the interface type for various > > reasons. If you don't give them a nice programatic thing like an > > IOCTL to call, they will undoubtedly start making assumptions based > > off of the device name... > > Makes sense.. > > Unfortunately SIOCGETTUNNEL is (SIOCDEVPRIVATE + 3), otherwise we could > just say something like "If an ARPHRD_ETHER device supports SIOCGETTUNNEL, > it's an ether/ip tunnel." > > Any better ideas? I hate adding more ioctls. I think it should go into ip_tunnel_param, unforunately there are no unused fields. Maybe schedule this for 2.7 together with a clean up of all the tunnels so they share redundant code? Lots of gre related code and comments spread over non-gre tunnels that should go away. From akpm@osdl.org Wed Jan 12 15:53:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 15:53:11 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0CNr34A010129 for ; Wed, 12 Jan 2005 15:53:04 -0800 Received: from akpm.pao.digeo.com (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id j0CNqvY28281; Wed, 12 Jan 2005 15:52:57 -0800 Date: Wed, 12 Jan 2005 15:57:41 -0800 From: Andrew Morton To: netdev@oss.sgi.com Cc: jgoerzen@complete.org Subject: Fw: [Bugme-new] [Bug 4027] New: assertion failed at net/ipv6/addrconf.c, plus halt fails Message-Id: <20050112155741.193e1f37.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i586-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 184 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Begin forwarded message: Date: Wed, 12 Jan 2005 15:38:23 -0800 From: bugme-daemon@osdl.org To: bugme-new@lists.osdl.org Subject: [Bugme-new] [Bug 4027] New: assertion failed at net/ipv6/addrconf.c, plus halt fails http://bugme.osdl.org/show_bug.cgi?id=4027 Summary: assertion failed at net/ipv6/addrconf.c, plus halt fails Kernel Version: 2.6.9 & 2.6.10, kernel.org tree Status: NEW Severity: normal Owner: yoshfuji@linux-ipv6.org Submitter: jgoerzen@complete.org Distribution: Hardware Environment: Alpha 164LX 21164a 600MHz Software Environment: Debian unstable Problem Description: During bootup, I am getting multiple instances ofitems like this, typically when a daemon starts up: Jan 12 17:23:38 erwin kernel: RTNL: assertion failed at net/ipv6/addrconf.c (1992) Trace shows: Jan 12 17:23:38 erwin kernel: Trace: Jan 12 17:23:38 erwin kernel: [sk_free+324/336] sk_free+0x144/0x150 Jan 12 17:23:38 erwin kernel: [inet_release+128/160] inet_release+0x80/0xa0 Jan 12 17:23:38 erwin kernel: [sock_release+172/240] sock_release+0xac/0xf0 Jan 12 17:23:38 erwin kernel: [sock_close+48/112] sock_close+0x30/0x70 Jan 12 17:23:38 erwin kernel: [__fput+412/448] __fput+0x19c/0x1c0 Jan 12 17:23:38 erwin kernel: [fput+72/96] fput+0x48/0x60 Jan 12 17:23:38 erwin kernel: [filp_close+132/240] filp_close+0x84/0xf0 Jan 12 17:23:38 erwin kernel: [close_files+172/224] close_files+0xac/0xe0 Jan 12 17:23:38 erwin kernel: [put_files_struct+84/224] put_files_struct+0x54/0xe0 Jan 12 17:23:39 erwin kernel: [do_exit+508/1424] do_exit+0x1fc/0x590 Jan 12 17:23:39 erwin kernel: [do_group_exit+60/176] do_group_exit+0x3c/0xb0 Jan 12 17:23:39 erwin kernel: [entSys+164/192] entSys+0xa4/0xc0 The system appears to function normally after bootup. However, when it comes time to halt the system, I cannot. It stalls with: unregister_netdevice: waiting for sit1 to become free. Usage count = 1 This machine is acting as a firewall. I have two Ethernet devices in it; one for the outside and one for the inside. The outside speaks only IPv4. Inside speaks IPv4 and IPv6. IPv6 is routed to the outside via sit1, using the public 6to4 router address. I will attach dmesg logs, ksymoops output, configurations, etc. This behavior was observed on both 2.6.9 and 2.6.10. Please ask if there is any other information you would need to resolve this problem. I am quite happy to provide anything that may be of use. ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. From shemminger@osdl.org Wed Jan 12 16:05:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 16:05:12 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0D052TT012258 for ; Wed, 12 Jan 2005 16:05:02 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0D04rY29617; Wed, 12 Jan 2005 16:04:53 -0800 Date: Wed, 12 Jan 2005 16:04:55 -0800 From: Stephen Hemminger To: Lennert Buytenhek Cc: netdev@oss.sgi.com, rhousley@rsasecurity.com, shollenbeck@verisign.com Subject: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling Message-ID: <20050112160455.3b839b21@dxpl.pdx.osdl.net> In-Reply-To: <20050112222437.GC14280@xi.wantstofly.org> References: <20050112222437.GC14280@xi.wantstofly.org> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 185 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev On Wed, 12 Jan 2005 23:24:37 +0100 Lennert Buytenhek wrote: > Hi, > > After struggling with various userland VPN solutions for a while (and > failing to make IPSEC tunnel mode do what I want), I decided to just > implement ethernet-in-IP tunneling in the kernel and let IPSEC transport > mode handle the rest. > > There appeared to be an RFC for ethernet-in-IP already, RFC 3378, so I > just implemented that. It's very simple -- slap a 16-bit header (0x3000, > which is 4 bits of etherip version number and 12 bits of padding) onto > the beginning of the ethernet packet, and then wrap it in an IP packet. > > Below is what I came up with, against the latest Fedora Core 3 kernel, > which is 2.6.10-something. It survives some fairly basic testing between > a number of different machines, UP and SMP. (Corresponding iproute2 > patch is available from http://www.wantstofly.org/~buytenh/etherip/ ) > Since it is an RFC, any chance of interoperability testing it with something besides Linux on the other end? -- Stephen Hemminger From buytenh@wantstofly.org Wed Jan 12 16:18:39 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 16:18:43 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0D0IcRw013270 for ; Wed, 12 Jan 2005 16:18:39 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id 7D2F12B0EC; Thu, 13 Jan 2005 01:18:37 +0100 (MET) Date: Thu, 13 Jan 2005 01:18:37 +0100 From: Lennert Buytenhek To: Thomas Graf Cc: Ben Greear , netdev@oss.sgi.com, shemminger@osdl.org, shollenbeck@verisign.com Subject: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling Message-ID: <20050113001837.GH14280@xi.wantstofly.org> References: <20050112222437.GC14280@xi.wantstofly.org> <41E5A7E9.4030101@candelatech.com> <20050112224810.GE14280@xi.wantstofly.org> <41E5AEAC.8060706@candelatech.com> <20050112231615.GF14280@xi.wantstofly.org> <20050112234344.GM26856@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050112234344.GM26856@postel.suug.ch> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 186 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev On Thu, Jan 13, 2005 at 12:43:44AM +0100, Thomas Graf wrote: > > > >>Also, could you add an ioctl that allowed one to query whether or not > > > >>a particular device is an etherip device? I had always wished I had added > > > >>this earlier to the VLAN code :) > > > > > > > >Hmmm. Bridge devices don't have this either, do they? Can you name > > > >an advantage of having this? > > > > > > I got the request several times with regard to VLANs. Lots of people > > > (and applications) will want to know the interface type for various > > > reasons. If you don't give them a nice programatic thing like an > > > IOCTL to call, they will undoubtedly start making assumptions based > > > off of the device name... > > > > Makes sense.. > > > > Unfortunately SIOCGETTUNNEL is (SIOCDEVPRIVATE + 3), otherwise we could > > just say something like "If an ARPHRD_ETHER device supports SIOCGETTUNNEL, > > it's an ether/ip tunnel." > > > > Any better ideas? I hate adding more ioctls. > > I think it should go into ip_tunnel_param, unforunately there are no > unused fields. What's that? I can't find it in my kernel tree nor on google. > Maybe schedule this for 2.7 together with a clean up > of all the tunnels so they share redundant code? Lots of gre related > code and comments spread over non-gre tunnels that should go away. Indeed, it would be good to have this cleaned up. cheers, Lennert From tgraf@suug.ch Wed Jan 12 16:27:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 16:27:53 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0D0Rkku017510 for ; Wed, 12 Jan 2005 16:27:47 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 52EB8F; Thu, 13 Jan 2005 01:27:23 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id DF37E1C0EA; Thu, 13 Jan 2005 01:28:06 +0100 (CET) Date: Thu, 13 Jan 2005 01:28:06 +0100 From: Thomas Graf To: Lennert Buytenhek Cc: Ben Greear , netdev@oss.sgi.com, shemminger@osdl.org, shollenbeck@verisign.com Subject: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling Message-ID: <20050113002806.GN26856@postel.suug.ch> References: <20050112222437.GC14280@xi.wantstofly.org> <41E5A7E9.4030101@candelatech.com> <20050112224810.GE14280@xi.wantstofly.org> <41E5AEAC.8060706@candelatech.com> <20050112231615.GF14280@xi.wantstofly.org> <20050112234344.GM26856@postel.suug.ch> <20050113001837.GH14280@xi.wantstofly.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050113001837.GH14280@xi.wantstofly.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 187 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * Lennert Buytenhek <20050113001837.GH14280@xi.wantstofly.org> 2005-01-13 01:18 > What's that? I can't find it in my kernel tree nor on google. Typo, sorry. I meant ip_tunnel_parm. Thinking of it, shouldn't protocol in ip_tunnel_parm->iph->protocol be set to ETHER_IP so userspace could find out this way? From buytenh@wantstofly.org Wed Jan 12 16:30:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 16:30:05 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0D0U0qv017874 for ; Wed, 12 Jan 2005 16:30:01 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id EF1112B0EC; Thu, 13 Jan 2005 01:29:59 +0100 (MET) Date: Thu, 13 Jan 2005 01:29:59 +0100 From: Lennert Buytenhek To: Stephen Hemminger Cc: netdev@oss.sgi.com, shollenbeck@verisign.com Subject: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling Message-ID: <20050113002959.GI14280@xi.wantstofly.org> References: <20050112222437.GC14280@xi.wantstofly.org> <20050112160455.3b839b21@dxpl.pdx.osdl.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050112160455.3b839b21@dxpl.pdx.osdl.net> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 188 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev On Wed, Jan 12, 2005 at 04:04:55PM -0800, Stephen Hemminger wrote: > > After struggling with various userland VPN solutions for a while (and > > failing to make IPSEC tunnel mode do what I want), I decided to just > > implement ethernet-in-IP tunneling in the kernel and let IPSEC transport > > mode handle the rest. > > > > There appeared to be an RFC for ethernet-in-IP already, RFC 3378, so I > > just implemented that. It's very simple -- slap a 16-bit header (0x3000, > > which is 4 bits of etherip version number and 12 bits of padding) onto > > the beginning of the ethernet packet, and then wrap it in an IP packet. > > > > Below is what I came up with, against the latest Fedora Core 3 kernel, > > which is 2.6.10-something. It survives some fairly basic testing between > > a number of different machines, UP and SMP. (Corresponding iproute2 > > patch is available from http://www.wantstofly.org/~buytenh/etherip/ ) > > Since it is an RFC, any chance of interoperability testing it with > something besides Linux on the other end? Some googling suggests that OpenBSD implements this as well. Anyone here with an OpenBSD box on the 'net that's willing to do some tests? cheers, Lennert From buytenh@wantstofly.org Wed Jan 12 16:36:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 16:36:32 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0D0aP7N018818 for ; Wed, 12 Jan 2005 16:36:26 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id 413BC2B0EC; Thu, 13 Jan 2005 01:36:25 +0100 (MET) Date: Thu, 13 Jan 2005 01:36:25 +0100 From: Lennert Buytenhek To: Thomas Graf Cc: Ben Greear , netdev@oss.sgi.com, shemminger@osdl.org, shollenbeck@verisign.com Subject: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling Message-ID: <20050113003625.GJ14280@xi.wantstofly.org> References: <20050112222437.GC14280@xi.wantstofly.org> <41E5A7E9.4030101@candelatech.com> <20050112224810.GE14280@xi.wantstofly.org> <41E5AEAC.8060706@candelatech.com> <20050112231615.GF14280@xi.wantstofly.org> <20050112234344.GM26856@postel.suug.ch> <20050113001837.GH14280@xi.wantstofly.org> <20050113002806.GN26856@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050113002806.GN26856@postel.suug.ch> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 189 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev On Thu, Jan 13, 2005 at 01:28:06AM +0100, Thomas Graf wrote: > > What's that? I can't find it in my kernel tree nor on google. > > Typo, sorry. I meant ip_tunnel_parm. Thinking of it, shouldn't protocol > in ip_tunnel_parm->iph->protocol be set to ETHER_IP so userspace could > find out this way? ip_tunnel_parm->iph->protocol for ether/ip tunnels is IPPROTO_ETHERIP, which is 97. So yeah, the info is in there. But this doesn't help you much in determining whether an arbitrary network device is in fact an ether/ip tunnel or not, since SIOCGETTUNNEL aliases with SIOCDEVPRIVATE+3. The only way to make it stand out would be to give it its own ARPHRD_ type, but then it wouldn't look like an ethernet device anymore. cheers, Lennert From tgraf@suug.ch Wed Jan 12 17:19:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 17:19:56 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0D1JmpM020444 for ; Wed, 12 Jan 2005 17:19:48 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id E7EA8F; Thu, 13 Jan 2005 02:19:24 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 1C26B1C0EA; Thu, 13 Jan 2005 02:20:08 +0100 (CET) Date: Thu, 13 Jan 2005 02:20:07 +0100 From: Thomas Graf To: Lennert Buytenhek Cc: Ben Greear , netdev@oss.sgi.com, shemminger@osdl.org, shollenbeck@verisign.com Subject: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling Message-ID: <20050113012007.GO26856@postel.suug.ch> References: <20050112222437.GC14280@xi.wantstofly.org> <41E5A7E9.4030101@candelatech.com> <20050112224810.GE14280@xi.wantstofly.org> <41E5AEAC.8060706@candelatech.com> <20050112231615.GF14280@xi.wantstofly.org> <20050112234344.GM26856@postel.suug.ch> <20050113001837.GH14280@xi.wantstofly.org> <20050113002806.GN26856@postel.suug.ch> <20050113003625.GJ14280@xi.wantstofly.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050113003625.GJ14280@xi.wantstofly.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 190 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * Lennert Buytenhek <20050113003625.GJ14280@xi.wantstofly.org> 2005-01-13 01:36 > On Thu, Jan 13, 2005 at 01:28:06AM +0100, Thomas Graf wrote: > > > > What's that? I can't find it in my kernel tree nor on google. > > > > Typo, sorry. I meant ip_tunnel_parm. Thinking of it, shouldn't protocol > > in ip_tunnel_parm->iph->protocol be set to ETHER_IP so userspace could > > find out this way? > > ip_tunnel_parm->iph->protocol for ether/ip tunnels is IPPROTO_ETHERIP, > which is 97. So yeah, the info is in there. But this doesn't help you > much in determining whether an arbitrary network device is in fact an > ether/ip tunnel or not, since SIOCGETTUNNEL aliases with SIOCDEVPRIVATE+3. Ahh.. You want userspace to be able to tell even if it is unclear wether it is a tunnel. I think the only way to avoid a new ioctl would be to introduce IFF_TUNNEL or alike and have userspace call GETTUNNEL if it is set. This also solves the problem for all other tunnels. You can also reuse one of the unused flags such as IFF_NOTRAILERS since it would be read only anyway but I guess this would be too much of a hack ;-> From pekkas@netcore.fi Wed Jan 12 23:50:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 12 Jan 2005 23:50:11 -0800 (PST) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0D7o5Gv015162 for ; Wed, 12 Jan 2005 23:50:06 -0800 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id j0D7nt019772; Thu, 13 Jan 2005 09:49:55 +0200 Date: Thu, 13 Jan 2005 09:49:55 +0200 (EET) From: Pekka Savola To: Lennert Buytenhek cc: netdev@oss.sgi.com, shemminger@osdl.org, rhousley@rsasecurity.com, shollenbeck@verisign.com Subject: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling In-Reply-To: <20050112222437.GC14280@xi.wantstofly.org> Message-ID: References: <20050112222437.GC14280@xi.wantstofly.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 191 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev On Wed, 12 Jan 2005, Lennert Buytenhek wrote: > After struggling with various userland VPN solutions for a while (and > failing to make IPSEC tunnel mode do what I want), I decided to just > implement ethernet-in-IP tunneling in the kernel and let IPSEC transport > mode handle the rest. > > There appeared to be an RFC for ethernet-in-IP already, RFC 3378, so I > just implemented that. It's very simple -- slap a 16-bit header (0x3000, > which is 4 bits of etherip version number and 12 bits of padding) onto > the beginning of the ethernet packet, and then wrap it in an IP packet. EtherIP is not recommended for use; it's an Informational RFC. Is there a particular reason why GRE tunnel is not sufficient? AFAICS, it provides all the benefits of Ethernet-in-IP, is very commonly deployed, and only has 4 bytes of overhead. And if GRE is not sufficient, the next step would be L2TP. -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From advertiser@localhost.localdomain Thu Jan 13 00:16:50 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 00:17:02 -0800 (PST) Received: from localhost.localdomain ([82.201.181.227]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0D8GmQL016435 for ; Thu, 13 Jan 2005 00:16:49 -0800 Received: from localhost.localdomain (admin3 [127.0.0.1]) by localhost.localdomain (8.12.8/8.12.8) with ESMTP id j0DKCL70006239 for ; Thu, 13 Jan 2005 22:24:29 +0200 Received: (from advertiser@localhost) by localhost.localdomain (8.12.8/8.12.8/Submit) id j06CYxHe029844 for netdev@oss.sgi.com; Thu, 6 Jan 2005 14:34:59 +0200 Date: Thu, 6 Jan 2005 14:34:59 +0200 From: advertiser@advertise.com Message-Id: <200501061234.j06CYxHe029844@localhost.localdomain> To: netdev@oss.sgi.com Subject: Cheap Prices NOT Cheap Hosting X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 192 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: advertiser@advertise.com Precedence: bulk X-list: netdev .HellO... ------------------------------------------------------------ ############################################################## $ Visit http://www.mkhoster.com For Very Good Hosting Offer $ $ Chosse from our Linux and Windows servers $ $--- Cpanel/helm $ $--- PHP-ASP-ASP.net-JSP $ $--- CGI-perl $ $--- Mysql-Access-MS sqlserver 2000 $ $--- And MORE ....... $ ############################################################## FOR MORE INFORMATIONS -----< http://mkhoster.com/support.html >----- ************************************************************** From Robert.Olsson@data.slu.se Thu Jan 13 00:56:24 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 00:56:28 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0D8uNBB021901 for ; Thu, 13 Jan 2005 00:56:24 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0D8uJLB012306; Thu, 13 Jan 2005 09:56:20 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id BCA0BEC1A0; Thu, 13 Jan 2005 09:56:19 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16870.14259.701771.389978@robur.slu.se> Date: Thu, 13 Jan 2005 09:56:19 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501121723.21969.jeremy.guthrie@berbee.com> References: <200501121647.30934.jeremy.guthrie@berbee.com> <16869.45158.194375.398326@robur.slu.se> <200501121723.21969.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 193 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > > As your traffic looks sane double your bucket size of the route hash to > > start with. Use the boot option w. rhash_entries. look at rtstat > Does it make sense that the driver would kill throughput and force us to > output these types of messages? No the other way around... Higher (driver/cpu) throughput/load causes more dst-entries to freed and you reach the max_size*ip_rt_gc_min_interval which is a constant and get "dst cache overflow". Increasing rhash_entries is the easieast way to attack this.. Give this a try. Monitor with rtstat. You might even have to quadruple your size. --ro From buytenh@wantstofly.org Thu Jan 13 01:23:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 01:23:59 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0D9Nqbw023738 for ; Thu, 13 Jan 2005 01:23:53 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id 5A2162B0EC; Thu, 13 Jan 2005 10:23:51 +0100 (MET) Date: Thu, 13 Jan 2005 10:23:51 +0100 From: Lennert Buytenhek To: Pekka Savola Cc: netdev@oss.sgi.com, shemminger@osdl.org, shollenbeck@verisign.com Subject: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling Message-ID: <20050113092351.GA23170@xi.wantstofly.org> References: <20050112222437.GC14280@xi.wantstofly.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 194 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev On Thu, Jan 13, 2005 at 09:49:55AM +0200, Pekka Savola wrote: > Is there a particular reason why GRE tunnel is not sufficient? No particular reason, apart from not being aware that GRE provides this functionality. cheers, Lennert From kumar.gala@freescale.com Thu Jan 13 06:46:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 06:46:09 -0800 (PST) Received: from de01egw01.freescale.net (de01egw01.freescale.net [192.88.165.102]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0DEk08Y017845 for ; Thu, 13 Jan 2005 06:46:01 -0800 Received: from de01smr01.am.mot.com (de01smr01.freescale.net [10.208.0.31]) by de01egw01.freescale.net (8.12.11/de01egw01) with ESMTP id j0DEoPCt020211; Thu, 13 Jan 2005 07:50:25 -0700 (MST) Received: from [192.168.1.101] (vpn-10-212-32-85.am.freescale.net [10.212.32.85]) by de01smr01.am.mot.com (8.13.1/8.13.0) with ESMTP id j0DEoscr014644; Thu, 13 Jan 2005 08:50:54 -0600 (CST) In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit Cc: Netdev , Andy Fleming From: Kumar Gala Subject: Re: [RFC] Patch to Abstract Ethernet PHY support (using driver model) Date: Thu, 13 Jan 2005 08:45:53 -0600 To: Jeff Garzik X-Mailer: Apple Mail (2.619) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 195 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kumar.gala@freescale.com Precedence: bulk X-list: netdev Jeff, We were hoping for more feedback from netdev people on this patch: http://oss.sgi.com/projects/netdev/archive/2004-12/msg00643.html thanks - kumar On Dec 23, 2004, at 3:00 PM, Andy Fleming wrote: > It has been suggested that I split the patch into 2 parts: gianfar > specific stuff, and PHY specific stuff. > > Here is the result: > From cliffw@osdl.org Thu Jan 13 07:32:14 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 07:32:20 -0800 (PST) Received: from mail.osdl.org ([65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0DFUGJY021770 for ; Thu, 13 Jan 2005 07:32:14 -0800 Received: from osdlab.pdx.osdl.net (cliffw@localhost) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0DFThm26355; Thu, 13 Jan 2005 07:29:43 -0800 Message-Id: <200501131529.j0DFThm26355@mail.osdl.org> To: Stephen Hemminger cc: Craig Thomas , David Hollis , netdev@oss.sgi.com, cliff white , cliffw@osdl.org Subject: Re: Network driver test suite? In-Reply-To: Your message of "Wed, 12 Jan 2005 10:10:01 PST." <20050112101001.20ccc59d@dxpl.pdx.osdl.net> Date: Thu, 13 Jan 2005 07:29:43 -0800 From: Cliff White X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 196 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cliffw@osdl.org Precedence: bulk X-list: netdev > On Wed, 12 Jan 2005 09:14:01 -0800 > Craig Thomas wrote: > > > On Wed, 2005-01-12 at 08:24, David Hollis wrote: > > > On Tue, 2005-01-11 at 17:32 -0800, Craig Thomas wrote: > > > > > > > > > > > Would there be a desire for someone to collect the tests or at least > > > > create an index to all their locations? If so, then developers can > > > > scan a library of potential tests to run against newly developed code. > > > > > > > > OSDL can start incorporating some of these tests into their test > > > > platform as well. > > > > > > I would love to see a collection of the types of tests that should be > > > performed. As it appears now, there is nothing defined that a driver > > > author should do to verify that their driver performs properly, or > > > supports the right capabilities etc. Some things may be difficult to > > > automate, but simply having a checklist would be great. For the things > > > that can be automated, that would be even better. > > > > Great. We can do some of this. I would like to ask, what mimimal > > types of tests do you expect to execute for a driver? If several > > can respond to the types of testing they perform, we can start > > a checklist. Then, additional items can be added to fill in the > > holes. I've asked Cliff White of OSDL to help put this together. > > There are two types of tests that would be easy to set up. > First is a full exercise of all the possible API transitions through > ifconfig, ip link, and ethtool. These could be covered without any > traffic going through. > > Then setup a standard test environment with a known good card and a > crossover cable. The test could then use raw (and/or packet generator) > to send packets down good card to card to be verified. > > Also testing, auto negotiation and transitions under load. Okay, I'll see what i can do to start putting together a list of tests requirements. cliffw From shemminger@osdl.org Thu Jan 13 09:03:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 09:03:08 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0DH2xCT032740 for ; Thu, 13 Jan 2005 09:03:00 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0DH2mY12693; Thu, 13 Jan 2005 09:02:48 -0800 Date: Thu, 13 Jan 2005 09:02:50 -0800 From: Stephen Hemminger To: Kumar Gala Cc: Jeff Garzik , Netdev , Andy Fleming Subject: Re: [RFC] Patch to Abstract Ethernet PHY support (using driver model) Message-ID: <20050113090250.15444e09@dxpl.pdx.osdl.net> In-Reply-To: References: Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 197 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev On Thu, 13 Jan 2005 08:45:53 -0600 Kumar Gala wrote: > Jeff, > > We were hoping for more feedback from netdev people on this patch: > > http://oss.sgi.com/projects/netdev/archive/2004-12/msg00643.html > > thanks > > - kumar > > On Dec 23, 2004, at 3:00 PM, Andy Fleming wrote: > > > It has been suggested that I split the patch into 2 parts: gianfar > > specific stuff, and PHY specific stuff. > > > > Here is the result: > > > It would be more valuable if there were cases where multiple different boards that use the same type of PHY chip were supported. Even better if it could subsume the existing MII code. Don't know enough about all the different flavors of hardware to know what combinations exist but it looks like there are different boards that have the same PHY chips. It looks like the FreeBSD tries to abstract this. -- Stephen Hemminger From tgraf@suug.ch Thu Jan 13 09:40:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 09:41:02 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0DHeqAM004305 for ; Thu, 13 Jan 2005 09:40:53 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 5D623F; Thu, 13 Jan 2005 18:40:29 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id F07E61C0EA; Thu, 13 Jan 2005 18:41:11 +0100 (CET) Date: Thu, 13 Jan 2005 18:41:11 +0100 From: Thomas Graf To: jamal Cc: netdev@oss.sgi.com Subject: [RFC] meta ematch Message-ID: <20050113174111.GP26856@postel.suug.ch> References: <20050105110048.GO26856@postel.suug.ch> <1104931991.1117.152.camel@jzny.localdomain> <20050105144514.GQ26856@postel.suug.ch> <1105019225.2312.7.camel@jzny.localdomain> <20050106194102.GW26856@postel.suug.ch> <1105105511.1046.77.camel@jzny.localdomain> <20050108145457.GZ26856@postel.suug.ch> <1105363582.1041.162.camel@jzny.localdomain> <20050110211747.GA26856@postel.suug.ch> <1105394738.1085.63.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1105394738.1085.63.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 198 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1105394738.1085.63.camel@jzny.localdomain> 2005-01-10 17:05 > > Ok, you make a convincing arguement ;-> No more concerns from my side. > Churn that code! > Found some cycles today and wrote the meta ematch. It tried to find a good compromise between speed and power. So far I added the following matching possibilies: - random - load average (0,1,2) - dev (numeric and string) - indev (numeric and string) - realdev (numeric and string) - skb priority - ... protocol - ... security - ... pkttype (to easly match on multicast/broadcast) - ... pktlen - ... datalen - ... maclen - netfilter mark - ... cache - ... conntrack info - ... debug variable - tc index - ... verdict - ... classid - routing classid - .... iif Yet to come are more routing and socket attributes such as queue sizes, backlog sizes, neighbour attribute of the route found, ... It is also possible to compare two kernel meta values, e.g realdev equals dev. Numeric matches may be modified via shift and mask operators to for example only consider a part of nfmark. Binary matches may have a shift modifier to only consider a certain amount of the data, e.g. "eth1" with shift 1 would end up with "eth". I added this because I wanted something like eth% but didn't want to implement expensive string operations. If its not obvious, random and loadavg are intended for load balancing purposes, i.e. tc filter add ... basic meta random mask 1 eq 1 and \ loadavg_5 lt 10 action redirect ... diff -Nru linux-2.6.10-bk14.orig/include/linux/pkt_cls.h linux-2.6.10-bk14/include/linux/pkt_cls.h --- linux-2.6.10-bk14.orig/include/linux/pkt_cls.h 2005-01-13 11:18:05.000000000 +0100 +++ linux-2.6.10-bk14/include/linux/pkt_cls.h 2005-01-13 11:17:52.000000000 +0100 @@ -352,6 +352,7 @@ TCF_EM_CMP, TCF_EM_NBYTE, TCF_EM_U32, + TCF_EM_META, __TCF_EM_MAX }; diff -Nru linux-2.6.10-bk14.orig/include/linux/tc_ematch/tc_em_meta.h linux-2.6.10-bk14/include/linux/tc_ematch/tc_em_meta.h --- linux-2.6.10-bk14.orig/include/linux/tc_ematch/tc_em_meta.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.10-bk14/include/linux/tc_ematch/tc_em_meta.h 2005-01-13 17:20:59.000000000 +0100 @@ -0,0 +1,71 @@ +#ifndef __LINUX_TC_EM_META_H +#define __LINUX_TC_EM_META_H + +#include + +enum +{ + TCA_EM_META_HDR, + TCA_EM_META_LVALUE, + TCA_EM_META_RVALUE, + __TCA_EM_META_MAX +}; +#define TCA_EM_META_MAX (__TCA_EM_META_MAX - 1) + +struct tcf_meta_val +{ + __u16 kind; + __u8 shift; + __u8 op; +}; + +#define TCF_META_TYPE_MASK (0xf << 12) +#define TCF_META_TYPE(kind) (((kind) & TCF_META_TYPE_MASK) >> 12) +#define TCF_META_ID_MASK 0x7ff +#define TCF_META_ID(kind) ((kind) & TCF_META_ID_MASK) + +enum +{ + TCF_META_TYPE_VAR, + TCF_META_TYPE_INT, + __TCF_META_TYPE_MAX +}; +#define TCF_META_TYPE_MAX (__TCF_META_TYPE_MAX - 1) + +enum +{ + TCF_META_ID_VALUE, + TCF_META_ID_RANDOM, + TCF_META_ID_LOADAVG_0, + TCF_META_ID_LOADAVG_1, + TCF_META_ID_LOADAVG_2, + TCF_META_ID_DEV, + TCF_META_ID_INDEV, + TCF_META_ID_REALDEV, + TCF_META_ID_PRIORITY, + TCF_META_ID_PROTOCOL, + TCF_META_ID_SECURITY, + TCF_META_ID_PKTTYPE, + TCF_META_ID_PKTLEN, + TCF_META_ID_DATALEN, + TCF_META_ID_MACLEN, + TCF_META_ID_NFMARK, + TCF_META_ID_NFCACHE, + TCF_META_ID_NFCTINFO, + TCF_META_ID_NFDEBUG, + TCF_META_ID_TCINDEX, + TCF_META_ID_TCVERDICT, + TCF_META_ID_TCCLASSID, + TCF_META_ID_RTCLASSID, + TCF_META_ID_RTIIF, + __TCF_META_ID_MAX +}; +#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1) + +struct tcf_meta_hdr +{ + struct tcf_meta_val left; + struct tcf_meta_val right; +}; + +#endif diff -Nru linux-2.6.10-bk14.orig/net/sched/Kconfig linux-2.6.10-bk14/net/sched/Kconfig --- linux-2.6.10-bk14.orig/net/sched/Kconfig 2005-01-13 11:18:05.000000000 +0100 +++ linux-2.6.10-bk14/net/sched/Kconfig 2005-01-13 11:17:52.000000000 +0100 @@ -428,6 +428,16 @@ To compile this code as a module, choose M here: the module will be called em_u32. +config NET_EMATCH_META + tristate "Metadata" + depends on NET_EMATCH + ---help--- + Say Y here if you want to be ablt to classify packets based on + metadata. + + To compile this code as a module, choose M here: the + module will be called em_meta. + config NET_CLS_ACT bool "Packet ACTION" depends on EXPERIMENTAL && NET_CLS && NET_QOS diff -Nru linux-2.6.10-bk14.orig/net/sched/Makefile linux-2.6.10-bk14/net/sched/Makefile --- linux-2.6.10-bk14.orig/net/sched/Makefile 2005-01-13 11:18:05.000000000 +0100 +++ linux-2.6.10-bk14/net/sched/Makefile 2005-01-13 11:17:52.000000000 +0100 @@ -37,3 +37,4 @@ obj-$(CONFIG_NET_EMATCH_CMP) += em_cmp.o obj-$(CONFIG_NET_EMATCH_NBYTE) += em_nbyte.o obj-$(CONFIG_NET_EMATCH_U32) += em_u32.o +obj-$(CONFIG_NET_EMATCH_META) += em_meta.o diff -Nru linux-2.6.10-bk14.orig/net/sched/em_meta.c linux-2.6.10-bk14/net/sched/em_meta.c --- linux-2.6.10-bk14.orig/net/sched/em_meta.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.10-bk14/net/sched/em_meta.c 2005-01-13 18:07:04.000000000 +0100 @@ -0,0 +1,566 @@ +/* + * net/sched/em_meta.c Metadata ematch + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: Thomas Graf + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct meta_value +{ + struct tcf_meta_val hdr; + unsigned long value; + unsigned int len; +}; + +struct meta_match +{ + struct meta_value lvalue; + struct meta_value rvalue; +}; + +#define meta_id(value) (TCF_META_ID((value)->hdr.kind)) +#define meta_type(value) (TCF_META_TYPE((value)->hdr.kind)) + +/************************************************************************** + * System status & misc + **************************************************************************/ + +static int meta_int_random(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + get_random_bytes(&dst->value, sizeof(dst->value)); + return 0; +} + +static inline unsigned long fixed_loadavg(unsigned long v) +{ + return (v + (FIXED_1/200)) >> FSHIFT; +} + +static int meta_int_loadavg_0(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + dst->value = fixed_loadavg(avenrun[0]); + return 0; +} + +static int meta_int_loadavg_1(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + dst->value = fixed_loadavg(avenrun[1]); + return 0; +} + +static int meta_int_loadavg_2(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + dst->value = fixed_loadavg(avenrun[2]); + return 0; +} + +/************************************************************************** + * Device names & indices + **************************************************************************/ + +static inline int int_dev(struct net_device *dev, struct meta_value *dst) +{ + if (unlikely(dev == NULL)) + return -1; + + dst->value = dev->ifindex; + return 0; +} + +static inline int var_dev(struct net_device *dev, struct meta_value *dst) +{ + if (unlikely(dev == NULL)) + return -1; + + dst->value = (unsigned long) dev->name; + dst->len = strlen(dev->name); + return 0; +} + +static int meta_int_dev(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + return int_dev(skb->dev, dst); +} + +static int meta_var_dev(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + return var_dev(skb->dev, dst); +} + +static int meta_int_indev(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + return int_dev(skb->input_dev, dst); +} + +static int meta_var_indev(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + return var_dev(skb->input_dev, dst); +} + +static int meta_int_realdev(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + return int_dev(skb->real_dev, dst); +} + +static int meta_var_realdev(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + return var_dev(skb->real_dev, dst); +} + +/************************************************************************** + * skb attributes + **************************************************************************/ + +static int meta_int_priority(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + dst->value = skb->priority; + return 0; +} + +static int meta_int_protocol(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + dst->value = skb->protocol; + return 0; +} + +static int meta_int_security(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + dst->value = skb->security; + return 0; +} + +static int meta_int_pkttype(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + dst->value = skb->pkt_type; + return 0; +} + +static int meta_int_pktlen(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + dst->value = skb->len; + return 0; +} + +static int meta_int_datalen(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + dst->value = skb->data_len; + return 0; +} + +static int meta_int_maclen(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + dst->value = skb->mac_len; + return 0; +} + +/************************************************************************** + * Netfilter + **************************************************************************/ + +#ifdef CONFIG_NETFILTER +static int meta_int_nfmark(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + dst->value = skb->nfmark; + return 0; +} + +static int meta_int_nfcache(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + dst->value = skb->nfcache; + return 0; +} + +static int meta_int_nfctinfo(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + dst->value = skb->nfctinfo; + return 0; +} + +#ifdef CONFIG_NETFILTER_DEBUG +static int meta_int_nfdebug(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + dst->value = skb->nf_debug; + return 0; +} +#endif +#endif + +/************************************************************************** + * Traffic Control + **************************************************************************/ + +static int meta_int_tcindex(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + dst->value = skb->tc_index; + return 0; +} + +#ifdef CONFIG_NET_CLS_ACT +static int meta_int_tcverd(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + dst->value = skb->tc_verd; + return 0; +} + +static int meta_int_tcclassid(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + dst->value = skb->tc_classid; + return 0; +} +#endif + +/************************************************************************** + * Routing + **************************************************************************/ + +#ifdef CONFIG_NET_CLS_ROUTE +static int meta_int_rtclassid(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + if (unlikely(skb->dst == NULL)) + return -1; + + dst->value = skb->dst->tclassid; + return 0; +} +#endif + +static int meta_int_rtiif(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + if (unlikely(skb->dst == NULL)) + return -1; + + dst->value = ((struct rtable*) skb->dst)->fl.iif; + return 0; +} + +struct meta_ops +{ + int (*get)(struct sk_buff *, struct tcf_pkt_info *, + struct meta_value *, struct meta_value *); +}; + +static struct meta_ops __meta_ops[TCF_META_TYPE_MAX+1][TCF_META_ID_MAX+1] = { + [TCF_META_TYPE_VAR] = { + [TCF_META_ID_DEV] = { .get = meta_var_dev }, + [TCF_META_ID_INDEV] = { .get = meta_var_indev }, + [TCF_META_ID_REALDEV] = { .get = meta_var_realdev } + }, + [TCF_META_TYPE_INT] = { + [TCF_META_ID_RANDOM] = { .get = meta_int_random }, + [TCF_META_ID_LOADAVG_0] = { .get = meta_int_loadavg_0 }, + [TCF_META_ID_LOADAVG_1] = { .get = meta_int_loadavg_1 }, + [TCF_META_ID_LOADAVG_2] = { .get = meta_int_loadavg_2 }, + [TCF_META_ID_DEV] = { .get = meta_int_dev }, + [TCF_META_ID_INDEV] = { .get = meta_int_indev }, + [TCF_META_ID_REALDEV] = { .get = meta_int_realdev }, + [TCF_META_ID_PRIORITY] = { .get = meta_int_priority }, + [TCF_META_ID_PROTOCOL] = { .get = meta_int_protocol }, + [TCF_META_ID_SECURITY] = { .get = meta_int_security }, + [TCF_META_ID_PKTTYPE] = { .get = meta_int_pkttype }, + [TCF_META_ID_PKTLEN] = { .get = meta_int_pktlen }, + [TCF_META_ID_DATALEN] = { .get = meta_int_datalen }, + [TCF_META_ID_MACLEN] = { .get = meta_int_maclen }, +#ifdef CONFIG_NETFILTER + [TCF_META_ID_NFMARK] = { .get = meta_int_nfmark }, + [TCF_META_ID_NFCACHE] = { .get = meta_int_nfcache }, + [TCF_META_ID_NFCTINFO] = { .get = meta_int_nfctinfo }, +#ifdef CONFIG_NETFILTER_DEBUG + [TCF_META_ID_NFDEBUG] = { .get = meta_int_nfdebug }, +#endif +#endif + [TCF_META_ID_TCINDEX] = { .get = meta_int_tcindex }, +#ifdef CONFIG_NET_CLS_ACT + [TCF_META_ID_TCVERDICT] = { .get = meta_int_tcverd }, + [TCF_META_ID_TCCLASSID] = { .get = meta_int_tcclassid }, +#endif +#ifdef CONFIG_NET_CLS_ROUTE + [TCF_META_ID_RTCLASSID] = { .get = meta_int_rtclassid }, +#endif + [TCF_META_ID_RTIIF] = { .get = meta_int_rtiif } + } +}; + +static inline struct meta_ops * meta_ops(struct meta_value *v) +{ + return &__meta_ops[meta_type(v)][meta_id(v)]; +} + +static int meta_var_compare(struct meta_value *a, struct meta_value *b) +{ + int r = a->len - b->len; + + if (r == 0) + r = memcmp((void *) a->value, (void *) b->value, a->len); + + return r; +} + +static int meta_var_change(struct meta_value *dst, struct rtattr *rta) +{ + int len = RTA_PAYLOAD(rta); + + dst->value = (unsigned long) kmalloc(len, GFP_KERNEL); + if (dst->value == 0UL) + return -ENOMEM; + memcpy((void *) dst->value, RTA_DATA(rta), len); + dst->len = len; + return 0; +} + +static void meta_var_destroy(struct meta_value *v) +{ + kfree((void *) v->value); +} + +static void meta_var_apply_extras(struct meta_value *v, + struct meta_value *dst) +{ + int shift = v->hdr.shift; + + if (shift && shift < dst->len) + dst->len -= shift; +} + +static int meta_int_compare(struct meta_value *a, struct meta_value *b) +{ + return a->value - b->value; +} + +static int meta_int_change(struct meta_value *dst, struct rtattr *rta) +{ + if (RTA_PAYLOAD(rta) < sizeof(u32)) + return -EINVAL; + dst->value = *(u32*) RTA_DATA(rta); + dst->len = sizeof(u32); + return 0; +} + +static void meta_int_apply_extras(struct meta_value *v, + struct meta_value *dst) +{ + if (v->hdr.shift) + dst->value >>= v->hdr.shift; + + if (v->value) + dst->value &= v->value; +} + +struct meta_type_ops +{ + void (*destroy)(struct meta_value *); + int (*compare)(struct meta_value *, struct meta_value *); + int (*change)(struct meta_value *, struct rtattr *); + void (*apply_extras)(struct meta_value *, struct meta_value *); +}; + +static struct meta_type_ops __meta_type_ops[TCF_META_TYPE_MAX+1] = { + [TCF_META_TYPE_VAR] = { + .destroy = meta_var_destroy, + .compare = meta_var_compare, + .change = meta_var_change, + .apply_extras = meta_var_apply_extras + }, + [TCF_META_TYPE_INT] = { + .compare = meta_int_compare, + .change = meta_int_change, + .apply_extras = meta_int_apply_extras + } +}; + +static inline struct meta_type_ops * meta_type_ops(struct meta_value *v) +{ + return &__meta_type_ops[meta_type(v)]; +} + +static inline int meta_get(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_value *dst) +{ + int err; + + if (meta_id(v) == TCF_META_ID_VALUE) { + dst->value = v->value; + dst->len = v->len; + return 0; + } + + err = meta_ops(v)->get(skb, info, v, dst); + if (err < 0) + return err; + + if (meta_type_ops(v)->apply_extras) + meta_type_ops(v)->apply_extras(v, dst); + + return 0; +} + +static int em_meta_match(struct sk_buff *skb, struct tcf_ematch *m, + struct tcf_pkt_info *info) +{ + int r; + struct meta_match *meta = (struct meta_match *) m->data; + struct meta_value l_value, r_value; + + if (meta_get(skb, info, &meta->lvalue, &l_value) < 0 || + meta_get(skb, info, &meta->rvalue, &r_value) < 0) + return 0; + + r = meta_type_ops(&meta->lvalue)->compare(&l_value, &r_value); + + switch (meta->lvalue.hdr.op) { + case TCF_EM_OPND_EQ: + return !r; + case TCF_EM_OPND_LT: + return r < 0; + case TCF_EM_OPND_GT: + return r > 0; + } + + return 0; +} + +static inline void meta_delete(struct meta_match *meta) +{ + struct meta_type_ops *ops = meta_type_ops(&meta->lvalue); + + if (ops && ops->destroy) { + ops->destroy(&meta->lvalue); + ops->destroy(&meta->rvalue); + } + + kfree(meta); +} + +static inline int meta_change_data(struct meta_value *dst, struct rtattr *rta) +{ + if (rta) { + if (RTA_PAYLOAD(rta) == 0) + return -EINVAL; + + return meta_type_ops(dst)->change(dst, rta); + } + + return 0; +} + +static int em_meta_change(struct tcf_proto *tp, void *data, int len, + struct tcf_ematch *m) +{ + int err = -EINVAL; + struct rtattr *tb[TCA_EM_META_MAX]; + struct tcf_meta_hdr *hdr; + struct meta_match *meta = NULL; + + if (rtattr_parse(tb, TCA_EM_META_MAX, data, len) < 0) + goto errout; + + if (tb[TCA_EM_META_HDR-1] == NULL || + RTA_PAYLOAD(tb[TCA_EM_META_HDR-1]) < sizeof(*hdr)) + goto errout; + hdr = RTA_DATA(tb[TCA_EM_META_HDR-1]); + + if (TCF_META_TYPE(hdr->left.kind) != TCF_META_TYPE(hdr->right.kind) || + TCF_META_TYPE(hdr->left.kind) > TCF_META_TYPE_MAX || + TCF_META_ID(hdr->left.kind) > TCF_META_ID_MAX || + TCF_META_ID(hdr->right.kind) > TCF_META_ID_MAX) + goto errout; + + meta = kmalloc(sizeof(*meta), GFP_KERNEL); + if (meta == NULL) + goto errout; + memset(meta, 0, sizeof(*meta)); + + memcpy(&meta->lvalue.hdr, &hdr->left, sizeof(hdr->left)); + memcpy(&meta->rvalue.hdr, &hdr->right, sizeof(hdr->right)); + + if (meta_ops(&meta->lvalue)->get == NULL || + meta_ops(&meta->rvalue)->get == NULL) { + err = -EOPNOTSUPP; + goto errout; + } + + if (meta_change_data(&meta->lvalue, tb[TCA_EM_META_LVALUE-1]) < 0 || + meta_change_data(&meta->rvalue, tb[TCA_EM_META_RVALUE-1]) < 0) + goto errout; + + m->datalen = sizeof(*meta); + m->data = (unsigned long) meta; + + err = 0; +errout: + if (err && meta) + meta_delete(meta); + return err; +} + +static void em_meta_destroy(struct tcf_proto *tp, struct tcf_ematch *m) +{ + meta_delete((struct meta_match *) m->data); +} + +static struct tcf_ematch_ops em_meta_ops = { + .kind = TCF_EM_META, + .change = em_meta_change, + .match = em_meta_match, + .destroy = em_meta_destroy, + .owner = THIS_MODULE, + .link = LIST_HEAD_INIT(em_meta_ops.link) +}; + +static int __init init_em_meta(void) +{ + return tcf_em_register(&em_meta_ops); +} + +static void __exit exit_em_meta(void) +{ + tcf_em_unregister(&em_meta_ops); +} + +MODULE_LICENSE("GPL"); + +module_init(init_em_meta); +module_exit(exit_em_meta); + From afleming@freescale.com Thu Jan 13 10:22:38 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 10:22:43 -0800 (PST) Received: from de01egw01.freescale.net (de01egw01.freescale.net [192.88.165.102]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0DIMbla006630 for ; Thu, 13 Jan 2005 10:22:38 -0800 Received: from de01smr02.am.mot.com (de01smr02.freescale.net [10.208.0.151]) by de01egw01.freescale.net (8.12.11/de01egw01) with ESMTP id j0DIQt7L029216; Thu, 13 Jan 2005 11:26:55 -0700 (MST) Received: from [10.82.17.240] ([10.82.17.240]) by de01smr02.am.mot.com (8.13.1/8.13.0) with ESMTP id j0DIRaAf026532; Thu, 13 Jan 2005 12:27:36 -0600 (CST) In-Reply-To: <20050113090250.15444e09@dxpl.pdx.osdl.net> References: <20050113090250.15444e09@dxpl.pdx.osdl.net> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <103A69BE-6590-11D9-8D70-000393C30512@freescale.com> Content-Transfer-Encoding: 7bit Cc: Kumar Gala , Jeff Garzik , Netdev From: Andy Fleming Subject: Re: [RFC] Patch to Abstract Ethernet PHY support (using driver model) Date: Thu, 13 Jan 2005 12:22:20 -0600 To: Stephen Hemminger X-Mailer: Apple Mail (2.619) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 199 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: afleming@freescale.com Precedence: bulk X-list: netdev On Jan 13, 2005, at 11:02, Stephen Hemminger wrote: >> On Dec 23, 2004, at 3:00 PM, Andy Fleming wrote: >> >>> It has been suggested that I split the patch into 2 parts: gianfar >>> specific stuff, and PHY specific stuff. >>> >>> Here is the result: >>> >> > > It would be more valuable if there were cases where multiple different > boards that > use the same type of PHY chip were supported. Even better if it could > subsume the existing > MII code. Don't know enough about all the different flavors of > hardware to know what > combinations exist but it looks like there are different boards that > have the same > PHY chips. It looks like the FreeBSD tries to abstract this. I'm not clear what you mean here. The whole point of the code is to allow different boards which use the same PHY chip to use the same code. The only code that would be different is code that is specific to the board. Does this code not fulfill that requirement? Andy Fleming Open Source Team Freescale Semiconductor, Inc From kaber@trash.net Thu Jan 13 10:54:38 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 10:54:43 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0DIsbVa009838 for ; Thu, 13 Jan 2005 10:54:38 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CpA73-0006uj-VX; Thu, 13 Jan 2005 19:54:30 +0100 Message-ID: <41E6C3E5.2020908@trash.net> Date: Thu, 13 Jan 2005 19:54:29 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: Thomas Graf CC: jamal , netdev@oss.sgi.com Subject: Re: [RFC] meta ematch References: <20050105110048.GO26856@postel.suug.ch> <1104931991.1117.152.camel@jzny.localdomain> <20050105144514.GQ26856@postel.suug.ch> <1105019225.2312.7.camel@jzny.localdomain> <20050106194102.GW26856@postel.suug.ch> <1105105511.1046.77.camel@jzny.localdomain> <20050108145457.GZ26856@postel.suug.ch> <1105363582.1041.162.camel@jzny.localdomain> <20050110211747.GA26856@postel.suug.ch> <1105394738.1085.63.camel@jzny.localdomain> <20050113174111.GP26856@postel.suug.ch> In-Reply-To: <20050113174111.GP26856@postel.suug.ch> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 200 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Thomas Graf wrote: >Found some cycles today and wrote the meta ematch. It tried to >find a good compromise between speed and power. > >So far I added the following matching possibilies: > - random > - load average (0,1,2) > - dev (numeric and string) > - indev (numeric and string) > - realdev (numeric and string) > - skb priority > - ... protocol > - ... security > - ... pkttype (to easly match on multicast/broadcast) > - ... pktlen > - ... datalen > - ... maclen > - netfilter mark > - ... cache > - ... conntrack info > - ... debug variable > - tc index > - ... verdict > - ... classid > - routing classid > - .... iif > >Yet to come are more routing and socket attributes such as queue >sizes, backlog sizes, neighbour attribute of the route found, ... > >It is also possible to compare two kernel meta values, e.g >realdev equals dev. > >Numeric matches may be modified via shift and mask operators >to for example only consider a part of nfmark. > >Binary matches may have a shift modifier to only consider >a certain amount of the data, e.g. "eth1" with shift 1 would >end up with "eth". I added this because I wanted something >like eth% but didn't want to implement expensive string >operations. > > Looks great. I have a few doubts about about the set of chosen values though. Things like nf_debug and nf_cache were never meant to be userspace-visible. What about backwards compatibility if we want to remove it, or some other more meaningful value where just returning 0 wouldn't be the same ? A couple of minor things: - var_dev sets dst->value to dev->name, meta_var_destroy will try to free dev->name. - meta_int_change only uses 32 bit, but dst->value is unsigned long (64 bit on 64-bit arches). nfmark for example is unsigned long, so you should also use *(unsigned long *). - for the same reason meta_int_compare should return long not int >If its not obvious, random and loadavg are intended for >load balancing purposes, i.e. > > I have my doubts about the usefullness of load balancing traffic based on CPU load, but I guess it doesn't hurt. Regards Patrick From tgraf@suug.ch Thu Jan 13 11:20:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 11:20:34 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0DJKRZP011997 for ; Thu, 13 Jan 2005 11:20:27 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 380C7F; Thu, 13 Jan 2005 20:20:04 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 66B891C0EA; Thu, 13 Jan 2005 20:20:47 +0100 (CET) Date: Thu, 13 Jan 2005 20:20:47 +0100 From: Thomas Graf To: Patrick McHardy Cc: jamal , netdev@oss.sgi.com Subject: Re: [RFC] meta ematch Message-ID: <20050113192047.GQ26856@postel.suug.ch> References: <20050105144514.GQ26856@postel.suug.ch> <1105019225.2312.7.camel@jzny.localdomain> <20050106194102.GW26856@postel.suug.ch> <1105105511.1046.77.camel@jzny.localdomain> <20050108145457.GZ26856@postel.suug.ch> <1105363582.1041.162.camel@jzny.localdomain> <20050110211747.GA26856@postel.suug.ch> <1105394738.1085.63.camel@jzny.localdomain> <20050113174111.GP26856@postel.suug.ch> <41E6C3E5.2020908@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41E6C3E5.2020908@trash.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 201 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * Patrick McHardy <41E6C3E5.2020908@trash.net> 2005-01-13 19:54 > Looks great. I have a few doubts about about the set of chosen values > though. Things like nf_debug and nf_cache were never meant to be > userspace-visible. What about backwards compatibility if we want to > remove it, or some other more meaningful value where just returning 0 > wouldn't be the same ? It is indeed problematic and they should be marked as "for debugging purposes (unreliable)" but at least nf_debug and nfctinfo are very useful for debugging. > - var_dev sets dst->value to dev->name, meta_var_destroy will try to > free dev->name. The `dst` meta_value is the l_value/r_lvalue from em_meta_match and never gets destroyed. I reused meta_data to store address & length. It might be a good idea to make a new struct for this to make it more readable though. > - meta_int_change only uses 32 bit, but dst->value is unsigned long > (64 bit on 64-bit arches). nfmark for example is unsigned long, so > you should also use *(unsigned long *). Doesn't work when size of long differs between kernel and userspace. I'm aware of this but it seems everyone is using int anyway for nfmark, so yes this indeed limits the use of nfmark match to only 32 bits on 64bit machines. The proper way is to introduce a new type TCF_EM_TYPE_INT64 and access nfmark over it but I didn't want to create a new type just because of this special case. We can always add it later as addition to the 32bit version. > - for the same reason meta_int_compare should return long not int Agreed. From jeremy.guthrie@berbee.com Thu Jan 13 11:28:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 11:28:49 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0DJSf2k012908 for ; Thu, 13 Jan 2005 11:28:41 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Thu, 13 Jan 2005 13:28:35 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Thu, 13 Jan 2005 13:28:29 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson References: <200501121723.21969.jeremy.guthrie@berbee.com> <16870.14259.701771.389978@robur.slu.se> In-Reply-To: <16870.14259.701771.389978@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2668695.7sWysN36Or"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501131328.34449.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 13 Jan 2005 19:28:35.0965 (UTC) FILETIME=[1376B2D0:01C4F9A6] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 202 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart2668695.7sWysN36Or Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I after a few revs I just bumped rhash_entries to 2.4mil in an attempt to g= et=20 well above my actual usage.=20 You can see below I am over 600K entries before it blows them away and=20 restarts. How do I bump up the time from 10 minutes to something longer? = =20 With the way our system works, entries should be good for a day as we won't= =20 reprogram the policy route table but once a day. I still have some instrumented network card drivers to work with but I now= =20 show some 30-40% idle CPU on CPU0 but still with 0.3% packet loss. I'll po= st=20 stats once I get the instrumented drivers in. size IN: hit tot mc no_rt bcast madst masrc OUT: hit tot = mc=20 GC: tot ignored goal_miss ovrf HASH: in_search out_search 611167 98712 645 0 0 0 0 0 30 0=20 1074229262 645 643 0 0 61922 17 611461 96203 591 0 0 0 1 0 42 1=20 3220738034 592 590 0 0 63160 14 611759 93852 592 0 0 0 0 0 18 0 = =20 0 591 589 0 0 63078 6 612094 95276 632 0 0 0 0 0 28 0 = =20 0 632 630 0 0 63336 8 612368 94945 580 0 0 0 0 0 22 0 = =20 0 578 576 0 0 61224 18 612670 99258 622 0 0 0 0 0 28 0 = =20 0 621 619 0 0 63922 8 613025 93573 666 0 0 0 0 0 16 0 = =20 0 665 663 0 0 61781 6 613394 83917 722 0 0 0 0 0 8 0 = =20 0 721 719 0 0 55533 10 613697 85851 634 0 0 0 0 0 10 0 = =20 0 633 631 0 0 56394 12 613986 81854 611 0 0 0 0 0 8 0 = =20 0 610 608 0 0 54273 8 614349 81419 704 0 0 0 0 0 4 0 = =20 0 702 700 0 0 52641 8 614651 83312 616 0 0 0 0 0 14 0 = =20 0 617 615 0 0 54160 12 614962 83119 651 0 0 0 0 0 6 0 = =20 0 651 649 0 0 56612 4 615264 84871 583 0 0 0 0 0 10 0 = =20 0 583 581 0 0 56130 12 615521 83932 557 0 0 0 0 0 8 0 = =20 0 557 555 0 0 56229 10 615852 86368 626 0 0 0 0 0 8 0 = =20 0 624 622 0 0 56504 10 493558 47553 4603 0 0 0 0 0 2 0 = =20 0 4166 4164 0 0 28346 0 10091 46526 7096 0 0 0 0 0 2 3 = 0 =20 0 0 0 0 554 0 16238 80565 6145 0 0 0 0 0 6 3 = 0 =20 0 0 0 0 1334 0 21754 81224 5515 0 0 0 0 0 6 2 = 0 =20 0 0 0 0 1793 0 size IN: hit tot mc no_rt bcast madst masrc OUT: hit tot = mc=20 GC: tot ignored goal_miss ovrf HASH: in_search out_search 26737 80792 4982 0 0 0 0 0 5 2=20 1074229262 0 0 0 0 2669 0 31085 82895 4347 0 0 0 0 0 5 1=20 3220738034 0 0 0 0 2397 0 35333 83220 4248 0 0 0 0 0 1 1 = 0 =20 0 0 0 0 2754 0 39053 83910 3720 0 0 0 0 0 7 1 = 0 =20 0 0 0 0 3328 0 42692 82373 3634 0 0 0 0 0 8 6 = 0 =20 0 0 0 0 3485 3 46404 84900 3707 0 0 0 0 0 15 7 = 0 =20 0 0 0 0 3889 1 On Thursday 13 January 2005 02:56 am, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > > As your traffic looks sane double your bucket size of the route hash > > > to start with. Use the boot option w. rhash_entries. look at rtstat > > > > Does it make sense that the driver would kill throughput and force us = to > > output these types of messages? > > No the other way around... Higher (driver/cpu) throughput/load causes mo= re > dst-entries to freed and you reach the max_size*ip_rt_gc_min_interval > which is a constant and get "dst cache overflow". > > Increasing rhash_entries is the easieast way to attack this.. Give this > a try. Monitor with rtstat. You might even have to quadruple your size. > > --ro =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart2668695.7sWysN36Or Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB5sviqtjaBHGZBeURAkUqAJ4oKcrGq3qtLSJHT0vJZG5Zk8o0DgCffgee z8UBMfM4V3ifgUym8XNgmY4= =Jhh0 -----END PGP SIGNATURE----- --nextPart2668695.7sWysN36Or-- From afleming@freescale.com Thu Jan 13 11:50:44 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 11:50:50 -0800 (PST) Received: from de01egw02.freescale.net (de01egw02.freescale.net [192.88.165.103]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0DJoi3Y015593 for ; Thu, 13 Jan 2005 11:50:44 -0800 Received: from de01smr02.am.mot.com (de01smr02.freescale.net [10.208.0.151]) by de01egw02.freescale.net (8.12.11/de01egw02) with ESMTP id j0DJrI6w026684; Thu, 13 Jan 2005 12:53:18 -0700 (MST) Received: from [10.82.17.240] ([10.82.17.240]) by de01smr02.am.mot.com (8.13.1/8.13.0) with ESMTP id j0DJtlCT011490; Thu, 13 Jan 2005 13:55:47 -0600 (CST) In-Reply-To: <20050106070245.GA6539@gate.ebshome.net> References: <20050106070245.GA6539@gate.ebshome.net> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <61A37C72-659C-11D9-8D70-000393C30512@freescale.com> Content-Transfer-Encoding: 7bit Cc: Kumar Gala , Netdev , Embedded PPC Linux list From: Andy Fleming Subject: Re: [RFC] Patch to Abstract Ethernet PHY support (using driver model) Date: Thu, 13 Jan 2005 13:50:31 -0600 To: Eugene Surovegin X-Mailer: Apple Mail (2.619) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 203 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: afleming@freescale.com Precedence: bulk X-list: netdev On Jan 6, 2005, at 01:02, Eugene Surovegin wrote: > On Thu, Dec 23, 2004 at 03:00:13PM -0600, Andy Fleming wrote: >> >>> Adds a Phy Abstraction Layer which allows ethernet controllers to >>> manage their PHYs without knowing the details of how the particular >>> PHY device operates. This code steals heavily from BenH's sungem >>> driver, and got some stuff out of Jason McMullan's patch. > > Some random notes from quick look at the code: > > 1) IMO if we can extract some info from the PHY using _standard_ > registers we should use them, even if the PHY provides some custom > ones. > > I suspect that _all_ XXX_read_status functions for different PHYs in > your patch can be easily handled by generic IEEE 802.3 compliant code > (you need to update genphy_read_status to properly handle GigE of > course). Ok, I understand this, but a part of me rebels. The "standard" procedure is to read the Link Partner Advertisement, AND it with the Advertisement, and then find the highest setting that works. It seems to me that this is replicating work that is already done by the PHY, and I hate to do work that's already been done. I also have one worry about this technique (though I'm still reading the 802.3 spec to see if my worry is valid). Is it possible that the PHY would choose a setting which is lower than the highest possible, and therefore render the method above inaccurate? > > 2) genphy can be changed to handle GigE speeds as well. Yeah, that's not a problem. I just wasn't sure if the bits were properly defined on non-gigabit PHYs. I will change this, as long as the relevant bits are always correct on 10/100 PHYs > > 3) I think it's better for the genphy case to _detect_ PHY features > instead of hard coding PHY_BASIC_FEATURES. In this case you can easily > handle 10/100 and 10/100/1000 PHYs by genphy code. Ok, that's easy enough > > 4) Pause negotiation/advertising is completely missing. Sigh... I knew someone would ask for that. I will get right on this. From akpm@osdl.org Thu Jan 13 11:53:52 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 11:53:58 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0DJrp31016317 for ; Thu, 13 Jan 2005 11:53:52 -0800 Received: from bix (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id j0DJrjY15881; Thu, 13 Jan 2005 11:53:45 -0800 Date: Thu, 13 Jan 2005 11:53:28 -0800 From: Andrew Morton To: netdev@oss.sgi.com Cc: nmalykh@bilim.com Subject: Fw: [Bugme-new] [Bug 4037] New: Incorrect parameters handling in pktgen.c. Message-Id: <20050113115328.7d66410f.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 204 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Begin forwarded message: Date: Thu, 13 Jan 2005 08:29:49 -0800 From: bugme-daemon@osdl.org To: bugme-new@lists.osdl.org Subject: [Bugme-new] [Bug 4037] New: Incorrect parameters handling in pktgen.c. http://bugme.osdl.org/show_bug.cgi?id=4037 Summary: Incorrect parameters handling in pktgen.c. Kernel Version: <= 2.6.10 Status: NEW Severity: normal Owner: acme@conectiva.com.br Submitter: nmalykh@bilim.com Distribution: kernel source Hardware Environment: ALL Software Environment: ALL Problem Description: Incorrect handling cur_udp_dst and cur_udp_src in function mod_cur_headers(). Few mistakes in Documentation/networking/pktgen.txt Steps to reproduce: set udp_src_min > udp_src_max or/and udp_dst_min >= udp_dst_max in packet generation script ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. From davem@davemloft.net Thu Jan 13 12:07:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 12:07:48 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0DK7fdH017654 for ; Thu, 13 Jan 2005 12:07:42 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CpB9G-0001gB-00; Thu, 13 Jan 2005 12:00:50 -0800 Date: Thu, 13 Jan 2005 12:00:50 -0800 From: "David S. Miller" To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert.Olsson@data.slu.se Subject: Re: V2.4 policy router operates faster/better than V2.6 Message-Id: <20050113120050.0c734df5.davem@davemloft.net> In-Reply-To: <200501131328.34449.jeremy.guthrie@berbee.com> References: <200501121723.21969.jeremy.guthrie@berbee.com> <16870.14259.701771.389978@robur.slu.se> <200501131328.34449.jeremy.guthrie@berbee.com> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 205 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Thu, 13 Jan 2005 13:28:29 -0600 "Jeremy M. Guthrie" wrote: > You can see below I am over 600K entries before it blows them away and > restarts. How do I bump up the time from 10 minutes to something longer? > With the way our system works, entries should be good for a day as we won't > reprogram the policy route table but once a day. Increase /proc/sys/net/ipv4/ip_rt_secret_interval From jeremy.guthrie@berbee.com Thu Jan 13 12:43:41 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 12:43:47 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0DKheeK024075 for ; Thu, 13 Jan 2005 12:43:40 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Thu, 13 Jan 2005 14:43:35 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Thu, 13 Jan 2005 14:43:30 -0600 User-Agent: KMail/1.7.2 Cc: "David S. Miller" , Robert.Olsson@data.slu.se References: <200501131328.34449.jeremy.guthrie@berbee.com> <20050113120050.0c734df5.davem@davemloft.net> In-Reply-To: <20050113120050.0c734df5.davem@davemloft.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart10540886.MM5IrbZhTB"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501131443.34174.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 13 Jan 2005 20:43:35.0114 (UTC) FILETIME=[8D2A5AA0:01C4F9B0] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 206 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart10540886.MM5IrbZhTB Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I don't show that proc file being there. I see it in 'iproute.c' but not i= n=20 proc. On Thursday 13 January 2005 02:00 pm, David S. Miller wrote: > On Thu, 13 Jan 2005 13:28:29 -0600 > > "Jeremy M. Guthrie" wrote: > > You can see below I am over 600K entries before it blows them away and > > restarts. How do I bump up the time from 10 minutes to something longe= r? > > With the way our system works, entries should be good for a day as we > > won't reprogram the policy route table but once a day. > > Increase /proc/sys/net/ipv4/ip_rt_secret_interval =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart10540886.MM5IrbZhTB Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB5t12qtjaBHGZBeURAqKCAJ0VKnhvq9Na4+cdNHUfL/Js7i5qwQCdHcAx o+vhNCrS3lz+OO0+ZvK7IgA= =3cFq -----END PGP SIGNATURE----- --nextPart10540886.MM5IrbZhTB-- From Robert.Olsson@data.slu.se Thu Jan 13 13:12:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 13:12:26 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0DLCKHX028857 for ; Thu, 13 Jan 2005 13:12:21 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0DLCE9b020890; Thu, 13 Jan 2005 22:12:15 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id C3A18EC1A0; Thu, 13 Jan 2005 22:12:14 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16870.58414.767012.96364@robur.slu.se> Date: Thu, 13 Jan 2005 22:12:14 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501131328.34449.jeremy.guthrie@berbee.com> References: <200501121723.21969.jeremy.guthrie@berbee.com> <16870.14259.701771.389978@robur.slu.se> <200501131328.34449.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 207 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > I after a few revs I just bumped rhash_entries to 2.4mil in an attempt to get > well above my actual usage. A bit hefty size :-) But the stats are looking much better as we do much less linear search (in_search) in hash and less fib lookups (tot) And you have now "dst cache overflows"? Is the e1000 patch I sent in use? > You can see below I am over 600K entries before it blows them away and > restarts. This is a part of GC process to reclaim memory and reclaim unused dst entries. This > size IN: hit tot mc no_rt bcast madst masrc OUT: hit tot mc > GC: tot ignored goal_miss ovrf HASH: in_search out_search > 615852 86368 626 0 0 0 0 0 8 0 > 0 624 622 0 0 56504 10 > 493558 47553 4603 0 0 0 0 0 2 0 > 0 4166 4164 0 0 28346 0 > 10091 46526 7096 0 0 0 0 0 2 3 0 > 0 0 0 0 554 0 > 16238 80565 6145 0 0 0 0 0 6 3 0 > 0 0 0 0 1334 0 In short we reduce the hash size to remove unused flows and let it grow again. You see from (tot) that we have recreate may of the flows at this point. Most likely this is where we drop the packets. We have monitored small drops in our system when GC happens. The GC can be smoothen out but we leave that for now. Is the e1000 patch I sent in use? > How do I bump up the time from 10 minutes to something longer? Davem pointed out another periodic task thats flushes the cache totally it's /proc/sys/net/ipv4/route/secret_interval It flushes the cache totally we so all current flows has be recreated. You probably drop packets here in your setup. Yes it can be idea to increase it or run the flush manually. But most routers drop packets now and then. --ro From ebs@ebshome.net Thu Jan 13 13:21:58 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 13:22:12 -0800 (PST) Received: from gate.ebshome.net (gate.ebshome.net [64.81.67.12]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0DLLwK2030129 for ; Thu, 13 Jan 2005 13:21:58 -0800 Received: (qmail 16172 invoked by uid 1000); 13 Jan 2005 13:21:52 -0800 Date: Thu, 13 Jan 2005 13:21:52 -0800 From: Eugene Surovegin To: Andy Fleming Cc: Kumar Gala , Netdev , Embedded PPC Linux list Subject: Re: [RFC] Patch to Abstract Ethernet PHY support (using driver model) Message-ID: <20050113212152.GA16041@gate.ebshome.net> Mail-Followup-To: Andy Fleming , Kumar Gala , Netdev , Embedded PPC Linux list References: <20050106070245.GA6539@gate.ebshome.net> <61A37C72-659C-11D9-8D70-000393C30512@freescale.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <61A37C72-659C-11D9-8D70-000393C30512@freescale.com> X-ICQ-UIN: 1193073 X-Operating-System: Linux i686 X-PGP-Key: http://www.ebshome.net/pubkey.asc User-Agent: Mutt/1.5.5.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 208 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ebs@ebshome.net Precedence: bulk X-list: netdev On Thu, Jan 13, 2005 at 01:50:31PM -0600, Andy Fleming wrote: > >I suspect that _all_ XXX_read_status functions for different PHYs in > >your patch can be easily handled by generic IEEE 802.3 compliant code > >(you need to update genphy_read_status to properly handle GigE of > >course). > > Ok, I understand this, but a part of me rebels. The "standard" > procedure is to read the Link Partner Advertisement, AND it with the > Advertisement, and then find the highest setting that works. It seems > to me that this is replicating work that is already done by the PHY, > and I hate to do work that's already been done. Well, some PHYs have a non-standard way to get this info, some PHYs don't. I don't understand why do you want to bloat kernel with knowledge of this PHY-specific registers when there is a standard way to get this info? In fact I use IBM EMAC with a lot of different PHYs and never needed this special code, except only PHY initialization maybe. > I also have one worry about this technique (though I'm still reading > the 802.3 spec to see if my worry is valid). Is it possible that the > PHY would choose a setting which is lower than the highest possible, > and therefore render the method above inaccurate? It's a standard, period. If there is a PHY which isn't compliant I guess it will not work anyway, but in this case, yes, we can use PHY-specific link detection, but only in this case. I suspect you'll have a hard time finding such PHY :) > Yeah, that's not a problem. I just wasn't sure if the bits were > properly defined on non-gigabit PHYs. I will change this, as long as > the relevant bits are always correct on 10/100 PHYs I use ES bit in MII_BMSR register to detect availability of MII_ESR register. So far it worked OK with number of 10/100 PHYs. > >4) Pause negotiation/advertising is completely missing. > > Sigh... I knew someone would ask for that. I will get right on this. This is not that difficult, I have example code in NAPI IBM EMAC driver (http://kernel.ebshome.net). -- Eugene From joern@wohnheim.fh-wedel.de Thu Jan 13 13:58:14 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 13:58:21 -0800 (PST) Received: from moskovskaya.fh-wedel.de (mail.fh-wedel.de [213.39.232.198]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0DLwEre001220 for ; Thu, 13 Jan 2005 13:58:14 -0800 Received: from wohnheim.fh-wedel.de ([213.39.233.138]:42708) by moskovskaya.fh-wedel.de with esmtp (Exim 4.34) id 1CpCyl-000058-1a; Thu, 13 Jan 2005 22:58:07 +0100 Received: from joern by wohnheim.fh-wedel.de with local (Exim 3.35 #1 (Debian)) id 1CpCym-0004zI-00; Thu, 13 Jan 2005 22:58:08 +0100 Date: Thu, 13 Jan 2005 22:58:08 +0100 From: =?iso-8859-1?Q?J=F6rn?= Engel To: Andy Fleming , Kumar Gala , Netdev , Embedded PPC Linux list Subject: Re: [RFC] Patch to Abstract Ethernet PHY support (using driver model) Message-ID: <20050113215808.GA15124@wohnheim.fh-wedel.de> References: <20050106070245.GA6539@gate.ebshome.net> <61A37C72-659C-11D9-8D70-000393C30512@freescale.com> <20050113212152.GA16041@gate.ebshome.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20050113212152.GA16041@gate.ebshome.net> User-Agent: Mutt/1.3.28i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 209 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: joern@wohnheim.fh-wedel.de Precedence: bulk X-list: netdev On Thu, 13 January 2005 13:21:52 -0800, Eugene Surovegin wrote: > > It's a standard, period. If there is a PHY which isn't compliant I > guess it will not work anyway, but in this case, yes, we can use > PHY-specific link detection, but only in this case. I suspect you'll > have a hard time finding such PHY :) http://www.broadcom.com/collateral/pb/5325-PB05-R.pdf With some thinking and very little code, you can use this neat chip almost like a normal phy. Jörn -- Optimizations always bust things, because all optimizations are, in the long haul, a form of cheating, and cheaters eventually get caught. -- Larry Wall From jeremy.guthrie@berbee.com Thu Jan 13 14:27:27 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 14:27:35 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0DMRQOn005463 for ; Thu, 13 Jan 2005 14:27:27 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Thu, 13 Jan 2005 16:27:21 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Thu, 13 Jan 2005 16:27:17 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson References: <200501131328.34449.jeremy.guthrie@berbee.com> <16870.58414.767012.96364@robur.slu.se> In-Reply-To: <16870.58414.767012.96364@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1629717.l7AYCjrpxA"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501131627.20360.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 13 Jan 2005 22:27:21.0412 (UTC) FILETIME=[0C540840:01C4F9BF] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 210 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart1629717.l7AYCjrpxA Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thursday 13 January 2005 03:12 pm, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > I after a few revs I just bumped rhash_entries to 2.4mil in an attempt > > to get well above my actual usage. > > A bit hefty size :-) But the stats are looking much better as we do much > less linear search (in_search) in hash and less fib lookups (tot) Okay. > And you have now "dst cache overflows"? No, I haven't gotten any of these yet. > Is the e1000 patch I sent in use? yes. I also have another E1000 driver I haven't had a chance to try yet. = It=20 is a bit more instrumented. =20 > > You can see below I am over 600K entries before it blows them away and > > restarts. > > This is a part of GC process to reclaim memory and reclaim unused dst > entries. This > > > size IN: hit tot mc no_rt bcast madst masrc OUT: hit to= t=20 > > mc GC: tot ignored goal_miss ovrf HASH: in_search out_search > > > > > > 615852 86368 626 0 0 0 0 0 8 = 0 > > 0 624 622 0 0 56504 10 > > 493558 47553 4603 0 0 0 0 0 2 = 0 > > 0 4166 4164 0 0 28346 0 > > 10091 46526 7096 0 0 0 0 0 2 = 3=20 > > 0 0 0 0 0 554 0 > > 16238 80565 6145 0 0 0 0 0 6 = 3=20 > > 0 0 0 0 0 1334 0 > > In short we reduce the hash size to remove unused flows and let it grow > again. You see from (tot) that we have recreate may of the flows at this > point. Most likely this is where we drop the packets. We have monitored > small drops in our system when GC happens. The GC can be smoothen out but > we leave that for now. Sorry, not quite following. IN:Hits are cache hits yes? Tot, are the total number of flows created sin= ce=20 we last looked at the total flow count, correct? What would cause a packet= =20 to drop in the network stack and thus showup in /proc/net/softnet_stat? > > How do I bump up the time from 10 minutes to something longer? > > Davem pointed out another periodic task thats flushes the cache totally > it's > > /proc/sys/net/ipv4/route/secret_interval > > It flushes the cache totally we so all current flows has be recreated. Y= ou > probably drop packets here in your setup. Yes it can be idea to increase > it or run the flush manually. But most routers drop packets now and then. If I set the secret_interval to 60 seconds then I drop over 1% of all packe= ts=20 coming through. So GC isn't exactly my friend. Performance has picked up. I am not dropping packets anymore except during= =20 GC. I upped my interval from 600 seconds to 1800 seconds. =20 Here are 15 second snapshots. Line 3 appears to be when GC take effect. =20 Afterwards, everything stabilizes. These numbers are much better. Thu Jan 13 16:10:30 CST 2005 entries: 000de44a Packets: 1255162 Errors:= 0 =20 PPS: 83677 Percentage: 0.0% Thu Jan 13 16:10:45 CST 2005 entries: 000df2ad Packets: 1303050 Errors:= =20 3875 PPS: 86870 Percentage: 0.29% Thu Jan 13 16:11:00 CST 2005 entries: 0000b053 Packets: 1265398 Errors:= =20 38586 PPS: 84359 Percentage: 3.04% Thu Jan 13 16:11:15 CST 2005 entries: 00013df8 Packets: 1310618 Errors:= 0 =20 PPS: 87374 Percentage: 0.0% Thu Jan 13 16:11:30 CST 2005 entries: 0001b527 Packets: 1282435 Errors:= 0 =20 PPS: 85495 Percentage: 0.0% Thu Jan 13 16:11:45 CST 2005 entries: 000222bb Packets: 1213217 Errors:= 0 =20 PPS: 80881 Percentage: 0.0% Thu Jan 13 16:12:01 CST 2005 entries: 00027c7e Packets: 1279811 Errors:= 0 =20 PPS: 85320 Percentage: 0.0% Thu Jan 13 16:12:16 CST 2005 entries: 0002c5d5 Packets: 1224232 Errors:= 0 =20 PPS: 81615 Percentage: 0.0% Thu Jan 13 16:12:31 CST 2005 entries: 0003090c Packets: 1243539 Errors:= 0 =20 PPS: 82902 Percentage: 0.0% Thu Jan 13 16:12:46 CST 2005 entries: 00034d41 Packets: 1267200 Errors:= 0 =20 PPS: 84480 Percentage: 0.0% Thu Jan 13 16:13:01 CST 2005 entries: 00038f82 Packets: 1238821 Errors:= 0 =20 PPS: 82588 Percentage: 0.0% Thu Jan 13 16:13:16 CST 2005 entries: 0003cf6a Packets: 1245474 Errors:= 0 =20 PPS: 83031 Percentage: 0.0% Thu Jan 13 16:13:31 CST 2005 entries: 00040d23 Packets: 1266478 Errors:= 0 =20 PPS: 84431 Percentage: 0.0% Thu Jan 13 16:13:46 CST 2005 entries: 00044918 Packets: 1247576 Errors:= 0 =20 PPS: 83171 Percentage: 0.0% Thu Jan 13 16:14:01 CST 2005 entries: 00048520 Packets: 1223002 Errors:= 0 =20 PPS: 81533 Percentage: 0.0% Thu Jan 13 16:14:16 CST 2005 entries: 0004c0b6 Packets: 1303942 Errors:= =20 333 PPS: 86929 Percentage: 0.2% Thu Jan 13 16:14:32 CST 2005 entries: 0004f83e Packets: 1203334 Errors:= 0 =20 PPS: 80222 Percentage: 0.0% Thu Jan 13 16:14:47 CST 2005 entries: 00053241 Packets: 1216611 Errors:= 0 =20 PPS: 81107 Percentage: 0.0% Thu Jan 13 16:15:02 CST 2005 entries: 00056f97 Packets: 1281206 Errors:= 0 =20 PPS: 85413 Percentage: 0.0% Thu Jan 13 16:15:17 CST 2005 entries: 0005b020 Packets: 1270007 Errors:= 0 =20 PPS: 84667 Percentage: 0.0% Thu Jan 13 16:15:32 CST 2005 entries: 0005eb63 Packets: 1250099 Errors:= 0 =20 PPS: 83339 Percentage: 0.0% Thu Jan 13 16:15:47 CST 2005 entries: 00061e08 Packets: 1183444 Errors:= 0 =20 PPS: 78896 Percentage: 0.0% Thu Jan 13 16:16:02 CST 2005 entries: 0006489b Packets: 1246170 Errors:= =20 3791 PPS: 83078 Percentage: 0.30% Thu Jan 13 16:16:17 CST 2005 entries: 00066f1f Packets: 1233601 Errors:= =20 4141 PPS: 82240 Percentage: 0.33% Thu Jan 13 16:16:32 CST 2005 entries: 000695aa Packets: 1273744 Errors:= =20 3798 PPS: 84916 Percentage: 0.29% Thu Jan 13 16:16:47 CST 2005 entries: 0006ba5d Packets: 1263619 Errors:= =20 4219 PPS: 84241 Percentage: 0.33% Thu Jan 13 16:17:03 CST 2005 entries: 0006df19 Packets: 1240743 Errors:= =20 3616 PPS: 82716 Percentage: 0.29% =2D---------one other snapshot------------ Thu Jan 13 16:09:03 CST 2005 eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 RX packets:459165122 errors:3427143 dropped:3427143 overruns:2045= 357=20 frame:0 1b5e031d 00000000 0000a829 00000000 00000000 00000000 00000000 00000000=20 0002cbd7 000072c1 00000000 00000001 00000000 00000000 00000000 00000000 00000000=20 00001e00 entries in_hit in_slow_tot in_no_route in_brd in_martian_dst in_martian_sr= c =20 out_hit out_slow_tot out_slow_mc gc_total gc_ignored gc_goal_miss=20 gc_dst_overflow in_hlist_search out_hlist_search 000d92e0 1a0ecfdc 014e19f9 00000000 00000000 000000a6 000000df 00000000 =20 00009558 00000c5e 00000000 000b7605 000b6c68 00000000 00000000 07c9547f=20 0000398d 000d92e0 00001340 00005e40 00000000 00000000 0000005e 00000000 00000000 =20 00000007 00000036 00000002 00000002 00000002 00000000 00000000 00001542=20 00000004 CPU0 CPU1 18: 123586344 8007 IO-APIC-level eth3 20: 1 18109191 IO-APIC-level eth2 Thu Jan 13 16:10:03 CST 2005 eth3 Link encap:Ethernet HWaddr 00:02:B3:D5:7E:30 RX packets:464242944 errors:3427143 dropped:3427143 overruns:2045= 357=20 frame:0 1bab839b 00000000 0000a82d 00000000 00000000 00000000 00000000 00000000=20 0002d2bc 000072e3 00000000 00000001 00000000 00000000 00000000 00000000 00000000=20 00001ed8 entries in_hit in_slow_tot in_no_route in_brd in_martian_dst in_martian_sr= c =20 out_hit out_slow_tot out_slow_mc gc_total gc_ignored gc_goal_miss=20 gc_dst_overflow in_hlist_search out_hlist_search 000dcaba 1a5bd4fd 014e9288 00000000 00000000 000000a6 000000df 00000000 =20 00009678 00000c6a 00000000 000bee9e 000be489 00000000 00000000 08109f0f=20 00003a97 000dcaba 00001349 00005e58 00000000 00000000 0000005e 00000000 00000000 =20 00000007 00000036 00000002 00000002 00000002 00000000 00000000 00001597=20 00000004 CPU0 CPU1 18: 125388992 8007 IO-APIC-level eth3 20: 1 18340497 IO-APIC-level eth2 =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart1629717.l7AYCjrpxA Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB5vXIqtjaBHGZBeURAi0fAJ4yz6DtEQcQevDSEwON91O86jGFRwCggGrQ Z8uaeS6S+YKyX2nfqm9cNYk= =RLar -----END PGP SIGNATURE----- --nextPart1629717.l7AYCjrpxA-- From jeremy.guthrie@berbee.com Thu Jan 13 14:56:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 14:56:11 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0DMu1rx008136 for ; Thu, 13 Jan 2005 14:56:02 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Thu, 13 Jan 2005 16:55:56 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Thu, 13 Jan 2005 16:55:52 -0600 User-Agent: KMail/1.7.2 Cc: "Brandeburg, Jesse" , "Robert Olsson" References: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart12160972.rPvSlENFIn"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501131655.55407.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 13 Jan 2005 22:55:56.0406 (UTC) FILETIME=[0A8B5960:01C4F9C3] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 211 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart12160972.rPvSlENFIn Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Thu Jan 13 16:50:06 CST 2005 entries: 0000cc39 Packets: 1127110 Errors:= =20 264136 PPS: 75140 Percentage: 23.43% Thu Jan 13 16:50:22 CST 2005 entries: 000142c0 Packets: 1148930 Errors:= =20 743 PPS: 76595 Percentage: 0.6% Thu Jan 13 16:50:37 CST 2005 entries: 0001aa91 Packets: 1158591 Errors:= =20 116 PPS: 77239 Percentage: 0.1% Thu Jan 13 16:50:52 CST 2005 entries: 00021146 Packets: 1192241 Errors:= =20 11648 PPS: 79482 Percentage: 0.97% Thu Jan 13 16:51:07 CST 2005 entries: 00025c42 Packets: 1227489 Errors:= =20 1056 PPS: 81832 Percentage: 0.8% Thu Jan 13 16:51:22 CST 2005 entries: 00029ca0 Packets: 1217954 Errors:= =20 365 PPS: 81196 Percentage: 0.2% ethtool -S eth3 NIC statistics: rx_packets: 8778549 tx_packets: 5 rx_bytes: 327267728 tx_bytes: 398 rx_errors: 575319 tx_errors: 0 rx_dropped: 360028 tx_dropped: 0 multicast: 0 collisions: 0 rx_length_errors: 0 rx_over_errors: 0 rx_crc_errors: 0 rx_frame_errors: 0 rx_fifo_errors: 215291 rx_missed_errors: 215291 tx_aborted_errors: 0 tx_carrier_errors: 0 tx_fifo_errors: 0 tx_heartbeat_errors: 0 tx_window_errors: 0 tx_abort_late_coll: 0 tx_deferred_ok: 0 tx_single_coll_ok: 0 tx_multi_coll_ok: 0 rx_long_length_errors: 0 rx_short_length_errors: 0 rx_align_errors: 0 tx_tcp_seg_good: 0 tx_tcp_seg_failed: 0 rx_flow_control_xon: 0 rx_flow_control_xoff: 0 tx_flow_control_xon: 0 tx_flow_control_xoff: 0 rx_long_byte_count: 4622235024 rx_csum_offload_good: 8285347 int_tx_desc: 5 int_tx_queueempty: 6 int_link_state: 1 int_rx_frame_err: 0 int_rx_desc_min_thresh: 1330 int_rx_fifo_ovr: 47 int_rx_timer: 1768171 int_mdio: 0 int_rxcfg: 1 int_gpio_pins: 0 rx_csum_offload_errors: 698 On Wednesday 12 January 2005 06:49 pm, Brandeburg, Jesse wrote: > I didn't send this to netdev.... if the interrupt counting code does > something good then we can publish it. > > Jeremy, I would agree a faster CPU is going to help you handle more > traffic. I can't speak to the routing thing. Your test would be very > interesting if we could set up something similar here, unfortunately > we're mostly interested in network device performance and not so much on > kernel policy routing. I personally would be interested in having > something set up to "play" with the driver on, but it may be doubtful > how much time I would get to spend on it. > > Anyway, here is a driver that counts interrupt sources, you can get the > counts from > ethtool -S eth3 > > you'll need to compile it like so: > make CFLAGS_EXTRA=3D-DE1000_COUNT_ICR > > any messages in /var/log/messages from the network stack? (I just saw > your netdev email about dst cache overflow) This driver has what we > think should be the correct napi code in e1000_clean. If robert's fix > works better for you then stick with it, and let me know cause what I'm > sending you now is what we're going forward with unless we hear about > problems. > > If you want to chat over an instant messenger of some kind here is my > info: > Aim: jbrandeb > msn: go_jesse@hotmail.com > yahoo: go_jesse > > I appreciate your patience as we try different stuff. I know I'm poking > at the driver a lot, but the high interrupt counts seem a little weird > given the load of your system. > > jesse > > -----Original Message----- > From: Jeremy M. Guthrie [mailto:jeremy.guthrie@berbee.com] > Sent: Wednesday, January 12, 2005 2:31 PM > To: netdev@oss.sgi.com > Cc: Robert Olsson; Stephen Hemminger; Brandeburg, Jesse > Subject: Re: V2.4 policy router operates faster/better than V2.6 > > On Wednesday 12 January 2005 04:22 pm, Robert Olsson wrote: > > Jeremy M. Guthrie writes: > > > I am now getting some push back from the project manager on this > > > performance problem. I am wondering if you think faster CPUs will > > > a) help relieve the symptoms of this problem > > > b) not help because now we will hit a '# of routes in the > > route-cache' > > > > problem > > > c) or will help to a point till the # interrupts come back and > > bite us. > > > Back out the patch I sent.and have hardirq's to run RX-softirq as you > > did before but something is very wrong. You didn't answer if there > > were > > > other load on the machine... > > I have backed out. As for the load, this box only does policy routing. > Any > other functions it performs are part of its automated system to download > the > next days policy-routing config. > > > route-cache can probably be tuned you as have four times the linear > > seach > > > I see in one PIII system at 110 kpps w. production traffic. > > How would I go about tuning that? > > > Of course the non-engineering solution is to buy more CPU... :-) > > That is good to know. This will help me calm the situation a bit. 8) =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart12160972.rPvSlENFIn Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB5vx7qtjaBHGZBeURAqarAJ9Cto6GThe8p6MhawcL3K15MHeELQCfcZRy aL44Q235173XOvocmAQT/00= =vgBG -----END PGP SIGNATURE----- --nextPart12160972.rPvSlENFIn-- From davem@davemloft.net Thu Jan 13 15:20:38 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 15:20:45 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0DNKcec014262 for ; Thu, 13 Jan 2005 15:20:38 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CpE9w-0002C7-00; Thu, 13 Jan 2005 15:13:44 -0800 Date: Thu, 13 Jan 2005 15:13:44 -0800 From: "David S. Miller" To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert.Olsson@data.slu.se Subject: Re: V2.4 policy router operates faster/better than V2.6 Message-Id: <20050113151344.32f7833f.davem@davemloft.net> In-Reply-To: <200501131443.34174.jeremy.guthrie@berbee.com> References: <200501131328.34449.jeremy.guthrie@berbee.com> <20050113120050.0c734df5.davem@davemloft.net> <200501131443.34174.jeremy.guthrie@berbee.com> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 212 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Thu, 13 Jan 2005 14:43:30 -0600 "Jeremy M. Guthrie" wrote: > I don't show that proc file being there. I see it in 'iproute.c' but not in > proc. Sorry, my bad, it's /proc/sys/net/ipv4/route/secret_interval From romieu@fr.zoreil.com Thu Jan 13 16:09:14 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 16:09:20 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0E09CtV018209 for ; Thu, 13 Jan 2005 16:09:13 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.13.1/8.12.1) with ESMTP id j0E07bBv002217; Fri, 14 Jan 2005 01:07:37 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.13.1/8.13.1/Submit) id j0E07WAp002216; Fri, 14 Jan 2005 01:07:32 +0100 Date: Fri, 14 Jan 2005 01:07:32 +0100 From: Francois Romieu To: jgarzik@pobox.com Cc: netdev@oss.sgi.com Subject: [patch 2.6.10-rc1 0/5] dscc4: short summary for the serie of patches Message-ID: <20050114000732.GA28864@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 213 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev The dscc4 driver has inherited a missing initialization bug since the internals of the struct hdlc_dev was reworked (!). Now it kills the driver at startup. The first patch of the incoming serie fixes it. I would appreciate if it could be included in mainline for the next release. The remaining patches are not critical. Patches are archived as: o patch-script http://www.fr.zoreil.com/linux/kernel/2.6.x/2.6.11-rc1/dscc4 o tar-ball http://www.fr.zoreil.com/linux/kernel/2.6.x/2.6.11-rc1/dscc4-blob.tar.bz2 -- Ueimor From romieu@fr.zoreil.com Thu Jan 13 16:13:14 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 16:13:20 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0E0DCl9018861 for ; Thu, 13 Jan 2005 16:13:13 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.13.1/8.12.1) with ESMTP id j0E0Axfv002310; Fri, 14 Jan 2005 01:10:59 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.13.1/8.13.1/Submit) id j0E0AsAL002309; Fri, 14 Jan 2005 01:10:54 +0100 Date: Fri, 14 Jan 2005 01:10:54 +0100 From: Francois Romieu To: jgarzik@pobox.com Cc: netdev@oss.sgi.com Subject: [patch 2.6.10-rc1 2/5] dscc4: code factorisation Message-ID: <20050114001054.GB2219@electric-eye.fr.zoreil.com> References: <20050114000732.GA28864@electric-eye.fr.zoreil.com> <20050114000941.GA2219@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050114000941.GA2219@electric-eye.fr.zoreil.com> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 215 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Small code factorization. Signed-off-by: Francois Romieu diff -puN drivers/net/wan/dscc4.c~dscc4-010 drivers/net/wan/dscc4.c --- linux-2.6.11-rc1/drivers/net/wan/dscc4.c~dscc4-010 2005-01-14 00:54:44.287823008 +0100 +++ linux-2.6.11-rc1-fr/drivers/net/wan/dscc4.c 2005-01-14 00:54:44.291822356 +0100 @@ -892,17 +892,14 @@ static int dscc4_found1(struct pci_dev * for (i = 0; i < dev_per_card; i++) { root[i].dev = alloc_hdlcdev(root + i); - if (!root[i].dev) { - while (i--) - free_netdev(root[i].dev); + if (!root[i].dev) goto err_free_dev; - } } ppriv = (struct dscc4_pci_priv *) kmalloc(sizeof(*ppriv), GFP_KERNEL); if (!ppriv) { printk(KERN_ERR "%s: can't allocate private data\n", DRV_NAME); - goto err_free_dev2; + goto err_free_dev; } memset(ppriv, 0, sizeof(struct dscc4_pci_priv)); @@ -958,15 +955,15 @@ static int dscc4_found1(struct pci_dev * return ret; err_unregister: - while (--i >= 0) { + while (i-- > 0) { dscc4_release_ring(root + i); unregister_hdlc_device(dscc4_to_dev(&root[i])); } kfree(ppriv); -err_free_dev2: - for (i = 0; i < dev_per_card; i++) - free_netdev(root[i].dev); + i = dev_per_card; err_free_dev: + while (i-- > 0) + free_netdev(root[i].dev); kfree(root); err_out: return ret; _ From romieu@fr.zoreil.com Thu Jan 13 16:13:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 16:13:19 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0E0DCD9018860 for ; Thu, 13 Jan 2005 16:13:12 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.13.1/8.12.1) with ESMTP id j0E09kYA002297; Fri, 14 Jan 2005 01:09:46 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.13.1/8.13.1/Submit) id j0E09fqe002296; Fri, 14 Jan 2005 01:09:41 +0100 Date: Fri, 14 Jan 2005 01:09:41 +0100 From: Francois Romieu To: jgarzik@pobox.com Cc: netdev@oss.sgi.com Subject: [patch 2.6.10-rc1 1/5] dscc4: use of uncompletely initialized struct Message-ID: <20050114000941.GA2219@electric-eye.fr.zoreil.com> References: <20050114000732.GA28864@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050114000732.GA28864@electric-eye.fr.zoreil.com> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 214 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev dscc4_set_quartz() is issued with an argument in an unitialized state and the kernel does not like it. Signed-off-by: Francois Romieu diff -puN drivers/net/wan/dscc4.c~dscc4-000 drivers/net/wan/dscc4.c --- linux-2.6.11-rc1/drivers/net/wan/dscc4.c~dscc4-000 2005-01-13 23:57:53.017533390 +0100 +++ linux-2.6.11-rc1-fr/drivers/net/wan/dscc4.c 2005-01-14 00:06:01.600966142 +0100 @@ -905,9 +905,7 @@ static int dscc4_found1(struct pci_dev * goto err_free_dev2; } memset(ppriv, 0, sizeof(struct dscc4_pci_priv)); - ret = dscc4_set_quartz(root, quartz); - if (ret < 0) - goto err_free_priv; + ppriv->root = root; spin_lock_init(&ppriv->lock); @@ -951,6 +949,11 @@ static int dscc4_found1(struct pci_dev * goto err_unregister; } } + + ret = dscc4_set_quartz(root, quartz); + if (ret < 0) + goto err_unregister; + pci_set_drvdata(pdev, ppriv); return ret; @@ -959,7 +962,6 @@ err_unregister: dscc4_release_ring(root + i); unregister_hdlc_device(dscc4_to_dev(&root[i])); } -err_free_priv: kfree(ppriv); err_free_dev2: for (i = 0; i < dev_per_card; i++) _ From romieu@fr.zoreil.com Thu Jan 13 16:13:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 16:13:22 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0E0DDor018862 for ; Thu, 13 Jan 2005 16:13:14 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.13.1/8.12.1) with ESMTP id j0E0CH5B002317; Fri, 14 Jan 2005 01:12:17 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.13.1/8.13.1/Submit) id j0E0CCdL002316; Fri, 14 Jan 2005 01:12:12 +0100 Date: Fri, 14 Jan 2005 01:12:12 +0100 From: Francois Romieu To: jgarzik@pobox.com Cc: netdev@oss.sgi.com Subject: [patch 2.6.10-rc1 3/5] dscc4: error status checking and pci janitoring Message-ID: <20050114001212.GC2219@electric-eye.fr.zoreil.com> References: <20050114000732.GA28864@electric-eye.fr.zoreil.com> <20050114000941.GA2219@electric-eye.fr.zoreil.com> <20050114001054.GB2219@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050114001054.GB2219@electric-eye.fr.zoreil.com> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 216 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Error status checking and PCI janitoring - propagation of the error code; - pci_request_region use in dscc4_init_one; - missing pci_disable_device() added to the error path; Signed-off-by: Francois Romieu diff -puN drivers/net/wan/dscc4.c~dscc4-020 drivers/net/wan/dscc4.c --- linux-2.6.11-rc1/drivers/net/wan/dscc4.c~dscc4-020 2005-01-14 00:54:49.243016015 +0100 +++ linux-2.6.11-rc1-fr/drivers/net/wan/dscc4.c 2005-01-14 00:54:49.248015200 +0100 @@ -708,31 +708,35 @@ static int __devinit dscc4_init_one(stru struct dscc4_dev_priv *dpriv; static int cards_found = 0; void __iomem *ioaddr; - int i; + int i, rc; printk(KERN_DEBUG "%s", version); - if (pci_enable_device(pdev)) - goto err_out; - if (!request_mem_region(pci_resource_start(pdev, 0), - pci_resource_len(pdev, 0), "registers")) { + rc = pci_enable_device(pdev); + if (rc < 0) + goto out; + + rc = pci_request_region(pdev, 0, "registers"); + if (rc < 0) { printk(KERN_ERR "%s: can't reserve MMIO region (regs)\n", DRV_NAME); - goto err_out; + goto err_disable_0; } - if (!request_mem_region(pci_resource_start(pdev, 1), - pci_resource_len(pdev, 1), "LBI interface")) { + rc = pci_request_region(pdev, 1, "LBI interface"); + if (rc < 0) { printk(KERN_ERR "%s: can't reserve MMIO region (lbi)\n", DRV_NAME); - goto err_out_free_mmio_region0; + goto err_free_mmio_region_1; } + ioaddr = ioremap(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0)); if (!ioaddr) { printk(KERN_ERR "%s: cannot remap MMIO region %lx @ %lx\n", DRV_NAME, pci_resource_len(pdev, 0), pci_resource_start(pdev, 0)); - goto err_out_free_mmio_region; + rc = -EIO; + goto err_free_mmio_regions_2; } printk(KERN_DEBUG "Siemens DSCC4, MMIO at %#lx (regs), %#lx (lbi), IRQ %d\n", pci_resource_start(pdev, 0), @@ -742,14 +746,16 @@ static int __devinit dscc4_init_one(stru pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0xf8); pci_set_master(pdev); - if (dscc4_found1(pdev, ioaddr)) - goto err_out_iounmap; + rc = dscc4_found1(pdev, ioaddr); + if (rc < 0) + goto err_iounmap_3; priv = (struct dscc4_pci_priv *)pci_get_drvdata(pdev); - if (request_irq(pdev->irq, &dscc4_irq, SA_SHIRQ, DRV_NAME, priv->root)){ + rc = request_irq(pdev->irq, dscc4_irq, SA_SHIRQ, DRV_NAME, priv->root); + if (rc < 0) { printk(KERN_WARNING "%s: IRQ %d busy\n", DRV_NAME, pdev->irq); - goto err_out_free1; + goto err_release_4; } /* power up/little endian/dma core controlled via lrda/ltda */ @@ -769,9 +775,11 @@ static int __devinit dscc4_init_one(stru priv->iqcfg = (u32 *) pci_alloc_consistent(pdev, IRQ_RING_SIZE*sizeof(u32), &priv->iqcfg_dma); if (!priv->iqcfg) - goto err_out_free_irq; + goto err_free_irq_5; writel(priv->iqcfg_dma, ioaddr + IQCFG); + rc = -ENOMEM; + /* * SCC 0-3 private rx/tx irq structures * IQRX/TXi needs to be set soon. Learned it the hard way... @@ -781,7 +789,7 @@ static int __devinit dscc4_init_one(stru dpriv->iqtx = (u32 *) pci_alloc_consistent(pdev, IRQ_RING_SIZE*sizeof(u32), &dpriv->iqtx_dma); if (!dpriv->iqtx) - goto err_out_free_iqtx; + goto err_free_iqtx_6; writel(dpriv->iqtx_dma, ioaddr + IQTX0 + i*4); } for (i = 0; i < dev_per_card; i++) { @@ -789,7 +797,7 @@ static int __devinit dscc4_init_one(stru dpriv->iqrx = (u32 *) pci_alloc_consistent(pdev, IRQ_RING_SIZE*sizeof(u32), &dpriv->iqrx_dma); if (!dpriv->iqrx) - goto err_out_free_iqrx; + goto err_free_iqrx_7; writel(dpriv->iqrx_dma, ioaddr + IQRX0 + i*4); } @@ -805,16 +813,19 @@ static int __devinit dscc4_init_one(stru writel(0xff200001, ioaddr + GCMDR); cards_found++; - return 0; -err_out_free_iqrx: + rc = 0; +out: + return rc; + +err_free_iqrx_7: while (--i >= 0) { dpriv = priv->root + i; pci_free_consistent(pdev, IRQ_RING_SIZE*sizeof(u32), dpriv->iqrx, dpriv->iqrx_dma); } i = dev_per_card; -err_out_free_iqtx: +err_free_iqtx_6: while (--i >= 0) { dpriv = priv->root + i; pci_free_consistent(pdev, IRQ_RING_SIZE*sizeof(u32), @@ -822,20 +833,19 @@ err_out_free_iqtx: } pci_free_consistent(pdev, IRQ_RING_SIZE*sizeof(u32), priv->iqcfg, priv->iqcfg_dma); -err_out_free_irq: +err_free_irq_5: free_irq(pdev->irq, priv->root); -err_out_free1: +err_release_4: dscc4_free1(pdev); -err_out_iounmap: +err_iounmap_3: iounmap (ioaddr); -err_out_free_mmio_region: - release_mem_region(pci_resource_start(pdev, 1), - pci_resource_len(pdev, 1)); -err_out_free_mmio_region0: - release_mem_region(pci_resource_start(pdev, 0), - pci_resource_len(pdev, 0)); -err_out: - return -ENODEV; +err_free_mmio_regions_2: + pci_release_region(pdev, 1); +err_free_mmio_region_1: + pci_release_region(pdev, 0); +err_disable_0: + pci_disable_device(pdev); + goto out; }; /* @@ -1997,10 +2007,10 @@ static void __devexit dscc4_remove_one(s iounmap(ioaddr); - release_mem_region(pci_resource_start(pdev, 1), - pci_resource_len(pdev, 1)); - release_mem_region(pci_resource_start(pdev, 0), - pci_resource_len(pdev, 0)); + pci_release_region(pdev, 1); + pci_release_region(pdev, 0); + + pci_disable_device(pdev); } static int dscc4_hdlc_attach(struct net_device *dev, unsigned short encoding, _ From romieu@fr.zoreil.com Thu Jan 13 16:17:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 16:17:18 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0E0HC0L021721 for ; Thu, 13 Jan 2005 16:17:13 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.13.1/8.12.1) with ESMTP id j0E0DNQh002424; Fri, 14 Jan 2005 01:13:23 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.13.1/8.13.1/Submit) id j0E0DIYh002423; Fri, 14 Jan 2005 01:13:18 +0100 Date: Fri, 14 Jan 2005 01:13:18 +0100 From: Francois Romieu To: jgarzik@pobox.com Cc: netdev@oss.sgi.com Subject: [patch 2.6.10-rc1 4/5] dscc4: removal of unneeded casts Message-ID: <20050114001318.GD2219@electric-eye.fr.zoreil.com> References: <20050114000732.GA28864@electric-eye.fr.zoreil.com> <20050114000941.GA2219@electric-eye.fr.zoreil.com> <20050114001054.GB2219@electric-eye.fr.zoreil.com> <20050114001212.GC2219@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050114001212.GC2219@electric-eye.fr.zoreil.com> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 217 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Removal of unneeded casts. Signed-off-by: Francois Romieu diff -puN drivers/net/wan/dscc4.c~dscc4-030 drivers/net/wan/dscc4.c --- linux-2.6.11-rc1/drivers/net/wan/dscc4.c~dscc4-030 2005-01-14 00:54:54.446168638 +0100 +++ linux-2.6.11-rc1-fr/drivers/net/wan/dscc4.c 2005-01-14 00:54:54.449168149 +0100 @@ -750,7 +750,7 @@ static int __devinit dscc4_init_one(stru if (rc < 0) goto err_iounmap_3; - priv = (struct dscc4_pci_priv *)pci_get_drvdata(pdev); + priv = pci_get_drvdata(pdev); rc = request_irq(pdev->irq, dscc4_irq, SA_SHIRQ, DRV_NAME, priv->root); if (rc < 0) { @@ -892,8 +892,7 @@ static int dscc4_found1(struct pci_dev * struct dscc4_dev_priv *root; int i, ret = -ENOMEM; - root = (struct dscc4_dev_priv *) - kmalloc(dev_per_card*sizeof(*root), GFP_KERNEL); + root = kmalloc(dev_per_card*sizeof(*root), GFP_KERNEL); if (!root) { printk(KERN_ERR "%s: can't allocate data\n", DRV_NAME); goto err_out; @@ -906,7 +905,7 @@ static int dscc4_found1(struct pci_dev * goto err_free_dev; } - ppriv = (struct dscc4_pci_priv *) kmalloc(sizeof(*ppriv), GFP_KERNEL); + ppriv = kmalloc(sizeof(*ppriv), GFP_KERNEL); if (!ppriv) { printk(KERN_ERR "%s: can't allocate private data\n", DRV_NAME); goto err_free_dev; _ From romieu@fr.zoreil.com Thu Jan 13 16:17:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 16:17:19 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0E0HDxA021722 for ; Thu, 13 Jan 2005 16:17:14 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.13.1/8.12.1) with ESMTP id j0E0FL1s002441; Fri, 14 Jan 2005 01:15:21 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.13.1/8.13.1/Submit) id j0E0FGQ6002440; Fri, 14 Jan 2005 01:15:16 +0100 Date: Fri, 14 Jan 2005 01:15:16 +0100 From: Francois Romieu To: jgarzik@pobox.com Cc: netdev@oss.sgi.com Subject: [patch 2.6.10-rc1 5/5] dscc4: removal of unneeded variable Message-ID: <20050114001516.GE2219@electric-eye.fr.zoreil.com> References: <20050114000732.GA28864@electric-eye.fr.zoreil.com> <20050114000941.GA2219@electric-eye.fr.zoreil.com> <20050114001054.GB2219@electric-eye.fr.zoreil.com> <20050114001212.GC2219@electric-eye.fr.zoreil.com> <20050114001318.GD2219@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050114001318.GD2219@electric-eye.fr.zoreil.com> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 218 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Removal of unneeded variable and more spaces for my eyes. Signed-off-by: Francois Romieu diff -puN drivers/net/wan/dscc4.c~dscc4-040 drivers/net/wan/dscc4.c --- linux-2.6.11-rc1/drivers/net/wan/dscc4.c~dscc4-040 2005-01-14 00:54:59.425357736 +0100 +++ linux-2.6.11-rc1-fr/drivers/net/wan/dscc4.c 2005-01-14 00:55:22.581586543 +0100 @@ -691,7 +691,7 @@ static void dscc4_free1(struct pci_dev * root = ppriv->root; for (i = 0; i < dev_per_card; i++) - unregister_hdlc_device(dscc4_to_dev(&root[i])); + unregister_hdlc_device(dscc4_to_dev(root + i)); pci_set_drvdata(pdev, NULL); @@ -706,7 +706,6 @@ static int __devinit dscc4_init_one(stru { struct dscc4_pci_priv *priv; struct dscc4_dev_priv *dpriv; - static int cards_found = 0; void __iomem *ioaddr; int i, rc; @@ -812,8 +811,6 @@ static int __devinit dscc4_init_one(stru writel(0xff200001, ioaddr + GCMDR); - cards_found++; - rc = 0; out: return rc; @@ -966,7 +963,7 @@ static int dscc4_found1(struct pci_dev * err_unregister: while (i-- > 0) { dscc4_release_ring(root + i); - unregister_hdlc_device(dscc4_to_dev(&root[i])); + unregister_hdlc_device(dscc4_to_dev(root + i)); } kfree(ppriv); i = dev_per_card; _ From ebs@ebshome.net Thu Jan 13 17:00:22 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 17:00:28 -0800 (PST) Received: from gate.ebshome.net (gate.ebshome.net [64.81.67.12]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0E10LUX027835 for ; Thu, 13 Jan 2005 17:00:22 -0800 Received: (qmail 19707 invoked by uid 1000); 13 Jan 2005 17:00:16 -0800 Date: Thu, 13 Jan 2005 17:00:16 -0800 From: Eugene Surovegin To: J?rn Engel Cc: Andy Fleming , Kumar Gala , Netdev , Embedded PPC Linux list Subject: Re: [RFC] Patch to Abstract Ethernet PHY support (using driver model) Message-ID: <20050114010016.GA16635@gate.ebshome.net> Mail-Followup-To: J?rn Engel , Andy Fleming , Kumar Gala , Netdev , Embedded PPC Linux list References: <20050106070245.GA6539@gate.ebshome.net> <61A37C72-659C-11D9-8D70-000393C30512@freescale.com> <20050113212152.GA16041@gate.ebshome.net> <20050113215808.GA15124@wohnheim.fh-wedel.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050113215808.GA15124@wohnheim.fh-wedel.de> X-ICQ-UIN: 1193073 X-Operating-System: Linux i686 X-PGP-Key: http://www.ebshome.net/pubkey.asc User-Agent: Mutt/1.5.5.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 219 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ebs@ebshome.net Precedence: bulk X-list: netdev On Thu, Jan 13, 2005 at 10:58:08PM +0100, J?rn Engel wrote: > On Thu, 13 January 2005 13:21:52 -0800, Eugene Surovegin wrote: > > > > It's a standard, period. If there is a PHY which isn't compliant I > > guess it will not work anyway, but in this case, yes, we can use > > PHY-specific link detection, but only in this case. I suspect you'll > > have a hard time finding such PHY :) > > http://www.broadcom.com/collateral/pb/5325-PB05-R.pdf > > With some thinking and very little code, you can use this neat chip > almost like a normal phy. Yeah, but why would I want to? If you connect your MAC to any 5 PHYs my statement still stands, if directly to MII you don't need any PHY stuff at all, because link is always ON and speed/duplex is fixed. In fact, we use different switch chips connected to PPC4xx directly. In this situation, in my NAPI IBM EMAC driver I just have special "PHY-less" case which is trivial "fixed settings" one. And all this PHY lib is completely unneeded bloat. -- Eugene From kaber@trash.net Thu Jan 13 17:13:52 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 17:13:59 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0E1Dp63028918 for ; Thu, 13 Jan 2005 17:13:52 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CpG20-0007ZF-NR; Fri, 14 Jan 2005 02:13:40 +0100 Message-ID: <41E71CC4.3020102@trash.net> Date: Fri, 14 Jan 2005 02:13:40 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: Thomas Graf CC: jamal , netdev@oss.sgi.com Subject: Re: [RFC] meta ematch References: <20050105144514.GQ26856@postel.suug.ch> <1105019225.2312.7.camel@jzny.localdomain> <20050106194102.GW26856@postel.suug.ch> <1105105511.1046.77.camel@jzny.localdomain> <20050108145457.GZ26856@postel.suug.ch> <1105363582.1041.162.camel@jzny.localdomain> <20050110211747.GA26856@postel.suug.ch> <1105394738.1085.63.camel@jzny.localdomain> <20050113174111.GP26856@postel.suug.ch> <41E6C3E5.2020908@trash.net> <20050113192047.GQ26856@postel.suug.ch> In-Reply-To: <20050113192047.GQ26856@postel.suug.ch> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 220 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Thomas Graf wrote: >* Patrick McHardy <41E6C3E5.2020908@trash.net> 2005-01-13 19:54 > > > >>Looks great. I have a few doubts about about the set of chosen values >>though. Things like nf_debug and nf_cache were never meant to be >>userspace-visible. What about backwards compatibility if we want to >>remove it, or some other more meaningful value where just returning 0 >>wouldn't be the same ? >> >> > >It is indeed problematic and they should be marked as "for debugging >purposes (unreliable)" but at least nf_debug and nfctinfo are >very useful for debugging. > True. nfctinfo is even useful for more, the direction of a connection might be interesting. connmark, conntrack counters, src-ip before SNAT etc. might also be interesting, but they are horrible to implement cleanly because any dependency on ip_conntrack_lock will automatically load ip_conntrack. Perhaps we should add something like nf_ct_get_afinfo() to return a set of conntrack operations to nf_conntrack. For things beside the nf* fields: I think we should make it very clear that everything that isn't already visible to userspace in some way, and thus won't disappear (like priority, nfmark, load average ...), can get changed/removed any time. >>- var_dev sets dst->value to dev->name, meta_var_destroy will try to >> free dev->name. >> >> > >The `dst` meta_value is the l_value/r_lvalue from em_meta_match and >never gets destroyed. I reused meta_data to store address & length. >It might be a good idea to make a new struct for this to make it >more readable though. > Looks good to me already. I only looked at the diff, so I didn't really follow the codepath. >>- meta_int_change only uses 32 bit, but dst->value is unsigned long >> (64 bit on 64-bit arches). nfmark for example is unsigned long, so >> you should also use *(unsigned long *). >> >> > >Doesn't work when size of long differs between kernel and userspace. >I'm aware of this but it seems everyone is using int anyway for nfmark, >so yes this indeed limits the use of nfmark match to only 32 bits >on 64bit machines. The proper way is to introduce a new type >TCF_EM_TYPE_INT64 and access nfmark over it but I didn't want to >create a new type just because of this special case. We can always >add it later as addition to the 32bit version. > > Shouldn't be too hard to get right. In the kernel you can decide based on RTA_PAYLOAD. Userspace needs some other way to notice it is running as a 32-bit binary on a 64-bit kernel, but that's something you can't solve in the kernel anyway. Regards Patrick From davem@davemloft.net Thu Jan 13 17:19:29 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 17:19:35 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0E1JSEj029628 for ; Thu, 13 Jan 2005 17:19:29 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CpG0w-0002ZC-00; Thu, 13 Jan 2005 17:12:34 -0800 Date: Thu, 13 Jan 2005 17:12:34 -0800 From: "David S. Miller" To: anton@samba.org Cc: netdev@oss.sgi.com, herbert@gondor.apana.org.au Subject: [DEBUG]: sk_forward_alloc assertion failures Message-Id: <20050113171234.3fde0925.davem@davemloft.net> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 221 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Anton, can you and the other IBM folks who can reproduce the problem give this test patch a whirl? Herbert and I aren't exactly sure what the exact sequence of events is that causes the problem, but we do know that this code is highly suspect. [ BTW, Herbert, it just occurred to me that these adjustments are incorrect for the skb->data pulling case since we really aren't liberating the data. ] Thanks. ===== net/ipv4/tcp_output.c 1.75 vs edited ===== --- 1.75/net/ipv4/tcp_output.c 2004-12-28 10:22:40 -08:00 +++ edited/net/ipv4/tcp_output.c 2005-01-13 16:45:26 -08:00 @@ -580,12 +580,12 @@ TCP_SKB_CB(skb)->seq += len; skb->ip_summed = CHECKSUM_HW; - +#if 0 skb->truesize -= len; sk->sk_queue_shrunk = 1; sk->sk_wmem_queued -= len; sk->sk_forward_alloc += len; - +#endif /* Any change of skb->len requires recalculation of tso * factor and mss. */ From anton@ozlabs.org Thu Jan 13 17:26:19 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 17:26:24 -0800 (PST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0E1QIcQ030339 for ; Thu, 13 Jan 2005 17:26:19 -0800 Received: by ozlabs.org (Postfix, from userid 1010) id 49C182BDF2; Fri, 14 Jan 2005 12:26:12 +1100 (EST) Date: Fri, 14 Jan 2005 12:25:04 +1100 From: Anton Blanchard To: "David S. Miller" Cc: netdev@oss.sgi.com, herbert@gondor.apana.org.au Subject: Re: [DEBUG]: sk_forward_alloc assertion failures Message-ID: <20050114012504.GF6309@krispykreme.ozlabs.ibm.com> References: <20050113171234.3fde0925.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050113171234.3fde0925.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 222 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: anton@samba.org Precedence: bulk X-list: netdev Hi Dave, > Anton, can you and the other IBM folks who can reproduce > the problem give this test patch a whirl? > > Herbert and I aren't exactly sure what the exact sequence > of events is that causes the problem, but we do know that > this code is highly suspect. > > [ BTW, Herbert, it just occurred to me that these adjustments > are incorrect for the skb->data pulling case since we really > aren't liberating the data. ] Excellent! Ive forwarded it on, lets see if it reproduces. Anton From herbert@gondor.apana.org.au Thu Jan 13 17:38:23 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 17:38:32 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0E1cMeh031242 for ; Thu, 13 Jan 2005 17:38:22 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CpGPc-0007h2-00; Fri, 14 Jan 2005 12:38:04 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CpGPB-00034A-00; Fri, 14 Jan 2005 12:37:37 +1100 Date: Fri, 14 Jan 2005 12:37:37 +1100 To: "David S. Miller" Cc: anton@samba.org, netdev@oss.sgi.com Subject: Re: [DEBUG]: sk_forward_alloc assertion failures Message-ID: <20050114013737.GB11619@gondor.apana.org.au> References: <20050113171234.3fde0925.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050113171234.3fde0925.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 223 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev On Thu, Jan 13, 2005 at 05:12:34PM -0800, David S. Miller wrote: > > [ BTW, Herbert, it just occurred to me that these adjustments > are incorrect for the skb->data pulling case since we really > aren't liberating the data. ] Yes but I thought the idea was to fake it so the application can transmit more packets? Without TSO, the data would've been freed at this point. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From sri@us.ibm.com Thu Jan 13 17:50:33 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 17:50:38 -0800 (PST) Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.131]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0E1oQPf032175 for ; Thu, 13 Jan 2005 17:50:33 -0800 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e33.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j0E1oKCO083688 for ; Thu, 13 Jan 2005 20:50:20 -0500 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j0E1oJ8x304450 for ; Thu, 13 Jan 2005 18:50:19 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j0E1oJd0001150 for ; Thu, 13 Jan 2005 18:50:19 -0700 Received: from w-sridhar.beaverton.ibm.com (w-sridhar.beaverton.ibm.com [9.47.18.19]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j0E1oIp2001112; Thu, 13 Jan 2005 18:50:18 -0700 Date: Thu, 13 Jan 2005 17:50:17 -0800 (PST) From: Sridhar Samudrala X-X-Sender: sridhar@w-sridhar.beaverton.ibm.com To: "David S. Miller" cc: anton@samba.org, netdev@oss.sgi.com, herbert@gondor.apana.org.au Subject: Re: [DEBUG]: sk_forward_alloc assertion failures In-Reply-To: <20050113171234.3fde0925.davem@davemloft.net> Message-ID: References: <20050113171234.3fde0925.davem@davemloft.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 224 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sri@us.ibm.com Precedence: bulk X-list: netdev Dave, I think with this patch we will start seeing sk_wmem_queued assertions. Currently sk_wmem_queued seems to be accounted correctly, but this patch changes this value too. -Sridhar On Thu, 13 Jan 2005, David S. Miller wrote: > > Anton, can you and the other IBM folks who can reproduce > the problem give this test patch a whirl? > > Herbert and I aren't exactly sure what the exact sequence > of events is that causes the problem, but we do know that > this code is highly suspect. > > [ BTW, Herbert, it just occurred to me that these adjustments > are incorrect for the skb->data pulling case since we really > aren't liberating the data. ] > > Thanks. > > ===== net/ipv4/tcp_output.c 1.75 vs edited ===== > --- 1.75/net/ipv4/tcp_output.c 2004-12-28 10:22:40 -08:00 > +++ edited/net/ipv4/tcp_output.c 2005-01-13 16:45:26 -08:00 > @@ -580,12 +580,12 @@ > > TCP_SKB_CB(skb)->seq += len; > skb->ip_summed = CHECKSUM_HW; > - > +#if 0 > skb->truesize -= len; > sk->sk_queue_shrunk = 1; > sk->sk_wmem_queued -= len; > sk->sk_forward_alloc += len; > - > +#endif > /* Any change of skb->len requires recalculation of tso > * factor and mss. > */ > > From herbert@gondor.apana.org.au Thu Jan 13 18:11:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 18:11:38 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0E2BTDQ001057 for ; Thu, 13 Jan 2005 18:11:30 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CpGvT-0007sQ-00; Fri, 14 Jan 2005 13:10:59 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CpGub-00037V-00; Fri, 14 Jan 2005 13:10:05 +1100 Date: Fri, 14 Jan 2005 13:10:05 +1100 To: Sridhar Samudrala Cc: "David S. Miller" , anton@samba.org, netdev@oss.sgi.com Subject: Re: [DEBUG]: sk_forward_alloc assertion failures Message-ID: <20050114021005.GA11962@gondor.apana.org.au> References: <20050113171234.3fde0925.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 225 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev On Thu, Jan 13, 2005 at 05:50:17PM -0800, Sridhar Samudrala wrote: > > I think with this patch we will start seeing > sk_wmem_queued assertions. Not necessarily. What's probably happening currently is that sk_forward_alloc is temporarily raised above the value it should have. It then gets cut down by the reclaim function and subsequently goes negative. Since there is no reclaim for sk_wmem_queued it doesn't happen there. So taking out the adjustments should not cause any problems of sk_wmem_queued, theoretically :) -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From shemminger@osdl.org Thu Jan 13 18:32:00 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 18:32:04 -0800 (PST) Received: from fire-1.osdl.org (fire.osdl.org [65.172.181.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0E2VxjK002321 for ; Thu, 13 Jan 2005 18:32:00 -0800 Received: from localhost.localdomain (063-170-215-071.dslnorthwest.net [63.170.215.71]) (authenticated bits=0) by fire-1.osdl.org (8.12.8/8.12.8) with ESMTP id j0E2Vq7s005248 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 13 Jan 2005 18:31:53 -0800 Date: Thu, 13 Jan 2005 18:31:47 -0800 From: Stephen Hemminger To: Florian Schirmer , "David S. Miller" Cc: netdev@oss.sgi.com Subject: b44: timeout on initialization Message-ID: <20050113183147.0772941c.shemminger@osdl.org> X-Mailer: Sylpheed-Claws 0.9.12cvs146.13 (GTK+ 2.4.14; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-MIMEDefang-Filter: osdl$Revision: 1.98 $ X-Scanned-By: MIMEDefang 2.36 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 226 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev I get this all the time on my laptop (2.6.8 - 2.6.10) even when connected to the router b44: eth0: BUG! Timeout waiting for bit 00000001 of register 41c to set. repeats about 5 times then goes away. Connection works fine. Description is 01:0c.0 Ethernet controller: Broadcom Corporation BCM4401-B0 100Base-TX (rev 02) Subsystem: Fujitsu Limited.: Unknown device 123b Flags: bus master, fast devsel, latency 64, IRQ 11 Memory at d0204000 (32-bit, non-prefetchable) [size=8K] Capabilities: [40] Power Management version 2 From davem@davemloft.net Thu Jan 13 19:52:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 19:52:35 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0E3qOiI006148 for ; Thu, 13 Jan 2005 19:52:25 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CpIOK-0002yd-00; Thu, 13 Jan 2005 19:44:52 -0800 Date: Thu, 13 Jan 2005 19:44:51 -0800 From: "David S. Miller" To: Herbert Xu Cc: sri@us.ibm.com, anton@samba.org, netdev@oss.sgi.com Subject: Re: [DEBUG]: sk_forward_alloc assertion failures Message-Id: <20050113194451.1b6685a2.davem@davemloft.net> In-Reply-To: <20050114021005.GA11962@gondor.apana.org.au> References: <20050113171234.3fde0925.davem@davemloft.net> <20050114021005.GA11962@gondor.apana.org.au> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 227 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Fri, 14 Jan 2005 13:10:05 +1100 Herbert Xu wrote: > Since there is no reclaim for sk_wmem_queued it doesn't happen > there. > > So taking out the adjustments should not cause any problems of > sk_wmem_queued, theoretically :) If we take out the skb->truesize adjustment, as the test patch does, then we must take out the sk_wmem_queued and sk_forward_alloc adjustments, as the test patch also does. :-) From davem@davemloft.net Thu Jan 13 20:16:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 20:17:01 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0E4GtUG007552 for ; Thu, 13 Jan 2005 20:16:55 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CpImR-00034C-00; Thu, 13 Jan 2005 20:09:47 -0800 Date: Thu, 13 Jan 2005 20:09:47 -0800 From: "David S. Miller" To: Herbert Xu Cc: anton@samba.org, netdev@oss.sgi.com Subject: Re: [DEBUG]: sk_forward_alloc assertion failures Message-Id: <20050113200947.09e53b01.davem@davemloft.net> In-Reply-To: <20050114013737.GB11619@gondor.apana.org.au> References: <20050113171234.3fde0925.davem@davemloft.net> <20050114013737.GB11619@gondor.apana.org.au> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 228 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Fri, 14 Jan 2005 12:37:37 +1100 Herbert Xu wrote: > On Thu, Jan 13, 2005 at 05:12:34PM -0800, David S. Miller wrote: > > > > [ BTW, Herbert, it just occurred to me that these adjustments > > are incorrect for the skb->data pulling case since we really > > aren't liberating the data. ] > > Yes but I thought the idea was to fake it so the application > can transmit more packets? Without TSO, the data would've been > freed at this point. You're right. At most we'll pseudo-free no more than 1 full packet, so it's safe. From davem@davemloft.net Thu Jan 13 20:26:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 20:26:18 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0E4QBME011685 for ; Thu, 13 Jan 2005 20:26:11 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CpIvb-00035e-00; Thu, 13 Jan 2005 20:19:15 -0800 Date: Thu, 13 Jan 2005 20:19:14 -0800 From: "David S. Miller" To: Anton Blanchard Cc: netdev@oss.sgi.com, herbert@gondor.apana.org.au Subject: Re: [DEBUG]: sk_forward_alloc assertion failures Message-Id: <20050113201914.46b7c4a2.davem@davemloft.net> In-Reply-To: <20050114012504.GF6309@krispykreme.ozlabs.ibm.com> References: <20050113171234.3fde0925.davem@davemloft.net> <20050114012504.GF6309@krispykreme.ozlabs.ibm.com> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 229 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Fri, 14 Jan 2005 12:25:04 +1100 Anton Blanchard wrote: > Excellent! Ive forwarded it on, lets see if it reproduces. I think Herbert and I may have zeroed in on the true cause of this bug. It's a bug older than TSO support, but it never showed up because nothing really depended upon skb->truesize being incredibly accurate. do_tcp_sendpages(), when it allocates new SKBs, optimistically sets skb->truesize to the struct sk_buff et al. overhead plus tp->mss_cache. This, in and of itself, leaves us generally with a valid skb->truesize value. At worst, it will be an overestimate if we don't fully fill the SKB, but that's fine. It's underestimates that can lead to the BUG case. do_tcp_sendpages() aparently does this so it doesn't have to keep adjusting skb->truesize, sk_wmem_queued, and sk_forward_alloc as new page pieces are tacked onto the SKB. tcp_sendmsg() works the other way, it actually does adjust all the accounting knobs as each piece of user data is copied into the packet. So if tcp_sendmsg() creates the SKB, and then do_tcp_sendpages() tacks pages onto the tail of that SKB, skb->truesize can be way too small. Later on if this were a TSO frame, and it gets deeply partially acked, tcp_trim_skb() will underflow skb->truesize and this is where all the trouble starts. The easiest way to fix this is to simply make do_tcp_sendpages() account just like tcp_sendmsg() does. This is implemented below and should be the real fix for the sk_forward_alloc assertion failures. ===== net/ipv4/tcp.c 1.88 vs edited ===== --- 1.88/net/ipv4/tcp.c 2005-01-06 15:13:39 -08:00 +++ edited/net/ipv4/tcp.c 2005-01-13 19:44:36 -08:00 @@ -664,7 +664,7 @@ if (!sk_stream_memory_free(sk)) goto wait_for_sndbuf; - skb = sk_stream_alloc_pskb(sk, 0, tp->mss_cache, + skb = sk_stream_alloc_pskb(sk, 0, 0, sk->sk_allocation); if (!skb) goto wait_for_memory; @@ -689,6 +689,9 @@ skb->len += copy; skb->data_len += copy; + skb->truesize += copy; + sk->sk_wmem_queued += copy; + sk->sk_forward_alloc -= copy; skb->ip_summed = CHECKSUM_HW; tp->write_seq += copy; TCP_SKB_CB(skb)->end_seq += copy; From davem@davemloft.net Thu Jan 13 20:56:57 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 20:57:03 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0E4uuZI013536 for ; Thu, 13 Jan 2005 20:56:57 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CpJPJ-0003BO-00; Thu, 13 Jan 2005 20:49:57 -0800 Date: Thu, 13 Jan 2005 20:49:57 -0800 From: "David S. Miller" To: Patrick McHardy Cc: netdev@oss.sgi.com Subject: Re: [PATCH PKT_SCHED 0/6]: assorted fixes Message-Id: <20050113204957.0fd3a800.davem@davemloft.net> In-Reply-To: <41E44926.5010701@trash.net> References: <41E44926.5010701@trash.net> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 230 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Tue, 11 Jan 2005 22:46:14 +0100 Patrick McHardy wrote: > following are a couple of assorted fixes: a mem leak, locking bugs in two > tc actions, your sch_api.c fix for holding the rtnl while loading modules > ported to act_api.c, and a bug in tcf_exts that prevents using > actions/policers > without a rate estimator. > > You can pull all changes from bk://212.42.230.204/net-2.6-sched Pulled, thanks a lot Patrick. From davem@davemloft.net Thu Jan 13 21:01:14 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 21:01:19 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0E51DRi014172 for ; Thu, 13 Jan 2005 21:01:14 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CpJTM-0003Cr-00; Thu, 13 Jan 2005 20:54:08 -0800 Date: Thu, 13 Jan 2005 20:54:07 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: tgraf@suug.ch, buytenh@wantstofly.org, netdev@oss.sgi.com Subject: Re: race in net/ipv4/ipip.c ? Message-Id: <20050113205407.13154ccd.davem@davemloft.net> In-Reply-To: <20050112.223600.09187852.yoshfuji@linux-ipv6.org> References: <20050112125336.GH26856@postel.suug.ch> <20050112.220816.56650893.yoshfuji@linux-ipv6.org> <20050112132126.GI26856@postel.suug.ch> <20050112.223600.09187852.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j0E51DRi014172 X-archive-position: 231 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Wed, 12 Jan 2005 22:36:00 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > David, I think we need to fix sit.c, anyway. > > Signed-off-by: Hideaki YOSHIFUJI Good catch, I will apply this patch. From yoshfuji@linux-ipv6.org Thu Jan 13 21:10:19 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 13 Jan 2005 21:10:24 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0E5AJjo015294 for ; Thu, 13 Jan 2005 21:10:19 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id B274F33CC2; Fri, 14 Jan 2005 14:10:51 +0900 (JST) Date: Fri, 14 Jan 2005 14:10:51 +0900 (JST) Message-Id: <20050114.141051.80900279.yoshfuji@linux-ipv6.org> To: davem@davemloft.net Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: race in net/ipv4/ipip.c ? From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20050113205407.13154ccd.davem@davemloft.net> References: <20050112132126.GI26856@postel.suug.ch> <20050112.223600.09187852.yoshfuji@linux-ipv6.org> <20050113205407.13154ccd.davem@davemloft.net> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 232 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev In article <20050113205407.13154ccd.davem@davemloft.net> (at Thu, 13 Jan 2005 20:54:07 -0800), "David S. Miller" says: > On Wed, 12 Jan 2005 22:36:00 +0900 (JST) > YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > > > David, I think we need to fix sit.c, anyway. > > > > Signed-off-by: Hideaki YOSHIFUJI > > Good catch, I will apply this patch. Please apply against 2.4.x as well. Thanks. --yoshfuji From buytenh@wantstofly.org Fri Jan 14 02:22:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 02:22:11 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0EAM6II011312 for ; Fri, 14 Jan 2005 02:22:06 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id E71FD2B0EC; Fri, 14 Jan 2005 11:22:04 +0100 (MET) Date: Fri, 14 Jan 2005 11:22:04 +0100 From: Lennert Buytenhek To: Florian Schirmer Cc: Stephen Hemminger , "David S. Miller" , netdev@oss.sgi.com Subject: Re: b44: timeout on initialization Message-ID: <20050114102204.GB3626@xi.wantstofly.org> References: <20050113183147.0772941c.shemminger@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050113183147.0772941c.shemminger@osdl.org> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 233 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev On Thu, Jan 13, 2005 at 06:31:47PM -0800, Stephen Hemminger wrote: > I get this all the time on my laptop (2.6.8 - 2.6.10) even > when connected to the router > b44: eth0: BUG! Timeout waiting for bit 00000001 of register 41c to set. I get a similar-looking message on my Dell Inspiron 8500 on 2.6.9: b44: eth0: BUG! Timeout waiting for bit 80000000 of register 428 to clear. This happens when UP'ing the device, both when at-the-time-of-UP'ing already connected to some Cisco Catalyst that's configured to do only 10Mbps and no autonegotiation, as well as when not connected to anything at all. Not sure whether it also happens on 100Mbps or when using autonegotiation -- can't check right now. 02:00.0 Ethernet controller: Broadcom Corporation BCM4401 100Base-T (rev 01) Subsystem: Dell: Unknown device 8127 Flags: bus master, fast devsel, latency 32, IRQ 11 Memory at faffe000 (32-bit, non-prefetchable) [size=8K] Capabilities: [40] Power Management version 2 Hope this helps. --L From herbert@gondor.apana.org.au Fri Jan 14 03:18:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 03:18:11 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0EBI267018023 for ; Fri, 14 Jan 2005 03:18:03 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CpPSb-00041W-00; Fri, 14 Jan 2005 22:17:45 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CpPRg-0007IU-00; Fri, 14 Jan 2005 22:16:48 +1100 Date: Fri, 14 Jan 2005 22:16:48 +1100 To: "David S. Miller" Cc: Anton Blanchard , netdev@oss.sgi.com Subject: Re: [DEBUG]: sk_forward_alloc assertion failures Message-ID: <20050114111648.GA27964@gondor.apana.org.au> References: <20050113171234.3fde0925.davem@davemloft.net> <20050114012504.GF6309@krispykreme.ozlabs.ibm.com> <20050113201914.46b7c4a2.davem@davemloft.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="gBBFr7Ir9EOA20Yy" Content-Disposition: inline In-Reply-To: <20050113201914.46b7c4a2.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 234 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev --gBBFr7Ir9EOA20Yy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jan 13, 2005 at 08:19:14PM -0800, David S. Miller wrote: > > The easiest way to fix this is to simply make do_tcp_sendpages() > account just like tcp_sendmsg() does. This is implemented below > and should be the real fix for the sk_forward_alloc assertion > failures. Sorry, but this may bypass the memory checks if sk_forward_alloc is less than mss_now. Since the packet is bounded by mss_now, and most of the time it will be exactly mss_now bytes long, how about if we simply replace tp->mss_cache by mss_now? Could you guys please give this patch a go? Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --gBBFr7Ir9EOA20Yy Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== net/ipv4/tcp.c 1.88 vs edited ===== --- 1.88/net/ipv4/tcp.c 2005-01-07 10:13:39 +11:00 +++ edited/net/ipv4/tcp.c 2005-01-14 22:14:41 +11:00 @@ -664,7 +664,7 @@ if (!sk_stream_memory_free(sk)) goto wait_for_sndbuf; - skb = sk_stream_alloc_pskb(sk, 0, tp->mss_cache, + skb = sk_stream_alloc_pskb(sk, 0, mss_now, sk->sk_allocation); if (!skb) goto wait_for_memory; --gBBFr7Ir9EOA20Yy-- From herbert@gondor.apana.org.au Fri Jan 14 04:04:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 04:04:23 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0EC4AG6020947 for ; Fri, 14 Jan 2005 04:04:11 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CpQBC-0004BP-00; Fri, 14 Jan 2005 23:03:50 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CpQAk-0007xY-00; Fri, 14 Jan 2005 23:03:22 +1100 Date: Fri, 14 Jan 2005 23:03:22 +1100 To: "David S. Miller" Cc: Anton Blanchard , netdev@oss.sgi.com Subject: Re: [DEBUG]: sk_forward_alloc assertion failures Message-ID: <20050114120322.GA28449@gondor.apana.org.au> References: <20050113171234.3fde0925.davem@davemloft.net> <20050114012504.GF6309@krispykreme.ozlabs.ibm.com> <20050113201914.46b7c4a2.davem@davemloft.net> <20050114111648.GA27964@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="EVF5PPMfhYS0aIcm" Content-Disposition: inline In-Reply-To: <20050114111648.GA27964@gondor.apana.org.au> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 235 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev --EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Jan 14, 2005 at 10:16:48PM +1100, herbert wrote: > > Since the packet is bounded by mss_now, and most of the time it > will be exactly mss_now bytes long, how about if we simply > replace tp->mss_cache by mss_now? Doh! My patch is the same as the current code :) What we need to do is to remember mss_now across sendpage calls. Luckily the value of truesize lets us deduce the value of mss_now. To complicate the picture the mss might have been reduced between sendpages calls. So we take the minimum of the remembered mss and the current mss. Any brave souls out there to try this? -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --EVF5PPMfhYS0aIcm Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== net/ipv4/tcp.c 1.88 vs edited ===== --- 1.88/net/ipv4/tcp.c 2005-01-07 10:13:39 +11:00 +++ edited/net/ipv4/tcp.c 2005-01-14 22:57:44 +11:00 @@ -654,23 +654,31 @@ while (psize > 0) { struct sk_buff *skb = sk->sk_write_queue.prev; + int skb_mss; struct page *page = pages[poffset / PAGE_SIZE]; int copy, i; int offset = poffset % PAGE_SIZE; int size = min_t(size_t, psize, PAGE_SIZE - offset); - if (!sk->sk_send_head || (copy = mss_now - skb->len) <= 0) { + if (!sk->sk_send_head) + goto new_segment; + + skb_mss = skb_netsize(skb) - skb_headroom(skb); + if (mss_now < skb_mss) + skb_mss = mss_now; + if ((copy = skb_mss - skb->len) <= 0) { new_segment: if (!sk_stream_memory_free(sk)) goto wait_for_sndbuf; - skb = sk_stream_alloc_pskb(sk, 0, tp->mss_cache, + skb = sk_stream_alloc_pskb(sk, 0, mss_now, sk->sk_allocation); if (!skb) goto wait_for_memory; skb_entail(sk, tp, skb); copy = mss_now; + skb_mss = mss_now; } if (copy > size) @@ -702,14 +710,14 @@ if (!(psize -= copy)) goto out; - if (skb->len != mss_now || (flags & MSG_OOB)) + if (skb->len != skb_mss || (flags & MSG_OOB)) continue; if (forced_push(tp)) { tcp_mark_push(tp, skb); - __tcp_push_pending_frames(sk, tp, mss_now, TCP_NAGLE_PUSH); + __tcp_push_pending_frames(sk, tp, skb_mss, TCP_NAGLE_PUSH); } else if (skb == sk->sk_send_head) - tcp_push_one(sk, mss_now); + tcp_push_one(sk, skb_mss); continue; wait_for_sndbuf: ===== include/linux/skbuff.h 1.58 vs edited ===== --- 1.58/include/linux/skbuff.h 2004-12-28 16:24:42 +11:00 +++ edited/include/linux/skbuff.h 2005-01-14 22:30:45 +11:00 @@ -1124,6 +1124,11 @@ return buffer; } +static inline int skb_netsize(const struct sk_buff *skb) +{ + return skb->truesize - sizeof(struct sk_buff); +} + extern void skb_init(void); extern void skb_add_mtu(int mtu); --EVF5PPMfhYS0aIcm-- From buytenh@wantstofly.org Fri Jan 14 04:47:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 04:47:06 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ECl1kZ026676 for ; Fri, 14 Jan 2005 04:47:02 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id 488AB2B0EC; Fri, 14 Jan 2005 13:47:00 +0100 (MET) Date: Fri, 14 Jan 2005 13:47:00 +0100 From: Lennert Buytenhek To: benwa@club-internet.fr Cc: netdev@oss.sgi.com Subject: [PATCH] remove superfluous diverter printk'ing Message-ID: <20050114124700.GA4079@xi.wantstofly.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 236 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev Hi Benoit, You're not listed as diverter maintainer but I'm sending this via you anyway. This patch removes some printk'ing from the diverter driver (and cleans up the code a bit), because after a while it gets really annoying to have log messages like this one for every single tunnel you create or tear down. divert: not allocating divert_blk for non-ethernet device tunl0 Please consider sending upstream. cheers, Lennert --- linux-2.6.10/net/core/dv.c.orig 2005-01-14 13:36:44.507808269 +0100 +++ linux-2.6.10/net/core/dv.c 2005-01-14 13:38:18.808399830 +0100 @@ -52,26 +52,20 @@ { int alloc_size = (sizeof(struct divert_blk) + 3) & ~3; + dev->divert = NULL; if (dev->type == ARPHRD_ETHER) { - printk(KERN_DEBUG "divert: allocating divert_blk for %s\n", - dev->name); - dev->divert = (struct divert_blk *) kmalloc(alloc_size, GFP_KERNEL); if (dev->divert == NULL) { - printk(KERN_DEBUG "divert: unable to allocate divert_blk for %s\n", + printk(KERN_INFO "divert: unable to allocate divert_blk for %s\n", dev->name); return -ENOMEM; - } else { - memset(dev->divert, 0, sizeof(struct divert_blk)); } - dev_hold(dev); - } else { - printk(KERN_DEBUG "divert: not allocating divert_blk for non-ethernet device %s\n", - dev->name); - dev->divert = NULL; + memset(dev->divert, 0, sizeof(struct divert_blk)); + dev_hold(dev); } + return 0; } @@ -85,11 +79,6 @@ kfree(dev->divert); dev->divert=NULL; dev_put(dev); - printk(KERN_DEBUG "divert: freeing divert_blk for %s\n", - dev->name); - } else { - printk(KERN_DEBUG "divert: no divert_blk to free, %s not ethernet\n", - dev->name); } } @@ -192,8 +181,12 @@ /* * control function of the diverter */ +#if 0 #define DVDBG(a) \ printk(KERN_DEBUG "divert_ioctl() line %d %s\n", __LINE__, (a)) +#else +#define DVDBG(a) +#endif int divert_ioctl(unsigned int cmd, struct divert_cf __user *arg) { From klassert@mathematik.tu-chemnitz.de Fri Jan 14 06:33:29 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 06:33:34 -0800 (PST) Received: from john.hrz.tu-chemnitz.de (john.hrz.tu-chemnitz.de [134.109.132.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0EEXQO0031278 for ; Fri, 14 Jan 2005 06:33:29 -0800 Received: from gareth.mathematik.tu-chemnitz.de ([134.109.40.156]) by john.hrz.tu-chemnitz.de with esmtp (Exim 4.41) id 1CpSVv-0000ft-Fn; Fri, 14 Jan 2005 15:33:23 +0100 Received: by gareth.mathematik.tu-chemnitz.de (Postfix, from userid 274) id 42BE137450; Fri, 14 Jan 2005 15:33:23 +0100 (CET) Date: Fri, 14 Jan 2005 15:33:23 +0100 From: Steffen Klassert To: Andrew Morton , Jeff Garzik Cc: Network Development Mailing List Subject: 3c59x collisions statistic Message-ID: <20050114143323.GA20922@gareth.mathematik.tu-chemnitz.de> Mail-Followup-To: Andrew Morton , Jeff Garzik , Network Development Mailing List Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Scan-Signature: 82263f40e2f38d0685488778ad62770b X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 237 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: klassert@mathematik.tu-chemnitz.de Precedence: bulk X-list: netdev The collisions statistic of the 3c59x driver seems to be not correct. While looking closer to the update_stats() function of the 3c59x driver I found that vp->stats.collisions counts just the value of the SingleCollisions register. The SingleCollisions register counts the number of packets that are transmitted without error after one and only one collision. Packets with multiple collisions are not counted. Therefore the value of the SingleCollisions register is just a lower bound on the total number of collisions. As far as I know, vp->stats.collisions should count the total number of collisions during the transmisson of each packet (not just the number of packets which are transmitted after a single collision). Unfortunately it seems to be impossible to calculate the total number of collisions from the statistic counters of the NIC. But it would be possible to count the total number of packets with collisions during the transmission in vp->stats.collisions. IMHO this is better then just counting packets with a single collision in vp->stats.collisions. Steffen From joern@wohnheim.fh-wedel.de Fri Jan 14 06:55:22 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 06:55:27 -0800 (PST) Received: from moskovskaya.fh-wedel.de (mail.fh-wedel.de [213.39.232.198]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0EEtLdq032573 for ; Fri, 14 Jan 2005 06:55:21 -0800 Received: from wohnheim.fh-wedel.de ([213.39.233.138]:58885) by moskovskaya.fh-wedel.de with esmtp (Exim 4.34) id 1CpSr5-0007Y1-64; Fri, 14 Jan 2005 15:55:15 +0100 Received: from joern by wohnheim.fh-wedel.de with local (Exim 3.35 #1 (Debian)) id 1CpSr8-0005d7-00; Fri, 14 Jan 2005 15:55:18 +0100 Date: Fri, 14 Jan 2005 15:55:18 +0100 From: =?iso-8859-1?Q?J=F6rn?= Engel To: Andy Fleming , Kumar Gala , Netdev , Embedded PPC Linux list Subject: Re: [RFC] Patch to Abstract Ethernet PHY support (using driver model) Message-ID: <20050114145518.GA21418@wohnheim.fh-wedel.de> References: <20050106070245.GA6539@gate.ebshome.net> <61A37C72-659C-11D9-8D70-000393C30512@freescale.com> <20050113212152.GA16041@gate.ebshome.net> <20050113215808.GA15124@wohnheim.fh-wedel.de> <20050114010016.GA16635@gate.ebshome.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20050114010016.GA16635@gate.ebshome.net> User-Agent: Mutt/1.3.28i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 238 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: joern@wohnheim.fh-wedel.de Precedence: bulk X-list: netdev On Thu, 13 January 2005 17:00:16 -0800, Eugene Surovegin wrote: > On Thu, Jan 13, 2005 at 10:58:08PM +0100, J?rn Engel wrote: > > > > http://www.broadcom.com/collateral/pb/5325-PB05-R.pdf > > > > With some thinking and very little code, you can use this neat chip > > almost like a normal phy. > > Yeah, but why would I want to? If you connect your MAC to any 5 PHYs > my statement still stands, if directly to MII you don't need any PHY > stuff at all, because link is always ON and speed/duplex is fixed. > > In fact, we use different switch chips connected to PPC4xx directly. > In this situation, in my NAPI IBM EMAC driver I just have special > "PHY-less" case which is trivial "fixed settings" one. And all this > PHY lib is completely unneeded bloat. Wrt. the proposed PHY lib, I agree. Didn't even bother to look at the code, it's mere size said enough. But an abstraction different from drivers/net/mii.c is needed to handle the 5325 chip. Or, you could have the special cases all over in your code, but that's a) ugly and b) more code. I used to have such a mess and after doing the proper abstraction, it line count went down. Jörn -- Time? What's that? Time is only worth what you do with it. -- Theo de Raadt From jeremy.guthrie@berbee.com Fri Jan 14 07:00:00 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 07:00:14 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0EExxXV000807 for ; Fri, 14 Jan 2005 07:00:00 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Fri, 14 Jan 2005 08:59:53 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Fri, 14 Jan 2005 08:59:38 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson References: <200501131328.34449.jeremy.guthrie@berbee.com> <16870.58414.767012.96364@robur.slu.se> In-Reply-To: <16870.58414.767012.96364@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart24040128.PuJ0tmka1N"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501140859.42018.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 14 Jan 2005 14:59:53.0877 (UTC) FILETIME=[B45D0C50:01C4FA49] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 239 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart24040128.PuJ0tmka1N Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I ran a script overnight using the modified driver you had given me Robert.= =20 it is interesting that there is almost always errors in the interface even= =20 though we aren't getting dst-cache errors and running ~ 40% free CPU now. = I=20 am going to switch over to Jesse's driver to see if his instrumentation hel= ps=20 nail down where the problem is. ethtool -S eth3 NIC statistics: rx_packets: 2722676103 tx_packets: 5 rx_bytes: 1171335471 tx_bytes: 398 rx_errors: 8558366 tx_errors: 0 rx_dropped: 1951692 tx_dropped: 0 multicast: 0 collisions: 0 rx_length_errors: 0 rx_over_errors: 0 rx_crc_errors: 0 rx_frame_errors: 0 rx_fifo_errors: 6606674 rx_missed_errors: 6606674 tx_aborted_errors: 0 tx_carrier_errors: 0 tx_fifo_errors: 0 tx_heartbeat_errors: 0 tx_window_errors: 0 tx_abort_late_coll: 0 tx_deferred_ok: 0 tx_single_coll_ok: 0 tx_multi_coll_ok: 0 rx_long_length_errors: 0 rx_short_length_errors: 0 rx_align_errors: 0 tx_tcp_seg_good: 0 tx_tcp_seg_failed: 0 rx_flow_control_xon: 0 rx_flow_control_xoff: 0 tx_flow_control_xon: 0 tx_flow_control_xoff: 0 rx_long_byte_count: 1384150804783 rx_csum_offload_good: 2542900690 rx_csum_offload_errors: 243513 01/13/05 19:20:13 entries: 000690f5 Pkts: 948466 Err: 2788 PPS: 6323= 1 =20 Drop %: 0.29% Eth3RXInt: 411656 Eth2TXInt: 52008 01/13/05 19:20:28 entries: 0006ac8e Pkts: 967236 Err: 2582 PPS: 6448= 2 =20 Drop %: 0.26% Eth3RXInt: 412282 Eth2TXInt: 51066 01/13/05 19:20:43 entries: 0006c6f3 Pkts: 974209 Err: 2645 PPS: 6494= 7 =20 Drop %: 0.27% Eth3RXInt: 412606 Eth2TXInt: 51439 01/13/05 19:20:58 entries: 0006de75 Pkts: 926103 Err: 2654 PPS: 6174= 0 =20 Drop %: 0.28% Eth3RXInt: 411864 Eth2TXInt: 51888 01/13/05 19:30:03 entries: 00091311 Pkts: 991885 Err: 2507 PPS: 6612= 5 =20 Drop %: 0.25% Eth3RXInt: 420214 Eth2TXInt: 44873 01/13/05 19:30:18 entries: 00091ecc Pkts: 935298 Err: 2656 PPS: 6235= 3 =20 Drop %: 0.28% Eth3RXInt: 411803 Eth2TXInt: 49733 01/13/05 19:30:33 entries: 00092a91 Pkts: 937829 Err: 2797 PPS: 6252= 1 =20 Drop %: 0.29% Eth3RXInt: 408503 Eth2TXInt: 49473 01/13/05 19:30:48 entries: 00093612 Pkts: 958149 Err: 2698 PPS: 6387= 6 =20 Drop %: 0.28% Eth3RXInt: 415769 Eth2TXInt: 49552 01/13/05 19:40:08 entries: 000ae2ac Pkts: 917843 Err: 2654 PPS: 6118= 9 =20 Drop %: 0.28% Eth3RXInt: 394963 Eth2TXInt: 51912 01/13/05 19:40:23 entries: 000af369 Pkts: 917445 Err: 2117 PPS: 6116= 3 =20 Drop %: 0.23% Eth3RXInt: 394155 Eth2TXInt: 53112 01/13/05 19:40:38 entries: 000b0272 Pkts: 931697 Err: 2763 PPS: 6211= 3 =20 Drop %: 0.29% Eth3RXInt: 403602 Eth2TXInt: 51899 01/13/05 19:40:53 entries: 00005de3 Pkts: 854339 Err: 83088 PPS: 569= 55 =20 Drop %: 9.72% Eth3RXInt: 296451 Eth2TXInt: 62172 01/13/05 19:50:13 entries: 000669e0 Pkts: 910599 Err: 2646 PPS: 6070= 6 =20 Drop %: 0.29% Eth3RXInt: 402982 Eth2TXInt: 53797 01/13/05 19:50:28 entries: 00068591 Pkts: 921526 Err: 2782 PPS: 6143= 5 =20 Drop %: 0.30% Eth3RXInt: 408122 Eth2TXInt: 51792 01/13/05 19:50:44 entries: 0006a046 Pkts: 909343 Err: 2996 PPS: 6062= 2 =20 Drop %: 0.32% Eth3RXInt: 410888 Eth2TXInt: 53315 01/13/05 19:50:59 entries: 0006b968 Pkts: 904949 Err: 2656 PPS: 6032= 9 =20 Drop %: 0.29% Eth3RXInt: 410376 Eth2TXInt: 53444 01/13/05 20:00:03 entries: 0009188b Pkts: 907073 Err: 2539 PPS: 6047= 1 =20 Drop %: 0.27% Eth3RXInt: 408658 Eth2TXInt: 52399 01/13/05 20:00:18 entries: 000924f5 Pkts: 930178 Err: 2386 PPS: 6201= 1 =20 Drop %: 0.25% Eth3RXInt: 410595 Eth2TXInt: 51822 01/13/05 20:00:33 entries: 000931a3 Pkts: 895381 Err: 2447 PPS: 5969= 2 =20 Drop %: 0.27% Eth3RXInt: 406246 Eth2TXInt: 52993 01/13/05 20:00:49 entries: 00093c95 Pkts: 908271 Err: 2338 PPS: 6055= 1 =20 Drop %: 0.25% Eth3RXInt: 416026 Eth2TXInt: 53732 01/13/05 20:10:08 entries: 000ad87d Pkts: 911705 Err: 2432 PPS: 6078= 0 =20 Drop %: 0.26% Eth3RXInt: 416020 Eth2TXInt: 51364 01/13/05 20:10:23 entries: 000ae3fc Pkts: 961446 Err: 2385 PPS: 6409= 6 =20 Drop %: 0.24% Eth3RXInt: 418902 Eth2TXInt: 48358 01/13/05 20:10:39 entries: 000aee6a Pkts: 913636 Err: 2347 PPS: 6090= 9 =20 Drop %: 0.25% Eth3RXInt: 414232 Eth2TXInt: 51236 01/13/05 20:10:54 entries: 00005e36 Pkts: 888657 Err: 88852 PPS: 592= 43 =20 Drop %: 9.99% Eth3RXInt: 307888 Eth2TXInt: 58891 01/13/05 20:20:14 entries: 00064ea9 Pkts: 837630 Err: 2339 PPS: 5584= 2 =20 Drop %: 0.27% Eth3RXInt: 398772 Eth2TXInt: 57373 01/13/05 20:20:29 entries: 0006687f Pkts: 863629 Err: 2205 PPS: 5757= 5 =20 Drop %: 0.25% Eth3RXInt: 403868 Eth2TXInt: 54794 01/13/05 20:20:44 entries: 00068299 Pkts: 872662 Err: 2487 PPS: 5817= 7 =20 Drop %: 0.28% Eth3RXInt: 404412 Eth2TXInt: 55279 01/13/05 20:20:59 entries: 0006995c Pkts: 848795 Err: 2537 PPS: 5658= 6 =20 Drop %: 0.29% Eth3RXInt: 402853 Eth2TXInt: 56477 01/13/05 20:30:04 entries: 0009b042 Pkts: 875158 Err: 2970 PPS: 5834= 3 =20 Drop %: 0.33% Eth3RXInt: 382571 Eth2TXInt: 55533 01/13/05 20:30:19 entries: 0009c17f Pkts: 880014 Err: 2311 PPS: 5866= 7 =20 Drop %: 0.26% Eth3RXInt: 385079 Eth2TXInt: 53440 01/13/05 20:30:34 entries: 0009d1d6 Pkts: 900716 Err: 2453 PPS: 6004= 7 =20 Drop %: 0.27% Eth3RXInt: 396762 Eth2TXInt: 54786 01/13/05 20:30:49 entries: 0009e22d Pkts: 897585 Err: 2453 PPS: 5983= 9 =20 Drop %: 0.27% Eth3RXInt: 396506 Eth2TXInt: 54240 01/13/05 20:40:08 entries: 000b915f Pkts: 827962 Err: 2565 PPS: 5519= 7 =20 Drop %: 0.30% Eth3RXInt: 404875 Eth2TXInt: 58387 01/13/05 20:40:24 entries: 000b9cf2 Pkts: 821150 Err: 2460 PPS: 5474= 3 =20 Drop %: 0.29% Eth3RXInt: 399397 Eth2TXInt: 58173 01/13/05 20:40:39 entries: 000baaef Pkts: 878751 Err: 2733 PPS: 5858= 3 =20 Drop %: 0.31% Eth3RXInt: 402052 Eth2TXInt: 55343 01/13/05 20:40:54 entries: 000062d3 Pkts: 815754 Err: 77364 PPS: 543= 83 =20 Drop %: 9.48% Eth3RXInt: 298308 Eth2TXInt: 63697 01/13/05 20:50:13 entries: 000655f5 Pkts: 874449 Err: 2589 PPS: 5829= 6 =20 Drop %: 0.29% Eth3RXInt: 397470 Eth2TXInt: 55040 01/13/05 20:50:29 entries: 000670ef Pkts: 862434 Err: 2335 PPS: 5749= 5 =20 Drop %: 0.27% Eth3RXInt: 399384 Eth2TXInt: 55292 01/13/05 20:50:44 entries: 00068e59 Pkts: 904716 Err: 2520 PPS: 6031= 4 =20 Drop %: 0.27% Eth3RXInt: 401899 Eth2TXInt: 52789 01/13/05 20:50:59 entries: 0006a6af Pkts: 877349 Err: 2660 PPS: 5848= 9 =20 Drop %: 0.30% Eth3RXInt: 401982 Eth2TXInt: 54755 01/13/05 21:00:03 entries: 0008ffba Pkts: 835650 Err: 2127 PPS: 5571= 0 =20 Drop %: 0.25% Eth3RXInt: 406517 Eth2TXInt: 57597 01/13/05 21:00:18 entries: 00090a7f Pkts: 842742 Err: 2102 PPS: 5618= 2 =20 Drop %: 0.24% Eth3RXInt: 407024 Eth2TXInt: 57559 01/13/05 21:00:33 entries: 000915dd Pkts: 844459 Err: 2683 PPS: 5629= 7 =20 Drop %: 0.31% Eth3RXInt: 406624 Eth2TXInt: 58553 01/13/05 21:00:48 entries: 000920b6 Pkts: 810715 Err: 2626 PPS: 5404= 7 =20 Drop %: 0.32% Eth3RXInt: 401342 Eth2TXInt: 59538 01/13/05 21:10:08 entries: 000aa6a7 Pkts: 829066 Err: 2159 PPS: 5527= 1 =20 Drop %: 0.26% Eth3RXInt: 401210 Eth2TXInt: 56607 01/13/05 21:10:23 entries: 000ab10b Pkts: 833478 Err: 2350 PPS: 5556= 5 =20 Drop %: 0.28% Eth3RXInt: 404397 Eth2TXInt: 56495 01/13/05 21:10:38 entries: 000abb70 Pkts: 813251 Err: 2425 PPS: 5421= 6 =20 Drop %: 0.29% Eth3RXInt: 402135 Eth2TXInt: 57976 01/13/05 21:10:53 entries: 000ac12b Pkts: 836855 Err: 2315 PPS: 5579= 0 =20 Drop %: 0.27% Eth3RXInt: 404963 Eth2TXInt: 56857 01/13/05 21:20:13 entries: 000c8587 Pkts: 780311 Err: 2011 PPS: 5202= 0 =20 Drop %: 0.25% Eth3RXInt: 387437 Eth2TXInt: 60951 01/13/05 21:20:28 entries: 000c927c Pkts: 781288 Err: 1957 PPS: 5208= 5 =20 Drop %: 0.25% Eth3RXInt: 386866 Eth2TXInt: 60672 01/13/05 21:20:43 entries: 000c9f80 Pkts: 771294 Err: 2185 PPS: 5141= 9 =20 Drop %: 0.28% Eth3RXInt: 386213 Eth2TXInt: 61530 01/13/05 21:20:58 entries: 000cabe0 Pkts: 761870 Err: 1847 PPS: 5079= 1 =20 Drop %: 0.24% Eth3RXInt: 383979 Eth2TXInt: 60613 01/13/05 21:30:02 entries: 000e1471 Pkts: 752945 Err: 2363 PPS: 5019= 6 =20 Drop %: 0.31% Eth3RXInt: 385445 Eth2TXInt: 62462 01/13/05 21:30:17 entries: 000e20e0 Pkts: 746890 Err: 2179 PPS: 4979= 2 =20 Drop %: 0.29% Eth3RXInt: 385645 Eth2TXInt: 62886 01/13/05 21:30:32 entries: 000e2bf5 Pkts: 759932 Err: 2353 PPS: 5066= 2 =20 Drop %: 0.30% Eth3RXInt: 390137 Eth2TXInt: 61938 01/13/05 21:30:47 entries: 000e368c Pkts: 770359 Err: 2226 PPS: 5135= 7 =20 Drop %: 0.28% Eth3RXInt: 393035 Eth2TXInt: 62280 01/13/05 21:40:07 entries: 000f66ab Pkts: 710993 Err: 1425 PPS: 4739= 9 =20 Drop %: 0.20% Eth3RXInt: 385138 Eth2TXInt: 66570 01/13/05 21:40:22 entries: 000f6eea Pkts: 722199 Err: 1727 PPS: 4814= 6 =20 Drop %: 0.23% Eth3RXInt: 386471 Eth2TXInt: 65154 01/13/05 21:40:37 entries: 000f7731 Pkts: 721459 Err: 1858 PPS: 4809= 7 =20 Drop %: 0.25% Eth3RXInt: 388601 Eth2TXInt: 64437 01/13/05 21:40:52 entries: 00005160 Pkts: 717256 Err: 50031 PPS: 478= 17 =20 Drop %: 6.97% Eth3RXInt: 301824 Eth2TXInt: 67610 01/13/05 21:50:11 entries: 00060c77 Pkts: 744283 Err: 2209 PPS: 4961= 8 =20 Drop %: 0.29% Eth3RXInt: 385202 Eth2TXInt: 61977 01/13/05 21:50:26 entries: 0006251c Pkts: 712155 Err: 1731 PPS: 4747= 7 =20 Drop %: 0.24% Eth3RXInt: 375784 Eth2TXInt: 63593 01/13/05 21:50:42 entries: 00063f3d Pkts: 732397 Err: 2502 PPS: 4882= 6 =20 Drop %: 0.34% Eth3RXInt: 382823 Eth2TXInt: 64629 01/13/05 21:50:57 entries: 00065ea4 Pkts: 732251 Err: 1954 PPS: 4881= 6 =20 Drop %: 0.26% Eth3RXInt: 372229 Eth2TXInt: 64307 01/13/05 22:00:01 entries: 0008ed30 Pkts: 753502 Err: 1919 PPS: 5023= 3 =20 Drop %: 0.25% Eth3RXInt: 392290 Eth2TXInt: 63585 01/13/05 22:00:16 entries: 0008f743 Pkts: 765954 Err: 1783 PPS: 5106= 3 =20 Drop %: 0.23% Eth3RXInt: 398195 Eth2TXInt: 64681 01/13/05 22:00:31 entries: 00090132 Pkts: 745575 Err: 1748 PPS: 4970= 5 =20 Drop %: 0.23% Eth3RXInt: 393391 Eth2TXInt: 63904 01/13/05 22:00:46 entries: 00090bf1 Pkts: 750483 Err: 1810 PPS: 5003= 2 =20 Drop %: 0.24% Eth3RXInt: 395678 Eth2TXInt: 65592 01/13/05 22:10:05 entries: 000a69b4 Pkts: 740410 Err: 4101 PPS: 4936= 0 =20 Drop %: 0.55% Eth3RXInt: 393872 Eth2TXInt: 66508 01/13/05 22:10:20 entries: 000a732d Pkts: 737503 Err: 3481 PPS: 4916= 6 =20 Drop %: 0.47% Eth3RXInt: 392793 Eth2TXInt: 67370 01/13/05 22:10:35 entries: 000a7d9a Pkts: 735129 Err: 3227 PPS: 4900= 8 =20 Drop %: 0.43% Eth3RXInt: 394918 Eth2TXInt: 67208 01/13/05 22:10:51 entries: 000a87d0 Pkts: 731617 Err: 3099 PPS: 4877= 4 =20 Drop %: 0.42% Eth3RXInt: 391164 Eth2TXInt: 67757 01/13/05 22:20:09 entries: 000bcb09 Pkts: 674113 Err: 3321 PPS: 4494= 0 =20 Drop %: 0.49% Eth3RXInt: 379562 Eth2TXInt: 69421 01/13/05 22:20:25 entries: 000bd3b8 Pkts: 666534 Err: 2801 PPS: 4443= 5 =20 Drop %: 0.42% Eth3RXInt: 377072 Eth2TXInt: 70649 01/13/05 22:20:40 entries: 000bdd19 Pkts: 678034 Err: 2940 PPS: 4520= 2 =20 Drop %: 0.43% Eth3RXInt: 378198 Eth2TXInt: 69143 01/13/05 22:20:55 entries: 000be345 Pkts: 661543 Err: 2829 PPS: 4410= 2 =20 Drop %: 0.42% Eth3RXInt: 373469 Eth2TXInt: 69994 01/13/05 22:30:14 entries: 000d1135 Pkts: 678235 Err: 1982 PPS: 4521= 5 =20 Drop %: 0.29% Eth3RXInt: 373441 Eth2TXInt: 71223 01/13/05 22:30:29 entries: 000d1bf0 Pkts: 685493 Err: 1983 PPS: 4569= 9 =20 Drop %: 0.28% Eth3RXInt: 373410 Eth2TXInt: 68586 01/13/05 22:30:44 entries: 000d26eb Pkts: 684653 Err: 2007 PPS: 4564= 3 =20 Drop %: 0.29% Eth3RXInt: 373354 Eth2TXInt: 68304 01/13/05 22:30:59 entries: 000d2e78 Pkts: 664648 Err: 1527 PPS: 4430= 9 =20 Drop %: 0.22% Eth3RXInt: 365428 Eth2TXInt: 67413 01/13/05 22:40:03 entries: 000e44b4 Pkts: 645300 Err: 1954 PPS: 4302= 0 =20 Drop %: 0.30% Eth3RXInt: 369820 Eth2TXInt: 72192 01/13/05 22:40:18 entries: 000e4c66 Pkts: 643369 Err: 1702 PPS: 4289= 1 =20 Drop %: 0.26% Eth3RXInt: 366982 Eth2TXInt: 72002 01/13/05 22:40:33 entries: 000e5423 Pkts: 634654 Err: 1873 PPS: 4231= 0 =20 Drop %: 0.29% Eth3RXInt: 367668 Eth2TXInt: 72011 01/13/05 22:40:48 entries: 00002be0 Pkts: 626759 Err: 21655 PPS: 417= 83 =20 Drop %: 3.45% Eth3RXInt: 317916 Eth2TXInt: 72957 01/13/05 22:50:07 entries: 00057b41 Pkts: 636115 Err: 1548 PPS: 4240= 7 =20 Drop %: 0.24% Eth3RXInt: 356743 Eth2TXInt: 70117 01/13/05 22:50:22 entries: 00059254 Pkts: 690168 Err: 2081 PPS: 4601= 1 =20 Drop %: 0.30% Eth3RXInt: 375141 Eth2TXInt: 69588 01/13/05 22:50:37 entries: 0005a923 Pkts: 667265 Err: 1647 PPS: 4448= 4 =20 Drop %: 0.24% Eth3RXInt: 367504 Eth2TXInt: 69765 01/13/05 22:50:52 entries: 0005be38 Pkts: 646829 Err: 1806 PPS: 4312= 1 =20 Drop %: 0.27% Eth3RXInt: 361265 Eth2TXInt: 72190 01/13/05 23:00:11 entries: 0008b137 Pkts: 616932 Err: 1566 PPS: 4112= 8 =20 Drop %: 0.25% Eth3RXInt: 361653 Eth2TXInt: 74776 01/13/05 23:00:26 entries: 0008bd2f Pkts: 655216 Err: 2433 PPS: 4368= 1 =20 Drop %: 0.37% Eth3RXInt: 366736 Eth2TXInt: 72637 01/13/05 23:00:42 entries: 0008c6ce Pkts: 650050 Err: 1792 PPS: 4333= 6 =20 Drop %: 0.27% Eth3RXInt: 369516 Eth2TXInt: 74231 01/13/05 23:00:57 entries: 0008cf8a Pkts: 622743 Err: 1628 PPS: 4151= 6 =20 Drop %: 0.26% Eth3RXInt: 362609 Eth2TXInt: 73576 01/13/05 23:10:00 entries: 0009ec88 Pkts: 558466 Err: 1254 PPS: 3723= 1 =20 Drop %: 0.22% Eth3RXInt: 341801 Eth2TXInt: 77394 01/13/05 23:10:15 entries: 0009f446 Pkts: 583270 Err: 1727 PPS: 3888= 4 =20 Drop %: 0.29% Eth3RXInt: 351413 Eth2TXInt: 77099 01/13/05 23:10:31 entries: 0009fd65 Pkts: 585702 Err: 1378 PPS: 3904= 6 =20 Drop %: 0.23% Eth3RXInt: 352610 Eth2TXInt: 76484 01/13/05 23:10:46 entries: 000a061f Pkts: 591411 Err: 1389 PPS: 3942= 7 =20 Drop %: 0.23% Eth3RXInt: 351609 Eth2TXInt: 76353 01/13/05 23:20:04 entries: 000b177a Pkts: 630155 Err: 1788 PPS: 4201= 0 =20 Drop %: 0.28% Eth3RXInt: 368741 Eth2TXInt: 76933 01/13/05 23:20:19 entries: 000b2070 Pkts: 608282 Err: 1147 PPS: 4055= 2 =20 Drop %: 0.18% Eth3RXInt: 356552 Eth2TXInt: 76472 01/13/05 23:20:34 entries: 000b28ae Pkts: 560094 Err: 1474 PPS: 3733= 9 =20 Drop %: 0.26% Eth3RXInt: 341610 Eth2TXInt: 77689 01/13/05 23:20:50 entries: 000b314f Pkts: 559777 Err: 1268 PPS: 3731= 8 =20 Drop %: 0.22% Eth3RXInt: 342036 Eth2TXInt: 77905 01/13/05 23:30:08 entries: 000c3e43 Pkts: 602182 Err: 1643 PPS: 4014= 5 =20 Drop %: 0.27% Eth3RXInt: 360109 Eth2TXInt: 76867 01/13/05 23:30:23 entries: 000c456a Pkts: 544079 Err: 1293 PPS: 3627= 1 =20 Drop %: 0.23% Eth3RXInt: 337942 Eth2TXInt: 78707 01/13/05 23:30:38 entries: 000c4d58 Pkts: 571859 Err: 1606 PPS: 3812= 3 =20 Drop %: 0.28% Eth3RXInt: 348591 Eth2TXInt: 78355 01/13/05 23:30:53 entries: 000c4f8d Pkts: 553967 Err: 1299 PPS: 3693= 1 =20 Drop %: 0.23% Eth3RXInt: 340507 Eth2TXInt: 77327 01/13/05 23:40:12 entries: 000d5cd4 Pkts: 571850 Err: 1459 PPS: 3812= 3 =20 Drop %: 0.25% Eth3RXInt: 342271 Eth2TXInt: 77382 01/13/05 23:40:27 entries: 000d66eb Pkts: 537062 Err: 1233 PPS: 3580= 4 =20 Drop %: 0.22% Eth3RXInt: 326360 Eth2TXInt: 79641 01/13/05 23:40:42 entries: 000d700d Pkts: 538091 Err: 1640 PPS: 3587= 2 =20 Drop %: 0.30% Eth3RXInt: 331841 Eth2TXInt: 79667 01/13/05 23:40:57 entries: 00006e93 Pkts: 534710 Err: 14693 PPS: 356= 47 =20 Drop %: 2.74% Eth3RXInt: 255177 Eth2TXInt: 78981 01/13/05 23:50:01 entries: 00056e16 Pkts: 574215 Err: 1233 PPS: 3828= 1 =20 Drop %: 0.21% Eth3RXInt: 337409 Eth2TXInt: 78770 01/13/05 23:50:16 entries: 00058557 Pkts: 537083 Err: 1186 PPS: 3580= 5 =20 Drop %: 0.22% Eth3RXInt: 324471 Eth2TXInt: 78352 01/13/05 23:50:31 entries: 00059b52 Pkts: 565715 Err: 1586 PPS: 3771= 4 =20 Drop %: 0.28% Eth3RXInt: 340689 Eth2TXInt: 79699 01/13/05 23:50:46 entries: 0005af99 Pkts: 558546 Err: 1355 PPS: 3723= 6 =20 Drop %: 0.24% Eth3RXInt: 337133 Eth2TXInt: 78779 01/14/05 00:00:05 entries: 0008504d Pkts: 588805 Err: 1507 PPS: 3925= 3 =20 Drop %: 0.25% Eth3RXInt: 346266 Eth2TXInt: 77616 01/14/05 00:00:20 entries: 00085c27 Pkts: 570425 Err: 1672 PPS: 3802= 8 =20 Drop %: 0.29% Eth3RXInt: 338249 Eth2TXInt: 78085 01/14/05 00:00:35 entries: 00086908 Pkts: 578050 Err: 1327 PPS: 3853= 6 =20 Drop %: 0.22% Eth3RXInt: 340259 Eth2TXInt: 77927 01/14/05 00:00:50 entries: 00087438 Pkts: 566396 Err: 1135 PPS: 3775= 9 =20 Drop %: 0.20% Eth3RXInt: 338626 Eth2TXInt: 77983 01/14/05 00:10:09 entries: 0009a1f9 Pkts: 527344 Err: 1364 PPS: 3515= 6 =20 Drop %: 0.25% Eth3RXInt: 330864 Eth2TXInt: 80726 01/14/05 00:10:24 entries: 0009a950 Pkts: 519107 Err: 1251 PPS: 3460= 7 =20 Drop %: 0.24% Eth3RXInt: 327638 Eth2TXInt: 81313 01/14/05 00:10:39 entries: 0009b0d4 Pkts: 527377 Err: 1085 PPS: 3515= 8 =20 Drop %: 0.20% Eth3RXInt: 330084 Eth2TXInt: 80885 01/14/05 00:10:54 entries: 0009b7e8 Pkts: 527706 Err: 1603 PPS: 3518= 0 =20 Drop %: 0.30% Eth3RXInt: 331284 Eth2TXInt: 80577 01/14/05 00:20:13 entries: 000aa8fa Pkts: 477646 Err: 1147 PPS: 3184= 3 =20 Drop %: 0.24% Eth3RXInt: 313514 Eth2TXInt: 81244 01/14/05 00:20:28 entries: 000aaf4c Pkts: 506930 Err: 1148 PPS: 3379= 5 =20 Drop %: 0.22% Eth3RXInt: 324715 Eth2TXInt: 80366 01/14/05 00:20:43 entries: 000ab666 Pkts: 538447 Err: 1783 PPS: 3589= 6 =20 Drop %: 0.33% Eth3RXInt: 340587 Eth2TXInt: 80129 01/14/05 00:20:58 entries: 000abc90 Pkts: 503351 Err: 1151 PPS: 3355= 6 =20 Drop %: 0.22% Eth3RXInt: 324926 Eth2TXInt: 81205 01/14/05 00:30:01 entries: 000b95f8 Pkts: 503581 Err: 1588 PPS: 3357= 2 =20 Drop %: 0.31% Eth3RXInt: 323090 Eth2TXInt: 81310 01/14/05 00:30:16 entries: 000b9c10 Pkts: 509557 Err: 1373 PPS: 3397= 0 =20 Drop %: 0.26% Eth3RXInt: 327946 Eth2TXInt: 80876 01/14/05 00:30:31 entries: 000ba263 Pkts: 498061 Err: 1624 PPS: 3320= 4 =20 Drop %: 0.32% Eth3RXInt: 320360 Eth2TXInt: 80399 01/14/05 00:30:47 entries: 000ba8af Pkts: 508690 Err: 1030 PPS: 3391= 2 =20 Drop %: 0.20% Eth3RXInt: 325848 Eth2TXInt: 80562 01/14/05 00:40:05 entries: 000c8eb0 Pkts: 423203 Err: 925 PPS: 28213= =20 Drop %: 0.21% Eth3RXInt: 289128 Eth2TXInt: 81558 01/14/05 00:40:20 entries: 000c9460 Pkts: 435865 Err: 905 PPS: 29057= =20 Drop %: 0.20% Eth3RXInt: 290040 Eth2TXInt: 81407 01/14/05 00:40:35 entries: 000c9b1d Pkts: 470792 Err: 987 PPS: 31386= =20 Drop %: 0.20% Eth3RXInt: 306570 Eth2TXInt: 80345 01/14/05 00:40:50 entries: 00003ace Pkts: 455627 Err: 7859 PPS: 3037= 5 =20 Drop %: 1.72% Eth3RXInt: 261150 Eth2TXInt: 80456 01/14/05 00:50:09 entries: 0004b083 Pkts: 491755 Err: 1253 PPS: 3278= 3 =20 Drop %: 0.25% Eth3RXInt: 316362 Eth2TXInt: 81009 01/14/05 00:50:24 entries: 0004c2e2 Pkts: 465117 Err: 975 PPS: 31007= =20 Drop %: 0.20% Eth3RXInt: 301050 Eth2TXInt: 81862 01/14/05 00:50:39 entries: 0004d6dc Pkts: 459493 Err: 1327 PPS: 3063= 2 =20 Drop %: 0.28% Eth3RXInt: 298610 Eth2TXInt: 81555 01/14/05 00:50:54 entries: 0004eb2d Pkts: 487190 Err: 887 PPS: 32479= =20 Drop %: 0.18% Eth3RXInt: 313779 Eth2TXInt: 81653 01/14/05 01:00:12 entries: 0007333a Pkts: 511807 Err: 1015 PPS: 3412= 0 =20 Drop %: 0.19% Eth3RXInt: 326166 Eth2TXInt: 80991 01/14/05 01:00:28 entries: 000742bb Pkts: 490129 Err: 1441 PPS: 3267= 5 =20 Drop %: 0.29% Eth3RXInt: 315417 Eth2TXInt: 81048 01/14/05 01:00:43 entries: 00075002 Pkts: 480424 Err: 1108 PPS: 3202= 8 =20 Drop %: 0.23% Eth3RXInt: 312870 Eth2TXInt: 81955 01/14/05 01:00:58 entries: 00075ab5 Pkts: 479570 Err: 1305 PPS: 3197= 1 =20 Drop %: 0.27% Eth3RXInt: 314682 Eth2TXInt: 81203 01/14/05 01:10:01 entries: 0008979c Pkts: 450310 Err: 1045 PPS: 3002= 0 =20 Drop %: 0.23% Eth3RXInt: 290075 Eth2TXInt: 81569 01/14/05 01:10:16 entries: 00089faf Pkts: 433228 Err: 1053 PPS: 2888= 1 =20 Drop %: 0.24% Eth3RXInt: 285539 Eth2TXInt: 81461 01/14/05 01:10:31 entries: 0008a763 Pkts: 440048 Err: 1367 PPS: 2933= 6 =20 Drop %: 0.31% Eth3RXInt: 291495 Eth2TXInt: 81925 01/14/05 01:10:46 entries: 0008af1e Pkts: 501093 Err: 1510 PPS: 3340= 6 =20 Drop %: 0.30% Eth3RXInt: 319267 Eth2TXInt: 82134 01/14/05 01:20:05 entries: 0009a978 Pkts: 484885 Err: 1591 PPS: 3232= 5 =20 Drop %: 0.32% Eth3RXInt: 304961 Eth2TXInt: 80773 01/14/05 01:20:20 entries: 0009b485 Pkts: 497080 Err: 1484 PPS: 3313= 8 =20 Drop %: 0.29% Eth3RXInt: 310173 Eth2TXInt: 81031 01/14/05 01:20:35 entries: 0009bfd7 Pkts: 503000 Err: 1555 PPS: 3353= 3 =20 Drop %: 0.30% Eth3RXInt: 315228 Eth2TXInt: 81955 01/14/05 01:20:50 entries: 0009cb17 Pkts: 473078 Err: 1004 PPS: 3153= 8 =20 Drop %: 0.21% Eth3RXInt: 302143 Eth2TXInt: 82036 01/14/05 01:30:09 entries: 000acb27 Pkts: 485756 Err: 1048 PPS: 3238= 3 =20 Drop %: 0.21% Eth3RXInt: 315112 Eth2TXInt: 81381 01/14/05 01:30:24 entries: 000ade3e Pkts: 487954 Err: 1116 PPS: 3253= 0 =20 Drop %: 0.22% Eth3RXInt: 296615 Eth2TXInt: 80622 01/14/05 01:30:39 entries: 000b1d66 Pkts: 496891 Err: 1365 PPS: 3312= 6 =20 Drop %: 0.27% Eth3RXInt: 245583 Eth2TXInt: 79328 01/14/05 01:30:54 entries: 000b55c3 Pkts: 525362 Err: 1661 PPS: 3502= 4 =20 Drop %: 0.31% Eth3RXInt: 249821 Eth2TXInt: 76762 01/14/05 01:40:12 entries: 000c5d9b Pkts: 441275 Err: 1262 PPS: 2941= 8 =20 Drop %: 0.28% Eth3RXInt: 295788 Eth2TXInt: 81607 01/14/05 01:40:27 entries: 000c638d Pkts: 432402 Err: 818 PPS: 28826= =20 Drop %: 0.18% Eth3RXInt: 292080 Eth2TXInt: 82215 01/14/05 01:40:42 entries: 000c6a20 Pkts: 475611 Err: 1137 PPS: 3170= 7 =20 Drop %: 0.23% Eth3RXInt: 312107 Eth2TXInt: 82512 01/14/05 01:40:58 entries: 000062a2 Pkts: 422599 Err: 3778 PPS: 2817= 3 =20 Drop %: 0.89% Eth3RXInt: 236232 Eth2TXInt: 81681 01/14/05 01:50:01 entries: 00047c87 Pkts: 434595 Err: 1120 PPS: 2897= 3 =20 Drop %: 0.25% Eth3RXInt: 291004 Eth2TXInt: 81547 01/14/05 01:50:16 entries: 0004924f Pkts: 473118 Err: 1018 PPS: 3154= 1 =20 Drop %: 0.21% Eth3RXInt: 306494 Eth2TXInt: 81818 01/14/05 01:50:31 entries: 0004a615 Pkts: 454845 Err: 807 PPS: 30323= =20 Drop %: 0.17% Eth3RXInt: 300121 Eth2TXInt: 81781 01/14/05 01:50:46 entries: 0004b989 Pkts: 446690 Err: 814 PPS: 29779= =20 Drop %: 0.18% Eth3RXInt: 295153 Eth2TXInt: 82147 01/14/05 02:00:05 entries: 00071828 Pkts: 485939 Err: 1181 PPS: 3239= 5 =20 Drop %: 0.24% Eth3RXInt: 311765 Eth2TXInt: 81409 01/14/05 02:00:20 entries: 000727ca Pkts: 473909 Err: 1384 PPS: 3159= 3 =20 Drop %: 0.29% Eth3RXInt: 307111 Eth2TXInt: 81430 01/14/05 02:00:35 entries: 00073806 Pkts: 477835 Err: 1173 PPS: 3185= 5 =20 Drop %: 0.24% Eth3RXInt: 308946 Eth2TXInt: 81813 01/14/05 02:00:50 entries: 00074824 Pkts: 481520 Err: 918 PPS: 32101= =20 Drop %: 0.19% Eth3RXInt: 310852 Eth2TXInt: 81876 01/14/05 02:10:08 entries: 0008a6fc Pkts: 441730 Err: 788 PPS: 29448= =20 Drop %: 0.17% Eth3RXInt: 296119 Eth2TXInt: 82040 01/14/05 02:10:23 entries: 0008ae30 Pkts: 462573 Err: 964 PPS: 30838= =20 Drop %: 0.20% Eth3RXInt: 305317 Eth2TXInt: 82031 01/14/05 02:10:39 entries: 0008b5ce Pkts: 462473 Err: 1037 PPS: 3083= 1 =20 Drop %: 0.22% Eth3RXInt: 305753 Eth2TXInt: 81449 01/14/05 02:10:54 entries: 0008baee Pkts: 433606 Err: 885 PPS: 28907= =20 Drop %: 0.20% Eth3RXInt: 291876 Eth2TXInt: 81471 01/14/05 02:20:12 entries: 0009a92d Pkts: 458960 Err: 851 PPS: 30597= =20 Drop %: 0.18% Eth3RXInt: 303308 Eth2TXInt: 81503 01/14/05 02:20:27 entries: 0009b002 Pkts: 498472 Err: 1221 PPS: 3323= 1 =20 Drop %: 0.24% Eth3RXInt: 325077 Eth2TXInt: 81679 01/14/05 02:20:42 entries: 0009b68c Pkts: 484378 Err: 1176 PPS: 3229= 1 =20 Drop %: 0.24% Eth3RXInt: 317011 Eth2TXInt: 80552 01/14/05 02:20:57 entries: 0009b9cf Pkts: 448711 Err: 932 PPS: 29914= =20 Drop %: 0.20% Eth3RXInt: 300504 Eth2TXInt: 81309 01/14/05 02:30:01 entries: 000abe83 Pkts: 485720 Err: 1211 PPS: 3238= 1 =20 Drop %: 0.24% Eth3RXInt: 317102 Eth2TXInt: 81805 01/14/05 02:30:16 entries: 000ac418 Pkts: 456824 Err: 770 PPS: 30454= =20 Drop %: 0.16% Eth3RXInt: 303707 Eth2TXInt: 82063 01/14/05 02:30:31 entries: 000aca2e Pkts: 464268 Err: 926 PPS: 30951= =20 Drop %: 0.19% Eth3RXInt: 307084 Eth2TXInt: 82922 01/14/05 02:30:46 entries: 000acfd9 Pkts: 488002 Err: 1199 PPS: 3253= 3 =20 Drop %: 0.24% Eth3RXInt: 317994 Eth2TXInt: 82220 01/14/05 02:40:04 entries: 000b939f Pkts: 426137 Err: 1071 PPS: 2840= 9 =20 Drop %: 0.25% Eth3RXInt: 291613 Eth2TXInt: 80942 01/14/05 02:40:19 entries: 000b99b8 Pkts: 435682 Err: 641 PPS: 29045= =20 Drop %: 0.14% Eth3RXInt: 295451 Eth2TXInt: 81203 01/14/05 02:40:34 entries: 000ba164 Pkts: 469842 Err: 1099 PPS: 3132= 2 =20 Drop %: 0.23% Eth3RXInt: 310350 Eth2TXInt: 81309 01/14/05 02:40:50 entries: 000039d8 Pkts: 432433 Err: 4158 PPS: 2882= 8 =20 Drop %: 0.96% Eth3RXInt: 258916 Eth2TXInt: 79816 01/14/05 02:50:08 entries: 00045e02 Pkts: 411631 Err: 1073 PPS: 2744= 2 =20 Drop %: 0.26% Eth3RXInt: 278161 Eth2TXInt: 81417 01/14/05 02:50:23 entries: 00046f7b Pkts: 410141 Err: 795 PPS: 27342= =20 Drop %: 0.19% Eth3RXInt: 275966 Eth2TXInt: 81285 01/14/05 02:50:38 entries: 000481d2 Pkts: 433426 Err: 1245 PPS: 2889= 5 =20 Drop %: 0.28% Eth3RXInt: 289269 Eth2TXInt: 81567 01/14/05 02:50:53 entries: 000493db Pkts: 412782 Err: 969 PPS: 27518= =20 Drop %: 0.23% Eth3RXInt: 277938 Eth2TXInt: 81170 01/14/05 03:00:12 entries: 00075b30 Pkts: 525329 Err: 1144 PPS: 3502= 1 =20 Drop %: 0.21% Eth3RXInt: 335221 Eth2TXInt: 82922 01/14/05 03:00:27 entries: 00076ad2 Pkts: 517248 Err: 1513 PPS: 3448= 3 =20 Drop %: 0.29% Eth3RXInt: 325825 Eth2TXInt: 82644 01/14/05 03:00:42 entries: 000778c5 Pkts: 455097 Err: 1211 PPS: 3033= 9 =20 Drop %: 0.26% Eth3RXInt: 301609 Eth2TXInt: 81940 01/14/05 03:00:57 entries: 000785d8 Pkts: 472256 Err: 1428 PPS: 3148= 3 =20 Drop %: 0.30% Eth3RXInt: 308709 Eth2TXInt: 82655 01/14/05 03:10:00 entries: 0008c8fd Pkts: 474980 Err: 1191 PPS: 3166= 5 =20 Drop %: 0.25% Eth3RXInt: 305622 Eth2TXInt: 80539 01/14/05 03:10:15 entries: 0008d062 Pkts: 457870 Err: 1130 PPS: 3052= 4 =20 Drop %: 0.24% Eth3RXInt: 296680 Eth2TXInt: 82396 01/14/05 03:10:30 entries: 0008d73b Pkts: 480551 Err: 1381 PPS: 3203= 6 =20 Drop %: 0.28% Eth3RXInt: 309356 Eth2TXInt: 81644 01/14/05 03:10:46 entries: 0008ddd3 Pkts: 465617 Err: 950 PPS: 31041= =20 Drop %: 0.20% Eth3RXInt: 304579 Eth2TXInt: 82222 01/14/05 03:20:04 entries: 0009e568 Pkts: 457937 Err: 1151 PPS: 3052= 9 =20 Drop %: 0.25% Eth3RXInt: 305244 Eth2TXInt: 81326 01/14/05 03:20:19 entries: 0009eb65 Pkts: 436354 Err: 938 PPS: 29090= =20 Drop %: 0.21% Eth3RXInt: 292012 Eth2TXInt: 81560 01/14/05 03:20:34 entries: 0009f1d4 Pkts: 420677 Err: 863 PPS: 28045= =20 Drop %: 0.20% Eth3RXInt: 285478 Eth2TXInt: 81628 01/14/05 03:20:49 entries: 0009f71d Pkts: 451901 Err: 838 PPS: 30126= =20 Drop %: 0.18% Eth3RXInt: 302797 Eth2TXInt: 81472 01/14/05 03:30:08 entries: 000ab0e6 Pkts: 496468 Err: 935 PPS: 33097= =20 Drop %: 0.18% Eth3RXInt: 313564 Eth2TXInt: 81825 01/14/05 03:30:23 entries: 000ab6d9 Pkts: 487412 Err: 1234 PPS: 3249= 4 =20 Drop %: 0.25% Eth3RXInt: 311207 Eth2TXInt: 81957 01/14/05 03:30:38 entries: 000abd71 Pkts: 486905 Err: 1197 PPS: 3246= 0 =20 Drop %: 0.24% Eth3RXInt: 309132 Eth2TXInt: 81431 01/14/05 03:30:53 entries: 000ac18a Pkts: 501542 Err: 1095 PPS: 3343= 6 =20 Drop %: 0.21% Eth3RXInt: 317566 Eth2TXInt: 82225 01/14/05 03:40:11 entries: 000b7c09 Pkts: 453065 Err: 1297 PPS: 3020= 4 =20 Drop %: 0.28% Eth3RXInt: 301844 Eth2TXInt: 81878 01/14/05 03:40:26 entries: 000b80c8 Pkts: 419895 Err: 794 PPS: 27993= =20 Drop %: 0.18% Eth3RXInt: 286286 Eth2TXInt: 81854 01/14/05 03:40:41 entries: 000b85bf Pkts: 437850 Err: 871 PPS: 29190= =20 Drop %: 0.19% Eth3RXInt: 296486 Eth2TXInt: 81568 01/14/05 03:40:56 entries: 00005a7b Pkts: 441752 Err: 4133 PPS: 2945= 0 =20 Drop %: 0.93% Eth3RXInt: 246594 Eth2TXInt: 80314 01/14/05 03:50:00 entries: 00046892 Pkts: 403034 Err: 1065 PPS: 2686= 8 =20 Drop %: 0.26% Eth3RXInt: 274784 Eth2TXInt: 81157 01/14/05 03:50:15 entries: 000476c7 Pkts: 435578 Err: 729 PPS: 29038= =20 Drop %: 0.16% Eth3RXInt: 292309 Eth2TXInt: 81034 01/14/05 03:50:30 entries: 000486aa Pkts: 412410 Err: 828 PPS: 27494= =20 Drop %: 0.20% Eth3RXInt: 278210 Eth2TXInt: 81402 01/14/05 03:50:45 entries: 000495b6 Pkts: 416286 Err: 1004 PPS: 2775= 2 =20 Drop %: 0.24% Eth3RXInt: 281510 Eth2TXInt: 81008 01/14/05 04:00:03 entries: 0006a815 Pkts: 475366 Err: 1129 PPS: 3169= 1 =20 Drop %: 0.23% Eth3RXInt: 307887 Eth2TXInt: 81480 01/14/05 04:00:18 entries: 0006b54b Pkts: 474234 Err: 1045 PPS: 3161= 5 =20 Drop %: 0.22% Eth3RXInt: 307872 Eth2TXInt: 81418 01/14/05 04:00:34 entries: 0006c1b3 Pkts: 468519 Err: 920 PPS: 31234= =20 Drop %: 0.19% Eth3RXInt: 309532 Eth2TXInt: 81400 01/14/05 04:00:49 entries: 0006cec6 Pkts: 427386 Err: 701 PPS: 28492= =20 Drop %: 0.16% Eth3RXInt: 288788 Eth2TXInt: 80951 01/14/05 04:10:07 entries: 0008b49a Pkts: 450361 Err: 0 PPS: 30024 = =20 Drop %: 0.0% Eth3RXInt: 298760 Eth2TXInt: 82346 01/14/05 04:10:22 entries: 0008ba59 Pkts: 459431 Err: 0 PPS: 30628 = =20 Drop %: 0.0% Eth3RXInt: 301596 Eth2TXInt: 81793 01/14/05 04:10:37 entries: 0008c017 Pkts: 450040 Err: 0 PPS: 30002 = =20 Drop %: 0.0% Eth3RXInt: 298585 Eth2TXInt: 81996 01/14/05 04:10:52 entries: 0008c2e9 Pkts: 454740 Err: 963 PPS: 30316= =20 Drop %: 0.21% Eth3RXInt: 299204 Eth2TXInt: 82428 01/14/05 04:20:11 entries: 0009746e Pkts: 417841 Err: 1077 PPS: 2785= 6 =20 Drop %: 0.25% Eth3RXInt: 285292 Eth2TXInt: 81971 01/14/05 04:20:26 entries: 00097988 Pkts: 444129 Err: 834 PPS: 29608= =20 Drop %: 0.18% Eth3RXInt: 294925 Eth2TXInt: 82172 01/14/05 04:20:41 entries: 00097e6c Pkts: 440004 Err: 1152 PPS: 2933= 3 =20 Drop %: 0.26% Eth3RXInt: 298454 Eth2TXInt: 82420 01/14/05 04:20:56 entries: 000982c8 Pkts: 483248 Err: 1265 PPS: 3221= 6 =20 Drop %: 0.26% Eth3RXInt: 312325 Eth2TXInt: 80981 01/14/05 04:30:15 entries: 000a66f5 Pkts: 455322 Err: 1273 PPS: 3035= 4 =20 Drop %: 0.27% Eth3RXInt: 302449 Eth2TXInt: 82011 01/14/05 04:30:30 entries: 000a6c4f Pkts: 443848 Err: 938 PPS: 29589= =20 Drop %: 0.21% Eth3RXInt: 296296 Eth2TXInt: 82826 01/14/05 04:30:45 entries: 000a714d Pkts: 457830 Err: 906 PPS: 30522= =20 Drop %: 0.19% Eth3RXInt: 303239 Eth2TXInt: 82669 01/14/05 04:40:03 entries: 000b3c19 Pkts: 443891 Err: 1363 PPS: 2959= 2 =20 Drop %: 0.30% Eth3RXInt: 298216 Eth2TXInt: 81958 01/14/05 04:40:18 entries: 000b4131 Pkts: 436785 Err: 1055 PPS: 2911= 9 =20 Drop %: 0.24% Eth3RXInt: 293404 Eth2TXInt: 81866 01/14/05 04:40:33 entries: 000b4670 Pkts: 418272 Err: 886 PPS: 27884= =20 Drop %: 0.21% Eth3RXInt: 284868 Eth2TXInt: 82277 01/14/05 04:40:48 entries: 00003a13 Pkts: 433659 Err: 5106 PPS: 2891= 0 =20 Drop %: 1.17% Eth3RXInt: 254964 Eth2TXInt: 80964 01/14/05 04:50:07 entries: 000487b1 Pkts: 426580 Err: 825 PPS: 28438= =20 Drop %: 0.19% Eth3RXInt: 284115 Eth2TXInt: 81550 01/14/05 04:50:22 entries: 000499d9 Pkts: 429040 Err: 782 PPS: 28602= =20 Drop %: 0.18% Eth3RXInt: 286171 Eth2TXInt: 81600 01/14/05 04:50:37 entries: 0004ab30 Pkts: 425725 Err: 965 PPS: 28381= =20 Drop %: 0.22% Eth3RXInt: 287211 Eth2TXInt: 81419 01/14/05 04:50:52 entries: 0004bc1b Pkts: 453751 Err: 1116 PPS: 3025= 0 =20 Drop %: 0.24% Eth3RXInt: 296099 Eth2TXInt: 81084 01/14/05 05:00:11 entries: 000744da Pkts: 515817 Err: 1322 PPS: 3438= 7 =20 Drop %: 0.25% Eth3RXInt: 319462 Eth2TXInt: 81837 01/14/05 05:00:26 entries: 00075866 Pkts: 524724 Err: 1613 PPS: 3498= 1 =20 Drop %: 0.30% Eth3RXInt: 320024 Eth2TXInt: 81871 01/14/05 05:00:41 entries: 000768aa Pkts: 513511 Err: 1273 PPS: 3423= 4 =20 Drop %: 0.24% Eth3RXInt: 319514 Eth2TXInt: 81763 01/14/05 05:00:56 entries: 00077652 Pkts: 521796 Err: 1088 PPS: 3478= 6 =20 Drop %: 0.20% Eth3RXInt: 322121 Eth2TXInt: 81846 01/14/05 05:10:14 entries: 0008bcd7 Pkts: 441778 Err: 1271 PPS: 2945= 1 =20 Drop %: 0.28% Eth3RXInt: 293564 Eth2TXInt: 81867 01/14/05 05:10:29 entries: 0008c48f Pkts: 457062 Err: 1177 PPS: 3047= 0 =20 Drop %: 0.25% Eth3RXInt: 301042 Eth2TXInt: 82350 01/14/05 05:10:45 entries: 0008cb53 Pkts: 459844 Err: 940 PPS: 30656= =20 Drop %: 0.20% Eth3RXInt: 303190 Eth2TXInt: 82519 01/14/05 05:20:03 entries: 0009b445 Pkts: 478691 Err: 889 PPS: 31912= =20 Drop %: 0.18% Eth3RXInt: 313378 Eth2TXInt: 82914 01/14/05 05:20:18 entries: 0009ba72 Pkts: 485207 Err: 960 PPS: 32347= =20 Drop %: 0.19% Eth3RXInt: 316409 Eth2TXInt: 82264 01/14/05 05:20:33 entries: 0009c150 Pkts: 486224 Err: 879 PPS: 32414= =20 Drop %: 0.18% Eth3RXInt: 314240 Eth2TXInt: 81731 01/14/05 05:20:48 entries: 0009c35b Pkts: 449497 Err: 1155 PPS: 2996= 6 =20 Drop %: 0.25% Eth3RXInt: 299010 Eth2TXInt: 82788 01/14/05 05:30:07 entries: 000ab4ea Pkts: 485299 Err: 1095 PPS: 3235= 3 =20 Drop %: 0.22% Eth3RXInt: 314318 Eth2TXInt: 82271 01/14/05 05:30:22 entries: 000abae8 Pkts: 490269 Err: 797 PPS: 32684= =20 Drop %: 0.16% Eth3RXInt: 317205 Eth2TXInt: 82521 01/14/05 05:30:37 entries: 000ac134 Pkts: 496198 Err: 1132 PPS: 3307= 9 =20 Drop %: 0.22% Eth3RXInt: 318933 Eth2TXInt: 81960 01/14/05 05:30:52 entries: 000ac2a1 Pkts: 501254 Err: 954 PPS: 33416= =20 Drop %: 0.19% Eth3RXInt: 324082 Eth2TXInt: 83014 01/14/05 05:40:11 entries: 000baeeb Pkts: 593611 Err: 1357 PPS: 3957= 4 =20 Drop %: 0.22% Eth3RXInt: 360758 Eth2TXInt: 81969 01/14/05 05:40:26 entries: 000bb507 Pkts: 567372 Err: 1385 PPS: 3782= 4 =20 Drop %: 0.24% Eth3RXInt: 350017 Eth2TXInt: 82295 01/14/05 05:40:41 entries: 000bbb4c Pkts: 495626 Err: 1517 PPS: 3304= 1 =20 Drop %: 0.30% Eth3RXInt: 320385 Eth2TXInt: 81689 01/14/05 05:40:56 entries: 00006b5a Pkts: 488706 Err: 6440 PPS: 3258= 0 =20 Drop %: 1.31% Eth3RXInt: 247798 Eth2TXInt: 80410 01/14/05 05:50:14 entries: 0004e410 Pkts: 500546 Err: 1278 PPS: 3336= 9 =20 Drop %: 0.25% Eth3RXInt: 310059 Eth2TXInt: 80386 01/14/05 05:50:29 entries: 0004f8e5 Pkts: 506876 Err: 1275 PPS: 3379= 1 =20 Drop %: 0.25% Eth3RXInt: 316871 Eth2TXInt: 81128 01/14/05 05:50:45 entries: 00050dc1 Pkts: 510450 Err: 1152 PPS: 3403= 0 =20 Drop %: 0.22% Eth3RXInt: 320390 Eth2TXInt: 80666 01/14/05 06:00:03 entries: 0008089f Pkts: 519631 Err: 1531 PPS: 3464= 2 =20 Drop %: 0.29% Eth3RXInt: 323648 Eth2TXInt: 79945 01/14/05 06:00:18 entries: 00081247 Pkts: 535934 Err: 1163 PPS: 3572= 8 =20 Drop %: 0.21% Eth3RXInt: 327138 Eth2TXInt: 79790 01/14/05 06:00:33 entries: 00081bb3 Pkts: 540473 Err: 1305 PPS: 3603= 1 =20 Drop %: 0.24% Eth3RXInt: 332823 Eth2TXInt: 79750 01/14/05 06:00:48 entries: 00082320 Pkts: 541275 Err: 1622 PPS: 3608= 5 =20 Drop %: 0.29% Eth3RXInt: 334946 Eth2TXInt: 79207 01/14/05 06:10:07 entries: 00095795 Pkts: 559209 Err: 1351 PPS: 3728= 0 =20 Drop %: 0.24% Eth3RXInt: 336161 Eth2TXInt: 79479 01/14/05 06:10:22 entries: 000963c0 Pkts: 540560 Err: 1095 PPS: 3603= 7 =20 Drop %: 0.20% Eth3RXInt: 323433 Eth2TXInt: 79487 01/14/05 06:10:37 entries: 00096fa6 Pkts: 559203 Err: 1492 PPS: 3728= 0 =20 Drop %: 0.26% Eth3RXInt: 330691 Eth2TXInt: 80035 01/14/05 06:10:52 entries: 000979fb Pkts: 542626 Err: 1438 PPS: 3617= 5 =20 Drop %: 0.26% Eth3RXInt: 325674 Eth2TXInt: 79483 01/14/05 06:20:11 entries: 000ad185 Pkts: 537524 Err: 1585 PPS: 3583= 4 =20 Drop %: 0.29% Eth3RXInt: 329987 Eth2TXInt: 79144 01/14/05 06:20:26 entries: 000adaba Pkts: 513026 Err: 1035 PPS: 3420= 1 =20 Drop %: 0.20% Eth3RXInt: 317912 Eth2TXInt: 79128 01/14/05 06:20:41 entries: 000ae400 Pkts: 532172 Err: 1700 PPS: 3547= 8 =20 Drop %: 0.31% Eth3RXInt: 326356 Eth2TXInt: 79715 01/14/05 06:20:56 entries: 000aeb41 Pkts: 580261 Err: 1658 PPS: 3868= 4 =20 Drop %: 0.28% Eth3RXInt: 346806 Eth2TXInt: 79013 01/14/05 06:30:00 entries: 000c1594 Pkts: 572401 Err: 1903 PPS: 3816= 0 =20 Drop %: 0.33% Eth3RXInt: 341422 Eth2TXInt: 78273 01/14/05 06:30:15 entries: 000c1ea7 Pkts: 585850 Err: 1822 PPS: 3905= 6 =20 Drop %: 0.31% Eth3RXInt: 345728 Eth2TXInt: 77805 01/14/05 06:30:30 entries: 000c27b2 Pkts: 594077 Err: 1693 PPS: 3960= 5 =20 Drop %: 0.28% Eth3RXInt: 348358 Eth2TXInt: 76571 01/14/05 06:30:45 entries: 000c3123 Pkts: 582267 Err: 1706 PPS: 3881= 7 =20 Drop %: 0.29% Eth3RXInt: 342533 Eth2TXInt: 77763 01/14/05 06:40:04 entries: 000dfb48 Pkts: 710678 Err: 2075 PPS: 4737= 8 =20 Drop %: 0.29% Eth3RXInt: 377850 Eth2TXInt: 70656 01/14/05 06:40:19 entries: 000e083c Pkts: 660634 Err: 1777 PPS: 4404= 2 =20 Drop %: 0.26% Eth3RXInt: 353285 Eth2TXInt: 71353 01/14/05 06:40:34 entries: 000e131e Pkts: 683136 Err: 1696 PPS: 4554= 2 =20 Drop %: 0.24% Eth3RXInt: 369381 Eth2TXInt: 72622 01/14/05 06:40:49 entries: 00005c1d Pkts: 713262 Err: 36148 PPS: 475= 50 =20 Drop %: 50.6% Eth3RXInt: 286910 Eth2TXInt: 71729 01/14/05 06:50:08 entries: 0006066c Pkts: 695785 Err: 1970 PPS: 4638= 5 =20 Drop %: 0.28% Eth3RXInt: 368369 Eth2TXInt: 73034 01/14/05 06:50:23 entries: 0006209f Pkts: 705028 Err: 1715 PPS: 4700= 1 =20 Drop %: 0.24% Eth3RXInt: 368574 Eth2TXInt: 72892 01/14/05 06:50:38 entries: 000639ca Pkts: 702841 Err: 1706 PPS: 4685= 6 =20 Drop %: 0.24% Eth3RXInt: 370024 Eth2TXInt: 72876 01/14/05 06:50:54 entries: 000651d2 Pkts: 726747 Err: 2020 PPS: 4844= 9 =20 Drop %: 0.27% Eth3RXInt: 376832 Eth2TXInt: 71366 01/14/05 07:00:13 entries: 0008f249 Pkts: 677362 Err: 1595 PPS: 4515= 7 =20 Drop %: 0.23% Eth3RXInt: 370724 Eth2TXInt: 69981 01/14/05 07:00:28 entries: 0008fe96 Pkts: 662406 Err: 1423 PPS: 4416= 0 =20 Drop %: 0.21% Eth3RXInt: 362967 Eth2TXInt: 72611 01/14/05 07:00:43 entries: 00090c13 Pkts: 662222 Err: 1844 PPS: 4414= 8 =20 Drop %: 0.27% Eth3RXInt: 359869 Eth2TXInt: 72181 01/14/05 07:00:58 entries: 00091789 Pkts: 656859 Err: 1729 PPS: 4379= 0 =20 Drop %: 0.26% Eth3RXInt: 358838 Eth2TXInt: 70074 01/14/05 07:10:02 entries: 000abdb6 Pkts: 697539 Err: 2042 PPS: 4650= 2 =20 Drop %: 0.29% Eth3RXInt: 379747 Eth2TXInt: 70269 01/14/05 07:10:17 entries: 000ac9d9 Pkts: 704847 Err: 1847 PPS: 4698= 9 =20 Drop %: 0.26% Eth3RXInt: 374670 Eth2TXInt: 69898 01/14/05 07:10:32 entries: 000ad57b Pkts: 703755 Err: 2090 PPS: 4691= 7 =20 Drop %: 0.29% Eth3RXInt: 377955 Eth2TXInt: 70850 01/14/05 07:10:47 entries: 000adebf Pkts: 709598 Err: 1790 PPS: 4730= 6 =20 Drop %: 0.25% Eth3RXInt: 379562 Eth2TXInt: 69334 01/14/05 07:20:06 entries: 000c9ceb Pkts: 790839 Err: 2372 PPS: 5272= 2 =20 Drop %: 0.29% Eth3RXInt: 392123 Eth2TXInt: 63101 01/14/05 07:20:21 entries: 000caa53 Pkts: 815293 Err: 2200 PPS: 5435= 2 =20 Drop %: 0.26% Eth3RXInt: 391243 Eth2TXInt: 63859 01/14/05 07:20:37 entries: 000cb70a Pkts: 801060 Err: 2421 PPS: 5340= 4 =20 Drop %: 0.30% Eth3RXInt: 392279 Eth2TXInt: 63283 01/14/05 07:20:52 entries: 000cc107 Pkts: 816395 Err: 2279 PPS: 5442= 6 =20 Drop %: 0.27% Eth3RXInt: 390125 Eth2TXInt: 63646 01/14/05 07:30:11 entries: 000e682c Pkts: 817455 Err: 2501 PPS: 5449= 7 =20 Drop %: 0.30% Eth3RXInt: 396197 Eth2TXInt: 63137 01/14/05 07:30:26 entries: 000e756b Pkts: 820908 Err: 2438 PPS: 5472= 7 =20 Drop %: 0.29% Eth3RXInt: 391849 Eth2TXInt: 63660 01/14/05 07:30:41 entries: 000e8389 Pkts: 816010 Err: 2613 PPS: 5440= 0 =20 Drop %: 0.32% Eth3RXInt: 392971 Eth2TXInt: 64416 01/14/05 07:30:56 entries: 000e8d18 Pkts: 827390 Err: 2536 PPS: 5515= 9 =20 Drop %: 0.30% Eth3RXInt: 394834 Eth2TXInt: 61765 01/14/05 07:40:01 entries: 0010436e Pkts: 863423 Err: 2368 PPS: 5756= 1 =20 Drop %: 0.27% Eth3RXInt: 405190 Eth2TXInt: 60998 01/14/05 07:40:16 entries: 00104fda Pkts: 858511 Err: 2494 PPS: 5723= 4 =20 Drop %: 0.29% Eth3RXInt: 403185 Eth2TXInt: 61815 01/14/05 07:40:31 entries: 00105c15 Pkts: 854565 Err: 2470 PPS: 5697= 1 =20 Drop %: 0.28% Eth3RXInt: 404894 Eth2TXInt: 61287 01/14/05 07:40:46 entries: 000057a0 Pkts: 826768 Err: 113636 PPS: 55= 117 =20 Drop %: 13.74% Eth3RXInt: 302767 Eth2TXInt: 65567 01/14/05 07:50:06 entries: 00079684 Pkts: 913524 Err: 2245 PPS: 6090= 1 =20 Drop %: 0.24% Eth3RXInt: 400066 Eth2TXInt: 58282 01/14/05 07:50:21 entries: 0007b783 Pkts: 864505 Err: 2505 PPS: 5763= 3 =20 Drop %: 0.28% Eth3RXInt: 393922 Eth2TXInt: 61211 01/14/05 07:50:36 entries: 0007d8a8 Pkts: 883376 Err: 2693 PPS: 5889= 1 =20 Drop %: 0.30% Eth3RXInt: 397785 Eth2TXInt: 61160 01/14/05 07:50:51 entries: 0007f40c Pkts: 858829 Err: 2394 PPS: 5725= 5 =20 Drop %: 0.27% Eth3RXInt: 398098 Eth2TXInt: 60954 01/14/05 08:00:11 entries: 000a460b Pkts: 1000645 Err: 2906 PPS: 667= 09 =20 Drop %: 0.29% Eth3RXInt: 406845 Eth2TXInt: 53497 01/14/05 08:00:26 entries: 000a55a7 Pkts: 965824 Err: 3062 PPS: 6438= 8 =20 Drop %: 0.31% Eth3RXInt: 402766 Eth2TXInt: 54223 01/14/05 08:00:41 entries: 000a6548 Pkts: 975763 Err: 3184 PPS: 6505= 0 =20 Drop %: 0.32% Eth3RXInt: 408337 Eth2TXInt: 55173 01/14/05 08:00:56 entries: 000a726e Pkts: 963100 Err: 3105 PPS: 6420= 6 =20 Drop %: 0.32% Eth3RXInt: 409883 Eth2TXInt: 54808 01/14/05 08:10:01 entries: 000c7fc9 Pkts: 1045671 Err: 2629 PPS: 697= 11 =20 Drop %: 0.25% Eth3RXInt: 412912 Eth2TXInt: 52786 01/14/05 08:10:16 entries: 000c8dd3 Pkts: 1059809 Err: 3206 PPS: 706= 53 =20 Drop %: 0.30% Eth3RXInt: 414254 Eth2TXInt: 51833 01/14/05 08:10:32 entries: 000c9c1a Pkts: 1026487 Err: 3277 PPS: 684= 32 =20 Drop %: 0.31% Eth3RXInt: 414313 Eth2TXInt: 51822 01/14/05 08:10:47 entries: 000ca57f Pkts: 1026565 Err: 3149 PPS: 684= 37 =20 Drop %: 0.30% Eth3RXInt: 412748 Eth2TXInt: 51581 01/14/05 08:20:07 entries: 000eb744 Pkts: 1086031 Err: 3287 PPS: 724= 02 =20 Drop %: 0.30% Eth3RXInt: 406328 Eth2TXInt: 48924 01/14/05 08:20:22 entries: 000ec65d Pkts: 1066622 Err: 2733 PPS: 711= 08 =20 Drop %: 0.25% Eth3RXInt: 408729 Eth2TXInt: 49285 01/14/05 08:20:37 entries: 000ed550 Pkts: 1069185 Err: 2919 PPS: 712= 79 =20 Drop %: 0.27% Eth3RXInt: 409380 Eth2TXInt: 49829 01/14/05 08:20:52 entries: 000ede68 Pkts: 1098310 Err: 3181 PPS: 732= 20 =20 Drop %: 0.28% Eth3RXInt: 414812 Eth2TXInt: 50289 01/14/05 08:30:12 entries: 0010ba04 Pkts: 1132309 Err: 3248 PPS: 754= 87 =20 Drop %: 0.28% Eth3RXInt: 414595 Eth2TXInt: 45562 01/14/05 08:30:27 entries: 0010c986 Pkts: 1154479 Err: 3665 PPS: 769= 65 =20 Drop %: 0.31% Eth3RXInt: 404918 Eth2TXInt: 45873 01/14/05 08:30:43 entries: 0010d8e5 Pkts: 1192416 Err: 4128 PPS: 794= 94 =20 Drop %: 0.34% Eth3RXInt: 405126 Eth2TXInt: 43819 01/14/05 08:30:58 entries: 0010e633 Pkts: 1166668 Err: 3361 PPS: 777= 77 =20 Drop %: 0.28% Eth3RXInt: 415004 Eth2TXInt: 44711 01/14/05 08:40:03 entries: 0012aad0 Pkts: 1138575 Err: 3211 PPS: 759= 05 =20 Drop %: 0.28% Eth3RXInt: 373013 Eth2TXInt: 47718 01/14/05 08:40:18 entries: 0012c2e3 Pkts: 1158909 Err: 3481 PPS: 772= 60 =20 Drop %: 0.30% Eth3RXInt: 366664 Eth2TXInt: 45401 01/14/05 08:40:33 entries: 0012d5fb Pkts: 1155017 Err: 3674 PPS: 770= 01 =20 Drop %: 0.31% Eth3RXInt: 389075 Eth2TXInt: 46785 01/14/05 08:40:48 entries: 00008aee Pkts: 1033983 Err: 174485 PPS: =20 68932 Drop %: 16.87% Eth3RXInt: 246160 Eth2TXInt: 60997 =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart24040128.PuJ0tmka1N Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB595dqtjaBHGZBeURArZgAJsEpm5evhwsj26dMD9zrzRZzdAYnQCfYNuf /FwmUlAZx1ly/oGN61Q6vak= =NEZp -----END PGP SIGNATURE----- --nextPart24040128.PuJ0tmka1N-- From tgraf@suug.ch Fri Jan 14 07:13:51 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 07:13:59 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0EFDoaj002243 for ; Fri, 14 Jan 2005 07:13:50 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 4455E8C; Fri, 14 Jan 2005 16:13:25 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id CDF881C0EA; Fri, 14 Jan 2005 16:14:07 +0100 (CET) Date: Fri, 14 Jan 2005 16:14:07 +0100 From: Thomas Graf To: Patrick McHardy Cc: jamal , netdev@oss.sgi.com Subject: Re: [RFC] meta ematch Message-ID: <20050114151407.GR26856@postel.suug.ch> References: <20050106194102.GW26856@postel.suug.ch> <1105105511.1046.77.camel@jzny.localdomain> <20050108145457.GZ26856@postel.suug.ch> <1105363582.1041.162.camel@jzny.localdomain> <20050110211747.GA26856@postel.suug.ch> <1105394738.1085.63.camel@jzny.localdomain> <20050113174111.GP26856@postel.suug.ch> <41E6C3E5.2020908@trash.net> <20050113192047.GQ26856@postel.suug.ch> <41E71CC4.3020102@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41E71CC4.3020102@trash.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 240 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * Patrick McHardy <41E71CC4.3020102@trash.net> 2005-01-14 02:13 > True. nfctinfo is even useful for more, the direction of a connection > might be interesting. connmark, conntrack counters, src-ip before SNAT > etc. might also be interesting, but they are horrible to implement cleanly > because any dependency on ip_conntrack_lock will automatically load > ip_conntrack. Perhaps we should add something like nf_ct_get_afinfo() to > return a set of conntrack operations to nf_conntrack. Yes, I'm kind of afraid to create a too big dependency on netfilter, so I sticked to the easly reachable values. I think I'll remove the netfilter attributes again except for nfmark and readd them together with the more complicated routing information and the socket attributes to not delay the whole ematch patch for too long. > For things beside the nf* fields: I think we should make it very clear > that everything that isn't already visible to userspace in some way, and > thus won't disappear (like priority, nfmark, load average ...), can get > changed/removed any time. Agreed. > >The `dst` meta_value is the l_value/r_lvalue from em_meta_match and > >never gets destroyed. I reused meta_data to store address & length. > >It might be a good idea to make a new struct for this to make it > >more readable though. > > > Looks good to me already. I only looked at the diff, so I didn't really > follow the codepath. I changed it anyway, it looks a lot cleaner now. > Shouldn't be too hard to get right. In the kernel you can decide based > on RTA_PAYLOAD. Userspace needs some other way to notice it is running > as a 32-bit binary on a 64-bit kernel, but that's something you can't > solve in the kernel anyway. Both have their drawbacks but I think yours is a bit simpler. I changed it to the code below and gave responsibility to userspace. + if (RTA_PAYLOAD(rta) >= sizeof(unsigned long)) { + dst->val = *(unsigned long *) RTA_DATA(rta); + dst->len = sizeof(unsigned long); + } else if (RTA_PAYLOAD(rta) == sizeof(u32)) { + dst->val = *(u32 *) RTA_DATA(rta); + dst->len = sizeof(u32); + } else + return -EINVAL; Here's a revised patch. I fixed the numeric comparison issues and added meta_obj instead of using meta_data to give a better impression on the difference of a comparable object and meta data definitions. diff -Nru linux-2.6.10-bk14.orig/include/linux/pkt_cls.h linux-2.6.10-bk14/include/linux/pkt_cls.h --- linux-2.6.10-bk14.orig/include/linux/pkt_cls.h 2005-01-13 11:18:05.000000000 +0100 +++ linux-2.6.10-bk14/include/linux/pkt_cls.h 2005-01-13 11:17:52.000000000 +0100 @@ -352,6 +352,7 @@ TCF_EM_CMP, TCF_EM_NBYTE, TCF_EM_U32, + TCF_EM_META, __TCF_EM_MAX }; diff -Nru linux-2.6.10-bk14.orig/include/linux/tc_ematch/tc_em_meta.h linux-2.6.10-bk14/include/linux/tc_ematch/tc_em_meta.h --- linux-2.6.10-bk14.orig/include/linux/tc_ematch/tc_em_meta.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.10-bk14/include/linux/tc_ematch/tc_em_meta.h 2005-01-13 22:16:40.000000000 +0100 @@ -0,0 +1,72 @@ +#ifndef __LINUX_TC_EM_META_H +#define __LINUX_TC_EM_META_H + +#include + +enum +{ + TCA_EM_META_UNSPEC, + TCA_EM_META_HDR, + TCA_EM_META_LVALUE, + TCA_EM_META_RVALUE, + __TCA_EM_META_MAX +}; +#define TCA_EM_META_MAX (__TCA_EM_META_MAX - 1) + +struct tcf_meta_val +{ + __u16 kind; + __u8 shift; + __u8 op; +}; + +#define TCF_META_TYPE_MASK (0xf << 12) +#define TCF_META_TYPE(kind) (((kind) & TCF_META_TYPE_MASK) >> 12) +#define TCF_META_ID_MASK 0x7ff +#define TCF_META_ID(kind) ((kind) & TCF_META_ID_MASK) + +enum +{ + TCF_META_TYPE_VAR, + TCF_META_TYPE_INT, + __TCF_META_TYPE_MAX +}; +#define TCF_META_TYPE_MAX (__TCF_META_TYPE_MAX - 1) + +enum +{ + TCF_META_ID_VALUE, + TCF_META_ID_RANDOM, + TCF_META_ID_LOADAVG_0, + TCF_META_ID_LOADAVG_1, + TCF_META_ID_LOADAVG_2, + TCF_META_ID_DEV, + TCF_META_ID_INDEV, + TCF_META_ID_REALDEV, + TCF_META_ID_PRIORITY, + TCF_META_ID_PROTOCOL, + TCF_META_ID_SECURITY, + TCF_META_ID_PKTTYPE, + TCF_META_ID_PKTLEN, + TCF_META_ID_DATALEN, + TCF_META_ID_MACLEN, + TCF_META_ID_NFMARK, + TCF_META_ID_NFCACHE, + TCF_META_ID_NFCTINFO, + TCF_META_ID_NFDEBUG, + TCF_META_ID_TCINDEX, + TCF_META_ID_TCVERDICT, + TCF_META_ID_TCCLASSID, + TCF_META_ID_RTCLASSID, + TCF_META_ID_RTIIF, + __TCF_META_ID_MAX +}; +#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1) + +struct tcf_meta_hdr +{ + struct tcf_meta_val left; + struct tcf_meta_val right; +}; + +#endif diff -Nru linux-2.6.10-bk14.orig/net/sched/Kconfig linux-2.6.10-bk14/net/sched/Kconfig --- linux-2.6.10-bk14.orig/net/sched/Kconfig 2005-01-13 11:18:05.000000000 +0100 +++ linux-2.6.10-bk14/net/sched/Kconfig 2005-01-14 14:09:41.000000000 +0100 @@ -428,6 +428,17 @@ To compile this code as a module, choose M here: the module will be called em_u32. +config NET_EMATCH_META + tristate "Metadata" + depends on NET_EMATCH + ---help--- + Say Y here if you want to be ablt to classify packets based on + metadata such as load average, netfilter attributes, socket + attributes and routing decisions. + + To compile this code as a module, choose M here: the + module will be called em_meta. + config NET_CLS_ACT bool "Packet ACTION" depends on EXPERIMENTAL && NET_CLS && NET_QOS diff -Nru linux-2.6.10-bk14.orig/net/sched/Makefile linux-2.6.10-bk14/net/sched/Makefile --- linux-2.6.10-bk14.orig/net/sched/Makefile 2005-01-13 11:18:05.000000000 +0100 +++ linux-2.6.10-bk14/net/sched/Makefile 2005-01-13 11:17:52.000000000 +0100 @@ -37,3 +37,4 @@ obj-$(CONFIG_NET_EMATCH_CMP) += em_cmp.o obj-$(CONFIG_NET_EMATCH_NBYTE) += em_nbyte.o obj-$(CONFIG_NET_EMATCH_U32) += em_u32.o +obj-$(CONFIG_NET_EMATCH_META) += em_meta.o diff -Nru linux-2.6.10-bk14.orig/net/sched/em_meta.c linux-2.6.10-bk14/net/sched/em_meta.c --- linux-2.6.10-bk14.orig/net/sched/em_meta.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.10-bk14/net/sched/em_meta.c 2005-01-14 14:08:41.000000000 +0100 @@ -0,0 +1,587 @@ +/* + * net/sched/em_meta.c Metadata ematch + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: Thomas Graf + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct meta_obj +{ + unsigned long value; + unsigned int len; +}; + +struct meta_value +{ + struct tcf_meta_val hdr; + unsigned long val; + unsigned int len; +}; + +struct meta_match +{ + struct meta_value lvalue; + struct meta_value rvalue; +}; + +#define meta_id(value) (TCF_META_ID((value)->hdr.kind)) +#define meta_type(value) (TCF_META_TYPE((value)->hdr.kind)) + +/************************************************************************** + * System status & misc + **************************************************************************/ + +static int meta_int_random(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + get_random_bytes(&dst->value, sizeof(dst->value)); + return 0; +} + +static inline unsigned long fixed_loadavg(unsigned long v) +{ + return (v + (FIXED_1/200)) >> FSHIFT; +} + +static int meta_int_loadavg_0(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + dst->value = fixed_loadavg(avenrun[0]); + return 0; +} + +static int meta_int_loadavg_1(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + dst->value = fixed_loadavg(avenrun[1]); + return 0; +} + +static int meta_int_loadavg_2(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + dst->value = fixed_loadavg(avenrun[2]); + return 0; +} + +/************************************************************************** + * Device names & indices + **************************************************************************/ + +static inline int int_dev(struct net_device *dev, struct meta_obj *dst) +{ + if (unlikely(dev == NULL)) + return -1; + + dst->value = dev->ifindex; + return 0; +} + +static inline int var_dev(struct net_device *dev, struct meta_obj *dst) +{ + if (unlikely(dev == NULL)) + return -1; + + dst->value = (unsigned long) dev->name; + dst->len = strlen(dev->name); + return 0; +} + +static int meta_int_dev(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + return int_dev(skb->dev, dst); +} + +static int meta_var_dev(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + return var_dev(skb->dev, dst); +} + +static int meta_int_indev(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + return int_dev(skb->input_dev, dst); +} + +static int meta_var_indev(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + return var_dev(skb->input_dev, dst); +} + +static int meta_int_realdev(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + return int_dev(skb->real_dev, dst); +} + +static int meta_var_realdev(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + return var_dev(skb->real_dev, dst); +} + +/************************************************************************** + * skb attributes + **************************************************************************/ + +static int meta_int_priority(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + dst->value = skb->priority; + return 0; +} + +static int meta_int_protocol(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + /* Let userspace take care of the byte ordering */ + dst->value = skb->protocol; + return 0; +} + +static int meta_int_security(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + dst->value = skb->security; + return 0; +} + +static int meta_int_pkttype(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + dst->value = skb->pkt_type; + return 0; +} + +static int meta_int_pktlen(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + dst->value = skb->len; + return 0; +} + +static int meta_int_datalen(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + dst->value = skb->data_len; + return 0; +} + +static int meta_int_maclen(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + dst->value = skb->mac_len; + return 0; +} + +/************************************************************************** + * Netfilter + **************************************************************************/ + +#ifdef CONFIG_NETFILTER +static int meta_int_nfmark(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + dst->value = skb->nfmark; + return 0; +} + +static int meta_int_nfcache(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + dst->value = skb->nfcache; + return 0; +} + +static int meta_int_nfctinfo(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + dst->value = skb->nfctinfo; + return 0; +} + +#ifdef CONFIG_NETFILTER_DEBUG +static int meta_int_nfdebug(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + dst->value = skb->nf_debug; + return 0; +} +#endif +#endif + +/************************************************************************** + * Traffic Control + **************************************************************************/ + +static int meta_int_tcindex(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + dst->value = skb->tc_index; + return 0; +} + +#ifdef CONFIG_NET_CLS_ACT +static int meta_int_tcverd(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + dst->value = skb->tc_verd; + return 0; +} + +static int meta_int_tcclassid(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + dst->value = skb->tc_classid; + return 0; +} +#endif + +/************************************************************************** + * Routing + **************************************************************************/ + +#ifdef CONFIG_NET_CLS_ROUTE +static int meta_int_rtclassid(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + if (unlikely(skb->dst == NULL)) + return -1; + + dst->value = skb->dst->tclassid; + return 0; +} +#endif + +static int meta_int_rtiif(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + if (unlikely(skb->dst == NULL)) + return -1; + + dst->value = ((struct rtable*) skb->dst)->fl.iif; + return 0; +} + +struct meta_ops +{ + int (*get)(struct sk_buff *, struct tcf_pkt_info *, + struct meta_value *, struct meta_obj *); +}; + +static struct meta_ops __meta_ops[TCF_META_TYPE_MAX+1][TCF_META_ID_MAX+1] = { + [TCF_META_TYPE_VAR] = { + [TCF_META_ID_DEV] = { .get = meta_var_dev }, + [TCF_META_ID_INDEV] = { .get = meta_var_indev }, + [TCF_META_ID_REALDEV] = { .get = meta_var_realdev } + }, + [TCF_META_TYPE_INT] = { + [TCF_META_ID_RANDOM] = { .get = meta_int_random }, + [TCF_META_ID_LOADAVG_0] = { .get = meta_int_loadavg_0 }, + [TCF_META_ID_LOADAVG_1] = { .get = meta_int_loadavg_1 }, + [TCF_META_ID_LOADAVG_2] = { .get = meta_int_loadavg_2 }, + [TCF_META_ID_DEV] = { .get = meta_int_dev }, + [TCF_META_ID_INDEV] = { .get = meta_int_indev }, + [TCF_META_ID_REALDEV] = { .get = meta_int_realdev }, + [TCF_META_ID_PRIORITY] = { .get = meta_int_priority }, + [TCF_META_ID_PROTOCOL] = { .get = meta_int_protocol }, + [TCF_META_ID_SECURITY] = { .get = meta_int_security }, + [TCF_META_ID_PKTTYPE] = { .get = meta_int_pkttype }, + [TCF_META_ID_PKTLEN] = { .get = meta_int_pktlen }, + [TCF_META_ID_DATALEN] = { .get = meta_int_datalen }, + [TCF_META_ID_MACLEN] = { .get = meta_int_maclen }, +#ifdef CONFIG_NETFILTER + [TCF_META_ID_NFMARK] = { .get = meta_int_nfmark }, + [TCF_META_ID_NFCACHE] = { .get = meta_int_nfcache }, + [TCF_META_ID_NFCTINFO] = { .get = meta_int_nfctinfo }, +#ifdef CONFIG_NETFILTER_DEBUG + [TCF_META_ID_NFDEBUG] = { .get = meta_int_nfdebug }, +#endif +#endif + [TCF_META_ID_TCINDEX] = { .get = meta_int_tcindex }, +#ifdef CONFIG_NET_CLS_ACT + [TCF_META_ID_TCVERDICT] = { .get = meta_int_tcverd }, + [TCF_META_ID_TCCLASSID] = { .get = meta_int_tcclassid }, +#endif +#ifdef CONFIG_NET_CLS_ROUTE + [TCF_META_ID_RTCLASSID] = { .get = meta_int_rtclassid }, +#endif + [TCF_META_ID_RTIIF] = { .get = meta_int_rtiif } + } +}; + +static inline struct meta_ops * meta_ops(struct meta_value *v) +{ + return &__meta_ops[meta_type(v)][meta_id(v)]; +} + +static int meta_var_compare(struct meta_obj *a, struct meta_obj *b) +{ + int r = a->len - b->len; + + if (r == 0) + r = memcmp((void *) a->value, (void *) b->value, a->len); + + return r; +} + +static int meta_var_change(struct meta_value *dst, struct rtattr *rta) +{ + int len = RTA_PAYLOAD(rta); + + dst->val = (unsigned long) kmalloc(len, GFP_KERNEL); + if (dst->val == 0UL) + return -ENOMEM; + memcpy((void *) dst->val, RTA_DATA(rta), len); + dst->len = len; + return 0; +} + +static void meta_var_destroy(struct meta_value *v) +{ + kfree((void *) v->val); +} + +static void meta_var_apply_extras(struct meta_value *v, + struct meta_obj *dst) +{ + int shift = v->hdr.shift; + + if (shift && shift < dst->len) + dst->len -= shift; +} + +static int meta_int_compare(struct meta_obj *a, struct meta_obj *b) +{ + /* Let gcc optimize it, the unlikely is not really based on + * some numbers but jump free code for missmatches seems + * more logical. + */ + if (unlikely(a == b)) + return 0; + else if (a < b) + return -1; + else + return 1; +} + +static int meta_int_change(struct meta_value *dst, struct rtattr *rta) +{ + if (RTA_PAYLOAD(rta) >= sizeof(unsigned long)) { + dst->val = *(unsigned long *) RTA_DATA(rta); + dst->len = sizeof(unsigned long); + } else if (RTA_PAYLOAD(rta) == sizeof(u32)) { + dst->val = *(u32 *) RTA_DATA(rta); + dst->len = sizeof(u32); + } else + return -EINVAL; + + return 0; +} + +static void meta_int_apply_extras(struct meta_value *v, + struct meta_obj *dst) +{ + if (v->hdr.shift) + dst->value >>= v->hdr.shift; + + if (v->val) + dst->value &= v->val; +} + +struct meta_type_ops +{ + void (*destroy)(struct meta_value *); + int (*compare)(struct meta_obj *, struct meta_obj *); + int (*change)(struct meta_value *, struct rtattr *); + void (*apply_extras)(struct meta_value *, struct meta_obj *); +}; + +static struct meta_type_ops __meta_type_ops[TCF_META_TYPE_MAX+1] = { + [TCF_META_TYPE_VAR] = { + .destroy = meta_var_destroy, + .compare = meta_var_compare, + .change = meta_var_change, + .apply_extras = meta_var_apply_extras + }, + [TCF_META_TYPE_INT] = { + .compare = meta_int_compare, + .change = meta_int_change, + .apply_extras = meta_int_apply_extras + } +}; + +static inline struct meta_type_ops * meta_type_ops(struct meta_value *v) +{ + return &__meta_type_ops[meta_type(v)]; +} + +static inline int meta_get(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + int err; + + if (meta_id(v) == TCF_META_ID_VALUE) { + dst->value = v->val; + dst->len = v->len; + return 0; + } + + err = meta_ops(v)->get(skb, info, v, dst); + if (err < 0) + return err; + + if (meta_type_ops(v)->apply_extras) + meta_type_ops(v)->apply_extras(v, dst); + + return 0; +} + +static int em_meta_match(struct sk_buff *skb, struct tcf_ematch *m, + struct tcf_pkt_info *info) +{ + int r; + struct meta_match *meta = (struct meta_match *) m->data; + struct meta_obj l_value, r_value; + + if (meta_get(skb, info, &meta->lvalue, &l_value) < 0 || + meta_get(skb, info, &meta->rvalue, &r_value) < 0) + return 0; + + r = meta_type_ops(&meta->lvalue)->compare(&l_value, &r_value); + + switch (meta->lvalue.hdr.op) { + case TCF_EM_OPND_EQ: + return !r; + case TCF_EM_OPND_LT: + return r < 0; + case TCF_EM_OPND_GT: + return r > 0; + } + + return 0; +} + +static inline void meta_delete(struct meta_match *meta) +{ + struct meta_type_ops *ops = meta_type_ops(&meta->lvalue); + + if (ops && ops->destroy) { + ops->destroy(&meta->lvalue); + ops->destroy(&meta->rvalue); + } + + kfree(meta); +} + +static inline int meta_change_data(struct meta_value *dst, struct rtattr *rta) +{ + if (rta) { + if (RTA_PAYLOAD(rta) == 0) + return -EINVAL; + + return meta_type_ops(dst)->change(dst, rta); + } + + return 0; +} + +static int em_meta_change(struct tcf_proto *tp, void *data, int len, + struct tcf_ematch *m) +{ + int err = -EINVAL; + struct rtattr *tb[TCA_EM_META_MAX]; + struct tcf_meta_hdr *hdr; + struct meta_match *meta = NULL; + + if (rtattr_parse(tb, TCA_EM_META_MAX, data, len) < 0) + goto errout; + + if (tb[TCA_EM_META_HDR-1] == NULL || + RTA_PAYLOAD(tb[TCA_EM_META_HDR-1]) < sizeof(*hdr)) + goto errout; + hdr = RTA_DATA(tb[TCA_EM_META_HDR-1]); + + if (TCF_META_TYPE(hdr->left.kind) != TCF_META_TYPE(hdr->right.kind) || + TCF_META_TYPE(hdr->left.kind) > TCF_META_TYPE_MAX || + TCF_META_ID(hdr->left.kind) > TCF_META_ID_MAX || + TCF_META_ID(hdr->right.kind) > TCF_META_ID_MAX) + goto errout; + + meta = kmalloc(sizeof(*meta), GFP_KERNEL); + if (meta == NULL) + goto errout; + memset(meta, 0, sizeof(*meta)); + + memcpy(&meta->lvalue.hdr, &hdr->left, sizeof(hdr->left)); + memcpy(&meta->rvalue.hdr, &hdr->right, sizeof(hdr->right)); + + if (meta_ops(&meta->lvalue)->get == NULL || + meta_ops(&meta->rvalue)->get == NULL) { + err = -EOPNOTSUPP; + goto errout; + } + + if (meta_change_data(&meta->lvalue, tb[TCA_EM_META_LVALUE-1]) < 0 || + meta_change_data(&meta->rvalue, tb[TCA_EM_META_RVALUE-1]) < 0) + goto errout; + + m->datalen = sizeof(*meta); + m->data = (unsigned long) meta; + + err = 0; +errout: + if (err && meta) + meta_delete(meta); + return err; +} + +static void em_meta_destroy(struct tcf_proto *tp, struct tcf_ematch *m) +{ + meta_delete((struct meta_match *) m->data); +} + +static struct tcf_ematch_ops em_meta_ops = { + .kind = TCF_EM_META, + .change = em_meta_change, + .match = em_meta_match, + .destroy = em_meta_destroy, + .owner = THIS_MODULE, + .link = LIST_HEAD_INIT(em_meta_ops.link) +}; + +static int __init init_em_meta(void) +{ + return tcf_em_register(&em_meta_ops); +} + +static void __exit exit_em_meta(void) +{ + tcf_em_unregister(&em_meta_ops); +} + +MODULE_LICENSE("GPL"); + +module_init(init_em_meta); +module_exit(exit_em_meta); + From ebs@ebshome.net Fri Jan 14 07:25:24 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 07:25:28 -0800 (PST) Received: from gate.ebshome.net (gate.ebshome.net [64.81.67.12]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0EFPNQD003592 for ; Fri, 14 Jan 2005 07:25:24 -0800 Received: (qmail 32015 invoked by uid 1000); 14 Jan 2005 07:25:18 -0800 Date: Fri, 14 Jan 2005 07:25:18 -0800 From: Eugene Surovegin To: J?rn Engel Cc: Andy Fleming , Kumar Gala , Netdev , Embedded PPC Linux list Subject: Re: [RFC] Patch to Abstract Ethernet PHY support (using driver model) Message-ID: <20050114152518.GB23768@gate.ebshome.net> Mail-Followup-To: J?rn Engel , Andy Fleming , Kumar Gala , Netdev , Embedded PPC Linux list References: <20050106070245.GA6539@gate.ebshome.net> <61A37C72-659C-11D9-8D70-000393C30512@freescale.com> <20050113212152.GA16041@gate.ebshome.net> <20050113215808.GA15124@wohnheim.fh-wedel.de> <20050114010016.GA16635@gate.ebshome.net> <20050114145518.GA21418@wohnheim.fh-wedel.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050114145518.GA21418@wohnheim.fh-wedel.de> X-ICQ-UIN: 1193073 X-Operating-System: Linux i686 X-PGP-Key: http://www.ebshome.net/pubkey.asc User-Agent: Mutt/1.5.5.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 241 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ebs@ebshome.net Precedence: bulk X-list: netdev On Fri, Jan 14, 2005 at 03:55:18PM +0100, J?rn Engel wrote: > Wrt. the proposed PHY lib, I agree. Didn't even bother to look at the > code, it's mere size said enough. > > But an abstraction different from drivers/net/mii.c is needed to > handle the 5325 chip. Or, you could have the special cases all over > in your code, but that's a) ugly and b) more code. I used to have > such a mess and after doing the proper abstraction, it line count went > down. Well, I still fail to see what is so _special_ about this chip that it needs "proper abstraction". Could you elaborate, please? The way I handled this in my drivers was clean and simple - "there-is-no-PHY". And this wasn't in any case chip-specific and was set up through OCP in board support code. So I'm kinda puzzled what "ugliness and more code" you are talking about. We can also make a fake PHY which will always indicate link, will have fixed speed/duplex capabilities and will not support autoneg. If you think this is more elegant, OK, I might even agree with you :). Please, note that wrt current discussion we are interested only in CPU port, not other 5 ports which aren't connected to the CPU at all. This is completely different stuff and yes, if we want to expose them in some way we need another abstraction. But abstraction of switch chips is a big and complex thing - they are very different, and frankly this one you mentioned is quite "feature-challenged" and will not make a good "model" chip IMHO :). -- Eugene From Robert.Olsson@data.slu.se Fri Jan 14 07:44:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 07:44:23 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0EFiILn005043 for ; Fri, 14 Jan 2005 07:44:19 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0EFiF7Q019761; Fri, 14 Jan 2005 16:44:15 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 15013EC1A0; Fri, 14 Jan 2005 16:44:15 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16871.59599.43835.954744@robur.slu.se> Date: Fri, 14 Jan 2005 16:44:15 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501131627.20360.jeremy.guthrie@berbee.com> References: <200501131328.34449.jeremy.guthrie@berbee.com> <16870.58414.767012.96364@robur.slu.se> <200501131627.20360.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 242 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > > IN:Hits are cache hits yes? Tot, are the total number of flows created since > we last looked at the total flow count, correct? Thats correct. > What would cause a packet to drop in the network stack and thus showup in > /proc/net/softnet_stat? Only netif_rx (non-NAPI) driver drops in the backlog. NAPI drivers drops early in device. > Performance has picked up. I am not dropping packets anymore except during > GC. I upped my interval from 600 seconds to 1800 seconds. Yes and as far as I see you have CPU left the as RX interrupts on eth3 indicates (if the patch is applied) but also the low numbers of time squeeze in sofnet_stat --ro From joern@wohnheim.fh-wedel.de Fri Jan 14 07:49:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 07:49:59 -0800 (PST) Received: from moskovskaya.fh-wedel.de (mail.fh-wedel.de [213.39.232.198]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0EFnsYR005884 for ; Fri, 14 Jan 2005 07:49:55 -0800 Received: from wohnheim.fh-wedel.de ([213.39.233.138]:34351) by moskovskaya.fh-wedel.de with esmtp (Exim 4.34) id 1CpThs-0003b2-C4; Fri, 14 Jan 2005 16:49:48 +0100 Received: from joern by wohnheim.fh-wedel.de with local (Exim 3.35 #1 (Debian)) id 1CpThv-000600-00; Fri, 14 Jan 2005 16:49:51 +0100 Date: Fri, 14 Jan 2005 16:49:51 +0100 From: =?iso-8859-1?Q?J=F6rn?= Engel To: Andy Fleming , Kumar Gala , Netdev , Embedded PPC Linux list Subject: Re: [RFC] Patch to Abstract Ethernet PHY support (using driver model) Message-ID: <20050114154951.GC21418@wohnheim.fh-wedel.de> References: <20050106070245.GA6539@gate.ebshome.net> <61A37C72-659C-11D9-8D70-000393C30512@freescale.com> <20050113212152.GA16041@gate.ebshome.net> <20050113215808.GA15124@wohnheim.fh-wedel.de> <20050114010016.GA16635@gate.ebshome.net> <20050114145518.GA21418@wohnheim.fh-wedel.de> <20050114152518.GB23768@gate.ebshome.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20050114152518.GB23768@gate.ebshome.net> User-Agent: Mutt/1.3.28i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 243 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: joern@wohnheim.fh-wedel.de Precedence: bulk X-list: netdev On Fri, 14 January 2005 07:25:18 -0800, Eugene Surovegin wrote: > On Fri, Jan 14, 2005 at 03:55:18PM +0100, J?rn Engel wrote: > > Wrt. the proposed PHY lib, I agree. Didn't even bother to look at the > > code, it's mere size said enough. > > > > But an abstraction different from drivers/net/mii.c is needed to > > handle the 5325 chip. Or, you could have the special cases all over > > in your code, but that's a) ugly and b) more code. I used to have > > such a mess and after doing the proper abstraction, it line count went > > down. > > Well, I still fail to see what is so _special_ about this chip that it > needs "proper abstraction". Could you elaborate, please? > > The way I handled this in my drivers was clean and simple - > "there-is-no-PHY". And this wasn't in any case chip-specific and was > set up through OCP in board support code. So I'm kinda puzzled what > "ugliness and more code" you are talking about. > > We can also make a fake PHY which will always indicate link, will have > fixed speed/duplex capabilities and will not support autoneg. If you > think this is more elegant, OK, I might even agree with you :). Exactly. You need link status, speed and duplex status at the least. Put query functions for those three into a struct phy_ops or whatever it may be called and you're done. Depending on your hardware, you may also need something more complicated for various fixups, etc. But it's mostly those three functions. > Please, note that wrt current discussion we are interested only in CPU > port, not other 5 ports which aren't connected to the CPU at all. This > is completely different stuff and yes, if we want to expose them in > some way we need another abstraction. But abstraction of switch chips > is a big and complex thing - they are very different, and frankly this > one you mentioned is quite "feature-challenged" and will not make > a good "model" chip IMHO :). Well, it's one of the few I've had to worry about so far. I'm a big non-believer in abstractions I just don't need yet. The one outlined above I already needed. Jörn -- To announce that there must be no criticism of the President, or that we are to stand by the President, right or wrong, is not only unpatriotic and servile, but is morally treasonable to the American public. -- Theodore Roosevelt, Kansas City Star, 1918 From Robert.Olsson@data.slu.se Fri Jan 14 08:05:12 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 08:05:16 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0EG5BrS007276 for ; Fri, 14 Jan 2005 08:05:12 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0EG572T023635; Fri, 14 Jan 2005 17:05:07 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 1171DEC1A0; Fri, 14 Jan 2005 17:05:05 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16871.60849.905998.527106@robur.slu.se> Date: Fri, 14 Jan 2005 17:05:05 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501140859.42018.jeremy.guthrie@berbee.com> References: <200501131328.34449.jeremy.guthrie@berbee.com> <16870.58414.767012.96364@robur.slu.se> <200501140859.42018.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 244 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > I ran a script overnight using the modified driver you had given me Robert. > it is interesting that there is almost always errors in the interface even > though we aren't getting dst-cache errors and running ~ 40% free CPU now. I > am going to switch over to Jesse's driver to see if his instrumentation helps > nail down where the problem is. > rx_packets: 2722676103 > tx_packets: 5 > rx_bytes: 1171335471 > tx_bytes: 398 > rx_errors: 8558366 > tx_errors: 0 > rx_dropped: 1951692 It might come from be periodic work from GC process correlate drops w. rtatat. I think the GC process can be made more smooth but studies and experimentation is probably needed as GC process is quite complex. Maybe some looked into this already? Also you reported less drops when you increased the size of the RX ring and I see higher system performance with smaller RX rings. Both statements may actually be true. Big rings size may buffer during periodic work as GC. Also I have an experimental patch so you route without the route hash as a comparison. You have to be brave... BTW we had this thread going for week, --ro From bunk@stusta.de Fri Jan 14 09:35:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 09:35:54 -0800 (PST) Received: from mailout.stusta.mhn.de (mailout.stusta.mhn.de [141.84.69.5]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0EHZlxd014650 for ; Fri, 14 Jan 2005 09:35:48 -0800 Received: (qmail 6537 invoked from network); 14 Jan 2005 17:35:39 -0000 Received: from r063144.stusta.swh.mhn.de (10.150.63.144) by mailhub.stusta.mhn.de with SMTP; 14 Jan 2005 17:35:39 -0000 Received: by r063144.stusta.swh.mhn.de (Postfix, from userid 1000) id 6BE49BC0F9; Fri, 14 Jan 2005 18:35:38 +0100 (CET) Date: Fri, 14 Jan 2005 18:35:38 +0100 From: Adrian Bunk To: Andrew Morton , Rusty Russell Cc: linux-kernel@vger.kernel.org, coreteam@netfilter.org, netdev@oss.sgi.com Subject: [patch] 2.6.11-rc1-mm1: ip_tables.c: ipt_find_target must be EXPORT_SYMBOL'ed Message-ID: <20050114173538.GB4274@stusta.de> References: <20050114002352.5a038710.akpm@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050114002352.5a038710.akpm@osdl.org> User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 245 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bunk@stusta.de Precedence: bulk X-list: netdev On Fri, Jan 14, 2005 at 12:23:52AM -0800, Andrew Morton wrote: >... > All 434 patches: >... > restore-net-sched-iptc-after-iptables-kmod-cleanup.patch > Restore net/sched/ipt.c After iptables Kmod Cleanup >... This causes the following error with CONFIG_NET_ACT_IPT=m: <-- snip --> if [ -r System.map ]; then /sbin/depmod -ae -F System.map 2.6.11-rc1-mm1; fi WARNING: /lib/modules/2.6.11-rc1-mm1/kernel/net/sched/ipt.ko needs unknown symbol ipt_find_target <-- snip --> The fix is simple: Signed-off-by: Adrian Bunk --- linux-2.6.11-rc1-mm1-modular/net/ipv4/netfilter/ip_tables.c.old 2005-01-14 18:03:18.000000000 +0100 +++ linux-2.6.11-rc1-mm1-modular/net/ipv4/netfilter/ip_tables.c 2005-01-14 18:04:17.000000000 +0100 @@ -488,6 +488,7 @@ return NULL; return target; } +EXPORT_SYMBOL(ipt_find_target); static int match_revfn(const char *name, u8 revision, int *bestp) { From kaber@trash.net Fri Jan 14 09:43:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 09:43:51 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0EHhjsr015386 for ; Fri, 14 Jan 2005 09:43:45 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CpVTR-00011h-0V; Fri, 14 Jan 2005 18:43:01 +0100 Message-ID: <41E804A4.9040003@trash.net> Date: Fri, 14 Jan 2005 18:43:00 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: Adrian Bunk CC: Andrew Morton , Rusty Russell , linux-kernel@vger.kernel.org, coreteam@netfilter.org, netdev@oss.sgi.com Subject: Re: [patch] 2.6.11-rc1-mm1: ip_tables.c: ipt_find_target must be EXPORT_SYMBOL'ed References: <20050114002352.5a038710.akpm@osdl.org> <20050114173538.GB4274@stusta.de> In-Reply-To: <20050114173538.GB4274@stusta.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 246 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Adrian Bunk wrote: >On Fri, Jan 14, 2005 at 12:23:52AM -0800, Andrew Morton wrote: > >>... >>All 434 patches: >>... >>restore-net-sched-iptc-after-iptables-kmod-cleanup.patch >> Restore net/sched/ipt.c After iptables Kmod Cleanup >>... >> > >This causes the following error with CONFIG_NET_ACT_IPT=m: > ><-- snip --> > >if [ -r System.map ]; then /sbin/depmod -ae -F System.map 2.6.11-rc1-mm1; fi >WARNING: /lib/modules/2.6.11-rc1-mm1/kernel/net/sched/ipt.ko needs unknown symbol ipt_find_target > ><-- snip --> > The fix is already in Dave's tree. Regards Patrick From jeremy.guthrie@berbee.com Fri Jan 14 11:00:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 11:01:01 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0EJ0qWw019272 for ; Fri, 14 Jan 2005 11:00:52 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Fri, 14 Jan 2005 13:00:44 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Fri, 14 Jan 2005 13:00:41 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson References: <200501140859.42018.jeremy.guthrie@berbee.com> <16871.60849.905998.527106@robur.slu.se> In-Reply-To: <16871.60849.905998.527106@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart73718073.tc2AOGqPoy"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501141300.44347.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 14 Jan 2005 19:00:45.0059 (UTC) FILETIME=[59F06D30:01C4FA6B] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 247 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart73718073.tc2AOGqPoy Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline These stats are from the driver Jesse instrumented. ethtool -S eth3 | egrep -v ": 0" NIC statistics: rx_packets: 1130958533 tx_packets: 5 rx_bytes: 2373643298 tx_bytes: 398 rx_errors: 4388190 rx_dropped: 1486253 rx_fifo_errors: 2901937 rx_missed_errors: 2901937 rx_long_byte_count: 582194228258 rx_csum_offload_good: 1040376597 int_tx_desc: 4 int_tx_queueempty: 5 int_link_state: 1 int_rx_desc_min_thresh: 20704 int_rx_fifo_ovr: 1208 int_rx_timer: 331925913 int_rxcfg: 1 rx_csum_offload_errors: 325045 I am seeing more times w/ his driver where I run at zero errors. Of the la= st=20 877 samples since I switched drivers, I see 231 samples w/ zero errors. On Friday 14 January 2005 10:05 am, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > I ran a script overnight using the modified driver you had given me > > Robert. it is interesting that there is almost always errors in the > > interface even though we aren't getting dst-cache errors and running ~ > > 40% free CPU now. I am going to switch over to Jesse's driver to see = if > > his instrumentation helps nail down where the problem is. > > > > > > rx_packets: 2722676103 > > tx_packets: 5 > > rx_bytes: 1171335471 > > tx_bytes: 398 > > rx_errors: 8558366 > > tx_errors: 0 > > rx_dropped: 1951692 > > It might come from be periodic work from GC process correlate drops w. > rtatat. > > I think the GC process can be made more smooth but studies and > experimentation is probably needed as GC process is quite complex. Maybe > some looked into this already? > Also you reported less drops when you increased the size of the RX ring > and I see higher system performance with smaller RX rings. Both statements > may actually be true. Big rings size may buffer during periodic work as G= C. I am running w/ 2048 input buffers. I am going to increase to 10K and try= =20 again. > Also I have an experimental patch so you route without the route hash as= a > comparison. You have to be brave... I am about 300 miles from the machine this week and next week though I migh= t=20 be able to try it this weekend while I am home. > BTW we had this thread going for week, Pardon me for being a bit naive but I am not understanding this last commen= t. =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart73718073.tc2AOGqPoy Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB6BbcqtjaBHGZBeURAoZDAJ9ZRJLyxJ66eMZUD+zVqOlSN58gYACfZ5oC AE68yuBonH+VecKuVm0H56s= =gsqU -----END PGP SIGNATURE----- --nextPart73718073.tc2AOGqPoy-- From davem@davemloft.net Fri Jan 14 11:11:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 11:11:42 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0EJBZBh020235 for ; Fri, 14 Jan 2005 11:11:36 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CpWjg-0005Je-00; Fri, 14 Jan 2005 11:03:52 -0800 Date: Fri, 14 Jan 2005 11:03:52 -0800 From: "David S. Miller" To: Herbert Xu Cc: anton@samba.org, netdev@oss.sgi.com Subject: Re: [DEBUG]: sk_forward_alloc assertion failures Message-Id: <20050114110352.23c94ab9.davem@davemloft.net> In-Reply-To: <20050114120322.GA28449@gondor.apana.org.au> References: <20050113171234.3fde0925.davem@davemloft.net> <20050114012504.GF6309@krispykreme.ozlabs.ibm.com> <20050113201914.46b7c4a2.davem@davemloft.net> <20050114111648.GA27964@gondor.apana.org.au> <20050114120322.GA28449@gondor.apana.org.au> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 248 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Fri, 14 Jan 2005 23:03:22 +1100 Herbert Xu wrote: > What we need to do is to remember mss_now across sendpage calls. > Luckily the value of truesize lets us deduce the value of mss_now. > To complicate the picture the mss might have been reduced between > sendpages calls. So we take the minimum of the remembered mss > and the current mss. > > Any brave souls out there to try this? Herbert, this patch doesn't fix the bug. We still have to do the adjustments gradually just like sendmsg(). That's the whole problem. If sendmsg() creates the SKB, then sendpages() adds paged data onto the end, we don't make skb->truesize big enough. From jeremy.guthrie@berbee.com Fri Jan 14 11:26:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 11:26:43 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0EJQZx2021227 for ; Fri, 14 Jan 2005 11:26:36 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Fri, 14 Jan 2005 13:26:30 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Fri, 14 Jan 2005 13:26:26 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson References: <16871.60849.905998.527106@robur.slu.se> <200501141300.44347.jeremy.guthrie@berbee.com> In-Reply-To: <200501141300.44347.jeremy.guthrie@berbee.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1722434.I5vvOfWpoh"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501141326.29575.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 14 Jan 2005 19:26:30.0372 (UTC) FILETIME=[F3047A40:01C4FA6E] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 249 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart1722434.I5vvOfWpoh Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I actually upped the buffer count to 8192 buffers instead of 10k. Of the 7= 4=20 samples I have thus far, 57 have been clean of errors. Most of the sample= =20 errors appear to be shortly after the cache flush. I am going to let the buffers run for a bit longer then I have to go. I ha= ve=20 a five hour drive ahead of me. =20 On Friday 14 January 2005 01:00 pm, Jeremy M. Guthrie wrote: > These stats are from the driver Jesse instrumented. > ethtool -S eth3 | egrep -v ": 0" > NIC statistics: > rx_packets: 1130958533 > tx_packets: 5 > rx_bytes: 2373643298 > tx_bytes: 398 > rx_errors: 4388190 > rx_dropped: 1486253 > rx_fifo_errors: 2901937 > rx_missed_errors: 2901937 > rx_long_byte_count: 582194228258 > rx_csum_offload_good: 1040376597 > int_tx_desc: 4 > int_tx_queueempty: 5 > int_link_state: 1 > int_rx_desc_min_thresh: 20704 > int_rx_fifo_ovr: 1208 > int_rx_timer: 331925913 > int_rxcfg: 1 > rx_csum_offload_errors: 325045 > > I am seeing more times w/ his driver where I run at zero errors. Of the > last 877 samples since I switched drivers, I see 231 samples w/ zero > errors. > > On Friday 14 January 2005 10:05 am, Robert Olsson wrote: > > Jeremy M. Guthrie writes: > > > I ran a script overnight using the modified driver you had given me > > > Robert. it is interesting that there is almost always errors in the > > > interface even though we aren't getting dst-cache errors and running= ~ > > > 40% free CPU now. I am going to switch over to Jesse's driver to see > > > if his instrumentation helps nail down where the problem is. > > > > > > > > > rx_packets: 2722676103 > > > tx_packets: 5 > > > rx_bytes: 1171335471 > > > tx_bytes: 398 > > > rx_errors: 8558366 > > > tx_errors: 0 > > > rx_dropped: 1951692 > > > > It might come from be periodic work from GC process correlate drops w. > > rtatat. > > > > I think the GC process can be made more smooth but studies and > > experimentation is probably needed as GC process is quite complex. Maybe > > some looked into this already? > > Also you reported less drops when you increased the size of the RX ring > > and I see higher system performance with smaller RX rings. Both > > statements may actually be true. Big rings size may buffer during > > periodic work as GC. > > I am running w/ 2048 input buffers. I am going to increase to 10K and try > again. > > > Also I have an experimental patch so you route without the route hash = as > > a comparison. You have to be brave... > > I am about 300 miles from the machine this week and next week though I > might be able to try it this weekend while I am home. > > > BTW we had this thread going for week, > > Pardon me for being a bit naive but I am not understanding this last > comment. =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart1722434.I5vvOfWpoh Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB6BzlqtjaBHGZBeURAoSjAJ4/VOZwu9cpJ3P8bjfgWvl4hRWhFwCfY7Cw 0w3Q/VDpYzMapAZIegRJoGQ= =zpTx -----END PGP SIGNATURE----- --nextPart1722434.I5vvOfWpoh-- From dsp@llnl.gov Fri Jan 14 11:29:30 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 11:29:36 -0800 (PST) Received: from smtp-2.llnl.gov (smtp-2.llnl.gov [128.115.250.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0EJTUd8021783 for ; Fri, 14 Jan 2005 11:29:30 -0800 Received: from hypatia.llnl.gov (localhost [127.0.0.1]) by smtp-2.llnl.gov (8.12.3p2-20030917/8.12.3/LLNL evision: 1.15 $) with ESMTP id j0EJTMoB015805; Fri, 14 Jan 2005 11:29:22 -0800 (PST) Received: from hypatia.llnl.gov (localhost.localdomain [127.0.0.1]) by hypatia.llnl.gov (8.12.11/8.12.10) with ESMTP id j0EJTMgT006718; Fri, 14 Jan 2005 11:29:22 -0800 Received: from localhost (localhost [[UNIX: localhost]]) by hypatia.llnl.gov (8.12.11/8.12.11/Submit) id j0EJTLso006716; Fri, 14 Jan 2005 11:29:21 -0800 From: Dave Peterson To: robert.olsson@its.uu.se, netdev@oss.sgi.com Subject: possible bug in net/core/pktgen.c (2.6.10 kernel) Date: Fri, 14 Jan 2005 11:29:21 -0800 User-Agent: KMail/1.5.3 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501141129.21461.dsp@llnl.gov> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 250 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dsp@llnl.gov Precedence: bulk X-list: netdev Hi, I found a piece of code that looks problematic in the 2.6.10 kernel. The following code appears starting on line 746 in function inject() of net/core/pktgen.c: if (netif_queue_stopped(odev) || need_resched()) { u32 idle_start, idle; idle_start = cycles(); do { if (signal_pending(current)) { info->do_run_run = 0; break; } if (!netif_running(odev)) { info->do_run_run = 0; break; } if (need_resched()) schedule(); else do_softirq(); } while (netif_queue_stopped(odev)); idle = cycles() - idle_start; info->idle_acc += idle; } Notice the call to do_softirq() above. At this point it appears that preemption is enabled. However, do_softirq() is written under the assumption that it will be called with preemption disabled. It looks like the code was originally written for the 2.4 kernel and this was missed when kernel preemption was added in 2.5. Is this in fact a bug or am I missing something? I haven't attempted to make a patch that fixes this because I'm not too familiar with the networking code and I'd rather let someone else determine what is the best way to fix it. Dave Peterson dsp@llnl.gov From herbert@gondor.apana.org.au Fri Jan 14 12:36:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 12:36:08 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0EKZxt8028292 for ; Fri, 14 Jan 2005 12:36:00 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CpYAO-0008P6-00; Sat, 15 Jan 2005 07:35:32 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CpY9k-0000L7-00; Sat, 15 Jan 2005 07:34:52 +1100 Date: Sat, 15 Jan 2005 07:34:52 +1100 To: "David S. Miller" Cc: anton@samba.org, netdev@oss.sgi.com Subject: Re: [DEBUG]: sk_forward_alloc assertion failures Message-ID: <20050114203452.GA1277@gondor.apana.org.au> References: <20050113171234.3fde0925.davem@davemloft.net> <20050114012504.GF6309@krispykreme.ozlabs.ibm.com> <20050113201914.46b7c4a2.davem@davemloft.net> <20050114111648.GA27964@gondor.apana.org.au> <20050114120322.GA28449@gondor.apana.org.au> <20050114110352.23c94ab9.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050114110352.23c94ab9.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 251 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev On Fri, Jan 14, 2005 at 11:03:52AM -0800, David S. Miller wrote: > > Herbert, this patch doesn't fix the bug. We still have > to do the adjustments gradually just like sendmsg(). > That's the whole problem. > > If sendmsg() creates the SKB, then sendpages() adds paged > data onto the end, we don't make skb->truesize big enough. My reasoning is as follows: The size of the skb is bounded by the MSS. Therefore it can never grow beyond that. So if we allocated that much memory then we can tack bits on as long as we don't exceed the original MSS that was used. The problem before was that the MSS could've changed between sendpages calls. If it increased then we may exceed the amount of memory allocated originally. My idea is to remember the original MSS so that we never exceed it. Did I missing something? Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From kyoungso@cs.princeton.edu Fri Jan 14 12:51:12 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 12:51:17 -0800 (PST) Received: from Princeton.EDU (root@postoffice02.Princeton.EDU [128.112.130.38]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0EKpBvi029303 for ; Fri, 14 Jan 2005 12:51:12 -0800 Received: from smtpserver1.Princeton.EDU (smtpserver1.Princeton.EDU [128.112.129.65]) by Princeton.EDU (8.12.9/8.12.9) with ESMTP id j0EKp9ou002771 for ; Fri, 14 Jan 2005 15:51:09 -0500 (EST) Received: from cs.princeton.edu (targe.CS.Princeton.EDU [128.112.139.194]) (authenticated bits=0) by smtpserver1.Princeton.EDU (8.12.9/8.12.9) with ESMTP id j0EKp8XM003570 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT) for ; Fri, 14 Jan 2005 15:51:09 -0500 (EST) Message-ID: <41E830BC.7000709@cs.princeton.edu> Date: Fri, 14 Jan 2005 15:51:08 -0500 From: KyoungSoo Park User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: is there any plan to support BSD accept filter? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 252 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kyoungso@cs.princeton.edu Precedence: bulk X-list: netdev Hi, I just want to ask a quick question. Is there any plan to support FreeBSD-like accept filter (http://www.freebsd.org/cgi/man.cgi?query=accf_http) for linux? If not, is there any glaring reason why? Thanks, KyoungSoo From afleming@freescale.com Fri Jan 14 13:00:30 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 13:00:34 -0800 (PST) Received: from de01egw02.freescale.net (de01egw02.freescale.net [192.88.165.103]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0EL0Ucw030054 for ; Fri, 14 Jan 2005 13:00:30 -0800 Received: from de01smr01.am.mot.com (de01smr01.freescale.net [10.208.0.31]) by de01egw02.freescale.net (8.12.11/de01egw02) with ESMTP id j0EL37sH007408; Fri, 14 Jan 2005 14:03:07 -0700 (MST) Received: from [10.82.17.240] ([10.82.17.240]) by de01smr01.am.mot.com (8.13.1/8.13.0) with ESMTP id j0EL5RYI014486; Fri, 14 Jan 2005 15:05:27 -0600 (CST) In-Reply-To: <20050114145518.GA21418@wohnheim.fh-wedel.de> References: <20050106070245.GA6539@gate.ebshome.net> <61A37C72-659C-11D9-8D70-000393C30512@freescale.com> <20050113212152.GA16041@gate.ebshome.net> <20050113215808.GA15124@wohnheim.fh-wedel.de> <20050114010016.GA16635@gate.ebshome.net> <20050114145518.GA21418@wohnheim.fh-wedel.de> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <4D217F72-666F-11D9-8D70-000393C30512@freescale.com> Content-Transfer-Encoding: 7bit Cc: Kumar Gala , Netdev , Embedded PPC Linux list From: Andy Fleming Subject: Re: [RFC] Patch to Abstract Ethernet PHY support (using driver model) Date: Fri, 14 Jan 2005 15:00:20 -0600 To: =?ISO-8859-1?Q?J=F6rn_Engel?= X-Mailer: Apple Mail (2.619) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 253 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: afleming@freescale.com Precedence: bulk X-list: netdev >> In fact, we use different switch chips connected to PPC4xx directly. >> In this situation, in my NAPI IBM EMAC driver I just have special >> "PHY-less" case which is trivial "fixed settings" one. And all this >> PHY lib is completely unneeded bloat. > > Wrt. the proposed PHY lib, I agree. Didn't even bother to look at the > code, it's mere size said enough. Hmm... Before I spend too much time revising based on previous comments ebs made, is there a general consensus that the code is much too large? I know there's a lot in there, but the goal is to simplify PHY management for all ethernet drivers, new and old, and thus reduce code size, overall. Is this code heading in the right direction? Does it do too much? Too little? Andy Fleming Open Source Team Freescale Semiconductor, Inc From herbert@gondor.apana.org.au Fri Jan 14 13:35:12 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 13:35:21 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ELZA8A031754 for ; Fri, 14 Jan 2005 13:35:11 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CpZ5o-0000Mq-00; Sat, 15 Jan 2005 08:34:52 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CpZ5N-0003EV-00; Sat, 15 Jan 2005 08:34:25 +1100 Date: Sat, 15 Jan 2005 08:34:25 +1100 To: "David S. Miller" Cc: Anton Blanchard , netdev@oss.sgi.com Subject: Re: [DEBUG]: sk_forward_alloc assertion failures Message-ID: <20050114213425.GA12410@gondor.apana.org.au> References: <20050113171234.3fde0925.davem@davemloft.net> <20050114012504.GF6309@krispykreme.ozlabs.ibm.com> <20050113201914.46b7c4a2.davem@davemloft.net> <20050114111648.GA27964@gondor.apana.org.au> <20050114120322.GA28449@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="IJpNTDwzlM2Ie8A6" Content-Disposition: inline In-Reply-To: <20050114120322.GA28449@gondor.apana.org.au> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 254 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev --IJpNTDwzlM2Ie8A6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Jan 14, 2005 at 11:03:22PM +1100, herbert wrote: > > To complicate the picture the mss might have been reduced between > sendpages calls. So we take the minimum of the remembered mss > and the current mss. With that the packet size might actually exceed the current mss. So we need to change the skb->len != skb_mss test to skb->len < skb_mss. -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --IJpNTDwzlM2Ie8A6 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== net/ipv4/tcp.c 1.88 vs edited ===== --- 1.88/net/ipv4/tcp.c 2005-01-07 10:13:39 +11:00 +++ edited/net/ipv4/tcp.c 2005-01-15 08:31:52 +11:00 @@ -654,23 +654,31 @@ while (psize > 0) { struct sk_buff *skb = sk->sk_write_queue.prev; + int skb_mss; struct page *page = pages[poffset / PAGE_SIZE]; int copy, i; int offset = poffset % PAGE_SIZE; int size = min_t(size_t, psize, PAGE_SIZE - offset); - if (!sk->sk_send_head || (copy = mss_now - skb->len) <= 0) { + if (!sk->sk_send_head) + goto new_segment; + + skb_mss = skb_netsize(skb) - skb_headroom(skb); + if (mss_now < skb_mss) + skb_mss = mss_now; + if ((copy = skb_mss - skb->len) <= 0) { new_segment: if (!sk_stream_memory_free(sk)) goto wait_for_sndbuf; - skb = sk_stream_alloc_pskb(sk, 0, tp->mss_cache, + skb = sk_stream_alloc_pskb(sk, 0, mss_now, sk->sk_allocation); if (!skb) goto wait_for_memory; skb_entail(sk, tp, skb); copy = mss_now; + skb_mss = mss_now; } if (copy > size) @@ -702,14 +710,14 @@ if (!(psize -= copy)) goto out; - if (skb->len != mss_now || (flags & MSG_OOB)) + if (skb->len < skb_mss || (flags & MSG_OOB)) continue; if (forced_push(tp)) { tcp_mark_push(tp, skb); - __tcp_push_pending_frames(sk, tp, mss_now, TCP_NAGLE_PUSH); + __tcp_push_pending_frames(sk, tp, skb_mss, TCP_NAGLE_PUSH); } else if (skb == sk->sk_send_head) - tcp_push_one(sk, mss_now); + tcp_push_one(sk, skb_mss); continue; wait_for_sndbuf: ===== include/linux/skbuff.h 1.58 vs edited ===== --- 1.58/include/linux/skbuff.h 2004-12-28 16:24:42 +11:00 +++ edited/include/linux/skbuff.h 2005-01-14 22:30:45 +11:00 @@ -1124,6 +1124,11 @@ return buffer; } +static inline int skb_netsize(const struct sk_buff *skb) +{ + return skb->truesize - sizeof(struct sk_buff); +} + extern void skb_init(void); extern void skb_add_mtu(int mtu); --IJpNTDwzlM2Ie8A6-- From davem@davemloft.net Fri Jan 14 13:35:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 13:35:41 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ELZbci031849 for ; Fri, 14 Jan 2005 13:35:37 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CpYz8-0005gO-00; Fri, 14 Jan 2005 13:27:58 -0800 Date: Fri, 14 Jan 2005 13:27:57 -0800 From: "David S. Miller" To: Herbert Xu Cc: anton@samba.org, netdev@oss.sgi.com Subject: Re: [DEBUG]: sk_forward_alloc assertion failures Message-Id: <20050114132757.4ca3153a.davem@davemloft.net> In-Reply-To: <20050114203452.GA1277@gondor.apana.org.au> References: <20050113171234.3fde0925.davem@davemloft.net> <20050114012504.GF6309@krispykreme.ozlabs.ibm.com> <20050113201914.46b7c4a2.davem@davemloft.net> <20050114111648.GA27964@gondor.apana.org.au> <20050114120322.GA28449@gondor.apana.org.au> <20050114110352.23c94ab9.davem@davemloft.net> <20050114203452.GA1277@gondor.apana.org.au> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 255 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Sat, 15 Jan 2005 07:34:52 +1100 Herbert Xu wrote: > My reasoning is as follows: > > The size of the skb is bounded by the MSS. Therefore it can > never grow beyond that. So if we allocated that much memory > then we can tack bits on as long as we don't exceed the original > MSS that was used. > > The problem before was that the MSS could've changed between > sendpages calls. If it increased then we may exceed the > amount of memory allocated originally. > > My idea is to remember the original MSS so that we never exceed > it. Did I missing something? You missed the whole problem. It has nothing to do with the MSS changing. The bug case is when _SEND_MSG_ creates the SKB, and a subsequent _SEND_PAGE_ call adds pages onto that SKB in the queue. Unlike _SEND_PAGE_, _SEND_MSG_ does not do the "allocate tp->mss_cache" thingy. Instead, it adjusts the queueing allocation values as it copies the data into the SKB. Therefore my change aims to make _SEND_PAGE_ use _SEND_MSG_'s accounting scheme (adjust as we actually add the data) so that it all works out. That fix is in Linus's tree at this point. From herbert@gondor.apana.org.au Fri Jan 14 13:38:59 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 13:39:03 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ELcwGq000355 for ; Fri, 14 Jan 2005 13:38:58 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CpZ9Z-0000Pn-00; Sat, 15 Jan 2005 08:38:45 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CpZ9J-0003Fe-00; Sat, 15 Jan 2005 08:38:29 +1100 Date: Sat, 15 Jan 2005 08:38:29 +1100 To: "David S. Miller" Cc: anton@samba.org, netdev@oss.sgi.com Subject: Re: [DEBUG]: sk_forward_alloc assertion failures Message-ID: <20050114213829.GA12454@gondor.apana.org.au> References: <20050113171234.3fde0925.davem@davemloft.net> <20050114012504.GF6309@krispykreme.ozlabs.ibm.com> <20050113201914.46b7c4a2.davem@davemloft.net> <20050114111648.GA27964@gondor.apana.org.au> <20050114120322.GA28449@gondor.apana.org.au> <20050114110352.23c94ab9.davem@davemloft.net> <20050114203452.GA1277@gondor.apana.org.au> <20050114132757.4ca3153a.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050114132757.4ca3153a.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 256 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev On Fri, Jan 14, 2005 at 01:27:57PM -0800, David S. Miller wrote: > > You missed the whole problem. > > It has nothing to do with the MSS changing. However if the MSS does change then it can cause the same symptoms. In fact the MSS can easily increase when TSO is enabled since it increases as the RCV window is opened up. > The bug case is when _SEND_MSG_ creates the SKB, and a subsequent > _SEND_PAGE_ call adds pages onto that SKB in the queue. > > Unlike _SEND_PAGE_, _SEND_MSG_ does not do the "allocate tp->mss_cache" > thingy. Instead, it adjusts the queueing allocation values as it copies > the data into the SKB. > > Therefore my change aims to make _SEND_PAGE_ use _SEND_MSG_'s accounting > scheme (adjust as we actually add the data) so that it all works out. I understand your point about sendmsg followed by sendpages. My patch addresses that as well by making sure that we don't tack on more bits than what's allowed by skb->truesize. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From davem@davemloft.net Fri Jan 14 13:43:39 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 13:43:43 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ELhdw2001003 for ; Fri, 14 Jan 2005 13:43:39 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CpZ75-0005iS-00; Fri, 14 Jan 2005 13:36:11 -0800 Date: Fri, 14 Jan 2005 13:36:11 -0800 From: "David S. Miller" To: Herbert Xu Cc: anton@samba.org, netdev@oss.sgi.com Subject: Re: [DEBUG]: sk_forward_alloc assertion failures Message-Id: <20050114133611.69ff0bb2.davem@davemloft.net> In-Reply-To: <20050114213829.GA12454@gondor.apana.org.au> References: <20050113171234.3fde0925.davem@davemloft.net> <20050114012504.GF6309@krispykreme.ozlabs.ibm.com> <20050113201914.46b7c4a2.davem@davemloft.net> <20050114111648.GA27964@gondor.apana.org.au> <20050114120322.GA28449@gondor.apana.org.au> <20050114110352.23c94ab9.davem@davemloft.net> <20050114203452.GA1277@gondor.apana.org.au> <20050114132757.4ca3153a.davem@davemloft.net> <20050114213829.GA12454@gondor.apana.org.au> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 257 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Sat, 15 Jan 2005 08:38:29 +1100 Herbert Xu wrote: > On Fri, Jan 14, 2005 at 01:27:57PM -0800, David S. Miller wrote: > > > > You missed the whole problem. > > > > It has nothing to do with the MSS changing. > > However if the MSS does change then it can cause the same symptoms. > In fact the MSS can easily increase when TSO is enabled since it > increases as the RCV window is opened up. MSS changes are handled _transparently_ if we do the adjustments as we actaully add data to the packet. We always account what is actually put into the packet in this way. That's why I made the fix the way that I did. From davem@davemloft.net Fri Jan 14 13:53:14 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 13:53:20 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ELrEZf001964 for ; Fri, 14 Jan 2005 13:53:14 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CpZGV-0005k5-00; Fri, 14 Jan 2005 13:45:55 -0800 Date: Fri, 14 Jan 2005 13:45:55 -0800 From: "David S. Miller" To: Arnaldo Carvalho de Melo Cc: netdev@oss.sgi.com Subject: Re: [PATCH] merge udp_opt with udp_sock Message-Id: <20050114134555.3c9624bc.davem@davemloft.net> In-Reply-To: <41E37765.4030105@conectiva.com.br> References: <41E37765.4030105@conectiva.com.br> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 258 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Tue, 11 Jan 2005 04:51:17 -0200 Arnaldo Carvalho de Melo wrote: > Please consider pulling from: > > bk://kernel.bkbits.net/acme/connection_sock-2.6 Looks good, pulled. Thanks Arnaldo. From davem@davemloft.net Fri Jan 14 13:54:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 13:54:09 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ELs3R7002250 for ; Fri, 14 Jan 2005 13:54:03 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CpZHG-0005kK-00; Fri, 14 Jan 2005 13:46:42 -0800 Date: Fri, 14 Jan 2005 13:46:42 -0800 From: "David S. Miller" To: Lennert Buytenhek Cc: benwa@club-internet.fr, netdev@oss.sgi.com Subject: Re: [PATCH] remove superfluous diverter printk'ing Message-Id: <20050114134642.4be4e2fc.davem@davemloft.net> In-Reply-To: <20050114124700.GA4079@xi.wantstofly.org> References: <20050114124700.GA4079@xi.wantstofly.org> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 259 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Fri, 14 Jan 2005 13:47:00 +0100 Lennert Buytenhek wrote: > You're not listed as diverter maintainer but I'm sending this via > you anyway. This patch removes some printk'ing from the diverter > driver (and cleans up the code a bit), because after a while it gets > really annoying to have log messages like this one for every single > tunnel you create or tear down. > > divert: not allocating divert_blk for non-ethernet device tunl0 > > Please consider sending upstream. Those diverter messages drive me crazy too, I think I'll add your patch Lennert. From herbert@gondor.apana.org.au Fri Jan 14 13:55:41 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 13:55:48 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ELtdhp002969 for ; Fri, 14 Jan 2005 13:55:40 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CpZPj-0000aF-00; Sat, 15 Jan 2005 08:55:27 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CpZPM-0003My-00; Sat, 15 Jan 2005 08:55:04 +1100 Date: Sat, 15 Jan 2005 08:55:04 +1100 To: "David S. Miller" Cc: anton@samba.org, netdev@oss.sgi.com Subject: Re: [DEBUG]: sk_forward_alloc assertion failures Message-ID: <20050114215504.GA12569@gondor.apana.org.au> References: <20050113171234.3fde0925.davem@davemloft.net> <20050114012504.GF6309@krispykreme.ozlabs.ibm.com> <20050113201914.46b7c4a2.davem@davemloft.net> <20050114111648.GA27964@gondor.apana.org.au> <20050114120322.GA28449@gondor.apana.org.au> <20050114110352.23c94ab9.davem@davemloft.net> <20050114203452.GA1277@gondor.apana.org.au> <20050114132757.4ca3153a.davem@davemloft.net> <20050114213829.GA12454@gondor.apana.org.au> <20050114133611.69ff0bb2.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050114133611.69ff0bb2.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 260 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev On Fri, Jan 14, 2005 at 01:36:11PM -0800, David S. Miller wrote: > > MSS changes are handled _transparently_ if we do the adjustments > as we actaully add data to the packet. We always account what is > actually put into the packet in this way. > > That's why I made the fix the way that I did. You're right. However, doing so requires us to check sk_forward_alloc every time around the loop. That is, you'll need to do the same check as is done in sk_stream_alloc_pskb and sk_stream_alloc_page. If we simply adjust sk_forward_alloc as you do now then it can easily go negative if we didn't have enough memory to start with. My point is that most of the time sendpages will produce a packet that is MSS-sized. Therefore we can avoid the duplicate work (if the connection is at full throttle then MSS ~~ 64K which is much bigger than the page size of 4K) by allocating MSS bytes up front in sk_forward_alloc. As long as we're careful about what we've allocated in the skb then everything will be alright. We're in trouble right now with mixed sendmsg/sendpages calls and changing MSSs only because we're not careful about keeping track of how much memory we've allocated at the start. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From davem@davemloft.net Fri Jan 14 14:03:34 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 14:03:40 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0EM3XKM003751 for ; Fri, 14 Jan 2005 14:03:34 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CpZQS-0005n3-00; Fri, 14 Jan 2005 13:56:12 -0800 Date: Fri, 14 Jan 2005 13:56:12 -0800 From: "David S. Miller" To: "chas williams - CONTRACTOR" Cc: netdev@oss.sgi.com Subject: Re: [RFC] locking changes for lec.c Message-Id: <20050114135612.0edc180d.davem@davemloft.net> In-Reply-To: <200501061717.j06HHJ5I000508@ginger.cmf.nrl.navy.mil> References: <200501061717.j06HHJ5I000508@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 261 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Thu, 06 Jan 2005 12:17:20 -0500 "chas williams - CONTRACTOR" wrote: > after looking at things recently its not clear to me that the combination > of lec_arp_lock and lec_arp_users was protecting things properly. > here is a small rewrite that eliminates lec_arp_users completely and > uses lec_arp_lock to protect the lists in lec_prev: lec_arp_tables, > lec_arp_empty_ones, et al. Can HW interrupt paths ever call into this ARP stuff? If not, probably should just use BH disabled locking instead of the heavy handed IRQ disabling locks. From shemminger@osdl.org Fri Jan 14 14:05:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 14:05:52 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0EM5lVr004303 for ; Fri, 14 Jan 2005 14:05:47 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0EM5cY04591; Fri, 14 Jan 2005 14:05:38 -0800 Date: Fri, 14 Jan 2005 14:05:40 -0800 From: Stephen Hemminger To: KyoungSoo Park Cc: netdev@oss.sgi.com Subject: Re: is there any plan to support BSD accept filter? Message-ID: <20050114140540.76146b29@dxpl.pdx.osdl.net> In-Reply-To: <41E830BC.7000709@cs.princeton.edu> References: <41E830BC.7000709@cs.princeton.edu> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 262 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev If you want to do these kind of stateful hacks, why not build a netfilter module to do it? -- Stephen Hemminger From acme@conectiva.com.br Fri Jan 14 14:09:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 14:09:26 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0EM9JVi004865 for ; Fri, 14 Jan 2005 14:09:20 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CpYsu-00082u-00; Fri, 14 Jan 2005 19:21:32 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 3EB9A1462D; Fri, 14 Jan 2005 20:09:16 -0200 (BRST) Message-ID: <41E84405.7070002@conectiva.com.br> Date: Fri, 14 Jan 2005 20:13:25 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" Cc: Networking Team Subject: [PATCH] merge raw4_opt with raw_sock X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------060703010009090906040604" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 263 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------060703010009090906040604 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David, Now the raw_sock one, available at: bk://kernel.bkbits.net/acme/connection_sock-2.6 Later today I'll reclone and redo the SCTP and IPv6 bits, then the connection_sock introduction. - Arnaldo --------------060703010009090906040604 Content-Type: text/plain; name="raw_sock.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="raw_sock.patch" You can import this changeset into BK by piping this whole message to: '| bk receive [path to repository]' or apply the patch as usual. =================================================================== ChangeSet@1.2280, 2005-01-14 02:39:01-02:00, acme@conectiva.com.br [RAW] merge raw_sock with raw_opt No need for two structs, follow the new inet_sock layout style. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller include/net/icmp.h | 15 +++++++-------- net/ipv4/raw.c | 11 ++++++----- 2 files changed, 13 insertions(+), 13 deletions(-) diff -Nru a/include/net/icmp.h b/include/net/icmp.h --- a/include/net/icmp.h 2005-01-14 19:59:34 -02:00 +++ b/include/net/icmp.h 2005-01-14 19:59:34 -02:00 @@ -46,16 +46,15 @@ /* Move into dst.h ? */ extern int xrlim_allow(struct dst_entry *dst, int timeout); -struct raw_opt { - struct icmp_filter filter; -}; - -/* WARNING: don't change the layout of the members in raw_sock! */ struct raw_sock { - struct inet_sock inet; - struct raw_opt raw4; + /* inet_sock has to be the first member */ + struct inet_sock inet; + struct icmp_filter filter; }; -#define raw4_sk(__sk) (&((struct raw_sock *)__sk)->raw4) +static inline struct raw_sock *raw_sk(const struct sock *sk) +{ + return (struct raw_sock *)sk; +} #endif /* _ICMP_H */ diff -Nru a/net/ipv4/raw.c b/net/ipv4/raw.c --- a/net/ipv4/raw.c 2005-01-14 19:59:34 -02:00 +++ b/net/ipv4/raw.c 2005-01-14 19:59:34 -02:00 @@ -135,7 +135,7 @@ type = skb->h.icmph->type; if (type < 32) { - __u32 data = raw4_sk(sk)->filter.data; + __u32 data = raw_sk(sk)->filter.data; return ((1 << type) & data) != 0; } @@ -615,9 +615,10 @@ static int raw_init(struct sock *sk) { - struct raw_opt *tp = raw4_sk(sk); + struct raw_sock *rp = raw_sk(sk); + if (inet_sk(sk)->num == IPPROTO_ICMP) - memset(&tp->filter, 0, sizeof(tp->filter)); + memset(&rp->filter, 0, sizeof(rp->filter)); return 0; } @@ -625,7 +626,7 @@ { if (optlen > sizeof(struct icmp_filter)) optlen = sizeof(struct icmp_filter); - if (copy_from_user(&raw4_sk(sk)->filter, optval, optlen)) + if (copy_from_user(&raw_sk(sk)->filter, optval, optlen)) return -EFAULT; return 0; } @@ -643,7 +644,7 @@ len = sizeof(struct icmp_filter); ret = -EFAULT; if (put_user(len, optlen) || - copy_to_user(optval, &raw4_sk(sk)->filter, len)) + copy_to_user(optval, &raw_sk(sk)->filter, len)) goto out; ret = 0; out: return ret; --------------060703010009090906040604-- From davem@davemloft.net Fri Jan 14 14:12:05 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 14:12:11 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0EMC5Ie005432 for ; Fri, 14 Jan 2005 14:12:05 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CpZYQ-0005pi-00; Fri, 14 Jan 2005 14:04:26 -0800 Date: Fri, 14 Jan 2005 14:04:26 -0800 From: "David S. Miller" To: Herbert Xu Cc: anton@samba.org, netdev@oss.sgi.com Subject: Re: [DEBUG]: sk_forward_alloc assertion failures Message-Id: <20050114140426.5cf06f0c.davem@davemloft.net> In-Reply-To: <20050114215504.GA12569@gondor.apana.org.au> References: <20050113171234.3fde0925.davem@davemloft.net> <20050114012504.GF6309@krispykreme.ozlabs.ibm.com> <20050113201914.46b7c4a2.davem@davemloft.net> <20050114111648.GA27964@gondor.apana.org.au> <20050114120322.GA28449@gondor.apana.org.au> <20050114110352.23c94ab9.davem@davemloft.net> <20050114203452.GA1277@gondor.apana.org.au> <20050114132757.4ca3153a.davem@davemloft.net> <20050114213829.GA12454@gondor.apana.org.au> <20050114133611.69ff0bb2.davem@davemloft.net> <20050114215504.GA12569@gondor.apana.org.au> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 264 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Sat, 15 Jan 2005 08:55:04 +1100 Herbert Xu wrote: > As long as we're careful about what we've allocated in the skb then > everything will be alright. We're in trouble right now with mixed > sendmsg/sendpages calls and changing MSSs only because we're not > careful about keeping track of how much memory we've allocated > at the start. I see, but we don't want sendmsg() to charge a full MSS if the user is only writing 10 bytes of data onto the wire. That seems to be what happens if we implement things the way you are suggesting. From davem@davemloft.net Fri Jan 14 14:16:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 14:16:39 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0EMGZEn006037 for ; Fri, 14 Jan 2005 14:16:35 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CpZd8-0005rd-00; Fri, 14 Jan 2005 14:09:18 -0800 Date: Fri, 14 Jan 2005 14:09:18 -0800 From: "David S. Miller" To: Arnaldo Carvalho de Melo Cc: netdev@oss.sgi.com Subject: Re: [PATCH] merge raw4_opt with raw_sock Message-Id: <20050114140918.37181a14.davem@davemloft.net> In-Reply-To: <41E84405.7070002@conectiva.com.br> References: <41E84405.7070002@conectiva.com.br> X-Mailer: Sylpheed version 1.0.0rc (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 265 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Fri, 14 Jan 2005 20:13:25 -0200 Arnaldo Carvalho de Melo wrote: > Now the raw_sock one, available at: > > bk://kernel.bkbits.net/acme/connection_sock-2.6 Pulled, thanks Arnaldo. From herbert@gondor.apana.org.au Fri Jan 14 14:48:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 14:48:55 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0EMmjAQ008116 for ; Fri, 14 Jan 2005 14:48:46 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CpaEr-0000zK-00; Sat, 15 Jan 2005 09:48:17 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CpaEL-0003V0-00; Sat, 15 Jan 2005 09:47:45 +1100 Date: Sat, 15 Jan 2005 09:47:45 +1100 To: "David S. Miller" Cc: anton@samba.org, netdev@oss.sgi.com Subject: Re: [DEBUG]: sk_forward_alloc assertion failures Message-ID: <20050114224745.GA13180@gondor.apana.org.au> References: <20050113201914.46b7c4a2.davem@davemloft.net> <20050114111648.GA27964@gondor.apana.org.au> <20050114120322.GA28449@gondor.apana.org.au> <20050114110352.23c94ab9.davem@davemloft.net> <20050114203452.GA1277@gondor.apana.org.au> <20050114132757.4ca3153a.davem@davemloft.net> <20050114213829.GA12454@gondor.apana.org.au> <20050114133611.69ff0bb2.davem@davemloft.net> <20050114215504.GA12569@gondor.apana.org.au> <20050114140426.5cf06f0c.davem@davemloft.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="GvXjxJ+pjyke8COw" Content-Disposition: inline In-Reply-To: <20050114140426.5cf06f0c.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 266 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Jan 14, 2005 at 02:04:26PM -0800, David S. Miller wrote: > > I see, but we don't want sendmsg() to charge a full MSS if the > user is only writing 10 bytes of data onto the wire. That seems > to be what happens if we implement things the way you are suggesting. Yes you're right. Although I belive it only happens in the case of sendpages(). It will allocate more memory than what's required in that case. I'd say that it should be rare to have a 10 byte packet with sendfile() though. However, it's not all that difficult to fix up either. We can adjust truesize to a more reasonable value in tcp_write_xmit(). Something like this will do. Actually it happens in the case of sendmsg() too. Unfortunately in that case we can't do a thing about it since the memory is allocated between skb->head and skb->tail. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== net/ipv4/tcp_output.c 1.75 vs edited ===== --- 1.75/net/ipv4/tcp_output.c 2004-12-29 05:22:40 +11:00 +++ edited/net/ipv4/tcp_output.c 2005-01-15 09:43:48 +11:00 @@ -750,9 +750,21 @@ tcp_snd_test(tp, skb, mss_now, tcp_skb_is_last(sk, skb) ? nonagle : TCP_NAGLE_PUSH)) { + unsigned int len, used; + if (skb->len > mss_now) { if (tcp_fragment(sk, skb, mss_now)) break; + } + + len = skb_netsize(skb); + used = skb->data_len + (skb->end - skb->head); + if (len > used) { + len -= used; + skb->truesize -= len; + sk->sk_queue_shrunk = 1; + sk->sk_wmem_queued -= len; + sk->sk_forward_alloc += len; } TCP_SKB_CB(skb)->when = tcp_time_stamp; --GvXjxJ+pjyke8COw-- From shemminger@osdl.org Fri Jan 14 15:57:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 15:57:27 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ENv1lK011599 for ; Fri, 14 Jan 2005 15:57:02 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0ENuBl28613; Fri, 14 Jan 2005 15:56:11 -0800 Date: Fri, 14 Jan 2005 15:56:13 -0800 From: Stephen Hemminger To: Jeff Garzik , Christoph Hellwig Cc: netdev@oss.sgi.com Subject: [RFT] New syskonnect gigabit ether driver (skge) Message-ID: <20050114155613.3c68e829@dxpl.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 267 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Here is my rewrite of the SysKonnect Gigabit Ether driver. Gave up on the existing sk98lin driver because it bloated and limited by the requirement to be portable. This version is still very experimental and has only been run for several days on my LinkSys card (single port Yukon). Please test on other hardware and let me know what you find out. diff -Nru a/drivers/net/Kconfig b/drivers/net/Kconfig --- a/drivers/net/Kconfig 2005-01-14 15:51:52 -08:00 +++ b/drivers/net/Kconfig 2005-01-14 15:51:52 -08:00 @@ -1980,6 +1980,18 @@ If in doubt, say Y. +config SKGE + tristate "New SysKonnect GigaEthernet support (EXPERIMENTAL)" + depends on PCI && EXPERIMENTAL + select CRC32 + ---help--- + This driver support the Marvell Yukon or SysKonnect SK-98xx/SK-95xx + and related Gigabit Ethernet adapters. It is a new smaller driver + driver with better performance and more complete ethtool support. + + It does not support the link failover and network management + features that "portable" vendor supplied sk98lin driver does. + config SK98LIN tristate "Marvell Yukon Chipset / SysKonnect SK-98xx Support" depends on PCI diff -Nru a/drivers/net/Makefile b/drivers/net/Makefile --- a/drivers/net/Makefile 2005-01-14 15:51:52 -08:00 +++ b/drivers/net/Makefile 2005-01-14 15:51:52 -08:00 @@ -52,6 +52,7 @@ obj-$(CONFIG_FEALNX) += fealnx.o obj-$(CONFIG_TIGON3) += tg3.o obj-$(CONFIG_TC35815) += tc35815.o +obj-$(CONFIG_SKGE) += skge.o obj-$(CONFIG_SK98LIN) += sk98lin/ obj-$(CONFIG_SKFP) += skfp/ obj-$(CONFIG_VIA_RHINE) += via-rhine.o diff -Nru a/drivers/net/skge.c b/drivers/net/skge.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/net/skge.c 2005-01-14 15:51:52 -08:00 @@ -0,0 +1,3065 @@ +/* + * New driver for Marvell Yukon chipsent and SysKonnect Gigabit + * Ethernet adapters. Based on earlier sk98lin, e100 and + * Freebsd if_sk drivers. + * + * This driver intentionally does not support all the features + * of the original driver such as link failover and link management because + * those should be done at higher levels. + * + * Copyright (C) 2004, Stephen Hemminger + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "skge.h" + +#define DRV_NAME "skge" +#define DRV_VERSION "0.2" +#define PFX DRV_NAME " " + +#define DEFAULT_TX_RING_SIZE 128 +#define DEFAULT_RX_RING_SIZE 512 +#define MAX_TX_RING_SIZE 1024 +#define MAX_RX_RING_SIZE 4096 +#define PHY_RETRIES 1000 +#define ETH_JUMBO_MTU 9000 +#define TX_WATCHDOG (2 * HZ) +#define NAPI_WEIGHT 64 + +MODULE_DESCRIPTION("SysKonnect Gigabit Ethernet driver"); +MODULE_AUTHOR("Stephen Hemminger "); +MODULE_LICENSE("GPL"); +MODULE_VERSION(DRV_VERSION); + +static const u32 default_msg + = NETIF_MSG_DRV| NETIF_MSG_PROBE| NETIF_MSG_LINK + | NETIF_MSG_IFUP| NETIF_MSG_IFDOWN; + +static int debug = -1; /* defaults above */ +module_param(debug, int, 0); +MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); + +static const struct pci_device_id skge_id_table[] = { + { PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C940, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C940B, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_GE, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_YU, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_SYSKONNECT, 0x9E00, /* SK-9Exx 10/100/1000Base-T Adapter */ + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_DLINK, PCI_DEVICE_ID_DLINK_DGE510T, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_MARVELL, 0x4320, /* Gigabit Ethernet Controller */ + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_MARVELL, 0x5005, /* Marvell (11ab), Belkin */ + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_CNET, PCI_DEVICE_ID_CNET_GIGACARD, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_LINKSYS, PCI_DEVICE_ID_LINKSYS_EG1032, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_LINKSYS, PCI_DEVICE_ID_LINKSYS_EG1064, + PCI_ANY_ID, PCI_ANY_ID }, + { 0 } +}; +MODULE_DEVICE_TABLE(pci, skge_id_table); + +static int skge_up(struct net_device *dev); +static int skge_down(struct net_device *dev); +static void skge_tx_clean(struct skge_port *skge); +static void skge_xm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val); +static void skge_gm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val); +static void genesis_get_stats(struct skge_port *skge, u64 *data); +static void yukon_get_stats(struct skge_port *skge, u64 *data); + +static const int txq[] = { Q_XA1, Q_XA2 }; +static const int rxq[] = { Q_R1, Q_R2 }; + +/* Don't need to look at whole 16K. + * last interesting register is descriptor poll timer. + */ +#define SKGE_REGS_LEN (29*128) + +static int skge_get_regs_len(struct net_device *dev) +{ + return SKGE_REGS_LEN; +} + +/* + * Returns copy of control register region + * I/O region is divided into banks and certain regions + * are unreadable + */ +static void skge_get_regs(struct net_device *dev, struct ethtool_regs *regs, + void *p) +{ + struct skge_port *skge = netdev_priv(dev); + unsigned long offs; + void __iomem *io = skge->hw->regs; + static const unsigned long bankmap + = (1<<0) | (1<<2) | (1<<8) | (1<<9) + | (1<<12) | (1<<13) | (1<<14) | (1<<15) | (1<<16) + | (1<<17) | (1<<20) | (1<<21) | (1<<22) | (1<<23) + | (1<<24) | (1<<25) | (1<<26) | (1<<27) | (1<<28); + + regs->version = 1; + for (offs = 0; offs < regs->len; offs += 128) { + u32 len = min_t(u32, 128, regs->len - offs); + + if (bankmap & (1<<(offs/128))) + memcpy_fromio(p + offs, io + offs, len); + else + memset(p + offs, 0, len); + } +} + +static int skge_get_settings(struct net_device *dev, + struct ethtool_cmd *ecmd) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + + ecmd->transceiver = XCVR_INTERNAL; + + if (iscopper(hw)) { + if (hw->chip_id == CHIP_ID_GENESIS) + ecmd->supported = SUPPORTED_1000baseT_Full + | SUPPORTED_1000baseT_Half + | SUPPORTED_Autoneg | SUPPORTED_TP; + else { + ecmd->supported = SUPPORTED_10baseT_Half + | SUPPORTED_10baseT_Full + | SUPPORTED_100baseT_Half + | SUPPORTED_100baseT_Full + | SUPPORTED_1000baseT_Half + | SUPPORTED_1000baseT_Full + | SUPPORTED_Autoneg| SUPPORTED_TP; + + if (hw->chip_id == CHIP_ID_YUKON) + ecmd->supported &= ~SUPPORTED_1000baseT_Half; + + else if (hw->chip_id == CHIP_ID_YUKON_FE) + ecmd->supported &= ~(SUPPORTED_1000baseT_Half + | SUPPORTED_1000baseT_Full); + } + + ecmd->advertising = ADVERTISED_TP | ADVERTISED_Autoneg; + ecmd->port = PORT_TP; + ecmd->phy_address = hw->phy_addr; + + ecmd->speed = skge->speed; + ecmd->duplex = skge->duplex; + } else { + ecmd->supported = SUPPORTED_1000baseT_Full + | SUPPORTED_FIBRE + | SUPPORTED_Autoneg; + + ecmd->advertising = ADVERTISED_1000baseT_Full + | ADVERTISED_FIBRE + | ADVERTISED_Autoneg; + ecmd->port = PORT_FIBRE; + ecmd->autoneg = AUTONEG_ENABLE; + ecmd->speed = SPEED_1000; + ecmd->duplex = DUPLEX_FULL; + } + + return 0; +} + +static int skge_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) +{ + struct skge_port *skge = netdev_priv(dev); + + if (netif_running(dev)) + skge_down(dev); + + skge->autoneg = ecmd->autoneg; + skge->speed = ecmd->speed; + skge->duplex = ecmd->duplex; + + if (netif_running(dev)) + skge_up(dev); + return (0); +} + +static void skge_get_drvinfo(struct net_device *dev, + struct ethtool_drvinfo *info) +{ + struct skge_port *skge = netdev_priv(dev); + + strcpy(info->driver, DRV_NAME); + strcpy(info->version, DRV_VERSION); + strcpy(info->fw_version, "N/A"); + strcpy(info->bus_info, pci_name(skge->hw->pdev)); +} + +/* + * The VPD config area contains Vital Product Data, as suggested in + * the PCI 2.1 specification. The VPD data is separared into areas + * denoted by resource IDs. The SysKonnect VPD contains an ID string + * resource (the name of the adapter), a read-only area resource + * containing various key/data fields and a read/write area which + * can be used to store asset management information or log messages. + */ +static int skge_vpd_read(struct pci_dev *pci, u8 *buf, u16 offset, u32 len) +{ + int i; + u16 reg; + unsigned long timeout = jiffies + 2*HZ; + + if (offset & 3) + return -EINVAL; + + for (i = 0; i < len; i += 4) { + pci_write_config_word(pci, PCI_VPD+PCI_VPD_ADDR, offset); + + for(;;) { + pci_read_config_word(pci, PCI_VPD+PCI_VPD_ADDR, ®); + + if (reg & PCI_VPD_ADDR_F) + break; + + if (time_after(jiffies, timeout)) { + printk(KERN_ERR "%s: VPD read timed out\n", + pci_name(pci)); + return -ETIMEDOUT; + } + cpu_relax(); + } + + pci_read_config_byte(pci, PCI_VPD+PCI_VPD_DATA, buf+i); + pci_read_config_byte(pci, PCI_VPD+PCI_VPD_DATA+1,buf+i+1); + pci_read_config_byte(pci, PCI_VPD+PCI_VPD_DATA+2,buf+i+2); + pci_read_config_byte(pci, PCI_VPD+PCI_VPD_DATA+3,buf+i+3); + + offset += 4; + } + return 0; +} + +static const struct skge_stat { + char name[ETH_GSTRING_LEN]; + u16 xmac_offset; + u16 gma_offset; +} skge_stats[] = { + { "tx_bytes", XM_TXO_OK_HI, GM_TXO_OK_HI }, + { "rx_bytes", XM_RXO_OK_HI, GM_RXO_OK_HI }, + + { "tx_broadcast", XM_TXF_BC_OK, GM_TXF_BC_OK }, + { "rx_broadcast", XM_RXF_BC_OK, GM_RXF_BC_OK }, + { "tx_multicast", XM_TXF_MC_OK, GM_TXF_MC_OK }, + { "rx_multicast", XM_RXF_MC_OK, GM_RXF_MC_OK }, + { "tx_unicast", XM_TXF_UC_OK, GM_TXF_UC_OK }, + { "rx_unicast", XM_RXF_UC_OK, GM_RXF_UC_OK }, + { "tx_mac_pause", XM_TXF_MPAUSE, GM_TXF_MPAUSE }, + { "rx_mac_pause", XM_RXF_MPAUSE, GM_RXF_MPAUSE }, + + { "collisions", XM_TXF_SNG_COL, GM_TXF_SNG_COL }, + { "multi_collisions", XM_TXF_MUL_COL, GM_TXF_MUL_COL }, + { "aborted", XM_TXF_ABO_COL, GM_TXF_ABO_COL}, + { "late_collision", XM_TXF_LAT_COL, GM_TXF_LAT_COL }, + { "fifo_underrun", XM_TXE_FIFO_UR, GM_TXE_FIFO_UR }, + { "fifo_overflow", XM_RXE_FIFO_OV, GM_RXE_FIFO_OV }, + + { "rx_toolong", XM_RXF_LNG_ERR, GM_RXF_LNG_ERR }, + { "rx_jabber", XM_RXF_JAB_PKT, GM_RXF_JAB_PKT }, + { "rx_runt", XM_RXE_RUNT, GM_RXE_FRAG }, + { "rx_too_long", XM_RXF_LNG_ERR, GM_RXF_LNG_ERR }, + { "rx_fcs_error", XM_RXF_FCS_ERR, GM_RXF_FCS_ERR }, +}; + +static int skge_get_stats_count(struct net_device *dev) +{ + return ARRAY_SIZE(skge_stats); +} + +static void skge_get_ethtool_stats(struct net_device *dev, + struct ethtool_stats *stats, u64 *data) +{ + struct skge_port *skge = netdev_priv(dev); + + if (skge->hw->chip_id == CHIP_ID_GENESIS) + genesis_get_stats(skge, data); + else + yukon_get_stats(skge, data); +} + +static void skge_get_strings(struct net_device *dev, u32 stringset, u8 *data) +{ + int i; + + switch(stringset) { + case ETH_SS_STATS: + for (i = 0; i < ARRAY_SIZE(skge_stats); i++) + memcpy(data + i * ETH_GSTRING_LEN, + skge_stats[i].name, ETH_GSTRING_LEN); + break; + } +} + +static void skge_get_ring_param(struct net_device *dev, + struct ethtool_ringparam *p) +{ + struct skge_port *skge = netdev_priv(dev); + + p->rx_max_pending = MAX_RX_RING_SIZE; + p->tx_max_pending = MAX_TX_RING_SIZE; + p->rx_mini_max_pending = 0; + p->rx_jumbo_max_pending = 0; + + p->rx_pending = skge->rx_ring.count; + p->tx_pending = skge->tx_ring.count; + p->rx_mini_pending = 0; + p->rx_jumbo_pending = 0; +} + +static int skge_set_ring_param(struct net_device *dev, + struct ethtool_ringparam *p) +{ + struct skge_port *skge = netdev_priv(dev); + int err = 0; + + if (p->rx_pending == 0 || p->rx_pending > MAX_RX_RING_SIZE || + p->tx_pending == 0 || p->tx_pending > MAX_TX_RING_SIZE) + return -EINVAL; + + if (netif_running(dev)) + skge_down(dev); + skge->rx_ring.count = p->rx_pending; + skge->tx_ring.count = p->tx_pending; + if (netif_running(dev)) + err = skge_up(dev); + + return err; +} + +static u32 skge_get_msglevel(struct net_device *netdev) +{ + struct skge_port *skge = netdev_priv(netdev); + return skge->msg_enable; +} + +static void skge_set_msglevel(struct net_device *netdev, u32 value) +{ + struct skge_port *skge = netdev_priv(netdev); + skge->msg_enable = value; +} + +static int skge_set_sg(struct net_device *dev, u32 data) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + + if (hw->chip_id == CHIP_ID_GENESIS && data) + return -EOPNOTSUPP; + return ethtool_op_set_sg(dev, data); +} + +static u32 skge_get_rx_csum(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + + return skge->rx_csum; +} + +static int skge_set_rx_csum(struct net_device *dev, u32 data) +{ + struct skge_port *skge = netdev_priv(dev); + + if (skge->hw->chip_id == CHIP_ID_GENESIS && data) + return -EOPNOTSUPP; + + skge->rx_csum = data; + return 0; +} + +static void skge_led_on(struct skge_hw *hw, int port) +{ + if (hw->chip_id == CHIP_ID_GENESIS) { + + skge_write8(hw, SKGEMAC_REG(port, LNK_LED_REG), LINKLED_ON); + skge_write8(hw, B0_LED, LED_STAT_ON); + + skge_write8(hw, SKGEMAC_REG(port, RX_LED_TST), LED_T_ON); + skge_write32(hw, SKGEMAC_REG(port, RX_LED_VAL), 100); + skge_write8(hw, SKGEMAC_REG(port, RX_LED_CTRL), LED_START); + + switch (hw->phy_type) { + case SK_PHY_BCOM: + skge_xm_phy_write(hw, port, PHY_BCOM_P_EXT_CTRL, + PHY_B_PEC_LED_ON); + break; + case SK_PHY_LONE: + skge_xm_phy_write(hw, port, PHY_LONE_LED_CFG, + 0x0800); + break; + default: + skge_write8(hw, SKGEMAC_REG(port, TX_LED_TST), LED_T_ON); + skge_write32(hw, SKGEMAC_REG(port, TX_LED_VAL), 100); + skge_write8(hw, SKGEMAC_REG(port, TX_LED_CTRL), LED_START); + } + } else { + skge_gm_phy_write(hw, port, PHY_MARV_LED_CTRL, 0); + skge_gm_phy_write(hw, port, PHY_MARV_LED_OVER, + PHY_M_LED_MO_DUP(MO_LED_ON) | + PHY_M_LED_MO_10(MO_LED_ON) | + PHY_M_LED_MO_100(MO_LED_ON) | + PHY_M_LED_MO_1000(MO_LED_ON) | + PHY_M_LED_MO_RX(MO_LED_ON)); + } +} + +static void skge_led_off(struct skge_hw *hw, int port) +{ + if (hw->chip_id == CHIP_ID_GENESIS) { + skge_write8(hw, SKGEMAC_REG(port, LNK_LED_REG), LINKLED_OFF); + skge_write8(hw, B0_LED, LED_STAT_OFF); + + skge_write32(hw, SKGEMAC_REG(port, RX_LED_VAL), 0); + skge_write8(hw, SKGEMAC_REG(port, RX_LED_CTRL), LED_T_OFF); + + switch (hw->phy_type) { + case SK_PHY_BCOM: + skge_xm_phy_write(hw, port, PHY_BCOM_P_EXT_CTRL, + PHY_B_PEC_LED_OFF); + break; + case SK_PHY_LONE: + skge_xm_phy_write(hw, port, PHY_LONE_LED_CFG, + PHY_L_LC_LEDT); + break; + default: + skge_write32(hw, SKGEMAC_REG(port, TX_LED_VAL), 0); + skge_write8(hw, SKGEMAC_REG(port, TX_LED_CTRL), LED_T_OFF); + } + } else { + skge_gm_phy_write(hw, port, PHY_MARV_LED_CTRL, 0); + skge_gm_phy_write(hw, port, PHY_MARV_LED_OVER, + PHY_M_LED_MO_DUP(MO_LED_OFF) | + PHY_M_LED_MO_10(MO_LED_OFF) | + PHY_M_LED_MO_100(MO_LED_OFF) | + PHY_M_LED_MO_1000(MO_LED_OFF) | + PHY_M_LED_MO_RX(MO_LED_OFF)); + } +} + +static void skge_blink_timer(unsigned long data) +{ + struct net_device *dev = (struct net_device *) data; + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + unsigned long flags; + + spin_lock_irqsave(&hw->phy_lock, flags); + if (skge->blink_on) + skge_led_on(hw, skge->port); + else + skge_led_off(hw, skge->port); + spin_unlock_irqrestore(&hw->phy_lock, flags); + + skge->blink_on = !skge->blink_on; + mod_timer(&skge->led_blink, jiffies + HZ/4); +} + +static int skge_phys_id(struct net_device *dev, u32 data) +{ + struct skge_port *skge = netdev_priv(dev); + + if(!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ)) + data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ); + + /* start blinking */ + skge->blink_on = 1; + mod_timer(&skge->led_blink, jiffies); + + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(data * HZ); + del_timer_sync(&skge->led_blink); + + skge_led_off(skge->hw, skge->port); + + return 0; +} + +static struct ethtool_ops skge_ethtool_ops = { + .get_settings = skge_get_settings, + .set_settings = skge_set_settings, + .get_drvinfo = skge_get_drvinfo, + .get_regs_len = skge_get_regs_len, + .get_regs = skge_get_regs, + .get_msglevel = skge_get_msglevel, + .set_msglevel = skge_set_msglevel, + .get_link = ethtool_op_get_link, + .get_ringparam = skge_get_ring_param, + .set_ringparam = skge_set_ring_param, + .get_sg = ethtool_op_get_sg, + .set_sg = skge_set_sg, + .get_tx_csum = ethtool_op_get_tx_csum, + .set_tx_csum = ethtool_op_set_tx_csum, + .get_rx_csum = skge_get_rx_csum, + .set_rx_csum = skge_set_rx_csum, + .get_strings = skge_get_strings, + .phys_id = skge_phys_id, + .get_stats_count = skge_get_stats_count, + .get_ethtool_stats = skge_get_ethtool_stats, +}; + +/* + * Allocate ring elements and chain them together + * One-to-one association of board descriptors with ring elements + */ +static int skge_ring_alloc(struct skge_ring *ring, void *vaddr, u64 base) +{ + struct skge_tx_desc *d; + struct skge_element *e; + int i; + + ring->start = kmalloc(sizeof(*e)*ring->count, GFP_KERNEL); + if (!ring->start) + return -ENOMEM; + + for (i = 0, e = ring->start, d = vaddr; i < ring->count; i++, e++, d++) { + e->desc = d; + if (i == ring->count - 1) { + e->next = ring->start; + d->next_offset = base; + } else { + e->next = e + 1; + d->next_offset = base + (i+1) * sizeof(*d); + } + } + ring->to_use = ring->to_clean = ring->start; + + return 0; +} + +/* Setup buffer for receiving */ +static inline int skge_rx_alloc(struct skge_port *skge, + struct skge_element *e) +{ + unsigned long bufsize = skge->netdev->mtu + ETH_HLEN; /* VLAN? */ + struct skge_rx_desc *rd = e->desc; + struct sk_buff *skb; + u64 map; + + skb = dev_alloc_skb(bufsize + NET_IP_ALIGN); + if (unlikely(!skb)) { + printk(KERN_DEBUG PFX "%s: out of memory for receive\n", + skge->netdev->name); + return -ENOMEM; + } + + skb->dev = skge->netdev; + skb_reserve(skb, NET_IP_ALIGN); + + map = pci_map_single(skge->hw->pdev, skb->data, bufsize, + PCI_DMA_FROMDEVICE); + + rd->dma_lo = map; + rd->dma_hi = map >> 32; + e->skb = skb; + rd->csum1_start = ETH_HLEN; + rd->csum2_start = ETH_HLEN; + rd->csum1 = 0; + rd->csum2 = 0; + + wmb(); + + rd->control = BMU_OWN | BMU_STF | BMU_IRQ_EOF | BMU_TCP_CHECK | bufsize; + pci_unmap_addr_set(e, mapaddr, map); + pci_unmap_len_set(e, maplen, bufsize); + return 0; +} + +/* Free all unused buffers in receive ring, assumes receiver stopped */ +static void skge_rx_clean(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + struct skge_ring *ring = &skge->rx_ring; + struct skge_element *e; + + for (e = ring->to_clean; e != ring->to_use; e = e->next) { + struct skge_rx_desc *rd = e->desc; + rd->control = 0; + + pci_unmap_single(hw->pdev, + pci_unmap_addr(e, mapaddr), + pci_unmap_len(e, maplen), + PCI_DMA_FROMDEVICE); + dev_kfree_skb(e->skb); + e->skb = NULL; + } + ring->to_clean = e; +} + +/* Allocate buffers for receive ring + * For receive: to_use is refill location + * to_clean is next received frame. + * + * if (to_use == to_clean) + * then ring all frames in ring need buffers + * if (to_use->next == to_clean) + * then ring all frames in ring have buffers + */ +static int skge_rx_fill(struct skge_port *skge) +{ + struct skge_ring *ring = &skge->rx_ring; + struct skge_element *e; + int err = 0; + + for (e = ring->to_use; e->next != ring->to_clean; e = e->next) { + err = skge_rx_alloc(skge, e); + if (err) + break; + } + ring->to_use = e; + + return err; +} + +static void skge_link_report(struct skge_port *skge) +{ + if (!netif_msg_link(skge)) + return; + + if (netif_carrier_ok(skge->netdev)) { + printk(KERN_INFO PFX + "%s: Link is up at %d Mbps, %s duplex, flow control %s\n", + skge->netdev->name, skge->speed, + skge->duplex == DUPLEX_FULL ? "full" : "half", + (skge->flow_control == FLOW_MODE_NONE) ? "none" : + (skge->flow_control == FLOW_MODE_LOC_SEND) ? "tx only" : + (skge->flow_control == FLOW_MODE_REM_SEND) ? "rx only" : + (skge->flow_control == FLOW_MODE_SYMMETRIC) ? "tx and rx" : + "unknown"); + } else + printk(KERN_INFO PFX "%s: Link is down.\n", skge->netdev->name); +} + +static u16 skge_xm_phy_read(struct skge_hw *hw, int port, u16 reg) +{ + int i; + u16 v; + + skge_xm_write16(hw, port, XM_PHY_ADDR, reg | hw->phy_addr); + v = skge_xm_read16(hw, port, XM_PHY_DATA); + if (hw->phy_type != SK_PHY_XMAC) { + for (i = 0; i < PHY_RETRIES; i++) { + udelay(1); + if (skge_xm_read16(hw, port, XM_MMU_CMD) + & XM_MMU_PHY_RDY) + goto ready; + } + + printk(KERN_WARNING PFX "%s: phy read timed out\n", + hw->dev[port]->name); + return 0; + ready: + v = skge_xm_read16(hw, port, XM_PHY_DATA); + } + + return v; +} + +static void skge_xm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val) +{ + int i; + + skge_xm_write16(hw, port, XM_PHY_ADDR, reg | hw->phy_addr); + for (i = 0; i < PHY_RETRIES; i++) { + if (!(skge_xm_read16(hw, port, XM_MMU_CMD) & XM_MMU_PHY_BUSY)) + goto ready; + cpu_relax(); + } + printk(KERN_WARNING PFX "%s: phy write failed to come ready\n", + hw->dev[port]->name); + + + ready: + skge_xm_write16(hw, port, XM_PHY_DATA, val); + for (i = 0; i < PHY_RETRIES; i++) { + udelay(1); + if (!(skge_xm_read16(hw, port, XM_MMU_CMD) & XM_MMU_PHY_BUSY)) + return; + } + printk(KERN_WARNING PFX "%s: phy write timed out\n", + hw->dev[port]->name); +} + +static void genesis_init(struct skge_hw *hw) +{ + /* set blink source counter */ + skge_write32(hw, B2_BSC_INI, (SK_BLK_DUR * SK_FACT_53) / 100); + skge_write8(hw, B2_BSC_CTRL, BSC_START); + + /* configure mac arbiter */ + skge_write16(hw, B3_MA_TO_CTRL, MA_RST_CLR); + + /* configure mac arbiter timeout values */ + skge_write8(hw, B3_MA_TOINI_RX1, SK_MAC_TO_53); + skge_write8(hw, B3_MA_TOINI_RX2, SK_MAC_TO_53); + skge_write8(hw, B3_MA_TOINI_TX1, SK_MAC_TO_53); + skge_write8(hw, B3_MA_TOINI_TX2, SK_MAC_TO_53); + + skge_write8(hw, B3_MA_RCINI_RX1, 0); + skge_write8(hw, B3_MA_RCINI_RX2, 0); + skge_write8(hw, B3_MA_RCINI_TX1, 0); + skge_write8(hw, B3_MA_RCINI_TX2, 0); + + /* configure packet arbiter timeout */ + skge_write16(hw, B3_PA_CTRL, PA_RST_CLR); + skge_write16(hw, B3_PA_TOINI_RX1, SK_PKT_TO_MAX); + skge_write16(hw, B3_PA_TOINI_TX1, SK_PKT_TO_MAX); + skge_write16(hw, B3_PA_TOINI_RX2, SK_PKT_TO_MAX); + skge_write16(hw, B3_PA_TOINI_TX2, SK_PKT_TO_MAX); +} + +static void genesis_reset(struct skge_hw *hw, int port) +{ + int i; + u64 zero = 0; + + /* reset the statistics module */ + skge_xm_write32(hw, port, XM_GP_PORT, XM_GP_RES_STAT); + skge_xm_write16(hw, port, XM_IMSK, 0xffff); /* disable XMAC IRQs */ + skge_xm_write32(hw, port, XM_MODE, 0); /* clear Mode Reg */ + skge_xm_write16(hw, port, XM_TX_CMD, 0); /* reset TX CMD Reg */ + skge_xm_write16(hw, port, XM_RX_CMD, 0); /* reset RX CMD Reg */ + + /* disable all PHY IRQs */ + if (hw->phy_type == SK_PHY_BCOM) + skge_xm_write16(hw, port, PHY_BCOM_INT_MASK, 0xffff); + + skge_xm_outhash(hw, port, XM_HSM, (u8 *) &zero); + for (i = 0; i < 15; i++) + skge_xm_outaddr(hw, port, XM_EXM(i), (u8 *) &zero); + skge_xm_outhash(hw, port, XM_SRC_CHK, (u8 *) &zero); +} + + +static void genesis_mac_init(struct skge_hw *hw, int port) +{ + struct skge_port *skge = netdev_priv(hw->dev[port]); + int i; + u32 r; + u16 id1; + u16 ctrl1, ctrl2, ctrl3, ctrl4, ctrl5; + + /* magic workaround patterns for Broadcom */ + static const struct { + u16 reg; + u16 val; + } A1hack[] = { + { 0x18, 0x0c20 }, { 0x17, 0x0012 }, { 0x15, 0x1104 }, + { 0x17, 0x0013 }, { 0x15, 0x0404 }, { 0x17, 0x8006 }, + { 0x15, 0x0132 }, { 0x17, 0x8006 }, { 0x15, 0x0232 }, + { 0x17, 0x800D }, { 0x15, 0x000F }, { 0x18, 0x0420 }, + }, C0hack[] = { + { 0x18, 0x0c20 }, { 0x17, 0x0012 }, { 0x15, 0x1204 }, + { 0x17, 0x0013 }, { 0x15, 0x0A04 }, { 0x18, 0x0420 }, + }; + + + /* initialize Rx, Tx and Link LED */ + skge_write8(hw, SKGEMAC_REG(port, LNK_LED_REG), LINKLED_ON); + skge_write8(hw, SKGEMAC_REG(port, LNK_LED_REG), LINKLED_LINKSYNC_ON); + + skge_write8(hw, SKGEMAC_REG(port, RX_LED_CTRL), LED_START); + skge_write8(hw, SKGEMAC_REG(port, TX_LED_CTRL), LED_START); + + /* Unreset the XMAC. */ + skge_write16(hw, SKGEMAC_REG(port, TX_MFF_CTRL1), MFF_CLR_MAC_RST); + + /* + * Perform additional initialization for external PHYs, + * namely for the 1000baseTX cards that use the XMAC's + * GMII mode. + */ + spin_lock_bh(&hw->phy_lock); + if (hw->phy_type != SK_PHY_XMAC) { + /* Take PHY out of reset. */ + r = skge_read32(hw, B2_GP_IO); + if (port == 0) + r |= GP_DIR_0|GP_IO_0; + else + r |= GP_DIR_2|GP_IO_2; + + skge_write32(hw, B2_GP_IO, r); + skge_read32(hw, B2_GP_IO); + + /* Enable GMII mode on the XMAC. */ + skge_xm_write16(hw, port, XM_HW_CFG, XM_HW_GMII_MD); + + id1 = skge_xm_phy_read(hw, port, PHY_XMAC_ID1); + + /* Optimize MDIO transfer by suppressing preamble. */ + skge_xm_write16(hw, port, XM_MMU_CMD, + skge_xm_read16(hw, port, XM_MMU_CMD) + | XM_MMU_NO_PRE); + + if (id1 == PHY_BCOM_ID1_C0) { + /* + * Workaround BCOM Errata for the C0 type. + * Write magic patterns to reserved registers. + */ + for (i = 0; i < ARRAY_SIZE(C0hack); i++) + skge_xm_phy_write(hw, port, + C0hack[i].reg, C0hack[i].val); + + } else if (id1 == PHY_BCOM_ID1_A1) { + /* + * Workaround BCOM Errata for the A1 type. + * Write magic patterns to reserved registers. + */ + for (i = 0; i < ARRAY_SIZE(A1hack); i++) + skge_xm_phy_write(hw, port, + A1hack[i].reg, A1hack[i].val); + } + + /* + * Workaround BCOM Errata (#10523) for all BCom PHYs. + * Disable Power Management after reset. + */ + r = skge_xm_phy_read(hw, port, PHY_BCOM_AUX_CTRL); + skge_xm_phy_write(hw, port, PHY_BCOM_AUX_CTRL, r | PHY_B_AC_DIS_PM); + } + + /* Dummy read */ + skge_xm_read16(hw, port, XM_ISRC); + + r = skge_xm_read32(hw, port, XM_MODE); + skge_xm_write32(hw, port, XM_MODE, r|XM_MD_CSA); + + /* We don't need the FCS appended to the packet. */ + r = skge_xm_read16(hw, port, XM_RX_CMD); + skge_xm_write16(hw, port, XM_RX_CMD, r | XM_RX_STRIP_FCS); + + /* We want short frames padded to 60 bytes. */ + r = skge_xm_read16(hw, port, XM_TX_CMD); + skge_xm_write16(hw, port, XM_TX_CMD, r | XM_TX_AUTO_PAD); + + /* + * Enable the reception of all error frames. This is is + * a necessary evil due to the design of the XMAC. The + * XMAC's receive FIFO is only 8K in size, however jumbo + * frames can be up to 9000 bytes in length. When bad + * frame filtering is enabled, the XMAC's RX FIFO operates + * in 'store and forward' mode. For this to work, the + * entire frame has to fit into the FIFO, but that means + * that jumbo frames larger than 8192 bytes will be + * truncated. Disabling all bad frame filtering causes + * the RX FIFO to operate in streaming mode, in which + * case the XMAC will start transfering frames out of the + * RX FIFO as soon as the FIFO threshold is reached. + */ + r = skge_xm_read32(hw, port, XM_MODE); + skge_xm_write32(hw, port, XM_MODE, + XM_MD_RX_CRCE|XM_MD_RX_LONG|XM_MD_RX_RUNT| + XM_MD_RX_ERR|XM_MD_RX_IRLE); + + skge_xm_outaddr(hw, port, XM_SA, hw->dev[port]->dev_addr); + skge_xm_outaddr(hw, port, XM_EXM(0), hw->dev[port]->dev_addr); + + /* + * Bump up the transmit threshold. This helps hold off transmit + * underruns when we're blasting traffic from both ports at once. + */ + skge_xm_write16(hw, port, XM_TX_THR, 512); + + /* Configure MAC arbiter */ + skge_write16(hw, B3_MA_TO_CTRL, MA_RST_CLR); + + /* configure timeout values */ + skge_write8(hw, B3_MA_TOINI_RX1, 72); + skge_write8(hw, B3_MA_TOINI_RX2, 72); + skge_write8(hw, B3_MA_TOINI_TX1, 72); + skge_write8(hw, B3_MA_TOINI_TX2, 72); + + skge_write8(hw, B3_MA_RCINI_RX1, 0); + skge_write8(hw, B3_MA_RCINI_RX2, 0); + skge_write8(hw, B3_MA_RCINI_TX1, 0); + skge_write8(hw, B3_MA_RCINI_TX2, 0); + + /* Configure Rx MAC FIFO */ + skge_write8(hw, SKGEMAC_REG(port, RX_MFF_CTRL2), MFF_RST_CLR); + skge_write16(hw, SKGEMAC_REG(port, RX_MFF_CTRL1), MFF_ENA_TIM_PAT); + skge_write8(hw, SKGEMAC_REG(port, RX_MFF_CTRL2), MFF_ENA_OP_MD); + + /* Configure Tx MAC FIFO */ + skge_write8(hw, SKGEMAC_REG(port, TX_MFF_CTRL2), MFF_RST_CLR); + skge_write16(hw, SKGEMAC_REG(port, TX_MFF_CTRL1), MFF_TX_CTRL_DEF); + skge_write8(hw, SKGEMAC_REG(port, TX_MFF_CTRL2), MFF_ENA_OP_MD); + + if (hw->dev[port]->mtu > ETH_DATA_LEN) { + /* Enable frame flushing if jumbo frames used */ + skge_write16(hw, SKGEMAC_REG(port,RX_MFF_CTRL1), MFF_ENA_FLUSH); + } else { + /* enable timeout timers if normal frames */ + skge_write16(hw, B3_PA_CTRL, + port == 0 ? PA_ENA_TO_TX1 : PA_ENA_TO_TX2); + } + + + r = skge_xm_read16(hw, port, XM_RX_CMD); + if (hw->dev[port]->mtu > ETH_DATA_LEN) + skge_xm_write16(hw, port, XM_RX_CMD, r | XM_RX_BIG_PK_OK); + else + skge_xm_write16(hw, port, XM_RX_CMD, r & ~(XM_RX_BIG_PK_OK)); + + switch (hw->phy_type) { + case SK_PHY_XMAC: + if (skge->autoneg == AUTONEG_ENABLE) { + ctrl1 = PHY_X_AN_FD | PHY_X_AN_HD; + + switch (skge->flow_control) { + case FLOW_MODE_NONE: + ctrl1 |= PHY_X_P_NO_PAUSE; + break; + case FLOW_MODE_LOC_SEND: + ctrl1 |= PHY_X_P_ASYM_MD; + break; + case FLOW_MODE_SYMMETRIC: + ctrl1 |= PHY_X_P_SYM_MD; + break; + case FLOW_MODE_REM_SEND: + ctrl1 |= PHY_X_P_BOTH_MD; + break; + } + + skge_xm_phy_write(hw, port, PHY_XMAC_AUNE_ADV, ctrl1); + ctrl2 = PHY_CT_ANE | PHY_CT_RE_CFG; + } else { + ctrl2 = 0; + if (skge->duplex == DUPLEX_FULL) + ctrl2 |= PHY_CT_DUP_MD; + } + + skge_xm_phy_write(hw, port, PHY_XMAC_CTRL, ctrl2); + break; + + case SK_PHY_BCOM: + ctrl1 = PHY_CT_SP1000; + ctrl2 = 0; + ctrl3 = PHY_SEL_TYPE; + ctrl4 = PHY_B_PEC_EN_LTR; + ctrl5 = PHY_B_AC_TX_TST; + + if (skge->autoneg == AUTONEG_ENABLE) { + /* + * Workaround BCOM Errata #1 for the C5 type. + * 1000Base-T Link Acquisition Failure in Slave Mode + * Set Repeater/DTE bit 10 of the 1000Base-T Control Register + */ + ctrl2 |= PHY_B_1000C_RD; + ctrl2 |= PHY_B_1000C_AFD | PHY_B_1000C_AHD; + + /* Set Flow-control capabilities */ + switch (skge->flow_control) { + case FLOW_MODE_NONE: + ctrl3 |= PHY_B_P_NO_PAUSE; + break; + case FLOW_MODE_LOC_SEND: + ctrl3 |= PHY_B_P_ASYM_MD; + break; + case FLOW_MODE_SYMMETRIC: + ctrl3 |= PHY_B_P_SYM_MD; + break; + case FLOW_MODE_REM_SEND: + ctrl3 |= PHY_B_P_BOTH_MD; + break; + } + + /* Restart Auto-negotiation */ + ctrl1 |= PHY_CT_ANE | PHY_CT_RE_CFG; + } else { + if (skge->duplex == DUPLEX_FULL) + ctrl1 |= PHY_CT_DUP_MD; + + ctrl2 |= PHY_B_1000C_MSE; /* set it to Slave */ + } + + skge_xm_phy_write(hw, port, PHY_BCOM_1000T_CTRL, ctrl2); + skge_xm_phy_write(hw, port, PHY_BCOM_AUNE_ADV, ctrl3); + + if (skge->netdev->mtu > ETH_DATA_LEN) { + ctrl4 |= PHY_B_PEC_HIGH_LA; + ctrl5 |= PHY_B_AC_LONG_PACK; + + skge_xm_phy_write(hw, port,PHY_BCOM_AUX_CTRL, ctrl5); + } + + skge_xm_phy_write(hw, port, PHY_BCOM_P_EXT_CTRL, ctrl4); + skge_xm_phy_write(hw, port, PHY_BCOM_CTRL, ctrl1); + break; + } + spin_unlock_bh(&hw->phy_lock); + + /* Clear MIB counters */ + skge_xm_write16(hw, port, XM_STAT_CMD, + XM_SC_CLR_RXC | XM_SC_CLR_TXC); + /* Clear two times according to Errata #3 */ + skge_xm_write16(hw, port, XM_STAT_CMD, + XM_SC_CLR_RXC | XM_SC_CLR_TXC); + + /* Start polling for link status */ + mod_timer(&skge->link_check, jiffies + HZ/10); +} + +static void genesis_stop(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + + /* Clear Tx packet arbiter timeout IRQ */ + skge_write16(hw, B3_PA_CTRL, + port == 0 ? PA_CLR_TO_TX1 : PA_CLR_TO_TX2); + + /* + * If the transfer stucks at the MAC the STOP command will not + * terminate if we don't flush the XMAC's transmit FIFO ! + */ + skge_xm_write32(hw, port, XM_MODE, + skge_xm_read32(hw, port, XM_MODE)|XM_MD_FTF); + + + /* Reset the MAC */ + skge_write16(hw, SKGEMAC_REG(port, TX_MFF_CTRL1), MFF_SET_MAC_RST); + + /* For external PHYs there must be special handling */ + if (hw->phy_type != SK_PHY_XMAC) { + u32 reg = skge_read32(hw, B2_GP_IO); + + if (port == 0) { + reg |= GP_DIR_0; + reg &= ~GP_IO_0; + } else { + reg |= GP_DIR_2; + reg &= ~GP_IO_2; + } + skge_write32(hw, B2_GP_IO, reg); + skge_read32(hw, B2_GP_IO); + } + + skge_xm_write16(hw, port, XM_MMU_CMD, + skge_xm_read16(hw, port, XM_MMU_CMD) + & ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX)); + + skge_xm_read16(hw, port, XM_MMU_CMD); +} + + +static void genesis_get_stats(struct skge_port *skge, u64 *data) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + int i; + unsigned long timeout = jiffies + HZ; + + skge_xm_write16(hw, port, + XM_STAT_CMD, XM_SC_SNP_TXC | XM_SC_SNP_RXC); + + /* wait for update to complete */ + while (skge_xm_read16(hw, port, XM_STAT_CMD) + & (XM_SC_SNP_TXC | XM_SC_SNP_RXC)) { + if (time_after(jiffies, timeout)) + break; + udelay(10); + } + + /* special case for 64 bit octet counter */ + data[0] = (u64) skge_xm_read32(hw, port, XM_TXO_OK_HI) << 32 + | skge_xm_read32(hw, port, XM_TXO_OK_LO); + data[1] = (u64) skge_xm_read32(hw, port, XM_RXO_OK_HI) << 32 + | skge_xm_read32(hw, port, XM_RXO_OK_LO); + + for (i = 2; i < ARRAY_SIZE(skge_stats); i++) + data[i] = skge_xm_read32(hw, port, skge_stats[i].xmac_offset); +} + +static void genesis_intr(struct skge_hw *hw, int port) +{ + struct skge_port *skge = netdev_priv(hw->dev[port]); + u16 status = skge_xm_read16(hw, port, XM_ISRC); + + pr_debug("genesis_intr status %x\n", status); + if (hw->phy_type == SK_PHY_XMAC) { + /* LInk down, start polling for state change */ + if (status & XM_IS_INP_ASS) { + skge_xm_write16(hw, port, XM_IMSK, + skge_xm_read16(hw, port, XM_IMSK) | XM_IS_INP_ASS); + mod_timer(&skge->link_check, jiffies + HZ/10); + } + else if (status & XM_IS_AND) + mod_timer(&skge->link_check, jiffies + HZ/10); + } + + if (status & XM_IS_TXF_UR) { + skge_xm_write32(hw, port, XM_MODE, XM_MD_FTF); + ++skge->net_stats.tx_fifo_errors; + } + if (status & XM_IS_RXF_OV) { + skge_xm_write32(hw, port, XM_MODE, XM_MD_FRF); + ++skge->net_stats.rx_fifo_errors; + } +} + +static void skge_gm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val) +{ + int i; + + skge_gma_write16(hw, port, GM_SMI_DATA, val); + skge_gma_write16(hw, port, GM_SMI_CTRL, + GM_SMI_CT_PHY_AD(hw->phy_addr) | GM_SMI_CT_REG_AD(reg)); + for (i = 0; i < PHY_RETRIES; i++) { + udelay(1); + + if (!(skge_gma_read16(hw, port, GM_SMI_CTRL) & GM_SMI_CT_BUSY)) + break; + } +} + +static u16 skge_gm_phy_read(struct skge_hw *hw, int port, u16 reg) +{ + int i; + + skge_gma_write16(hw, port, GM_SMI_CTRL, + GM_SMI_CT_PHY_AD(hw->phy_addr) + | GM_SMI_CT_REG_AD(reg) | GM_SMI_CT_OP_RD); + + for (i = 0; i < PHY_RETRIES; i++) { + udelay(1); + if (skge_gma_read16(hw, port, GM_SMI_CTRL) & GM_SMI_CT_RD_VAL) + goto ready; + } + + printk(KERN_WARNING PFX "%s: phy read timeout\n", + hw->dev[port]->name); + return 0; + ready: + return skge_gma_read16(hw, port, GM_SMI_DATA); +} + +static void genesis_link_down(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + + pr_debug("genesis_link_down\n"); + + netif_carrier_off(skge->netdev); + skge_xm_write16(hw, port, XM_MMU_CMD, + skge_xm_read16(hw, port, XM_MMU_CMD) + & ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX)); + + /* dummy read to ensure writing */ + (void) skge_xm_read16(hw, port, XM_MMU_CMD); + + skge_link_report(skge); +} + +static void genesis_link_up(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + u16 cmd; + u32 mode, msk; + + pr_debug("genesis_link_up\n"); + netif_wake_queue(skge->netdev); + netif_carrier_on(skge->netdev); + + cmd = skge_xm_read16(hw, port, XM_MMU_CMD); + + /* + * enabling pause frame reception is required for 1000BT + * because the XMAC is not reset if the link is going down + */ + if (skge->flow_control == FLOW_MODE_NONE || + skge->flow_control == FLOW_MODE_LOC_SEND) + cmd |= XM_MMU_IGN_PF; + else + /* Enable Pause Frame Reception */ + cmd &= ~XM_MMU_IGN_PF; + + skge_xm_write16(hw, port, XM_MMU_CMD, cmd); + + mode = skge_xm_read32(hw, port, XM_MODE); + if (skge->flow_control == FLOW_MODE_SYMMETRIC || + skge->flow_control == FLOW_MODE_LOC_SEND) { + /* + * Configure Pause Frame Generation + * Use internal and external Pause Frame Generation. + * Sending pause frames is edge triggered. + * Send a Pause frame with the maximum pause time if + * internal oder external FIFO full condition occurs. + * Send a zero pause time frame to re-start transmission. + */ + /* XM_PAUSE_DA = '010000C28001' (default) */ + /* XM_MAC_PTIME = 0xffff (maximum) */ + /* remember this value is defined in big endian (!) */ + skge_xm_write16(hw, port, XM_MAC_PTIME, 0xffff); + + mode |= XM_PAUSE_MODE; + skge_write16(hw, SKGEMAC_REG(port, RX_MFF_CTRL1), MFF_ENA_PAUSE); + } else { + /* + * disable pause frame generation is required for 1000BT + * because the XMAC is not reset if the link is going down + */ + /* Disable Pause Mode in Mode Register */ + mode &= ~XM_PAUSE_MODE; + + skge_write16(hw, SKGEMAC_REG(port, RX_MFF_CTRL1), MFF_DIS_PAUSE); + } + + skge_xm_write32(hw, port, XM_MODE, mode); + + msk = XM_DEF_MSK; + if (hw->phy_type != SK_PHY_XMAC) + msk |= XM_IS_INP_ASS; /* disable GP0 interrupt bit */ + + skge_xm_write16(hw, port, XM_IMSK, msk); + skge_xm_read16(hw, port, XM_ISRC); + + /* get MMU Command Reg. */ + cmd = skge_xm_read16(hw, port, XM_MMU_CMD); + if (hw->phy_type != SK_PHY_XMAC && skge->duplex == DUPLEX_FULL) + cmd |= XM_MMU_GMII_FD; + + if (hw->phy_type == SK_PHY_BCOM) { + /* + * Workaround BCOM Errata (#10523) for all BCom Phys + * Enable Power Management after link up + */ + skge_xm_phy_write(hw, port, PHY_BCOM_AUX_CTRL, + skge_xm_phy_read(hw, port, PHY_BCOM_AUX_CTRL) + & ~PHY_B_AC_DIS_PM); + skge_xm_phy_write(hw, port, PHY_BCOM_INT_MASK, + PHY_B_DEF_MSK); + } + + /* enable Rx/Tx */ + skge_xm_write16(hw, port, XM_MMU_CMD, + cmd | XM_MMU_ENA_RX | XM_MMU_ENA_TX); + skge_link_report(skge); +} + + +static void genesis_bcom_intr(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + u16 stat = skge_xm_phy_read(hw, port, PHY_BCOM_INT_STAT); + + pr_debug("genesis_bcom intr stat=%x\n", stat); + + /* Workaround BCom Errata: + * enable and disable loopback mode if "NO HCD" occurs. + */ + if (stat & PHY_B_IS_NO_HDCL) { + u16 ctrl = skge_xm_phy_read(hw, port, PHY_BCOM_CTRL); + skge_xm_phy_write(hw, port, PHY_BCOM_CTRL, + ctrl | PHY_CT_LOOP); + skge_xm_phy_write(hw, port, PHY_BCOM_CTRL, + ctrl & ~PHY_CT_LOOP); + } + + stat = skge_xm_phy_read(hw, port, PHY_BCOM_STAT); + if (stat & (PHY_B_IS_AN_PR | PHY_B_IS_LST_CHANGE)) { + u16 aux = skge_xm_phy_read(hw, port, PHY_BCOM_AUX_STAT); + if ( !(aux & PHY_B_AS_LS) && netif_carrier_ok(skge->netdev)) + genesis_link_down(skge); + + else if (stat & PHY_B_IS_LST_CHANGE) { + if (aux & PHY_B_AS_AN_C) { + switch (aux & PHY_B_AS_AN_RES_MSK) { + case PHY_B_RES_1000FD: + skge->duplex = DUPLEX_FULL; + break; + case PHY_B_RES_1000HD: + skge->duplex = DUPLEX_HALF; + break; + } + + switch (aux & PHY_B_AS_PAUSE_MSK) { + case PHY_B_AS_PAUSE_MSK: + skge->flow_control = FLOW_MODE_SYMMETRIC; + break; + case PHY_B_AS_PRR: + skge->flow_control = FLOW_MODE_REM_SEND; + break; + case PHY_B_AS_PRT: + skge->flow_control = FLOW_MODE_LOC_SEND; + break; + default: + skge->flow_control = FLOW_MODE_NONE; + } + skge->speed = SPEED_1000; + } + genesis_link_up(skge); + } + else + mod_timer(&skge->link_check, jiffies + HZ/10); + } +} + +/* Perodic poll of phy status to check for link transistion */ +static void skge_link_timer(unsigned long __arg) +{ + struct skge_port *skge = (struct skge_port *) __arg; + struct skge_hw *hw = skge->hw; + int port = skge->port; + + if (hw->chip_id != CHIP_ID_GENESIS || !netif_running(skge->netdev)) + return; + + spin_lock_bh(&hw->phy_lock); + if (hw->phy_type == SK_PHY_BCOM) + genesis_bcom_intr(skge); + else { + int i; + for (i = 0; i < 3; i++) + if (skge_xm_read16(hw, port, XM_ISRC) & XM_IS_INP_ASS) + break; + + if (i == 3) + mod_timer(&skge->link_check, jiffies + HZ/10); + else + genesis_link_up(skge); + } + spin_unlock_bh(&hw->phy_lock); +} + +/* Marvell Phy Initailization */ +static void yukon_phy_init(struct skge_hw *hw, int port) +{ + struct skge_port *skge = netdev_priv(hw->dev[port]); + u16 ctrl, ct1000, adv; + u16 ledctrl, ledover; + + pr_debug("yukon_phy_init\n"); + spin_lock_bh(&hw->phy_lock); + if (skge->autoneg == AUTONEG_ENABLE) { + u16 ectrl = skge_gm_phy_read(hw, port, PHY_MARV_EXT_CTRL); + + ectrl &= ~(PHY_M_EC_M_DSC_MSK | PHY_M_EC_S_DSC_MSK | + PHY_M_EC_MAC_S_MSK); + ectrl |= PHY_M_EC_MAC_S(MAC_TX_CLK_25_MHZ); + + /* on PHY 88E1111 there is a change for downshift control */ + if (hw->chip_id == CHIP_ID_YUKON_EC) + ectrl |= PHY_M_EC_M_DSC_2(0) | PHY_M_EC_DOWN_S_ENA; + else + ectrl |= PHY_M_EC_M_DSC(0) | PHY_M_EC_S_DSC(1); + + skge_gm_phy_write(hw, port, PHY_MARV_EXT_CTRL, ectrl); + } + + ctrl = skge_gm_phy_read(hw, port, PHY_MARV_CTRL); + if (skge->autoneg == AUTONEG_DISABLE) + ctrl &= ~PHY_CT_ANE; + + ctrl |= PHY_CT_RESET; + skge_gm_phy_write(hw, port, PHY_MARV_CTRL, ctrl); + + ctrl = 0; + ct1000 = 0; + adv = PHY_SEL_TYPE; + + if (skge->autoneg == AUTONEG_ENABLE) { + if (iscopper(hw)) { + ct1000 |= PHY_M_1000C_AHD | PHY_M_1000C_AFD; + adv |= PHY_M_AN_100_FD | PHY_M_AN_100_HD | + PHY_M_AN_10_FD | PHY_M_AN_10_HD; + + /* Set Flow-control capabilities */ + switch (skge->flow_control) { + case FLOW_MODE_NONE: + adv |= PHY_B_P_NO_PAUSE; + break; + case FLOW_MODE_LOC_SEND: + adv |= PHY_B_P_ASYM_MD; + break; + case FLOW_MODE_SYMMETRIC: + adv |= PHY_B_P_SYM_MD; + break; + case FLOW_MODE_REM_SEND: + adv |= PHY_B_P_BOTH_MD; + break; + } + } else { /* special defines for FIBER (88E1011S only) */ + adv |= PHY_M_AN_1000X_AHD | PHY_M_AN_1000X_AFD; + + /* Set Flow-control capabilities */ + switch (skge->flow_control) { + case FLOW_MODE_NONE: + adv |= PHY_M_P_NO_PAUSE_X; + break; + case FLOW_MODE_LOC_SEND: + adv |= PHY_M_P_ASYM_MD_X; + break; + case FLOW_MODE_SYMMETRIC: + adv |= PHY_M_P_SYM_MD_X; + break; + case FLOW_MODE_REM_SEND: + adv |= PHY_M_P_BOTH_MD_X; + break; + } + } + /* Restart Auto-negotiation */ + ctrl |= PHY_CT_ANE | PHY_CT_RE_CFG; + } else { + /* forced speed/duplex settings */ + ct1000 = PHY_M_1000C_MSE; + + if (skge->duplex == DUPLEX_FULL) + ctrl |= PHY_CT_DUP_MD; + + switch (skge->speed) { + case SPEED_1000: + ctrl |= PHY_CT_SP1000; + break; + case SPEED_100: + ctrl |= PHY_CT_SP100; + break; + } + + ctrl |= PHY_CT_RESET; + } + + if (hw->chip_id != CHIP_ID_YUKON_FE) + skge_gm_phy_write(hw, port, PHY_MARV_1000T_CTRL, ct1000); + + skge_gm_phy_write(hw, port, PHY_MARV_AUNE_ADV, adv); + skge_gm_phy_write(hw, port, PHY_MARV_CTRL, ctrl); + + /* Setup Phy LED's */ + ledctrl = PHY_M_LED_PULS_DUR(PULS_170MS); + ledover = 0; + + if (hw->chip_id == CHIP_ID_YUKON_FE) { + /* on 88E3082 these bits are at 11..9 (shifted left) */ + ledctrl |= PHY_M_LED_BLINK_RT(BLINK_84MS) << 1; + + skge_gm_phy_write(hw, port, PHY_MARV_FE_LED_PAR, + ((skge_gm_phy_read(hw, port, PHY_MARV_FE_LED_PAR) + + & ~PHY_M_FELP_LED1_MSK) + | PHY_M_FELP_LED1_CTRL(LED_PAR_CTRL_ACT_BL))); + } else { + /* set Tx LED (LED_TX) to blink mode on Rx OR Tx activity */ + ledctrl |= PHY_M_LED_BLINK_RT(BLINK_84MS) | PHY_M_LEDC_TX_CTRL; + + /* turn off the Rx LED (LED_RX) */ + ledover |= PHY_M_LED_MO_RX(MO_LED_OFF); + } + + /* disable blink mode (LED_DUPLEX) on collisions */ + ctrl |= PHY_M_LEDC_DP_CTRL; + skge_gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl); + + if (skge->autoneg == AUTONEG_DISABLE || skge->speed == SPEED_100) { + /* turn on 100 Mbps LED (LED_LINK100) */ + ledover |= PHY_M_LED_MO_100(MO_LED_ON); + } + + if (ledover) + skge_gm_phy_write(hw, port, PHY_MARV_LED_OVER, ledover); + + /* Enable phy interrupt on autonegotiation complete (or link up) */ + if (skge->autoneg == AUTONEG_ENABLE) + skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_IS_AN_COMPL); + else + skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_DEF_MSK); + spin_unlock_bh(&hw->phy_lock); +} + +static void yukon_reset(struct skge_hw *hw, int port) +{ + spin_lock_bh(&hw->phy_lock); + skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, 0);/* disable PHY IRQs */ + skge_gma_write16(hw, port, GM_MC_ADDR_H1, 0); /* clear MC hash */ + skge_gma_write16(hw, port, GM_MC_ADDR_H2, 0); + skge_gma_write16(hw, port, GM_MC_ADDR_H3, 0); + skge_gma_write16(hw, port, GM_MC_ADDR_H4, 0); + + /* Enable Unicast and Multicast filtering */ + skge_gma_write16(hw, port, GM_RX_CTRL, + skge_gma_read16(hw, port, GM_RX_CTRL) + | GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA); + spin_unlock_bh(&hw->phy_lock); +} + +static void yukon_mac_init(struct skge_hw *hw, int port) +{ + struct skge_port *skge = netdev_priv(hw->dev[port]); + int i; + u32 reg; + const u8 *addr = hw->dev[port]->dev_addr; + + /* WA code for COMA mode -- set PHY reset */ + if (hw->chip_id == CHIP_ID_YUKON_LITE && + chip_rev(hw) == CHIP_REV_YU_LITE_A3) + skge_write32(hw, B2_GP_IO, + (skge_read32(hw, B2_GP_IO) | GP_DIR_9 | GP_IO_9)); + + /* hard reset */ + skge_write32(hw, SKGEMAC_REG(port, GPHY_CTRL), GPC_RST_SET); + skge_write32(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_RST_SET); + + /* WA code for COMA mode -- clear PHY reset */ + if (hw->chip_id == CHIP_ID_YUKON_LITE && + chip_rev(hw) == CHIP_REV_YU_LITE_A3) + skge_write32(hw, B2_GP_IO, + (skge_read32(hw, B2_GP_IO) | GP_DIR_9) + & ~GP_IO_9); + + /* Set hardware config mode */ + reg = GPC_INT_POL_HI | GPC_DIS_FC | GPC_DIS_SLEEP | + GPC_ENA_XC | GPC_ANEG_ADV_ALL_M | GPC_ENA_PAUSE; + reg |= iscopper(hw) ? GPC_HWCFG_GMII_COP : GPC_HWCFG_GMII_FIB; + + /* Clear GMC reset */ + skge_write32(hw, SKGEMAC_REG(port, GPHY_CTRL), reg | GPC_RST_SET); + skge_write32(hw, SKGEMAC_REG(port, GPHY_CTRL), reg | GPC_RST_CLR); + skge_write32(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_PAUSE_ON | GMC_RST_CLR); + if (skge->autoneg == AUTONEG_DISABLE) { + reg = GM_GPCR_AU_ALL_DIS; + skge_gma_write16(hw, port, GM_GP_CTRL, + skge_gma_read16(hw, port, GM_GP_CTRL) | reg); + + switch (skge->speed) { + case SPEED_1000: + reg |= GM_GPCR_SPEED_1000; + /* fallthru */ + case SPEED_100: + reg |= GM_GPCR_SPEED_100; + } + + if (skge->duplex == DUPLEX_FULL) + reg |= GM_GPCR_DUP_FULL; + } else + reg = GM_GPCR_SPEED_1000 | GM_GPCR_SPEED_100 | GM_GPCR_DUP_FULL; + switch (skge->flow_control) { + case FLOW_MODE_NONE: + skge_write32(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_PAUSE_OFF); + reg |= GM_GPCR_FC_TX_DIS | GM_GPCR_FC_RX_DIS | GM_GPCR_AU_FCT_DIS; + break; + case FLOW_MODE_LOC_SEND: + /* disable Rx flow-control */ + reg |= GM_GPCR_FC_RX_DIS | GM_GPCR_AU_FCT_DIS; + } + + skge_gma_write16(hw, port, GM_GP_CTRL, reg); + skge_read16(hw, GMAC_IRQ_SRC); + + yukon_phy_init(hw, port); + + /* MIB clear */ + reg = skge_gma_read16(hw, port, GM_PHY_ADDR); + skge_gma_write16(hw, port, GM_PHY_ADDR, reg | GM_PAR_MIB_CLR); + + for (i = 0; i < GM_MIB_CNT_SIZE; i++) + skge_gma_read16(hw, port, GM_MIB_CNT_BASE + 8*i); + skge_gma_write16(hw, port, GM_PHY_ADDR, reg); + + /* transmit control */ + skge_gma_write16(hw, port, GM_TX_CTRL, TX_COL_THR(TX_COL_DEF)); + + /* receive control reg: unicast + multicast + no FCS */ + skge_gma_write16(hw, port, GM_RX_CTRL, + GM_RXCR_UCF_ENA | GM_RXCR_CRC_DIS | GM_RXCR_MCF_ENA); + + /* transmit flow control */ + skge_gma_write16(hw, port, GM_TX_FLOW_CTRL, 0xffff); + + /* transmit parameter */ + skge_gma_write16(hw, port, GM_TX_PARAM, + TX_JAM_LEN_VAL(TX_JAM_LEN_DEF) | + TX_JAM_IPG_VAL(TX_JAM_IPG_DEF) | + TX_IPG_JAM_DATA(TX_IPG_JAM_DEF)); + + /* serial mode register */ + reg = GM_SMOD_VLAN_ENA | IPG_DATA_VAL(IPG_DATA_DEF); + if (hw->dev[port]->mtu > 1500) + reg |= GM_SMOD_JUMBO_ENA; + + skge_gma_write16(hw, port, GM_SERIAL_MODE, reg); + + /* physical address: used for pause frames */ + skge_gm_set_addr(hw, port, GM_SRC_ADDR_1L, addr); + /* virtual address for data */ + skge_gm_set_addr(hw, port, GM_SRC_ADDR_2L, addr); + + /* enable interrupt mask for counter overflows */ + skge_gma_write16(hw, port, GM_TX_IRQ_MSK, 0); + skge_gma_write16(hw, port, GM_RX_IRQ_MSK, 0); + skge_gma_write16(hw, port, GM_TR_IRQ_MSK, 0); + + /* Initialize Mac Fifo */ + + /* Configure Rx MAC FIFO */ + skge_write16(hw, SKGEMAC_REG(port, RX_GMF_FL_MSK), RX_FF_FL_DEF_MSK); + reg = GMF_OPER_ON | GMF_RX_F_FL_ON; + if (hw->chip_id == CHIP_ID_YUKON_LITE && + chip_rev(hw) == CHIP_REV_YU_LITE_A3) + reg &= ~GMF_RX_F_FL_ON; + skge_write8(hw, SKGEMAC_REG(port, RX_GMF_CTRL_T), GMF_RST_CLR); + skge_write16(hw, SKGEMAC_REG(port, RX_GMF_CTRL_T), reg); + skge_write16(hw, SKGEMAC_REG(port, RX_GMF_FL_THR), RX_GMF_FL_THR_DEF); + + /* Configure Tx MAC FIFO */ + skge_write8(hw, SKGEMAC_REG(port, TX_GMF_CTRL_T), GMF_RST_CLR); + skge_write16(hw, SKGEMAC_REG(port, TX_GMF_CTRL_T), GMF_OPER_ON); +} + +static void yukon_stop(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + + if (hw->chip_id == CHIP_ID_YUKON_LITE && + chip_rev(hw) == CHIP_REV_YU_LITE_A3) { + skge_write32(hw, B2_GP_IO, + skge_read32(hw, B2_GP_IO) | GP_DIR_9 | GP_IO_9); + } + + skge_gma_write16(hw, port, GM_GP_CTRL, + skge_gma_read16(hw, port, GM_GP_CTRL) + & ~(GM_GPCR_RX_ENA|GM_GPCR_RX_ENA)); + skge_gma_read16(hw, port, GM_GP_CTRL); + + /* set GPHY Control reset */ + skge_gma_write32(hw, port, GPHY_CTRL, GPC_RST_SET); + skge_gma_write32(hw, port, GMAC_CTRL, GMC_RST_SET); +} + +static void yukon_get_stats(struct skge_port *skge, u64 *data) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + int i; + + data[0] = (u64) skge_gma_read32(hw, port, GM_TXO_OK_HI) << 32 + | skge_gma_read32(hw, port, GM_TXO_OK_LO); + data[1] = (u64) skge_gma_read32(hw, port, GM_RXO_OK_HI) << 32 + | skge_gma_read32(hw, port, GM_RXO_OK_LO); + + for (i = 2; i < ARRAY_SIZE(skge_stats); i++) + data[i] = skge_gma_read32(hw, port, + skge_stats[i].gma_offset); +} + +static void yukon_intr(struct skge_hw *hw, int port) +{ + struct skge_port *skge = netdev_priv(hw->dev[port]); + u8 status = skge_read8(hw, SKGEMAC_REG(port, GMAC_IRQ_SRC)); + + pr_debug("yukon_intr status %x\n", status); + if (status & GM_IS_RX_FF_OR) { + ++skge->net_stats.rx_fifo_errors; + skge_gma_write8(hw, port, RX_GMF_CTRL_T, GMF_CLI_RX_FO); + } + if (status & GM_IS_TX_FF_UR) { + ++skge->net_stats.tx_fifo_errors; + skge_gma_write8(hw, port, TX_GMF_CTRL_T, GMF_CLI_TX_FU); + } + +} + +static u16 yukon_speed(const struct skge_hw *hw, u16 aux) +{ + if (hw->chip_id == CHIP_ID_YUKON_FE) + return (aux & PHY_M_PS_SPEED_100) ? SPEED_100 : SPEED_10; + + switch(aux & PHY_M_PS_SPEED_MSK) { + case PHY_M_PS_SPEED_1000: + return SPEED_1000; + case PHY_M_PS_SPEED_100: + return SPEED_100; + default: + return SPEED_10; + } +} + +static void yukon_link_up(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + u16 reg; + + pr_debug("yukon_link_up\n"); + netif_wake_queue(skge->netdev); + netif_carrier_on(skge->netdev); + + /* Enable Transmit FIFO Underrun */ + skge_write8(hw, GMAC_IRQ_MSK, GMAC_DEF_MSK); + + reg = skge_gma_read16(hw, port, GM_GP_CTRL); + if (skge->duplex == DUPLEX_FULL || skge->autoneg == AUTONEG_ENABLE) + reg |= GM_GPCR_DUP_FULL; + + /* enable Rx/Tx */ + reg |= GM_GPCR_RX_ENA | GM_GPCR_TX_ENA; + skge_gma_write16(hw, port, GM_GP_CTRL, reg); + + skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_DEF_MSK); + skge_link_report(skge); +} + +static void yukon_link_down(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + netif_carrier_off(skge->netdev); + + pr_debug("yukon_link_down\n"); + skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, 0); + skge_gm_phy_write(hw, port, GM_GP_CTRL, + skge_gm_phy_read(hw, port, GM_GP_CTRL) + & ~(GM_GPCR_RX_ENA | GM_GPCR_TX_ENA)); + + if (hw->chip_id != CHIP_ID_YUKON_FE && + skge->flow_control == FLOW_MODE_REM_SEND) { + /* restore Asymmetric Pause bit */ + skge_gm_phy_write(hw, port, PHY_MARV_AUNE_ADV, + skge_gm_phy_read(hw, port, + PHY_MARV_AUNE_ADV) + | PHY_M_AN_ASP); + + } + skge_link_report(skge); +} + +static void yukon_phy_intr(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + const char *reason = NULL; + u16 istatus, phystat; + + istatus = skge_gm_phy_read(hw, port, PHY_MARV_INT_STAT); + phystat = skge_gm_phy_read(hw, port, PHY_MARV_PHY_STAT); + pr_debug("yukon phy intr istat=%x phy_stat=%x\n", istatus, phystat); + + if (istatus & PHY_M_IS_AN_COMPL) { + if (skge_gm_phy_read(hw, port, PHY_MARV_AUNE_LP) + & PHY_M_AN_RF) { + reason = "remote fault"; + goto failed; + } + + if (!(hw->chip_id == CHIP_ID_YUKON_FE || hw->chip_id == CHIP_ID_YUKON_EC) + && (skge_gm_phy_read(hw, port, PHY_MARV_1000T_STAT) + & PHY_B_1000S_MSF)) { + reason = "master/slave fault"; + goto failed; + } + + if (!(phystat & PHY_M_PS_SPDUP_RES)) { + reason = "speed/duplex"; + goto failed; + } + + skge->duplex = (phystat & PHY_M_PS_FULL_DUP) + ? DUPLEX_FULL : DUPLEX_HALF; + skge->speed = yukon_speed(hw, phystat); + + /* Tx & Rx Pause Enabled bits are at 9..8 */ + if (hw->chip_id == CHIP_ID_YUKON_XL) + phystat >>= 6; + + /* We are using IEEE 802.3z/D5.0 Table 37-4 */ + switch (phystat & PHY_M_PS_PAUSE_MSK) { + case PHY_M_PS_PAUSE_MSK: + skge->flow_control = FLOW_MODE_SYMMETRIC; + break; + case PHY_M_PS_RX_P_EN: + skge->flow_control = FLOW_MODE_REM_SEND; + break; + case PHY_M_PS_TX_P_EN: + skge->flow_control = FLOW_MODE_LOC_SEND; + break; + default: + skge->flow_control = FLOW_MODE_NONE; + } + + if (skge->flow_control == FLOW_MODE_NONE || + (skge->speed < SPEED_1000 && skge->duplex == DUPLEX_HALF)) + skge_write8(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_PAUSE_OFF); + else + skge_write8(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_PAUSE_ON); + yukon_link_up(skge); + return; + } + + if (istatus & PHY_M_IS_LSP_CHANGE) + skge->speed = yukon_speed(hw, phystat); + + if (istatus & PHY_M_IS_DUP_CHANGE) + skge->duplex = (phystat & PHY_M_PS_FULL_DUP) ? DUPLEX_FULL : DUPLEX_HALF; + if (istatus & PHY_M_IS_LST_CHANGE) { + if (phystat & PHY_M_PS_LINK_UP) + yukon_link_up(skge); + else + yukon_link_down(skge); + } + return; + failed: + printk(KERN_ERR PFX "%s: autonegotiation failed (%s)\n", + skge->netdev->name, reason); + /* add restart later */ +} + +static void skge_ramset(struct skge_hw *hw, u16 q, u32 start, size_t len) +{ + u32 end; + + start /= 8; + len /= 8; + end = start + len - 1; + + skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_RST_CLR); + skge_write32(hw, RB_ADDR(q, RB_START), start); + skge_write32(hw, RB_ADDR(q, RB_WP), start); + skge_write32(hw, RB_ADDR(q, RB_RP), start); + skge_write32(hw, RB_ADDR(q, RB_END), end); + + if (q == Q_R1 || q == Q_R2) { + /* Set thresholds on receive queue's */ + skge_write32(hw, RB_ADDR(q, RB_RX_UTPP), + start + (2*len)/3); + skge_write32(hw, RB_ADDR(q, RB_RX_LTPP), + start + (len/3)); + } else { + /* Enable store & forward on Tx queue's because + * Tx FIFO is only 4K on Genesis and 1K on Yukon + */ + skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_ENA_STFWD); + } + + skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_ENA_OP_MD); +} + +/* Setup Bus Memory Interface */ +static void skge_qset(struct skge_port *skge, u16 q, + const struct skge_element *e) +{ + struct skge_hw *hw = skge->hw; + u32 watermark = 0x600; + u64 base = skge->dma + (e->desc - skge->mem); + + /* optimization to reduce window on 32bit/33mhz */ + if ((skge_read16(hw, B0_CTST) & (CS_BUS_CLOCK | CS_BUS_SLOT_SZ)) == 0) + watermark /= 2; + + skge_write32(hw, Q_ADDR(q, Q_CSR), CSR_CLR_RESET); + skge_write32(hw, Q_ADDR(q, Q_F), watermark); + skge_write32(hw, Q_ADDR(q, Q_DA_H), (u32)(base >> 32)); + skge_write32(hw, Q_ADDR(q, Q_DA_L), (u32)base); +} + +static int skge_up(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + int port = skge->port; + u32 chunk, ram_addr; + size_t rx_size, tx_size; + int err; + + if (netif_msg_ifup(skge)) + printk(KERN_INFO PFX "%s: enabling interface\n", dev->name); + + rx_size = skge->rx_ring.count * sizeof(struct skge_rx_desc); + tx_size = skge->tx_ring.count * sizeof(struct skge_tx_desc); + skge->mem_size = tx_size + rx_size; + skge->mem = pci_alloc_consistent(hw->pdev, skge->mem_size, &skge->dma); + if (!skge->mem) + return -ENOMEM; + + memset(skge->mem, 0, skge->mem_size); + + if ((err = skge_ring_alloc(&skge->rx_ring, skge->mem, skge->dma))) + goto free_pci_mem; + + if ((err = skge_rx_fill(skge))) + goto free_rx_ring; + + if ((err = skge_ring_alloc(&skge->tx_ring, skge->mem + rx_size, + skge->dma + rx_size))) + goto free_rx_ring; + + skge->tx_avail = skge->tx_ring.count - 1; + + /* Initialze MAC */ + if (hw->chip_id == CHIP_ID_GENESIS) + genesis_mac_init(hw, port); + else + yukon_mac_init(hw, port); + + /* Configure RAMbuffers */ + chunk = hw->ram_size / (isdualport(hw) ? 4 : 2); + ram_addr = hw->ram_offset + 2 * chunk * port; + + skge_ramset(hw, rxq[port], ram_addr, chunk); + skge_qset(skge, rxq[port], skge->rx_ring.to_clean); + + BUG_ON(skge->tx_ring.to_use != skge->tx_ring.to_clean); + skge_ramset(hw, txq[port], ram_addr+chunk, chunk); + skge_qset(skge, txq[port], skge->tx_ring.to_use); + + /* Start receiver BMU */ + wmb(); + skge_write8(hw, Q_ADDR(rxq[port], Q_CSR), CSR_START | CSR_IRQ_CL_F); + + return 0; + + free_rx_ring: + skge_rx_clean(skge); + kfree(skge->rx_ring.start); + free_pci_mem: + pci_free_consistent(hw->pdev, skge->mem_size, skge->mem, skge->dma); + + return err; +} + +static int skge_down(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + int port = skge->port; + + if (netif_msg_ifdown(skge)) + printk(KERN_INFO PFX "%s: disabling interface\n", dev->name); + + netif_stop_queue(dev); + + /* Stop transmitter */ + skge_write8(hw, Q_ADDR(txq[port], Q_CSR), CSR_STOP); + skge_write32(hw, RB_ADDR(txq[port], RB_CTRL), + RB_RST_SET|RB_DIS_OP_MD); + + if (hw->chip_id == CHIP_ID_GENESIS) + genesis_stop(skge); + else + yukon_stop(skge); + + /* Disable Force Sync bit and Enable Alloc bit */ + skge_write8(hw, SKGEMAC_REG(port, TXA_CTRL), + TXA_DIS_FSYNC | TXA_DIS_ALLOC | TXA_STOP_RC); + + /* Stop Interval Timer and Limit Counter of Tx Arbiter */ + skge_write32(hw, SKGEMAC_REG(port, TXA_ITI_INI), 0L); + skge_write32(hw, SKGEMAC_REG(port, TXA_LIM_INI), 0L); + + /* Reset PCI FIFO */ + skge_write32(hw, Q_ADDR(txq[port], Q_CSR), CSR_SET_RESET); + skge_write32(hw, RB_ADDR(txq[port], RB_CTRL), RB_RST_SET); + + /* Reset the RAM Buffer async Tx queue */ + skge_write8(hw, RB_ADDR(port == 0 ? Q_XA1 : Q_XA2, RB_CTRL), RB_RST_SET); + /* stop receiver */ + skge_write8(hw, Q_ADDR(rxq[port], Q_CSR), CSR_STOP); + skge_write32(hw, RB_ADDR(port ? Q_R2 : Q_R1, RB_CTRL), + RB_RST_SET|RB_DIS_OP_MD); + skge_write32(hw, Q_ADDR(rxq[port], Q_CSR), CSR_SET_RESET); + + if (hw->chip_id == CHIP_ID_GENESIS) { + skge_write8(hw, SKGEMAC_REG(port, TX_MFF_CTRL2), MFF_RST_SET); + skge_write8(hw, SKGEMAC_REG(port, RX_MFF_CTRL2), MFF_RST_SET); + skge_write8(hw, SKGEMAC_REG(port, TX_LED_CTRL), LED_STOP); + skge_write8(hw, SKGEMAC_REG(port, RX_LED_CTRL), LED_STOP); + } else { + skge_write8(hw, SKGEMAC_REG(port, RX_GMF_CTRL_T), GMF_RST_SET); + skge_write8(hw, SKGEMAC_REG(port, TX_GMF_CTRL_T), GMF_RST_SET); + } + + /* turn off led's */ + skge_write16(hw, B0_LED, LED_STAT_OFF); + + skge_tx_clean(skge); + skge_rx_clean(skge); + + kfree(skge->rx_ring.start); + kfree(skge->tx_ring.start); + pci_free_consistent(hw->pdev, skge->mem_size, skge->mem, skge->dma); + return 0; +} + +static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + struct skge_ring *ring = &skge->tx_ring; + struct skge_element *e; + struct skge_tx_desc *td; + int i; + u32 control, len; + u64 map; + unsigned long flags; + + if(unlikely(skb->len <= 0)) { + dev_kfree_skb_any(skb); + return NETDEV_TX_OK; + } + + len = skb_headlen(skb); + skb = skb_padto(skb, ETH_ZLEN); + if (!skb) + return NETDEV_TX_OK; + + local_irq_save(flags); + if (!spin_trylock(&skge->tx_lock)) { + /* Collision - tell upper layer to requeue */ + local_irq_restore(flags); + return NETDEV_TX_LOCKED; + } + + if (unlikely(skge->tx_avail < skb_shinfo(skb)->nr_frags +1)) { + netif_stop_queue(dev); + spin_unlock_irqrestore(&skge->tx_lock, flags); + + printk(KERN_WARNING PFX "%s: ring full when queue awake!\n", + dev->name); + return NETDEV_TX_BUSY; + } + + e = ring->to_use; + td = e->desc; + e->skb = skb; + map = pci_map_single(hw->pdev, skb->data, len, PCI_DMA_TODEVICE); + pci_unmap_addr_set(e, mapaddr, map); + pci_unmap_len_set(e, maplen, len); + + td->dma_lo = map; + td->dma_hi = map >> 32; + + if (skb->ip_summed == CHECKSUM_HW) { + const struct iphdr *ip + = (const struct iphdr *) skb->h.raw; + u32 offset = skb->h.raw - skb->data; + + /* + ** We have to use the opcode for tcp here, because the + ** opcode for udp is not working in the hardware yet + ** (Revision 2.0) + */ + if (ip->protocol == IPPROTO_UDP && + chip_rev(hw) == 0 && hw->chip_id == CHIP_ID_YUKON) + control = BMU_TCP_CHECK; + else + control = BMU_UDP_CHECK; + + td->csum_startval = 0; + td->csum_startpos = offset; + td->csum_writepos = offset + skb->csum; + } else + control = BMU_CHECK; + + if (!skb_shinfo(skb)->nr_frags) { + /* single buffer i.e. no fragments */ + control |= BMU_EOF| BMU_IRQ_EOF; + } else { + /* multiple fragments (note always hardware checksum) */ + struct skge_tx_desc *tf = td; + + control |= BMU_STFWD; + + for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { + skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; + + map = pci_map_page(hw->pdev, frag->page, frag->page_offset, + frag->size, PCI_DMA_TODEVICE); + + e = e->next; + e->skb = NULL; + tf = e->desc; + tf->dma_lo = map; + tf->dma_hi = (u64) map >> 32; + pci_unmap_addr_set(e, mapaddr, map); + pci_unmap_len_set(e, maplen, frag->size); + + tf->control = BMU_OWN | BMU_SW | BMU_STFWD | control | frag->size; + } + tf->control |= BMU_EOF | BMU_IRQ_EOF; + } + /* Make sure all the chained buffers are ready before + * updating start of chain. + */ + wmb(); + + td->control = BMU_OWN | BMU_SW | BMU_STF | control | len; + wmb(); + + skge_write8(skge->hw, Q_ADDR(txq[skge->port], Q_CSR), CSR_START); + + if (netif_msg_tx_queued(skge)) + printk(KERN_DEBUG "%s: tx queued, slot %d, len %d\n", + dev->name, e - ring->start, skb->len); + + ring->to_use = e->next; + skge->tx_avail -= skb_shinfo(skb)->nr_frags + 1; + if (skge->tx_avail <= MAX_SKB_FRAGS + 1) + netif_stop_queue(dev); + + skge->net_stats.tx_packets++; + skge->net_stats.tx_bytes += skb->len; + + dev->trans_start = jiffies; + spin_unlock_irqrestore(&skge->tx_lock, flags); + + return NETDEV_TX_OK; +} + +static inline void skge_tx_free(struct skge_hw *hw, struct skge_element *e) +{ + if (e->skb) { + pci_unmap_single(hw->pdev, + pci_unmap_addr(e, mapaddr), + pci_unmap_len(e, maplen), + PCI_DMA_TODEVICE); + dev_kfree_skb_any(e->skb); + e->skb = NULL; + } else { + pci_unmap_page(hw->pdev, + pci_unmap_addr(e, mapaddr), + pci_unmap_len(e, maplen), + PCI_DMA_TODEVICE); + } +} + +static void skge_tx_clean(struct skge_port *skge) +{ + struct skge_ring *ring = &skge->tx_ring; + struct skge_element *e; + unsigned long flags; + + spin_lock_irqsave(&skge->tx_lock, flags); + for (e = ring->to_clean; e != ring->to_use; e = e->next) { + ++skge->tx_avail; + skge_tx_free(skge->hw, e); + } + ring->to_clean = e; + spin_unlock_irqrestore(&skge->tx_lock, flags); +} + +static void skge_tx_timeout(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + + if (netif_msg_timer(skge)) + printk(KERN_DEBUG PFX "%s: tx timeout\n", dev->name); + + skge_write8(skge->hw, Q_ADDR(txq[skge->port], Q_CSR), CSR_STOP); + skge_tx_clean(skge); +} + +static int skge_change_mtu(struct net_device *dev, int new_mtu) +{ + int err = 0; + + if(new_mtu < ETH_ZLEN || new_mtu > ETH_JUMBO_MTU) + return -EINVAL; + + if (netif_running(dev)) + skge_down(dev); + dev->mtu = new_mtu; + if (netif_running(dev)) + err = skge_up(dev); + + return err; +} + +static void genesis_set_multicast(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + int port = skge->port; + int i, count = dev->mc_count; + struct dev_mc_list *list = dev->mc_list; + u32 mode; + u8 filter[8]; + + mode = skge_xm_read32(hw, port, XM_MODE); + mode |= XM_MD_ENA_HASH; + if (dev->flags & IFF_PROMISC) + mode |= XM_MD_ENA_PROM; + else + mode &= ~XM_MD_ENA_PROM; + + if (dev->flags & IFF_ALLMULTI) + memset(filter, 0xff, sizeof(filter)); + else { + memset(filter, 0, sizeof(filter)); + for(i = 0; list && i < count; i++, list = list->next) { + u32 crc = crc32_le(~0, list->dmi_addr, ETH_ALEN); + u8 bit = 63 - (crc & 63); + + filter[bit/8] |= 1 << (bit%8); + } + } + + skge_xm_outhash(hw, port, XM_HSM, filter); + + skge_xm_write32(hw, port, XM_MODE, mode); +} + +static void yukon_set_multicast(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + int port = skge->port; + struct dev_mc_list *list = dev->mc_list; + u16 reg; + u8 filter[8]; + + memset(filter, 0, sizeof(filter)); + + reg = skge_gma_read16(hw, port, GM_RX_CTRL); + reg |= GM_RXCR_UCF_ENA; + + if (dev->flags & IFF_PROMISC) /* promiscious */ + reg &= ~(GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA); + else if (dev->flags & IFF_ALLMULTI) /* all multicast */ + memset(filter, 0xff, sizeof(filter)); + else if (dev->mc_count == 0) /* no multicast */ + reg &= ~GM_RXCR_MCF_ENA; + else { + int i; + reg |= GM_RXCR_MCF_ENA; + + for(i = 0; list && i < dev->mc_count; i++, list = list->next) { + u32 bit = ether_crc(ETH_ALEN, list->dmi_addr) & 0x3f; + filter[bit/8] |= 1 << (bit%8); + } + } + + + skge_gma_write16(hw, port, GM_MC_ADDR_H1, + (u16)filter[0] | ((u16)filter[1] << 8)); + skge_gma_write16(hw, port, GM_MC_ADDR_H2, + (u16)filter[2] | ((u16)filter[3] << 8)); + skge_gma_write16(hw, port, GM_MC_ADDR_H3, + (u16)filter[4] | ((u16)filter[5] << 8)); + skge_gma_write16(hw, port, GM_MC_ADDR_H4, + (u16)filter[6] | ((u16)filter[7] << 8)); + + skge_gma_write16(hw, port, GM_RX_CTRL, reg); +} + +static inline int bad_phy_status(const struct skge_hw *hw, u32 status) +{ + if (hw->chip_id == CHIP_ID_GENESIS) + return (status & (XMR_FS_ERR | XMR_FS_2L_VLAN)) != 0; + else + return (status & GMR_FS_ANY_ERR) || + (status & GMR_FS_RX_OK) == 0; +} + +static void skge_rx_error(struct skge_port *skge, int slot, + u32 control, u32 status) +{ + if (netif_msg_rx_err(skge)) + printk(KERN_DEBUG PFX "%s: rx err, slot %d control 0x%x status 0x%x\n", + skge->netdev->name, slot, control, status); + + if ((control & (BMU_EOF|BMU_STF)) != (BMU_STF|BMU_EOF) + || (control & BMU_BBC) > skge->netdev->mtu + VLAN_ETH_HLEN) + skge->net_stats.rx_length_errors++; + else { + if (skge->hw->chip_id == CHIP_ID_GENESIS) { + if (status & (XMR_FS_RUNT|XMR_FS_LNG_ERR)) + skge->net_stats.rx_length_errors++; + if (status & XMR_FS_FRA_ERR) + skge->net_stats.rx_frame_errors++; + if (status & XMR_FS_FCS_ERR) + skge->net_stats.rx_crc_errors++; + } else { + if (status & (GMR_FS_LONG_ERR|GMR_FS_UN_SIZE)) + skge->net_stats.rx_length_errors++; + if (status & GMR_FS_FRAGMENT) + skge->net_stats.rx_frame_errors++; + if (status & GMR_FS_CRC_ERR) + skge->net_stats.rx_crc_errors++; + } + } +} + +static int skge_poll(struct net_device *dev, int *budget) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + struct skge_ring *ring = &skge->rx_ring; + struct skge_element *e; + unsigned int to_do = min(dev->quota, *budget); + unsigned int work_done = 0; + int done; + static const u32 irqmask[] = { IS_PORT_1, IS_PORT_2 }; + + for (e = ring->to_clean; e != ring->to_use && work_done < to_do; + e = e->next) { + struct skge_rx_desc *rd = e->desc; + struct sk_buff *skb = e->skb; + u32 control, len, status; + + rmb(); + control = rd->control; + if (control & BMU_OWN) + break; + + len = control & BMU_BBC; + e->skb = NULL; + + pci_unmap_single(hw->pdev, + pci_unmap_addr(e, mapaddr), + pci_unmap_len(e, maplen), + PCI_DMA_FROMDEVICE); + + status = rd->status; + if ((control & (BMU_EOF|BMU_STF)) != (BMU_STF|BMU_EOF) + || len > dev->mtu + VLAN_ETH_HLEN + || bad_phy_status(hw, status)) { + skge_rx_error(skge, e - ring->start, control, status); + dev_kfree_skb(skb); + continue; + } + + if (netif_msg_rx_status(skge)) + printk(KERN_DEBUG PFX "%s: rx slot %d status 0x%x len %d\n", + dev->name, e - ring->start, rd->status, len); + + skb_put(skb, len); + skb->protocol = eth_type_trans(skb, dev); + + if (skge->rx_csum) { + skb->csum = le16_to_cpu(rd->csum2); + skb->ip_summed = CHECKSUM_HW; + } + + dev->last_rx = jiffies; + skge->net_stats.rx_packets++; + skge->net_stats.rx_bytes += skb->len; + netif_receive_skb(skb); + + ++work_done; + } + ring->to_clean = e; + + *budget -= work_done; + dev->quota -= work_done; + done = work_done < to_do; + + if (skge_rx_fill(skge) != 0) + done = 0; + + /* restart receiver */ + wmb(); + skge_write8(hw, Q_ADDR(rxq[skge->port], Q_CSR), + CSR_START | CSR_IRQ_CL_F); + + if (done) { + local_irq_disable(); + hw->intr_mask |= irqmask[skge->port]; + /* Order is important since data can get interrupted */ + skge_write32(hw, B0_IMSK, hw->intr_mask); + __netif_rx_complete(dev); + local_irq_enable(); + } + + return !done; +} + +static inline void skge_tx_intr(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + struct skge_ring *ring = &skge->tx_ring; + struct skge_element *e; + + spin_lock(&skge->tx_lock); + for(e = ring->to_clean; e != ring->to_use; e = e->next) { + struct skge_tx_desc *td = e->desc; + u32 control; + + rmb(); + control = td->control; + if (control & BMU_OWN) + break; + + if (unlikely(netif_msg_tx_done(skge))) + printk(KERN_DEBUG PFX "%s: tx done slot %d status 0x%x\n", + dev->name, e - ring->start, td->status); + + skge_tx_free(hw, e); + e->skb = NULL; + ++skge->tx_avail; + } + ring->to_clean = e; + skge_write8(hw, Q_ADDR(txq[skge->port], Q_CSR), CSR_IRQ_CL_F); + + if (skge->tx_avail > MAX_SKB_FRAGS + 1) + netif_wake_queue(dev); + + spin_unlock(&skge->tx_lock); +} + +static void skge_mac_parity(struct skge_hw *hw, int port) +{ + if (hw->chip_id == CHIP_ID_GENESIS) + skge_write16(hw, SKGEMAC_REG(port, TX_MFF_CTRL1), + MFF_CLR_PERR); + else + /* HW-Bug #8: cleared by GMF_CLI_TX_FC instead of GMF_CLI_TX_PE */ + skge_write8(hw, SKGEMAC_REG(port, TX_GMF_CTRL_T), + (hw->chip_id == CHIP_ID_YUKON && chip_rev(hw) == 0) + ? GMF_CLI_TX_FC : GMF_CLI_TX_PE); +} + +static void skge_pci_clear(struct skge_hw *hw) +{ + u16 status; + + status = skge_read16(hw, SKGEPCI_REG(PCI_STATUS)); + skge_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); + skge_write16(hw, SKGEPCI_REG(PCI_STATUS), + status | PCI_STATUS_ERROR_BITS); + skge_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF); +} + +/* Handle device specific framing and timeout interrupts */ +static void skge_error_irq(struct skge_hw *hw) +{ + u32 hwstatus = skge_read32(hw, B0_HWE_ISRC); + + printk(KERN_ERR PFX "hardware error detected (status 0x%x)\n", + hwstatus); + + skge_pci_clear(hw); + + if (hw->chip_id == CHIP_ID_GENESIS) { + /* clear xmac errors */ + if (hwstatus & (IS_NO_STAT_M1|IS_NO_TIST_M1)) + + skge_write16(hw, SKGEMAC_REG(0, RX_MFF_CTRL1), MFF_CLR_INSTAT); + if (hwstatus & (IS_NO_STAT_M2|IS_NO_TIST_M2)) + skge_write16(hw, SKGEMAC_REG(0, RX_MFF_CTRL2), MFF_CLR_INSTAT); + } else { + if (hwstatus & IS_IRQ_SENSOR) { + /* no sensors on 32-bit Yukon */ + if ((skge_read16(hw, B0_CTST) & CS_BUS_SLOT_SZ) == 32) + hw->intr_mask &= ~IS_HW_ERR; + } + + } + + if (hwstatus & IS_RAM_RD_PAR) + skge_write16(hw, B3_RI_CTRL, RI_CLR_RD_PERR); + + if (hwstatus & IS_RAM_WR_PAR) + skge_write16(hw, B3_RI_CTRL, RI_CLR_WR_PERR); + + if (hwstatus & IS_M1_PAR_ERR) + skge_mac_parity(hw, 0); + + if (hwstatus & IS_M2_PAR_ERR) + skge_mac_parity(hw, 1); + + if (hwstatus & IS_R1_PAR_ERR) + skge_write32(hw, B0_R1_CSR, CSR_IRQ_CL_P); + + if (hwstatus & IS_R2_PAR_ERR) + skge_write32(hw, B0_R2_CSR, CSR_IRQ_CL_P); +} + +/* + * Interrrupt from PHY are handled in tasklet (soft irq) + * because accessing phy registers requires spin wait which might + * cause excess interrupt latency. + */ +static void skge_extirq(unsigned long data) +{ + struct skge_hw *hw = (struct skge_hw *) data; + int port; + + spin_lock(&hw->phy_lock); + for (port = 0; port < 2; port++) { + struct net_device *dev = hw->dev[port]; + + if (dev && netif_running(dev)) { + struct skge_port *skge = netdev_priv(dev); + + if (hw->chip_id != CHIP_ID_GENESIS) + yukon_phy_intr(skge); + else if (hw->phy_type == SK_PHY_BCOM) + genesis_bcom_intr(skge); + } + } + spin_unlock(&hw->phy_lock); + + local_irq_disable(); + hw->intr_mask |= IS_EXT_REG; + skge_write32(hw, B0_IMSK, hw->intr_mask); + local_irq_enable(); +} + +static irqreturn_t skge_intr(int irq, void *dev_id, struct pt_regs *regs) +{ + struct skge_hw *hw = dev_id; + u32 status = skge_read32(hw, B0_SP_ISRC); + + if (status == 0 || status == ~0) /* hotplug or shared irq */ + return IRQ_NONE; + + status &= hw->intr_mask; + + if (status & IS_R1_F) { + hw->intr_mask &= ~IS_R1_F; + netif_rx_schedule(hw->dev[0]); + } + + if (status & IS_R2_F) { + hw->intr_mask &= ~IS_R2_F; + netif_rx_schedule(hw->dev[1]); + } + + if (status & IS_XA1_F) + skge_tx_intr(hw->dev[0]); + + if (status & IS_XA2_F) + skge_tx_intr(hw->dev[1]); + + if (hw->chip_id == CHIP_ID_GENESIS) { + if (status & IS_MAC1) + genesis_intr(hw, 0); + + if (status & IS_MAC2) + genesis_intr(hw, 1); + } else { + if (status & IS_MAC1) + yukon_intr(hw, 0); + + if (status & IS_MAC2) + yukon_intr(hw, 1); + } + + if (status & IS_HW_ERR) + skge_error_irq(hw); + + if (status & IS_EXT_REG) { + hw->intr_mask &= ~IS_EXT_REG; + tasklet_schedule(&hw->ext_tasklet); + } + skge_write32(hw, B0_IMSK, hw->intr_mask); + + return IRQ_HANDLED; +} + +#ifdef CONFIG_NET_POLL_CONTROLLER +static void skge_netpoll(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + + disable_irq(dev->irq); + skge_intr(dev->irq, skge->hw, NULL); + enable_irq(dev->irq); +} +#endif + +/* TODO: use MIB counters instead?? */ +static struct net_device_stats *skge_get_stats(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + + return &skge->net_stats; +} + + +static int skge_set_mac_address(struct net_device *dev, void *p) +{ + struct skge_port *skge = netdev_priv(dev); + struct sockaddr *addr = p; + int err = 0; + + if (!is_valid_ether_addr(addr->sa_data)) + return -EADDRNOTAVAIL; + + skge_down(dev); + memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); + memcpy_toio(skge->hw->regs + B2_MAC_1 + skge->port*8, + dev->dev_addr, ETH_ALEN); + memcpy_toio(skge->hw->regs + B2_MAC_2 + skge->port*8, + dev->dev_addr, ETH_ALEN); + if (dev->flags & IFF_UP) + err = skge_up(dev); + return err; +} + +/* + * Setup the board data structure, but don't bring up + * the port(s) + */ +static __devinit struct skge_hw *skge_hwinit(struct pci_dev *pdev) +{ + struct skge_hw *hw; + u32 sz; + u16 ctst; + u8 t8; + int i, ports; + char *name = pci_name(pdev); + + hw = kmalloc(sizeof(*hw), GFP_KERNEL); + if (!hw) { + printk(KERN_ERR "skge %s: cannot allocate hardware struct\n", name); + goto err_out1; + } + + memset(hw, 0, sizeof(*hw)); + hw->pdev = pdev; + spin_lock_init(&hw->phy_lock); + tasklet_init(&hw->ext_tasklet, skge_extirq, (unsigned long) hw); + + hw->regs = ioremap_nocache(pci_resource_start(pdev, 0), 0x4000); + if (!hw->regs) { + printk(KERN_ERR "skge %s: cannot map device registers\n", name); + goto err_out2; + } + + ctst = skge_read16(hw, B0_CTST); + + /* do a SW reset */ + skge_write8(hw, B0_CTST, CS_RST_SET); + skge_write8(hw, B0_CTST, CS_RST_CLR); + + /* clear PCI errors, if any */ + skge_pci_clear(hw); + + skge_write8(hw, B0_CTST, CS_MRST_CLR); + + /* restore CLK_RUN bits (for Yukon-Lite) */ + skge_write16(hw, B0_CTST, + ctst & (CS_CLK_RUN_HOT|CS_CLK_RUN_RST|CS_CLK_RUN_ENA)); + + hw->chip_id = skge_read8(hw, B2_CHIP_ID); + hw->phy_type = skge_read8(hw, B2_E_1) & 0xf; + hw->pmd_type = skge_read8(hw, B2_PMD_TYP); + + switch(hw->chip_id) { + case CHIP_ID_GENESIS: + switch (hw->phy_type) { + case SK_PHY_XMAC: + hw->phy_addr = PHY_ADDR_XMAC; + break; + case SK_PHY_BCOM: + hw->phy_addr = PHY_ADDR_BCOM; + break; + default: + printk(KERN_ERR PFX "%s: unsupported phy type 0x%x\n", + name, hw->phy_type); + goto err_out3; + } + break; + + case CHIP_ID_YUKON: + case CHIP_ID_YUKON_LITE: + case CHIP_ID_YUKON_LP: + if (hw->phy_type < SK_PHY_MARV_COPPER && hw->pmd_type != 'S') + hw->phy_type = SK_PHY_MARV_COPPER; + + hw->phy_addr = PHY_ADDR_MARV; + if (!iscopper(hw)) + hw->phy_type = SK_PHY_MARV_FIBER; + + break; + + default: + printk(KERN_ERR PFX "%s: unsupported chip type 0x%x\n", + name, hw->chip_id); + goto err_out3; + } + + hw->mac_cfg = skge_read8(hw, B2_MAC_CFG); + ports = isdualport(hw) ? 2 : 1; + + /* read the adapters RAM size */ + t8 = skge_read8(hw, B2_E_0); + if (hw->chip_id == CHIP_ID_GENESIS) { + if (t8 == 3) { + /* special case: 4 x 64k x 36, offset = 0x80000 */ + hw->ram_size = 0x100000; + hw->ram_offset = 0x80000; + } else + hw->ram_size = t8 * 512; + } + else if (t8 == 0) + hw->ram_size = 0x20000; + else + hw->ram_size = t8 * 4096; + + pci_read_config_dword(hw->pdev, PCI_DEV_REG2, &sz); + hw->rom_size = 256 << ((sz & PCI_VPD_ROM_SZ) >> 14); + + if (hw->chip_id == CHIP_ID_GENESIS) + genesis_init(hw); +#if USE_TIST + else + skge_write8(hw, GMAC_TI_ST_CTRL, GMT_ST_START); +#endif + + /* + * looks like it ignores stuck sensor interrupts + */ + if (hw->chip_id != CHIP_ID_GENESIS) { + /* switch power to VCC (WA for VAUX problem) */ + skge_write8(hw, B0_POWER_CTRL, + PC_VAUX_ENA | PC_VCC_ENA | PC_VAUX_OFF | PC_VCC_ON); + if ((skge_read32(hw, B0_ISRC) & IS_HW_ERR) && + (skge_read32(hw, B0_HWE_ISRC & IS_IRQ_SENSOR))) + hw->intr_mask &= ~IS_HW_ERR; + + for (i = 0; i < ports; i++) { + skge_write16(hw, SKGEMAC_REG(i, GMAC_LINK_CTRL), GMLC_RST_SET); + skge_write16(hw, SKGEMAC_REG(i, GMAC_LINK_CTRL), GMLC_RST_CLR); + } + } + + /* turn off hardware timer (unused) */ + skge_write8(hw, B2_TI_CTRL, TIM_STOP); + skge_write8(hw, B2_TI_CTRL, TIM_CLR_IRQ); + skge_write8(hw, B0_LED, LED_STAT_ON); + + /* enable the Tx Arbiters */ + for (i = 0; i < ports; i++) + skge_write8(hw, SKGEMAC_REG(i, TXA_CTRL), TXA_ENA_ARB); + + /* Initialize ram interface */ + skge_write16(hw, B3_RI_CTRL, RI_RST_CLR); + + skge_write8(hw, B3_RI_WTO_R1, SK_RI_TO_53); + skge_write8(hw, B3_RI_WTO_XA1, SK_RI_TO_53); + skge_write8(hw, B3_RI_WTO_XS1, SK_RI_TO_53); + skge_write8(hw, B3_RI_RTO_R1, SK_RI_TO_53); + skge_write8(hw, B3_RI_RTO_XA1, SK_RI_TO_53); + skge_write8(hw, B3_RI_RTO_XS1, SK_RI_TO_53); + skge_write8(hw, B3_RI_WTO_R2, SK_RI_TO_53); + skge_write8(hw, B3_RI_WTO_XA2, SK_RI_TO_53); + skge_write8(hw, B3_RI_WTO_XS2, SK_RI_TO_53); + skge_write8(hw, B3_RI_RTO_R2, SK_RI_TO_53); + skge_write8(hw, B3_RI_RTO_XA2, SK_RI_TO_53); + skge_write8(hw, B3_RI_RTO_XS2, SK_RI_TO_53); + + skge_write32(hw, B0_HWE_IMSK, IS_ERR_MSK); + + hw->intr_mask = IS_HW_ERR | IS_EXT_REG | IS_PORT_1; + if (isdualport(hw)) + hw->intr_mask |= IS_PORT_2; + skge_write32(hw, B0_IMSK, hw->intr_mask); + + if (hw->chip_id != CHIP_ID_GENESIS) + skge_write8(hw, GMAC_IRQ_MSK, 0); + + for (i = 0; i < ports; i++) { + if (hw->chip_id == CHIP_ID_GENESIS) + genesis_reset(hw, i); + else + yukon_reset(hw, i); + } + + return hw; + + err_out3: + iounmap(hw->regs); + err_out2: + kfree(hw); + err_out1: + return NULL; +} + +/* Release board resources */ +static void skge_hwfree(struct skge_hw *hw) +{ + skge_write16(hw, B0_LED, LED_STAT_OFF); + iounmap(hw->regs); + kfree(hw); +} + +/* Initialize network device */ +static struct net_device *skge_devinit(struct skge_hw *hw, int port) +{ + struct skge_port *skge; + struct net_device *dev = alloc_etherdev(sizeof(*skge)); + int i; + + if (!dev) { + printk(KERN_ERR "skge etherdev alloc failed"); + return NULL; + } + + SET_MODULE_OWNER(dev); + SET_NETDEV_DEV(dev, &hw->pdev->dev); + dev->open = skge_up; + dev->stop = skge_down; + dev->hard_start_xmit = skge_xmit_frame; + dev->get_stats = skge_get_stats; + if (hw->chip_id == CHIP_ID_GENESIS) + dev->set_multicast_list = genesis_set_multicast; + else + dev->set_multicast_list = yukon_set_multicast; + + dev->set_mac_address = skge_set_mac_address; + dev->change_mtu = skge_change_mtu; + SET_ETHTOOL_OPS(dev, &skge_ethtool_ops); + dev->tx_timeout = skge_tx_timeout; + dev->watchdog_timeo = TX_WATCHDOG; + dev->poll = skge_poll; + dev->weight = NAPI_WEIGHT; +#ifdef CONFIG_NET_POLL_CONTROLLER + dev->poll_controller = skge_netpoll; +#endif + dev->irq = hw->pdev->irq; + + dev->features |= NETIF_F_LLTX; + if (hw->chip_id != CHIP_ID_GENESIS) + dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; + + skge = netdev_priv(dev); + skge->netdev = dev; + skge->hw = hw; + skge->msg_enable = netif_msg_init(debug, default_msg); + skge->rx_csum = 1; + skge->tx_ring.count = DEFAULT_TX_RING_SIZE; + skge->rx_ring.count = DEFAULT_RX_RING_SIZE; + + /* Auto speed and flow control */ + skge->autoneg = AUTONEG_ENABLE; + skge->flow_control = FLOW_MODE_SYMMETRIC; + hw->dev[port] = dev; + + skge->port = port; + + spin_lock_init(&skge->tx_lock); + + init_timer(&skge->link_check); + skge->link_check.function = skge_link_timer; + skge->link_check.data = (unsigned long) skge; + + init_timer(&skge->led_blink); + skge->led_blink.function = skge_blink_timer; + skge->led_blink.data = (unsigned long) skge; + + /* read the mac address */ + for (i = 0; i < ETH_ALEN; i++) + dev->dev_addr[i] = skge_read8(hw, B2_MAC_1 + port*8 + i); + + /* device is off until link detection */ + netif_carrier_off(dev); + netif_stop_queue(dev); + + return dev; +} + +/* Read the board name out of the EEPROM and print it */ +static void skge_board_info( struct skge_hw *hw) +{ + const struct net_device *dev = hw->dev[0]; + const u8 *ea = dev->dev_addr; + u16 cs; + u8 rom[256]; + + if (skge_vpd_read(hw->pdev, rom, 0, sizeof(rom)) + || rom[0] == 0xff || rom[1] == 0xff) { + printk(KERN_ERR "%s: eeprom read error\n", dev->name); + return; + } + + if (rom[0] != VPD_RES_ID) { + printk(KERN_ERR "%s: eeprom invalid id 0x%02x\n", + dev->name, rom[0]); + return; + } + + cs = skge_read16(hw, B0_CTST); + + printk(KERN_INFO "%s: %*.*s\n", + dev->name, rom[1], rom[1], (char *) rom+3); + printk(KERN_INFO " %s rev %d (PCI %d Mhz: %d-bit)" + " addr %02x:%02x:%02x:%02x:%02x:%02x\n", + hw->chip_id == CHIP_ID_GENESIS ? "Genesis" : + hw->chip_id == CHIP_ID_YUKON ? "Yukon" : + hw->chip_id == CHIP_ID_YUKON_LITE ? "Yukon Lite" : + hw->chip_id == CHIP_ID_YUKON_LP ? "Yukon LP" : + "Unknown chip", chip_rev(hw), + (cs & CS_BUS_CLOCK) ? 66 : 33, + (cs & CS_BUS_SLOT_SZ) ? 66 : 32, + ea[0],ea[1],ea[2],ea[3],ea[4],ea[5]); +} + +static int __devinit skge_probe(struct pci_dev *pdev, + const struct pci_device_id *ent) +{ + struct net_device *dev; + struct skge_hw *hw; + int err, using_dac = 0; + + if ((err = pci_enable_device(pdev))) { + printk(KERN_ERR "%s cannot enable PCI device\n", + pci_name(pdev)); + goto err_out; + } + + if ((err = pci_request_regions(pdev, DRV_NAME))) { + printk(KERN_ERR "%s cannot obtain PCI resources\n", + pci_name(pdev)); + goto err_out_disable_pdev; + } + + pci_set_master(pdev); + + if (!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK))) + using_dac = 1; + else if (!(err = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) { + printk(KERN_ERR "%s no usable DMA configuration\n", + pci_name(pdev)); + goto err_out_free_regions; + } + +#ifdef __BIG_ENDIAN + /* byte swap decriptors in hardware */ + { + u32 reg; + + pci_read_config_dword(pdev, PCI_DEV_REG2, ®); + reg |= SKGEPCI_REV_DESC; + pci_write_config_dword(pdev, PCI_DEV_REG2, reg); + } +#endif + + err = -ENOMEM; + hw = skge_hwinit(pdev); + if (!hw) + goto err_out_free_regions; + + if ((err = request_irq(pdev->irq, skge_intr, SA_SHIRQ, DRV_NAME, hw))) { + printk(KERN_ERR "%s: cannot assign irq %d\n", + pci_name(pdev), pdev->irq); + goto err_out_free_hw; + } + + if ((dev = skge_devinit(hw, 0)) == NULL) + goto err_out_free_irq; + + if (using_dac) + dev->features |= NETIF_F_HIGHDMA; + + if ((err = register_netdev(dev))) { + printk(KERN_ERR "%s: cannot register net device\n", + pci_name(pdev)); + goto err_out_free_netdev; + } + + pci_set_drvdata(pdev, hw); + + if (isdualport(hw)) { + struct net_device *dev1 = skge_devinit(hw, 1); + + if (using_dac) + dev1->features |= NETIF_F_HIGHDMA; + + if (dev1 && register_netdev(dev1)) { + hw->dev[1] = NULL; + free_netdev(dev1); + } + + } + + skge_board_info(hw); + + return 0; + +err_out_free_netdev: + free_netdev(dev); +err_out_free_irq: + free_irq(pdev->irq, hw); +err_out_free_hw: + skge_hwfree(hw); +err_out_free_regions: + pci_release_regions(pdev); +err_out_disable_pdev: + pci_disable_device(pdev); + pci_set_drvdata(pdev, NULL); +err_out: + return err; +} + +static void __devexit skge_remove(struct pci_dev *pdev) +{ + struct skge_hw *hw = pci_get_drvdata(pdev); + struct net_device *dev0, *dev1; + + if(!hw) + return; + + if ((dev1 = hw->dev[1])) + unregister_netdev(dev1); + dev0 = hw->dev[0]; + unregister_netdev(dev0); + + tasklet_kill(&hw->ext_tasklet); + free_irq(pdev->irq, hw); + pci_release_regions(pdev); + pci_disable_device(pdev); + if (dev1) + free_netdev(dev1); + free_netdev(dev0); + skge_hwfree(hw); + pci_set_drvdata(pdev, NULL); +} + +static struct pci_driver skge_driver = { + .name = DRV_NAME, + .id_table = skge_id_table, + .probe = skge_probe, + .remove = __devexit_p(skge_remove), +}; + +static int __init skge_init_module(void) +{ + return pci_module_init(&skge_driver); +} + +static void __exit skge_cleanup_module(void) +{ + pci_unregister_driver(&skge_driver); +} + +module_init(skge_init_module); +module_exit(skge_cleanup_module); diff -Nru a/drivers/net/skge.h b/drivers/net/skge.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/net/skge.h 2005-01-14 15:51:52 -08:00 @@ -0,0 +1,3005 @@ +/* + * Definitions for the new Marvell Yukon / SysKonenct driver. + */ +#ifndef _SKGE_H +#define _SKGE_H + +/* PCI config registers */ +#define PCI_DEV_REG1 0x40 +#define PCI_DEV_REG2 0x44 +#ifndef PCI_VPD +#define PCI_VPD 0x50 +#endif + +/* PCI_OUR_REG_2 32 bit Our Register 2 */ +enum { + PCI_VPD_WR_THR = 0xff<<24, /* Bit 31..24: VPD Write Threshold */ + PCI_DEV_SEL = 0x7f<<17, /* Bit 23..17: EEPROM Device Select */ + PCI_VPD_ROM_SZ = 7 <<14, /* Bit 16..14: VPD ROM Size */ + /* Bit 13..12: reserved */ + PCI_EN_DUMMY_RD = 1<<3, /* Enable Dummy Read */ + PCI_REV_DESC = 1<<2, /* Reverse Desc. Bytes */ + PCI_USEDATA64 = 1<<0, /* Use 64Bit Data bus ext */ +}; + +/* PCI_VPD_ADR_REG 16 bit VPD Address Register */ +enum { + PCI_VPD_FLAG = 1<<15, /* starts VPD rd/wr cycle */ + PCI_VPD_ADR_MSK =0x7fffL, /* Bit 14.. 0: VPD Address Mask */ + VPD_RES_ID = 0x82, + VPD_RES_READ = 0x90, + VPD_RES_WRITE = 0x81, + VPD_RES_END = 0x78, +}; + + +#define PCI_STATUS_ERROR_BITS (PCI_STATUS_DETECTED_PARITY | \ + PCI_STATUS_SIG_SYSTEM_ERROR | \ + PCI_STATUS_REC_MASTER_ABORT | \ + PCI_STATUS_REC_TARGET_ABORT | \ + PCI_STATUS_PARITY) + + +enum csr_regs { + B0_RAP = 0x0000, + B0_CTST = 0x0004, + B0_LED = 0x0006, + B0_POWER_CTRL = 0x0007, + B0_ISRC = 0x0008, + B0_IMSK = 0x000c, + B0_HWE_ISRC = 0x0010, + B0_HWE_IMSK = 0x0014, + B0_SP_ISRC = 0x0018, + B0_XM1_IMSK = 0x0020, + B0_XM1_ISRC = 0x0028, + B0_XM1_PHY_ADDR = 0x0030, + B0_XM1_PHY_DATA = 0x0034, + B0_XM2_IMSK = 0x0040, + B0_XM2_ISRC = 0x0048, + B0_XM2_PHY_ADDR = 0x0050, + B0_XM2_PHY_DATA = 0x0054, + B0_R1_CSR = 0x0060, + B0_R2_CSR = 0x0064, + B0_XS1_CSR = 0x0068, + B0_XA1_CSR = 0x006c, + B0_XS2_CSR = 0x0070, + B0_XA2_CSR = 0x0074, + + B2_MAC_1 = 0x0100, + B2_MAC_2 = 0x0108, + B2_MAC_3 = 0x0110, + B2_CONN_TYP = 0x0118, + B2_PMD_TYP = 0x0119, + B2_MAC_CFG = 0x011a, + B2_CHIP_ID = 0x011b, + B2_E_0 = 0x011c, + B2_E_1 = 0x011d, + B2_E_2 = 0x011e, + B2_E_3 = 0x011f, + B2_FAR = 0x0120, + B2_FDP = 0x0124, + B2_LD_CTRL = 0x0128, + B2_LD_TEST = 0x0129, + B2_TI_INI = 0x0130, + B2_TI_VAL = 0x0134, + B2_TI_CTRL = 0x0138, + B2_TI_TEST = 0x0139, + B2_IRQM_INI = 0x0140, + B2_IRQM_VAL = 0x0144, + B2_IRQM_CTRL = 0x0148, + B2_IRQM_TEST = 0x0149, + B2_IRQM_MSK = 0x014c, + B2_IRQM_HWE_MSK = 0x0150, + B2_TST_CTRL1 = 0x0158, + B2_TST_CTRL2 = 0x0159, + B2_GP_IO = 0x015c, + B2_I2C_CTRL = 0x0160, + B2_I2C_DATA = 0x0164, + B2_I2C_IRQ = 0x0168, + B2_I2C_SW = 0x016c, + B2_BSC_INI = 0x0170, + B2_BSC_VAL = 0x0174, + B2_BSC_CTRL = 0x0178, + B2_BSC_STAT = 0x0179, + B2_BSC_TST = 0x017a, + + B3_RAM_ADDR = 0x0180, + B3_RAM_DATA_LO = 0x0184, + B3_RAM_DATA_HI = 0x0188, + B3_RI_WTO_R1 = 0x0190, + B3_RI_WTO_XA1 = 0x0191, + B3_RI_WTO_XS1 = 0x0192, + B3_RI_RTO_R1 = 0x0193, + B3_RI_RTO_XA1 = 0x0194, + B3_RI_RTO_XS1 = 0x0195, + B3_RI_WTO_R2 = 0x0196, + B3_RI_WTO_XA2 = 0x0197, + B3_RI_WTO_XS2 = 0x0198, + B3_RI_RTO_R2 = 0x0199, + B3_RI_RTO_XA2 = 0x019a, + B3_RI_RTO_XS2 = 0x019b, + B3_RI_TO_VAL = 0x019c, + B3_RI_CTRL = 0x01a0, + B3_RI_TEST = 0x01a2, + B3_MA_TOINI_RX1 = 0x01b0, + B3_MA_TOINI_RX2 = 0x01b1, + B3_MA_TOINI_TX1 = 0x01b2, + B3_MA_TOINI_TX2 = 0x01b3, + B3_MA_TOVAL_RX1 = 0x01b4, + B3_MA_TOVAL_RX2 = 0x01b5, + B3_MA_TOVAL_TX1 = 0x01b6, + B3_MA_TOVAL_TX2 = 0x01b7, + B3_MA_TO_CTRL = 0x01b8, + B3_MA_TO_TEST = 0x01ba, + B3_MA_RCINI_RX1 = 0x01c0, + B3_MA_RCINI_RX2 = 0x01c1, + B3_MA_RCINI_TX1 = 0x01c2, + B3_MA_RCINI_TX2 = 0x01c3, + B3_MA_RCVAL_RX1 = 0x01c4, + B3_MA_RCVAL_RX2 = 0x01c5, + B3_MA_RCVAL_TX1 = 0x01c6, + B3_MA_RCVAL_TX2 = 0x01c7, + B3_MA_RC_CTRL = 0x01c8, + B3_MA_RC_TEST = 0x01ca, + B3_PA_TOINI_RX1 = 0x01d0, + B3_PA_TOINI_RX2 = 0x01d4, + B3_PA_TOINI_TX1 = 0x01d8, + B3_PA_TOINI_TX2 = 0x01dc, + B3_PA_TOVAL_RX1 = 0x01e0, + B3_PA_TOVAL_RX2 = 0x01e4, + B3_PA_TOVAL_TX1 = 0x01e8, + B3_PA_TOVAL_TX2 = 0x01ec, + B3_PA_CTRL = 0x01f0, + B3_PA_TEST = 0x01f2, +}; + +/* B0_CTST 16 bit Control/Status register */ +enum { + CS_CLK_RUN_HOT = 1<<13,/* CLK_RUN hot m. (YUKON-Lite only) */ + CS_CLK_RUN_RST = 1<<12,/* CLK_RUN reset (YUKON-Lite only) */ + CS_CLK_RUN_ENA = 1<<11,/* CLK_RUN enable (YUKON-Lite only) */ + CS_VAUX_AVAIL = 1<<10,/* VAUX available (YUKON only) */ + CS_BUS_CLOCK = 1<<9, /* Bus Clock 0/1 = 33/66 MHz */ + CS_BUS_SLOT_SZ = 1<<8, /* Slot Size 0/1 = 32/64 bit slot */ + CS_ST_SW_IRQ = 1<<7, /* Set IRQ SW Request */ + CS_CL_SW_IRQ = 1<<6, /* Clear IRQ SW Request */ + CS_STOP_DONE = 1<<5, /* Stop Master is finished */ + CS_STOP_MAST = 1<<4, /* Command Bit to stop the master */ + CS_MRST_CLR = 1<<3, /* Clear Master reset */ + CS_MRST_SET = 1<<2, /* Set Master reset */ + CS_RST_CLR = 1<<1, /* Clear Software reset */ + CS_RST_SET = 1, /* Set Software reset */ + +/* B0_LED 8 Bit LED register */ +/* Bit 7.. 2: reserved */ + LED_STAT_ON = 1<<1, /* Status LED on */ + LED_STAT_OFF = 1, /* Status LED off */ + +/* B0_POWER_CTRL 8 Bit Power Control reg (YUKON only) */ + PC_VAUX_ENA = 1<<7, /* Switch VAUX Enable */ + PC_VAUX_DIS = 1<<6, /* Switch VAUX Disable */ + PC_VCC_ENA = 1<<5, /* Switch VCC Enable */ + PC_VCC_DIS = 1<<4, /* Switch VCC Disable */ + PC_VAUX_ON = 1<<3, /* Switch VAUX On */ + PC_VAUX_OFF = 1<<2, /* Switch VAUX Off */ + PC_VCC_ON = 1<<1, /* Switch VCC On */ + PC_VCC_OFF = 1<<0, /* Switch VCC Off */ +}; + +/* B2_IRQM_MSK 32 bit IRQ Moderation Mask */ +enum { + IS_ALL_MSK = 0xbffffffful, /* All Interrupt bits */ + IS_HW_ERR = 1<<31, /* Interrupt HW Error */ + /* Bit 30: reserved */ + IS_PA_TO_RX1 = 1<<29, /* Packet Arb Timeout Rx1 */ + IS_PA_TO_RX2 = 1<<28, /* Packet Arb Timeout Rx2 */ + IS_PA_TO_TX1 = 1<<27, /* Packet Arb Timeout Tx1 */ + IS_PA_TO_TX2 = 1<<26, /* Packet Arb Timeout Tx2 */ + IS_I2C_READY = 1<<25, /* IRQ on end of I2C Tx */ + IS_IRQ_SW = 1<<24, /* SW forced IRQ */ + IS_EXT_REG = 1<<23, /* IRQ from LM80 or PHY (GENESIS only) */ + /* IRQ from PHY (YUKON only) */ + IS_TIMINT = 1<<22, /* IRQ from Timer */ + IS_MAC1 = 1<<21, /* IRQ from MAC 1 */ + IS_LNK_SYNC_M1 = 1<<20, /* Link Sync Cnt wrap MAC 1 */ + IS_MAC2 = 1<<19, /* IRQ from MAC 2 */ + IS_LNK_SYNC_M2 = 1<<18, /* Link Sync Cnt wrap MAC 2 */ +/* Receive Queue 1 */ + IS_R1_B = 1<<17, /* Q_R1 End of Buffer */ + IS_R1_F = 1<<16, /* Q_R1 End of Frame */ + IS_R1_C = 1<<15, /* Q_R1 Encoding Error */ +/* Receive Queue 2 */ + IS_R2_B = 1<<14, /* Q_R2 End of Buffer */ + IS_R2_F = 1<<13, /* Q_R2 End of Frame */ + IS_R2_C = 1<<12, /* Q_R2 Encoding Error */ +/* Synchronous Transmit Queue 1 */ + IS_XS1_B = 1<<11, /* Q_XS1 End of Buffer */ + IS_XS1_F = 1<<10, /* Q_XS1 End of Frame */ + IS_XS1_C = 1<<9, /* Q_XS1 Encoding Error */ +/* Asynchronous Transmit Queue 1 */ + IS_XA1_B = 1<<8, /* Q_XA1 End of Buffer */ + IS_XA1_F = 1<<7, /* Q_XA1 End of Frame */ + IS_XA1_C = 1<<6, /* Q_XA1 Encoding Error */ +/* Synchronous Transmit Queue 2 */ + IS_XS2_B = 1<<5, /* Q_XS2 End of Buffer */ + IS_XS2_F = 1<<4, /* Q_XS2 End of Frame */ + IS_XS2_C = 1<<3, /* Q_XS2 Encoding Error */ +/* Asynchronous Transmit Queue 2 */ + IS_XA2_B = 1<<2, /* Q_XA2 End of Buffer */ + IS_XA2_F = 1<<1, /* Q_XA2 End of Frame */ + IS_XA2_C = 1<<0, /* Q_XA2 Encoding Error */ + + IS_PORT_1 = IS_XA1_F| IS_R1_F| IS_MAC1, + IS_PORT_2 = IS_XA2_F| IS_R2_F| IS_MAC2, +}; + + +/* B2_IRQM_HWE_MSK 32 bit IRQ Moderation HW Error Mask */ +enum { + IS_ERR_MSK = 0x00000fff,/* All Error bits */ + + IS_IRQ_TIST_OV = 1<<13, /* Time Stamp Timer Overflow (YUKON only) */ + IS_IRQ_SENSOR = 1<<12, /* IRQ from Sensor (YUKON only) */ + IS_IRQ_MST_ERR = 1<<11, /* IRQ master error detected */ + IS_IRQ_STAT = 1<<10, /* IRQ status exception */ + IS_NO_STAT_M1 = 1<<9, /* No Rx Status from MAC 1 */ + IS_NO_STAT_M2 = 1<<8, /* No Rx Status from MAC 2 */ + IS_NO_TIST_M1 = 1<<7, /* No Time Stamp from MAC 1 */ + IS_NO_TIST_M2 = 1<<6, /* No Time Stamp from MAC 2 */ + IS_RAM_RD_PAR = 1<<5, /* RAM Read Parity Error */ + IS_RAM_WR_PAR = 1<<4, /* RAM Write Parity Error */ + IS_M1_PAR_ERR = 1<<3, /* MAC 1 Parity Error */ + IS_M2_PAR_ERR = 1<<2, /* MAC 2 Parity Error */ + IS_R1_PAR_ERR = 1<<1, /* Queue R1 Parity Error */ + IS_R2_PAR_ERR = 1<<0, /* Queue R2 Parity Error */ +}; + +/* B2_TST_CTRL1 8 bit Test Control Register 1 */ +enum { + TST_FRC_DPERR_MR = 1<<7, /* force DATAPERR on MST RD */ + TST_FRC_DPERR_MW = 1<<6, /* force DATAPERR on MST WR */ + TST_FRC_DPERR_TR = 1<<5, /* force DATAPERR on TRG RD */ + TST_FRC_DPERR_TW = 1<<4, /* force DATAPERR on TRG WR */ + TST_FRC_APERR_M = 1<<3, /* force ADDRPERR on MST */ + TST_FRC_APERR_T = 1<<2, /* force ADDRPERR on TRG */ + TST_CFG_WRITE_ON = 1<<1, /* Enable Config Reg WR */ + TST_CFG_WRITE_OFF= 1<<0, /* Disable Config Reg WR */ +}; + +/* B2_MAC_CFG 8 bit MAC Configuration / Chip Revision */ +enum { + CFG_CHIP_R_MSK = 0xf<<4, /* Bit 7.. 4: Chip Revision */ + /* Bit 3.. 2: reserved */ + CFG_DIS_M2_CLK = 1<<1, /* Disable Clock for 2nd MAC */ + CFG_SNG_MAC = 1<<0, /* MAC Config: 0=2 MACs / 1=1 MAC*/ +}; + +/* B2_CHIP_ID 8 bit Chip Identification Number */ +enum { + CHIP_ID_GENESIS = 0x0a, /* Chip ID for GENESIS */ + CHIP_ID_YUKON = 0xb0, /* Chip ID for YUKON */ + CHIP_ID_YUKON_LITE = 0xb1, /* Chip ID for YUKON-Lite (Rev. A1-A3) */ + CHIP_ID_YUKON_LP = 0xb2, /* Chip ID for YUKON-LP */ + CHIP_ID_YUKON_XL = 0xb3, /* Chip ID for YUKON-2 XL */ + CHIP_ID_YUKON_EC = 0xb6, /* Chip ID for YUKON-2 EC */ + CHIP_ID_YUKON_FE = 0xb7, /* Chip ID for YUKON-2 FE */ + + CHIP_REV_YU_LITE_A1 = 3, /* Chip Rev. for YUKON-Lite A1,A2 */ + CHIP_REV_YU_LITE_A3 = 7, /* Chip Rev. for YUKON-Lite A3 */ +}; + +/* B2_LD_TEST 8 bit EPROM loader test register */ +enum { + LD_T_ON = 1<<3, /* Loader Test mode on */ + LD_T_OFF = 1<<2, /* Loader Test mode off */ + LD_T_STEP = 1<<1, /* Decrement FPROM addr. Counter */ + LD_START = 1<<0, /* Start loading FPROM */ +}; + +/* B2_TI_CTRL 8 bit Timer control */ +/* B2_IRQM_CTRL 8 bit IRQ Moderation Timer Control */ +enum { + TIM_START = 1<<2, /* Start Timer */ + TIM_STOP = 1<<1, /* Stop Timer */ + TIM_CLR_IRQ = 1<<0, /* Clear Timer IRQ (!IRQM) */ +}; + +/* B2_TI_TEST 8 Bit Timer Test */ +/* B2_IRQM_TEST 8 bit IRQ Moderation Timer Test */ +/* B28_DPT_TST 8 bit Descriptor Poll Timer Test Reg */ +enum { + TIM_T_ON = 1<<2, /* Test mode on */ + TIM_T_OFF = 1<<1, /* Test mode off */ + TIM_T_STEP = 1<<0, /* Test step */ +}; + +/* B28_DPT_INI 32 bit Descriptor Poll Timer Init Val */ +/* B28_DPT_VAL 32 bit Descriptor Poll Timer Curr Val */ +/* B28_DPT_CTRL 8 bit Descriptor Poll Timer Ctrl Reg */ +enum { + DPT_MSK = 0x00ffffffL, /* Bit 23.. 0: Desc Poll Timer Bits */ + + DPT_START = 1<<1, /* Start Descriptor Poll Timer */ + DPT_STOP = 1<<0, /* Stop Descriptor Poll Timer */ +}; + +/* B2_GP_IO 32 bit General Purpose I/O Register */ +enum { + GP_DIR_9 = 1<<25, /* IO_9 direct, 0=In/1=Out */ + GP_DIR_8 = 1<<24, /* IO_8 direct, 0=In/1=Out */ + GP_DIR_7 = 1<<23, /* IO_7 direct, 0=In/1=Out */ + GP_DIR_6 = 1<<22, /* IO_6 direct, 0=In/1=Out */ + GP_DIR_5 = 1<<21, /* IO_5 direct, 0=In/1=Out */ + GP_DIR_4 = 1<<20, /* IO_4 direct, 0=In/1=Out */ + GP_DIR_3 = 1<<19, /* IO_3 direct, 0=In/1=Out */ + GP_DIR_2 = 1<<18, /* IO_2 direct, 0=In/1=Out */ + GP_DIR_1 = 1<<17, /* IO_1 direct, 0=In/1=Out */ + GP_DIR_0 = 1<<16, /* IO_0 direct, 0=In/1=Out */ + + GP_IO_9 = 1<<9, /* IO_9 pin */ + GP_IO_8 = 1<<8, /* IO_8 pin */ + GP_IO_7 = 1<<7, /* IO_7 pin */ + GP_IO_6 = 1<<6, /* IO_6 pin */ + GP_IO_5 = 1<<5, /* IO_5 pin */ + GP_IO_4 = 1<<4, /* IO_4 pin */ + GP_IO_3 = 1<<3, /* IO_3 pin */ + GP_IO_2 = 1<<2, /* IO_2 pin */ + GP_IO_1 = 1<<1, /* IO_1 pin */ + GP_IO_0 = 1<<0, /* IO_0 pin */ +}; + +/* Rx/Tx Path related Arbiter Test Registers */ +/* B3_MA_TO_TEST 16 bit MAC Arbiter Timeout Test Reg */ +/* B3_MA_RC_TEST 16 bit MAC Arbiter Recovery Test Reg */ +/* B3_PA_TEST 16 bit Packet Arbiter Test Register */ +/* Bit 15, 11, 7, and 3 are reserved in B3_PA_TEST */ +enum { + TX2_T_EV = 1<<15,/* TX2 Timeout/Recv Event occured */ + TX2_T_ON = 1<<14,/* TX2 Timeout/Recv Timer Test On */ + TX2_T_OFF = 1<<13,/* TX2 Timeout/Recv Timer Tst Off */ + TX2_T_STEP = 1<<12,/* TX2 Timeout/Recv Timer Step */ + TX1_T_EV = 1<<11,/* TX1 Timeout/Recv Event occured */ + TX1_T_ON = 1<<10,/* TX1 Timeout/Recv Timer Test On */ + TX1_T_OFF = 1<<9, /* TX1 Timeout/Recv Timer Tst Off */ + TX1_T_STEP = 1<<8, /* TX1 Timeout/Recv Timer Step */ + RX2_T_EV = 1<<7, /* RX2 Timeout/Recv Event occured */ + RX2_T_ON = 1<<6, /* RX2 Timeout/Recv Timer Test On */ + RX2_T_OFF = 1<<5, /* RX2 Timeout/Recv Timer Tst Off */ + RX2_T_STEP = 1<<4, /* RX2 Timeout/Recv Timer Step */ + RX1_T_EV = 1<<3, /* RX1 Timeout/Recv Event occured */ + RX1_T_ON = 1<<2, /* RX1 Timeout/Recv Timer Test On */ + RX1_T_OFF = 1<<1, /* RX1 Timeout/Recv Timer Tst Off */ + RX1_T_STEP = 1<<0, /* RX1 Timeout/Recv Timer Step */ +}; + +/* Descriptor Bit Definition */ +/* TxCtrl Transmit Buffer Control Field */ +/* RxCtrl Receive Buffer Control Field */ +enum { + BMU_OWN = 1<<31, /* OWN bit: 0=host/1=BMU */ + BMU_STF = 1<<30, /* Start of Frame */ + BMU_EOF = 1<<29, /* End of Frame */ + BMU_IRQ_EOB = 1<<28, /* Req "End of Buffer" IRQ */ + BMU_IRQ_EOF = 1<<27, /* Req "End of Frame" IRQ */ + /* TxCtrl specific bits */ + BMU_STFWD = 1<<26, /* (Tx) Store & Forward Frame */ + BMU_NO_FCS = 1<<25, /* (Tx) Disable MAC FCS (CRC) generation */ + BMU_SW = 1<<24, /* (Tx) 1 bit res. for SW use */ + /* RxCtrl specific bits */ + BMU_DEV_0 = 1<<26, /* (Rx) Transfer data to Dev0 */ + BMU_STAT_VAL = 1<<25, /* (Rx) Rx Status Valid */ + BMU_TIST_VAL = 1<<24, /* (Rx) Rx TimeStamp Valid */ + /* Bit 23..16: BMU Check Opcodes */ + BMU_CHECK = 0x55<<16, /* Default BMU check */ + BMU_TCP_CHECK = 0x56<<16, /* Descr with TCP ext */ + BMU_UDP_CHECK = 0x57<<16, /* Descr with UDP ext (YUKON only) */ + BMU_BBC = 0xffffL, /* Bit 15.. 0: Buffer Byte Counter */ +}; + +/* B2_BSC_CTRL 8 bit Blink Source Counter Control */ +enum { + BSC_START = 1<<1, /* Start Blink Source Counter */ + BSC_STOP = 1<<0, /* Stop Blink Source Counter */ +}; + +/* B2_BSC_STAT 8 bit Blink Source Counter Status */ +enum { + BSC_SRC = 1<<0, /* Blink Source, 0=Off / 1=On */ +}; + +/* B2_BSC_TST 16 bit Blink Source Counter Test Reg */ +enum { + BSC_T_ON = 1<<2, /* Test mode on */ + BSC_T_OFF = 1<<1, /* Test mode off */ + BSC_T_STEP = 1<<0, /* Test step */ +}; + +/* B3_RAM_ADDR 32 bit RAM Address, to read or write */ + /* Bit 31..19: reserved */ +#define RAM_ADR_RAN 0x0007ffffL /* Bit 18.. 0: RAM Address Range */ +/* RAM Interface Registers */ + +/* B3_RI_CTRL 16 bit RAM Iface Control Register */ +enum { + RI_CLR_RD_PERR = 1<<9, /* Clear IRQ RAM Read Parity Err */ + RI_CLR_WR_PERR = 1<<8, /* Clear IRQ RAM Write Parity Err*/ + + RI_RST_CLR = 1<<1, /* Clear RAM Interface Reset */ + RI_RST_SET = 1<<0, /* Set RAM Interface Reset */ +}; + +/* B3_RI_TEST 8 bit RAM Iface Test Register */ +enum { + RI_T_EV = 1<<3, /* Timeout Event occured */ + RI_T_ON = 1<<2, /* Timeout Timer Test On */ + RI_T_OFF = 1<<1, /* Timeout Timer Test Off */ + RI_T_STEP = 1<<0, /* Timeout Timer Step */ +}; + +/* MAC Arbiter Registers */ +/* B3_MA_TO_CTRL 16 bit MAC Arbiter Timeout Ctrl Reg */ +enum { + MA_FOE_ON = 1<<3, /* XMAC Fast Output Enable ON */ + MA_FOE_OFF = 1<<2, /* XMAC Fast Output Enable OFF */ + MA_RST_CLR = 1<<1, /* Clear MAC Arbiter Reset */ + MA_RST_SET = 1<<0, /* Set MAC Arbiter Reset */ + +}; + +/* Timeout values */ +#define SK_MAC_TO_53 72 /* MAC arbiter timeout */ +#define SK_PKT_TO_53 0x2000 /* Packet arbiter timeout */ +#define SK_PKT_TO_MAX 0xffff /* Maximum value */ +#define SK_RI_TO_53 36 /* RAM interface timeout */ + + +/* B3_MA_RC_CTRL 16 bit MAC Arbiter Recovery Ctrl Reg */ +enum { + MA_ENA_REC_TX2 = 1<<7, /* Enable Recovery Timer TX2 */ + MA_DIS_REC_TX2 = 1<<6, /* Disable Recovery Timer TX2 */ + MA_ENA_REC_TX1 = 1<<5, /* Enable Recovery Timer TX1 */ + MA_DIS_REC_TX1 = 1<<4, /* Disable Recovery Timer TX1 */ + MA_ENA_REC_RX2 = 1<<3, /* Enable Recovery Timer RX2 */ + MA_DIS_REC_RX2 = 1<<2, /* Disable Recovery Timer RX2 */ + MA_ENA_REC_RX1 = 1<<1, /* Enable Recovery Timer RX1 */ + MA_DIS_REC_RX1 = 1<<0, /* Disable Recovery Timer RX1 */ +}; + +/* Packet Arbiter Registers */ +/* B3_PA_CTRL 16 bit Packet Arbiter Ctrl Register */ +enum { + PA_CLR_TO_TX2 = 1<<13, /* Clear IRQ Packet Timeout TX2 */ + PA_CLR_TO_TX1 = 1<<12, /* Clear IRQ Packet Timeout TX1 */ + PA_CLR_TO_RX2 = 1<<11, /* Clear IRQ Packet Timeout RX2 */ + PA_CLR_TO_RX1 = 1<<10, /* Clear IRQ Packet Timeout RX1 */ + PA_ENA_TO_TX2 = 1<<9, /* Enable Timeout Timer TX2 */ + PA_DIS_TO_TX2 = 1<<8, /* Disable Timeout Timer TX2 */ + PA_ENA_TO_TX1 = 1<<7, /* Enable Timeout Timer TX1 */ + PA_DIS_TO_TX1 = 1<<6, /* Disable Timeout Timer TX1 */ + PA_ENA_TO_RX2 = 1<<5, /* Enable Timeout Timer RX2 */ + PA_DIS_TO_RX2 = 1<<4, /* Disable Timeout Timer RX2 */ + PA_ENA_TO_RX1 = 1<<3, /* Enable Timeout Timer RX1 */ + PA_DIS_TO_RX1 = 1<<2, /* Disable Timeout Timer RX1 */ + PA_RST_CLR = 1<<1, /* Clear MAC Arbiter Reset */ + PA_RST_SET = 1<<0, /* Set MAC Arbiter Reset */ +}; + +#define PA_ENA_TO_ALL (PA_ENA_TO_RX1 | PA_ENA_TO_RX2 |\ + PA_ENA_TO_TX1 | PA_ENA_TO_TX2) + + +/* Transmit Arbiter Registers MAC 1 and 2, use MR_ADDR() to access */ +/* TXA_ITI_INI 32 bit Tx Arb Interval Timer Init Val */ +/* TXA_ITI_VAL 32 bit Tx Arb Interval Timer Value */ +/* TXA_LIM_INI 32 bit Tx Arb Limit Counter Init Val */ +/* TXA_LIM_VAL 32 bit Tx Arb Limit Counter Value */ + +#define TXA_MAX_VAL 0x00ffffffUL /* Bit 23.. 0: Max TXA Timer/Cnt Val */ + +/* TXA_CTRL 8 bit Tx Arbiter Control Register */ +enum { + TXA_ENA_FSYNC = 1<<7, /* Enable force of sync Tx queue */ + TXA_DIS_FSYNC = 1<<6, /* Disable force of sync Tx queue */ + TXA_ENA_ALLOC = 1<<5, /* Enable alloc of free bandwidth */ + TXA_DIS_ALLOC = 1<<4, /* Disable alloc of free bandwidth */ + TXA_START_RC = 1<<3, /* Start sync Rate Control */ + TXA_STOP_RC = 1<<2, /* Stop sync Rate Control */ + TXA_ENA_ARB = 1<<1, /* Enable Tx Arbiter */ + TXA_DIS_ARB = 1<<0, /* Disable Tx Arbiter */ +}; + +/* + * Bank 4 - 5 + */ +/* Transmit Arbiter Registers MAC 1 and 2, use MR_ADDR() to access */ +enum { + TXA_ITI_INI = 0x0200,/* 32 bit Tx Arb Interval Timer Init Val*/ + TXA_ITI_VAL = 0x0204,/* 32 bit Tx Arb Interval Timer Value */ + TXA_LIM_INI = 0x0208,/* 32 bit Tx Arb Limit Counter Init Val */ + TXA_LIM_VAL = 0x020c,/* 32 bit Tx Arb Limit Counter Value */ + TXA_CTRL = 0x0210,/* 8 bit Tx Arbiter Control Register */ + TXA_TEST = 0x0211,/* 8 bit Tx Arbiter Test Register */ + TXA_STAT = 0x0212,/* 8 bit Tx Arbiter Status Register */ +}; + + +enum { + B6_EXT_REG = 0x0300,/* External registers (GENESIS only) */ + B7_CFG_SPC = 0x0380,/* copy of the Configuration register */ + B8_RQ1_REGS = 0x0400,/* Receive Queue 1 */ + B8_RQ2_REGS = 0x0480,/* Receive Queue 2 */ + B8_TS1_REGS = 0x0600,/* Transmit sync queue 1 */ + B8_TA1_REGS = 0x0680,/* Transmit async queue 1 */ + B8_TS2_REGS = 0x0700,/* Transmit sync queue 2 */ + B8_TA2_REGS = 0x0780,/* Transmit sync queue 2 */ + B16_RAM_REGS = 0x0800,/* RAM Buffer Registers */ +}; + +/* Queue Register Offsets, use Q_ADDR() to access */ +enum { + B8_Q_REGS = 0x0400, /* base of Queue registers */ + Q_D = 0x00, /* 8*32 bit Current Descriptor */ + Q_DA_L = 0x20, /* 32 bit Current Descriptor Address Low dWord */ + Q_DA_H = 0x24, /* 32 bit Current Descriptor Address High dWord */ + Q_AC_L = 0x28, /* 32 bit Current Address Counter Low dWord */ + Q_AC_H = 0x2c, /* 32 bit Current Address Counter High dWord */ + Q_BC = 0x30, /* 32 bit Current Byte Counter */ + Q_CSR = 0x34, /* 32 bit BMU Control/Status Register */ + Q_F = 0x38, /* 32 bit Flag Register */ + Q_T1 = 0x3c, /* 32 bit Test Register 1 */ + Q_T1_TR = 0x3c, /* 8 bit Test Register 1 Transfer SM */ + Q_T1_WR = 0x3d, /* 8 bit Test Register 1 Write Descriptor SM */ + Q_T1_RD = 0x3e, /* 8 bit Test Register 1 Read Descriptor SM */ + Q_T1_SV = 0x3f, /* 8 bit Test Register 1 Supervisor SM */ + Q_T2 = 0x40, /* 32 bit Test Register 2 */ + Q_T3 = 0x44, /* 32 bit Test Register 3 */ + +/* Yukon-2 */ + Q_DONE = 0x24, /* 16 bit Done Index (Yukon-2 only) */ + Q_WM = 0x40, /* 16 bit FIFO Watermark */ + Q_AL = 0x42, /* 8 bit FIFO Alignment */ + Q_RSP = 0x44, /* 16 bit FIFO Read Shadow Pointer */ + Q_RSL = 0x46, /* 8 bit FIFO Read Shadow Level */ + Q_RP = 0x48, /* 8 bit FIFO Read Pointer */ + Q_RL = 0x4a, /* 8 bit FIFO Read Level */ + Q_WP = 0x4c, /* 8 bit FIFO Write Pointer */ + Q_WSP = 0x4d, /* 8 bit FIFO Write Shadow Pointer */ + Q_WL = 0x4e, /* 8 bit FIFO Write Level */ + Q_WSL = 0x4f, /* 8 bit FIFO Write Shadow Level */ +}; +#define Q_ADDR(reg, offs) (B8_Q_REGS + (reg) + (offs)) + +/* RAM Buffer Register Offsets */ +enum { + + RB_START = 0x00,/* 32 bit RAM Buffer Start Address */ + RB_END = 0x04,/* 32 bit RAM Buffer End Address */ + RB_WP = 0x08,/* 32 bit RAM Buffer Write Pointer */ + RB_RP = 0x0c,/* 32 bit RAM Buffer Read Pointer */ + RB_RX_UTPP = 0x10,/* 32 bit Rx Upper Threshold, Pause Packet */ + RB_RX_LTPP = 0x14,/* 32 bit Rx Lower Threshold, Pause Packet */ + RB_RX_UTHP = 0x18,/* 32 bit Rx Upper Threshold, High Prio */ + RB_RX_LTHP = 0x1c,/* 32 bit Rx Lower Threshold, High Prio */ + /* 0x10 - 0x1f: reserved at Tx RAM Buffer Registers */ + RB_PC = 0x20,/* 32 bit RAM Buffer Packet Counter */ + RB_LEV = 0x24,/* 32 bit RAM Buffer Level Register */ + RB_CTRL = 0x28,/* 32 bit RAM Buffer Control Register */ + RB_TST1 = 0x29,/* 8 bit RAM Buffer Test Register 1 */ + RB_TST2 = 0x2a,/* 8 bit RAM Buffer Test Register 2 */ +}; + +/* Receive and Transmit Queues */ +enum { + Q_R1 = 0x0000, /* Receive Queue 1 */ + Q_R2 = 0x0080, /* Receive Queue 2 */ + Q_XS1 = 0x0200, /* Synchronous Transmit Queue 1 */ + Q_XA1 = 0x0280, /* Asynchronous Transmit Queue 1 */ + Q_XS2 = 0x0300, /* Synchronous Transmit Queue 2 */ + Q_XA2 = 0x0380, /* Asynchronous Transmit Queue 2 */ +}; + +/* Different MAC Types */ +enum { + SK_MAC_XMAC = 0, /* Xaqti XMAC II */ + SK_MAC_GMAC = 1, /* Marvell GMAC */ +}; + +/* Different PHY Types */ +enum { + SK_PHY_XMAC = 0,/* integrated in XMAC II */ + SK_PHY_BCOM = 1,/* Broadcom BCM5400 */ + SK_PHY_LONE = 2,/* Level One LXT1000 [not supported]*/ + SK_PHY_NAT = 3,/* National DP83891 [not supported] */ + SK_PHY_MARV_COPPER= 4,/* Marvell 88E1011S */ + SK_PHY_MARV_FIBER = 5,/* Marvell 88E1011S working on fiber */ +}; + +/* PHY addresses (bits 12..8 of PHY address reg) */ +enum { + PHY_ADDR_XMAC = 0<<8, + PHY_ADDR_BCOM = 1<<8, + PHY_ADDR_LONE = 3<<8, + PHY_ADDR_NAT = 0<<8, +/* GPHY address (bits 15..11 of SMI control reg) */ + PHY_ADDR_MARV = 0, +}; + +#define RB_ADDR(offs, queue) (B16_RAM_REGS + (queue) + (offs)) + +/* Receive MAC FIFO, Receive LED, and Link_Sync regs (GENESIS only) */ +enum { + RX_MFF_EA = 0x0c00,/* 32 bit Receive MAC FIFO End Address */ + RX_MFF_WP = 0x0c04,/* 32 bit Receive MAC FIFO Write Pointer */ + + RX_MFF_RP = 0x0c0c,/* 32 bit Receive MAC FIFO Read Pointer */ + RX_MFF_PC = 0x0c10,/* 32 bit Receive MAC FIFO Packet Cnt */ + RX_MFF_LEV = 0x0c14,/* 32 bit Receive MAC FIFO Level */ + RX_MFF_CTRL1 = 0x0c18,/* 16 bit Receive MAC FIFO Control Reg 1*/ + RX_MFF_STAT_TO = 0x0c1a,/* 8 bit Receive MAC Status Timeout */ + RX_MFF_TIST_TO = 0x0c1b,/* 8 bit Receive MAC Time Stamp Timeout */ + RX_MFF_CTRL2 = 0x0c1c,/* 8 bit Receive MAC FIFO Control Reg 2*/ + RX_MFF_TST1 = 0x0c1d,/* 8 bit Receive MAC FIFO Test Reg 1 */ + RX_MFF_TST2 = 0x0c1e,/* 8 bit Receive MAC FIFO Test Reg 2 */ + + RX_LED_INI = 0x0c20,/* 32 bit Receive LED Cnt Init Value */ + RX_LED_VAL = 0x0c24,/* 32 bit Receive LED Cnt Current Value */ + RX_LED_CTRL = 0x0c28,/* 8 bit Receive LED Cnt Control Reg */ + RX_LED_TST = 0x0c29,/* 8 bit Receive LED Cnt Test Register */ + + LNK_SYNC_INI = 0x0c30,/* 32 bit Link Sync Cnt Init Value */ + LNK_SYNC_VAL = 0x0c34,/* 32 bit Link Sync Cnt Current Value */ + LNK_SYNC_CTRL = 0x0c38,/* 8 bit Link Sync Cnt Control Register */ + LNK_SYNC_TST = 0x0c39,/* 8 bit Link Sync Cnt Test Register */ + LNK_LED_REG = 0x0c3c,/* 8 bit Link LED Register */ +}; + +/* Receive and Transmit MAC FIFO Registers (GENESIS only) */ +/* RX_MFF_CTRL1 16 bit Receive MAC FIFO Control Reg 1 */ +enum { + MFF_ENA_RDY_PAT = 1<<13, /* Enable Ready Patch */ + MFF_DIS_RDY_PAT = 1<<12, /* Disable Ready Patch */ + MFF_ENA_TIM_PAT = 1<<11, /* Enable Timing Patch */ + MFF_DIS_TIM_PAT = 1<<10, /* Disable Timing Patch */ + MFF_ENA_ALM_FUL = 1<<9, /* Enable AlmostFull Sign */ + MFF_DIS_ALM_FUL = 1<<8, /* Disable AlmostFull Sign */ + MFF_ENA_PAUSE = 1<<7, /* Enable Pause Signaling */ + MFF_DIS_PAUSE = 1<<6, /* Disable Pause Signaling */ + MFF_ENA_FLUSH = 1<<5, /* Enable Frame Flushing */ + MFF_DIS_FLUSH = 1<<4, /* Disable Frame Flushing */ + MFF_ENA_TIST = 1<<3, /* Enable Time Stamp Gener */ + MFF_DIS_TIST = 1<<2, /* Disable Time Stamp Gener */ + MFF_CLR_INTIST = 1<<1, /* Clear IRQ No Time Stamp */ + MFF_CLR_INSTAT = 1<<0, /* Clear IRQ No Status */ +#define MFF_RX_CTRL_DEF MFF_ENA_TIM_PAT +}; + +/* TX_MFF_CTRL1 16 bit Transmit MAC FIFO Control Reg 1 */ +enum { + MFF_CLR_PERR = 1<<15, /* Clear Parity Error IRQ */ + /* Bit 14: reserved */ + MFF_ENA_PKT_REC = 1<<13, /* Enable Packet Recovery */ + MFF_DIS_PKT_REC = 1<<12, /* Disable Packet Recovery */ + + MFF_ENA_W4E = 1<<7, /* Enable Wait for Empty */ + MFF_DIS_W4E = 1<<6, /* Disable Wait for Empty */ + + MFF_ENA_LOOPB = 1<<3, /* Enable Loopback */ + MFF_DIS_LOOPB = 1<<2, /* Disable Loopback */ + MFF_CLR_MAC_RST = 1<<1, /* Clear XMAC Reset */ + MFF_SET_MAC_RST = 1<<0, /* Set XMAC Reset */ +}; + +#define MFF_TX_CTRL_DEF (MFF_ENA_PKT_REC | MFF_ENA_TIM_PAT | MFF_ENA_FLUSH) + +/* RX_MFF_TST2 8 bit Receive MAC FIFO Test Register 2 */ +/* TX_MFF_TST2 8 bit Transmit MAC FIFO Test Register 2 */ +enum { + MFF_WSP_T_ON = 1<<6, /* Tx: Write Shadow Ptr TestOn */ + MFF_WSP_T_OFF = 1<<5, /* Tx: Write Shadow Ptr TstOff */ + MFF_WSP_INC = 1<<4, /* Tx: Write Shadow Ptr Increment */ + MFF_PC_DEC = 1<<3, /* Packet Counter Decrement */ + MFF_PC_T_ON = 1<<2, /* Packet Counter Test On */ + MFF_PC_T_OFF = 1<<1, /* Packet Counter Test Off */ + MFF_PC_INC = 1<<0, /* Packet Counter Increment */ +}; + +/* RX_MFF_TST1 8 bit Receive MAC FIFO Test Register 1 */ +/* TX_MFF_TST1 8 bit Transmit MAC FIFO Test Register 1 */ +enum { + MFF_WP_T_ON = 1<<6, /* Write Pointer Test On */ + MFF_WP_T_OFF = 1<<5, /* Write Pointer Test Off */ + MFF_WP_INC = 1<<4, /* Write Pointer Increm */ + + MFF_RP_T_ON = 1<<2, /* Read Pointer Test On */ + MFF_RP_T_OFF = 1<<1, /* Read Pointer Test Off */ + MFF_RP_DEC = 1<<0, /* Read Pointer Decrement */ +}; + +/* RX_MFF_CTRL2 8 bit Receive MAC FIFO Control Reg 2 */ +/* TX_MFF_CTRL2 8 bit Transmit MAC FIFO Control Reg 2 */ +enum { + MFF_ENA_OP_MD = 1<<3, /* Enable Operation Mode */ + MFF_DIS_OP_MD = 1<<2, /* Disable Operation Mode */ + MFF_RST_CLR = 1<<1, /* Clear MAC FIFO Reset */ + MFF_RST_SET = 1<<0, /* Set MAC FIFO Reset */ +}; + + +/* Link LED Counter Registers (GENESIS only) */ + +/* RX_LED_CTRL 8 bit Receive LED Cnt Control Reg */ +/* TX_LED_CTRL 8 bit Transmit LED Cnt Control Reg */ +/* LNK_SYNC_CTRL 8 bit Link Sync Cnt Control Register */ +enum { + LED_START = 1<<2, /* Start Timer */ + LED_STOP = 1<<1, /* Stop Timer */ + LED_STATE = 1<<0, /* Rx/Tx: LED State, 1=LED on */ +}; + +/* RX_LED_TST 8 bit Receive LED Cnt Test Register */ +/* TX_LED_TST 8 bit Transmit LED Cnt Test Register */ +/* LNK_SYNC_TST 8 bit Link Sync Cnt Test Register */ +enum { + LED_T_ON = 1<<2, /* LED Counter Test mode On */ + LED_T_OFF = 1<<1, /* LED Counter Test mode Off */ + LED_T_STEP = 1<<0, /* LED Counter Step */ +}; + +/* LNK_LED_REG 8 bit Link LED Register */ +enum { + LED_BLK_ON = 1<<5, /* Link LED Blinking On */ + LED_BLK_OFF = 1<<4, /* Link LED Blinking Off */ + LED_SYNC_ON = 1<<3, /* Use Sync Wire to switch LED */ + LED_SYNC_OFF = 1<<2, /* Disable Sync Wire Input */ + LED_ON = 1<<1, /* switch LED on */ + LED_OFF = 1<<0, /* switch LED off */ +}; + +/* Receive GMAC FIFO (YUKON and Yukon-2) */ +enum { + RX_GMF_EA = 0x0c40,/* 32 bit Rx GMAC FIFO End Address */ + RX_GMF_AF_THR = 0x0c44,/* 32 bit Rx GMAC FIFO Almost Full Thresh. */ + RX_GMF_CTRL_T = 0x0c48,/* 32 bit Rx GMAC FIFO Control/Test */ + RX_GMF_FL_MSK = 0x0c4c,/* 32 bit Rx GMAC FIFO Flush Mask */ + RX_GMF_FL_THR = 0x0c50,/* 32 bit Rx GMAC FIFO Flush Threshold */ + RX_GMF_TR_THR = 0x0c54,/* 32 bit Rx Truncation Threshold (Yukon-2) */ + + RX_GMF_VLAN = 0x0c5c,/* 32 bit Rx VLAN Type Register (Yukon-2) */ + RX_GMF_WP = 0x0c60,/* 32 bit Rx GMAC FIFO Write Pointer */ + + RX_GMF_WLEV = 0x0c68,/* 32 bit Rx GMAC FIFO Write Level */ + + RX_GMF_RP = 0x0c70,/* 32 bit Rx GMAC FIFO Read Pointer */ + + RX_GMF_RLEV = 0x0c78,/* 32 bit Rx GMAC FIFO Read Level */ +}; + + +/* TXA_TEST 8 bit Tx Arbiter Test Register */ +enum { + TXA_INT_T_ON = 1<<5, /* Tx Arb Interval Timer Test On */ + TXA_INT_T_OFF = 1<<4, /* Tx Arb Interval Timer Test Off */ + TXA_INT_T_STEP = 1<<3, /* Tx Arb Interval Timer Step */ + TXA_LIM_T_ON = 1<<2, /* Tx Arb Limit Timer Test On */ + TXA_LIM_T_OFF = 1<<1, /* Tx Arb Limit Timer Test Off */ + TXA_LIM_T_STEP = 1<<0, /* Tx Arb Limit Timer Step */ +}; + +/* TXA_STAT 8 bit Tx Arbiter Status Register */ +enum { + TXA_PRIO_XS = 1<<0, /* sync queue has prio to send */ +}; + + +/* Q_BC 32 bit Current Byte Counter */ + +/* BMU Control Status Registers */ +/* B0_R1_CSR 32 bit BMU Ctrl/Stat Rx Queue 1 */ +/* B0_R2_CSR 32 bit BMU Ctrl/Stat Rx Queue 2 */ +/* B0_XA1_CSR 32 bit BMU Ctrl/Stat Sync Tx Queue 1 */ +/* B0_XS1_CSR 32 bit BMU Ctrl/Stat Async Tx Queue 1 */ +/* B0_XA2_CSR 32 bit BMU Ctrl/Stat Sync Tx Queue 2 */ +/* B0_XS2_CSR 32 bit BMU Ctrl/Stat Async Tx Queue 2 */ +/* Q_CSR 32 bit BMU Control/Status Register */ + +enum { + CSR_SV_IDLE = 1<<24, /* BMU SM Idle */ + + CSR_DESC_CLR = 1<<21, /* Clear Reset for Descr */ + CSR_DESC_SET = 1<<20, /* Set Reset for Descr */ + CSR_FIFO_CLR = 1<<19, /* Clear Reset for FIFO */ + CSR_FIFO_SET = 1<<18, /* Set Reset for FIFO */ + CSR_HPI_RUN = 1<<17, /* Release HPI SM */ + CSR_HPI_RST = 1<<16, /* Reset HPI SM to Idle */ + CSR_SV_RUN = 1<<15, /* Release Supervisor SM */ + CSR_SV_RST = 1<<14, /* Reset Supervisor SM */ + CSR_DREAD_RUN = 1<<13, /* Release Descr Read SM */ + CSR_DREAD_RST = 1<<12, /* Reset Descr Read SM */ + CSR_DWRITE_RUN = 1<<11, /* Release Descr Write SM */ + CSR_DWRITE_RST = 1<<10, /* Reset Descr Write SM */ + CSR_TRANS_RUN = 1<<9, /* Release Transfer SM */ + CSR_TRANS_RST = 1<<8, /* Reset Transfer SM */ + CSR_ENA_POL = 1<<7, /* Enable Descr Polling */ + CSR_DIS_POL = 1<<6, /* Disable Descr Polling */ + CSR_STOP = 1<<5, /* Stop Rx/Tx Queue */ + CSR_START = 1<<4, /* Start Rx/Tx Queue */ + CSR_IRQ_CL_P = 1<<3, /* (Rx) Clear Parity IRQ */ + CSR_IRQ_CL_B = 1<<2, /* Clear EOB IRQ */ + CSR_IRQ_CL_F = 1<<1, /* Clear EOF IRQ */ + CSR_IRQ_CL_C = 1<<0, /* Clear ERR IRQ */ +}; + +#define CSR_SET_RESET (CSR_DESC_SET | CSR_FIFO_SET | CSR_HPI_RST |\ + CSR_SV_RST | CSR_DREAD_RST | CSR_DWRITE_RST |\ + CSR_TRANS_RST) +#define CSR_CLR_RESET (CSR_DESC_CLR | CSR_FIFO_CLR | CSR_HPI_RUN |\ + CSR_SV_RUN | CSR_DREAD_RUN | CSR_DWRITE_RUN |\ + CSR_TRANS_RUN) + +/* Q_F 32 bit Flag Register */ +enum { + F_ALM_FULL = 1<<27, /* Rx FIFO: almost full */ + F_EMPTY = 1<<27, /* Tx FIFO: empty flag */ + F_FIFO_EOF = 1<<26, /* Tag (EOF Flag) bit in FIFO */ + F_WM_REACHED = 1<<25, /* Watermark reached */ + + F_FIFO_LEVEL = 0x1fL<<16, /* Bit 23..16: # of Qwords in FIFO */ + F_WATER_MARK = 0x0007ffL, /* Bit 10.. 0: Watermark */ +}; + +/* RAM Buffer Register Offsets, use RB_ADDR(Queue, Offs) to access */ +/* RB_START 32 bit RAM Buffer Start Address */ +/* RB_END 32 bit RAM Buffer End Address */ +/* RB_WP 32 bit RAM Buffer Write Pointer */ +/* RB_RP 32 bit RAM Buffer Read Pointer */ +/* RB_RX_UTPP 32 bit Rx Upper Threshold, Pause Pack */ +/* RB_RX_LTPP 32 bit Rx Lower Threshold, Pause Pack */ +/* RB_RX_UTHP 32 bit Rx Upper Threshold, High Prio */ +/* RB_RX_LTHP 32 bit Rx Lower Threshold, High Prio */ +/* RB_PC 32 bit RAM Buffer Packet Counter */ +/* RB_LEV 32 bit RAM Buffer Level Register */ + +#define RB_MSK 0x0007ffff /* Bit 18.. 0: RAM Buffer Pointer Bits */ +/* RB_TST2 8 bit RAM Buffer Test Register 2 */ +/* RB_TST1 8 bit RAM Buffer Test Register 1 */ + +/* RB_CTRL 8 bit RAM Buffer Control Register */ +enum { + RB_ENA_STFWD = 1<<5, /* Enable Store & Forward */ + RB_DIS_STFWD = 1<<4, /* Disable Store & Forward */ + RB_ENA_OP_MD = 1<<3, /* Enable Operation Mode */ + RB_DIS_OP_MD = 1<<2, /* Disable Operation Mode */ + RB_RST_CLR = 1<<1, /* Clear RAM Buf STM Reset */ + RB_RST_SET = 1<<0, /* Set RAM Buf STM Reset */ +}; + +/* Transmit MAC FIFO and Transmit LED Registers (GENESIS only), */ +enum { + TX_MFF_EA = 0x0d00,/* 32 bit Transmit MAC FIFO End Address */ + TX_MFF_WP = 0x0d04,/* 32 bit Transmit MAC FIFO WR Pointer */ + TX_MFF_WSP = 0x0d08,/* 32 bit Transmit MAC FIFO WR Shadow Ptr */ + TX_MFF_RP = 0x0d0c,/* 32 bit Transmit MAC FIFO RD Pointer */ + TX_MFF_PC = 0x0d10,/* 32 bit Transmit MAC FIFO Packet Cnt */ + TX_MFF_LEV = 0x0d14,/* 32 bit Transmit MAC FIFO Level */ + TX_MFF_CTRL1 = 0x0d18,/* 16 bit Transmit MAC FIFO Ctrl Reg 1 */ + TX_MFF_WAF = 0x0d1a,/* 8 bit Transmit MAC Wait after flush */ + + TX_MFF_CTRL2 = 0x0d1c,/* 8 bit Transmit MAC FIFO Ctrl Reg 2 */ + TX_MFF_TST1 = 0x0d1d,/* 8 bit Transmit MAC FIFO Test Reg 1 */ + TX_MFF_TST2 = 0x0d1e,/* 8 bit Transmit MAC FIFO Test Reg 2 */ + + TX_LED_INI = 0x0d20,/* 32 bit Transmit LED Cnt Init Value */ + TX_LED_VAL = 0x0d24,/* 32 bit Transmit LED Cnt Current Val */ + TX_LED_CTRL = 0x0d28,/* 8 bit Transmit LED Cnt Control Reg */ + TX_LED_TST = 0x0d29,/* 8 bit Transmit LED Cnt Test Reg */ +}; + +/* Counter and Timer constants, for a host clock of 62.5 MHz */ +#define SK_XMIT_DUR 0x002faf08UL /* 50 ms */ +#define SK_BLK_DUR 0x01dcd650UL /* 500 ms */ + +#define SK_DPOLL_DEF 0x00ee6b28UL /* 250 ms at 62.5 MHz */ + +#define SK_DPOLL_MAX 0x00ffffffUL /* 268 ms at 62.5 MHz */ + /* 215 ms at 78.12 MHz */ + +#define SK_FACT_62 100 /* is given in percent */ +#define SK_FACT_53 85 /* on GENESIS: 53.12 MHz */ +#define SK_FACT_78 125 /* on YUKON: 78.12 MHz */ + + +/* Transmit GMAC FIFO (YUKON only) */ +enum { + TX_GMF_EA = 0x0d40,/* 32 bit Tx GMAC FIFO End Address */ + TX_GMF_AE_THR = 0x0d44,/* 32 bit Tx GMAC FIFO Almost Empty Thresh.*/ + TX_GMF_CTRL_T = 0x0d48,/* 32 bit Tx GMAC FIFO Control/Test */ + + TX_GMF_WP = 0x0d60,/* 32 bit Tx GMAC FIFO Write Pointer */ + TX_GMF_WSP = 0x0d64,/* 32 bit Tx GMAC FIFO Write Shadow Ptr. */ + TX_GMF_WLEV = 0x0d68,/* 32 bit Tx GMAC FIFO Write Level */ + + TX_GMF_RP = 0x0d70,/* 32 bit Tx GMAC FIFO Read Pointer */ + TX_GMF_RSTP = 0x0d74,/* 32 bit Tx GMAC FIFO Restart Pointer */ + TX_GMF_RLEV = 0x0d78,/* 32 bit Tx GMAC FIFO Read Level */ + + /* Descriptor Poll Timer Registers */ + B28_DPT_INI = 0x0e00,/* 24 bit Descriptor Poll Timer Init Val */ + B28_DPT_VAL = 0x0e04,/* 24 bit Descriptor Poll Timer Curr Val */ + B28_DPT_CTRL = 0x0e08,/* 8 bit Descriptor Poll Timer Ctrl Reg */ + + B28_DPT_TST = 0x0e0a,/* 8 bit Descriptor Poll Timer Test Reg */ + + /* Time Stamp Timer Registers (YUKON only) */ + GMAC_TI_ST_VAL = 0x0e14,/* 32 bit Time Stamp Timer Curr Val */ + GMAC_TI_ST_CTRL = 0x0e18,/* 8 bit Time Stamp Timer Ctrl Reg */ + GMAC_TI_ST_TST = 0x0e1a,/* 8 bit Time Stamp Timer Test Reg */ +}; + +/* Status BMU Registers (Yukon-2 only)*/ +enum { + STAT_CTRL = 0x0e80,/* 32 bit Status BMU Control Reg */ + STAT_LAST_IDX = 0x0e84,/* 16 bit Status BMU Last Index */ + /* 0x0e85 - 0x0e86: reserved */ + STAT_LIST_ADDR_LO = 0x0e88,/* 32 bit Status List Start Addr (low) */ + STAT_LIST_ADDR_HI = 0x0e8c,/* 32 bit Status List Start Addr (high) */ + STAT_TXA1_RIDX = 0x0e90,/* 16 bit Status TxA1 Report Index Reg */ + STAT_TXS1_RIDX = 0x0e92,/* 16 bit Status TxS1 Report Index Reg */ + STAT_TXA2_RIDX = 0x0e94,/* 16 bit Status TxA2 Report Index Reg */ + STAT_TXS2_RIDX = 0x0e96,/* 16 bit Status TxS2 Report Index Reg */ + STAT_TX_IDX_TH = 0x0e98,/* 16 bit Status Tx Index Threshold Reg */ + STAT_PUT_IDX = 0x0e9c,/* 16 bit Status Put Index Reg */ + +/* FIFO Control/Status Registers (Yukon-2 only)*/ + STAT_FIFO_WP = 0x0ea0,/* 8 bit Status FIFO Write Pointer Reg */ + STAT_FIFO_RP = 0x0ea4,/* 8 bit Status FIFO Read Pointer Reg */ + STAT_FIFO_RSP = 0x0ea6,/* 8 bit Status FIFO Read Shadow Ptr */ + STAT_FIFO_LEVEL = 0x0ea8,/* 8 bit Status FIFO Level Reg */ + STAT_FIFO_SHLVL = 0x0eaa,/* 8 bit Status FIFO Shadow Level Reg */ + STAT_FIFO_WM = 0x0eac,/* 8 bit Status FIFO Watermark Reg */ + STAT_FIFO_ISR_WM = 0x0ead,/* 8 bit Status FIFO ISR Watermark Reg */ + +/* Level and ISR Timer Registers (Yukon-2 only)*/ + STAT_LEV_TIMER_INI = 0x0eb0,/* 32 bit Level Timer Init. Value Reg */ + STAT_LEV_TIMER_CNT = 0x0eb4,/* 32 bit Level Timer Counter Reg */ + STAT_LEV_TIMER_CTRL = 0x0eb8,/* 8 bit Level Timer Control Reg */ + STAT_LEV_TIMER_TEST = 0x0eb9,/* 8 bit Level Timer Test Reg */ + STAT_TX_TIMER_INI = 0x0ec0,/* 32 bit Tx Timer Init. Value Reg */ + STAT_TX_TIMER_CNT = 0x0ec4,/* 32 bit Tx Timer Counter Reg */ + STAT_TX_TIMER_CTRL = 0x0ec8,/* 8 bit Tx Timer Control Reg */ + STAT_TX_TIMER_TEST = 0x0ec9,/* 8 bit Tx Timer Test Reg */ + STAT_ISR_TIMER_INI = 0x0ed0,/* 32 bit ISR Timer Init. Value Reg */ + STAT_ISR_TIMER_CNT = 0x0ed4,/* 32 bit ISR Timer Counter Reg */ + STAT_ISR_TIMER_CTRL = 0x0ed8,/* 8 bit ISR Timer Control Reg */ + STAT_ISR_TIMER_TEST = 0x0ed9,/* 8 bit ISR Timer Test Reg */ + + ST_LAST_IDX_MASK = 0x007f,/* Last Index Mask */ + ST_TXRP_IDX_MASK = 0x0fff,/* Tx Report Index Mask */ + ST_TXTH_IDX_MASK = 0x0fff,/* Tx Threshold Index Mask */ + ST_WM_IDX_MASK = 0x3f,/* FIFO Watermark Index Mask */ +}; + +enum { + LINKLED_OFF = 0x01, + LINKLED_ON = 0x02, + LINKLED_LINKSYNC_OFF = 0x04, + LINKLED_LINKSYNC_ON = 0x08, + LINKLED_BLINK_OFF = 0x10, + LINKLED_BLINK_ON = 0x20, +}; + +/* GMAC and GPHY Control Registers (YUKON only) */ +enum { + GMAC_CTRL = 0x0f00,/* 32 bit GMAC Control Reg */ + GPHY_CTRL = 0x0f04,/* 32 bit GPHY Control Reg */ + GMAC_IRQ_SRC = 0x0f08,/* 8 bit GMAC Interrupt Source Reg */ + GMAC_IRQ_MSK = 0x0f0c,/* 8 bit GMAC Interrupt Mask Reg */ + GMAC_LINK_CTRL = 0x0f10,/* 16 bit Link Control Reg */ + +/* Wake-up Frame Pattern Match Control Registers (YUKON only) */ + + WOL_REG_OFFS = 0x20,/* HW-Bug: Address is + 0x20 against spec. */ + + WOL_CTRL_STAT = 0x0f20,/* 16 bit WOL Control/Status Reg */ + WOL_MATCH_CTL = 0x0f22,/* 8 bit WOL Match Control Reg */ + WOL_MATCH_RES = 0x0f23,/* 8 bit WOL Match Result Reg */ + WOL_MAC_ADDR_LO = 0x0f24,/* 32 bit WOL MAC Address Low */ + WOL_MAC_ADDR_HI = 0x0f28,/* 16 bit WOL MAC Address High */ + WOL_PATT_PME = 0x0f2a,/* 8 bit WOL PME Match Enable (Yukon-2) */ + WOL_PATT_ASFM = 0x0f2b,/* 8 bit WOL ASF Match Enable (Yukon-2) */ + WOL_PATT_RPTR = 0x0f2c,/* 8 bit WOL Pattern Read Pointer */ + +/* WOL Pattern Length Registers (YUKON only) */ + + WOL_PATT_LEN_LO = 0x0f30,/* 32 bit WOL Pattern Length 3..0 */ + WOL_PATT_LEN_HI = 0x0f34,/* 24 bit WOL Pattern Length 6..4 */ + +/* WOL Pattern Counter Registers (YUKON only) */ + + WOL_PATT_CNT_0 = 0x0f38,/* 32 bit WOL Pattern Counter 3..0 */ + WOL_PATT_CNT_4 = 0x0f3c,/* 24 bit WOL Pattern Counter 6..4 */ +}; + +enum { + WOL_PATT_RAM_1 = 0x1000,/* WOL Pattern RAM Link 1 */ + WOL_PATT_RAM_2 = 0x1400,/* WOL Pattern RAM Link 2 */ +}; + +enum { + BASE_XMAC_1 = 0x2000,/* XMAC 1 registers */ + BASE_GMAC_1 = 0x2800,/* GMAC 1 registers */ + BASE_XMAC_2 = 0x3000,/* XMAC 2 registers */ + BASE_GMAC_2 = 0x3800,/* GMAC 2 registers */ +}; + +/* + * Receive Frame Status Encoding + */ +enum { + XMR_FS_LEN = 0x3fff<<18, /* Bit 31..18: Rx Frame Length */ + XMR_FS_2L_VLAN = 1<<17, /* Bit 17: tagged wh 2Lev VLAN ID*/ + XMR_FS_1_VLAN = 1<<16, /* Bit 16: tagged wh 1ev VLAN ID*/ + XMR_FS_BC = 1<<15, /* Bit 15: Broadcast Frame */ + XMR_FS_MC = 1<<14, /* Bit 14: Multicast Frame */ + XMR_FS_UC = 1<<13, /* Bit 13: Unicast Frame */ + + XMR_FS_BURST = 1<<11, /* Bit 11: Burst Mode */ + XMR_FS_CEX_ERR = 1<<10, /* Bit 10: Carrier Ext. Error */ + XMR_FS_802_3 = 1<<9, /* Bit 9: 802.3 Frame */ + XMR_FS_COL_ERR = 1<<8, /* Bit 8: Collision Error */ + XMR_FS_CAR_ERR = 1<<7, /* Bit 7: Carrier Event Error */ + XMR_FS_LEN_ERR = 1<<6, /* Bit 6: In-Range Length Error */ + XMR_FS_FRA_ERR = 1<<5, /* Bit 5: Framing Error */ + XMR_FS_RUNT = 1<<4, /* Bit 4: Runt Frame */ + XMR_FS_LNG_ERR = 1<<3, /* Bit 3: Giant (Jumbo) Frame */ + XMR_FS_FCS_ERR = 1<<2, /* Bit 2: Frame Check Sequ Err */ + XMR_FS_ERR = 1<<1, /* Bit 1: Frame Error */ + XMR_FS_MCTRL = 1<<0, /* Bit 0: MAC Control Packet */ + +/* + * XMR_FS_ERR will be set if + * XMR_FS_FCS_ERR, XMR_FS_LNG_ERR, XMR_FS_RUNT, + * XMR_FS_FRA_ERR, XMR_FS_LEN_ERR, or XMR_FS_CEX_ERR + * is set. XMR_FS_LNG_ERR and XMR_FS_LEN_ERR will issue + * XMR_FS_ERR unless the corresponding bit in the Receive Command + * Register is set. + */ +}; + +/* +,* XMAC-PHY Registers, indirect addressed over the XMAC + */ +enum { + PHY_XMAC_CTRL = 0x00,/* 16 bit r/w PHY Control Register */ + PHY_XMAC_STAT = 0x01,/* 16 bit r/w PHY Status Register */ + PHY_XMAC_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */ + PHY_XMAC_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */ + PHY_XMAC_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */ + PHY_XMAC_AUNE_LP = 0x05,/* 16 bit r/o Link Partner Abi Reg */ + PHY_XMAC_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */ + PHY_XMAC_NEPG = 0x07,/* 16 bit r/w Next Page Register */ + PHY_XMAC_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner */ + + PHY_XMAC_EXT_STAT = 0x0f,/* 16 bit r/o Ext Status Register */ + PHY_XMAC_RES_ABI = 0x10,/* 16 bit r/o PHY Resolved Ability */ +}; +/* + * Broadcom-PHY Registers, indirect addressed over XMAC + */ +enum { + PHY_BCOM_CTRL = 0x00,/* 16 bit r/w PHY Control Register */ + PHY_BCOM_STAT = 0x01,/* 16 bit r/o PHY Status Register */ + PHY_BCOM_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */ + PHY_BCOM_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */ + PHY_BCOM_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */ + PHY_BCOM_AUNE_LP = 0x05,/* 16 bit r/o Link Part Ability Reg */ + PHY_BCOM_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */ + PHY_BCOM_NEPG = 0x07,/* 16 bit r/w Next Page Register */ + PHY_BCOM_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner */ + /* Broadcom-specific registers */ + PHY_BCOM_1000T_CTRL = 0x09,/* 16 bit r/w 1000Base-T Control Reg */ + PHY_BCOM_1000T_STAT = 0x0a,/* 16 bit r/o 1000Base-T Status Reg */ + PHY_BCOM_EXT_STAT = 0x0f,/* 16 bit r/o Extended Status Reg */ + PHY_BCOM_P_EXT_CTRL = 0x10,/* 16 bit r/w PHY Extended Ctrl Reg */ + PHY_BCOM_P_EXT_STAT = 0x11,/* 16 bit r/o PHY Extended Stat Reg */ + PHY_BCOM_RE_CTR = 0x12,/* 16 bit r/w Receive Error Counter */ + PHY_BCOM_FC_CTR = 0x13,/* 16 bit r/w False Carrier Sense Cnt */ + PHY_BCOM_RNO_CTR = 0x14,/* 16 bit r/w Receiver NOT_OK Cnt */ + + PHY_BCOM_AUX_CTRL = 0x18,/* 16 bit r/w Auxiliary Control Reg */ + PHY_BCOM_AUX_STAT = 0x19,/* 16 bit r/o Auxiliary Stat Summary */ + PHY_BCOM_INT_STAT = 0x1a,/* 16 bit r/o Interrupt Status Reg */ + PHY_BCOM_INT_MASK = 0x1b,/* 16 bit r/w Interrupt Mask Reg */ +}; + +/* + * Marvel-PHY Registers, indirect addressed over GMAC + */ +enum { + PHY_MARV_CTRL = 0x00,/* 16 bit r/w PHY Control Register */ + PHY_MARV_STAT = 0x01,/* 16 bit r/o PHY Status Register */ + PHY_MARV_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */ + PHY_MARV_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */ + PHY_MARV_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */ + PHY_MARV_AUNE_LP = 0x05,/* 16 bit r/o Link Part Ability Reg */ + PHY_MARV_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */ + PHY_MARV_NEPG = 0x07,/* 16 bit r/w Next Page Register */ + PHY_MARV_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner */ + /* Marvel-specific registers */ + PHY_MARV_1000T_CTRL = 0x09,/* 16 bit r/w 1000Base-T Control Reg */ + PHY_MARV_1000T_STAT = 0x0a,/* 16 bit r/o 1000Base-T Status Reg */ + PHY_MARV_EXT_STAT = 0x0f,/* 16 bit r/o Extended Status Reg */ + PHY_MARV_PHY_CTRL = 0x10,/* 16 bit r/w PHY Specific Ctrl Reg */ + PHY_MARV_PHY_STAT = 0x11,/* 16 bit r/o PHY Specific Stat Reg */ + PHY_MARV_INT_MASK = 0x12,/* 16 bit r/w Interrupt Mask Reg */ + PHY_MARV_INT_STAT = 0x13,/* 16 bit r/o Interrupt Status Reg */ + PHY_MARV_EXT_CTRL = 0x14,/* 16 bit r/w Ext. PHY Specific Ctrl */ + PHY_MARV_RXE_CNT = 0x15,/* 16 bit r/w Receive Error Counter */ + PHY_MARV_EXT_ADR = 0x16,/* 16 bit r/w Ext. Ad. for Cable Diag. */ + PHY_MARV_PORT_IRQ = 0x17,/* 16 bit r/o Port 0 IRQ (88E1111 only) */ + PHY_MARV_LED_CTRL = 0x18,/* 16 bit r/w LED Control Reg */ + PHY_MARV_LED_OVER = 0x19,/* 16 bit r/w Manual LED Override Reg */ + PHY_MARV_EXT_CTRL_2 = 0x1a,/* 16 bit r/w Ext. PHY Specific Ctrl 2 */ + PHY_MARV_EXT_P_STAT = 0x1b,/* 16 bit r/w Ext. PHY Spec. Stat Reg */ + PHY_MARV_CABLE_DIAG = 0x1c,/* 16 bit r/o Cable Diagnostic Reg */ + PHY_MARV_PAGE_ADDR = 0x1d,/* 16 bit r/w Extended Page Address Reg */ + PHY_MARV_PAGE_DATA = 0x1e,/* 16 bit r/w Extended Page Data Reg */ + +/* for 10/100 Fast Ethernet PHY (88E3082 only) */ + PHY_MARV_FE_LED_PAR = 0x16,/* 16 bit r/w LED Parallel Select Reg. */ + PHY_MARV_FE_LED_SER = 0x17,/* 16 bit r/w LED Stream Select S. LED */ + PHY_MARV_FE_VCT_TX = 0x1a,/* 16 bit r/w VCT Reg. for TXP/N Pins */ + PHY_MARV_FE_VCT_RX = 0x1b,/* 16 bit r/o VCT Reg. for RXP/N Pins */ + PHY_MARV_FE_SPEC_2 = 0x1c,/* 16 bit r/w Specific Control Reg. 2 */ +}; + +/* Level One-PHY Registers, indirect addressed over XMAC */ +enum { + PHY_LONE_CTRL = 0x00,/* 16 bit r/w PHY Control Register */ + PHY_LONE_STAT = 0x01,/* 16 bit r/o PHY Status Register */ + PHY_LONE_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */ + PHY_LONE_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */ + PHY_LONE_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */ + PHY_LONE_AUNE_LP = 0x05,/* 16 bit r/o Link Part Ability Reg */ + PHY_LONE_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */ + PHY_LONE_NEPG = 0x07,/* 16 bit r/w Next Page Register */ + PHY_LONE_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner */ + /* Level One-specific registers */ + PHY_LONE_1000T_CTRL = 0x09,/* 16 bit r/w 1000Base-T Control Reg */ + PHY_LONE_1000T_STAT = 0x0a,/* 16 bit r/o 1000Base-T Status Reg */ + PHY_LONE_EXT_STAT = 0x0f,/* 16 bit r/o Extended Status Reg */ + PHY_LONE_PORT_CFG = 0x10,/* 16 bit r/w Port Configuration Reg*/ + PHY_LONE_Q_STAT = 0x11,/* 16 bit r/o Quick Status Reg */ + PHY_LONE_INT_ENAB = 0x12,/* 16 bit r/w Interrupt Enable Reg */ + PHY_LONE_INT_STAT = 0x13,/* 16 bit r/o Interrupt Status Reg */ + PHY_LONE_LED_CFG = 0x14,/* 16 bit r/w LED Configuration Reg */ + PHY_LONE_PORT_CTRL = 0x15,/* 16 bit r/w Port Control Reg */ + PHY_LONE_CIM = 0x16,/* 16 bit r/o CIM Reg */ +}; + +/* National-PHY Registers, indirect addressed over XMAC */ +enum { + PHY_NAT_CTRL = 0x00,/* 16 bit r/w PHY Control Register */ + PHY_NAT_STAT = 0x01,/* 16 bit r/w PHY Status Register */ + PHY_NAT_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */ + PHY_NAT_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */ + PHY_NAT_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */ + PHY_NAT_AUNE_LP = 0x05,/* 16 bit r/o Link Partner Ability Reg */ + PHY_NAT_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */ + PHY_NAT_NEPG = 0x07,/* 16 bit r/w Next Page Register */ + PHY_NAT_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner Reg */ + /* National-specific registers */ + PHY_NAT_1000T_CTRL = 0x09,/* 16 bit r/w 1000Base-T Control Reg */ + PHY_NAT_1000T_STAT = 0x0a,/* 16 bit r/o 1000Base-T Status Reg */ + PHY_NAT_EXT_STAT = 0x0f,/* 16 bit r/o Extended Status Register */ + PHY_NAT_EXT_CTRL1 = 0x10,/* 16 bit r/o Extended Control Reg1 */ + PHY_NAT_Q_STAT1 = 0x11,/* 16 bit r/o Quick Status Reg1 */ + PHY_NAT_10B_OP = 0x12,/* 16 bit r/o 10Base-T Operations Reg */ + PHY_NAT_EXT_CTRL2 = 0x13,/* 16 bit r/o Extended Control Reg1 */ + PHY_NAT_Q_STAT2 = 0x14,/* 16 bit r/o Quick Status Reg2 */ + + PHY_NAT_PHY_ADDR = 0x19,/* 16 bit r/o PHY Address Register */ +}; + +enum { + PHY_CT_RESET = 1<<15, /* Bit 15: (sc) clear all PHY related regs */ + PHY_CT_LOOP = 1<<14, /* Bit 14: enable Loopback over PHY */ + PHY_CT_SPS_LSB = 1<<13, /* Bit 13: Speed select, lower bit */ + PHY_CT_ANE = 1<<12, /* Bit 12: Auto-Negotiation Enabled */ + PHY_CT_PDOWN = 1<<11, /* Bit 11: Power Down Mode */ + PHY_CT_ISOL = 1<<10, /* Bit 10: Isolate Mode */ + PHY_CT_RE_CFG = 1<<9, /* Bit 9: (sc) Restart Auto-Negotiation */ + PHY_CT_DUP_MD = 1<<8, /* Bit 8: Duplex Mode */ + PHY_CT_COL_TST = 1<<7, /* Bit 7: Collision Test enabled */ + PHY_CT_SPS_MSB = 1<<6, /* Bit 6: Speed select, upper bit */ +}; + +enum { + PHY_CT_SP1000 = PHY_CT_SPS_MSB, /* enable speed of 1000 Mbps */ + PHY_CT_SP100 = PHY_CT_SPS_LSB, /* enable speed of 100 Mbps */ + PHY_CT_SP10 = 0, /* enable speed of 10 Mbps */ +}; + +enum { + PHY_ST_EXT_ST = 1<<8, /* Bit 8: Extended Status Present */ + + PHY_ST_PRE_SUP = 1<<6, /* Bit 6: Preamble Suppression */ + PHY_ST_AN_OVER = 1<<5, /* Bit 5: Auto-Negotiation Over */ + PHY_ST_REM_FLT = 1<<4, /* Bit 4: Remote Fault Condition Occured */ + PHY_ST_AN_CAP = 1<<3, /* Bit 3: Auto-Negotiation Capability */ + PHY_ST_LSYNC = 1<<2, /* Bit 2: Link Synchronized */ + PHY_ST_JAB_DET = 1<<1, /* Bit 1: Jabber Detected */ + PHY_ST_EXT_REG = 1<<0, /* Bit 0: Extended Register available */ +}; + +enum { + PHY_I1_OUI_MSK = 0x3f<<10, /* Bit 15..10: Organization Unique ID */ + PHY_I1_MOD_NUM = 0x3f<<4, /* Bit 9.. 4: Model Number */ + PHY_I1_REV_MSK = 0xf, /* Bit 3.. 0: Revision Number */ +}; + +/* different Broadcom PHY Ids */ +enum { + PHY_BCOM_ID1_A1 = 0x6041, + PHY_BCOM_ID1_B2 = 0x6043, + PHY_BCOM_ID1_C0 = 0x6044, + PHY_BCOM_ID1_C5 = 0x6047, +}; + +/* different Marvell PHY Ids */ +enum { + PHY_MARV_ID0_VAL= 0x0141, /* Marvell Unique Identifier */ + PHY_MARV_ID1_B0 = 0x0C23, /* Yukon (PHY 88E1011) */ + PHY_MARV_ID1_B2 = 0x0C25, /* Yukon-Plus (PHY 88E1011) */ + PHY_MARV_ID1_C2 = 0x0CC2, /* Yukon-EC (PHY 88E1111) */ + PHY_MARV_ID1_Y2 = 0x0C91, /* Yukon-2 (PHY 88E1112) */ +}; + +enum { + PHY_AN_NXT_PG = 1<<15, /* Bit 15: Request Next Page */ + PHY_X_AN_ACK = 1<<14, /* Bit 14: (ro) Acknowledge Received */ + PHY_X_AN_RFB = 3<<12,/* Bit 13..12: Remote Fault Bits */ + + PHY_X_AN_PAUSE = 3<<7,/* Bit 8.. 7: Pause Bits */ + PHY_X_AN_HD = 1<<6, /* Bit 6: Half Duplex */ + PHY_X_AN_FD = 1<<5, /* Bit 5: Full Duplex */ +}; + +enum { + PHY_B_AN_RF = 1<<13, /* Bit 13: Remote Fault */ + + PHY_B_AN_ASP = 1<<11, /* Bit 11: Asymmetric Pause */ + PHY_B_AN_PC = 1<<10, /* Bit 10: Pause Capable */ + PHY_B_AN_SEL = 0x1f, /* Bit 4..0: Selector Field, 00001=Ethernet*/ +}; + +enum { + PHY_L_AN_RF = 1<<13, /* Bit 13: Remote Fault */ + /* Bit 12: reserved */ + PHY_L_AN_ASP = 1<<11, /* Bit 11: Asymmetric Pause */ + PHY_L_AN_PC = 1<<10, /* Bit 10: Pause Capable */ + + PHY_L_AN_SEL = 0x1f, /* Bit 4..0: Selector Field, 00001=Ethernet*/ +}; + +/* PHY_NAT_AUNE_ADV 16 bit r/w Auto-Negotiation Advertisement */ +/* PHY_NAT_AUNE_LP 16 bit r/o Link Partner Ability Reg *****/ +/* PHY_AN_NXT_PG (see XMAC) Bit 15: Request Next Page */ +enum { + PHY_N_AN_RF = 1<<13, /* Bit 13: Remote Fault */ + + PHY_N_AN_100F = 1<<11, /* Bit 11: 100Base-T2 FD Support */ + PHY_N_AN_100H = 1<<10, /* Bit 10: 100Base-T2 HD Support */ + + PHY_N_AN_SEL = 0x1f, /* Bit 4..0: Selector Field, 00001=Ethernet*/ +}; + +/* field type definition for PHY_x_AN_SEL */ +enum { + PHY_SEL_TYPE = 1, /* 00001 = Ethernet */ +}; + +enum { + PHY_ANE_LP_NP = 1<<3, /* Bit 3: Link Partner can Next Page */ + PHY_ANE_LOC_NP = 1<<2, /* Bit 2: Local PHY can Next Page */ + PHY_ANE_RX_PG = 1<<1, /* Bit 1: Page Received */ +}; + +enum { + PHY_ANE_PAR_DF = 1<<4, /* Bit 4: Parallel Detection Fault */ + + PHY_ANE_LP_CAP = 1<<0, /* Bit 0: Link Partner Auto-Neg. Cap. */ +}; + +enum { + PHY_NP_MORE = 1<<15, /* Bit 15: More, Next Pages to follow */ + PHY_NP_ACK1 = 1<<14, /* Bit 14: (ro) Ack1, for receiving a message */ + PHY_NP_MSG_VAL = 1<<13, /* Bit 13: Message Page valid */ + PHY_NP_ACK2 = 1<<12, /* Bit 12: Ack2, comply with msg content */ + PHY_NP_TOG = 1<<11, /* Bit 11: Toggle Bit, ensure sync */ + PHY_NP_MSG = 0x07ff, /* Bit 10..0: Message from/to Link Partner */ +}; + +enum { + PHY_X_EX_FD = 1<<15, /* Bit 15: Device Supports Full Duplex */ + PHY_X_EX_HD = 1<<14, /* Bit 14: Device Supports Half Duplex */ +}; + +enum { + PHY_X_RS_PAUSE = 3<<7,/* Bit 8..7: selected Pause Mode */ + PHY_X_RS_HD = 1<<6, /* Bit 6: Half Duplex Mode selected */ + PHY_X_RS_FD = 1<<5, /* Bit 5: Full Duplex Mode selected */ + PHY_X_RS_ABLMIS = 1<<4, /* Bit 4: duplex or pause cap mismatch */ + PHY_X_RS_PAUMIS = 1<<3, /* Bit 3: pause capability mismatch */ +}; + +/** Remote Fault Bits (PHY_X_AN_RFB) encoding */ +enum { + X_RFB_OK = 0<<12,/* Bit 13..12 No errors, Link OK */ + X_RFB_LF = 1<<12, /* Bit 13..12 Link Failure */ + X_RFB_OFF = 2<<12,/* Bit 13..12 Offline */ + X_RFB_AN_ERR = 3<<12,/* Bit 13..12 Auto-Negotiation Error */ +}; + +/* Pause Bits (PHY_X_AN_PAUSE and PHY_X_RS_PAUSE) encoding */ +enum { + PHY_X_P_NO_PAUSE = 0<<7,/* Bit 8..7: no Pause Mode */ + PHY_X_P_SYM_MD = 1<<7, /* Bit 8..7: symmetric Pause Mode */ + PHY_X_P_ASYM_MD = 2<<7,/* Bit 8..7: asymmetric Pause Mode */ + PHY_X_P_BOTH_MD = 3<<7,/* Bit 8..7: both Pause Mode */ +}; + + +/* Broadcom-Specific */ +/***** PHY_BCOM_1000T_CTRL 16 bit r/w 1000Base-T Control Reg *****/ +enum { + PHY_B_1000C_TEST = 7<<13,/* Bit 15..13: Test Modes */ + PHY_B_1000C_MSE = 1<<12, /* Bit 12: Master/Slave Enable */ + PHY_B_1000C_MSC = 1<<11, /* Bit 11: M/S Configuration */ + PHY_B_1000C_RD = 1<<10, /* Bit 10: Repeater/DTE */ + PHY_B_1000C_AFD = 1<<9, /* Bit 9: Advertise Full Duplex */ + PHY_B_1000C_AHD = 1<<8, /* Bit 8: Advertise Half Duplex */ +}; + +/***** PHY_BCOM_1000T_STAT 16 bit r/o 1000Base-T Status Reg *****/ +/***** PHY_MARV_1000T_STAT 16 bit r/o 1000Base-T Status Reg *****/ +enum { + PHY_B_1000S_MSF = 1<<15, /* Bit 15: Master/Slave Fault */ + PHY_B_1000S_MSR = 1<<14, /* Bit 14: Master/Slave Result */ + PHY_B_1000S_LRS = 1<<13, /* Bit 13: Local Receiver Status */ + PHY_B_1000S_RRS = 1<<12, /* Bit 12: Remote Receiver Status */ + PHY_B_1000S_LP_FD = 1<<11, /* Bit 11: Link Partner can FD */ + PHY_B_1000S_LP_HD = 1<<10, /* Bit 10: Link Partner can HD */ + /* Bit 9..8: reserved */ + PHY_B_1000S_IEC = 0xff, /* Bit 7..0: Idle Error Count */ +}; + +/***** PHY_BCOM_EXT_STAT 16 bit r/o Extended Status Register *****/ +enum { + PHY_B_ES_X_FD_CAP = 1<<15, /* Bit 15: 1000Base-X FD capable */ + PHY_B_ES_X_HD_CAP = 1<<14, /* Bit 14: 1000Base-X HD capable */ + PHY_B_ES_T_FD_CAP = 1<<13, /* Bit 13: 1000Base-T FD capable */ + PHY_B_ES_T_HD_CAP = 1<<12, /* Bit 12: 1000Base-T HD capable */ +}; + +/***** PHY_BCOM_P_EXT_CTRL 16 bit r/w PHY Extended Control Reg *****/ +enum { + PHY_B_PEC_MAC_PHY = 1<<15, /* Bit 15: 10BIT/GMI-Interface */ + PHY_B_PEC_DIS_CROSS = 1<<14, /* Bit 14: Disable MDI Crossover */ + PHY_B_PEC_TX_DIS = 1<<13, /* Bit 13: Tx output Disabled */ + PHY_B_PEC_INT_DIS = 1<<12, /* Bit 12: Interrupts Disabled */ + PHY_B_PEC_F_INT = 1<<11, /* Bit 11: Force Interrupt */ + PHY_B_PEC_BY_45 = 1<<10, /* Bit 10: Bypass 4B5B-Decoder */ + PHY_B_PEC_BY_SCR = 1<<9, /* Bit 9: Bypass Scrambler */ + PHY_B_PEC_BY_MLT3 = 1<<8, /* Bit 8: Bypass MLT3 Encoder */ + PHY_B_PEC_BY_RXA = 1<<7, /* Bit 7: Bypass Rx Alignm. */ + PHY_B_PEC_RES_SCR = 1<<6, /* Bit 6: Reset Scrambler */ + PHY_B_PEC_EN_LTR = 1<<5, /* Bit 5: Ena LED Traffic Mode */ + PHY_B_PEC_LED_ON = 1<<4, /* Bit 4: Force LED's on */ + PHY_B_PEC_LED_OFF = 1<<3, /* Bit 3: Force LED's off */ + PHY_B_PEC_EX_IPG = 1<<2, /* Bit 2: Extend Tx IPG Mode */ + PHY_B_PEC_3_LED = 1<<1, /* Bit 1: Three Link LED mode */ + PHY_B_PEC_HIGH_LA = 1<<0, /* Bit 0: GMII FIFO Elasticy */ +}; + +/***** PHY_BCOM_P_EXT_STAT 16 bit r/o PHY Extended Status Reg *****/ +enum { + PHY_B_PES_CROSS_STAT = 1<<13, /* Bit 13: MDI Crossover Status */ + PHY_B_PES_INT_STAT = 1<<12, /* Bit 12: Interrupt Status */ + PHY_B_PES_RRS = 1<<11, /* Bit 11: Remote Receiver Stat. */ + PHY_B_PES_LRS = 1<<10, /* Bit 10: Local Receiver Stat. */ + PHY_B_PES_LOCKED = 1<<9, /* Bit 9: Locked */ + PHY_B_PES_LS = 1<<8, /* Bit 8: Link Status */ + PHY_B_PES_RF = 1<<7, /* Bit 7: Remote Fault */ + PHY_B_PES_CE_ER = 1<<6, /* Bit 6: Carrier Ext Error */ + PHY_B_PES_BAD_SSD = 1<<5, /* Bit 5: Bad SSD */ + PHY_B_PES_BAD_ESD = 1<<4, /* Bit 4: Bad ESD */ + PHY_B_PES_RX_ER = 1<<3, /* Bit 3: Receive Error */ + PHY_B_PES_TX_ER = 1<<2, /* Bit 2: Transmit Error */ + PHY_B_PES_LOCK_ER = 1<<1, /* Bit 1: Lock Error */ + PHY_B_PES_MLT3_ER = 1<<0, /* Bit 0: MLT3 code Error */ +}; + +/***** PHY_BCOM_FC_CTR 16 bit r/w False Carrier Counter *****/ +enum { + PHY_B_FC_CTR = 0xff, /* Bit 7..0: False Carrier Counter */ + +/***** PHY_BCOM_RNO_CTR 16 bit r/w Receive NOT_OK Counter *****/ + PHY_B_RC_LOC_MSK = 0xff00, /* Bit 15..8: Local Rx NOT_OK cnt */ + PHY_B_RC_REM_MSK = 0x00ff, /* Bit 7..0: Remote Rx NOT_OK cnt */ + +/***** PHY_BCOM_AUX_CTRL 16 bit r/w Auxiliary Control Reg *****/ + PHY_B_AC_L_SQE = 1<<15, /* Bit 15: Low Squelch */ + PHY_B_AC_LONG_PACK = 1<<14, /* Bit 14: Rx Long Packets */ + PHY_B_AC_ER_CTRL = 3<<12,/* Bit 13..12: Edgerate Control */ + /* Bit 11: reserved */ + PHY_B_AC_TX_TST = 1<<10, /* Bit 10: Tx test bit, always 1 */ + /* Bit 9.. 8: reserved */ + PHY_B_AC_DIS_PRF = 1<<7, /* Bit 7: dis part resp filter */ + /* Bit 6: reserved */ + PHY_B_AC_DIS_PM = 1<<5, /* Bit 5: dis power management */ + /* Bit 4: reserved */ + PHY_B_AC_DIAG = 1<<3, /* Bit 3: Diagnostic Mode */ +}; + +/***** PHY_BCOM_AUX_STAT 16 bit r/o Auxiliary Status Reg *****/ +enum { + PHY_B_AS_AN_C = 1<<15, /* Bit 15: AutoNeg complete */ + PHY_B_AS_AN_CA = 1<<14, /* Bit 14: AN Complete Ack */ + PHY_B_AS_ANACK_D = 1<<13, /* Bit 13: AN Ack Detect */ + PHY_B_AS_ANAB_D = 1<<12, /* Bit 12: AN Ability Detect */ + PHY_B_AS_NPW = 1<<11, /* Bit 11: AN Next Page Wait */ + PHY_B_AS_AN_RES_MSK = 7<<8,/* Bit 10..8: AN HDC */ + PHY_B_AS_PDF = 1<<7, /* Bit 7: Parallel Detect. Fault */ + PHY_B_AS_RF = 1<<6, /* Bit 6: Remote Fault */ + PHY_B_AS_ANP_R = 1<<5, /* Bit 5: AN Page Received */ + PHY_B_AS_LP_ANAB = 1<<4, /* Bit 4: LP AN Ability */ + PHY_B_AS_LP_NPAB = 1<<3, /* Bit 3: LP Next Page Ability */ + PHY_B_AS_LS = 1<<2, /* Bit 2: Link Status */ + PHY_B_AS_PRR = 1<<1, /* Bit 1: Pause Resolution-Rx */ + PHY_B_AS_PRT = 1<<0, /* Bit 0: Pause Resolution-Tx */ +}; +#define PHY_B_AS_PAUSE_MSK (PHY_B_AS_PRR | PHY_B_AS_PRT) + +/***** PHY_BCOM_INT_STAT 16 bit r/o Interrupt Status Reg *****/ +/***** PHY_BCOM_INT_MASK 16 bit r/w Interrupt Mask Reg *****/ +enum { + PHY_B_IS_PSE = 1<<14, /* Bit 14: Pair Swap Error */ + PHY_B_IS_MDXI_SC = 1<<13, /* Bit 13: MDIX Status Change */ + PHY_B_IS_HCT = 1<<12, /* Bit 12: counter above 32k */ + PHY_B_IS_LCT = 1<<11, /* Bit 11: counter above 128 */ + PHY_B_IS_AN_PR = 1<<10, /* Bit 10: Page Received */ + PHY_B_IS_NO_HDCL = 1<<9, /* Bit 9: No HCD Link */ + PHY_B_IS_NO_HDC = 1<<8, /* Bit 8: No HCD */ + PHY_B_IS_NEG_USHDC = 1<<7, /* Bit 7: Negotiated Unsup. HCD */ + PHY_B_IS_SCR_S_ER = 1<<6, /* Bit 6: Scrambler Sync Error */ + PHY_B_IS_RRS_CHANGE = 1<<5, /* Bit 5: Remote Rx Stat Change */ + PHY_B_IS_LRS_CHANGE = 1<<4, /* Bit 4: Local Rx Stat Change */ + PHY_B_IS_DUP_CHANGE = 1<<3, /* Bit 3: Duplex Mode Change */ + PHY_B_IS_LSP_CHANGE = 1<<2, /* Bit 2: Link Speed Change */ + PHY_B_IS_LST_CHANGE = 1<<1, /* Bit 1: Link Status Changed */ + PHY_B_IS_CRC_ER = 1<<0, /* Bit 0: CRC Error */ +}; +#define PHY_B_DEF_MSK (~(PHY_B_IS_AN_PR | PHY_B_IS_LST_CHANGE)) + +/* Pause Bits (PHY_B_AN_ASP and PHY_B_AN_PC) encoding */ +enum { + PHY_B_P_NO_PAUSE = 0<<10,/* Bit 11..10: no Pause Mode */ + PHY_B_P_SYM_MD = 1<<10, /* Bit 11..10: symmetric Pause Mode */ + PHY_B_P_ASYM_MD = 2<<10,/* Bit 11..10: asymmetric Pause Mode */ + PHY_B_P_BOTH_MD = 3<<10,/* Bit 11..10: both Pause Mode */ +}; +/* + * Resolved Duplex mode and Capabilities (Aux Status Summary Reg) + */ +enum { + PHY_B_RES_1000FD = 7<<8,/* Bit 10..8: 1000Base-T Full Dup. */ + PHY_B_RES_1000HD = 6<<8,/* Bit 10..8: 1000Base-T Half Dup. */ +}; + +/* + * Level One-Specific + */ +/***** PHY_LONE_1000T_CTRL 16 bit r/w 1000Base-T Control Reg *****/ +enum { + PHY_L_1000C_TEST = 7<<13,/* Bit 15..13: Test Modes */ + PHY_L_1000C_MSE = 1<<12, /* Bit 12: Master/Slave Enable */ + PHY_L_1000C_MSC = 1<<11, /* Bit 11: M/S Configuration */ + PHY_L_1000C_RD = 1<<10, /* Bit 10: Repeater/DTE */ + PHY_L_1000C_AFD = 1<<9, /* Bit 9: Advertise Full Duplex */ + PHY_L_1000C_AHD = 1<<8, /* Bit 8: Advertise Half Duplex */ +}; + +/***** PHY_LONE_1000T_STAT 16 bit r/o 1000Base-T Status Reg *****/ +enum { + PHY_L_1000S_MSF = 1<<15, /* Bit 15: Master/Slave Fault */ + PHY_L_1000S_MSR = 1<<14, /* Bit 14: Master/Slave Result */ + PHY_L_1000S_LRS = 1<<13, /* Bit 13: Local Receiver Status */ + PHY_L_1000S_RRS = 1<<12, /* Bit 12: Remote Receiver Status */ + PHY_L_1000S_LP_FD = 1<<11, /* Bit 11: Link Partner can FD */ + PHY_L_1000S_LP_HD = 1<<10, /* Bit 10: Link Partner can HD */ + + PHY_L_1000S_IEC = 0xff, /* Bit 7..0: Idle Error Count */ + +/***** PHY_LONE_EXT_STAT 16 bit r/o Extended Status Register *****/ + PHY_L_ES_X_FD_CAP = 1<<15, /* Bit 15: 1000Base-X FD capable */ + PHY_L_ES_X_HD_CAP = 1<<14, /* Bit 14: 1000Base-X HD capable */ + PHY_L_ES_T_FD_CAP = 1<<13, /* Bit 13: 1000Base-T FD capable */ + PHY_L_ES_T_HD_CAP = 1<<12, /* Bit 12: 1000Base-T HD capable */ +}; + +/***** PHY_LONE_PORT_CFG 16 bit r/w Port Configuration Reg *****/ +enum { + PHY_L_PC_REP_MODE = 1<<15, /* Bit 15: Repeater Mode */ + + PHY_L_PC_TX_DIS = 1<<13, /* Bit 13: Tx output Disabled */ + PHY_L_PC_BY_SCR = 1<<12, /* Bit 12: Bypass Scrambler */ + PHY_L_PC_BY_45 = 1<<11, /* Bit 11: Bypass 4B5B-Decoder */ + PHY_L_PC_JAB_DIS = 1<<10, /* Bit 10: Jabber Disabled */ + PHY_L_PC_SQE = 1<<9, /* Bit 9: Enable Heartbeat */ + PHY_L_PC_TP_LOOP = 1<<8, /* Bit 8: TP Loopback */ + PHY_L_PC_SSS = 1<<7, /* Bit 7: Smart Speed Selection */ + PHY_L_PC_FIFO_SIZE = 1<<6, /* Bit 6: FIFO Size */ + PHY_L_PC_PRE_EN = 1<<5, /* Bit 5: Preamble Enable */ + PHY_L_PC_CIM = 1<<4, /* Bit 4: Carrier Integrity Mon */ + PHY_L_PC_10_SER = 1<<3, /* Bit 3: Use Serial Output */ + PHY_L_PC_ANISOL = 1<<2, /* Bit 2: Unisolate Port */ + PHY_L_PC_TEN_BIT = 1<<1, /* Bit 1: 10bit iface mode on */ + PHY_L_PC_ALTCLOCK = 1<<0, /* Bit 0: (ro) ALTCLOCK Mode on */ +}; + +/***** PHY_LONE_Q_STAT 16 bit r/o Quick Status Reg *****/ +enum { + PHY_L_QS_D_RATE = 3<<14,/* Bit 15..14: Data Rate */ + PHY_L_QS_TX_STAT = 1<<13, /* Bit 13: Transmitting */ + PHY_L_QS_RX_STAT = 1<<12, /* Bit 12: Receiving */ + PHY_L_QS_COL_STAT = 1<<11, /* Bit 11: Collision */ + PHY_L_QS_L_STAT = 1<<10, /* Bit 10: Link is up */ + PHY_L_QS_DUP_MOD = 1<<9, /* Bit 9: Full/Half Duplex */ + PHY_L_QS_AN = 1<<8, /* Bit 8: AutoNeg is On */ + PHY_L_QS_AN_C = 1<<7, /* Bit 7: AN is Complete */ + PHY_L_QS_LLE = 7<<4,/* Bit 6..4: Line Length Estim. */ + PHY_L_QS_PAUSE = 1<<3, /* Bit 3: LP advertised Pause */ + PHY_L_QS_AS_PAUSE = 1<<2, /* Bit 2: LP adv. asym. Pause */ + PHY_L_QS_ISOLATE = 1<<1, /* Bit 1: CIM Isolated */ + PHY_L_QS_EVENT = 1<<0, /* Bit 0: Event has occurred */ +}; + +/***** PHY_LONE_INT_ENAB 16 bit r/w Interrupt Enable Reg *****/ +/***** PHY_LONE_INT_STAT 16 bit r/o Interrupt Status Reg *****/ +enum { + PHY_L_IS_AN_F = 1<<13, /* Bit 13: Auto-Negotiation fault */ + PHY_L_IS_CROSS = 1<<11, /* Bit 11: Crossover used */ + PHY_L_IS_POL = 1<<10, /* Bit 10: Polarity correct. used */ + PHY_L_IS_SS = 1<<9, /* Bit 9: Smart Speed Downgrade */ + PHY_L_IS_CFULL = 1<<8, /* Bit 8: Counter Full */ + PHY_L_IS_AN_C = 1<<7, /* Bit 7: AutoNeg Complete */ + PHY_L_IS_SPEED = 1<<6, /* Bit 6: Speed Changed */ + PHY_L_IS_DUP = 1<<5, /* Bit 5: Duplex Changed */ + PHY_L_IS_LS = 1<<4, /* Bit 4: Link Status Changed */ + PHY_L_IS_ISOL = 1<<3, /* Bit 3: Isolate Occured */ + PHY_L_IS_MDINT = 1<<2, /* Bit 2: (ro) STAT: MII Int Pending */ + PHY_L_IS_INTEN = 1<<1, /* Bit 1: ENAB: Enable IRQs */ + PHY_L_IS_FORCE = 1<<0, /* Bit 0: ENAB: Force Interrupt */ +}; + +/* int. mask */ +#define PHY_L_DEF_MSK (PHY_L_IS_LS | PHY_L_IS_ISOL | PHY_L_IS_INTEN) + +/***** PHY_LONE_LED_CFG 16 bit r/w LED Configuration Reg *****/ +enum { + PHY_L_LC_LEDC = 3<<14,/* Bit 15..14: Col/Blink/On/Off */ + PHY_L_LC_LEDR = 3<<12,/* Bit 13..12: Rx/Blink/On/Off */ + PHY_L_LC_LEDT = 3<<10,/* Bit 11..10: Tx/Blink/On/Off */ + PHY_L_LC_LEDG = 3<<8,/* Bit 9..8: Giga/Blink/On/Off */ + PHY_L_LC_LEDS = 3<<6,/* Bit 7..6: 10-100/Blink/On/Off */ + PHY_L_LC_LEDL = 3<<4,/* Bit 5..4: Link/Blink/On/Off */ + PHY_L_LC_LEDF = 3<<2,/* Bit 3..2: Duplex/Blink/On/Off */ + PHY_L_LC_PSTRECH= 1<<1, /* Bit 1: Strech LED Pulses */ + PHY_L_LC_FREQ = 1<<0, /* Bit 0: 30/100 ms */ +}; + +/***** PHY_LONE_PORT_CTRL 16 bit r/w Port Control Reg *****/ +enum { + PHY_L_PC_TX_TCLK = 1<<15, /* Bit 15: Enable TX_TCLK */ + PHY_L_PC_ALT_NP = 1<<13, /* Bit 14: Alternate Next Page */ + PHY_L_PC_GMII_ALT= 1<<12, /* Bit 13: Alternate GMII driver */ + PHY_L_PC_TEN_CRS = 1<<10, /* Bit 10: Extend CRS*/ +}; + +/***** PHY_LONE_CIM 16 bit r/o CIM Reg *****/ +enum { + PHY_L_CIM_ISOL = 0xff<<8,/* Bit 15..8: Isolate Count */ + PHY_L_CIM_FALSE_CAR = 0xff, /* Bit 7..0: False Carrier Count */ +}; + +/* + * Pause Bits (PHY_L_AN_ASP and PHY_L_AN_PC) encoding + */ +enum { + PHY_L_P_NO_PAUSE= 0<<10,/* Bit 11..10: no Pause Mode */ + PHY_L_P_SYM_MD = 1<<10, /* Bit 11..10: symmetric Pause Mode */ + PHY_L_P_ASYM_MD = 2<<10,/* Bit 11..10: asymmetric Pause Mode */ + PHY_L_P_BOTH_MD = 3<<10,/* Bit 11..10: both Pause Mode */ +}; + +/* + * National-Specific + */ +/***** PHY_NAT_1000T_CTRL 16 bit r/w 1000Base-T Control Reg *****/ +enum { + PHY_N_1000C_TEST= 7<<13,/* Bit 15..13: Test Modes */ + PHY_N_1000C_MSE = 1<<12, /* Bit 12: Master/Slave Enable */ + PHY_N_1000C_MSC = 1<<11, /* Bit 11: M/S Configuration */ + PHY_N_1000C_RD = 1<<10, /* Bit 10: Repeater/DTE */ + PHY_N_1000C_AFD = 1<<9, /* Bit 9: Advertise Full Duplex */ + PHY_N_1000C_AHD = 1<<8, /* Bit 8: Advertise Half Duplex */ + PHY_N_1000C_APC = 1<<7, /* Bit 7: Asymmetric Pause Cap. */}; + + +/***** PHY_NAT_1000T_STAT 16 bit r/o 1000Base-T Status Reg *****/ +enum { + PHY_N_1000S_MSF = 1<<15, /* Bit 15: Master/Slave Fault */ + PHY_N_1000S_MSR = 1<<14, /* Bit 14: Master/Slave Result */ + PHY_N_1000S_LRS = 1<<13, /* Bit 13: Local Receiver Status */ + PHY_N_1000S_RRS = 1<<12, /* Bit 12: Remote Receiver Status*/ + PHY_N_1000S_LP_FD= 1<<11, /* Bit 11: Link Partner can FD */ + PHY_N_1000S_LP_HD= 1<<10, /* Bit 10: Link Partner can HD */ + PHY_N_1000C_LP_APC= 1<<9, /* Bit 9: LP Asym. Pause Cap. */ + PHY_N_1000S_IEC = 0xff, /* Bit 7..0: Idle Error Count */ +}; + +/***** PHY_NAT_EXT_STAT 16 bit r/o Extended Status Register *****/ +enum { + PHY_N_ES_X_FD_CAP= 1<<15, /* Bit 15: 1000Base-X FD capable */ + PHY_N_ES_X_HD_CAP= 1<<14, /* Bit 14: 1000Base-X HD capable */ + PHY_N_ES_T_FD_CAP= 1<<13, /* Bit 13: 1000Base-T FD capable */ + PHY_N_ES_T_HD_CAP= 1<<12, /* Bit 12: 1000Base-T HD capable */ +}; + +/** Marvell-Specific */ +enum { + PHY_M_AN_NXT_PG = 1<<15, /* Request Next Page */ + PHY_M_AN_ACK = 1<<14, /* (ro) Acknowledge Received */ + PHY_M_AN_RF = 1<<13, /* Remote Fault */ + + PHY_M_AN_ASP = 1<<11, /* Asymmetric Pause */ + PHY_M_AN_PC = 1<<10, /* MAC Pause implemented */ + PHY_M_AN_100_T4 = 1<<9, /* Not cap. 100Base-T4 (always 0) */ + PHY_M_AN_100_FD = 1<<8, /* Advertise 100Base-TX Full Duplex */ + PHY_M_AN_100_HD = 1<<7, /* Advertise 100Base-TX Half Duplex */ + PHY_M_AN_10_FD = 1<<6, /* Advertise 10Base-TX Full Duplex */ + PHY_M_AN_10_HD = 1<<5, /* Advertise 10Base-TX Half Duplex */ + PHY_M_AN_SEL_MSK =0x1f<<4, /* Bit 4.. 0: Selector Field Mask */ +}; + +/* special defines for FIBER (88E1011S only) */ +enum { + PHY_M_AN_ASP_X = 1<<8, /* Asymmetric Pause */ + PHY_M_AN_PC_X = 1<<7, /* MAC Pause implemented */ + PHY_M_AN_1000X_AHD = 1<<6, /* Advertise 10000Base-X Half Duplex */ + PHY_M_AN_1000X_AFD = 1<<5, /* Advertise 10000Base-X Full Duplex */ +}; + +/* Pause Bits (PHY_M_AN_ASP_X and PHY_M_AN_PC_X) encoding */ +enum { + PHY_M_P_NO_PAUSE_X = 0<<7,/* Bit 8.. 7: no Pause Mode */ + PHY_M_P_SYM_MD_X = 1<<7, /* Bit 8.. 7: symmetric Pause Mode */ + PHY_M_P_ASYM_MD_X = 2<<7,/* Bit 8.. 7: asymmetric Pause Mode */ + PHY_M_P_BOTH_MD_X = 3<<7,/* Bit 8.. 7: both Pause Mode */ +}; + +/***** PHY_MARV_1000T_CTRL 16 bit r/w 1000Base-T Control Reg *****/ +enum { + PHY_M_1000C_TEST = 7<<13,/* Bit 15..13: Test Modes */ + PHY_M_1000C_MSE = 1<<12, /* Manual Master/Slave Enable */ + PHY_M_1000C_MSC = 1<<11, /* M/S Configuration (1=Master) */ + PHY_M_1000C_MPD = 1<<10, /* Multi-Port Device */ + PHY_M_1000C_AFD = 1<<9, /* Advertise Full Duplex */ + PHY_M_1000C_AHD = 1<<8, /* Advertise Half Duplex */ +}; + +/***** PHY_MARV_PHY_CTRL 16 bit r/w PHY Specific Ctrl Reg *****/ +enum { + PHY_M_PC_TX_FFD_MSK = 3<<14,/* Bit 15..14: Tx FIFO Depth Mask */ + PHY_M_PC_RX_FFD_MSK = 3<<12,/* Bit 13..12: Rx FIFO Depth Mask */ + PHY_M_PC_ASS_CRS_TX = 1<<11, /* Assert CRS on Transmit */ + PHY_M_PC_FL_GOOD = 1<<10, /* Force Link Good */ + PHY_M_PC_EN_DET_MSK = 3<<8,/* Bit 9.. 8: Energy Detect Mask */ + PHY_M_PC_ENA_EXT_D = 1<<7, /* Enable Ext. Distance (10BT) */ + PHY_M_PC_MDIX_MSK = 3<<5,/* Bit 6.. 5: MDI/MDIX Config. Mask */ + PHY_M_PC_DIS_125CLK = 1<<4, /* Disable 125 CLK */ + PHY_M_PC_MAC_POW_UP = 1<<3, /* MAC Power up */ + PHY_M_PC_SQE_T_ENA = 1<<2, /* SQE Test Enabled */ + PHY_M_PC_POL_R_DIS = 1<<1, /* Polarity Reversal Disabled */ + PHY_M_PC_DIS_JABBER = 1<<0, /* Disable Jabber */ +}; + +enum { + PHY_M_PC_EN_DET = 2<<8, /* Energy Detect (Mode 1) */ + PHY_M_PC_EN_DET_PLUS = 3<<8, /* Energy Detect Plus (Mode 2) */ +}; + +#define PHY_M_PC_MDI_XMODE(x) (((x)<<5) & PHY_M_PC_MDIX_MSK) + +enum { + PHY_M_PC_MAN_MDI = 0, /* 00 = Manual MDI configuration */ + PHY_M_PC_MAN_MDIX = 1, /* 01 = Manual MDIX configuration */ + PHY_M_PC_ENA_AUTO = 3, /* 11 = Enable Automatic Crossover */ +}; + +/* for 10/100 Fast Ethernet PHY (88E3082 only) */ +enum { + PHY_M_PC_ENA_DTE_DT = 1<<15, /* Enable Data Terminal Equ. (DTE) Detect */ + PHY_M_PC_ENA_ENE_DT = 1<<14, /* Enable Energy Detect (sense & pulse) */ + PHY_M_PC_DIS_NLP_CK = 1<<13, /* Disable Normal Link Puls (NLP) Check */ + PHY_M_PC_ENA_LIP_NP = 1<<12, /* Enable Link Partner Next Page Reg. */ + PHY_M_PC_DIS_NLP_GN = 1<<11, /* Disable Normal Link Puls Generation */ + + PHY_M_PC_DIS_SCRAMB = 1<<9, /* Disable Scrambler */ + PHY_M_PC_DIS_FEFI = 1<<8, /* Disable Far End Fault Indic. (FEFI) */ + + PHY_M_PC_SH_TP_SEL = 1<<6, /* Shielded Twisted Pair Select */ + PHY_M_PC_RX_FD_MSK = 3<<2,/* Bit 3.. 2: Rx FIFO Depth Mask */ +}; + +/***** PHY_MARV_PHY_STAT 16 bit r/o PHY Specific Status Reg *****/ +enum { + PHY_M_PS_SPEED_MSK = 3<<14, /* Bit 15..14: Speed Mask */ + PHY_M_PS_SPEED_1000 = 1<<15, /* 10 = 1000 Mbps */ + PHY_M_PS_SPEED_100 = 1<<14, /* 01 = 100 Mbps */ + PHY_M_PS_SPEED_10 = 0, /* 00 = 10 Mbps */ + PHY_M_PS_FULL_DUP = 1<<13, /* Full Duplex */ + PHY_M_PS_PAGE_REC = 1<<12, /* Page Received */ + PHY_M_PS_SPDUP_RES = 1<<11, /* Speed & Duplex Resolved */ + PHY_M_PS_LINK_UP = 1<<10, /* Link Up */ + PHY_M_PS_CABLE_MSK = 7<<7, /* Bit 9.. 7: Cable Length Mask */ + PHY_M_PS_MDI_X_STAT = 1<<6, /* MDI Crossover Stat (1=MDIX) */ + PHY_M_PS_DOWNS_STAT = 1<<5, /* Downshift Status (1=downsh.) */ + PHY_M_PS_ENDET_STAT = 1<<4, /* Energy Detect Status (1=act) */ + PHY_M_PS_TX_P_EN = 1<<3, /* Tx Pause Enabled */ + PHY_M_PS_RX_P_EN = 1<<2, /* Rx Pause Enabled */ + PHY_M_PS_POL_REV = 1<<1, /* Polarity Reversed */ + PHY_M_PS_JABBER = 1<<0, /* Jabber */ +}; + +#define PHY_M_PS_PAUSE_MSK (PHY_M_PS_TX_P_EN | PHY_M_PS_RX_P_EN) + +/* for 10/100 Fast Ethernet PHY (88E3082 only) */ +enum { + PHY_M_PS_DTE_DETECT = 1<<15, /* Data Terminal Equipment (DTE) Detected */ + PHY_M_PS_RES_SPEED = 1<<14, /* Resolved Speed (1=100 Mbps, 0=10 Mbps */ +}; + +enum { + PHY_M_IS_AN_ERROR = 1<<15, /* Auto-Negotiation Error */ + PHY_M_IS_LSP_CHANGE = 1<<14, /* Link Speed Changed */ + PHY_M_IS_DUP_CHANGE = 1<<13, /* Duplex Mode Changed */ + PHY_M_IS_AN_PR = 1<<12, /* Page Received */ + PHY_M_IS_AN_COMPL = 1<<11, /* Auto-Negotiation Completed */ + PHY_M_IS_LST_CHANGE = 1<<10, /* Link Status Changed */ + PHY_M_IS_SYMB_ERROR = 1<<9, /* Symbol Error */ + PHY_M_IS_FALSE_CARR = 1<<8, /* False Carrier */ + PHY_M_IS_FIFO_ERROR = 1<<7, /* FIFO Overflow/Underrun Error */ + PHY_M_IS_MDI_CHANGE = 1<<6, /* MDI Crossover Changed */ + PHY_M_IS_DOWNSH_DET = 1<<5, /* Downshift Detected */ + PHY_M_IS_END_CHANGE = 1<<4, /* Energy Detect Changed */ + + PHY_M_IS_DTE_CHANGE = 1<<2, /* DTE Power Det. Status Changed */ + PHY_M_IS_POL_CHANGE = 1<<1, /* Polarity Changed */ + PHY_M_IS_JABBER = 1<<0, /* Jabber */ +}; + +#define PHY_M_DEF_MSK ( PHY_M_IS_AN_ERROR | PHY_M_IS_LSP_CHANGE | \ + PHY_M_IS_LST_CHANGE | PHY_M_IS_FIFO_ERROR) + +/***** PHY_MARV_EXT_CTRL 16 bit r/w Ext. PHY Specific Ctrl *****/ +enum { + PHY_M_EC_ENA_BC_EXT = 1<<15, /* Enable Block Carr. Ext. (88E1111 only) */ + PHY_M_EC_ENA_LIN_LB = 1<<14, /* Enable Line Loopback (88E1111 only) */ + + PHY_M_EC_DIS_LINK_P = 1<<12, /* Disable Link Pulses (88E1111 only) */ + PHY_M_EC_M_DSC_MSK = 3<<10, /* Bit 11..10: Master Downshift Counter */ + /* (88E1011 only) */ + PHY_M_EC_S_DSC_MSK = 3<<8,/* Bit 9.. 8: Slave Downshift Counter */ + /* (88E1011 only) */ + PHY_M_EC_M_DSC_MSK2 = 7<<9,/* Bit 11.. 9: Master Downshift Counter */ + /* (88E1111 only) */ + PHY_M_EC_DOWN_S_ENA = 1<<8, /* Downshift Enable (88E1111 only) */ + /* !!! Errata in spec. (1 = disable) */ + PHY_M_EC_RX_TIM_CT = 1<<7, /* RGMII Rx Timing Control*/ + PHY_M_EC_MAC_S_MSK = 7<<4,/* Bit 6.. 4: Def. MAC interface speed */ + PHY_M_EC_FIB_AN_ENA = 1<<3, /* Fiber Auto-Neg. Enable (88E1011S only) */ + PHY_M_EC_DTE_D_ENA = 1<<2, /* DTE Detect Enable (88E1111 only) */ + PHY_M_EC_TX_TIM_CT = 1<<1, /* RGMII Tx Timing Control */ + PHY_M_EC_TRANS_DIS = 1<<0, /* Transmitter Disable (88E1111 only) */}; + +#define PHY_M_EC_M_DSC(x) ((x)<<10) /* 00=1x; 01=2x; 10=3x; 11=4x */ +#define PHY_M_EC_S_DSC(x) ((x)<<8) /* 00=dis; 01=1x; 10=2x; 11=3x */ +#define PHY_M_EC_MAC_S(x) ((x)<<4) /* 01X=0; 110=2.5; 111=25 (MHz) */ + +#define PHY_M_EC_M_DSC_2(x) ((x)<<9) /* 000=1x; 001=2x; 010=3x; 011=4x */ + /* 100=5x; 101=6x; 110=7x; 111=8x */ +enum { + MAC_TX_CLK_0_MHZ = 2, + MAC_TX_CLK_2_5_MHZ = 6, + MAC_TX_CLK_25_MHZ = 7, +}; + +/***** PHY_MARV_LED_CTRL 16 bit r/w LED Control Reg *****/ +enum { + PHY_M_LEDC_DIS_LED = 1<<15, /* Disable LED */ + PHY_M_LEDC_PULS_MSK = 7<<12,/* Bit 14..12: Pulse Stretch Mask */ + PHY_M_LEDC_F_INT = 1<<11, /* Force Interrupt */ + PHY_M_LEDC_BL_R_MSK = 7<<8,/* Bit 10.. 8: Blink Rate Mask */ + PHY_M_LEDC_DP_C_LSB = 1<<7, /* Duplex Control (LSB, 88E1111 only) */ + PHY_M_LEDC_TX_C_LSB = 1<<6, /* Tx Control (LSB, 88E1111 only) */ + PHY_M_LEDC_LK_C_MSK = 7<<3,/* Bit 5.. 3: Link Control Mask */ + /* (88E1111 only) */ +}; + +enum { + PHY_M_LEDC_LINK_MSK = 3<<3,/* Bit 4.. 3: Link Control Mask */ + /* (88E1011 only) */ + PHY_M_LEDC_DP_CTRL = 1<<2, /* Duplex Control */ + PHY_M_LEDC_DP_C_MSB = 1<<2, /* Duplex Control (MSB, 88E1111 only) */ + PHY_M_LEDC_RX_CTRL = 1<<1, /* Rx Activity / Link */ + PHY_M_LEDC_TX_CTRL = 1<<0, /* Tx Activity / Link */ + PHY_M_LEDC_TX_C_MSB = 1<<0, /* Tx Control (MSB, 88E1111 only) */ +}; + +#define PHY_M_LED_PULS_DUR(x) ( ((x)<<12) & PHY_M_LEDC_PULS_MSK) + +enum { + PULS_NO_STR = 0,/* no pulse stretching */ + PULS_21MS = 1,/* 21 ms to 42 ms */ + PULS_42MS = 2,/* 42 ms to 84 ms */ + PULS_84MS = 3,/* 84 ms to 170 ms */ + PULS_170MS = 4,/* 170 ms to 340 ms */ + PULS_340MS = 5,/* 340 ms to 670 ms */ + PULS_670MS = 6,/* 670 ms to 1.3 s */ + PULS_1300MS = 7,/* 1.3 s to 2.7 s */ +}; + +#define PHY_M_LED_BLINK_RT(x) ( ((x)<<8) & PHY_M_LEDC_BL_R_MSK) + +enum { + BLINK_42MS = 0,/* 42 ms */ + BLINK_84MS = 1,/* 84 ms */ + BLINK_170MS = 2,/* 170 ms */ + BLINK_340MS = 3,/* 340 ms */ + BLINK_670MS = 4,/* 670 ms */ +}; + +/***** PHY_MARV_LED_OVER 16 bit r/w Manual LED Override Reg *****/ +#define PHY_M_LED_MO_SGMII(x) ((x)<<14) /* Bit 15..14: SGMII AN Timer */ + /* Bit 13..12: reserved */ +#define PHY_M_LED_MO_DUP(x) ((x)<<10) /* Bit 11..10: Duplex */ +#define PHY_M_LED_MO_10(x) ((x)<<8) /* Bit 9.. 8: Link 10 */ +#define PHY_M_LED_MO_100(x) ((x)<<6) /* Bit 7.. 6: Link 100 */ +#define PHY_M_LED_MO_1000(x) ((x)<<4) /* Bit 5.. 4: Link 1000 */ +#define PHY_M_LED_MO_RX(x) ((x)<<2) /* Bit 3.. 2: Rx */ +#define PHY_M_LED_MO_TX(x) ((x)<<0) /* Bit 1.. 0: Tx */ + +enum { + MO_LED_NORM = 0, + MO_LED_BLINK = 1, + MO_LED_OFF = 2, + MO_LED_ON = 3, +}; + +/***** PHY_MARV_EXT_CTRL_2 16 bit r/w Ext. PHY Specific Ctrl 2 *****/ +enum { + PHY_M_EC2_FI_IMPED = 1<<6, /* Fiber Input Impedance */ + PHY_M_EC2_FO_IMPED = 1<<5, /* Fiber Output Impedance */ + PHY_M_EC2_FO_M_CLK = 1<<4, /* Fiber Mode Clock Enable */ + PHY_M_EC2_FO_BOOST = 1<<3, /* Fiber Output Boost */ + PHY_M_EC2_FO_AM_MSK = 7,/* Bit 2.. 0: Fiber Output Amplitude */ +}; + +/***** PHY_MARV_EXT_P_STAT 16 bit r/w Ext. PHY Specific Status *****/ +enum { + PHY_M_FC_AUTO_SEL = 1<<15, /* Fiber/Copper Auto Sel. Dis. */ + PHY_M_FC_AN_REG_ACC = 1<<14, /* Fiber/Copper AN Reg. Access */ + PHY_M_FC_RESOLUTION = 1<<13, /* Fiber/Copper Resolution */ + PHY_M_SER_IF_AN_BP = 1<<12, /* Ser. IF AN Bypass Enable */ + PHY_M_SER_IF_BP_ST = 1<<11, /* Ser. IF AN Bypass Status */ + PHY_M_IRQ_POLARITY = 1<<10, /* IRQ polarity */ + PHY_M_DIS_AUT_MED = 1<<9, /* Disable Aut. Medium Reg. Selection */ + /* (88E1111 only) */ + /* Bit 9.. 4: reserved (88E1011 only) */ + PHY_M_UNDOC1 = 1<<7, /* undocumented bit !! */ + PHY_M_DTE_POW_STAT = 1<<4, /* DTE Power Status (88E1111 only) */ + PHY_M_MODE_MASK = 0xf, /* Bit 3.. 0: copy of HWCFG MODE[3:0] */ +}; + +/***** PHY_MARV_CABLE_DIAG 16 bit r/o Cable Diagnostic Reg *****/ +enum { + PHY_M_CABD_ENA_TEST = 1<<15, /* Enable Test (Page 0) */ + PHY_M_CABD_DIS_WAIT = 1<<15, /* Disable Waiting Period (Page 1) */ + /* (88E1111 only) */ + PHY_M_CABD_STAT_MSK = 3<<13, /* Bit 14..13: Status Mask */ + PHY_M_CABD_AMPL_MSK = 0x1f<<8,/* Bit 12.. 8: Amplitude Mask */ + /* (88E1111 only) */ + PHY_M_CABD_DIST_MSK = 0xff, /* Bit 7.. 0: Distance Mask */ +}; + +/* values for Cable Diagnostic Status (11=fail; 00=OK; 10=open; 01=short) */ +enum { + CABD_STAT_NORMAL= 0, + CABD_STAT_SHORT = 1, + CABD_STAT_OPEN = 2, + CABD_STAT_FAIL = 3, +}; + +/* for 10/100 Fast Ethernet PHY (88E3082 only) */ +/***** PHY_MARV_FE_LED_PAR 16 bit r/w LED Parallel Select Reg. *****/ + /* Bit 15..12: reserved (used internally) */ +enum { + PHY_M_FELP_LED2_MSK = 0xf<<8, /* Bit 11.. 8: LED2 Mask (LINK) */ + PHY_M_FELP_LED1_MSK = 0xf<<4, /* Bit 7.. 4: LED1 Mask (ACT) */ + PHY_M_FELP_LED0_MSK = 0xf, /* Bit 3.. 0: LED0 Mask (SPEED) */ +}; + +#define PHY_M_FELP_LED2_CTRL(x) ( ((x)<<8) & PHY_M_FELP_LED2_MSK) +#define PHY_M_FELP_LED1_CTRL(x) ( ((x)<<4) & PHY_M_FELP_LED1_MSK) +#define PHY_M_FELP_LED0_CTRL(x) ( ((x)<<0) & PHY_M_FELP_LED0_MSK) + +enum { + LED_PAR_CTRL_COLX = 0x00, + LED_PAR_CTRL_ERROR = 0x01, + LED_PAR_CTRL_DUPLEX = 0x02, + LED_PAR_CTRL_DP_COL = 0x03, + LED_PAR_CTRL_SPEED = 0x04, + LED_PAR_CTRL_LINK = 0x05, + LED_PAR_CTRL_TX = 0x06, + LED_PAR_CTRL_RX = 0x07, + LED_PAR_CTRL_ACT = 0x08, + LED_PAR_CTRL_LNK_RX = 0x09, + LED_PAR_CTRL_LNK_AC = 0x0a, + LED_PAR_CTRL_ACT_BL = 0x0b, + LED_PAR_CTRL_TX_BL = 0x0c, + LED_PAR_CTRL_RX_BL = 0x0d, + LED_PAR_CTRL_COL_BL = 0x0e, + LED_PAR_CTRL_INACT = 0x0f +}; + +/*****,PHY_MARV_FE_SPEC_2 16 bit r/w Specific Control Reg. 2 *****/ +enum { + PHY_M_FESC_DIS_WAIT = 1<<2, /* Disable TDR Waiting Period */ + PHY_M_FESC_ENA_MCLK = 1<<1, /* Enable MAC Rx Clock in sleep mode */ + PHY_M_FESC_SEL_CL_A = 1<<0, /* Select Class A driver (100B-TX) */ +}; + +/* for Yukon-2 Gigabit Ethernet PHY (88E1112 only) */ +/***** PHY_MARV_PHY_CTRL (page 2) 16 bit r/w MAC Specific Ctrl *****/ +enum { + PHY_M_MAC_MD_MSK = 7<<7, /* Bit 9.. 7: Mode Select Mask */ + PHY_M_MAC_MD_AUTO = 3,/* Auto Copper/1000Base-X */ + PHY_M_MAC_MD_COPPER = 5,/* Copper only */ + PHY_M_MAC_MD_1000BX = 7,/* 1000Base-X only */ +}; +#define PHY_M_MAC_MODE_SEL(x) ( ((x)<<7) & PHY_M_MAC_MD_MSK) + +/***** PHY_MARV_PHY_CTRL (page 3) 16 bit r/w LED Control Reg. *****/ +enum { + PHY_M_LEDC_LOS_MSK = 0xf<<12,/* Bit 15..12: LOS LED Ctrl. Mask */ + PHY_M_LEDC_INIT_MSK = 0xf<<8, /* Bit 11.. 8: INIT LED Ctrl. Mask */ + PHY_M_LEDC_STA1_MSK = 0xf<<4,/* Bit 7.. 4: STAT1 LED Ctrl. Mask */ + PHY_M_LEDC_STA0_MSK = 0xf, /* Bit 3.. 0: STAT0 LED Ctrl. Mask */ +}; + +#define PHY_M_LEDC_LOS_CTRL(x) ( ((x)<<12) & PHY_M_LEDC_LOS_MSK) +#define PHY_M_LEDC_INIT_CTRL(x) ( ((x)<<8) & PHY_M_LEDC_INIT_MSK) +#define PHY_M_LEDC_STA1_CTRL(x) ( ((x)<<4) & PHY_M_LEDC_STA1_MSK) +#define PHY_M_LEDC_STA0_CTRL(x) ( ((x)<<0) & PHY_M_LEDC_STA0_MSK) + +/* GMAC registers */ +/* Port Registers */ +enum { + GM_GP_STAT = 0x0000, /* 16 bit r/o General Purpose Status */ + GM_GP_CTRL = 0x0004, /* 16 bit r/w General Purpose Control */ + GM_TX_CTRL = 0x0008, /* 16 bit r/w Transmit Control Reg. */ + GM_RX_CTRL = 0x000c, /* 16 bit r/w Receive Control Reg. */ + GM_TX_FLOW_CTRL = 0x0010, /* 16 bit r/w Transmit Flow-Control */ + GM_TX_PARAM = 0x0014, /* 16 bit r/w Transmit Parameter Reg. */ + GM_SERIAL_MODE = 0x0018, /* 16 bit r/w Serial Mode Register */ +/* Source Address Registers */ + GM_SRC_ADDR_1L = 0x001c, /* 16 bit r/w Source Address 1 (low) */ + GM_SRC_ADDR_1M = 0x0020, /* 16 bit r/w Source Address 1 (middle) */ + GM_SRC_ADDR_1H = 0x0024, /* 16 bit r/w Source Address 1 (high) */ + GM_SRC_ADDR_2L = 0x0028, /* 16 bit r/w Source Address 2 (low) */ + GM_SRC_ADDR_2M = 0x002c, /* 16 bit r/w Source Address 2 (middle) */ + GM_SRC_ADDR_2H = 0x0030, /* 16 bit r/w Source Address 2 (high) */ + +/* Multicast Address Hash Registers */ + GM_MC_ADDR_H1 = 0x0034, /* 16 bit r/w Multicast Address Hash 1 */ + GM_MC_ADDR_H2 = 0x0038, /* 16 bit r/w Multicast Address Hash 2 */ + GM_MC_ADDR_H3 = 0x003c, /* 16 bit r/w Multicast Address Hash 3 */ + GM_MC_ADDR_H4 = 0x0040, /* 16 bit r/w Multicast Address Hash 4 */ + +/* Interrupt Source Registers */ + GM_TX_IRQ_SRC = 0x0044, /* 16 bit r/o Tx Overflow IRQ Source */ + GM_RX_IRQ_SRC = 0x0048, /* 16 bit r/o Rx Overflow IRQ Source */ + GM_TR_IRQ_SRC = 0x004c, /* 16 bit r/o Tx/Rx Over. IRQ Source */ + +/* Interrupt Mask Registers */ + GM_TX_IRQ_MSK = 0x0050, /* 16 bit r/w Tx Overflow IRQ Mask */ + GM_RX_IRQ_MSK = 0x0054, /* 16 bit r/w Rx Overflow IRQ Mask */ + GM_TR_IRQ_MSK = 0x0058, /* 16 bit r/w Tx/Rx Over. IRQ Mask */ + +/* Serial Management Interface (SMI) Registers */ + GM_SMI_CTRL = 0x0080, /* 16 bit r/w SMI Control Register */ + GM_SMI_DATA = 0x0084, /* 16 bit r/w SMI Data Register */ + GM_PHY_ADDR = 0x0088, /* 16 bit r/w GPHY Address Register */ +}; + +/* MIB Counters */ +#define GM_MIB_CNT_BASE 0x0100 /* Base Address of MIB Counters */ +#define GM_MIB_CNT_SIZE 44 /* Number of MIB Counters */ + +/* + * MIB Counters base address definitions (low word) - + * use offset 4 for access to high word (32 bit r/o) + */ +enum { + GM_RXF_UC_OK = GM_MIB_CNT_BASE + 0, /* Unicast Frames Received OK */ + GM_RXF_BC_OK = GM_MIB_CNT_BASE + 8, /* Broadcast Frames Received OK */ + GM_RXF_MPAUSE = GM_MIB_CNT_BASE + 16, /* Pause MAC Ctrl Frames Received */ + GM_RXF_MC_OK = GM_MIB_CNT_BASE + 24, /* Multicast Frames Received OK */ + GM_RXF_FCS_ERR = GM_MIB_CNT_BASE + 32, /* Rx Frame Check Seq. Error */ + /* GM_MIB_CNT_BASE + 40: reserved */ + GM_RXO_OK_LO = GM_MIB_CNT_BASE + 48, /* Octets Received OK Low */ + GM_RXO_OK_HI = GM_MIB_CNT_BASE + 56, /* Octets Received OK High */ + GM_RXO_ERR_LO = GM_MIB_CNT_BASE + 64, /* Octets Received Invalid Low */ + GM_RXO_ERR_HI = GM_MIB_CNT_BASE + 72, /* Octets Received Invalid High */ + GM_RXF_SHT = GM_MIB_CNT_BASE + 80, /* Frames <64 Byte Received OK */ + GM_RXE_FRAG = GM_MIB_CNT_BASE + 88, /* Frames <64 Byte Received with FCS Err */ + GM_RXF_64B = GM_MIB_CNT_BASE + 96, /* 64 Byte Rx Frame */ + GM_RXF_127B = GM_MIB_CNT_BASE + 104, /* 65-127 Byte Rx Frame */ + GM_RXF_255B = GM_MIB_CNT_BASE + 112, /* 128-255 Byte Rx Frame */ + GM_RXF_511B = GM_MIB_CNT_BASE + 120, /* 256-511 Byte Rx Frame */ + GM_RXF_1023B = GM_MIB_CNT_BASE + 128, /* 512-1023 Byte Rx Frame */ + GM_RXF_1518B = GM_MIB_CNT_BASE + 136, /* 1024-1518 Byte Rx Frame */ + GM_RXF_MAX_SZ = GM_MIB_CNT_BASE + 144, /* 1519-MaxSize Byte Rx Frame */ + GM_RXF_LNG_ERR = GM_MIB_CNT_BASE + 152, /* Rx Frame too Long Error */ + GM_RXF_JAB_PKT = GM_MIB_CNT_BASE + 160, /* Rx Jabber Packet Frame */ + /* GM_MIB_CNT_BASE + 168: reserved */ + GM_RXE_FIFO_OV = GM_MIB_CNT_BASE + 176, /* Rx FIFO overflow Event */ + /* GM_MIB_CNT_BASE + 184: reserved */ + GM_TXF_UC_OK = GM_MIB_CNT_BASE + 192, /* Unicast Frames Xmitted OK */ + GM_TXF_BC_OK = GM_MIB_CNT_BASE + 200, /* Broadcast Frames Xmitted OK */ + GM_TXF_MPAUSE = GM_MIB_CNT_BASE + 208, /* Pause MAC Ctrl Frames Xmitted */ + GM_TXF_MC_OK = GM_MIB_CNT_BASE + 216, /* Multicast Frames Xmitted OK */ + GM_TXO_OK_LO = GM_MIB_CNT_BASE + 224, /* Octets Transmitted OK Low */ + GM_TXO_OK_HI = GM_MIB_CNT_BASE + 232, /* Octets Transmitted OK High */ + GM_TXF_64B = GM_MIB_CNT_BASE + 240, /* 64 Byte Tx Frame */ + GM_TXF_127B = GM_MIB_CNT_BASE + 248, /* 65-127 Byte Tx Frame */ + GM_TXF_255B = GM_MIB_CNT_BASE + 256, /* 128-255 Byte Tx Frame */ + GM_TXF_511B = GM_MIB_CNT_BASE + 264, /* 256-511 Byte Tx Frame */ + GM_TXF_1023B = GM_MIB_CNT_BASE + 272, /* 512-1023 Byte Tx Frame */ + GM_TXF_1518B = GM_MIB_CNT_BASE + 280, /* 1024-1518 Byte Tx Frame */ + GM_TXF_MAX_SZ = GM_MIB_CNT_BASE + 288, /* 1519-MaxSize Byte Tx Frame */ + + GM_TXF_COL = GM_MIB_CNT_BASE + 304, /* Tx Collision */ + GM_TXF_LAT_COL = GM_MIB_CNT_BASE + 312, /* Tx Late Collision */ + GM_TXF_ABO_COL = GM_MIB_CNT_BASE + 320, /* Tx aborted due to Exces. Col. */ + GM_TXF_MUL_COL = GM_MIB_CNT_BASE + 328, /* Tx Multiple Collision */ + GM_TXF_SNG_COL = GM_MIB_CNT_BASE + 336, /* Tx Single Collision */ + GM_TXE_FIFO_UR = GM_MIB_CNT_BASE + 344, /* Tx FIFO Underrun Event */ +}; + +/* GMAC Bit Definitions */ +/* GM_GP_STAT 16 bit r/o General Purpose Status Register */ +enum { + GM_GPSR_SPEED = 1<<15, /* Bit 15: Port Speed (1 = 100 Mbps) */ + GM_GPSR_DUPLEX = 1<<14, /* Bit 14: Duplex Mode (1 = Full) */ + GM_GPSR_FC_TX_DIS = 1<<13, /* Bit 13: Tx Flow-Control Mode Disabled */ + GM_GPSR_LINK_UP = 1<<12, /* Bit 12: Link Up Status */ + GM_GPSR_PAUSE = 1<<11, /* Bit 11: Pause State */ + GM_GPSR_TX_ACTIVE = 1<<10, /* Bit 10: Tx in Progress */ + GM_GPSR_EXC_COL = 1<<9, /* Bit 9: Excessive Collisions Occured */ + GM_GPSR_LAT_COL = 1<<8, /* Bit 8: Late Collisions Occured */ + + GM_GPSR_PHY_ST_CH = 1<<5, /* Bit 5: PHY Status Change */ + GM_GPSR_GIG_SPEED = 1<<4, /* Bit 4: Gigabit Speed (1 = 1000 Mbps) */ + GM_GPSR_PART_MODE = 1<<3, /* Bit 3: Partition mode */ + GM_GPSR_FC_RX_DIS = 1<<2, /* Bit 2: Rx Flow-Control Mode Disabled */ + GM_GPSR_PROM_EN = 1<<1, /* Bit 1: Promiscuous Mode Enabled */ +}; + +/* GM_GP_CTRL 16 bit r/w General Purpose Control Register */ +enum { + GM_GPCR_PROM_ENA = 1<<14, /* Bit 14: Enable Promiscuous Mode */ + GM_GPCR_FC_TX_DIS = 1<<13, /* Bit 13: Disable Tx Flow-Control Mode */ + GM_GPCR_TX_ENA = 1<<12, /* Bit 12: Enable Transmit */ + GM_GPCR_RX_ENA = 1<<11, /* Bit 11: Enable Receive */ + GM_GPCR_BURST_ENA = 1<<10, /* Bit 10: Enable Burst Mode */ + GM_GPCR_LOOP_ENA = 1<<9, /* Bit 9: Enable MAC Loopback Mode */ + GM_GPCR_PART_ENA = 1<<8, /* Bit 8: Enable Partition Mode */ + GM_GPCR_GIGS_ENA = 1<<7, /* Bit 7: Gigabit Speed (1000 Mbps) */ + GM_GPCR_FL_PASS = 1<<6, /* Bit 6: Force Link Pass */ + GM_GPCR_DUP_FULL = 1<<5, /* Bit 5: Full Duplex Mode */ + GM_GPCR_FC_RX_DIS = 1<<4, /* Bit 4: Disable Rx Flow-Control Mode */ + GM_GPCR_SPEED_100 = 1<<3, /* Bit 3: Port Speed 100 Mbps */ + GM_GPCR_AU_DUP_DIS = 1<<2, /* Bit 2: Disable Auto-Update Duplex */ + GM_GPCR_AU_FCT_DIS = 1<<1, /* Bit 1: Disable Auto-Update Flow-C. */ + GM_GPCR_AU_SPD_DIS = 1<<0, /* Bit 0: Disable Auto-Update Speed */ +}; + +#define GM_GPCR_SPEED_1000 (GM_GPCR_GIGS_ENA | GM_GPCR_SPEED_100) +#define GM_GPCR_AU_ALL_DIS (GM_GPCR_AU_DUP_DIS | GM_GPCR_AU_FCT_DIS|GM_GPCR_AU_SPD_DIS) + +/* GM_TX_CTRL 16 bit r/w Transmit Control Register */ +enum { + GM_TXCR_FORCE_JAM = 1<<15, /* Bit 15: Force Jam / Flow-Control */ + GM_TXCR_CRC_DIS = 1<<14, /* Bit 14: Disable insertion of CRC */ + GM_TXCR_PAD_DIS = 1<<13, /* Bit 13: Disable padding of packets */ + GM_TXCR_COL_THR_MSK = 1<<10, /* Bit 12..10: Collision Threshold */ +}; + +#define TX_COL_THR(x) (((x)<<10) & GM_TXCR_COL_THR_MSK) +#define TX_COL_DEF 0x04 + +/* GM_RX_CTRL 16 bit r/w Receive Control Register */ +enum { + GM_RXCR_UCF_ENA = 1<<15, /* Bit 15: Enable Unicast filtering */ + GM_RXCR_MCF_ENA = 1<<14, /* Bit 14: Enable Multicast filtering */ + GM_RXCR_CRC_DIS = 1<<13, /* Bit 13: Remove 4-byte CRC */ + GM_RXCR_PASS_FC = 1<<12, /* Bit 12: Pass FC packets to FIFO */ +}; + +/* GM_TX_PARAM 16 bit r/w Transmit Parameter Register */ +enum { + GM_TXPA_JAMLEN_MSK = 0x03<<14, /* Bit 15..14: Jam Length */ + GM_TXPA_JAMIPG_MSK = 0x1f<<9, /* Bit 13..9: Jam IPG */ + GM_TXPA_JAMDAT_MSK = 0x1f<<4, /* Bit 8..4: IPG Jam to Data */ + + TX_JAM_LEN_DEF = 0x03, + TX_JAM_IPG_DEF = 0x0b, + TX_IPG_JAM_DEF = 0x1c, +}; + +#define TX_JAM_LEN_VAL(x) (((x)<<14) & GM_TXPA_JAMLEN_MSK) +#define TX_JAM_IPG_VAL(x) (((x)<<9) & GM_TXPA_JAMIPG_MSK) +#define TX_IPG_JAM_DATA(x) (((x)<<4) & GM_TXPA_JAMDAT_MSK) + + +/* GM_SERIAL_MODE 16 bit r/w Serial Mode Register */ +enum { + GM_SMOD_DATABL_MSK = 0x1f<<11, /* Bit 15..11: Data Blinder (r/o) */ + GM_SMOD_LIMIT_4 = 1<<10, /* Bit 10: 4 consecutive Tx trials */ + GM_SMOD_VLAN_ENA = 1<<9, /* Bit 9: Enable VLAN (Max. Frame Len) */ + GM_SMOD_JUMBO_ENA = 1<<8, /* Bit 8: Enable Jumbo (Max. Frame Len) */ + GM_SMOD_IPG_MSK = 0x1f /* Bit 4..0: Inter-Packet Gap (IPG) */ +}; + +#define DATA_BLIND_VAL(x) (((x)<<11) & GM_SMOD_DATABL_MSK) +#define DATA_BLIND_DEF 0x04 + +#define IPG_DATA_VAL(x) (x & GM_SMOD_IPG_MSK) +#define IPG_DATA_DEF 0x1e + +/* GM_SMI_CTRL 16 bit r/w SMI Control Register */ +enum { + GM_SMI_CT_PHY_A_MSK = 0x1f<<11,/* Bit 15..11: PHY Device Address */ + GM_SMI_CT_REG_A_MSK = 0x1f<<6,/* Bit 10.. 6: PHY Register Address */ + GM_SMI_CT_OP_RD = 1<<5, /* Bit 5: OpCode Read (0=Write)*/ + GM_SMI_CT_RD_VAL = 1<<4, /* Bit 4: Read Valid (Read completed) */ + GM_SMI_CT_BUSY = 1<<3, /* Bit 3: Busy (Operation in progress) */ +}; + +#define GM_SMI_CT_PHY_AD(x) (((x)<<11) & GM_SMI_CT_PHY_A_MSK) +#define GM_SMI_CT_REG_AD(x) (((x)<<6) & GM_SMI_CT_REG_A_MSK) + +/* GM_PHY_ADDR 16 bit r/w GPHY Address Register */ +enum { + GM_PAR_MIB_CLR = 1<<5, /* Bit 5: Set MIB Clear Counter Mode */ + GM_PAR_MIB_TST = 1<<4, /* Bit 4: MIB Load Counter (Test Mode) */ +}; + +/* Receive Frame Status Encoding */ +enum { + GMR_FS_LEN = 0xffff<<16, /* Bit 31..16: Rx Frame Length */ + GMR_FS_VLAN = 1<<13, /* Bit 13: VLAN Packet */ + GMR_FS_JABBER = 1<<12, /* Bit 12: Jabber Packet */ + GMR_FS_UN_SIZE = 1<<11, /* Bit 11: Undersize Packet */ + GMR_FS_MC = 1<<10, /* Bit 10: Multicast Packet */ + GMR_FS_BC = 1<<9, /* Bit 9: Broadcast Packet */ + GMR_FS_RX_OK = 1<<8, /* Bit 8: Receive OK (Good Packet) */ + GMR_FS_GOOD_FC = 1<<7, /* Bit 7: Good Flow-Control Packet */ + GMR_FS_BAD_FC = 1<<6, /* Bit 6: Bad Flow-Control Packet */ + GMR_FS_MII_ERR = 1<<5, /* Bit 5: MII Error */ + GMR_FS_LONG_ERR = 1<<4, /* Bit 4: Too Long Packet */ + GMR_FS_FRAGMENT = 1<<3, /* Bit 3: Fragment */ + + GMR_FS_CRC_ERR = 1<<1, /* Bit 1: CRC Error */ + GMR_FS_RX_FF_OV = 1<<0, /* Bit 0: Rx FIFO Overflow */ + +/* + * GMR_FS_ANY_ERR (analogous to XMR_FS_ANY_ERR) + */ + GMR_FS_ANY_ERR = GMR_FS_CRC_ERR | GMR_FS_LONG_ERR | + GMR_FS_MII_ERR | GMR_FS_BAD_FC | GMR_FS_GOOD_FC | + GMR_FS_JABBER, +/* Rx GMAC FIFO Flush Mask (default) */ + RX_FF_FL_DEF_MSK = GMR_FS_CRC_ERR | GMR_FS_RX_FF_OV |GMR_FS_MII_ERR | + GMR_FS_BAD_FC | GMR_FS_GOOD_FC | GMR_FS_UN_SIZE | + GMR_FS_JABBER, +}; + +/* RX_GMF_CTRL_T 32 bit Rx GMAC FIFO Control/Test */ +enum { + GMF_WP_TST_ON = 1<<14, /* Write Pointer Test On */ + GMF_WP_TST_OFF = 1<<13, /* Write Pointer Test Off */ + GMF_WP_STEP = 1<<12, /* Write Pointer Step/Increment */ + + GMF_RP_TST_ON = 1<<10, /* Read Pointer Test On */ + GMF_RP_TST_OFF = 1<<9, /* Read Pointer Test Off */ + GMF_RP_STEP = 1<<8, /* Read Pointer Step/Increment */ + GMF_RX_F_FL_ON = 1<<7, /* Rx FIFO Flush Mode On */ + GMF_RX_F_FL_OFF = 1<<6, /* Rx FIFO Flush Mode Off */ + GMF_CLI_RX_FO = 1<<5, /* Clear IRQ Rx FIFO Overrun */ + GMF_CLI_RX_FC = 1<<4, /* Clear IRQ Rx Frame Complete */ + GMF_OPER_ON = 1<<3, /* Operational Mode On */ + GMF_OPER_OFF = 1<<2, /* Operational Mode Off */ + GMF_RST_CLR = 1<<1, /* Clear GMAC FIFO Reset */ + GMF_RST_SET = 1<<0, /* Set GMAC FIFO Reset */ + + RX_GMF_FL_THR_DEF = 0xa, /* flush threshold (default) */ +}; + + +/* TX_GMF_CTRL_T 32 bit Tx GMAC FIFO Control/Test */ +enum { + GMF_WSP_TST_ON = 1<<18,/* Write Shadow Pointer Test On */ + GMF_WSP_TST_OFF = 1<<17,/* Write Shadow Pointer Test Off */ + GMF_WSP_STEP = 1<<16,/* Write Shadow Pointer Step/Increment */ + + GMF_CLI_TX_FU = 1<<6, /* Clear IRQ Tx FIFO Underrun */ + GMF_CLI_TX_FC = 1<<5, /* Clear IRQ Tx Frame Complete */ + GMF_CLI_TX_PE = 1<<4, /* Clear IRQ Tx Parity Error */ +}; + +/* GMAC_TI_ST_CTRL 8 bit Time Stamp Timer Ctrl Reg (YUKON only) */ +enum { + GMT_ST_START = 1<<2, /* Start Time Stamp Timer */ + GMT_ST_STOP = 1<<1, /* Stop Time Stamp Timer */ + GMT_ST_CLR_IRQ = 1<<0, /* Clear Time Stamp Timer IRQ */ +}; + +/* GMAC_CTRL 32 bit GMAC Control Reg (YUKON only) */ +enum { + GMC_H_BURST_ON = 1<<7, /* Half Duplex Burst Mode On */ + GMC_H_BURST_OFF = 1<<6, /* Half Duplex Burst Mode Off */ + GMC_F_LOOPB_ON = 1<<5, /* FIFO Loopback On */ + GMC_F_LOOPB_OFF = 1<<4, /* FIFO Loopback Off */ + GMC_PAUSE_ON = 1<<3, /* Pause On */ + GMC_PAUSE_OFF = 1<<2, /* Pause Off */ + GMC_RST_CLR = 1<<1, /* Clear GMAC Reset */ + GMC_RST_SET = 1<<0, /* Set GMAC Reset */ +}; + +/* GPHY_CTRL 32 bit GPHY Control Reg (YUKON only) */ +enum { + GPC_SEL_BDT = 1<<28, /* Select Bi-Dir. Transfer for MDC/MDIO */ + GPC_INT_POL_HI = 1<<27, /* IRQ Polarity is Active HIGH */ + GPC_75_OHM = 1<<26, /* Use 75 Ohm Termination instead of 50 */ + GPC_DIS_FC = 1<<25, /* Disable Automatic Fiber/Copper Detection */ + GPC_DIS_SLEEP = 1<<24, /* Disable Energy Detect */ + GPC_HWCFG_M_3 = 1<<23, /* HWCFG_MODE[3] */ + GPC_HWCFG_M_2 = 1<<22, /* HWCFG_MODE[2] */ + GPC_HWCFG_M_1 = 1<<21, /* HWCFG_MODE[1] */ + GPC_HWCFG_M_0 = 1<<20, /* HWCFG_MODE[0] */ + GPC_ANEG_0 = 1<<19, /* ANEG[0] */ + GPC_ENA_XC = 1<<18, /* Enable MDI crossover */ + GPC_DIS_125 = 1<<17, /* Disable 125 MHz clock */ + GPC_ANEG_3 = 1<<16, /* ANEG[3] */ + GPC_ANEG_2 = 1<<15, /* ANEG[2] */ + GPC_ANEG_1 = 1<<14, /* ANEG[1] */ + GPC_ENA_PAUSE = 1<<13, /* Enable Pause (SYM_OR_REM) */ + GPC_PHYADDR_4 = 1<<12, /* Bit 4 of Phy Addr */ + GPC_PHYADDR_3 = 1<<11, /* Bit 3 of Phy Addr */ + GPC_PHYADDR_2 = 1<<10, /* Bit 2 of Phy Addr */ + GPC_PHYADDR_1 = 1<<9, /* Bit 1 of Phy Addr */ + GPC_PHYADDR_0 = 1<<8, /* Bit 0 of Phy Addr */ + /* Bits 7..2: reserved */ + GPC_RST_CLR = 1<<1, /* Clear GPHY Reset */ + GPC_RST_SET = 1<<0, /* Set GPHY Reset */ +}; + +#define GPC_HWCFG_GMII_COP (GPC_HWCFG_M_3|GPC_HWCFG_M_2 | GPC_HWCFG_M_1 | GPC_HWCFG_M_0) +#define GPC_HWCFG_GMII_FIB (GPC_HWCFG_M_2 | GPC_HWCFG_M_1 | GPC_HWCFG_M_0) +#define GPC_ANEG_ADV_ALL_M (GPC_ANEG_3 | GPC_ANEG_2 | GPC_ANEG_1 | GPC_ANEG_0) + +/* forced speed and duplex mode (don't mix with other ANEG bits) */ +#define GPC_FRC10MBIT_HALF 0 +#define GPC_FRC10MBIT_FULL GPC_ANEG_0 +#define GPC_FRC100MBIT_HALF GPC_ANEG_1 +#define GPC_FRC100MBIT_FULL (GPC_ANEG_0 | GPC_ANEG_1) + +/* auto-negotiation with limited advertised speeds */ +/* mix only with master/slave settings (for copper) */ +#define GPC_ADV_1000_HALF GPC_ANEG_2 +#define GPC_ADV_1000_FULL GPC_ANEG_3 +#define GPC_ADV_ALL (GPC_ANEG_2 | GPC_ANEG_3) + +/* master/slave settings */ +/* only for copper with 1000 Mbps */ +#define GPC_FORCE_MASTER 0 +#define GPC_FORCE_SLAVE GPC_ANEG_0 +#define GPC_PREF_MASTER GPC_ANEG_1 +#define GPC_PREF_SLAVE (GPC_ANEG_1 | GPC_ANEG_0) + +/* GMAC_IRQ_SRC 8 bit GMAC Interrupt Source Reg (YUKON only) */ +/* GMAC_IRQ_MSK 8 bit GMAC Interrupt Mask Reg (YUKON only) */ +enum { + GM_IS_TX_CO_OV = 1<<5, /* Transmit Counter Overflow IRQ */ + GM_IS_RX_CO_OV = 1<<4, /* Receive Counter Overflow IRQ */ + GM_IS_TX_FF_UR = 1<<3, /* Transmit FIFO Underrun */ + GM_IS_TX_COMPL = 1<<2, /* Frame Transmission Complete */ + GM_IS_RX_FF_OR = 1<<1, /* Receive FIFO Overrun */ + GM_IS_RX_COMPL = 1<<0, /* Frame Reception Complete */ + +#define GMAC_DEF_MSK (GM_IS_TX_CO_OV | GM_IS_RX_CO_OV | GM_IS_TX_FF_UR) + +/* GMAC_LINK_CTRL 16 bit GMAC Link Control Reg (YUKON only) */ + /* Bits 15.. 2: reserved */ + GMLC_RST_CLR = 1<<1, /* Clear GMAC Link Reset */ + GMLC_RST_SET = 1<<0, /* Set GMAC Link Reset */ + + +/* WOL_CTRL_STAT 16 bit WOL Control/Status Reg */ + WOL_CTL_LINK_CHG_OCC = 1<<15, + WOL_CTL_MAGIC_PKT_OCC = 1<<14, + WOL_CTL_PATTERN_OCC = 1<<13, + + WOL_CTL_CLEAR_RESULT = 1<<12, + WOL_CTL_ENA_PME_ON_LINK_CHG = 1<<11, + WOL_CTL_DIS_PME_ON_LINK_CHG = 1<<10, + WOL_CTL_ENA_PME_ON_MAGIC_PKT = 1<<9, + WOL_CTL_DIS_PME_ON_MAGIC_PKT = 1<<8, + WOL_CTL_ENA_PME_ON_PATTERN = 1<<7, + WOL_CTL_DIS_PME_ON_PATTERN = 1<<6, + WOL_CTL_ENA_LINK_CHG_UNIT = 1<<5, + WOL_CTL_DIS_LINK_CHG_UNIT = 1<<4, + WOL_CTL_ENA_MAGIC_PKT_UNIT = 1<<3, + WOL_CTL_DIS_MAGIC_PKT_UNIT = 1<<2, + WOL_CTL_ENA_PATTERN_UNIT = 1<<1, + WOL_CTL_DIS_PATTERN_UNIT = 1<<0, +}; + +#define WOL_CTL_DEFAULT \ + (WOL_CTL_DIS_PME_ON_LINK_CHG | \ + WOL_CTL_DIS_PME_ON_PATTERN | \ + WOL_CTL_DIS_PME_ON_MAGIC_PKT | \ + WOL_CTL_DIS_LINK_CHG_UNIT | \ + WOL_CTL_DIS_PATTERN_UNIT | \ + WOL_CTL_DIS_MAGIC_PKT_UNIT) + +/* WOL_MATCH_CTL 8 bit WOL Match Control Reg */ +#define WOL_CTL_PATT_ENA(x) (BIT_0 << (x)) + + +/* XMAC II registers */ +enum { + XM_MMU_CMD = 0x0000, /* 16 bit r/w MMU Command Register */ + XM_POFF = 0x0008, /* 32 bit r/w Packet Offset Register */ + XM_BURST = 0x000c, /* 32 bit r/w Burst Register for half duplex*/ + XM_1L_VLAN_TAG = 0x0010, /* 16 bit r/w One Level VLAN Tag ID */ + XM_2L_VLAN_TAG = 0x0014, /* 16 bit r/w Two Level VLAN Tag ID */ + XM_TX_CMD = 0x0020, /* 16 bit r/w Transmit Command Register */ + XM_TX_RT_LIM = 0x0024, /* 16 bit r/w Transmit Retry Limit Register */ + XM_TX_STIME = 0x0028, /* 16 bit r/w Transmit Slottime Register */ + XM_TX_IPG = 0x002c, /* 16 bit r/w Transmit Inter Packet Gap */ + XM_RX_CMD = 0x0030, /* 16 bit r/w Receive Command Register */ + XM_PHY_ADDR = 0x0034, /* 16 bit r/w PHY Address Register */ + XM_PHY_DATA = 0x0038, /* 16 bit r/w PHY Data Register */ + XM_GP_PORT = 0x0040, /* 32 bit r/w General Purpose Port Register */ + XM_IMSK = 0x0044, /* 16 bit r/w Interrupt Mask Register */ + XM_ISRC = 0x0048, /* 16 bit r/o Interrupt Status Register */ + XM_HW_CFG = 0x004c, /* 16 bit r/w Hardware Config Register */ + XM_TX_LO_WM = 0x0060, /* 16 bit r/w Tx FIFO Low Water Mark */ + XM_TX_HI_WM = 0x0062, /* 16 bit r/w Tx FIFO High Water Mark */ + XM_TX_THR = 0x0064, /* 16 bit r/w Tx Request Threshold */ + XM_HT_THR = 0x0066, /* 16 bit r/w Host Request Threshold */ + XM_PAUSE_DA = 0x0068, /* NA reg r/w Pause Destination Address */ + XM_CTL_PARA = 0x0070, /* 32 bit r/w Control Parameter Register */ + XM_MAC_OPCODE = 0x0074, /* 16 bit r/w Opcode for MAC control frames */ + XM_MAC_PTIME = 0x0076, /* 16 bit r/w Pause time for MAC ctrl frames*/ + XM_TX_STAT = 0x0078, /* 32 bit r/o Tx Status LIFO Register */ + + XM_EXM_START = 0x0080, /* r/w Start Address of the EXM Regs */ +#define XM_EXM(reg) (XM_EXM_START + ((reg) << 3)) +}; + +enum { + XM_SRC_CHK = 0x0100, /* NA reg r/w Source Check Address Register */ + XM_SA = 0x0108, /* NA reg r/w Station Address Register */ + XM_HSM = 0x0110, /* 64 bit r/w Hash Match Address Registers */ + XM_RX_LO_WM = 0x0118, /* 16 bit r/w Receive Low Water Mark */ + XM_RX_HI_WM = 0x011a, /* 16 bit r/w Receive High Water Mark */ + XM_RX_THR = 0x011c, /* 32 bit r/w Receive Request Threshold */ + XM_DEV_ID = 0x0120, /* 32 bit r/o Device ID Register */ + XM_MODE = 0x0124, /* 32 bit r/w Mode Register */ + XM_LSA = 0x0128, /* NA reg r/o Last Source Register */ + XM_TS_READ = 0x0130, /* 32 bit r/o Time Stamp Read Register */ + XM_TS_LOAD = 0x0134, /* 32 bit r/o Time Stamp Load Value */ + XM_STAT_CMD = 0x0200, /* 16 bit r/w Statistics Command Register */ + XM_RX_CNT_EV = 0x0204, /* 32 bit r/o Rx Counter Event Register */ + XM_TX_CNT_EV = 0x0208, /* 32 bit r/o Tx Counter Event Register */ + XM_RX_EV_MSK = 0x020c, /* 32 bit r/w Rx Counter Event Mask */ + XM_TX_EV_MSK = 0x0210, /* 32 bit r/w Tx Counter Event Mask */ + XM_TXF_OK = 0x0280, /* 32 bit r/o Frames Transmitted OK Conuter */ + XM_TXO_OK_HI = 0x0284, /* 32 bit r/o Octets Transmitted OK High Cnt*/ + XM_TXO_OK_LO = 0x0288, /* 32 bit r/o Octets Transmitted OK Low Cnt */ + XM_TXF_BC_OK = 0x028c, /* 32 bit r/o Broadcast Frames Xmitted OK */ + XM_TXF_MC_OK = 0x0290, /* 32 bit r/o Multicast Frames Xmitted OK */ + XM_TXF_UC_OK = 0x0294, /* 32 bit r/o Unicast Frames Xmitted OK */ + XM_TXF_LONG = 0x0298, /* 32 bit r/o Tx Long Frame Counter */ + XM_TXE_BURST = 0x029c, /* 32 bit r/o Tx Burst Event Counter */ + XM_TXF_MPAUSE = 0x02a0, /* 32 bit r/o Tx Pause MAC Ctrl Frame Cnt */ + XM_TXF_MCTRL = 0x02a4, /* 32 bit r/o Tx MAC Ctrl Frame Counter */ + XM_TXF_SNG_COL = 0x02a8, /* 32 bit r/o Tx Single Collision Counter */ + XM_TXF_MUL_COL = 0x02ac, /* 32 bit r/o Tx Multiple Collision Counter */ + XM_TXF_ABO_COL = 0x02b0, /* 32 bit r/o Tx aborted due to Exces. Col. */ + XM_TXF_LAT_COL = 0x02b4, /* 32 bit r/o Tx Late Collision Counter */ + XM_TXF_DEF = 0x02b8, /* 32 bit r/o Tx Deferred Frame Counter */ + XM_TXF_EX_DEF = 0x02bc, /* 32 bit r/o Tx Excessive Deferall Counter */ + XM_TXE_FIFO_UR = 0x02c0, /* 32 bit r/o Tx FIFO Underrun Event Cnt */ + XM_TXE_CS_ERR = 0x02c4, /* 32 bit r/o Tx Carrier Sense Error Cnt */ + XM_TXP_UTIL = 0x02c8, /* 32 bit r/o Tx Utilization in % */ + XM_TXF_64B = 0x02d0, /* 32 bit r/o 64 Byte Tx Frame Counter */ + XM_TXF_127B = 0x02d4, /* 32 bit r/o 65-127 Byte Tx Frame Counter */ + XM_TXF_255B = 0x02d8, /* 32 bit r/o 128-255 Byte Tx Frame Counter */ + XM_TXF_511B = 0x02dc, /* 32 bit r/o 256-511 Byte Tx Frame Counter */ + XM_TXF_1023B = 0x02e0, /* 32 bit r/o 512-1023 Byte Tx Frame Counter*/ + XM_TXF_MAX_SZ = 0x02e4, /* 32 bit r/o 1024-MaxSize Byte Tx Frame Cnt*/ + XM_RXF_OK = 0x0300, /* 32 bit r/o Frames Received OK */ + XM_RXO_OK_HI = 0x0304, /* 32 bit r/o Octets Received OK High Cnt */ + XM_RXO_OK_LO = 0x0308, /* 32 bit r/o Octets Received OK Low Counter*/ + XM_RXF_BC_OK = 0x030c, /* 32 bit r/o Broadcast Frames Received OK */ + XM_RXF_MC_OK = 0x0310, /* 32 bit r/o Multicast Frames Received OK */ + XM_RXF_UC_OK = 0x0314, /* 32 bit r/o Unicast Frames Received OK */ + XM_RXF_MPAUSE = 0x0318, /* 32 bit r/o Rx Pause MAC Ctrl Frame Cnt */ + XM_RXF_MCTRL = 0x031c, /* 32 bit r/o Rx MAC Ctrl Frame Counter */ + XM_RXF_INV_MP = 0x0320, /* 32 bit r/o Rx invalid Pause Frame Cnt */ + XM_RXF_INV_MOC = 0x0324, /* 32 bit r/o Rx Frames with inv. MAC Opcode*/ + XM_RXE_BURST = 0x0328, /* 32 bit r/o Rx Burst Event Counter */ + XM_RXE_FMISS = 0x032c, /* 32 bit r/o Rx Missed Frames Event Cnt */ + XM_RXF_FRA_ERR = 0x0330, /* 32 bit r/o Rx Framing Error Counter */ + XM_RXE_FIFO_OV = 0x0334, /* 32 bit r/o Rx FIFO overflow Event Cnt */ + XM_RXF_JAB_PKT = 0x0338, /* 32 bit r/o Rx Jabber Packet Frame Cnt */ + XM_RXE_CAR_ERR = 0x033c, /* 32 bit r/o Rx Carrier Event Error Cnt */ + XM_RXF_LEN_ERR = 0x0340, /* 32 bit r/o Rx in Range Length Error */ + XM_RXE_SYM_ERR = 0x0344, /* 32 bit r/o Rx Symbol Error Counter */ + XM_RXE_SHT_ERR = 0x0348, /* 32 bit r/o Rx Short Event Error Cnt */ + XM_RXE_RUNT = 0x034c, /* 32 bit r/o Rx Runt Event Counter */ + XM_RXF_LNG_ERR = 0x0350, /* 32 bit r/o Rx Frame too Long Error Cnt */ + XM_RXF_FCS_ERR = 0x0354, /* 32 bit r/o Rx Frame Check Seq. Error Cnt */ + XM_RXF_CEX_ERR = 0x035c, /* 32 bit r/o Rx Carrier Ext Error Frame Cnt*/ + XM_RXP_UTIL = 0x0360, /* 32 bit r/o Rx Utilization in % */ + XM_RXF_64B = 0x0368, /* 32 bit r/o 64 Byte Rx Frame Counter */ + XM_RXF_127B = 0x036c, /* 32 bit r/o 65-127 Byte Rx Frame Counter */ + XM_RXF_255B = 0x0370, /* 32 bit r/o 128-255 Byte Rx Frame Counter */ + XM_RXF_511B = 0x0374, /* 32 bit r/o 256-511 Byte Rx Frame Counter */ + XM_RXF_1023B = 0x0378, /* 32 bit r/o 512-1023 Byte Rx Frame Counter*/ + XM_RXF_MAX_SZ = 0x037c, /* 32 bit r/o 1024-MaxSize Byte Rx Frame Cnt*/ +}; + +/* XM_MMU_CMD 16 bit r/w MMU Command Register */ +enum { + XM_MMU_PHY_RDY = 1<<12,/* Bit 12: PHY Read Ready */ + XM_MMU_PHY_BUSY = 1<<11,/* Bit 11: PHY Busy */ + XM_MMU_IGN_PF = 1<<10,/* Bit 10: Ignore Pause Frame */ + XM_MMU_MAC_LB = 1<<9, /* Bit 9: Enable MAC Loopback */ + XM_MMU_FRC_COL = 1<<7, /* Bit 7: Force Collision */ + XM_MMU_SIM_COL = 1<<6, /* Bit 6: Simulate Collision */ + XM_MMU_NO_PRE = 1<<5, /* Bit 5: No MDIO Preamble */ + XM_MMU_GMII_FD = 1<<4, /* Bit 4: GMII uses Full Duplex */ + XM_MMU_RAT_CTRL = 1<<3, /* Bit 3: Enable Rate Control */ + XM_MMU_GMII_LOOP= 1<<2, /* Bit 2: PHY is in Loopback Mode */ + XM_MMU_ENA_RX = 1<<1, /* Bit 1: Enable Receiver */ + XM_MMU_ENA_TX = 1<<0, /* Bit 0: Enable Transmitter */ +}; + + +/* XM_TX_CMD 16 bit r/w Transmit Command Register */ +enum { + XM_TX_BK2BK = 1<<6, /* Bit 6: Ignor Carrier Sense (Tx Bk2Bk)*/ + XM_TX_ENC_BYP = 1<<5, /* Bit 5: Set Encoder in Bypass Mode */ + XM_TX_SAM_LINE = 1<<4, /* Bit 4: (sc) Start utilization calculation */ + XM_TX_NO_GIG_MD = 1<<3, /* Bit 3: Disable Carrier Extension */ + XM_TX_NO_PRE = 1<<2, /* Bit 2: Disable Preamble Generation */ + XM_TX_NO_CRC = 1<<1, /* Bit 1: Disable CRC Generation */ + XM_TX_AUTO_PAD = 1<<0, /* Bit 0: Enable Automatic Padding */ +}; + +/* XM_TX_RT_LIM 16 bit r/w Transmit Retry Limit Register */ +#define XM_RT_LIM_MSK 0x1f /* Bit 4..0: Tx Retry Limit */ + + +/* XM_TX_STIME 16 bit r/w Transmit Slottime Register */ +#define XM_STIME_MSK 0x7f /* Bit 6..0: Tx Slottime bits */ + + +/* XM_TX_IPG 16 bit r/w Transmit Inter Packet Gap */ +#define XM_IPG_MSK 0xff /* Bit 7..0: IPG value bits */ + + +/* XM_RX_CMD 16 bit r/w Receive Command Register */ +enum { + XM_RX_LENERR_OK = 1<<8, /* Bit 8 don't set Rx Err bit for */ + /* inrange error packets */ + XM_RX_BIG_PK_OK = 1<<7, /* Bit 7 don't set Rx Err bit for */ + /* jumbo packets */ + XM_RX_IPG_CAP = 1<<6, /* Bit 6 repl. type field with IPG */ + XM_RX_TP_MD = 1<<5, /* Bit 5: Enable transparent Mode */ + XM_RX_STRIP_FCS = 1<<4, /* Bit 4: Enable FCS Stripping */ + XM_RX_SELF_RX = 1<<3, /* Bit 3: Enable Rx of own packets */ + XM_RX_SAM_LINE = 1<<2, /* Bit 2: (sc) Start utilization calculation */ + XM_RX_STRIP_PAD = 1<<1, /* Bit 1: Strip pad bytes of Rx frames */ + XM_RX_DIS_CEXT = 1<<0, /* Bit 0: Disable carrier ext. check */ +}; + + +/* XM_PHY_ADDR 16 bit r/w PHY Address Register */ +#define XM_PHY_ADDR_SZ 0x1f /* Bit 4..0: PHY Address bits */ + + +/* XM_GP_PORT 32 bit r/w General Purpose Port Register */ +enum { + XM_GP_ANIP = 1<<6, /* Bit 6: (ro) Auto-Neg. in progress */ + XM_GP_FRC_INT = 1<<5, /* Bit 5: (sc) Force Interrupt */ + XM_GP_RES_MAC = 1<<3, /* Bit 3: (sc) Reset MAC and FIFOs */ + XM_GP_RES_STAT = 1<<2, /* Bit 2: (sc) Reset the statistics module */ + XM_GP_INP_ASS = 1<<0, /* Bit 0: (ro) GP Input Pin asserted */ +}; + + +/* XM_IMSK 16 bit r/w Interrupt Mask Register */ +/* XM_ISRC 16 bit r/o Interrupt Status Register */ +enum { + XM_IS_LNK_AE = 1<<14, /* Bit 14: Link Asynchronous Event */ + XM_IS_TX_ABORT = 1<<13, /* Bit 13: Transmit Abort, late Col. etc */ + XM_IS_FRC_INT = 1<<12, /* Bit 12: Force INT bit set in GP */ + XM_IS_INP_ASS = 1<<11, /* Bit 11: Input Asserted, GP bit 0 set */ + XM_IS_LIPA_RC = 1<<10, /* Bit 10: Link Partner requests config */ + XM_IS_RX_PAGE = 1<<9, /* Bit 9: Page Received */ + XM_IS_TX_PAGE = 1<<8, /* Bit 8: Next Page Loaded for Transmit */ + XM_IS_AND = 1<<7, /* Bit 7: Auto-Negotiation Done */ + XM_IS_TSC_OV = 1<<6, /* Bit 6: Time Stamp Counter Overflow */ + XM_IS_RXC_OV = 1<<5, /* Bit 5: Rx Counter Event Overflow */ + XM_IS_TXC_OV = 1<<4, /* Bit 4: Tx Counter Event Overflow */ + XM_IS_RXF_OV = 1<<3, /* Bit 3: Receive FIFO Overflow */ + XM_IS_TXF_UR = 1<<2, /* Bit 2: Transmit FIFO Underrun */ + XM_IS_TX_COMP = 1<<1, /* Bit 1: Frame Tx Complete */ + XM_IS_RX_COMP = 1<<0, /* Bit 0: Frame Rx Complete */ +}; + +#define XM_DEF_MSK (~(XM_IS_INP_ASS | XM_IS_LIPA_RC | XM_IS_RX_PAGE | \ + XM_IS_AND | XM_IS_RXC_OV | XM_IS_TXC_OV | \ + XM_IS_RXF_OV | XM_IS_TXF_UR)) + + +/* XM_HW_CFG 16 bit r/w Hardware Config Register */ +enum { + XM_HW_GEN_EOP = 1<<3, /* Bit 3: generate End of Packet pulse */ + XM_HW_COM4SIG = 1<<2, /* Bit 2: use Comma Detect for Sig. Det.*/ + XM_HW_GMII_MD = 1<<0, /* Bit 0: GMII Interface selected */ +}; + + +/* XM_TX_LO_WM 16 bit r/w Tx FIFO Low Water Mark */ +/* XM_TX_HI_WM 16 bit r/w Tx FIFO High Water Mark */ +#define XM_TX_WM_MSK 0x01ff /* Bit 9.. 0 Tx FIFO Watermark bits */ + +/* XM_TX_THR 16 bit r/w Tx Request Threshold */ +/* XM_HT_THR 16 bit r/w Host Request Threshold */ +/* XM_RX_THR 16 bit r/w Rx Request Threshold */ +#define XM_THR_MSK 0x03ff /* Bit 10.. 0 Rx/Tx Request Threshold bits */ + + +/* XM_TX_STAT 32 bit r/o Tx Status LIFO Register */ +enum { + XM_ST_VALID = (1UL<<31), /* Bit 31: Status Valid */ + XM_ST_BYTE_CNT = (0x3fffL<<17), /* Bit 30..17: Tx frame Length */ + XM_ST_RETRY_CNT = (0x1fL<<12), /* Bit 16..12: Retry Count */ + XM_ST_EX_COL = 1<<11, /* Bit 11: Excessive Collisions */ + XM_ST_EX_DEF = 1<<10, /* Bit 10: Excessive Deferral */ + XM_ST_BURST = 1<<9, /* Bit 9: p. xmitted in burst md*/ + XM_ST_DEFER = 1<<8, /* Bit 8: packet was defered */ + XM_ST_BC = 1<<7, /* Bit 7: Broadcast packet */ + XM_ST_MC = 1<<6, /* Bit 6: Multicast packet */ + XM_ST_UC = 1<<5, /* Bit 5: Unicast packet */ + XM_ST_TX_UR = 1<<4, /* Bit 4: FIFO Underrun occured */ + XM_ST_CS_ERR = 1<<3, /* Bit 3: Carrier Sense Error */ + XM_ST_LAT_COL = 1<<2, /* Bit 2: Late Collision Error */ + XM_ST_MUL_COL = 1<<1, /* Bit 1: Multiple Collisions */ + XM_ST_SGN_COL = 1<<0, /* Bit 0: Single Collision */ +}; + +/* XM_RX_LO_WM 16 bit r/w Receive Low Water Mark */ +/* XM_RX_HI_WM 16 bit r/w Receive High Water Mark */ +#define XM_RX_WM_MSK 0x03ff /* Bit 11.. 0: Rx FIFO Watermark bits */ + + +/* XM_DEV_ID 32 bit r/o Device ID Register */ +#define XM_DEV_OUI (0x00ffffffUL<<8) /* Bit 31..8: Device OUI */ +#define XM_DEV_REV (0x07L << 5) /* Bit 7..5: Chip Rev Num */ + + +/* XM_MODE 32 bit r/w Mode Register */ +enum { + XM_MD_ENA_REJ = 1<<26, /* Bit 26: Enable Frame Reject */ + XM_MD_SPOE_E = 1<<25, /* Bit 25: Send Pause on Edge */ + /* extern generated */ + XM_MD_TX_REP = 1<<24, /* Bit 24: Transmit Repeater Mode */ + XM_MD_SPOFF_I = 1<<23, /* Bit 23: Send Pause on FIFO full */ + /* intern generated */ + XM_MD_LE_STW = 1<<22, /* Bit 22: Rx Stat Word in Little Endian */ + XM_MD_TX_CONT = 1<<21, /* Bit 21: Send Continuous */ + XM_MD_TX_PAUSE = 1<<20, /* Bit 20: (sc) Send Pause Frame */ + XM_MD_ATS = 1<<19, /* Bit 19: Append Time Stamp */ + XM_MD_SPOL_I = 1<<18, /* Bit 18: Send Pause on Low */ + /* intern generated */ + XM_MD_SPOH_I = 1<<17, /* Bit 17: Send Pause on High */ + /* intern generated */ + XM_MD_CAP = 1<<16, /* Bit 16: Check Address Pair */ + XM_MD_ENA_HASH = 1<<15, /* Bit 15: Enable Hashing */ + XM_MD_CSA = 1<<14, /* Bit 14: Check Station Address */ + XM_MD_CAA = 1<<13, /* Bit 13: Check Address Array */ + XM_MD_RX_MCTRL = 1<<12, /* Bit 12: Rx MAC Control Frame */ + XM_MD_RX_RUNT = 1<<11, /* Bit 11: Rx Runt Frames */ + XM_MD_RX_IRLE = 1<<10, /* Bit 10: Rx in Range Len Err Frame */ + XM_MD_RX_LONG = 1<<9, /* Bit 9: Rx Long Frame */ + XM_MD_RX_CRCE = 1<<8, /* Bit 8: Rx CRC Error Frame */ + XM_MD_RX_ERR = 1<<7, /* Bit 7: Rx Error Frame */ + XM_MD_DIS_UC = 1<<6, /* Bit 6: Disable Rx Unicast */ + XM_MD_DIS_MC = 1<<5, /* Bit 5: Disable Rx Multicast */ + XM_MD_DIS_BC = 1<<4, /* Bit 4: Disable Rx Broadcast */ + XM_MD_ENA_PROM = 1<<3, /* Bit 3: Enable Promiscuous */ + XM_MD_ENA_BE = 1<<2, /* Bit 2: Enable Big Endian */ + XM_MD_FTF = 1<<1, /* Bit 1: (sc) Flush Tx FIFO */ + XM_MD_FRF = 1<<0, /* Bit 0: (sc) Flush Rx FIFO */ +}; + +#define XM_PAUSE_MODE (XM_MD_SPOE_E | XM_MD_SPOL_I | XM_MD_SPOH_I) +#define XM_DEF_MODE (XM_MD_RX_RUNT | XM_MD_RX_IRLE | XM_MD_RX_LONG |\ + XM_MD_RX_CRCE | XM_MD_RX_ERR | XM_MD_CSA | XM_MD_CAA) + +/* XM_STAT_CMD 16 bit r/w Statistics Command Register */ +enum { + XM_SC_SNP_RXC = 1<<5, /* Bit 5: (sc) Snap Rx Counters */ + XM_SC_SNP_TXC = 1<<4, /* Bit 4: (sc) Snap Tx Counters */ + XM_SC_CP_RXC = 1<<3, /* Bit 3: Copy Rx Counters Continuously */ + XM_SC_CP_TXC = 1<<2, /* Bit 2: Copy Tx Counters Continuously */ + XM_SC_CLR_RXC = 1<<1, /* Bit 1: (sc) Clear Rx Counters */ + XM_SC_CLR_TXC = 1<<0, /* Bit 0: (sc) Clear Tx Counters */ +}; + + +/* XM_RX_CNT_EV 32 bit r/o Rx Counter Event Register */ +/* XM_RX_EV_MSK 32 bit r/w Rx Counter Event Mask */ +enum { + XMR_MAX_SZ_OV = 1<<31, /* Bit 31: 1024-MaxSize Rx Cnt Ov*/ + XMR_1023B_OV = 1<<30, /* Bit 30: 512-1023Byte Rx Cnt Ov*/ + XMR_511B_OV = 1<<29, /* Bit 29: 256-511 Byte Rx Cnt Ov*/ + XMR_255B_OV = 1<<28, /* Bit 28: 128-255 Byte Rx Cnt Ov*/ + XMR_127B_OV = 1<<27, /* Bit 27: 65-127 Byte Rx Cnt Ov */ + XMR_64B_OV = 1<<26, /* Bit 26: 64 Byte Rx Cnt Ov */ + XMR_UTIL_OV = 1<<25, /* Bit 25: Rx Util Cnt Overflow */ + XMR_UTIL_UR = 1<<24, /* Bit 24: Rx Util Cnt Underrun */ + XMR_CEX_ERR_OV = 1<<23, /* Bit 23: CEXT Err Cnt Ov */ + XMR_FCS_ERR_OV = 1<<21, /* Bit 21: Rx FCS Error Cnt Ov */ + XMR_LNG_ERR_OV = 1<<20, /* Bit 20: Rx too Long Err Cnt Ov*/ + XMR_RUNT_OV = 1<<19, /* Bit 19: Runt Event Cnt Ov */ + XMR_SHT_ERR_OV = 1<<18, /* Bit 18: Rx Short Ev Err Cnt Ov*/ + XMR_SYM_ERR_OV = 1<<17, /* Bit 17: Rx Sym Err Cnt Ov */ + XMR_CAR_ERR_OV = 1<<15, /* Bit 15: Rx Carr Ev Err Cnt Ov */ + XMR_JAB_PKT_OV = 1<<14, /* Bit 14: Rx Jabb Packet Cnt Ov */ + XMR_FIFO_OV = 1<<13, /* Bit 13: Rx FIFO Ov Ev Cnt Ov */ + XMR_FRA_ERR_OV = 1<<12, /* Bit 12: Rx Framing Err Cnt Ov */ + XMR_FMISS_OV = 1<<11, /* Bit 11: Rx Missed Ev Cnt Ov */ + XMR_BURST = 1<<10, /* Bit 10: Rx Burst Event Cnt Ov */ + XMR_INV_MOC = 1<<9, /* Bit 9: Rx with inv. MAC OC Ov*/ + XMR_INV_MP = 1<<8, /* Bit 8: Rx inv Pause Frame Ov */ + XMR_MCTRL_OV = 1<<7, /* Bit 7: Rx MAC Ctrl-F Cnt Ov */ + XMR_MPAUSE_OV = 1<<6, /* Bit 6: Rx Pause MAC Ctrl-F Ov*/ + XMR_UC_OK_OV = 1<<5, /* Bit 5: Rx Unicast Frame CntOv*/ + XMR_MC_OK_OV = 1<<4, /* Bit 4: Rx Multicast Cnt Ov */ + XMR_BC_OK_OV = 1<<3, /* Bit 3: Rx Broadcast Cnt Ov */ + XMR_OK_LO_OV = 1<<2, /* Bit 2: Octets Rx OK Low CntOv*/ + XMR_OK_HI_OV = 1<<1, /* Bit 1: Octets Rx OK Hi Cnt Ov*/ + XMR_OK_OV = 1<<0, /* Bit 0: Frames Received Ok Ov */ +}; + +#define XMR_DEF_MSK (XMR_OK_LO_OV | XMR_OK_HI_OV) + +/* XM_TX_CNT_EV 32 bit r/o Tx Counter Event Register */ +/* XM_TX_EV_MSK 32 bit r/w Tx Counter Event Mask */ +enum { + XMT_MAX_SZ_OV = 1<<25, /* Bit 25: 1024-MaxSize Tx Cnt Ov*/ + XMT_1023B_OV = 1<<24, /* Bit 24: 512-1023Byte Tx Cnt Ov*/ + XMT_511B_OV = 1<<23, /* Bit 23: 256-511 Byte Tx Cnt Ov*/ + XMT_255B_OV = 1<<22, /* Bit 22: 128-255 Byte Tx Cnt Ov*/ + XMT_127B_OV = 1<<21, /* Bit 21: 65-127 Byte Tx Cnt Ov */ + XMT_64B_OV = 1<<20, /* Bit 20: 64 Byte Tx Cnt Ov */ + XMT_UTIL_OV = 1<<19, /* Bit 19: Tx Util Cnt Overflow */ + XMT_UTIL_UR = 1<<18, /* Bit 18: Tx Util Cnt Underrun */ + XMT_CS_ERR_OV = 1<<17, /* Bit 17: Tx Carr Sen Err Cnt Ov*/ + XMT_FIFO_UR_OV = 1<<16, /* Bit 16: Tx FIFO Ur Ev Cnt Ov */ + XMT_EX_DEF_OV = 1<<15, /* Bit 15: Tx Ex Deferall Cnt Ov */ + XMT_DEF = 1<<14, /* Bit 14: Tx Deferred Cnt Ov */ + XMT_LAT_COL_OV = 1<<13, /* Bit 13: Tx Late Col Cnt Ov */ + XMT_ABO_COL_OV = 1<<12, /* Bit 12: Tx abo dueto Ex Col Ov*/ + XMT_MUL_COL_OV = 1<<11, /* Bit 11: Tx Mult Col Cnt Ov */ + XMT_SNG_COL = 1<<10, /* Bit 10: Tx Single Col Cnt Ov */ + XMT_MCTRL_OV = 1<<9, /* Bit 9: Tx MAC Ctrl Counter Ov*/ + XMT_MPAUSE = 1<<8, /* Bit 8: Tx Pause MAC Ctrl-F Ov*/ + XMT_BURST = 1<<7, /* Bit 7: Tx Burst Event Cnt Ov */ + XMT_LONG = 1<<6, /* Bit 6: Tx Long Frame Cnt Ov */ + XMT_UC_OK_OV = 1<<5, /* Bit 5: Tx Unicast Cnt Ov */ + XMT_MC_OK_OV = 1<<4, /* Bit 4: Tx Multicast Cnt Ov */ + XMT_BC_OK_OV = 1<<3, /* Bit 3: Tx Broadcast Cnt Ov */ + XMT_OK_LO_OV = 1<<2, /* Bit 2: Octets Tx OK Low CntOv*/ + XMT_OK_HI_OV = 1<<1, /* Bit 1: Octets Tx OK Hi Cnt Ov*/ + XMT_OK_OV = 1<<0, /* Bit 0: Frames Tx Ok Ov */ +}; + +#define XMT_DEF_MSK (XMT_OK_LO_OV | XMT_OK_HI_OV) + +struct skge_rx_desc { + u32 control; + u32 next_offset; + u32 dma_lo; + u32 dma_hi; + u32 status; + u32 timestamp; + u16 csum2; + u16 csum1; + u16 csum2_start; + u16 csum1_start; +}; + +struct skge_tx_desc { + u32 control; + u32 next_offset; + u32 dma_lo; + u32 dma_hi; + u32 status; + u32 csum_startval; + u16 csum_writepos; + u16 csum_startpos; + u32 rsvd; +}; + +struct skge_element { + struct skge_element *next; + void *desc; + struct sk_buff *skb; + DECLARE_PCI_UNMAP_ADDR(mapaddr); + DECLARE_PCI_UNMAP_LEN(maplen); +}; + +struct skge_ring { + struct skge_element *to_clean; + struct skge_element *to_use; + struct skge_element *start; + unsigned long count; +}; + + +struct skge_hw { + void __iomem *regs; + struct pci_dev *pdev; + u32 intr_mask; + struct net_device *dev[2]; + + spinlock_t phy_lock; + struct tasklet_struct ext_tasklet; + + u8 chip_id; + u8 mac_cfg; + u8 phy_type; + u8 pmd_type; + u16 phy_addr; + + u32 rom_size; + u32 ram_size; + u32 ram_offset; + +}; + +static inline int isdualport(const struct skge_hw *hw) +{ + return !(hw->mac_cfg & CFG_SNG_MAC); +} + +static inline u8 chip_rev(const struct skge_hw *hw) +{ + return (hw->mac_cfg & CFG_CHIP_R_MSK) >> 4; +} + +static inline int iscopper(const struct skge_hw *hw) +{ + return (hw->pmd_type == 'T'); +} + +enum { + FLOW_MODE_NONE = 0, /* No Flow-Control */ + FLOW_MODE_LOC_SEND = 1, /* Local station sends PAUSE */ + FLOW_MODE_REM_SEND = 2, /* Symmetric or just remote */ + FLOW_MODE_SYMMETRIC = 3, /* Both stations may send PAUSE */ +}; + +struct skge_port { + struct skge_hw *hw; + struct net_device *netdev; + u32 msg_enable; + u8 port; + u8 rx_csum; + u8 blink_on; + u8 flow_control; + u8 autoneg; /* AUTONEG_ENABLE, AUTONEG_DISABLE */ + u8 duplex; /* DUPLEX_HALF, DUPLEX_FULL */ + u16 speed; /* SPEED_1000, SPEED_100, ... */ + + void *mem; /* PCI memory for rings */ + dma_addr_t dma; + unsigned long mem_size; + + spinlock_t tx_lock; + u32 tx_avail; + struct skge_ring tx_ring; + struct skge_ring rx_ring; + + struct net_device_stats net_stats; + struct timer_list link_check; + struct timer_list led_blink; +}; + + +/* Register accessor for memory mapped device */ +static inline u32 skge_read32(const struct skge_hw *hw, int reg) +{ + return readl(hw->regs + reg); + +} + +static inline u16 skge_read16(const struct skge_hw *hw, int reg) +{ + return readw(hw->regs + reg); +} + +static inline u8 skge_read8(const struct skge_hw *hw, int reg) +{ + return readb(hw->regs + reg); +} + +static inline void skge_write32(const struct skge_hw *hw, int reg, u32 val) +{ + writel(val, hw->regs + reg); +} + +static inline void skge_write16(const struct skge_hw *hw, int reg, u16 val) +{ + writew(val, hw->regs + reg); +} + +static inline void skge_write8(const struct skge_hw *hw, int reg, u8 val) +{ + writeb(val, hw->regs + reg); +} + +/* MAC Related Registers inside the device. */ +#define SKGEMAC_REG(port,reg) (((port)<<7)+(reg)) + +/* PCI config space can be accessed via memory mapped space */ +#define SKGEPCI_REG(reg) ((reg)+ 0x380) + +#define SKGEXM_REG(port, reg) \ + ((BASE_XMAC_1 + (port) * (BASE_XMAC_2 - BASE_XMAC_1)) | (reg) << 1) + +static inline u32 skge_xm_read32(const struct skge_hw *hw, int port, int reg) +{ + return skge_read32(hw, SKGEXM_REG(port,reg)); +} + +static inline u16 skge_xm_read16(const struct skge_hw *hw, int port, int reg) +{ + return skge_read16(hw, SKGEXM_REG(port,reg)); +} + +static inline u8 skge_xm_read8(const struct skge_hw *hw, int port, int reg) +{ + return skge_read8(hw, SKGEXM_REG(port,reg)); +} + +static inline void skge_xm_write32(const struct skge_hw *hw, int port, int r, u32 v) +{ + skge_write32(hw, SKGEXM_REG(port,r), v); +} + +static inline void skge_xm_write16(const struct skge_hw *hw, int port, int r, u16 v) +{ + skge_write16(hw, SKGEXM_REG(port,r), v); +} + +static inline void skge_xm_write8(const struct skge_hw *hw, int port, int r, u8 v) +{ + skge_write8(hw, SKGEXM_REG(port,r), v); +} + +static inline void skge_xm_outhash(const struct skge_hw *hw, int port, int reg, + const u8 *hash) +{ + skge_xm_write16(hw, port, reg, + (u16)hash[0] | ((u16)hash[1] << 8)); + skge_xm_write16(hw, port, reg+2, + (u16)hash[2] | ((u16)hash[3] << 8)); + skge_xm_write16(hw, port, reg+4, + (u16)hash[4] | ((u16)hash[5] << 8)); + skge_xm_write16(hw, port, reg+6, + (u16)hash[6] | ((u16)hash[7] << 8)); +} + +static inline void skge_xm_outaddr(const struct skge_hw *hw, int port, int reg, + const u8 *addr) +{ + skge_xm_write16(hw, port, reg, + (u16)addr[0] | ((u16)addr[1] << 8)); + skge_xm_write16(hw, port, reg, + (u16)addr[2] | ((u16)addr[3] << 8)); + skge_xm_write16(hw, port, reg, + (u16)addr[4] | ((u16)addr[5] << 8)); +} + + +#define SKGEGMA_REG(port,reg) \ + ((reg) + BASE_GMAC_1 + \ + (port) * (BASE_GMAC_2-BASE_GMAC_1)) + +static inline u16 skge_gma_read16(const struct skge_hw *hw, int port, int reg) +{ + return skge_read16(hw, SKGEGMA_REG(port,reg)); +} + +static inline u32 skge_gma_read32(const struct skge_hw *hw, int port, int reg) +{ + return (u32) skge_read16(hw, SKGEGMA_REG(port,reg)) + | ((u32)skge_read16(hw, SKGEGMA_REG(port,reg+4)) << 16); +} + +static inline u8 skge_gma_read8(const struct skge_hw *hw, int port, int reg) +{ + return skge_read8(hw, SKGEGMA_REG(port,reg)); +} + +static inline void skge_gma_write16(const struct skge_hw *hw, int port, int r, u16 v) +{ + skge_write16(hw, SKGEGMA_REG(port,r), v); +} + +static inline void skge_gma_write32(const struct skge_hw *hw, int port, int r, u32 v) +{ + skge_write16(hw, SKGEGMA_REG(port, r), (u16) v); + skge_write32(hw, SKGEGMA_REG(port, r+4), (u16)(v >> 16)); +} + +static inline void skge_gma_write8(const struct skge_hw *hw, int port, int r, u8 v) +{ + skge_write8(hw, SKGEGMA_REG(port,r), v); +} + +static inline void skge_gm_set_addr(struct skge_hw *hw, int port, int reg, + const u8 *addr) +{ + skge_gma_write16(hw, port, reg, + (u16) addr[0] | ((u16) addr[1] << 8)); + skge_gma_write16(hw, port, reg+4, + (u16) addr[2] | ((u16) addr[3] << 8)); + skge_gma_write16(hw, port, reg+8, + (u16) addr[4] | ((u16) addr[5] << 8)); +} + +#endif From herbert@gondor.apana.org.au Fri Jan 14 16:29:06 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 16:29:15 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0F0T4sr016643 for ; Fri, 14 Jan 2005 16:29:05 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1Cpbo1-0001Pb-00; Sat, 15 Jan 2005 11:28:41 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1Cpbm2-0003qp-00; Sat, 15 Jan 2005 11:26:38 +1100 Date: Sat, 15 Jan 2005 11:26:38 +1100 To: Jeff Garzik Cc: YOSHIFUJI Hideaki / ???????????? , "David S. Miller" , netdev@oss.sgi.com Subject: Re: "Badness" again Message-ID: <20050115002638.GA13849@gondor.apana.org.au> References: <41E83B8D.8020003@pobox.com> <20050114215833.GA12981@gondor.apana.org.au> <41E844AC.6040200@pobox.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="ew6BAiZeqk4r7MaW" Content-Disposition: inline In-Reply-To: <41E844AC.6040200@pobox.com> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 268 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev --ew6BAiZeqk4r7MaW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Jan 14, 2005 at 05:16:12PM -0500, Jeff Garzik wrote: > > Blah. Any other suggestions for debugging this thing? Yes I have a better theory now :) All your "badness" messages start with a call to udpv6_sendmsg(). That function calls ip6_dst_lookup() to get its dst entry. Note that udpv6_sendmsg() does not hold a lock on the sk at all. However, ip6_dst_lookup() uses __sk_dst_check() which is only safe if you can either guarantee single-threadedness or if you hold sk_dst_lock. Neither is true here and therefore we may have a situation where the cached dst is released twice. In fact I tracked down the address closest to the "badness" messages and it belongs to one of your domain's name servers. That means the requests were probably made by named, which is multi-threaded. So please give this patch a spin and see if it makes things any better. I've verified that no callers to ip6_dst_lookup() holds sk_dst_lock so it's safe (but possibly redundant in cases where they hold locks on the sk itself) to use sk_dst_check(). Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --ew6BAiZeqk4r7MaW Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== net/ipv6/ip6_output.c 1.79 vs edited ===== --- 1.79/net/ipv6/ip6_output.c 2005-01-14 15:41:06 +11:00 +++ edited/net/ipv6/ip6_output.c 2005-01-15 11:17:44 +11:00 @@ -745,7 +745,7 @@ if (sk) { struct ipv6_pinfo *np = inet6_sk(sk); - *dst = __sk_dst_check(sk, np->dst_cookie); + *dst = sk_dst_check(sk, np->dst_cookie); if (*dst) { struct rt6_info *rt = (struct rt6_info*)*dst; @@ -772,9 +772,9 @@ && (np->daddr_cache == NULL || !ipv6_addr_equal(&fl->fl6_dst, np->daddr_cache))) || (fl->oif && fl->oif != (*dst)->dev->ifindex)) { + dst_release(*dst); *dst = NULL; - } else - dst_hold(*dst); + } } } --ew6BAiZeqk4r7MaW-- From kyoungso@cs.princeton.edu Fri Jan 14 18:23:22 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 18:23:27 -0800 (PST) Received: from Princeton.EDU (root@postoffice02.Princeton.EDU [128.112.130.38]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0F2NLfi021318 for ; Fri, 14 Jan 2005 18:23:22 -0800 Received: from smtpserver1.Princeton.EDU (smtpserver1.Princeton.EDU [128.112.129.65]) by Princeton.EDU (8.12.9/8.12.9) with ESMTP id j0F2Mtou008563; Fri, 14 Jan 2005 21:22:55 -0500 (EST) Received: from cs.princeton.edu (kyoungso.student.Princeton.EDU [140.180.162.132]) (authenticated bits=0) by smtpserver1.Princeton.EDU (8.12.9/8.12.9) with ESMTP id j0F2MsXM011509 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT); Fri, 14 Jan 2005 21:22:55 -0500 (EST) Message-ID: <41E87E7D.8040107@cs.princeton.edu> Date: Fri, 14 Jan 2005 21:22:53 -0500 From: KyoungSoo Park User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: netdev@oss.sgi.com Subject: Re: is there any plan to support BSD accept filter? References: <41E830BC.7000709@cs.princeton.edu> <20050114140540.76146b29@dxpl.pdx.osdl.net> In-Reply-To: <20050114140540.76146b29@dxpl.pdx.osdl.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 269 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kyoungso@cs.princeton.edu Precedence: bulk X-list: netdev yes. I agree that maybe an ugly hack to put that in the kernel. What I want to do is to support such feature leaving as little footprint as possible in the kernel, but specify whatever flexible policy you want in the user level. I'm not sure netfilter module is the right place because it seems I need to do packet by packet processing, but I want to deal with a little higher level than that as a start. (I'm not familar with netfilter, so please correct me if I'm wrong.) Anyway, thanks for your response. KyoungSoo Stephen Hemminger wrote: >If you want to do these kind of stateful hacks, why not build a >netfilter module to do it? > > > > From chas@cmf.nrl.navy.mil Fri Jan 14 18:33:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 18:33:08 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0F2X0rV022100 for ; Fri, 14 Jan 2005 18:33:03 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.11/8.12.11) with ESMTP id j0F2Wovr010942; Fri, 14 Jan 2005 21:32:50 -0500 (EST) Message-Id: <200501150232.j0F2Wovr010942@ginger.cmf.nrl.navy.mil> To: "David S. Miller" cc: netdev@oss.sgi.com Reply-To: chas3@users.sourceforge.net Subject: Re: [RFC] locking changes for lec.c In-reply-to: Your message of "Fri, 14 Jan 2005 13:56:12 PST." <20050114135612.0edc180d.davem@davemloft.net> Date: Fri, 14 Jan 2005 21:32:51 -0500 From: "chas williams - CONTRACTOR" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-Virus-Status: Clean X-archive-position: 270 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev In message <20050114135612.0edc180d.davem@davemloft.net>,"David S. Miller" writes: >Can HW interrupt paths ever call into this ARP stuff? >If not, probably should just use BH disabled locking >instead of the heavy handed IRQ disabling locks. yes, lec_push() could be run in hw interrupt context from one of of the atm drivers recv path. in fact, this is the path where i "noticed" the race condition. From jgarzik@pobox.com Fri Jan 14 20:20:56 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 20:21:01 -0800 (PST) Received: from parcelfarce.linux.theplanet.co.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0F4KsZf030360 for ; Fri, 14 Jan 2005 20:20:55 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by parcelfarce.linux.theplanet.co.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CpfQh-0007LR-Bf; Sat, 15 Jan 2005 04:20:51 +0000 Message-ID: <41E89A0E.5020207@pobox.com> Date: Fri, 14 Jan 2005 23:20:30 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Herbert Xu CC: YOSHIFUJI Hideaki / ???????????? , "David S. Miller" , netdev@oss.sgi.com Subject: Re: "Badness" again References: <41E83B8D.8020003@pobox.com> <20050114215833.GA12981@gondor.apana.org.au> <41E844AC.6040200@pobox.com> <20050115002638.GA13849@gondor.apana.org.au> In-Reply-To: <20050115002638.GA13849@gondor.apana.org.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 271 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Herbert Xu wrote: > On Fri, Jan 14, 2005 at 05:16:12PM -0500, Jeff Garzik wrote: > >>Blah. Any other suggestions for debugging this thing? > > > Yes I have a better theory now :) > > All your "badness" messages start with a call to udpv6_sendmsg(). > That function calls ip6_dst_lookup() to get its dst entry. Note > that udpv6_sendmsg() does not hold a lock on the sk at all. However, > ip6_dst_lookup() uses __sk_dst_check() which is only safe if you can > either guarantee single-threadedness or if you hold sk_dst_lock. > > Neither is true here and therefore we may have a situation where > the cached dst is released twice. In fact I tracked down the > address closest to the "badness" messages and it belongs to > one of your domain's name servers. That means the requests were > probably made by named, which is multi-threaded. > > So please give this patch a spin and see if it makes things any > better. I've verified that no callers to ip6_dst_lookup() holds > sk_dst_lock so it's safe (but possibly redundant in cases where > they hold locks on the sk itself) to use sk_dst_check(). Running with this patch now, we'll see how it goes. Thanks. FWIW I also see ICMP code paths in the tracebacks (but that may be "second message" noise). Jeff From davem@davemloft.net Fri Jan 14 20:34:17 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 20:34:23 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0F4YESO031365 for ; Fri, 14 Jan 2005 20:34:16 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CpfdH-0003CZ-00; Fri, 14 Jan 2005 20:33:51 -0800 Date: Fri, 14 Jan 2005 20:33:51 -0800 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [RFC] locking changes for lec.c Message-Id: <20050114203351.14effe19.davem@davemloft.net> In-Reply-To: <200501150232.j0F2Wovr010942@ginger.cmf.nrl.navy.mil> References: <20050114135612.0edc180d.davem@davemloft.net> <200501150232.j0F2Wovr010942@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 272 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Fri, 14 Jan 2005 21:32:51 -0500 "chas williams - CONTRACTOR" wrote: > In message <20050114135612.0edc180d.davem@davemloft.net>,"David S. Miller" writes: > >Can HW interrupt paths ever call into this ARP stuff? > >If not, probably should just use BH disabled locking > >instead of the heavy handed IRQ disabling locks. > > yes, lec_push() could be run in hw interrupt context from one of of the > atm drivers recv path. in fact, this is the path where i "noticed" the > race condition. Ok. As a future thought, if you make the ATM driver receive path NAPI in style or run always from softint processing, you can undo all the IRQ based locking. From acme@conectiva.com.br Fri Jan 14 20:48:06 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 20:48:20 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0F4m4as032295 for ; Fri, 14 Jan 2005 20:48:05 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1Cpf6o-0008TE-00; Sat, 15 Jan 2005 02:00:18 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 0492B1462D; Sat, 15 Jan 2005 02:48:01 -0200 (BRST) Message-ID: <41E8A17D.9040307@conectiva.com.br> Date: Sat, 15 Jan 2005 02:52:13 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" , Sridhar Samudrala Cc: Networking Team Subject: [PATCH] merge sctp_opt with sctp_sock X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------040302060905050501040809" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 273 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------040302060905050501040809 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David, Sridhar, Please take a look and if its acceptable pull from: bk://kernel.bkbits.net/acme/connection_sock-2.6 The tricky bit here is that SCTP, to keep the existing logic, needs a way to copy only its private area from one sock to another, so I introduced a generic inet_sk_copy_descendant, that knows about the inet (v4/v6) layout (wrt inet_sock and inet6_pinfo), using this and sk->sk_prot->slab_obj_size we can copy the inet_sock descendant private area generically. Best Regards, - Arnaldo --------------040302060905050501040809 Content-Type: text/plain; name="sctp_sock.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sctp_sock.patch" =================================================================== ChangeSet@1.2334, 2005-01-15 02:32:54-02:00, acme@toy.ghostprotocols.net [SCTP] merge sctp_sock with sctp_opt No need for two structs, follow the new inet_sock layout style. Also introduce inet_sk_copy_descendant, to copy just the inet_sock descendant specific area from one sock to another. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller include/linux/ip.h | 14 +++++++++ include/linux/ipv6.h | 11 +++++++ include/net/sctp/sctp.h | 19 ------------- include/net/sctp/structs.h | 44 +++++++++++++++++++++--------- net/sctp/associola.c | 8 ++--- net/sctp/bind_addr.c | 4 +- net/sctp/chunk.c | 2 - net/sctp/endpointola.c | 2 - net/sctp/ipv6.c | 20 +++++++------- net/sctp/output.c | 4 +- net/sctp/protocol.c | 16 +++++------ net/sctp/sm_make_chunk.c | 2 - net/sctp/socket.c | 64 ++++++++++++++++++++++----------------------- net/sctp/transport.c | 2 - net/sctp/ulpqueue.c | 3 -- 15 files changed, 120 insertions(+), 95 deletions(-) diff -Nru a/include/linux/ip.h b/include/linux/ip.h --- a/include/linux/ip.h 2005-01-15 02:43:18 -02:00 +++ b/include/linux/ip.h 2005-01-15 02:43:18 -02:00 @@ -158,6 +158,20 @@ return (struct inet_sock *)sk; } +static inline void __inet_sk_copy_descendant(struct sock *sk_to, + const struct sock *sk_from, + const int ancestor_size) +{ + memcpy(inet_sk(sk_to) + 1, inet_sk(sk_from) + 1, + sk_from->sk_prot->slab_obj_size - ancestor_size); +} +#if !(defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)) +static inline void inet_sk_copy_descendant(struct sock *sk_to, + const struct sock *sk_from) +{ + __inet_sk_copy_descendant(sk_to, sk_from, sizeof(struct inet_sock)); +} +#endif #endif struct iphdr { diff -Nru a/include/linux/ipv6.h b/include/linux/ipv6.h --- a/include/linux/ipv6.h 2005-01-15 02:43:18 -02:00 +++ b/include/linux/ipv6.h 2005-01-15 02:43:18 -02:00 @@ -282,6 +282,17 @@ return &((struct raw6_sock *)__sk)->raw6; } +static inline void inet_sk_copy_descendant(struct sock *sk_to, + const struct sock *sk_from) +{ + int ancestor_size = sizeof(struct inet_sock); + + if (sk_from->sk_family == PF_INET6) + ancestor_size += sizeof(struct ipv6_pinfo); + + __inet_sk_copy_descendant(sk_to, sk_from, ancestor_size); +} + #define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only) #define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk)) #else diff -Nru a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h --- a/include/net/sctp/sctp.h 2005-01-15 02:43:18 -02:00 +++ b/include/net/sctp/sctp.h 2005-01-15 02:43:18 -02:00 @@ -423,7 +423,7 @@ } /* Break down data chunks at this point. */ -static inline int sctp_frag_point(const struct sctp_opt *sp, int pmtu) +static inline int sctp_frag_point(const struct sctp_sock *sp, int pmtu) { int frag = pmtu; @@ -575,23 +575,6 @@ h ^= vtag; return (h & (sctp_assoc_hashsize-1)); } - -/* WARNING: Do not change the layout of the members in sctp_sock! */ -struct sctp_sock { - struct inet_sock inet; - struct sctp_opt sctp; -}; - -#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) -struct sctp6_sock { - struct inet_sock inet; - struct sctp_opt sctp; - struct ipv6_pinfo inet6; -}; -#endif /* CONFIG_IPV6 */ - -#define sctp_sk(__sk) (&((struct sctp_sock *)__sk)->sctp) -#define sctp_opt2sk(__sp) &container_of(__sp, struct sctp_sock, sctp)->inet.sk /* Is a socket of this style? */ #define sctp_style(sk, style) __sctp_style((sk), (SCTP_SOCKET_##style)) diff -Nru a/include/net/sctp/structs.h b/include/net/sctp/structs.h --- a/include/net/sctp/structs.h 2005-01-15 02:43:18 -02:00 +++ b/include/net/sctp/structs.h 2005-01-15 02:43:18 -02:00 @@ -58,6 +58,7 @@ #include /* linux/in.h needs this!! */ #include /* We get struct sockaddr_in. */ #include /* We get struct in6_addr */ +#include #include /* We get MAXHOSTNAMELEN. */ #include /* This gets us atomic counters. */ #include /* We need sk_buff_head. */ @@ -84,7 +85,6 @@ struct sctp_outq; struct sctp_bind_addr; struct sctp_ulpq; -struct sctp_opt; struct sctp_ep_common; struct sctp_ssnmap; @@ -234,7 +234,9 @@ } sctp_socket_type_t; /* Per socket SCTP information. */ -struct sctp_opt { +struct sctp_sock { + /* inet_sock has to be the first member of sctp_sock */ + struct inet_sock inet; /* What kind of a socket is this? */ sctp_socket_type_t type; @@ -272,6 +274,22 @@ struct sk_buff_head pd_lobby; }; +static inline struct sctp_sock *sctp_sk(const struct sock *sk) +{ + return (struct sctp_sock *)sk; +} + +static inline struct sock *sctp_opt2sk(const struct sctp_sock *sp) +{ + return (struct sock *)sp; +} + +#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) +struct sctp6_sock { + struct sctp_sock sctp; + struct ipv6_pinfo inet6; +}; +#endif /* CONFIG_IPV6 */ /* This is our APPLICATION-SPECIFIC state cookie. @@ -487,12 +505,12 @@ int (*to_addr_param) (const union sctp_addr *, union sctp_addr_param *); int (*addr_valid) (union sctp_addr *, - struct sctp_opt *); + struct sctp_sock *); sctp_scope_t (*scope) (union sctp_addr *); void (*inaddr_any) (union sctp_addr *, unsigned short); int (*is_any) (const union sctp_addr *); int (*available) (union sctp_addr *, - struct sctp_opt *); + struct sctp_sock *); int (*skb_iif) (const struct sk_buff *sk); int (*is_ce) (const struct sk_buff *sk); void (*seq_dump_addr)(struct seq_file *seq, @@ -510,16 +528,16 @@ struct sctp_pf { void (*event_msgname)(struct sctp_ulpevent *, char *, int *); void (*skb_msgname) (struct sk_buff *, char *, int *); - int (*af_supported) (sa_family_t, struct sctp_opt *); + int (*af_supported) (sa_family_t, struct sctp_sock *); int (*cmp_addr) (const union sctp_addr *, const union sctp_addr *, - struct sctp_opt *); - int (*bind_verify) (struct sctp_opt *, union sctp_addr *); - int (*send_verify) (struct sctp_opt *, union sctp_addr *); - int (*supported_addrs)(const struct sctp_opt *, __u16 *); + struct sctp_sock *); + int (*bind_verify) (struct sctp_sock *, union sctp_addr *); + int (*send_verify) (struct sctp_sock *, union sctp_addr *); + int (*supported_addrs)(const struct sctp_sock *, __u16 *); struct sock *(*create_accept_sk) (struct sock *sk, struct sctp_association *asoc); - void (*addr_v4map) (struct sctp_opt *, union sctp_addr *); + void (*addr_v4map) (struct sctp_sock *, union sctp_addr *); struct sctp_af *af; }; @@ -922,7 +940,7 @@ void sctp_transport_set_owner(struct sctp_transport *, struct sctp_association *); void sctp_transport_route(struct sctp_transport *, union sctp_addr *, - struct sctp_opt *); + struct sctp_sock *); void sctp_transport_pmtu(struct sctp_transport *); void sctp_transport_free(struct sctp_transport *); void sctp_transport_reset_timers(struct sctp_transport *); @@ -1071,11 +1089,11 @@ int gfp); int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *); int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *, - struct sctp_opt *); + struct sctp_sock *); union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp, const union sctp_addr *addrs, int addrcnt, - struct sctp_opt *opt); + struct sctp_sock *opt); union sctp_params sctp_bind_addrs_to_raw(const struct sctp_bind_addr *bp, int *addrs_len, int gfp); int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw, int len, diff -Nru a/net/sctp/associola.c b/net/sctp/associola.c --- a/net/sctp/associola.c 2005-01-15 02:43:18 -02:00 +++ b/net/sctp/associola.c 2005-01-15 02:43:18 -02:00 @@ -73,7 +73,7 @@ sctp_scope_t scope, int gfp) { - struct sctp_opt *sp; + struct sctp_sock *sp; int i; /* Retrieve the SCTP per socket area. */ @@ -434,7 +434,7 @@ int gfp) { struct sctp_transport *peer; - struct sctp_opt *sp; + struct sctp_sock *sp; unsigned short port; sp = sctp_sk(asoc->base.sk); @@ -886,7 +886,7 @@ /* This routine moves an association from its old sk to a new sk. */ void sctp_assoc_migrate(struct sctp_association *assoc, struct sock *newsk) { - struct sctp_opt *newsp = sctp_sk(newsk); + struct sctp_sock *newsp = sctp_sk(newsk); struct sock *oldsk = assoc->base.sk; /* Delete the association from the old endpoint's list of @@ -1059,7 +1059,7 @@ } if (pmtu) { - struct sctp_opt *sp = sctp_sk(asoc->base.sk); + struct sctp_sock *sp = sctp_sk(asoc->base.sk); asoc->pmtu = pmtu; asoc->frag_point = sctp_frag_point(sp, pmtu); } diff -Nru a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c --- a/net/sctp/bind_addr.c 2005-01-15 02:43:18 -02:00 +++ b/net/sctp/bind_addr.c 2005-01-15 02:43:18 -02:00 @@ -293,7 +293,7 @@ /* Does this contain a specified address? Allow wildcarding. */ int sctp_bind_addr_match(struct sctp_bind_addr *bp, const union sctp_addr *addr, - struct sctp_opt *opt) + struct sctp_sock *opt) { struct sctp_sockaddr_entry *laddr; struct list_head *pos; @@ -313,7 +313,7 @@ union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp, const union sctp_addr *addrs, int addrcnt, - struct sctp_opt *opt) + struct sctp_sock *opt) { struct sctp_sockaddr_entry *laddr; union sctp_addr *addr; diff -Nru a/net/sctp/chunk.c b/net/sctp/chunk.c --- a/net/sctp/chunk.c 2005-01-15 02:43:18 -02:00 +++ b/net/sctp/chunk.c 2005-01-15 02:43:18 -02:00 @@ -77,7 +77,7 @@ { struct list_head *pos, *temp; struct sctp_chunk *chunk; - struct sctp_opt *sp; + struct sctp_sock *sp; struct sctp_ulpevent *ev; struct sctp_association *asoc = NULL; int error = 0, notify; diff -Nru a/net/sctp/endpointola.c b/net/sctp/endpointola.c --- a/net/sctp/endpointola.c 2005-01-15 02:43:18 -02:00 +++ b/net/sctp/endpointola.c 2005-01-15 02:43:18 -02:00 @@ -69,7 +69,7 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep, struct sock *sk, int gfp) { - struct sctp_opt *sp = sctp_sk(sk); + struct sctp_sock *sp = sctp_sk(sk); memset(ep, 0, sizeof(struct sctp_endpoint)); /* Initialize the base structure. */ diff -Nru a/net/sctp/ipv6.c b/net/sctp/ipv6.c --- a/net/sctp/ipv6.c 2005-01-15 02:43:18 -02:00 +++ b/net/sctp/ipv6.c 2005-01-15 02:43:18 -02:00 @@ -502,7 +502,7 @@ } /* Should this be available for binding? */ -static int sctp_v6_available(union sctp_addr *addr, struct sctp_opt *sp) +static int sctp_v6_available(union sctp_addr *addr, struct sctp_sock *sp) { int type; struct in6_addr *in6 = (struct in6_addr *)&addr->v6.sin6_addr; @@ -531,14 +531,14 @@ * Return 0 - If the address is a non-unicast or an illegal address. * Return 1 - If the address is a unicast. */ -static int sctp_v6_addr_valid(union sctp_addr *addr, struct sctp_opt *sp) +static int sctp_v6_addr_valid(union sctp_addr *addr, struct sctp_sock *sp) { int ret = ipv6_addr_type(&addr->v6.sin6_addr); /* Support v4-mapped-v6 address. */ if (ret == IPV6_ADDR_MAPPED) { /* Note: This routine is used in input, so v4-mapped-v6 - * are disallowed here when there is no sctp_opt. + * are disallowed here when there is no sctp_sock. */ if (!sp || !sp->v4mapped) return 0; @@ -616,7 +616,7 @@ newsk->sk_shutdown = sk->sk_shutdown; newsctp6sk = (struct sctp6_sock *)newsk; - newsctp6sk->inet.pinet6 = &newsctp6sk->inet6; + inet_sk(newsk)->pinet6 = &newsctp6sk->inet6; newinet = inet_sk(newsk); newnp = inet6_sk(newsk); @@ -661,7 +661,7 @@ } /* Map v4 address to mapped v6 address */ -static void sctp_v6_addr_v4map(struct sctp_opt *sp, union sctp_addr *addr) +static void sctp_v6_addr_v4map(struct sctp_sock *sp, union sctp_addr *addr) { if (sp->v4mapped && AF_INET == addr->sa.sa_family) sctp_v4_map_v6(addr); @@ -766,7 +766,7 @@ } /* Do we support this AF? */ -static int sctp_inet6_af_supported(sa_family_t family, struct sctp_opt *sp) +static int sctp_inet6_af_supported(sa_family_t family, struct sctp_sock *sp) { switch (family) { case AF_INET6: @@ -786,7 +786,7 @@ */ static int sctp_inet6_cmp_addr(const union sctp_addr *addr1, const union sctp_addr *addr2, - struct sctp_opt *opt) + struct sctp_sock *opt) { struct sctp_af *af1, *af2; @@ -808,7 +808,7 @@ /* Verify that the provided sockaddr looks bindable. Common verification, * has already been taken care of. */ -static int sctp_inet6_bind_verify(struct sctp_opt *opt, union sctp_addr *addr) +static int sctp_inet6_bind_verify(struct sctp_sock *opt, union sctp_addr *addr) { struct sctp_af *af; @@ -838,7 +838,7 @@ /* Verify that the provided sockaddr looks bindable. Common verification, * has already been taken care of. */ -static int sctp_inet6_send_verify(struct sctp_opt *opt, union sctp_addr *addr) +static int sctp_inet6_send_verify(struct sctp_sock *opt, union sctp_addr *addr) { struct sctp_af *af = NULL; @@ -872,7 +872,7 @@ * addresses. * Returns number of addresses supported. */ -static int sctp_inet6_supported_addrs(const struct sctp_opt *opt, +static int sctp_inet6_supported_addrs(const struct sctp_sock *opt, __u16 *types) { types[0] = SCTP_PARAM_IPV4_ADDRESS; diff -Nru a/net/sctp/output.c b/net/sctp/output.c --- a/net/sctp/output.c 2005-01-15 02:43:18 -02:00 +++ b/net/sctp/output.c 2005-01-15 02:43:18 -02:00 @@ -110,7 +110,7 @@ packet->destination_port = dport; skb_queue_head_init(&packet->chunks); if (asoc) { - struct sctp_opt *sp = sctp_sk(asoc->base.sk); + struct sctp_sock *sp = sctp_sk(asoc->base.sk); overhead = sp->pf->af->net_header_len; } else { overhead = sizeof(struct ipv6hdr); @@ -534,7 +534,7 @@ struct sctp_transport *transport = packet->transport; __u32 max_burst_bytes; struct sctp_association *asoc = transport->asoc; - struct sctp_opt *sp = sctp_sk(asoc->base.sk); + struct sctp_sock *sp = sctp_sk(asoc->base.sk); struct sctp_outq *q = &asoc->outqueue; /* RFC 2960 6.1 Transmission of DATA Chunks diff -Nru a/net/sctp/protocol.c b/net/sctp/protocol.c --- a/net/sctp/protocol.c 2005-01-15 02:43:18 -02:00 +++ b/net/sctp/protocol.c 2005-01-15 02:43:18 -02:00 @@ -364,7 +364,7 @@ * Return 0 - If the address is a non-unicast or an illegal address. * Return 1 - If the address is a unicast. */ -static int sctp_v4_addr_valid(union sctp_addr *addr, struct sctp_opt *sp) +static int sctp_v4_addr_valid(union sctp_addr *addr, struct sctp_sock *sp) { /* Is this a non-unicast address or a unusable SCTP address? */ if (IS_IPV4_UNUSABLE_ADDRESS(&addr->v4.sin_addr.s_addr)) @@ -374,7 +374,7 @@ } /* Should this be available for binding? */ -static int sctp_v4_available(union sctp_addr *addr, struct sctp_opt *sp) +static int sctp_v4_available(union sctp_addr *addr, struct sctp_sock *sp) { int ret = inet_addr_type(addr->v4.sin_addr.s_addr); @@ -608,7 +608,7 @@ } /* Map address, empty for v4 family */ -static void sctp_v4_addr_v4map(struct sctp_opt *sp, union sctp_addr *addr) +static void sctp_v4_addr_v4map(struct sctp_sock *sp, union sctp_addr *addr) { /* Empty */ } @@ -745,7 +745,7 @@ } /* Do we support this AF? */ -static int sctp_inet_af_supported(sa_family_t family, struct sctp_opt *sp) +static int sctp_inet_af_supported(sa_family_t family, struct sctp_sock *sp) { /* PF_INET only supports AF_INET addresses. */ return (AF_INET == family); @@ -754,7 +754,7 @@ /* Address matching with wildcards allowed. */ static int sctp_inet_cmp_addr(const union sctp_addr *addr1, const union sctp_addr *addr2, - struct sctp_opt *opt) + struct sctp_sock *opt) { /* PF_INET only supports AF_INET addresses. */ if (addr1->sa.sa_family != addr2->sa.sa_family) @@ -771,7 +771,7 @@ /* Verify that provided sockaddr looks bindable. Common verification has * already been taken care of. */ -static int sctp_inet_bind_verify(struct sctp_opt *opt, union sctp_addr *addr) +static int sctp_inet_bind_verify(struct sctp_sock *opt, union sctp_addr *addr) { return sctp_v4_available(addr, opt); } @@ -779,7 +779,7 @@ /* Verify that sockaddr looks sendable. Common verification has already * been taken care of. */ -static int sctp_inet_send_verify(struct sctp_opt *opt, union sctp_addr *addr) +static int sctp_inet_send_verify(struct sctp_sock *opt, union sctp_addr *addr) { return 1; } @@ -787,7 +787,7 @@ /* Fill in Supported Address Type information for INIT and INIT-ACK * chunks. Returns number of addresses supported. */ -static int sctp_inet_supported_addrs(const struct sctp_opt *opt, +static int sctp_inet_supported_addrs(const struct sctp_sock *opt, __u16 *types) { types[0] = SCTP_PARAM_IPV4_ADDRESS; diff -Nru a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c --- a/net/sctp/sm_make_chunk.c 2005-01-15 02:43:18 -02:00 +++ b/net/sctp/sm_make_chunk.c 2005-01-15 02:43:18 -02:00 @@ -181,7 +181,7 @@ size_t chunksize; struct sctp_chunk *retval = NULL; int num_types, addrs_len = 0; - struct sctp_opt *sp; + struct sctp_sock *sp; sctp_supported_addrs_param_t sat; __u16 types[2]; sctp_adaption_ind_param_t aiparam; diff -Nru a/net/sctp/socket.c b/net/sctp/socket.c --- a/net/sctp/socket.c 2005-01-15 02:43:18 -02:00 +++ b/net/sctp/socket.c 2005-01-15 02:43:18 -02:00 @@ -93,7 +93,7 @@ static int sctp_wait_for_connect(struct sctp_association *, long *timeo_p); static int sctp_wait_for_accept(struct sock *sk, long timeo); static void sctp_wait_for_close(struct sock *sk, long timeo); -static struct sctp_af *sctp_sockaddr_af(struct sctp_opt *opt, +static struct sctp_af *sctp_sockaddr_af(struct sctp_sock *opt, union sctp_addr *addr, int len); static int sctp_bindx_add(struct sock *, struct sockaddr *, int); static int sctp_bindx_rem(struct sock *, struct sockaddr *, int); @@ -269,7 +269,7 @@ static long sctp_get_port_local(struct sock *, union sctp_addr *); /* Verify this is a valid sockaddr. */ -static struct sctp_af *sctp_sockaddr_af(struct sctp_opt *opt, +static struct sctp_af *sctp_sockaddr_af(struct sctp_sock *opt, union sctp_addr *addr, int len) { struct sctp_af *af; @@ -294,7 +294,7 @@ /* Bind a local address either to an endpoint or to an association. */ SCTP_STATIC int sctp_do_bind(struct sock *sk, union sctp_addr *addr, int len) { - struct sctp_opt *sp = sctp_sk(sk); + struct sctp_sock *sp = sctp_sk(sk); struct sctp_endpoint *ep = sp->ep; struct sctp_bind_addr *bp = &ep->base.bind_addr; struct sctp_af *af; @@ -467,7 +467,7 @@ struct sockaddr *addrs, int addrcnt) { - struct sctp_opt *sp; + struct sctp_sock *sp; struct sctp_endpoint *ep; struct sctp_association *asoc; struct sctp_bind_addr *bp; @@ -572,7 +572,7 @@ */ int sctp_bindx_rem(struct sock *sk, struct sockaddr *addrs, int addrcnt) { - struct sctp_opt *sp = sctp_sk(sk); + struct sctp_sock *sp = sctp_sk(sk); struct sctp_endpoint *ep = sp->ep; int cnt; struct sctp_bind_addr *bp = &ep->base.bind_addr; @@ -656,7 +656,7 @@ struct sockaddr *addrs, int addrcnt) { - struct sctp_opt *sp; + struct sctp_sock *sp; struct sctp_endpoint *ep; struct sctp_association *asoc; struct sctp_bind_addr *bp; @@ -1051,7 +1051,7 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, size_t msg_len) { - struct sctp_opt *sp; + struct sctp_sock *sp; struct sctp_endpoint *ep; struct sctp_association *new_asoc=NULL, *asoc=NULL; struct sctp_transport *transport, *chunk_tp; @@ -1492,7 +1492,7 @@ int flags, int *addr_len) { struct sctp_ulpevent *event = NULL; - struct sctp_opt *sp = sctp_sk(sk); + struct sctp_sock *sp = sctp_sk(sk); struct sk_buff *skb; int copied; int err = 0; @@ -1637,7 +1637,7 @@ static int sctp_setsockopt_autoclose(struct sock *sk, char __user *optval, int optlen) { - struct sctp_opt *sp = sctp_sk(sk); + struct sctp_sock *sp = sctp_sk(sk); /* Applicable to UDP-style socket only */ if (sctp_style(sk, TCP)) @@ -1779,7 +1779,7 @@ static int sctp_setsockopt_initmsg(struct sock *sk, char __user *optval, int optlen) { struct sctp_initmsg sinit; - struct sctp_opt *sp = sctp_sk(sk); + struct sctp_sock *sp = sctp_sk(sk); if (optlen != sizeof(struct sctp_initmsg)) return -EINVAL; @@ -1817,7 +1817,7 @@ { struct sctp_sndrcvinfo info; struct sctp_association *asoc; - struct sctp_opt *sp = sctp_sk(sk); + struct sctp_sock *sp = sctp_sk(sk); if (optlen != sizeof(struct sctp_sndrcvinfo)) return -EINVAL; @@ -1934,7 +1934,7 @@ /* If there is no association or the association-id = 0 * set the values to the endpoint. */ - struct sctp_opt *sp = sctp_sk(sk); + struct sctp_sock *sp = sctp_sk(sk); if (rtoinfo.srto_initial != 0) sp->rtoinfo.srto_initial = rtoinfo.srto_initial; @@ -1987,7 +1987,7 @@ } } else { /* Set the values to the endpoint */ - struct sctp_opt *sp = sctp_sk(sk); + struct sctp_sock *sp = sctp_sk(sk); if (assocparams.sasoc_asocmaxrxt != 0) sp->assocparams.sasoc_asocmaxrxt = @@ -2012,7 +2012,7 @@ static int sctp_setsockopt_mappedv4(struct sock *sk, char __user *optval, int optlen) { int val; - struct sctp_opt *sp = sctp_sk(sk); + struct sctp_sock *sp = sctp_sk(sk); if (optlen < sizeof(int)) return -EINVAL; @@ -2040,7 +2040,7 @@ { struct sctp_association *asoc; struct list_head *pos; - struct sctp_opt *sp = sctp_sk(sk); + struct sctp_sock *sp = sctp_sk(sk); int val; if (optlen < sizeof(int)) @@ -2074,7 +2074,7 @@ static int sctp_setsockopt_peer_primary_addr(struct sock *sk, char __user *optval, int optlen) { - struct sctp_opt *sp; + struct sctp_sock *sp; struct sctp_endpoint *ep; struct sctp_association *asoc = NULL; struct sctp_setpeerprim prim; @@ -2269,7 +2269,7 @@ SCTP_STATIC int sctp_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) { - struct sctp_opt *sp; + struct sctp_sock *sp; struct sctp_endpoint *ep; struct sctp_association *asoc; struct sctp_transport *transport; @@ -2390,7 +2390,7 @@ */ SCTP_STATIC struct sock *sctp_accept(struct sock *sk, int flags, int *err) { - struct sctp_opt *sp; + struct sctp_sock *sp; struct sctp_endpoint *ep; struct sock *newsk = NULL; struct sctp_association *asoc; @@ -2453,7 +2453,7 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk) { struct sctp_endpoint *ep; - struct sctp_opt *sp; + struct sctp_sock *sp; SCTP_DEBUG_PRINTK("sctp_init_sock(sk: %p)\n", sk); @@ -3007,7 +3007,7 @@ struct sctp_transport *from; void __user *to; union sctp_addr temp; - struct sctp_opt *sp = sctp_sk(sk); + struct sctp_sock *sp = sctp_sk(sk); int addrlen; if (len != sizeof(struct sctp_getaddrs)) @@ -3164,7 +3164,7 @@ struct sctp_sockaddr_entry *addr; void __user *to; union sctp_addr temp; - struct sctp_opt *sp = sctp_sk(sk); + struct sctp_sock *sp = sctp_sk(sk); int addrlen; rwlock_t *addr_lock; int err = 0; @@ -3250,7 +3250,7 @@ { struct sctp_prim prim; struct sctp_association *asoc; - struct sctp_opt *sp = sctp_sk(sk); + struct sctp_sock *sp = sctp_sk(sk); if (len != sizeof(struct sctp_prim)) return -EINVAL; @@ -3329,7 +3329,7 @@ { struct sctp_sndrcvinfo info; struct sctp_association *asoc; - struct sctp_opt *sp = sctp_sk(sk); + struct sctp_sock *sp = sctp_sk(sk); if (len != sizeof(struct sctp_sndrcvinfo)) return -EINVAL; @@ -3423,7 +3423,7 @@ rtoinfo.srto_min = jiffies_to_msecs(asoc->rto_min); } else { /* Values corresponding to the endpoint. */ - struct sctp_opt *sp = sctp_sk(sk); + struct sctp_sock *sp = sctp_sk(sk); rtoinfo.srto_initial = sp->rtoinfo.srto_initial; rtoinfo.srto_max = sp->rtoinfo.srto_max; @@ -3489,7 +3489,7 @@ assocparams.sasoc_number_peer_destinations = cnt; } else { /* Values corresponding to the endpoint */ - struct sctp_opt *sp = sctp_sk(sk); + struct sctp_sock *sp = sctp_sk(sk); assocparams.sasoc_asocmaxrxt = sp->assocparams.sasoc_asocmaxrxt; assocparams.sasoc_peer_rwnd = sp->assocparams.sasoc_peer_rwnd; @@ -3524,7 +3524,7 @@ char __user *optval, int __user *optlen) { int val; - struct sctp_opt *sp = sctp_sk(sk); + struct sctp_sock *sp = sctp_sk(sk); if (len < sizeof(int)) return -EINVAL; @@ -3876,7 +3876,7 @@ */ SCTP_STATIC int sctp_seqpacket_listen(struct sock *sk, int backlog) { - struct sctp_opt *sp = sctp_sk(sk); + struct sctp_sock *sp = sctp_sk(sk); struct sctp_endpoint *ep = sp->ep; /* Only UDP style sockets that are not peeled off are allowed to @@ -3925,7 +3925,7 @@ */ SCTP_STATIC int sctp_stream_listen(struct sock *sk, int backlog) { - struct sctp_opt *sp = sctp_sk(sk); + struct sctp_sock *sp = sctp_sk(sk); struct sctp_endpoint *ep = sp->ep; /* If backlog is zero, disable listening. */ @@ -4026,7 +4026,7 @@ unsigned int sctp_poll(struct file *file, struct socket *sock, poll_table *wait) { struct sock *sk = sock->sk; - struct sctp_opt *sp = sctp_sk(sk); + struct sctp_sock *sp = sctp_sk(sk); unsigned int mask; poll_wait(file, sk->sk_sleep, wait); @@ -4654,8 +4654,8 @@ struct sctp_association *assoc, sctp_socket_type_t type) { - struct sctp_opt *oldsp = sctp_sk(oldsk); - struct sctp_opt *newsp = sctp_sk(newsk); + struct sctp_sock *oldsp = sctp_sk(oldsk); + struct sctp_sock *newsp = sctp_sk(newsk); struct sctp_bind_bucket *pp; /* hash list port iterator */ struct sctp_endpoint *newep = newsp->ep; struct sk_buff *skb, *tmp; @@ -4667,7 +4667,7 @@ newsk->sk_sndbuf = oldsk->sk_sndbuf; newsk->sk_rcvbuf = oldsk->sk_rcvbuf; /* Brute force copy old sctp opt. */ - memcpy(newsp, oldsp, sizeof(struct sctp_opt)); + inet_sk_copy_descendant(newsk, oldsk); /* Restore the ep value that was overwritten with the above structure * copy. diff -Nru a/net/sctp/transport.c b/net/sctp/transport.c --- a/net/sctp/transport.c 2005-01-15 02:43:18 -02:00 +++ b/net/sctp/transport.c 2005-01-15 02:43:18 -02:00 @@ -237,7 +237,7 @@ * address. */ void sctp_transport_route(struct sctp_transport *transport, - union sctp_addr *saddr, struct sctp_opt *opt) + union sctp_addr *saddr, struct sctp_sock *opt) { struct sctp_association *asoc = transport->asoc; struct sctp_af *af = transport->af_specific; diff -Nru a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c --- a/net/sctp/ulpqueue.c 2005-01-15 02:43:18 -02:00 +++ b/net/sctp/ulpqueue.c 2005-01-15 02:43:18 -02:00 @@ -138,8 +138,7 @@ */ int sctp_clear_pd(struct sock *sk) { - struct sctp_opt *sp; - sp = sctp_sk(sk); + struct sctp_sock *sp = sctp_sk(sk); sp->pd_mode = 0; if (!skb_queue_empty(&sp->pd_lobby)) { --------------040302060905050501040809-- From davem@davemloft.net Fri Jan 14 20:56:23 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 20:56:29 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0F4uNKG000767 for ; Fri, 14 Jan 2005 20:56:23 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CpfyR-0003G1-00; Fri, 14 Jan 2005 20:55:43 -0800 Date: Fri, 14 Jan 2005 20:55:43 -0800 From: "David S. Miller" To: Herbert Xu Cc: anton@samba.org, netdev@oss.sgi.com Subject: Re: [DEBUG]: sk_forward_alloc assertion failures Message-Id: <20050114205543.5acb0d68.davem@davemloft.net> In-Reply-To: <20050114224745.GA13180@gondor.apana.org.au> References: <20050113201914.46b7c4a2.davem@davemloft.net> <20050114111648.GA27964@gondor.apana.org.au> <20050114120322.GA28449@gondor.apana.org.au> <20050114110352.23c94ab9.davem@davemloft.net> <20050114203452.GA1277@gondor.apana.org.au> <20050114132757.4ca3153a.davem@davemloft.net> <20050114213829.GA12454@gondor.apana.org.au> <20050114133611.69ff0bb2.davem@davemloft.net> <20050114215504.GA12569@gondor.apana.org.au> <20050114140426.5cf06f0c.davem@davemloft.net> <20050114224745.GA13180@gondor.apana.org.au> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 274 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Sat, 15 Jan 2005 09:47:45 +1100 Herbert Xu wrote: > However, it's not all that difficult to fix up either. We can adjust > truesize to a more reasonable value in tcp_write_xmit(). Something > like this will do. > > Actually it happens in the case of sendmsg() too. Unfortunately in > that case we can't do a thing about it since the memory is allocated > between skb->head and skb->tail. Doing the adjustments at tcp_write_xmit() time also runs into the problem you mentioned where we're just blindly subtracting from sk_forward_alloc. I really still feel that the best way is to "adjust as we add data". sendmsg() does that already, I tried to add it simply to sendpage() but it just needs some checks and wait_for_memory logic. Here's a patch against current BK that tries to do that. See any holes? :-) ===== net/ipv4/tcp.c 1.89 vs edited ===== --- 1.89/net/ipv4/tcp.c 2005-01-13 19:57:57 -08:00 +++ edited/net/ipv4/tcp.c 2005-01-14 20:22:27 -08:00 @@ -655,7 +655,7 @@ while (psize > 0) { struct sk_buff *skb = sk->sk_write_queue.prev; struct page *page = pages[poffset / PAGE_SIZE]; - int copy, i; + int copy, i, can_coalesce; int offset = poffset % PAGE_SIZE; int size = min_t(size_t, psize, PAGE_SIZE - offset); @@ -677,14 +677,20 @@ copy = size; i = skb_shinfo(skb)->nr_frags; - if (skb_can_coalesce(skb, i, page, offset)) { + can_coalesce = skb_can_coalesce(skb, i, page, offset); + if (!can_coalesce && i >= MAX_SKB_FRAGS) { + tcp_mark_push(tp, skb); + goto new_segment; + } + if (sk->sk_forward_alloc < copy && + !sk_stream_mem_schedule(sk, copy, 0)) + goto wait_for_memory; + + if (can_coalesce) { skb_shinfo(skb)->frags[i - 1].size += copy; - } else if (i < MAX_SKB_FRAGS) { + } else { get_page(page); skb_fill_page_desc(skb, i, page, offset, copy); - } else { - tcp_mark_push(tp, skb); - goto new_segment; } skb->len += copy; From davem@davemloft.net Fri Jan 14 21:07:18 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 21:07:23 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0F57IVk001770 for ; Fri, 14 Jan 2005 21:07:18 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cpg9D-0003HL-00; Fri, 14 Jan 2005 21:06:51 -0800 Date: Fri, 14 Jan 2005 21:06:51 -0800 From: "David S. Miller" To: Herbert Xu Cc: jgarzik@pobox.com, yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: "Badness" again Message-Id: <20050114210651.654b22de.davem@davemloft.net> In-Reply-To: <20050115002638.GA13849@gondor.apana.org.au> References: <41E83B8D.8020003@pobox.com> <20050114215833.GA12981@gondor.apana.org.au> <41E844AC.6040200@pobox.com> <20050115002638.GA13849@gondor.apana.org.au> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 275 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Sat, 15 Jan 2005 11:26:38 +1100 Herbert Xu wrote: > All your "badness" messages start with a call to udpv6_sendmsg(). > That function calls ip6_dst_lookup() to get its dst entry. Note > that udpv6_sendmsg() does not hold a lock on the sk at all. However, > ip6_dst_lookup() uses __sk_dst_check() which is only safe if you can > either guarantee single-threadedness or if you hold sk_dst_lock. Good catch, that looks to be it. I wouldn't have caught the necessary dst_hold(*dst) removal too, in fact I thought this hunk of your patch was a bug at first :-) I'll apply this, thanks a lot Herbert. From yoshfuji@linux-ipv6.org Fri Jan 14 21:13:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 21:13:26 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0F5DJ1F002410 for ; Fri, 14 Jan 2005 21:13:20 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id AB37033CC2; Sat, 15 Jan 2005 14:13:53 +0900 (JST) Date: Sat, 15 Jan 2005 14:13:53 +0900 (JST) Message-Id: <20050115.141353.55181147.yoshfuji@linux-ipv6.org> To: davem@davemloft.net Cc: herbert@gondor.apana.org.au, jgarzik@pobox.com, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: "Badness" again From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20050114210651.654b22de.davem@davemloft.net> References: <41E844AC.6040200@pobox.com> <20050115002638.GA13849@gondor.apana.org.au> <20050114210651.654b22de.davem@davemloft.net> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 276 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev In article <20050114210651.654b22de.davem@davemloft.net> (at Fri, 14 Jan 2005 21:06:51 -0800), "David S. Miller" says: > On Sat, 15 Jan 2005 11:26:38 +1100 > Herbert Xu wrote: > > > All your "badness" messages start with a call to udpv6_sendmsg(). > > That function calls ip6_dst_lookup() to get its dst entry. Note > > that udpv6_sendmsg() does not hold a lock on the sk at all. However, > > ip6_dst_lookup() uses __sk_dst_check() which is only safe if you can > > either guarantee single-threadedness or if you hold sk_dst_lock. > > Good catch, that looks to be it. I agree too; this is one of changeset what I was going to send. Thanks. --yoshfuji From herbert@gondor.apana.org.au Fri Jan 14 21:46:59 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 21:47:07 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0F5kqna004148 for ; Fri, 14 Jan 2005 21:46:58 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1Cpgld-0003Jw-00; Sat, 15 Jan 2005 16:46:33 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1Cpgkt-00048z-00; Sat, 15 Jan 2005 16:45:47 +1100 Date: Sat, 15 Jan 2005 16:45:47 +1100 To: "David S. Miller" Cc: anton@samba.org, netdev@oss.sgi.com Subject: Re: [DEBUG]: sk_forward_alloc assertion failures Message-ID: <20050115054547.GA15860@gondor.apana.org.au> References: <20050114120322.GA28449@gondor.apana.org.au> <20050114110352.23c94ab9.davem@davemloft.net> <20050114203452.GA1277@gondor.apana.org.au> <20050114132757.4ca3153a.davem@davemloft.net> <20050114213829.GA12454@gondor.apana.org.au> <20050114133611.69ff0bb2.davem@davemloft.net> <20050114215504.GA12569@gondor.apana.org.au> <20050114140426.5cf06f0c.davem@davemloft.net> <20050114224745.GA13180@gondor.apana.org.au> <20050114205543.5acb0d68.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050114205543.5acb0d68.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 277 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev On Fri, Jan 14, 2005 at 08:55:43PM -0800, David S. Miller wrote: > > Doing the adjustments at tcp_write_xmit() time also runs into the > problem you mentioned where we're just blindly subtracting from > sk_forward_alloc. Not really because what we're doing there is increasing sk_forward_alloc, just as we do in tcp_trim_head. Anyway, I'm not terribly attached to that idea since we're doing a page's worth of data each time around the loop anyway so it's not too bad. > Here's a patch against current BK that tries to do that. See any > holes? :-) Just one little problem :) > + if (sk->sk_forward_alloc < copy && > + !sk_stream_mem_schedule(sk, copy, 0)) You want to have sk->sk_allocation here instead of 0. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From herbert@gondor.apana.org.au Fri Jan 14 21:49:17 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 21:49:23 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0F5nEBm004590 for ; Fri, 14 Jan 2005 21:49:16 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1Cpgnk-0003K0-00; Sat, 15 Jan 2005 16:48:44 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1Cpgle-00049R-00; Sat, 15 Jan 2005 16:46:34 +1100 Date: Sat, 15 Jan 2005 16:46:34 +1100 To: Jeff Garzik Cc: YOSHIFUJI Hideaki / ???????????? , "David S. Miller" , netdev@oss.sgi.com Subject: Re: "Badness" again Message-ID: <20050115054634.GB15860@gondor.apana.org.au> References: <41E83B8D.8020003@pobox.com> <20050114215833.GA12981@gondor.apana.org.au> <41E844AC.6040200@pobox.com> <20050115002638.GA13849@gondor.apana.org.au> <41E89A0E.5020207@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41E89A0E.5020207@pobox.com> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 278 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev On Fri, Jan 14, 2005 at 11:20:30PM -0500, Jeff Garzik wrote: > > FWIW I also see ICMP code paths in the tracebacks (but that may be > "second message" noise). I haven't figured out how they can occur as a result of the first problem but let's hope so :) -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From yoshfuji@linux-ipv6.org Fri Jan 14 22:59:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 14 Jan 2005 22:59:52 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0F6xZBs008205 for ; Fri, 14 Jan 2005 22:59:35 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id 0D3AB33CC2; Sat, 15 Jan 2005 16:00:09 +0900 (JST) Date: Sat, 15 Jan 2005 16:00:08 +0900 (JST) Message-Id: <20050115.160008.04476889.yoshfuji@linux-ipv6.org> To: davem@davemloft.net Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: [BK PATCH] sk_dst_cache annotation From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 279 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Hello. I had looked around sk_dst_cache and now I have several doubts. Following changesets depend on herbert's changeset. (I removed that one from my changesets to avoid conflict.) You can pull them from bk://bk.skbuff.net:20611/linux-2.6-refcnt Thank you. HEADLINES --------- ChangeSet@1.2334, 2005-01-15 15:47:01+09:00, yoshfuji@linux-ipv6.org [TCP] Update MSS using exact dst, which the caller expects. ChangeSet@1.2335, 2005-01-15 15:47:12+09:00, yoshfuji@linux-ipv6.org [NET] Always hold refcnt for dst when we use sk_dst_cache. ChangeSet@1.2336, 2005-01-15 15:47:23+09:00, yoshfuji@linux-ipv6.org [NET] Introduce dst_check() to check if dst is still up-to-date. ChangeSet@1.2337, 2005-01-15 15:47:35+09:00, yoshfuji@linux-ipv6.org [NET] Use sk_dst_check() to hold appropriate lock and refcnt. ChangeSet@1.2338, 2005-01-15 15:47:46+09:00, yoshfuji@linux-ipv6.org [NET] Use sk_dst_set() for sk_dst_reset(). ChangeSet@1.2339, 2005-01-15 15:47:58+09:00, yoshfuji@linux-ipv6.org [DECNET] use sk_dst_set() to store sk_dst_cache. Clean up. ChangeSet@1.2340, 2005-01-15 15:48:09+09:00, yoshfuji@linux-ipv6.org [NET] Use dst_clone() where appropriate. ChangeSet@1.2341, 2005-01-15 15:48:21+09:00, yoshfuji@linux-ipv6.org [NET] Hold appropriate lock and refcnt when we do dst_negative_advice(). DIFFSTATS --------- include/net/dst.h | 16 +++++++++++--- include/net/sock.h | 52 ++++++++++++++++++++++++++++++++++++++++++++---- include/net/tcp.h | 12 ++++++++++- net/decnet/af_decnet.c | 18 ++++++++++++---- net/decnet/dn_nsp_out.c | 39 ++++++++++++++++++------------------ net/ipv4/ip_output.c | 6 ++--- net/ipv4/tcp_input.c | 11 +++++++--- net/ipv4/tcp_ipv4.c | 20 +++++++++++------- net/ipv4/tcp_output.c | 27 ++++++++++++++++-------- net/ipv4/tcp_timer.c | 4 +-- net/ipv6/ip6_tunnel.c | 3 -- net/ipv6/tcp_ipv6.c | 20 +++++++++--------- 12 files changed, 159 insertions(+), 69 deletions(-) CHANGESETS ---------- ChangeSet@1.2334, 2005-01-15 15:47:01+09:00, yoshfuji@linux-ipv6.org [TCP] Update MSS using exact dst, which the caller expects. Signed-off-by: Hideaki YOSHIFUJI diff -Nru a/include/net/tcp.h b/include/net/tcp.h --- a/include/net/tcp.h 2005-01-15 15:54:11 +09:00 +++ b/include/net/tcp.h 2005-01-15 15:54:11 +09:00 @@ -961,7 +961,17 @@ extern void tcp_delete_keepalive_timer(struct sock *); extern void tcp_reset_keepalive_timer(struct sock *, unsigned long); -extern unsigned int tcp_sync_mss(struct sock *sk, u32 pmtu); + +extern unsigned int __tcp_sync_mss(struct sock *sk, struct dst_entry *dst, + u32 pmtu); +static inline unsigned int tcp_sync_mss(struct sock *sk, u32 pmtu) +{ + struct dst_entry *dst = sk_dst_get(sk); + unsigned int mss = __tcp_sync_mss(sk, dst, pmtu); + dst_release(dst); + return mss; +} + extern unsigned int tcp_current_mss(struct sock *sk, int large); #ifdef TCP_DEBUG diff -Nru a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c --- a/net/ipv4/tcp_ipv4.c 2005-01-15 15:54:11 +09:00 +++ b/net/ipv4/tcp_ipv4.c 2005-01-15 15:54:11 +09:00 @@ -948,7 +948,7 @@ if (inet->pmtudisc != IP_PMTUDISC_DONT && tp->pmtu_cookie > mtu) { - tcp_sync_mss(sk, mtu); + __tcp_sync_mss(sk, dst, mtu); /* Resend the TCP packet because it's * clear that the old packet has been @@ -1581,7 +1581,7 @@ newtp->ext2_header_len = dst->header_len; newinet->id = newtp->write_seq ^ jiffies; - tcp_sync_mss(newsk, dst_pmtu(dst)); + __tcp_sync_mss(newsk, dst, dst_pmtu(dst)); newtp->advmss = dst_metric(dst, RTAX_ADVMSS); tcp_initialize_rcv_mss(newsk); diff -Nru a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c --- a/net/ipv4/tcp_output.c 2005-01-15 15:54:11 +09:00 +++ b/net/ipv4/tcp_output.c 2005-01-15 15:54:11 +09:00 @@ -618,10 +618,10 @@ this function. --ANK (980731) */ -unsigned int tcp_sync_mss(struct sock *sk, u32 pmtu) +unsigned int __tcp_sync_mss(struct sock *sk, struct dst_entry *dst, + u32 pmtu) { struct tcp_sock *tp = tcp_sk(sk); - struct dst_entry *dst = __sk_dst_get(sk); int mss_now; if (dst && dst->ops->get_mss) @@ -676,7 +676,7 @@ u32 mtu = dst_pmtu(dst); if (mtu != tp->pmtu_cookie || tp->ext2_header_len != dst->header_len) - mss_now = tcp_sync_mss(sk, mtu); + mss_now = __tcp_sync_mss(sk, dst, mtu); } do_large = (large && @@ -1430,7 +1430,7 @@ if (tp->user_mss) tp->mss_clamp = tp->user_mss; tp->max_window = 0; - tcp_sync_mss(sk, dst_pmtu(dst)); + __tcp_sync_mss(sk, dst, dst_pmtu(dst)); if (!tp->window_clamp) tp->window_clamp = dst_metric(dst, RTAX_WINDOW); @@ -1724,4 +1724,4 @@ EXPORT_SYMBOL(tcp_connect); EXPORT_SYMBOL(tcp_make_synack); EXPORT_SYMBOL(tcp_simple_retransmit); -EXPORT_SYMBOL(tcp_sync_mss); +EXPORT_SYMBOL(__tcp_sync_mss); diff -Nru a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c --- a/net/ipv6/tcp_ipv6.c 2005-01-15 15:54:11 +09:00 +++ b/net/ipv6/tcp_ipv6.c 2005-01-15 15:54:11 +09:00 @@ -814,7 +814,7 @@ dst_hold(dst); if (tp->pmtu_cookie > dst_pmtu(dst)) { - tcp_sync_mss(sk, dst_pmtu(dst)); + __tcp_sync_mss(sk, dst, dst_pmtu(dst)); tcp_simple_retransmit(sk); } /* else let the usual retransmit timer handle it */ dst_release(dst); @@ -1444,7 +1444,7 @@ newnp->opt->opt_flen; newtp->ext2_header_len = dst->header_len; - tcp_sync_mss(newsk, dst_pmtu(dst)); + __tcp_sync_mss(newsk, dst, dst_pmtu(dst)); newtp->advmss = dst_metric(dst, RTAX_ADVMSS); tcp_initialize_rcv_mss(newsk); ChangeSet@1.2335, 2005-01-15 15:47:12+09:00, yoshfuji@linux-ipv6.org [NET] Always hold refcnt for dst when we use sk_dst_cache. Signed-off-by: Hideaki YOSHIFUJI diff -Nru a/include/net/sock.h b/include/net/sock.h --- a/include/net/sock.h 2005-01-15 15:54:16 +09:00 +++ b/include/net/sock.h 2005-01-15 15:54:16 +09:00 @@ -922,12 +922,6 @@ extern unsigned long sock_i_ino(struct sock *sk); static inline struct dst_entry * -__sk_dst_get(struct sock *sk) -{ - return sk->sk_dst_cache; -} - -static inline struct dst_entry * sk_dst_get(struct sock *sk) { struct dst_entry *dst; diff -Nru a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c --- a/net/decnet/af_decnet.c 2005-01-15 15:54:16 +09:00 +++ b/net/decnet/af_decnet.c 2005-01-15 15:54:16 +09:00 @@ -807,14 +807,17 @@ static int dn_confirm_accept(struct sock *sk, long *timeo, int allocation) { struct dn_scp *scp = DN_SK(sk); + struct dst_entry *dst; DEFINE_WAIT(wait); int err; if (scp->state != DN_CR) return -EINVAL; + dst = sk_dst_get(sk); + scp->state = DN_CC; - scp->segsize_loc = dst_path_metric(__sk_dst_get(sk), RTAX_ADVMSS); + scp->segsize_loc = dst_path_metric(dst, RTAX_ADVMSS); dn_send_conn_conf(sk, allocation); prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); @@ -843,6 +846,9 @@ } else if (scp->state != DN_CC) { sk->sk_socket->state = SS_UNCONNECTED; } + + dst_release(dst); + return err; } @@ -1859,7 +1865,7 @@ static inline unsigned int dn_current_mss(struct sock *sk, int flags) { - struct dst_entry *dst = __sk_dst_get(sk); + struct dst_entry *dst; struct dn_scp *scp = DN_SK(sk); int mss_now = min_t(int, scp->segsize_loc, scp->segsize_rem); @@ -1867,10 +1873,14 @@ if (flags & MSG_OOB) return 16; + dst = sk_dst_get(sk); + /* This works out the maximum size of segment we can send out */ if (dst) { u32 mtu = dst_pmtu(dst); mss_now = min_t(int, dn_mss_from_pmtu(dst->dev, mtu), mss_now); + + dst_release(dst); } return mss_now; diff -Nru a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c --- a/net/ipv4/tcp_input.c 2005-01-15 15:54:16 +09:00 +++ b/net/ipv4/tcp_input.c 2005-01-15 15:54:16 +09:00 @@ -711,7 +711,7 @@ void tcp_update_metrics(struct sock *sk) { struct tcp_sock *tp = tcp_sk(sk); - struct dst_entry *dst = __sk_dst_get(sk); + struct dst_entry *dst = sk_dst_get(sk); if (sysctl_tcp_nometrics_save) return; @@ -728,7 +728,7 @@ */ if (!(dst_metric_locked(dst, RTAX_RTT))) dst->metrics[RTAX_RTT-1] = 0; - return; + goto out; } m = dst_metric(dst, RTAX_RTT) - tp->srtt; @@ -795,6 +795,8 @@ dst->metrics[RTAX_REORDERING-1] = tp->reordering; } } +out: + dst_release(dst); } /* Numbers are taken from RFC2414. */ @@ -816,7 +818,7 @@ static void tcp_init_metrics(struct sock *sk) { struct tcp_sock *tp = tcp_sk(sk); - struct dst_entry *dst = __sk_dst_get(sk); + struct dst_entry *dst = sk_dst_get(sk); if (dst == NULL) goto reset; @@ -870,6 +872,8 @@ goto reset; tp->snd_cwnd = tcp_init_cwnd(tp, dst); tp->snd_cwnd_stamp = tcp_time_stamp; +out: + dst_release(dst); return; reset: @@ -882,6 +886,7 @@ tp->mdev = tp->mdev_max = tp->rttvar = TCP_TIMEOUT_INIT; tp->rto = TCP_TIMEOUT_INIT; } + goto out; } static void tcp_update_reordering(struct tcp_sock *tp, int metric, int ts) diff -Nru a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c --- a/net/ipv4/tcp_ipv4.c 2005-01-15 15:54:16 +09:00 +++ b/net/ipv4/tcp_ipv4.c 2005-01-15 15:54:16 +09:00 @@ -1973,7 +1973,7 @@ { struct inet_sock *inet = inet_sk(sk); struct tcp_sock *tp = tcp_sk(sk); - struct rtable *rt = (struct rtable *)__sk_dst_get(sk); + struct rtable *rt = (struct rtable *)sk_dst_get(sk); struct inet_peer *peer = NULL; int release_it = 0; @@ -1995,10 +1995,10 @@ } if (release_it) inet_putpeer(peer); - return 1; } - return 0; + dst_release(&rt->u.dst); + return (peer != NULL); } int tcp_v4_tw_remember_stamp(struct tcp_tw_bucket *tw) diff -Nru a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c --- a/net/ipv4/tcp_output.c 2005-01-15 15:54:16 +09:00 +++ b/net/ipv4/tcp_output.c 2005-01-15 15:54:16 +09:00 @@ -92,7 +92,7 @@ static __u16 tcp_advertise_mss(struct sock *sk) { struct tcp_sock *tp = tcp_sk(sk); - struct dst_entry *dst = __sk_dst_get(sk); + struct dst_entry *dst = sk_dst_get(sk); int mss = tp->advmss; if (dst && dst_metric(dst, RTAX_ADVMSS) < mss) { @@ -100,6 +100,8 @@ tp->advmss = mss; } + dst_release(dst); + return (__u16)mss; } @@ -128,10 +130,11 @@ struct sk_buff *skb, struct sock *sk) { u32 now = tcp_time_stamp; + struct dst_entry *dst = sk_dst_get(sk); if (!tcp_get_pcount(&tp->packets_out) && (s32)(now - tp->lsndtime) > tp->rto) - tcp_cwnd_restart(tp, __sk_dst_get(sk)); + tcp_cwnd_restart(tp, dst); tp->lsndtime = now; @@ -140,6 +143,8 @@ */ if ((u32)(now - tp->ack.lrcvtime) < tp->ack.ato) tp->ack.pingpong = 1; + + dst_release(dst); } static __inline__ void tcp_event_ack_sent(struct sock *sk) @@ -668,7 +673,7 @@ unsigned int tcp_current_mss(struct sock *sk, int large) { struct tcp_sock *tp = tcp_sk(sk); - struct dst_entry *dst = __sk_dst_get(sk); + struct dst_entry *dst = sk_dst_get(sk); unsigned int do_large, mss_now; mss_now = tp->mss_cache_std; @@ -679,6 +684,8 @@ mss_now = __tcp_sync_mss(sk, dst, mtu); } + dst_release(dst); + do_large = (large && (sk->sk_route_caps & NETIF_F_TSO) && !tp->urg_mode); @@ -1417,7 +1424,7 @@ */ static inline void tcp_connect_init(struct sock *sk) { - struct dst_entry *dst = __sk_dst_get(sk); + struct dst_entry *dst = sk_dst_get(sk); struct tcp_sock *tp = tcp_sk(sk); /* We'll fix this up when we get a response from the other end. @@ -1460,6 +1467,8 @@ tp->rto = TCP_TIMEOUT_INIT; tp->retransmits = 0; tcp_clear_retrans(tp); + + dst_release(dst); } /* ChangeSet@1.2336, 2005-01-15 15:47:23+09:00, yoshfuji@linux-ipv6.org [NET] Introduce dst_check() to check if dst is still up-to-date. Signed-off-by: Hideaki YOSHIFUJI diff -Nru a/include/net/dst.h b/include/net/dst.h --- a/include/net/dst.h 2005-01-15 15:54:20 +09:00 +++ b/include/net/dst.h 2005-01-15 15:54:20 +09:00 @@ -129,6 +129,14 @@ return dst_metric(dst, RTAX_LOCK) & (1<obsolete) + return NULL; + return dst->ops->check(dst, cookie); +} + static inline void dst_hold(struct dst_entry * dst) { atomic_inc(&dst->__refcnt); diff -Nru a/include/net/sock.h b/include/net/sock.h --- a/include/net/sock.h 2005-01-15 15:54:20 +09:00 +++ b/include/net/sock.h 2005-01-15 15:54:20 +09:00 @@ -975,7 +975,7 @@ { struct dst_entry *dst = sk->sk_dst_cache; - if (dst && dst->obsolete && dst->ops->check(dst, cookie) == NULL) { + if (dst_check(dst, cookie) == NULL) { sk->sk_dst_cache = NULL; return NULL; } @@ -988,7 +988,7 @@ { struct dst_entry *dst = sk_dst_get(sk); - if (dst && dst->obsolete && dst->ops->check(dst, cookie) == NULL) { + if (dst_check(dst, cookie) == NULL) { sk_dst_reset(sk); return NULL; } diff -Nru a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c --- a/net/ipv6/ip6_tunnel.c 2005-01-15 15:54:20 +09:00 +++ b/net/ipv6/ip6_tunnel.c 2005-01-15 15:54:20 +09:00 @@ -91,8 +91,7 @@ { struct dst_entry *dst = t->dst_cache; - if (dst && dst->obsolete && - dst->ops->check(dst, t->dst_cookie) == NULL) { + if (dst_check(dst, t->dst_cookie) == NULL) { t->dst_cache = NULL; return NULL; } ChangeSet@1.2337, 2005-01-15 15:47:35+09:00, yoshfuji@linux-ipv6.org [NET] Use sk_dst_check() to hold appropriate lock and refcnt. Signed-off-by: Hideaki YOSHIFUJI diff -Nru a/include/net/sock.h b/include/net/sock.h --- a/include/net/sock.h 2005-01-15 15:54:25 +09:00 +++ b/include/net/sock.h 2005-01-15 15:54:25 +09:00 @@ -971,19 +971,6 @@ } static inline struct dst_entry * -__sk_dst_check(struct sock *sk, u32 cookie) -{ - struct dst_entry *dst = sk->sk_dst_cache; - - if (dst_check(dst, cookie) == NULL) { - sk->sk_dst_cache = NULL; - return NULL; - } - - return dst; -} - -static inline struct dst_entry * sk_dst_check(struct sock *sk, u32 cookie) { struct dst_entry *dst = sk_dst_get(sk); diff -Nru a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c --- a/net/ipv4/ip_output.c 2005-01-15 15:54:25 +09:00 +++ b/net/ipv4/ip_output.c 2005-01-15 15:54:25 +09:00 @@ -310,7 +310,7 @@ goto packet_routed; /* Make sure we can route this packet. */ - rt = (struct rtable *)__sk_dst_check(sk, 0); + rt = (struct rtable *)sk_dst_check(sk, 0); if (rt == NULL) { u32 daddr; @@ -337,10 +337,10 @@ if (ip_route_output_flow(&rt, &fl, sk, 0)) goto no_route; } - __sk_dst_set(sk, &rt->u.dst); + __sk_dst_set(sk, dst_clone(&rt->u.dst)); tcp_v4_setup_caps(sk, &rt->u.dst); } - skb->dst = dst_clone(&rt->u.dst); + skb->dst = &rt->u.dst; packet_routed: if (opt && opt->is_strictroute && rt->rt_dst != rt->rt_gateway) diff -Nru a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c --- a/net/ipv4/tcp_ipv4.c 2005-01-15 15:54:25 +09:00 +++ b/net/ipv4/tcp_ipv4.c 2005-01-15 15:54:25 +09:00 @@ -933,7 +933,7 @@ * There is a small race when the user changes this flag in the * route, but I think that's acceptable. */ - if ((dst = __sk_dst_check(sk, 0)) == NULL) + if ((dst = sk_dst_check(sk, 0)) == NULL) return; dst->ops->update_pmtu(dst, mtu); @@ -957,6 +957,8 @@ */ tcp_simple_retransmit(sk); } /* else let the usual retransmit timer handle it */ + + dst_release(dst); } /* @@ -1908,13 +1910,15 @@ int tcp_v4_rebuild_header(struct sock *sk) { struct inet_sock *inet = inet_sk(sk); - struct rtable *rt = (struct rtable *)__sk_dst_check(sk, 0); + struct rtable *rt = (struct rtable *)sk_dst_check(sk, 0); u32 daddr; int err; /* Route is OK, nothing to do. */ - if (rt) + if (rt) { + dst_release(&rt->u.dst); return 0; + } /* Reroute. */ daddr = inet->daddr; diff -Nru a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c --- a/net/ipv6/tcp_ipv6.c 2005-01-15 15:54:25 +09:00 +++ b/net/ipv6/tcp_ipv6.c 2005-01-15 15:54:25 +09:00 @@ -782,7 +782,7 @@ goto out; /* icmp should have updated the destination cache entry */ - dst = __sk_dst_check(sk, np->dst_cookie); + dst = sk_dst_check(sk, np->dst_cookie); if (dst == NULL) { struct inet_sock *inet = inet_sk(sk); @@ -810,8 +810,7 @@ goto out; } - } else - dst_hold(dst); + } if (tp->pmtu_cookie > dst_pmtu(dst)) { __tcp_sync_mss(sk, dst, dst_pmtu(dst)); @@ -1751,7 +1750,7 @@ struct dst_entry *dst; struct ipv6_pinfo *np = inet6_sk(sk); - dst = __sk_dst_check(sk, np->dst_cookie); + dst = sk_dst_check(sk, np->dst_cookie); if (dst == NULL) { struct inet_sock *inet = inet_sk(sk); @@ -1792,7 +1791,8 @@ sk->sk_route_caps = dst->dev->features & ~(NETIF_F_IP_CSUM | NETIF_F_TSO); tcp_sk(sk)->ext2_header_len = dst->header_len; - } + } else + dst_release(dst); return 0; } @@ -1823,7 +1823,7 @@ final_p = &final; } - dst = __sk_dst_check(sk, np->dst_cookie); + dst = sk_dst_check(sk, np->dst_cookie); if (dst == NULL) { int err = ip6_dst_lookup(sk, &dst, &fl); @@ -1842,13 +1842,13 @@ return err; } - ip6_dst_store(sk, dst, NULL); + ip6_dst_store(sk, dst_clone(dst), NULL); sk->sk_route_caps = dst->dev->features & ~(NETIF_F_IP_CSUM | NETIF_F_TSO); tcp_sk(sk)->ext2_header_len = dst->header_len; } - skb->dst = dst_clone(dst); + skb->dst = dst; /* Restore final destination back after routing done */ ipv6_addr_copy(&fl.fl6_dst, &np->daddr); ChangeSet@1.2338, 2005-01-15 15:47:46+09:00, yoshfuji@linux-ipv6.org [NET] Use sk_dst_set() for sk_dst_reset(). Signed-off-by: Hideaki YOSHIFUJI diff -Nru a/include/net/sock.h b/include/net/sock.h --- a/include/net/sock.h 2005-01-15 15:54:30 +09:00 +++ b/include/net/sock.h 2005-01-15 15:54:30 +09:00 @@ -952,23 +952,8 @@ write_unlock(&sk->sk_dst_lock); } -static inline void -__sk_dst_reset(struct sock *sk) -{ - struct dst_entry *old_dst; - - old_dst = sk->sk_dst_cache; - sk->sk_dst_cache = NULL; - dst_release(old_dst); -} - -static inline void -sk_dst_reset(struct sock *sk) -{ - write_lock(&sk->sk_dst_lock); - __sk_dst_reset(sk); - write_unlock(&sk->sk_dst_lock); -} +#define __sk_dst_reset(_sk) __sk_dst_set((_sk), NULL) +#define sk_dst_reset(_sk) sk_dst_set((_sk), NULL) static inline struct dst_entry * sk_dst_check(struct sock *sk, u32 cookie) ChangeSet@1.2339, 2005-01-15 15:47:58+09:00, yoshfuji@linux-ipv6.org [DECNET] use sk_dst_set() to store sk_dst_cache. Clean up. Signed-off-by: Hideaki YOSHIFUJI diff -Nru a/net/decnet/dn_nsp_out.c b/net/decnet/dn_nsp_out.c --- a/net/decnet/dn_nsp_out.c 2005-01-15 15:54:34 +09:00 +++ b/net/decnet/dn_nsp_out.c 2005-01-15 15:54:34 +09:00 @@ -78,34 +78,35 @@ struct sock *sk = skb->sk; struct dn_scp *scp = DN_SK(sk); struct dst_entry *dst; - struct flowi fl; skb->h.raw = skb->data; scp->stamp = jiffies; dst = sk_dst_check(sk, 0); - if (dst) { -try_again: - skb->dst = dst; - dst_output(skb); - return; - } - memset(&fl, 0, sizeof(fl)); - fl.oif = sk->sk_bound_dev_if; - fl.fld_src = dn_saddr2dn(&scp->addr); - fl.fld_dst = dn_saddr2dn(&scp->peer); - dn_sk_ports_copy(&fl, scp); - fl.proto = DNPROTO_NSP; - if (dn_route_output_sock(&sk->sk_dst_cache, &fl, sk, 0) == 0) { - dst = sk_dst_get(sk); + if (dst == NULL) { + struct flowi fl; + + memset(&fl, 0, sizeof(fl)); + fl.oif = sk->sk_bound_dev_if; + fl.fld_src = dn_saddr2dn(&scp->addr); + fl.fld_dst = dn_saddr2dn(&scp->peer); + dn_sk_ports_copy(&fl, scp); + fl.proto = DNPROTO_NSP; + + if (dn_route_output_sock(&dst, &fl, sk, 0)) { + sk->sk_err = EHOSTUNREACH; + if (!sock_flag(sk, SOCK_DEAD)) + sk->sk_state_change(sk); + return; + } + sk->sk_route_caps = dst->dev->features; - goto try_again; + sk_dst_set(sk, dst_clone(dst)); } - sk->sk_err = EHOSTUNREACH; - if (!sock_flag(sk, SOCK_DEAD)) - sk->sk_state_change(sk); + skb->dst = dst; + dst_output(skb); } ChangeSet@1.2340, 2005-01-15 15:48:09+09:00, yoshfuji@linux-ipv6.org [NET] Use dst_clone() where appropriate. Signed-off-by: Hideaki YOSHIFUJI diff -Nru a/include/net/sock.h b/include/net/sock.h --- a/include/net/sock.h 2005-01-15 15:54:39 +09:00 +++ b/include/net/sock.h 2005-01-15 15:54:39 +09:00 @@ -928,8 +928,7 @@ read_lock(&sk->sk_dst_lock); dst = sk->sk_dst_cache; - if (dst) - dst_hold(dst); + dst_clone(dst); read_unlock(&sk->sk_dst_lock); return dst; } ChangeSet@1.2341, 2005-01-15 15:48:21+09:00, yoshfuji@linux-ipv6.org [NET] Hold appropriate lock and refcnt when we do dst_negative_advice(). Migrate dst_negative_advice() to sk_dst_negative_advice(), which holds appropriate lock and refcnt. Signed-off-by: Hideaki YOSHIFUJI diff -Nru a/include/net/dst.h b/include/net/dst.h --- a/include/net/dst.h 2005-01-15 15:54:43 +09:00 +++ b/include/net/dst.h 2005-01-15 15:54:43 +09:00 @@ -199,11 +199,11 @@ neigh_confirm(dst->neighbour); } -static inline void dst_negative_advice(struct dst_entry **dst_p) +static inline struct dst_entry *dst_negative_advice(struct dst_entry *dst) { - struct dst_entry * dst = *dst_p; - if (dst && dst->ops->negative_advice) - *dst_p = dst->ops->negative_advice(dst); + if (!dst || !dst->ops->negative_advice) + return dst; + return dst->ops->negative_advice(dst); } static inline void dst_link_failure(struct sk_buff *skb) diff -Nru a/include/net/sock.h b/include/net/sock.h --- a/include/net/sock.h 2005-01-15 15:54:43 +09:00 +++ b/include/net/sock.h 2005-01-15 15:54:43 +09:00 @@ -967,6 +967,15 @@ return dst; } +static inline void sk_dst_negative_advice(struct sock *sk) +{ + struct dst_entry *dst = sk_dst_get(sk); + if (likely(dst_negative_advice(dst) == NULL)) + sk_dst_reset(sk); + else + dst_release(dst); +} + static inline void sk_charge_skb(struct sock *sk, struct sk_buff *skb) { sk->sk_wmem_queued += skb->truesize; diff -Nru a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c --- a/net/decnet/af_decnet.c 2005-01-15 15:54:43 +09:00 +++ b/net/decnet/af_decnet.c 2005-01-15 15:54:43 +09:00 @@ -1941,8 +1941,8 @@ goto out_err; } - if ((flags & MSG_TRYHARD) && sk->sk_dst_cache) - dst_negative_advice(&sk->sk_dst_cache); + if (flags & MSG_TRYHARD) + sk_dst_negative_advice(sk); mss = scp->segsize_rem; fctype = scp->services_rem & NSP_FC_MASK; diff -Nru a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c --- a/net/ipv4/tcp_timer.c 2005-01-15 15:54:43 +09:00 +++ b/net/ipv4/tcp_timer.c 2005-01-15 15:54:43 +09:00 @@ -159,7 +159,7 @@ if ((1 << sk->sk_state) & (TCPF_SYN_SENT | TCPF_SYN_RECV)) { if (tp->retransmits) - dst_negative_advice(&sk->sk_dst_cache); + sk_dst_negative_advice(sk); retry_until = tp->syn_retries ? : sysctl_tcp_syn_retries; } else { if (tp->retransmits >= sysctl_tcp_retries1) { @@ -183,7 +183,7 @@ Golden words :-). */ - dst_negative_advice(&sk->sk_dst_cache); + sk_dst_negative_advice(sk); } retry_until = sysctl_tcp_retries2; -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@wide.ad.jp Sat Jan 15 01:27:23 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 15 Jan 2005 01:27:29 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0F9RMsX017589 for ; Sat, 15 Jan 2005 01:27:23 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id 16C0F33CC2; Sat, 15 Jan 2005 18:27:57 +0900 (JST) Date: Sat, 15 Jan 2005 18:27:56 +0900 (JST) Message-Id: <20050115.182756.133007240.yoshfuji@wide.ad.jp> To: davem@davemloft.net Cc: netdev@oss.sgi.com, yoshfuji@wide.ad.jp Subject: [PATCH] [IPV6] Don't use obsolete entries. From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 280 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@wide.ad.jp Precedence: bulk X-list: netdev Hello. Following changesets improve specification conformity. Please pull them from: Thanks. HEADLINES --------- ChangeSet@1.2334, 2005-01-15 17:44:55+09:00, yoshfuji@linux-ipv6.org [IPV6] Don't use expired default routes. ChangeSet@1.2335, 2005-01-15 18:05:34+09:00, yoshfuji@linux-ipv6.org [IPV6] Don't update FAILED entries on receipt of NAs. DIFFSTATS --------- net/ipv6/ndisc.c | 4 ++++ net/ipv6/route.c | 18 +++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) CHANGESETS ---------- ChangeSet@1.2334, 2005-01-15 17:44:55+09:00, yoshfuji@linux-ipv6.org [IPV6] Don't use expired default routes. Signed-off-by: Hideaki YOSHIFUJI diff -Nru a/net/ipv6/route.c b/net/ipv6/route.c --- a/net/ipv6/route.c 2005-01-15 18:20:47 +09:00 +++ b/net/ipv6/route.c 2005-01-15 18:20:47 +09:00 @@ -167,6 +167,12 @@ } } +static __inline__ int rt6_check_expired(const struct rt6_info *rt) +{ + return (rt->rt6i_flags & RTF_EXPIRES && + time_after(jiffies, rt->rt6i_expires)); +} + /* * Route lookup. Any rt6_lock is implied. */ @@ -237,8 +243,7 @@ sprt->rt6i_dev->ifindex == oif)) m += 8; - if ((sprt->rt6i_flags & RTF_EXPIRES) && - time_after(jiffies, sprt->rt6i_expires)) + if (rt6_check_expired(sprt)) continue; if (sprt == rt6_dflt_pointer) @@ -296,7 +301,8 @@ for (sprt = rt6_dflt_pointer->u.next; sprt; sprt = sprt->u.next) { if (sprt->u.dst.obsolete <= 0 && - sprt->u.dst.error == 0) { + sprt->u.dst.error == 0 && + !rt6_check_expired(sprt)) { match = sprt; break; } @@ -305,7 +311,8 @@ !match && sprt; sprt = sprt->u.next) { if (sprt->u.dst.obsolete <= 0 && - sprt->u.dst.error == 0) { + sprt->u.dst.error == 0 && + !rt6_check_expired(sprt)) { match = sprt; break; } @@ -331,7 +338,8 @@ */ for (sprt = ip6_routing_table.leaf; sprt; sprt = sprt->u.next) { - if ((sprt->rt6i_flags & RTF_DEFAULT) && + if (!rt6_check_expired(sprt) && + (sprt->rt6i_flags & RTF_DEFAULT) && (!oif || (sprt->rt6i_dev && sprt->rt6i_dev->ifindex == oif))) { ChangeSet@1.2335, 2005-01-15 18:05:34+09:00, yoshfuji@linux-ipv6.org [IPV6] Don't update FAILED entries on receipt of NAs. As NAs do not create new entries (RFC2461 7.2.5), NA should not change state of FAILED entries. Signed-off-by: Hideaki YOSHIFUJI diff -Nru a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c --- a/net/ipv6/ndisc.c 2005-01-15 18:20:52 +09:00 +++ b/net/ipv6/ndisc.c 2005-01-15 18:20:52 +09:00 @@ -903,6 +903,9 @@ if (neigh) { u8 old_flags = neigh->flags; + if (neigh->nud_state & NUD_FAILED) + goto out; + neigh_update(neigh, lladdr, msg->icmph.icmp6_solicited ? NUD_REACHABLE : NUD_STALE, NEIGH_UPDATE_F_WEAK_OVERRIDE| @@ -920,6 +923,7 @@ ip6_del_rt(rt, NULL, NULL); } +out: neigh_release(neigh); } } -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From buytenh@wantstofly.org Sat Jan 15 02:39:41 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 15 Jan 2005 02:39:45 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0FAde4G021185 for ; Sat, 15 Jan 2005 02:39:40 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id D7D8E2B0EC; Sat, 15 Jan 2005 11:39:38 +0100 (MET) Date: Sat, 15 Jan 2005 11:39:38 +0100 From: Lennert Buytenhek To: Herbert Xu Cc: Jeff Garzik , YOSHIFUJI Hideaki / ???????????? , "David S. Miller" , netdev@oss.sgi.com Subject: Re: "Badness" again Message-ID: <20050115103938.GA14991@xi.wantstofly.org> References: <41E83B8D.8020003@pobox.com> <20050114215833.GA12981@gondor.apana.org.au> <41E844AC.6040200@pobox.com> <20050115002638.GA13849@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050115002638.GA13849@gondor.apana.org.au> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 281 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev On Sat, Jan 15, 2005 at 11:26:38AM +1100, Herbert Xu wrote: > Neither is true here and therefore we may have a situation where > the cached dst is released twice. In fact I tracked down the > address closest to the "badness" messages and it belongs to > one of your domain's name servers. That means the requests were > probably made by named, which is multi-threaded. The machine where I was seeing this (a HT P4) was indeed running named as well. This is the slave server for some zones, and the master server, which had a pretty much identical sw configuration (both Fedora 2, both using 6to4), is a (non-HT) Celeron and I never saw it happening there. --L From buytenh@wantstofly.org Sat Jan 15 02:47:52 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 15 Jan 2005 02:47:55 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0FAlpud023866 for ; Sat, 15 Jan 2005 02:47:52 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id B0D672B0EC; Sat, 15 Jan 2005 11:47:50 +0100 (MET) Date: Sat, 15 Jan 2005 11:47:50 +0100 From: Lennert Buytenhek To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: [PATCH] remove superfluous diverter printk'ing Message-ID: <20050115104750.GB14991@xi.wantstofly.org> References: <20050114124700.GA4079@xi.wantstofly.org> <20050114134642.4be4e2fc.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050114134642.4be4e2fc.davem@davemloft.net> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 282 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev On Fri, Jan 14, 2005 at 01:46:42PM -0800, David S. Miller wrote: > > You're not listed as diverter maintainer but I'm sending this via > > you anyway. This patch removes some printk'ing from the diverter > > driver (and cleans up the code a bit), because after a while it gets > > really annoying to have log messages like this one for every single > > tunnel you create or tear down. > > > > divert: not allocating divert_blk for non-ethernet device tunl0 > > > > Please consider sending upstream. > > Those diverter messages drive me crazy too, I think I'll > add your patch Lennert. Benoit's email address bounces, and it's the latest address of his I could find, so if he doesn't read this list you might as well go ahead. cheers, Lennert From wichert@levante.wiggy.net Sat Jan 15 04:03:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 15 Jan 2005 04:03:35 -0800 (PST) Received: from mx1.wiggy.net (levante.wiggy.net [195.85.225.139]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0FC3PJd027903 for ; Sat, 15 Jan 2005 04:03:26 -0800 Received: from wichert by mx1.wiggy.net with local (Exim 4.34) id 1CpmeJ-0005RB-Cz; Sat, 15 Jan 2005 13:03:23 +0100 Date: Sat, 15 Jan 2005 13:03:23 +0100 From: Wichert Akkerman To: netdev@oss.sgi.com Cc: Herbert Xu Subject: Re: ipv6 tunnel stops accepting input Message-ID: <20050115120323.GA20664@wiggy.net> References: <20050111125826.GA25169@wiggy.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050111125826.GA25169@wiggy.net> User-Agent: Mutt/1.5.6+20040907i X-SA-Exim-Connect-IP: X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 283 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: wichert@wiggy.net Precedence: bulk X-list: netdev (Herbert: I did not receive your mail since it seems your mailserver refuses the sender verification that exim tries to do). Herbert Xu Wrote: >Do you have any netfilter rules? I do have a small set of ipv4 netfilter rules. Wichert. -- Wichert Akkerman It is simple to make things. http://www.wiggy.net/ It is hard to make things simple. From herbert@gondor.apana.org.au Sat Jan 15 04:30:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 15 Jan 2005 04:30:34 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0FCUPHS032703 for ; Sat, 15 Jan 2005 04:30:26 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1Cpn3u-0004sT-00; Sat, 15 Jan 2005 23:29:50 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1Cpn3I-0007dK-00; Sat, 15 Jan 2005 23:29:12 +1100 Date: Sat, 15 Jan 2005 23:29:12 +1100 To: Wichert Akkerman Cc: netdev@oss.sgi.com Subject: Re: ipv6 tunnel stops accepting input Message-ID: <20050115122912.GA29331@gondor.apana.org.au> References: <20050111125826.GA25169@wiggy.net> <20050115120323.GA20664@wiggy.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050115120323.GA20664@wiggy.net> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 284 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev On Sat, Jan 15, 2005 at 01:03:23PM +0100, Wichert Akkerman wrote: > (Herbert: I did not receive your mail since it seems your mailserver > refuses the sender verification that exim tries to do). Hmm, is it still happening now? > Herbert Xu Wrote: > >Do you have any netfilter rules? > > I do have a small set of ipv4 netfilter rules. Are you using a SIT tunnel? Do you allow SIT traffic initiated from the outside? The ICMP message you quoted originally appears to indicate that you didn't allow SIT traffic intiated from the outside. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From wichert@levante.wiggy.net Sat Jan 15 04:44:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 15 Jan 2005 04:44:18 -0800 (PST) Received: from mx1.wiggy.net (levante.wiggy.net [195.85.225.139]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0FCiCos001258 for ; Sat, 15 Jan 2005 04:44:12 -0800 Received: from wichert by mx1.wiggy.net with local (Exim 4.34) id 1CpnHn-0005j1-KT; Sat, 15 Jan 2005 13:44:11 +0100 Date: Sat, 15 Jan 2005 13:44:11 +0100 From: Wichert Akkerman To: Herbert Xu Cc: netdev@oss.sgi.com Subject: Re: ipv6 tunnel stops accepting input Message-ID: <20050115124411.GA20912@wiggy.net> References: <20050111125826.GA25169@wiggy.net> <20050115120323.GA20664@wiggy.net> <20050115122912.GA29331@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050115122912.GA29331@gondor.apana.org.au> User-Agent: Mutt/1.5.6+20040907i X-SA-Exim-Connect-IP: X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 285 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: wichert@wiggy.net Precedence: bulk X-list: netdev Previously Herbert Xu wrote: > Hmm, is it still happening now? Seems to work just fine now. > Are you using a SIT tunnel? Do you allow SIT traffic initiated > from the outside? Hmm, that might indeed be the problem and would explain the behaviour: generating outgoing traffic adds a connection and from that point incoming traffic would hit the RELATED accept rule. I'll redo the firewall rules a bit and see if things improve. Wichert. -- Wichert Akkerman It is simple to make things. http://www.wiggy.net/ It is hard to make things simple. From herbert@gondor.apana.org.au Sat Jan 15 05:33:17 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 15 Jan 2005 05:33:25 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0FDXESW003713 for ; Sat, 15 Jan 2005 05:33:15 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1Cpo2e-0005DM-00; Sun, 16 Jan 2005 00:32:36 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1Cpo1q-0007lI-00; Sun, 16 Jan 2005 00:31:46 +1100 From: Herbert Xu To: tommy.christensen@tpack.net (Tommy Christensen) Subject: Re: Fwd: [2.6] ethertap and af_inet.c assertion failures Cc: simon.roscic@chello.at, netdev@oss.sgi.com, davem@davemloft.net Organization: Core In-Reply-To: <41E44476.20303@tpack.net> X-Newsgroups: apana.lists.os.linux.netdev User-Agent: tin/1.7.4-20040225 ("Benbecula") (UNIX) (Linux/2.4.27-hx-1-686-smp (i686)) Message-Id: Date: Sun, 16 Jan 2005 00:31:46 +1100 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 286 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Tommy Christensen wrote: > > netlink has messed up the send buffer accounting, when trimming a skb. You are spot on. Dave, you were right too about checking for charged skb's in netlink_trim. Since the skb will be orphaned on its way to the destination anyway, let's simply do that before the trimming. This shouldn't lead to skb leakage since the skb will either be charged to the destination socket or freed. Signed-off-by: Herbert Xu Simon, please check if this fixes your problem or not. Thanks, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- ===== net/netlink/af_netlink.c 1.66 vs edited ===== --- 1.66/net/netlink/af_netlink.c 2005-01-14 15:41:06 +11:00 +++ edited/net/netlink/af_netlink.c 2005-01-16 00:24:20 +11:00 @@ -629,7 +629,6 @@ } return 1; } - skb_orphan(skb); skb_set_owner_r(skb, sk); return 0; } @@ -663,14 +662,11 @@ static inline void netlink_trim(struct sk_buff *skb, int allocation) { - int delta = skb->end - skb->tail; + int delta; - /* If the packet is charged to a socket, the modification - * of truesize below is illegal and will corrupt socket - * buffer accounting state. - */ - BUG_ON(skb->list != NULL); + skb_orphan(skb); + delta = skb->end - skb->tail; if (delta * 2 < skb->truesize) return; if (pskb_expand_head(skb, 0, -delta, allocation)) @@ -707,14 +703,12 @@ struct netlink_opt *nlk = nlk_sk(sk); #ifdef NL_EMULATE_DEV if (nlk->handler) { - skb_orphan(skb); nlk->handler(sk->sk_protocol, skb); return 0; } else #endif if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf && !test_bit(0, &nlk->state)) { - skb_orphan(skb); skb_set_owner_r(skb, sk); skb_queue_tail(&sk->sk_receive_queue, skb); sk->sk_data_ready(sk, skb->len); From tommy.christensen@tpack.net Sat Jan 15 08:18:22 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 15 Jan 2005 08:18:26 -0800 (PST) Received: from mail.tpack.net (ip18.tpack.net [213.173.228.18]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0FGIKwi011270 for ; Sat, 15 Jan 2005 08:18:21 -0800 Received: (qmail 8259 invoked from network); 15 Jan 2005 16:18:14 -0000 Received: from dhcp-74.cph.tpack.net (HELO ?172.17.159.11?) (192.168.0.74) by 0 with SMTP; 15 Jan 2005 16:18:14 -0000 Message-ID: <41E942AF.3030202@tpack.net> Date: Sat, 15 Jan 2005 17:19:59 +0100 From: Tommy Christensen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Herbert Xu CC: simon.roscic@chello.at, netdev@oss.sgi.com, davem@davemloft.net Subject: Re: Fwd: [2.6] ethertap and af_inet.c assertion failures References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 287 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tommy.christensen@tpack.net Precedence: bulk X-list: netdev Herbert Xu wrote: > Since the skb will be orphaned on its way to the destination anyway, > let's simply do that before the trimming. This shouldn't lead to > skb leakage since the skb will either be charged to the destination > socket or freed. Looks fine. This will solve the problem for other callers as well. Shouldn't there be a check for skb_shared as well? Or are the callers of netlink_unicast/broadcast supposed to avoid this. -Tommy From sneakums@zork.net Sat Jan 15 08:27:10 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 15 Jan 2005 08:27:15 -0800 (PST) Received: from zork.zork.net (Debian-exim@zork.zork.net [64.81.246.102]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0FGR32L015336 for ; Sat, 15 Jan 2005 08:27:06 -0800 Received: from sneakums by zork.zork.net with local (Exim 4.34) id 1CpqlN-0004if-VB; Sat, 15 Jan 2005 08:26:58 -0800 From: Sean Neakums To: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: [PATCH] sunrpc: clarify the source of some messages Mail-Followup-To: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Date: Sat, 15 Jan 2005 16:26:57 +0000 Message-ID: <6uu0pizmi6.fsf@zork.zork.net> User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: sneakums@zork.net X-SA-Exim-Scanned: No (on zork.zork.net); SAEximRunCond expanded to false X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 288 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sneakums@zork.net Precedence: bulk X-list: netdev Sometimes cl_protname is "portmap", which can make it seem as if the userspace portmapper is complaining, when in fact it is sunrpc that is complaining. The second hunk also adds a missing printk level. Against 2.6.11-rc1. diff -urN --exclude '*~' S11-rc1/net/sunrpc/clnt.c S11-rc1~sunrpc/net/sunrpc/clnt.c --- S11-rc1/net/sunrpc/clnt.c 2005-01-15 11:45:16.000000000 +0000 +++ S11-rc1~sunrpc/net/sunrpc/clnt.c 2005-01-15 16:15:10.000000000 +0000 @@ -631,7 +631,7 @@ } if (encode && (status = rpcauth_wrap_req(task, encode, req, p, task->tk_msg.rpc_argp)) < 0) { - printk(KERN_WARNING "%s: can't encode arguments: %d\n", + printk(KERN_WARNING "RPC: %s: can't encode arguments: %d\n", clnt->cl_protname, -status); rpc_exit(task, status); } @@ -781,7 +781,7 @@ break; default: if (clnt->cl_chatty) - printk("%s: RPC call returned error %d\n", + printk(KERN_NOTICE "RPC: %s: RPC call returned error %d\n", clnt->cl_protname, -status); rpc_exit(task, status); break; @@ -806,7 +806,7 @@ dprintk("RPC: %4d call_timeout (major)\n", task->tk_pid); if (RPC_IS_SOFT(task)) { if (clnt->cl_chatty) - printk(KERN_NOTICE "%s: server %s not responding, timed out\n", + printk(KERN_NOTICE "RPC: %s: server %s not responding, timed out\n", clnt->cl_protname, clnt->cl_server); rpc_exit(task, -EIO); return; @@ -814,7 +814,7 @@ if (clnt->cl_chatty && !(task->tk_flags & RPC_CALL_MAJORSEEN)) { task->tk_flags |= RPC_CALL_MAJORSEEN; - printk(KERN_NOTICE "%s: server %s not responding, still trying\n", + printk(KERN_NOTICE "RPC: %s: server %s not responding, still trying\n", clnt->cl_protname, clnt->cl_server); } if (clnt->cl_autobind) @@ -841,7 +841,7 @@ task->tk_pid, task->tk_status); if (clnt->cl_chatty && (task->tk_flags & RPC_CALL_MAJORSEEN)) { - printk(KERN_NOTICE "%s: server %s OK\n", + printk(KERN_NOTICE "RPC: %s: server %s OK\n", clnt->cl_protname, clnt->cl_server); task->tk_flags &= ~RPC_CALL_MAJORSEEN; } @@ -852,7 +852,7 @@ clnt->cl_stats->rpcretrans++; goto out_retry; } - printk(KERN_WARNING "%s: too small RPC reply size (%d bytes)\n", + printk(KERN_WARNING "RPC: %s: too small RPC reply size (%d bytes)\n", clnt->cl_protname, task->tk_status); rpc_exit(task, -EIO); return; From simon.roscic@chello.at Sat Jan 15 10:03:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 15 Jan 2005 10:03:30 -0800 (PST) Received: from simon.segfault.info (chello213047247120.tirol.surfer.at [213.47.247.120]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0FI3P09020220 for ; Sat, 15 Jan 2005 10:03:26 -0800 Received: from workstation.lan (workstation.lan [192.168.5.2]) by simon.segfault.info (Postfix) with ESMTP id E2A7D3C00094; Sat, 15 Jan 2005 19:03:18 +0100 (CET) From: Simon Roscic To: Herbert Xu Subject: Re: Fwd: [2.6] ethertap and af_inet.c assertion failures Date: Sat, 15 Jan 2005 19:03:14 +0100 User-Agent: KMail/1.7.1 References: In-Reply-To: Cc: tommy.christensen@tpack.net, netdev@oss.sgi.com, davem@davemloft.net MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501151903.14239.simon.roscic@chello.at> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 289 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: simon.roscic@chello.at Precedence: bulk X-list: netdev Herbert Xu wrote: > Simon, please check if this fixes your problem or not. Yup, your patch fixes the problem. Thanks! bye, simon. From herbert@gondor.apana.org.au Sat Jan 15 10:31:38 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 15 Jan 2005 10:31:45 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0FIVaud021718 for ; Sat, 15 Jan 2005 10:31:37 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CpshX-0006Px-00; Sun, 16 Jan 2005 05:31:07 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1Cpsgp-00088B-00; Sun, 16 Jan 2005 05:30:23 +1100 Date: Sun, 16 Jan 2005 05:30:23 +1100 To: Tommy Christensen Cc: simon.roscic@chello.at, netdev@oss.sgi.com, davem@davemloft.net Subject: Re: Fwd: [2.6] ethertap and af_inet.c assertion failures Message-ID: <20050115183023.GA31211@gondor.apana.org.au> References: <41E942AF.3030202@tpack.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41E942AF.3030202@tpack.net> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 290 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev On Sat, Jan 15, 2005 at 05:19:59PM +0100, Tommy Christensen wrote: > > Shouldn't there be a check for skb_shared as well? Or are the > callers of netlink_unicast/broadcast supposed to avoid this. Had anyone been using shared skb's here before they would've got into trouble a long time ago with calls such as skb_orphan in the path. Even if they managed to do that and not notice then the pskb_expand_head call in netlink_trim would've likely caught it as well. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From hasso@estpak.ee Sat Jan 15 10:45:57 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 15 Jan 2005 10:46:01 -0800 (PST) Received: from arena (test.estpak.ee [194.126.115.47]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0FIjuTj022765 for ; Sat, 15 Jan 2005 10:45:56 -0800 Received: from localhost ([127.0.0.1] helo=arena) by arena with esmtp (Exim 4.34) id 1CpswM-00016S-5z for netdev@oss.sgi.com; Sat, 15 Jan 2005 20:46:26 +0200 From: Hasso Tepper To: netdev@oss.sgi.com Subject: Some IPv6 related limit Date: Sat, 15 Jan 2005 20:46:25 +0200 User-Agent: KMail/1.7.2 Organization: Elion Enterprises Ltd. MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_BUW6Bfl4rdnbvJv" Message-Id: <200501152046.25747.hasso@estpak.ee> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 291 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hasso@estpak.ee Precedence: bulk X-list: netdev --Boundary-00=_BUW6Bfl4rdnbvJv Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Some time ago IPv6 tunnelbroker I manage started to behave strangely. Loosing neighbors, packet loss, attempt to load ip6_tables module failed with message "Cannot allocate memory". I discovered that number of tunnels is problem. When problems apeared, there was 513 tunnels. I reduced number of tunnels and problems disappeared. Of course it was temporary only. At first I thought that it's related to size of IPv6 routing table, but changing /proc/sys/net/ipv6/route/max_size didn't make any difference. I can reproduce problem on my desktop and laptop as well (tested with 2.4.29-rc1 and 2.6.10 kernels) with attached script. When I run this, about 500 tunnels work fine, but for the rest there will be address added on tunnel, but not route to the interface for this address (adding route to the neighbor fails therefore too). About same time neighbors in LAN stop answering (ping6 -I eth0 ff02::1, only ::1 will answer). Removing tunnels makes all work again. I tried with vlans as well and can reproduce same problem, although for some reason number of vlans have to be bigger. I'm hitting some IPv6 related limit in kernel probably. Is it known limit? Is there way to change this limit or is there workaround? -- Hasso Tepper Elion Enterprises Ltd. WAN administrator --Boundary-00=_BUW6Bfl4rdnbvJv Content-Type: application/x-shellscript; name="tunnels.sh" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="tunnels.sh" for i in `seq 1 254` do ip tunnel add test1$i mode sit remote 10.10.1.$i local 10.10.10.154 ttl 64 ip link set test1$i up ip -6 addr add 2001:db8:1:$i::1/64 dev test1$i ip -6 route add 2001:db8:11:$i::/64 via 2001:db8:1:$i::2 done for i in `seq 1 254` do ip tunnel add test2$i mode sit remote 10.10.2.$i local 10.10.10.154 ttl 64 ip link set test2$i up ip -6 addr add 2001:db8:2:$i::1/64 dev test2$i ip -6 route add 2001:db8:21:$i::/64 via 2001:db8:2:$i::2 done for i in `seq 1 254` do ip tunnel add test3$i mode sit remote 10.10.3.$i local 10.10.10.154 ttl 64 ip link set test3$i up ip -6 addr add 2001:db8:3:$i::1/64 dev test3$i ip -6 route add 2001:db8:31:$i::/64 via 2001:db8:3:$i::2 done for i in `seq 1 254` do ip tunnel add test4$i mode sit remote 10.10.4.$i local 10.10.10.154 ttl 64 ip link set test4$i up ip -6 addr add 2001:db8:4:$i::1/64 dev test4$i ip -6 route add 2001:db8:41:$i::/64 via 2001:db8:4:$i::2 done --Boundary-00=_BUW6Bfl4rdnbvJv-- From tommy.christensen@tpack.net Sat Jan 15 12:19:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 15 Jan 2005 12:19:08 -0800 (PST) Received: from mail.tpack.net (ip18.tpack.net [213.173.228.18]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0FKJ2PX027167 for ; Sat, 15 Jan 2005 12:19:02 -0800 Received: (qmail 14000 invoked from network); 15 Jan 2005 20:18:56 -0000 Received: from dhcp-253.cph.tpack.net (HELO ?172.17.159.11?) (192.168.0.253) by 0 with SMTP; 15 Jan 2005 20:18:56 -0000 Message-ID: <41E97B1A.30205@tpack.net> Date: Sat, 15 Jan 2005 21:20:42 +0100 From: Tommy Christensen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Herbert Xu CC: simon.roscic@chello.at, netdev@oss.sgi.com, davem@davemloft.net Subject: Re: Fwd: [2.6] ethertap and af_inet.c assertion failures References: <41E942AF.3030202@tpack.net> <20050115183023.GA31211@gondor.apana.org.au> In-Reply-To: <20050115183023.GA31211@gondor.apana.org.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 292 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tommy.christensen@tpack.net Precedence: bulk X-list: netdev Herbert Xu wrote: > On Sat, Jan 15, 2005 at 05:19:59PM +0100, Tommy Christensen wrote: > >>Shouldn't there be a check for skb_shared as well? Or are the >>callers of netlink_unicast/broadcast supposed to avoid this. > > > Had anyone been using shared skb's here before they would've got into > trouble a long time ago with calls such as skb_orphan in the path. > > Even if they managed to do that and not notice then the pskb_expand_head > call in netlink_trim would've likely caught it as well. Well, pskb_expand_head was added recently and isn't even always called. Have a look at audit_log_drain() in kernel/audit.c. This code does: skb_get netlink_unicast ... kfree_skb This is working just fine - until one day an over-sized skb comes along and hits the BUG in pskb_expand_head ... That particular example can easily be solved by re-arranging the code a bit (I'll send a patch to someone). Still, regarding netlink, I think the safe approach is to either handle or disallow shared skb's. Anything in-between could appear to be working, and then suddenly blow up on your production system. -Tommy From akpm@osdl.org Sat Jan 15 14:40:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 15 Jan 2005 14:40:40 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0FMeaI0003892 for ; Sat, 15 Jan 2005 14:40:36 -0800 Received: from bix (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id j0FMeTl07025; Sat, 15 Jan 2005 14:40:29 -0800 Date: Sat, 15 Jan 2005 14:40:10 -0800 From: Andrew Morton To: "David S. Miller" , netdev@oss.sgi.com Subject: c99ism in latest linus -bk Message-Id: <20050115144010.33182075.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 293 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev net/sched/cls_api.c: In function `tcf_exts_validate': net/sched/cls_api.c:489: parse error before `int' net/sched/cls_api.c:493: `act' undeclared (first use in this function) net/sched/cls_api.c:493: (Each undeclared identifier is reported only once net/sched/cls_api.c:493: for each function it appears in.) net/sched/cls_api.c:494: `err' undeclared (first use in this function) Someone wanna fix that up please? From tgraf@suug.ch Sat Jan 15 15:25:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 15 Jan 2005 15:25:43 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0FNPar2006122 for ; Sat, 15 Jan 2005 15:25:37 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 2016B84; Sun, 16 Jan 2005 00:25:12 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 05A3A1C0EA; Sun, 16 Jan 2005 00:25:54 +0100 (CET) Date: Sun, 16 Jan 2005 00:25:54 +0100 From: Thomas Graf To: Andrew Morton Cc: "David S. Miller" , netdev@oss.sgi.com Subject: [PATCH] PKT_SCHED: remove c99ism Message-ID: <20050115232554.GS26856@postel.suug.ch> References: <20050115144010.33182075.akpm@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050115144010.33182075.akpm@osdl.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 294 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * Andrew Morton <20050115144010.33182075.akpm@osdl.org> 2005-01-15 14:40 > net/sched/cls_api.c: In function `tcf_exts_validate': > net/sched/cls_api.c:489: parse error before `int' > net/sched/cls_api.c:493: `act' undeclared (first use in this function) > net/sched/cls_api.c:493: (Each undeclared identifier is reported only once > net/sched/cls_api.c:493: for each function it appears in.) > net/sched/cls_api.c:494: `err' undeclared (first use in this function) Signed-off-by: Thomas Graf --- linux-2.6.11-rc1-bk2.orig/net/sched/cls_api.c 2005-01-16 00:04:40.000000000 +0100 +++ linux-2.6.11-rc1-bk2/net/sched/cls_api.c 2005-01-15 23:56:48.000000000 +0100 @@ -486,10 +486,9 @@ memset(exts, 0, sizeof(*exts)); #ifdef CONFIG_NET_CLS_ACT - int err; - struct tc_action *act; - if (map->police && tb[map->police-1]) { + int err; + struct tc_action *act; act = tcf_action_init_1(tb[map->police-1], rate_tlv, "police", TCA_ACT_NOREPLACE, TCA_ACT_BIND, &err); if (act == NULL) @@ -498,6 +497,8 @@ act->type = TCA_OLD_COMPAT; exts->action = act; } else if (map->action && tb[map->action-1]) { + int err; + struct tc_action *act; act = tcf_action_init(tb[map->action-1], rate_tlv, NULL, TCA_ACT_NOREPLACE, TCA_ACT_BIND, &err); if (act == NULL) From akpm@osdl.org Sat Jan 15 15:32:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 15 Jan 2005 15:32:36 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0FNWVus006786 for ; Sat, 15 Jan 2005 15:32:31 -0800 Received: from bix (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id j0FNWLl15621; Sat, 15 Jan 2005 15:32:21 -0800 Date: Sat, 15 Jan 2005 15:32:02 -0800 From: Andrew Morton To: Thomas Graf Cc: davem@davemloft.net, netdev@oss.sgi.com Subject: Re: [PATCH] PKT_SCHED: remove c99ism Message-Id: <20050115153202.2f7f81c6.akpm@osdl.org> In-Reply-To: <20050115232554.GS26856@postel.suug.ch> References: <20050115144010.33182075.akpm@osdl.org> <20050115232554.GS26856@postel.suug.ch> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 295 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Thomas Graf wrote: > > #ifdef CONFIG_NET_CLS_ACT > - int err; > - struct tc_action *act; > - > if (map->police && tb[map->police-1]) { > + int err; > + struct tc_action *act; > act = tcf_action_init_1(tb[map->police-1], rate_tlv, "police", > TCA_ACT_NOREPLACE, TCA_ACT_BIND, &err); > if (act == NULL) > @@ -498,6 +497,8 @@ > act->type = TCA_OLD_COMPAT; > exts->action = act; > } else if (map->action && tb[map->action-1]) { > + int err; > + struct tc_action *act; > act = tcf_action_init(tb[map->action-1], rate_tlv, NULL, > TCA_ACT_NOREPLACE, TCA_ACT_BIND, &err); > if (act == NULL) yes, that's the obvious one, but it uses a little more stack space. An uglier but more efficient approach is to whack braces around the whole thing. From pp@ee.oulu.fi Sat Jan 15 15:38:41 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 15 Jan 2005 15:38:45 -0800 (PST) Received: from ee.oulu.fi (ee.oulu.fi [130.231.61.23]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0FNcdbQ007420 for ; Sat, 15 Jan 2005 15:38:40 -0800 Received: from tk28.oulu.fi (tk28 [130.231.48.68]) by ee.oulu.fi (8.13.1/8.13.1) with ESMTP id j0FNcaw5022455; Sun, 16 Jan 2005 01:38:36 +0200 (EET) Received: (from pp@localhost) by tk28.oulu.fi (8.13.1/8.13.1/Submit) id j0FNcabC005479; Sun, 16 Jan 2005 01:38:36 +0200 (EET) Date: Sun, 16 Jan 2005 01:38:36 +0200 From: Pekka Pietikainen To: James Hubbard Cc: netdev@oss.sgi.com Subject: Re: Multicast on b44 Message-ID: <20050115233836.GA5334@ee.oulu.fi> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 296 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pp@ee.oulu.fi Precedence: bulk X-list: netdev On Thu, Jan 13, 2005 at 11:41:12PM -0500, James Hubbard wrote: > I spoke to one of the developers of the communication software. He > checked things in a limited way. This was his take on things. > > "Okay, so I went and looked at the source to the b44 driver that comes > with Fedora 1, and downloaded the 7.3.5 and 3.0.8 versions of the > drivers from the broadcom web site." > > "I'm not sure which chip you've got or which driver you're running, but > the b44 driver looks like it's completely broken as soon as you go over > about 30 multicast groups. It just sort of randomly stops accepting new > joins and so forth. The ones from broadcom seem a little bit better, > but are still a little bogus looking." > > Do you have any suggestions that might help us to fix the problem? Hiya It looks like the b44 driver is limited to 32 entries (B44_MCAST_TABLE_SIZE) whereas bcm4400 goes up to 63. It's just a #define so you should be able to up it to that and be safe, might be worth upping it to that in b44 by default. If you need more than that you're stuck with allmulti, which if I remember correctly didn't work. Yup, from a previous mail of mine I did test it at one point: "Ok, after some digging around ALLMULTI breaking is not a bug, the vendor-provided driver seems to break in similar ways, at least on 2.6, so that's a feature unless they fix it in theirs so I can copy the fix :-)" (well, it receive all multicasts after that, just not any unicasts :-) ). Might be worth checking if the latest one of theirs still does that. Wouldn't be surprised if it was a hardware bug... Another option is promiscuous, which definately does work since I've used tcpdump quite a bit :-). If it's a hardware bug with allmulti I suppose just making allmulti == promiscuous. Debugging this kind of things is very difficult though, since the only source of documentation I have is the bcm4400 driver. And now that I upgraded my system to a nice Athlon 64 with dual GigE I don't have the hardware to test with either, so there's not much I can do to the driver anyway other than point people to stuff, make "it compiles" patches and hope someone tests and fixes them :-/ From tgraf@suug.ch Sat Jan 15 15:40:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 15 Jan 2005 15:40:40 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0FNeaXN007927 for ; Sat, 15 Jan 2005 15:40:37 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id A5E5784; Sun, 16 Jan 2005 00:40:13 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 465FD1C0EA; Sun, 16 Jan 2005 00:40:56 +0100 (CET) Date: Sun, 16 Jan 2005 00:40:56 +0100 From: Thomas Graf To: Andrew Morton Cc: davem@davemloft.net, netdev@oss.sgi.com Subject: [PATCH] PKT_SCHED: remove c99ism Message-ID: <20050115234056.GT26856@postel.suug.ch> References: <20050115144010.33182075.akpm@osdl.org> <20050115232554.GS26856@postel.suug.ch> <20050115153202.2f7f81c6.akpm@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050115153202.2f7f81c6.akpm@osdl.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 297 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * Andrew Morton <20050115153202.2f7f81c6.akpm@osdl.org> 2005-01-15 15:32 > An uglier but more efficient approach is to whack braces around the whole > thing. Fine with me as well. The code isn't used that often and not deep in the calling stack which is why I preferred the cleaner way first. Signed-off-by: Thomas Graf --- linux-2.6.11-rc1-bk2.orig/net/sched/cls_api.c 2005-01-16 00:04:40.000000000 +0100 +++ linux-2.6.11-rc1-bk2/net/sched/cls_api.c 2005-01-16 00:34:53.000000000 +0100 @@ -486,24 +486,26 @@ memset(exts, 0, sizeof(*exts)); #ifdef CONFIG_NET_CLS_ACT - int err; - struct tc_action *act; + { + int err; + struct tc_action *act; - if (map->police && tb[map->police-1]) { - act = tcf_action_init_1(tb[map->police-1], rate_tlv, "police", - TCA_ACT_NOREPLACE, TCA_ACT_BIND, &err); - if (act == NULL) - return err; - - act->type = TCA_OLD_COMPAT; - exts->action = act; - } else if (map->action && tb[map->action-1]) { - act = tcf_action_init(tb[map->action-1], rate_tlv, NULL, - TCA_ACT_NOREPLACE, TCA_ACT_BIND, &err); - if (act == NULL) - return err; + if (map->police && tb[map->police-1]) { + act = tcf_action_init_1(tb[map->police-1], rate_tlv, "police", + TCA_ACT_NOREPLACE, TCA_ACT_BIND, &err); + if (act == NULL) + return err; + + act->type = TCA_OLD_COMPAT; + exts->action = act; + } else if (map->action && tb[map->action-1]) { + act = tcf_action_init(tb[map->action-1], rate_tlv, NULL, + TCA_ACT_NOREPLACE, TCA_ACT_BIND, &err); + if (act == NULL) + return err; - exts->action = act; + exts->action = act; + } } #elif defined CONFIG_NET_CLS_POLICE if (map->police && tb[map->police-1]) { From pp@ee.oulu.fi Sat Jan 15 16:08:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 15 Jan 2005 16:08:19 -0800 (PST) Received: from ee.oulu.fi (ee.oulu.fi [130.231.61.23]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0G08BKc009452 for ; Sat, 15 Jan 2005 16:08:12 -0800 Received: from tk28.oulu.fi (tk28 [130.231.48.68]) by ee.oulu.fi (8.13.1/8.13.1) with ESMTP id j0G089up024022; Sun, 16 Jan 2005 02:08:09 +0200 (EET) Received: (from pp@localhost) by tk28.oulu.fi (8.13.1/8.13.1/Submit) id j0G089U6005587; Sun, 16 Jan 2005 02:08:09 +0200 (EET) Date: Sun, 16 Jan 2005 02:08:09 +0200 From: Pekka Pietikainen To: James Hubbard Cc: netdev@oss.sgi.com Subject: Re: Multicast on b44 Message-ID: <20050116000809.GB5334@ee.oulu.fi> References: <20050115233836.GA5334@ee.oulu.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20050115233836.GA5334@ee.oulu.fi> User-Agent: Mutt/1.4.2i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 298 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pp@ee.oulu.fi Precedence: bulk X-list: netdev On Sun, Jan 16, 2005 at 01:38:36AM +0200, Pekka Pietikainen wrote: > It looks like the b44 driver is limited to 32 entries (B44_MCAST_TABLE_SIZE) > whereas bcm4400 goes up to 63. It's just a #define so you should be able to > up it to that and be safe, might be worth upping it to that in b44 by > default. > > If you need more than that you're stuck with allmulti, which if I remember > correctly didn't work. Yup, from a previous mail of mine I did test it at > one point: > > "Ok, after some digging around ALLMULTI breaking is not a bug, the > vendor-provided driver seems to break in similar ways, at least on 2.6, > so that's a feature unless they fix it in theirs so I can copy the fix :-)" > But do try with RXCONFIG_ALLMULTI instead of _PROMISC. Anyway, here's something totally untested: X-It-Compiles-Lets-Ship-It-By: pp@ee.oulu.fi --- ./b44.h.2 2005-01-16 02:00:27.000000000 +0200 +++ ./b44.h 2005-01-16 02:00:52.000000000 +0200 @@ -358,7 +358,7 @@ DECLARE_PCI_UNMAP_ADDR(mapping); }; -#define B44_MCAST_TABLE_SIZE 32 +#define B44_MCAST_TABLE_SIZE 63 #define B44_BOUNCEBUF_SHIFT 3 #define B44_NUM_BOUNCEBUFS (1 << B44_BOUNCEBUF_SHIFT) --- ./b44.c.2 2005-01-16 02:00:25.000000000 +0200 +++ ./b44.c 2005-01-16 02:04:06.000000000 +0200 @@ -1425,12 +1425,14 @@ } else { __b44_set_mac_addr(bp); - if (dev->flags & IFF_ALLMULTI) - val |= RXCONFIG_ALLMULTI; + if ((dev->flags & IFF_ALLMULTI) || (dev->mc_count > B44_MCAST_TABLE_SIZE)) + /* RXCONFIG_ALLMULTI seems to disable unicast packets :-( */ + val |= RXCONFIG_PROMISC; else i=__b44_load_mcast(bp, dev); - for(;i<64;i++) { + /* Fill in remaining entries with zero */ + for(;i; Sat, 15 Jan 2005 22:30:27 -0800 Received: from localhost (localhost [127.0.0.1]) by mx1.skjellin.no (Postfix) with ESMTP id AD08F88507 for ; Sun, 16 Jan 2005 07:30:25 +0100 (CET) Received: from puppen.pasop.tomt.net (gw-fe-1.pasop.tomt.net [10.255.1.1]) by mail1.skjellin.no (Postfix) with ESMTP id 1D0E2884F8 for ; Sun, 16 Jan 2005 07:30:25 +0100 (CET) Received: from [10.255.1.10] (slurv.pasop.tomt.net [10.255.1.10]) by puppen.pasop.tomt.net (Postfix) with ESMTP id 0A6DC22AC7 for ; Sun, 16 Jan 2005 07:30:25 +0100 (CET) Message-ID: <41EA0A01.2020707@tomt.net> Date: Sun, 16 Jan 2005 07:30:25 +0100 From: Andre Tomt User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: 2.6.10 ipv6/8021q lockup on vconfig on interface removal Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at skjellin.no X-Virus-Status: Clean X-archive-position: 299 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: andre@tomt.net Precedence: bulk X-list: netdev I sent this initially about a week ago, but nobody have said anything, not even a confirmation that its beeing looked into, or about me beeing silly - highly unusual on netdev! So I'm reposting (with slight modifications), boo, shame on me. Just a bit worried it slipped through the cracks. Hi! Another "unregister_netdevice: waiting for eth0.1 to become free. Usage count = 1" issue coming up.. Fun fun fun! And this one also seems to be related to the ipv6 stack. I can reproduce this reliably this by ifdown lo before ifdown'ing eth0.1. That is, if lo goes down first, vconfig rem eth0.1 gets stuck when run later. This only happens with ipv6.ko loaded. I havn't added *any* ipv6 adresses to any interace, the only one are those the ipv6-stack adds itself. This is hitting us often on our routers, as we have ipv6.ko loaded, and Debian runs ifdown -a (bring down all configured interfaces, starting with lo unfortunatly) on shutdown and reboot. I've currently workarounded the problem by making sure ifdown -a is not run on reboot or shutdown, but this is, well, a workaround. Bringing down non-vlan interfaces works just fine after killing lo. I have not attempted to *remove* them like vconfig does, though. a backtrace from vconfing captured with sysrq-T (quickly typed off-screen): shedule_timeout process_timeout netdev_wait_allrefs netdev_wait_allrefs netdev_run_todo unregister_vlan_device [8021q] vlan_ioctl_handler [8021q] sock_ioctl sys_ioctl syscall_call The lab machine is running with a minimalist config, no listeners besides sshd, ipv6.ko and 8021q.ko loaded. From herbert@gondor.apana.org.au Sun Jan 16 00:04:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 00:04:23 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0G84DAn002744 for ; Sun, 16 Jan 2005 00:04:13 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1Cq5Ns-0002EF-00; Sun, 16 Jan 2005 19:03:40 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1Cq5N8-0000oz-00; Sun, 16 Jan 2005 19:02:54 +1100 Date: Sun, 16 Jan 2005 19:02:54 +1100 To: Tommy Christensen Cc: simon.roscic@chello.at, netdev@oss.sgi.com, davem@davemloft.net Subject: [NETLINK] Do not netlink_unicast shared packet in kernel/audit.c Message-ID: <20050116080254.GA2997@gondor.apana.org.au> References: <41E942AF.3030202@tpack.net> <20050115183023.GA31211@gondor.apana.org.au> <41E97B1A.30205@tpack.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="cNdxnHkX5QqsyA0e" Content-Disposition: inline In-Reply-To: <41E97B1A.30205@tpack.net> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 300 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Jan 15, 2005 at 09:20:42PM +0100, Tommy Christensen wrote: > > Well, pskb_expand_head was added recently and isn't even always called. > > Have a look at audit_log_drain() in kernel/audit.c. This code does: > skb_get > netlink_unicast > ... > kfree_skb > > This is working just fine - until one day an over-sized skb comes along > and hits the BUG in pskb_expand_head ... You're always right :) > Still, regarding netlink, I think the safe approach is to either handle > or disallow shared skb's. Anything in-between could appear to be working, > and then suddenly blow up on your production system. kernel/audit.c seems to be the only caller that does this. Strictly speaking shared skb's are always illegal in netlink_unicast/netlink_broadcast since we call functions such as skb_orphan which modifies the sk_buff structure. However, for callers such as kernel/audit.c that don't care about those fields, it actually turns out to be harmless. I'm hesitant to put an outright ban on it since it will force callers such as kernel/audit.c to always do an skb_clone. So here is a patch to handle shared skb's by cloning them if we're going to do a pskb_expand_head. This patch depends on the previous one that moves skb_orphan into netlink_trim. Signed-off-by: Herbert Xu Thanks, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --cNdxnHkX5QqsyA0e Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p --- linux-2.6/net/netlink/af_netlink.c.orig 2005-01-16 17:46:49.000000000 +1100 +++ linux-2.6/net/netlink/af_netlink.c 2005-01-16 19:00:51.000000000 +1100 @@ -660,7 +660,7 @@ sock_put(sk); } -static inline void netlink_trim(struct sk_buff *skb, int allocation) +static inline struct sk_buff *netlink_trim(struct sk_buff *skb, int allocation) { int delta; @@ -668,10 +668,20 @@ delta = skb->end - skb->tail; if (delta * 2 < skb->truesize) - return; - if (pskb_expand_head(skb, 0, -delta, allocation)) - return; - skb->truesize -= delta; + return skb; + + if (skb_shared(skb)) { + struct sk_buff *nskb = skb_clone(skb, allocation); + if (!nskb) + return skb; + kfree_skb(skb); + skb = nskb; + } + + if (!pskb_expand_head(skb, 0, -delta, allocation)) + skb->truesize -= delta; + + return skb; } int netlink_unicast(struct sock *ssk, struct sk_buff *skb, u32 pid, int nonblock) @@ -680,7 +690,7 @@ int err; long timeo; - netlink_trim(skb, gfp_any()); + skb = netlink_trim(skb, gfp_any()); timeo = sock_sndtimeo(ssk, nonblock); retry: @@ -788,7 +798,7 @@ info.skb = skb; info.skb2 = NULL; - netlink_trim(skb, allocation); + skb = netlink_trim(skb, allocation); /* While we sleep in clone, do not allow to change socket list */ --cNdxnHkX5QqsyA0e-- From tommy.christensen@tpack.net Sun Jan 16 00:33:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 00:33:25 -0800 (PST) Received: from mail.tpack.net (ip18.tpack.net [213.173.228.18]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0G8XJSO008003 for ; Sun, 16 Jan 2005 00:33:20 -0800 Received: (qmail 2346 invoked from network); 16 Jan 2005 08:33:13 -0000 Received: from dhcp-174.cph.tpack.net (HELO ?172.17.159.11?) (192.168.0.174) by 0 with SMTP; 16 Jan 2005 08:33:13 -0000 Message-ID: <41EA2733.1010308@tpack.net> Date: Sun, 16 Jan 2005 09:34:59 +0100 From: Tommy Christensen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Herbert Xu CC: simon.roscic@chello.at, netdev@oss.sgi.com, davem@davemloft.net Subject: Re: [NETLINK] Do not netlink_unicast shared packet in kernel/audit.c References: <41E942AF.3030202@tpack.net> <20050115183023.GA31211@gondor.apana.org.au> <41E97B1A.30205@tpack.net> <20050116080254.GA2997@gondor.apana.org.au> In-Reply-To: <20050116080254.GA2997@gondor.apana.org.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 301 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tommy.christensen@tpack.net Precedence: bulk X-list: netdev Herbert Xu wrote: > I'm hesitant to put an outright ban on it since it will force callers > such as kernel/audit.c to always do an skb_clone. > > So here is a patch to handle shared skb's by cloning them if we're > going to do a pskb_expand_head. This patch depends on the previous > one that moves skb_orphan into netlink_trim. Very nice, Herbert. This should be fine for everybody. -Tommy From hch@lst.de Sun Jan 16 03:54:38 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 03:54:42 -0800 (PST) Received: from mail.lst.de (verein.lst.de [213.95.11.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GBsaj7017893 for ; Sun, 16 Jan 2005 03:54:38 -0800 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id j0GBsV6t013702 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sun, 16 Jan 2005 12:54:32 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id j0GBsVLs013700; Sun, 16 Jan 2005 12:54:31 +0100 Date: Sun, 16 Jan 2005 12:54:31 +0100 From: Christoph Hellwig To: davem@davemloft.net, pavlic@de.ibm.com Cc: waldi@debian.org, netdev@oss.sgi.com Subject: [PATCH] ipv6: alternative version of S/390 shared NIC support Message-ID: <20050116115431.GA13617@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 302 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: netdev Let's try again solvign the EUI64 generation for S/390. I looked over the IBM patch and I think it can be done a lot simpler: - put a dev_id field in struct net_device, so that it uses space that would be wasted by padding otherwise. - if this fields is non-null let ipv6_generate_eui64 use the algorithm from the QETH code to generate an EUI that's different for each OS instance. See code comments for details. --- 1.23/drivers/s390/net/qeth_main.c 2005-01-04 00:49:39 +01:00 +++ edited/drivers/s390/net/qeth_main.c 2005-01-16 12:33:52 +01:00 @@ -5033,27 +5033,6 @@ return 0; } -#ifdef CONFIG_QETH_IPV6 -int -qeth_ipv6_generate_eui64(u8 * eui, struct net_device *dev) -{ - switch (dev->type) { - case ARPHRD_ETHER: - case ARPHRD_FDDI: - case ARPHRD_IEEE802_TR: - if (dev->addr_len != ETH_ALEN) - return -1; - memcpy(eui, dev->dev_addr, 3); - memcpy(eui + 5, dev->dev_addr + 3, 3); - eui[3] = (dev->dev_id >> 8) & 0xff; - eui[4] = dev->dev_id & 0xff; - return 0; - } - return -1; - -} -#endif - static void qeth_get_mac_for_ipm(__u32 ipm, char *mac, struct net_device *dev) { @@ -5587,11 +5566,8 @@ } #ifdef CONFIG_QETH_IPV6 /*IPv6 address autoconfiguration stuff*/ - card->dev->dev_id = card->info.unique_id & 0xffff; if (!(card->info.unique_id & UNIQUE_ID_NOT_BY_CARD)) - card->dev->generate_eui64 = qeth_ipv6_generate_eui64; - - + card->dev->dev_id = card->info.unique_id & 0xffff; #endif dev->hard_header_parse = NULL; dev->set_mac_address = qeth_layer2_set_mac_address; --- 1.95/include/linux/netdevice.h 2005-01-10 21:23:55 +01:00 +++ edited/include/linux/netdevice.h 2005-01-16 12:32:07 +01:00 @@ -345,6 +345,7 @@ unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ unsigned char dev_addr[MAX_ADDR_LEN]; /* hw address */ unsigned char addr_len; /* hardware address length */ + unsigned short dev_id; /* for shared network cards */ struct dev_mc_list *mc_list; /* Multicast mac addresses */ int mc_count; /* Number of installed mcasts */ --- 1.128/net/ipv6/addrconf.c 2005-01-14 22:30:07 +01:00 +++ edited/net/ipv6/addrconf.c 2005-01-16 12:29:51 +01:00 @@ -1079,10 +1079,29 @@ if (dev->addr_len != ETH_ALEN) return -1; memcpy(eui, dev->dev_addr, 3); - memcpy(eui + 5, dev->dev_addr+3, 3); - eui[3] = 0xFF; - eui[4] = 0xFE; - eui[0] ^= 2; + memcpy(eui + 5, dev->dev_addr + 3, 3); + + /* + * The zSeries OSA network cards can be shared among various + * OS instances, but the OSA cards have only one MAC address. + * This leads to duplicate address conflicts in conjunction + * with IPv6 if more than one instance uses the same card. + * + * The driver for these cards can deliver a unique 16-bit + * identifier for each instance sharing the same card. It is + * placed instead of 0xFFFE in the interface identifier. The + * "u" bit of the interface identifier is not inverted in this + * case. Hence the resulting interface identifier has local + * scope according to RFC2373. + */ + if (dev->dev_id) { + eui[3] = (dev->dev_id >> 8) & 0xFF; + eui[4] = dev->dev_id & 0xFF; + } else { + eui[3] = 0xFF; + eui[4] = 0xFE; + eui[0] ^= 2; + } return 0; case ARPHRD_ARCNET: /* XXX: inherit EUI-64 from other interface -- yoshfuji */ From Robert.Olsson@data.slu.se Sun Jan 16 04:32:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 04:33:00 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GCWssb028430 for ; Sun, 16 Jan 2005 04:32:55 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0GCWn9Q028551; Sun, 16 Jan 2005 13:32:49 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 77846EC1A0; Sun, 16 Jan 2005 13:32:49 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16874.24305.461492.48668@robur.slu.se> Date: Sun, 16 Jan 2005 13:32:49 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501141326.29575.jeremy.guthrie@berbee.com> References: <16871.60849.905998.527106@robur.slu.se> <200501141300.44347.jeremy.guthrie@berbee.com> <200501141326.29575.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 303 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > I actually upped the buffer count to 8192 buffers instead of 10k. > Of the 74 samples I have thus far, 57 have been clean of errors. > Most of the sample errors appear to be shortly after the cache flush. I don't really believe in increasing RX buffers to this extent. We verified that you have CPU available and the drops occur when the timer based GC happens. Increasing buffers decreases overall performance and adds jitter. We saw also the timed based GC were taking the dst-entries from about 600k to 40k in one shot. I think this what we should look into. Just GC is "work" also after GC a lot flows has to be recreated doing fib lookup and creating new entries. We want to smoothen the GC process so happen more frequent and does less work. Some time ago an "in-flow" GC (as opposed to timer based) was added to the routing code look for cand in route.c. In setup like yours (and ours) it would be better to relay on this process to a higher extent. Anyway in /proc/sys/net/ipv4/route/ you have the files. gc_elasticity, gc_interval, gc_thresh etc I would avoid gc_min_interval. And you can play with your running system and for drops without causing your users to much pain. We save the patch for routing without route hash and GC until later, --ro From Robert.Olsson@data.slu.se Sun Jan 16 04:46:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 04:46:58 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GCkr6H029374 for ; Sun, 16 Jan 2005 04:46:54 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0GCkoE5030325; Sun, 16 Jan 2005 13:46:50 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 595F0EC1A0; Sun, 16 Jan 2005 13:46:50 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16874.25146.335366.990655@robur.slu.se> Date: Sun, 16 Jan 2005 13:46:50 +0100 To: Dave Peterson Cc: robert.olsson@its.uu.se, netdev@oss.sgi.com Subject: possible bug in net/core/pktgen.c (2.6.10 kernel) In-Reply-To: <200501141129.21461.dsp@llnl.gov> References: <200501141129.21461.dsp@llnl.gov> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 304 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Dave Peterson writes: > I found a piece of code that looks problematic in the 2.6.10 kernel. > The following code appears starting on line 746 in function inject() > of net/core/pktgen.c: > schedule(); > else > do_softirq(); Thanks! So it should be? --- net/core/pktgen.c.orig 2005-01-16 13:39:10.933427120 +0100 +++ net/core/pktgen.c 2005-01-16 13:40:41.926751672 +0100 @@ -753,8 +753,11 @@ } if (need_resched()) schedule(); - else + else { + preempt_disable(); do_softirq(); + preempt_enable(); + } } while (netif_queue_stopped(odev)); idle = cycles() - idle_start; info->idle_acc += idle; --ro From linux_lover2004@yahoo.com Sun Jan 16 05:01:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 05:01:08 -0800 (PST) Received: from web52210.mail.yahoo.com (web52210.mail.yahoo.com [206.190.39.92]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0GD1345030449 for ; Sun, 16 Jan 2005 05:01:03 -0800 Received: (qmail 69967 invoked by uid 60001); 16 Jan 2005 13:00:58 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=rvSaKvBMZiSqnESXmJxIU6hA+ASFgRodXXr6sk3Akn75S/XdlCz9475enaSJ2VcbWt6Y3pMv/wEAKhCWYz2RZjkmB17vTrfqd9WS2255lgTDwutm4cg09GhdTRsmf85padHDzYu33nNiNrK6AimsE3kDRhpd7svFasOL+htCHF0= ; Message-ID: <20050116130058.69965.qmail@web52210.mail.yahoo.com> Received: from [202.56.231.117] by web52210.mail.yahoo.com via HTTP; Sun, 16 Jan 2005 05:00:58 PST Date: Sun, 16 Jan 2005 05:00:58 -0800 (PST) From: linux lover Subject: Analysing UDP packet building code in 2.6.10 kernel To: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 305 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: linux_lover2004@yahoo.com Precedence: bulk X-list: netdev Hello all, I am knowing all 2.4 kernel network stack packet buildup procedure. Now i am trying to analysing same in 2.6.10 kernel. What i found is many changes to 2.6 kernel compare to 2.4. Theres is no ip_build_xmit instead thers a new function that is ip_append_data. What i want to know is from udp.c file. Theres a udp protocol structure is defined struct proto udp_prot = { .name = "UDP", .owner = THIS_MODULE, .close = udp_close, .connect = ip4_datagram_connect, .disconnect = udp_disconnect, .ioctl = udp_ioctl, .destroy = udp_destroy_sock, .setsockopt = udp_setsockopt, .getsockopt = udp_getsockopt, .sendmsg = udp_sendmsg, .recvmsg = udp_recvmsg, .sendpage = udp_sendpage, .backlog_rcv = udp_queue_rcv_skb, .hash = udp_v4_hash, .unhash = udp_v4_unhash, .get_port = udp_v4_get_port, .slab_obj_size = sizeof(struct udp_sock), }; I want to know for what purpose udp_sendpage is used also whats significance of . in structure members? Also why .slab_obj_size = sizeof(struct udp_sock) defined in udp_prot? Also where's packet size/space is allocated for UDP packet? Please help me to analyze code. Thanks in advance. linux_lover. __________________________________ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.yahoo.com From hadi@cyberus.ca Sun Jan 16 06:30:51 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 06:30:57 -0800 (PST) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GEUow7002014 for ; Sun, 16 Jan 2005 06:30:51 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.30) id 1CqBQV-0002wl-HN for netdev@oss.sgi.com; Sun, 16 Jan 2005 09:30:47 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqBQR-00020J-4R; Sun, 16 Jan 2005 09:30:43 -0500 Subject: Re: [PATCH] ipv6: alternative version of S/390 shared NIC support From: jamal Reply-To: hadi@cyberus.ca To: Christoph Hellwig Cc: "David S. Miller" , pavlic@de.ibm.com, waldi@debian.org, netdev@oss.sgi.com In-Reply-To: <20050116115431.GA13617@lst.de> References: <20050116115431.GA13617@lst.de> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105885839.1097.573.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 16 Jan 2005 09:30:40 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 306 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev I could be missing something: Its almost like the "cards" in these drivers deserve to be their own netdevices to begin with. In other words the qeth approach itself seems to be a hack to begin with. Should be along the lines: --->Physical netdevice -->some demux code to select instance --> Virtual netdevice specific to OS instance ---> standard linux path This approach would be no different from say any tunnel driver code. If someone fixes them to be separate netdevices, then there would be any need to speacial case code in the stack just for them. Routing, VLANS etc would all work fine. I know its a lot of work to make those changes - but it is probably cleaner to just keep it as it was before your patch until someone converts these into netdevices. Either that or i missed something that forces the cards to be modeled the way they were. cheers, jamal On Sun, 2005-01-16 at 06:54, Christoph Hellwig wrote: > Let's try again solvign the EUI64 generation for S/390. I looked over > the IBM patch and I think it can be done a lot simpler: > > - put a dev_id field in struct net_device, so that it uses space that > would be wasted by padding otherwise. > - if this fields is non-null let ipv6_generate_eui64 use the algorithm > from the QETH code to generate an EUI that's different for each > OS instance. See code comments for details. > > > --- 1.23/drivers/s390/net/qeth_main.c 2005-01-04 00:49:39 +01:00 > +++ edited/drivers/s390/net/qeth_main.c 2005-01-16 12:33:52 +01:00 > @@ -5033,27 +5033,6 @@ > return 0; > } > > -#ifdef CONFIG_QETH_IPV6 > -int > -qeth_ipv6_generate_eui64(u8 * eui, struct net_device *dev) > -{ > - switch (dev->type) { > - case ARPHRD_ETHER: > - case ARPHRD_FDDI: > - case ARPHRD_IEEE802_TR: > - if (dev->addr_len != ETH_ALEN) > - return -1; > - memcpy(eui, dev->dev_addr, 3); > - memcpy(eui + 5, dev->dev_addr + 3, 3); > - eui[3] = (dev->dev_id >> 8) & 0xff; > - eui[4] = dev->dev_id & 0xff; > - return 0; > - } > - return -1; > - > -} > -#endif > - > static void > qeth_get_mac_for_ipm(__u32 ipm, char *mac, struct net_device *dev) > { > @@ -5587,11 +5566,8 @@ > } > #ifdef CONFIG_QETH_IPV6 > /*IPv6 address autoconfiguration stuff*/ > - card->dev->dev_id = card->info.unique_id & 0xffff; > if (!(card->info.unique_id & UNIQUE_ID_NOT_BY_CARD)) > - card->dev->generate_eui64 = qeth_ipv6_generate_eui64; > - > - > + card->dev->dev_id = card->info.unique_id & 0xffff; > #endif > dev->hard_header_parse = NULL; > dev->set_mac_address = qeth_layer2_set_mac_address; > --- 1.95/include/linux/netdevice.h 2005-01-10 21:23:55 +01:00 > +++ edited/include/linux/netdevice.h 2005-01-16 12:32:07 +01:00 > @@ -345,6 +345,7 @@ > unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ > unsigned char dev_addr[MAX_ADDR_LEN]; /* hw address */ > unsigned char addr_len; /* hardware address length */ > + unsigned short dev_id; /* for shared network cards */ > > struct dev_mc_list *mc_list; /* Multicast mac addresses */ > int mc_count; /* Number of installed mcasts */ > --- 1.128/net/ipv6/addrconf.c 2005-01-14 22:30:07 +01:00 > +++ edited/net/ipv6/addrconf.c 2005-01-16 12:29:51 +01:00 > @@ -1079,10 +1079,29 @@ > if (dev->addr_len != ETH_ALEN) > return -1; > memcpy(eui, dev->dev_addr, 3); > - memcpy(eui + 5, dev->dev_addr+3, 3); > - eui[3] = 0xFF; > - eui[4] = 0xFE; > - eui[0] ^= 2; > + memcpy(eui + 5, dev->dev_addr + 3, 3); > + > + /* > + * The zSeries OSA network cards can be shared among various > + * OS instances, but the OSA cards have only one MAC address. > + * This leads to duplicate address conflicts in conjunction > + * with IPv6 if more than one instance uses the same card. > + * > + * The driver for these cards can deliver a unique 16-bit > + * identifier for each instance sharing the same card. It is > + * placed instead of 0xFFFE in the interface identifier. The > + * "u" bit of the interface identifier is not inverted in this > + * case. Hence the resulting interface identifier has local > + * scope according to RFC2373. > + */ > + if (dev->dev_id) { > + eui[3] = (dev->dev_id >> 8) & 0xFF; > + eui[4] = dev->dev_id & 0xFF; > + } else { > + eui[3] = 0xFF; > + eui[4] = 0xFE; > + eui[0] ^= 2; > + } > return 0; > case ARPHRD_ARCNET: > /* XXX: inherit EUI-64 from other interface -- yoshfuji */ > > From hadi@cyberus.ca Sun Jan 16 06:43:29 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 06:43:34 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GEhSZI003025 for ; Sun, 16 Jan 2005 06:43:28 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CqBcj-0007Rm-Ui for netdev@oss.sgi.com; Sun, 16 Jan 2005 09:43:25 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqBch-0003Ok-9o; Sun, 16 Jan 2005 09:43:23 -0500 Subject: Re: is there any plan to support BSD accept filter? From: jamal Reply-To: hadi@cyberus.ca To: KyoungSoo Park Cc: Stephen Hemminger , netdev@oss.sgi.com In-Reply-To: <41E87E7D.8040107@cs.princeton.edu> References: <41E830BC.7000709@cs.princeton.edu> <20050114140540.76146b29@dxpl.pdx.osdl.net> <41E87E7D.8040107@cs.princeton.edu> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105886601.1097.583.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 16 Jan 2005 09:43:21 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 307 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Seems easy to do if you can muck with the security hooks. The selinux folkk already have a monopoly on all those hooks. Look at selinux and security_socket_accept() and how you can hook up to it. You probably wanna worry about security_socket_recvmsg() and security_socket_post_accept() Dont ask me - look at the code and visit their docs. As a warning those hooks are pretty stupid (what a waste of potential) so you will have to sweat a little hacking them to maintain state. cheers, jamal On Fri, 2005-01-14 at 21:22, KyoungSoo Park wrote: > yes. I agree that maybe an ugly hack to put that in the kernel. > What I want to do is to support such feature leaving as little footprint > as possible in the kernel, but specify whatever flexible policy you want > in the user level. > I'm not sure netfilter module is the right place because it seems I need > to do packet by packet processing, but I want to deal with a little higher > level than that as a start. (I'm not familar with netfilter, so please correct > me if I'm wrong.) > > Anyway, thanks for your response. > > KyoungSoo > > > Stephen Hemminger wrote: > > >If you want to do these kind of stateful hacks, why not build a > >netfilter module to do it? > > > > > > > > > > > From hadi@cyberus.ca Sun Jan 16 06:58:50 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 06:58:54 -0800 (PST) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GEwnYj004097 for ; Sun, 16 Jan 2005 06:58:49 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.30) id 1CqBra-0003e5-CT for netdev@oss.sgi.com; Sun, 16 Jan 2005 09:58:46 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqBrW-0005Eq-Um; Sun, 16 Jan 2005 09:58:43 -0500 Subject: Re: [RFC] meta ematch From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: Patrick McHardy , netdev@oss.sgi.com In-Reply-To: <20050114151407.GR26856@postel.suug.ch> References: <20050106194102.GW26856@postel.suug.ch> <1105105511.1046.77.camel@jzny.localdomain> <20050108145457.GZ26856@postel.suug.ch> <1105363582.1041.162.camel@jzny.localdomain> <20050110211747.GA26856@postel.suug.ch> <1105394738.1085.63.camel@jzny.localdomain> <20050113174111.GP26856@postel.suug.ch> <41E6C3E5.2020908@trash.net> <20050113192047.GQ26856@postel.suug.ch> <41E71CC4.3020102@trash.net> <20050114151407.GR26856@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105887519.1097.597.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 16 Jan 2005 09:58:40 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 308 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Fri, 2005-01-14 at 10:14, Thomas Graf wrote: > > Here's a revised patch. I fixed the numeric comparison issues and > added meta_obj instead of using meta_data to give a better impression > on the difference of a comparable object and meta data definitions. I scanned the code very quickly; lets start with the big picture then i will send some more comments: Did i understand this correctly that a metamatch MUST have a lvalue + rvalue pair? What if all i wanted to say was .. ematch indev eth0 I only see one value there - does that become l or r? more comments coming - just ned some caffeine then i will stare. cheers, jamal From tgraf@suug.ch Sun Jan 16 07:08:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 07:08:59 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GF8s9a004912 for ; Sun, 16 Jan 2005 07:08:54 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 1896984; Sun, 16 Jan 2005 16:08:31 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 5710D1C0EA; Sun, 16 Jan 2005 16:09:14 +0100 (CET) Date: Sun, 16 Jan 2005 16:09:14 +0100 From: Thomas Graf To: jamal Cc: Patrick McHardy , netdev@oss.sgi.com Subject: Re: [RFC] meta ematch Message-ID: <20050116150914.GU26856@postel.suug.ch> References: <20050108145457.GZ26856@postel.suug.ch> <1105363582.1041.162.camel@jzny.localdomain> <20050110211747.GA26856@postel.suug.ch> <1105394738.1085.63.camel@jzny.localdomain> <20050113174111.GP26856@postel.suug.ch> <41E6C3E5.2020908@trash.net> <20050113192047.GQ26856@postel.suug.ch> <41E71CC4.3020102@trash.net> <20050114151407.GR26856@postel.suug.ch> <1105887519.1097.597.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1105887519.1097.597.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 309 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1105887519.1097.597.camel@jzny.localdomain> 2005-01-16 09:58 > On Fri, 2005-01-14 at 10:14, Thomas Graf wrote: > > > > Here's a revised patch. I fixed the numeric comparison issues and > > added meta_obj instead of using meta_data to give a better impression > > on the difference of a comparable object and meta data definitions. > > I scanned the code very quickly; lets start with the big picture then i > will send some more comments: > Did i understand this correctly that a metamatch MUST have a lvalue + > rvalue pair? They MAY have bove. > What if all i wanted to say was > .. > ematch indev eth0 > The lvalue will be TCF_META_ID_INDEV and your rvalue will be TCF_META_TYPE_VAR with "eth0" as payload(TCF_EM_META_RVALUE). TCF_EM_META_LVALUE will be unused in this case. From hadi@cyberus.ca Sun Jan 16 07:38:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 07:38:08 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GFc3rX008980 for ; Sun, 16 Jan 2005 07:38:03 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CqCTZ-0007UF-5W for netdev@oss.sgi.com; Sun, 16 Jan 2005 10:38:01 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqCTV-0001lY-RB; Sun, 16 Jan 2005 10:37:58 -0500 Subject: Re: [RFC] meta ematch From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: Patrick McHardy , netdev@oss.sgi.com In-Reply-To: <20050116150914.GU26856@postel.suug.ch> References: <20050108145457.GZ26856@postel.suug.ch> <1105363582.1041.162.camel@jzny.localdomain> <20050110211747.GA26856@postel.suug.ch> <1105394738.1085.63.camel@jzny.localdomain> <20050113174111.GP26856@postel.suug.ch> <41E6C3E5.2020908@trash.net> <20050113192047.GQ26856@postel.suug.ch> <41E71CC4.3020102@trash.net> <20050114151407.GR26856@postel.suug.ch> <1105887519.1097.597.camel@jzny.localdomain> <20050116150914.GU26856@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105889874.1090.613.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 16 Jan 2005 10:37:54 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 310 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Sun, 2005-01-16 at 10:09, Thomas Graf wrote: > The lvalue will be TCF_META_ID_INDEV and your rvalue will be > TCF_META_TYPE_VAR with "eth0" as payload(TCF_EM_META_RVALUE). > TCF_EM_META_LVALUE will be unused in this case. ok - i get it. So the rvalue is basically just the data that needs to be compared against. rvalue confused me a little. If you had called it meta_data i would have got it right away. But now that you explain it, makes sense. I am not sure iam following yet: So in the case of indev, you would need to - get indev ifindex from skb - get indev name from skb - compare the two?? Actually it may be a little overkill to have those two as separate entities with their own headers etc, no? Why not just store it in the same fashion you transported it from/to user space? I will start looking at the code cheers, jamal From tgraf@suug.ch Sun Jan 16 07:57:38 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 07:57:43 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GFvcn7010268 for ; Sun, 16 Jan 2005 07:57:38 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 3270184; Sun, 16 Jan 2005 16:57:15 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 57B451C0EA; Sun, 16 Jan 2005 16:57:58 +0100 (CET) Date: Sun, 16 Jan 2005 16:57:58 +0100 From: Thomas Graf To: jamal Cc: Patrick McHardy , netdev@oss.sgi.com Subject: Re: [RFC] meta ematch Message-ID: <20050116155758.GV26856@postel.suug.ch> References: <20050110211747.GA26856@postel.suug.ch> <1105394738.1085.63.camel@jzny.localdomain> <20050113174111.GP26856@postel.suug.ch> <41E6C3E5.2020908@trash.net> <20050113192047.GQ26856@postel.suug.ch> <41E71CC4.3020102@trash.net> <20050114151407.GR26856@postel.suug.ch> <1105887519.1097.597.camel@jzny.localdomain> <20050116150914.GU26856@postel.suug.ch> <1105889874.1090.613.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1105889874.1090.613.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 311 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1105889874.1090.613.camel@jzny.localdomain> 2005-01-16 10:37 > On Sun, 2005-01-16 at 10:09, Thomas Graf wrote: > > > The lvalue will be TCF_META_ID_INDEV and your rvalue will be > > TCF_META_TYPE_VAR with "eth0" as payload(TCF_EM_META_RVALUE). > > TCF_EM_META_LVALUE will be unused in this case. > > ok - i get it. So the rvalue is basically just the data that needs to be > compared against. rvalue confused me a little. If you had called it > meta_data i would have got it right away. But now that you explain it, > makes sense. The rvalue may also point to a metadata in the kernel. This gets useful when comparing dev against real dev or if nfmark, tcindex, you name it carries a ifindex for example. It would even be possible to compare two strings from userspace but that wouldn't make sense. The only difference between lvalue and rvalue is that the lvalue carries the operand. > I am not sure iam following yet: > > So in the case of indev, you would need to > - get indev ifindex from skb > - get indev name from skb > - compare the two?? > > Actually it may be a little overkill to have those two as separate > entities with their own headers etc, no? Why not just store it in the > same fashion you transported it from/to user space? For devices, userspace can choose between comparing indices or device names. The variable type will get more use once I add the IPv6 routing meta matches. From hadi@cyberus.ca Sun Jan 16 08:11:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 08:11:26 -0800 (PST) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GGBKvt011211 for ; Sun, 16 Jan 2005 08:11:21 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.30) id 1CqCzl-00089L-O1 for netdev@oss.sgi.com; Sun, 16 Jan 2005 11:11:17 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqCzi-0006Kn-M5; Sun, 16 Jan 2005 11:11:14 -0500 Subject: Re: [RFC] meta ematch From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: Patrick McHardy , netdev@oss.sgi.com In-Reply-To: <20050114151407.GR26856@postel.suug.ch> References: <20050106194102.GW26856@postel.suug.ch> <1105105511.1046.77.camel@jzny.localdomain> <20050108145457.GZ26856@postel.suug.ch> <1105363582.1041.162.camel@jzny.localdomain> <20050110211747.GA26856@postel.suug.ch> <1105394738.1085.63.camel@jzny.localdomain> <20050113174111.GP26856@postel.suug.ch> <41E6C3E5.2020908@trash.net> <20050113192047.GQ26856@postel.suug.ch> <41E71CC4.3020102@trash.net> <20050114151407.GR26856@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105891871.1097.647.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 16 Jan 2005 11:11:11 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 312 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Fri, 2005-01-14 at 10:14, Thomas Graf wrote: > diff -Nru linux-2.6.10-bk14.orig/include/linux/tc_ematch/tc_em_meta.h linux-2.6.10-bk14/include/linux/tc_ematch/tc_em_meta.h [..] > +struct tcf_meta_val > +{ > + __u16 kind; > + __u8 shift; > + __u8 op; > +}; > + > +#define TCF_META_TYPE_MASK (0xf << 12) > +#define TCF_META_TYPE(kind) (((kind) & TCF_META_TYPE_MASK) >> 12) > +#define TCF_META_ID_MASK 0x7ff > +#define TCF_META_ID(kind) ((kind) & TCF_META_ID_MASK) Does it smell like there may be endianess issues? Probably not. > +enum > +{ > + TCF_META_TYPE_VAR, > + TCF_META_TYPE_INT, > + __TCF_META_TYPE_MAX > +}; > +#define TCF_META_TYPE_MAX (__TCF_META_TYPE_MAX - 1) > + > +enum > +{ > + TCF_META_ID_VALUE, > + TCF_META_ID_RANDOM, > + TCF_META_ID_LOADAVG_0, > + TCF_META_ID_LOADAVG_1, > + TCF_META_ID_LOADAVG_2, > + TCF_META_ID_DEV, Since filters are attached to devices - is TCF_META_ID_DEV of any value? > diff -Nru linux-2.6.10-bk14.orig/net/sched/em_meta.c linux-2.6.10-bk14/net/sched/em_meta.c > + > +struct meta_obj > +{ > + unsigned long value; > + unsigned int len; > +}; > + > +struct meta_value > +{ > + struct tcf_meta_val hdr; > + unsigned long val; > + unsigned int len; Those last two look like meta_obj you defined above > +/************************************************************************** > + * System status & misc > + **************************************************************************/ > + > +static int meta_int_random(struct sk_buff *skb, struct tcf_pkt_info *info, > + struct meta_value *v, struct meta_obj *dst) > +{ > + get_random_bytes(&dst->value, sizeof(dst->value)); > + return 0; > +} > + > +static inline unsigned long fixed_loadavg(unsigned long v) > +{ > + return (v + (FIXED_1/200)) >> FSHIFT; 200 has some magic connotation to it - a define somewhere perhaps? > +} > + > +static int meta_int_loadavg_0(struct sk_buff *skb, struct tcf_pkt_info *info, > + struct meta_value *v, struct meta_obj *dst) > +{ > + dst->value = fixed_loadavg(avenrun[0]); > + return 0; > +} > + > +static int meta_int_loadavg_1(struct sk_buff *skb, struct tcf_pkt_info *info, > + struct meta_value *v, struct meta_obj *dst) > +{ > + dst->value = fixed_loadavg(avenrun[1]); > + return 0; > +} > + > +static int meta_int_loadavg_2(struct sk_buff *skb, struct tcf_pkt_info *info, > + struct meta_value *v, struct meta_obj *dst) > +{ > + dst->value = fixed_loadavg(avenrun[2]); > + return 0; > +} Theres a lot of parameters not used at all in these calls .get calls. So far i have seen dst->value and some of the skb fields used. I apologize, I normally dont pick on these things - so if you have future plans for why you are passing those, keep them and ignore the comment. BTW, it would probably be useful to return some mnemonic instead of 0. > +/************************************************************************** > + * Device names & indices > + **************************************************************************/ > + > +static inline int int_dev(struct net_device *dev, struct meta_obj *dst) > +{ > + if (unlikely(dev == NULL)) > + return -1; > + > + dst->value = dev->ifindex; > + return 0; > +} > + > +static inline int var_dev(struct net_device *dev, struct meta_obj *dst) > +{ > + if (unlikely(dev == NULL)) > + return -1; > + > + dst->value = (unsigned long) dev->name; > + dst->len = strlen(dev->name); So if device dissapears ... what happens to the pointer? [..] > +static inline struct meta_ops * meta_ops(struct meta_value *v) > +{ > + return &__meta_ops[meta_type(v)][meta_id(v)]; > +} > + > +static int meta_var_compare(struct meta_obj *a, struct meta_obj *b) > +{ > + int r = a->len - b->len; > + > + if (r == 0) > + r = memcmp((void *) a->value, (void *) b->value, a->len); > + > + return r; > +} clever > +static void meta_var_apply_extras(struct meta_value *v, > + struct meta_obj *dst) > +{ > + int shift = v->hdr.shift; > + > + if (shift && shift < dst->len) > + dst->len -= shift; > +} whats the purpose to the extras? > +static int meta_int_compare(struct meta_obj *a, struct meta_obj *b) > +{ > + /* Let gcc optimize it, the unlikely is not really based on > + * some numbers but jump free code for missmatches seems > + * more logical. > + */ > + if (unlikely(a == b)) > + return 0; > + else if (a < b) > + return -1; > + else > + return 1; > +} Would be very useful to return mnemonics for readability. > +static int em_meta_match(struct sk_buff *skb, struct tcf_ematch *m, > + struct tcf_pkt_info *info) > +{ > + int r; > + struct meta_match *meta = (struct meta_match *) m->data; > + struct meta_obj l_value, r_value; > + > + if (meta_get(skb, info, &meta->lvalue, &l_value) < 0 || > + meta_get(skb, info, &meta->rvalue, &r_value) < 0) > + return 0; This is one part that confused me in my earlier email > + r = meta_type_ops(&meta->lvalue)->compare(&l_value, &r_value); And this is where it started Overall comment: Well done usability comment: Ok, I have to admit I am not a friend of too-friendly, which is one of the faults IMO with netfilter; however, this would have joenetfilterfireman sweat a little too profusely. I think you could add a new metafield in 31 seconds. I could probably do it in 95 seconds. Would be ideal to get average janeorjoenetfilterfireman to do it in 30 minutes - I dont think you are there. cheers, jamal From hadi@cyberus.ca Sun Jan 16 08:19:30 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 08:19:34 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GGJU05015261 for ; Sun, 16 Jan 2005 08:19:30 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1CqD7f-00033n-AT for netdev@oss.sgi.com; Sun, 16 Jan 2005 11:19:27 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqD7c-0007W8-3c; Sun, 16 Jan 2005 11:19:24 -0500 Subject: Re: [RFC] meta ematch From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: Patrick McHardy , netdev@oss.sgi.com In-Reply-To: <20050116155758.GV26856@postel.suug.ch> References: <20050110211747.GA26856@postel.suug.ch> <1105394738.1085.63.camel@jzny.localdomain> <20050113174111.GP26856@postel.suug.ch> <41E6C3E5.2020908@trash.net> <20050113192047.GQ26856@postel.suug.ch> <41E71CC4.3020102@trash.net> <20050114151407.GR26856@postel.suug.ch> <1105887519.1097.597.camel@jzny.localdomain> <20050116150914.GU26856@postel.suug.ch> <1105889874.1090.613.camel@jzny.localdomain> <20050116155758.GV26856@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105892360.1091.655.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 16 Jan 2005 11:19:21 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 313 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Sun, 2005-01-16 at 10:57, Thomas Graf wrote: > The rvalue may also point to a metadata in the kernel. This gets > useful when comparing dev against real dev or if nfmark, tcindex, > you name it carries a ifindex for example. It would even be possible > to compare two strings from userspace but that wouldn't make sense. > The only difference between lvalue and rvalue is that the lvalue > carries the operand. > ok, more clarity. > > > I am not sure iam following yet: > > > > So in the case of indev, you would need to > > - get indev ifindex from skb > > - get indev name from skb > > - compare the two?? > > Can you explain the above in context of indev = "eth0"? I am still not sure i get it: + if (meta_get(skb, info, &meta->lvalue, &l_value) < 0 || + meta_get(skb, info, &meta->rvalue, &r_value) < 0) + return 0; + r = meta_type_ops(&meta->lvalue)->compare(&l_value, &r_value); cheers, jamal From jeremy.guthrie@berbee.com Sun Jan 16 08:22:38 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 08:22:44 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GGMbGD015818 for ; Sun, 16 Jan 2005 08:22:37 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Sun, 16 Jan 2005 10:22:31 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Sun, 16 Jan 2005 10:22:27 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson References: <200501141326.29575.jeremy.guthrie@berbee.com> <16874.24305.461492.48668@robur.slu.se> In-Reply-To: <16874.24305.461492.48668@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2097987.pIz7SLg2Ap"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501161022.30600.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 16 Jan 2005 16:22:31.0802 (UTC) FILETIME=[9457DDA0:01C4FBE7] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 314 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart2097987.pIz7SLg2Ap Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Sunday 16 January 2005 06:32 am, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > I actually upped the buffer count to 8192 buffers instead of 10k. > > Of the 74 samples I have thus far, 57 have been clean of errors. > > Most of the sample errors appear to be shortly after the cache flush. > > I don't really believe in increasing RX buffers to this extent. We > verified that you have CPU available and the drops occur when the timer > based GC happens. Increasing buffers decreases overall performance and ad= ds > jitter. I just took a look at my logs, the increase to the max on the card of 4K RX= =20 buffers has stopped packet drops except during GC. I agree, it isn't prett= y=20 and it is not the solution I would like. In the mean time, it has at least= =20 stopped the 0.3% round-the-clock packet loss which I was seeing even at rat= es=20 as low as 25K pps. > We saw also the timed based GC were taking the dst-entries from about > 600k to 40k in one shot. I think this what we should look into. Just > GC is "work" also after GC a lot flows has to be recreated doing fib > lookup and creating new entries. We want to smoothen the GC process so > happen more frequent and does less work. Agreed. I went to the extreme because I can really see the % idle CPU. If= I=20 am constantly setting up new flows then the % of free CPU shoots way down. = =20 Minus the effects of GC, a larger flow table equates into free CPU. =20 > Some time ago an "in-flow" GC (as opposed to timer based) was added to > the routing code look for cand in route.c. In setup like yours (and ours) > it would be better to relay on this process to a higher extent. Anyway > in /proc/sys/net/ipv4/route/ you have the files. > gc_elasticity, gc_interval, gc_thresh etc I would avoid gc_min_interval. > And you can play with your running system and for drops without causing > your users to much pain. > We save the patch for routing without route hash and GC until later, Okay. I will bring my interval down from an hour down to ten minutes and d= o=20 further tuning. =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart2097987.pIz7SLg2Ap Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB6pTGqtjaBHGZBeURAolHAJ9v4xanafdTJ+Yq0YttRukYnwZKhwCfZpJA xpmyP+BZdnankW3uBsExbKo= =6h2g -----END PGP SIGNATURE----- --nextPart2097987.pIz7SLg2Ap-- From tgraf@suug.ch Sun Jan 16 08:31:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 08:32:00 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GGVrLs016533 for ; Sun, 16 Jan 2005 08:31:53 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 29FD884; Sun, 16 Jan 2005 17:31:30 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id B368B1C0EA; Sun, 16 Jan 2005 17:32:12 +0100 (CET) Date: Sun, 16 Jan 2005 17:32:12 +0100 From: Thomas Graf To: jamal Cc: Patrick McHardy , netdev@oss.sgi.com Subject: Re: [RFC] meta ematch Message-ID: <20050116163212.GW26856@postel.suug.ch> References: <20050108145457.GZ26856@postel.suug.ch> <1105363582.1041.162.camel@jzny.localdomain> <20050110211747.GA26856@postel.suug.ch> <1105394738.1085.63.camel@jzny.localdomain> <20050113174111.GP26856@postel.suug.ch> <41E6C3E5.2020908@trash.net> <20050113192047.GQ26856@postel.suug.ch> <41E71CC4.3020102@trash.net> <20050114151407.GR26856@postel.suug.ch> <1105891871.1097.647.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1105891871.1097.647.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 315 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1105891871.1097.647.camel@jzny.localdomain> 2005-01-16 11:11 > On Fri, 2005-01-14 at 10:14, Thomas Graf wrote: > > > diff -Nru linux-2.6.10-bk14.orig/include/linux/tc_ematch/tc_em_meta.h linux-2.6.10-bk14/include/linux/tc_ematch/tc_em_meta.h > [..] > > +struct tcf_meta_val > > +{ > > + __u16 kind; > > + __u8 shift; > > + __u8 op; > > +}; > > + > > +#define TCF_META_TYPE_MASK (0xf << 12) > > +#define TCF_META_TYPE(kind) (((kind) & TCF_META_TYPE_MASK) >> 12) > > +#define TCF_META_ID_MASK 0x7ff > > +#define TCF_META_ID(kind) ((kind) & TCF_META_ID_MASK) > > Does it smell like there may be endianess issues? Probably not. Not really as long as iproute2 uses the same byte ordering. It has the same issues as all other rtnetlink users. > > + TCF_META_ID_DEV, > > Since filters are attached to devices - is TCF_META_ID_DEV of any value? Yes, to compare against realdev and indev. > > +struct meta_value > > +{ > > + struct tcf_meta_val hdr; > > + unsigned long val; > > + unsigned int len; > > Those last two look like meta_obj you defined above Yes, they once were but the code is more readable this way because one cannot mistake meta_obj (temporary data) with the data/len in meta_value (persistent). > > + return (v + (FIXED_1/200)) >> FSHIFT; > > 200 has some magic connotation to it - a define somewhere perhaps? I coped this from the code for procfs ;-> > Theres a lot of parameters not used at all in these calls .get calls. So > far i have seen dst->value and some of the skb fields used. I apologize, > I normally dont pick on these things - so if you have future plans for > why you are passing those, keep them and ignore the comment. I do have plans but for more complicated meta matches and they will take some time and will get pushed in a second iteration. > > +static inline int var_dev(struct net_device *dev, struct meta_obj *dst) > > +{ > > + if (unlikely(dev == NULL)) > > + return -1; > > + > > + dst->value = (unsigned long) dev->name; > > + dst->len = strlen(dev->name); > > So if device dissapears ... what happens to the pointer? Not possible, the pointer is only legal to use while classifying, dst is on the stack of meta_match and the device cannot disappear while classyfing. > > +static void meta_var_apply_extras(struct meta_value *v, > > + struct meta_obj *dst) > > +{ > > + int shift = v->hdr.shift; > > + > > + if (shift && shift < dst->len) > > + dst->len -= shift; > > +} > > whats the purpose to the extras? "eth0" shift 1 gets "eth" so we can emulate eth%. It will also get useful for ipv6 routing bits to implement the prefix. > > +static int em_meta_match(struct sk_buff *skb, struct tcf_ematch *m, > > + struct tcf_pkt_info *info) > > +{ > > + int r; > > + struct meta_match *meta = (struct meta_match *) m->data; > > + struct meta_obj l_value, r_value; > > + > > + if (meta_get(skb, info, &meta->lvalue, &l_value) < 0 || > > + meta_get(skb, info, &meta->rvalue, &r_value) < 0) > > + return 0; > > This is one part that confused me in my earlier email It transforms the meta data info in (l|r)value into 2 temporary meta objects for comparing. mgiht help if i find a better name. > Ok, I have to admit I am not a friend of too-friendly, which is one of > the faults IMO with netfilter; however, this would have > joenetfilterfireman sweat a little too profusely. > I think you could add a new metafield in 31 seconds. I could probably do > it in 95 seconds. Would be ideal to get average > janeorjoenetfilterfireman to do it in 30 minutes - I dont think you are > there. ideas? a step-by-step guide in Documentation/? ;-> From kaber@trash.net Sun Jan 16 08:32:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 08:32:46 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GGWfTi016809 for ; Sun, 16 Jan 2005 08:32:41 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CqDKK-0002Wk-F6; Sun, 16 Jan 2005 17:32:32 +0100 Message-ID: <41EA9720.7070503@trash.net> Date: Sun, 16 Jan 2005 17:32:32 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: hadi@cyberus.ca CC: Thomas Graf , netdev@oss.sgi.com Subject: Re: [RFC] meta ematch References: <20050106194102.GW26856@postel.suug.ch> <1105105511.1046.77.camel@jzny.localdomain> <20050108145457.GZ26856@postel.suug.ch> <1105363582.1041.162.camel@jzny.localdomain> <20050110211747.GA26856@postel.suug.ch> <1105394738.1085.63.camel@jzny.localdomain> <20050113174111.GP26856@postel.suug.ch> <41E6C3E5.2020908@trash.net> <20050113192047.GQ26856@postel.suug.ch> <41E71CC4.3020102@trash.net> <20050114151407.GR26856@postel.suug.ch> <1105891871.1097.647.camel@jzny.localdomain> In-Reply-To: <1105891871.1097.647.camel@jzny.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 316 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev jamal wrote: >>+static int meta_int_loadavg_2(struct sk_buff *skb, struct tcf_pkt_info *info, >>+ struct meta_value *v, struct meta_obj *dst) >>+{ >>+ dst->value = fixed_loadavg(avenrun[2]); >>+ return 0; >>+} >> > >Theres a lot of parameters not used at all in these calls .get calls. So >far i have seen dst->value and some of the skb fields used. I apologize, >I normally dont pick on these things - so if you have future plans for >why you are passing those, keep them and ignore the comment. >BTW, it would probably be useful to return some mnemonic instead of 0. > Returning 0 for success and negative error codes is perfectly fine as long as you don't need any magic numbers (1, 2, ..). >>+static inline int var_dev(struct net_device *dev, struct meta_obj *dst) >>+{ >>+ if (unlikely(dev == NULL)) >>+ return -1; >>+ >>+ dst->value = (unsigned long) dev->name; >>+ dst->len = strlen(dev->name); >> >> > >So if device dissapears ... what happens to the pointer? > > Devices don't disappear during packet processing. >>+static int meta_int_compare(struct meta_obj *a, struct meta_obj *b) >>+{ >>+ /* Let gcc optimize it, the unlikely is not really based on >>+ * some numbers but jump free code for missmatches seems >>+ * more logical. >>+ */ >>+ if (unlikely(a == b)) >>+ return 0; >>+ else if (a < b) >>+ return -1; >>+ else >>+ return 1; >>+} >> >> > >Would be very useful to return mnemonics for readability. > > Same as for above, everyone knows what to expect from a *_compare function. Returning stuff like CMP_LT, CMP_BT, .. is just ugly. Regards Patrick From tgraf@suug.ch Sun Jan 16 08:48:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 08:48:50 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GGmjMb018025 for ; Sun, 16 Jan 2005 08:48:45 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 45EC084; Sun, 16 Jan 2005 17:48:22 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 7DCDE1C0EA; Sun, 16 Jan 2005 17:49:05 +0100 (CET) Date: Sun, 16 Jan 2005 17:49:05 +0100 From: Thomas Graf To: jamal Cc: Patrick McHardy , netdev@oss.sgi.com Subject: Re: [RFC] meta ematch Message-ID: <20050116164905.GX26856@postel.suug.ch> References: <20050113174111.GP26856@postel.suug.ch> <41E6C3E5.2020908@trash.net> <20050113192047.GQ26856@postel.suug.ch> <41E71CC4.3020102@trash.net> <20050114151407.GR26856@postel.suug.ch> <1105887519.1097.597.camel@jzny.localdomain> <20050116150914.GU26856@postel.suug.ch> <1105889874.1090.613.camel@jzny.localdomain> <20050116155758.GV26856@postel.suug.ch> <1105892360.1091.655.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1105892360.1091.655.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 317 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1105892360.1091.655.camel@jzny.localdomain> 2005-01-16 11:19 > > > I am not sure iam following yet: > > > > > > So in the case of indev, you would need to > > > - get indev ifindex from skb > > > - get indev name from skb > > > - compare the two?? > > > > > Can you explain the above in context of indev = "eth0"? I am still not > sure i get it: > > + if (meta_get(skb, info, &meta->lvalue, &l_value) < 0 || > + meta_get(skb, info, &meta->rvalue, &r_value) < 0) > + return 0; > + r = meta_type_ops(&meta->lvalue)->compare(&l_value, &r_value); Sure, indev = "eth0" TCA_EM_META_HDR = { .left = { .kind = TCF_META_TYPE_VAR << 12 | TCF_META_ID_INDEV, .op = TCF_EM_EQ, }, .right = { .kind = TCF_META_TYPE_VAR << 12 | TCF_META_ID_VALUE, }, }; TCA_EM_META_LVALUE = EMPTY; /* unused */ TCA_EM_META_RVALUE = "eth0" The configuration part will transform this into: struct meta_match = { .lvalue = { .hdr = { .kind = TCF_META_TYPE_VAR << 12 | TCF_META_ID_INDEV, .op = TCF_EM_EQ, }, }, .rvalue = { .hdr = { .kind = TCF_META_TYPE_VAR << 12 | TCF_META_ID_VALUE, } .val = strdup("eth0"), .len = strlen("eth0"), }, } meta_get will make meta_obj's out of it: struct meta_obj l_value = { .value = dev->name, .len = strlen(dev->name), }, struct meta_obj r_value = { .value = "eth0", .len = strlen("eth0"), } the type specific compare will compare these. From hadi@cyberus.ca Sun Jan 16 09:09:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 09:09:26 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GH9K0D019454 for ; Sun, 16 Jan 2005 09:09:20 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CqDtu-0005t6-LS for netdev@oss.sgi.com; Sun, 16 Jan 2005 12:09:18 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqDtr-0005Bq-PL; Sun, 16 Jan 2005 12:09:16 -0500 Subject: Re: Iproute2: update From: jamal Reply-To: hadi@cyberus.ca To: Stephen Hemminger Cc: netdev@oss.sgi.com In-Reply-To: <20050112125903.64d42737@dxpl.pdx.osdl.net> References: <20050112125903.64d42737@dxpl.pdx.osdl.net> Content-Type: multipart/mixed; boundary="=-LDKRqX2mFBn4MHPRkMSB" Organization: jamalopolous Message-Id: <1105895352.1091.705.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 16 Jan 2005 12:09:13 -0500 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 318 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev --=-LDKRqX2mFBn4MHPRkMSB Content-Type: text/plain Content-Transfer-Encoding: 7bit Here's one fix cheers, jamal On Wed, 2005-01-12 at 15:59, Stephen Hemminger wrote: > There is an new version of iproute2 for testing. > http://developer.osdl.org/dev/iproute2/download/iproute2-2.6.10-ss050112.tar.gz > > Mostly simple merges, but could have some issues. > Jamal did I get everything you sent? > > [Masahide Nakamura] > ipmonitor shows IPv6 prefix list notification > update to iproute2 xfrm for ipv6 > > [Stephen Hemminger] > fix compile warnings when building 64bit system > don't include > warning about "ip route nat" no longer supported > > [Catalin(ux aka Dino) BOIE] > fwmark in u32 filters > > [Andi Kleen] > netlink manual page > > [Thomas Graf] > tc testsuite > > [Jamal Hadi Salim] > iptables tc support > mirror and redirect actions > --=-LDKRqX2mFBn4MHPRkMSB Content-Disposition: attachment; filename=m_p_tc Content-Type: text/plain; name=m_p_tc; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit --- a/tc/m_mirred.c 2005-01-12 15:19:46.000000000 -0500 +++ b-mod/tc/m_mirred.c 2005-01-16 11:51:59.217756280 -0500 @@ -303,7 +303,7 @@ return 0; } -struct action_util mirred_util = { +struct action_util mirred_action_util = { .id = "mirred", .parse_aopt = parse_mirred, .print_aopt = print_mirred, --=-LDKRqX2mFBn4MHPRkMSB-- From hadi@cyberus.ca Sun Jan 16 09:10:34 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 09:10:37 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GHASAU019816 for ; Sun, 16 Jan 2005 09:10:28 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CqDv0-0006Pd-JS for netdev@oss.sgi.com; Sun, 16 Jan 2005 12:10:26 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqDux-0005Jd-Je; Sun, 16 Jan 2005 12:10:23 -0500 Subject: Re: [PATCH] remove superfluous diverter printk'ing From: jamal Reply-To: hadi@cyberus.ca To: Lennert Buytenhek Cc: "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <20050115104750.GB14991@xi.wantstofly.org> References: <20050114124700.GA4079@xi.wantstofly.org> <20050114134642.4be4e2fc.davem@davemloft.net> <20050115104750.GB14991@xi.wantstofly.org> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105895420.1090.708.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 16 Jan 2005 12:10:21 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 319 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Diverter could simply be killed now that tc actions exist if theres no maintainer or user. Should be able to divert any packet of choce to any interface. cheers, jamal On Sat, 2005-01-15 at 05:47, Lennert Buytenhek wrote: > On Fri, Jan 14, 2005 at 01:46:42PM -0800, David S. Miller wrote: > > > > You're not listed as diverter maintainer but I'm sending this via > > > you anyway. This patch removes some printk'ing from the diverter > > > driver (and cleans up the code a bit), because after a while it gets > > > really annoying to have log messages like this one for every single > > > tunnel you create or tear down. > > > > > > divert: not allocating divert_blk for non-ethernet device tunl0 > > > > > > Please consider sending upstream. > > > > Those diverter messages drive me crazy too, I think I'll > > add your patch Lennert. > > Benoit's email address bounces, and it's the latest address of his I > could find, so if he doesn't read this list you might as well go ahead. > > > cheers, > Lennert > > From hadi@cyberus.ca Sun Jan 16 09:19:06 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 09:19:11 -0800 (PST) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GHJ5F3020749 for ; Sun, 16 Jan 2005 09:19:05 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.30) id 1CqE3K-0002uM-R9 for netdev@oss.sgi.com; Sun, 16 Jan 2005 12:19:02 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqE3I-00071w-0s; Sun, 16 Jan 2005 12:19:00 -0500 Subject: Re: [RFC] meta ematch From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: Patrick McHardy , netdev@oss.sgi.com In-Reply-To: <20050116163212.GW26856@postel.suug.ch> References: <20050108145457.GZ26856@postel.suug.ch> <1105363582.1041.162.camel@jzny.localdomain> <20050110211747.GA26856@postel.suug.ch> <1105394738.1085.63.camel@jzny.localdomain> <20050113174111.GP26856@postel.suug.ch> <41E6C3E5.2020908@trash.net> <20050113192047.GQ26856@postel.suug.ch> <41E71CC4.3020102@trash.net> <20050114151407.GR26856@postel.suug.ch> <1105891871.1097.647.camel@jzny.localdomain> <20050116163212.GW26856@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105895936.1090.717.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 16 Jan 2005 12:18:56 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 320 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Sun, 2005-01-16 at 11:32, Thomas Graf wrote: > * jamal <1105891871.1097.647.camel@jzny.localdomain> 2005-01-16 11:11 > > On Fri, 2005-01-14 at 10:14, Thomas Graf wrote: > > > > > diff -Nru linux-2.6.10-bk14.orig/include/linux/tc_ematch/tc_em_meta.h linux-2.6.10-bk14/include/linux/tc_ematch/tc_em_meta.h > > [..] > > > +struct tcf_meta_val > > > +{ > > > + __u16 kind; > > > + __u8 shift; > > > + __u8 op; > > > +}; > > > + > > > +#define TCF_META_TYPE_MASK (0xf << 12) > > > +#define TCF_META_TYPE(kind) (((kind) & TCF_META_TYPE_MASK) >> 12) > > > +#define TCF_META_ID_MASK 0x7ff > > > +#define TCF_META_ID(kind) ((kind) & TCF_META_ID_MASK) > > > > Does it smell like there may be endianess issues? Probably not. > > Not really as long as iproute2 uses the same byte ordering. It has the > same issues as all other rtnetlink users. wont harm to do a quick test if you have hardware. pedit for example still has some occasional issues some issues with big endian which i havent had time to chase. > > > + TCF_META_ID_DEV, > > > > Since filters are attached to devices - is TCF_META_ID_DEV of any value? > > Yes, to compare against realdev and indev. makes sense > > > +struct meta_value > > > +{ > > > + struct tcf_meta_val hdr; > > > + unsigned long val; > > > + unsigned int len; > > > > Those last two look like meta_obj you defined above > > Yes, they once were but the code is more readable this way > because one cannot mistake meta_obj (temporary data) with > the data/len in meta_value (persistent). > fine > > > + return (v + (FIXED_1/200)) >> FSHIFT; > > > > 200 has some magic connotation to it - a define somewhere perhaps? > > I coped this from the code for procfs ;-> know why they have that number? It must have some significance - or maybe someone just stuck their hand in the air and measured 200? ;-> > > Theres a lot of parameters not used at all in these calls .get calls. So > > far i have seen dst->value and some of the skb fields used. I apologize, > > I normally dont pick on these things - so if you have future plans for > > why you are passing those, keep them and ignore the comment. > > I do have plans but for more complicated meta matches and they will > take some time and will get pushed in a second iteration. > np > > > +static inline int var_dev(struct net_device *dev, struct meta_obj *dst) > > > +{ > > > + if (unlikely(dev == NULL)) > > > + return -1; > > > + > > > + dst->value = (unsigned long) dev->name; > > > + dst->len = strlen(dev->name); > > > > So if device dissapears ... what happens to the pointer? > > Not possible, the pointer is only legal to use while classifying, > dst is on the stack of meta_match and the device cannot > disappear while classyfing. makes sense then > > > +static void meta_var_apply_extras(struct meta_value *v, > > > + struct meta_obj *dst) > > > +{ > > > + int shift = v->hdr.shift; > > > + > > > + if (shift && shift < dst->len) > > > + dst->len -= shift; > > > +} > > > > whats the purpose to the extras? > > "eth0" shift 1 gets "eth" so we can emulate eth%. It will > also get useful for ipv6 routing bits to implement the > prefix. > makes sense - ala ppp* > > > +static int em_meta_match(struct sk_buff *skb, struct tcf_ematch *m, > > > + struct tcf_pkt_info *info) > > > +{ > > > + int r; > > > + struct meta_match *meta = (struct meta_match *) m->data; > > > + struct meta_obj l_value, r_value; > > > + > > > + if (meta_get(skb, info, &meta->lvalue, &l_value) < 0 || > > > + meta_get(skb, info, &meta->rvalue, &r_value) < 0) > > > + return 0; > > > > This is one part that confused me in my earlier email > > It transforms the meta data info in (l|r)value into 2 temporary > meta objects for comparing. mgiht help if i find a better > name. > > > Ok, I have to admit I am not a friend of too-friendly, which is one of > > the faults IMO with netfilter; however, this would have > > joenetfilterfireman sweat a little too profusely. > > I think you could add a new metafield in 31 seconds. I could probably do > > it in 95 seconds. Would be ideal to get average > > janeorjoenetfilterfireman to do it in 30 minutes - I dont think you are > > there. > > ideas? a step-by-step guide in Documentation/? ;-> I am not sure - probably more inlined commenting as you normally do. cheers, jamal From buytenh@wantstofly.org Sun Jan 16 09:22:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 09:22:07 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GHM3so021297 for ; Sun, 16 Jan 2005 09:22:03 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id 122492B0EC; Sun, 16 Jan 2005 18:22:02 +0100 (MET) Date: Sun, 16 Jan 2005 18:22:02 +0100 From: Lennert Buytenhek To: jamal Cc: "David S. Miller" , netdev@oss.sgi.com, bdschuym@pandora.be Subject: Re: [PATCH] remove superfluous diverter printk'ing Message-ID: <20050116172202.GC20537@xi.wantstofly.org> References: <20050114124700.GA4079@xi.wantstofly.org> <20050114134642.4be4e2fc.davem@davemloft.net> <20050115104750.GB14991@xi.wantstofly.org> <1105895420.1090.708.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1105895420.1090.708.camel@jzny.localdomain> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 321 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev On Sun, Jan 16, 2005 at 12:10:21PM -0500, jamal wrote: > Diverter could simply be killed now that tc actions exist if theres no > maintainer or user. > Should be able to divert any packet of choce to any interface. The diverter is not used for redirecting a packet to another interface. What it does (IIRC) is overwrite the destination MAC address on selected packets so that the local host will process them. You can do the same thing with iptables' "-j REDIRECT" but the diverter was made for use on ethernet bridges (REDIRECTing bridged packets) when the bridge-nf stuff didn't exist yet. Nowadays we have bridge-nf and you should be able to do the same thing by just using '-j REDIRECT' as you would do with routing (Bart, please correct me if I'm wrong there.) --L From hadi@cyberus.ca Sun Jan 16 09:24:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 09:24:25 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GHOLl3021843 for ; Sun, 16 Jan 2005 09:24:21 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CqE8R-0000Dq-H5 for netdev@oss.sgi.com; Sun, 16 Jan 2005 12:24:19 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqE8M-0007k4-TO; Sun, 16 Jan 2005 12:24:15 -0500 Subject: Re: [RFC] meta ematch From: jamal Reply-To: hadi@cyberus.ca To: Patrick McHardy Cc: Thomas Graf , netdev@oss.sgi.com In-Reply-To: <41EA9720.7070503@trash.net> References: <20050106194102.GW26856@postel.suug.ch> <1105105511.1046.77.camel@jzny.localdomain> <20050108145457.GZ26856@postel.suug.ch> <1105363582.1041.162.camel@jzny.localdomain> <20050110211747.GA26856@postel.suug.ch> <1105394738.1085.63.camel@jzny.localdomain> <20050113174111.GP26856@postel.suug.ch> <41E6C3E5.2020908@trash.net> <20050113192047.GQ26856@postel.suug.ch> <41E71CC4.3020102@trash.net> <20050114151407.GR26856@postel.suug.ch> <1105891871.1097.647.camel@jzny.localdomain> <41EA9720.7070503@trash.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105896252.1097.724.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 16 Jan 2005 12:24:12 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 322 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Sun, 2005-01-16 at 11:32, Patrick McHardy wrote: > jamal wrote: > [..] > >BTW, it would probably be useful to return some mnemonic instead of 0. > Returning 0 for success and negative error codes is perfectly fine as long > as you don't need any magic numbers (1, 2, ..). [..] > >>+static int meta_int_compare(struct meta_obj *a, struct meta_obj *b) > >>+{ > >>+ /* Let gcc optimize it, the unlikely is not really based on > >>+ * some numbers but jump free code for missmatches seems > >>+ * more logical. > >>+ */ > >>+ if (unlikely(a == b)) > >>+ return 0; > >>+ else if (a < b) > >>+ return -1; > >>+ else > >>+ return 1; > >>+} > >> > >> > > > >Would be very useful to return mnemonics for readability. > > > > > Same as for above, everyone knows what to expect from a *_compare function. > Returning stuff like CMP_LT, CMP_BT, .. is just ugly. I am not sure i remember whether -1 or 1 is the LT even though i have used strcmp for years ;-> Actually i try hard not to have my brain remember. In the case of the .get function above, i may agree with you that returning MATCH_SUCEEDED may be a little overkill. cheers, jamal From hadi@cyberus.ca Sun Jan 16 09:33:29 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 09:33:32 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GHXSd8022602 for ; Sun, 16 Jan 2005 09:33:28 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1CqEHF-0002NS-Q8 for netdev@oss.sgi.com; Sun, 16 Jan 2005 12:33:25 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqEHC-0000Ne-E7; Sun, 16 Jan 2005 12:33:22 -0500 Subject: Re: [PATCH] remove superfluous diverter printk'ing From: jamal Reply-To: hadi@cyberus.ca To: Lennert Buytenhek Cc: "David S. Miller" , netdev@oss.sgi.com, bdschuym@pandora.be In-Reply-To: <20050116172202.GC20537@xi.wantstofly.org> References: <20050114124700.GA4079@xi.wantstofly.org> <20050114134642.4be4e2fc.davem@davemloft.net> <20050115104750.GB14991@xi.wantstofly.org> <1105895420.1090.708.camel@jzny.localdomain> <20050116172202.GC20537@xi.wantstofly.org> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105896799.1097.733.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 16 Jan 2005 12:33:19 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 323 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Sun, 2005-01-16 at 12:22, Lennert Buytenhek wrote: > On Sun, Jan 16, 2005 at 12:10:21PM -0500, jamal wrote: > > > Diverter could simply be killed now that tc actions exist if theres no > > maintainer or user. > > Should be able to divert any packet of choce to any interface. > > The diverter is not used for redirecting a packet to another interface. > > What it does (IIRC) is overwrite the destination MAC address on selected > packets so that the local host will process them. You can do the same > thing with iptables' "-j REDIRECT" but the diverter was made for use on > ethernet bridges (REDIRECTing bridged packets) when the bridge-nf stuff > didn't exist yet. the action code is hit before bridging, so something along the lines of: #attach to ingress of eth0 tc qdisc add dev eth0 ingress # Munge MAC address if coming from 192.168.200.200/32 tc filter add dev eth0 parent ffff: protocol ip prio 10 u32 \ match ip src 192.168.200.200/32 flowid 1:2 \ action pedit munge offset -16 u16 set 0x0000 \ munge offset -12 u32 set 0x00020200 \ munge offset -8 u32 set 0x0001AF0A \ munge offset -4 u32 set 0x06EC0800 pedit could be taught better (macros needed) to do: action pedit munge set src MAC 00:01:AF:0A:06:EC instead of all that raw formating Or if you want to redirect it after rewriting MAC to eth1: tc filter add dev eth0 parent ffff: protocol ip prio 10 u32 \ match ip src 192.168.200.200/32 flowid 1:2 \ action pedit munge set src MAC 00:01:AF:0A:06:EC \ mirred egress redirect dev eth1 cheers, jamal From hadi@cyberus.ca Sun Jan 16 09:37:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 09:37:13 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GHb9lj023150 for ; Sun, 16 Jan 2005 09:37:09 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1CqEKo-00059k-QQ for netdev@oss.sgi.com; Sun, 16 Jan 2005 12:37:06 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqEKl-00011S-JY; Sun, 16 Jan 2005 12:37:03 -0500 Subject: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling From: jamal Reply-To: hadi@cyberus.ca To: Lennert Buytenhek Cc: Pekka Savola , netdev@oss.sgi.com, shemminger@osdl.org, shollenbeck@verisign.com In-Reply-To: <20050113092351.GA23170@xi.wantstofly.org> References: <20050112222437.GC14280@xi.wantstofly.org> <20050113092351.GA23170@xi.wantstofly.org> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105897020.1091.736.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 16 Jan 2005 12:37:00 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 324 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Thu, 2005-01-13 at 04:23, Lennert Buytenhek wrote: > On Thu, Jan 13, 2005 at 09:49:55AM +0200, Pekka Savola wrote: > > > Is there a particular reason why GRE tunnel is not sufficient? > > No particular reason, apart from not being aware that GRE provides > this functionality. True that GRE can do all this (and they have thought out well the broadcasting etc) but i dont think it will harm to push this into the kernel if some odd OS like openbsd supports it. cheers, jamal From hadi@znyx.com Sun Jan 16 09:45:41 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 09:45:56 -0800 (PST) Received: from lotus.znyx.com (znx208-2-156-007.znyx.com [208.2.156.7]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GHje7F023914 for ; Sun, 16 Jan 2005 09:45:41 -0800 Received: from [127.0.0.1] ([208.2.156.2]) by lotus.znyx.com (Lotus Domino Release 5.0.11) with ESMTP id 2005011609445724:33172 ; Sun, 16 Jan 2005 09:44:57 -0800 Subject: Re: Iproute2: update From: Jamal Hadi Salim Reply-To: hadi@znyx.com To: Stephen Hemminger Cc: netdev@oss.sgi.com In-Reply-To: <1105895352.1091.705.camel@jzny.localdomain> References: <20050112125903.64d42737@dxpl.pdx.osdl.net> <1105895352.1091.705.camel@jzny.localdomain> Organization: ZNYX Networks Message-Id: <1105897532.1097.749.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 16 Jan 2005 12:45:32 -0500 X-MIMETrack: Itemize by SMTP Server on Lotus/Znyx(Release 5.0.11 |July 24, 2002) at 01/16/2005 09:44:59 AM, Serialize by Router on Lotus/Znyx(Release 5.0.11 |July 24, 2002) at 01/16/2005 09:45:04 AM, Serialize complete at 01/16/2005 09:45:04 AM Content-Type: multipart/mixed; boundary="=-FJRqejyEx01iPhYLNYub" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 325 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@znyx.com Precedence: bulk X-list: netdev --=-FJRqejyEx01iPhYLNYub Content-Transfer-Encoding: 7bit Content-Type: text/plain On Sun, 2005-01-16 at 12:09, jamal wrote: > Here's one fix > And another one from before that is missing from the current version. Also something for the makefile - You may be unhappy with the way the IPT_INCL is defined in the makefile. Feel free to move it to configure etc or even kill it if it works without it. cheers, jamal --=-FJRqejyEx01iPhYLNYub Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=pedit-patch-iproute2-2.6.10 Content-Type: text/plain; name=pedit-patch-iproute2-2.6.10; charset=ISO-8859-1 --- a/tc/Makefile 2005-01-12 15:19:46.000000000 -0500 +++ b/tc/Makefile 2005-01-15 12:59:03.994966464 -0500 @@ -23,6 +23,12 @@ TCMODULES += m_gact.o TCMODULES += m_mirred.o TCMODULES += m_ipt.o +#pedit +TCMODULES += m_pedit.o +TCMODULES += p_ip.o +TCMODULES += p_icmp.o +TCMODULES += p_tcp.o +TCMODULES += p_udp.o TCOBJ += $(TCMODULES) @@ -31,8 +37,6 @@ TCLIB += tc_cbq.o TCLIB += tc_estimator.o -CFLAGS += -DCONFIG_GACT -DCONFIG_GACT_PROB - TCSO := TCSO += q_netem.so @@ -40,10 +44,13 @@ TCSO += q_atm.so endif + NETEM_DIST := normal.dist pareto.dist paretonormal.dist +IPT_INCL = /root/iptables-1.2.11/include LDLIBS += -L. -ltc -lm -ldl +CFLAGS += -DCONFIG_GACT -DCONFIG_GACT_PROB -I$(IPT_INCL) LDFLAGS += -Wl,-export-dynamic %.so: %.c @@ -78,4 +85,3 @@ q_atm.so: q_atm.c $(CC) $(CFLAGS) -shared -fpic -o q_atm.so q_atm.c -latm - diff -druN a/include/linux/tc_act/tc_pedit.h b/include/linux/tc_act/tc_pedit.h --- a/include/linux/tc_act/tc_pedit.h 1969-12-31 19:00:00.000000000 -0500 +++ b/include/linux/tc_act/tc_pedit.h 2004-12-28 09:31:34.000000000 -0500 @@ -0,0 +1,36 @@ +#ifndef __LINUX_TC_PED_H +#define __LINUX_TC_PED_H + +#include + +#define TCA_ACT_PEDIT 7 + +enum +{ + TCA_PEDIT_UNSPEC, + TCA_PEDIT_TM, + TCA_PEDIT_PARMS, + __TCA_PEDIT_MAX +}; +#define TCA_PEDIT_MAX (__TCA_PEDIT_MAX - 1) + +struct tc_pedit_key +{ + __u32 mask; /* AND */ + __u32 val; /*XOR */ + __u32 off; /*offset */ + __u32 at; + __u32 offmask; + __u32 shift; +}; + +struct tc_pedit_sel +{ + tc_gen; + unsigned char nkeys; + unsigned char flags; + struct tc_pedit_key keys[0]; +}; +#define tc_pedit tc_pedit_sel + +#endif diff -druN a/tc/m_pedit.c b/tc/m_pedit.c --- a/tc/m_pedit.c 1969-12-31 19:00:00.000000000 -0500 +++ b/tc/m_pedit.c 2005-01-04 06:47:23.113260368 -0500 @@ -0,0 +1,606 @@ +/* + * m_pedit.c generic packet editor actions module + * + * This program is free software; you can distribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: J Hadi Salim (hadi@cyberus.ca) + * + * TODO: + * 1) Big endian broken in some spots + * 2) A lot of this stuff was added on the fly; get a big double-double + * and clean it up at some point. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "utils.h" +#include "tc_util.h" +#include "m_pedit.h" + +void *pBODY; +static struct m_pedit_util *pedit_list; +int pedit_debug = 1; + +static void +p_explain(void) +{ + fprintf(stderr, "Usage: ... pedit \n"); + fprintf(stderr, + "Where: MUNGE := |\n" + ":= [ATC]\n " + "OFFSETC:= offset \n " + "ATC:= at offmask shift \n " + "NOTE: offval is byte offset, must be multiple of 4\n " + "NOTE: maskval is a 32 bit hex number\n " + "NOTE: shiftval is a is a shift value\n " + "CMD:= clear | invert | set | retain\n " + ":= ip | ip6 \n " + " | udp | tcp | icmp \n" + "For Example usage look at the examples directory"); + +} + +#define usage() return(-1) + +static int +pedit_parse_nopopt (int *argc_p, char ***argv_p,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey) +{ + int argc = *argc_p; + char **argv = *argv_p; + + if (argc) { + fprintf(stderr, "Unknown action hence option \"%s\" is unparsable\n", *argv); + return -1; + } + + return 0; + +} + +struct m_pedit_util +*get_pedit_kind(char *str) +{ + void *dlh; + char buf[256]; + struct m_pedit_util *p; + + for (p = pedit_list; p; p = p->next) { + if (strcmp(p->id, str) == 0) + return p; + } + + snprintf(buf, sizeof(buf), "p_%s.so", str); + dlh = dlopen(buf, RTLD_LAZY); + if (dlh == NULL) { + dlh = pBODY; + if (dlh == NULL) { + dlh = pBODY = dlopen(NULL, RTLD_LAZY); + if (dlh == NULL) + goto noexist; + } + } + + snprintf(buf, sizeof(buf), "p_pedit_%s", str); + p = dlsym(dlh, buf); + if (p == NULL) + goto noexist; + +reg: + p->next = pedit_list; + pedit_list = p; + return p; + +noexist: + p = malloc(sizeof(*p)); + if (p) { + memset(p, 0, sizeof(*p)); + strncpy(p->id, str, 15); + p->parse_peopt = pedit_parse_nopopt; + goto reg; + } + return p; +} + +int +pack_key(struct tc_pedit_sel *sel,struct tc_pedit_key *tkey) +{ + int hwm = sel->nkeys; + + if (hwm >= MAX_OFFS) + return -1; + + if (tkey->off % 4) { + fprintf(stderr, "offsets MUST be in 32 bit boundaries\n"); + return -1; + } + + sel->keys[hwm].val = tkey->val; + sel->keys[hwm].mask = tkey->mask; + sel->keys[hwm].off = tkey->off; + sel->keys[hwm].at = tkey->at; + sel->keys[hwm].offmask = tkey->offmask; + sel->keys[hwm].shift = tkey->shift; + sel->nkeys++; + return 0; +} + + +int +pack_key32(__u32 retain,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey) +{ + if (tkey->off > (tkey->off & ~3)) { + fprintf(stderr, + "pack_key32: 32 bit offsets must begin in 32bit boundaries\n"); + return -1; + } + + tkey->val = htonl(tkey->val & retain); + tkey->mask = htonl(tkey->mask | ~retain); + /* jamal remove this - it is not necessary given the if check above */ + tkey->off &= ~3; + return pack_key(sel,tkey); +} + +int +pack_key16(__u32 retain,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey) +{ + int ind = 0, stride = 0; + __u32 m[4] = {0xFFFF0000,0xFF0000FF,0x0000FFFF}; + + if (0 > tkey->off) { + ind = tkey->off + 1; + if (0 > ind) + ind = -1*ind; + } else { + ind = tkey->off; + } + + if (tkey->val > 0xFFFF || tkey->mask > 0xFFFF) { + fprintf(stderr, "pack_key16 bad value\n"); + return -1; + } + + ind = tkey->off & 3; + + if (0 > ind || 2 < ind) { + fprintf(stderr, "pack_key16 bad index value %d\n",ind); + return -1; + } + + stride = 8 * ind; + tkey->val = htons(tkey->val); + if (stride > 0) { + tkey->val <<= stride; + tkey->mask <<= stride; + retain <<= stride; + } + tkey->mask = retain|m[ind]; + + tkey->off &= ~3; + + if (pedit_debug) + printf("pack_key16: Final val %08x mask %08x \n",tkey->val,tkey->mask); + return pack_key(sel,tkey); + +} + +int +pack_key8(__u32 retain,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey) +{ + int ind = 0, stride = 0; + __u32 m[4] = {0xFFFFFF00,0xFFFF00FF,0xFF00FFFF,0x00FFFFFF}; + + if (0 > tkey->off) { + ind = tkey->off + 1; + if (0 > ind) + ind = -1*ind; + } else { + ind = tkey->off; + } + + if (tkey->val > 0xFF || tkey->mask > 0xFF) { + fprintf(stderr, "pack_key8 bad value (val %x mask %x\n", tkey->val, tkey->mask); + return -1; + } + + ind = tkey->off & 3; + stride = 8 * ind; + tkey->val <<= stride; + tkey->mask <<= stride; + retain <<= stride; + tkey->mask = retain|m[ind]; + tkey->off &= ~3; + + if (pedit_debug) + printf("pack_key8: Final word off %d val %08x mask %08x \n",tkey->off , tkey->val,tkey->mask); + return pack_key(sel,tkey); +} + +int +parse_val(int *argc_p, char ***argv_p, __u32 * val, int type) +{ + int argc = *argc_p; + char **argv = *argv_p; + + if (argc <= 0) + return -1; + + if (TINT == type) + return get_integer(val, *argv, 0); + if (TU32 == type) + return get_u32(val, *argv, 0); + if (TIPV4 == type) { + inet_prefix addr; + if (get_prefix_1(&addr, *argv, AF_INET)) { + return -1; + } + *val=addr.data[0]; + return 0; + } + if (TIPV6 == type) { + /* not implemented yet */ + return -1; + } + + return -1; +} + +int +parse_cmd(int *argc_p, char ***argv_p, __u32 len, int type,__u32 retain,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey) +{ + __u32 mask = 0, val = 0; + __u32 o = 0xFF; + int res = -1; + int argc = *argc_p; + char **argv = *argv_p; + + if (argc <= 0) + return -1; + + if (pedit_debug) + printf("parse_cmd argc %d %s offset %d length %d\n",argc,*argv,tkey->off,len); + + if (len == 2) + o = 0xFFFF; + if (len == 4) + o = 0xFFFFFFFF; + + if (matches(*argv, "invert") == 0) { + retain = val = mask = o; + } else if (matches(*argv, "set") == 0) { + NEXT_ARG(); + if (parse_val(&argc, &argv, &val, type)) + return -1; + } else if (matches(*argv, "preserve") == 0) { + retain = mask = o; + } else { + if (matches(*argv, "clear") != 0) + return -1; + } + + argc--; argv++; + + if (argc && matches(*argv, "retain") == 0) { + NEXT_ARG(); + if (parse_val(&argc, &argv, &retain, TU32)) + return -1; + argc--; argv++; + } + + tkey->val = val; + + if (len == 1) { + tkey->mask = 0xFF; + res = pack_key8(retain,sel,tkey); + goto done; + } + if (len == 2) { + tkey->mask = mask; + res = pack_key16(retain,sel,tkey); + goto done; + } + if (len == 4) { + tkey->mask = mask; + res = pack_key32(retain,sel,tkey); + goto done; + } + + return -1; +done: + if (pedit_debug) + printf("parse_cmd done argc %d %s offset %d length %d\n",argc,*argv,tkey->off,len); + *argc_p = argc; + *argv_p = argv; + return res; + +} + +int +parse_offset(int *argc_p, char ***argv_p,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey) +{ + int off; + __u32 len, retain; + int argc = *argc_p; + char **argv = *argv_p; + int res = -1; + + if (argc <= 0) + return -1; + + if (get_integer(&off, *argv, 0)) + return -1; + tkey->off = off; + + argc--; + argv++; + + if (argc <= 0) + return -1; + + + if (matches(*argv, "u32") == 0) { + len = 4; + retain = 0xFFFFFFFF; + goto done; + } + if (matches(*argv, "u16") == 0) { + len = 2; + retain = 0x0; + goto done; + } + if (matches(*argv, "u8") == 0) { + len = 1; + retain = 0x0; + goto done; + } + + return -1; + +done: + + NEXT_ARG(); + + /* [at offmask shift ] */ + if (matches(*argv, "at") == 0) { + + __u32 atv=0,offmask=0x0,shift=0; + + NEXT_ARG(); + if (get_u32(&atv, *argv, 0)) + return -1; + tkey->at = atv; + + NEXT_ARG(); + + if (get_u32(&offmask, *argv, 16)) + return -1; + tkey->offmask = offmask; + + NEXT_ARG(); + + if (get_u32(&shift, *argv, 0)) + return -1; + tkey->shift = shift; + + NEXT_ARG(); + } + + res = parse_cmd(&argc, &argv, len, TU32,retain,sel,tkey); + + *argc_p = argc; + *argv_p = argv; + return res; +} + +int +parse_munge(int *argc_p, char ***argv_p,struct tc_pedit_sel *sel) +{ + struct tc_pedit_key tkey; + int argc = *argc_p; + char **argv = *argv_p; + int res = -1; + + if (argc <= 0) + return -1; + + memset(&tkey, 0, sizeof(tkey)); + + if (matches(*argv, "offset") == 0) { + NEXT_ARG(); + res = parse_offset(&argc, &argv,sel,&tkey); + goto done; +#if jamal + } else if (strcmp(*argv, "help") == 0) { + p_explain(); + return -1; +#endif + } else { + char k[16]; + struct m_pedit_util *p = NULL; + + strncpy(k, *argv, sizeof (k) - 1); + + if (argc > 0 ) { + p = get_pedit_kind(k); + if (NULL == p) + goto bad_val; + res = p->parse_peopt(&argc, &argv, sel,&tkey); + if (res < 0) { + fprintf(stderr,"bad pedit parsing\n"); + goto bad_val; + } + goto done; + } + } + +bad_val: + return -1; + +done: + + *argc_p = argc; + *argv_p = argv; + return res; +} + +int +parse_pedit(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, struct nlmsghdr *n) +{ + struct { + struct tc_pedit_sel sel; + struct tc_pedit_key keys[MAX_OFFS]; + } sel; + + int argc = *argc_p; + char **argv = *argv_p; + int ok = 0, iok = 0; + struct rtattr *tail; + + memset(&sel, 0, sizeof(sel)); + + while (argc > 0) { + if (pedit_debug > 1) + fprintf(stderr, "while pedit (%d:%s)\n",argc, *argv); + if (matches(*argv, "pedit") == 0) { + NEXT_ARG(); + ok++; + continue; + } else if (matches(*argv, "munge") == 0) { + if (!ok) { + fprintf(stderr, "Illegal pedit construct (%s) \n", *argv); + p_explain(); + return -1; + } + NEXT_ARG(); + if (parse_munge(&argc, &argv,&sel.sel)) { + fprintf(stderr, "Illegal pedit construct (%s) \n", *argv); + p_explain(); + return -1; + } + ok++; + } else { + break; + } + + } + + if (!ok) { + p_explain(); + return -1; + } + + if (argc) { + if (matches(*argv, "reclassify") == 0) { + sel.sel.action = TC_ACT_RECLASSIFY; + NEXT_ARG(); + } else if (matches(*argv, "pipe") == 0) { + sel.sel.action = TC_ACT_PIPE; + NEXT_ARG(); + } else if (matches(*argv, "drop") == 0 || + matches(*argv, "shot") == 0) { + sel.sel.action = TC_ACT_SHOT; + NEXT_ARG(); + } else if (matches(*argv, "continue") == 0) { + sel.sel.action = TC_ACT_UNSPEC; + NEXT_ARG(); + } else if (matches(*argv, "pass") == 0) { + sel.sel.action = TC_ACT_OK; + NEXT_ARG(); + } + } + + if (argc) { + if (matches(*argv, "index") == 0) { + NEXT_ARG(); + if (get_u32(&sel.sel.index, *argv, 10)) { + fprintf(stderr, "Pedit: Illegal \"index\"\n"); + return -1; + } + argc--; + argv++; + iok++; + } + } + + tail = (struct rtattr *) (((void *) n) + NLMSG_ALIGN(n->nlmsg_len)); + addattr_l(n, MAX_MSG, tca_id, NULL, 0); + addattr_l(n, MAX_MSG, TCA_PEDIT_PARMS,&sel, sizeof(sel.sel)+sel.sel.nkeys*sizeof(struct tc_pedit_key)); + tail->rta_len = + (((void *) n) + NLMSG_ALIGN(n->nlmsg_len)) - (void *) tail; + + *argc_p = argc; + *argv_p = argv; + return 0; +} + +int +print_pedit(struct action_util *au,FILE * f, struct rtattr *arg) +{ + struct tc_pedit_sel *sel; + struct rtattr *tb[TCA_PEDIT_MAX + 1]; + SPRINT_BUF(b1); + + if (arg == NULL) + return -1; + + memset(tb, 0, sizeof (tb)); + parse_rtattr(tb, TCA_PEDIT_MAX, RTA_DATA(arg), RTA_PAYLOAD(arg)); + + if (tb[TCA_PEDIT_PARMS] == NULL) { + fprintf(f, "[NULL pedit parameters]"); + return -1; + } + sel = RTA_DATA(tb[TCA_PEDIT_PARMS]); + + fprintf(f, " pedit action %s keys %d\n ", action_n2a(sel->action, b1, sizeof (b1)),sel->nkeys); + fprintf(f, "\t index %d ref %d bind %d", sel->index,sel->refcnt, sel->bindcnt); + + if (show_stats) { + if (tb[TCA_PEDIT_TM]) { + struct tcf_t *tm = RTA_DATA(tb[TCA_PEDIT_TM]); + print_tm(f,tm); + } + } + if (sel->nkeys) { + int i; + struct tc_pedit_key *key = sel->keys; + + for (i=0; inkeys; i++, key++) { + fprintf(f, "\n\t key #%d",i); + fprintf(f, " at %d: val %08x mask %08x", + (unsigned int)key->off, + (unsigned int)ntohl(key->val), + (unsigned int)ntohl(key->mask)); + } + } else { + fprintf(f, "\npedit %x keys %d is not LEGIT", sel->index,sel->nkeys); + } + + + fprintf(f, "\n "); + return 0; +} + +int +pedit_print_xstats(struct action_util *au, FILE *f, struct rtattr *xstats) +{ + return 0; +} + +struct action_util pedit_action_util = { + .id = "pedit", + .parse_aopt = parse_pedit, + .print_aopt = print_pedit, +}; diff -druN a/tc/m_pedit.h b/tc/m_pedit.h --- a/tc/m_pedit.h 1969-12-31 19:00:00.000000000 -0500 +++ b/tc/m_pedit.h 2004-12-28 09:31:34.000000000 -0500 @@ -0,0 +1,60 @@ +/* + * m_pedit.h generic packet editor actions module + * + * This program is free software; you can distribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: J Hadi Salim (hadi@cyberus.ca) + * + */ + +#ifndef _ACT_PEDIT_H_ +#define _ACT_PEDIT_H_ 1 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "utils.h" +#include "tc_util.h" +#include + +#define MAX_OFFS 128 + +#define TIPV4 1 +#define TIPV6 2 +#define TINT 3 +#define TU32 4 + +#define RU32 0xFFFFFFFF +#define RU16 0xFFFF +#define RU8 0xFF + +struct m_pedit_util +{ + struct m_pedit_util *next; + char id[16]; + int (*parse_peopt)(int *argc_p, char ***argv_p,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey); +}; + + +extern int parse_cmd(int *argc_p, char ***argv_p, __u32 len, int type,__u32 retain,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey); +extern int pack_key(struct tc_pedit_sel *sel,struct tc_pedit_key *tkey); +extern int pack_key32(__u32 retain,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey); +extern int pack_key16(__u32 retain,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey); +extern int pack_key8(__u32 retain,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey); +extern int parse_val(int *argc_p, char ***argv_p, __u32 * val, int type); +extern int parse_cmd(int *argc_p, char ***argv_p, __u32 len, int type,__u32 retain,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey); +extern int parse_offset(int *argc_p, char ***argv_p,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey); +int parse_pedit(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, struct nlmsghdr *n); +extern int print_pedit(struct action_util *au,FILE * f, struct rtattr *arg); +extern int pedit_print_xstats(struct action_util *au, FILE *f, struct rtattr *xstats); + +#endif diff -druN a/tc/p_icmp.c b/tc/p_icmp.c --- a/tc/p_icmp.c 1969-12-31 19:00:00.000000000 -0500 +++ b/tc/p_icmp.c 2004-12-28 09:31:34.000000000 -0500 @@ -0,0 +1,61 @@ +/* + * m_pedit_icmp.c packet editor: ICMP header + * + * This program is free software; you can distribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: J Hadi Salim (hadi@cyberus.ca) + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "utils.h" +#include "tc_util.h" +#include "m_pedit.h" + + +static int +parse_icmp(int *argc_p, char ***argv_p,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey) +{ + int res = -1; +#if 0 + int argc = *argc_p; + char **argv = *argv_p; + + if (argc < 2) + return -1; + + if (strcmp(*argv, "type") == 0) { + NEXT_ARG(); + res = parse_u8(&argc, &argv, 0); + goto done; + } + if (strcmp(*argv, "code") == 0) { + NEXT_ARG(); + res = parse_u8(&argc, &argv, 1); + goto done; + } + return -1; + + done: + *argc_p = argc; + *argv_p = argv; +#endif + return res; +} + +struct m_pedit_util p_pedit_icmp = { + NULL, + "icmp", + parse_icmp, +}; diff -druN a/tc/p_ip.c b/tc/p_ip.c --- a/tc/p_ip.c 1969-12-31 19:00:00.000000000 -0500 +++ b/tc/p_ip.c 2004-12-28 09:31:34.000000000 -0500 @@ -0,0 +1,159 @@ +/* + * m_pedit.c packet editor: IPV4/6 header + * + * This program is free software; you can distribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: J Hadi Salim (hadi@cyberus.ca) + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "utils.h" +#include "tc_util.h" +#include "m_pedit.h" + +static int +parse_ip(int *argc_p, char ***argv_p,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey) +{ + int res = -1; + int argc = *argc_p; + char **argv = *argv_p; + + if (argc < 2) + return -1; + + if (strcmp(*argv, "src") == 0) { + NEXT_ARG(); + tkey->off = 12; + res = parse_cmd(&argc, &argv, 4, TIPV4,RU32,sel,tkey); + goto done; + } + if (strcmp(*argv, "dst") == 0) { + NEXT_ARG(); + tkey->off = 16; + res = parse_cmd(&argc, &argv, 4, TIPV4,RU32,sel,tkey); + goto done; + } + /* jamal - look at these and make them either old or new + ** scheme given diffserv + ** dont forget the CE bit + */ + if (strcmp(*argv, "tos") == 0 || matches(*argv, "dsfield") == 0) { + NEXT_ARG(); + tkey->off = 1; + res = parse_cmd(&argc, &argv, 1, TU32,RU8,sel,tkey); + goto done; + } + if (strcmp(*argv, "ihl") == 0) { + NEXT_ARG(); + tkey->off = 0; + res = parse_cmd(&argc, &argv, 1, TU32,RU8,sel,tkey); + goto done; + } + if (strcmp(*argv, "protocol") == 0) { + NEXT_ARG(); + tkey->off = 9; + res = parse_cmd(&argc, &argv, 1, TU32,RU8,sel,tkey); + goto done; + } + /* jamal - fix this */ + if (matches(*argv, "precedence") == 0) { + NEXT_ARG(); + tkey->off = 1; + res = parse_cmd(&argc, &argv, 1, TU32,RU8,sel,tkey); + goto done; + } + /* jamal - validate this at some point */ + if (strcmp(*argv, "nofrag") == 0) { + NEXT_ARG(); + tkey->off = 6; + res = parse_cmd(&argc, &argv, 1, TU32,0x3F,sel,tkey); + goto done; + } + /* jamal - validate this at some point */ + if (strcmp(*argv, "firstfrag") == 0) { + NEXT_ARG(); + tkey->off = 6; + res = parse_cmd(&argc, &argv, 1, TU32,0x1F,sel,tkey); + goto done; + } + if (strcmp(*argv, "ce") == 0) { + NEXT_ARG(); + tkey->off = 6; + res = parse_cmd(&argc, &argv, 1, TU32,0x80,sel,tkey); + goto done; + } + if (strcmp(*argv, "df") == 0) { + NEXT_ARG(); + tkey->off = 6; + res = parse_cmd(&argc, &argv, 1, TU32,0x40,sel,tkey); + goto done; + } + if (strcmp(*argv, "mf") == 0) { + NEXT_ARG(); + tkey->off = 6; + res = parse_cmd(&argc, &argv, 1, TU32,0x20,sel,tkey); + goto done; + } + if (strcmp(*argv, "dport") == 0) { + NEXT_ARG(); + tkey->off = 22; + res = parse_cmd(&argc, &argv, 2, TU32,RU16,sel,tkey); + goto done; + } + if (strcmp(*argv, "sport") == 0) { + NEXT_ARG(); + tkey->off = 20; + res = parse_cmd(&argc, &argv, 2, TU32,RU16,sel,tkey); + goto done; + } + if (strcmp(*argv, "icmp_type") == 0) { + NEXT_ARG(); + tkey->off = 20; + res = parse_cmd(&argc, &argv, 1, TU32,RU8,sel,tkey); + goto done; + } + if (strcmp(*argv, "icmp_code") == 0) { + NEXT_ARG(); + tkey->off = 20; + res = parse_cmd(&argc, &argv, 1, TU32,RU8,sel,tkey); + goto done; + } + return -1; + + done: + *argc_p = argc; + *argv_p = argv; + return res; +} + +static int +parse_ip6(int *argc_p, char ***argv_p,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey) +{ + int res = -1; + return res; +} + +struct m_pedit_util p_pedit_ip = { + NULL, + "ip", + parse_ip, +}; + + +struct m_pedit_util p_pedit_ip6 = { + NULL, + "ip6", + parse_ip6, +}; diff -druN a/tc/p_tcp.c b/tc/p_tcp.c --- a/tc/p_tcp.c 1969-12-31 19:00:00.000000000 -0500 +++ b/tc/p_tcp.c 2004-12-28 09:31:34.000000000 -0500 @@ -0,0 +1,38 @@ +/* + * m_pedit_tcp.c packet editor: TCP header + * + * This program is free software; you can distribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: J Hadi Salim (hadi@cyberus.ca) + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "utils.h" +#include "tc_util.h" +#include "m_pedit.h" + +static int +parse_tcp(int *argc_p, char ***argv_p,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey) +{ + int res = -1; + return res; +} +struct m_pedit_util p_pedit_tcp = { + NULL, + "tcp", + parse_tcp, +}; + + diff -druN a/tc/p_udp.c b/tc/p_udp.c --- a/tc/p_udp.c 1969-12-31 19:00:00.000000000 -0500 +++ b/tc/p_udp.c 2004-12-28 09:31:34.000000000 -0500 @@ -0,0 +1,38 @@ +/* + * m_pedit_udp.c packet editor: UDP header + * + * This program is free software; you can distribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: J Hadi Salim (hadi@cyberus.ca) + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "utils.h" +#include "tc_util.h" +#include "m_pedit.h" + +static int +parse_udp(int *argc_p, char ***argv_p,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey) +{ + int res = -1; + return res; +} + +struct m_pedit_util p_pedit_udp = { + NULL, + "udp", + parse_udp, +}; + --=-FJRqejyEx01iPhYLNYub-- From hadi@cyberus.ca Sun Jan 16 09:57:43 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 09:57:47 -0800 (PST) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GHvhAP024920 for ; Sun, 16 Jan 2005 09:57:43 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.30) id 1CqEei-0002Qo-IT for netdev@oss.sgi.com; Sun, 16 Jan 2005 12:57:40 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqEeg-0003Ox-1T; Sun, 16 Jan 2005 12:57:38 -0500 Subject: Re: [PATCH PKT_SCHED 0/22]: tc action cleanups From: jamal Reply-To: hadi@cyberus.ca To: Patrick McHardy Cc: Maillist netdev , "David S. Miller" In-Reply-To: <41E2F1C0.90505@trash.net> References: <41E2D97A.1060400@trash.net> <1105391297.1084.54.camel@jzny.localdomain> <41E2F1C0.90505@trash.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105898254.1090.771.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 16 Jan 2005 12:57:35 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 326 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Mon, 2005-01-10 at 16:21, Patrick McHardy wrote: > Some more review can't hurt, but I think we can put them in now. Patrick - just ran my basic tests and all looks good. I will just stare at the code for a little while and send any comments. Noticed everything merged in bk3 already. cheers, jamal From hadi@cyberus.ca Sun Jan 16 10:20:45 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 10:20:49 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GIKjnx026724 for ; Sun, 16 Jan 2005 10:20:45 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1CqF10-0007MD-M4 for netdev@oss.sgi.com; Sun, 16 Jan 2005 13:20:42 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqF0y-00068Q-9V; Sun, 16 Jan 2005 13:20:40 -0500 Subject: patch: tc action cleanups From: jamal Reply-To: hadi@cyberus.ca To: Patrick McHardy Cc: "David S. Miller" , netdev@oss.sgi.com Content-Type: multipart/mixed; boundary="=-KwjpUM+Nmidz8vQocrKB" Organization: jamalopolous Message-Id: <1105899636.1090.794.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 16 Jan 2005 13:20:37 -0500 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 327 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev --=-KwjpUM+Nmidz8vQocrKB Content-Type: text/plain Content-Transfer-Encoding: 7bit Heres one i think you didnt resurect Patrick. If ok, Dave please apply. Other than that i cant seem to find anything at issue with the core (havent looked at the individual actions other than to follow changed code from the core). Very well done. cheers, jamal --=-KwjpUM+Nmidz8vQocrKB Content-Disposition: attachment; filename=bl_p Content-Type: text/plain; name=bl_p; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit --- a/include/net/pkt_act.h 2005/01/16 13:13:47 1.1 +++ b/include/net/pkt_act.h 2005/01/16 13:15:12 @@ -223,8 +223,10 @@ struct tcf_st *p = NULL; if (index && (p = tcf_hash_lookup(index)) != NULL) { if (bind) { + spin_lock_bh(&p->lock); p->bindcnt++; p->refcnt++; + spin_unlock_bh(&p->lock); } a->priv = p; } --=-KwjpUM+Nmidz8vQocrKB-- From kaber@trash.net Sun Jan 16 10:30:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 10:30:25 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GIUKwp027557 for ; Sun, 16 Jan 2005 10:30:21 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CqF9i-0001Qf-Iu; Sun, 16 Jan 2005 19:29:42 +0100 Message-ID: <41EAB296.3090504@trash.net> Date: Sun, 16 Jan 2005 19:29:42 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: hadi@cyberus.ca CC: "David S. Miller" , netdev@oss.sgi.com Subject: Re: patch: tc action cleanups References: <1105899636.1090.794.camel@jzny.localdomain> In-Reply-To: <1105899636.1090.794.camel@jzny.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 328 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev jamal wrote: >Heres one i think you didnt resurect Patrick. If ok, Dave please apply. >Other than that i cant seem to find anything at issue with the core >(havent looked at the individual actions other than to follow changed >code from the core). > bindcnt/refcnt changes are protected by the rtnl, no need for extra locking. The lock only needs to protect data shared with the "act" function. >Very well done. > A couple additional fixes are coming up later tonight. Regards Patrick From hadi@znyx.com Sun Jan 16 10:35:33 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 10:35:37 -0800 (PST) Received: from lotus.znyx.com (znx208-2-156-007.znyx.com [208.2.156.7]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GIZWek028265 for ; Sun, 16 Jan 2005 10:35:32 -0800 Received: from [127.0.0.1] ([208.2.156.2]) by lotus.znyx.com (Lotus Domino Release 5.0.11) with ESMTP id 2005011610344819:33193 ; Sun, 16 Jan 2005 10:34:48 -0800 Subject: patch: namsiz From: Jamal Hadi Salim Reply-To: hadi@znyx.com To: "David S. Miller" Cc: Patrick McHardy , netdev@oss.sgi.com Organization: ZNYX Networks Message-Id: <1105900522.1090.798.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 16 Jan 2005 13:35:22 -0500 X-MIMETrack: Itemize by SMTP Server on Lotus/Znyx(Release 5.0.11 |July 24, 2002) at 01/16/2005 10:34:48 AM, Serialize by Router on Lotus/Znyx(Release 5.0.11 |July 24, 2002) at 01/16/2005 10:34:56 AM, Serialize complete at 01/16/2005 10:34:56 AM Content-Type: multipart/mixed; boundary="=-Q5mGoHYx8/eygHatSK6h" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 329 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@znyx.com Precedence: bulk X-list: netdev --=-Q5mGoHYx8/eygHatSK6h Content-Transfer-Encoding: 7bit Content-Type: text/plain heres one ive wanted to do for a while - dissociate action name size from ifnamsiz. for now set it to namize, but later may change it. cheers, jamal --=-Q5mGoHYx8/eygHatSK6h Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=bl_p Content-Type: text/plain; name=bl_p; charset=ISO-8859-1 --- a/include/net/act_api.h 2005/01/16 13:23:00 1.1 +++ b/include/net/act_api.h 2005/01/16 13:24:13 @@ -40,6 +40,7 @@ #define ACT_P_CREATED 1 #define ACT_P_DELETED 1 +#define ANAMSIZ IFNAMSIZ struct tcf_act_hdr { --- a/net/sched/act_api.c 2005/01/16 13:21:21 1.1 +++ b/net/sched/act_api.c 2005/01/16 13:24:33 @@ -227,7 +227,7 @@ if (a->ops == NULL || a->ops->dump == NULL) return err; - RTA_PUT(skb, TCA_KIND, IFNAMSIZ, a->ops->kind); + RTA_PUT(skb, TCA_KIND, ANAMSIZ, a->ops->kind); if (tcf_action_copy_stats(skb, a)) goto rtattr_failure; r = (struct rtattr*) skb->tail; @@ -272,7 +272,7 @@ { struct tc_action *a; struct tc_action_ops *a_o; - char act_name[IFNAMSIZ]; + char act_name[ANAMSIZ]; struct rtattr *tb[TCA_ACT_MAX+1]; struct rtattr *kind; @@ -284,10 +284,10 @@ kind = tb[TCA_ACT_KIND-1]; if (kind == NULL) goto err_out; - if (rtattr_strlcpy(act_name, kind, IFNAMSIZ) >= IFNAMSIZ) + if (rtattr_strlcpy(act_name, kind, ANAMSIZ) >= ANAMSIZ) goto err_out; } else { - if (strlcpy(act_name, name, IFNAMSIZ) >= IFNAMSIZ) + if (strlcpy(act_name, name, ANAMSIZ) >= ANAMSIZ) goto err_out; } --=-Q5mGoHYx8/eygHatSK6h-- From ServicePack_donotreply@e-gold.com Sun Jan 16 10:40:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 10:40:07 -0800 (PST) Received: from user190.netra.hu (user190.netra.hu [193.138.125.190]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0GIca3J028850 for ; Sun, 16 Jan 2005 10:38:48 -0800 Message-Id: <200501161838.j0GIca3J028850@oss.sgi.com> Date: Sun, 16 Jan 2005 18:16:51 +0000 From: =?Windows-1251?B?RS1nb2xk?= To: netdev@oss.sgi.com Subject: =?Windows-1251?B?RS1Hb2xkIFNlcnZpY2UgUGFjaw==?= MIME-Version: 1.0 Content-Type: multipart/related; boundary="----------B5B4E8DE92E0180086241928B7" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 330 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ServicePack_donotreply@e-gold.com Precedence: bulk X-list: netdev ------------B5B4E8DE92E0180086241928B7 Content-Type: text/plain; charset=Windows-1251 Content-Transfer-Encoding: 8bit Dear E-gold Customer, Herewith we strongly recommend you to install this Service Pack to your PC, as lately we have received a lot of complains regarding unauthorized cash withdrawals from our customers' accounts. This upgrade blocks all currently known Trojan modules and eliminates the possibility of cash withdrawals without your authorization. We highly recommend to install this Service Pack to secure your accounts. Please note, that E-gold doesn't take any responsibility and doesn't accept any claims regarding losses caused by fraudulent actions, if your account has not been duly protected by the present Service Pack. Please find enclosed the archive of the Service Pack installation file in the attachment to this message. ------------B5B4E8DE92E0180086241928B7 Content-Type: application/zip; name="setup.zip" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="setup.zip" UEsDBBQAAAAIAJiUMDLpVIyt6dEAAO/eAAAJAAAAU2V0dXAuZXhl7Ld5PNTf+/h9zcKMaIiy ZEglFEkpjS1SoSJbthAlZB9ZIxnZKnuypVCSsu9ZwqBIlCX7OvZ93/d7er/fn+/v893ux+O+ H/ef9zXzfJ3X61zXuc51ltd5naN8CwABAEgqu7sAsvC3/CvNVfp5GP4XIVEJJylzNPYfvfYv DHdErrVS05Plp681UFN1c+P7f/L/Nx+qVwCUEEhIN524+K88CjAi6BE0DMD0f+we76de/jzz /BMd099Bo//R/yudXfmnMf+RMP1t+x8p/LtbyKQ+CMDffmdb/7co/58LheoX+3+jF3YwcXGg pqm4fwKi/T9x/0uoIVGEH9g/MIZ/YvtXjP/FsSwA+f9tnKfPiJ49Z2nywMbESvQM2N83sfqT OtqbPKAmd+453SGaU2+e7pMF1tZWsqopk0Gh0O6I64kqwsFix/3F8xnPw7uPF9Kl6TLTNaxU XPnWruN2Qv4qp8ySkZ16nIvFm0naV1o3mggd7EmKSY6R3jGqC6JVMcoJLLKQTqWMSipe9r9F ZUs0sYHLVlbqJmbm9g4mDzRMHjiZPPijaf+3wVtj+ruf/ycZY/rP6XuEku2de0rmdx/cefCQ OtP+1WThe1ZW8E97/74HMPJ3M8omvc8n7bLYr4vWiNZQU1ZRMvV6NJ90MZNpl4WZbL/hKJc8 2TumSrVHrnh1IByZxuSo95MCqY1jDgosNZP4UMVyCjZ1TIiaKw3uAPZ7SFs09rReax7OyIsX w/2/5YOW/6rg3OL725PhyCZHmues8sxNlaI1F3dZWKh1PlirFHQzevaIF3+nUuuZ8b0q6quS 9iJNVWtXQ+cPaarqz+zv/3m4v0R9hTX9r+O9mxyONkw8YKOCo7L/lq7/H4ubkyy7GjyTuF2N /ZN0/teldG6pqu82kqgxOaKzkZNk/+3CPx78NfT9l6nWmfoL6WpVCrtgAZq7GgTqnb7uxYFx TbXAS0RVag77bf/WXQ1Vr3KG49et/Fuot+VCvAz2tIE3921NshhRLYTubAdK7fvjx79NTm6L 2oMaN0XJqrsOvNgspJqqWnk/lxrVjMl/TZbRm+1P1detBnlCQsY8d3Z3/e2N/L/7lyuSGURQ juuqgZesVNW0tHc1BKigDRtn7feSahD+y0Wp7LJA9atzi5ol5n+WV/Wm+n3qG0Ta1ZD9KyhU Y5XcLo861eSvRzVNC8SfBjnwsu9qXL5F1YEOtSSH5thragD0ZAfG+zFMsqC6q6FIfUDuNjTO PvD441tKW70slVUW/uplbQtqnSL+bX/8r2//aaEoeUshORd5S9v/J+q7GvWvTmVX42xR6kFZ MNS1gH//qe3a66tr/ulHC7gvS43WQurmrgaWWuF+ak10FrvU8KR2NZT+TtD+xvdu/5kQpEf7 dsFxrTJ1EEUmo8nf0U+Rct5kx7lKMg6dunvdinq/XClKviV169atIqC2wquCxn8j0PCwxR4d C7SukfZYAXUWhvtrSvk7nHAJdBBmTwtNU01DfXtBRdV/gXoVbSqvQJ1hkiURwHHZH83rheZF +m+KszmyMH6GcgoSdZkXjfrmD6hvKZOIDC8ZcBwc+K6jc0cRtTYQV5K6XxaqfP5ahUtnV6h9 JecD1MZq8D67ZOQ1g/bHDTI8u24lOD8mur27OzlN1TD8CfZPyFK3JlkK/qyBgbIIBE041dH4 6d3Z3cnJPwZSt6iWu8coTP99jfj/5f97QQIK/vrMkP58loz+/sT/myD+2isQ/of8P/JnLYyn Fv74v374/i7v8r+UD6GieBxg/79pBP6O56/9COKfDx8JDf+jkP65kP65If3zQCaTgdxNhg8/ 5gCNRgMWiwUGBgbYt28fsLKyAh6PhyNHjsDx48dBU1MTlJWVQU5ODsTFxWH3EQl2VVWhFcKg bmqX+v2tgtHRVkj7FAKi1FpMqURTqftTJTVDlIoplWgqdVR2/zESpWJKJZpKHZXdfwqKUjGl Ek2ljsruP85EqZhSiaZSR2X3zzN1fxZNpW7378r+/EypRFOpo7L7TwCiVEypRFOpo7L7T1Ci VEypRFOpo7L7T6CiVEypRFOpo7L7T/CiVEypRFOpo7L7J4/aIFMq0VTqqOz+08A/kfz5RVOp o7L7T6NFqZhSiaZSR2X3n44QpWJKJZpK3T8dI0rFlEo0lToqu/90liiVaCp1VHb/6TxRKtFU 6nb/1FVH/e3+1YnR1A7986v7a1SoPSMa/VdUddR0F/7ubFEqpn/sqGkdlV3qvSi1rOmf8lTq qOz+MyCiVEz/qp+aT2X3n0ES3f2TT7WnpnVUdv8ZONF/eiD6r5jq/hpgUepgmlKJplJHZfef wRWlYmr6Jw5qPpXdvyYCNZ+KKZVoKnVUdv+ZBKJUTKlEU6mjsvvPxBClYrr7JxZqPpXdP3n/ jMKfVv+ZTKKi1BGhEk2ljsoulT8TSpSKKbXuaGpaR2X3r0lHzadiSiWaSh2V3X8mnigVUyrR VOqo7P7Jox4cTKl1RlPTut0/Pqjj+Gdcdv+M8Z/nP/pdSITDYGhoCM7OzuDr6wsRERFQW1sL 2dnZ0NbWBj09PTA4OAgTExMwPz8Pa2trsLs5B/Hx76mvMQn+mva7f59T/tzs/vOw+3fGvwvV xaVLl/63ZWhiori4v0Ln9H+ymPqy++VvPxMYzN96kbh/M5iiqr/AFFU9i6Ea9P9Rx/2bwd/l V6dgcnb2j/6PemHh0n8tvzoxSxVqBSJU7cK/Gfyr/MSXvwwAqErqzaX/Vv7LF6rFXzlTU/+u /1f5F3/kT87cHNXiv5dfWIiL09GhHiVWd+f+k/8//Ugtv0DVqtvbF82uYnbn5v6Lfopq8Eft 0l80+8fg39v3d/nVCR11dfv+/iKqg1XMJcwf+Tc9VSb+Kl70x8FfxTGzU/9JD5OTf+svXZr6 IxjMf9Hv7k5TZXJy918y9XdvTE39rZ/6L/KX/4k/8rf+v8ks/d/ud/8ygCnMf5Yp+JfLvzz8 Y/sf8ld4fzXx7yqoesS/yf/R/2PwR7/p6nqaKtRPzb/r/9XJu4jK2/8y+E/6f1q5i7j9Hwb/ Wf+PF2r5fxn8z/rb/2HwP+td/8Pgf9H/h8H/pv/LgNrM/1n/P/fPv/fC/9C//yGT/0Woy8AO Zpe8htglE2GXzAMeZPgLmb8x+od/PQOKCoIK/FdIf29GEGtUtqjsUNn9w9r/DVt/tk1/9jY8 PH/vUv7sgBD/ES3NX1fSn8v52wramAEtPy2wIDZRsN20HEx0u1UY5B6EIpaceNeGrv8Gog5N lzphgf4exMihLrBxYdVTJH+fOe7Zmu/TF9cFOC+x+12ueHICdRdLs+Uoqr3HeD+G5ILVGRIg GqmTBHwX4/c8Y0IYxC5k5fEo87BjmbWnfipgbDQcsKN7tO29fAicFzUQyWcwWbLnvewSBCtf XzEhPggVeV0QgHg6ibETD4s5wnmceXLf2X2PdJGetLc/xj8LjUa9/aQnGGYfY1xfShtzCeeJ TRm9w8tIfzSnzut6Fcvlp98Jmfkk2ieipImfd2D3/G81sfKGHvGUeFKw+83Ukas/cYrWP0JI vp9ZTwhDVUWX2plr7euQhPJ/sVWpMQWGIs3ZDyLKf+HJ0nKklC+83U8iJaLFAiy4ouIdv9Nt B5tQXkakuuG9BO33H/GXfPFM8noM6kTYKx7aHM+DVUdL6qo5MOMq7T4KpPvYY/uxd93qHbiu s4QV8tVavF28ZHeUWJc+581QiUTpd0WFo4/Z56F2o2Lqo2+Yofdl+tLuvcchsKfqDLN7yEob IoVZ03BF4YnnHabP+F/YbdI8sxeH4UWToO8JElEPb6AoAXI4jOxq652TxPEXnzExquhRAVUR fPUmvphpz6VUfeE8r+yPZbp+jHHHFgzJTBEpAje5Ms+EdHD37imoGBwPqx7QJT1TGjxMeUjv nM3KeVRMQdD6Jf+T8t1XFfLo/bwvlLJ49k4kZVdCsv4tCm9EAgeDr3ZYAR3xaXyTwA/9Ixzv DKP2IFqIqPjfintv9Fc0Oc0FoT++TOFBhDMZ0urP/lSQs3818DtD0sDHK9LxuZhEG61Gch13 +YEBxh972FRIz60Oej0pP0Ze0M8vYUDgcUZXbxlPp5ewHbpzWKCTwerd09FmVN+VevrZjP5c RZx+KfPx0ZNyqZcuPslMOCzLHcj0XByHYxxrVyHp01QjXXgL2N1eHELYebMpMKwy+eSoespP 4ECO1siTPaX+Sd2E8d1s0yL9i3TAsxHkEXMffUMV+6mFz4QsfjaL/Sd/lj7328NPal9c4pND C2ggwzHsQWLMlYgXVxQYnw9oYBsVvdnJ+CNN3eLsFY7fk08oDHkidGgTXC51k+LfJ4q+kuNk KvbdLxG2qY/oL3qxbZL56axp6RmNcc+nrUZ76mcHFNthVEIzkakJVaRvwy7/XAzzgu6C6tv4 BtLGjwYj5MgZupiBF8ksigfYLyHTnUX73+nIig7Gtyiu/ogL6T9+F0PHo49eWfi+Dy0w+DRd KYUJY3KInZaN57y8yGUmZt6lFBk/bhkis8kuhxRHRqnq66b+HGSLj2wVnlVAvw1ltUGnoVoR xfMDxVyk8C0kVT+5fySBS63SCmlHtg4wlolnF37ZS8egH7k3+lAEjpU91AldTm7K0Oc5jP9F yzTYV1MwFuVS0n+6Zo79iOhhHiV9XyzKwBDrjl/HKB1ik69gopdjr57bYp82iR8TE3rpe3GZ eeqYENIHGz/96rDSwf0ovPN3RuIho5tJSN1ghehZr0FD2+PnjNIO55zFPTn7TR2Nt0JilQRS w1Q4n+16XAvkPEz7WFPn+Mh9IYTz0g2B403kKA5cNFu2lAYqpjyCN4osygQIRf9dBmHWAFfs 2EeE/B2CV3X6/NRJObBXTJJloVU9cOjgrW4SEf+6q0MSdPSk2iVi1lyBSyZK1/2xwQZ8vSWy 7/diMzvodXHo+l9SegJ0d488xkacXuG2/ZUsW8ETPF9zHDxPPf0iP1Y9C0poxvEnpJe3oP35 QQR5cD9SRo0FZFs2Pza7qmLiHQjsleSKl573QJGJgdHotOhXaR00FEnlDx4j8br4schWHwHR 2edknjGP5oF9EHV8qkZ2r8sosIl/Ftjz4yMKtZ+LBbsq+FspJfTj+bSLMnh/ki730Am6pTBk AGG5jvGJUYE/B9TocB3hLvIe3f+Cx7cJ9hBF/F9334B2LjIfwvTsXQheuBijyt+3NScJXhrN NeEhKQQIZPDfxzJHXfqXV31krMzIrxDGt2ST0KcYieeEYIW3OowlCjHIaMX+IJpMdjz43UW1 KeTeoav0ahfXRENkP2wptDvxHSqmiAT1I3g4pjwn9y10gdhg9Wek+kiYcwHqnanyVaU7/Wty WycP0XJ2XGwNexJ1DFW8UvsomD+qrxIJh26JkeyEZJ0ZTdD3U2U9c3mf2EMOLqBdiDn4Gebp /RoVbUb4nFDdYwrfz/sHXvkW2Qh8yCKs0b6gdGaxG8ogxll2dXm/MzNgHC4SkTyi05hhJ9Ol p/3CdCw/97WfuojCntCKVqSZ4/H8DOmchXz0+jNk9OY5WY79XqFnxpRsWRDJ5cEZ9yScl9Rn 4XIOG6vIM1cKZv8ZIkd2n1FmPN29F4hjwiW59N5CG5Sx6KeIjD12+xTPIdrnjnAHxyF37fHz p8/I7stHrGcfuSCz9Fq0rN7+CSVnXyWig3HxyKH2eIcELdyHgmBMceQJsgCxvs4VC1sUxM2P JBpzmiWTK1c/4Emy7xxZY/N4EBcfOL1FPnJpIAsJsOenIs6WW3+eyl3Y2r0KzOhf9zmNDp2F g3vp9ngfk6eBoydCcd8FjPjIR7joWL3xII89iggVbucdE334PYSGfIKD7oy3yAV5JGBC2b4f v+88dprH6Jwd3RmG6T1HPEvlaY963jz5nd/oADDSneL2RsnD0cOhPN+5TxvRH9lPV+fNwijP flRQA0IF1lQlpC6kMMFJlb7DOBQGp28rWwVXop+EWOubNYMqy71k6cxrUIuROvu47XWz4v4V EPjpJdmXQIu6Fvo1R/DUmqfackguJQwMt3aZLLP0BaBznvtmhlE8r6tiyBkEXo4VG3WwvkPH SKoDJ3Kp1BPcH1g0CuADnquDOd9RB9dphHL2PA+p4yOZQQXCZvlMgrB9Z2EJsSuqROuZThlC /N4cxsvsmyGX3KRTPHTPAdcG5RvCNuv4DrUUcNUUK7TPI6QFwW9L6pF58TJMV6COyj0oWEIM 2f06+3xAtoNuiQkFoV2v9bRML3GBlNr1Rm5ODlqaZt3XY29Ijx7s14FHnQzqMd1cjMB5YefV ra58ZjhNrsh4L59eDiFG37OQmZw/gMu+8nVoNA8WZ8XReYJy3OfpnjuPFOG7ytWqwFCEKzy6 ySPgFq+4snNfuFtEFCl7nvKp/3L7YKP9vdV+VDnlcq+bPPd+DLHjKeu1bk38isbSFKqQiedG /GrmIbTE1hyOmBdCkBWVdHbZvKCbBUnlFEsL76WdOiWbd1xHTCtvEp/WVieFRB6OV9897ubW Jz0sVxJQcjW4prvuzugC25HZhnMWR6tZozfKToXYiFMm6M4/TNxv6c2UdELxzAEGj1/Swal2 9brGyttu7cFdSst+93qmPyfXMa4+rN9nPPsqqN7ailLQhmL0GEEwMLnfrNbO+Nk7GrSvrvH1 zvYn+msiRjadA6aVuPrsXfNQ+sND4+ermE+YskLfKb7OmEtBsqpMDZ8wuU0NiO+GEPB015Ib V09z9aJXpqJb+/e+2snB6OCjsw1DAXWqWm/Q292DN7nDT8oCuZBefvkEYuBn3WumRPO+hItN yhcR01EftQumZkaK4zOvXWaMNH/GgbOP/ViCCFpU2i0UCL25xlC0yfZ9nslW/B7Zy+Dq2QOf UQEWNLz1BYvDc5EPX2MKn88q7hhWmj61LGgTTWGcebZvZZTtRNw9+9rX5wt0FOrF5UlK1dus i710yNkuRc13RrJkc8z897YRYCL1eO15i0tkJPAsUKxSWZdXnD3XkEWYR5kXRCorUDuJ5QIm x5vJy3VlJUo6QeCWcL80M1VtSRSkGpgYXX41zjjy7Vw9xKq0DyF5avcAT3d50VAEOZ9htKEr DL9eZdS3SdI66LIWyrSTh0GybDNvrJo7sw9+ubk4vGi5uNiQxz0v2a/lvhYMRWzWdPvCO6JW ltc8CIdOBIckMjGqyV58j2WMkpFyKBVCWTiy17F+39e1GcUCUihbpijkFwpm/GX3j3TP8m/M xKczqMSDImvcLmN4OgnHec5u1qN7BtspNcwN8ByrgxBkLxrArV/ao+RZfkrSde05s4TYy1gh Gq8GLDprzIbkxsi+fTff9vAs0YxJcXE1r0EJVWR7hFtlkGfzRcVGAsaATpdcPmex+P0VYybz D6mjiXvEx25y3p2SdTuJ2YuQo7skS9yJvUOvxK6xn9R3UvAZEjMX+YPOJUHifF/GqYRT1w/f P8OF7rugGlSXKkzc5Y7tVajPcVCRUpGvOiDDYKReZS1yFQW/a7Abaz8Ipw+V3btPuvA1CD+c Se6d7/NS5kHUk9kdGFX3tZ+QPcT6MfOJlVvQhbsfyPRlzFK7HKSuzBdkuiF2UBZl3NRSesZW +gjQ2FAyszPjc6lXyDNgr8enE1OO4qibR7zxfHardKj7ILBnsl4+4jXrQ98jK8dIStkzTHZA bRV5VqufHPOh3C2opfFPlHEgQ5dwxW9fJOvN6yxw6cWJa0NekKosS770UaACvrQ0HjvehtEd 4h7jAvn7MYHxB/3lAPFESvI2U6YsspUB3cKRTmFfo+Xd081Dx5kFbP6+Is+iIiUy6F57Rb3R gXbRTsWucYSN7OtLFmpfRS7x4O6ePpwjdzI1igwctaAh95snwledRNRiO3BLjyZKSYwsddD2 OQKZxL2vcI+h7Ip8gBt8i2/XXam8cUHG5xlcZj5y7WHqVZBXMnlnHpo9tOUx9AqOnft68R6L +hNChy7Qkt7w5HGKImKe1uyKlRO+ol9AqLpa3XeSIzPCR+CiC8oqaon7FvBlB3++dkXIFFUu 652ZWxdPI7INCxc5eaPaqn6C0avgPXcPk5QGKkH+Ms3W648BRsD6tv9WUTzPUeBXPKPOTLok C7yqHF2OhJb9mIOSXGe7yb/xlJ8S/gwQ0DamHDSiBPU5u+k3ZD6HjMQCS1GVgOxLrxcIs2qS ScXqWjvZEXH0R9HcY0/NoSEPSKaVTvKpmfVDNcTsDjx55ojlrnhFgTOJH46YuQEGdc60va1B A5rjivd7ORLHIJkntHzl02Ek+KTIqfRuuXIA9WT65eCVyh1wmnxA+3W+WMTVDdSwHiuFUrKX 2Cvm7O+iJ6GmhwYXYSVglNmPa03dc7smk1TmVehdAvFk2afHugx3cB9Fdp1rOsipavVwbuKi VUCcFhkx8xqhKlGe2Gydwbgw9u7tjEn8HrSH/VdUhetFGU/kx9OoOuigv9yv6K2URFC9CTpf n+obBXgSaaJeo6xCvtNdeUkiRtVh9r6Od2iA8qvvm3FSLo/aoVvZ52OqPsWSCEMHONQyx7gC Kd8QuZoFul+mDpPnllAGa1uhNcdIx++cxJicPicuDebWdo64h+7h0fDmbeKnNHxWXiGU/Gxs 6eiB/mHs+PT88jpsX/7Gn+4o1gzviWc1lfEoRVDyRlzZr/+UKWQyPvIeDTeJ+JLkIFVHF+UC aPz7huYruFHY++iqpxxDuSrvM+VWpNDNsW9GVZqBwKVbcAt/Zj+bZM0QHN7NX/lITkDsuYlU Lw6aJUfMgettWrHNeXZLyMmYZuWs6vRVJT8zhvTBbmebm9gsKF1d+rKpjHmLt48RgBG/QqOa bULoMtBPPhrU2mmEMEr6Vcs9bj2oY1lLfqvqa+3SaLBSkvh0PmRDAF5z+n1xo+UIhhL902n5 beRuvAhCE3Wb36l9TudGHEUSoeZFu1D6RVcS0J7CH389BluUXmOr0qMpShUY3+PJCnCiWYNI vyXaJC7zQXizSHQIXC8zEz9XHDE3CtpD5x/0SgHGWEPQ4Bh2FW4d9EL1jMvEId4Q52sUVk5T fslRmBELP6TzqiMNyfK2gBt4nl+yt7EclNHfvtK/3ZAmssL29IpMQZxJM6UUkaDsKbWglkgO 4keVZKgaOOZ5BtuL0FrjR0UjQeZN6Y3WbcLyEKROOiRbrU8R+YHt9bCXlInsFmFTBo5pXV0Q eXGYyAXOEkE/8w75WVLOQc5F1igr600s6KWsFKN+NaDhw3nnnWn/fk+QvLAqYVpGOAhsi6qu Pma/BInvnA1RAWtNlFqDkBSaZUJQvpBTBiRbmOxUz0PRz6GyHrTSKzBYV6EQ5O2nQJHHa2Xk qJwAdHuMd9ZglbZoSvqOb9+DqFXpD7WviU7wcLj6itlGmwfi7sWjRFzWATJXHOPiYJkRebTw 8JEOkJyX3YfZChGH1oESDWxRyjC43zDH35u+1QtNVyKV9cxMG6G09ivr5pF3HofWaiYIiF/a dRbt7OTlGFTD85wHBsWklOkMKCmPWNcjWLvDTKcXzZK2gWT8aOoijJderb+MLQ4HfALRNfju 0QzcMdn+O69BUJrxyOlsPidMLPjsvfwrbgQUBokCi10yPZRAjLvhi+kZyEhtUcQdzXzwE3Bu ejHsUP5mNf5ltRcaXHaSPnE0OXqI/7oAvldPr5rQBqLP7QTXl5IT+z54o2RRaKmpgyT7eV2Q PqNHwWM7s2C58Quf4F21iwTtNbpwp70ITt8H9WSeBhR/187RPjfSbIk/ptPSsCUbHpQ6/sZp yctag7JYsd57vIsBiWzEncqP4ENsx1o/XDccI5toYe5p1Ls+Cvky27gB4ic+G/MRzwkiGH5b 2iigmi8uJT1a6rqP/2yuDO0rBqZ+iaB5hf8O03SnByPLu2IM+bi0ZJ8jWy9tBL3wAxgh7zGO wwy6+n8bgS8r+YWsBl4m8FU/SzPOlGXBhg9QGvuK00QQ6y0ubdbjXeRpD9gbEYANignVRl7Q FPI2k6dgLunCTGuPBUFihx+cU+xonaRbLgs0rnmHICDs/DsG+2cdb4XSl1egrdsiRrcv/pvl KjBLl46UifXPAye6u57fo/0xmBOm3L8XOXvjfM4vcMKkbyLHTZG7zEa1FhfZLoimsWSx+sEK V9lQjSN4c8aM3lkMT6Gcx9x/b9/7ETqEvpfBw1Dytsut3bPgmjXngO60EmL2e6QNNeYl+9cv geyHPCnbPUn37eOg7jvZo1KCzy0EBRMmrpo6UQUHyB/cQ/tOFAq0aQQCSqxV5qFe4ndMcfuH F01n86cYQPRpgHID+0lM7I/kr108vg4FY4CJWEA3FqdPM9b31XwRA50w5UndDBghxlj2L+FE RYZthE384sQHnHAqqzM8hKY+IoIuf9ZBkMTVs+foQyDpzp2ubTlBBCsXRNlaB4pr5i4sNWII K3zIvUCKV1nv5FRqIbQyuSGKZRbFG6cfk6U7MaFJ5rmxoFId1Q3++pyMKW48lXAbvRl+4fLr eUlnLEl/tCP/x5gJQb2cteg22i2ZgXwhxeocis0hnW+FhnR2vZKm8NHG7TckudluQyTbyE8x ygTZi3YdvinspHrWFDlFGYKv4pszpXpCUehN7/6zU+SKJatwOJFE+5AxhKGG6DD1BlXg8ezl XXXS2m9VQKbE9EXMLwww6/F0wPPuR/czs0FSF/t5NL96EDgCFcrs7Qw5DzmSG+FnUUfsgBRm Q8H6nG+IU1woDTAIPnURvX323UIhjGjZWoZZoYyB+XhK0SxTLj2i9sQ5A9o2M6K9Juge44gv FWMeIHw4BKsZU5uTeRZAWfGYpdVOPScpLoKPEiXtI6yhkYEo5dcyXpdvk6o2UyBb39/DYjCR CCc6XQMR00I2ILkyqSnQlpEF9avouLOlMy+JAbA5Jf0OZ7rXGdZHEtBBSfpdvCfmNsFHWapo OpzBw4tr5Wk6zNhG946WjnWBVCTywlUxOkGwwp46mG1uHQPT/NEr7E/ZCLBauFCny0U9IE/R nCtxc+mT2XN19FrpMhjWReV+XhYp90i2+rACtjnRhVjeiDxQPkpfYjZrfxgf616DqFfvElwQ WSqF37nLjiIaVhX0M17lMZAnkVf5VLov9dD7YatqwJEWuB6owwtXOpuXxPRjRDvUSYeNDGtt 0kCCJLTyMy9IM53Px1TUcCNwsioj17pxmetLOxBzvePCkwt9FcJ3s2Gj/MB9xzrKCWg/F2vA pJRIgHf2CcdVcW2usOIpMXORdl5YKe8MItfpt8WmO/mbLiwHtU7VfhTYAi2hZnXa8A5XmImM I9hPiuWBFU2rw2pnhQJhYdAVjLzob10l7PRDgZUc3XgJOglxcFmJQb+pccFo03cYygLzT8uu ZakAGxJn2Gpua0q5AFp8dtbLcQ2n8b6RURAww2+onQPEXrPNTxsvHgG75nJp9TcfW/TInN7C NMng6uNaMF/quucilX/NiRth/aFMoeh8EjmdBoL6NBY7a32+AVasp22Jf64EY5tUdeocuoJM v91HgQd2Y85FOrQxmMO+sV15gPnZEg/ZglNfXS6uWMFnmludbD0/f6McB6X7dyRJrvWG0DCE WfdWYKJDrfmyxR3csziZRLxJFPms6M8DxRc3J8aw7qio5BHHUfb41253E3pJy72djF3rT/Qp RaN6bTP01t71LqQkNpuYO8QwIFhijuYL9ieD0VQGn9PZMKRLFn5rxh/Mb71W4p0jFK3CEaGO 74Nh2fqaFuDqeL5gTU8Uvj7GlvgwGqeAomD1on1UKT2qDP12zOMq6V2+Oc29peLZ26RF7ZPC tLSG0VNV+ZAvdjbCQ9LKGFykt0tj1mbZQe3W3bap97Q4kRs2RqKjcVAY33MpyUhikq3ry2/I 4In9viiIaXxp76MHRsKsD6C9QUN13aQcC4U/XbtWp/0n8YjDRfC9pf9c1Qyhbz/0bitJVo+d IN/sTigq5oQ61yWKdOAsP66UifZDPArtHWumFFoEEcsxePoTNPgy9W7oLJnuKabj/cQiCikc cTbvJQS42b6HfATEXCGyd2Jpi3lW/Sv6zPh78ptqpzcTQniPmR/wGXnw/BkdIf3uAczGl2/C 8POcu3wrBK/F33VFNnOxJVhwAMet5Pe47yy/HYqhN8798lIQHPm0Okt89VnDvpes0zOTn+cI 7KdKW/v2lVzhG22sglUXlbvXTIE2u3oHe3bhCCKoqyOXrklLROk+xj9M3tsajBP0N0DaPi1S gMOsRIl3C5I6tdw0E9jBU58UdEdA/iChRhdibSzz9Ur9YPXlm4Hj7C4eaO9X7w3nPMcKxsgv 8hg9eQvDvXqCVEi2xbcOxa3/qtk2RNmot5BOjz3DJNo99s8GBs915f3GAT87oEciYnH8eSbx BfTt5rqHHjnoBy6kr8ffG7w8DFnHLMyJKtd4wPjpbphTgdtlYL79aV8dEy4Epa6BuPprqgAt cwd8KU/JbreZTQuU6WWVyp8Bn5RqPY9HFiAuNUS6vLtDwskL7c3OBx25cmHZfZD1ZGVXgfix BrybL/aOH0h4CGR3nx+10Yfq4BPnfU+LLNmQKTow/SAYICcSwbVCAmX562GH310IBXz1IyHs IbIE8D6haHsn3UCKZw56ypJeMPEc3Drsx5gVp+VLIjecXJYWN30PxWtPyzG6ytDaYbdPg2OF E47IjrL+1InXwxnL9NHxhNVg0epKZCcw4CzMW3TxhKiu7Qsc3b/D4FX7e8Tgy6tcoJR25ECs IOdeiOmokGCJ140GLtKhkLIPegkLUvAy4mAzgtztOdQHXWOyE+FLLJfEUVKk1IsUwSjvw9B2 4r76vjsD5RD5eu8U3jVqXMpzi3SrZvOJLqve0Big1JqFPv2uiAe6SzpPDBwaR4aW4PVgziuO 5bXbgFcxD3jiHYKUaFBn0+uIN/QDssHr0QM1aqxwY5L/UojG027o0PXx1OFc5HqoANLx7716 9Pzf8XUT3gJzmAaLQwmsK3zPRhYcNIfbcgztr2NVmREeHSfUnlbepBSYgnj5cw6tM54RCIaH b+hC2VLbm8MXPq7gWSuiOuDoaO5E7WUghxQ1fmeWmseEXYmRlWPjoOB/uzRD98tLNU/qj19D rWVeRFXtVj4nkw9XwKHUgw/5TZ9chu7gO4unaPTtge6iN4q3YnQKvttZBAQXvH8K2uRyynFa mVjImDCvG1Y00hxzAmOmSozqFwI7rosn6psWPoC0P/rgdy41UOxWPYo/8XUTJC/+JPjzMAzD ULjn9/K9c0cpuwgXb+aDXGz4paBalFBMt7/OqfZf7emgV89tiw9SUhFnOCTN+NrjA0mRVTf5 KifdExaCClJtZra8uOJiVovylAYDEPANugeDmGPh9a9m37ADle0Q08l+g6OmPhjx5Ijxresz j5aj2zm5wPd1N3bWtF0lKgIaXiqsRXMHfaIeSzR/Y804eyGScmLpmQzyOxTUBolx/KbvhFBW jf1lfFcMoevJLd6AGn8cJJRfr5umN4qG1zovenK6fneK0kiPrcSjOaIh6OW+0HPPW8c8EuBX zxSTP6UuElPRcTb2Rrw2Q2UA7lTJzROnuslzVV3cwoD6XvOs/BarMsqeFPvK0+WzqhpWL5Vm 3+NK8Vv4btkQHcY9MgmMXoaIAhK/LvGGMkS3SwRep/upxI0r3ZLl2H0QtfkG4nXcMnMpSwww vvq2ruby1WpgP6ThwO++3xUWFHL2YDPv+EF8V7tBPbJEnT8yuF9DdU7cA4V3IgoxPA1RYCzC 1FoElepqV8WbpV0s3rCRLLjld6kTmy4ruLvxA/2kwzzThtyuqNMDvkmpJ/aV8RaB7NpgtdQG Rho+6USN3TB+NkR8gDKjySD2l5HunLCGvr2LPDJzdyXBCpn2Qp//TillEPJPhjyz/S6JhYYS VL309SYMgbZP/wQmvtjqcFIr+hTpzJui44QcC+QA+9VPTOTExRQ6h7GH3+H0hQcl/VA8qGNV I8bgy0xrZM099ot4H141BI7jdE4KEmFPR7JLTiJ5Cwga25ucoygTcKt0Jsp4G1KA1qPi5Y4n thpKfe77Wd7lXyNuwpNGi/a3xTW/YfRM2/zRbZpsIYkybZg6YYE014Qeg5ykqNwITsoVzMhy bDc/+NJ7s0BN73sPkbWSCVgZzDjkqowdg3ujob9U/MLyKPqIq+qPT6amrZDrWnWEVaDZcO35 Tq4RoKuvRmX8QO7HK+RJAa1bCvfFfWDwmZi0Jku4iRCpODIWOjVXIfshnB2qb33Hr5XzNQD6 5bzljt8bIxgNGNm8IvhYBPiRB+MkduRfgUcpWmB2wkVoqAn4sT00Nw/mfIRtAqelyOhRL9aA oVLodWtJq+diNBy4pXtx4tr3+enPpLs4Z7EQQ2PoQvW3sc/RElccUbp0wnLrpDVRRC9UWr2y 1McJHodhDBrJ7ZFMCJFlvFqi7PRW89j7NfLoJlRbs12WDD6chZl+VJX63iMSQpHxKv1i8C6v 1vzKi/CXlCZI6DsV54hvVAWhHd/VytRzLxDY5Gx1/cVt4tUUJYEzjNXtrQmVwy9qtbL8b5DL HsGOJtFvTlK3Ewy1jlwNFS4og/jjEnH1vmfdR43Of5DuEPFSu8M/fZXkqPMLOgdYmCnzCN6Q YlTZrVHZx99IN9wdWHeUniH81oNLKhuKvgJD3Kv+Rj7Xapmf+4+Jkox6Beu84K0QNiBws2sd c718Kakf+jZQzoToFDB9pmLZVVpDnALppM1FtoyfNympkBiUzlNuM0iAUn8P8VYfsxLEe86K 2yj2s81vPyDmYx9cXohOLA8h7qPDuXp8tgexh/3IJXxH4w8Q5NibeGALVXxprNOaL+Eyadbs MZzgjlnLPjNFC5iwIcQFQWwg2C76c+37euoHmLUEG03EDefCaTzWPMkL1QGHS6tfp87fwFFO oBxc8axVAqQ367zoUNv7t554ziYjqz820vsQWoZAU8/+4KpWKVEDyrUnbm6esSrAz2ebwS9f ZwEpHwjHNgf/2K6vRuXe+Ogl7EdKaDmAIdoOB4nAVrn+XRbW8Ay4qG21fnAZTJzE2O0tVzvA xvxySn121x1C0l2wymMi9GrmwG/iB+WXPzGRNPRaVm/YKlfLSSqNF509WK6vJIFrxLIf26KI jN3EOIcz7q7eagt0f94MsQd9y5p1VlN2DygqSdH6Fkh4SFlGDjUfMehIMxr3n4XgD7GbTZOE X4Bxe5CyZznwKmgzd6CX+MxEoSEhX8SJtjvuIS/lKgwf53t0T/EAFlBjS9uUO3leqtEJ/giD QJvFFc9xnponSDfvRp5Sa0pDDC0qpzNhxxizVP0Sggv7rm55ENxtYKl4fFJ6OspRnMgDY+8q 3ph5EerpFYsibcBia3jpC7A1Lk+jDxUfREm9zIwzu0bSOcONqdHUj2gE1OG3k/B6pbWf3fBx C8o6p1shxhceEcsuTXwonQNH9tV757bbi1EBb976vv9Jqs4pgeQ8A/oVl4NXIN+NUaWsvrBa 8RcGIudSPrKceAyc7F/vPntdMAFSfgOF7eZYEsgxy5waD/zVDR84JATSZy3SlJxMYT7MgbyJ ZQOD9WdChVbo00DB+I8XXWfvAt3B7qPFNMFXiOfXWCFIiVm6V3zuPUa91UPMBTzDNXDAnfeQ A/tr6SO8DVqIPHTFioeYAfN9upY3z+TYAdsc4U1Mgwcj5slelTw0sJBXf0PPOt0nSjazPALJ 1e5ZZXaSHFGCOmcvN3zKjWSZsUr/+XeoGly8MnCwFzgFh/dGfuLZBydLu7YZEG7q+heeIDoK DTJMD8t6DnN8pqNloCiQ1Ny6BwyR7WmDnQRf2bodsyEk5od6WDwz4LannrJ92JyE6wsRfs5I hMLYSWN7Wu2ltDoonVQPDW8zPY5QvXrpGvlpNrkhFZFldaeYIW9TRL4FUaTSTDYvmCWSTyDZ RA+9ORgpG0D6jblUfWrdH7RW137uL4pub4SFkulzyzhZfGc1HjoeO7h1ucPQa6K+FLPIe2Ir ZHrxLHxUY60h2KZDrVv4vafjl8FOzNyCMCuRRIsa0P720gnxyiptf2H/AXIJGho+9P16XT/m hO98tA7bz+/N5aBBjlLIpOJgd5HxBuuHV6ZlX15v9W2pMNbmoyzj97k3TBLBMKp0ZnYR7YEa H3IVe0RPMqd0Y87X9y61Q9yguwkO0zXZB82vGQRz8DG3dIErcSCiEAcqM9iErLIjSpCzgtnK Jw9agf3+gskxmVdPADm/M7pltnpF4Ln0yNY0eHw9WxrTRWyCIr7rKNqWKiWltiZIu3eyN2zZ kBKImN4O9+y7kEUuNYE7vPrOiTtYfljyMkDVHmQwxqSELvfpUNpHaOPBru3CuSvagz6u+2Fd pfoQCvExFjIfXDCiNfP9hhf8OQatmqud3U7AKusikBbpi8YUjz68HgYDeUHfcNrHnXPhy9uG VmnhfJU84Czz6OqMBMeHHX1axQpZQJiK2Ft9i1MG2frtEMMWxigrmJ17QeOHEAcBiil7uO4Y tmG0TyvcpIXwwnh23JBTcT0UXTCr+cShfe5LZoJIWQNKkF62Iye+o+Twj4uYxDHWIvCodPnI HphDi3h/zWfx0zdlcpIEeGR/wDxceOeOyNOWI2ddDBO5Ygb1dCNOrWzXCGCV0j7Q4C3do9iL Bo9jQo18Rx/iMOzv5Y3Usgy+vSZ4e8CeF0oHhJGe8F3gsHuV7SiecFAQLm34fZ1Kf0N8hGii V77c3qBt1GQJnYsnb5St5lYQrodAW8HBUTGfuwS5JSL0nTtge0WLtQ55kKd+10HaKMPekLGn rF/lC/wwn3j86RChXBzYtpef3+ELQ+SJYDyTkMx9JIN9keA8qiT4nrCtDAJM+qhDDvxigKGs BdDdzxWl7KNj6TUqdLGGF4ri809IZ1zEP4WSGGks6Q+1vQT2oghD4zRWX8CXPKhpKSUwQ+b0 Jzda6zwtp2jc2OlfB3lW7c8LYiBzLRwb2P4hi8ZTOXHEkLR2r5QekhV2JKuev62AmEPEPXPc N+X1PYYgTb8Aq7VxgtIIzRlZ+Sm99i4IPp0c3QdiCMq4K+FHGbzIP2E4dmk4Mxbso0ONb3d4 5ULbFLuMyeLDdbAmnv+ElmK8hNss9mj5AmUvn1WdSSWmgfKKtnTomshzyicU2775I++ewRNB gSJp45hSYgkI3+4sTA16Wx31E5pHScrOUnfW6Sw37NKBh7+ma5rA+h6mXifJfPjMBg1RESIu RhsmOmFxp54YRe6cOpkUI3s0YRnujR1BzD02zqYzcow7TcKeQDWxwFobOVLRzl/gULnDmTfX Yc4leexBL1RI2P9iq0Fz4PLEn9aBzrGrVnT4229uweISQyPFSdHgBqAShhJzrOPxFdUswKE0 y7/4mVA2BT4jqbEdefRET9Bu/bByJlF4m/BVBCg9X2wfcKEKhuFc6a8fqX4lgxQNxJa48I5Q 7CQP0waqpV260MaepO9+EdPsRu+xCq/HjsqDXMGxw37tIRsEle9QLq1buzpPgLKwzs2bUgto 3OSFtuPgus7FyA836GLGPOM60XDO9s541yl2V0hj/KY5gNGbdUYTr8KajfGlKj5XLkaB6gt5 ZNWzV5wJ8ClZyC3JO64AuDyYzi2e4hODYBTy8QvtRB2IJMXi0GvkeuFfcdrgMx2TgDcuYICf rzaCU7ieSQM5u/+ExsslJuQDGQcPzUTZPDF6Pp9cJGOpCA8af/dHO99H8Ungy9I9f4lTaYoV WsbLJWxW8zCMt/nWt+HjM5QOXO/PpjUKODQOejeLvtlg03wxlpFjvDL3RklxJq094KQRzpql E7cFfMtYtbI8RwWCxzRYSCeu6U6dUHQ+8hjuOXwppbjSjEL3JXb3Ot8iQRpL7062bNKowaQ0 nWuX1QCsCt0Q7QZWt4Rx7NuCu9Qzy5Wu/WUNx4HVAeW8x50QA+bGd4087wzoEcPB0CSPzT8w aHxPVGvvRCjSY+SKMUVNmhaUY1dUOr39m+GbLNv46MyYK/TsJ55wRMQGixhMZ59f9gQnzevU ZamdEzoNfZE7DRPSlBFEaW3hgaD1fPJWOrRoPYgzOImtg/H6ah/+UJQgn8UkAHeP7XZeIZS9 TxqvfUixhvotdKOr/1gVFLUxEeyi1biIUSCabDZIY709C/3S/p4XhtPqH5+FeWxfXaN5RBJ0 eB68w27WZYkYfnedNitvc607H6XQp1wUOU9Km2nD/L5QpdeJdJuQPfWiXdU96js8fYdX8wka 84c37Cq13VxXB9loV6pAzfwB4eY5KJIwYwrkZzyKPPUB5bjy2uiSVSo8n2CwTiOUKoPTQNGT yE/Bv2B+OoOnb0m8BYOu85nhhE2nvDbc3QFTL7AuKRU+iq+zPAaDrdxOZcaEjE2INe9y/D2R BR876O9Ppc4cFDrT2Y+s/uDMTvmpcw7Rqi36RvmbOflwMgy3vKAZ/5CjAgITBr+uzaNvwAkO zZpBI6kCkOxpR56P6f0C7NemvgeeWvHBd3p8g6jYvo4Jwwt+kyQ5HFu8ZmoOsxcPEZhmny+F aRDG70PGdrtKSmcS7ChqtS7Q59MQLqbC9PL4Uq9TEcRS2lY2dvs7KJ8hzp++fe/a4woQRb/c diwtZwKezaa4X0VITmEt6cNwuifvK3oQY7oU+ywQ/MNCNXD0E/KCkCLaf4kobBnNBK6PnFNn PxLOd8HvXsNA8xdc0EnR0dWj1b+NO0jutoZnv2wuv2TLPK0LQw9HCTtlLOdLWsGnSpurDkkX fNBGi9Rw4eMUL7jFbzBVacR+RdXepo1UmSWdejcCcnT9etaDSwlgiSWaCH1TyQEGWhIbYf3X FkS8p3hqlx9NQ2DuTiu5eQ3y5CEOXb6+B31NHVte9/Am2TiaJrzJNsi/XMQgQeTjGGTklYvf UGB6jTTBILFLW0Y2DnfR+JMZiRykedmvGqx3JD/BWndfZtAIol5UvU186IbR53VnfkqRauAb femgTiK4GKtdt7JXWGX53T6MPrIRS0KbtXqjBFyuOsuLkerHORibR9rKyfd5tYr9Ye2z06zz wdIJogXIVdWHx77VuECxRfaNH9gwOyr7KLIB5VvBT9YuWnOMOUaQ5kPkdOZpjK5VUIwZQhmC a5sutQ+C7MxAA58CoR7UT7p9RqwKv4cRz76C29GNzJRSuH+O84Hl8hQFPtmm0Ka+MUsDJrHq y0TpCDdEDsq2XEavmZwXhMioZfFIKvotolsCsZ9ECM5yZjy0M75pwSf0MYw5771bICHZeBtl thqtx3aQ1Fn/E5PXUfp7EVrJAlzMnyJWgDsreXw6HGxMThLQfbfTgc5nXvD+7O8I/bvUWXYj p/vEjprlmNBTg0JIbGnu65EA7PW2R/fcf5ozj6YMQo+mqyNKC2d90lsP1PMLT93glnyzTEbP s9mZIuCZmsiBDPpP/DTlYez3l8nQnuKNmGv68KRiOImIdYPRBtcbzaXsLuA+m2LY4as8QmSA uLklJcuYNX/KL6Tb9W6tzV7Zb85WMOJhcW2mj6yJWCCirrB615OL6VHybzImMHtBsULQ0Ljs s/NQa8hpxLdzcf0jZ/eItNijsmIiQ1m7SQNJLHuU7tsZZUF+33tkbhkuRdu9H2Qibg4YC1W/ kobFjLdmZH66ZVvnUeAVW6ffREzUt82lDzqSmx2gdFjDkJAiIIw5gMnp+gwzS3GFUN/dc5zt isZL4D/AsHaVj7UWP3q/CJa1dGqcNZXs61C2P8sGF5/2rVVjZmXYrebmhirCX6EJd927P3mm W7bJRlTmRWLuq47JJ0JFAqEBp86+ogE0m9sqgqz5q7EwGWl3pnqNIXjae0O4BI72vVnChJ48 BpPLLiILwULbsHMT/TpJ7ZINs3CNPehZGn+WWoWN3s3lHHeafAi1w5Za97x0RYu5YaZRlJAP oF18C99+d3scsM7Sib+XM5DwLag6TzGiLNWOAG0fMWlnS+IriQ1w0En3jV7p9VQY++rBLrXj GIxGS1ek95FyXCc/AU/eTMDty2u8sFx5QexJa/EU4tX4i1jxR35GtxWZ+WTfAv7mS2nddaWv ByB25ofEm7QsJRtJ2GkSxaHbdcHMwdVb+o14LuonywC/uRHpQgwHzA06tGpOkUyEBn6wQOAv Sdccw6jnkG7LlVBuV1dLWQC6tfPBmsOqNEJpvWdgqbRmi1sGHC+5SHIMy6Mh//OVnci7oruZ dnD8ZFN5sQ3tAebULn3Zxirm9ZxgeEeRdwm4oliEw5fo8pHELs8o1FAEeX9disYsfXJWxXzb doGp0hMLtLos0rwblsnQuqp+XoghJAdx0Sjh3NdxO9m8/mIEyLo8wZxSzFCCofMMzD2zYvwM X4exlzoNJ9Rxg7T7ZEAz/UdcGqbvec/mbYjiKexl95gZswhuQu8LqzufSzo7YGqNOBya9z6O f4L8gQNie+gdFF7qhEssWBLhTYX5Z76o+gcgg0y7qf9ab5pyDpllNRPJYf2kg/MnefpXBmZ4 1u6x+gXIduv52AquWOFylcNfSoAoX7bJk6sZgKidpDV4gBois75H1zSQJcrIgoLltCDW+YTr MceDeZhqitnCfEaRKHTohNzwXtYxIwh+ZbeYumNIbIQvazWFAtuXHMpIqxNNaAbhw+xfARv7 Yevce2c3MNx/RjqA8/gIrsrT/xG8ytso7gZ6PXdFzSJGa0AnGA2+cTZjpYxCS7K+qMEdc3aw 7FR+nJIe9IJG8NSkwjRpr9ytHkTCxM8P9dXHyDwFKIGrin2nHpCeXL4LQV002v4FRxOJXOjP ZjHbNp63uj8MeY6y2I85Q07bp9eYQEJ4FRAvu1VvP2xV9OkHLbWP88KmJby1J+Wgvqc0eyEA JaGa+smRF+QHt8KMGrmx8PDN8zV9F49qTG2uSv8PimZogO+egb2VqWWQXUTLbRtJOY8M35+V njYrS+o9DDjl0e1lG55bIJ1kHkp7MsWMer43qdFlxzew9AF2VTNyus1JCD9y7ygYMnR2hzkT bnRBoWDfiRxuGyCUm26fjosx2i+u2dwI+8685yIE34MlpnPcfFuXQzC03hMS7y+A2CvsgnCI JAwYiMasH5hXyVRBPLp+caXl2z1yVzNirjStWCgoxWj1ISKaaybVTO0O+XgVNN2yHZYuoUxD h9Oeu0WxvfLg25XyI/sN07cRGzgVhrJW3fQLBsJ1lqmSxOcJcFAvXeWDnT9TZh73Tt00eY/E 6qh1XPxaVS7d5/f850kGKSeIy7jujcV0GI9a16QgjNmmxxwshsmkGcRrjd6+TOZS0s13ku7a qbOZvsgyJa0ZNxWjjtoqeJJiGd3OybMIWZ0WtuhA91RM3hhHjC54/HQ8Rlfao2AL3wmSYum4 cq6kQ7KvJWoMLzFnahXDs/bj/TaiKKyuV/d0H0UT9RYfmuIBEtfn4r456Q8OgZ6xTbFBYpDH ErQHvuPeaZV8w/CVc7zjQhqsltIhm40ib1L6EDIF7q9jPLzI3/ajRDv9XGysSXmfR2Gw19Zy +45eO5Eb5fj8S6yNIYnL+Q19t35pIllucBr8s6OXA1zS3SAmDKHgNSuJggqPlII2KdVDuONB IdLwwOz5PUM4hg34cGfKZgV33uvoU8jg74nnZHYPPgsVL4Y3mexAYuRAKbuhdTq8My26sn7x ztdMLBQsqyRJXrPaxhBiuUrrVRF8FnSKpwLAx50S/o3FbieOunOO4sJwJtYTfUEydrSobSNu BHgUnSbn3WmvRKnBi7EP8qV7doag7NJPz+0iHkPouO9+CP1uuYDoBHdyJ/THfLOCEOwD1W9U hsWboxdVXqLPfZklkVKXFSHPfvQ+mpA+AcHj64aRh9/pA/ZogWh0EKIeLGvw3K2YJ84DM9QF eaqqbMPkNXg2XPlaX1QzC6roq/21lwdRREG4aW0ueutE38+dJtiIckz9LsRMxsQq1JXJAY1y hpVAR3QHktKqJzYzQnbOEnBW8WiAD7Wpgj22mFlGPVTMVPnomGG2UVUfnp/VDyYPRGvitCC+ ZN0h0uV3GuItelXtMarWqFqQ1XpyB8IRNSXzsQiWjkqlLY8+stUN2Ct9npA8mhvArGbiC7sX cs59GEctOU83uuqRpP2MwNi9c4wpqk4XaNcfM/c9kidAIiOyZavScJz6AQ1ZlDY6ZKV/uQ6u MM4yF42yEgMQr/HpZsYP9IzMbCAmebP1O42OC+YD/8ZzWibhjInXlBW4N+g6JfMtfxRSq23X fq97c+NMh90PVrIlTZE69YqoR+ff0xdDcmIKeiB7ZWTwjpazgONXcBkvbVvn12NBoDO1VeoH w8nXFaChxJiVaDN3FYpPohfpfRj1IA1b+mihzF4bSlAy52kM9lkQRq3g7MEzM89OhSoNjILe Ue5u/kJPuOtMYnK4v2kAtMw814cvIffyFrknMTaLXjRAhTMahZjRve90VfGRK/W7B5d1d6bA L2/VOmT2+DjER59EvQgd7KYpVRxmbvf70RCHX3SNb9aqxBjkdKZpK6iBc2S4P3vW9FnKGXZw cv0p3SaqMMRCvu+B9v2g77X3OnWbNYy3LRkF9ZTUwgPrBI5gWL5xNE5ttQm2mUr6Ak9wfaZH FkakwL3ouIvXhXd8XsGvD3q11nMgmdNWfDH53gGKDOJQ34UnKs/ojH6Rob52Qlr0F5MgdN08 Y/MY/UUSloNy2eQn7/mgNGL0OEv4P57fW+YxANdfubyUERXUK/gGdzTjaOfYi76jL/PldNs0 CDrelNBpXYIpw8efU0rdeAd6OUD3XGwTmzQ+o9gY9CdO5q5YEdzsAOdoii/3XSWGwWJT4oxe kkk9c6bUEdkvAgmTobrAJF05vcqRiz69q92t79Ms16B/7TsyMpl28zfZJt8DwvsoVlcZCZ+h vLkoAeFcc52YCIWtd8594dQ5A2yGWI359GlNuiGDETsQtc5YeQRObWMtPObdHvvr73uHg5/J eEx0TRMxCSr4AxhKK8MeUC4hu9bTRrZiKPEYCXD7bItKNT+dJ9Cs9B2RVf7ya8qHi2Stw+B0 70juDpuAPKRVDZXQhhdPgB92Nm8k44OHYxCDuoxc/ndFEMYFlp3O+j4BbqNLfmbWxVhE50WW bttnYmvTO6ixPe4pr7pI5N+F8L65kjihEvIZhY7sOOBeQZL6EgCY87IpDjpqWFx7aQ4LDNoO 508TfaCjSYLV8Fc5dQtXYD3jvPTjCphGj1HOt7r2AHvWTp/Gpq8xobEJiPO4wg9p/IjQMZVj vQtvyJlL1ON5zjYlRtoJIZTbbPCG//EUTQTc6vmowy5zZwjRKiUmrxW6Qu7PReM7G8ZlyNbp h0tpnt9+j92GnBb7fiU+SKInZnzmf4ZABIszXjDUNic/OoZisggtO3Wd5Fv6FpT7QqZ/13Q7 A7rEul74YYck9x2T2ySC4ftJbiI0Vm2NXqj8dB7X8qzsLaVPWD7rEMv6ygY0lm4vpS9kXoMg g8QOruFTKoAVXvElyJayAjrH0v1N2Voet923yGrF1jhcfBjStbFfv4LbAYXT647QRpCUcwxp dt5YZTwkbyRkmoMIhYFLMcTDBBpXHca4J9F34IX+sdne+POF8TGWzxh/Cijny2Lrk62XwCE2 fOR3/x0VzLmEdbSn3eni7jUPCpiP30MufWE2kD7XRfoeXzikecGFsF8E+Koriwte7hCvcpvH H4bCTYGwqO9uZToRbOw5pTsy0WyUAClgudwqiq8kIAehiHszZllJHH4w9XFMLEo1gfcKsreR cX0Jrg2Sr9BPDNQIVBd7IT+MntRP4yRl4abikeh7F5KLc4pAJ1oh0lSf/JqB3HfRAlfy4pTY XcTqIjm9rJr+vNHDx0DjJd/9FBJkcMJjumUoii08X8tSRtMi+WHO+5NnpPjkAuUwPJ54Rd/O GkjAnGSSetkCAuUxkqhdBNe9zObMpSHpzDJw/JJxJs+pvYFyAg4FPCDElOzooGbfn3zur9nu 08eK8VU2+fUNvkucd4aP0TRsOkTBbghCe2gP4KX6Fevt4VdpzP6F45uU0wjh4vZTNVtsZKE6 GvdpR/JjyOJy6DG7gXKzTZPzqCVlbFWzT7BtChwshfqVKPGg+TEN5pnxYbDn5lG2KNN/fgiu vy86E0ASpMTBsdg6jitjQ4p0v7eMN6HS3SGKK9JzVjdsZk56A9fZg3GBibHH9eqYqqIkbQ0w 1Ov7BCt1nYfYT80mQqWotK+Mea4hoL4VYSO6rD5LpZUE/+JBk20Dp0tFafbTSLl+JW2v+bqw nM3ugyCltsFv43Bkw3CTn/26PMYkfP4l2mvFpn1sfx/zF/98+MqSIpTpDBhVn2uEEa02xE1r Es7Nq5vYlYBuMMz2ySe7kCO3jJUa9mqSjB/dAtdB0fLtddNSkOo9X7KXNPcGbpH7CwSSGsNg DU84NsLe/lXosb0I3JN6rlXbTRA5CLx0t1b2ubDjE7Tvw/GGnsRpIUS9suLXJttQ2YT1ICyx EuGdkL2qOyPPs3oVRJTHXqbH3FPFnN2Y79ICdpXUTcWen/CEzfQw4xkn0B3w0mLKSdSXEOL/ KNtAF7p+u49k1TaB1sIlLKeJkSrJXbpmQ1YQwJ5+xFXYrfvQ3uW8j0EbwTBYnZFy9Iv3AvDn 71nrtPpAC0MJS/WPr7AzQdansJtbVdcvoHQVPR6efwlNeYInXNu++YTsSn6u8CS3MxtfWRXI gzuG/uaiB+/hdk3P9cG1WccD1E/z22YWVvjYylZ4co5Sg3C90lRhGZ1GflCEMnjCmvWtn2SE KgmZhK2hNQJOyg8JZJbvpSjN8BwQuOH/YCeQpxs4xNEnE0qTygmr1nA2y+YzQnIbsHFfJtyf v59X9JuAi+sK1i7XQxAxZpjBcksDkdgCEA93OFqiZ+FCPRKfR2HC7r4j6G+BXyY23I1iD7Pj fJt4zWJmQhPm0LlQxHc7jlJhcn0jlA35vTjWlfmFenQ0cydEuB1gbBHn9ObpT09tLIFEtNDc yHdXBti5Y+vWxOTegzOfRbcctcqKIWnKeoDfjrZuLeXSFNzCk6WvOG3vAS6rnEdtArb0oGMY mYU+0FoCCUeWffsfGUuBpNDIABpTtAqG7KyzrzyqrKD5BarXuLSgktAhgXgjuuQYJzRkUAdz j1SnTqHHp+meLbM7ebp3DFrPaRvDRqTM+NnVVDvGT+0jDymxcj2us/BbiRhtEHwciRRwPrfa niA7EEpGWf58WXgjY6xjfQusCU0p91doRkFCUIw4Ke4RDpjbOOn2Vm9LYF9TFh3XTayGQqv1 VRNs7EmE2EKb5ihf89zsCOBo2TvKS3o+EhZ9P3jIQ4hKUuJqE03uSvHOLVJD43SesOSMBeyf qjz3LJGwvAQp0uNM2wbPiZ3gXn8yT0+VuENHCPPSNTJcR0HKLFZCbB7nA5LSnrrKBMtOaJUp JJWOPtIkVF6HvmRDsnyK3h5WgfRTQUK7oPXZpWltBYYGf7NzGiZIY2L8FNpm4XG1/RhtmYhr Q60+Iv69f1qh+CkifRysahkrpz4K3Qs7ql6Xeh7O6hHasIC8c028tCEoShi0VRDOjltyGzS/ cexapohFeUua1mknsvMUyr2jt2RFF1x23k+eMGCTAXYW+jerZiY3MWHIZ7Z8MDlBOwdd095H Bc6LrsBqJPfID5+SWKXkn9BkMCA0xn4cwSWjc2SPD8OQUrm0YwGwvVHez9xrgMogyC1man2f FwoGNMdDj2FJFydgp1U2duwXuwwTiiWU8/nFLcAw9XQgRncTueBO6FSD33tyzM+NMEMp01zJ QPWHVUaUZGQE8k3xEzLJZfbQy+yFCmfL7gzZy9NxsNhcdqnLMKRVfyoF4ZvzjDWbllxSACNH Fs9kpa928n5VfA3C7i7aekfxnkOJMHvOo9qpCAwNCKV9OdejEYkRaJ+4XyNLR8uRTgffHNL4 TI6gvEVkzrc7+139TX5qSZNSKo+yJrl9lE6AOzw7kq5RLFX4dQKjrBgN/+rvMhhfUu7IsHqR jux5QD+wD0lZjtrA2baMr8ty6KDfl2BmvymbqULxvfopsPOzFKZl3leGH3TjBJt3eT4tN2FD i8AqXR8oAypS45JPskebiBQEvcEB7VA/L57BcODdDJt9v4g+Cq4pw8Saj1ynADESkKq/QogB NbHiOfQ8S3rmD3i/sWdpS9v2DGBv17fEBob5gekVYW9HATQZvi714mJ1xqrAwwerVjmpmIRe 7Dx8vZQkLXX3GqzHxjSOHSgyo1RgSDI7K5qAWnS/jhKwTjjz2Yeki2OFErHC6S2ikwxy01xv faXGKI9rFqwvID3bURsDvHi2LaiofvopPAL3JI9xBIaKWu/Z4lPcD4K5MOfkUimhOgf817+N SUv+xO8/HwFVN+3Mxc5h9Hj9ml0paKcuB4ntxi8a4OEevpls60kpPaTvOn3V14rUL33tYC/k q9Tu8AxGz2Oml1n1PNuOw8ljj5z5GpO3gD94uC2MqPhAAW7fEMP95NoG1N4j2TFv9JiA8/yy 4TOXRWWKFerJVlzqus8hraAMuck3Co/J71BZSDveiKJHsUav1GZQYavSZqETT19gWzFRRYv7 XMslf4XJvtWwvYFJmLhcqA7tmFU1nPvdYDdw7K1nHoFv97kogkFK6syPrKoxz716eWgrjrRT BMEnIPfnL2fbGJh2k0YjFV/cJpTPQN2ntjuOngY0tgJNV53J4lLzaOrX3OctQWc13eheXerA t2mCbj00SPeNtZRZAseCAV4vtNoDd9zh6xrs+N+woYW0Lqv5pCHsPTAKu76Yztf3glKIWmn9 Ia1VBM2WgrXJHhVk+C7gRstnnMIN5uHeMb0UJla4UPsxXRK5N+XRIHRtoWiP2wWPENy7YYxr JifUqx5vHmkKrv3fbHfk4ZcHu29Vp2QMQUWY+SsRrPPePTTbBzaGck8XR3Jec50bWr5B8aCc z/5OOAUnp14OfEy6jQLWttbAeP4ABZQvNojx6+scxLMr7DwFp5BJnVXfS7KM9ulZ0q0EJciT dF0eYC7j6E6+PgETG/Whz/AqjDKgfvnxyoi0kWm35cSgK9jUbpWWoSutBXLyq+ANNoXoIpa3 iJnOjJJrzzBSQ/f/3CaklcEXu+zgTd6WEDJc119uyKveNqYQEaVnNrYa1RmJ2l6ohbkZN81A UsBzLtBq69h7iwadikzjLw1JUSN9TXDT64KpaWxN6I7CIiY32m9iDIpUflSAYMH0iUb2RCzL VUtn+FqrNLowcOGRiF+SsaTYpe2fJFXnMODufhHgoui5H5e3s7AMja1fM5GQylSr0Zt24gw9 rcFiD5i52M2f5nVrtICLxvpaksky2efxyG3gejX6no0VsrBmi0u/94oy8mE+0Rn1tMkrvINe Xx/VxfyUKEoBrHyIEH0zNN2BcGVkl3uyrGG0EcOs6hMChsdEKLfxmX2QYX1Q1z2CwalAG/yH WVMlHs6GFcRAdrfJrUWdr6cpvciyd10CPqykwMGl2Eu4yLSmaWjFSLD14ScmrUFzys3ZIEE4 bfkORJppOdJWQf+eGHZXJwRK+tQyxocRnU7uu7k/B/VAUfdykx7pQG4UKs3DTvYanmSyzxRy yrqwO+ekXJHRQxzVsQwr8Ygg5WC+LtndG2P6mLLkeY/7RMdIjBRwOFnTdH9QeABM17Q6P39R L6Ks4VR3ZvcC9+vJ9nkBWuNmQCUcXzjXt65E0DYEudCN1AkuK9hkl51j1X8Ywz17ZRQ4IpB1 SZxCemPR8NN0eTv8ImEQS3qXf9t4P78KzCqhxljkcrQpiqA+hHgtksXOtKEAxz0nfEXDDhNg uSVlo8+V/jSjrVkzCn6MGZCdMbTBA2tbme8LHjqANKUYmXRVi16KoRXus3McLLRpB0PMxqhe tZgimMaez0Jf5V8lyLync3K1RdwVzxAl41VQVc42br6qpDttJhAgv4YaZrKrpNcYPe8GOey8 PLIwroeTbr1eziqjwIaodsyv01AZkjMlPgaW+Tde4bomVpIVbkRE8oxvusXqFLn7B3g8lb7S 8C33rQTxJ6BeqcVkWSiCmLt8Dbqj+zpd6qyCWfsGJE/TjSdI2LZRNgDFVTzB/qD3NATdyXbB cmDeYfQlP+hVlHXDL5+JsmVNmmN3nFpvkyxjZzvAPYPgWBr+3YMGY79REk0uEuQfg/evikyw No9r4cEsTW7VCfEoOscOjTWSndOV0i5czGKSCfQ1Tp17gCnT46rlhvD0Z16sOvZ2mDtXVinX f30uJAqBWPTm1NntmWqUeJWjkiLy0+87xPlO+Miuyy/KyKQDmmcLT24WYa4QtjIgb+1mu3Po DwSnQM/SjrIB+dg32KhIv+M9YWdBCNxD9+i5CMJJdPMTGXnQ6SfOfkU3CZa7OookYbXlwpwa 2/pBkF7rLla47SWfaYvYo2uz2e6vTBZXAUnzwcz5d8fFQt7Bw8ifxK16+xQaRPEIxZBEXNFT hTyOXKVqrntMkM7LiZ9oQN/EVXY9lgAthYrjD4Fh+V7U0RVadrszEFFwWUWuU8AW4993+2ji Ri5cWwuoKy0mfHNDMIZqD7+NsyBPvqlfgesTT0tuVD72BF0DpEDgco02vEGXkc/1Xk4h3gCz nxut6Ya3v1E8EP2KwsoP3avIftXQ3VN/YvabB8rI/3mMbvEOqmZyStpOGe6yOxWlJFYlE5w9 pe+RoulHPuRFuGbmwHWp+cBS27VWNkurc9AklsU5mggXBOoLHQWT0KjQ1AR11Yw1se6Z+JyA 3yK21lXpb7fATdpMb3At+jRYcD8tHnevFgWZU2OlWWHoODiu3+k/O+jbcU6xaQQKpv12konw wODxFdqNqQ68RcmALDOlvrEPDRknotLvObLdwXWlpqzDVSsdxE/oXGRyyM8zVIHPtNdWJzq0 vVnRAkFrw3gnRXBL65nVsQKeQPGJVfSHEFjYWPGUtGFOhqwawgti5pkHCJKd4HJ0SueSqR/X dqIN9DHnJ7Gvg2az2Yz0t6Ef4D6a6fJ0nO80Ch2cY9YWSZqa0MJoOo2+Kgev+b3nFN9EqJBz 7h6oo8+d/SpJklS0kNlAeKC3NOkzLMlJ5yGMr5ADF1xQRrg7DKcRTZa6rEyo3x+3+65NgtxA 7OgE0dYXjq4XMn13GIoGWr7uARfV6ceI7b0N/EXXOspfLQkmw2QuLfFwSFYpcRzOKhnRFOh9 GAWXwQlJffH88oJDsPhyPmmcJtxiIgqyZ4k8yK9VaJwOf7EZHC2zGDmInyV9hvvvL/IELdCw 4vnz5fBpEG9cYvvZBNrYZ10FDNmKoIWV87H8jWUPXMzxbyLwEDPwKA6VU5JeMeFN2vnpg5wx G25e/WxkEneXyzr1NBmlKba81A9WP9CCb8Or9Ag0/BBrVrPSbNwFBt9eKd58Od4P3hGFGMJ5 Nh3Q/vJ0yba4+hK8xcbsqFT2WsEjlJ4U7WDycbpjX7iToERQuuwe5JYScyizP7/vRY+LOz9q rymChQq+tZj6Pc2MrZK9bbKf1mlm7iBbCF86iwxJXk7DxnnMd/WEUUvfu53LOz+Q11tBInji i+W8XL6i030wrIz7eb/1N6gQc8+mv1iQomdJPiWJ2f1o5nPgGzm+gHYZfjr0qsxXfOajSKI8 nrk3lHW1r5WECNOPfUR0yk+HPydPLkNapojT2xadDFi1DtrESjSuMJZ86JQm9514b4oGriIf 94i1raAQa1Rb/z3eQgLp0pt3cI1cfa4rXsaQIFkGwiekY0Za1AHrym0WOGbDB14GAnMSxnYn GFY7PBiabkN5yq563DqdI0gMeiemOb1jh8KZba4LltP7EFFDqFLD8sYq8sXVi1Ea+983WbVA dcBC9Hw/N53O1qMK0uHj3dQ9xV7eRH1XaH/w2pS/smAEriwZ3kzNi8KCWOHdgzxxaAU+m7Mt sHA66XDgI/iA5Z84wclVxkhB9LcaRfo3fNZDWGVdUGj37SMrz0L2S3pXYae7ocxnSNOw2WOB bvWFmPNYa1f2VAFMUfXMceTFtKpyz6rnFKUImbVROQI+B9GqIPSr35W47zQlG+7yH01psVOc 1O/pgEeNuQ++3lfIJEPyeMmTKcLrCmBwuxV39VMPD2WI66NgM1nVFe8pM+BwDvcz4/wsnGG1 /VHEIjHOALIqi+18q7w3LzwG1XM7oZsxUEgccxfEIN7tLyL1r0Atd/tkvucccQdmjvEzbCNU HiASXpS/2oe+1XzkNEjI5mNnrcWmUSdmJlCnPpFw6ff3uL1h8vu6x+NyMsxKKHmnmICF8cb8 G8JvG9WcmDLY/vKZMhnVbgJC2A/5PHqc/ASmq9Ct0CM40jBBFIAvOjmYkLrTXRjFlYStQLjA 3zeJ8VjTtTKRddj/IQ7utbPcoI0pOkEpkTbNR2+zjrCRb5RtmbH4BYyBoYr5aXU+vHa5I+Qc XeF/fR369xJ+MTFqvqP3qh38TRq8d/PnJHOjgjDw6D3jeHUAE8N5MmEaZkNb2nBmA7n0EGdf MCGPf8AZIpvT92LsGC3KJjFOUuIA6WbhHTg/jBTLdZk7A4zVNGk1MXd5FFdLAEFakh70cCfq gUHwOwYl44e5IYOIhQ+L9ausomSdSrjE+IXkYDeWuOfGd5ev32FyD9+H6+WQM4yODm7CLIG1 PYFxlLyzcGh/rJ6Cp0Y3vLV9eBsERM50jqlN6lD6MNyUgpmuuWRDZl2a/bRCgelAkZ3f4rkJ ++S62RkePFGG4xsKD7V/3KGFM+JR4+xuiSPCmuq3IH22/alPH2Y3r07sGry546CKqBY4lasc 4dh9gJbu20a9NOnJoyeMq0A/HHWeEtzTjsHP/rb/ta/TXcGukWx2g8ayN3RDFTzXHzdV3sdL dzwE8QFOjiUtzLmSu/r20CXYXsDCwO5ITuqQ2MKIyT4ezQfWU1nq1E2LjwqB20CZ4JxGW1Xc 90wA+G7TF9Umf8KCWqDQjZyySXkC10lwXTCf/oV8Dxts3i7byhl5QPu4eI9KBX9iCBvCUfct p6V5PxlvDL5D9PMnhJmUwH4nrP0uraBMwQRO+d3zw2DyiCPv2covKG0/TxP6ku6yIlMo4uBE ber6rOx7ehtexAIzQyDfcX+j+3r750Z8y8CcO/N+QjsW9CM5rY4fRHoSDt2Al0RXedzjHqUg ApQU3+rmXz8joFCQiPIwqbcy8IONFb0sbh82Fdmcs2iF5ihFeVLb3WOGNPWlNH3JZOTGl7O4 4dBqLQjiNZz3hulbBwjfZH4XQorn050fvewfwEX67mg8rWQqwplnW4xNr2fMSQWRZ8AfEfXY 3y6y+0cT3rP2Jjwzlln9rLORbIdFXaoSG+FUbNx8Sv7WB3cTRP1GL9Eogedn7KHsrSRTxm6n Rp0nFNVVyuWzk3uYiq6ErWBEOs+Q32Qg7cTjJ+ZQRwt+OZVOkuaLyLB4oGethRCjCPSd2q+W rBQ4kTuDc7kHtEj9Yco++UAM0bA/xP6IV8TL6e6ZsXr4SRseEbZS6QYpN1AciFVfAWIx3D9a mO5BcG4isN0CyxR/v82dLzjzi15B3eB0pNSmjZWgF80XjkLku63JC5G/b8Ns5i+Zh/Tq1S78 8RsHOxGCt5SFXnFs8syKg3VEZtbpeQNnYiHUvdEsvvwdbwTsm6V9p9avVQtF19fDjcm4DSU2 8TlXaBFYcVj/hUH8CJY+3d4/QHzUhxhcvdOBnrpm1NwFBbbTa4Gn+hUhNmmkHo19ewS9IvMF I15QAmNTl83UVjl08KLg38kWSPRNYb/bpEqJ7qAbOrIcDm8pDXxO4I8nsatsWJSC9dGvbM6i o2coy6iQyuIJzKc5yiA9sNAmx0q9aaeeOhT3fJBwt0DBsNMtw6vvA7WAVf5xybev7TKASmYK f4WpVHB3zEwgdK/A1vNVfUOuwEwBjNuczssfcHbU4wHMYGV8m5Pf29GV8jvGkD4czVQWhzWd OuKPmrPTgFcyd/yakRDKyyZRBC47qzHKBog+gfqyyxWfiMZZIOQ7tvX6FbIYhB3MEubZp32g aE/K0cuCeU7QMfMczXao5SEYvltp9Ld/2ffgFawVIt1j35tJR9nA/lK7XPswoXRKHuJGSmdc jkyvbB9vAQG33eLKDhmJhefnIW1kFVvUnFBCE2dpgrhPSnitUgeaebHaTlj6LBhXTNPq9Irs XZEFg7DzqycDknSJexGGpk5eWR6dIkufYTo/+EHpqjn1RenLPf4J3USj73EGsubP2Hfc7IVb TCn8eS5Rbvq0fgQMSLLEfXyevwg31/I4WJEB8uxNPzoWZhtwgy0W94DEWTfJhR/PeAuBj29c nhbju9BeBdv7s7/k2OOE7wamwILS8/GfIFmytmKqKWUiUzZF0qdD610d6Ce6w4hn8T2jc1/k id6U2wjHwKW950s0eeo1ULO3zuhdnyBV+9nC6lKAIYo20gOiZ8/u4ZH2t0aYnEMvWE12kn1F kdorFbKILIr8AVdMmVtO3wXwG2mYxa0ZdpVCfrPwexG8xGoECE2lR/qFQasZNjRcjbUY3avw wVGZRIi8NQ8ezW5XaP0GS0Aw+RXWXcJQmnZpw0Fem6h/YB6ZdyrGzKAN7JpTOe1wWQsZZ8HZ /tKUN40g26q2GHlW86glbnhtPQ82rW98NoYuj3Im19rpXFr1MGTIXlNFU27EsqqhUQknMaYI Yjpp0Q1tocHxNZsnUM39Jl0WYSRRlgm49sBDpRp1XxanzvXZFnLTU5aMoE+QHsueNq0HvREl pj3piv0glhVQ1Yfd1AWtuGHpX+iPJjQSzqV7j5Hd6KwOAtvCHV3Mu8JWoGgffYDM0lOGZoPN jh4n9Buo+/Jj0ne4YqWgAbaCLd2XSw4tQu/6zlV0bFExTeMB4vwgaUcprxSOrU6f3RuvvHwj HTLkS15ZtRINwKb+Y2eKB5kewUqYfZyctI989R7G2L3f26cXCq03x0mQHeHPPp8iaoTurK2q fk7ytipbAM2kaenJfkNuwM+Oh4uO0AbppBiAfenykn6RO+zhD5CLJPTbUFJRM+Ym4hzT7Z96 SyDX45CBts/gF2I3zEYaCi/flDiOQI0nNv2yKCCzx0I7Vmx9ZYaiK3TAUQ/QzO700hhwyNjs f2E7laa/4AS0s+GT0tbJFG1o2GhkOe3qxAM3TuafH5MK9UZZ3VmhV+AjpWyg6C2GrQdJP3WF L7njMhxkFsGjR/rWNeF89cf0UynQa+MvGDl/gbwSN9NKMQbedetl5WHHi8i2j6lynGe1YX/t p6exIDyD7teSPqAA7oM8x5UEb9ts6UDM9o1v60SXZmgwsx9FpE7HTekC5Y2jIW3Z2R38z+My wDnZXOrfCJ+OdRWdFnokQInCsK5nbHuQ+DSjdY/58z7+BGj9gOcieiAcMu1prVM0SPkEhh/e pWKvz/6AWknhklGx6clXJ0DQ48qntPSNLsTFJOmoR7YVZA5taDkeM8kuGTmIWFEJ9x0KbRSZ koDYWQ6P7lJCLcL1fXNK9JVvsrss6cOQli14kLaNoR+U7fE+vFgrNyixSXj1vBxhhhsV312m RDVbhLTraNbAMx2eppmyb/gPlo4gsxRM/vIcnEOYBiPez5+CZSlt8cPMNCnEE/CYJ+xGnjR/ L6z1j84StGKKAeXQiTgZpWegKLQEO01fZQYJucC2Lt6P8RNQIK5CKOlkXVCZCrsdAbg+KZv4 NAiSwZWiKrOKHkkEz3anWZHQhUI8W3EzOLKK3Z/zp1N45R1AWuiTuJ6Nzy3pgK68z+ZFAbxz rd7wLEgDFaMAo1uGhM+rG1jUL8+ZFRPtJ2kU4Xx3SLw7JOfRQHCD8xYP4zZodz2pXw9VvrED bXczn1F+IKwe2tyuOPa93JrHNQFY7il7d0TmTTla6E88BYKzbrhQUxmr1/5B+Ojh2Pf1BCq6 tCrwW/OYAOcKmC8p2tGN+x9jVmhJgn26aPaHgbgiv1fW8DZUCOkBy3ExOo6raw9RDIz9xwc2 SaeuJeELqh7D5JPRuoUdfZooaEQlDBfhHhKXYGDbVHFoMGRPrBcoZwjpBIyAti6ZZaV5qAdU KQj/NvR0KYue0kXQxfqdnfkMZphk6fUCnWi4RKnlPt4zas/y1Z0NliOtc92y8Cf6SVChUNzF 91vx4R7IjLpa2tggTPyCYLGLDzp9AyfCSo84efnBWkH6+aUwE2IC6EU3NuvnE7LAjtOXRLvI 5UccRcR17J9srzDl0aEgLPVdxh43OZA1LoDjVCeb8xxBFR41jC6gcEd4ha8W14J0/3b4WgaN guXYegz5U1M65VBKTTS5TidH6tQQ7Mho7L2qcsMMRO1EbtF4VEnAfuJxt7JcRBFO/s3Nd7AT UTg0Dfr++MMHg3KlQJk9ztXxBFsJ5rkYZmEwfg65Zgro7ImvI1gfI1C3q943n+4lCmMKwgnI 0smXIJKRfNi0qYcdYjynG73VZR5SXsApv7FzX2qjaVFn2quKvRhIYtUfIJ3TbyCMcv0SyNNW 0uO59X0vKJ4kub1EN5/fcM70gEZXw5zrZ3F74/u2NzFP6+ZpBUF/yvIFRE4m/0AdqSzH1x+X hlGhz8tKKzj7oz5jcLmqMngVX3onF7ik8gL9XOmu5keRlzAElMn8Q3cjUqvpIBxWKGpxc+lN AqezNNMyjhPu9Gva2xnwSCUPlyOUErABmgm//ZqT4MbrYgX2vg+JUKiE9k5YjPoKnwuup71r ZRPAHfC6aAm7t6Xz80Cbacg4TEVHkgXlqgC+qW66kytozxjrhDfkL1utFlDW+XhzPjfuDqE0 FGFuSikR5Odp3AbJnUvFs5xGYXRu5zhQADP15qUw6m7d5s1fGUQxg+OrnSPNUl8ofEKcynC+ NVF/Oh+wCwo2goYapwGZrtaxVTigCZFFBjIHPHG3gSbXRZK+tQsNHEdZnq2Nn1XzkKNYQrLg 4PTMU/7rK+4I1wdj+Pb6qq9Hm4j6YFubl+F0n3o2l3tAnqtTRqaAlfGJAyXE9LQLgSvo6YN6 2+TDrjejMb/aZv3ToWy+5B0uoPjMDjJYF0cpZb/usA8nQCNToQ9jJZttZcvgMTsfvdi3WgX9 Z51v4xoMtXGjUsFE0oUDvgaTlCF6DZ9lUzAxabt3G08SqAb5n878pc/RM312aRMkhZsjkXiN 2wbQVsLGeTRCOD2uDaEsbnn6GPmBO12lRXXnc7HX8Oheg1NYDVEMnsdF/sy/pDkNhw252MfR VoNQEnZfImMtrRB0L6Bm9E/p6RBu/oRsy8h7Z03P80ZfJEBs2WT++gphKgacsosUmly7IM5o 83GLw1tB8plRF8Mgd8hVv/Nb6ctpFBCF+RCPbzvmE8tgWI3bQ8W9PV0/5R1UMXxxitbtggc0 v1pcV8PJqOqtwIgBt7V6l1cw5dcnpb4c4A+i59O1UaoxRIyGVpjevJFEKnKO+XT6KbhmUzbk Oo3/1D4LPitxDlPVGPdDcoNfEaVFriI1YcSqqGHQHLbJ0xUqXwPxofZCZHg+M/SmKmHf/vyk j4q5UWka+IO0uvQIptdWQrX9FitUy2ojwMNb+vOdEqZqcGobd6/HZP4CMruE2+qMZB+olMbY Gz0XF0EWpmJytreM6sci9F2DoLKE4BWp4kZzZu9jA0cvD12Sr7E0Ir3w3Zblk8nGGR7bcAj9 PtrZfSvKwzCS9LploJRQcRAyVvPudUn0gXgHSxzD3Z5PIBqqyRdm45kEAkcOpowztUrArHfh CiaQozmzAPzCFKSjv6m5o50UyzztSQ9/G5mggnSX+XqDSbkrb0HNmsPWxoUrjVAkCcd+jjuV 8JyHWLP+sAtvaJcQg0Phh39V8Xp2j/3On/1AvGxF+2qS4v7rBvBNHwhgre74CP1Fd9hjuZaj Idi7LWKMJ+YnWHYUoa/ocRmCwEjeakksryRgsCp3g6rY7WBjtqXocslaZGYQGOuKWVodjXaB GNzC+IMsFCtqc6pUeDJnrUHbGNWC6bGUWaWM1s5BbllC0Sz7o2LoPV/fX4mhlT4pl6vqAjiu rUannIIKqNrP1Nm104dBv3Sjb/YjBUWOOuG+Mb9/AfiAYMuV/UOhTT6QMaGXTXvDXz/rCqjG /Tgv+ioIer+qhBANdgRAaPsm68APJD+vRMB5WJDZdOpjIZNG3NvqzPFCP8shMFmhUzsS1KP9 92IZVodpzPa7ntQj1eoED0K+1ukrdbLz8lBh5PezyGlMEZc6k34ATi+2ubcA9pzNZHR43hLe V+0CiCwLpy18AalSphXDvtw6VB5tk8w3mqzZKVKD6C/byvAZOgvCjma8Ee8aLgWRb+P/ZfR5 FvlzAN1Fgw8bDf4YheDEoAlYWW16DmPHo5olDRVlxdOqES7mbaKWvzyDgghmI7ndx25z902U rMHzeffvMZvqYPw5LuxBpv0Kd31I9kcSnKVgk7ZbDhdCv89BsT3oUTvgfKCJ6KRvE+SrKfgu gbypWPczm7w+iEdJcR6qdJgmFRRLFGxDXeMppmG/feZwd4DxpgHfXlsgnA5zSD5LU4X3n34H bu1pGyIEoYvG8nDVW3ZseRtGfj/SKXbc+dXvl6tcXgDnXC/OwpWJZnmfHKwVpLz5zFUmjnkL lwlPZjNUiyQwd3y20m/fgAbZFc8nUON4an4BPzSIMnfy/YJs/cj5sAB/140B4d1rYmQ6bEju cgfESeOIQimsDyTQWy2+Y+VvxJxgxxctE1F0lz1hxbatwd9yURKwtPbbdY/zypQQ30F8zNjv B6UH8pPn+k8sMr5RGmaAlL6iSc0b3EAo/rQ8cv2La+ZeWHq80HtFZ64c6ITOjT44YtRJM+gR Fl9a/ZFcYXeDHbEg4DI7sq1rpILAXC0i4c+DXkG9AawJ1b2Oiq1+ifezXAKPya4B1VLQKJNr PpZDe9S+EZ8mtgz9NpLdEfb4BnGKthudmweJqTWoRgJGIkKxBLqTX+hbaLL2eK7Xj54hRSyJ 3ukuloLCSgLNA3klVxCv9ps0GTwagpvrStQEAruOexzxE5Tk+e0o3V2tpfCCSPqhsOH+JRc0 63wLM5Lc1b3ORGFHnJCWlGmSCiTnbaI0xvJb5ytIv04YgKdOG+1iTbsZRQXl+F4bUZ1TRyp7 MPwMtPhCg52xcTwg7bYj+pG2oobg4wkcDz8zo37xQ6HiDpNxQfUpYN8nuMEQlHAb1HZpn7I5 3xHBpJ7tO1bSh7xWXaRNknJ88zs9Pj2lGAwHwmTy7JaFiEhgiO8LlCvbTKU8BpvL93lLj4+w 486WV43Hz9LQDXQi5PTOPHRYHSTXm4GH7llpQv6tS9C5Ecv967WSDrw089dnuOZbBPmoe61+ af0HcaohfXXApGzuHkOu+7z99ssa3mYsk/7FNLR38B0tBJ6gl+cdifsjIRe1mH420cMPUqux po4Hi4ThXGSp79EV+nFoV0J3eryasNwzOB3m9gvS7RPPrafi33lTD9MH6qq/n4D2JWzJzKxb BDSn6D78xPCSSFd6FuELJ05NHJxhvmQtDq22DfIJ0ogvvmGugj6FPLILiNfbxTPJbd48S08Q lqJpMpJdZ8llw+B+4Ji0Kz12FVaEy7+5aZjaEuNhUd192Zh3h0+nOAsCV/u1Kxeox2Wmatd6 DbU+PG5mxMYZro3KuYS6g8ot6yTBDrQh8nbwW+fRV2TptHlwUmlLjWO3oR5JymbFAtikq4Ts S+sBedyC3Z1Rn6UK9reP+KK2N0EguUjwowi6FGWW9LZGm4vkqpWKzFruGV8hGu2WvTO0i++a Qiw9es2ZlT5PWsp/pbt50BKKJ6vKe61GE8SXCaT2LwFde5Kz4DQmwxHFm1uIuWV1lfDzAauP kYtdDFucAgv4TWZlCA4zs+W1w7F6xcSzkoTaMPoZ/R9IPVZR8vUbKahp96PRXR6k8EUpcCxd bozkcQ2DjHQt2sdFkk4IlGG4hPPBTrLVBs1UUNqvJ+R7r6t0IfhOoHiAyEoGOBi70mLVx84h XnC9Z/X6EUEu1YO9Va7utfl+vo/Z4sczzBE9bWHVqULPyKNfwETTMHmmHrufZafhOrBsIsLv bECfXTDr8U9F2TpqpAvHSCTz4dKkxhSwl8qbzzDe85Zhxk++rqkdhJKnFdOaJfgVYwTwtG6k z6PSH6JU7FXxPqw2kHT347rbGcKKKwRl11oc16qGaHarzYwPTto4+cEec7hjMPM8B2bdD138 HfEhhN7yapAOhKCnPb6dep42ZwB5ysOxkRR2S5qPRYaqvZ5en0TJfSehuSX/uXsqUZ+Zb8cC zMeXj+RJA7rg2ewGwesSqGjZehaSO8/A2huNYiTKXAwvOZcN3V1xiy/SUWYDdufk75IErY/x tsgEwlbe8XGdq2DS5uwvN3yWANEbWgbeae8kYIrdr9SttpcT7zv9q7o/XwuUzosewg/mrUKb U1/LGQ/hnxKXIbwuPanmN73YxdcDMDkUmDYB1a3kdhdD05+wRHOs4IDzKjvkPNTSaK0PkqRX rzo3DK397p+m8YUfAkBLIncjiAJqdtjJzh8dYZDKX6VgeHGzS3+7AdyvP9iJLlWa0Kech83c hz+ssR5R4Pom6FMMZlgb2DsPpgwobe6F3G06lFm3lRxYvhCZUhCdr0bU6Lm3LQky1cW9xZ97 1wqpAbEPaVWEchoOM+/ANcpAqMKaXhLJ60txNsx5/NgsM3q1Cmp+jlJH29Q3hLi1qMdoQUNF 68ApNkoRzRx/REnwWAro9pIV9Gy4iZtgOe3SnrtwIg3YJfnTJeaTr8DRXsHN6dNnxmEfu8FL 1gsJi3g5pVCYfp7ddXCc6A8yAfknMr5oq4FOokORNU+ECtAaZjXPDjj6EO4eBY+WPPcJJpEo bQQxpqttmjRF1uQDnbSMEVN/tk4gXHOV32tLWw7p46nYxfzH1biGreAdOKD9oieXT8vrGt4B TDeGnXU5T9q5y4ZnDMCKFu7zeD5xAz5u50q/tvSWlHzsRWLS50x3PqatQ3sKbrosx3ZM0tFc LCl3UiOt2Qi2Eywv8RluQEvG/TC/u+GUi7+UIEBwvEaaLS6Bu/+BO3ng2OqTU27Qa0fIudTe Y72SDHkDES5s+R9kgMZ9umSI/ncadPyY2O7DG7aAeEHpt1wrj2v79z11jLzwCJPiGaoNfMdW 0nFF08z5QFjmDDbh/nwnBTpfndlRRsW/zMghOMfBQp9EgMoPTTg9tBTUvHibgOg3RvPdY/q+ VWmLUees0laIb/3qFuk+In3QBYUfW1xtIs1pisG0lwZOsNj1N/5KGxM8yPip9TgXGTesYDl3 QNaStgKuWTsNmRPSlSHHu8/LJrtMH9iFCq0tO818wJPh56A6trQXZpNPMybSd48gBPX6Da7P m5HP9Eo3/cYXFgPbQ5ZsUXXCrCdIM5P1U07gWYqrY4CYvH5pxhZ2uH5jmKRKfwFa4yhqg75j kLgFt8UY702Z4j9RVoDVefJUWvoHCh7pMEruemxhFdRL2UBYCj24VFUiT75qj0bEeBSak6q4 u/oxzZ+M8LxwbjX+GTJq6pp9VyUZ2RFC35jLFUe6fWArPVxHmU7gZPzQezx60+09I7ClVC6F F8LbHKasEbJ0CZkXpRXmfleGf4ake+yJ1SuMOi7GR+EC5Mt6LH5GhaKzG5mxpO+TxSB17EUD T4ZtEiJ8gTU9mNZJIn5YA+MwlTV7qi0HBh1fFaGEe7WlaxNIt8SrQeadaLYrIXwV1HWNfZXO fOdlGUjlLoV7NYyshfcoLMBT8vhKzzOlRoRogc5EsIrU2oW9KAqx3su7jNTpTMCwRS5zScJs t0gwDA2u/zy/lTAMX9/NVehH0p6k61V/fxsGyY8kRfdk6Z6b6QDBX0V9mDjiFxDKm07W4bQZ AS9/QlqWn+oTxPNr4gKIQDry3jKQKZfoo5TyyIEJ6Y2LGSv2AJRtiaw9lNn1ZDl6lQhHfUp+ q4XiN7R14YP6sysZY0YOL/RfC+xlduONgITPey6I/QZpzHZM4CztJrfMnDnyNTejPiUJfRXI sQI1zJIZPq4M9Ik3EN7w1nZmX8lJOV3KCtsihM3vVcoZxiqD7ZkLFlO+nguHcNphsuTekoY3 V1lyzNr3P34JLWgbfdrOz7dNyT9bw9dB2W2NEJN3ZFD/XTnueHQughER94PHRotYC0s6v+5n ML0o2kgBHq7+qJfL6NuYtNmWLi+ytfKPQ6AwdIT94/WBa4CpYRtbcW7kIGjQ+0UEVRpA3Y+r NnjhPEOMxSK+gW8y0BrNPnZu5xL55WXRiZCrcCFyfEuz/eYGEOKsuiS+PN2E7Fa06KfE6EpC firga1enJH+mgwe71a/pm/f6oTeRsWwYcTBvxxH8Z9xjU/x0uzDWmW6oZCh/bhiFybqhkzMT GQRiCd0qwMbe1/Ip9dRR8Nm5qSGQF5dEuHMSzt7u9wjrYAKnTotZ9kRaPGYwa/1NBcjWXmnh K5oqhoDS0ZJ0U5ajqwP4XTg/0seaM4l/bOYKE74Ghi+7Ufryp43e1JPeBXHzuaZdBwPrRNv4 UVRqX+av9GwSejFXSHetE96oPGZ16oE2V6YOj4QdKbB8d5Oh+oVED0grzMszCV+ph6fZdntI ur60YHLrHU11IdYBmjdnvvvb66JHpnBxi6hQnsj0+gYdhMGNL0WDNo3kcOpJcvnktD9R8AXY /Uazikj+2lzJgYllS3xXvpI8pJa0sN8bLK2Fs1ZjLOMeNyQgjeng75+0Ve2Mdac984E9JtTn 6loalGhFaXO3UrYAiesTXWvX5YeVaifCTpBlHpLDnTNj8aXRXldpyjX4xL2qGXcmu4lNykwL LWI59eToK1kz22VIF31W4Gg87op5iM+2SCGWKcy5w4Y3Q+NkHzoYzKxjHQ1HB+7jXNcYV1DJ 2hKFS9Hkdjb4PNK8x1W3/CQqUSpwQj/g6c6h884nosjguI87cnKFS0Coo/chTKxatnw+idRJ 7/+d7UXJlKyCjXlKbgrWPgPGtbVG1pu/HYfJjzRBKm2RXjA2GLY4FP24BSNtL5Eg9guqMiY/ S0I/2fTJbMAjgsMWjOiyM8ocvakV33RbmZESzP8KrJx/XVmGJc8dFdaScQdKKoyGT06VVxd1 gUWh37sROmMFVG1wj9nXHZL/djR0DTavlIjYlsGox/KLw2+1FxHiXqe2UVIfjcpNEEum577Q imaQR++i1HDWjgcCSeN5Mhh6Z5t+N/g5/SsafrOcnmRy73CBWBND5HPlQE+ldjX4EGbD8/hN NBSmY96+Jr6ibmY6EfVqw6F+BS3guGa8KD2qcRphW+fRkGZaShydAHFPw2Sj5RZmaFbPLB51 j3qHxyIe/yp4Gb/1zSXo1AVMIClPKr+O4fwyuckxY721jGa/YWaSJcm6ODV5/8a4bzAsOb8q XaAeuj1LCgdzz6pkQoRXvW2+4ivpeP8wR/iFu7DavnDKEi4mr2vIdTFVMpatxQ0BGudTHU7w PgFtGqZeK92xnj/JJ0lwsOjNjH8hQROufk5SY5yuXnJBgmXvj6+ztV3xmLhJP/1VW0zINryu S/+Gz9+6DtnutvUtkuDnPDdVzU47TWdheN0NuIc2YutBqi0njjAsoYjg8EBnSI5s8vDUIR1+ PpyufUypXg9HtIYG+kgu9pKt3NEPrfkGpUln+yzeQmldgH43Mf0NyuBHLM2oEzevpi3YheT7 M1nAsHibtrxc0y3MWJT7tAcItA5uwFogk2h6gHYfiKF4GyX6dTigxZjBuWPjGhfUohLHCOLN fYh8W89QyuA08Z4T9Tj/InM1mH4Mwr4MnWNQPTuJulCd60lLVzxOqtdMl06I8wvzU1AD7gvF s2ChdbeV6fmzLCT/fActgwGpx8PcnQM0SyLHLHStEii0kLYpbdg0q0aArgnzvhDc+QWINE2c jqr88YySi3mnoZs3gnyUYeQcKw+RE2GvBhQsJsH78h3BucNYV+nqcZKjV+UOSt0JzOrDA3To XRuIY5j+VEnUG2iOVCgHjN71eXbDn+3MZbnuIOa2auTwCpILyTnapQ8tYYHAqsR1xv0bviWV HyIssjKO/uQO2BqG+Z6ol++oS8CgZpHL11YPIhscSnNsGd/Q5aCsg0NPfvce0dNYyM5M42eJ u4OAq+uqOtIrj4Lgoivli+EL2ijMtU6ynAoIPujVBldnPWV2N7t5RPoHJdqdanNKWB+QK/Yk mtF8+QgpT3Np9xW3a4N0/OHMV/e3GLgHD1zy/vpBa5Z8M1ixESS5klaJQzsmcFiK+zvnfQMM XsJLmbSP3y3k7At3fQRBDXGbjuN990N+wlo49FprGyW4JrLwpTACK0tmlmCDEm0o3HBgVfdH lhCfQIHKWcP3g+dDQjoRTZm3r4qe2yB/eocqUMfPC2mSktxiweqauZEJMT4PYcxE82zt3DLP TV9QzCltzKq/zQTydMLfbSvR73Bup+dPgtpRL4VTcExrKeaRiLQ8yu95biVzIyLeysHlcb0N WSkTJXDk+5dKAtB2siN6L+r70T2UP48Bax5y+TQwHbr3ISer4w5q7/xlIfYr5HS5ONh/sstp IfWUH1QuubM/22ttDOW86J1judKCkCP19HnzPL6M+8CMGmnYUWiD6GRHBnYNzHjapSESEQHh IcqKSU+9noMVJY5D4gm7HCB479CVf2TSQaEvMEzc4yIjpzuHvuuTht1QT48KlNOzfJc9+/WQ CDcdHFKkPDgcD9gr+OPddZvtD14CuXm/rBchdRV0Ij8WJlaTlg9hhynlA2dDeWjmWC6GCEig doKOzVXBnSYbP3bgeNT1MNgr5x7XwpEGOE4kbS4rwKujh78zWtHwI0IuTDyvuISdO6sIYneN JKbjLnNMqc1NQbabQkVkUR8P7saGx2EIzqvV9SHWgxjT7Nq4vLgtsDf7pWfr9FzmfaEhStff 8WT4YtjgdUp92j4gKIYeXq9EGOGku257gduBj402QOvwQVWgvtwq03qvadBMYCs5QxpSFByT NsN4FaHgawt2plG9ZsIBrvH8oJVtEOdlTM35dcmj+pifboO00EEB3ATTmWhKGukZ4fMOPhOL IiOl5t5mTT5tmPdiG1KNOittHORn1IVpP066pJc6aIMR7b7qFc4Tcu3GPEYwXimLSW4vDUUj +RXKoj3zsJd/2JuEqEy8O5YmGYcQYCKJhtX1P2QBa8X3h5/RCZK5MFJywHq1w7efDcSO88hK nE+5iSLVEn6QjTrFjVqftYLtQRwnSsF8BcjxpZ5nufRoQFSyVkYRgZqE8Je/5J9hIqnLLQOW 8951oUCooD9Hjmb8RAL1fYrhR9rxSmAY8u7wsNzxgENW+zLqF8RmH85+md3lQY3LygcwPttX N1uvQY6Q6/hW5J6IYlcU/MqUOif8HLulJuHrT3KOvkzvd1UR8aM8R7TtOY6SjcB4ar1E5nsa cdKNkc6A6+YLmvt8L69Av7WVLK1PbS80cHxmVv02d+bQOd6Wuv5sgesgXyvUQKrzjYTEt2ce 8x6q4nRsYTtST8/Oe9bkOqKS21/qcmttd0ZANU6xjnQ4SpYXDsjd3jdnJCjNdRU5RGLmMPzG In5oPJq1PPQZSZKtQSIEymsQuGlOo0pAWhw4s0U6sheeSdciLFlk3dAJ9VdpXlZGOP0OLaBn vzFFJ2NBRhhdllc4rDVJufiDQSkknOHYW/J+Rnp+RP9RP2+BTFGjS4ooUyZBuosnQwIk9jHz /F8dl2VAk4/3t8+9YIzYYHQMNrodDaM2GkQdKSjoKOtrUIqU3nQKo1MdCIpiIBb2CBUBFRUV FHWEig2IiIjy/J7/efF5d86L8+ZzXXWrSHcyhAnf9+dJqp8KMMWuDvNfGdK3aAZiOrtSK7bI y85GgHLvDbCCmf8ljiOaVgV6fo6CMWqDFo4bCMe83+N17OQ/xqhAs9uUpZC4ZACFjdOLogrk 0zCRpZLmrjS3c7EENP0igja5XdMF45Bq6xu5T1tBtFxnG+Uh//G+bnvXITiCzX/ASkyYGcTw pVy65mOFg7bj/9M1EaKjuv+P3zFrIqH0+BedRzMxcsEUc+CgUhUOk1pgkf3h0jtmnjOsXe/h yo8wbENcwk0DbGzlnrDKUWGNXrDbPfanaSU97Gcdc2eRoh75Fb5HXykJ66fZ40tYVzp0iX5m JjMUaC3l0vdlhQqqCUwllmqRWldDLYwZc8wz9KTzsC5yrO7Nce03mr59avdc2484b0js+a3d I2CcnoI3g/4fpk9ebwYDHZzYbU2RSRJjzxVZSH4izU2CxvDe+/VSxgWKty+lxMzECwth3T+n W4p6yjjqRxIG+gdDg3dJI8UKZ+87jHnErE93WksqPlT4VEMmLEqoQBdX/S9dJyvwqI+AT5Tn ET1Jy+PobBYl5AaUZ3q3xYdWScH6gA5DxebPvRDr5lxMdy3aQDjANT4braAo2DW+plEeEQS1 0pD+1CXXEO95l+PgyTn0b0tu4QtQPFwTXNoQEipfefMJGD99XyfTStgwRuX/a5/cH+KnpTTU 8r/mo1hUkBL+A26B74OR8MfD2MsZxcgWSs2YTRioUIeUy0deTmEFVn3DIZHo/YRooJRcvikz S7sIsoI1l17HN/XEv4jnIktHpnKzZBsE8oEwJmMTELnn8QmIUHG50Lbpe2ysBilYzWKr8MOG ghEFVVYW7+wlktIMzXnVY7cwJ3oPyKWdKnta3BfKYsIzlXv+R8P+54Bmv193cO04zMN+wipV b7wSBEe88/E6ZS5m3zuManTv8/cMLoxxAdZ/0dJTcTEJVNdpW7aeesY1/nxEpe19lSOIrICG Dj+7/XYfxUR/qAWpPVW4itebuBM2xAh8cc6RIQ59PVA8XoYRzQ6E9E8D15wnyoeDm0OQ9XRh jl9R74kDegGSf6DiBTY2xPeoIUHDtKkqcjNthVi/+yn2tbN27ceadrZQNbTKah9o1Ls0yq68 9QZLfTPUX+ylx9LT/aM6zutuAzX8zGLZX2Bj6y1l7bfIGU/y5g9BtXhLgFHFvMHCMLzTdn9R eGMoGnSOXxcTZ7fTllkQKzV9L3MNH6m5/t45KV2Vwwo6ugIa1DtTpXKIJ40taqIYHuOUAPGa ec2CM8ZRpM9TI9YPWeechYM6YnpF4GkgbZiKKokS3JEPRpcMcepdgrckgTJY73wSzs8VowPx P810Z6u5oE87Fg6m5YNFAYa108G5OdRmBOKMigREy4K0bvWsWAf0jtJp3X5p2NOugdimOfOx +ZHE3ZpsgV0TBRF47aLrMn1n+36NJLij7X6YUYS4T5MleEKfg46YFnfzprJ0yPKKj9S1T8i2 C9qLDjhtoK/dfn6hLNEMKnEllptWXxYBW5f3wvyJgh7oYLuiWWJp0sBSppxQ133eyS25TN81 h4cthdgcz5Y1x2AYkesfaPIQ/UQi7shkdMEfjIa8pfqWcGXMoEm/Niq0RrW+gLSKBsXJh9iJ ZY2JFsznfZixclU9DZdy2gL0PuELAXnZZSZAFf7jXaIKyctd2lz6EnXa0BYjXXnnRU9dSTeR mfGSu0HIlKVBX3nI6xdOSBs01o8unjGV9yEJ/ENYjs3WsNrcV7br5Td7dV4YFXWpVxxW3gC1 x6fCg3ySsxbNITdwwq5caIsFZQ97pW2SBbLI+wgvKssmfHq4Ep6JhDjM+gocl3AwPhFWj/l4 XgiLrIhvTvZXbztUTopnTq+gUXPZ1RRgmjHQZoyAi5tYJ/FSFjVg268QflZZ1SUMpXWHRMET jmg4Y6FzM5KlzAw+hSVwI0yA4kZk9HtYbsMuRvoz38z3Hdkt7uRjSjBRMrCNaVs+nlHzGazd ymYye3keWF/b3Vys3KKZWqRtoDtaEZRqGi22iJtIr5zSElR8lwoY/2KvDO3D4gWVlrkVCUpa EuMi2D5lwveZaf5VMkveSYx75WuA9JJTRg24NSfMdC1gsLLr9kU5lfDwFnbwwrl6muiy+Bw0 kta3q73S6lCVwlTfSKfYX8eZCaf3+yMxTsTbsg+n55WbCciFqoDHaGu8cyby6Y7VayJFZsb1 PwxCGGTIKgsr1lbZ9/GzbaUsxVEuR8dDTSFqJ1pxKctGLkdGe16fUM7GwM3E9ebwy8bAhdMT fjqBRebjok0npbPYvP4AFEg1ZiOddystIsV9PKXz3G2PODm/6DMAFDEgjO3DYtWlBRgJhx87 8vq+TMONf0zlogSPvIT/3Zw07aR2mRDh3RIqRv5r1WB0uHYMq3k181Rn+MIQtod+2nujvnCv vam4oCDgKrwYfsr2g64szJ2obu2MfU4OC657VVH7GLRub6Vb5iQM8nLeK4cj3/A1FR7d3mij bNEoVBma9id/eLbioKCFlfLNcMVOi+YNLpXAZu0pMyT7abqdoiy253u5jLMQIzZF4P93cdOb GKwkve3AALb0a0R6Yvu0631+zX8kbTeDaa5uBiazEmoj6KUyJ2tsoIQd/EP5gnYsluAu0VFd XiP9b09KMEmBtEhfT7iXS/mOPvzNPUOGWRF3qY7eaS+Hcrn0wtprCn7q3KcE8kNKcNBRwe6f ktUKJ/A7MzXx4SS+iLAUV0l/P/UGW2F1rmOduPDhrCaouFHfKignxKiGmdNzA+onaJ/qmM2w rLvtpw5ahFvkmcg/Fge55k0VKcHqUXgBrIxMnQjpJl+tq91Fy3LH9StCae5RspO2VDOk72yd C/Z+VADT0h/u43gURO/P/sngn7kx6j8aA4fb54EszwgOZUniS05NYU1Rd1R1L6MmYN90li22 7sHfIe0+nuByEaAXlNUsD1XUUHESGNbb7T45CQtgzT2njW9roBGSUH3KIhRq7F8glLa7in0Q cM6lIrww1Vb5gAY76kc0kCjSY6IaOw+KzMSnKzuv3kDcPO10+mzsR4piwEHLiSWDmtZB93Y3 8cFFQR/5gPMKguZLK+D2QkR4ClXDWLhniqEjtVkICqvuE3c1Q2RnSIBOaRPpF3b2AqvPHwmH 5Z6a7zyZ6XjkwelGdvsFV27wVaAFnHy8avycWqwW07ALCiIt2e4PnRDnomdN07LR80xJ6EkQ 2bngS0uErfHiRBKHLFRbF3uD5SkVar1LFXhLrmkWEnm3ISOG+avckWMNLsGadmYW919Qq4aJ As861v6bsVCx3G/yRk1phMDRMvpsE6Ah2Bnnq044EWFm4tMRuT3iHnTRsy4HgrVmRTtNf5xJ UE9QVr2whsS9Vwxi0wqj/Gx6hWzBTdpnEZWRluukxEjYOcr8kcDb5+tDryZYma4RGzJa6l6x U2ahu/35ZvvCFSBL+t471yvJDeInWQWZMLOPQGSC+5RtyDyq/G0PVYrvF5RSKAeiozpt3DLr 82AREPjSjmAmC3UCdzZ2l89FLB2T7qvwv61JvBG6ulxk5AQQP8hwDtzLPUhyp10w23q7G81+ ZD2NKcK8wyaUZK9s6jom+WwoBsVf6462sxf5nqLEAOU7XRZMugfy0HHo8H2ikwRZJArI296e MHtR5gdFj2WSMoSnbnOlOJpVZAOYsOC54VVWBZBTB+8nCtqfHC0rV4t23YZKLvJl3bWIyiY/ NeCD3Jo0Iwi08v5uXSCPpukiZqXGDGfsTe7GgNRpCL/oQ19jNkWBDLEgm+RG17WwzdfTimXI 2QzC8pyjOzGdFdiiGYrj7doa1y1yB2nJ4+B9XAHTUmCm+s8BDqLaOzWDmyqo/rc0otywefYL xBm1395zugf+IyY2Mu2wb94X8SgdAXM14C+uvUNrgSdNkPe19ZphrAiZJSaeLzKB8vCTrPU3 IMvkp+7OntkHW4/fjhBjlH6Ek3VBa4PzV617r4Jz0lEUyKSPtxReI/2aMdCyvp4D6+jbutX/ gmKt8IgMq/UDM1MAdGzxNQ2r6+BqvU9O58aClERFn8X4LctP328upiGP/XF+5IZOlNNVWmnc pwA+OyKjeSkvT8pcuWYO+43CL+dawxqKKOJqQHy+woga9yl9AxUorlqR1w86z/8r8141YUg2 u57qSpOh1mClpiOAJ7skYu6fK0AyIuN7hLRo2vAQuJRl4cRjHO8BPX9QkzMTXQu3Vg6UIr4P 28V7eJMPyOICF5NHx5hppjapASgOH8ll6XRgZRWDQkzqWs0LTmnd2ciEAEZTSl6VreZB1ECW FLyqfQ5UGSEH6J1ZJvBN0nTxvlf+Ecd1Pui058nwMVtXsvHB9q7iTGHyxEMiRxYpyzvHGG83 6mmGk9d0Da+HvtsJeH1axfDvwZT9GriBX/cNtqGBRkOpB4PJSJGFHvq83XL1RWrBk9Msb806 M5UAgm7aQV6XIOsidSPQcJukc/N7PWd0YF/GaaF1+Ly+w+U69L+eB7jNhwbltWb+EAy1fySh J3h+efJTAnBMROUadusmH4ih/pkvYylojprsw2FLungcVKv6mXz1J6lU+pfqvbNgRnXVONjZ hQOrRi/CZulMUWjfpBYRasfKsos3JbQKfnSjeWzUoKYLqy3/WsJXbHGw4gbBZ/+BFScUffww AR5kGeIvvW7xx92cuBpNF7yflu6Ci2gA/g3XqgM+VWQ94PsGXdNxpW2Bm2GXPiurw4WoFsEg J0QNw4qWY/Q7sE7YensapGlRCWpC1oRblmXfF3G/T/PrMz0EOUSRnTqqqAzhvXIezA/7v+wP 9gmA9dTiOAVfg3t4kqZJkhlyRKZrZrCX8SHVRlz80otq4m1U81FUsRtobTBX/5OU5UrFdEuw d4rPlkrP949CDOUGh3ZpnawMbqUCaqU8cjeHpJCg/MSyA+aZ9W6oRaVKDvAWI2y66xDyRsIT pJoRjKYO2dszUS520qJ7LSNJCCY3r62pWq9p9UiD021rxhKcwCMT22SMnMcglOvbZR4ObXWS 0yL/wipDNSoIJgFace1R9TJ/kdYFJzwn93Px5TAF9Grdcd97ILD/QCG5y74nrN+c/fwqx9r5 cSMsDk/d+Vl8Nj9VwYaRhSo+tB0yDplK2QufPtf6Ze8yuwAB+lVIYXSelTqGYPxw4An/4dJ8 Vx18U675XL2nSh08pI1O632N0IJ3bkWUdrbJJ0J2qnnP2dnIBStWhbJ1J2BL4ofm/ORnxAO+ LhX9hLJqssmIIJl6vEPj5zcfcX0hVoB2O5Wa6CI37FVeXCRSuDfuQEWTYbgMVtmI3LgixYfA VrNh84PF5ICeJU2kze2P2PQ392RnNdkzUW8bX99EY7yUt/AmiJx7ASaw8cDqXtWDz4Bo+n34 gYbFWfyJT0z/V4LuisVGsJd0VzD4WCQHW9a3PMob3o1C1WJhSa8y+SLhwTPT1Xd45oPiRWQr 5pMA/tlHa1deBGuYwbt/57LetAQC+63dhn2HY8SogthQ1tKb75cVspw+KBZnPl3grpvTXkqK MXR8fhIdoATHqmZcgdzqHdKLvPW20Pe+yzqLYRYbbxrauQIqgjRKkbwMQeM4EmhYIoz+RLfe DHovzR9qnp/dMs8Dm1+uX71Oci+Q2pnNLpGGB7IE/gzZL6L8ntmvUGclP1FJNjYH2+/2L01S tHSQL+UyihpR7Kn/ichGywsviZlxOftjIcBjoI+3zrbMboYJno5uW479MIfauzImiRE5WyHz TZW80vbeTeBySPDH9MFwD6yrKWeeOKZkB5NB1hSPVZabIEksXsXVjFzp4HQVrbL+7W/arW8b pHjbEP1OcK8o6GqAKFM3p6KLkS9gAWcpKWYgdQNWWX813sPCGgV/inB0hyNbfeldr0JJcrsb 9oaPt+lrMTRKVM3KiesuRHCX9nafP+NUWgN9zb+cZHmVye9AoeKxl5GgZAIc5Io8szUNZyEi c82jvTPm3lCNDF69ww5ehuZSfNSzGKwEWF/JqK+zmdcgaWO0ZO/wh2HyxoWhhlinVaF9x0Bw QhH7i0yqeEQ40udBo4hW30zRAhtupmeuTxGPUEIvd1aMpUrzaaGn/p39Z/bvMvgxXnBpdnlO oOOZvp+FLxJTlZbUEFT41PLU6eqNzq1vTQTnzTsGrPJA087ztga2k0XIKSJKF/Nkqn0abHj0 s81dItdpejbQ5nnW2bTIUtrpika2oyu6iJ5oV7wJv7LvvRji+I0wX42h9sFKdeRaVaB+q4+f v3sx2r7ZjVymNOtyYMPh9o2HJMFob8jxl9QhXbLpMd/tQp8j75/yYYI4WLShI+oF3Kr8MBM7 6nMI6jBBDTWbJoahCc8Y2+Bwr1TtxcsEtFDoWylRniKHDPudfXKco0Sz3K4eUlvf7i3TFAU5 e/QN4lPvZUHZpflylcfBY1CFkw1toLYgZJuAsBDY9OWSPRdqg0cetGf6q2kJjKl6c1Ax2TCg wdnaDD51zwJkuygb4NWU9RnHhe318GHjXOBzwbwKvHo5SrU49xnv5FdOsr21LJQ0TWz/PqWL vd+9a+ZIKbh/qObgy6tukecV3K7zw9albOqG5y4G69P5IWpY1Zv/oRsm88o/isLnFf1T4hpK ZQiH9Yk38seIZjYAgiC6RBLqjGDzKa3yuN4Zxw1GC9r2TVuwktsqCcO8Fz6+QKqYavUTPh2p 0QSrbS6lArbRHkD+bD7k6DB4ltC82160dYh3ReoUIs2Yig7ua6AZPKZUX7ADP5ta2qtSIFqe l/toHrxdZ0wMD9SCv+OnEKC16FnKs7Z1w3B+UcQGr1E/6Jdsos9cKfUUWWvJ4nFFCeaZ+UPe rI1NqprIJkJ5qK8whBGciKwmPY6/p//+S/qu1CZCJD3sTP9WpfZCcVIG8NlZlV8v3HRJEwEf /+9d5ZYTFGxGy0BpTPpYrxmaqXuKCqYO6FwVMcEaVAs1B/NIlzmQ4fx0Zt/otBewJZuTz6Yf LoTGPjXPFNGfa2JwNo8/xwjg5yH4v8H/X6L/P6yDdLdWWQUR5K3OTgTlBsGOmCdC0TERJSni yl0CRgzxFBW0ROwmjq9FBnHE05924PqKyUp+ekuOv9IZl6W3k/IXc/LKVuupuCjmunZnGGAj RPHLe83Xi0XKEtD9osFTejFcP1Qv5wdfLF8KCTsyd/4SbQ1NUVR9/akHHoTd/gmiH8TWx2dm 26iw/ZFTZoTzLOvM2GOGPQ1u0TFxpYyGziIk7zMh1ra8XkNFX/2ktIV0aggmXWRTKz+/tBbb eHKjYXl8feSjWyL1LqR00bYP4Vpkcc0Lg5mr78q45vXZtF9GRTLM0U8PwmHF+qmvVdfQa9s2 PlqSFnD6vdcDkueufh6ac0XewATudr/yNfMe+Q0nsIVlyz3+X2AzY7gjrqrroarAwRltu6E1 llHNrLUq2kGt4e/tI/4tiRZWVJ1OUc00jJfVKLQry7dbXY81KK+jiVxIV76reXPwnhLh47qR bA90m6i2rGhEyqME6mqZ8qs6Azsaf7jEasYMnp3JkujBYENf1VTitOMvYVdq6h/Vrt2Kk27P EZGMUtITu2tGSeMtvEDaKIGbFzwy0sOlrqg+FP2LzlIylTazo4v7jjFrktZihUXOJALr1/Nw 45iP3M9i9Rzch716CEP13p/rUmK9p0NtTC4xO9DbIblHtec2L0shVW16Ae1mvNdq9W/Euos/ Opbf0wvJJ/hM0oXi1R2xKppWUYa74ipSM2RX6rpxEbJlPs7nSZJtJ2g9p0I3CEGr6phSzvry zj5iTAb/SX9oukbT5prDYggnxoHP8Fw73v3k7T6xYlwF2karlNosIhv6/YFzokPdhPm5sOzO 6r0FDlbMmJ3+p9S6BHIT/WIK6xYLJHYqZ2ZoC1TmQi9LDKmSuGpeGyJfnVV4HE6fQ1/ubMr7 8GAY67Ys/n1p/A/LM/QWZeJDmfPwabZdBnKMzjokVTDJI5Gnv6Lr0NB7mP1avp0puWXqSJa0 h8Sv2Gz8BVK6O5/kLMJNl1Bse5TxKfJuRMe1UC6bSFsqPoiv34ZbK4o5+SxaEGnLPv8gXfd8 aCM940uZS4dzNE4Pw6hULLZKpVggZR7B5Al/0ebH6VmCQ6oaT2y7ujP29p3ymOKnB4sc26/s MoY2Y1vqnO1UpM7nMMv/sELHr5Up/41ut6jfMumv9zH9Ocp99L15Ah35wITAFqkn10J3K5q7 FxDKoomOjaL8Icmlfi4JwzWrnyg7VeppquiCWX82frzJPJg1yXd65pl68ug4JoJHoIXyFnzm pDNwk3lZZ9sEUtHqirEi8bR4d7KrFEXLpS1X7UfMbPQK3b5e6Rzn45PxARvMs4C7qiCvF/pi 5xLR35bTnU7rx17zuKN/mhR6ajz8mG/PzqFYgc6uIiempKJJBVEYWt0lWVtFkp8tLdqH63py TiKURlcVkfr21vF+Z3HN/psy6vexihp0mo1PKFc0bLNoGkP1t4+6gntsN1ncWfEesvw1mp8/ bWXkmkP5qX4q1EgKHyBCx/soY1UTsX0x6txncCKkxKP2O39y855+S+4Zz/+pN83iTgUudydG VEbvtEj5uvyVg96T7nSRt4FV+srvjajIXxm9gicx2KsdtnYXz5+0aR+6pLBg/4dxrMu2SgsV mEshnoUrBAkT+SLRs5mtVvbTwsx7cWeFxg7O8WDCkhHhyCnDhjHRGNWGV6NgF7zRfoRZvwjJ VKeakLQDYbDUu4Eh/fTHMChufKUUUujiAxnECI1Poulb4MGf0b9K3TQV9dk3B1gpeV1qTgnk yYPKtoJlryV6L/mq5261t4hmZ16k3xfBMtxsNWD77u/iQMWGEeVwYktGmizgZFiS1aPHmT6c JEKmjbBnqHswnUdWbR6REFiIHQ7WBJwn7UtMdRGKIDsa+1gkoxH2VKoimXh15DFar7wfp4NI aMTotYquHyukqoWoHWDlSaoUBamaDL7dSRJlcAsbhErBQD3EI/d8+rAB/ocuUVI2hdoOtlmI oWuw1lX2cEcmMHaJnvuOC5zA2gVE+F9wQn0xQoINGs6gckjKqjiQ2v9IP2BLRR02BZtOlGXa v1E7CJT9rPC4j9QemAl0kriGVDBVO95tR00PGqz8HoMlT7vX9zSofhIsH6zRTub762BakrS+ XeF1JhA/ueb7zpjHgSgl6yEDo7sCbq0SXCm6pRhcZXbVd2QF34X0xd1xkducm/AaYrQ8FB5l kJgVShDYI5Sm0IvEsApmfbTgvDzXYzvJROlW9e9ytPZ8JW0VbI1kxH7lczOYhJFvGkD0YeKb lGTd9aZUfkCc0DGnJzqmHJq0u6+hdUQSwvqM8SgskRhLpcCg67yG4uo8IonRm/z7eC7zGmAi N9zF+zsGIOzdol700YdC9whg3csqwmv7KYF0aAF3LcWiE5RNtHxd6vTcyXmi/Aia44AKocZh 3VfYFIYRSNvigCXPjfbVEJFVz+G9P7IN6VVO0ds5dO02rCS8ueBVdT0GunrMBejJWjbC4kQe XVW4l/Z6FPCuygiV72MCf2kNQ6TP+hkQva1CQqFG2b5zFWyl24SyAzGDqTPLLKyXv2S7ioNg QUkHhs1vU5jraorgICb9uX3QoBXQm5GAkbBDlvCOaH6Lr1pp7+C7B502xMo6VdhMPYARB55F +tJuNijbvaRER5iiZOtgWQzqqMUPp5PkM8wqxmuubi2ltU4igm2z4R4Hlod2SsFSdoorV8jw JbMiPNnkPQRtjtRm3EQkrwzO013MZGOX9oIYMcpvQGnENRGLLXwqUPbCz3wweQilfMLFcbP7 zqBPs5BVTt96Cwmpi/3tPcZedHAGZNL6kuxn7UJQNFAWzejnaSDPlQLGejAdUxUJWEsrrfOv 6lpblInY1ZLBFjwsTHw0kFeq65Imj0o07EanSOzmEJJ6Uadm7tILlL9/+iDg+2U/7sw7eRZ4 dI26QCm93YmWUxTgtntPZad+eIioy3yd/hhoPkZuBdOlS8PycV2eEF6nPzjBOONqj8McXVFG VdToStvigaqzKsKrhsWd0OV/ue4LoT/UOmSNUCuZBxl7wWZFQy6ZAa6tMRhchSYBntgTl5wb M4Qfl8/6A/fF1EOSXU8kpKJ/fe4wm3N8JKzA6dDiXewwmScDq9O0713PkHwCattsGPvcqb2q 5ydYaEE05yGaDsP6V8rskL0GhBbeESdDVIDtNoIS5/BaS1f9NyT08VYD1my74e3KTwIw0sPK HPbqU0VY0WEMdlPkGF6fLCv6/i/r8yM+sQLZMtDOe2qLcIuCCKMoN5guHPn6rBvYP/Msfcz1 snycs0DA5aT2dKVAgeZzlasuB4tlAtS8wHpQ9J21kLB5H3kDVoqrzFwBekkIz1o6msZUjESN mjYvr2bg9IYEN2paYHu13SklqR3+OoyAMaT+N6WVSQv27TwCOUGMjP1Wkvj/2VFgYoV2qvI/ YrCihCx76BGwAi5HaTuKgwWzsXs9gud6Npmk8ThORIVkuNrlIRNAkfWC0MI+01UY51lgU4sz cqVjByH8q+ZJLcs/eQydQ1MRgaucYr2OytaEsTcZoPKEB8F3htTpTSJonThTe32zzbyfUx9m V7rND0/hGoI/VDFFBzfLo0uQMVuiEHdV9TbpeKlGhSBh6F6OMUm5n5LPUhu5sPpAwvhS0YG0 eV+sSe+ylLpb/rz9cNsawErMRmCWsr5hjxGcaYX1gjovC3iOC8tD/tGDwEW3bP+JFdOaL1pk Rx/JABiXqVrjom5+NhSm3JXzdf5XHreWvLfL97WAA7bMRavZYq29UX/ZFlOs+m1NDUHRZQxU XJicmCp0fwyOG20zHXqzvX0CFZnr0NqiOEwUZ7zdDrJVyc+t95Y5wElNPI4THZ4HFcONwUS9 g+KwJQHv48DOKQ42/ZlMXb4odldua8wGxbDFoLvaR4Cr47X77vP9+o4956BuIOyrDd8VhLcK LhGTc9phhPTQjJrF+QiPZLuKGMltWuobdo1Ab3hcmGafQgZWGc4XvOk2qFO9dnepS7vd5q+V kCEFZ98SC4QHxszExfLV2vFlXEGaKvIHa3R+aX0Se8YxDO8g7oTR8z7GMufmJFAPdBMehd0x kpMKjTiU7FgvjYpZc587Wd4i77k2JC+U4w2IvIVgBpPbvzHmTfDsRcgxaRE1nOkiIAkvB0dh YiM6B6/XKNfj8+NtIQonWxo8jFIcr1Wg3epZN53UvhwQILzkxuNKYcQ76bQULoH+ZrHbHeVr XDqIiNRhmZX9VTML2qCzZ3I9SczFBuJ1V9hlet+XoOub9E9tzRm7b3fgJvViVURUzSSU+gpN msbDuiYy4ZiAtoT7PcuFOk07g1DT447Qjg02JGBmpciqEnNawo1xtSLaCjWBbLh0KLrxl1K7 Klzc/OS5RV1emBOCu96LvpH4q4wx2qjO1A0S7MMOMizN96n6sCWgNy/D5Fln8vJO9QaL05kU 3GAgX/dtGLi38gKwIwMSagg6y8JHv9PhS4FIo+smQmWwgbqYEo8lWbHN3ZcGDBnZC3Gts5wa NcA6n+epsNZQ1KjTRSz1hyJqnCQsLb5MQmUT/3hhEWGMJ+rrtDy8FoakPeoSfPKMoEfU9MOO uQC6eHb1O2fIXTgYfxUXlSycJqG0SFVxICyll7GIMt22zZmYX+xybwfWe+ZnAutPabuG1Ovd bEfQ2ee/NiFpgAA9/KLmrWhtAeIstUHTLfj8a6fhNSIQVNGJ20QqykToeNmcApYFbZUaODkP D7gG8ANjxZLOyEvzNsO3LJvetAYYoHMzXo52+yPNtZNaKXWqrPmAj0UY1IeZHpglfH8maoKw IAF9lMOSSdlyMtOHyFn3eqKE3xzOP3r6ZQD09SqqkSVNP+yKK/dwmoNgOsMOLufebes8nS+/ pAXpjktzUZUiEiDX6mnfFHxQX02B4oyq1RRt+odgAw/Z/t4i0yX6kKbyGtyUdK+qTVfgQUP7 orjB0k8pMkIRCejZf+hub1dYxsUvsrYQ6T3/vYslsZnZb3K6YAKcV7/CLd1BlKWifpprW9Cq mGS/hYfGYLd05NsV2H3oRgC1v/mvjlvTgFE0oJjgo+515L5AjbLGZq+CY8vSg0nXsJ47uPto jovbv5giW5kfw/rerRVWj8DTCYup2y5rauDQ9qF2kZgHCPRvk6nuuOklSb5nMPOYz1OmqSsi t8axrBut8UOH5LDVM+mUUAX+tLDORz8L28XM2Cg1RBrLxHae39lhONpOX4uNk1aV3XOf7SNV Gf987HBu/EYY0n2Qc4KN58CNr+hgrawgaZ8pKGQ/GN5ztDQEtIPwFWV11rP2fqPQlcAkajxt h+zLApY8ciCD7IXRKbuJhkQVirxSwomlHml1SJeaOZGJtlBeRPZFvbt9wGj+FYxnBtetDnM2 w8pku8jnlLRHyLpRFSxYLkoUxdJ6/Y4+oZYXPpUG5TL8dRyinD/v7j662lAkT+Cdf+REFELE Zo0bpHtcVgxkfAth5sgMyiCRj4OxFbtj/O5A4TI9ae2hXAzUa/c5Cc7TwqG6antR4+cci6QE maxeI+QeZn302plnauAXG9ZDlfvNhIfJS7avRymTmE8Z5wTCI8K97tqQ94DWyJXCr0AF8syA HbnFNqULnqgZ6YiwrO+Tc+KpGV1vk7c/mpFbZNqzqSbKggsY0/XuqlCqsUmxJ/x7NcjW2FWc 2TYfklALARl9bnmR70Rgb8MhTTEuzVqN4NlDiH/J23qgmE+kHEdroPSRq4Sdpqk8BK4EiPRe VX/7PzrSniMKrrF6xuALftIm6YznKDiwBVUYnHfMfCg8miuPlXZxlXUc+QxvN3NOsiLzHdAT dt5U3e3TbYspUEuMCOFgX05jnkjKzVAesbZOEuDzZt/gbxgnKRgiXn3d+U6/BCo/qOavjMpM E7OLNQbQ/P9ywzPBq8qYbMGUOQ11+OOhSdjz8xPngBUsq+tw2P2T1r6hQ8TkAWgu/fPOFnal trYH7KcJPxHIFV9a9Lie3VE6syBrVVA142jHgx332crbpBt0HQ/gwd61BWf9qAcbumPm1k7W UL6/ilbxid86HfBlb8b7rA54oKCvNmt0vxuPF/tQIQdFLaHHVS0Uwh+dQ1QVarZuj+noxD27 G6S9Kf1Daw/97UjSLA5tfj53GN09kdAC7lc2R3Djrn+A3pTc20HX5CkIvopUH7hn35D9/1hF VSp5ZaflLrh45D7e6L/q85BNpA6Ii1pEQnO57DnLxOQK0sta+S+30RPmd9vtB+FiRK/4Y4us 2xAvMnNE51HUeTCfb9Ogbo0WI9xsXM18L1z7Mi4DeeyMZH503L28ydJ+1RxgBm7WdKyxR8RK 12+QD2B+DRxSGUSc//d80g58zIm/CwIqo81MUHy5z796DtKS7uMCNx88CeYvo8Jb1OTw+7aD 7aj/lqsvRn5eEwGRnsgfSeb/TE06bLer48FAWrOtP1JVTb+ma9n2JsvkDz+k8TbyISfUZs2O 0sWOYzMBIGGc95y2ePsgmAbSXzL2Zr8HP7yAZ8ZsojppcrIvYiWc7z351THx2kNY+5OYwIbA EW1f0ocIachA/D7yA/AujgxnkEF3H41LiVWTZb9k6dr95iW7Q6VWR5i8zCADVs2s+5l5NMik fRNihzjIixicGdeIqSLMuLafhosD68zclHu6FucIvrmNlZZSt37wmFDA2i2+t30dBegH52zL 03alwz9C9cPjdwJPiv9KGvyB3mwSyjIh0fS3tb2EpBKIlFwbfulQqAaX3jDt2rdtTgQ99VdN bzvumqny8MvFGDkWEuYv7236UnNaGv3CTwAb2Sfa90sLzsDeu15bOz1lfL4kwSJ7c1lEZJim jojFmIIYwFI5WsCntu0eZO0QicyrY5l4998pJl/kfqHsPW8IYte+36obL2cDPRn7LGVNdR7/ uvxDwGjI3rM6PrABfLMXTB1ajK9Arm4VobmzQpmgcdowskgqLqcrPZUKUbkm27x1t2BI3xso iEOzN/LcsPJrVkxIH3HbLYENqLjp2HPBdy0pi3hEqZGkly/kce9Nt+aMQH+76L/S7bh4mPHi /g0c3XQLks97PDlquFfabu3dW4NoEUfRPDnhf4yu8XE4R2FiHGwaLvfv7LUzEcHUPEjOeQk7 AkhUK6VMZ9DCDHmEXnU3gHf3N53S8VOsn/aGUrPCycqmmfeIOPGPnfE9sSVug2ctYQPfKkDA MncvQJz0nWQU6AjN1CivQTgi+Jbc+QB7Vuq5bIdFjVHfEagrkzTfpxNdosa+Vpzr6n9/iKEh 2jNjkdiOJH+uVD5imx8l57k8iIsjJoivFRwiXaVDPVna/m1ZGxv6dG26kvOU8A46q3I/mTke mMyVfTRTHLL5nM5XidUQlv7sfvN38EJcDUU0dIRAHjewilujnwzB6GmLCknbcOBqr0TbmLzT QGRafkSFFTyZviSVRCXkrVbIFfCTpVexiPJ7e76jL6oPYDSRo/8Zu/xVHxlCzifRZJIby+Be sXOB7frF0zrRX3QQnsjG/rKY1zHJNvhYDVwABj3DC8NDcIacDzvmXzShHPHF+Y9fzP3Zy5HF C2/lhK1GQ/ptrkByJmZ/oARPEbBTCq1/+LQLVKnGwdccwUyPrqSyDMjq/TjgEXZo9MB1cEaz TQLvVHrDuOENct5lv6dpWEKRdBkmmbemcfND8nWXs/eFF7mdZ9xTpdS0Ygaysp1m71XQBK/F IkkfVog8/rMBT3Yt0PSsSRZL2RQHVi8105aFpidk8F9OGEB/BG9Oa53Va5PJsj+wIydfpJSD SZdO1DqXLTgXkwnzSqhRc6ikCvbmyO/18vqvLo7MVW/BlZpmFN5AOz0tixBrv9W40atZ91of uoYhdYPcRVlEc+x3CHjFjIo5Vd/hT9tAylrnLdFT0+/Iz59mPuEu/EesYcLkYdsJQjq5oTMA Xt2KtH7DEVfulFK3lV0prnsm9CzM0GtaCFcbju4UUL38tCY9MDECKbT/IXvfz5HCKKwOIrrE NllM+/2FnNUesJubz32sZIpFrvI8XRuGjqwKgyXhiNuogloVrC8rVd9jLKkLv+YJhcK1EpGQ IWvJ/N70fvVc/FIMwapeHrlAoxaReFDMCrsXWdbc9M+f7IK39fkroKc/+j35hWxM7vakxWTs /r4nLRZMsxZ8FPvpKOCJ3bukU5cGCGScdddU++0LFfmdFcjafZ+e7roYNnV3T+ruWAs4YN9l 5pGuKYqtIxg4VCSP4Hp2qDNfZqJfDt0myj8Q6Lh0iV1hd7LUT3c2oJc+n5rf1tspBIznqpqP a6SaIcgmcNPgWA4bJMsy1mILDnjC/V7z+ovvSjXB3nqNgbOKd/iXTkzaf4b6Gmd72tulhlwp IcYmYBLQrl+miqWpmKe0nJthK4tCeY9/bxcx8SqkRbToUR/MssEo2jqW5eMvDfoDnKhny87K 8JT6tVfrctYRh101qL7ZDWbo0QvQOCMcI2saHlM77lAOcvTAru2UWB4YTJTutE+q58BDnzEV Q2UtUxlUIlqNtHLzXqcqqvusVr/+2CDhyDim2VK4ayZLTy3QK49QoXufnyjVZncABeVfUVol ot+TYIjWQ/djuZKAcMlW3zz8XD42GNuMnl/XOmdKXBIHemnsVel2iXQjd748drtSM7bGeKcy WO8+qy4tzlOx59yhBll06cpd7+qf7/ME8d/EK2aRJVYm194tgKsI18fXPEmX4m12DGho89bz RIib/9lJcH1jDn79EvwYlHkLTnIu3Tz27YcT1OyaPI9jsJ6C7Jo6S560X6NdjcCejZ5/x2hX NvaBU1pdzB22Y4PvXZ3Yl/GOW509BJdFX4qTEBGGE/rJ79SjtgNx5A1T181Y9i7aO/wJC3mD Sef14eqN1vRSkMfXtA9FsDYR4nfgtJK5vp5cO5BRcPhPNS9THiJlb58akvBkwaBPtAZnS9Qx amBDCsv1fU+HJnZaBilbc8Ld/qF5zD55ZOcjlHJba8eXYwEQHsMeMn1w7TpGTqPhOz9yAoFj OxY/k+0G2Og6s9ms/1zy9o4kofFyoMr9sKQ8ZSzteMg9AfC7fRjoXzeKreEs6unVOPHGzgRu eAx2cJ1WOToFrIWTWwVpp/74UU9TFDBEqddM4VGMqB3DK51wEmXPms77JdtXikG6QB+/VLcH ZmSQD1cfnoxaTe5LIkFlfxdFMYZTBTvsFerCuwdOg84Wy8EmJR4WkVDmP7D4bfqdF3F6C1Ky zM7Vdwh6HD5Mx0KiUumU1EFxFF50a3+lSBowkGaBxPXBuUjWj3cEMWqqqKEAadLd5hkgkaiR 75zHB8r1A+ZnTTfoYLvn9K9ODPN3+d1qdCmiNUpAZgoqvryeUQwyMRsW61cVrABPw8PA7DZT Eu63eZeetU39ACdGMXSu8/5z4B5Xc1vhmac+ML9MBBo607gL12HnvLL5uYGQFfhWbKDEwUl1 QgTmY06SD1EMmY7WPnOwOHQq8wr4uZU5fzLO4GI1Z7ZpP5StiZn3oe6QGocRS4FDYAB5KSm+ 83vLrS5lbN8TMe7nSru9kteJ6dF7PB+KCmKlhjjMJRf4LR76CescRYjVIjACw4JZH+oNi38J CozFfiLw3sgVDWvCncaq2nOWelomXISrAi6CIWVLk3UdKxuyok9IcZVXNScX9RyJpfxrFZFm qAcJ8NuWkBlJFhWr8E+YhwPPlZYvJi8elxKy9QsQSkhmVnPdouv2h74pL2gfpkDTcfOGeVsn DpQ0PWRhdv5VBhR3NQA75sLYxwd/V+8gGk9HBmqMimwMBbpRQNHLaDfG6fDf12GRv4xJjZoR VTnuezr8MrjP097TvwE+Zaic2b5O6RU1IkCI+kVqqWtLgyjq3aUzEI4c2Il/PqIlg0VpPhi2 usp/T7q6z/a/zPuyYy+UMys8g/6jDIHJEj9K4IMU2TyKRvPvFEQ4c1HSgzT+5q5QVtGqob19 YHnX6aBRZnexmpaSo1jyv6cQZct0cs9CNBa+y+fpJnKRcPil1c5EM0oPgYssN/1q3SCr3ZdA cThYc3PhQLBSRFlKg/0ULQlPPzmLZKp3CEy4xB6OAuaaXyVlRrs7PCEjw1VUT3PYSuIkLnUc m1S387fc7dYgd195u8eqSsWMJ6zn6yf4sNMdW4DjEPGIhsj9F6Nb2UKjvDkdRLVZ2lr2+sX5 okOIrWc7Q1BmM3M+yyfzMux0tbvtZN/73uGhiGPPy5t3zt1xpUms91qEaY8UivWfMAZsVEFb dpoRQsBVMsBzcX8Fjlxvm/WdPkpg7pyhricfvWMlS7uPMZuoO9D7fcS5GY67XB3IX7behF3D 9apbES4S7N3Bihm9etThhAxIVPynZBv7+1INHtRbO7o+eeH3Y3zmFu+/M0FXKJ1ES3itrGSB uj1N+MoYmbc1V1nuEbEUt3unXkL7TXgYqSNfWoNmIz5aj0gXLMxWnWQ3lL8z4JoZ6rga7SLH KK3LWiXndFwbtH6nS5uOQMt1j6OVt/vcCBOSIU37pfANtsvLHvjR487vqtFrWVovO6s4d05h 4ffZtI27Va8e3X8IBk3/aiyutwwgUBij0d5XIcME32gLawmKD+jymUXwSUSMm9VZ8EScejvv TGYBcxXpctRNE66Y+/r7dN6mWA2CJlvLPu/cm00FBx2U4KcyUa71xfVPxrWDakZglpN5zvbm spKOhjLbKbTWXuHG/e9bNt/I7ZKgsLMNh+JT87SxAe6SCm2/OveLTBFsP6xQRnk7bqLVQFRl GSOGd/Nhf2CSSn2G+arkBcc/w2gRt2/oU22YEdHgClp5MEdeC09lxc2zfE0DbBv3UFP/rRJ8 YKuPmB2ihvec9Sjoey1szuX6gIu3RFb1y417gTCbLDdqcmsRruzTWrjgtz0AvI/LHHuXs3YO Kpox7l25yYZwknx84yhlw+F4LFjnzamM1S3pwTdx41b57D9acJ/WriCbZO8HPmflGnDc4Jew 2ZOaU9j2cw1U9KRv9HcIiIIb73RO78k5KfUNB1/3Iy99GB+YB9ygn7SHK0L4pgkOEedu7pU9 uV2+x10VLB+nEM+HgbOv+N6lQ91HQEaLyahJsImCNAWNopA52y0Q7xB2/G4FkwI3rA4usI0N 6eBpF/HixJYrR0AnLE5EO5FaBlnl0hmqUX6Pwbh7WD/y4rXTnWR4iJ1I+HDDcA50Kav/fMyy ZwBzxTr2usMPP3XjLdO5bl3DMhPL3flCC6w8MMRen66uMP8Ifq7q1y7eztQSzzoS249+eLre jwVHp1Lt15XPHYO6mvM39j/CbmcYhJ7arOkKgeKF6vcp/yOoAGmhc1LnoMJeZqgNm1UZDidO 47b75B3NBPxJ5ydf3K3vE4qbFBQDhuIKXH+D7WHlfOevNipfHsIlg12LlHcpGGonrhq03x5L /Lka0Iit+NPuL5VBFZmSkrU67kt5JoKD6CedGTo06u+K7+l7ZjLjtAXON2ZQKCQJyUa/5V21 pK+rwBT9r0flBlBAbx3N0tZgw9tOaRFDvE4RkrQUgOrvDn18lJGhjUzl1bhcWJr/8U1WTV1L V6Dzff/scavOFZ4rNn8+dOFPylBe3xUCeej2StTPji7L3fd7f4yqoiddDt9jvc77knhYn/ph Ns6Wq/wspKaAoTFsfKeuS+3gijwBt6vsPOuW9fLWtE87Xy+WvDfjHtAsuafL6HKyeRf2+ct3 JFjOo+WHciYnR/L3QvxIrJVEoJrvv3sKgFkkjz4J9miD0/JnPqBXlBTgcvwfcq5lmQRYF3na Stt9bYFsCknr12LP9wN/yOocnbMWRY7T6LMblRmBRJJtW9HtvXCXHW2fqshkrDar2Xw/J+aj mtvfwlx7bzs+SVbZCMJb/drW3ilwBznv9zVV14Ui8LKOvfA7Of0SSbPBI4cVecSkWFe1v8tB sGb2xAOeL3wgrItEfWzj4fcN66sV++YcoBL5XB1YkuIKo31yxyoWztZAdtzJTkEqcoQcnXtZ F3UqC9DKgzsY52s5emY31au24ARG61fdsFmnRl8tyzpfi34+bSYfpTmDff0hKaBw/4xaaiC0 v7t4d8YPExqcXAv2vXwe9pI4BMmwqDT97N3i2yxWTRK6poea1zGc4+PBfcLFvCa02wIaGmfZ M9+3HoELl3YaqD0dM8LFHRWpxKG/Hro+Jvdo77ui2/Be4PMzZ2FCjKz0yHXm2IM3Q/dvK05n HIUaiYSV6Jw9o5ygthOg+6Bhe+iSc594L2t2J0ynPORhYH1w5bV1sa6+36bB6deN3ZH+31hg bXXlZc6lJIqjtCvqNbyDHxYghvPAXS9C0FN2VTKQuaEzi5hkJQ2JHQ7FB70xomDnMaVk7LZD CO3VhxR7ym2xMPBkFankvrj5gX0gWqsfbmfUZgNHR7U2Wgpifede2iT/zyFU4tAe4Xkm9wha ajlhg/l1FCgB2PITV6lkoKcgamLpYYOwHF/2R+r3LQ84mZOkeoa8h2U0Wtptn84dK17a0D0d IPUvLVR6Ddw9n5XRlKtCsVj2BmtfucYRWYJM2Z5Pxu3WJWbze7nwk/z885QIhmLHUKW4LVFU QC0gnRd+EUu1cOx8JdUXY4PWGL6vgL6dqzQOeE6YwFLXHLL7/VFb0nO7i+YCKcb+XAp4z6wN DNic55e8TLKd8s1Gx1HBgjWI/VlsWoo7dwKmLprxmLeyDgeH30QUlPQS8bLT6RugYMB9OSLj Wdx7IXytsDwlsb/2AjLUM+z1qY4csyprfzVc8XHZxTeNawf9+LWpW0NMToPw2yG8ZsSbdHGd 4zfioXZ+JW8d+eKdAGZ+dPH93HvX2akeOjMJJzpdYthkd/uvrty/AhUpBPSzHMcoLu/5cDZl DU5z+cwGyDkcsZqGJhOTwqEb1xR2Tl7jCZhoceLKbsk90Np/uR1uE/f19sgvdWILjHfnev4Y iuzS4Qtx6v/OmAe69LKHAsL1CVY9P//uOMqqPtVZRICy+qTL/eNsS2je8h+SNlf0ALCrElq/ XtIKk8mt4GJ6ZtRVhDu+CEXoVOnYvDmC+Yn7+RL8Lb62fojBs/BFV5vKQTMP5N6S+d8Iq80x V5NBaLji7su5kgPPnU8G9LrUaMAcvZImcz3QipA5HrXd17GLdekde0gCJWzbn3zeglcS0ool XKsKSs9S7wmVrVhBmVEGjnBQ/dl7/cSaK7AzoUK69vCeOcjNdDzOa5QrAtU88p8LJ/VLSazi N9tZJ35vmmaDcJk+l4mJvAsXp2yXvHu0GjqDodKm36j+jLVX6g3QeM569WXdIyTRBJ6JSzO/ +b/BqF78mt3VuHHnpsQv6FPkO027rRSpF6wewOfeM+Hboz+6au8Cw+uvlYUHUgay50mEyh+v ssAgIG66Fz1+AXT+uiho39iDASMG9q0vIeJf3fDcc1iNdAS7K6NaUN/OrBLZ3e8EziMRPoG5 9ghix9phs9caw80gQih1lH2mwn4kwQ60ys+KN96L+gjWxciaz1VF/+PZG966GjebhYTRwt0G vRon/QQDt9dhhzSXXL8Y1VQ21jg0HMut73Xb+e/DoAjP5sJe2reL0BSAyf5QIilHsmCw3iE6 th3fuT/NVcty9NGBp/OWBZ7QfaVKacK1ggO6b0yTswPxpdAcFEDrfmFiDx+1Yz3HlWT3Mk0r wE/qn/mVAXsgfkxzmcwzOQapWcY6J7C1q5C127uDNx2vi/EygK2XkrfsN7pHAO1SK9/lpTe/ eJlgW9Ch8butakDC9WGefqQeuHs5GjSLJ/VhlogXtI1PcAM0c6Yjao7WrHY6eAU64+iYgmvB sFY0F29rWacJhGc06eEMySYQL3OMMLtSQfdc+wz7zuCvO36xO4oM5zOGwnr7MVKpcohRqv3S 10Q24xsHqRHHPHTZ4cWd6gb+zbV+/WXjIjM60/+pZZ10Q+9a3M5IOA2P7qB2NNseum20B8yX P47hB2nB+eD/zMTFeELy9vv2ZfBuMCY7AmY+Jph0PcRIY2/Y69HbavgZS1QoDQx9ppF2IUhm JMYcNHxmhqflYT0rf9yeIrRV1XvslckzWTvVGfTRe6Gg8zZcWM2ROnoMz5ORdgoDl/1v6aUV IC/3+Jdz+55EMPjU5/8kt2wGYoTMkxrjBAuy8nSAwYkn9O/cYyrZm04gPX4bnDWnWX3kLcCb mst+uJmtCDS75DLWt5kwwJw0KNy+IS8HPve+/PdbT54YbP8aISdhOAc6Y4xm4X1CIfPfD+MZ QONO6Nm5d5WGXvhEEpadB1PMcHWegzIXtceftE0PkIabSyLmi15uOESoaWYQIcHirrEEz2bf lxWHkvO1MNtyyQS3yJxCr7ccnR09xfHK4B4Z5E+52DUCw6TrWtu9SipAdLE+S6nU+RJE2GQa IFKYU3CRLb0k0B4Ih11dwv7jiaP5hHicxlVW+5R9ng4c2fDOxsOX+QyJrpMQqRlcmNEohb74 jGsX3OWC7iR428GrDZjDzAcQXVBWcYafjFWsdxed5hjZO6Sjwn3f2MVhc1jplkBmiONiZPMe rFBOrHfYcMjhM/FLcOJZ8Slxr2T8wUpBQqmOJpRt0gh4NpmlBurrv/23rvntExA/V+2MOdJ4 jZS5ftKYf7+sJ8AGhFk+Tm6r7A3ap6jsVPH0yudThBCGPI7k/IDyT9Bex5g+rl6mdUHg5Xlx OzpqmxyP7r1SWbjtPzZMvGyODl8evuWwloAqWV+WwDEVsU8+a6jVG7eiQw4IqyBghD/mwjpb XHgvhTMt/LcMz5nWl2bvTt4gG83/1GU9zRs+X00wVGFaPuRkBiT/gYbIgrYo7aBXMFVk7TG5 eJoIdq+frXvj9TYkVHwfKD3Ik8gIGoVrBTJ+Pb7WQjHlJ66iJ7DOmVnrhQV5cQgO/StwSysb +n7A9HI5s9BsXisDsJ3R6/NS/nULiyFdzk5KJ+2VEbZyQvfRjVbhY74qONT2/JV/e+ESNCql td8+gvoyV5p9BklnFP5zqz7alVGCHzzVAAS/0ijeDQoLtAM3iaAZb+4QsBLM15kxPZaY+RpL SG+7MfD2Y1A+xoz6RIn1Q5iw/AfLa10pFN3dp1JyUfXsGxbBoe49B2uc8RZwXNVlk/QlfXg3 23LP9UHPfniZhPMqEBnAONh4A19BuO5HIgXCipesNNrtmNh4v4Zp/v1pPSk1VZfSOMFybwhT xAHX6upmkSZ4qu9ZB+cfj7Xkrp4LdipCygL6kRckOmvN68EZyn5I/nfhVgLOTwT2MjeyTo8X GAHy4tHCV/3uN9C19lSriHajT8pjGDntXPd0Q2o2kpNhlJJsLTatgHNcerUANy63ZERj5JvA VeOkZJb3qTGoOXAi5kbyi/uQ387ArFHC/gSxo4PSxK8+mrAcsdfd4XwrD3DJpogb36k/1Qz2 l7nWPbN9/8qkgbZCnm/pmc2JuyO47mH2r70ctuJWrcFqOyMTzznb6zfCeO4bo83iOTZYmQLt Z5kfrjKHhp0PA/G+yLjyyuQh+OQagTOcauTDndeS+IoLhHBI3VHHc+3JWAun/2jhLuLHj2JD dFL19geOJNJ2AHXtYtqhmkKp3/3ChrHH5LgbFWFwKnLrzz4n1+jswkpnKiwsfzQ0GAYbr+Ny nDDCdWKwmnMkenLby4OH4Db+UtOSkEzlxZLec9xdBK2rZxYCKR1me8DpzVyzSi58yCgf4wxj jZxquuG/PbEqLoJkyPQaNbMkNZOZwRXoyZ7wc2hTCI6z/jFiKAiLXVs40WfrNQ29wRezKyye LWBByqWZyET9OKDYRQk69Nt5A5icPyh+IUytwF5zLzn44ymyH7rjU50Oj5STRDwpeK+5rVxV poB9Do4oH3UdKyNhOrDJW1uJUut1atq+hGuFeZghj/hfMn4ODm3YJwtL6OBoXkzrX3A6XIml sTWJDt9v2U3U/DDq00qcC99/kYi3G3CAzIo6li2WeEbn0/Y9YHTxSBtOM/C+zStD9Box9ahT cAgMa7vE8jm8E8BKeloo7VceAu6XXNjofQUC8CtS5K7lE9ORmLylf8Oz3vS2+Rn+XEJaKNln a2cuKjdNmRuEC3p9yffQtn9plU7N7HS1KaJGYxftumWnG08KTiXNi26zZ/8WsU00In28ZS/d 8MtJ5IBWyArWbnnHrj7kQRq8cRJZWy/hYYHNqrtot+lhQa5gg2ocDL7/9clce8WGe0brZndm KnjlKvRa36VPw61TL0uW7kiutvEuResaMfp2ErZUl8VomL86GZVDITSVYCvHWXuydEWQE/lf fx8oz5he/Mz43he0O46ITeqSoPoROo9/OZBUig0yCfbnIoLNUh+pzRlOLltmlp+gp2u8Ke+r 4gVa3fRdiw+RgZfT+iNBz2ZWV3Ny39+BwiKO38PTWR/VBxQkV1tYoUrGcuhFkJ7XvpxcPUCj xmticvEnyPoLo2DoeCz6bRUhb9tkZwt/+wOpd/CzofnJiSDcWrDrODyxXImf5m31xNbDzb+/ TK9lfm5fNXMv5R125+IGqvymoWnWyHK/AiVxVq2qi+ntcffU8s5leK8u/+9mO+EvGBkmsmc6 b5eSMyu/N4Oyfo6VCfnLzUnj3Tv4mX+f5GOgTuS/INs9TdMzXmDNkdF1YuHK4ISZfnFK9fsM So6qAL6U3+jHHiHGoW5Z8IHB3MbqvCyeqxQ6gGKGam6jiPrZl/vwN7IE69NSVkz2u4aD3oS1 F+UtorUJz8tQPyyotkdmNzA1JH860OJCYW1PvTWKH7ZdvAh/C/btCNaubThYI5/Yb0DaOj6h 3InNfRZRulTXMKz0Hmzji7yoooIsEFoeI5r8w0SosZaK0ULKWMPr69Driy1wbfyaoSbn/INt cGGx9HOMO4pUKnz1Ncz4LTT6q748q1P2C9SpjcyneWmfHUra0JlBw0gO8nCOmuBwsEpXZF3X K8aM5xR0nOnPSvqI4QFi8bvI5oP9Ttj0HHfjbcj4f079nQSPvdWH0SeVWScgcTl76Ubt/WOA G/Vj5089YZHWLV/0AsX2ukNM8sCsglLJO0GoyKMHjwl4zuV7RwVLVVcdyZ9it1RyMbrdzShp xcvbNLQrRsuMPz3V+Bpu1NgPVz5TCQHb9PKw7PM9nwkjvjhW7gxyfMUfctS6vSfDvriDZSA+ f8lexBZYNcI/iTesL4Pcmjv4F9Xbn0OcZ/xcun2Yq9PKeZTxVgr7P4iF/BuR++qscOoQkLBy JaSDWQ6ld//1r9+S1wYpxgHHtqaHBsHMRI7zK+aFtd/KVTEELpBGxjbaUEEwGMyYSW7Kml4H dsM6WharqbNkWsaqblBmfvPyh74D4di/iWYpwJlRmrWce2VMXr0SVIFSnLvMK0lc6z4t1C6g WcSdILR/1SnFW/cT40uNlCGyG/h4bnIfe/UBPQhnCfTH7EiOYPpsaPt+iddSgMja5tGZRcdB Azd4I8h9zdGYDmhh/JU4tblXAbxDL9BbBZJnIeJdOzl8KWmWGObcUIyq2PSJSIHt/Xpfzu0Z eZ+GSRhaf5KnLD6mNrhwnOVEr0PNWIBwXYUuyQ9iwM5z0FenaOIc2MSa5giVdYlg/cxNbxth WibeFph51DVrPVS1AdNurxx55k03ou8axBR3uDVD1II6VdE/wTK/FmW3Wcle8fmpKpkiWGN5 eISvC5dZGlp6VnQ3MKxnKxNqyZ6pv2yJfNhmlEKXEM6AZkxJnmVxaQ15tCndgk9FyMIC3rVQ 60qq6GHB2bg7vqX6hGV5+s0wYTjVtQe+vrdciszsHk+1Wr4LaXUZMfKylcNw/i/Wmnnx+BnQ ZG9abRsRLgkNzulhGp6yAQlMcoWxmeV3Q7QBY3K1UUaPy2ndxTy9F4jGRQZi70gCUNZjSTC7 vMdT9Qn0p9prnrS7Pn/khCv1NVGLEtQnbz5UY0XGVOmue836b+YAT1sDmTRoTNTJUfpo/vP4 WK0FBGnnm66aMPOEaAw9WfkfUYKA3tdmZfC2JLyIsh+wIVd6mqAavgc7nAB3eVdRK/OD30QL FHvgM00Ykl4Yy22/q06KcO/0cJn2WugZMcTkXUQm9Y+G4b1SUfpQywzFjOj6w7sDfp33TDUh s/c4rqIZqzCCPqmV6q1jlZ1Py/c6nPgRuOJ5ddt88eEzgZ9OOVkl54dsJ+JcgtA2UQ1/aAzj 5MtdY9LIp58oed4L4gk0V63dBn+i9Fy0V2dY23NZ6a/UAihr6FPq0jxlrMlt18STFjM6Sgm8 7SQF36RPugN0HWvaohfXqEaOq6QPM6oKBSb0s7IgfZX34t9/892Qo6O9I8IeoYCXdDjzUBmW B2qfyvGvtBHav2xs+0WtLelGfL/bOuTxHiwJZZtYLTLhVzFCFLkj3YilfNctx4pRj5+YLLKJ TpadO0roZ3IuaPGqK+34y3rLJbJP2nHfISQXU2DPuu3YcQB7SGQ870rn0Dd2T9C5lvDfypLC EyOIq5bBUX9sIbe/mqxgk1eygmI0NuRed4NB0e9tUQWaLAzJh1JTtQq9oNGkqEuV9mz7m9nh c4V3awgzQSOIOh8qkuFVaqioYX2O8XToRn9M/1xatDO4+c8LeZCNHazL4y97HpeXPq0B3ZZC JD3SSRPPjRAvKpYGikZVrc9hHs2Jfux2y229Dy2mv8x/Wf6y/tX569qvGzOO2Mhj5EOeYj58 XjFdyhmpwIuaN99EaDtRozs+60CE3uXcWvRempRu0NueXqip75n7idF8wXlLTZf2gRk+D7pc aKVPpDIkErP2K37+/u8a4GRsLNybBxBEUjZPURX1/Os9xpAA/YJfhNW3WHPMiN4MTz0fE0GX scvTVqsRUVgzcDY9N5pFtuPXoma+nvY4F3nIEgzETb8447xgE5wugONreRau+qLIHb24jMnN br0fJYn54yEIaopR/TwLhhn+LadFr8WAxA/Xj0t04XMIaesWU0BQB4INgyVeav7ryWPRYJr0 PHyOj8I3lZg+FcZBZz39dMtOYxvC2RzcGd2tp0DSoysLdmEurrwVTzwM1P4WRbTDq2+vJdmF xXH+JyionZx4fORAGW83iT3l7ioQqxOe0CWz0hl4gUaX7M5VBJvSpuTBmRs8lA7/nAWuiNpj DXUXH3ZD9pvue8IOA84hCTXBnrVTH71ACT/RYfOpEhTZLP7L9EM4oI8E0FwMI7YvrPe8mgHu O3QJzqoLZCYjJO5g7kWM5ukoxEHJ1jEl92Zz+vhkXpcTb1Nfmr10iTNTlEIQkDAre9xLXEj+ gkyNyh4fxgtenbKzK9JMRYNoLM17Q/giHbK0W53+U/l3swXTIhqEWHefhIjJxACoUlINL6e0 5SkKnRUUzfTI1aL3vbksH4uRIJIUu99R4K74Sr6Rc/Vd9V7KliwbVbFkBkvHZuXt4h3im3nm 3hQJUQXcOEuKVk3CKt52X1CmHdNgiV03eiTG6LMCm+fVNzFZkupkMY2mEWEOItmEw9N2sWc4 XqA1We5DXZSuSmLKu4e4wr6SVzzsLFeDkyopehsyn/jer/gf+8JgUaF02uqYEthbaS7rN9Kl BCq5s/7DP4dO8xyBa1Ihlxz8aj02hIh9KuPrVBcI2961DFecDwZFm8chVP9XVhDWkV66gVUe jN/4i2PMz32VWR/XypuUgWNjXb4ND145gXDoz8qP+lJ/iTCWWpHiweTJlXlpOVC+r+QXz15e 4m5wblM5fwRCulvtRtqH9zrdQbPqt6yioHk/pB8uX4RNl6b58rf9TGG373xJw1KnHTx8Ntz8 MeH1mJP0HrUQKewmS1mVEauoenjG3/JYqVf5BzaYLfdqXuUQ6ropM6CToTU74gT11ziCPWbQ t13+NeWjcin1Zxib9XeB6HtsFIaCV4pdreVkwejBiPDvav4idvg2ri5MVSBT+woz92evqRGe +0mJI+42vrYVrBiHHxPIx7Rdfwi/xVXVOItgx5Yr1FJB5dUtxydOmzgQs/OpqkjFiK8t+hns A8Le76t8Ix4VQzElV/A5aNejAJB4IXO47+VlKcKXD0qPU4UcX315qGIJfC4HGo4f6HRwnnbg oH7tCKlm7MWHj/qMuBKQeDlzoGhNUCp57b9Fv8v4XSNEgWKnylWoVe1beM3YkgYld7Zxf3Yd iZF1Vhk5CVGfH7M3HBbCP7eTM55SGxlwTZl7UFJfexbilfgzyOibRqAvr/iOoex98D2/6oUW R94IKkwj62RjlIOCxbyAJmHHec0mLnkgbnmDvvJrosa0s9TOoru7iK/13d8NR6xAURz/Ve1M 8zlqysev/iHQssHr0bA0ISsoRqrsKHro7pCaDpQ2ZH8eK5SsIFwVrJ/9wmu7w2mFWl78Mv7R 1y1QV/mjhCnfpgzSpYNxHAmyKjgesNs0YTDUz3jltrzb7xSM8Gp7s2KQQMQI1a48f3fuS+IO xP9bT/folVTaZA2sNk8ZH6uk7odwuotXIkfuK9RuUVF+w5/IgWfvjG72TMmkGnkWfaM0URlo J0WUgAuCAakzYiEJri2k3PtCR9SlDLnUgdcXJP+jChrRHjd1PlaKWdxlESXQ7DZ4rUP+T34u GEyzzI96qz/2TUfflHJ0B7vAR/pK2+r7ayXTVKBI6XZawpoDEvDhwco5cul3H9CalfbdfOTx 00U5eFZSkSg7ruA/pX5QDMawNdRbfZo/4Zrgqm+wT9gQlFDWE6QUKjLnN4OZ0DPrx4YQJRuq F3xqCNJ7b3BzmWfrqo8evif0rZh4CvtEi+to8sE14o6/GqgAG9OCPmBX1WZUjxXkvUt5D4ZD HC0edV8XFEfLTe4V5p+H+lH2oxSOdTm8EnjWbirM4AN62uG4vPeiFja4QDbh78d25YY0MLng 2jV6JzBGXalQFd3xSHBR7jCyhLyyuzPAWBQZBdXie4avpQoLsErjT0+tjh0xSbwE6MRAg1j0 2RqCxhl37ULGM1VnhPyC8W8UXfl76dGaeIxNhxTaHqiqxGvrhaSxizjKSJgz0DbJlIhlqQz5 VAyCvEbDaYGwHgwrC2ddFoLXJoeBLbH2aVQde5G07hgnn7XxFYunDEOVemo+XYRi+9IBeN1X SET/xAQ3SYGZRYvStPkIoXXjx8hgXxp1y1RN314V8KwnhvwzqDRCVL9muHB2hDOUzdWQDdvQ WmF3/+M6ePgiWrKjqe8B3M31khYXDM5BPmIsdN3HopPdSfcWQHTDXE04NtrfBteCRWmzDnD9 0eNJlj7jBshK7NLB2H7jT7NN9lwwgVWozErqOCmT5SD64Xs6/s2K4ioocwL4f1BLAQIUABQA AAAIAJiUMDLpVIyt6dEAAO/eAAAJAAAAAAAAAAAAIADAgQAAAABTZXR1cC5leGVQSwUGAAAA AAEAAQA3AAAAENIAAAAA ------------B5B4E8DE92E0180086241928B7-- From hadi@cyberus.ca Sun Jan 16 10:42:05 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 10:42:09 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GIg5i2029668 for ; Sun, 16 Jan 2005 10:42:05 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CqFLf-0007tC-Mo for netdev@oss.sgi.com; Sun, 16 Jan 2005 13:42:03 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqFLb-0000XL-9G; Sun, 16 Jan 2005 13:41:59 -0500 Subject: Re: patch: tc action cleanups From: jamal Reply-To: hadi@cyberus.ca To: Patrick McHardy Cc: "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <41EAB296.3090504@trash.net> References: <1105899636.1090.794.camel@jzny.localdomain> <41EAB296.3090504@trash.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105900913.1090.803.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 16 Jan 2005 13:41:53 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 331 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Sun, 2005-01-16 at 13:29, Patrick McHardy wrote: > jamal wrote: > > >Heres one i think you didnt resurect Patrick. If ok, Dave please apply. > >Other than that i cant seem to find anything at issue with the core > >(havent looked at the individual actions other than to follow changed > >code from the core). > > > bindcnt/refcnt changes are protected by the rtnl, no need for extra locking. > The lock only needs to protect data shared with the "act" function. Very clever ;-> maybe add a comment then to that effect in your next batch? Dave ignore that patch. cheers, jamal From tgraf@suug.ch Sun Jan 16 10:47:33 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 10:47:37 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GIlWHV030358 for ; Sun, 16 Jan 2005 10:47:32 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id C5EC984; Sun, 16 Jan 2005 19:47:08 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id ACA591C0EA; Sun, 16 Jan 2005 19:47:51 +0100 (CET) Date: Sun, 16 Jan 2005 19:47:51 +0100 From: Thomas Graf To: jamal Cc: Patrick McHardy , netdev@oss.sgi.com Subject: Re: [RFC] meta ematch Message-ID: <20050116184751.GY26856@postel.suug.ch> References: <20050110211747.GA26856@postel.suug.ch> <1105394738.1085.63.camel@jzny.localdomain> <20050113174111.GP26856@postel.suug.ch> <41E6C3E5.2020908@trash.net> <20050113192047.GQ26856@postel.suug.ch> <41E71CC4.3020102@trash.net> <20050114151407.GR26856@postel.suug.ch> <1105891871.1097.647.camel@jzny.localdomain> <20050116163212.GW26856@postel.suug.ch> <1105895936.1090.717.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1105895936.1090.717.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 332 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1105895936.1090.717.camel@jzny.localdomain> 2005-01-16 12:18 > On Sun, 2005-01-16 at 11:32, Thomas Graf wrote: > > Not really as long as iproute2 uses the same byte ordering. It has the > > same issues as all other rtnetlink users. > > wont harm to do a quick test if you have hardware. pedit for example > still has some occasional issues some issues with big endian which i > havent had time to chase. Uhmm.. yes. The endianess comes in at sutff like skb->protocol. Leaving it to userspace makes comparison beyond simple equals quite difficult. Providing a method to transform in kernel space adds more complexity. > > > > + return (v + (FIXED_1/200)) >> FSHIFT; > > > > > > 200 has some magic connotation to it - a define somewhere perhaps? > > > > I coped this from the code for procfs ;-> > > know why they have that number? It must have some significance - or > maybe someone just stuck their hand in the air and measured 200? ;-> It is some kind of factor and has almost no impact in our case because it only changes the first 4 bits in the exp part and I'm only interested in the integer part. It might be a good idea to take a few bits in from the exp part and provide the load as *10^n where n is either 2 or 3, i.e. a load of 1.9 would be 190. I have to think a little more about this. From kaber@trash.net Sun Jan 16 10:50:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 10:50:08 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GIo31D030892 for ; Sun, 16 Jan 2005 10:50:04 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CqFTD-0001Sq-KK; Sun, 16 Jan 2005 19:49:51 +0100 Message-ID: <41EAB74F.6060507@trash.net> Date: Sun, 16 Jan 2005 19:49:51 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: hadi@znyx.com CC: "David S. Miller" , netdev@oss.sgi.com Subject: Re: patch: namsiz References: <1105900522.1090.798.camel@jzny.localdomain> In-Reply-To: <1105900522.1090.798.camel@jzny.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 333 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Jamal Hadi Salim wrote: >heres one ive wanted to do for a while - dissociate action name size >from ifnamsiz. for now set it to namize, but later may change it. > The same can be done for sch_api and cls_api. I'll add it to my tree when I'm done with the current fixes, unfortunately one of them has to touch basically all files in net/sched and I want to avoid clashes. Regards Patrick From buytenh@wantstofly.org Sun Jan 16 10:55:56 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 10:56:00 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GIttI7031716 for ; Sun, 16 Jan 2005 10:55:55 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id F254D2B0EC; Sun, 16 Jan 2005 19:55:53 +0100 (MET) Date: Sun, 16 Jan 2005 19:55:53 +0100 From: Lennert Buytenhek To: netdev@oss.sgi.com Cc: jamal , Pekka Savola , shemminger@osdl.org, shollenbeck@verisign.com Subject: tunneling in linux (was: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling) Message-ID: <20050116185553.GA21739@xi.wantstofly.org> References: <20050112222437.GC14280@xi.wantstofly.org> <20050113092351.GA23170@xi.wantstofly.org> <1105897020.1091.736.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1105897020.1091.736.camel@jzny.localdomain> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 334 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev Summarising private thread on netdev. The main issue under discussion is whether to implement ethernet-over-IP tunneling by using etherip, or whether using something like GRE would be better. The main argument against etherip is that its RFC has 'Informational' status (while the latest GRE RFC I could find, 2784, is 'Proposed Standard'.) Another argument against etherip would be that OpenBSD apparently mis-implemented etherip by putting the etherip version nibble in the second nibble of the etherip header instead of the first, which would probably prevent the linux and OpenBSD versions from interoperating, negating the advantage of using etherip in the first place. All I personally care about is that when I install a random linux distro two years from now, that ethernet-over-IP tunneling will simply work, using whatever protocol -- I don't care about which. Any opinions? If we do end up using GRE for ethernet tunneling, there's some work that needs to be done. For one, ip_gre in its current form would need a certain amount of hacking for tunneling ethernet frames instead of IPv4/IPv6 as it does now. We might as rename it to plain 'gre' and move it out of net/ipv4/ to net/core/ or something while we're at it. The way we currently use (f.e. in iproute2) for finding out whether a given netdevice is a tunnel or not is by looking at ARPHRD_*, but this scheme breaks down for ethernet tunnels, since there is no other way of distinguishing them from regular ethernet devices. We could issue SIOCGETTUNNEL and see if that succeeds, but that unfortunately aliases with SIOCDEVPRIVATE which aliases to BOND_ENSLAVE_OLD, SIOCGMSTATS, EQL_ENSLAVE, FRAD_GET_CONF, SIOCDEVPLIP, SIOCGPPPSTATS and a million others, so you never know if the netdevice really interpreted it as SIOCGETTUNNEL or no. Other things that suck about tunneling? - If we're going to overhaul the way tunneling works, we should try to remove the need for the gre0 interface as well. - Tunneling over IPv6 should be implemented. - How to share more code between sit/ipip/gre? Ideas? On Sun, Jan 16, 2005 at 12:37:00PM -0500, jamal wrote: > > > Is there a particular reason why GRE tunnel is not sufficient? > > > > No particular reason, apart from not being aware that GRE provides > > this functionality. > > True that GRE can do all this (and they have thought out well the > broadcasting etc) but i dont think it will harm to push this into the > kernel if some odd OS like openbsd supports it. > > cheers, > jamal > > From tgraf@suug.ch Sun Jan 16 10:56:12 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 10:56:18 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GIuBh8031824 for ; Sun, 16 Jan 2005 10:56:12 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id A8C4984; Sun, 16 Jan 2005 19:55:47 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id C14D41C0EA; Sun, 16 Jan 2005 19:56:30 +0100 (CET) Date: Sun, 16 Jan 2005 19:56:30 +0100 From: Thomas Graf To: Patrick McHardy Cc: hadi@znyx.com, "David S. Miller" , netdev@oss.sgi.com Subject: Re: patch: namsiz Message-ID: <20050116185630.GZ26856@postel.suug.ch> References: <1105900522.1090.798.camel@jzny.localdomain> <41EAB74F.6060507@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41EAB74F.6060507@trash.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 335 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * Patrick McHardy <41EAB74F.6060507@trash.net> 2005-01-16 19:49 > Jamal Hadi Salim wrote: > > >heres one ive wanted to do for a while - dissociate action name size > >from ifnamsiz. for now set it to namize, but later may change it. > > > The same can be done for sch_api and cls_api. I'll add it to my tree > when I'm done with the current fixes, unfortunately one of them has > to touch basically all files in net/sched and I want to avoid clashes. Go ahead, I have no changes in my tree except in a few header files and the necessary iproute2 changes will occupy me for a while. From buytenh@wantstofly.org Sun Jan 16 11:02:30 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 11:02:34 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GJ2R1b000424 for ; Sun, 16 Jan 2005 11:02:30 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id 1EE012B0EC; Sun, 16 Jan 2005 20:02:27 +0100 (MET) Date: Sun, 16 Jan 2005 20:02:27 +0100 From: Lennert Buytenhek To: jamal Cc: Pekka Savola , netdev@oss.sgi.com, shemminger@osdl.org, shollenbeck@verisign.com Subject: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling Message-ID: <20050116190227.GC21870@xi.wantstofly.org> References: <20050112222437.GC14280@xi.wantstofly.org> <20050113092351.GA23170@xi.wantstofly.org> <1105897020.1091.736.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1105897020.1091.736.camel@jzny.localdomain> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 336 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev On Sun, Jan 16, 2005 at 12:37:00PM -0500, jamal wrote: > > > Is there a particular reason why GRE tunnel is not sufficient? > > > > No particular reason, apart from not being aware that GRE provides > > this functionality. > > True that GRE can do all this (and they have thought out well the > broadcasting etc) but i dont think it will harm to push this into the > kernel if some odd OS like openbsd supports it. Apparently they mis-read the RFC and write the etherip header as 0x0300 instead of 0x3000 (they have the version nibble in the wrong place.) This would likely prevent interoperability. cheers, Lennert From hadi@znyx.com Sun Jan 16 11:17:17 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 11:17:21 -0800 (PST) Received: from lotus.znyx.com (znx208-2-156-007.znyx.com [208.2.156.7]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GJHHLT001580 for ; Sun, 16 Jan 2005 11:17:17 -0800 Received: from [127.0.0.1] ([208.2.156.2]) by lotus.znyx.com (Lotus Domino Release 5.0.11) with ESMTP id 2005011611163919:33212 ; Sun, 16 Jan 2005 11:16:39 -0800 Subject: Re: patch: namsiz From: Jamal Hadi Salim Reply-To: hadi@znyx.com To: Thomas Graf Cc: Patrick McHardy , "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <20050116185630.GZ26856@postel.suug.ch> References: <1105900522.1090.798.camel@jzny.localdomain> <41EAB74F.6060507@trash.net> <20050116185630.GZ26856@postel.suug.ch> Organization: ZNYX Networks Message-Id: <1105903033.1097.829.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 16 Jan 2005 14:17:13 -0500 X-MIMETrack: Itemize by SMTP Server on Lotus/Znyx(Release 5.0.11 |July 24, 2002) at 01/16/2005 11:16:39 AM, Serialize by Router on Lotus/Znyx(Release 5.0.11 |July 24, 2002) at 01/16/2005 11:16:41 AM, Serialize complete at 01/16/2005 11:16:41 AM Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 337 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@znyx.com Precedence: bulk X-list: netdev On my part - theres one little change i made - just compiling it as we speak; I will post and stop there until you are done cheers, jamal On Sun, 2005-01-16 at 13:56, Thomas Graf wrote: > * Patrick McHardy <41EAB74F.6060507@trash.net> 2005-01-16 19:49 > > Jamal Hadi Salim wrote: > > > > >heres one ive wanted to do for a while - dissociate action name size > > >from ifnamsiz. for now set it to namize, but later may change it. > > > > > The same can be done for sch_api and cls_api. I'll add it to my tree > > when I'm done with the current fixes, unfortunately one of them has > > to touch basically all files in net/sched and I want to avoid clashes. > > Go ahead, I have no changes in my tree except in a few header files > and the necessary iproute2 changes will occupy me for a while. > > From hadi@cyberus.ca Sun Jan 16 11:32:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 11:32:56 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GJWqnY002802 for ; Sun, 16 Jan 2005 11:32:53 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CqG8n-0002lM-3P for netdev@oss.sgi.com; Sun, 16 Jan 2005 14:32:49 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqG8i-0007cS-4z; Sun, 16 Jan 2005 14:32:44 -0500 Subject: path: module replay From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: Patrick McHardy , "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <1105903033.1097.829.camel@jzny.localdomain> References: <1105900522.1090.798.camel@jzny.localdomain> <41EAB74F.6060507@trash.net> <20050116185630.GZ26856@postel.suug.ch> <1105903033.1097.829.camel@jzny.localdomain> Content-Type: multipart/mixed; boundary="=-z7lhh1ujrqFdR43zqEYn" Organization: jamalopolous Message-Id: <1105903960.1097.836.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 16 Jan 2005 14:32:40 -0500 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 338 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev --=-z7lhh1ujrqFdR43zqEYn Content-Type: text/plain Content-Transfer-Encoding: 7bit Sorry, that work address just decides to appear when it feels like it. Doing this from my laptop which is also used for work (as well as extra curicular activities ;->). Now if evolution could setup the From address for me when posting to netdev it would help ;-> On Sun, 2005-01-16 at 14:17, Jamal Hadi Salim wrote: > On my part - theres one little change i made - just compiling it as we > speak; > I will post and stop there until you are done Ok, here is the last patch. I think module replay should be done from that spot and to be consistent as well from cls_api.c for legacy stuff. I also fixed a module ref count leak. the act_api piece is dependent on what i sent earlier for namsiz. the cls_api change i believe conflicts with what Thomas sent yesterday. Anyways, not sending anymore after this ;-> cheers, jamal --=-z7lhh1ujrqFdR43zqEYn Content-Disposition: attachment; filename=p_replay Content-Type: text/plain; name=p_replay; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit --- a/net/sched/act_api.c 2005/01/16 14:05:37 1.2 +++ b/net/sched/act_api.c 2005/01/16 14:22:47 @@ -308,7 +308,7 @@ */ if (a_o != NULL) { *err = -EAGAIN; - goto err_mod; + goto err_out; } #endif goto err_out; @@ -361,9 +361,13 @@ } for (i=0; i < TCA_ACT_MAX_PRIO && tb[i]; i++) { +replay: act = tcf_action_init_1(tb[i], est, name, ovr, bind, err); - if (act == NULL) - goto err; + if (act == NULL) { + if (*err == -EAGAIN) + goto replay; + goto err_out; + } act->order = i+1; if (head == NULL) @@ -374,7 +378,7 @@ } return head; -err: +err_out: if (head != NULL) tcf_action_destroy(head, bind); return NULL; @@ -752,10 +756,7 @@ */ if (n->nlmsg_flags&NLM_F_REPLACE) ovr = 1; -replay: ret = tcf_action_add(tca[TCA_ACT_TAB-1], n, pid, ovr); - if (ret == -EAGAIN) - goto replay; break; case RTM_DELACTION: ret = tca_action_gd(tca[TCA_ACT_TAB-1], n, pid, RTM_DELACTION); --- a/net/sched/cls_api.c 2005/01/16 14:09:39 1.1 +++ b/net/sched/cls_api.c 2005/01/16 14:20:41 @@ -486,14 +486,19 @@ memset(exts, 0, sizeof(*exts)); #ifdef CONFIG_NET_CLS_ACT + { int err; struct tc_action *act; if (map->police && tb[map->police-1]) { +replay: act = tcf_action_init_1(tb[map->police-1], rate_tlv, "police", TCA_ACT_NOREPLACE, TCA_ACT_BIND, &err); - if (act == NULL) - return err; + if (act == NULL) { + if (err == -EAGAIN) + goto replay; + return err; + } act->type = TCA_OLD_COMPAT; exts->action = act; @@ -505,6 +510,7 @@ exts->action = act; } + } #elif defined CONFIG_NET_CLS_POLICE if (map->police && tb[map->police-1]) { struct tcf_police *p; --=-z7lhh1ujrqFdR43zqEYn-- From kaber@trash.net Sun Jan 16 11:44:23 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 11:44:27 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GJiM5D003693 for ; Sun, 16 Jan 2005 11:44:22 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CqGJL-0001oS-0d; Sun, 16 Jan 2005 20:43:43 +0100 Message-ID: <41EAC3EE.1020801@trash.net> Date: Sun, 16 Jan 2005 20:43:42 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: hadi@cyberus.ca CC: Thomas Graf , "David S. Miller" , netdev@oss.sgi.com Subject: Re: path: module replay References: <1105900522.1090.798.camel@jzny.localdomain> <41EAB74F.6060507@trash.net> <20050116185630.GZ26856@postel.suug.ch> <1105903033.1097.829.camel@jzny.localdomain> <1105903960.1097.836.camel@jzny.localdomain> In-Reply-To: <1105903960.1097.836.camel@jzny.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 339 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev jamal wrote: >Ok, here is the last patch. I think module replay should be done from >that spot and to be consistent as well from cls_api.c for legacy stuff. >I also fixed a module ref count leak. >the act_api piece is dependent on what i sent earlier for namsiz. >the cls_api change i believe conflicts with what Thomas sent yesterday. > We have to replay all orders since we dropped the rtnl. An action could have done __dev_get_by_* or something similar. Can you send a single patch for the module refcount leak please ? Regards Patrick From kaber@trash.net Sun Jan 16 11:50:45 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 11:50:57 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GJoi03004398 for ; Sun, 16 Jan 2005 11:50:45 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CqGPY-0001p3-DM; Sun, 16 Jan 2005 20:50:08 +0100 Message-ID: <41EAC570.1010003@trash.net> Date: Sun, 16 Jan 2005 20:50:08 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: hadi@cyberus.ca CC: Thomas Graf , "David S. Miller" , netdev@oss.sgi.com Subject: Re: path: module replay References: <1105900522.1090.798.camel@jzny.localdomain> <41EAB74F.6060507@trash.net> <20050116185630.GZ26856@postel.suug.ch> <1105903033.1097.829.camel@jzny.localdomain> <1105903960.1097.836.camel@jzny.localdomain> <41EAC3EE.1020801@trash.net> In-Reply-To: <41EAC3EE.1020801@trash.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 340 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Patrick McHardy wrote: > jamal wrote: > >> Ok, here is the last patch. I think module replay should be done from >> that spot and to be consistent as well from cls_api.c for legacy stuff. >> I also fixed a module ref count leak. the act_api piece is dependent >> on what i sent earlier for namsiz. >> the cls_api change i believe conflicts with what Thomas sent yesterday. >> > We have to replay all orders since we dropped the rtnl. An action > could have done __dev_get_by_* or something similar. Can you send > a single patch for the module refcount leak please ? I was wrong, the already initialized actions need to hold their own references anyway. I'm going have another look and add your patch later if I don't see other problems. Regards Patrick From pekkas@netcore.fi Sun Jan 16 11:52:00 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 11:52:08 -0800 (PST) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GJptUD004683 for ; Sun, 16 Jan 2005 11:51:57 -0800 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id j0GJpfZ11204; Sun, 16 Jan 2005 21:51:43 +0200 Date: Sun, 16 Jan 2005 21:51:41 +0200 (EET) From: Pekka Savola To: Lennert Buytenhek cc: netdev@oss.sgi.com Subject: Re: tunneling in linux (was: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling) In-Reply-To: <20050116185553.GA21739@xi.wantstofly.org> Message-ID: References: <20050112222437.GC14280@xi.wantstofly.org> <20050113092351.GA23170@xi.wantstofly.org> <1105897020.1091.736.camel@jzny.localdomain> <20050116185553.GA21739@xi.wantstofly.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 341 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev On Sun, 16 Jan 2005, Lennert Buytenhek wrote: > If we do end up using GRE for ethernet tunneling, there's some work that > needs to be done. For one, ip_gre in its current form would need a certain > amount of hacking for tunneling ethernet frames instead of IPv4/IPv6 as > it does now. We might as rename it to plain 'gre' and move it out of > net/ipv4/ to net/core/ or something while we're at it. Now that I think about this a bit more, there may be a potential issue.. If the payload of GRE is an ethernet frame, which GRE 'Protocol Type' (i.e., ethertype) would that be? I doubt anyone has defined an ethertype which would be used to transmit full ethernet frames inside an ethernet header, so this would likely need to be some special value.. http://www.iana.org/assignments/ethernet-numbers (Another solution for this problem space is obviously L2TP, which is also rather widely supported..) -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From buytenh@wantstofly.org Sun Jan 16 11:57:52 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 11:57:57 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GJvp3N006215 for ; Sun, 16 Jan 2005 11:57:52 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id 0BF6C2B0EC; Sun, 16 Jan 2005 20:57:51 +0100 (MET) Date: Sun, 16 Jan 2005 20:57:50 +0100 From: Lennert Buytenhek To: Pekka Savola Cc: netdev@oss.sgi.com Subject: Re: tunneling in linux (was: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling) Message-ID: <20050116195750.GB22165@xi.wantstofly.org> References: <20050112222437.GC14280@xi.wantstofly.org> <20050113092351.GA23170@xi.wantstofly.org> <1105897020.1091.736.camel@jzny.localdomain> <20050116185553.GA21739@xi.wantstofly.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 342 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev On Sun, Jan 16, 2005 at 09:51:41PM +0200, Pekka Savola wrote: > >If we do end up using GRE for ethernet tunneling, there's some work that > >needs to be done. For one, ip_gre in its current form would need a certain > >amount of hacking for tunneling ethernet frames instead of IPv4/IPv6 as > >it does now. We might as rename it to plain 'gre' and move it out of > >net/ipv4/ to net/core/ or something while we're at it. > > Now that I think about this a bit more, there may be a potential > issue.. > > If the payload of GRE is an ethernet frame, which GRE 'Protocol Type' > (i.e., ethertype) would that be? I assumed that "Transparent Ethernet Bridging" would be used for that. From ethernet-numbers: Ethernet Exp. Ethernet Description References ------------- ------------- ----------- ---------- decimal Hex decimal octal [snip] 25944 6558 - - Trans Ethen Bridging [RFC1701] RFC1701 is the original GRE RFC, which mentions: The following are currently assigned protocol types for GRE. Future protocol types must be taken from DIX ethernet encoding. For historical reasons, a number of other values have been used for some protocols. The following table of values MUST be used to identify the following protocols: Protocol Family PTYPE --------------- ----- [snip] Transparent Ethernet Bridging 6558 --L From hadi@cyberus.ca Sun Jan 16 12:02:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 12:02:40 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GK2Z5Q006898 for ; Sun, 16 Jan 2005 12:02:35 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1CqGbY-00009U-Pj for netdev@oss.sgi.com; Sun, 16 Jan 2005 15:02:32 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqGbV-0002he-JG; Sun, 16 Jan 2005 15:02:29 -0500 Subject: Re: tunneling in linux (was: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling) From: jamal Reply-To: hadi@cyberus.ca To: Lennert Buytenhek Cc: netdev@oss.sgi.com, Pekka Savola , shemminger@osdl.org, shollenbeck@verisign.com In-Reply-To: <20050116185553.GA21739@xi.wantstofly.org> References: <20050112222437.GC14280@xi.wantstofly.org> <20050113092351.GA23170@xi.wantstofly.org> <1105897020.1091.736.camel@jzny.localdomain> <20050116185553.GA21739@xi.wantstofly.org> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105905745.1097.858.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 16 Jan 2005 15:02:26 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 343 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Sun, 2005-01-16 at 13:55, Lennert Buytenhek wrote: [..] > Another argument against etherip would be that OpenBSD apparently > mis-implemented etherip by putting the etherip version nibble in the > second nibble of the etherip header instead of the first, which would > probably prevent the linux and OpenBSD versions from interoperating, > negating the advantage of using etherip in the first place. Should be pretty easy for them to fix, no? > All I personally care about is that when I install a random linux distro > two years from now, that ethernet-over-IP tunneling will simply work, using > whatever protocol -- I don't care about which. > > Any opinions? > My opinion is it doesnt harm to have it in. BTW, in one of your emails i noticed you cced the authors of that RFC - did they respond? Whats their deployment experiences? > > If we do end up using GRE for ethernet tunneling, there's some work that > needs to be done. For one, ip_gre in its current form would need a certain > amount of hacking for tunneling ethernet frames instead of IPv4/IPv6 as > it does now. We might as rename it to plain 'gre' and move it out of > net/ipv4/ to net/core/ or something while we're at it. > > The way we currently use (f.e. in iproute2) for finding out whether a > given netdevice is a tunnel or not is by looking at ARPHRD_*, but this > scheme breaks down for ethernet tunnels, the dev->type is intended precisely for that. So if this needs a new type then you should introduce a new ARPHRD type for it and set it at device creation time. > since there is no other way of > distinguishing them from regular ethernet devices. We could issue > SIOCGETTUNNEL and see if that succeeds, but that unfortunately aliases > with SIOCDEVPRIVATE which aliases to BOND_ENSLAVE_OLD, SIOCGMSTATS, > EQL_ENSLAVE, FRAD_GET_CONF, SIOCDEVPLIP, SIOCGPPPSTATS and a million > others, so you never know if the netdevice really interpreted it as > SIOCGETTUNNEL or no. Introducing the new type should help. Also the iflink is typically set to the mother netdevice. So that should go a long way to give you details. Ia m not sure about this ioctl stuff - but shouldnt there be a backway via netlink for all these details. > Other things that suck about tunneling? > - If we're going to overhaul the way tunneling works, we should try to > remove the need for the gre0 interface as well. Why is this first instance needed? Its not like theres a bus that is scanned at boot time and we need to create at that discovery time. > - Tunneling over IPv6 should be implemented. sit? or v6-v6? > - How to share more code between sit/ipip/gre? Lots of shareable stuff there. BTW, have you looked at any of the L2VPN stuff? browse the ietf web page. Some interesting stuff there. cheers, jamal From hadi@cyberus.ca Sun Jan 16 12:05:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 12:05:30 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GK5Q4i007552 for ; Sun, 16 Jan 2005 12:05:26 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1CqGeI-0003ar-WB for netdev@oss.sgi.com; Sun, 16 Jan 2005 15:05:22 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqGe6-00034N-Mo; Sun, 16 Jan 2005 15:05:11 -0500 Subject: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling From: jamal Reply-To: hadi@cyberus.ca To: Lennert Buytenhek Cc: Pekka Savola , netdev@oss.sgi.com, shemminger@osdl.org, shollenbeck@verisign.com In-Reply-To: <20050116190227.GC21870@xi.wantstofly.org> References: <20050112222437.GC14280@xi.wantstofly.org> <20050113092351.GA23170@xi.wantstofly.org> <1105897020.1091.736.camel@jzny.localdomain> <20050116190227.GC21870@xi.wantstofly.org> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105905906.1097.860.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 16 Jan 2005 15:05:06 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 344 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Sun, 2005-01-16 at 14:02, Lennert Buytenhek wrote: > Apparently they mis-read the RFC and write the etherip header as 0x0300 > instead of 0x3000 (they have the version nibble in the wrong place.) This > would likely prevent interoperability. Thinking about it a bit - you should be able to break yours to do 0x0300 to test with them ;-> cheers, jamal From buytenh@wantstofly.org Sun Jan 16 12:20:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 12:20:48 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GKKfGF012536 for ; Sun, 16 Jan 2005 12:20:42 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id 244362B0EC; Sun, 16 Jan 2005 21:20:41 +0100 (MET) Date: Sun, 16 Jan 2005 21:20:41 +0100 From: Lennert Buytenhek To: jamal Cc: netdev@oss.sgi.com, Pekka Savola , shemminger@osdl.org, shollenbeck@verisign.com Subject: Re: tunneling in linux (was: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling) Message-ID: <20050116202041.GC22165@xi.wantstofly.org> References: <20050112222437.GC14280@xi.wantstofly.org> <20050113092351.GA23170@xi.wantstofly.org> <1105897020.1091.736.camel@jzny.localdomain> <20050116185553.GA21739@xi.wantstofly.org> <1105905745.1097.858.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1105905745.1097.858.camel@jzny.localdomain> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 345 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev On Sun, Jan 16, 2005 at 03:02:26PM -0500, jamal wrote: > > Another argument against etherip would be that OpenBSD apparently > > mis-implemented etherip by putting the etherip version nibble in the > > second nibble of the etherip header instead of the first, which would > > probably prevent the linux and OpenBSD versions from interoperating, > > negating the advantage of using etherip in the first place. > > Should be pretty easy for them to fix, no? Sure, but, the argument in favor of etherip would be interoperability with existing implementations. If at least OpenBSD gets it wrong (and the proposed patch for NetBSD seems to also use the wrong value) then this argument isn't all that strong anymore. > > All I personally care about is that when I install a random linux distro > > two years from now, that ethernet-over-IP tunneling will simply work, using > > whatever protocol -- I don't care about which. > > > > Any opinions? > > My opinion is it doesnt harm to have it in. We'd need to sort out the ARPHRD_* issue in any case -- see below. > BTW, in one of your emails i > noticed you cced the authors of that RFC - did they respond? Whats their > deployment experiences? The @rsa.. address bounces, the other address is still in the CC list and I didn't hear from him yet :-) > > If we do end up using GRE for ethernet tunneling, there's some work that > > needs to be done. For one, ip_gre in its current form would need a certain > > amount of hacking for tunneling ethernet frames instead of IPv4/IPv6 as > > it does now. We might as rename it to plain 'gre' and move it out of > > net/ipv4/ to net/core/ or something while we're at it. > > > > The way we currently use (f.e. in iproute2) for finding out whether a > > given netdevice is a tunnel or not is by looking at ARPHRD_*, but this > > scheme breaks down for ethernet tunnels, > > the dev->type is intended precisely for that. So if this needs a new > type then you should introduce a new ARPHRD type for it and set it at > device creation time. Bridges present themselves as ARPHRD_ETHER, even though they are not 'real' ethernet devices as such. Should they have their own type? What about ethertap devices? If we create ARPHRD_ETHERTUNNEL for ethernet tunnels instead of using ARPHRD_ETHER, we'd have to make modifications all over the place to teach other code that ARPHRD_ETHERTUNNEL is basically just another type of ethernet device. For example, we'd have to modify net/bridge/* because it will only enslave devices which are ARPHRD_ETHER. But even more modifications would be needed in userland -- we'd have to adapt ifconfig, ip route, etc. The issue is "We can not blindly issue SIOCGETTUNNEL to ARPHRD_ETHER devices like we do for ARPHRD_{TUNNEL,IPGRE,SIT} because on _ETHER, it might alias with another ioctl (SIOCDEVPRIVATE)." > > since there is no other way of > > distinguishing them from regular ethernet devices. We could issue > > SIOCGETTUNNEL and see if that succeeds, but that unfortunately aliases > > with SIOCDEVPRIVATE which aliases to BOND_ENSLAVE_OLD, SIOCGMSTATS, > > EQL_ENSLAVE, FRAD_GET_CONF, SIOCDEVPLIP, SIOCGPPPSTATS and a million > > others, so you never know if the netdevice really interpreted it as > > SIOCGETTUNNEL or no. > > Introducing the new type should help. Also the iflink is typically set > to the mother netdevice. So that should go a long way to give you > details. There is no 'mother' device for a tunnel -- there might be no route to the remote host at creation time, and that route might change over time due to routing changes too. > > Other things that suck about tunneling? > > - If we're going to overhaul the way tunneling works, we should try to > > remove the need for the gre0 interface as well. > > Why is this first instance needed? Its not like theres a bus that is > scanned at boot time and we need to create at that discovery time. This first instance is used for sending ioctls to to create subsequent tunnel devices. Doing something netlink-based would be fine with me. > > - Tunneling over IPv6 should be implemented. > > sit? or v6-v6? Basically, 'ip tunnel' should accept v6 addresses for 'local' and 'remote'. Having GRE-over-v6 would then imply v6-over-v6, v4-over-v6, ethernet-over-v6, etc. > BTW, have you looked at any of the L2VPN stuff? browse the ietf web > page. Some interesting stuff there. The L2TP RFC (RFC 2661, is that the same thing?) is 170kB, which scared me off somewhat. At least the GRE RFC fits in 16kB. --L From buytenh@wantstofly.org Sun Jan 16 12:22:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 12:22:59 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GKMt9O012948 for ; Sun, 16 Jan 2005 12:22:55 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id 6432C2B0EC; Sun, 16 Jan 2005 21:22:54 +0100 (MET) Date: Sun, 16 Jan 2005 21:22:54 +0100 From: Lennert Buytenhek To: jamal Cc: Pekka Savola , netdev@oss.sgi.com, shemminger@osdl.org, shollenbeck@verisign.com Subject: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling Message-ID: <20050116202254.GD22165@xi.wantstofly.org> References: <20050112222437.GC14280@xi.wantstofly.org> <20050113092351.GA23170@xi.wantstofly.org> <1105897020.1091.736.camel@jzny.localdomain> <20050116190227.GC21870@xi.wantstofly.org> <1105905906.1097.860.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1105905906.1097.860.camel@jzny.localdomain> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 346 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev On Sun, Jan 16, 2005 at 03:05:06PM -0500, jamal wrote: > > Apparently they mis-read the RFC and write the etherip header as 0x0300 > > instead of 0x3000 (they have the version nibble in the wrong place.) This > > would likely prevent interoperability. > > Thinking about it a bit - you should be able to break yours to do 0x0300 > to test with them ;-> Etherip is a really simple standard, the header is only 16 bits which can only assume a single value (0x3000). Looking at encapsulated packets with tcpdump makes me 99.99% confident that it's all okay on that level. --L From hasso@estpak.ee Sun Jan 16 12:37:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 12:37:24 -0800 (PST) Received: from arena (dream.estpak.ee [194.126.115.147]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GKbIwH014192 for ; Sun, 16 Jan 2005 12:37:19 -0800 Received: from localhost ([127.0.0.1] helo=arena) by arena with esmtp (Exim 4.34) id 1CqH9R-0002aP-Ti; Sun, 16 Jan 2005 22:37:33 +0200 From: Hasso Tepper To: Lennert Buytenhek Subject: Re: tunneling in linux (was: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling) Date: Sun, 16 Jan 2005 22:37:33 +0200 User-Agent: KMail/1.7.2 Cc: jamal , netdev@oss.sgi.com, Pekka Savola , shemminger@osdl.org, shollenbeck@verisign.com References: <20050112222437.GC14280@xi.wantstofly.org> <1105905745.1097.858.camel@jzny.localdomain> <20050116202041.GC22165@xi.wantstofly.org> In-Reply-To: <20050116202041.GC22165@xi.wantstofly.org> Organization: Elion Enterprises Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501162237.33743.hasso@estpak.ee> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 347 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hasso@estpak.ee Precedence: bulk X-list: netdev Lennert Buytenhek wrote: > On Sun, Jan 16, 2005 at 03:02:26PM -0500, jamal wrote: > > BTW, have you looked at any of the L2VPN stuff? browse the ietf web > > page. Some interesting stuff there. > > The L2TP RFC (RFC 2661, is that the same thing?) is 170kB, which scared > me off somewhat. If L2TP, then v3 probably - RFC3931. But that's far from just ethernet over ip, it's anything over ip. -- Hasso Tepper Elion Enterprises Ltd. WAN administrator From buytenh@wantstofly.org Sun Jan 16 13:21:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 13:21:30 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GLLPW7016808 for ; Sun, 16 Jan 2005 13:21:26 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id 607D12B0EC; Sun, 16 Jan 2005 22:21:24 +0100 (MET) Date: Sun, 16 Jan 2005 22:21:24 +0100 From: Lennert Buytenhek To: Hasso Tepper Cc: jamal , netdev@oss.sgi.com, Pekka Savola , shemminger@osdl.org, shollenbeck@verisign.com Subject: Re: tunneling in linux (was: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling) Message-ID: <20050116212124.GF22165@xi.wantstofly.org> References: <20050112222437.GC14280@xi.wantstofly.org> <1105905745.1097.858.camel@jzny.localdomain> <20050116202041.GC22165@xi.wantstofly.org> <200501162237.33743.hasso@estpak.ee> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200501162237.33743.hasso@estpak.ee> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 348 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev On Sun, Jan 16, 2005 at 10:37:33PM +0200, Hasso Tepper wrote: > > > BTW, have you looked at any of the L2VPN stuff? browse the ietf web > > > page. Some interesting stuff there. > > > > The L2TP RFC (RFC 2661, is that the same thing?) is 170kB, which scared > > me off somewhat. > > If L2TP, then v3 probably - RFC3931. That RFC appears not to exist. > But that's far from just ethernet over ip, it's anything over ip. Yeah, I really doubt that L2TP is what I'm after. --L From hasso@estpak.ee Sun Jan 16 13:32:16 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 13:32:23 -0800 (PST) Received: from arena (dream.estpak.ee [194.126.115.147]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GLWFKf017756 for ; Sun, 16 Jan 2005 13:32:16 -0800 Received: from localhost ([127.0.0.1] helo=arena) by arena with esmtp (Exim 4.34) id 1CqI0l-0002dS-0n; Sun, 16 Jan 2005 23:32:39 +0200 From: Hasso Tepper To: Lennert Buytenhek Subject: Re: tunneling in linux (was: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling) Date: Sun, 16 Jan 2005 23:32:38 +0200 User-Agent: KMail/1.7.2 Cc: jamal , netdev@oss.sgi.com, Pekka Savola , shemminger@osdl.org, shollenbeck@verisign.com References: <20050112222437.GC14280@xi.wantstofly.org> <200501162237.33743.hasso@estpak.ee> <20050116212124.GF22165@xi.wantstofly.org> In-Reply-To: <20050116212124.GF22165@xi.wantstofly.org> Organization: Elion Enterprises Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501162332.38798.hasso@estpak.ee> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 349 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hasso@estpak.ee Precedence: bulk X-list: netdev Lennert Buytenhek wrote: > On Sun, Jan 16, 2005 at 10:37:33PM +0200, Hasso Tepper wrote: > > > > BTW, have you looked at any of the L2VPN stuff? browse the ietf web > > > > page. Some interesting stuff there. > > > > > > The L2TP RFC (RFC 2661, is that the same thing?) is 170kB, which > > > scared me off somewhat. > > > > If L2TP, then v3 probably - RFC3931. > > That RFC appears not to exist. Hmmm. Yes, seems that there was decision for yet another draft before 3931 was made official. Some sites contain info about it though. So official one at the moment: http://www.ietf.org/internet-drafts/draft-ietf-l2tpext-l2tp-base-15.txt -- Hasso Tepper Elion Enterprises Ltd. WAN administrator From buytenh@wantstofly.org Sun Jan 16 13:44:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 13:44:09 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GLi2M3018714 for ; Sun, 16 Jan 2005 13:44:03 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id C71E32B0EC; Sun, 16 Jan 2005 22:44:01 +0100 (MET) Date: Sun, 16 Jan 2005 22:44:01 +0100 From: Lennert Buytenhek To: Hasso Tepper Cc: jamal , netdev@oss.sgi.com, Pekka Savola , shemminger@osdl.org, shollenbeck@verisign.com Subject: Re: tunneling in linux (was: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling) Message-ID: <20050116214401.GG22165@xi.wantstofly.org> References: <20050112222437.GC14280@xi.wantstofly.org> <200501162237.33743.hasso@estpak.ee> <20050116212124.GF22165@xi.wantstofly.org> <200501162332.38798.hasso@estpak.ee> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200501162332.38798.hasso@estpak.ee> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 350 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev On Sun, Jan 16, 2005 at 11:32:38PM +0200, Hasso Tepper wrote: > > > > > BTW, have you looked at any of the L2VPN stuff? browse the ietf web > > > > > page. Some interesting stuff there. > > > > > > > > The L2TP RFC (RFC 2661, is that the same thing?) is 170kB, which > > > > scared me off somewhat. > > > > > > If L2TP, then v3 probably - RFC3931. > > > > That RFC appears not to exist. > > Hmmm. Yes, seems that there was decision for yet another draft before 3931 > was made official. Some sites contain info about it though. So official one > at the moment: > > http://www.ietf.org/internet-drafts/draft-ietf-l2tpext-l2tp-base-15.txt Things like this make me shiver: Appendix A: Control Slow Start and Congestion Avoidance Although each side has indicated the maximum size of its receive window, it is recommended that a slow start and congestion avoidance method be used to transmit control packets. The methods described here are based upon the TCP congestion avoidance algorithm as described in Section 21.6 of TCP/IP Illustrated, Volume I, by W. Richard Stevens [STEVENS] (this algorithm is also described in [RFC2581]). [snip] For some reason, people really really like reinventing TCP. I'm definitely not going to implement this, all I wanted from the very beginning is a _simple_ way of tunneling ethernet packets. :-) --L From njm@us.ibm.com Sun Jan 16 15:03:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 15:03:58 -0800 (PST) Received: from e3.ny.us.ibm.com (e3.ny.us.ibm.com [32.97.182.143]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GN3lf6023373 for ; Sun, 16 Jan 2005 15:03:54 -0800 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e3.ny.us.ibm.com (8.12.10/8.12.10) with ESMTP id j0GN3f7j007929 for ; Sun, 16 Jan 2005 18:03:41 -0500 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay04.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j0GN3fk2225514 for ; Sun, 16 Jan 2005 18:03:41 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j0GN3fvY031597 for ; Sun, 16 Jan 2005 18:03:41 -0500 Received: from [9.65.55.216] (sig-9-65-55-216.mts.ibm.com [9.65.55.216]) by d01av02.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j0GN3eO2031588 for ; Sun, 16 Jan 2005 18:03:40 -0500 Message-ID: <41EAF2C9.5010201@us.ibm.com> Date: Sun, 16 Jan 2005 17:03:37 -0600 From: Nancy Milliner User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: Re: [DEBUG]: sk_forward_alloc assertion failures Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 351 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: njm@us.ibm.com Precedence: bulk X-list: netdev Dave, I've been running SPECweb99 with this patch all weekend and have not been able to produce any kernel assertions at all. I'm currently running RH kernel 2.6.9-5.EL.root and have been able to reproduce at will when setting /proc/net/ipv4/tcp_tso_win_divisor to 1, 2 or 4. Let me know when you have something else ready to test. ===== net/ipv4/tcp.c 1.88 vs edited ===== --- 1.88/net/ipv4/tcp.c 2005-01-06 15:13:39 -08:00 +++ edited/net/ipv4/tcp.c 2005-01-13 19:44:36 -08:00 @@ -664,7 +664,7 @@ if (!sk_stream_memory_free(sk)) goto wait_for_sndbuf; - skb = sk_stream_alloc_pskb(sk, 0, tp->mss_cache, + skb = sk_stream_alloc_pskb(sk, 0, 0, sk->sk_allocation); if (!skb) goto wait_for_memory; @@ -689,6 +689,9 @@ skb->len += copy; skb->data_len += copy; + skb->truesize += copy; + sk->sk_wmem_queued += copy; + sk->sk_forward_alloc -= copy; skb->ip_summed = CHECKSUM_HW; tp->write_seq += copy; TCP_SKB_CB(skb)->end_seq += copy; From hadi@cyberus.ca Sun Jan 16 15:09:19 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 15:09:26 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GN9ISv024107 for ; Sun, 16 Jan 2005 15:09:19 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CqJWH-0004t5-3W for netdev@oss.sgi.com; Sun, 16 Jan 2005 18:09:17 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqJW9-0007Wt-2m; Sun, 16 Jan 2005 18:09:09 -0500 Subject: Re: tunneling in linux (was: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling) From: jamal Reply-To: hadi@cyberus.ca To: Lennert Buytenhek Cc: netdev@oss.sgi.com, Pekka Savola , shemminger@osdl.org, shollenbeck@verisign.com In-Reply-To: <20050116202041.GC22165@xi.wantstofly.org> References: <20050112222437.GC14280@xi.wantstofly.org> <20050113092351.GA23170@xi.wantstofly.org> <1105897020.1091.736.camel@jzny.localdomain> <20050116185553.GA21739@xi.wantstofly.org> <1105905745.1097.858.camel@jzny.localdomain> <20050116202041.GC22165@xi.wantstofly.org> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105916945.1091.1039.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 16 Jan 2005 18:09:05 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 352 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Sun, 2005-01-16 at 15:20, Lennert Buytenhek wrote: > On Sun, Jan 16, 2005 at 03:02:26PM -0500, jamal wrote: > Sure, but, the argument in favor of etherip would be interoperability > with existing implementations. If at least OpenBSD gets it wrong (and > the proposed patch for NetBSD seems to also use the wrong value) then > this argument isn't all that strong anymore. > Is 0x300 owned by anything? Maybe thats what it should be from now on and an update to be issued agains the RFC ;-> > > BTW, in one of your emails i > > noticed you cced the authors of that RFC - did they respond? Whats their > > deployment experiences? > > The @rsa.. address bounces, the other address is still in the CC list > and I didn't hear from him yet :-) Hopefully we'll hear from them > > the dev->type is intended precisely for that. So if this needs a new > > type then you should introduce a new ARPHRD type for it and set it at > > device creation time. > > Bridges present themselves as ARPHRD_ETHER, even though they are not > 'real' ethernet devices as such. Should they have their own type? some devices are "ethernet like" - meaning they operate on ethernet headers, so its fine to use that. I would think bridges would fall under that category. > What about ethertap devices? They are ethernet like as well. OTOH, if you look at tuntap you may find one of the modes is not ethernet-like. Infact it doesnt have a header at all;-> (ARPHRD_NONE). rule of thumb: Whats the header like? > If we create ARPHRD_ETHERTUNNEL for ethernet tunnels instead of using > ARPHRD_ETHER, we'd have to make modifications all over the place to > teach other code that ARPHRD_ETHERTUNNEL is basically just another type > of ethernet device. IANA actually keeps track of these iftype numbers - they dont seem to match with Linux - I wonder why we havent heard some SNMP weenie bitching about this: http://www.iana.org/assignments/ianaiftype-mib So, yes, should be able to add ARPHRD_ETHERTUNNEL in some free number and i am pretty sure youd hear from them someday;-> If i have time i will sneak a look at net-snmp > For example, we'd have to modify net/bridge/* > because it will only enslave devices which are ARPHRD_ETHER. But even > more modifications would be needed in userland -- we'd have to adapt > ifconfig, ip route, etc. You probably want net/bridge to enslave _only_ ethernet like type netdevices. Otherwise it gets confused trying to see where the fsck dst MAC is to be found. > The issue is "We can not blindly issue SIOCGETTUNNEL to ARPHRD_ETHER > devices like we do for ARPHRD_{TUNNEL,IPGRE,SIT} because on _ETHER, it > might alias with another ioctl (SIOCDEVPRIVATE)." I dont think it will be an issue with proper dev->type. You know theres another way to do this: Write this as a simple action. If all you are doing is slapping headers back and forth then you want: ingress: match protocol 0x3000 action: etherip decap, format, --> netif_rx egress: outgoing: match someIP action: etherip encap, format --> out we go All very simple to control with netlink. And would be an excuse to finaly get you to look at this stuff ;-> > > Introducing the new type should help. Also the iflink is typically set > > to the mother netdevice. So that should go a long way to give you > > details. > > There is no 'mother' device for a tunnel -- there might be no route to > the remote host at creation time, and that route might change over time > due to routing changes too. > I thought you should be able to specify _exactly_ what the physical device is ("ip tunnel ... dev eth0" or something along those lines) . I could be wrong. > > Why is this first instance needed? Its not like theres a bus that is > > scanned at boot time and we need to create at that discovery time. > > This first instance is used for sending ioctls to to create subsequent > tunnel devices. Doing something netlink-based would be fine with me. > Yes, that would kill need for those devices.. 2.6.x is now fine and should handle all that fine with no need for ioctls - backward comapt maybe an issue. > > > > - Tunneling over IPv6 should be implemented. > > > > sit? or v6-v6? > > Basically, 'ip tunnel' should accept v6 addresses for 'local' and > 'remote'. Having GRE-over-v6 would then imply v6-over-v6, v4-over-v6, > ethernet-over-v6, etc. > At the moment you specify the mode - is that the only painful thing? Didnt quiet follow > > > BTW, have you looked at any of the L2VPN stuff? browse the ietf web > > page. Some interesting stuff there. > > The L2TP RFC (RFC 2661, is that the same thing?) is 170kB, which scared > me off somewhat. > > At least the GRE RFC fits in 16kB. No meant L2VPNs - purely layer 2 and then somewhere along the path carried by MPLS. start here: http://www.ietf.org/html.charters/l2vpn-charter.html cheers, jamal From hadi@cyberus.ca Sun Jan 16 15:10:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 15:11:00 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0GNAs1N024613 for ; Sun, 16 Jan 2005 15:10:55 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1CqJXn-0007iX-Qh for netdev@oss.sgi.com; Sun, 16 Jan 2005 18:10:51 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqJXe-0007lV-Ed; Sun, 16 Jan 2005 18:10:42 -0500 Subject: Re: [patch 4/10] s390: network driver. From: jamal Reply-To: hadi@cyberus.ca To: Tommy Christensen Cc: Jeff Garzik , Thomas Spatzier , "David S. Miller" , Hasso Tepper , Herbert Xu , netdev@oss.sgi.com, Paul Jakma In-Reply-To: <1105363092.1041.146.camel@jzny.localdomain> References: <1104764710.1048.580.camel@jzny.localdomain> <41DB26A6.2070008@pobox.com> <1104895169.1117.63.camel@jzny.localdomain> <41DC0931.80603@tpack.net> <1105019912.2314.20.camel@jzny.localdomain> <1105023972.3462.48.camel@tsc-6.cph.tpack.net> <1105104757.1046.63.camel@jzny.localdomain> <1105111605.3462.101.camel@tsc-6.cph.tpack.net> <1105363092.1041.146.camel@jzny.localdomain> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105917038.1091.1041.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 16 Jan 2005 18:10:38 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 353 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Didnt see anymore discussion on this - have we given up on it? cheers, jamal On Mon, 2005-01-10 at 08:18, jamal wrote: > On Fri, 2005-01-07 at 10:26, Tommy Christensen wrote: > > On Fri, 2005-01-07 at 14:32, jamal wrote: > > > On Thu, 2005-01-06 at 10:06, Tommy Christensen wrote: > > [..] > > > > reseting qdisc could certainly be part of the device watchdog. > > > Note that once the packets are drained, the next thing that will happen > > > if device is stopped for a dev->timeout period is watchdog kicking in > > > and flushing the DMA. So you could reset your qdisc there though i am > > > not sure it will be needed with that patch. > > > > Unfortunately the watchdog won't do this when carrier is off, which > > is fair enough since the chip isn't hung as such. > > We may have to kick the dog in that path as well then. > > > So, we would need another method to flush out stale packets from > > the DMA ring. Some drivers already do this themselves, and some won't > > need it because they keep on running even when link is down. > > kicking tx_timeout seems like the right thing to do until i looked at > the drivers. Sigh. I just stared at a few drivers and it is not pleasant > - and they mostly have the same theme (so you cant say they are > inconsistent). > Looking at e1000 for example is quiet interesting - it actually brings > down then up the device ;-> This will both flash the dma and reset qdisc > but also loose any static routes. It will also reschedule the device;-< > So i am not so sure that the dog kicking in a minute later is a good > thing at all. We may need a lot of janitorial work to cleanse the > drivers - something jgarzik is against. > > A qdisc_reset, as you suggest, will probably not cure the problem but > provide some cosmetics. Thoughts? > > cheers, > jamal > > > From pekkas@netcore.fi Sun Jan 16 21:45:17 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 16 Jan 2005 21:45:21 -0800 (PST) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0H5jFLM014229 for ; Sun, 16 Jan 2005 21:45:16 -0800 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id j0H5j8F22067; Mon, 17 Jan 2005 07:45:08 +0200 Date: Mon, 17 Jan 2005 07:45:08 +0200 (EET) From: Pekka Savola To: Lennert Buytenhek cc: netdev@oss.sgi.com Subject: Re: tunneling in linux (was: Re: [PATCH][RFC] etherip: Ethernet-in-IPv4 tunneling) In-Reply-To: <20050116195750.GB22165@xi.wantstofly.org> Message-ID: References: <20050112222437.GC14280@xi.wantstofly.org> <20050113092351.GA23170@xi.wantstofly.org> <1105897020.1091.736.camel@jzny.localdomain> <20050116185553.GA21739@xi.wantstofly.org> <20050116195750.GB22165@xi.wantstofly.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 354 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev On Sun, 16 Jan 2005, Lennert Buytenhek wrote: > I assumed that "Transparent Ethernet Bridging" would be used for that. > > 25944 6558 - - Trans Ethen Bridging [RFC1701] Yes. Sorry I missed that. -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From bunk@stusta.de Mon Jan 17 00:14:51 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 00:14:59 -0800 (PST) Received: from mailout.stusta.mhn.de (emailhub.stusta.mhn.de [141.84.69.5]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0H8Emcd019768 for ; Mon, 17 Jan 2005 00:14:50 -0800 Received: (qmail 17648 invoked from network); 17 Jan 2005 08:14:42 -0000 Received: from r063144.stusta.swh.mhn.de (10.150.63.144) by mailhub.stusta.mhn.de with SMTP; 17 Jan 2005 08:14:42 -0000 Received: by r063144.stusta.swh.mhn.de (Postfix, from userid 1000) id C200ABBF31; Mon, 17 Jan 2005 09:14:38 +0100 (CET) Date: Mon, 17 Jan 2005 09:14:38 +0100 From: Adrian Bunk To: "David S. Miller" Cc: acme@conectiva.com.br, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [2.6 patch] net/802/: some cleanups Message-ID: <20050117081438.GE4274@stusta.de> References: <20041212201115.GU22324@stusta.de> <20041227184923.5b26f5a0.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041227184923.5b26f5a0.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 355 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bunk@stusta.de Precedence: bulk X-list: netdev On Mon, Dec 27, 2004 at 06:49:23PM -0800, David S. Miller wrote: > > drivers/net/net_init.c no longer exists in the source tree :) Updated patch: <-- snip --> This patch contains the following cleanups: - make some needlessly global code static - net/802/hippi.c: remove the unused global function hippi_net_init - net/8021q/vlan.c: remove the global variable vlan_default_dev_flags that was never changed Signed-off-by: Adrian Bunk --- diffstat output: drivers/net/fc/iph5526_ip.h | 1 - include/linux/fcdevice.h | 4 ---- include/linux/fddidevice.h | 7 ------- include/linux/hippidevice.h | 21 --------------------- include/linux/trdevice.h | 4 ---- net/802/fc.c | 7 ++++--- net/802/fddi.c | 7 ++++--- net/802/hippi.c | 19 ++++--------------- net/802/tr.c | 7 ++++--- net/8021q/vlan.c | 9 +++------ net/8021q/vlan.h | 1 - net/8021q/vlanproc.c | 2 +- 12 files changed, 20 insertions(+), 69 deletions(-) --- linux-2.6.10-rc2-mm4-full/include/linux/fcdevice.h.old 2004-12-12 18:03:19.000000000 +0100 +++ linux-2.6.10-rc2-mm4-full/include/linux/fcdevice.h 2004-12-12 18:06:57.000000000 +0100 @@ -27,10 +27,6 @@ #include #ifdef __KERNEL__ -extern int fc_header(struct sk_buff *skb, struct net_device *dev, - unsigned short type, void *daddr, - void *saddr, unsigned len); -extern int fc_rebuild_header(struct sk_buff *skb); extern unsigned short fc_type_trans(struct sk_buff *skb, struct net_device *dev); extern struct net_device *alloc_fcdev(int sizeof_priv); --- linux-2.6.10-rc2-mm4-full/net/802/fc.c.old 2004-12-12 18:03:56.000000000 +0100 +++ linux-2.6.10-rc2-mm4-full/net/802/fc.c 2004-12-12 18:04:53.000000000 +0100 @@ -35,8 +35,9 @@ * Put the headers on a Fibre Channel packet. */ -int fc_header(struct sk_buff *skb, struct net_device *dev, unsigned short type, - void *daddr, void *saddr, unsigned len) +static int fc_header(struct sk_buff *skb, struct net_device *dev, + unsigned short type, + void *daddr, void *saddr, unsigned len) { struct fch_hdr *fch; int hdr_len; @@ -81,7 +82,7 @@ * can now send the packet. */ -int fc_rebuild_header(struct sk_buff *skb) +static int fc_rebuild_header(struct sk_buff *skb) { struct fch_hdr *fch=(struct fch_hdr *)skb->data; struct fcllc *fcllc=(struct fcllc *)(skb->data+sizeof(struct fch_hdr)); --- linux-2.6.10-rc2-mm4-full/drivers/net/fc/iph5526_ip.h.old 2004-12-12 18:07:07.000000000 +0100 +++ linux-2.6.10-rc2-mm4-full/drivers/net/fc/iph5526_ip.h 2004-12-12 18:07:21.000000000 +0100 @@ -18,7 +18,6 @@ static void rx_net_packet(struct fc_info *fi, u_char *buff_addr, int payload_size); static void rx_net_mfs_packet(struct fc_info *fi, struct sk_buff *skb); -unsigned short fc_type_trans(struct sk_buff *skb, struct net_device *dev); static int tx_ip_packet(struct sk_buff *skb, unsigned long len, struct fc_info *fi); static int tx_arp_packet(char *data, unsigned long len, struct fc_info *fi); #endif --- linux-2.6.10-rc2-mm4-full/include/linux/fddidevice.h.old 2004-12-12 18:08:23.000000000 +0100 +++ linux-2.6.10-rc2-mm4-full/include/linux/fddidevice.h 2004-12-12 18:10:20.000000000 +0100 @@ -25,13 +25,6 @@ #include #ifdef __KERNEL__ -extern int fddi_header(struct sk_buff *skb, - struct net_device *dev, - unsigned short type, - void *daddr, - void *saddr, - unsigned len); -extern int fddi_rebuild_header(struct sk_buff *skb); extern unsigned short fddi_type_trans(struct sk_buff *skb, struct net_device *dev); extern struct net_device *alloc_fddidev(int sizeof_priv); --- linux-2.6.10-rc2-mm4-full/net/802/fddi.c.old 2004-12-12 18:08:41.000000000 +0100 +++ linux-2.6.10-rc2-mm4-full/net/802/fddi.c 2004-12-12 18:10:15.000000000 +0100 @@ -52,8 +52,9 @@ * daddr=NULL means leave destination address (eg unresolved arp) */ -int fddi_header(struct sk_buff *skb, struct net_device *dev, unsigned short type, - void *daddr, void *saddr, unsigned len) +static int fddi_header(struct sk_buff *skb, struct net_device *dev, + unsigned short type, + void *daddr, void *saddr, unsigned len) { int hl = FDDI_K_SNAP_HLEN; struct fddihdr *fddi; @@ -96,7 +97,7 @@ * this sk_buff. We now let ARP fill in the other fields. */ -int fddi_rebuild_header(struct sk_buff *skb) +static int fddi_rebuild_header(struct sk_buff *skb) { struct fddihdr *fddi = (struct fddihdr *)skb->data; --- linux-2.6.10-rc2-mm4-full/include/linux/hippidevice.h.old 2004-12-12 18:10:40.000000000 +0100 +++ linux-2.6.10-rc2-mm4-full/include/linux/hippidevice.h 2004-12-12 18:11:56.000000000 +0100 @@ -26,30 +26,9 @@ #include #ifdef __KERNEL__ -extern int hippi_header(struct sk_buff *skb, - struct net_device *dev, - unsigned short type, - void *daddr, - void *saddr, - unsigned len); - -extern int hippi_rebuild_header(struct sk_buff *skb); - extern unsigned short hippi_type_trans(struct sk_buff *skb, struct net_device *dev); -extern void hippi_header_cache_bind(struct hh_cache ** hhp, - struct net_device *dev, - unsigned short htype, - __u32 daddr); - -extern void hippi_header_cache_update(struct hh_cache *hh, - struct net_device *dev, - unsigned char * haddr); -extern int hippi_header_parse(struct sk_buff *skb, unsigned char *haddr); - -extern void hippi_net_init(void); - extern struct net_device *alloc_hippi_dev(int sizeof_priv); #endif --- linux-2.6.10-rc2-mm4-full/net/802/hippi.c.old 2004-12-12 18:12:42.000000000 +0100 +++ linux-2.6.10-rc2-mm4-full/net/802/hippi.c 2004-12-12 18:13:32.000000000 +0100 @@ -40,26 +40,15 @@ #include /* - * hippi_net_init() - * - * Do nothing, this is just to pursuade the stupid linker to behave. - */ - -void hippi_net_init(void) -{ - return; -} - -/* * Create the HIPPI MAC header for an arbitrary protocol layer * * saddr=NULL means use device source address * daddr=NULL means leave destination address (eg unresolved arp) */ -int hippi_header(struct sk_buff *skb, struct net_device *dev, - unsigned short type, void *daddr, void *saddr, - unsigned len) +static int hippi_header(struct sk_buff *skb, struct net_device *dev, + unsigned short type, void *daddr, void *saddr, + unsigned len) { struct hippi_hdr *hip = (struct hippi_hdr *)skb_push(skb, HIPPI_HLEN); @@ -107,7 +96,7 @@ * completed on this sk_buff. We now let ARP fill in the other fields. */ -int hippi_rebuild_header(struct sk_buff *skb) +static int hippi_rebuild_header(struct sk_buff *skb) { struct hippi_hdr *hip = (struct hippi_hdr *)skb->data; --- linux-2.6.10-rc2-mm4-full/include/linux/trdevice.h.old 2004-12-12 18:14:26.000000000 +0100 +++ linux-2.6.10-rc2-mm4-full/include/linux/trdevice.h 2004-12-12 18:16:00.000000000 +0100 @@ -28,10 +28,6 @@ #include #ifdef __KERNEL__ -extern int tr_header(struct sk_buff *skb, struct net_device *dev, - unsigned short type, void *daddr, - void *saddr, unsigned len); -extern int tr_rebuild_header(struct sk_buff *skb); extern unsigned short tr_type_trans(struct sk_buff *skb, struct net_device *dev); extern void tr_source_route(struct sk_buff *skb, struct trh_hdr *trh, struct net_device *dev); extern struct net_device *alloc_trdev(int sizeof_priv); --- linux-2.6.10-rc2-mm4-full/net/802/tr.c.old 2004-12-12 18:14:51.000000000 +0100 +++ linux-2.6.10-rc2-mm4-full/net/802/tr.c 2004-12-12 18:15:28.000000000 +0100 @@ -98,8 +98,9 @@ * makes this a little more exciting than on ethernet. */ -int tr_header(struct sk_buff *skb, struct net_device *dev, unsigned short type, - void *daddr, void *saddr, unsigned len) +static int tr_header(struct sk_buff *skb, struct net_device *dev, + unsigned short type, + void *daddr, void *saddr, unsigned len) { struct trh_hdr *trh; int hdr_len; @@ -153,7 +154,7 @@ * can now send the packet. */ -int tr_rebuild_header(struct sk_buff *skb) +static int tr_rebuild_header(struct sk_buff *skb) { struct trh_hdr *trh=(struct trh_hdr *)skb->data; struct trllc *trllc=(struct trllc *)(skb->data+sizeof(struct trh_hdr)); --- linux-2.6.10-rc2-mm4-full/net/8021q/vlan.h.old 2004-12-12 18:17:02.000000000 +0100 +++ linux-2.6.10-rc2-mm4-full/net/8021q/vlan.h 2004-12-12 18:17:06.000000000 +0100 @@ -33,7 +33,6 @@ #define VLAN_GRP_HASH_SHIFT 5 #define VLAN_GRP_HASH_SIZE (1 << VLAN_GRP_HASH_SHIFT) #define VLAN_GRP_HASH_MASK (VLAN_GRP_HASH_SIZE - 1) -extern struct hlist_head vlan_group_hash[VLAN_GRP_HASH_SIZE]; /* Find a VLAN device by the MAC address of its Ethernet device, and * it's VLAN ID. The default configuration is to have VLAN's scope --- linux-2.6.10-rc2-mm4-full/net/8021q/vlan.c.old 2004-12-12 18:16:08.000000000 +0100 +++ linux-2.6.10-rc2-mm4-full/net/8021q/vlan.c 2004-12-12 18:17:20.000000000 +0100 @@ -40,7 +40,7 @@ /* Global VLAN variables */ /* Our listing of VLAN group(s) */ -struct hlist_head vlan_group_hash[VLAN_GRP_HASH_SIZE]; +static struct hlist_head vlan_group_hash[VLAN_GRP_HASH_SIZE]; #define vlan_grp_hashfn(IDX) ((((IDX) >> VLAN_GRP_HASH_SHIFT) ^ (IDX)) & VLAN_GRP_HASH_MASK) static char vlan_fullname[] = "802.1Q VLAN Support"; @@ -52,7 +52,7 @@ static int vlan_ioctl_handler(void __user *); static int unregister_vlan_dev(struct net_device *, unsigned short ); -struct notifier_block vlan_notifier_block = { +static struct notifier_block vlan_notifier_block = { .notifier_call = vlan_device_event, }; @@ -61,9 +61,6 @@ /* Determines interface naming scheme. */ unsigned short vlan_name_type = VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD; -/* DO reorder the header by default */ -unsigned short vlan_default_dev_flags = 1; - static struct packet_type vlan_packet_type = { .type = __constant_htons(ETH_P_8021Q), .func = vlan_skb_recv, /* VLAN receive method */ @@ -490,7 +487,7 @@ VLAN_DEV_INFO(new_dev)->vlan_id = VLAN_ID; /* 1 through VLAN_VID_MASK */ VLAN_DEV_INFO(new_dev)->real_dev = real_dev; VLAN_DEV_INFO(new_dev)->dent = NULL; - VLAN_DEV_INFO(new_dev)->flags = vlan_default_dev_flags; + VLAN_DEV_INFO(new_dev)->flags = 1; #ifdef VLAN_DEBUG printk(VLAN_DBG "About to go find the group for idx: %i\n", --- linux-2.6.10-rc2-mm4-full/net/8021q/vlanproc.c.old 2004-12-12 18:17:33.000000000 +0100 +++ linux-2.6.10-rc2-mm4-full/net/8021q/vlanproc.c 2004-12-12 18:17:42.000000000 +0100 @@ -239,7 +239,7 @@ */ /* starting at dev, find a VLAN device */ -struct net_device *vlan_skip(struct net_device *dev) +static struct net_device *vlan_skip(struct net_device *dev) { while (dev && !(dev->priv_flags & IFF_802_1Q_VLAN)) dev = dev->next; From herbert@13thfloor.at Mon Jan 17 01:09:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 01:09:20 -0800 (PST) Received: from mail.13thfloor.at (MAIL.13thfloor.at [212.16.62.51]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0H99DwF031125 for ; Mon, 17 Jan 2005 01:09:14 -0800 Received: by mail.13thfloor.at (Postfix, from userid 1001) id 2CBC9170246; Mon, 17 Jan 2005 10:09:12 +0100 (CET) Date: Mon, 17 Jan 2005 10:09:12 +0100 From: Herbert Poetzl To: Thomas Graf Cc: Andrew Morton , davem@davemloft.net, netdev@oss.sgi.com Subject: Re: [PATCH] PKT_SCHED: remove c99ism Message-ID: <20050117090912.GB30371@mail.13thfloor.at> References: <20050115144010.33182075.akpm@osdl.org> <20050115232554.GS26856@postel.suug.ch> <20050115153202.2f7f81c6.akpm@osdl.org> <20050115234056.GT26856@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050115234056.GT26856@postel.suug.ch> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 356 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@13thfloor.at Precedence: bulk X-list: netdev On Sun, Jan 16, 2005 at 12:40:56AM +0100, Thomas Graf wrote: > * Andrew Morton <20050115153202.2f7f81c6.akpm@osdl.org> 2005-01-15 15:32 > > An uglier but more efficient approach is to whack braces around the whole > > thing. > > Fine with me as well. The code isn't used that often and not deep in the > calling stack which is why I preferred the cleaner way first. hmm, please remind me why putting some #ifdef CONFIG_NET_CLS_ACT int err; struct tc_action *act; #endif at the _beginning_ of that procedure would be a bad choice? TIA, Herbert > > Signed-off-by: Thomas Graf > > --- linux-2.6.11-rc1-bk2.orig/net/sched/cls_api.c 2005-01-16 00:04:40.000000000 +0100 > +++ linux-2.6.11-rc1-bk2/net/sched/cls_api.c 2005-01-16 00:34:53.000000000 +0100 > @@ -486,24 +486,26 @@ > memset(exts, 0, sizeof(*exts)); > > #ifdef CONFIG_NET_CLS_ACT > - int err; > - struct tc_action *act; > + { > + int err; > + struct tc_action *act; > > - if (map->police && tb[map->police-1]) { > - act = tcf_action_init_1(tb[map->police-1], rate_tlv, "police", > - TCA_ACT_NOREPLACE, TCA_ACT_BIND, &err); > - if (act == NULL) > - return err; > - > - act->type = TCA_OLD_COMPAT; > - exts->action = act; > - } else if (map->action && tb[map->action-1]) { > - act = tcf_action_init(tb[map->action-1], rate_tlv, NULL, > - TCA_ACT_NOREPLACE, TCA_ACT_BIND, &err); > - if (act == NULL) > - return err; > + if (map->police && tb[map->police-1]) { > + act = tcf_action_init_1(tb[map->police-1], rate_tlv, "police", > + TCA_ACT_NOREPLACE, TCA_ACT_BIND, &err); > + if (act == NULL) > + return err; > + > + act->type = TCA_OLD_COMPAT; > + exts->action = act; > + } else if (map->action && tb[map->action-1]) { > + act = tcf_action_init(tb[map->action-1], rate_tlv, NULL, > + TCA_ACT_NOREPLACE, TCA_ACT_BIND, &err); > + if (act == NULL) > + return err; > > - exts->action = act; > + exts->action = act; > + } > } > #elif defined CONFIG_NET_CLS_POLICE > if (map->police && tb[map->police-1]) { From herbert@gondor.apana.org.au Mon Jan 17 02:11:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 02:13:11 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HABkbK002098 for ; Mon, 17 Jan 2005 02:11:47 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CqTr4-0002Ri-00; Mon, 17 Jan 2005 21:11:26 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CqTqc-0007HO-00; Mon, 17 Jan 2005 21:10:58 +1100 Date: Mon, 17 Jan 2005 21:10:58 +1100 To: "David S. Miller" , netdev@oss.sgi.com Subject: [TCP] Remove tcp_pcount_t Message-ID: <20050117101058.GA27521@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="lrZ03NoBR/3+SXJZ" Content-Disposition: inline User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 357 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Dave: IMHO the TSO stuff has mostly settled down now. As a result tcp_pcount_t is now more of a liability in that it reduces the readability of the code. So here is a patch to remove it. Signed-off-by: Herbert Xu Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== include/linux/tcp.h 1.33 vs edited ===== --- 1.33/include/linux/tcp.h 2004-12-29 05:22:40 +11:00 +++ edited/include/linux/tcp.h 2005-01-17 20:42:09 +11:00 @@ -203,10 +203,6 @@ __u32 end_seq; }; -typedef struct tcp_pcount { - __u32 val; -} tcp_pcount_t; - enum tcp_congestion_algo { TCP_RENO=0, TCP_VEGAS, @@ -289,9 +285,9 @@ __u32 rtt_seq; /* sequence number to update rttvar */ __u32 rto; /* retransmit timeout */ - tcp_pcount_t packets_out; /* Packets which are "in flight" */ - tcp_pcount_t left_out; /* Packets which leaved network */ - tcp_pcount_t retrans_out; /* Retransmitted packets out */ + __u32 packets_out; /* Packets which are "in flight" */ + __u32 left_out; /* Packets which leaved network */ + __u32 retrans_out; /* Retransmitted packets out */ /* @@ -352,9 +348,9 @@ __u8 syn_retries; /* num of allowed syn retries */ __u8 ecn_flags; /* ECN status bits. */ __u16 prior_ssthresh; /* ssthresh saved at recovery start */ - tcp_pcount_t lost_out; /* Lost packets */ - tcp_pcount_t sacked_out;/* SACK'd packets */ - tcp_pcount_t fackets_out;/* FACK'd packets */ + __u32 lost_out; /* Lost packets */ + __u32 sacked_out; /* SACK'd packets */ + __u32 fackets_out; /* FACK'd packets */ __u32 high_seq; /* snd_nxt at onset of congestion */ __u32 retrans_stamp; /* Timestamp of the last retransmit, ===== include/net/tcp.h 1.102 vs edited ===== --- 1.102/include/net/tcp.h 2005-01-07 10:13:39 +11:00 +++ edited/include/net/tcp.h 2005-01-17 20:45:40 +11:00 @@ -1176,55 +1176,23 @@ return skb_shinfo(skb)->tso_size; } -static inline void tcp_inc_pcount(tcp_pcount_t *count, - const struct sk_buff *skb) -{ - count->val += tcp_skb_pcount(skb); -} - -static inline void tcp_inc_pcount_explicit(tcp_pcount_t *count, int amt) -{ - count->val += amt; -} - -static inline void tcp_dec_pcount_explicit(tcp_pcount_t *count, int amt) -{ - count->val -= amt; -} - -static inline void tcp_dec_pcount(tcp_pcount_t *count, - const struct sk_buff *skb) -{ - count->val -= tcp_skb_pcount(skb); -} - -static inline void tcp_dec_pcount_approx(tcp_pcount_t *count, +static inline void tcp_dec_pcount_approx(__u32 *count, const struct sk_buff *skb) { - if (count->val) { - count->val -= tcp_skb_pcount(skb); - if ((int)count->val < 0) - count->val = 0; + if (*count) { + *count -= tcp_skb_pcount(skb); + if ((int)*count < 0) + *count = 0; } } -static inline __u32 tcp_get_pcount(const tcp_pcount_t *count) -{ - return count->val; -} - -static inline void tcp_set_pcount(tcp_pcount_t *count, __u32 val) -{ - count->val = val; -} - static inline void tcp_packets_out_inc(struct sock *sk, struct tcp_sock *tp, const struct sk_buff *skb) { - int orig = tcp_get_pcount(&tp->packets_out); + int orig = tp->packets_out; - tcp_inc_pcount(&tp->packets_out, skb); + tp->packets_out += tcp_skb_pcount(skb); if (!orig) tcp_reset_xmit_timer(sk, TCP_TIME_RETRANS, tp->rto); } @@ -1232,7 +1200,7 @@ static inline void tcp_packets_out_dec(struct tcp_sock *tp, const struct sk_buff *skb) { - tcp_dec_pcount(&tp->packets_out, skb); + tp->packets_out -= tcp_skb_pcount(skb); } /* This determines how many packets are "in the network" to the best @@ -1251,9 +1219,7 @@ */ static __inline__ unsigned int tcp_packets_in_flight(const struct tcp_sock *tp) { - return (tcp_get_pcount(&tp->packets_out) - - tcp_get_pcount(&tp->left_out) + - tcp_get_pcount(&tp->retrans_out)); + return (tp->packets_out - tp->left_out + tp->retrans_out); } /* @@ -1357,14 +1323,9 @@ static inline void tcp_sync_left_out(struct tcp_sock *tp) { if (tp->sack_ok && - (tcp_get_pcount(&tp->sacked_out) >= - tcp_get_pcount(&tp->packets_out) - tcp_get_pcount(&tp->lost_out))) - tcp_set_pcount(&tp->sacked_out, - (tcp_get_pcount(&tp->packets_out) - - tcp_get_pcount(&tp->lost_out))); - tcp_set_pcount(&tp->left_out, - (tcp_get_pcount(&tp->sacked_out) + - tcp_get_pcount(&tp->lost_out))); + (tp->sacked_out >= tp->packets_out - tp->lost_out)) + tp->sacked_out = tp->packets_out - tp->lost_out; + tp->left_out = tp->sacked_out + tp->lost_out; } extern void tcp_cwnd_application_limited(struct sock *sk); @@ -1373,7 +1334,7 @@ static inline void tcp_cwnd_validate(struct sock *sk, struct tcp_sock *tp) { - __u32 packets_out = tcp_get_pcount(&tp->packets_out); + __u32 packets_out = tp->packets_out; if (packets_out >= tp->snd_cwnd) { /* Network is feed fully. */ @@ -1381,8 +1342,8 @@ tp->snd_cwnd_stamp = tcp_time_stamp; } else { /* Network starves. */ - if (tcp_get_pcount(&tp->packets_out) > tp->snd_cwnd_used) - tp->snd_cwnd_used = tcp_get_pcount(&tp->packets_out); + if (tp->packets_out > tp->snd_cwnd_used) + tp->snd_cwnd_used = tp->packets_out; if ((s32)(tcp_time_stamp - tp->snd_cwnd_stamp) >= tp->rto) tcp_cwnd_application_limited(sk); @@ -1450,7 +1411,7 @@ !(TCP_SKB_CB(skb)->flags & TCPCB_FLAG_FIN) && ((nonagle&TCP_NAGLE_CORK) || (!nonagle && - tcp_get_pcount(&tp->packets_out) && + tp->packets_out && tcp_minshall_check(tp)))); } @@ -1503,7 +1464,7 @@ static __inline__ void tcp_check_probe_timer(struct sock *sk, struct tcp_sock *tp) { - if (!tcp_get_pcount(&tp->packets_out) && !tp->pending) + if (!tp->packets_out && !tp->pending) tcp_reset_xmit_timer(sk, TCP_TIME_PROBE0, tp->rto); } ===== net/ipv4/tcp.c 1.90 vs edited ===== --- 1.90/net/ipv4/tcp.c 2005-01-15 15:37:59 +11:00 +++ edited/net/ipv4/tcp.c 2005-01-17 20:42:08 +11:00 @@ -1822,7 +1822,7 @@ tp->backoff = 0; tp->snd_cwnd = 2; tp->probes_out = 0; - tcp_set_pcount(&tp->packets_out, 0); + tp->packets_out = 0; tp->snd_ssthresh = 0x7fffffff; tp->snd_cwnd_cnt = 0; tcp_set_ca_state(tp, TCP_CA_Open); @@ -2137,11 +2137,11 @@ info->tcpi_snd_mss = tp->mss_cache_std; info->tcpi_rcv_mss = tp->ack.rcv_mss; - info->tcpi_unacked = tcp_get_pcount(&tp->packets_out); - info->tcpi_sacked = tcp_get_pcount(&tp->sacked_out); - info->tcpi_lost = tcp_get_pcount(&tp->lost_out); - info->tcpi_retrans = tcp_get_pcount(&tp->retrans_out); - info->tcpi_fackets = tcp_get_pcount(&tp->fackets_out); + info->tcpi_unacked = tp->packets_out; + info->tcpi_sacked = tp->sacked_out; + info->tcpi_lost = tp->lost_out; + info->tcpi_retrans = tp->retrans_out; + info->tcpi_fackets = tp->fackets_out; info->tcpi_last_data_sent = jiffies_to_msecs(now - tp->lsndtime); info->tcpi_last_data_recv = jiffies_to_msecs(now - tp->ack.lrcvtime); ===== net/ipv4/tcp_input.c 1.88 vs edited ===== --- 1.88/net/ipv4/tcp_input.c 2005-01-07 10:13:39 +11:00 +++ edited/net/ipv4/tcp_input.c 2005-01-17 20:42:08 +11:00 @@ -902,8 +902,8 @@ printk(KERN_DEBUG "Disorder%d %d %u f%u s%u rr%d\n", tp->sack_ok, tp->ca_state, tp->reordering, - tcp_get_pcount(&tp->fackets_out), - tcp_get_pcount(&tp->sacked_out), + tp->fackets_out, + tp->sacked_out, tp->undo_marker ? tp->undo_retrans : 0); #endif /* Disable FACK yet. */ @@ -966,7 +966,7 @@ unsigned char *ptr = ack_skb->h.raw + TCP_SKB_CB(ack_skb)->sacked; struct tcp_sack_block *sp = (struct tcp_sack_block *)(ptr+2); int num_sacks = (ptr[1] - TCPOLEN_SACK_BASE)>>3; - int reord = tcp_get_pcount(&tp->packets_out); + int reord = tp->packets_out; int prior_fackets; u32 lost_retrans = 0; int flag = 0; @@ -980,9 +980,9 @@ tp->mss_cache = tp->mss_cache_std; } - if (!tcp_get_pcount(&tp->sacked_out)) - tcp_set_pcount(&tp->fackets_out, 0); - prior_fackets = tcp_get_pcount(&tp->fackets_out); + if (!tp->sacked_out) + tp->fackets_out = 0; + prior_fackets = tp->fackets_out; for (i=0; isacked &= ~(TCPCB_LOST|TCPCB_SACKED_RETRANS); - tcp_dec_pcount(&tp->lost_out, skb); - tcp_dec_pcount(&tp->retrans_out, skb); + tp->lost_out -= tcp_skb_pcount(skb); + tp->retrans_out -= tcp_skb_pcount(skb); } } else { /* New sack for not retransmitted frame, @@ -1093,16 +1093,16 @@ if (sacked & TCPCB_LOST) { TCP_SKB_CB(skb)->sacked &= ~TCPCB_LOST; - tcp_dec_pcount(&tp->lost_out, skb); + tp->lost_out -= tcp_skb_pcount(skb); } } TCP_SKB_CB(skb)->sacked |= TCPCB_SACKED_ACKED; flag |= FLAG_DATA_SACKED; - tcp_inc_pcount(&tp->sacked_out, skb); + tp->sacked_out += tcp_skb_pcount(skb); - if (fack_count > tcp_get_pcount(&tp->fackets_out)) - tcp_set_pcount(&tp->fackets_out, fack_count); + if (fack_count > tp->fackets_out) + tp->fackets_out = fack_count; } else { if (dup_sack && (sacked&TCPCB_RETRANS)) reord = min(fack_count, reord); @@ -1116,7 +1116,7 @@ if (dup_sack && (TCP_SKB_CB(skb)->sacked&TCPCB_SACKED_RETRANS)) { TCP_SKB_CB(skb)->sacked &= ~TCPCB_SACKED_RETRANS; - tcp_dec_pcount(&tp->retrans_out, skb); + tp->retrans_out -= tcp_skb_pcount(skb); } } } @@ -1142,10 +1142,10 @@ TCP_SKB_CB(skb)->ack_seq + tp->reordering * tp->mss_cache_std))) { TCP_SKB_CB(skb)->sacked &= ~TCPCB_SACKED_RETRANS; - tcp_dec_pcount(&tp->retrans_out, skb); + tp->retrans_out -= tcp_skb_pcount(skb); if (!(TCP_SKB_CB(skb)->sacked&(TCPCB_LOST|TCPCB_SACKED_ACKED))) { - tcp_inc_pcount(&tp->lost_out, skb); + tp->lost_out += tcp_skb_pcount(skb); TCP_SKB_CB(skb)->sacked |= TCPCB_LOST; flag |= FLAG_DATA_SACKED; NET_INC_STATS_BH(LINUX_MIB_TCPLOSTRETRANSMIT); @@ -1154,20 +1154,15 @@ } } - tcp_set_pcount(&tp->left_out, - (tcp_get_pcount(&tp->sacked_out) + - tcp_get_pcount(&tp->lost_out))); - - if ((reord < tcp_get_pcount(&tp->fackets_out)) && - tp->ca_state != TCP_CA_Loss) - tcp_update_reordering(tp, - ((tcp_get_pcount(&tp->fackets_out) + 1) - - reord), 0); + tp->left_out = tp->sacked_out + tp->lost_out; + + if ((reord < tp->fackets_out) && tp->ca_state != TCP_CA_Loss) + tcp_update_reordering(tp, ((tp->fackets_out + 1) - reord), 0); #if FASTRETRANS_DEBUG > 0 - BUG_TRAP((int)tcp_get_pcount(&tp->sacked_out) >= 0); - BUG_TRAP((int)tcp_get_pcount(&tp->lost_out) >= 0); - BUG_TRAP((int)tcp_get_pcount(&tp->retrans_out) >= 0); + BUG_TRAP((int)tp->sacked_out >= 0); + BUG_TRAP((int)tp->lost_out >= 0); + BUG_TRAP((int)tp->retrans_out >= 0); BUG_TRAP((int)tcp_packets_in_flight(tp) >= 0); #endif return flag; @@ -1197,7 +1192,7 @@ * If something was really lost, it is eventually caught up * in tcp_enter_frto_loss. */ - tcp_set_pcount(&tp->retrans_out, 0); + tp->retrans_out = 0; tp->undo_marker = tp->snd_una; tp->undo_retrans = 0; @@ -1220,9 +1215,9 @@ struct sk_buff *skb; int cnt = 0; - tcp_set_pcount(&tp->sacked_out, 0); - tcp_set_pcount(&tp->lost_out, 0); - tcp_set_pcount(&tp->fackets_out, 0); + tp->sacked_out = 0; + tp->lost_out = 0; + tp->fackets_out = 0; sk_stream_for_retrans_queue(skb, sk) { cnt += tcp_skb_pcount(skb); @@ -1235,11 +1230,11 @@ if (!after(TCP_SKB_CB(skb)->end_seq, tp->frto_highmark)) { TCP_SKB_CB(skb)->sacked |= TCPCB_LOST; - tcp_inc_pcount(&tp->lost_out, skb); + tp->lost_out += tcp_skb_pcount(skb); } } else { - tcp_inc_pcount(&tp->sacked_out, skb); - tcp_set_pcount(&tp->fackets_out, cnt); + tp->sacked_out += tcp_skb_pcount(skb); + tp->fackets_out = cnt; } } tcp_sync_left_out(tp); @@ -1261,12 +1256,12 @@ void tcp_clear_retrans(struct tcp_sock *tp) { - tcp_set_pcount(&tp->left_out, 0); - tcp_set_pcount(&tp->retrans_out, 0); + tp->left_out = 0; + tp->retrans_out = 0; - tcp_set_pcount(&tp->fackets_out, 0); - tcp_set_pcount(&tp->sacked_out, 0); - tcp_set_pcount(&tp->lost_out, 0); + tp->fackets_out = 0; + tp->sacked_out = 0; + tp->lost_out = 0; tp->undo_marker = 0; tp->undo_retrans = 0; @@ -1307,10 +1302,10 @@ if (!(TCP_SKB_CB(skb)->sacked&TCPCB_SACKED_ACKED) || how) { TCP_SKB_CB(skb)->sacked &= ~TCPCB_SACKED_ACKED; TCP_SKB_CB(skb)->sacked |= TCPCB_LOST; - tcp_inc_pcount(&tp->lost_out, skb); + tp->lost_out += tcp_skb_pcount(skb); } else { - tcp_inc_pcount(&tp->sacked_out, skb); - tcp_set_pcount(&tp->fackets_out, cnt); + tp->sacked_out += tcp_skb_pcount(skb); + tp->fackets_out = cnt; } } tcp_sync_left_out(tp); @@ -1347,8 +1342,7 @@ static inline int tcp_fackets_out(struct tcp_sock *tp) { - return IsReno(tp) ? tcp_get_pcount(&tp->sacked_out)+1 : - tcp_get_pcount(&tp->fackets_out); + return IsReno(tp) ? tp->sacked_out+1 : tp->fackets_out; } static inline int tcp_skb_timedout(struct tcp_sock *tp, struct sk_buff *skb) @@ -1358,7 +1352,7 @@ static inline int tcp_head_timedout(struct sock *sk, struct tcp_sock *tp) { - return tcp_get_pcount(&tp->packets_out) && + return tp->packets_out && tcp_skb_timedout(tp, skb_peek(&sk->sk_write_queue)); } @@ -1460,7 +1454,7 @@ __u32 packets_out; /* Trick#1: The loss is proven. */ - if (tcp_get_pcount(&tp->lost_out)) + if (tp->lost_out) return 1; /* Not-A-Trick#2 : Classic rule... */ @@ -1476,9 +1470,9 @@ /* Trick#4: It is still not OK... But will it be useful to delay * recovery more? */ - packets_out = tcp_get_pcount(&tp->packets_out); + packets_out = tp->packets_out; if (packets_out <= tp->reordering && - tcp_get_pcount(&tp->sacked_out) >= max_t(__u32, packets_out/2, sysctl_tcp_reordering) && + tp->sacked_out >= max_t(__u32, packets_out/2, sysctl_tcp_reordering) && !tcp_may_send_now(sk, tp)) { /* We have nothing to send. This connection is limited * either by receiver window or by application. @@ -1497,16 +1491,12 @@ { u32 holes; - holes = max(tcp_get_pcount(&tp->lost_out), 1U); - holes = min(holes, tcp_get_pcount(&tp->packets_out)); + holes = max(tp->lost_out, 1U); + holes = min(holes, tp->packets_out); - if ((tcp_get_pcount(&tp->sacked_out) + holes) > - tcp_get_pcount(&tp->packets_out)) { - tcp_set_pcount(&tp->sacked_out, - (tcp_get_pcount(&tp->packets_out) - holes)); - tcp_update_reordering(tp, - tcp_get_pcount(&tp->packets_out)+addend, - 0); + if ((tp->sacked_out + holes) > tp->packets_out) { + tp->sacked_out = tp->packets_out - holes; + tcp_update_reordering(tp, tp->packets_out+addend, 0); } } @@ -1514,7 +1504,7 @@ static void tcp_add_reno_sack(struct tcp_sock *tp) { - tcp_inc_pcount_explicit(&tp->sacked_out, 1); + tp->sacked_out++; tcp_check_reno_reordering(tp, 0); tcp_sync_left_out(tp); } @@ -1525,10 +1515,10 @@ { if (acked > 0) { /* One ACK acked hole. The rest eat duplicate ACKs. */ - if (acked-1 >= tcp_get_pcount(&tp->sacked_out)) - tcp_set_pcount(&tp->sacked_out, 0); + if (acked-1 >= tp->sacked_out) + tp->sacked_out = 0; else - tcp_dec_pcount_explicit(&tp->sacked_out, acked-1); + tp->sacked_out -= acked-1; } tcp_check_reno_reordering(tp, acked); tcp_sync_left_out(tp); @@ -1536,8 +1526,8 @@ static inline void tcp_reset_reno_sack(struct tcp_sock *tp) { - tcp_set_pcount(&tp->sacked_out, 0); - tcp_set_pcount(&tp->left_out, tcp_get_pcount(&tp->lost_out)); + tp->sacked_out = 0; + tp->left_out = tp->lost_out; } /* Mark head of queue up as lost. */ @@ -1547,7 +1537,7 @@ struct sk_buff *skb; int cnt = packets; - BUG_TRAP(cnt <= tcp_get_pcount(&tp->packets_out)); + BUG_TRAP(cnt <= tp->packets_out); sk_stream_for_retrans_queue(skb, sk) { cnt -= tcp_skb_pcount(skb); @@ -1555,7 +1545,7 @@ break; if (!(TCP_SKB_CB(skb)->sacked&TCPCB_TAGBITS)) { TCP_SKB_CB(skb)->sacked |= TCPCB_LOST; - tcp_inc_pcount(&tp->lost_out, skb); + tp->lost_out += tcp_skb_pcount(skb); } } tcp_sync_left_out(tp); @@ -1566,7 +1556,7 @@ static void tcp_update_scoreboard(struct sock *sk, struct tcp_sock *tp) { if (IsFack(tp)) { - int lost = tcp_get_pcount(&tp->fackets_out) - tp->reordering; + int lost = tp->fackets_out - tp->reordering; if (lost <= 0) lost = 1; tcp_mark_head_lost(sk, tp, lost, tp->high_seq); @@ -1586,7 +1576,7 @@ if (tcp_skb_timedout(tp, skb) && !(TCP_SKB_CB(skb)->sacked&TCPCB_TAGBITS)) { TCP_SKB_CB(skb)->sacked |= TCPCB_LOST; - tcp_inc_pcount(&tp->lost_out, skb); + tp->lost_out += tcp_skb_pcount(skb); } } tcp_sync_left_out(tp); @@ -1651,9 +1641,9 @@ printk(KERN_DEBUG "Undo %s %u.%u.%u.%u/%u c%u l%u ss%u/%u p%u\n", msg, NIPQUAD(inet->daddr), ntohs(inet->dport), - tp->snd_cwnd, tcp_get_pcount(&tp->left_out), + tp->snd_cwnd, tp->left_out, tp->snd_ssthresh, tp->prior_ssthresh, - tcp_get_pcount(&tp->packets_out)); + tp->packets_out); } #else #define DBGUNDO(x...) do { } while (0) @@ -1724,13 +1714,13 @@ int acked) { /* Partial ACK arrived. Force Hoe's retransmit. */ - int failed = IsReno(tp) || tcp_get_pcount(&tp->fackets_out)>tp->reordering; + int failed = IsReno(tp) || tp->fackets_out>tp->reordering; if (tcp_may_undo(tp)) { /* Plain luck! Hole if filled with delayed * packet, rather than with a retransmit. */ - if (tcp_get_pcount(&tp->retrans_out) == 0) + if (tp->retrans_out == 0) tp->retrans_stamp = 0; tcp_update_reordering(tp, tcp_fackets_out(tp)+acked, 1); @@ -1757,8 +1747,8 @@ TCP_SKB_CB(skb)->sacked &= ~TCPCB_LOST; } DBGUNDO(sk, tp, "partial loss"); - tcp_set_pcount(&tp->lost_out, 0); - tcp_set_pcount(&tp->left_out, tcp_get_pcount(&tp->sacked_out)); + tp->lost_out = 0; + tp->left_out = tp->sacked_out; tcp_undo_cwr(tp, 1); NET_INC_STATS_BH(LINUX_MIB_TCPLOSSUNDO); tp->retransmits = 0; @@ -1781,9 +1771,9 @@ static void tcp_try_to_open(struct sock *sk, struct tcp_sock *tp, int flag) { - tcp_set_pcount(&tp->left_out, tcp_get_pcount(&tp->sacked_out)); + tp->left_out = tp->sacked_out; - if (tcp_get_pcount(&tp->retrans_out) == 0) + if (tp->retrans_out == 0) tp->retrans_stamp = 0; if (flag&FLAG_ECE) @@ -1792,9 +1782,7 @@ if (tp->ca_state != TCP_CA_CWR) { int state = TCP_CA_Open; - if (tcp_get_pcount(&tp->left_out) || - tcp_get_pcount(&tp->retrans_out) || - tp->undo_marker) + if (tp->left_out || tp->retrans_out || tp->undo_marker) state = TCP_CA_Disorder; if (tp->ca_state != state) { @@ -1827,11 +1815,11 @@ /* Some technical things: * 1. Reno does not count dupacks (sacked_out) automatically. */ - if (!tcp_get_pcount(&tp->packets_out)) - tcp_set_pcount(&tp->sacked_out, 0); + if (!tp->packets_out) + tp->sacked_out = 0; /* 2. SACK counts snd_fack in packets inaccurately. */ - if (tcp_get_pcount(&tp->sacked_out) == 0) - tcp_set_pcount(&tp->fackets_out, 0); + if (tp->sacked_out == 0) + tp->fackets_out = 0; /* Now state machine starts. * A. ECE, hence prohibit cwnd undoing, the reduction is required. */ @@ -1839,15 +1827,15 @@ tp->prior_ssthresh = 0; /* B. In all the states check for reneging SACKs. */ - if (tcp_get_pcount(&tp->sacked_out) && tcp_check_sack_reneging(sk, tp)) + if (tp->sacked_out && tcp_check_sack_reneging(sk, tp)) return; /* C. Process data loss notification, provided it is valid. */ if ((flag&FLAG_DATA_LOST) && before(tp->snd_una, tp->high_seq) && tp->ca_state != TCP_CA_Open && - tcp_get_pcount(&tp->fackets_out) > tp->reordering) { - tcp_mark_head_lost(sk, tp, tcp_get_pcount(&tp->fackets_out)-tp->reordering, tp->high_seq); + tp->fackets_out > tp->reordering) { + tcp_mark_head_lost(sk, tp, tp->fackets_out-tp->reordering, tp->high_seq); NET_INC_STATS_BH(LINUX_MIB_TCPLOSS); } @@ -1858,7 +1846,7 @@ * when high_seq is ACKed. */ if (tp->ca_state == TCP_CA_Open) { if (!sysctl_tcp_frto) - BUG_TRAP(tcp_get_pcount(&tp->retrans_out) == 0); + BUG_TRAP(tp->retrans_out == 0); tp->retrans_stamp = 0; } else if (!before(tp->snd_una, tp->high_seq)) { switch (tp->ca_state) { @@ -1905,8 +1893,7 @@ if (IsReno(tp) && is_dupack) tcp_add_reno_sack(tp); } else { - int acked = prior_packets - - tcp_get_pcount(&tp->packets_out); + int acked = prior_packets - tp->packets_out; if (IsReno(tp)) tcp_remove_reno_sacks(sk, tp, acked); is_dupack = tcp_try_undo_partial(sk, tp, acked); @@ -1949,7 +1936,7 @@ tp->high_seq = tp->snd_nxt; tp->prior_ssthresh = 0; tp->undo_marker = tp->snd_una; - tp->undo_retrans = tcp_get_pcount(&tp->retrans_out); + tp->undo_retrans = tp->retrans_out; if (tp->ca_state < TCP_CA_CWR) { if (!(flag&FLAG_ECE)) @@ -2349,7 +2336,7 @@ static inline void tcp_ack_packets_out(struct sock *sk, struct tcp_sock *tp) { - if (!tcp_get_pcount(&tp->packets_out)) { + if (!tp->packets_out) { tcp_clear_xmit_timer(sk, TCP_TIME_RETRANS); } else { tcp_reset_xmit_timer(sk, TCP_TIME_RETRANS, tp->rto); @@ -2391,18 +2378,15 @@ if (sacked) { if (sacked & TCPCB_RETRANS) { if (sacked & TCPCB_SACKED_RETRANS) - tcp_dec_pcount_explicit(&tp->retrans_out, - packets_acked); + tp->retrans_out -= packets_acked; acked |= FLAG_RETRANS_DATA_ACKED; *seq_rtt = -1; } else if (*seq_rtt < 0) *seq_rtt = now - scb->when; if (sacked & TCPCB_SACKED_ACKED) - tcp_dec_pcount_explicit(&tp->sacked_out, - packets_acked); + tp->sacked_out -= packets_acked; if (sacked & TCPCB_LOST) - tcp_dec_pcount_explicit(&tp->lost_out, - packets_acked); + tp->lost_out -= packets_acked; if (sacked & TCPCB_URG) { if (tp->urg_mode && !before(seq, tp->snd_up)) @@ -2411,12 +2395,11 @@ } else if (*seq_rtt < 0) *seq_rtt = now - scb->when; - if (tcp_get_pcount(&tp->fackets_out)) { - __u32 dval = min(tcp_get_pcount(&tp->fackets_out), - packets_acked); - tcp_dec_pcount_explicit(&tp->fackets_out, dval); + if (tp->fackets_out) { + __u32 dval = min(tp->fackets_out, packets_acked); + tp->fackets_out -= dval; } - tcp_dec_pcount_explicit(&tp->packets_out, packets_acked); + tp->packets_out -= packets_acked; BUG_ON(tcp_skb_pcount(skb) == 0); BUG_ON(!before(scb->seq, scb->end_seq)); @@ -2468,15 +2451,15 @@ if (sacked) { if (sacked & TCPCB_RETRANS) { if(sacked & TCPCB_SACKED_RETRANS) - tcp_dec_pcount(&tp->retrans_out, skb); + tp->retrans_out -= tcp_skb_pcount(skb); acked |= FLAG_RETRANS_DATA_ACKED; seq_rtt = -1; } else if (seq_rtt < 0) seq_rtt = now - scb->when; if (sacked & TCPCB_SACKED_ACKED) - tcp_dec_pcount(&tp->sacked_out, skb); + tp->sacked_out -= tcp_skb_pcount(skb); if (sacked & TCPCB_LOST) - tcp_dec_pcount(&tp->lost_out, skb); + tp->lost_out -= tcp_skb_pcount(skb); if (sacked & TCPCB_URG) { if (tp->urg_mode && !before(scb->end_seq, tp->snd_up)) @@ -2496,27 +2479,24 @@ } #if FASTRETRANS_DEBUG > 0 - BUG_TRAP((int)tcp_get_pcount(&tp->sacked_out) >= 0); - BUG_TRAP((int)tcp_get_pcount(&tp->lost_out) >= 0); - BUG_TRAP((int)tcp_get_pcount(&tp->retrans_out) >= 0); - if (!tcp_get_pcount(&tp->packets_out) && tp->sack_ok) { - if (tcp_get_pcount(&tp->lost_out)) { + BUG_TRAP((int)tp->sacked_out >= 0); + BUG_TRAP((int)tp->lost_out >= 0); + BUG_TRAP((int)tp->retrans_out >= 0); + if (!tp->packets_out && tp->sack_ok) { + if (tp->lost_out) { printk(KERN_DEBUG "Leak l=%u %d\n", - tcp_get_pcount(&tp->lost_out), - tp->ca_state); - tcp_set_pcount(&tp->lost_out, 0); + tp->lost_out, tp->ca_state); + tp->lost_out = 0; } - if (tcp_get_pcount(&tp->sacked_out)) { + if (tp->sacked_out) { printk(KERN_DEBUG "Leak s=%u %d\n", - tcp_get_pcount(&tp->sacked_out), - tp->ca_state); - tcp_set_pcount(&tp->sacked_out, 0); + tp->sacked_out, tp->ca_state); + tp->sacked_out = 0; } - if (tcp_get_pcount(&tp->retrans_out)) { + if (tp->retrans_out) { printk(KERN_DEBUG "Leak r=%u %d\n", - tcp_get_pcount(&tp->retrans_out), - tp->ca_state); - tcp_set_pcount(&tp->retrans_out, 0); + tp->retrans_out, tp->ca_state); + tp->retrans_out = 0; } } #endif @@ -2943,7 +2923,7 @@ */ sk->sk_err_soft = 0; tp->rcv_tstamp = tcp_time_stamp; - prior_packets = tcp_get_pcount(&tp->packets_out); + prior_packets = tp->packets_out; if (!prior_packets) goto no_queue; @@ -3964,7 +3944,7 @@ { struct tcp_sock *tp = tcp_sk(sk); - if (tcp_get_pcount(&tp->packets_out) < tp->snd_cwnd && + if (tp->packets_out < tp->snd_cwnd && !(sk->sk_userlocks & SOCK_SNDBUF_LOCK) && !tcp_memory_pressure && atomic_read(&tcp_memory_allocated) < sysctl_tcp_mem[0]) { ===== net/ipv4/tcp_minisocks.c 1.62 vs edited ===== --- 1.62/net/ipv4/tcp_minisocks.c 2005-01-14 15:41:05 +11:00 +++ edited/net/ipv4/tcp_minisocks.c 2005-01-17 20:42:09 +11:00 @@ -754,11 +754,11 @@ newtp->mdev = TCP_TIMEOUT_INIT; newtp->rto = TCP_TIMEOUT_INIT; - tcp_set_pcount(&newtp->packets_out, 0); - tcp_set_pcount(&newtp->left_out, 0); - tcp_set_pcount(&newtp->retrans_out, 0); - tcp_set_pcount(&newtp->sacked_out, 0); - tcp_set_pcount(&newtp->fackets_out, 0); + newtp->packets_out = 0; + newtp->left_out = 0; + newtp->retrans_out = 0; + newtp->sacked_out = 0; + newtp->fackets_out = 0; newtp->snd_ssthresh = 0x7fffffff; /* So many TCP implementations out there (incorrectly) count the ===== net/ipv4/tcp_output.c 1.75 vs edited ===== --- 1.75/net/ipv4/tcp_output.c 2004-12-29 05:22:40 +11:00 +++ edited/net/ipv4/tcp_output.c 2005-01-17 20:42:09 +11:00 @@ -129,8 +129,7 @@ { u32 now = tcp_time_stamp; - if (!tcp_get_pcount(&tp->packets_out) && - (s32)(now - tp->lsndtime) > tp->rto) + if (!tp->packets_out && (s32)(now - tp->lsndtime) > tp->rto) tcp_cwnd_restart(tp, __sk_dst_get(sk)); tp->lsndtime = now; @@ -509,8 +508,8 @@ TCP_SKB_CB(buff)->when = TCP_SKB_CB(skb)->when; if (TCP_SKB_CB(skb)->sacked & TCPCB_LOST) { - tcp_dec_pcount(&tp->lost_out, skb); - tcp_dec_pcount(&tp->left_out, skb); + tp->lost_out -= tcp_skb_pcount(skb); + tp->left_out -= tcp_skb_pcount(skb); } /* Fix up tso_factor for both original and new SKB. */ @@ -518,13 +517,13 @@ tcp_set_skb_tso_segs(buff, tp->mss_cache_std); if (TCP_SKB_CB(skb)->sacked & TCPCB_LOST) { - tcp_inc_pcount(&tp->lost_out, skb); - tcp_inc_pcount(&tp->left_out, skb); + tp->lost_out += tcp_skb_pcount(skb); + tp->left_out += tcp_skb_pcount(skb); } if (TCP_SKB_CB(buff)->sacked&TCPCB_LOST) { - tcp_inc_pcount(&tp->lost_out, buff); - tcp_inc_pcount(&tp->left_out, buff); + tp->lost_out += tcp_skb_pcount(buff); + tp->left_out += tcp_skb_pcount(buff); } /* Link BUFF into the send queue. */ @@ -773,7 +772,7 @@ return 0; } - return !tcp_get_pcount(&tp->packets_out) && sk->sk_send_head; + return !tp->packets_out && sk->sk_send_head; } return 0; } @@ -945,15 +944,15 @@ */ TCP_SKB_CB(skb)->sacked |= TCP_SKB_CB(next_skb)->sacked&(TCPCB_EVER_RETRANS|TCPCB_AT_TAIL); if (TCP_SKB_CB(next_skb)->sacked&TCPCB_SACKED_RETRANS) - tcp_dec_pcount(&tp->retrans_out, next_skb); + tp->retrans_out -= tcp_skb_pcount(next_skb); if (TCP_SKB_CB(next_skb)->sacked&TCPCB_LOST) { - tcp_dec_pcount(&tp->lost_out, next_skb); - tcp_dec_pcount(&tp->left_out, next_skb); + tp->lost_out -= tcp_skb_pcount(next_skb); + tp->left_out -= tcp_skb_pcount(next_skb); } /* Reno case is special. Sigh... */ - if (!tp->sack_ok && tcp_get_pcount(&tp->sacked_out)) { + if (!tp->sack_ok && tp->sacked_out) { tcp_dec_pcount_approx(&tp->sacked_out, next_skb); - tcp_dec_pcount(&tp->left_out, next_skb); + tp->left_out -= tcp_skb_pcount(next_skb); } /* Not quite right: it can be > snd.fack, but @@ -981,11 +980,11 @@ !(TCP_SKB_CB(skb)->sacked&TCPCB_SACKED_ACKED)) { if (TCP_SKB_CB(skb)->sacked&TCPCB_SACKED_RETRANS) { TCP_SKB_CB(skb)->sacked &= ~TCPCB_SACKED_RETRANS; - tcp_dec_pcount(&tp->retrans_out, skb); + tp->retrans_out -= tcp_skb_pcount(skb); } if (!(TCP_SKB_CB(skb)->sacked&TCPCB_LOST)) { TCP_SKB_CB(skb)->sacked |= TCPCB_LOST; - tcp_inc_pcount(&tp->lost_out, skb); + tp->lost_out += tcp_skb_pcount(skb); lost = 1; } } @@ -1060,9 +1059,8 @@ /* New SKB created, account for it. */ new_factor = tcp_skb_pcount(skb); - tcp_dec_pcount_explicit(&tp->packets_out, - old_factor - new_factor); - tcp_inc_pcount(&tp->packets_out, skb->next); + tp->packets_out -= old_factor - new_factor; + tp->packets_out += tcp_skb_pcount(skb->next); } /* Collapse two adjacent packets if worthwhile and we can. */ @@ -1115,7 +1113,7 @@ } #endif TCP_SKB_CB(skb)->sacked |= TCPCB_RETRANS; - tcp_inc_pcount(&tp->retrans_out, skb); + tp->retrans_out += tcp_skb_pcount(skb); /* Save stamp of the first retransmit. */ if (!tp->retrans_stamp) @@ -1143,7 +1141,7 @@ { struct tcp_sock *tp = tcp_sk(sk); struct sk_buff *skb; - int packet_cnt = tcp_get_pcount(&tp->lost_out); + int packet_cnt = tp->lost_out; /* First pass: retransmit lost packets. */ if (packet_cnt) { @@ -1210,7 +1208,7 @@ * real MSS sized packet because tcp_retransmit_skb() * will fragment it if necessary. */ - if (++packet_cnt > tcp_get_pcount(&tp->fackets_out)) + if (++packet_cnt > tp->fackets_out) break; if (tcp_packets_in_flight(tp) >= tp->snd_cwnd) @@ -1496,7 +1494,7 @@ tp->retrans_stamp = TCP_SKB_CB(buff)->when; __skb_queue_tail(&sk->sk_write_queue, buff); sk_charge_skb(sk, buff); - tcp_inc_pcount(&tp->packets_out, buff); + tp->packets_out += tcp_skb_pcount(buff); tcp_transmit_skb(sk, skb_clone(buff, GFP_KERNEL)); TCP_INC_STATS(TCP_MIB_ACTIVEOPENS); @@ -1694,7 +1692,7 @@ err = tcp_write_wakeup(sk); - if (tcp_get_pcount(&tp->packets_out) || !sk->sk_send_head) { + if (tp->packets_out || !sk->sk_send_head) { /* Cancel probe timer, if it is not required. */ tp->probes_out = 0; tp->backoff = 0; ===== net/ipv4/tcp_timer.c 1.28 vs edited ===== --- 1.28/net/ipv4/tcp_timer.c 2005-01-07 10:13:39 +11:00 +++ edited/net/ipv4/tcp_timer.c 2005-01-17 20:42:09 +11:00 @@ -123,7 +123,7 @@ * 1. Last segment was sent recently. */ if ((s32)(tcp_time_stamp - tp->lsndtime) <= TCP_TIMEWAIT_LEN || /* 2. Window is closed. */ - (!tp->snd_wnd && !tcp_get_pcount(&tp->packets_out))) + (!tp->snd_wnd && !tp->packets_out)) do_reset = 1; if (do_reset) tcp_send_active_reset(sk, GFP_ATOMIC); @@ -271,7 +271,7 @@ struct tcp_sock *tp = tcp_sk(sk); int max_probes; - if (tcp_get_pcount(&tp->packets_out) || !sk->sk_send_head) { + if (tp->packets_out || !sk->sk_send_head) { tp->probes_out = 0; return; } @@ -318,7 +318,7 @@ { struct tcp_sock *tp = tcp_sk(sk); - if (!tcp_get_pcount(&tp->packets_out)) + if (!tp->packets_out) goto out; BUG_TRAP(!skb_queue_empty(&sk->sk_write_queue)); @@ -608,7 +608,7 @@ elapsed = keepalive_time_when(tp); /* It is alive without keepalive 8) */ - if (tcp_get_pcount(&tp->packets_out) || sk->sk_send_head) + if (tp->packets_out || sk->sk_send_head) goto resched; elapsed = tcp_time_stamp - tp->rcv_tstamp; --lrZ03NoBR/3+SXJZ-- From tgraf@suug.ch Mon Jan 17 03:56:19 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 03:56:25 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HBuItN014512 for ; Mon, 17 Jan 2005 03:56:19 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 461C68A; Mon, 17 Jan 2005 12:55:54 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 4F7DB1C0EA; Mon, 17 Jan 2005 12:56:37 +0100 (CET) Date: Mon, 17 Jan 2005 12:56:37 +0100 From: Thomas Graf To: Herbert Poetzl Cc: Andrew Morton , davem@davemloft.net, netdev@oss.sgi.com Subject: Re: [PATCH] PKT_SCHED: remove c99ism Message-ID: <20050117115637.GB26856@postel.suug.ch> References: <20050115144010.33182075.akpm@osdl.org> <20050115232554.GS26856@postel.suug.ch> <20050115153202.2f7f81c6.akpm@osdl.org> <20050115234056.GT26856@postel.suug.ch> <20050117090912.GB30371@mail.13thfloor.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050117090912.GB30371@mail.13thfloor.at> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 358 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * Herbert Poetzl <20050117090912.GB30371@mail.13thfloor.at> 2005-01-17 10:09 > On Sun, Jan 16, 2005 at 12:40:56AM +0100, Thomas Graf wrote: > > * Andrew Morton <20050115153202.2f7f81c6.akpm@osdl.org> 2005-01-15 15:32 > > > An uglier but more efficient approach is to whack braces around the whole > > > thing. > > > > Fine with me as well. The code isn't used that often and not deep in the > > calling stack which is why I preferred the cleaner way first. > > hmm, please remind me why putting some > > #ifdef CONFIG_NET_CLS_ACT > int err; > struct tc_action *act; > #endif > > at the _beginning_ of that procedure would > be a bad choice? I personally don't think it's a bad choice but the less ifdefs the better. 2 out of 3 of my latest bugs were related to such ifdefs because testing gets more error prone. Personally I think the cleanest way would be to create inlined functions together with a nop macro but it would hide the mutual exclusiveness of NET_CLS_ACT and NET_CLS_POLICE in this case which is even worse. From hasso@estpak.ee Mon Jan 17 04:04:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 04:04:28 -0800 (PST) Received: from arena (test.estpak.ee [194.126.115.47]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HC4J83015987 for ; Mon, 17 Jan 2005 04:04:20 -0800 Received: from localhost ([127.0.0.1] helo=arena) by arena with esmtp (Exim 4.34) id 1CqVcJ-0000vz-Kv; Mon, 17 Jan 2005 14:04:19 +0200 From: Hasso Tepper To: hadi@cyberus.ca Subject: Re: [patch 4/10] s390: network driver. Date: Mon, 17 Jan 2005 14:04:19 +0200 User-Agent: KMail/1.7.2 Cc: Tommy Christensen , Jeff Garzik , Thomas Spatzier , "David S. Miller" , Herbert Xu , netdev@oss.sgi.com, Paul Jakma References: <1105363092.1041.146.camel@jzny.localdomain> <1105917038.1091.1041.camel@jzny.localdomain> In-Reply-To: <1105917038.1091.1041.camel@jzny.localdomain> Organization: Elion Enterprises Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501171404.19451.hasso@estpak.ee> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 359 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hasso@estpak.ee Precedence: bulk X-list: netdev jamal wrote: > Didnt see anymore discussion on this - have we given up on it? I'm not competent enough about kernel internals to decide how this should be done in kernel. But I would like to clarify situation for me as Quagga developer. All this work is done to avoid sending stale packets to the network? Ie. there will be no change regarding socket blocking issue? Detecting carrier on/off and/or socket per interface is must be for us in user space to avoid socket blocking? I'm just trying to have full picture so I can put my priorities in place for next release. Thanks for your support, -- Hasso Tepper Elion Enterprises Ltd. WAN administrator From bboissin@gmail.com Mon Jan 17 05:35:12 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 05:35:16 -0800 (PST) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.206]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HDZBwB000584 for ; Mon, 17 Jan 2005 05:35:12 -0800 Received: by wproxy.gmail.com with SMTP id 67so902422wri for ; Mon, 17 Jan 2005 05:35:06 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:mime-version:content-type:content-transfer-encoding; b=Ry1OgH618OveLGMS6os71qjMz2UybXR638jO5yGj2GOCf2FJnhMBCFN8rkbUjeZLcuA03hCnEezKA9hrecPveofKFmL0TW3vadu42N3NzITvGNiT4UAiiTVy24l0lRKwS7vOxM17ioiAvchqZp/vgkvTpByspMf3pXeaFUjjPt8= Received: by 10.54.39.16 with SMTP id m16mr27003wrm; Mon, 17 Jan 2005 05:35:06 -0800 (PST) Received: by 10.54.14.57 with HTTP; Mon, 17 Jan 2005 05:35:06 -0800 (PST) Message-ID: <40f323d0050117053528f7ac8@mail.gmail.com> Date: Mon, 17 Jan 2005 14:35:06 +0100 From: Benoit Boissinot Reply-To: Benoit Boissinot To: Stephen Hemminger Subject: Re: [RFT] New syskonnect gigabit ether driver (skge) Cc: netdev@oss.sgi.com, Jeff Garzik , Christoph Hellwig Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 360 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bboissin@gmail.com Precedence: bulk X-list: netdev > Here is my rewrite of the SysKonnect Gigabit Ether driver. Gave up on > the existing sk98lin driver because it bloated and limited by the requirement > to be portable. This version is still very experimental and has only been > run for several days on my LinkSys card (single port Yukon). > Please test on other hardware and let me know what you find out. I had no problem with it with the following card (3Com) (not tested in GigaEthernet mode): (kernel 2.6.11-rc1-mm1) 0000:00:09.0 Ethernet controller: 3Com Corporation 3c940 10/100/1000Base-T [Marvell] (rev 12) Subsystem: ASUSTeK Computer Inc. P4P800 Mainboard Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap+ 66Mhz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- SERR- ; Mon, 17 Jan 2005 07:22:54 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 2F98084; Mon, 17 Jan 2005 16:22:30 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id D2FD91C0EA; Mon, 17 Jan 2005 16:23:12 +0100 (CET) Date: Mon, 17 Jan 2005 16:23:12 +0100 From: Thomas Graf To: Jamal Hadi Salim , Patrick McHardy , Stephen Hemminger Cc: netdev@oss.sgi.com Subject: [RFC] batched tc to improve change throughput Message-ID: <20050117152312.GC26856@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 361 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev While collecting performance numbers for the ematch changes I realized that the throughput of changes per second is almost only limited by the cost of starting the tc binary over and over. In order to improve this, batching of commands is required. My plan to do so is quite simple, introduce a new flag -f which puts tc into batched mode and makes it read commands from stdin. A bison based parser splits things into tokens, the grammer would be quite easy: INPUT ::= { /* empty */ | CMDS } CMDS ::= { CMD | CMD ';' CMDS } CMD ::= ARGS ARGS ::= { STRING | STRING ARGS } The lexical part can be made to ignore c-syle and shell-style comments, i.e. --- #!/sbin/tc -f /* some comments here */ qdisc add .. class ... # shell like comments also possible filter add ... basic match ... --- Of course this loses ability to use shell features like variables and loops and it's probably not worth trying to emulate things. One can always generate these tc scripts with the help of other tools like m4, you name it. This could also be applied to ip of course. Thoughts? From hadi@cyberus.ca Mon Jan 17 07:47:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 07:47:48 -0800 (PST) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HFlfTg008180 for ; Mon, 17 Jan 2005 07:47:42 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.30) id 1CqZ6N-0000Aa-FC for netdev@oss.sgi.com; Mon, 17 Jan 2005 10:47:35 -0500 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqZ46-0001s0-RO; Mon, 17 Jan 2005 10:45:14 -0500 Subject: Re: [RFC] batched tc to improve change throughput From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com In-Reply-To: <20050117152312.GC26856@postel.suug.ch> References: <20050117152312.GC26856@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105976711.1078.1.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 17 Jan 2005 10:45:11 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 362 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev You dont like the -batch option to tc? ;-> cheers, jamal On Mon, 2005-01-17 at 10:23, Thomas Graf wrote: > While collecting performance numbers for the ematch changes > I realized that the throughput of changes per second is > almost only limited by the cost of starting the tc binary > over and over. In order to improve this, batching of commands > is required. My plan to do so is quite simple, introduce > a new flag -f which puts tc into batched mode and makes > it read commands from stdin. A bison based parser splits > things into tokens, the grammer would be quite easy: > > INPUT ::= { /* empty */ | CMDS } > CMDS ::= { CMD | CMD ';' CMDS } > CMD ::= ARGS > ARGS ::= { STRING | STRING ARGS } > > The lexical part can be made to ignore c-syle and > shell-style comments, i.e. > > --- > #!/sbin/tc -f > > /* some comments here */ > qdisc add .. > class ... > > # shell like comments also possible > filter add ... basic match ... > --- > > Of course this loses ability to use shell features like > variables and loops and it's probably not worth trying > to emulate things. One can always generate these tc scripts > with the help of other tools like m4, you name it. > > This could also be applied to ip of course. > > Thoughts? > > From tgraf@suug.ch Mon Jan 17 08:05:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 08:05:31 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HG5JpP009417 for ; Mon, 17 Jan 2005 08:05:20 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 5FB8B84; Mon, 17 Jan 2005 17:04:56 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 8AC511C0EA; Mon, 17 Jan 2005 17:05:39 +0100 (CET) Date: Mon, 17 Jan 2005 17:05:39 +0100 From: Thomas Graf To: jamal Cc: Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com Subject: Re: [RFC] batched tc to improve change throughput Message-ID: <20050117160539.GD26856@postel.suug.ch> References: <20050117152312.GC26856@postel.suug.ch> <1105976711.1078.1.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1105976711.1078.1.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 363 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1105976711.1078.1.camel@jzny.localdomain> 2005-01-17 10:45 > You dont like the -batch option to tc? ;-> No, because: - it duplicates logic - it doesn't allow any commenting - it doesn't get along with my more complicated ematch parsing From hadi@cyberus.ca Mon Jan 17 08:36:56 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 08:37:01 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HGaudk014781 for ; Mon, 17 Jan 2005 08:36:56 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CqZs6-0005nq-AX for netdev@oss.sgi.com; Mon, 17 Jan 2005 11:36:54 -0500 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqZs3-0002tU-8P; Mon, 17 Jan 2005 11:36:51 -0500 Subject: Re: [RFC] batched tc to improve change throughput From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com In-Reply-To: <20050117160539.GD26856@postel.suug.ch> References: <20050117152312.GC26856@postel.suug.ch> <1105976711.1078.1.camel@jzny.localdomain> <20050117160539.GD26856@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105979807.1078.16.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 17 Jan 2005 11:36:47 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 364 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Mon, 2005-01-17 at 11:05, Thomas Graf wrote: > * jamal <1105976711.1078.1.camel@jzny.localdomain> 2005-01-17 10:45 > > You dont like the -batch option to tc? ;-> > > No, because: > > - it duplicates logic Didnt follow this - uses the same code as command line. What logic gets duplicated? > - it doesn't allow any commenting Trivial thing you can fix in about 33.5 seconds ;-> > - it doesn't get along with my more complicated ematch parsing Example? cheers, jamal From tgraf@suug.ch Mon Jan 17 08:56:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 08:56:13 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HGu8wP016048 for ; Mon, 17 Jan 2005 08:56:08 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id CF24984; Mon, 17 Jan 2005 17:55:43 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 08EFC1C0EA; Mon, 17 Jan 2005 17:56:27 +0100 (CET) Date: Mon, 17 Jan 2005 17:56:26 +0100 From: Thomas Graf To: jamal Cc: Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com Subject: Re: [RFC] batched tc to improve change throughput Message-ID: <20050117165626.GE26856@postel.suug.ch> References: <20050117152312.GC26856@postel.suug.ch> <1105976711.1078.1.camel@jzny.localdomain> <20050117160539.GD26856@postel.suug.ch> <1105979807.1078.16.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1105979807.1078.16.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 365 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1105979807.1078.16.camel@jzny.localdomain> 2005-01-17 11:36 > On Mon, 2005-01-17 at 11:05, Thomas Graf wrote: > > * jamal <1105976711.1078.1.camel@jzny.localdomain> 2005-01-17 10:45 > > > You dont like the -batch option to tc? ;-> > > > > No, because: > > > > - it duplicates logic > > Didnt follow this - uses the same code as command line. What logic gets > duplicated? The parsing of top level nodes. > > - it doesn't allow any commenting > > Trivial thing you can fix in about 33.5 seconds ;- Simple full-line comments yes, mid-line comments no. -batch is also not able to split things across multiple lines. I want my scripts to look like this: /** * filter dla_fp * match DLA traffic at lower watermark */ tc filter add dev %DEV parent 1:12 prio 40 protocol all basic match meta(nfmark eq %LOW_WATERMARK) and ( nbyte("\x0\x1\x2\x3\x4" at 4 layer 2) /* 00 01 02 03 04 (dla fp) */ or u32(ip src 10.0.0.0/8) ) flowid 1:20 > > - it doesn't get along with my more complicated ematch parsing > > Example? stuff like nbyte, kmp or regexp rely on quoted strings and those would be destroyed if they'd contain whitespaces. From joern@wohnheim.fh-wedel.de Mon Jan 17 09:17:22 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 09:17:27 -0800 (PST) Received: from moskovskaya.fh-wedel.de (mail.fh-wedel.de [213.39.232.198]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HHHLU9019331 for ; Mon, 17 Jan 2005 09:17:22 -0800 Received: from wohnheim.fh-wedel.de ([213.39.233.138]:35427) by moskovskaya.fh-wedel.de with esmtp (Exim 4.34) id 1CqaV8-0000TX-9I; Mon, 17 Jan 2005 18:17:14 +0100 Received: from joern by wohnheim.fh-wedel.de with local (Exim 3.35 #1 (Debian)) id 1CqaVA-0007IL-00; Mon, 17 Jan 2005 18:17:16 +0100 Date: Mon, 17 Jan 2005 18:17:16 +0100 From: =?iso-8859-1?Q?J=F6rn?= Engel To: Andy Fleming Cc: Kumar Gala , Netdev , Embedded PPC Linux list Subject: Re: [RFC] Patch to Abstract Ethernet PHY support (using driver model) Message-ID: <20050117171715.GA21744@wohnheim.fh-wedel.de> References: <20050106070245.GA6539@gate.ebshome.net> <61A37C72-659C-11D9-8D70-000393C30512@freescale.com> <20050113212152.GA16041@gate.ebshome.net> <20050113215808.GA15124@wohnheim.fh-wedel.de> <20050114010016.GA16635@gate.ebshome.net> <20050114145518.GA21418@wohnheim.fh-wedel.de> <4D217F72-666F-11D9-8D70-000393C30512@freescale.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4D217F72-666F-11D9-8D70-000393C30512@freescale.com> User-Agent: Mutt/1.3.28i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 366 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: joern@wohnheim.fh-wedel.de Precedence: bulk X-list: netdev On Fri, 14 January 2005 15:00:20 -0600, Andy Fleming wrote: > > > >Wrt. the proposed PHY lib, I agree. Didn't even bother to look at the > >code, it's mere size said enough. Ok, this time I did bother to look at the code... > Hmm... Before I spend too much time revising based on previous comments > ebs made, is there a general consensus that the code is much too large? > I know there's a lot in there, but the goal is to simplify PHY > management for all ethernet drivers, new and old, and thus reduce code > size, overall. Is this code heading in the right direction? Does it > do too much? Too little? drivers/net/Kconfig | 33 +- drivers/net/Makefile | 3 drivers/net/phy/Kconfig | 45 +++ drivers/net/phy/Makefile | 9 drivers/net/phy/cicada.c | 165 +++++++++++ drivers/net/phy/davicom.c | 277 +++++++++++++++++++ drivers/net/phy/lxt.c | 237 +++++++++++++++++ drivers/net/phy/marvell.c | 173 ++++++++++++ drivers/net/phy/mdio_bus.c | 173 ++++++++++++ drivers/net/phy/phy.c | 512 ++++++++++++++++++++++++++++++++++++ drivers/net/phy/phy_device.c | 598 +++++++++++++++++++++++++++++++++++++++++++ drivers/net/phy/qsemi.c | 183 +++++++++++++ include/linux/phy.h | 355 +++++++++++++++++++++++++ 13 files changed, 2743 insertions(+), 20 deletions(-) Imo, the general idea to combine phy code makes sense - to a degree. Advantage is less code copied over most existing drivers. But few people have more than one driver compiled in (or loaded, in case of modules) at a time, so that bloat is source code only. The big danger here is that real compiled kernels will actually grow. As an example, drivers that don't bother with suspend/resume should have a slightly smaller binary, compared to generic code that supports it. There are valid reasons why people might want such a device, so no size fits 'em all. If you manage to convert existing drivers to your new proposed model, you can show some numbers. Is the compiled kernel smaller or bigger after your changes. About the same? If there is significant growth, I'm pretty unexcited about the idea. If it shrinks, you're a genius and sure, the patch should go in. With roughly the same binary size, you can point to code size and show how that has decreased. Right now, all I see is more code and I get this feeling that binary size will grow as well. So please try to prove me wrong. Jörn -- Time? What's that? Time is only worth what you do with it. -- Theo de Raadt From shemminger@osdl.org Mon Jan 17 10:01:17 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 10:01:24 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HI1GdQ021848 for ; Mon, 17 Jan 2005 10:01:17 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0HI02l22615; Mon, 17 Jan 2005 10:00:02 -0800 Date: Mon, 17 Jan 2005 10:00:04 -0800 From: Stephen Hemminger To: Thomas Graf Cc: Jamal Hadi Salim , Patrick McHardy , netdev@oss.sgi.com Subject: Re: [RFC] batched tc to improve change throughput Message-ID: <20050117100004.1353fdef@dxpl.pdx.osdl.net> In-Reply-To: <20050117152312.GC26856@postel.suug.ch> References: <20050117152312.GC26856@postel.suug.ch> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 367 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev On Mon, 17 Jan 2005 16:23:12 +0100 Thomas Graf wrote: > While collecting performance numbers for the ematch changes > I realized that the throughput of changes per second is > almost only limited by the cost of starting the tc binary > over and over. In order to improve this, batching of commands > is required. My plan to do so is quite simple, introduce > a new flag -f which puts tc into batched mode and makes > it read commands from stdin. A bison based parser splits > things into tokens, the grammer would be quite easy: > > INPUT ::= { /* empty */ | CMDS } > CMDS ::= { CMD | CMD ';' CMDS } > CMD ::= ARGS > ARGS ::= { STRING | STRING ARGS } > > The lexical part can be made to ignore c-syle and > shell-style comments, i.e. > > --- > #!/sbin/tc -f > > /* some comments here */ > qdisc add .. > class ... > > # shell like comments also possible > filter add ... basic match ... > --- > > Of course this loses ability to use shell features like > variables and loops and it's probably not worth trying > to emulate things. One can always generate these tc scripts > with the help of other tools like m4, you name it. > > This could also be applied to ip of course. > > Thoughts? I have no problem with -f input, but don't turn it into a full blown interpreter. There are enuf messy scripting languages already. -- Stephen Hemminger From shemminger@osdl.org Mon Jan 17 10:02:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 10:02:58 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HI2rIT022118 for ; Mon, 17 Jan 2005 10:02:53 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0HI2El22995; Mon, 17 Jan 2005 10:02:14 -0800 Date: Mon, 17 Jan 2005 10:02:16 -0800 From: Stephen Hemminger To: Thomas Graf Cc: Jamal Hadi Salim , Patrick McHardy , netdev@oss.sgi.com Subject: Re: [RFC] batched tc to improve change throughput Message-ID: <20050117100216.22767083@dxpl.pdx.osdl.net> In-Reply-To: <20050117152312.GC26856@postel.suug.ch> References: <20050117152312.GC26856@postel.suug.ch> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 368 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev On Mon, 17 Jan 2005 16:23:12 +0100 Thomas Graf wrote: > While collecting performance numbers for the ematch changes > I realized that the throughput of changes per second is > almost only limited by the cost of starting the tc binary > over and over. In order to improve this, batching of commands > is required. My plan to do so is quite simple, introduce > a new flag -f which puts tc into batched mode and makes > it read commands from stdin. A bison based parser splits > things into tokens, the grammer would be quite easy: > > INPUT ::= { /* empty */ | CMDS } > CMDS ::= { CMD | CMD ';' CMDS } > CMD ::= ARGS > ARGS ::= { STRING | STRING ARGS } > > The lexical part can be made to ignore c-syle and > shell-style comments, i.e. > > --- > #!/sbin/tc -f > > /* some comments here */ > qdisc add .. > class ... > > # shell like comments also possible > filter add ... basic match ... > --- > > Of course this loses ability to use shell features like > variables and loops and it's probably not worth trying > to emulate things. One can always generate these tc scripts > with the help of other tools like m4, you name it. > > This could also be applied to ip of course. > > Thoughts? The tc command line processing might leak memory now, or suffer from expected variable initialization issues. You may want to run it with valgrind or other tools to check for that. -- Stephen Hemminger From jmorris@redhat.com Mon Jan 17 10:37:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 10:37:32 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HIbRtr024896 for ; Mon, 17 Jan 2005 10:37:28 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j0HIbOKD030993; Mon, 17 Jan 2005 13:37:24 -0500 Received: from mail.boston.redhat.com (mail.boston.redhat.com [172.16.76.12]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j0HIbJO17141; Mon, 17 Jan 2005 13:37:19 -0500 Received: from thoron.boston.redhat.com (thoron.boston.redhat.com [172.16.80.63]) by mail.boston.redhat.com (8.12.8/8.12.8) with ESMTP id j0HIbIs2015492; Mon, 17 Jan 2005 13:37:19 -0500 Date: Mon, 17 Jan 2005 13:37:18 -0500 (EST) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: jamal cc: netdev@oss.sgi.com Subject: Re: patchlet In-Reply-To: <1104248027.1100.110.camel@jzny.localdomain> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 369 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jmorris@redhat.com Precedence: bulk X-list: netdev On 28 Dec 2004, jamal wrote: > James, > > Attached a small patchlet that looked obvious - untested. Thanks, not sure how that was missed. - James -- James Morris From dale@farnsworth.org Mon Jan 17 10:40:22 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 10:40:35 -0800 (PST) Received: from xyzzy.farnsworth.org (qmailr@h142-az.mvista.com [65.200.49.142] (may be forged)) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0HIeKid025460 for ; Mon, 17 Jan 2005 10:40:21 -0800 Received: (qmail 25073 invoked by uid 1000); 17 Jan 2005 18:40:19 -0000 From: "Dale Farnsworth" Date: Mon, 17 Jan 2005 11:40:19 -0700 To: netdev@oss.sgi.com, Jeff Garzik Cc: Ralf Baechle , Manish Lachwani , Brian Waite , "Steven J. Hill" Subject: MV643xx Ethernet 2.6 driver update Message-ID: <20050117184019.GA24655@xyzzy> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 370 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dale@farnsworth.org Precedence: bulk X-list: netdev While porting the mv643xx ethernet driver to 2.6 and for use on PPC, I modified it to use the device driver model, fixed the hardware checksum support, and did some miscellaneous bug fixes and cleanups. The following changes are included: A. Remove redundant or unneeded code. B. Replace fixed count spins with udelay/msleep waits on hardware status bits C. Fix code to enable hardware checksum generation for TX packets D. Convert from pci_map_* to dma_map_* interface E. Add device driver model support. F. Add support for several configurable parameters via platform_device G. Make use of MV64340_RX_QUEUE_FILL_ON_TASK macro consistent. H. Simplify mv64340_eth_set_rx_mode() I. Clean up receive buffer sizing J. Call netif_carrier_off/netif_carrier_on on a link down/up condition K. Add support for PHYs/boards that don't support autonegotiation. Change E is the only one that modifies the driver interface. Change G was sent to me by Steven J Hill . Change K was sent to me by Brian Waite . The first 6 changes were submitted to LKLM on Dec. 13 2004. Comments were received only from Christoph Hellwig and have been addressed. Changes G-K have been added since then. I have some additional (mostly cosmetic, but still significant) cleanups, but I'd like to get these in the queue first. Thanks, Dale Farnsworth Please do a bk pull bk://dfarnsworth.bkbits.net/netdev-2.6-mv643xx-enet This will update the following files: drivers/net/mv643xx_eth.c | 1146 ++++++++++++++++++++++++---------------------- drivers/net/mv643xx_eth.h | 235 --------- include/linux/mv643xx.h | 206 ++++++++ 3 files changed, 833 insertions(+), 754 deletions(-) through these ChangeSets: (05/01/14 1.2329.1.11) Add support for PHYs/boards that don't support autonegotiation. Signed-off-by: Brian Waite Signed-off-by: Dale Farnsworth (05/01/14 1.2329.1.10) With this patch, the driver now calls netif_carrier_off/netif_carrier_on on a link down/up condition. Signed-off-by: Dale Farnsworth (05/01/14 1.2329.1.9) This patch cleans up the handling of receive buffer sizing. Signed-off-by: Dale Farnsworth (05/01/14 1.2329.1.8) This patch simplifies the mv64340_eth_set_rx_mode function without changing its behavior. Signed-off-by: Dale Farnsworth (05/01/14 1.2329.1.7) This patch makes the use of the MV64340_RX_QUEUE_FILL_ON_TASK config macro more consistent, though the macro remains undefined, since the feature still does not work properly. Signed-off-by: Steven J. Hill Signed-off-by: Dale Farnsworth (05/01/14 1.2329.1.6) This patch adds support for passing additional parameters via the platform_device interface. These additional parameters are: size of RX and TX descriptor rings port_config value port_config_extend value port_sdma_config value port_serial_control value PHY address Signed-off-by: Dale Farnsworth (05/01/14 1.2329.1.5) This patch adds device driver model support to the mv643xx_eth driver. This is a change to the driver's programming interface. Platform code must now pass in the address of the MV643xx ethernet registers and IRQ. If firmware doesn't set the MAC address, platform code must also pass in the MAC address. Also, note that local MV_READ/MV_WRITE macros are used rather than using global macros. Keeping the macro names minimizes the patch size. The names will be changed to mv_read/mv_write in a later cosmetic cleanup patch. Signed-off-by: Dale Farnsworth (05/01/14 1.2329.1.4) This patch replaces the use of the pci_map_* functions with the corresponding dma_map_* functions. Signed-off-by: Dale Farnsworth (05/01/14 1.2329.1.3) This patch fixes the code that enables hardware checksum generation. The previous code has so many problems that it appears to never have worked 2.6. Signed-off-by: Dale Farnsworth (05/01/14 1.2329.1.2) This patch removes spin delays (count to 1000000, ugh) and instead waits with udelay or msleep for hardware flags to change. It also adds a spinlock to protect access to the MV64340_ETH_SMI_REG, which is shared across ports. Signed-off-by: Dale Farnsworth (05/01/14 1.2329.1.1) This patch removes code that is redundant or useless. The biggest area is in pre-initializing the RX and TX descriptor rings, which only obfuscates the driver since the ring data is overwritten without being used. Signed-off-by: Dale Farnsworth Cumulative patch resulting from the changesets above: diff -Nru a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c --- a/drivers/net/mv643xx_eth.c 2005-01-17 11:22:12 -07:00 +++ b/drivers/net/mv643xx_eth.c 2005-01-17 11:22:12 -07:00 @@ -10,6 +10,12 @@ * * Copyright (C) 2003 Ralf Baechle * + * Copyright (C) 2004-2005 MontaVista Software, Inc. + * Dale Farnsworth + * + * Copyright (C) 2004 Steven J. Hill + * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 @@ -24,58 +30,49 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include +#include #include -#include +#include #include -#include #include +#include #include #include #include #include +#include #include "mv643xx_eth.h" /* * The first part is the high level driver of the gigE ethernet ports. */ -/* Definition for configuring driver */ -#undef MV64340_RX_QUEUE_FILL_ON_TASK - /* Constants */ #define EXTRA_BYTES 32 #define WRAP ETH_HLEN + 2 + 4 + 16 #define BUFFER_MTU dev->mtu + WRAP #define INT_CAUSE_UNMASK_ALL 0x0007ffff #define INT_CAUSE_UNMASK_ALL_EXT 0x0011ffff -#ifdef MV64340_RX_FILL_ON_TASK +#ifdef MV64340_RX_QUEUE_FILL_ON_TASK #define INT_CAUSE_MASK_ALL 0x00000000 #define INT_CAUSE_CHECK_BITS INT_CAUSE_UNMASK_ALL #define INT_CAUSE_CHECK_BITS_EXT INT_CAUSE_UNMASK_ALL_EXT #endif +#ifdef MV64340_CHECKSUM_OFFLOAD_TX +#define MAX_DESCS_PER_SKB (MAX_SKB_FRAGS + 1) +#else +#define MAX_DESCS_PER_SKB 1 +#endif + +#define PHY_WAIT_ITERATIONS 1000 /* 1000 iterations * 10uS = 10mS max */ +#define PHY_WAIT_MICRO_SECONDS 10 /* Static function declarations */ +static int eth_port_link_is_up(unsigned int eth_port_num); +static void eth_port_uc_addr_get(struct net_device *dev, + unsigned char *MacAddr); static int mv64340_eth_real_open(struct net_device *); static int mv64340_eth_real_stop(struct net_device *); static int mv64340_eth_change_mtu(struct net_device *, int); @@ -84,9 +81,21 @@ #ifdef MV64340_NAPI static int mv64340_poll(struct net_device *dev, int *budget); #endif +static void ethernet_phy_set(unsigned int eth_port_num, int phy_addr); + +static void __iomem *mv64x60_eth_shared_base; + +/* used to protect MV64340_ETH_SMI_REG, which is shared across ports */ +static spinlock_t mv64340_eth_phy_lock = SPIN_LOCK_UNLOCKED; -unsigned char prom_mac_addr_base[6]; -unsigned long mv64340_sram_base; +#undef MV_READ +#define MV_READ(offset) \ + readl(mv64x60_eth_shared_base - MV64340_ETH_SHARED_REGS + offset) + +#undef MV_WRITE +#define MV_WRITE(offset, data) \ + writel((u32)data, \ + mv64x60_eth_shared_base - MV64340_ETH_SHARED_REGS + offset) /* * Changes MTU (maximum transfer unit) of the gigabit ethenret port @@ -148,24 +157,15 @@ panic("%s: Error in test_set_bit / clear_bit", dev->name); while (mp->rx_ring_skbs < (mp->rx_ring_size - 5)) { - /* The +8 for buffer allignment and another 32 byte extra */ - - skb = dev_alloc_skb(BUFFER_MTU + 8 + EXTRA_BYTES); + /* Ensure skb->len is a multiple of 8 */ + skb = dev_alloc_skb((BUFFER_MTU + EXTRA_BYTES + 7) & ~0x7); if (!skb) - /* Better luck next time */ break; mp->rx_ring_skbs++; pkt_info.cmd_sts = ETH_RX_ENABLE_INTERRUPT; - pkt_info.byte_cnt = dev->mtu + ETH_HLEN + 4 + 2 + EXTRA_BYTES; - /* Allign buffer to 8 bytes */ - if (pkt_info.byte_cnt & ~0x7) { - pkt_info.byte_cnt &= ~0x7; - pkt_info.byte_cnt += 8; - } + pkt_info.byte_cnt = skb->len; pkt_info.buf_ptr = - pci_map_single(0, skb->data, - dev->mtu + ETH_HLEN + 4 + 2 + EXTRA_BYTES, - PCI_DMA_FROMDEVICE); + dma_map_single(NULL, skb->data, skb->len, DMA_FROM_DEVICE); pkt_info.return_info = skb; if (eth_rx_return_buff(mp, &pkt_info) != ETH_OK) { printk(KERN_ERR @@ -186,7 +186,7 @@ add_timer(&mp->timeout); mp->rx_timer_flag = 1; } -#if MV64340_RX_QUEUE_FILL_ON_TASK +#ifdef MV64340_RX_QUEUE_FILL_ON_TASK else { /* Return interrupts */ MV_WRITE(MV64340_ETH_INTERRUPT_MASK_REG(mp->port_num), @@ -244,18 +244,14 @@ static void mv64340_eth_set_rx_mode(struct net_device *dev) { struct mv64340_private *mp = netdev_priv(dev); + u32 config_reg; - if (dev->flags & IFF_PROMISC) { - ethernet_set_config_reg - (mp->port_num, - ethernet_get_config_reg(mp->port_num) | - ETH_UNICAST_PROMISCUOUS_MODE); - } else { - ethernet_set_config_reg - (mp->port_num, - ethernet_get_config_reg(mp->port_num) & - ~(unsigned int) ETH_UNICAST_PROMISCUOUS_MODE); - } + config_reg = ethernet_get_config_reg(mp->port_num); + if (dev->flags & IFF_PROMISC) + config_reg |= (u32)MV64340_ETH_UNICAST_PROMISCUOUS_MODE; + else + config_reg &= ~(u32)MV64340_ETH_UNICAST_PROMISCUOUS_MODE; + ethernet_set_config_reg(mp->port_num, config_reg); } @@ -348,26 +344,27 @@ * last skb releases the whole chain. */ if (pkt_info.return_info) { - dev_kfree_skb_irq((struct sk_buff *) - pkt_info.return_info); - released = 0; if (skb_shinfo(pkt_info.return_info)->nr_frags) - pci_unmap_page(NULL, pkt_info.buf_ptr, - pkt_info.byte_cnt, PCI_DMA_TODEVICE); - - if (mp->tx_ring_skbs != 1) - mp->tx_ring_skbs--; - } else - pci_unmap_page(NULL, pkt_info.buf_ptr, - pkt_info.byte_cnt, PCI_DMA_TODEVICE); + dma_unmap_page(NULL, pkt_info.buf_ptr, + pkt_info.byte_cnt, DMA_TO_DEVICE); + else + dma_unmap_single(NULL, pkt_info.buf_ptr, + pkt_info.byte_cnt, DMA_TO_DEVICE); - /* - * Decrement the number of outstanding skbs counter on - * the TX queue. - */ - if (mp->tx_ring_skbs == 0) - panic("ERROR - TX outstanding SKBs counter is corrupted"); + dev_kfree_skb_irq(pkt_info.return_info); + released = 0; + /* + * Decrement the number of outstanding skbs counter on + * the TX queue. + */ + if (mp->tx_ring_skbs == 0) + panic("ERROR - TX outstanding SKBs" + " counter is corrupted"); + mp->tx_ring_skbs--; + } else + dma_unmap_page(NULL, pkt_info.buf_ptr, + pkt_info.byte_cnt, DMA_TO_DEVICE); } spin_unlock(&mp->lock); @@ -387,10 +384,9 @@ * Output : number of served packets */ #ifdef MV64340_NAPI -static int mv64340_eth_receive_queue(struct net_device *dev, unsigned int max, - int budget) +static int mv64340_eth_receive_queue(struct net_device *dev, int budget) #else -static int mv64340_eth_receive_queue(struct net_device *dev, unsigned int max) +static int mv64340_eth_receive_queue(struct net_device *dev) #endif { struct mv64340_private *mp = netdev_priv(dev); @@ -402,7 +398,7 @@ #ifdef MV64340_NAPI while (eth_port_receive(mp, &pkt_info) == ETH_OK && budget > 0) { #else - while ((--max) && eth_port_receive(mp, &pkt_info) == ETH_OK) { + while (eth_port_receive(mp, &pkt_info) == ETH_OK) { #endif mp->rx_ring_skbs--; received_packets++; @@ -412,7 +408,7 @@ /* Update statistics. Note byte count includes 4 byte CRC count */ stats->rx_packets++; stats->rx_bytes += pkt_info.byte_cnt; - skb = (struct sk_buff *) pkt_info.return_info; + skb = pkt_info.return_info; /* * In case received a packet without first / last bits on OR * the error summary bit is on, the packets needs to be dropeed. @@ -505,7 +501,7 @@ /* UDP change : We may need this */ if ((eth_int_cause_ext & 0x0000ffff) && (mv64340_eth_free_tx_queue(dev, eth_int_cause_ext) == 0) && - (MV64340_TX_QUEUE_SIZE > mp->tx_ring_skbs + 1)) + (mp->tx_ring_size > mp->tx_ring_skbs + MAX_DESCS_PER_SKB)) netif_wake_queue(dev); #ifdef MV64340_NAPI } else { @@ -525,7 +521,7 @@ * in an interrupts enabled context that refills the RX ring * with skb's. */ -#if MV64340_RX_QUEUE_FILL_ON_TASK +#ifdef MV64340_RX_QUEUE_FILL_ON_TASK /* Unmask all interrupts on ethernet port */ MV_WRITE(MV64340_ETH_INTERRUPT_MASK_REG(port_num), INT_CAUSE_MASK_ALL); @@ -538,25 +534,14 @@ } /* PHY status changed */ if (eth_int_cause_ext & (BIT16 | BIT20)) { - unsigned int phy_reg_data; - - /* Check Link status on ethernet port */ - eth_port_read_smi_reg(port_num, 1, &phy_reg_data); - if (!(phy_reg_data & 0x20)) { - netif_stop_queue(dev); - } else { + if (eth_port_link_is_up(port_num)) { + netif_carrier_on(dev); netif_wake_queue(dev); - - /* - * Start all TX queues on ethernet port. This is good in - * case of previous packets where not transmitted, due - * to link down and this command re-enables all TX - * queues. - * Note that it is possible to get a TX resource error - * interrupt after issuing this, since not all TX queues - * are enabled, or has anything to send. - */ + /* Start TX queue */ MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(port_num), 1); + } else { + netif_carrier_off(dev); + netif_stop_queue(dev); } } @@ -661,7 +646,7 @@ { struct mv64340_private *mp = netdev_priv(dev); unsigned int port_num = mp->port_num; - int err = err; + int err; spin_lock_irq(&mp->lock); @@ -708,56 +693,25 @@ * * INPUT: * struct mv64340_private *mp Ethernet Port Control srtuct. - * int rx_desc_num Number of Rx descriptors - * int rx_buff_size Size of Rx buffer - * unsigned int rx_desc_base_addr Rx descriptors memory area base addr. - * unsigned int rx_buff_base_addr Rx buffer memory area base addr. * * OUTPUT: * The routine updates the Ethernet port control struct with information * regarding the Rx descriptors and buffers. * * RETURN: - * false if the given descriptors memory area is not aligned according to - * Ethernet SDMA specifications. - * true otherwise. + * None. */ -static int ether_init_rx_desc_ring(struct mv64340_private * mp, - unsigned long rx_buff_base_addr) +static void ether_init_rx_desc_ring(struct mv64340_private * mp) { - unsigned long buffer_addr = rx_buff_base_addr; volatile struct eth_rx_desc *p_rx_desc; int rx_desc_num = mp->rx_ring_size; - unsigned long rx_desc_base_addr = (unsigned long) mp->p_rx_desc_area; - int rx_buff_size = 1536; /* Dummy, will be replaced later */ int i; - p_rx_desc = (struct eth_rx_desc *) rx_desc_base_addr; - - /* Rx desc Must be 4LW aligned (i.e. Descriptor_Address[3:0]=0000). */ - if (rx_buff_base_addr & 0xf) - return 0; - - /* Rx buffers are limited to 64K bytes and Minimum size is 8 bytes */ - if ((rx_buff_size < 8) || (rx_buff_size > RX_BUFFER_MAX_SIZE)) - return 0; - - /* Rx buffers must be 64-bit aligned. */ - if ((rx_buff_base_addr + rx_buff_size) & 0x7) - return 0; - - /* initialize the Rx descriptors ring */ + /* initialize the next_desc_ptr links in the Rx descriptors ring */ + p_rx_desc = (struct eth_rx_desc *) mp->p_rx_desc_area; for (i = 0; i < rx_desc_num; i++) { - p_rx_desc[i].buf_size = rx_buff_size; - p_rx_desc[i].byte_cnt = 0x0000; - p_rx_desc[i].cmd_sts = - ETH_BUFFER_OWNED_BY_DMA | ETH_RX_ENABLE_INTERRUPT; p_rx_desc[i].next_desc_ptr = mp->rx_desc_dma + ((i + 1) % rx_desc_num) * sizeof(struct eth_rx_desc); - p_rx_desc[i].buf_ptr = buffer_addr; - - mp->rx_skb[i] = NULL; - buffer_addr += rx_buff_size; } /* Save Rx desc pointer to driver struct. */ @@ -766,9 +720,8 @@ mp->rx_desc_area_size = rx_desc_num * sizeof(struct eth_rx_desc); + /* Add the queue to the list of RX queues of this port */ mp->port_rx_queue_command |= 1; - - return 1; } /* @@ -785,57 +738,37 @@ * * INPUT: * struct mv64340_private *mp Ethernet Port Control srtuct. - * int tx_desc_num Number of Tx descriptors - * int tx_buff_size Size of Tx buffer - * unsigned int tx_desc_base_addr Tx descriptors memory area base addr. * * OUTPUT: * The routine updates the Ethernet port control struct with information * regarding the Tx descriptors and buffers. * * RETURN: - * false if the given descriptors memory area is not aligned according to - * Ethernet SDMA specifications. - * true otherwise. + * None. */ -static int ether_init_tx_desc_ring(struct mv64340_private *mp) +static void ether_init_tx_desc_ring(struct mv64340_private *mp) { - unsigned long tx_desc_base_addr = (unsigned long) mp->p_tx_desc_area; int tx_desc_num = mp->tx_ring_size; struct eth_tx_desc *p_tx_desc; int i; - /* Tx desc Must be 4LW aligned (i.e. Descriptor_Address[3:0]=0000). */ - if (tx_desc_base_addr & 0xf) - return 0; - - /* save the first desc pointer to link with the last descriptor */ - p_tx_desc = (struct eth_tx_desc *) tx_desc_base_addr; - - /* Initialize the Tx descriptors ring */ + /* Initialize the next_desc_ptr links in the Tx descriptors ring */ + p_tx_desc = (struct eth_tx_desc *) mp->p_tx_desc_area; for (i = 0; i < tx_desc_num; i++) { - p_tx_desc[i].byte_cnt = 0x0000; - p_tx_desc[i].l4i_chk = 0x0000; - p_tx_desc[i].cmd_sts = 0x00000000; p_tx_desc[i].next_desc_ptr = mp->tx_desc_dma + ((i + 1) % tx_desc_num) * sizeof(struct eth_tx_desc); - p_tx_desc[i].buf_ptr = 0x00000000; - mp->tx_skb[i] = NULL; } - /* Set Tx desc pointer in driver struct. */ mp->tx_curr_desc_q = 0; mp->tx_used_desc_q = 0; #ifdef MV64340_CHECKSUM_OFFLOAD_TX mp->tx_first_desc_q = 0; #endif - /* Init Tx ring base and size parameters */ + mp->tx_desc_area_size = tx_desc_num * sizeof(struct eth_tx_desc); /* Add the queue to the list of Tx queues of this port */ mp->port_tx_queue_command |= 1; - - return 1; } /* Helper function for mv64340_eth_open */ @@ -843,8 +776,9 @@ { struct mv64340_private *mp = netdev_priv(dev); unsigned int port_num = mp->port_num; - u32 phy_reg_data; unsigned int size; + int i; + u32 port_serial_control_reg; /* Stop RX Queues */ MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(port_num), @@ -876,49 +810,74 @@ mp->rx_task_busy = 0; mp->rx_timer_flag = 0; + /* Allocate RX and TX skb rings */ + mp->rx_skb = kmalloc(sizeof(*mp->rx_skb)*mp->rx_ring_size, GFP_KERNEL); + if (!mp->rx_skb) { + printk(KERN_ERR "%s: Cannot allocate Rx skb ring\n", dev->name); + return -ENOMEM; + } + mp->tx_skb = kmalloc(sizeof(*mp->tx_skb)*mp->tx_ring_size, GFP_KERNEL); + if (!mp->tx_skb) { + printk(KERN_ERR "%s: Cannot allocate Tx skb ring\n", dev->name); + kfree(mp->rx_skb); + return -ENOMEM; + } + /* Allocate TX ring */ mp->tx_ring_skbs = 0; - mp->tx_ring_size = MV64340_TX_QUEUE_SIZE; size = mp->tx_ring_size * sizeof(struct eth_tx_desc); mp->tx_desc_area_size = size; - /* Assumes allocated ring is 16 bytes alligned */ - mp->p_tx_desc_area = pci_alloc_consistent(NULL, size, &mp->tx_desc_dma); + if (mp->tx_sram_size) { + mp->p_tx_desc_area = ioremap(mp->tx_sram_addr, + mp->tx_sram_size); + mp->tx_desc_dma = mp->tx_sram_addr; + } else + mp->p_tx_desc_area = dma_alloc_coherent(NULL, size, + &mp->tx_desc_dma, GFP_KERNEL); + if (!mp->p_tx_desc_area) { printk(KERN_ERR "%s: Cannot allocate Tx Ring (size %d bytes)\n", dev->name, size); + kfree(mp->rx_skb); + kfree(mp->tx_skb); return -ENOMEM; } + BUG_ON((u32)mp->p_tx_desc_area & 0xf); /* check 16-byte alignment */ memset((void *) mp->p_tx_desc_area, 0, mp->tx_desc_area_size); - /* Dummy will be replaced upon real tx */ ether_init_tx_desc_ring(mp); /* Allocate RX ring */ - /* Meantime RX Ring are fixed - but must be configurable by user */ - mp->rx_ring_size = MV64340_RX_QUEUE_SIZE; mp->rx_ring_skbs = 0; size = mp->rx_ring_size * sizeof(struct eth_rx_desc); mp->rx_desc_area_size = size; - /* Assumes allocated ring is 16 bytes aligned */ - - mp->p_rx_desc_area = pci_alloc_consistent(NULL, size, &mp->rx_desc_dma); + if (mp->rx_sram_size) { + mp->p_rx_desc_area = ioremap(mp->rx_sram_addr, + mp->rx_sram_size); + mp->rx_desc_dma = mp->rx_sram_addr; + } else + mp->p_rx_desc_area = dma_alloc_coherent(NULL, size, + &mp->rx_desc_dma, GFP_KERNEL); if (!mp->p_rx_desc_area) { printk(KERN_ERR "%s: Cannot allocate Rx ring (size %d bytes)\n", dev->name, size); printk(KERN_ERR "%s: Freeing previously allocated TX queues...", dev->name); - pci_free_consistent(0, mp->tx_desc_area_size, - (void *) mp->p_tx_desc_area, - mp->tx_desc_dma); + if (mp->rx_sram_size) + iounmap(mp->p_rx_desc_area); + else + dma_free_coherent(NULL, mp->tx_desc_area_size, + mp->p_tx_desc_area, mp->tx_desc_dma); + kfree(mp->rx_skb); + kfree(mp->tx_skb); return -ENOMEM; } - memset(mp->p_rx_desc_area, 0, size); + memset((void *)mp->p_rx_desc_area, 0, size); - if (!(ether_init_rx_desc_ring(mp, 0))) - panic("%s: Error initializing RX Ring", dev->name); + ether_init_rx_desc_ring(mp); mv64340_eth_rx_task(dev); /* Fill RX ring with skb's */ @@ -934,18 +893,18 @@ mp->tx_int_coal = eth_port_set_tx_coal (port_num, 133000000, MV64340_TX_COAL); - /* Increase the Rx side buffer size */ + /* Increase the Rx side buffer size if supporting GigE */ + port_serial_control_reg = + MV_READ(MV64340_ETH_PORT_SERIAL_CONTROL_REG(port_num)); + if (port_serial_control_reg & MV64340_ETH_SET_GMII_SPEED_TO_1000) + MV_WRITE(MV64340_ETH_PORT_SERIAL_CONTROL_REG(port_num), + (port_serial_control_reg & 0xfff1ffff) | (0x5 << 17)); + + /* wait up to 1 second for link to come up */ + for (i = 0; i < 10 && !eth_port_link_is_up(port_num); i++) + msleep(100); /* sleep 1/10 second */ - MV_WRITE (MV64340_ETH_PORT_SERIAL_CONTROL_REG(port_num), (0x5 << 17) | - (MV_READ(MV64340_ETH_PORT_SERIAL_CONTROL_REG(port_num)) - & 0xfff1ffff)); - - /* Check Link status on phy */ - eth_port_read_smi_reg(port_num, 1, &phy_reg_data); - if (!(phy_reg_data & 0x20)) - netif_stop_queue(dev); - else - netif_start_queue(dev); + netif_start_queue(dev); return 0; } @@ -960,22 +919,25 @@ MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(port_num), 0x0000ff00); - /* Free TX rings */ + /* Free outstanding skb's on TX rings */ - for (curr = 0; - (mp->tx_ring_skbs) && (curr < MV64340_TX_QUEUE_SIZE); - curr++) { + for (curr = 0; mp->tx_ring_skbs && curr < mp->tx_ring_size; curr++) { if (mp->tx_skb[curr]) { dev_kfree_skb(mp->tx_skb[curr]); mp->tx_ring_skbs--; } } - if (mp->tx_ring_skbs != 0) + if (mp->tx_ring_skbs) printk("%s: Error on Tx descriptor free - could not free %d" " descriptors\n", dev->name, mp->tx_ring_skbs); - pci_free_consistent(0, mp->tx_desc_area_size, - (void *) mp->p_tx_desc_area, mp->tx_desc_dma); + + /* Free TX ring */ + if (mp->tx_sram_size) + iounmap(mp->p_tx_desc_area); + else + dma_free_coherent(NULL, mp->tx_desc_area_size, + mp->p_tx_desc_area, mp->tx_desc_dma); } static void mv64340_eth_free_rx_rings(struct net_device *dev) @@ -988,25 +950,25 @@ MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(port_num), 0x0000ff00); - /* Free RX rings */ /* Free preallocated skb's on RX rings */ - for (curr = 0; - mp->rx_ring_skbs && (curr < MV64340_RX_QUEUE_SIZE); - curr++) { + for (curr = 0; mp->rx_ring_skbs && curr < mp->rx_ring_size; curr++) { if (mp->rx_skb[curr]) { dev_kfree_skb(mp->rx_skb[curr]); mp->rx_ring_skbs--; } } - if (mp->rx_ring_skbs != 0) + if (mp->rx_ring_skbs) printk(KERN_ERR "%s: Error in freeing Rx Ring. %d skb's still" " stuck in RX Ring - ignoring them\n", dev->name, mp->rx_ring_skbs); - pci_free_consistent(0, mp->rx_desc_area_size, - (void *) mp->p_rx_desc_area, - mp->rx_desc_dma); + /* Free RX ring */ + if (mp->rx_sram_size) + iounmap(mp->p_rx_desc_area); + else + dma_free_coherent(NULL, mp->rx_desc_area_size, + mp->p_rx_desc_area, mp->rx_desc_dma); } /* @@ -1068,23 +1030,25 @@ while (eth_tx_return_desc(mp, &pkt_info) == ETH_OK) { if (pkt_info.return_info) { - dev_kfree_skb_irq((struct sk_buff *) - pkt_info.return_info); if (skb_shinfo(pkt_info.return_info)->nr_frags) - pci_unmap_page(NULL, pkt_info.buf_ptr, - pkt_info.byte_cnt, - PCI_DMA_TODEVICE); + dma_unmap_page(NULL, pkt_info.buf_ptr, + pkt_info.byte_cnt, DMA_TO_DEVICE); + else + dma_unmap_single(NULL, pkt_info.buf_ptr, + pkt_info.byte_cnt, DMA_TO_DEVICE); - if (mp->tx_ring_skbs != 1) - mp->tx_ring_skbs--; + dev_kfree_skb_irq(pkt_info.return_info); + + if (mp->tx_ring_skbs) + mp->tx_ring_skbs--; } else - pci_unmap_page(NULL, pkt_info.buf_ptr, pkt_info.byte_cnt, - PCI_DMA_TODEVICE); + dma_unmap_page(NULL, pkt_info.buf_ptr, + pkt_info.byte_cnt, DMA_TO_DEVICE); } if (netif_queue_stopped(dev) && - MV64340_TX_QUEUE_SIZE > mp->tx_ring_skbs + 1) - netif_wake_queue(dev); + mp->tx_ring_size > mp->tx_ring_skbs + MAX_DESCS_PER_SKB) + netif_wake_queue(dev); } /* @@ -1112,7 +1076,7 @@ orig_budget = *budget; if (orig_budget > dev->quota) orig_budget = dev->quota; - work_done = mv64340_eth_receive_queue(dev, 0, orig_budget); + work_done = mv64340_eth_receive_queue(dev, orig_budget); mp->rx_task.func(dev); *budget -= work_done; dev->quota -= work_done; @@ -1163,8 +1127,8 @@ } /* This is a hard error, log it. */ - if ((MV64340_TX_QUEUE_SIZE - mp->tx_ring_skbs) <= - (skb_shinfo(skb)->nr_frags + 1)) { + if ((mp->tx_ring_size - mp->tx_ring_skbs) <= + (skb_shinfo(skb)->nr_frags + 1)) { netif_stop_queue(dev); printk(KERN_ERR "%s: Bug in mv64340_eth - Trying to transmit when" @@ -1175,6 +1139,7 @@ /* Paranoid check - this shouldn't happen */ if (skb == NULL) { stats->tx_dropped++; + printk(KERN_ERR "mv64320_eth paranoid check failed\n"); return 1; } @@ -1182,39 +1147,85 @@ /* Update packet info data structure -- DMA owned, first last */ #ifdef MV64340_CHECKSUM_OFFLOAD_TX - if (!skb_shinfo(skb)->nr_frags || (skb_shinfo(skb)->nr_frags > 3)) { -#endif - pkt_info.cmd_sts = ETH_TX_ENABLE_INTERRUPT | - ETH_TX_FIRST_DESC | ETH_TX_LAST_DESC; + if (!skb_shinfo(skb)->nr_frags) { +linear: + if (skb->ip_summed != CHECKSUM_HW) + pkt_info.cmd_sts = ETH_TX_ENABLE_INTERRUPT | + ETH_TX_FIRST_DESC | + ETH_TX_LAST_DESC; + else { + u32 ipheader = skb->nh.iph->ihl << 11; + pkt_info.cmd_sts = ETH_TX_ENABLE_INTERRUPT | + ETH_TX_FIRST_DESC | ETH_TX_LAST_DESC | + ETH_GEN_TCP_UDP_CHECKSUM | + ETH_GEN_IP_V_4_CHECKSUM | + ipheader; + /* CPU already calculated pseudo header checksum. */ + if (skb->nh.iph->protocol == IPPROTO_UDP) { + pkt_info.cmd_sts |= ETH_UDP_FRAME; + pkt_info.l4i_chk = skb->h.uh->check; + } + else if (skb->nh.iph->protocol == IPPROTO_TCP) + pkt_info.l4i_chk = skb->h.th->check; + else { + printk(KERN_ERR + "%s: chksum proto != TCP or UDP\n", + dev->name); + spin_unlock_irqrestore(&mp->lock, flags); + return 1; + } + } pkt_info.byte_cnt = skb->len; - pkt_info.buf_ptr = pci_map_single(0, skb->data, skb->len, - PCI_DMA_TODEVICE); - - + pkt_info.buf_ptr = dma_map_single(NULL, skb->data, skb->len, + DMA_TO_DEVICE); pkt_info.return_info = skb; status = eth_port_send(mp, &pkt_info); if ((status == ETH_ERROR) || (status == ETH_QUEUE_FULL)) printk(KERN_ERR "%s: Error on transmitting packet\n", dev->name); mp->tx_ring_skbs++; -#ifdef MV64340_CHECKSUM_OFFLOAD_TX } else { unsigned int frag; u32 ipheader; + skb_frag_t *last_frag; + + frag = skb_shinfo(skb)->nr_frags - 1; + last_frag = &skb_shinfo(skb)->frags[frag]; + if (last_frag->size <= 8 && last_frag->page_offset & 0x7) { + skb_linearize(skb, GFP_ATOMIC); + goto linear; + } /* first frag which is skb header */ pkt_info.byte_cnt = skb_headlen(skb); - pkt_info.buf_ptr = pci_map_single(0, skb->data, - skb_headlen(skb), PCI_DMA_TODEVICE); + pkt_info.buf_ptr = dma_map_single(NULL, skb->data, + skb_headlen(skb), DMA_TO_DEVICE); pkt_info.return_info = 0; - ipheader = skb->nh.iph->ihl << 11; - pkt_info.cmd_sts = ETH_TX_FIRST_DESC | - ETH_GEN_TCP_UDP_CHECKSUM | + pkt_info.cmd_sts = ETH_TX_FIRST_DESC; + + if (skb->ip_summed == CHECKSUM_HW) { + /* CPU already calculated pseudo header checksum. */ + ipheader = skb->nh.iph->ihl << 11; + pkt_info.cmd_sts |= ETH_GEN_TCP_UDP_CHECKSUM | ETH_GEN_IP_V_4_CHECKSUM | - ipheader; - /* CPU already calculated pseudo header checksum. So, use it */ - pkt_info.l4i_chk = skb->h.th->check; + ipheader; + /* CPU already calculated pseudo header checksum. */ + if (skb->nh.iph->protocol == IPPROTO_UDP) { + pkt_info.cmd_sts |= ETH_UDP_FRAME; + pkt_info.l4i_chk = skb->h.uh->check; + } + else if (skb->nh.iph->protocol == IPPROTO_TCP) + pkt_info.l4i_chk = skb->h.th->check; + else { + printk(KERN_ERR + "%s: chksum proto != TCP or UDP\n", + dev->name); + spin_unlock_irqrestore(&mp->lock, flags); + return 1; + } + } + status = eth_port_send(mp, &pkt_info); if (status != ETH_OK) { if ((status == ETH_ERROR)) @@ -1242,12 +1253,10 @@ pkt_info.return_info = 0; } pkt_info.byte_cnt = this_frag->size; - if (this_frag->size < 8) - printk("%d : \n", skb_shinfo(skb)->nr_frags); - pkt_info.buf_ptr = pci_map_page(NULL, this_frag->page, + pkt_info.buf_ptr = dma_map_page(NULL, this_frag->page, this_frag->page_offset, - this_frag->size, PCI_DMA_TODEVICE); + this_frag->size, DMA_TO_DEVICE); status = eth_port_send(mp, &pkt_info); @@ -1263,12 +1272,24 @@ } } } +#else + pkt_info.cmd_sts = ETH_TX_ENABLE_INTERRUPT | ETH_TX_FIRST_DESC | + ETH_TX_LAST_DESC; + pkt_info.byte_cnt = skb->len; + pkt_info.buf_ptr = dma_map_single(NULL, skb->data, skb->len, + DMA_TO_DEVICE); + pkt_info.return_info = skb; + status = eth_port_send(mp, &pkt_info); + if ((status == ETH_ERROR) || (status == ETH_QUEUE_FULL)) + printk(KERN_ERR "%s: Error on transmitting packet\n", + dev->name); + mp->tx_ring_skbs++; #endif /* Check if TX queue can handle another skb. If not, then * signal higher layers to stop requesting TX */ - if (MV64340_TX_QUEUE_SIZE <= (mp->tx_ring_skbs + 1)) + if (mp->tx_ring_size <= (mp->tx_ring_skbs + MAX_DESCS_PER_SKB)) /* * Stop getting skb's from upper layers. * Getting skb's from upper layers will be enabled again after @@ -1304,29 +1325,40 @@ } /*/ - * mv64340_eth_init + * mv64340_eth_probe * * First function called after registering the network device. * It's purpose is to initialize the device as an ethernet device, - * fill the structure that was given in registration with pointers - * to functions, and setting the MAC address of the interface + * fill the ethernet device structure with pointers * to functions, + * and set the MAC address of the interface * - * Input : number of port to initialize - * Output : -ENONMEM if failed , 0 if success + * Input : struct device * + * Output : -ENOMEM if failed , 0 if success */ -static struct net_device *mv64340_eth_init(int port_num) +static int mv64340_eth_probe(struct device *ddev) { + struct platform_device *pdev = to_platform_device(ddev); + struct mv64xxx_eth_platform_data *pd; + int port_num = pdev->id; struct mv64340_private *mp; struct net_device *dev; + u8 *p; + struct resource *res; int err; dev = alloc_etherdev(sizeof(struct mv64340_private)); if (!dev) - return NULL; + return -ENOMEM; + + dev_set_drvdata(ddev, dev); mp = netdev_priv(dev); - dev->irq = ETH_PORT0_IRQ_NUM + port_num; + res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); + BUG_ON(!res); + dev->irq = res->start; + + mp->port_num = port_num; dev->open = mv64340_eth_open; dev->stop = mv64340_eth_stop; @@ -1343,7 +1375,7 @@ #endif dev->watchdog_timeo = 2 * HZ; - dev->tx_queue_len = MV64340_TX_QUEUE_SIZE; + dev->tx_queue_len = mp->tx_ring_size; dev->base_addr = 0; dev->change_mtu = mv64340_eth_change_mtu; @@ -1359,60 +1391,149 @@ #endif #endif - mp->port_num = port_num; /* Configure the timeout task */ INIT_WORK(&mp->tx_timeout_task, (void (*)(void *))mv64340_eth_tx_timeout_task, dev); spin_lock_init(&mp->lock); + + /* set default config values */ + eth_port_uc_addr_get(dev, dev->dev_addr); + mp->port_config = MV64340_ETH_PORT_CONFIG_DEFAULT_VALUE; + mp->port_config_extend = MV64340_ETH_PORT_CONFIG_EXTEND_DEFAULT_VALUE; + mp->port_sdma_config = MV64340_ETH_PORT_SDMA_CONFIG_DEFAULT_VALUE; + mp->port_serial_control = MV64340_ETH_PORT_SERIAL_CONTROL_DEFAULT_VALUE; + mp->rx_ring_size = MV64340_ETH_PORT_DEFAULT_RECEIVE_QUEUE_SIZE; + mp->tx_ring_size = MV64340_ETH_PORT_DEFAULT_TRANSMIT_QUEUE_SIZE; + + pd = pdev->dev.platform_data; + if (pd) { + if (pd->mac_addr != NULL) + memcpy(dev->dev_addr, pd->mac_addr, 6); + + if (pd->phy_addr || pd->force_phy_addr) + ethernet_phy_set(port_num, pd->phy_addr); + + if (pd->port_config || pd->force_port_config) + mp->port_config = pd->port_config; + + if (pd->port_config_extend || pd->force_port_config_extend) + mp->port_config_extend = pd->port_config_extend; + + if (pd->port_sdma_config || pd->force_port_sdma_config) + mp->port_sdma_config = pd->port_sdma_config; + + if (pd->port_serial_control || pd->force_port_serial_control) + mp->port_serial_control = pd->port_serial_control; + + if (pd->rx_queue_size) + mp->rx_ring_size = pd->rx_queue_size; + + if (pd->tx_queue_size) + mp->tx_ring_size = pd->tx_queue_size; + + if (pd->tx_sram_size) { + mp->tx_sram_size = pd->tx_sram_size; + mp->tx_sram_addr = pd->tx_sram_addr; + } - /* set MAC addresses */ - memcpy(dev->dev_addr, prom_mac_addr_base, 6); - dev->dev_addr[5] += port_num; + if (pd->rx_sram_size) { + mp->rx_sram_size = pd->rx_sram_size; + mp->rx_sram_addr = pd->rx_sram_addr; + } + } err = register_netdev(dev); if (err) - goto out_free_dev; + goto out; - printk(KERN_NOTICE "%s: port %d with MAC address %02x:%02x:%02x:%02x:%02x:%02x\n", - dev->name, port_num, - dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], - dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]); + p = dev->dev_addr; + printk(KERN_NOTICE + "%s: port %d with MAC address %02x:%02x:%02x:%02x:%02x:%02x\n", + dev->name, port_num, p[0], p[1], p[2], p[3], p[4], p[5]); if (dev->features & NETIF_F_SG) - printk("Scatter Gather Enabled "); + printk(KERN_NOTICE "%s: Scatter Gather Enabled\n", dev->name); if (dev->features & NETIF_F_IP_CSUM) - printk("TX TCP/IP Checksumming Supported \n"); + printk(KERN_NOTICE "%s: TX TCP/IP Checksumming Supported\n", + dev->name); + +#ifdef MV64340_CHECKSUM_OFFLOAD_TX + printk(KERN_NOTICE "%s: RX TCP/UDP Checksum Offload ON \n", dev->name); +#endif - printk("RX TCP/UDP Checksum Offload ON, \n"); - printk("TX and RX Interrupt Coalescing ON \n"); +#ifdef MV64340_COAL + printk(KERN_NOTICE "%s: TX and RX Interrupt Coalescing ON \n", + dev->name); +#endif #ifdef MV64340_NAPI - printk("RX NAPI Enabled \n"); + printk(KERN_NOTICE "%s: RX NAPI Enabled \n", dev->name); #endif - return dev; + return 0; -out_free_dev: +out: free_netdev(dev); - return NULL; + return err; } -static void mv64340_eth_remove(struct net_device *dev) +static int mv64340_eth_remove(struct device *ddev) { - struct mv64340_private *mp = netdev_priv(dev); + struct net_device *dev = dev_get_drvdata(ddev); unregister_netdev(dev); flush_scheduled_work(); + free_netdev(dev); + dev_set_drvdata(ddev, NULL); + return 0; +} + +static int mv64340_eth_shared_probe(struct device *ddev) +{ + struct platform_device *pdev = to_platform_device(ddev); + struct resource *res; + + printk(KERN_NOTICE "MV-643xx 10/100/1000 Ethernet Driver\n"); + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (res == NULL) + return -ENODEV; + + mv64x60_eth_shared_base = ioremap(res->start, + MV64340_ETH_SHARED_REGS_SIZE); + if (mv64x60_eth_shared_base == NULL) + return -ENOMEM; + + return 0; + } -static struct net_device *mv64340_dev0; -static struct net_device *mv64340_dev1; -static struct net_device *mv64340_dev2; +static int mv64340_eth_shared_remove(struct device *ddev) +{ + iounmap(mv64x60_eth_shared_base); + mv64x60_eth_shared_base = NULL; + + return 0; +} + +static struct device_driver mv643xx_eth_driver = { + .name = MV64XXX_ETH_NAME, + .bus = &platform_bus_type, + .probe = mv64340_eth_probe, + .remove = mv64340_eth_remove, +}; + +static struct device_driver mv643xx_eth_shared_driver = { + .name = MV64XXX_ETH_SHARED_NAME, + .bus = &platform_bus_type, + .probe = mv64340_eth_shared_probe, + .remove = mv64340_eth_shared_remove, +}; /* * mv64340_init_module @@ -1425,30 +1546,15 @@ */ static int __init mv64340_init_module(void) { - printk(KERN_NOTICE "MV-643xx 10/100/1000 Ethernet Driver\n"); + int rc; -#ifdef CONFIG_MV643XX_ETH_0 - mv64340_dev0 = mv64340_eth_init(0); - if (!mv64340_dev0) { - printk(KERN_ERR - "Error registering MV-64360 ethernet port 0\n"); + rc = driver_register(&mv643xx_eth_shared_driver); + if (!rc) { + rc = driver_register(&mv643xx_eth_driver); + if (rc) + driver_unregister(&mv643xx_eth_shared_driver); } -#endif -#ifdef CONFIG_MV643XX_ETH_1 - mv64340_dev1 = mv64340_eth_init(1); - if (!mv64340_dev1) { - printk(KERN_ERR - "Error registering MV-64360 ethernet port 1\n"); - } -#endif -#ifdef CONFIG_MV643XX_ETH_2 - mv64340_dev2 = mv64340_eth_init(2); - if (!mv64340_dev2) { - printk(KERN_ERR - "Error registering MV-64360 ethernet port 2\n"); - } -#endif - return 0; + return rc; } /* @@ -1462,19 +1568,16 @@ */ static void __exit mv64340_cleanup_module(void) { - if (mv64340_dev2) - mv64340_eth_remove(mv64340_dev2); - if (mv64340_dev1) - mv64340_eth_remove(mv64340_dev1); - if (mv64340_dev0) - mv64340_eth_remove(mv64340_dev0); + driver_unregister(&mv643xx_eth_driver); + driver_unregister(&mv643xx_eth_shared_driver); } module_init(mv64340_init_module); module_exit(mv64340_cleanup_module); MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Rabeeh Khoury, Assaf Hoffman, Matthew Dharm and Manish Lachwani"); +MODULE_AUTHOR("Rabeeh Khoury, Assaf Hoffman, Matthew Dharm, Manish Lachwani" + " and Dale Farnsworth"); MODULE_DESCRIPTION("Ethernet driver for Marvell MV64340"); /* @@ -1605,12 +1708,6 @@ * port_sdma_config User port SDMA config value. * port_serial_control User port serial control value. * - * This driver introduce a set of default values: - * PORT_CONFIG_VALUE Default port configuration value - * PORT_CONFIG_EXTEND_VALUE Default port extend configuration value - * PORT_SDMA_CONFIG_VALUE Default sdma control value - * PORT_SERIAL_CONTROL_VALUE Default port serial control value - * * This driver data flow is done using the struct pkt_info which * is a unified struct for Rx and Tx operations: * @@ -1627,25 +1724,11 @@ #define ETH_ENABLE_TX_QUEUE(eth_port) \ MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(eth_port), 1) -#define ETH_DISABLE_TX_QUEUE(eth_port) \ - MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(eth_port), \ - (1 << 8)) - -#define ETH_ENABLE_RX_QUEUE(rx_queue, eth_port) \ - MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(eth_port), \ - (1 << rx_queue)) - -#define ETH_DISABLE_RX_QUEUE(rx_queue, eth_port) \ - MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(eth_port), \ - (1 << (8 + rx_queue))) - -#define LINK_UP_TIMEOUT 100000 -#define PHY_BUSY_TIMEOUT 10000000 - /* locals */ /* PHY routines */ static int ethernet_phy_get(unsigned int eth_port_num); +static void ethernet_phy_set(unsigned int eth_port_num, int phy_addr); /* Ethernet Port routines */ static int eth_port_uc_addr(unsigned int eth_port_num, unsigned char uc_nibble, @@ -1677,18 +1760,6 @@ */ static void eth_port_init(struct mv64340_private * mp) { - mp->port_config = PORT_CONFIG_VALUE; - mp->port_config_extend = PORT_CONFIG_EXTEND_VALUE; -#if defined(__BIG_ENDIAN) - mp->port_sdma_config = PORT_SDMA_CONFIG_VALUE; -#elif defined(__LITTLE_ENDIAN) - mp->port_sdma_config = PORT_SDMA_CONFIG_VALUE | - ETH_BLM_RX_NO_SWAP | ETH_BLM_TX_NO_SWAP; -#else -#error One of __LITTLE_ENDIAN or __BIG_ENDIAN must be defined! -#endif - mp->port_serial_control = PORT_SERIAL_CONTROL_VALUE; - mp->port_rx_queue_command = 0; mp->port_tx_queue_command = 0; @@ -1727,14 +1798,12 @@ * Ethernet port is ready to receive and transmit. * * RETURN: - * false if the port PHY is not up. - * true otherwise. + * None. */ -static int eth_port_start(struct mv64340_private *mp) +static void eth_port_start(struct mv64340_private *mp) { unsigned int eth_port_num = mp->port_num; int tx_curr_desc, rx_curr_desc; - unsigned int phy_reg_data; /* Assignment of Tx CTRP of given queue */ tx_curr_desc = mp->tx_curr_desc_q; @@ -1759,8 +1828,9 @@ MV_WRITE(MV64340_ETH_PORT_SERIAL_CONTROL_REG(eth_port_num), mp->port_serial_control); - MV_SET_REG_BITS(MV64340_ETH_PORT_SERIAL_CONTROL_REG(eth_port_num), - ETH_SERIAL_PORT_ENABLE); + MV_WRITE(MV64340_ETH_PORT_SERIAL_CONTROL_REG(eth_port_num), + MV_READ(MV64340_ETH_PORT_SERIAL_CONTROL_REG(eth_port_num)) | + MV64340_ETH_SERIAL_PORT_ENABLE); /* Assign port SDMA configuration */ MV_WRITE(MV64340_ETH_SDMA_CONFIG_REG(eth_port_num), @@ -1769,14 +1839,6 @@ /* Enable port Rx. */ MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(eth_port_num), mp->port_rx_queue_command); - - /* Check if link is up */ - eth_port_read_smi_reg(eth_port_num, 1, &phy_reg_data); - - if (!(phy_reg_data & 0x20)) - return 0; - - return 1; } /* @@ -1817,6 +1879,41 @@ } /* + * eth_port_uc_addr_get - This function retrieves the port Unicast address + * (MAC address) from the ethernet hw registers. + * + * DESCRIPTION: + * This function retrieves the port Ethernet MAC address. + * + * INPUT: + * unsigned int eth_port_num Port number. + * char *MacAddr pointer where the MAC address is stored + * + * OUTPUT: + * Copy the MAC address to the location pointed to by MacAddr + * + * RETURN: + * N/A. + * + */ +static void eth_port_uc_addr_get(struct net_device *dev, unsigned char *p_addr) +{ + struct mv64340_private *mp = netdev_priv(dev); + unsigned int mac_h; + unsigned int mac_l; + + mac_h = MV_READ(MV64340_ETH_MAC_ADDR_HIGH(mp->port_num)); + mac_l = MV_READ(MV64340_ETH_MAC_ADDR_LOW(mp->port_num)); + + p_addr[0] = (mac_h >> 24) & 0xff; + p_addr[1] = (mac_h >> 16) & 0xff; + p_addr[2] = (mac_h >> 8) & 0xff; + p_addr[3] = mac_h & 0xff; + p_addr[4] = (mac_l >> 8) & 0xff; + p_addr[5] = mac_l & 0xff; +} + +/* * eth_port_uc_addr - This function Set the port unicast address table * * DESCRIPTION: @@ -1975,41 +2072,57 @@ } /* + * ethernet_phy_set - Set the ethernet port PHY address. + * + * DESCRIPTION: + * This routine sets the given ethernet port PHY address. + * + * INPUT: + * unsigned int eth_port_num Ethernet Port number. + * int phy_addr PHY address. + * + * OUTPUT: + * None. + * + * RETURN: + * None. + * + */ +static void ethernet_phy_set(unsigned int eth_port_num, int phy_addr) +{ + u32 reg_data; + int addr_shift = 5 * eth_port_num; + + reg_data = MV_READ(MV64340_ETH_PHY_ADDR_REG); + reg_data &= ~(0x1f << addr_shift); + reg_data |= (phy_addr & 0x1f) << addr_shift; + MV_WRITE(MV64340_ETH_PHY_ADDR_REG, reg_data); +} + +/* * ethernet_phy_reset - Reset Ethernet port PHY. * * DESCRIPTION: - * This routine utilize the SMI interface to reset the ethernet port PHY. - * The routine waits until the link is up again or link up is timeout. + * This routine utilizes the SMI interface to reset the ethernet port PHY. * * INPUT: * unsigned int eth_port_num Ethernet Port number. * * OUTPUT: - * The ethernet port PHY renew its link. + * The PHY is reset. * * RETURN: * None. * */ -static int ethernet_phy_reset(unsigned int eth_port_num) +static void ethernet_phy_reset(unsigned int eth_port_num) { - unsigned int time_out = 50; unsigned int phy_reg_data; /* Reset the PHY */ eth_port_read_smi_reg(eth_port_num, 0, &phy_reg_data); phy_reg_data |= 0x8000; /* Set bit 15 to reset the PHY */ eth_port_write_smi_reg(eth_port_num, 0, phy_reg_data); - - /* Poll on the PHY LINK */ - do { - eth_port_read_smi_reg(eth_port_num, 1, &phy_reg_data); - - if (time_out-- == 0) - return 0; - } while (!(phy_reg_data & 0x20)); - - return 1; } /* @@ -2030,62 +2143,48 @@ * None. * */ -static void eth_port_reset(unsigned int eth_port_num) +static void eth_port_reset(unsigned int port_num) { unsigned int reg_data; /* Stop Tx port activity. Check port Tx activity. */ - reg_data = - MV_READ(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(eth_port_num)); + reg_data = MV_READ(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(port_num)); if (reg_data & 0xFF) { /* Issue stop command for active channels only */ - MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG - (eth_port_num), (reg_data << 8)); + MV_WRITE(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(port_num), + (reg_data << 8)); /* Wait for all Tx activity to terminate. */ - do { - /* Check port cause register that all Tx queues are stopped */ - reg_data = - MV_READ - (MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG - (eth_port_num)); - } - while (reg_data & 0xFF); + /* Check port cause register that all Tx queues are stopped */ + while (MV_READ(MV64340_ETH_TRANSMIT_QUEUE_COMMAND_REG(port_num)) + & 0xFF) + udelay(10); } /* Stop Rx port activity. Check port Rx activity. */ - reg_data = - MV_READ(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG - (eth_port_num)); + reg_data = MV_READ(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(port_num)); if (reg_data & 0xFF) { /* Issue stop command for active channels only */ - MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG - (eth_port_num), (reg_data << 8)); + MV_WRITE(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(port_num), + (reg_data << 8)); /* Wait for all Rx activity to terminate. */ - do { - /* Check port cause register that all Rx queues are stopped */ - reg_data = - MV_READ - (MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG - (eth_port_num)); - } - while (reg_data & 0xFF); + /* Check port cause register that all Rx queues are stopped */ + while (MV_READ(MV64340_ETH_RECEIVE_QUEUE_COMMAND_REG(port_num)) + & 0xFF) + udelay(10); } /* Clear all MIB counters */ - eth_clear_mib_counters(eth_port_num); + eth_clear_mib_counters(port_num); /* Reset the Enable bit in the Configuration Register */ - reg_data = - MV_READ(MV64340_ETH_PORT_SERIAL_CONTROL_REG (eth_port_num)); - reg_data &= ~ETH_SERIAL_PORT_ENABLE; - MV_WRITE(MV64340_ETH_PORT_SERIAL_CONTROL_REG(eth_port_num), reg_data); - - return; + reg_data = MV_READ(MV64340_ETH_PORT_SERIAL_CONTROL_REG(port_num)); + reg_data &= ~MV64340_ETH_SERIAL_PORT_ENABLE; + MV_WRITE(MV64340_ETH_PORT_SERIAL_CONTROL_REG(port_num), reg_data); } /* @@ -2119,6 +2218,23 @@ eth_config_reg); } +static int eth_port_link_is_up(unsigned int eth_port_num) +{ + unsigned int phy_reg_data0; + unsigned int phy_reg_data1; + + eth_port_read_smi_reg(eth_port_num, 0, &phy_reg_data0); + eth_port_read_smi_reg(eth_port_num, 1, &phy_reg_data1); + + if (phy_reg_data0 & 0x1000) { /* auto-neg supported? */ + if (phy_reg_data1 & 0x20) /* auto-neg complete */ + return 1; + } else + if (phy_reg_data1 & 0x4) /* link up */ + return 1; + return 0; +} + /* * ethernet_get_config_reg - Get the port configuration register * @@ -2144,7 +2260,6 @@ return eth_config_reg; } - /* * eth_port_read_smi_reg - Read PHY registers * @@ -2153,7 +2268,7 @@ * order to perform PHY register read. * * INPUT: - * unsigned int eth_port_num Ethernet Port number. + * unsigned int port_num Ethernet Port number. * unsigned int phy_reg PHY register address offset. * unsigned int *value Register value buffer. * @@ -2165,41 +2280,41 @@ * true otherwise. * */ -static int eth_port_read_smi_reg(unsigned int eth_port_num, +static void eth_port_read_smi_reg(unsigned int port_num, unsigned int phy_reg, unsigned int *value) { - int phy_addr = ethernet_phy_get(eth_port_num); - unsigned int time_out = PHY_BUSY_TIMEOUT; - unsigned int reg_value; - - /* first check that it is not busy */ - do { - reg_value = MV_READ(MV64340_ETH_SMI_REG); - if (time_out-- == 0) - return 0; - } while (reg_value & ETH_SMI_BUSY); + int phy_addr = ethernet_phy_get(port_num); + unsigned long flags; + int i; + + /* the SMI register is a shared resource */ + spin_lock_irqsave(&mv64340_eth_phy_lock, flags); - /* not busy */ + /* wait for the SMI register to become available */ + for (i = 0; MV_READ(MV64340_ETH_SMI_REG) & ETH_SMI_BUSY; i++) { + if (i == PHY_WAIT_ITERATIONS) { + printk("mv64340 PHY busy timeout, port %d\n", port_num); + goto out; + } + udelay(PHY_WAIT_MICRO_SECONDS); + } MV_WRITE(MV64340_ETH_SMI_REG, (phy_addr << 16) | (phy_reg << 21) | ETH_SMI_OPCODE_READ); - time_out = PHY_BUSY_TIMEOUT; /* initialize the time out var again */ - - do { - reg_value = MV_READ(MV64340_ETH_SMI_REG); - if (time_out-- == 0) - return 0; - } while (reg_value & ETH_SMI_READ_VALID); - - /* Wait for the data to update in the SMI register */ - for (time_out = 0; time_out < PHY_BUSY_TIMEOUT; time_out++); - - reg_value = MV_READ(MV64340_ETH_SMI_REG); - - *value = reg_value & 0xffff; + /* now wait for the data to be valid */ + for (i = 0; !(MV_READ(MV64340_ETH_SMI_REG) & ETH_SMI_READ_VALID); i++) { + if (i == PHY_WAIT_ITERATIONS) { + printk("mv64340 PHY read timeout, port %d\n", port_num); + goto out; + } + udelay(PHY_WAIT_MICRO_SECONDS); + } + + *value = MV_READ(MV64340_ETH_SMI_REG) & 0xffff; - return 1; +out: + spin_unlock_irqrestore(&mv64340_eth_phy_lock, flags); } /* @@ -2222,27 +2337,32 @@ * true otherwise. * */ -static int eth_port_write_smi_reg(unsigned int eth_port_num, +static void eth_port_write_smi_reg(unsigned int eth_port_num, unsigned int phy_reg, unsigned int value) { - unsigned int time_out = PHY_BUSY_TIMEOUT; - unsigned int reg_value; int phy_addr; + int i; + unsigned long flags; phy_addr = ethernet_phy_get(eth_port_num); - /* first check that it is not busy */ - do { - reg_value = MV_READ(MV64340_ETH_SMI_REG); - if (time_out-- == 0) - return 0; - } while (reg_value & ETH_SMI_BUSY); + /* the SMI register is a shared resource */ + spin_lock_irqsave(&mv64340_eth_phy_lock, flags); + + /* wait for the SMI register to become available */ + for (i = 0; MV_READ(MV64340_ETH_SMI_REG) & ETH_SMI_BUSY; i++) { + if (i == PHY_WAIT_ITERATIONS) { + printk("mv64340 PHY busy timeout, port %d\n", + eth_port_num); + goto out; + } + udelay(PHY_WAIT_MICRO_SECONDS); + } - /* not busy */ MV_WRITE(MV64340_ETH_SMI_REG, (phy_addr << 16) | (phy_reg << 21) | ETH_SMI_OPCODE_WRITE | (value & 0xffff)); - - return 1; +out: + spin_unlock_irqrestore(&mv64340_eth_phy_lock, flags); } /* @@ -2280,84 +2400,60 @@ struct pkt_info * p_pkt_info) { int tx_desc_curr, tx_desc_used, tx_first_desc, tx_next_desc; - volatile struct eth_tx_desc *current_descriptor; - volatile struct eth_tx_desc *first_descriptor; - u32 command_status, first_chip_ptr; + struct eth_tx_desc *current_descriptor; + struct eth_tx_desc *first_descriptor; + u32 command; /* Do not process Tx ring in case of Tx ring resource error */ if (mp->tx_resource_err) return ETH_QUEUE_FULL; + /* + * The hardware requires that each buffer that is <= 8 bytes + * in length must be aligned on an 8 byte boundary. + */ + if (p_pkt_info->byte_cnt <= 8 && p_pkt_info->buf_ptr & 0x7) { + printk(KERN_ERR + "mv64340_eth port %d: packet size <= 8 problem\n", + mp->port_num); + return ETH_ERROR; + } + /* Get the Tx Desc ring indexes */ tx_desc_curr = mp->tx_curr_desc_q; tx_desc_used = mp->tx_used_desc_q; current_descriptor = &mp->p_tx_desc_area[tx_desc_curr]; - if (current_descriptor == NULL) - return ETH_ERROR; - tx_next_desc = (tx_desc_curr + 1) % MV64340_TX_QUEUE_SIZE; - command_status = p_pkt_info->cmd_sts | ETH_ZERO_PADDING | ETH_GEN_CRC; + tx_next_desc = (tx_desc_curr + 1) % mp->tx_ring_size; - if (command_status & ETH_TX_FIRST_DESC) { + current_descriptor->buf_ptr = p_pkt_info->buf_ptr; + current_descriptor->byte_cnt = p_pkt_info->byte_cnt; + current_descriptor->l4i_chk = p_pkt_info->l4i_chk; + mp->tx_skb[tx_desc_curr] = p_pkt_info->return_info; + + command = p_pkt_info->cmd_sts | ETH_ZERO_PADDING | ETH_GEN_CRC | + ETH_BUFFER_OWNED_BY_DMA; + if (command & ETH_TX_LAST_DESC) + command |= ETH_TX_ENABLE_INTERRUPT; + + if (command & ETH_TX_FIRST_DESC) { tx_first_desc = tx_desc_curr; mp->tx_first_desc_q = tx_first_desc; - - /* fill first descriptor */ - first_descriptor = &mp->p_tx_desc_area[tx_desc_curr]; - first_descriptor->l4i_chk = p_pkt_info->l4i_chk; - first_descriptor->cmd_sts = command_status; - first_descriptor->byte_cnt = p_pkt_info->byte_cnt; - first_descriptor->buf_ptr = p_pkt_info->buf_ptr; - first_descriptor->next_desc_ptr = mp->tx_desc_dma + - tx_next_desc * sizeof(struct eth_tx_desc); - wmb(); + first_descriptor = current_descriptor; + mp->tx_first_command = command; } else { tx_first_desc = mp->tx_first_desc_q; first_descriptor = &mp->p_tx_desc_area[tx_first_desc]; - if (first_descriptor == NULL) { - printk("First desc is NULL !!\n"); - return ETH_ERROR; - } - if (command_status & ETH_TX_LAST_DESC) - current_descriptor->next_desc_ptr = 0x00000000; - else { - command_status |= ETH_BUFFER_OWNED_BY_DMA; - current_descriptor->next_desc_ptr = mp->tx_desc_dma + - tx_next_desc * sizeof(struct eth_tx_desc); - } - } - - if (p_pkt_info->byte_cnt < 8) { - printk(" < 8 problem \n"); - return ETH_ERROR; + BUG_ON(first_descriptor == NULL); + current_descriptor->cmd_sts = command; } - current_descriptor->buf_ptr = p_pkt_info->buf_ptr; - current_descriptor->byte_cnt = p_pkt_info->byte_cnt; - current_descriptor->l4i_chk = p_pkt_info->l4i_chk; - current_descriptor->cmd_sts = command_status; - - mp->tx_skb[tx_desc_curr] = (struct sk_buff*) p_pkt_info->return_info; - - wmb(); - - /* Set last desc with DMA ownership and interrupt enable. */ - if (command_status & ETH_TX_LAST_DESC) { - current_descriptor->cmd_sts = command_status | - ETH_TX_ENABLE_INTERRUPT | - ETH_BUFFER_OWNED_BY_DMA; - - if (!(command_status & ETH_TX_FIRST_DESC)) - first_descriptor->cmd_sts |= ETH_BUFFER_OWNED_BY_DMA; + if (command & ETH_TX_LAST_DESC) { + wmb(); + first_descriptor->cmd_sts = mp->tx_first_command; + wmb(); - - first_chip_ptr = MV_READ(MV64340_ETH_CURRENT_SERVED_TX_DESC_PTR(mp->port_num)); - - /* Apply send command */ - if (first_chip_ptr == 0x00000000) - MV_WRITE(MV64340_ETH_TX_CURRENT_QUEUE_DESC_PTR_0(mp->port_num), (struct eth_tx_desc *) mp->tx_desc_dma + tx_first_desc); - ETH_ENABLE_TX_QUEUE(mp->port_num); /* @@ -2365,11 +2461,6 @@ * error */ tx_first_desc = tx_next_desc; mp->tx_first_desc_q = tx_first_desc; - } else { - if (! (command_status & ETH_TX_FIRST_DESC) ) { - current_descriptor->cmd_sts = command_status; - wmb(); - } } /* Check for ring index overlap in the Tx desc ring */ @@ -2381,7 +2472,6 @@ } mp->tx_curr_desc_q = tx_next_desc; - wmb(); return ETH_OK; } @@ -2391,7 +2481,7 @@ { int tx_desc_curr; int tx_desc_used; - volatile struct eth_tx_desc* current_descriptor; + struct eth_tx_desc *current_descriptor; unsigned int command_status; /* Do not process Tx ring in case of Tx ring resource error */ @@ -2403,36 +2493,21 @@ tx_desc_used = mp->tx_used_desc_q; current_descriptor = &mp->p_tx_desc_area[tx_desc_curr]; - if (current_descriptor == NULL) - return ETH_ERROR; - command_status = p_pkt_info->cmd_sts | ETH_ZERO_PADDING | ETH_GEN_CRC; - -/* XXX Is this for real ?!?!? */ - /* Buffers with a payload smaller than 8 bytes must be aligned to a - * 64-bit boundary. We use the memory allocated for Tx descriptor. - * This memory is located in TX_BUF_OFFSET_IN_DESC offset within the - * Tx descriptor. */ - if (p_pkt_info->byte_cnt <= 8) { - printk(KERN_ERR - "You have failed in the < 8 bytes errata - fixme\n"); - return ETH_ERROR; - } current_descriptor->buf_ptr = p_pkt_info->buf_ptr; current_descriptor->byte_cnt = p_pkt_info->byte_cnt; - mp->tx_skb[tx_desc_curr] = (struct sk_buff *) p_pkt_info->return_info; - - mb(); + mp->tx_skb[tx_desc_curr] = p_pkt_info->return_info; /* Set last desc with DMA ownership and interrupt enable. */ + wmb(); current_descriptor->cmd_sts = command_status | ETH_BUFFER_OWNED_BY_DMA | ETH_TX_ENABLE_INTERRUPT; - /* Apply send command */ + wmb(); ETH_ENABLE_TX_QUEUE(mp->port_num); /* Finish Tx packet. Update first desc in case of Tx resource error */ - tx_desc_curr = (tx_desc_curr + 1) % MV64340_TX_QUEUE_SIZE; + tx_desc_curr = (tx_desc_curr + 1) % mp->tx_ring_size; /* Update the current descriptor */ mp->tx_curr_desc_q = tx_desc_curr; @@ -2474,40 +2549,33 @@ static ETH_FUNC_RET_STATUS eth_tx_return_desc(struct mv64340_private * mp, struct pkt_info * p_pkt_info) { - int tx_desc_used, tx_desc_curr; + int tx_desc_used; #ifdef MV64340_CHECKSUM_OFFLOAD_TX - int tx_first_desc; + int tx_busy_desc = mp->tx_first_desc_q; +#else + int tx_busy_desc = mp->tx_curr_desc_q; #endif - volatile struct eth_tx_desc *p_tx_desc_used; + struct eth_tx_desc *p_tx_desc_used; unsigned int command_status; /* Get the Tx Desc ring indexes */ - tx_desc_curr = mp->tx_curr_desc_q; tx_desc_used = mp->tx_used_desc_q; -#ifdef MV64340_CHECKSUM_OFFLOAD_TX - tx_first_desc = mp->tx_first_desc_q; -#endif + p_tx_desc_used = &mp->p_tx_desc_area[tx_desc_used]; - /* XXX Sanity check */ + /* Sanity check */ if (p_tx_desc_used == NULL) return ETH_ERROR; + /* Stop release. About to overlap the current available Tx descriptor */ + if (tx_desc_used == tx_busy_desc && !mp->tx_resource_err) + return ETH_END_OF_JOB; + command_status = p_tx_desc_used->cmd_sts; /* Still transmitting... */ -#ifndef MV64340_CHECKSUM_OFFLOAD_TX if (command_status & (ETH_BUFFER_OWNED_BY_DMA)) return ETH_RETRY; -#endif - /* Stop release. About to overlap the current available Tx descriptor */ -#ifdef MV64340_CHECKSUM_OFFLOAD_TX - if (tx_desc_used == tx_first_desc && !mp->tx_resource_err) - return ETH_END_OF_JOB; -#else - if (tx_desc_used == tx_desc_curr && !mp->tx_resource_err) - return ETH_END_OF_JOB; -#endif /* Pass the packet information to the caller */ p_pkt_info->cmd_sts = command_status; @@ -2515,7 +2583,7 @@ mp->tx_skb[tx_desc_used] = NULL; /* Update the next descriptor to release. */ - mp->tx_used_desc_q = (tx_desc_used + 1) % MV64340_TX_QUEUE_SIZE; + mp->tx_used_desc_q = (tx_desc_used + 1) % mp->tx_ring_size; /* Any Tx return cancels the Tx resource error status */ mp->tx_resource_err = 0; @@ -2565,6 +2633,7 @@ /* The following parameters are used to save readings from memory */ command_status = p_rx_desc->cmd_sts; + rmb(); /* Nothing to receive... */ if (command_status & (ETH_BUFFER_OWNED_BY_DMA)) @@ -2581,14 +2650,13 @@ mp->rx_skb[rx_curr_desc] = NULL; /* Update current index in data structure */ - rx_next_curr_desc = (rx_curr_desc + 1) % MV64340_RX_QUEUE_SIZE; + rx_next_curr_desc = (rx_curr_desc + 1) % mp->rx_ring_size; mp->rx_curr_desc_q = rx_next_curr_desc; /* Rx descriptors exhausted. Set the Rx ring resource error flag */ if (rx_next_curr_desc == rx_used_desc) mp->rx_resource_err = 1; - mb(); return ETH_OK; } @@ -2627,17 +2695,15 @@ mp->rx_skb[used_rx_desc] = p_pkt_info->return_info; /* Flush the write pipe */ - mb(); /* Return the descriptor to DMA ownership */ + wmb(); p_used_rx_desc->cmd_sts = ETH_BUFFER_OWNED_BY_DMA | ETH_RX_ENABLE_INTERRUPT; - - /* Flush descriptor and CPU pipe */ - mb(); + wmb(); /* Move the used descriptor pointer to the next descriptor */ - mp->rx_used_desc_q = (used_rx_desc + 1) % MV64340_RX_QUEUE_SIZE; + mp->rx_used_desc_q = (used_rx_desc + 1) % mp->rx_ring_size; /* Any Rx return cancels the Rx resource error status */ mp->rx_resource_err = 0; diff -Nru a/drivers/net/mv643xx_eth.h b/drivers/net/mv643xx_eth.h --- a/drivers/net/mv643xx_eth.h 2005-01-17 11:22:12 -07:00 +++ b/drivers/net/mv643xx_eth.h 2005-01-17 11:22:12 -07:00 @@ -46,15 +46,12 @@ * The first part is the high level driver of the gigE ethernet ports. */ -#define ETH_PORT0_IRQ_NUM 48 /* main high register, bit0 */ -#define ETH_PORT1_IRQ_NUM ETH_PORT0_IRQ_NUM+1 /* main high register, bit1 */ -#define ETH_PORT2_IRQ_NUM ETH_PORT0_IRQ_NUM+2 /* main high register, bit1 */ - /* Checksum offload for Tx works */ -#define MV64340_CHECKSUM_OFFLOAD_TX -#define MV64340_NAPI -#define MV64340_TX_FAST_REFILL -#undef MV64340_COAL +#define MV64340_CHECKSUM_OFFLOAD_TX +#define MV64340_NAPI +#define MV64340_TX_FAST_REFILL +#undef MV64340_RX_QUEUE_FILL_ON_TASK /* Does not work, yet */ +#undef MV64340_COAL /* * Number of RX / TX descriptors on RX / TX rings. @@ -65,10 +62,10 @@ */ /* Default TX ring size is 1000 descriptors */ -#define MV64340_TX_QUEUE_SIZE 1000 +#define MV64340_DEFAULT_TX_QUEUE_SIZE 1000 /* Default RX ring size is 400 descriptors */ -#define MV64340_RX_QUEUE_SIZE 400 +#define MV64340_DEFAULT_RX_QUEUE_SIZE 400 #define MV64340_TX_COAL 100 #ifdef MV64340_COAL @@ -93,58 +90,6 @@ * */ -/* Default port configuration value */ -#define PORT_CONFIG_VALUE \ - ETH_UNICAST_NORMAL_MODE | \ - ETH_DEFAULT_RX_QUEUE_0 | \ - ETH_DEFAULT_RX_ARP_QUEUE_0 | \ - ETH_RECEIVE_BC_IF_NOT_IP_OR_ARP | \ - ETH_RECEIVE_BC_IF_IP | \ - ETH_RECEIVE_BC_IF_ARP | \ - ETH_CAPTURE_TCP_FRAMES_DIS | \ - ETH_CAPTURE_UDP_FRAMES_DIS | \ - ETH_DEFAULT_RX_TCP_QUEUE_0 | \ - ETH_DEFAULT_RX_UDP_QUEUE_0 | \ - ETH_DEFAULT_RX_BPDU_QUEUE_0 - -/* Default port extend configuration value */ -#define PORT_CONFIG_EXTEND_VALUE \ - ETH_SPAN_BPDU_PACKETS_AS_NORMAL | \ - ETH_PARTITION_DISABLE - - -/* Default sdma control value */ -#define PORT_SDMA_CONFIG_VALUE \ - ETH_RX_BURST_SIZE_16_64BIT | \ - GT_ETH_IPG_INT_RX(0) | \ - ETH_TX_BURST_SIZE_16_64BIT; - -#define GT_ETH_IPG_INT_RX(value) \ - ((value & 0x3fff) << 8) - -/* Default port serial control value */ -#define PORT_SERIAL_CONTROL_VALUE \ - ETH_FORCE_LINK_PASS | \ - ETH_ENABLE_AUTO_NEG_FOR_DUPLX | \ - ETH_DISABLE_AUTO_NEG_FOR_FLOW_CTRL | \ - ETH_ADV_SYMMETRIC_FLOW_CTRL | \ - ETH_FORCE_FC_MODE_NO_PAUSE_DIS_TX | \ - ETH_FORCE_BP_MODE_NO_JAM | \ - BIT9 | \ - ETH_DO_NOT_FORCE_LINK_FAIL | \ - ETH_RETRANSMIT_16_ATTEMPTS | \ - ETH_ENABLE_AUTO_NEG_SPEED_GMII | \ - ETH_DTE_ADV_0 | \ - ETH_DISABLE_AUTO_NEG_BYPASS | \ - ETH_AUTO_NEG_NO_CHANGE | \ - ETH_MAX_RX_PACKET_9700BYTE | \ - ETH_CLR_EXT_LOOPBACK | \ - ETH_SET_FULL_DUPLEX_MODE | \ - ETH_ENABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX - -#define RX_BUFFER_MAX_SIZE 0x4000000 -#define TX_BUFFER_MAX_SIZE 0x4000000 - /* MAC accepet/reject macros */ #define ACCEPT_MAC_ADDR 0 #define REJECT_MAC_ADDR 1 @@ -211,156 +156,12 @@ #define ETH_PORT_TX_FIFO_EMPTY BIT10 -/* These macros describes the Port configuration reg (Px_cR) bits */ -#define ETH_UNICAST_NORMAL_MODE 0 -#define ETH_UNICAST_PROMISCUOUS_MODE BIT0 -#define ETH_DEFAULT_RX_QUEUE_0 0 -#define ETH_DEFAULT_RX_QUEUE_1 BIT1 -#define ETH_DEFAULT_RX_QUEUE_2 BIT2 -#define ETH_DEFAULT_RX_QUEUE_3 (BIT2 | BIT1) -#define ETH_DEFAULT_RX_QUEUE_4 BIT3 -#define ETH_DEFAULT_RX_QUEUE_5 (BIT3 | BIT1) -#define ETH_DEFAULT_RX_QUEUE_6 (BIT3 | BIT2) -#define ETH_DEFAULT_RX_QUEUE_7 (BIT3 | BIT2 | BIT1) -#define ETH_DEFAULT_RX_ARP_QUEUE_0 0 -#define ETH_DEFAULT_RX_ARP_QUEUE_1 BIT4 -#define ETH_DEFAULT_RX_ARP_QUEUE_2 BIT5 -#define ETH_DEFAULT_RX_ARP_QUEUE_3 (BIT5 | BIT4) -#define ETH_DEFAULT_RX_ARP_QUEUE_4 BIT6 -#define ETH_DEFAULT_RX_ARP_QUEUE_5 (BIT6 | BIT4) -#define ETH_DEFAULT_RX_ARP_QUEUE_6 (BIT6 | BIT5) -#define ETH_DEFAULT_RX_ARP_QUEUE_7 (BIT6 | BIT5 | BIT4) -#define ETH_RECEIVE_BC_IF_NOT_IP_OR_ARP 0 -#define ETH_REJECT_BC_IF_NOT_IP_OR_ARP BIT7 -#define ETH_RECEIVE_BC_IF_IP 0 -#define ETH_REJECT_BC_IF_IP BIT8 -#define ETH_RECEIVE_BC_IF_ARP 0 -#define ETH_REJECT_BC_IF_ARP BIT9 -#define ETH_TX_AM_NO_UPDATE_ERROR_SUMMARY BIT12 -#define ETH_CAPTURE_TCP_FRAMES_DIS 0 -#define ETH_CAPTURE_TCP_FRAMES_EN BIT14 -#define ETH_CAPTURE_UDP_FRAMES_DIS 0 -#define ETH_CAPTURE_UDP_FRAMES_EN BIT15 -#define ETH_DEFAULT_RX_TCP_QUEUE_0 0 -#define ETH_DEFAULT_RX_TCP_QUEUE_1 BIT16 -#define ETH_DEFAULT_RX_TCP_QUEUE_2 BIT17 -#define ETH_DEFAULT_RX_TCP_QUEUE_3 (BIT17 | BIT16) -#define ETH_DEFAULT_RX_TCP_QUEUE_4 BIT18 -#define ETH_DEFAULT_RX_TCP_QUEUE_5 (BIT18 | BIT16) -#define ETH_DEFAULT_RX_TCP_QUEUE_6 (BIT18 | BIT17) -#define ETH_DEFAULT_RX_TCP_QUEUE_7 (BIT18 | BIT17 | BIT16) -#define ETH_DEFAULT_RX_UDP_QUEUE_0 0 -#define ETH_DEFAULT_RX_UDP_QUEUE_1 BIT19 -#define ETH_DEFAULT_RX_UDP_QUEUE_2 BIT20 -#define ETH_DEFAULT_RX_UDP_QUEUE_3 (BIT20 | BIT19) -#define ETH_DEFAULT_RX_UDP_QUEUE_4 (BIT21 -#define ETH_DEFAULT_RX_UDP_QUEUE_5 (BIT21 | BIT19) -#define ETH_DEFAULT_RX_UDP_QUEUE_6 (BIT21 | BIT20) -#define ETH_DEFAULT_RX_UDP_QUEUE_7 (BIT21 | BIT20 | BIT19) -#define ETH_DEFAULT_RX_BPDU_QUEUE_0 0 -#define ETH_DEFAULT_RX_BPDU_QUEUE_1 BIT22 -#define ETH_DEFAULT_RX_BPDU_QUEUE_2 BIT23 #define ETH_DEFAULT_RX_BPDU_QUEUE_3 (BIT23 | BIT22) #define ETH_DEFAULT_RX_BPDU_QUEUE_4 BIT24 #define ETH_DEFAULT_RX_BPDU_QUEUE_5 (BIT24 | BIT22) #define ETH_DEFAULT_RX_BPDU_QUEUE_6 (BIT24 | BIT23) #define ETH_DEFAULT_RX_BPDU_QUEUE_7 (BIT24 | BIT23 | BIT22) - -/* These macros describes the Port configuration extend reg (Px_cXR) bits*/ -#define ETH_CLASSIFY_EN BIT0 -#define ETH_SPAN_BPDU_PACKETS_AS_NORMAL 0 -#define ETH_SPAN_BPDU_PACKETS_TO_RX_QUEUE_7 BIT1 -#define ETH_PARTITION_DISABLE 0 -#define ETH_PARTITION_ENABLE BIT2 - - -/* Tx/Rx queue command reg (RQCR/TQCR)*/ -#define ETH_QUEUE_0_ENABLE BIT0 -#define ETH_QUEUE_1_ENABLE BIT1 -#define ETH_QUEUE_2_ENABLE BIT2 -#define ETH_QUEUE_3_ENABLE BIT3 -#define ETH_QUEUE_4_ENABLE BIT4 -#define ETH_QUEUE_5_ENABLE BIT5 -#define ETH_QUEUE_6_ENABLE BIT6 -#define ETH_QUEUE_7_ENABLE BIT7 -#define ETH_QUEUE_0_DISABLE BIT8 -#define ETH_QUEUE_1_DISABLE BIT9 -#define ETH_QUEUE_2_DISABLE BIT10 -#define ETH_QUEUE_3_DISABLE BIT11 -#define ETH_QUEUE_4_DISABLE BIT12 -#define ETH_QUEUE_5_DISABLE BIT13 -#define ETH_QUEUE_6_DISABLE BIT14 -#define ETH_QUEUE_7_DISABLE BIT15 - - -/* These macros describes the Port Sdma configuration reg (SDCR) bits */ -#define ETH_RIFB BIT0 -#define ETH_RX_BURST_SIZE_1_64BIT 0 -#define ETH_RX_BURST_SIZE_2_64BIT BIT1 -#define ETH_RX_BURST_SIZE_4_64BIT BIT2 -#define ETH_RX_BURST_SIZE_8_64BIT (BIT2 | BIT1) -#define ETH_RX_BURST_SIZE_16_64BIT BIT3 -#define ETH_BLM_RX_NO_SWAP BIT4 -#define ETH_BLM_RX_BYTE_SWAP 0 -#define ETH_BLM_TX_NO_SWAP BIT5 -#define ETH_BLM_TX_BYTE_SWAP 0 -#define ETH_DESCRIPTORS_BYTE_SWAP BIT6 -#define ETH_DESCRIPTORS_NO_SWAP 0 -#define ETH_TX_BURST_SIZE_1_64BIT 0 -#define ETH_TX_BURST_SIZE_2_64BIT BIT22 -#define ETH_TX_BURST_SIZE_4_64BIT BIT23 -#define ETH_TX_BURST_SIZE_8_64BIT (BIT23 | BIT22) -#define ETH_TX_BURST_SIZE_16_64BIT BIT24 - - - -/* These macros describes the Port serial control reg (PSCR) bits */ -#define ETH_SERIAL_PORT_DISABLE 0 -#define ETH_SERIAL_PORT_ENABLE BIT0 -#define ETH_FORCE_LINK_PASS BIT1 -#define ETH_DO_NOT_FORCE_LINK_PASS 0 -#define ETH_ENABLE_AUTO_NEG_FOR_DUPLX 0 -#define ETH_DISABLE_AUTO_NEG_FOR_DUPLX BIT2 -#define ETH_ENABLE_AUTO_NEG_FOR_FLOW_CTRL 0 -#define ETH_DISABLE_AUTO_NEG_FOR_FLOW_CTRL BIT3 -#define ETH_ADV_NO_FLOW_CTRL 0 -#define ETH_ADV_SYMMETRIC_FLOW_CTRL BIT4 -#define ETH_FORCE_FC_MODE_NO_PAUSE_DIS_TX 0 -#define ETH_FORCE_FC_MODE_TX_PAUSE_DIS BIT5 -#define ETH_FORCE_BP_MODE_NO_JAM 0 -#define ETH_FORCE_BP_MODE_JAM_TX BIT7 -#define ETH_FORCE_BP_MODE_JAM_TX_ON_RX_ERR BIT8 -#define ETH_FORCE_LINK_FAIL 0 -#define ETH_DO_NOT_FORCE_LINK_FAIL BIT10 -#define ETH_RETRANSMIT_16_ATTEMPTS 0 -#define ETH_RETRANSMIT_FOREVER BIT11 -#define ETH_DISABLE_AUTO_NEG_SPEED_GMII BIT13 -#define ETH_ENABLE_AUTO_NEG_SPEED_GMII 0 -#define ETH_DTE_ADV_0 0 -#define ETH_DTE_ADV_1 BIT14 -#define ETH_DISABLE_AUTO_NEG_BYPASS 0 -#define ETH_ENABLE_AUTO_NEG_BYPASS BIT15 -#define ETH_AUTO_NEG_NO_CHANGE 0 -#define ETH_RESTART_AUTO_NEG BIT16 -#define ETH_MAX_RX_PACKET_1518BYTE 0 -#define ETH_MAX_RX_PACKET_1522BYTE BIT17 -#define ETH_MAX_RX_PACKET_1552BYTE BIT18 -#define ETH_MAX_RX_PACKET_9022BYTE (BIT18 | BIT17) -#define ETH_MAX_RX_PACKET_9192BYTE BIT19 -#define ETH_MAX_RX_PACKET_9700BYTE (BIT19 | BIT17) -#define ETH_SET_EXT_LOOPBACK BIT20 -#define ETH_CLR_EXT_LOOPBACK 0 -#define ETH_SET_FULL_DUPLEX_MODE BIT21 -#define ETH_SET_HALF_DUPLEX_MODE 0 -#define ETH_ENABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX BIT22 -#define ETH_DISABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX 0 -#define ETH_SET_GMII_SPEED_TO_10_100 0 -#define ETH_SET_GMII_SPEED_TO_1000 BIT23 -#define ETH_SET_MII_SPEED_TO_10 0 -#define ETH_SET_MII_SPEED_TO_100 BIT24 - - /* SMI reg */ #define ETH_SMI_BUSY BIT28 /* 0 - Write, 1 - Read */ #define ETH_SMI_READ_VALID BIT27 /* 0 - Write, 1 - Read */ @@ -499,6 +300,11 @@ u32 port_tx_queue_command; /* Port active Tx queues summary */ u32 port_rx_queue_command; /* Port active Rx queues summary */ + u32 rx_sram_addr; /* Base address of rx sram area */ + u32 rx_sram_size; /* Size of rx sram area */ + u32 tx_sram_addr; /* Base address of tx sram area */ + u32 tx_sram_size; /* Size of tx sram area */ + int rx_resource_err; /* Rx ring resource error flag */ int tx_resource_err; /* Tx ring resource error flag */ @@ -511,21 +317,22 @@ int tx_curr_desc_q, tx_used_desc_q; #ifdef MV64340_CHECKSUM_OFFLOAD_TX int tx_first_desc_q; + u32 tx_first_command; #endif #ifdef MV64340_TX_FAST_REFILL u32 tx_clean_threshold; #endif - volatile struct eth_rx_desc * p_rx_desc_area; + struct eth_rx_desc * p_rx_desc_area; dma_addr_t rx_desc_dma; unsigned int rx_desc_area_size; - struct sk_buff * rx_skb[MV64340_RX_QUEUE_SIZE]; + struct sk_buff ** rx_skb; - volatile struct eth_tx_desc * p_tx_desc_area; + struct eth_tx_desc * p_tx_desc_area; dma_addr_t tx_desc_dma; unsigned int tx_desc_area_size; - struct sk_buff * tx_skb[MV64340_TX_QUEUE_SIZE]; + struct sk_buff ** tx_skb; struct work_struct tx_timeout_task; @@ -565,7 +372,7 @@ /* Port operation control routines */ static void eth_port_init(struct mv64340_private *mp); static void eth_port_reset(unsigned int eth_port_num); -static int eth_port_start(struct mv64340_private *mp); +static void eth_port_start(struct mv64340_private *mp); static void ethernet_set_config_reg(unsigned int eth_port_num, unsigned int value); @@ -576,13 +383,13 @@ unsigned char *p_addr); /* PHY and MIB routines */ -static int ethernet_phy_reset(unsigned int eth_port_num); +static void ethernet_phy_reset(unsigned int eth_port_num); -static int eth_port_write_smi_reg(unsigned int eth_port_num, +static void eth_port_write_smi_reg(unsigned int eth_port_num, unsigned int phy_reg, unsigned int value); -static int eth_port_read_smi_reg(unsigned int eth_port_num, +static void eth_port_read_smi_reg(unsigned int eth_port_num, unsigned int phy_reg, unsigned int *value); diff -Nru a/include/linux/mv643xx.h b/include/linux/mv643xx.h --- a/include/linux/mv643xx.h 2005-01-17 11:22:12 -07:00 +++ b/include/linux/mv643xx.h 2005-01-17 11:22:12 -07:00 @@ -662,6 +662,9 @@ /* Ethernet Unit Registers */ /****************************************/ +#define MV64340_ETH_SHARED_REGS 0x2000 +#define MV64340_ETH_SHARED_REGS_SIZE 0x2000 + #define MV64340_ETH_PHY_ADDR_REG 0x2000 #define MV64340_ETH_SMI_REG 0x2004 #define MV64340_ETH_UNIT_DEFAULT_ADDR_REG 0x2008 @@ -1083,6 +1086,209 @@ u8 brg_can_tune; u8 brg_clk_src; u32 brg_clk_freq; +}; + +/* These macros describe Ethernet Port configuration reg (Px_cR) bits */ +#define MV64340_ETH_UNICAST_NORMAL_MODE 0 +#define MV64340_ETH_UNICAST_PROMISCUOUS_MODE (1<<0) +#define MV64340_ETH_DEFAULT_RX_QUEUE_0 0 +#define MV64340_ETH_DEFAULT_RX_QUEUE_1 (1<<1) +#define MV64340_ETH_DEFAULT_RX_QUEUE_2 (1<<2) +#define MV64340_ETH_DEFAULT_RX_QUEUE_3 ((1<<2) | (1<<1)) +#define MV64340_ETH_DEFAULT_RX_QUEUE_4 (1<<3) +#define MV64340_ETH_DEFAULT_RX_QUEUE_5 ((1<<3) | (1<<1)) +#define MV64340_ETH_DEFAULT_RX_QUEUE_6 ((1<<3) | (1<<2)) +#define MV64340_ETH_DEFAULT_RX_QUEUE_7 ((1<<3) | (1<<2) | (1<<1)) +#define MV64340_ETH_DEFAULT_RX_ARP_QUEUE_0 0 +#define MV64340_ETH_DEFAULT_RX_ARP_QUEUE_1 (1<<4) +#define MV64340_ETH_DEFAULT_RX_ARP_QUEUE_2 (1<<5) +#define MV64340_ETH_DEFAULT_RX_ARP_QUEUE_3 ((1<<5) | (1<<4)) +#define MV64340_ETH_DEFAULT_RX_ARP_QUEUE_4 (1<<6) +#define MV64340_ETH_DEFAULT_RX_ARP_QUEUE_5 ((1<<6) | (1<<4)) +#define MV64340_ETH_DEFAULT_RX_ARP_QUEUE_6 ((1<<6) | (1<<5)) +#define MV64340_ETH_DEFAULT_RX_ARP_QUEUE_7 ((1<<6) | (1<<5) | (1<<4)) +#define MV64340_ETH_RECEIVE_BC_IF_NOT_IP_OR_ARP 0 +#define MV64340_ETH_REJECT_BC_IF_NOT_IP_OR_ARP (1<<7) +#define MV64340_ETH_RECEIVE_BC_IF_IP 0 +#define MV64340_ETH_REJECT_BC_IF_IP (1<<8) +#define MV64340_ETH_RECEIVE_BC_IF_ARP 0 +#define MV64340_ETH_REJECT_BC_IF_ARP (1<<9) +#define MV64340_ETH_TX_AM_NO_UPDATE_ERROR_SUMMARY (1<<12) +#define MV64340_ETH_CAPTURE_TCP_FRAMES_DIS 0 +#define MV64340_ETH_CAPTURE_TCP_FRAMES_EN (1<<14) +#define MV64340_ETH_CAPTURE_UDP_FRAMES_DIS 0 +#define MV64340_ETH_CAPTURE_UDP_FRAMES_EN (1<<15) +#define MV64340_ETH_DEFAULT_RX_TCP_QUEUE_0 0 +#define MV64340_ETH_DEFAULT_RX_TCP_QUEUE_1 (1<<16) +#define MV64340_ETH_DEFAULT_RX_TCP_QUEUE_2 (1<<17) +#define MV64340_ETH_DEFAULT_RX_TCP_QUEUE_3 ((1<<17) | (1<<16)) +#define MV64340_ETH_DEFAULT_RX_TCP_QUEUE_4 (1<<18) +#define MV64340_ETH_DEFAULT_RX_TCP_QUEUE_5 ((1<<18) | (1<<16)) +#define MV64340_ETH_DEFAULT_RX_TCP_QUEUE_6 ((1<<18) | (1<<17)) +#define MV64340_ETH_DEFAULT_RX_TCP_QUEUE_7 ((1<<18) | (1<<17) | (1<<16)) +#define MV64340_ETH_DEFAULT_RX_UDP_QUEUE_0 0 +#define MV64340_ETH_DEFAULT_RX_UDP_QUEUE_1 (1<<19) +#define MV64340_ETH_DEFAULT_RX_UDP_QUEUE_2 (1<<20) +#define MV64340_ETH_DEFAULT_RX_UDP_QUEUE_3 ((1<<20) | (1<<19)) +#define MV64340_ETH_DEFAULT_RX_UDP_QUEUE_4 ((1<<21) +#define MV64340_ETH_DEFAULT_RX_UDP_QUEUE_5 ((1<<21) | (1<<19)) +#define MV64340_ETH_DEFAULT_RX_UDP_QUEUE_6 ((1<<21) | (1<<20)) +#define MV64340_ETH_DEFAULT_RX_UDP_QUEUE_7 ((1<<21) | (1<<20) | (1<<19)) +#define MV64340_ETH_DEFAULT_RX_BPDU_QUEUE_0 0 +#define MV64340_ETH_DEFAULT_RX_BPDU_QUEUE_1 (1<<22) +#define MV64340_ETH_DEFAULT_RX_BPDU_QUEUE_2 (1<<23) +#define MV64340_ETH_DEFAULT_RX_BPDU_QUEUE_3 ((1<<23) | (1<<22)) +#define MV64340_ETH_DEFAULT_RX_BPDU_QUEUE_4 (1<<24) +#define MV64340_ETH_DEFAULT_RX_BPDU_QUEUE_5 ((1<<24) | (1<<22)) +#define MV64340_ETH_DEFAULT_RX_BPDU_QUEUE_6 ((1<<24) | (1<<23)) +#define MV64340_ETH_DEFAULT_RX_BPDU_QUEUE_7 ((1<<24) | (1<<23) | (1<<22)) + +#define MV64340_ETH_PORT_CONFIG_DEFAULT_VALUE \ + MV64340_ETH_UNICAST_NORMAL_MODE | \ + MV64340_ETH_DEFAULT_RX_QUEUE_0 | \ + MV64340_ETH_DEFAULT_RX_ARP_QUEUE_0 | \ + MV64340_ETH_RECEIVE_BC_IF_NOT_IP_OR_ARP | \ + MV64340_ETH_RECEIVE_BC_IF_IP | \ + MV64340_ETH_RECEIVE_BC_IF_ARP | \ + MV64340_ETH_CAPTURE_TCP_FRAMES_DIS | \ + MV64340_ETH_CAPTURE_UDP_FRAMES_DIS | \ + MV64340_ETH_DEFAULT_RX_TCP_QUEUE_0 | \ + MV64340_ETH_DEFAULT_RX_UDP_QUEUE_0 | \ + MV64340_ETH_DEFAULT_RX_BPDU_QUEUE_0 + +/* These macros describe Ethernet Port configuration extend reg (Px_cXR) bits*/ +#define MV64340_ETH_CLASSIFY_EN (1<<0) +#define MV64340_ETH_SPAN_BPDU_PACKETS_AS_NORMAL 0 +#define MV64340_ETH_SPAN_BPDU_PACKETS_TO_RX_QUEUE_7 (1<<1) +#define MV64340_ETH_PARTITION_DISABLE 0 +#define MV64340_ETH_PARTITION_ENABLE (1<<2) + +#define MV64340_ETH_PORT_CONFIG_EXTEND_DEFAULT_VALUE \ + MV64340_ETH_SPAN_BPDU_PACKETS_AS_NORMAL | \ + MV64340_ETH_PARTITION_DISABLE + +/* These macros describe Ethernet Port Sdma configuration reg (SDCR) bits */ +#define MV64340_ETH_RIFB (1<<0) +#define MV64340_ETH_RX_BURST_SIZE_1_64BIT 0 +#define MV64340_ETH_RX_BURST_SIZE_2_64BIT (1<<1) +#define MV64340_ETH_RX_BURST_SIZE_4_64BIT (1<<2) +#define MV64340_ETH_RX_BURST_SIZE_8_64BIT ((1<<2) | (1<<1)) +#define MV64340_ETH_RX_BURST_SIZE_16_64BIT (1<<3) +#define MV64340_ETH_BLM_RX_NO_SWAP (1<<4) +#define MV64340_ETH_BLM_RX_BYTE_SWAP 0 +#define MV64340_ETH_BLM_TX_NO_SWAP (1<<5) +#define MV64340_ETH_BLM_TX_BYTE_SWAP 0 +#define MV64340_ETH_DESCRIPTORS_BYTE_SWAP (1<<6) +#define MV64340_ETH_DESCRIPTORS_NO_SWAP 0 +#define MV64340_ETH_TX_BURST_SIZE_1_64BIT 0 +#define MV64340_ETH_TX_BURST_SIZE_2_64BIT (1<<22) +#define MV64340_ETH_TX_BURST_SIZE_4_64BIT (1<<23) +#define MV64340_ETH_TX_BURST_SIZE_8_64BIT ((1<<23) | (1<<22)) +#define MV64340_ETH_TX_BURST_SIZE_16_64BIT (1<<24) + +#define MV64340_ETH_IPG_INT_RX(value) ((value & 0x3fff) << 8) + +#define MV64340_ETH_PORT_SDMA_CONFIG_DEFAULT_VALUE \ + MV64340_ETH_RX_BURST_SIZE_4_64BIT | \ + MV64340_ETH_IPG_INT_RX(0) | \ + MV64340_ETH_TX_BURST_SIZE_4_64BIT + +/* These macros describe Ethernet Port serial control reg (PSCR) bits */ +#define MV64340_ETH_SERIAL_PORT_DISABLE 0 +#define MV64340_ETH_SERIAL_PORT_ENABLE (1<<0) +#define MV64340_ETH_FORCE_LINK_PASS (1<<1) +#define MV64340_ETH_DO_NOT_FORCE_LINK_PASS 0 +#define MV64340_ETH_ENABLE_AUTO_NEG_FOR_DUPLX 0 +#define MV64340_ETH_DISABLE_AUTO_NEG_FOR_DUPLX (1<<2) +#define MV64340_ETH_ENABLE_AUTO_NEG_FOR_FLOW_CTRL 0 +#define MV64340_ETH_DISABLE_AUTO_NEG_FOR_FLOW_CTRL (1<<3) +#define MV64340_ETH_ADV_NO_FLOW_CTRL 0 +#define MV64340_ETH_ADV_SYMMETRIC_FLOW_CTRL (1<<4) +#define MV64340_ETH_FORCE_FC_MODE_NO_PAUSE_DIS_TX 0 +#define MV64340_ETH_FORCE_FC_MODE_TX_PAUSE_DIS (1<<5) +#define MV64340_ETH_FORCE_BP_MODE_NO_JAM 0 +#define MV64340_ETH_FORCE_BP_MODE_JAM_TX (1<<7) +#define MV64340_ETH_FORCE_BP_MODE_JAM_TX_ON_RX_ERR (1<<8) +#define MV64340_ETH_FORCE_LINK_FAIL 0 +#define MV64340_ETH_DO_NOT_FORCE_LINK_FAIL (1<<10) +#define MV64340_ETH_RETRANSMIT_16_ATTEMPTS 0 +#define MV64340_ETH_RETRANSMIT_FOREVER (1<<11) +#define MV64340_ETH_DISABLE_AUTO_NEG_SPEED_GMII (1<<13) +#define MV64340_ETH_ENABLE_AUTO_NEG_SPEED_GMII 0 +#define MV64340_ETH_DTE_ADV_0 0 +#define MV64340_ETH_DTE_ADV_1 (1<<14) +#define MV64340_ETH_DISABLE_AUTO_NEG_BYPASS 0 +#define MV64340_ETH_ENABLE_AUTO_NEG_BYPASS (1<<15) +#define MV64340_ETH_AUTO_NEG_NO_CHANGE 0 +#define MV64340_ETH_RESTART_AUTO_NEG (1<<16) +#define MV64340_ETH_MAX_RX_PACKET_1518BYTE 0 +#define MV64340_ETH_MAX_RX_PACKET_1522BYTE (1<<17) +#define MV64340_ETH_MAX_RX_PACKET_1552BYTE (1<<18) +#define MV64340_ETH_MAX_RX_PACKET_9022BYTE ((1<<18) | (1<<17)) +#define MV64340_ETH_MAX_RX_PACKET_9192BYTE (1<<19) +#define MV64340_ETH_MAX_RX_PACKET_9700BYTE ((1<<19) | (1<<17)) +#define MV64340_ETH_SET_EXT_LOOPBACK (1<<20) +#define MV64340_ETH_CLR_EXT_LOOPBACK 0 +#define MV64340_ETH_SET_FULL_DUPLEX_MODE (1<<21) +#define MV64340_ETH_SET_HALF_DUPLEX_MODE 0 +#define MV64340_ETH_ENABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX (1<<22) +#define MV64340_ETH_DISABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX 0 +#define MV64340_ETH_SET_GMII_SPEED_TO_10_100 0 +#define MV64340_ETH_SET_GMII_SPEED_TO_1000 (1<<23) +#define MV64340_ETH_SET_MII_SPEED_TO_10 0 +#define MV64340_ETH_SET_MII_SPEED_TO_100 (1<<24) + +#define MV64340_ETH_PORT_SERIAL_CONTROL_DEFAULT_VALUE \ + MV64340_ETH_DO_NOT_FORCE_LINK_PASS | \ + MV64340_ETH_ENABLE_AUTO_NEG_FOR_DUPLX | \ + MV64340_ETH_DISABLE_AUTO_NEG_FOR_FLOW_CTRL | \ + MV64340_ETH_ADV_SYMMETRIC_FLOW_CTRL | \ + MV64340_ETH_FORCE_FC_MODE_NO_PAUSE_DIS_TX | \ + MV64340_ETH_FORCE_BP_MODE_NO_JAM | \ + (1<<9) /* reserved */ | \ + MV64340_ETH_DO_NOT_FORCE_LINK_FAIL | \ + MV64340_ETH_RETRANSMIT_16_ATTEMPTS | \ + MV64340_ETH_ENABLE_AUTO_NEG_SPEED_GMII | \ + MV64340_ETH_DTE_ADV_0 | \ + MV64340_ETH_DISABLE_AUTO_NEG_BYPASS | \ + MV64340_ETH_AUTO_NEG_NO_CHANGE | \ + MV64340_ETH_MAX_RX_PACKET_9700BYTE | \ + MV64340_ETH_CLR_EXT_LOOPBACK | \ + MV64340_ETH_SET_FULL_DUPLEX_MODE | \ + MV64340_ETH_ENABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX + +#define MV64340_ETH_PORT_DEFAULT_TRANSMIT_QUEUE_SIZE 800 +#define MV64340_ETH_PORT_DEFAULT_RECEIVE_QUEUE_SIZE 400 + +#define MV64340_ETH_DESC_SIZE 64 + +#define MV64XXX_ETH_SHARED_NAME "mv64xxx_eth_shared" +#define MV64XXX_ETH_NAME "mv64xxx_eth" + +struct mv64xxx_eth_platform_data { + /* + * Non-values for mac_addr, phy_addr, port_config, etc. + * override the default value. Setting the corresponding + * force_* field, causes the default value to be overridden + * even when zero. + */ + unsigned int force_phy_addr:1; + unsigned int force_port_config:1; + unsigned int force_port_config_extend:1; + unsigned int force_port_sdma_config:1; + unsigned int force_port_serial_control:1; + int phy_addr; + char *mac_addr; /* pointer to mac address */ + u32 port_config; + u32 port_config_extend; + u32 port_sdma_config; + u32 port_serial_control; + u32 tx_queue_size; + u32 rx_queue_size; + u32 tx_sram_addr; + u32 tx_sram_size; + u32 rx_sram_addr; + u32 rx_sram_size; }; #endif /* __ASM_MV64340_H */ From jmorris@redhat.com Mon Jan 17 11:00:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 11:00:29 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HJ0OIn026694 for ; Mon, 17 Jan 2005 11:00:25 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j0HJ0NoN005923; Mon, 17 Jan 2005 14:00:24 -0500 Received: from mail.boston.redhat.com (mail.boston.redhat.com [172.16.76.12]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j0HJ0NO25132; Mon, 17 Jan 2005 14:00:23 -0500 Received: from thoron.boston.redhat.com (thoron.boston.redhat.com [172.16.80.63]) by mail.boston.redhat.com (8.12.8/8.12.8) with ESMTP id j0HJ0Ms2016870; Mon, 17 Jan 2005 14:00:23 -0500 Date: Mon, 17 Jan 2005 14:00:22 -0500 (EST) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: David Dillow cc: netdev@oss.sgi.com Subject: Re: [RFC BK 0/22] xfrm offload v2: Add hardware assist for IPSEC crypto In-Reply-To: <20040110014300.01@ori.thedillows.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 371 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jmorris@redhat.com Precedence: bulk X-list: netdev On Mon, 10 Jan 2005, David Dillow wrote: > * Only the 3Com 3CR990 family of NICs are supported. I don't have hardware > or documentation for the Intel cards. Is documentation for the 3com card freely available? Also, are the cards still available on the market? The 3com site says the 3CR990-TX-97 and -95 cards are discontinued. - James -- James Morris From greearb@candelatech.com Mon Jan 17 11:17:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 11:17:07 -0800 (PST) Received: from www.lanforge.com (ns1.lanforge.com [66.165.47.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HJH1OC027735 for ; Mon, 17 Jan 2005 11:17:01 -0800 Received: from [4.33.45.22] (evrtwa1-ar2-4-33-045-022.evrtwa1.dsl-verizon.net [4.33.45.22]) (authenticated bits=0) by www.lanforge.com (8.12.8/8.12.8) with ESMTP id j0HJYALH002232; Mon, 17 Jan 2005 11:34:11 -0800 Message-ID: <41EC0F2B.7010002@candelatech.com> Date: Mon, 17 Jan 2005 11:16:59 -0800 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041020 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andre Tomt CC: netdev@oss.sgi.com Subject: Re: 2.6.10 ipv6/8021q lockup on vconfig on interface removal References: <41EA0A01.2020707@tomt.net> In-Reply-To: <41EA0A01.2020707@tomt.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 372 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Andre Tomt wrote: > I sent this initially about a week ago, but nobody have said anything, > not even a confirmation that its beeing looked into, or about me beeing > silly - highly unusual on netdev! So I'm reposting (with slight > modifications), boo, shame on me. Just a bit worried it slipped through > the cracks. My take on this is that it is a bug in the IPv6 code. If the IPv6 people think that the VLAN code might could be causing this, then I am open to suggestions as to how the VLAN code might be in error.... Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From tgraf@suug.ch Mon Jan 17 11:38:59 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 11:39:03 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HJcw4x029188 for ; Mon, 17 Jan 2005 11:38:58 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 7806684; Mon, 17 Jan 2005 20:38:35 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id A95E51C0EA; Mon, 17 Jan 2005 20:39:17 +0100 (CET) Date: Mon, 17 Jan 2005 20:39:17 +0100 From: Thomas Graf To: Jamal Hadi Salim Cc: Stephen Hemminger , netdev@oss.sgi.com Subject: Re: Iproute2: update Message-ID: <20050117193917.GF26856@postel.suug.ch> References: <20050112125903.64d42737@dxpl.pdx.osdl.net> <1105895352.1091.705.camel@jzny.localdomain> <1105897532.1097.749.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1105897532.1097.749.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 373 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * Jamal Hadi Salim <1105897532.1097.749.camel@jzny.localdomain> 2005-01-16 12:45 > On Sun, 2005-01-16 at 12:09, jamal wrote: > > Here's one fix > > > > And another one from before that is missing from the current version. > Also something for the makefile - You may be unhappy with the way the > IPT_INCL is defined in the makefile. > Feel free to move it to configure etc or even kill it if it works > without it. It seems that ipt code is still missing in stephen's bk tree so the patch doesn't apply cleanly. It's no problem to fix it but you might to provide the patch again. Stephen, I can put it into my bk tree and you can pull it together with my my changes if you want. From tgraf@suug.ch Mon Jan 17 12:20:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 12:20:08 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HKK3UK002307 for ; Mon, 17 Jan 2005 12:20:04 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id D601884; Mon, 17 Jan 2005 21:19:40 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id A0FA01C0EA; Mon, 17 Jan 2005 21:20:22 +0100 (CET) Date: Mon, 17 Jan 2005 21:20:22 +0100 From: Thomas Graf To: Jamal Hadi Salim Cc: Stephen Hemminger , netdev@oss.sgi.com Subject: Re: Iproute2: update Message-ID: <20050117202022.GG26856@postel.suug.ch> References: <20050112125903.64d42737@dxpl.pdx.osdl.net> <1105895352.1091.705.camel@jzny.localdomain> <1105897532.1097.749.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1105897532.1097.749.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 374 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * Jamal Hadi Salim <1105897532.1097.749.camel@jzny.localdomain> 2005-01-16 12:45 > --- a/tc/Makefile 2005-01-12 15:19:46.000000000 -0500 > +++ b/tc/Makefile 2005-01-15 12:59:03.994966464 -0500 > @@ -23,6 +23,12 @@ > TCMODULES += m_gact.o > TCMODULES += m_mirred.o > TCMODULES += m_ipt.o > +#pedit > +TCMODULES += m_pedit.o > +TCMODULES += p_ip.o > +TCMODULES += p_icmp.o > +TCMODULES += p_tcp.o > +TCMODULES += p_udp.o > > TCOBJ += $(TCMODULES) > > @@ -31,8 +37,6 @@ > TCLIB += tc_cbq.o > TCLIB += tc_estimator.o > > -CFLAGS += -DCONFIG_GACT -DCONFIG_GACT_PROB > - > > TCSO := > TCSO += q_netem.so > @@ -40,10 +44,13 @@ > TCSO += q_atm.so > endif > > + > NETEM_DIST := normal.dist pareto.dist paretonormal.dist > > +IPT_INCL = /root/iptables-1.2.11/include I moved this to configure: --- 1.9/configure 2004-12-08 21:12:11 +01:00 +++ edited/configure 2005-01-17 20:55:38 +01:00 @@ -42,3 +42,17 @@ echo "TC_CONFIG_ACTION_MIRRED=y" >>Config fi +if [ -e "tc/m_ipt.c" ] +then + echo " IPT found" + echo "Enter path to iptables source directory or \"disable\"" + echo -n "Path: " + read PATH + if [ "$PATH" = "disable" ] + then + echo "TC_CONFIG_ACTION_IPT=n" >>Config + else + echo "TC_CONFIG_ACTION_IPT=y" >>Config + echo "IPT_INCL=${PATH}/include" >>Config + fi +fi and the Makefile part: --- 1.21/tc/Makefile 2004-12-08 21:12:11 +01:00 +++ edited/tc/Makefile 2005-01-17 20:49:36 +01:00 @@ -21,7 +21,15 @@ TCMODULES += q_hfsc.o TCMODULES += q_htb.o TCMODULES += m_gact.o +ifeq ($(TC_CONFIG_ACTION_IPT),y) +TCMODULES += m_ipt.o +endif TCMODULES += m_mirred.o +TCMODULES += m_pedit.o +TCMODULES += p_ip.o +TCMODULES += p_icmp.o +TCMODULES += p_tcp.o +TCMODULES += p_udp.o TCOBJ += $(TCMODULES) @@ -30,8 +38,7 @@ TCLIB += tc_cbq.o TCLIB += tc_estimator.o -CFLAGS += -DCONFIG_GACT -DCONFIG_GACT_PROB - +CFLAGS += -DCONFIG_GACT -DCONFIG_GACT_PROB -I$(IPT_INCL) TCSO := TCSO += q_netem.so > +struct m_pedit_util > +*get_pedit_kind(char *str) > +{ > + void *dlh; > + char buf[256]; > + struct m_pedit_util *p; > + > + for (p = pedit_list; p; p = p->next) { > + if (strcmp(p->id, str) == 0) > + return p; > + } > + > + snprintf(buf, sizeof(buf), "p_%s.so", str); > + dlh = dlopen(buf, RTLD_LAZY); > + if (dlh == NULL) { > + dlh = pBODY; > + if (dlh == NULL) { > + dlh = pBODY = dlopen(NULL, RTLD_LAZY); > + if (dlh == NULL) > + goto noexist; I made pBODY a static variable within get_pedit_kind. same in m_action.c > +noexist: > + p = malloc(sizeof(*p)); > + if (p) { > + memset(p, 0, sizeof(*p)); > + strncpy(p->id, str, 15); > + p->parse_peopt = pedit_parse_nopopt; > + goto reg; Quite hacky ;-> > +int > +pack_key32(__u32 retain,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey) > +{ > + if (tkey->off > (tkey->off & ~3)) { > + fprintf(stderr, > + "pack_key32: 32 bit offsets must begin in 32bit boundaries\n"); > + return -1; > + } > + > + tkey->val = htonl(tkey->val & retain); > + tkey->mask = htonl(tkey->mask | ~retain); > + /* jamal remove this - it is not necessary given the if check above */ > + tkey->off &= ~3; Are there multiple of you? ;-> > +int > +pack_key16(__u32 retain,struct tc_pedit_sel *sel,struct tc_pedit_key *tkey) > +{ > + int ind = 0, stride = 0; > + __u32 m[4] = {0xFFFF0000,0xFF0000FF,0x0000FFFF}; Missing check for 16bit boundry? You can also completely remove theses issues by writing in 8bit chunks. OTOH, the user can request you to do so, so no problem. > +#if jamal > + } else if (strcmp(*argv, "help") == 0) { > + p_explain(); > + return -1; > +#endif So you think you're the only one worth giving help? ;-> Just kidding. > + tail = (struct rtattr *) (((void *) n) + NLMSG_ALIGN(n->nlmsg_len)); > + addattr_l(n, MAX_MSG, tca_id, NULL, 0); > + addattr_l(n, MAX_MSG, TCA_PEDIT_PARMS,&sel, sizeof(sel.sel)+sel.sel.nkeys*sizeof(struct tc_pedit_key)); > + tail->rta_len = > + (((void *) n) + NLMSG_ALIGN(n->nlmsg_len)) - (void *) tail; I changed this and all other occurences to use the NLMSG_TAIL macro (added in my tree) +#define NLMSG_TAIL(nmsg) \ + ((struct rtattr *) (((void *) (nmsg)) + NLMSG_ALIGN((nmsg)->nlmsg_len))) > +struct m_pedit_util > +{ > + struct m_pedit_util *next; > + char id[16]; I made this a PEDITKINDSIZ and made the strncpy's use it I'll put this changes into my tree given you're fine with it and stephen can pull them. As I said, the ipt code is still missing, I can merge them into my tree as well if you want. From herbert@gondor.apana.org.au Mon Jan 17 12:41:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 12:41:34 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HKfP3s004083 for ; Mon, 17 Jan 2005 12:41:26 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CqdgR-0006vx-00; Tue, 18 Jan 2005 07:41:07 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1Cqdfy-0005JM-00; Tue, 18 Jan 2005 07:40:38 +1100 Date: Tue, 18 Jan 2005 07:40:38 +1100 To: "David S. Miller" Cc: anton@samba.org, netdev@oss.sgi.com Subject: Re: [DEBUG]: sk_forward_alloc assertion failures Message-ID: <20050117204038.GB9605@gondor.apana.org.au> References: <20050114203452.GA1277@gondor.apana.org.au> <20050114132757.4ca3153a.davem@davemloft.net> <20050114213829.GA12454@gondor.apana.org.au> <20050114133611.69ff0bb2.davem@davemloft.net> <20050114215504.GA12569@gondor.apana.org.au> <20050114140426.5cf06f0c.davem@davemloft.net> <20050114224745.GA13180@gondor.apana.org.au> <20050114205543.5acb0d68.davem@davemloft.net> <20050115054547.GA15860@gondor.apana.org.au> <20050117123729.526ccdc7.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050117123729.526ccdc7.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 376 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev On Mon, Jan 17, 2005 at 12:37:29PM -0800, David S. Miller wrote: > On Sat, 15 Jan 2005 16:45:47 +1100 > Herbert Xu wrote: > > > > + if (sk->sk_forward_alloc < copy && > > > + !sk_stream_mem_schedule(sk, copy, 0)) > > > > You want to have sk->sk_allocation here instead of 0. > > The third argument to sk_stream_mem_schedule() is "int kind" > which is to be set to 1 for receive packet allocations and 0 > for send packet allocations. > > Why would I want to use a sk_allocation gfp mask here? :-) You're right. I got carried away there :) -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From davem@davemloft.net Mon Jan 17 12:39:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 12:39:13 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HKd5Zh003642 for ; Mon, 17 Jan 2005 12:39:07 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cqdcw-0005Qt-00; Mon, 17 Jan 2005 12:37:30 -0800 Date: Mon, 17 Jan 2005 12:37:29 -0800 From: "David S. Miller" To: Herbert Xu Cc: anton@samba.org, netdev@oss.sgi.com Subject: Re: [DEBUG]: sk_forward_alloc assertion failures Message-Id: <20050117123729.526ccdc7.davem@davemloft.net> In-Reply-To: <20050115054547.GA15860@gondor.apana.org.au> References: <20050114120322.GA28449@gondor.apana.org.au> <20050114110352.23c94ab9.davem@davemloft.net> <20050114203452.GA1277@gondor.apana.org.au> <20050114132757.4ca3153a.davem@davemloft.net> <20050114213829.GA12454@gondor.apana.org.au> <20050114133611.69ff0bb2.davem@davemloft.net> <20050114215504.GA12569@gondor.apana.org.au> <20050114140426.5cf06f0c.davem@davemloft.net> <20050114224745.GA13180@gondor.apana.org.au> <20050114205543.5acb0d68.davem@davemloft.net> <20050115054547.GA15860@gondor.apana.org.au> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 375 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Sat, 15 Jan 2005 16:45:47 +1100 Herbert Xu wrote: > > + if (sk->sk_forward_alloc < copy && > > + !sk_stream_mem_schedule(sk, copy, 0)) > > You want to have sk->sk_allocation here instead of 0. The third argument to sk_stream_mem_schedule() is "int kind" which is to be set to 1 for receive packet allocations and 0 for send packet allocations. Why would I want to use a sk_allocation gfp mask here? :-) From davem@davemloft.net Mon Jan 17 12:50:19 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 12:50:24 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HKoEOm006339 for ; Mon, 17 Jan 2005 12:50:18 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CqdoH-0005To-00; Mon, 17 Jan 2005 12:49:13 -0800 Date: Mon, 17 Jan 2005 12:49:13 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: netdev@oss.sgi.com Subject: Re: [BK PATCH] sk_dst_cache annotation Message-Id: <20050117124913.49c253b6.davem@davemloft.net> In-Reply-To: <20050115.160008.04476889.yoshfuji@linux-ipv6.org> References: <20050115.160008.04476889.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j0HKoEOm006339 X-archive-position: 377 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Sat, 15 Jan 2005 16:00:08 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > ChangeSet@1.2335, 2005-01-15 15:47:12+09:00, yoshfuji@linux-ipv6.org > [NET] Always hold refcnt for dst when we use sk_dst_cache. > > Signed-off-by: Hideaki YOSHIFUJI There is less and less point to having the socket dst cache if we're going to take the read lock and grab an atomic reference all the time anyways. If the socket is locked, which most of the code paths you are modifying do, there is no need to grab a reference and __sk_dst_cache() is just fine. That's how it was mean to be used since if the socket is locked nobody can sk_dst_reset() on us. Let's work on this one changeset at a time, the first one involving tcp_sync_mss() might be correct, but it might be easier to fix this differently. Just make PMTU discovery behave just like ipv4 does, if there is no socket cached route then simply return and ignore the ICMP message. From tgraf@suug.ch Mon Jan 17 12:57:17 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 12:57:21 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HKvFw9007266 for ; Mon, 17 Jan 2005 12:57:17 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 52DDE84; Mon, 17 Jan 2005 21:56:52 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 4FAC01C0EA; Mon, 17 Jan 2005 21:57:34 +0100 (CET) Date: Mon, 17 Jan 2005 21:57:34 +0100 From: Thomas Graf To: Jamal Hadi Salim Cc: Stephen Hemminger , netdev@oss.sgi.com Subject: Re: Iproute2: update Message-ID: <20050117205734.GH26856@postel.suug.ch> References: <20050112125903.64d42737@dxpl.pdx.osdl.net> <1105895352.1091.705.camel@jzny.localdomain> <1105897532.1097.749.camel@jzny.localdomain> <20050117202022.GG26856@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050117202022.GG26856@postel.suug.ch> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 378 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev > I'll put this changes into my tree given you're fine with it and stephen > can pull them. As I said, the ipt code is still missing, I can merge > them into my tree as well if you want. Stephen: you can pull jamal's changes with my modifications from bk://tgr.bkbits.net/iproute2-tgr if you like. From davem@davemloft.net Mon Jan 17 13:02:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 13:02:59 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HL2qm9007963 for ; Mon, 17 Jan 2005 13:02:53 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cqe0W-0005Vb-00; Mon, 17 Jan 2005 13:01:52 -0800 Date: Mon, 17 Jan 2005 13:01:52 -0800 From: "David S. Miller" To: yoshfuji@wide.ad.jp Cc: netdev@oss.sgi.com Subject: Re: [PATCH] [IPV6] Don't use obsolete entries. Message-Id: <20050117130152.7ccd86f7.davem@davemloft.net> In-Reply-To: <20050115.182756.133007240.yoshfuji@wide.ad.jp> References: <20050115.182756.133007240.yoshfuji@wide.ad.jp> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j0HL2qm9007963 X-archive-position: 379 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Sat, 15 Jan 2005 18:27:56 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > Following changesets improve specification conformity. > Please pull them from: > Pulled, thanks. From xschmi00@stud.feec.vutbr.cz Mon Jan 17 13:07:24 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 13:07:27 -0800 (PST) Received: from tron.kn.vutbr.cz (tron.kn.vutbr.cz [147.229.191.152]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HL7MDj008671 for ; Mon, 17 Jan 2005 13:07:23 -0800 Received: from hammerfall (a05-0930b.kn.vutbr.cz [147.229.222.29]) by tron.kn.vutbr.cz (8.12.9p2/8.12.9) with ESMTP id j0HL78Pr057436; Mon, 17 Jan 2005 22:07:08 +0100 (CET) (envelope-from xschmi00@stud.feec.vutbr.cz) Received: from localhost ([127.0.0.1]) by hammerfall with esmtp (Exim 4.34) id 1Cqe5b-0001rC-N4; Mon, 17 Jan 2005 22:07:07 +0100 Message-ID: <41EC28FB.3040904@stud.feec.vutbr.cz> Date: Mon, 17 Jan 2005 22:07:07 +0100 From: Michal Schmidt User-Agent: Mozilla Thunderbird 0.9 (X11/20041201) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: Jeff Garzik , Christoph Hellwig , netdev@oss.sgi.com Subject: Re: [RFT] New syskonnect gigabit ether driver (skge) References: <20050114155613.3c68e829@dxpl.pdx.osdl.net> In-Reply-To: <20050114155613.3c68e829@dxpl.pdx.osdl.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: clamd / ClamAV version 0.70, clamav-milter version 0.70j X-Scanned-By: milter-spamc/0.19.268 (tron [147.229.191.152]); Mon, 17 Jan 2005 22:07:09 +0100 X-Virus-Status: Clean X-archive-position: 380 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: xschmi00@stud.feec.vutbr.cz Precedence: bulk X-list: netdev Stephen Hemminger wrote: > Here is my rewrite of the SysKonnect Gigabit Ether driver. Gave up on > the existing sk98lin driver because it bloated and limited by the requirement > to be portable. This version is still very experimental and has only been > run for several days on my LinkSys card (single port Yukon). > Please test on other hardware and let me know what you find out. Works with no problems with the integrated card on my Asus A8V Deluxe motherboard (architecture is x86_64). I only tested 100Mbit full-duplex. 0000:00:0a.0 Ethernet controller: Marvell Technology Group Ltd. Yukon Gigabit Ethernet 10/100/1000Base-T Adapter (rev 13) Subsystem: Asustek Computer, Inc.: Unknown device 811a Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B- Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- SERR- ; Mon, 17 Jan 2005 13:34:38 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CqeV5-0005c0-00; Mon, 17 Jan 2005 13:33:27 -0800 Date: Mon, 17 Jan 2005 13:33:27 -0800 From: "David S. Miller" To: Arnaldo Carvalho de Melo Cc: sri@us.ibm.com, netdev@oss.sgi.com Subject: Re: [PATCH] merge sctp_opt with sctp_sock Message-Id: <20050117133327.0386763f.davem@davemloft.net> In-Reply-To: <41E8A17D.9040307@conectiva.com.br> References: <41E8A17D.9040307@conectiva.com.br> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 381 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Sat, 15 Jan 2005 02:52:13 -0200 Arnaldo Carvalho de Melo wrote: > Please take a look and if its acceptable pull from: > > bk://kernel.bkbits.net/acme/connection_sock-2.6 > > The tricky bit here is that SCTP, to keep the existing logic, > needs a way to copy only its private area from one sock to another, so > I introduced a generic inet_sk_copy_descendant, that knows about the > inet (v4/v6) layout (wrt inet_sock and inet6_pinfo), using this and > sk->sk_prot->slab_obj_size we can copy the inet_sock descendant > private area generically. This looks fine, although I wish the descendant copying thing could be done more cleanly somehow. Pulled. From tommy.christensen@tpack.net Mon Jan 17 13:37:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 13:37:11 -0800 (PST) Received: from mail.tpack.net (ip18.tpack.net [213.173.228.18]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0HLb5q5010922 for ; Mon, 17 Jan 2005 13:37:06 -0800 Received: (qmail 5122 invoked from network); 17 Jan 2005 21:36:59 -0000 Received: from dhcp-245.cph.tpack.net (HELO ?172.17.159.11?) (192.168.0.245) by 0 with SMTP; 17 Jan 2005 21:36:59 -0000 Message-ID: <41EC3067.6050104@tpack.net> Date: Mon, 17 Jan 2005 22:38:47 +0100 From: Tommy Christensen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: en-us, en MIME-Version: 1.0 To: hadi@cyberus.ca CC: Jeff Garzik , Thomas Spatzier , "David S. Miller" , Hasso Tepper , Herbert Xu , netdev@oss.sgi.com, Paul Jakma Subject: Re: [patch 4/10] s390: network driver. References: <1104764710.1048.580.camel@jzny.localdomain> <41DB26A6.2070008@pobox.com> <1104895169.1117.63.camel@jzny.localdomain> <41DC0931.80603@tpack.net> <1105019912.2314.20.camel@jzny.localdomain> <1105023972.3462.48.camel@tsc-6.cph.tpack.net> <1105104757.1046.63.camel@jzny.localdomain> <1105111605.3462.101.camel@tsc-6.cph.tpack.net> <1105363092.1041.146.camel@jzny.localdomain> <1105917038.1091.1041.camel@jzny.localdomain> In-Reply-To: <1105917038.1091.1041.camel@jzny.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 382 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tommy.christensen@tpack.net Precedence: bulk X-list: netdev jamal wrote: > Didnt see anymore discussion on this - have we given up on it? It is not forgotten - just stalled ... I'll try to look at it some more. -Tommy From davem@davemloft.net Mon Jan 17 13:38:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 13:38:18 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HLcDPO011443 for ; Mon, 17 Jan 2005 13:38:13 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CqeYC-0005cS-00; Mon, 17 Jan 2005 13:36:40 -0800 Date: Mon, 17 Jan 2005 13:36:40 -0800 From: "David S. Miller" To: Herbert Xu Cc: tommy.christensen@tpack.net, simon.roscic@chello.at, netdev@oss.sgi.com Subject: Re: [NETLINK] Do not netlink_unicast shared packet in kernel/audit.c Message-Id: <20050117133640.0405d791.davem@davemloft.net> In-Reply-To: <20050116080254.GA2997@gondor.apana.org.au> References: <41E942AF.3030202@tpack.net> <20050115183023.GA31211@gondor.apana.org.au> <41E97B1A.30205@tpack.net> <20050116080254.GA2997@gondor.apana.org.au> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 383 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Sun, 16 Jan 2005 19:02:54 +1100 Herbert Xu wrote: > So here is a patch to handle shared skb's by cloning them if we're > going to do a pskb_expand_head. This patch depends on the previous > one that moves skb_orphan into netlink_trim. I think this patch is buggy. At least in the final hunk, we do this: info.skb = skb; ... skb = netlink_trim( ... ); Now info.skb can be pointing to a freed up skb. I'll apply the first patch though. From davem@davemloft.net Mon Jan 17 13:39:06 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 13:39:13 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HLd6vM011954 for ; Mon, 17 Jan 2005 13:39:06 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CqeZM-0005co-00; Mon, 17 Jan 2005 13:37:52 -0800 Date: Mon, 17 Jan 2005 13:37:51 -0800 From: "David S. Miller" To: Herbert Xu Cc: tommy.christensen@tpack.net, simon.roscic@chello.at, netdev@oss.sgi.com Subject: Re: Fwd: [2.6] ethertap and af_inet.c assertion failures Message-Id: <20050117133751.6d2421fa.davem@davemloft.net> In-Reply-To: References: <41E44476.20303@tpack.net> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 384 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Sun, 16 Jan 2005 00:31:46 +1100 Herbert Xu wrote: > Tommy Christensen wrote: > > > > netlink has messed up the send buffer accounting, when trimming a skb. > > You are spot on. Dave, you were right too about checking for charged > skb's in netlink_trim. It's good to know that I'm legitimately paranoid from time to time :-) > Since the skb will be orphaned on its way to the destination anyway, > let's simply do that before the trimming. This shouldn't lead to > skb leakage since the skb will either be charged to the destination > socket or freed. > > Signed-off-by: Herbert Xu Looks good, I'll apply this. Thanks Herbert. From hadi@cyberus.ca Mon Jan 17 13:39:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 13:39:21 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HLdE93011962 for ; Mon, 17 Jan 2005 13:39:15 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1Cqeag-00068t-M7 for netdev@oss.sgi.com; Mon, 17 Jan 2005 16:39:14 -0500 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Cqeac-0006zw-V2; Mon, 17 Jan 2005 16:39:11 -0500 Subject: Re: Iproute2: update From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: Stephen Hemminger , netdev@oss.sgi.com In-Reply-To: <20050117205734.GH26856@postel.suug.ch> References: <20050112125903.64d42737@dxpl.pdx.osdl.net> <1105895352.1091.705.camel@jzny.localdomain> <1105897532.1097.749.camel@jzny.localdomain> <20050117202022.GG26856@postel.suug.ch> <20050117205734.GH26856@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1105997946.1078.308.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 17 Jan 2005 16:39:06 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 385 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Mon, 2005-01-17 at 15:57, Thomas Graf wrote: > > I'll put this changes into my tree given you're fine with it and stephen > > can pull them. As I said, the ipt code is still missing, I can merge > > them into my tree as well if you want. > > Stephen: you can pull jamal's changes with my modifications from > bk://tgr.bkbits.net/iproute2-tgr if you like. Thomas, Look at iproute2-2.6.10-ss050112 - ipt is in there and thats where my patches are against. ---- [hadi@jzny hadi]$ find iproute2-2.6.10-ss050112 | grep ipt iproute2-2.6.10-ss050112/examples/dhcp-client-script iproute2-2.6.10-ss050112/tc/m_ipt.c iproute2-2.6.10-ss050112/ip/iptunnel.c iproute2-2.6.10-ss050112/include/iptables.h iproute2-2.6.10-ss050112/include/libiptc iproute2-2.6.10-ss050112/include/libiptc/ipt_kernel_headers.h iproute2-2.6.10-ss050112/include/libiptc/libip6tc.h iproute2-2.6.10-ss050112/include/libiptc/libiptc.h iproute2-2.6.10-ss050112/include/iptables_common.h iproute2-2.6.10-ss050112/include/linux/tc_act/tc_ipt.h ----------- Seems like Stephen now also included the iptables headers too. Hopefuly iptables wont be fluctuating as much anymore. So the IPT thing is unneeded. Also note that i had it the way you have it in configure but Stephen didnt like it. In regards to pedit - wait until the code goes in then shoot at it. Theres plenty of things for you to shoot at ;-> i think last time i really looked at it was ~2 years ago. Work it out with Stephen, if he wants to pull changes off you thats fine with me. cheers, jamal From davem@davemloft.net Mon Jan 17 13:41:59 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 13:42:06 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HLfxM7013116 for ; Mon, 17 Jan 2005 13:41:59 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CqecI-0005eI-00; Mon, 17 Jan 2005 13:40:54 -0800 Date: Mon, 17 Jan 2005 13:40:53 -0800 From: "David S. Miller" To: Thomas Graf Cc: akpm@osdl.org, netdev@oss.sgi.com Subject: Re: [PATCH] PKT_SCHED: remove c99ism Message-Id: <20050117134053.626cce63.davem@davemloft.net> In-Reply-To: <20050115234056.GT26856@postel.suug.ch> References: <20050115144010.33182075.akpm@osdl.org> <20050115232554.GS26856@postel.suug.ch> <20050115153202.2f7f81c6.akpm@osdl.org> <20050115234056.GT26856@postel.suug.ch> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 386 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Sun, 16 Jan 2005 00:40:56 +0100 Thomas Graf wrote: > * Andrew Morton <20050115153202.2f7f81c6.akpm@osdl.org> 2005-01-15 15:32 > > An uglier but more efficient approach is to whack braces around the whole > > thing. > > Fine with me as well. The code isn't used that often and not deep in the > calling stack which is why I preferred the cleaner way first. > > Signed-off-by: Thomas Graf Applied, thanks Thomas. From davem@davemloft.net Mon Jan 17 13:43:34 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 13:43:40 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HLhYvP013665 for ; Mon, 17 Jan 2005 13:43:34 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cqedo-0005ec-00; Mon, 17 Jan 2005 13:42:28 -0800 Date: Mon, 17 Jan 2005 13:42:28 -0800 From: "David S. Miller" To: Christoph Hellwig Cc: pavlic@de.ibm.com, waldi@debian.org, netdev@oss.sgi.com Subject: Re: [PATCH] ipv6: alternative version of S/390 shared NIC support Message-Id: <20050117134228.5a6002a0.davem@davemloft.net> In-Reply-To: <20050116115431.GA13617@lst.de> References: <20050116115431.GA13617@lst.de> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 387 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Sun, 16 Jan 2005 12:54:31 +0100 Christoph Hellwig wrote: > Let's try again solvign the EUI64 generation for S/390. I looked over > the IBM patch and I think it can be done a lot simpler: > > - put a dev_id field in struct net_device, so that it uses space that > would be wasted by padding otherwise. > - if this fields is non-null let ipv6_generate_eui64 use the algorithm > from the QETH code to generate an EUI that's different for each > OS instance. See code comments for details. I'll apply this patch. It might be nice to genericize that huge comment. This will likely be not the last time we see devices which have this characteristic. From tommy.christensen@tpack.net Mon Jan 17 14:03:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 14:03:11 -0800 (PST) Received: from mail.tpack.net (ip18.tpack.net [213.173.228.18]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0HM35YS015157 for ; Mon, 17 Jan 2005 14:03:06 -0800 Received: (qmail 9409 invoked from network); 17 Jan 2005 22:02:59 -0000 Received: from dhcp-245.cph.tpack.net (HELO ?172.17.159.11?) (192.168.0.245) by 0 with SMTP; 17 Jan 2005 22:02:59 -0000 Message-ID: <41EC3680.7060108@tpack.net> Date: Mon, 17 Jan 2005 23:04:48 +0100 From: Tommy Christensen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Hasso Tepper CC: hadi@cyberus.ca, Jeff Garzik , Thomas Spatzier , "David S. Miller" , Herbert Xu , netdev@oss.sgi.com, Paul Jakma Subject: Re: [patch 4/10] s390: network driver. References: <1105363092.1041.146.camel@jzny.localdomain> <1105917038.1091.1041.camel@jzny.localdomain> <200501171404.19451.hasso@estpak.ee> In-Reply-To: <200501171404.19451.hasso@estpak.ee> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 388 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tommy.christensen@tpack.net Precedence: bulk X-list: netdev Hasso Tepper wrote: > All this work is done to avoid sending stale packets to the network? Ie. > there will be no change regarding socket blocking issue? Detecting carrier > on/off and/or socket per interface is must be for us in user space to avoid > socket blocking? I'm just trying to have full picture so I can put my > priorities in place for next release. A proper solution would take care of both these issues: "stale packets" and "socket blocking". They are pretty much related. Using a socket for each interface *ought* not be needed. Carrier detection sounds like a good thing in its own right. Hope this helps, Tommy From davem@davemloft.net Mon Jan 17 14:13:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 14:14:22 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HMD6AJ016068 for ; Mon, 17 Jan 2005 14:13:07 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cqf6P-0005kZ-00; Mon, 17 Jan 2005 14:12:01 -0800 Date: Mon, 17 Jan 2005 14:12:01 -0800 From: "David S. Miller" To: "Arthur D. Kepner" Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH bk-2.6.10] tg3:align IP headers from 5701 in PCI-X mode Message-Id: <20050117141201.37b0fda7.davem@davemloft.net> In-Reply-To: References: X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 390 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Tue, 11 Jan 2005 12:49:05 -0600 (CST) "Arthur D. Kepner" wrote: > On Mon, 10 Jan 2005, David S. Miller wrote: > > > Let's just do this all the time for this case, adding new config > > options for stuff like this does nothing more than create confusion. > > OK, you mean like the following? Yep, patch applied. Thanks Arthur. From peter@pantasys.com Mon Jan 17 14:13:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 14:14:02 -0800 (PST) Received: from panta-1.pantasys.com (64-60-250-34.cust.telepacific.net [64.60.250.34]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HMDf7o016099 for ; Mon, 17 Jan 2005 14:13:42 -0800 Received: from [10.1.40.165] ([10.1.40.1]) by panta-1.pantasys.com with Microsoft SMTPSVC(5.0.2195.6713); Mon, 17 Jan 2005 14:08:23 -0800 Message-ID: <41EC3894.9090304@pantasys.com> Date: Mon, 17 Jan 2005 14:13:40 -0800 From: Peter Buckingham User-Agent: Mozilla Thunderbird 0.9 (X11/20041124) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tommy Christensen CC: Hasso Tepper , hadi@cyberus.ca, Jeff Garzik , Thomas Spatzier , "David S. Miller" , Herbert Xu , netdev@oss.sgi.com, Paul Jakma Subject: Re: [patch 4/10] s390: network driver. References: <1105363092.1041.146.camel@jzny.localdomain> <1105917038.1091.1041.camel@jzny.localdomain> <200501171404.19451.hasso@estpak.ee> <41EC3680.7060108@tpack.net> In-Reply-To: <41EC3680.7060108@tpack.net> X-Enigmail-Version: 0.89.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 17 Jan 2005 22:08:23.0843 (UTC) FILETIME=[0FEFC730:01C4FCE1] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 389 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: peter@pantasys.com Precedence: bulk X-list: netdev Hi, Tommy Christensen wrote: > A proper solution would take care of both these issues: "stale packets" > and "socket blocking". They are pretty much related. > > Using a socket for each interface *ought* not be needed. > Carrier detection sounds like a good thing in its own right. I came across this same problem with multicast/unicast with an e1000. For a quick hack we just check to see whether the carrier is ok, if it's not we just drop the packet. this might do some nasty things with tcp and it may be better to check to see wither the socket buffer is full, but this works for me here... (this is against a 2.6.9ish kernel) peter Index: net/core/dev.c =================================================================== --- net/core/dev.c +++ net/core/dev.c @@ -1379,6 +1379,11 @@ #ifdef CONFIG_NET_CLS_ACT skb->tc_verd = SET_TC_AT(skb->tc_verd,AT_EGRESS); #endif + if (!netif_carrier_ok(dev)) { + rc = NET_XMIT_DROP; + goto out_kfree_skb; + } + if (q->enqueue) { /* Grab device queue */ spin_lock(&dev->queue_lock); From shemminger@osdl.org Mon Jan 17 14:24:24 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 14:24:30 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HMOLq5018542 for ; Mon, 17 Jan 2005 14:24:22 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0HMOAl05419; Mon, 17 Jan 2005 14:24:10 -0800 Date: Mon, 17 Jan 2005 14:24:13 -0800 From: Stephen Hemminger To: hadi@znyx.com Cc: netdev@oss.sgi.com Subject: Re: Iproute2: update Message-ID: <20050117142413.3ef1fb63@dxpl.pdx.osdl.net> In-Reply-To: <1105897532.1097.749.camel@jzny.localdomain> References: <20050112125903.64d42737@dxpl.pdx.osdl.net> <1105895352.1091.705.camel@jzny.localdomain> <1105897532.1097.749.camel@jzny.localdomain> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 393 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev On 16 Jan 2005 12:45:32 -0500 Jamal Hadi Salim wrote: > On Sun, 2005-01-16 at 12:09, jamal wrote: > > Here's one fix > > > > And another one from before that is missing from the current version. > Also something for the makefile - You may be unhappy with the way the > IPT_INCL is defined in the makefile. Yup, I am not going to let the in. I put the iptables headers needed in include. > Feel free to move it to configure etc or even kill it if it works > without it. > > cheers, > jamal -- Stephen Hemminger From tgraf@suug.ch Mon Jan 17 14:24:18 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 14:24:23 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HMOHCg018550 for ; Mon, 17 Jan 2005 14:24:18 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id B2C6D84; Mon, 17 Jan 2005 23:23:54 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 8B9851C0EA; Mon, 17 Jan 2005 23:24:37 +0100 (CET) Date: Mon, 17 Jan 2005 23:24:37 +0100 From: Thomas Graf To: jamal Cc: Stephen Hemminger , netdev@oss.sgi.com Subject: Re: Iproute2: update Message-ID: <20050117222437.GI26856@postel.suug.ch> References: <20050112125903.64d42737@dxpl.pdx.osdl.net> <1105895352.1091.705.camel@jzny.localdomain> <1105897532.1097.749.camel@jzny.localdomain> <20050117202022.GG26856@postel.suug.ch> <20050117205734.GH26856@postel.suug.ch> <1105997946.1078.308.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1105997946.1078.308.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 392 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1105997946.1078.308.camel@jzny.localdomain> 2005-01-17 16:39 > On Mon, 2005-01-17 at 15:57, Thomas Graf wrote: > > > I'll put this changes into my tree given you're fine with it and stephen > > > can pull them. As I said, the ipt code is still missing, I can merge > > > them into my tree as well if you want. > > > > Stephen: you can pull jamal's changes with my modifications from > > bk://tgr.bkbits.net/iproute2-tgr if you like. > > Thomas, > > Look at iproute2-2.6.10-ss050112 - ipt is in there and thats where my > patches are against. > > ---- > [hadi@jzny hadi]$ find iproute2-2.6.10-ss050112 | grep ipt > iproute2-2.6.10-ss050112/examples/dhcp-client-script > iproute2-2.6.10-ss050112/tc/m_ipt.c > iproute2-2.6.10-ss050112/ip/iptunnel.c > iproute2-2.6.10-ss050112/include/iptables.h > iproute2-2.6.10-ss050112/include/libiptc > iproute2-2.6.10-ss050112/include/libiptc/ipt_kernel_headers.h > iproute2-2.6.10-ss050112/include/libiptc/libip6tc.h > iproute2-2.6.10-ss050112/include/libiptc/libiptc.h > iproute2-2.6.10-ss050112/include/iptables_common.h > iproute2-2.6.10-ss050112/include/linux/tc_act/tc_ipt.h > ----------- Ah, great. I didn't look at the release and they're not in the bk tree. Maybe stephen forgot to push his changes. > So the IPT thing is unneeded. Also note that i had it the way you > have it in configure but Stephen didnt like it. OK. I don't care, it's really ugly to compile iproute2 without iptables sources though. > In regards to pedit - wait until the code goes in then shoot at it. > Theres plenty of things for you to shoot at ;-> i think last time i > really looked at it was ~2 years ago. I'll keep those changes and eventually merge them sometimes. It's not that important. From ak@suse.de Mon Jan 17 14:23:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 14:23:48 -0800 (PST) Received: from Cantor.suse.de (news.suse.de [195.135.220.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HMNfBo018341 for ; Mon, 17 Jan 2005 14:23:42 -0800 Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 94E1C1359B85; Mon, 17 Jan 2005 23:23:35 +0100 (CET) Date: Mon, 17 Jan 2005 23:23:35 +0100 From: Andi Kleen To: davem@redhat.com, netdev@oss.sgi.com Subject: [PATCH] Use unlocked_ioctl for sock_ioctl Message-ID: <20050117222335.GC10882@wotan.suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 391 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@suse.de Precedence: bulk X-list: netdev Now that unlocked_ioctl has been merged use it for sock_ioctl. Signed-off-by: Andi Kleen diff -u linux-2.6.11-rc1-bk4/net/socket.c-o linux-2.6.11-rc1-bk4/net/socket.c --- linux-2.6.11-rc1-bk4/net/socket.c-o 2005-01-17 10:39:43.000000000 +0100 +++ linux-2.6.11-rc1-bk4/net/socket.c 2005-01-17 14:24:21.000000000 +0100 @@ -104,7 +104,7 @@ static int sock_close(struct inode *inode, struct file *file); static unsigned int sock_poll(struct file *file, struct poll_table_struct *wait); -static int sock_ioctl(struct inode *inode, struct file *file, +static long sock_ioctl(struct file *file, unsigned int cmd, unsigned long arg); static int sock_fasync(int fd, struct file *filp, int on); static ssize_t sock_readv(struct file *file, const struct iovec *vector, @@ -126,7 +126,7 @@ .aio_read = sock_aio_read, .aio_write = sock_aio_write, .poll = sock_poll, - .ioctl = sock_ioctl, + .unlocked_ioctl = sock_ioctl, .mmap = sock_mmap, .open = sock_no_open, /* special open code to disallow open via /proc */ .release = sock_close, @@ -829,15 +829,13 @@ * what to do with it - that's up to the protocol still. */ -static int sock_ioctl(struct inode *inode, struct file *file, unsigned int cmd, - unsigned long arg) +static long sock_ioctl(struct file *file, unsigned cmd, unsigned long arg) { struct socket *sock; void __user *argp = (void __user *)arg; int pid, err; - unlock_kernel(); - sock = SOCKET_I(inode); + sock = SOCKET_I(file->f_dentry->d_inode); if (cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) { err = dev_ioctl(cmd, argp); } else @@ -903,8 +901,6 @@ err = sock->ops->ioctl(sock, cmd, arg); break; } - lock_kernel(); - return err; } From hadi@cyberus.ca Mon Jan 17 14:28:44 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 14:28:50 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HMSilh019932 for ; Mon, 17 Jan 2005 14:28:44 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CqfMa-0005Ri-IA for netdev@oss.sgi.com; Mon, 17 Jan 2005 17:28:44 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqfMU-0006Wd-Mo; Mon, 17 Jan 2005 17:28:38 -0500 Subject: Re: [PATCH] ipv6: alternative version of S/390 shared NIC support From: jamal Reply-To: hadi@cyberus.ca To: "David S. Miller" Cc: Christoph Hellwig , pavlic@de.ibm.com, waldi@debian.org, netdev@oss.sgi.com In-Reply-To: <20050117134228.5a6002a0.davem@davemloft.net> References: <20050116115431.GA13617@lst.de> <20050117134228.5a6002a0.davem@davemloft.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1106000914.1046.4.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 17 Jan 2005 17:28:34 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 394 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Dave, Refer to my comments: any device that ends up having to do that is a hack in my opinion;-> The dev_id maybe useful for other things. the qeth driver needs fixing so it can stack the per-os instance interfaces. cheers, jamal On Mon, 2005-01-17 at 16:42, David S. Miller wrote: > On Sun, 16 Jan 2005 12:54:31 +0100 > Christoph Hellwig wrote: > > > Let's try again solvign the EUI64 generation for S/390. I looked over > > the IBM patch and I think it can be done a lot simpler: > > > > - put a dev_id field in struct net_device, so that it uses space that > > would be wasted by padding otherwise. > > - if this fields is non-null let ipv6_generate_eui64 use the algorithm > > from the QETH code to generate an EUI that's different for each > > OS instance. See code comments for details. > > I'll apply this patch. > > It might be nice to genericize that huge comment. This will likely > be not the last time we see devices which have this characteristic. > > From hadi@cyberus.ca Mon Jan 17 14:36:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 14:36:46 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HMadwC021105 for ; Mon, 17 Jan 2005 14:36:42 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1CqfUD-0005yd-Rn for netdev@oss.sgi.com; Mon, 17 Jan 2005 17:36:37 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqfU5-0007r7-RV; Mon, 17 Jan 2005 17:36:30 -0500 Subject: Re: [patch 4/10] s390: network driver. From: jamal Reply-To: hadi@cyberus.ca To: Peter Buckingham Cc: Tommy Christensen , Hasso Tepper , Jeff Garzik , Thomas Spatzier , "David S. Miller" , Herbert Xu , netdev@oss.sgi.com, Paul Jakma In-Reply-To: <41EC3894.9090304@pantasys.com> References: <1105363092.1041.146.camel@jzny.localdomain> <1105917038.1091.1041.camel@jzny.localdomain> <200501171404.19451.hasso@estpak.ee> <41EC3680.7060108@tpack.net> <41EC3894.9090304@pantasys.com> Content-Type: text/plain Organization: jamalopolous Message-Id: <1106001385.1036.7.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 17 Jan 2005 17:36:26 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 395 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Hi there, The solution that Tommy and myself have been batting around is a lot more cleaner than this (however still doesnt solve the issue 100%) cheers, jamal On Mon, 2005-01-17 at 17:13, Peter Buckingham wrote: > Hi, > > Tommy Christensen wrote: > > A proper solution would take care of both these issues: "stale packets" > > and "socket blocking". They are pretty much related. > > > > Using a socket for each interface *ought* not be needed. > > Carrier detection sounds like a good thing in its own right. > > I came across this same problem with multicast/unicast with an e1000. > For a quick hack we just check to see whether the carrier is ok, if it's > not we just drop the packet. this might do some nasty things with tcp > and it may be better to check to see wither the socket buffer is full, > but this works for me here... (this is against a 2.6.9ish kernel) > > peter > > Index: net/core/dev.c > =================================================================== > --- net/core/dev.c > +++ net/core/dev.c > @@ -1379,6 +1379,11 @@ > #ifdef CONFIG_NET_CLS_ACT > skb->tc_verd = SET_TC_AT(skb->tc_verd,AT_EGRESS); > #endif > + if (!netif_carrier_ok(dev)) { > + rc = NET_XMIT_DROP; > + goto out_kfree_skb; > + } > + > if (q->enqueue) { > /* Grab device queue */ > spin_lock(&dev->queue_lock); > > From hadi@cyberus.ca Mon Jan 17 14:40:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 14:40:06 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HMe1NS021725 for ; Mon, 17 Jan 2005 14:40:02 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1CqfXT-0007i5-Pq for netdev@oss.sgi.com; Mon, 17 Jan 2005 17:39:59 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqfXS-0008GS-3m; Mon, 17 Jan 2005 17:39:58 -0500 Subject: Re: Iproute2: update From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: Stephen Hemminger , netdev@oss.sgi.com In-Reply-To: <20050117222437.GI26856@postel.suug.ch> References: <20050112125903.64d42737@dxpl.pdx.osdl.net> <1105895352.1091.705.camel@jzny.localdomain> <1105897532.1097.749.camel@jzny.localdomain> <20050117202022.GG26856@postel.suug.ch> <20050117205734.GH26856@postel.suug.ch> <1105997946.1078.308.camel@jzny.localdomain> <20050117222437.GI26856@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1106001594.1036.10.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 17 Jan 2005 17:39:54 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 396 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Mon, 2005-01-17 at 17:24, Thomas Graf wrote: > > I'll keep those changes and eventually merge them sometimes. It's not > that important. np - they all look good except the one where you refer to me as talking to myself ;-> cheers, jamal From davem@davemloft.net Mon Jan 17 14:41:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 14:41:16 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HMf9f0022203 for ; Mon, 17 Jan 2005 14:41:09 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CqfX6-0005sv-00; Mon, 17 Jan 2005 14:39:36 -0800 Date: Mon, 17 Jan 2005 14:39:35 -0800 From: "David S. Miller" To: Herbert Xu Cc: netdev@oss.sgi.com Subject: Re: [TCP] Remove tcp_pcount_t Message-Id: <20050117143935.6b141791.davem@davemloft.net> In-Reply-To: <20050117101058.GA27521@gondor.apana.org.au> References: <20050117101058.GA27521@gondor.apana.org.au> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 397 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Mon, 17 Jan 2005 21:10:58 +1100 Herbert Xu wrote: > IMHO the TSO stuff has mostly settled down now. As a result > tcp_pcount_t is now more of a liability in that it reduces the > readability of the code. > > So here is a patch to remove it. > > Signed-off-by: Herbert Xu Agreed and applied, thanks Herbert. From davem@davemloft.net Mon Jan 17 14:41:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 14:42:01 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HMfrnO022622 for ; Mon, 17 Jan 2005 14:41:55 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CqfVC-0005rW-00; Mon, 17 Jan 2005 14:37:38 -0800 Date: Mon, 17 Jan 2005 14:37:38 -0800 From: "David S. Miller" To: Adrian Bunk Cc: acme@conectiva.com.br, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [2.6 patch] net/802/: some cleanups Message-Id: <20050117143738.0cf1ed02.davem@davemloft.net> In-Reply-To: <20050117081438.GE4274@stusta.de> References: <20041212201115.GU22324@stusta.de> <20041227184923.5b26f5a0.davem@davemloft.net> <20050117081438.GE4274@stusta.de> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 398 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Mon, 17 Jan 2005 09:14:38 +0100 Adrian Bunk wrote: > On Mon, Dec 27, 2004 at 06:49:23PM -0800, David S. Miller wrote: > > > > drivers/net/net_init.c no longer exists in the source tree :) > > Updated patch: > > > <-- snip --> > > > This patch contains the following cleanups: > - make some needlessly global code static > - net/802/hippi.c: remove the unused global function hippi_net_init > - net/8021q/vlan.c: remove the global variable vlan_default_dev_flags > that was never changed > > Signed-off-by: Adrian Bunk Applied, thanks Adrian. From davem@davemloft.net Mon Jan 17 14:44:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 14:44:13 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HMi6vg023256 for ; Mon, 17 Jan 2005 14:44:06 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CqfaN-0005tG-00; Mon, 17 Jan 2005 14:42:59 -0800 Date: Mon, 17 Jan 2005 14:42:59 -0800 From: "David S. Miller" To: hadi@cyberus.ca Cc: hch@lst.de, pavlic@de.ibm.com, waldi@debian.org, netdev@oss.sgi.com Subject: Re: [PATCH] ipv6: alternative version of S/390 shared NIC support Message-Id: <20050117144259.7882e629.davem@davemloft.net> In-Reply-To: <1106000914.1046.4.camel@jzny.localdomain> References: <20050116115431.GA13617@lst.de> <20050117134228.5a6002a0.davem@davemloft.net> <1106000914.1046.4.camel@jzny.localdomain> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 399 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On 17 Jan 2005 17:28:34 -0500 jamal wrote: > Refer to my comments: > any device that ends up having to do that is a hack in my opinion;-> > The dev_id maybe useful for other things. the qeth driver needs fixing > so it can stack the per-os instance interfaces. I agree but... At least Christian's patch is 100 times cleaner than what IBM has proposed. People have been "talking" endlessly about providing a clean version of the infrastructure necessary to support what qeth needs for EUI64 generation, but everyone did nothing but talk and suggest. Christian backed up his "talk" with "code", and since his changes aren't that unreasonable they go in :-) From davem@davemloft.net Mon Jan 17 14:45:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 14:45:42 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HMjbBt023703 for ; Mon, 17 Jan 2005 14:45:37 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cqfbr-0005uE-00; Mon, 17 Jan 2005 14:44:31 -0800 Date: Mon, 17 Jan 2005 14:44:31 -0800 From: "David S. Miller" To: Andi Kleen Cc: netdev@oss.sgi.com Subject: Re: [PATCH] Use unlocked_ioctl for sock_ioctl Message-Id: <20050117144431.587a739f.davem@davemloft.net> In-Reply-To: <20050117222335.GC10882@wotan.suse.de> References: <20050117222335.GC10882@wotan.suse.de> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 400 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Mon, 17 Jan 2005 23:23:35 +0100 Andi Kleen wrote: > > Now that unlocked_ioctl has been merged use it for sock_ioctl. > > Signed-off-by: Andi Kleen Applied, thanks Andi. From hadi@cyberus.ca Mon Jan 17 14:50:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 14:50:12 -0800 (PST) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HMo85G024466 for ; Mon, 17 Jan 2005 14:50:08 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.30) id 1CqfhE-0006Jm-Bf for netdev@oss.sgi.com; Mon, 17 Jan 2005 17:50:04 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqfhA-0001J5-TD; Mon, 17 Jan 2005 17:50:01 -0500 Subject: Re: [RFC] batched tc to improve change throughput From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com In-Reply-To: <20050117165626.GE26856@postel.suug.ch> References: <20050117152312.GC26856@postel.suug.ch> <1105976711.1078.1.camel@jzny.localdomain> <20050117160539.GD26856@postel.suug.ch> <1105979807.1078.16.camel@jzny.localdomain> <20050117165626.GE26856@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1106002197.1046.19.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 17 Jan 2005 17:49:57 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 401 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Mon, 2005-01-17 at 11:56, Thomas Graf wrote: > * jamal <1105979807.1078.16.camel@jzny.localdomain> 2005-01-17 11:36 [..] > > Didnt follow this - uses the same code as command line. What logic gets > > duplicated? > > The parsing of top level nodes. Probably not very big deal - will just force you to type in the commands in full over and over in your batch file > > > - it doesn't allow any commenting > > > > Trivial thing you can fix in about 33.5 seconds ;- > > Simple full-line comments yes, mid-line comments no. -batch > is also not able to split things across multiple lines. > > I want my scripts to look like this: > > /** > * filter dla_fp > * match DLA traffic at lower watermark > */ > tc filter add > dev %DEV > parent 1:12 > prio 40 > protocol all > basic match meta(nfmark eq %LOW_WATERMARK) > and ( > nbyte("\x0\x1\x2\x3\x4" at 4 layer 2) /* 00 01 02 03 04 (dla fp) */ > or u32(ip src 10.0.0.0/8) > ) > flowid 1:20 > > It does look clean. - btw look at Werners approach on tcng as well. > > > - it doesn't get along with my more complicated ematch parsing > > > > Example? > > stuff like nbyte, kmp or regexp rely on quoted strings and those > would be destroyed if they'd contain whitespaces. sounds reasonable. Another thing that would be really neat is to have a iso like cli (something like what zebra has) so you can go down the parse tree to say the ematch level and just start typing away these commands. Should probably be easy to rip off the vtysh stuff off zebra or use libio or something along those lines to do this. cheers, jamal From tommy.christensen@tpack.net Mon Jan 17 14:51:23 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 14:51:29 -0800 (PST) Received: from mail.tpack.net (ip18.tpack.net [213.173.228.18]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0HMpMKm024827 for ; Mon, 17 Jan 2005 14:51:23 -0800 Received: (qmail 17326 invoked from network); 17 Jan 2005 22:51:16 -0000 Received: from dhcp-245.cph.tpack.net (HELO ?172.17.159.11?) (192.168.0.245) by 0 with SMTP; 17 Jan 2005 22:51:16 -0000 Message-ID: <41EC41D1.1070704@tpack.net> Date: Mon, 17 Jan 2005 23:53:05 +0100 From: Tommy Christensen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Peter Buckingham CC: Hasso Tepper , hadi@cyberus.ca, Jeff Garzik , Thomas Spatzier , "David S. Miller" , Herbert Xu , netdev@oss.sgi.com, Paul Jakma Subject: Re: [patch 4/10] s390: network driver. References: <1105363092.1041.146.camel@jzny.localdomain> <1105917038.1091.1041.camel@jzny.localdomain> <200501171404.19451.hasso@estpak.ee> <41EC3680.7060108@tpack.net> <41EC3894.9090304@pantasys.com> In-Reply-To: <41EC3894.9090304@pantasys.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 402 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tommy.christensen@tpack.net Precedence: bulk X-list: netdev Peter Buckingham wrote: > Hi, > > Tommy Christensen wrote: > >> A proper solution would take care of both these issues: "stale packets" >> and "socket blocking". They are pretty much related. >> >> Using a socket for each interface *ought* not be needed. >> Carrier detection sounds like a good thing in its own right. > > > I came across this same problem with multicast/unicast with an e1000. > For a quick hack we just check to see whether the carrier is ok, if it's > not we just drop the packet. this might do some nasty things with tcp > and it may be better to check to see wither the socket buffer is full, > but this works for me here... (this is against a 2.6.9ish kernel) Thanks for the input! The downside of this solution is that it doesn't do anything with the packets already queued for tx (in the qdisc queue and in the DMA ring). OTOH it probably works just fine in real life (!). Also, we may not want to handle all devices alike, as this patch does. -Tommy From hadi@cyberus.ca Mon Jan 17 14:54:45 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 14:54:50 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HMsidJ025966 for ; Mon, 17 Jan 2005 14:54:44 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1Cqflj-0006H4-RQ for netdev@oss.sgi.com; Mon, 17 Jan 2005 17:54:43 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Cqfle-0001uO-1V; Mon, 17 Jan 2005 17:54:38 -0500 Subject: Re: [PATCH] ipv6: alternative version of S/390 shared NIC support From: jamal Reply-To: hadi@cyberus.ca To: "David S. Miller" Cc: hch@lst.de, pavlic@de.ibm.com, waldi@debian.org, netdev@oss.sgi.com In-Reply-To: <20050117144259.7882e629.davem@davemloft.net> References: <20050116115431.GA13617@lst.de> <20050117134228.5a6002a0.davem@davemloft.net> <1106000914.1046.4.camel@jzny.localdomain> <20050117144259.7882e629.davem@davemloft.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1106002474.1036.23.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 17 Jan 2005 17:54:34 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 403 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Mon, 2005-01-17 at 17:42, David S. Miller wrote: > At least Christian's patch is 100 times cleaner than what IBM > has proposed. People have been "talking" endlessly about providing > a clean version of the infrastructure necessary to support what > qeth needs for EUI64 generation, but everyone did nothing but > talk and suggest. I think theyd shoot me if i rewrote the driver ;-> And i probably wont have the cycles. But id be more than happy to work with anyone making the changes. cheers, jamal From hch@lst.de Mon Jan 17 14:59:56 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 15:00:00 -0800 (PST) Received: from mail.lst.de (verein.lst.de [213.95.11.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HMxt7K026707 for ; Mon, 17 Jan 2005 14:59:56 -0800 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id j0HMxk6t011896 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Mon, 17 Jan 2005 23:59:46 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id j0HMxkap011894; Mon, 17 Jan 2005 23:59:46 +0100 Date: Mon, 17 Jan 2005 23:59:46 +0100 From: Christoph Hellwig To: jamal Cc: "David S. Miller" , pavlic@de.ibm.com, waldi@debian.org, netdev@oss.sgi.com Subject: Re: [PATCH] ipv6: alternative version of S/390 shared NIC support Message-ID: <20050117225946.GA11845@lst.de> References: <20050116115431.GA13617@lst.de> <1105885839.1097.573.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1105885839.1097.573.camel@jzny.localdomain> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 404 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: netdev On Sun, Jan 16, 2005 at 09:30:40AM -0500, jamal wrote: > I could be missing something: > Its almost like the "cards" in these drivers deserve to be their own > netdevices to begin with. In other words the qeth approach itself seems > to be a hack to begin with. > Should be along the lines: > --->Physical netdevice > -->some demux code to select instance > --> Virtual netdevice specific to OS instance > ---> standard linux path The problem is again that the OS instances don't talk to each (well they can, but not in the driver), so your demux code would have to move into the device firmware, and that'd probably change the device <-> OS interface completely. From hadi@cyberus.ca Mon Jan 17 15:11:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 15:11:35 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HNBUhq027821 for ; Mon, 17 Jan 2005 15:11:30 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1Cqg1x-0007Pl-14 for netdev@oss.sgi.com; Mon, 17 Jan 2005 18:11:29 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Cqg1t-0004FH-Ql; Mon, 17 Jan 2005 18:11:26 -0500 Subject: Re: [PATCH] ipv6: alternative version of S/390 shared NIC support From: jamal Reply-To: hadi@cyberus.ca To: Christoph Hellwig Cc: "David S. Miller" , pavlic@de.ibm.com, waldi@debian.org, netdev@oss.sgi.com In-Reply-To: <20050117225946.GA11845@lst.de> References: <20050116115431.GA13617@lst.de> <1105885839.1097.573.camel@jzny.localdomain> <20050117225946.GA11845@lst.de> Content-Type: text/plain Organization: jamalopolous Message-Id: <1106003481.1035.35.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 17 Jan 2005 18:11:21 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 405 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Mon, 2005-01-17 at 17:59, Christoph Hellwig wrote: > The problem is again that the OS instances don't talk to each > (well they can, but not in the driver), so your demux code would > have to move into the device firmware, and that'd probably change > the device <-> OS interface completely. qeth_qdio_input_handler() seems to know what "card" the packet came on, no? Could you not use this information to select the proper netdevice? Actually, how does that work? Each OS instance would get the same driver invoked but you will never see any othe instances "cards"? cheers, jamal From herbert@gondor.apana.org.au Mon Jan 17 15:12:34 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 15:12:41 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HNCWTB028196 for ; Mon, 17 Jan 2005 15:12:33 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1Cqg2T-0008Rp-00; Tue, 18 Jan 2005 10:12:01 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1Cqg1w-0005WK-00; Tue, 18 Jan 2005 10:11:28 +1100 Date: Tue, 18 Jan 2005 10:11:28 +1100 To: "David S. Miller" Cc: tommy.christensen@tpack.net, simon.roscic@chello.at, netdev@oss.sgi.com Subject: Re: [NETLINK] Do not netlink_unicast shared packet in kernel/audit.c Message-ID: <20050117231128.GA21204@gondor.apana.org.au> References: <41E942AF.3030202@tpack.net> <20050115183023.GA31211@gondor.apana.org.au> <41E97B1A.30205@tpack.net> <20050116080254.GA2997@gondor.apana.org.au> <20050117133640.0405d791.davem@davemloft.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="UlVJffcvxoiEqYs2" Content-Disposition: inline In-Reply-To: <20050117133640.0405d791.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 406 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev --UlVJffcvxoiEqYs2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jan 17, 2005 at 01:36:40PM -0800, David S. Miller wrote: > > I think this patch is buggy. At least in the final hunk, we > do this: > > info.skb = skb; > ... > skb = netlink_trim( ... ); > > Now info.skb can be pointing to a freed up skb. Doh! Here is the corrected version. Signed-off-by: Herbert Xu Thanks Dave. -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --UlVJffcvxoiEqYs2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p --- /home/gondolin/herbert/src/bk/linux-2.6/net/netlink/af_netlink.c.orig 2005-01-18 10:06:45.000000000 +1100 +++ /home/gondolin/herbert/src/bk/linux-2.6/net/netlink/af_netlink.c 2005-01-18 10:09:54.000000000 +1100 @@ -660,7 +660,7 @@ sock_put(sk); } -static inline void netlink_trim(struct sk_buff *skb, int allocation) +static inline struct sk_buff *netlink_trim(struct sk_buff *skb, int allocation) { int delta; @@ -668,10 +668,20 @@ delta = skb->end - skb->tail; if (delta * 2 < skb->truesize) - return; - if (pskb_expand_head(skb, 0, -delta, allocation)) - return; - skb->truesize -= delta; + return skb; + + if (skb_shared(skb)) { + struct sk_buff *nskb = skb_clone(skb, allocation); + if (!nskb) + return skb; + kfree_skb(skb); + skb = nskb; + } + + if (!pskb_expand_head(skb, 0, -delta, allocation)) + skb->truesize -= delta; + + return skb; } int netlink_unicast(struct sock *ssk, struct sk_buff *skb, u32 pid, int nonblock) @@ -680,7 +690,7 @@ int err; long timeo; - netlink_trim(skb, gfp_any()); + skb = netlink_trim(skb, gfp_any()); timeo = sock_sndtimeo(ssk, nonblock); retry: @@ -778,6 +788,8 @@ struct hlist_node *node; struct sock *sk; + skb = netlink_trim(skb, allocation); + info.exclude_sk = ssk; info.pid = pid; info.group = group; @@ -788,8 +800,6 @@ info.skb = skb; info.skb2 = NULL; - netlink_trim(skb, allocation); - /* While we sleep in clone, do not allow to change socket list */ netlink_lock_table(); --UlVJffcvxoiEqYs2-- From christian@borntraeger.net Mon Jan 17 15:38:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 15:38:08 -0800 (PST) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.177]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0HNc2i3030061 for ; Mon, 17 Jan 2005 15:38:02 -0800 Received: from [212.227.126.209] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1CqgRX-0003u9-00; Tue, 18 Jan 2005 00:37:55 +0100 Received: from [84.56.148.232] (helo=cubus.S-IK) by mrelayng.kundenserver.de with asmtp (TLSv1:RC4-MD5:128) (Exim 3.35 #1) id 1CqgRX-0001lz-00; Tue, 18 Jan 2005 00:37:55 +0100 From: Christian =?iso-8859-15?q?Borntr=E4ger?= To: hadi@cyberus.ca Subject: Re: [PATCH] ipv6: alternative version of S/390 shared NIC support Date: Tue, 18 Jan 2005 00:37:57 +0100 User-Agent: KMail/1.7.1 Cc: Christoph Hellwig , "David S. Miller" , pavlic@de.ibm.com, waldi@debian.org, netdev@oss.sgi.com References: <20050116115431.GA13617@lst.de> <20050117225946.GA11845@lst.de> <1106003481.1035.35.camel@jzny.localdomain> In-Reply-To: <1106003481.1035.35.camel@jzny.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501180037.58453.christian@borntraeger.net> X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:5a8b66f42810086ecd21595c2d6103b9 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 407 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: christian@borntraeger.net Precedence: bulk X-list: netdev jamal wrote: > On Mon, 2005-01-17 at 17:59, Christoph Hellwig wrote: > > The problem is again that the OS instances don't talk to each > > (well they can, but not in the driver), so your demux code would > > have to move into the device firmware, and that'd probably change > > the device <-> OS interface completely. > > qeth_qdio_input_handler() seems to know what "card" the packet came on, > no? Could you not use this information to select the proper netdevice? > Actually, how does that work? Each OS instance would get the same driver > invoked but you will never see any othe instances "cards"? I am trying a small simplification here: Each physical network adapter offers hundreds of device addresses. You need 3 of them to have one logical network adapter(read,write,data). S/390 has hardware supported virtualization. Therefore can then use the hypervisor (LPAR or z/VM) to give specific LPARs or VM guests exactly 3 device addresses out of these hundreds. The qeth driver has to register the IP address at the logical network card (using 3 device addresses) Afterwards the physical network card knows which packet belongs to which device numbers. cheers Christian From hadi@cyberus.ca Mon Jan 17 16:49:57 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 16:50:01 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0I0nusH006946 for ; Mon, 17 Jan 2005 16:49:57 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CqhZF-0007Sf-6Z for netdev@oss.sgi.com; Mon, 17 Jan 2005 19:49:57 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CqhZ7-0007pr-Dq; Mon, 17 Jan 2005 19:49:49 -0500 Subject: Re: [PATCH] ipv6: alternative version of S/390 shared NIC support From: jamal Reply-To: hadi@cyberus.ca To: Christian =?ISO-8859-1?Q?Borntr=E4ger?= Cc: Christoph Hellwig , "David S. Miller" , pavlic@de.ibm.com, waldi@debian.org, netdev@oss.sgi.com In-Reply-To: <200501180037.58453.christian@borntraeger.net> References: <20050116115431.GA13617@lst.de> <20050117225946.GA11845@lst.de> <1106003481.1035.35.camel@jzny.localdomain> <200501180037.58453.christian@borntraeger.net> Content-Type: text/plain; charset=ISO-8859-1 Organization: jamalopolous Message-Id: <1106009385.1046.49.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 17 Jan 2005 19:49:45 -0500 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 408 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Mon, 2005-01-17 at 18:37, Christian Bornträger wrote: > I am trying a small simplification here: > Each physical network adapter offers hundreds of device addresses. You need > 3 of them to have one logical network adapter(read,write,data). the "card" concept is what you call network adapter, correct? I take it that read and write are control channels and data is where the skb comes through? > S/390 has > hardware supported virtualization. Therefore can then use the hypervisor > (LPAR or z/VM) to give specific LPARs or VM guests exactly 3 device > addresses out of these hundreds. Can you provision multiple of these cards per VM? if yes, is there some ID that will break it down to OSInstance:cardid? > The qeth driver has to register the IP address at the logical network card > (using 3 device addresses) Afterwards the physical network card knows which > packet belongs to which device numbers. I think i understood but confused: before you attach IP address though, you cant receive packets? Is there a concept of MAC address which you can pass to the hypervisor or can you run in promiscmous mode? Another question: When that driver runs for the physical card - it runs in the context of a specific VM, correct? In other words it would be impossible to see the "card" of another instance? cheers, jamal From acme@conectiva.com.br Mon Jan 17 17:07:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 17:07:48 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0I17ZJL008332 for ; Mon, 17 Jan 2005 17:07:36 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1Cqh6D-0005Ur-00; Mon, 17 Jan 2005 22:19:57 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 5A5421462D; Mon, 17 Jan 2005 23:07:30 -0200 (BRST) Message-ID: <41EC626D.1010804@conectiva.com.br> Date: Mon, 17 Jan 2005 23:12:13 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" Cc: sri@us.ibm.com, netdev@oss.sgi.com Subject: Re: [PATCH] merge sctp_opt with sctp_sock References: <41E8A17D.9040307@conectiva.com.br> <20050117133327.0386763f.davem@davemloft.net> In-Reply-To: <20050117133327.0386763f.davem@davemloft.net> X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 409 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev David S. Miller escreveu: > On Sat, 15 Jan 2005 02:52:13 -0200 > Arnaldo Carvalho de Melo wrote: > > >> Please take a look and if its acceptable pull from: >> >>bk://kernel.bkbits.net/acme/connection_sock-2.6 >> >> The tricky bit here is that SCTP, to keep the existing logic, >>needs a way to copy only its private area from one sock to another, so >>I introduced a generic inet_sk_copy_descendant, that knows about the >>inet (v4/v6) layout (wrt inet_sock and inet6_pinfo), using this and >>sk->sk_prot->slab_obj_size we can copy the inet_sock descendant >>private area generically. > > > This looks fine, although I wish the descendant copying thing > could be done more cleanly somehow. /me too, but this is the best scheme I've found for now, perhaps in the future, after some more refactoring work is done/merged we can find some better way of doing this (tcp_create_openreq_child also does something like this, but does it in all the sock, perhaps SCTP can do something similar). In fact my ambition is after mucho refactoring have some common infrastructure even for child creation. OK, back to chainsawing net/{ax25,netrom,rose} into a state where we can actually use a slab cache for each of them, which is needed to get the connection_sock abstraction into place, most of the work is done, now I'm reading some HAM radio howtos and preparing a testbed using bpqether, etc. Oh, there is another legacy family to send to you first: IPv6 ;) > Pulled. Thanks. - Arnaldo From acme@conectiva.com.br Mon Jan 17 17:25:57 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 17:26:03 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0I1PtjQ009572 for ; Mon, 17 Jan 2005 17:25:56 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CqhNw-0005V9-00; Mon, 17 Jan 2005 22:38:16 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 07BCD1462D; Mon, 17 Jan 2005 23:25:48 -0200 (BRST) Message-ID: <41EC66B8.9080907@conectiva.com.br> Date: Mon, 17 Jan 2005 23:30:32 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" , =?UTF-8?B?WU9TSElGVUpJIEhpZGU=?= =?UTF-8?B?YWtpIC8g5ZCJ6Jek6Iux5piO?= Cc: Networking Team Subject: [IPV6] merge raw6_opt with raw6_sock X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------060700070601040908040502" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 410 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------060700070601040908040502 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi David, This finishes the inet protos part, now to the legacy protocols. Available at the usual place: bk://kernel.bkbits.net/acme/connection_sock-2.6 Regards, - Arnaldo --------------060700070601040908040502 Content-Type: text/plain; name="raw6_sock.patch" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="raw6_sock.patch" PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PQoKCkNoYW5nZVNldEAxLjIzMzUsIDIwMDUtMDEtMTUgMTk6MjQ6MTgt MDI6MDAsIGFjbWVAdG95Lmdob3N0cHJvdG9jb2xzLm5ldAogIFtJUFY2XSBtZXJnZSByYXc2 X3NvY2sgd2l0aCByYXc2X29wdAogIAogIE5vIG5lZWQgZm9yIHR3byBzdHJ1Y3RzLCBmb2xs b3cgdGhlIG5ldyBpbmV0X3NvY2sgbGF5b3V0IHN0eWxlLgogIAogIFNpZ25lZC1vZmYtYnk6 IEFybmFsZG8gQ2FydmFsaG8gZGUgTWVsbyA8YWNtZUBjb25lY3RpdmEuY29tLmJyPgogIFNp Z25lZC1vZmYtYnk6IERhdmlkIFMuIE1pbGxlciA8ZGF2ZW1AZGF2ZW1sb2Z0Lm5ldD4KCgog aW5jbHVkZS9saW51eC9pcHY2LmggfCAgIDIzICsrKysrKysrKysrLS0tLS0tLS0tLS0tCiBu ZXQvaXB2Ni9yYXcuYyAgICAgICB8ICAgNDEgKysrKysrKysrKysrKysrKysrKysrLS0tLS0t LS0tLS0tLS0tLS0tLS0KIDIgZmlsZXMgY2hhbmdlZCwgMzIgaW5zZXJ0aW9ucygrKSwgMzIg ZGVsZXRpb25zKC0pCgoKZGlmZiAtTnJ1IGEvaW5jbHVkZS9saW51eC9pcHY2LmggYi9pbmNs dWRlL2xpbnV4L2lwdjYuaAotLS0gYS9pbmNsdWRlL2xpbnV4L2lwdjYuaAkyMDA1LTAxLTE3 IDIzOjIyOjEyIC0wMjowMAorKysgYi9pbmNsdWRlL2xpbnV4L2lwdjYuaAkyMDA1LTAxLTE3 IDIzOjIyOjEyIC0wMjowMApAQCAtMjQ3LDI3ICsyNDcsMjYgQEAKIAl9IGNvcms7CiB9Owog Ci1zdHJ1Y3QgcmF3Nl9vcHQgeworLyogV0FSTklORzogZG9uJ3QgY2hhbmdlIHRoZSBsYXlv dXQgb2YgdGhlIG1lbWJlcnMgaW4ge3Jhdyx1ZHAsdGNwfTZfc29jayEgKi8KK3N0cnVjdCBy YXc2X3NvY2sgeworCS8qIGluZXRfc29jayBoYXMgdG8gYmUgdGhlIGZpcnN0IG1lbWJlciBv ZiByYXc2X3NvY2sgKi8KKwlzdHJ1Y3QgaW5ldF9zb2NrCWluZXQ7CiAJX191MzIJCQljaGVj a3N1bTsJLyogcGVyZm9ybSBjaGVja3N1bSAqLwogCV9fdTMyCQkJb2Zmc2V0OwkJLyogY2hl Y2tzdW0gb2Zmc2V0ICAqLwotCiAJc3RydWN0IGljbXA2X2ZpbHRlcglmaWx0ZXI7Ci19Owot Ci0vKiBXQVJOSU5HOiBkb24ndCBjaGFuZ2UgdGhlIGxheW91dCBvZiB0aGUgbWVtYmVycyBp biB7cmF3LHVkcCx0Y3B9Nl9zb2NrISAqLwotc3RydWN0IHJhdzZfc29jayB7Ci0Jc3RydWN0 IGluZXRfc29jayAgaW5ldDsKLQlzdHJ1Y3QgcmF3Nl9vcHQgICByYXc2OwotCXN0cnVjdCBp cHY2X3BpbmZvIGluZXQ2OworCS8qIGlwdjZfcGluZm8gaGFzIHRvIGJlIHRoZSBsYXN0IG1l bWJlciBvZiByYXc2X3NvY2ssIHNlZSBpbmV0Nl9za19nZW5lcmljICovCisJc3RydWN0IGlw djZfcGluZm8JaW5ldDY7CiB9OwogCiBzdHJ1Y3QgdWRwNl9zb2NrIHsKIAlzdHJ1Y3QgdWRw X3NvY2sJICB1ZHA7CisJLyogaXB2Nl9waW5mbyBoYXMgdG8gYmUgdGhlIGxhc3QgbWVtYmVy IG9mIHVkcDZfc29jaywgc2VlIGluZXQ2X3NrX2dlbmVyaWMgKi8KIAlzdHJ1Y3QgaXB2Nl9w aW5mbyBpbmV0NjsKIH07CiAKIHN0cnVjdCB0Y3A2X3NvY2sgewogCXN0cnVjdCB0Y3Bfc29j awkgIHRjcDsKKwkvKiBpcHY2X3BpbmZvIGhhcyB0byBiZSB0aGUgbGFzdCBtZW1iZXIgb2Yg dGNwNl9zb2NrLCBzZWUgaW5ldDZfc2tfZ2VuZXJpYyAqLwogCXN0cnVjdCBpcHY2X3BpbmZv IGluZXQ2OwogfTsKIApAQCAtMjc3LDkgKzI3Niw5IEBACiAJcmV0dXJuIGluZXRfc2soX19z ayktPnBpbmV0NjsKIH0KIAotc3RhdGljIGlubGluZSBzdHJ1Y3QgcmF3Nl9vcHQgKiByYXc2 X3NrKGNvbnN0IHN0cnVjdCBzb2NrICpfX3NrKQorc3RhdGljIGlubGluZSBzdHJ1Y3QgcmF3 Nl9zb2NrICpyYXc2X3NrKGNvbnN0IHN0cnVjdCBzb2NrICpzaykKIHsKLQlyZXR1cm4gJigo c3RydWN0IHJhdzZfc29jayAqKV9fc2spLT5yYXc2OworCXJldHVybiAoc3RydWN0IHJhdzZf c29jayAqKXNrOwogfQogCiBzdGF0aWMgaW5saW5lIHZvaWQgaW5ldF9za19jb3B5X2Rlc2Nl bmRhbnQoc3RydWN0IHNvY2sgKnNrX3RvLApAQCAtMzA0LDcgKzMwMyw3IEBACiAJcmV0dXJu IE5VTEw7CiB9CiAKLXN0YXRpYyBpbmxpbmUgc3RydWN0IHJhdzZfb3B0ICogcmF3Nl9zayhj b25zdCBzdHJ1Y3Qgc29jayAqX19zaykKK3N0YXRpYyBpbmxpbmUgc3RydWN0IHJhdzZfc29j ayAqcmF3Nl9zayhjb25zdCBzdHJ1Y3Qgc29jayAqc2spCiB7CiAJcmV0dXJuIE5VTEw7CiB9 CmRpZmYgLU5ydSBhL25ldC9pcHY2L3Jhdy5jIGIvbmV0L2lwdjYvcmF3LmMKLS0tIGEvbmV0 L2lwdjYvcmF3LmMJMjAwNS0wMS0xNyAyMzoyMjoxMiAtMDI6MDAKKysrIGIvbmV0L2lwdjYv cmF3LmMJMjAwNS0wMS0xNyAyMzoyMjoxMiAtMDI6MDAKQEAgLTExNSwxMCArMTE1LDEwIEBA CiBzdGF0aWMgX19pbmxpbmVfXyBpbnQgaWNtcHY2X2ZpbHRlcihzdHJ1Y3Qgc29jayAqc2ss IHN0cnVjdCBza19idWZmICpza2IpCiB7CiAJc3RydWN0IGljbXA2aGRyICppY21waDsKLQlz dHJ1Y3QgcmF3Nl9vcHQgKm9wdCA9IHJhdzZfc2soc2spOworCXN0cnVjdCByYXc2X3NvY2sg KnJwID0gcmF3Nl9zayhzayk7CiAKIAlpZiAocHNrYl9tYXlfcHVsbChza2IsIHNpemVvZihz dHJ1Y3QgaWNtcDZoZHIpKSkgewotCQlfX3UzMiAqZGF0YSA9ICZvcHQtPmZpbHRlci5kYXRh WzBdOworCQlfX3UzMiAqZGF0YSA9ICZycC0+ZmlsdGVyLmRhdGFbMF07CiAJCWludCBiaXRf bnI7CiAKIAkJaWNtcGggPSAoc3RydWN0IGljbXA2aGRyICopIHNrYi0+ZGF0YTsKQEAgLTMx NSwxNCArMzE1LDE0IEBACiBpbnQgcmF3djZfcmN2KHN0cnVjdCBzb2NrICpzaywgc3RydWN0 IHNrX2J1ZmYgKnNrYikKIHsKIAlzdHJ1Y3QgaW5ldF9zb2NrICppbmV0ID0gaW5ldF9zayhz ayk7Ci0Jc3RydWN0IHJhdzZfb3B0ICpyYXdfb3B0ID0gcmF3Nl9zayhzayk7CisJc3RydWN0 IHJhdzZfc29jayAqcnAgPSByYXc2X3NrKHNrKTsKIAogICAgICAgICBpZiAoIXhmcm02X3Bv bGljeV9jaGVjayhzaywgWEZSTV9QT0xJQ1lfSU4sIHNrYikpIHsKICAgICAgICAgICAgICAg ICBrZnJlZV9za2Ioc2tiKTsKICAgICAgICAgICAgICAgICByZXR1cm4gTkVUX1JYX0RST1A7 CiAgICAgICAgIH0KIAotCWlmICghcmF3X29wdC0+Y2hlY2tzdW0pCisJaWYgKCFycC0+Y2hl Y2tzdW0pCiAJCXNrYi0+aXBfc3VtbWVkID0gQ0hFQ0tTVU1fVU5ORUNFU1NBUlk7CiAKIAlp ZiAoc2tiLT5pcF9zdW1tZWQgIT0gQ0hFQ0tTVU1fVU5ORUNFU1NBUlkpIHsKQEAgLTQ1MSwy MSArNDUxLDIyIEBACiAJZ290byBvdXRfZnJlZTsKIH0KIAotc3RhdGljIGludCByYXd2Nl9w dXNoX3BlbmRpbmdfZnJhbWVzKHN0cnVjdCBzb2NrICpzaywgc3RydWN0IGZsb3dpICpmbCwg c3RydWN0IHJhdzZfb3B0ICpvcHQsIGludCBsZW4pCitzdGF0aWMgaW50IHJhd3Y2X3B1c2hf cGVuZGluZ19mcmFtZXMoc3RydWN0IHNvY2sgKnNrLCBzdHJ1Y3QgZmxvd2kgKmZsLAorCQkJ CSAgICAgc3RydWN0IHJhdzZfc29jayAqcnAsIGludCBsZW4pCiB7CiAJc3RydWN0IHNrX2J1 ZmYgKnNrYjsKIAlpbnQgZXJyID0gMDsKIAl1MTYgKmNzdW07CiAJdTMyIHRtcF9jc3VtOwog Ci0JaWYgKCFvcHQtPmNoZWNrc3VtKQorCWlmICghcnAtPmNoZWNrc3VtKQogCQlnb3RvIHNl bmQ7CiAKIAlpZiAoKHNrYiA9IHNrYl9wZWVrKCZzay0+c2tfd3JpdGVfcXVldWUpKSA9PSBO VUxMKQogCQlnb3RvIG91dDsKIAotCWlmIChvcHQtPm9mZnNldCArIDEgPCBsZW4pCi0JCWNz dW0gPSAodTE2ICopKHNrYi0+aC5yYXcgKyBvcHQtPm9mZnNldCk7CisJaWYgKHJwLT5vZmZz ZXQgKyAxIDwgbGVuKQorCQljc3VtID0gKHUxNiAqKShza2ItPmgucmF3ICsgcnAtPm9mZnNl dCk7CiAJZWxzZSB7CiAJCWVyciA9IC1FSU5WQUw7CiAJCWdvdG8gb3V0OwpAQCAtNjA5LDcg KzYxMCw3IEBACiAJc3RydWN0IGluNl9hZGRyICpkYWRkciwgKmZpbmFsX3AgPSBOVUxMLCBm aW5hbDsKIAlzdHJ1Y3QgaW5ldF9zb2NrICppbmV0ID0gaW5ldF9zayhzayk7CiAJc3RydWN0 IGlwdjZfcGluZm8gKm5wID0gaW5ldDZfc2soc2spOwotCXN0cnVjdCByYXc2X29wdCAqcmF3 X29wdCA9IHJhdzZfc2soc2spOworCXN0cnVjdCByYXc2X3NvY2sgKnJwID0gcmF3Nl9zayhz ayk7CiAJc3RydWN0IGlwdjZfdHhvcHRpb25zICpvcHQgPSBOVUxMOwogCXN0cnVjdCBpcDZf Zmxvd2xhYmVsICpmbG93bGFiZWwgPSBOVUxMOwogCXN0cnVjdCBkc3RfZW50cnkgKmRzdCA9 IE5VTEw7CkBAIC03NzEsNyArNzcyLDcgQEAKIAkJaWYgKGVycikKIAkJCWlwNl9mbHVzaF9w ZW5kaW5nX2ZyYW1lcyhzayk7CiAJCWVsc2UgaWYgKCEobXNnLT5tc2dfZmxhZ3MgJiBNU0df TU9SRSkpCi0JCQllcnIgPSByYXd2Nl9wdXNoX3BlbmRpbmdfZnJhbWVzKHNrLCAmZmwsIHJh d19vcHQsIGxlbik7CisJCQllcnIgPSByYXd2Nl9wdXNoX3BlbmRpbmdfZnJhbWVzKHNrLCAm ZmwsIHJwLCBsZW4pOwogCX0KIGRvbmU6CiAJaXA2X2RzdF9zdG9yZShzaywgZHN0LApAQCAt ODM4LDcgKzgzOSw3IEBACiBzdGF0aWMgaW50IHJhd3Y2X3NldHNvY2tvcHQoc3RydWN0IHNv Y2sgKnNrLCBpbnQgbGV2ZWwsIGludCBvcHRuYW1lLCAKIAkJCSAgICBjaGFyIF9fdXNlciAq b3B0dmFsLCBpbnQgb3B0bGVuKQogewotCXN0cnVjdCByYXc2X29wdCAqb3B0ID0gcmF3Nl9z ayhzayk7CisJc3RydWN0IHJhdzZfc29jayAqcnAgPSByYXc2X3NrKHNrKTsKIAlpbnQgdmFs OwogCiAJc3dpdGNoKGxldmVsKSB7CkBAIC04NjgsMTAgKzg2OSwxMCBAQAogCQkJaWYgKHZh bCA+IDAgJiYgKHZhbCYxKSkKIAkJCQlyZXR1cm4oLUVJTlZBTCk7CiAJCQlpZiAodmFsIDwg MCkgewotCQkJCW9wdC0+Y2hlY2tzdW0gPSAwOworCQkJCXJwLT5jaGVja3N1bSA9IDA7CiAJ CQl9IGVsc2UgewotCQkJCW9wdC0+Y2hlY2tzdW0gPSAxOwotCQkJCW9wdC0+b2Zmc2V0ID0g dmFsOworCQkJCXJwLT5jaGVja3N1bSA9IDE7CisJCQkJcnAtPm9mZnNldCA9IHZhbDsKIAkJ CX0KIAogCQkJcmV0dXJuIDA7CkBAIC04ODUsNyArODg2LDcgQEAKIHN0YXRpYyBpbnQgcmF3 djZfZ2V0c29ja29wdChzdHJ1Y3Qgc29jayAqc2ssIGludCBsZXZlbCwgaW50IG9wdG5hbWUs IAogCQkJICAgIGNoYXIgX191c2VyICpvcHR2YWwsIGludCBfX3VzZXIgKm9wdGxlbikKIHsK LQlzdHJ1Y3QgcmF3Nl9vcHQgKm9wdCA9IHJhdzZfc2soc2spOworCXN0cnVjdCByYXc2X3Nv Y2sgKnJwID0gcmF3Nl9zayhzayk7CiAJaW50IHZhbCwgbGVuOwogCiAJc3dpdGNoKGxldmVs KSB7CkBAIC05MTAsMTAgKzkxMSwxMCBAQAogCiAJc3dpdGNoIChvcHRuYW1lKSB7CiAJY2Fz ZSBJUFY2X0NIRUNLU1VNOgotCQlpZiAob3B0LT5jaGVja3N1bSA9PSAwKQorCQlpZiAocnAt PmNoZWNrc3VtID09IDApCiAJCQl2YWwgPSAtMTsKIAkJZWxzZQotCQkJdmFsID0gb3B0LT5v ZmZzZXQ7CisJCQl2YWwgPSBycC0+b2Zmc2V0OwogCQlicmVhazsKIAogCWRlZmF1bHQ6CkBA IC05NjYsOSArOTY3LDkgQEAKIHN0YXRpYyBpbnQgcmF3djZfaW5pdF9zayhzdHJ1Y3Qgc29j ayAqc2spCiB7CiAJaWYgKGluZXRfc2soc2spLT5udW0gPT0gSVBQUk9UT19JQ01QVjYpIHsK LQkJc3RydWN0IHJhdzZfb3B0ICpvcHQgPSByYXc2X3NrKHNrKTsKLQkJb3B0LT5jaGVja3N1 bSA9IDE7Ci0JCW9wdC0+b2Zmc2V0ID0gMjsKKwkJc3RydWN0IHJhdzZfc29jayAqcnAgPSBy YXc2X3NrKHNrKTsKKwkJcnAtPmNoZWNrc3VtID0gMTsKKwkJcnAtPm9mZnNldCAgID0gMjsK IAl9CiAJcmV0dXJuKDApOwogfQoK --------------060700070601040908040502-- From sri@us.ibm.com Mon Jan 17 17:40:16 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 17:40:21 -0800 (PST) Received: from e1.ny.us.ibm.com (e1.ny.us.ibm.com [32.97.182.141]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0I1e9Hm010666 for ; Mon, 17 Jan 2005 17:40:15 -0800 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e1.ny.us.ibm.com (8.12.10/8.12.10) with ESMTP id j0I1e3RK008271 for ; Mon, 17 Jan 2005 20:40:03 -0500 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay04.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j0I1e3fE144566 for ; Mon, 17 Jan 2005 20:40:03 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j0I1e27X001933 for ; Mon, 17 Jan 2005 20:40:02 -0500 Received: from w-sridhar.beaverton.ibm.com (w-sridhar.beaverton.ibm.com [9.47.18.19]) by d01av02.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j0I1e1Xh001904; Mon, 17 Jan 2005 20:40:02 -0500 Date: Mon, 17 Jan 2005 17:40:01 -0800 (PST) From: Sridhar Samudrala X-X-Sender: sridhar@w-sridhar.beaverton.ibm.com To: Arnaldo Carvalho de Melo cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH] merge sctp_opt with sctp_sock In-Reply-To: <41EC626D.1010804@conectiva.com.br> Message-ID: References: <41E8A17D.9040307@conectiva.com.br> <20050117133327.0386763f.davem@davemloft.net> <41EC626D.1010804@conectiva.com.br> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 411 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sri@us.ibm.com Precedence: bulk X-list: netdev On Mon, 17 Jan 2005, Arnaldo Carvalho de Melo wrote: > David S. Miller escreveu: > > On Sat, 15 Jan 2005 02:52:13 -0200 > > Arnaldo Carvalho de Melo wrote: > > > > > >> Please take a look and if its acceptable pull from: > >> > >>bk://kernel.bkbits.net/acme/connection_sock-2.6 > >> > >> The tricky bit here is that SCTP, to keep the existing logic, > >>needs a way to copy only its private area from one sock to another, so > >>I introduced a generic inet_sk_copy_descendant, that knows about the > >>inet (v4/v6) layout (wrt inet_sock and inet6_pinfo), using this and > >>sk->sk_prot->slab_obj_size we can copy the inet_sock descendant > >>private area generically. > > > > > > This looks fine, although I wish the descendant copying thing > > could be done more cleanly somehow. > > /me too, but this is the best scheme I've found for now, perhaps in > the future, after some more refactoring work is done/merged we can > find some better way of doing this (tcp_create_openreq_child also > does something like this, but does it in all the sock, perhaps > SCTP can do something similar). I thought you introduced this generic function so that other protocols also may use it. If you & Dave feel that this is not clean and is going to be needed only by SCTP, SCTP also could do a memcpy of the entire sock instead of only sctp private area before calling sctp_sock_migrate although it is not very straightforward. Let me know if i should work on a patch to do that. Thanks Sridhar From acme@conectiva.com.br Mon Jan 17 17:44:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 17:44:59 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0I1iqwD011283 for ; Mon, 17 Jan 2005 17:44:53 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CqhgK-0005VT-00; Mon, 17 Jan 2005 22:57:16 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 3EE001462D; Mon, 17 Jan 2005 23:44:49 -0200 (BRST) Message-ID: <41EC6B2D.7020506@conectiva.com.br> Date: Mon, 17 Jan 2005 23:49:33 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: Sridhar Samudrala Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH] merge sctp_opt with sctp_sock References: <41E8A17D.9040307@conectiva.com.br> <20050117133327.0386763f.davem@davemloft.net> <41EC626D.1010804@conectiva.com.br> In-Reply-To: X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 412 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Sridhar Samudrala escreveu: > On Mon, 17 Jan 2005, Arnaldo Carvalho de Melo wrote: > > >>David S. Miller escreveu: >> >>>On Sat, 15 Jan 2005 02:52:13 -0200 >>>Arnaldo Carvalho de Melo wrote: >>> >>> >>> >>>> Please take a look and if its acceptable pull from: >>>> >>>>bk://kernel.bkbits.net/acme/connection_sock-2.6 >>>> >>>> The tricky bit here is that SCTP, to keep the existing logic, >>>>needs a way to copy only its private area from one sock to another, so >>>>I introduced a generic inet_sk_copy_descendant, that knows about the >>>>inet (v4/v6) layout (wrt inet_sock and inet6_pinfo), using this and >>>>sk->sk_prot->slab_obj_size we can copy the inet_sock descendant >>>>private area generically. >>> >>> >>>This looks fine, although I wish the descendant copying thing >>>could be done more cleanly somehow. >> >>/me too, but this is the best scheme I've found for now, perhaps in >>the future, after some more refactoring work is done/merged we can >>find some better way of doing this (tcp_create_openreq_child also >>does something like this, but does it in all the sock, perhaps >>SCTP can do something similar). > > > I thought you introduced this generic function so that other protocols also > may use it. If you & Dave feel that this is not clean and is going to be > needed only by SCTP, SCTP also could do a memcpy of the entire sock instead > of only sctp private area before calling sctp_sock_migrate although it is not > very straightforward. Let me know if i should work on a patch to do that. Sridhar, please leave it as is for now, perhaps some other protocol will need it, I still have decnet, econet, x.25, wanrouter, etc to go, and this is not something we should spend too much time for now, I think, I'm more than happy if you just tell me that this is equivalent to what we had before, i.e. that I didn't introduced any bugs 8) - Arnaldo From sri@us.ibm.com Mon Jan 17 18:18:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 18:18:18 -0800 (PST) Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.130]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0I2IChO013119 for ; Mon, 17 Jan 2005 18:18:12 -0800 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e32.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j0I2I6ul523876 for ; Mon, 17 Jan 2005 21:18:06 -0500 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j0I2I6D4427892 for ; Mon, 17 Jan 2005 19:18:06 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j0I2I5mv010550 for ; Mon, 17 Jan 2005 19:18:06 -0700 Received: from w-sridhar.beaverton.ibm.com (w-sridhar.beaverton.ibm.com [9.47.18.19]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j0I2I4YX010537; Mon, 17 Jan 2005 19:18:05 -0700 Date: Mon, 17 Jan 2005 18:18:04 -0800 (PST) From: Sridhar Samudrala X-X-Sender: sridhar@w-sridhar.beaverton.ibm.com To: Arnaldo Carvalho de Melo cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH] merge sctp_opt with sctp_sock In-Reply-To: <41EC6B2D.7020506@conectiva.com.br> Message-ID: References: <41E8A17D.9040307@conectiva.com.br> <20050117133327.0386763f.davem@davemloft.net> <41EC626D.1010804@conectiva.com.br> <41EC6B2D.7020506@conectiva.com.br> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 413 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sri@us.ibm.com Precedence: bulk X-list: netdev On Mon, 17 Jan 2005, Arnaldo Carvalho de Melo wrote: > Sridhar Samudrala escreveu: > > On Mon, 17 Jan 2005, Arnaldo Carvalho de Melo wrote: > > > > > >>David S. Miller escreveu: > >> > >>>On Sat, 15 Jan 2005 02:52:13 -0200 > >>>Arnaldo Carvalho de Melo wrote: > >>> > >>> > >>> > >>>> Please take a look and if its acceptable pull from: > >>>> > >>>>bk://kernel.bkbits.net/acme/connection_sock-2.6 > >>>> > >>>> The tricky bit here is that SCTP, to keep the existing logic, > >>>>needs a way to copy only its private area from one sock to another, so > >>>>I introduced a generic inet_sk_copy_descendant, that knows about the > >>>>inet (v4/v6) layout (wrt inet_sock and inet6_pinfo), using this and > >>>>sk->sk_prot->slab_obj_size we can copy the inet_sock descendant > >>>>private area generically. > >>> > >>> > >>>This looks fine, although I wish the descendant copying thing > >>>could be done more cleanly somehow. > >> > >>/me too, but this is the best scheme I've found for now, perhaps in > >>the future, after some more refactoring work is done/merged we can > >>find some better way of doing this (tcp_create_openreq_child also > >>does something like this, but does it in all the sock, perhaps > >>SCTP can do something similar). > > > > > > I thought you introduced this generic function so that other protocols also > > may use it. If you & Dave feel that this is not clean and is going to be > > needed only by SCTP, SCTP also could do a memcpy of the entire sock instead > > of only sctp private area before calling sctp_sock_migrate although it is not > > very straightforward. Let me know if i should work on a patch to do that. > > Sridhar, please leave it as is for now, perhaps some other protocol will need it, > I still have decnet, econet, x.25, wanrouter, etc to go, and this is not something > we should spend too much time for now, I think, I'm more than happy if you > just tell me that this is equivalent to what we had before, i.e. that I didn't > introduced any bugs 8) It looks fine and i don't see any issues. will try to pull from davem's tree and test to see that it doesn't break any SCTP regression tests. -Sridhar From yoshfuji@linux-ipv6.org Mon Jan 17 18:39:58 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 18:40:03 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0I2dvWj013910 for ; Mon, 17 Jan 2005 18:39:57 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id 56CFC33CC2; Tue, 18 Jan 2005 11:40:34 +0900 (JST) Date: Tue, 18 Jan 2005 11:40:34 +0900 (JST) Message-Id: <20050118.114034.89476074.yoshfuji@linux-ipv6.org> To: davem@davemloft.net Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [BK PATCH] sk_dst_cache annotation From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20050117124913.49c253b6.davem@davemloft.net> References: <20050115.160008.04476889.yoshfuji@linux-ipv6.org> <20050117124913.49c253b6.davem@davemloft.net> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 414 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev In article <20050117124913.49c253b6.davem@davemloft.net> (at Mon, 17 Jan 2005 12:49:13 -0800), "David S. Miller" says: > On Sat, 15 Jan 2005 16:00:08 +0900 (JST) > YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > > > ChangeSet@1.2335, 2005-01-15 15:47:12+09:00, yoshfuji@linux-ipv6.org > > [NET] Always hold refcnt for dst when we use sk_dst_cache. > > > > Signed-off-by: Hideaki YOSHIFUJI > > There is less and less point to having the socket dst cache > if we're going to take the read lock and grab an atomic > reference all the time anyways. > > If the socket is locked, which most of the code paths you > are modifying do, there is no need to grab a reference > and __sk_dst_cache() is just fine. That's how it was > mean to be used since if the socket is locked nobody > can sk_dst_reset() on us. I'll see them again. Let me clarify: if all the code paths (for each socket type) lock socket, we don't need sk_dst_lock at all (for that socket type). otherwise, we have races; we need sk_dst_lock (for that socket type). Am I corrent? --yoshfuji From yoshfuji@linux-ipv6.org Mon Jan 17 19:19:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 19:20:00 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0I3Jspg015301 for ; Mon, 17 Jan 2005 19:19:54 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id E3AAD33CC2; Tue, 18 Jan 2005 12:20:31 +0900 (JST) Date: Tue, 18 Jan 2005 12:20:31 +0900 (JST) Message-Id: <20050118.122031.30284967.yoshfuji@linux-ipv6.org> To: acme@conectiva.com.br, davem@davemloft.net Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [IPV6] merge raw6_opt with raw6_sock From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <41EC66B8.9080907@conectiva.com.br> References: <41EC66B8.9080907@conectiva.com.br> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 415 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev In article <41EC66B8.9080907@conectiva.com.br> (at Mon, 17 Jan 2005 23:30:32 -0200), Arnaldo Carvalho de Melo says: > This finishes the inet protos part, now to the legacy protocols. ack. --yoshfuji From greearb@candelatech.com Mon Jan 17 19:28:27 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 19:28:33 -0800 (PST) Received: from www.lanforge.com (ns1.lanforge.com [66.165.47.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0I3SRtH015880 for ; Mon, 17 Jan 2005 19:28:27 -0800 Received: from [4.33.45.22] (evrtwa1-ar2-4-33-045-022.evrtwa1.dsl-verizon.net [4.33.45.22]) (authenticated bits=0) by www.lanforge.com (8.12.8/8.12.8) with ESMTP id j0I3jeLH009112 for ; Mon, 17 Jan 2005 19:45:40 -0800 Message-ID: <41EC825B.4030603@candelatech.com> Date: Mon, 17 Jan 2005 19:28:27 -0800 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041020 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "'netdev@oss.sgi.com'" Subject: An interface goes away while a socket is bound to it..what happens? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 416 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev I've been playing around with multi-link PPP interfaces, and have noticed something strange (kernel 2.6.9+hacks, pppd 2.4.1b2 ). My application binds tight to the local IP address and the interface. In the instance tested, I was using UDP traffic but TCP seems to behave the same. Suppose I am pulling the T1 interfaces to cause a failover: If I pull both at once for a few seconds and then replace them, ppp0 will dissappear, and then quickly be rebuilt. My application discovers interfaces based on their name, by parsing /proc/net/dev every 30 seconds or so. Often, it does not detect that the interface ever went away (and came back), so it cannot take any evasive action. The interesting part to me is that I do not appearantly see any errors while continuing to send UDP packets on the socket that was bound to the original ppp0 interface, and yet no packets are ever routed over the new ppp0 interface. I would expect it to either fail the write, or to just magically keep working. So first: Is this happily-write-down-a-black-hole issue a bug? and: What is a good way to discover the coming and going of interfaces as it happens? (I looked around Netlink, but it does not appear to do notifications.) Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From davem@davemloft.net Mon Jan 17 19:40:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 19:40:58 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0I3eqfv016498 for ; Mon, 17 Jan 2005 19:40:53 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CqkDZ-0006rf-00; Mon, 17 Jan 2005 19:39:45 -0800 Date: Mon, 17 Jan 2005 19:39:45 -0800 From: "David S. Miller" To: Ben Greear Cc: netdev@oss.sgi.com Subject: Re: An interface goes away while a socket is bound to it..what happens? Message-Id: <20050117193945.3d3b1860.davem@davemloft.net> In-Reply-To: <41EC825B.4030603@candelatech.com> References: <41EC825B.4030603@candelatech.com> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 417 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Mon, 17 Jan 2005 19:28:27 -0800 Ben Greear wrote: > The interesting part to me is that I do not appearantly see any errors > while continuing to send UDP packets on the socket that was bound to the > original ppp0 interface, and yet no packets are ever routed over the new > ppp0 interface. I would expect it to either fail the write, or to just > magically keep working. If you have bound to the local IP address, when your T1 goes down that local IP address should no longer be assosciated with the system even when the PPP interface comes back up, so what should happen is that the route lookup in udp_sendmsg() will fail and sendmsg() will return with that error code. From rddunlap@osdl.org Mon Jan 17 21:14:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 21:14:41 -0800 (PST) Received: from fire-1.osdl.org (fire.osdl.org [65.172.181.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0I5EYos022250 for ; Mon, 17 Jan 2005 21:14:34 -0800 Received: from [192.168.1.103] (wbar2.sea1-4-5-049-023.sea1.dsl-verizon.net [4.5.49.23]) (authenticated bits=0) by fire-1.osdl.org (8.12.8/8.12.8) with ESMTP id j0I5ES7r030126 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Mon, 17 Jan 2005 21:14:28 -0800 Message-ID: <41EC9974.1090209@osdl.org> Date: Mon, 17 Jan 2005 21:07:00 -0800 From: "Randy.Dunlap" User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev , jgarzik Subject: [PATCH] 3c515: fix module_param type Content-Type: multipart/mixed; boundary="------------030703000806090001000700" X-MIMEDefang-Filter: osdl$Revision: 1.99 $ X-Scanned-By: MIMEDefang 2.36 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 418 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------030703000806090001000700 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 3c515: correct module_param data type (remove "const"); drivers/net/3c515.c:406: warning: return discards qualifiers from pointer target type drivers/net/3c515.c:406: warning: initialization discards qualifiers from pointer target type Signed-off-by: Randy Dunlap diffstat:= drivers/net/3c515.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) --- --------------030703000806090001000700 Content-Type: text/x-patch; name="3c515_modprm.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="3c515_modprm.patch" 3c515: correct module_param data type (remove "const"); drivers/net/3c515.c:406: warning: return discards qualifiers from pointer target type drivers/net/3c515.c:406: warning: initialization discards qualifiers from pointer target type Signed-off-by: Randy Dunlap diffstat:= drivers/net/3c515.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -Naurp ./drivers/net/3c515.c~3c515_modprm ./drivers/net/3c515.c --- ./drivers/net/3c515.c~3c515_modprm 2005-01-10 13:28:51.000000000 -0800 +++ ./drivers/net/3c515.c 2005-01-17 16:17:33.468358720 -0800 @@ -34,7 +34,7 @@ DRV_NAME ".c:v" DRV_VERSION " " DRV_RELD /* "Knobs" that adjust features and parameters. */ /* Set the copy breakpoint for the copy-only-tiny-frames scheme. Setting to > 1512 effectively disables this feature. */ -static const int rx_copybreak = 200; +static int rx_copybreak = 200; /* Allow setting MTU to a larger size, bypassing the normal ethernet setup. */ static const int mtu = 1500; --------------030703000806090001000700-- From greearb@candelatech.com Mon Jan 17 22:44:44 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 22:44:51 -0800 (PST) Received: from www.lanforge.com (ns1.lanforge.com [66.165.47.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0I6iiXE024537 for ; Mon, 17 Jan 2005 22:44:44 -0800 Received: from [4.33.45.22] (evrtwa1-ar2-4-33-045-022.evrtwa1.dsl-verizon.net [4.33.45.22]) (authenticated bits=0) by www.lanforge.com (8.12.8/8.12.8) with ESMTP id j0I71vLH011074; Mon, 17 Jan 2005 23:01:57 -0800 Message-ID: <41ECB05B.8060207@candelatech.com> Date: Mon, 17 Jan 2005 22:44:43 -0800 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041020 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com Subject: Re: An interface goes away while a socket is bound to it..what happens? References: <41EC825B.4030603@candelatech.com> <20050117193945.3d3b1860.davem@davemloft.net> In-Reply-To: <20050117193945.3d3b1860.davem@davemloft.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 419 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev David S. Miller wrote: > On Mon, 17 Jan 2005 19:28:27 -0800 > Ben Greear wrote: > > >>The interesting part to me is that I do not appearantly see any errors >>while continuing to send UDP packets on the socket that was bound to the >>original ppp0 interface, and yet no packets are ever routed over the new >>ppp0 interface. I would expect it to either fail the write, or to just >>magically keep working. > > > If you have bound to the local IP address, when your T1 goes down > that local IP address should no longer be assosciated with the > system even when the PPP interface comes back up, so what should > happen is that the route lookup in udp_sendmsg() will fail and sendmsg() > will return with that error code. Well, the new interface will come back with the same name, and same IP. Also, I bind to the local interface with BIND_TO_DEVICE. I can imagine how that might confuse things... I will do some double-checking to make sure I'm not missing an error code on the sendmsg call... Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From acme@conectiva.com.br Mon Jan 17 22:57:59 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 17 Jan 2005 22:58:05 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0I6vwC9025320 for ; Mon, 17 Jan 2005 22:57:59 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CqmZC-0005pf-00; Tue, 18 Jan 2005 04:10:14 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 418D91462D; Tue, 18 Jan 2005 04:57:46 -0200 (BRST) Message-ID: <41ECB488.3040207@conectiva.com.br> Date: Tue, 18 Jan 2005 05:02:32 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: chas@cmf.nrl.navy.mil Cc: Networking Team Subject: [RFC] relationship of struct atm_vcc with struct sock X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------000203040409030409090502" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 420 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------000203040409030409090502 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi Chas, I'm working on a series of patches to make all protocol families use private slab caches for its socks, this is needed to introduce struct connection_sock, to move the connection specific members out of struct sock and save bytes/cachelines in non connected protocols, such as UDP. Take a look at the attached patch that does this work on pfkey, basically I need that struct atm_sock (now called atm_vcc) contains as its first member a struct sock, so a pointer to an struct atm_sock is a pointer to an struct sock. This approach eliminates the need for a struct sock backpointer in atm_sock. The approach I'm using in ax25/netrom/rose is to make all functions receive struct sock pointers, and from it, if needed, obtain the ax25_sock pointer using ax25_sk(sk). I'm coordinating with Ralf Baechle, the ham radio protocols maintainer, that is reviewing my changes. Do you have any mixed feelings about doing the same with atm? Regards, - Arnaldo --------------000203040409030409090502 Content-Type: text/plain; name="pfkey.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="pfkey.patch" =================================================================== ChangeSet@1.2347, 2005-01-18 04:41:35-02:00, acme@toy.ghostprotocols.net [PF_KEY] use a private slab cache for socks Required to get rid of sk_protinfo and to introduce struct connection_sock, also for consistency with other protocol families implementations. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller af_key.c | 48 +++++++++++++++++++++++++++++------------------- 1 files changed, 29 insertions(+), 19 deletions(-) diff -Nru a/net/key/af_key.c b/net/key/af_key.c --- a/net/key/af_key.c 2005-01-18 04:55:03 -02:00 +++ b/net/key/af_key.c 2005-01-18 04:55:03 -02:00 @@ -42,11 +42,19 @@ static atomic_t pfkey_socks_nr = ATOMIC_INIT(0); -struct pfkey_opt { - int registered; - int promisc; +struct pfkey_sock { + /* struct sock must be the first member of struct pfkey_sock */ + struct sock sk; + int registered; + int promisc; }; -#define pfkey_sk(__sk) ((struct pfkey_opt *)(__sk)->sk_protinfo) + +static inline struct pfkey_sock *pfkey_sk(struct sock *sk) +{ + return (struct pfkey_sock *)sk; +} + +static kmem_cache_t *pfkey_sk_slab; static void pfkey_sock_destruct(struct sock *sk) { @@ -60,8 +68,6 @@ BUG_TRAP(!atomic_read(&sk->sk_rmem_alloc)); BUG_TRAP(!atomic_read(&sk->sk_wmem_alloc)); - kfree(pfkey_sk(sk)); - atomic_dec(&pfkey_socks_nr); } @@ -128,7 +134,6 @@ static int pfkey_create(struct socket *sock, int protocol) { struct sock *sk; - struct pfkey_opt *pfk; int err; if (!capable(CAP_NET_ADMIN)) @@ -139,7 +144,8 @@ return -EPROTONOSUPPORT; err = -ENOMEM; - sk = sk_alloc(PF_KEY, GFP_KERNEL, 1, NULL); + sk = sk_alloc(PF_KEY, GFP_KERNEL, + sizeof(struct pfkey_sock), pfkey_sk_slab); if (sk == NULL) goto out; @@ -147,14 +153,6 @@ sock_init_data(sock, sk); sk_set_owner(sk, THIS_MODULE); - err = -ENOMEM; - pfk = sk->sk_protinfo = kmalloc(sizeof(*pfk), GFP_KERNEL); - if (!pfk) { - sk_free(sk); - goto out; - } - memset(pfk, 0, sizeof(*pfk)); - sk->sk_family = PF_KEY; sk->sk_destruct = pfkey_sock_destruct; @@ -233,7 +231,7 @@ pfkey_lock_table(); sk_for_each(sk, node, &pfkey_table) { - struct pfkey_opt *pfk = pfkey_sk(sk); + struct pfkey_sock *pfk = pfkey_sk(sk); int err2; /* Yes, it means that if you are meant to receive this @@ -1418,7 +1416,7 @@ static int pfkey_register(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hdr, void **ext_hdrs) { - struct pfkey_opt *pfk = pfkey_sk(sk); + struct pfkey_sock *pfk = pfkey_sk(sk); struct sk_buff *supp_skb; if (hdr->sadb_msg_satype > SADB_SATYPE_MAX) @@ -1514,7 +1512,7 @@ static int pfkey_promisc(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hdr, void **ext_hdrs) { - struct pfkey_opt *pfk = pfkey_sk(sk); + struct pfkey_sock *pfk = pfkey_sk(sk); int satype = hdr->sadb_msg_satype; if (hdr->sadb_msg_len == (sizeof(*hdr) / sizeof(uint64_t))) { @@ -2863,10 +2861,22 @@ xfrm_unregister_km(&pfkeyv2_mgr); remove_proc_entry("net/pfkey", NULL); sock_unregister(PF_KEY); + + if (pfkey_sk_slab != NULL) { + kmem_cache_destroy(pfkey_sk_slab); + pfkey_sk_slab = NULL; + } } static int __init ipsec_pfkey_init(void) { + pfkey_sk_slab = kmem_cache_create("pfkey_sock", + sizeof(struct pfkey_sock), 0, + SLAB_HWCACHE_ALIGN, NULL, NULL); + + if (pfkey_sk_slab == NULL) + return -ENOMEM; + sock_register(&pfkey_family_ops); #ifdef CONFIG_PROC_FS create_proc_read_entry("net/pfkey", 0, NULL, pfkey_read_proc, NULL); =================================================================== --------------000203040409030409090502-- From hasso@estpak.ee Tue Jan 18 00:13:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 00:13:50 -0800 (PST) Received: from arena (test.estpak.ee [194.126.115.47]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0I8DfFt028470 for ; Tue, 18 Jan 2005 00:13:42 -0800 Received: from localhost ([127.0.0.1] helo=arena) by arena with esmtp (Exim 4.43) id 1CqoVA-0000jB-HP; Tue, 18 Jan 2005 10:14:12 +0200 From: Hasso Tepper To: Ben Greear Subject: Re: 2.6.10 ipv6/8021q lockup on vconfig on interface removal Date: Tue, 18 Jan 2005 10:14:11 +0200 User-Agent: KMail/1.7.2 Cc: Andre Tomt , netdev@oss.sgi.com References: <41EA0A01.2020707@tomt.net> <41EC0F2B.7010002@candelatech.com> In-Reply-To: <41EC0F2B.7010002@candelatech.com> Organization: Elion Enterprises Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501181014.12079.hasso@estpak.ee> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 421 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hasso@estpak.ee Precedence: bulk X-list: netdev Ben Greear wrote: > Andre Tomt wrote: > > I sent this initially about a week ago, but nobody have said anything, > > not even a confirmation that its beeing looked into, or about me beeing > > silly - highly unusual on netdev! So I'm reposting (with slight > > modifications), boo, shame on me. Just a bit worried it slipped through > > the cracks. > > My take on this is that it is a bug in the IPv6 code. If the IPv6 people > think that the VLAN code might could be causing this, then I am open to > suggestions as to how the VLAN code might be in error.... There were similar problems with tunnels in 2.6.8 and 2.6.9 kernels. They seems to be gone now in 2.6.10. Does it help, Andre? -- Hasso Tepper Elion Enterprises Ltd. WAN administrator From jgarzik@pobox.com Tue Jan 18 00:15:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 00:16:30 -0800 (PST) Received: from parcelfarce.linux.theplanet.co.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0I8Fqat028941 for ; Tue, 18 Jan 2005 00:15:52 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by parcelfarce.linux.theplanet.co.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CqoWj-0005Ec-Ky; Tue, 18 Jan 2005 08:15:50 +0000 Message-ID: <41ECC5A5.90708@pobox.com> Date: Tue, 18 Jan 2005 03:15:33 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrew Morton , Linus Torvalds CC: Netdev Subject: [BK PATCHES] 2.6.x net driver updates Content-Type: multipart/mixed; boundary="------------060509060202040405080405" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 422 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------060509060202040405080405 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit iomem annotations from viro, tun/tap fixes, multicast fixes. --------------060509060202040405080405 Content-Type: text/plain; name="net-drivers-2.6.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="net-drivers-2.6.txt" Please do a bk pull bk://gkernel.bkbits.net/net-drivers-2.6 This will update the following files: drivers/net/Kconfig | 1 drivers/net/atp.c | 2 drivers/net/bmac.c | 68 +++++++++--------- drivers/net/hamachi.c | 81 +++++++++++----------- drivers/net/myri_sbus.c | 10 +- drivers/net/s2io.c | 104 ++++++++++++++-------------- drivers/net/s2io.h | 15 +--- drivers/net/tulip/tulip_core.c | 2 drivers/net/tulip/winbond-840.c | 2 drivers/net/tun.c | 145 ++++++++++++++++++++++++++++++++++------ include/linux/if_tun.h | 2 11 files changed, 271 insertions(+), 161 deletions(-) through these ChangeSets: Alexander Viro: o s2io iomem annotations and cleanups o bmac iomem annotations o hamachi iomem annotations o miri_sbus iomem annotations Maksim Krasnyanskiy: o [TUN] Add a missing dependency on enabling the crc32 libraries o Use random_ether_addr() to generate TAP MAC address o TUN/TAP driver packet queuing fixes and improvements Roger Luethi: o mc_filter on big-endian arch diff -Nru a/drivers/net/Kconfig b/drivers/net/Kconfig --- a/drivers/net/Kconfig 2005-01-18 03:13:47 -05:00 +++ b/drivers/net/Kconfig 2005-01-18 03:13:47 -05:00 @@ -84,6 +84,7 @@ config TUN tristate "Universal TUN/TAP device driver support" depends on NETDEVICES + select CRC32 ---help--- TUN/TAP provides packet reception and transmission for user space programs. It can be viewed as a simple Point-to-Point or Ethernet diff -Nru a/drivers/net/atp.c b/drivers/net/atp.c --- a/drivers/net/atp.c 2005-01-18 03:13:47 -05:00 +++ b/drivers/net/atp.c 2005-01-18 03:13:47 -05:00 @@ -909,7 +909,7 @@ i++, mclist = mclist->next) { int filterbit = ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x3f; - mc_filter[filterbit >> 5] |= cpu_to_le32(1 << (filterbit & 31)); + mc_filter[filterbit >> 5] |= 1 << (filterbit & 31); } new_mode = CMR2h_Normal; } diff -Nru a/drivers/net/bmac.c b/drivers/net/bmac.c --- a/drivers/net/bmac.c 2005-01-18 03:13:47 -05:00 +++ b/drivers/net/bmac.c 2005-01-18 03:13:47 -05:00 @@ -59,9 +59,9 @@ struct bmac_data { /* volatile struct bmac *bmac; */ struct sk_buff_head *queue; - volatile struct dbdma_regs *tx_dma; + volatile struct dbdma_regs __iomem *tx_dma; int tx_dma_intr; - volatile struct dbdma_regs *rx_dma; + volatile struct dbdma_regs __iomem *rx_dma; int rx_dma_intr; volatile struct dbdma_cmd *tx_cmds; /* xmit dma command list */ volatile struct dbdma_cmd *rx_cmds; /* recv dma command list */ @@ -165,35 +165,35 @@ #define DBDMA_CLEAR(x) ( (x) << 16) static inline void -dbdma_st32(volatile unsigned long *a, unsigned long x) +dbdma_st32(volatile __u32 __iomem *a, unsigned long x) { __asm__ volatile( "stwbrx %0,0,%1" : : "r" (x), "r" (a) : "memory"); return; } static inline unsigned long -dbdma_ld32(volatile unsigned long *a) +dbdma_ld32(volatile __u32 __iomem *a) { - unsigned long swap; + __u32 swap; __asm__ volatile ("lwbrx %0,0,%1" : "=r" (swap) : "r" (a)); return swap; } static void -dbdma_continue(volatile struct dbdma_regs *dmap) +dbdma_continue(volatile struct dbdma_regs __iomem *dmap) { - dbdma_st32((volatile unsigned long *)&dmap->control, + dbdma_st32(&dmap->control, DBDMA_SET(RUN|WAKE) | DBDMA_CLEAR(PAUSE|DEAD)); eieio(); } static void -dbdma_reset(volatile struct dbdma_regs *dmap) +dbdma_reset(volatile struct dbdma_regs __iomem *dmap) { - dbdma_st32((volatile unsigned long *)&dmap->control, + dbdma_st32(&dmap->control, DBDMA_CLEAR(ACTIVE|DEAD|WAKE|FLUSH|PAUSE|RUN)); eieio(); - while (dbdma_ld32((volatile unsigned long *)&dmap->status) & RUN) + while (dbdma_ld32(&dmap->status) & RUN) eieio(); } @@ -213,22 +213,22 @@ static inline void bmwrite(struct net_device *dev, unsigned long reg_offset, unsigned data ) { - out_le16((void *)dev->base_addr + reg_offset, data); + out_le16((void __iomem *)dev->base_addr + reg_offset, data); } static inline volatile unsigned short bmread(struct net_device *dev, unsigned long reg_offset ) { - return in_le16((void *)dev->base_addr + reg_offset); + return in_le16((void __iomem *)dev->base_addr + reg_offset); } static void bmac_enable_and_reset_chip(struct net_device *dev) { struct bmac_data *bp = netdev_priv(dev); - volatile struct dbdma_regs *rd = bp->rx_dma; - volatile struct dbdma_regs *td = bp->tx_dma; + volatile struct dbdma_regs __iomem *rd = bp->rx_dma; + volatile struct dbdma_regs __iomem *td = bp->tx_dma; if (rd) dbdma_reset(rd); @@ -406,7 +406,7 @@ bmac_start_chip(struct net_device *dev) { struct bmac_data *bp = netdev_priv(dev); - volatile struct dbdma_regs *rd = bp->rx_dma; + volatile struct dbdma_regs __iomem *rd = bp->rx_dma; unsigned short oldConfig; /* enable rx dma channel */ @@ -476,8 +476,8 @@ bp->sleeping = 1; spin_unlock_irqrestore(&bp->lock, flags); if (bp->opened) { - volatile struct dbdma_regs *rd = bp->rx_dma; - volatile struct dbdma_regs *td = bp->tx_dma; + volatile struct dbdma_regs __iomem *rd = bp->rx_dma; + volatile struct dbdma_regs __iomem *td = bp->tx_dma; config = bmread(dev, RXCFG); bmwrite(dev, RXCFG, (config & ~RxMACEnable)); @@ -602,7 +602,7 @@ static void bmac_init_tx_ring(struct bmac_data *bp) { - volatile struct dbdma_regs *td = bp->tx_dma; + volatile struct dbdma_regs __iomem *td = bp->tx_dma; memset((char *)bp->tx_cmds, 0, (N_TX_RING+1) * sizeof(struct dbdma_cmd)); @@ -623,7 +623,7 @@ static int bmac_init_rx_ring(struct bmac_data *bp) { - volatile struct dbdma_regs *rd = bp->rx_dma; + volatile struct dbdma_regs __iomem *rd = bp->rx_dma; int i; struct sk_buff *skb; @@ -657,7 +657,7 @@ static int bmac_transmit_packet(struct sk_buff *skb, struct net_device *dev) { struct bmac_data *bp = netdev_priv(dev); - volatile struct dbdma_regs *td = bp->tx_dma; + volatile struct dbdma_regs __iomem *td = bp->tx_dma; int i; /* see if there's a free slot in the tx ring */ @@ -693,7 +693,7 @@ { struct net_device *dev = (struct net_device *) dev_id; struct bmac_data *bp = netdev_priv(dev); - volatile struct dbdma_regs *rd = bp->rx_dma; + volatile struct dbdma_regs __iomem *rd = bp->rx_dma; volatile struct dbdma_cmd *cp; int i, nb, stat; struct sk_buff *skb; @@ -1331,13 +1331,11 @@ goto err_out_iounmap; bp->is_bmac_plus = is_bmac_plus; - bp->tx_dma = (volatile struct dbdma_regs *) - ioremap(macio_resource_start(mdev, 1), macio_resource_len(mdev, 1)); + bp->tx_dma = ioremap(macio_resource_start(mdev, 1), macio_resource_len(mdev, 1)); if (!bp->tx_dma) goto err_out_iounmap; bp->tx_dma_intr = macio_irq(mdev, 1); - bp->rx_dma = (volatile struct dbdma_regs *) - ioremap(macio_resource_start(mdev, 2), macio_resource_len(mdev, 2)); + bp->rx_dma = ioremap(macio_resource_start(mdev, 2), macio_resource_len(mdev, 2)); if (!bp->rx_dma) goto err_out_iounmap_tx; bp->rx_dma_intr = macio_irq(mdev, 2); @@ -1392,11 +1390,11 @@ err_out_irq0: free_irq(dev->irq, dev); err_out_iounmap_rx: - iounmap((void *)bp->rx_dma); + iounmap(bp->rx_dma); err_out_iounmap_tx: - iounmap((void *)bp->tx_dma); + iounmap(bp->tx_dma); err_out_iounmap: - iounmap((void *)dev->base_addr); + iounmap((void __iomem *)dev->base_addr); out_release: macio_release_resources(mdev); out_free: @@ -1421,8 +1419,8 @@ static int bmac_close(struct net_device *dev) { struct bmac_data *bp = netdev_priv(dev); - volatile struct dbdma_regs *rd = bp->rx_dma; - volatile struct dbdma_regs *td = bp->tx_dma; + volatile struct dbdma_regs __iomem *rd = bp->rx_dma; + volatile struct dbdma_regs __iomem *td = bp->tx_dma; unsigned short config; int i; @@ -1505,8 +1503,8 @@ { struct net_device *dev = (struct net_device *) data; struct bmac_data *bp = netdev_priv(dev); - volatile struct dbdma_regs *td = bp->tx_dma; - volatile struct dbdma_regs *rd = bp->rx_dma; + volatile struct dbdma_regs __iomem *td = bp->tx_dma; + volatile struct dbdma_regs __iomem *rd = bp->rx_dma; volatile struct dbdma_cmd *cp; unsigned long flags; unsigned short config, oldConfig; @@ -1638,9 +1636,9 @@ free_irq(bp->tx_dma_intr, dev); free_irq(bp->rx_dma_intr, dev); - iounmap((void *)dev->base_addr); - iounmap((void *)bp->tx_dma); - iounmap((void *)bp->rx_dma); + iounmap((void __iomem *)dev->base_addr); + iounmap(bp->tx_dma); + iounmap(bp->rx_dma); macio_release_resources(mdev); diff -Nru a/drivers/net/hamachi.c b/drivers/net/hamachi.c --- a/drivers/net/hamachi.c 2005-01-18 03:13:47 -05:00 +++ b/drivers/net/hamachi.c 2005-01-18 03:13:47 -05:00 @@ -512,6 +512,7 @@ u32 rx_int_var, tx_int_var; /* interrupt control variables */ u32 option; /* Hold on to a copy of the options */ struct pci_dev *pci_dev; + void __iomem *base; }; MODULE_AUTHOR("Donald Becker , Eric Kasten , Keith Underwood "); @@ -549,7 +550,7 @@ MODULE_PARM_DESC(full_duplex, "GNIC-II full duplex setting(s) (1)"); MODULE_PARM_DESC(force32, "GNIC-II: Bit 0: 32 bit PCI, bit 1: disable parity, bit 2: 64 bit PCI (all boards)"); -static int read_eeprom(long ioaddr, int location); +static int read_eeprom(void __iomem *ioaddr, int location); static int mdio_read(struct net_device *dev, int phy_id, int location); static void mdio_write(struct net_device *dev, int phy_id, int location, int value); static int hamachi_open(struct net_device *dev); @@ -575,7 +576,8 @@ int option, i, rx_int_var, tx_int_var, boguscnt; int chip_id = ent->driver_data; int irq; - long ioaddr; + void __iomem *ioaddr; + unsigned long base; static int card_idx; struct net_device *dev; void *ring_space; @@ -594,9 +596,9 @@ goto err_out; } - ioaddr = pci_resource_start(pdev, 0); + base = pci_resource_start(pdev, 0); #ifdef __alpha__ /* Really "64 bit addrs" */ - ioaddr |= (pci_resource_start(pdev, 1) << 32); + base |= (pci_resource_start(pdev, 1) << 32); #endif pci_set_master(pdev); @@ -605,7 +607,7 @@ if (i) return i; irq = pdev->irq; - ioaddr = (long) ioremap(ioaddr, 0x400); + ioaddr = ioremap(base, 0x400); if (!ioaddr) goto err_out_release; @@ -678,7 +680,8 @@ i = readb(ioaddr + PCIClkMeas); } - dev->base_addr = ioaddr; + hmp->base = ioaddr; + dev->base_addr = (unsigned long)ioaddr; dev->irq = irq; pci_set_drvdata(pdev, dev); @@ -741,7 +744,7 @@ goto err_out_unmap_rx; } - printk(KERN_INFO "%s: %s type %x at 0x%lx, ", + printk(KERN_INFO "%s: %s type %x at %p, ", dev->name, chip_tbl[chip_id].name, readl(ioaddr + ChipRev), ioaddr); for (i = 0; i < 5; i++) @@ -790,14 +793,14 @@ err_out_cleardev: free_netdev (dev); err_out_iounmap: - iounmap((char *)ioaddr); + iounmap(ioaddr); err_out_release: pci_release_regions(pdev); err_out: return ret; } -static int __devinit read_eeprom(long ioaddr, int location) +static int __devinit read_eeprom(void __iomem *ioaddr, int location) { int bogus_cnt = 1000; @@ -819,7 +822,8 @@ static int mdio_read(struct net_device *dev, int phy_id, int location) { - long ioaddr = dev->base_addr; + struct hamachi_private *hmp = netdev_priv(dev); + void __iomem *ioaddr = hmp->base; int i; /* We should check busy first - per docs -KDU */ @@ -836,7 +840,8 @@ static void mdio_write(struct net_device *dev, int phy_id, int location, int value) { - long ioaddr = dev->base_addr; + struct hamachi_private *hmp = netdev_priv(dev); + void __iomem *ioaddr = hmp->base; int i; /* We should check busy first - per docs -KDU */ @@ -857,7 +862,7 @@ static int hamachi_open(struct net_device *dev) { struct hamachi_private *hmp = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = hmp->base; int i; u32 rx_int_var, tx_int_var; u16 fifo_info; @@ -987,7 +992,7 @@ writew(0x001D, ioaddr + RxDMACtrl); writew(0x001D, ioaddr + TxDMACtrl); #endif - writew(0x0001, dev->base_addr + RxCmd); + writew(0x0001, ioaddr + RxCmd); if (hamachi_debug > 2) { printk(KERN_DEBUG "%s: Done hamachi_open(), status: Rx %x Tx %x.\n", @@ -1038,7 +1043,7 @@ { struct net_device *dev = (struct net_device *)data; struct hamachi_private *hmp = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = hmp->base; int next_tick = 10*HZ; if (hamachi_debug > 2) { @@ -1063,7 +1068,7 @@ { int i; struct hamachi_private *hmp = netdev_priv(dev); - long ioaddr = dev->base_addr; + void __iomem *ioaddr = hmp->base; printk(KERN_WARNING "%s: Hamachi transmit timed out, status %8.8x," " resetting...\n", dev->name, (int)readw(ioaddr + TxStatus)); @@ -1115,7 +1120,7 @@ } udelay(60); /* Sleep 60 us just for safety sake */ - writew(0x0002, dev->base_addr + RxCmd); /* STOP Rx */ + writew(0x0002, ioaddr + RxCmd); /* STOP Rx */ writeb(0x01, ioaddr + ChipReset); /* Reinit the hardware */ @@ -1157,9 +1162,9 @@ hmp->stats.tx_errors++; /* Restart the chip's Tx/Rx processes . */ - writew(0x0002, dev->base_addr + TxCmd); /* STOP Tx */ - writew(0x0001, dev->base_addr + TxCmd); /* START Tx */ - writew(0x0001, dev->base_addr + RxCmd); /* START Rx */ + writew(0x0002, ioaddr + TxCmd); /* STOP Tx */ + writew(0x0001, ioaddr + TxCmd); /* START Tx */ + writew(0x0001, ioaddr + RxCmd); /* START Rx */ netif_wake_queue(dev); } @@ -1275,9 +1280,9 @@ /* Wake the potentially-idle transmit channel. */ /* If we don't need to read status, DON'T -KDU */ - status=readw(dev->base_addr + TxStatus); + status=readw(hmp->base + TxStatus); if( !(status & 0x0001) || (status & 0x0002)) - writew(0x0001, dev->base_addr + TxCmd); + writew(0x0001, hmp->base + TxCmd); return 1; } @@ -1343,9 +1348,9 @@ /* Wake the potentially-idle transmit channel. */ /* If we don't need to read status, DON'T -KDU */ - status=readw(dev->base_addr + TxStatus); + status=readw(hmp->base + TxStatus); if( !(status & 0x0001) || (status & 0x0002)) - writew(0x0001, dev->base_addr + TxCmd); + writew(0x0001, hmp->base + TxCmd); /* Immediately before returning, let's clear as many entries as we can. */ hamachi_tx(dev); @@ -1376,8 +1381,9 @@ static irqreturn_t hamachi_interrupt(int irq, void *dev_instance, struct pt_regs *rgs) { struct net_device *dev = dev_instance; - struct hamachi_private *hmp; - long ioaddr, boguscnt = max_interrupt_work; + struct hamachi_private *hmp = netdev_priv(dev); + void __iomem *ioaddr = hmp->base; + long boguscnt = max_interrupt_work; int handled = 0; #ifndef final_version /* Can never occur. */ @@ -1387,8 +1393,6 @@ } #endif - ioaddr = dev->base_addr; - hmp = netdev_priv(dev); spin_lock(&hmp->lock); do { @@ -1687,8 +1691,8 @@ /* Restart Rx engine if stopped. */ /* If we don't need to check status, don't. -KDU */ - if (readw(dev->base_addr + RxStatus) & 0x0002) - writew(0x0001, dev->base_addr + RxCmd); + if (readw(hmp->base + RxStatus) & 0x0002) + writew(0x0001, hmp->base + RxCmd); return 0; } @@ -1697,8 +1701,8 @@ than just errors. */ static void hamachi_error(struct net_device *dev, int intr_status) { - long ioaddr = dev->base_addr; struct hamachi_private *hmp = netdev_priv(dev); + void __iomem *ioaddr = hmp->base; if (intr_status & (LinkChange|NegotiationChange)) { if (hamachi_debug > 1) @@ -1731,8 +1735,8 @@ static int hamachi_close(struct net_device *dev) { - long ioaddr = dev->base_addr; struct hamachi_private *hmp = netdev_priv(dev); + void __iomem *ioaddr = hmp->base; struct sk_buff *skb; int i; @@ -1817,8 +1821,8 @@ static struct net_device_stats *hamachi_get_stats(struct net_device *dev) { - long ioaddr = dev->base_addr; struct hamachi_private *hmp = netdev_priv(dev); + void __iomem *ioaddr = hmp->base; /* We should lock this segment of code for SMP eventually, although the vulnerability window is very small and statistics are @@ -1845,7 +1849,8 @@ static void set_rx_mode(struct net_device *dev) { - long ioaddr = dev->base_addr; + struct hamachi_private *hmp = netdev_priv(dev); + void __iomem *ioaddr = hmp->base; if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ /* Unconditionally log net taps. */ @@ -1950,11 +1955,11 @@ */ if (!capable(CAP_NET_ADMIN)) return -EPERM; - writel(d[0], dev->base_addr + TxIntrCtrl); - writel(d[1], dev->base_addr + RxIntrCtrl); + writel(d[0], np->base + TxIntrCtrl); + writel(d[1], np->base + RxIntrCtrl); printk(KERN_NOTICE "%s: tx %08x, rx %08x intr\n", dev->name, - (u32) readl(dev->base_addr + TxIntrCtrl), - (u32) readl(dev->base_addr + RxIntrCtrl)); + (u32) readl(np->base + TxIntrCtrl), + (u32) readl(np->base + RxIntrCtrl)); rc = 0; } @@ -1980,7 +1985,7 @@ pci_free_consistent(pdev, TX_TOTAL_SIZE, hmp->tx_ring, hmp->tx_ring_dma); unregister_netdev(dev); - iounmap((char *)dev->base_addr); + iounmap(hmp->base); free_netdev(dev); pci_release_regions(pdev); pci_set_drvdata(pdev, NULL); diff -Nru a/drivers/net/myri_sbus.c b/drivers/net/myri_sbus.c --- a/drivers/net/myri_sbus.c 2005-01-18 03:13:47 -05:00 +++ b/drivers/net/myri_sbus.c 2005-01-18 03:13:47 -05:00 @@ -118,7 +118,7 @@ static inline void bang_the_chip(struct myri_eth *mp) { - struct myri_shmem *shmem = mp->shmem; + struct myri_shmem __iomem *shmem = mp->shmem; void __iomem *cregs = mp->cregs; sbus_writel(1, &shmem->send); @@ -127,9 +127,9 @@ static int myri_do_handshake(struct myri_eth *mp) { - struct myri_shmem *shmem = mp->shmem; + struct myri_shmem __iomem *shmem = mp->shmem; void __iomem *cregs = mp->cregs; - struct myri_channel *chan = &shmem->channel; + struct myri_channel __iomem *chan = &shmem->channel; int tick = 0; DET(("myri_do_handshake: ")); @@ -427,7 +427,7 @@ u32 csum = sbus_readl(&rxdack->csum); int len = sbus_readl(&rxdack->myri_scatters[0].len); int index = sbus_readl(&rxdack->ctx); - struct myri_rxd __iomem *rxd = &rq->myri_rxd[rq->tail]; + struct myri_rxd __iomem *rxd = &rq->myri_rxd[sbus_readl(&rq->tail)]; struct sk_buff *skb = mp->rx_skbs[index]; /* Ack it. */ @@ -546,7 +546,7 @@ struct net_device *dev = (struct net_device *) dev_id; struct myri_eth *mp = (struct myri_eth *) dev->priv; void __iomem *lregs = mp->lregs; - struct myri_channel *chan = &mp->shmem->channel; + struct myri_channel __iomem *chan = &mp->shmem->channel; unsigned long flags; u32 status; int handled = 0; diff -Nru a/drivers/net/s2io.c b/drivers/net/s2io.c --- a/drivers/net/s2io.c 2005-01-18 03:13:47 -05:00 +++ b/drivers/net/s2io.c 2005-01-18 03:13:47 -05:00 @@ -277,7 +277,7 @@ int lst_size, lst_per_page; struct net_device *dev = nic->dev; #ifdef CONFIG_2BUFF_MODE - u64 tmp; + unsigned long tmp; buffAdd_t *ba; #endif @@ -448,22 +448,22 @@ while (k != MAX_RXDS_PER_BLOCK) { ba = &nic->ba[i][j][k]; - ba->ba_0_org = (void *) kmalloc + ba->ba_0_org = kmalloc (BUF0_LEN + ALIGN_SIZE, GFP_KERNEL); if (!ba->ba_0_org) return -ENOMEM; - tmp = (u64) ba->ba_0_org; + tmp = (unsigned long) ba->ba_0_org; tmp += ALIGN_SIZE; - tmp &= ~((u64) ALIGN_SIZE); + tmp &= ~((unsigned long) ALIGN_SIZE); ba->ba_0 = (void *) tmp; - ba->ba_1_org = (void *) kmalloc + ba->ba_1_org = kmalloc (BUF1_LEN + ALIGN_SIZE, GFP_KERNEL); if (!ba->ba_1_org) return -ENOMEM; - tmp = (u64) ba->ba_1_org; + tmp = (unsigned long) ba->ba_1_org; tmp += ALIGN_SIZE; - tmp &= ~((u64) ALIGN_SIZE); + tmp &= ~((unsigned long) ALIGN_SIZE); ba->ba_1 = (void *) tmp; k++; } @@ -610,10 +610,10 @@ static int init_nic(struct s2io_nic *nic) { - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic->bar0; + XENA_dev_config_t __iomem *bar0 = nic->bar0; struct net_device *dev = nic->dev; register u64 val64 = 0; - void *add; + void __iomem *add; u32 time; int i, j; mac_info_t *mac_control; @@ -702,7 +702,7 @@ schedule_timeout(HZ / 2); /* Enable Receiving broadcasts */ - add = (void *) &bar0->mac_cfg; + add = &bar0->mac_cfg; val64 = readq(&bar0->mac_cfg); val64 |= MAC_RMAC_BCAST_ENABLE; writeq(RMAC_CFG_KEY(0x4C0D), &bar0->rmac_cfg_key); @@ -1003,7 +1003,7 @@ writeq(0xffbbffbbffbbffbbULL, &bar0->mc_pause_thresh_q4q7); /* Disable RMAC PAD STRIPPING */ - add = (void *) &bar0->mac_cfg; + add = &bar0->mac_cfg; val64 = readq(&bar0->mac_cfg); val64 &= ~(MAC_CFG_RMAC_STRIP_PAD); writeq(RMAC_CFG_KEY(0x4C0D), &bar0->rmac_cfg_key); @@ -1069,7 +1069,7 @@ static void en_dis_able_nic_intrs(struct s2io_nic *nic, u16 mask, int flag) { - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic->bar0; + XENA_dev_config_t __iomem *bar0 = nic->bar0; register u64 val64 = 0, temp64 = 0; /* Top level interrupt classification */ @@ -1354,7 +1354,7 @@ void fix_mac_address(nic_t * sp) { - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0; + XENA_dev_config_t __iomem *bar0 = sp->bar0; u64 val64; int i = 0; @@ -1379,7 +1379,7 @@ static int start_nic(struct s2io_nic *nic) { - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic->bar0; + XENA_dev_config_t __iomem *bar0 = nic->bar0; struct net_device *dev = nic->dev; register u64 val64 = 0; u16 interruptible, i; @@ -1474,7 +1474,7 @@ val64 |= 0x0000800000000000ULL; writeq(val64, &bar0->gpio_control); val64 = 0x0411040400000000ULL; - writeq(val64, (void *) ((u8 *) bar0 + 0x2700)); + writeq(val64, (void __iomem *) bar0 + 0x2700); } /* @@ -1557,7 +1557,7 @@ static void stop_nic(struct s2io_nic *nic) { - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic->bar0; + XENA_dev_config_t __iomem *bar0 = nic->bar0; register u64 val64 = 0; u16 interruptible, i; mac_info_t *mac_control; @@ -1615,7 +1615,7 @@ #ifdef CONFIG_2BUFF_MODE RxD_t *rxdpnext; int nextblk; - u64 tmp; + unsigned long tmp; buffAdd_t *ba; dma_addr_t rxdpphys; #endif @@ -1757,7 +1757,7 @@ #else ba = &nic->ba[ring_no][block_no][off]; skb_reserve(skb, BUF0_LEN); - tmp = (u64) skb->data; + tmp = (unsigned long) skb->data; tmp += ALIGN_SIZE; tmp &= ~ALIGN_SIZE; skb->data = (void *) tmp; @@ -1900,7 +1900,7 @@ static int s2io_poll(struct net_device *dev, int *budget) { nic_t *nic = dev->priv; - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic->bar0; + XENA_dev_config_t __iomem *bar0 = nic->bar0; int pkts_to_process = *budget, pkt_cnt = 0; register u64 val64 = 0; rx_curr_get_info_t get_info, put_info; @@ -2269,7 +2269,7 @@ static void tx_intr_handler(struct s2io_nic *nic) { - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic->bar0; + XENA_dev_config_t __iomem *bar0 = nic->bar0; struct net_device *dev = (struct net_device *) nic->dev; tx_curr_get_info_t get_info, put_info; struct sk_buff *skb; @@ -2376,7 +2376,7 @@ static void alarm_intr_handler(struct s2io_nic *nic) { struct net_device *dev = (struct net_device *) nic->dev; - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic->bar0; + XENA_dev_config_t __iomem *bar0 = nic->bar0; register u64 val64 = 0, err_reg = 0; /* Handling link status change error Intr */ @@ -2427,7 +2427,7 @@ int wait_for_cmd_complete(nic_t * sp) { - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0; + XENA_dev_config_t __iomem *bar0 = sp->bar0; int ret = FAILURE, cnt = 0; u64 val64; @@ -2458,7 +2458,7 @@ void s2io_reset(nic_t * sp) { - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0; + XENA_dev_config_t __iomem *bar0 = sp->bar0; u64 val64; u16 subid; @@ -2494,7 +2494,7 @@ val64 |= 0x0000800000000000ULL; writeq(val64, &bar0->gpio_control); val64 = 0x0411040400000000ULL; - writeq(val64, (void *) ((u8 *) bar0 + 0x2700)); + writeq(val64, (void __iomem *) bar0 + 0x2700); } sp->device_enabled_once = FALSE; @@ -2513,7 +2513,7 @@ int s2io_set_swapper(nic_t * sp) { struct net_device *dev = sp->dev; - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0; + XENA_dev_config_t __iomem *bar0 = sp->bar0; u64 val64; /* @@ -2689,14 +2689,14 @@ u16 frg_cnt, frg_len, i, queue, queue_len, put_off, get_off; register u64 val64; TxD_t *txdp; - TxFIFO_element_t *tx_fifo; + TxFIFO_element_t __iomem *tx_fifo; unsigned long flags; #ifdef NETIF_F_TSO int mss; #endif mac_info_t *mac_control; struct config_param *config; - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0; + XENA_dev_config_t __iomem *bar0 = sp->bar0; mac_control = &sp->mac_control; config = &sp->config; @@ -2813,7 +2813,7 @@ { struct net_device *dev = (struct net_device *) dev_id; nic_t *sp = dev->priv; - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0; + XENA_dev_config_t __iomem *bar0 = sp->bar0; #ifndef CONFIG_S2IO_NAPI int i, ret; #endif @@ -2939,11 +2939,11 @@ int i, j, prev_cnt; struct dev_mc_list *mclist; nic_t *sp = dev->priv; - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0; + XENA_dev_config_t __iomem *bar0 = sp->bar0; u64 val64 = 0, multi_mac = 0x010203040506ULL, mask = 0xfeffffffffffULL; u64 dis_addr = 0xffffffffffffULL, mac_addr = 0; - void *add; + void __iomem *add; if ((dev->flags & IFF_ALLMULTI) && (!sp->m_cast_flg)) { /* Enable all Multicast addresses */ @@ -2977,7 +2977,7 @@ if ((dev->flags & IFF_PROMISC) && (!sp->promisc_flg)) { /* Put the NIC into promiscuous mode */ - add = (void *) &bar0->mac_cfg; + add = &bar0->mac_cfg; val64 = readq(&bar0->mac_cfg); val64 |= MAC_CFG_RMAC_PROM_ENABLE; @@ -2992,7 +2992,7 @@ dev->name); } else if (!(dev->flags & IFF_PROMISC) && (sp->promisc_flg)) { /* Remove the NIC from promiscuous mode */ - add = (void *) &bar0->mac_cfg; + add = &bar0->mac_cfg; val64 = readq(&bar0->mac_cfg); val64 &= ~MAC_CFG_RMAC_PROM_ENABLE; @@ -3082,7 +3082,7 @@ int s2io_set_mac_addr(struct net_device *dev, u8 * addr) { nic_t *sp = dev->priv; - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0; + XENA_dev_config_t __iomem *bar0 = sp->bar0; register u64 val64, mac_addr = 0; int i; @@ -3225,7 +3225,7 @@ regs->version = sp->pdev->subsystem_device; for (i = 0; i < regs->len; i += 8) { - reg = readq((void *) (sp->bar0 + i)); + reg = readq(sp->bar0 + i); memcpy((reg_space + i), ®, 8); } } @@ -3242,7 +3242,7 @@ static void s2io_phy_id(unsigned long data) { nic_t *sp = (nic_t *) data; - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0; + XENA_dev_config_t __iomem *bar0 = sp->bar0; u64 val64 = 0; u16 subid; @@ -3279,7 +3279,7 @@ { u64 val64 = 0, last_gpio_ctrl_val; nic_t *sp = dev->priv; - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0; + XENA_dev_config_t __iomem *bar0 = sp->bar0; u16 subid; subid = sp->pdev->subsystem_device; @@ -3327,7 +3327,7 @@ { u64 val64; nic_t *sp = dev->priv; - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0; + XENA_dev_config_t __iomem *bar0 = sp->bar0; val64 = readq(&bar0->rmac_pause_cfg); if (val64 & RMAC_PAUSE_GEN_ENABLE) @@ -3354,7 +3354,7 @@ { u64 val64; nic_t *sp = dev->priv; - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0; + XENA_dev_config_t __iomem *bar0 = sp->bar0; val64 = readq(&bar0->rmac_pause_cfg); if (ep->tx_pause) @@ -3391,7 +3391,7 @@ int ret = -1; u32 exit_cnt = 0; u64 val64; - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0; + XENA_dev_config_t __iomem *bar0 = sp->bar0; val64 = I2C_CONTROL_DEV_ID(S2IO_DEV_ID) | I2C_CONTROL_ADDR(off) | I2C_CONTROL_BYTE_CNT(0x3) | I2C_CONTROL_READ | @@ -3432,7 +3432,7 @@ { int exit_cnt = 0, ret = -1; u64 val64; - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0; + XENA_dev_config_t __iomem *bar0 = sp->bar0; val64 = I2C_CONTROL_DEV_ID(S2IO_DEV_ID) | I2C_CONTROL_ADDR(off) | I2C_CONTROL_BYTE_CNT(cnt) | I2C_CONTROL_SET_DATA(data) | @@ -3555,7 +3555,7 @@ static int s2io_register_test(nic_t * sp, uint64_t * data) { - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0; + XENA_dev_config_t __iomem *bar0 = sp->bar0; u64 val64 = 0; int fail = 0; @@ -3726,7 +3726,7 @@ static int s2io_link_test(nic_t * sp, uint64_t * data) { - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0; + XENA_dev_config_t __iomem *bar0 = sp->bar0; u64 val64; val64 = readq(&bar0->adapter_status); @@ -3751,7 +3751,7 @@ static int s2io_rldram_test(nic_t * sp, uint64_t * data) { - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0; + XENA_dev_config_t __iomem *bar0 = sp->bar0; u64 val64; int cnt, iteration = 0, test_pass = 0; @@ -4092,7 +4092,7 @@ int s2io_change_mtu(struct net_device *dev, int new_mtu) { nic_t *sp = dev->priv; - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0; + XENA_dev_config_t __iomem *bar0 = sp->bar0; register u64 val64; if (netif_running(dev)) { @@ -4169,7 +4169,7 @@ { nic_t *nic = (nic_t *) data; struct net_device *dev = nic->dev; - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic->bar0; + XENA_dev_config_t __iomem *bar0 = nic->bar0; register u64 val64; u16 subid; @@ -4233,7 +4233,7 @@ static void s2io_card_down(nic_t * sp) { int cnt = 0; - XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0; + XENA_dev_config_t __iomem *bar0 = sp->bar0; unsigned long flags; register u64 val64 = 0; @@ -4611,7 +4611,7 @@ int dma_flag = FALSE; u32 mac_up, mac_down; u64 val64 = 0, tmp64 = 0; - XENA_dev_config_t *bar0 = NULL; + XENA_dev_config_t __iomem *bar0 = NULL; u16 subid; mac_info_t *mac_control; struct config_param *config; @@ -4741,7 +4741,7 @@ goto mem_alloc_failed; } - sp->bar0 = (caddr_t) ioremap(pci_resource_start(pdev, 0), + sp->bar0 = ioremap(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0)); if (!sp->bar0) { DBG_PRINT(ERR_DBG, "%s: S2IO: cannot remap io mem1\n", @@ -4750,7 +4750,7 @@ goto bar0_remap_failed; } - sp->bar1 = (caddr_t) ioremap(pci_resource_start(pdev, 2), + sp->bar1 = ioremap(pci_resource_start(pdev, 2), pci_resource_len(pdev, 2)); if (!sp->bar1) { DBG_PRINT(ERR_DBG, "%s: S2IO: cannot remap io mem2\n", @@ -4764,7 +4764,7 @@ /* Initializing the BAR1 address as the start of the FIFO pointer. */ for (j = 0; j < MAX_TX_FIFOS; j++) { - mac_control->tx_FIFO_start[j] = (TxFIFO_element_t *) + mac_control->tx_FIFO_start[j] = (TxFIFO_element_t __iomem *) (sp->bar1 + (j * 0x00020000)); } @@ -4829,7 +4829,7 @@ * MAC address initialization. * For now only one mac address will be read and used. */ - bar0 = (XENA_dev_config_t *) sp->bar0; + bar0 = sp->bar0; val64 = RMAC_ADDR_CMD_MEM_RD | RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD | RMAC_ADDR_CMD_MEM_OFFSET(0 + MAC_MAC_ADDR_START_OFFSET); writeq(val64, &bar0->rmac_addr_cmd_mem); @@ -4886,7 +4886,7 @@ val64 |= 0x0000800000000000ULL; writeq(val64, &bar0->gpio_control); val64 = 0x0411040400000000ULL; - writeq(val64, (u64 *) ((u8 *) bar0 + 0x2700)); + writeq(val64, (void __iomem *) bar0 + 0x2700); val64 = readq(&bar0->gpio_control); } diff -Nru a/drivers/net/s2io.h b/drivers/net/s2io.h --- a/drivers/net/s2io.h 2005-01-18 03:13:47 -05:00 +++ b/drivers/net/s2io.h 2005-01-18 03:13:47 -05:00 @@ -583,7 +583,7 @@ /* tx side stuff */ /* logical pointer of start of each Tx FIFO */ - TxFIFO_element_t *tx_FIFO_start[MAX_TX_FIFOS]; + TxFIFO_element_t __iomem *tx_FIFO_start[MAX_TX_FIFOS]; /* Current offset within tx_FIFO_start, where driver would write new Tx frame*/ tx_curr_put_info_t tx_curr_put_info[MAX_TX_FIFOS]; @@ -623,8 +623,8 @@ macaddr_t pre_mac_addr[MAX_MAC_SUPPORTED]; struct net_device_stats stats; - caddr_t bar0; - caddr_t bar1; + void __iomem *bar0; + void __iomem *bar1; struct config_param config; mac_info_t mac_control; int high_dma_flag; @@ -736,10 +736,9 @@ /* OS related system calls */ #ifndef readq -static inline u64 readq(void *addr) +static inline u64 readq(void __iomem *addr) { - u64 ret = 0; - ret = readl(addr + 4); + u64 ret = readl(addr + 4); ret <<= 32; ret |= readl(addr); @@ -748,7 +747,7 @@ #endif #ifndef writeq -static inline void writeq(u64 val, void *addr) +static inline void writeq(u64 val, void __iomem *addr) { writel((u32) (val), addr); writel((u32) (val >> 32), (addr + 4)); @@ -762,7 +761,7 @@ */ #define UF 1 #define LF 2 -static inline void SPECIAL_REG_WRITE(u64 val, void *addr, int order) +static inline void SPECIAL_REG_WRITE(u64 val, void __iomem *addr, int order) { if (order == LF) { writel((u32) (val), addr); diff -Nru a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c --- a/drivers/net/tulip/tulip_core.c 2005-01-18 03:13:47 -05:00 +++ b/drivers/net/tulip/tulip_core.c 2005-01-18 03:13:47 -05:00 @@ -1051,7 +1051,7 @@ else filterbit = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26; filterbit &= 0x3f; - mc_filter[filterbit >> 5] |= cpu_to_le32(1 << (filterbit & 31)); + mc_filter[filterbit >> 5] |= 1 << (filterbit & 31); if (tulip_debug > 2) { printk(KERN_INFO "%s: Added filter for %2.2x:%2.2x:%2.2x:" "%2.2x:%2.2x:%2.2x %8.8x bit %d.\n", dev->name, diff -Nru a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c --- a/drivers/net/tulip/winbond-840.c 2005-01-18 03:13:47 -05:00 +++ b/drivers/net/tulip/winbond-840.c 2005-01-18 03:13:47 -05:00 @@ -1410,7 +1410,7 @@ i++, mclist = mclist->next) { int filterbit = (ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26) ^ 0x3F; filterbit &= 0x3f; - mc_filter[filterbit >> 5] |= cpu_to_le32(1 << (filterbit & 31)); + mc_filter[filterbit >> 5] |= 1 << (filterbit & 31); } rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys; } diff -Nru a/drivers/net/tun.c b/drivers/net/tun.c --- a/drivers/net/tun.c 2005-01-18 03:13:47 -05:00 +++ b/drivers/net/tun.c 2005-01-18 03:13:47 -05:00 @@ -16,11 +16,25 @@ */ /* + * Changes: + * + * Mark Smith + * Use random_ether_addr() for tap MAC address. + * + * Harald Roelle 2004/04/20 + * Fixes in packet dropping, queue length setting and queue wakeup. + * Increased default tx queue length. + * Added ethtool API. + * Minor cleanups + * * Daniel Podlejski * Modifications for 2.3.99-pre5 kernel. */ -#define TUN_VER "1.5" +#define DRV_NAME "tun" +#define DRV_VERSION "1.6" +#define DRV_DESCRIPTION "Universal TUN/TAP device driver" +#define DRV_COPYRIGHT "(C) 1999-2004 Max Krasnyansky " #include #include @@ -31,11 +45,11 @@ #include #include #include -#include #include #include #include #include +#include #include #include #include @@ -53,6 +67,7 @@ /* Network device part of the driver */ static LIST_HEAD(tun_dev_list); +static struct ethtool_ops tun_ethtool_ops; /* Net device open. */ static int tun_net_open(struct net_device *dev) @@ -79,18 +94,24 @@ if (!tun->attached) goto drop; - /* Queue packet */ - if (!(tun->flags & TUN_ONE_QUEUE)) { - /* Normal queueing mode. - * Packet scheduler handles dropping. */ - if (skb_queue_len(&tun->readq) >= TUN_READQ_SIZE) + /* Packet dropping */ + if (skb_queue_len(&tun->readq) >= dev->tx_queue_len) { + if (!(tun->flags & TUN_ONE_QUEUE)) { + /* Normal queueing mode. */ + /* Packet scheduler handles dropping of further packets. */ netif_stop_queue(dev); - } else { - /* Single queue mode. - * Driver handles dropping itself. */ - if (skb_queue_len(&tun->readq) >= dev->tx_queue_len) + + /* We won't see all dropped packets individually, so overrun + * error is more appropriate. */ + tun->stats.tx_fifo_errors++; + } else { + /* Single queue mode. + * Driver handles dropping of all packets itself. */ goto drop; + } } + + /* Queue packet */ skb_queue_tail(&tun->readq, skb); /* Notify and wake up reader process */ @@ -164,18 +185,16 @@ /* Zero header length */ dev->type = ARPHRD_NONE; dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST; - dev->tx_queue_len = 10; + dev->tx_queue_len = TUN_READQ_SIZE; /* We prefer our own queue length */ break; case TUN_TAP_DEV: /* Ethernet TAP Device */ dev->set_multicast_list = tun_net_mclist; - /* Generate random Ethernet address. */ - *(u16 *)dev->dev_addr = htons(0x00FF); - get_random_bytes(dev->dev_addr + sizeof(u16), 4); - ether_setup(dev); + random_ether_addr(dev->dev_addr); + dev->tx_queue_len = TUN_READQ_SIZE; /* We prefer our own queue length */ break; } } @@ -354,7 +373,7 @@ schedule(); continue; } - netif_start_queue(tun->dev); + netif_wake_queue(tun->dev); /** Decide whether to accept this packet. This code is designed to * behave identically to an Ethernet interface. Accept the packet if @@ -418,6 +437,7 @@ dev->hard_start_xmit = tun_net_xmit; dev->stop = tun_net_close; dev->get_stats = tun_net_stats; + dev->ethtool_ops = &tun_ethtool_ops; dev->destructor = free_netdev; } @@ -736,12 +756,97 @@ .devfs_name = "net/tun", }; +/* ethtool interface */ + +static int tun_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) +{ + cmd->supported = 0; + cmd->advertising = 0; + cmd->speed = SPEED_10; + cmd->duplex = DUPLEX_FULL; + cmd->port = PORT_TP; + cmd->phy_address = 0; + cmd->transceiver = XCVR_INTERNAL; + cmd->autoneg = AUTONEG_DISABLE; + cmd->maxtxpkt = 0; + cmd->maxrxpkt = 0; + return 0; +} + +static void tun_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) +{ + struct tun_struct *tun = netdev_priv(dev); + + strcpy(info->driver, DRV_NAME); + strcpy(info->version, DRV_VERSION); + strcpy(info->fw_version, "N/A"); + + switch (tun->flags & TUN_TYPE_MASK) { + case TUN_TUN_DEV: + strcpy(info->bus_info, "tun"); + break; + case TUN_TAP_DEV: + strcpy(info->bus_info, "tap"); + break; + } +} + +static u32 tun_get_msglevel(struct net_device *dev) +{ +#ifdef TUN_DEBUG + struct tun_struct *tun = netdev_priv(dev); + return tun->debug; +#else + return -EOPNOTSUPP; +#endif +} + +static void tun_set_msglevel(struct net_device *dev, u32 value) +{ +#ifdef TUN_DEBUG + struct tun_struct *tun = netdev_priv(dev); + tun->debug = value; +#endif +} + +static u32 tun_get_link(struct net_device *dev) +{ + struct tun_struct *tun = netdev_priv(dev); + return tun->attached; +} + +static u32 tun_get_rx_csum(struct net_device *dev) +{ + struct tun_struct *tun = netdev_priv(dev); + return (tun->flags & TUN_NOCHECKSUM) == 0; +} + +static int tun_set_rx_csum(struct net_device *dev, u32 data) +{ + struct tun_struct *tun = netdev_priv(dev); + if (data) + tun->flags &= ~TUN_NOCHECKSUM; + else + tun->flags |= TUN_NOCHECKSUM; + return 0; +} + +static struct ethtool_ops tun_ethtool_ops = { + .get_settings = tun_get_settings, + .get_drvinfo = tun_get_drvinfo, + .get_msglevel = tun_get_msglevel, + .set_msglevel = tun_set_msglevel, + .get_link = tun_get_link, + .get_rx_csum = tun_get_rx_csum, + .set_rx_csum = tun_set_rx_csum +}; + int __init tun_init(void) { int ret = 0; - printk(KERN_INFO "Universal TUN/TAP device driver %s " - "(C)1999-2002 Maxim Krasnyansky\n", TUN_VER); + printk(KERN_INFO "tun: %s, %s\n", DRV_DESCRIPTION, DRV_VERSION); + printk(KERN_INFO "tun: %s\n", DRV_COPYRIGHT); ret = misc_register(&tun_miscdev); if (ret) @@ -766,5 +871,7 @@ module_init(tun_init); module_exit(tun_cleanup); +MODULE_DESCRIPTION(DRV_DESCRIPTION); +MODULE_AUTHOR(DRV_COPYRIGHT); MODULE_LICENSE("GPL"); MODULE_ALIAS_MISCDEV(TUN_MINOR); diff -Nru a/include/linux/if_tun.h b/include/linux/if_tun.h --- a/include/linux/if_tun.h 2005-01-18 03:13:47 -05:00 +++ b/include/linux/if_tun.h 2005-01-18 03:13:47 -05:00 @@ -58,7 +58,7 @@ #endif /* __KERNEL__ */ /* Read queue size */ -#define TUN_READQ_SIZE 10 +#define TUN_READQ_SIZE 500 /* TUN device flags */ #define TUN_TUN_DEV 0x0001 --------------060509060202040405080405-- From 64vn@cardvn.net Tue Jan 18 00:17:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 00:18:00 -0800 (PST) Received: from isp-go.FPT.NET (isp-go.fpt.net [210.245.0.153]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0I8Hih0029211 for ; Tue, 18 Jan 2005 00:17:45 -0800 Received: from isp-mta2.fpt.vn ([210.245.0.151]) by isp-go.FPT.NET with Microsoft SMTPSVC(5.0.2195.6713); Tue, 18 Jan 2005 15:17:37 +0700 Received: from [222.252.32.3] by isp-mta2.fpt.vn [210.245.0.151] Message-ID: <41ECC61E.7060908@cardvn.net> Date: Tue, 18 Jan 2005 15:17:34 +0700 From: Nguyen Dinh Nam <64vn@cardvn.net> User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: iproute2 fwmark feature request Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 18 Jan 2005 08:17:37.0679 (UTC) FILETIME=[2BB881F0:01C4FD36] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 423 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: 64vn@cardvn.net Precedence: bulk X-list: netdev Hello netdev, There are 2^32 values for fwmark, it's a hugh number. netfilter deal with it better than iproute2, particularly, there is an optional mask to apply to the fwmark before comparing it with some value (mark module of iptables). It's very helpful because we can use that 32 bits to store several sub values at the same time. So it'll be cool if the syntax is SELECTOR := [ from PREFIX ] [ to PREFIX ] [ tos TOS ] [ fwmark FWMARK[/MASK] ] Regards, Nam From buytenh@wantstofly.org Tue Jan 18 02:14:00 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 02:14:04 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IADxFH003531 for ; Tue, 18 Jan 2005 02:14:00 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id 2631B2B0EC; Tue, 18 Jan 2005 11:13:58 +0100 (MET) Date: Tue, 18 Jan 2005 11:13:58 +0100 From: Lennert Buytenhek To: netdev@oss.sgi.com Subject: sis900: eth0: NULL pointer encountered in Rx ring, skipping Message-ID: <20050118101358.GA9335@xi.wantstofly.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 424 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev Hi, I can make one of my machines, which has an on-board sis900 NIC, lose network connectivity within seconds by doing something like "nc -l -p 6666 > /dev/null" and then blasting some data towards it. When this happens, syslog fills up with these messages: eth0: NULL pointer encountered in Rx ring, skipping It seems like the driver+NIC combo doesn't handle any kind of load very well in general -- whenever it receives more than just a few tens of packets per second, the machine's ping time turns rather awful: (Two machines on 100Mb/s with an el-cheapo 8-port 100Mb/s switch between them. Other machines on the same switch don't show any of the same problems.) 64 bytes from 10.0.0.4: icmp_seq=212 ttl=64 time=128 ms 64 bytes from 10.0.0.4: icmp_seq=213 ttl=64 time=124 ms 64 bytes from 10.0.0.4: icmp_seq=214 ttl=64 time=119 ms 64 bytes from 10.0.0.4: icmp_seq=215 ttl=64 time=124 ms When it locks up, 'ifconfig eth0 down up' suffices to make it come back to life. I haven't checked whether it's just RX that stops working or whether it's both RX and TX. Any ideas? This is on the Fedora Core 3 update kernel, 2.6.10-based. cheers, Lennert From buytenh@wantstofly.org Tue Jan 18 02:21:40 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 02:21:44 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IALeXQ004122 for ; Tue, 18 Jan 2005 02:21:40 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id 775552B0EC; Tue, 18 Jan 2005 11:21:39 +0100 (MET) Date: Tue, 18 Jan 2005 11:21:39 +0100 From: Lennert Buytenhek To: netdev@oss.sgi.com Subject: Re: sis900: eth0: NULL pointer encountered in Rx ring, skipping Message-ID: <20050118102139.GA9507@xi.wantstofly.org> References: <20050118101358.GA9335@xi.wantstofly.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050118101358.GA9335@xi.wantstofly.org> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 425 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev On Tue, Jan 18, 2005 at 11:13:58AM +0100, Lennert Buytenhek wrote: > I can make one of my machines, which has an on-board sis900 NIC, lose > network connectivity within seconds by doing something like > "nc -l -p 6666 > /dev/null" and then blasting some data towards it. When > this happens, syslog fills up with these messages: > > eth0: NULL pointer encountered in Rx ring, skipping Just before it starts spewing these it says: eth0: Memory squeeze,deferring packet. So apparently it just doesn't deal with OOM very well. --L From bunk@stusta.de Tue Jan 18 02:29:41 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 02:29:54 -0800 (PST) Received: from mailout.stusta.mhn.de (emailhub.stusta.mhn.de [141.84.69.5]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0IATd6V004657 for ; Tue, 18 Jan 2005 02:29:40 -0800 Received: (qmail 18855 invoked from network); 18 Jan 2005 10:29:33 -0000 Received: from r063144.stusta.swh.mhn.de (10.150.63.144) by mailhub.stusta.mhn.de with SMTP; 18 Jan 2005 10:29:33 -0000 Received: by r063144.stusta.swh.mhn.de (Postfix, from userid 1000) id B3F96BBF8B; Tue, 18 Jan 2005 11:29:32 +0100 (CET) Date: Tue, 18 Jan 2005 11:29:32 +0100 From: Adrian Bunk To: netdev@oss.sgi.com Cc: linux-kernel@vger.kernel.org Subject: [2.6 patch] unexport xfrm_policy_delete Message-ID: <20050118102932.GD4274@stusta.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 426 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bunk@stusta.de Precedence: bulk X-list: netdev I haven't found any way how xfrm_policy_delete could be called from modular code in 2.6.11-rc1-mm1. Unless I'm wrong or a patch for a modular usage is pending, I'm therefore suggesting this patch for removing the EXPORT_SYMBOL. Signed-off-by: Adrian Bunk --- linux-2.6.11-rc1-mm1-full/net/xfrm/xfrm_policy.c.old 2005-01-18 11:11:34.000000000 +0100 +++ linux-2.6.11-rc1-mm1-full/net/xfrm/xfrm_policy.c 2005-01-18 11:11:39.000000000 +0100 @@ -549,8 +549,6 @@ } } -EXPORT_SYMBOL(xfrm_policy_delete); - int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol) { struct xfrm_policy *old_pol; From tgraf@suug.ch Tue Jan 18 04:17:40 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 04:17:48 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ICHdaf010213 for ; Tue, 18 Jan 2005 04:17:40 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id B266884; Tue, 18 Jan 2005 13:17:14 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id DDB131C0EA; Tue, 18 Jan 2005 13:17:57 +0100 (CET) Date: Tue, 18 Jan 2005 13:17:57 +0100 From: Thomas Graf To: Nguyen Dinh Nam <64vn@cardvn.net> Cc: netdev@oss.sgi.com Subject: Re: iproute2 fwmark feature request Message-ID: <20050118121757.GN26856@postel.suug.ch> References: <41ECC61E.7060908@cardvn.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41ECC61E.7060908@cardvn.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 427 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * Nguyen Dinh Nam <41ECC61E.7060908@cardvn.net> 2005-01-18 15:17 > There are 2^32 values for fwmark, it's a hugh number. > netfilter deal with it better than iproute2, particularly, there is an > optional mask to apply to the fwmark before comparing it with some value > (mark module of iptables). It's very helpful because we can use that 32 > bits to store several sub values at the same time. > So it'll be cool if the syntax is > SELECTOR := [ from PREFIX ] [ to PREFIX ] [ tos TOS ] [ fwmark > FWMARK[/MASK] ] http://oss.sgi.com/archives/netdev/2005-01/msg00548.html Wait 2-3 weeks and it will be all finished. From shollenbeck@verisign.com Tue Jan 18 04:54:51 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 04:54:57 -0800 (PST) Received: from falcon.verisign.com (falcon.verisign.com [216.168.239.71]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ICsoYT014779 for ; Tue, 18 Jan 2005 04:54:50 -0800 Received: from VSVAPOSTALGW1.vcorp.ad.vrsn.com (vsvapostalgw1.vcorp.ad.vrsn.com [10.170.12.38]) by falcon.verisign.com (8.12.10/8.12.10) with ESMTP id j0ICnPop025593; Tue, 18 Jan 2005 07:49:26 -0500 (EST) Received: by vsvapostalgw1.vcorp.ad.vrsn.com with Internet Mail Service (5.5.2657.72) id ; Tue, 18 Jan 2005 07:54:06 -0500 Message-ID: <046F43A8D79C794FA4733814869CDF07057840@dul1wnexmb01.vcorp.ad.vrsn.com> From: "Hollenbeck, Scott" To: "'Lennert Buytenhek'" , "'jamal'" Cc: "'netdev@oss.sgi.com'" , "'Pekka Savola'" , "'shemminger@osdl.org'" , "'Russ Housley'" Subject: RE: tunneling in linux (was: Re: [PATCH][RFC] etherip: Ethernet-i n-IPv4 tunneling) Date: Tue, 18 Jan 2005 07:54:01 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 428 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shollenbeck@verisign.com Precedence: bulk X-list: netdev > > BTW, in one of your emails i > > noticed you cced the authors of that RFC - did they > respond? Whats their > > deployment experiences? > > The @rsa.. address bounces, the other address is still in the CC list > and I didn't hear from him yet :-) The correct current address for Russ is housley@vigilsec.com. I've cc'd him here. So what do you want to hear? As the RFC says, etherIP documents work that Russ and I did at Xerox during the early 1990s. It was developed and deployed for use in conjunction with the Xerox Encryption Unit (XEU), a layer 2 (Ethernet/802.3) network encryption device. As the XEU was never a big seller etherIP never really got "out there", either, but it certainly worked in the environment for which it was intended. -Scott- From yoshfuji@linux-ipv6.org Tue Jan 18 05:36:41 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 05:36:46 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IDaeTB016242 for ; Tue, 18 Jan 2005 05:36:41 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id 77E6C33CC2; Tue, 18 Jan 2005 22:37:18 +0900 (JST) Date: Tue, 18 Jan 2005 22:37:18 +0900 (JST) Message-Id: <20050118.223718.112287192.yoshfuji@linux-ipv6.org> To: davem@davemloft.net Cc: netdev@oss.sgi.com Subject: [PATCH] [IPV6]: Ensure to learn link-layer address from RA. From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 429 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Hello. Here's a patch to ensure to learn link-layer address from RA. Signed-off-by: Hideaki YOSHIFUJI ===== net/ipv6/ndisc.c 1.107 vs edited ===== --- 1.107/net/ipv6/ndisc.c 2004-12-28 15:19:28 +09:00 +++ edited/net/ipv6/ndisc.c 2005-01-18 22:24:04 +09:00 @@ -985,7 +985,7 @@ static void ndisc_router_discovery(struct sk_buff *skb) { struct ra_msg *ra_msg = (struct ra_msg *) skb->h.raw; - struct neighbour *neigh; + struct neighbour *neigh = NULL; struct inet6_dev *in6_dev; struct rt6_info *rt; int lifetime; @@ -1053,7 +1053,11 @@ rt = rt6_get_dflt_router(&skb->nh.ipv6h->saddr, skb->dev); + if (rt) + neigh = rt->rt6i_nexthop; + if (rt && lifetime == 0) { + neigh_clone(neigh); ip6_del_rt(rt, NULL, NULL); rt = NULL; } @@ -1126,7 +1130,10 @@ * Process options. */ - if (rt && (neigh = rt->rt6i_nexthop) != NULL) { + if (!neigh) + neigh = __neigh_lookup(&nd_tbl, &skb->nh.ipv6h->saddr, + skb->dev, 1); + if (neigh) { u8 *lladdr = NULL; int lladdrlen; if (ndopts.nd_opts_src_lladdr) { @@ -1181,6 +1188,8 @@ out: if (rt) dst_release(&rt->u.dst); + else if (neigh) + neigh_release(neigh); in6_dev_put(in6_dev); } -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From tgraf@suug.ch Tue Jan 18 05:43:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 05:43:53 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IDhkQS016848 for ; Tue, 18 Jan 2005 05:43:47 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id C50B084; Tue, 18 Jan 2005 14:43:23 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id E293F1C0EA; Tue, 18 Jan 2005 14:44:06 +0100 (CET) Date: Tue, 18 Jan 2005 14:44:06 +0100 From: Thomas Graf To: jamal Cc: Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com Subject: Re: [RFC] batched tc to improve change throughput Message-ID: <20050118134406.GR26856@postel.suug.ch> References: <20050117152312.GC26856@postel.suug.ch> <1105976711.1078.1.camel@jzny.localdomain> <20050117160539.GD26856@postel.suug.ch> <1105979807.1078.16.camel@jzny.localdomain> <20050117165626.GE26856@postel.suug.ch> <1106002197.1046.19.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1106002197.1046.19.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 430 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1106002197.1046.19.camel@jzny.localdomain> 2005-01-17 17:49 > On Mon, 2005-01-17 at 11:56, Thomas Graf wrote: > > /** > > * filter dla_fp > > * match DLA traffic at lower watermark > > */ > > tc filter add > > dev %DEV > > parent 1:12 > > prio 40 > > protocol all > > basic match meta(nfmark eq %LOW_WATERMARK) > > and ( > > nbyte("\x0\x1\x2\x3\x4" at 4 layer 2) /* 00 01 02 03 04 (dla fp) */ > > or u32(ip src 10.0.0.0/8) > > ) > > flowid 1:20 > > > > > > It does look clean. - btw look at Werners approach on tcng as well. I'm aware of it but naturally it always lags behind a bit and keeping it up to date requires quite some work and I already have problems finding the time for my own changes ;-> > Another thing that would be really neat is to have a iso like cli > (something like what zebra has) so you can go down the parse tree to > say the ematch level and just start typing away these commands. > Should probably be easy to rip off the vtysh stuff off zebra or > use libio or something along those lines to do this. I wouldn't call it easy but it's doable. I'm not sure if entering/leaving subsystem features makes any sense. I find a context help by pressing '?' and normal completion most useful. It's not that I dislike your idea but I think it's not worth it. Actualy, I've been working on such a thing (called netsh) being a frontend to iproute2 + tc + ... with 3 modes: - batched mode (-f) - interactive shell supporting context help + completion - call over arguments It includes a quite easy to use API to define the grammar which can be used by readline to do the completion and print context aware help. It could be easly ported to iproute2 but every module needs to be changed, luckly this can happen step by step. I will port it to iproute2 and transform one of the easier modules like neighbour to it and we can see if we like it. From hadi@cyberus.ca Tue Jan 18 06:30:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 06:30:07 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IEU317021880 for ; Tue, 18 Jan 2005 06:30:03 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CquMq-0001Wo-Td for netdev@oss.sgi.com; Tue, 18 Jan 2005 09:30:00 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CquMl-0006HI-Pj; Tue, 18 Jan 2005 09:29:56 -0500 Subject: Re: [RFC] batched tc to improve change throughput From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com, Werner Almesberger In-Reply-To: <20050118134406.GR26856@postel.suug.ch> References: <20050117152312.GC26856@postel.suug.ch> <1105976711.1078.1.camel@jzny.localdomain> <20050117160539.GD26856@postel.suug.ch> <1105979807.1078.16.camel@jzny.localdomain> <20050117165626.GE26856@postel.suug.ch> <1106002197.1046.19.camel@jzny.localdomain> <20050118134406.GR26856@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1106058592.1035.95.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 18 Jan 2005 09:29:52 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 431 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Tue, 2005-01-18 at 08:44, Thomas Graf wrote: > * jamal <1106002197.1046.19.camel@jzny.localdomain> 2005-01-17 17:49 > > On Mon, 2005-01-17 at 11:56, Thomas Graf wrote: > > > /** > > > * filter dla_fp > > > * match DLA traffic at lower watermark > > > */ > > > tc filter add > > > dev %DEV > > > parent 1:12 > > > prio 40 > > > protocol all > > > basic match meta(nfmark eq %LOW_WATERMARK) > > > and ( > > > nbyte("\x0\x1\x2\x3\x4" at 4 layer 2) /* 00 01 02 03 04 (dla fp) */ > > > or u32(ip src 10.0.0.0/8) > > > ) > > > flowid 1:20 > > > > > > > > > > It does look clean. - btw look at Werners approach on tcng as well. > > I'm aware of it but naturally it always lags behind a bit and keeping > it up to date requires quite some work and I already have problems > finding the time for my own changes ;-> > I think it is worth getting mr. Almesbergers view. CCed him. > > Another thing that would be really neat is to have a iso like cli > > (something like what zebra has) so you can go down the parse tree to > > say the ematch level and just start typing away these commands. > > Should probably be easy to rip off the vtysh stuff off zebra or > > use libio or something along those lines to do this. > > I wouldn't call it easy but it's doable. I dont think its hard at all. It would take me, cycles pending, not more than a day to whip something off libio. > I'm not sure if > entering/leaving subsystem features makes any sense. I find a context > help by pressing '?' and normal completion most useful. It's not > that I dislike your idea but I think it's not worth it. What doesnt make sense or is not worth it? Two problems that are to be solved - whatever the solution is, it needs to address them: a) usability. i) I dont need to remember how the parse tree looks like or where i am on the parse tree. I go: tc tc> ? i get some help on the next levels. ii) I should be able to ssh to this thing from some remote location. This way i can write some scripts to automate things b) extrenous typing on command line. I go to the filter level u32> ? gives me help u32> context filter dev lo parent ffff: protocol ip prio 10 u32> add u32> match ip src 10.0.0.21/32 flowid 1:16 action drop u32> match ip src 0/0 flowid 1:16 action ok u32> commit filters submitted .. u32> .. //takes you up one u32> ls listing here of filter dev lo parent ffff: protocol ip prio 10 .. .. u32> /qdisc/dev/eth0 now into the qdisc level context for eth0 > Actualy, > I've been working on such a thing (called netsh) being a frontend > to iproute2 + tc + ... with 3 modes: > - batched mode (-f) this is useful. > - interactive shell supporting context help + completion MUST > - call over arguments Dont understand this. > It includes a quite easy to use API to define the grammar which > can be used by readline to do the completion and print context > aware help. what does readline provide you again? > It could be easly ported to iproute2 but every > module needs to be changed, luckly this can happen step by > step. I will port it to iproute2 and transform one of the > easier modules like neighbour to it and we can see if we like > it. I think iproute2 should stay as is - dont wanna break someones scripts or make it fatter than it is already. Any app to provide the above should be standalone. cheers, jamal From buytenh@wantstofly.org Tue Jan 18 06:37:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 06:37:12 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IEb0Xp022487 for ; Tue, 18 Jan 2005 06:37:00 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id 0BBB92B0EC; Tue, 18 Jan 2005 15:36:59 +0100 (MET) Date: Tue, 18 Jan 2005 15:36:58 +0100 From: Lennert Buytenhek To: jamal Cc: Thomas Graf , Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com, Werner Almesberger Subject: Re: [RFC] batched tc to improve change throughput Message-ID: <20050118143658.GA11474@xi.wantstofly.org> References: <20050117152312.GC26856@postel.suug.ch> <1105976711.1078.1.camel@jzny.localdomain> <20050117160539.GD26856@postel.suug.ch> <1105979807.1078.16.camel@jzny.localdomain> <20050117165626.GE26856@postel.suug.ch> <1106002197.1046.19.camel@jzny.localdomain> <20050118134406.GR26856@postel.suug.ch> <1106058592.1035.95.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1106058592.1035.95.camel@jzny.localdomain> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 432 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev On Tue, Jan 18, 2005 at 09:29:52AM -0500, jamal wrote: > > > Another thing that would be really neat is to have a iso like cli > > > (something like what zebra has) so you can go down the parse tree to > > > say the ematch level and just start typing away these commands. > > > Should probably be easy to rip off the vtysh stuff off zebra or > > > use libio or something along those lines to do this. > > > > I wouldn't call it easy but it's doable. > > I dont think its hard at all. It would take me, cycles pending, not more > than a day to whip something off libio. If you do this, please consider using Juniper config syntax instead of doing it the Cisco/quagga way. cheers, Lennert From hadi@cyberus.ca Tue Jan 18 06:44:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 06:44:06 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IEhxOo023418 for ; Tue, 18 Jan 2005 06:43:59 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CquaL-0006pi-3X for netdev@oss.sgi.com; Tue, 18 Jan 2005 09:43:57 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CquaJ-0000kL-8h; Tue, 18 Jan 2005 09:43:55 -0500 Subject: Re: [RFC] batched tc to improve change throughput From: jamal Reply-To: hadi@cyberus.ca To: Lennert Buytenhek Cc: Thomas Graf , Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com, Werner Almesberger In-Reply-To: <20050118143658.GA11474@xi.wantstofly.org> References: <20050117152312.GC26856@postel.suug.ch> <1105976711.1078.1.camel@jzny.localdomain> <20050117160539.GD26856@postel.suug.ch> <1105979807.1078.16.camel@jzny.localdomain> <20050117165626.GE26856@postel.suug.ch> <1106002197.1046.19.camel@jzny.localdomain> <20050118134406.GR26856@postel.suug.ch> <1106058592.1035.95.camel@jzny.localdomain> <20050118143658.GA11474@xi.wantstofly.org> Content-Type: text/plain Organization: jamalopolous Message-Id: <1106059431.1035.101.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 18 Jan 2005 09:43:51 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 433 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Tue, 2005-01-18 at 09:36, Lennert Buytenhek wrote: > On Tue, Jan 18, 2005 at 09:29:52AM -0500, jamal wrote: > If you do this, please consider using Juniper config syntax instead > of doing it the Cisco/quagga way. > Juniper is XML driven config files? [I am hoping Thomas would do it, btw;-> only if we strongly disagree then i will be tempted to provide an alternative]. btw, libio uses libevent; i recall you said you had some alternative to it. cheers, jamal From tgraf@suug.ch Tue Jan 18 06:58:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 06:58:15 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IEwAZj027888 for ; Tue, 18 Jan 2005 06:58:10 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 0686184; Tue, 18 Jan 2005 15:57:46 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 2242B1C0EA; Tue, 18 Jan 2005 15:58:30 +0100 (CET) Date: Tue, 18 Jan 2005 15:58:30 +0100 From: Thomas Graf To: jamal Cc: Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com, Werner Almesberger Subject: Re: [RFC] batched tc to improve change throughput Message-ID: <20050118145830.GS26856@postel.suug.ch> References: <20050117152312.GC26856@postel.suug.ch> <1105976711.1078.1.camel@jzny.localdomain> <20050117160539.GD26856@postel.suug.ch> <1105979807.1078.16.camel@jzny.localdomain> <20050117165626.GE26856@postel.suug.ch> <1106002197.1046.19.camel@jzny.localdomain> <20050118134406.GR26856@postel.suug.ch> <1106058592.1035.95.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1106058592.1035.95.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 434 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1106058592.1035.95.camel@jzny.localdomain> 2005-01-18 09:29 > On Tue, 2005-01-18 at 08:44, Thomas Graf wrote: > > I'm not sure if > > entering/leaving subsystem features makes any sense. I find a context > > help by pressing '?' and normal completion most useful. It's not > > that I dislike your idea but I think it's not worth it. > > What doesnt make sense or is not worth it? My very personal opinion is that it's not worth it. > a) usability. > i) I dont need to remember how the parse tree looks like or where i am > on the parse tree. > I go: > tc > tc> ? > i get some help on the next levels. > ii) I should be able to ssh to this thing from some remote location. > This way i can write some scripts to automate things > > b) extrenous typing on command line. > I go to the filter level > > u32> ? > gives me help > u32> context > filter dev lo parent ffff: protocol ip prio 10 > u32> add > u32> match ip src 10.0.0.21/32 flowid 1:16 action drop > u32> match ip src 0/0 flowid 1:16 action ok > u32> commit > filters submitted .. What do you if there is an error? To what kind of context do you go? Let's say the kernel reports -EINVAL. > u32> .. //takes you up one > u32> ls > listing here of filter dev lo parent ffff: protocol ip prio 10 > .. > .. > u32> /qdisc/dev/eth0 > now into the qdisc level context for eth0 That's what I have: tgr:axs ~/dev/netconfig/src ./netconfig ... axs# ? Next level commands: link ... Link (interface) configuration neighbour ... Neighbour (ARP) configuration warranty Show warranty exit Quit application axs# n? Backtrace: ->neighbour - Neighbour (ARP) configuration Description: Module to view and modify the neighbour tables. The neighbour table establishes bindings between protocol addresses and link layer addresses for hosts sharing the same physical link. This module allows you to view the content of these tables and to manipulate their content. Next level commands: add ... Add a neighbour modify ... Modify a neighbour delete ... Delete a neighbour list ... List neighbour attributes axs# neighbour l? Backtrace: ->neighbour - Neighbour (ARP) configuration ->list - List neighbour attributes Next level commands: Command can be executed at this point. stats ... Verbose listing (all attributes/statistics) where ... Only dump neighbours matching a filter axs# neighbour list w? Backtrace: ->neighbour - Neighbour (ARP) configuration ->list - List neighbour attributes ->where - Only dump neighbours matching a filter Attributes of this node: lladdr Link layer address dst Destination address dev Link the neighbour is on Next level commands: Command can be executed at this point. flags ... axs# ... Again, It's not that I dislike contexts but in the end it all gets down to make error correction as easy as possible. Everytime you request a completion or context help the command will get parsed and a very verbose message including the possibilities you have will be printed and you can correct your error. It's more typing work I know, but usually one only types the first 1..3 chars of the commands. I think something like this should be the base and contextes can be build upon it. > > - call over arguments > > Dont understand this. The way it is now, configuration over program arguments. > > It includes a quite easy to use API to define the grammar which > > can be used by readline to do the completion and print context > > aware help. > > what does readline provide you again? It basically takes over the reading of a line and allows manipulation of the input buffer. It implements all the useful line editing like in bash and helps with completion. You can bind the '?' key to a help function so that '?' will not be printed on the screen but instead the help text is printed and you get back your original line untouched. It also gives the user a chance to bind keys to certain actions so everyone can keep the bindings they like with the additional possibilities to export functions so one could for example bind C-N to "list-neighbours". > I think iproute2 should stay as is - dont wanna break someones scripts > or make it fatter than it is already. Any app to provide the above > should be standalone. Well, you mean like generating iproute2 input? This means we'd have to reimplement the logic twice and handling errors from iproute2 gets really hard. It's not a problem to keep the old way of iproute2 as-is. From tgraf@suug.ch Tue Jan 18 07:07:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 07:07:08 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IF73wv028635 for ; Tue, 18 Jan 2005 07:07:03 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 6D66785; Tue, 18 Jan 2005 16:06:40 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id CE51A1C0EA; Tue, 18 Jan 2005 16:07:23 +0100 (CET) Date: Tue, 18 Jan 2005 16:07:23 +0100 From: Thomas Graf To: jamal Cc: Lennert Buytenhek , Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com, Werner Almesberger Subject: Re: [RFC] batched tc to improve change throughput Message-ID: <20050118150723.GT26856@postel.suug.ch> References: <20050117152312.GC26856@postel.suug.ch> <1105976711.1078.1.camel@jzny.localdomain> <20050117160539.GD26856@postel.suug.ch> <1105979807.1078.16.camel@jzny.localdomain> <20050117165626.GE26856@postel.suug.ch> <1106002197.1046.19.camel@jzny.localdomain> <20050118134406.GR26856@postel.suug.ch> <1106058592.1035.95.camel@jzny.localdomain> <20050118143658.GA11474@xi.wantstofly.org> <1106059431.1035.101.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1106059431.1035.101.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 435 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1106059431.1035.101.camel@jzny.localdomain> 2005-01-18 09:43 > On Tue, 2005-01-18 at 09:36, Lennert Buytenhek wrote: > > On Tue, Jan 18, 2005 at 09:29:52AM -0500, jamal wrote: > > > If you do this, please consider using Juniper config syntax instead > > of doing it the Cisco/quagga way. > > > > Juniper is XML driven config files? > [I am hoping Thomas would do it, btw;-> only if we strongly disagree > then i will be tempted to provide an alternative]. I'm sure we can find somethign everyone ges along with just fine. Iff we do the XML thing we might want to try to stick to the ietf netconf thoughts. > btw, libio uses libevent; i recall you said you had some alternative to > it. libio couldbe put underneath libreadline but it doesn't make much sense, I think remote shells do the job just fine. I'd favour a XML protocol like netconf if we want to follow the remote configuration path. Endianess issues will hit us quite hard though. From werner@almesberger.net Tue Jan 18 07:08:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 07:08:14 -0800 (PST) Received: from host.almesberger.net (almesberger.net [63.105.73.238]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IF86mR028802 for ; Tue, 18 Jan 2005 07:08:07 -0800 Received: from almesberger.net (vpnwa-home [10.200.0.2]) by host.almesberger.net (8.12.8/8.9.3) with ESMTP id j0IF7cTO023345; Tue, 18 Jan 2005 07:07:39 -0800 Received: (from werner@localhost) by almesberger.net (8.11.6/8.11.6) id j0IF7b220996; Tue, 18 Jan 2005 12:07:37 -0300 Date: Tue, 18 Jan 2005 12:07:37 -0300 From: Werner Almesberger To: jamal Cc: Thomas Graf , Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com Subject: Re: [RFC] batched tc to improve change throughput Message-ID: <20050118120737.I15303@almesberger.net> References: <20050117152312.GC26856@postel.suug.ch> <1105976711.1078.1.camel@jzny.localdomain> <20050117160539.GD26856@postel.suug.ch> <1105979807.1078.16.camel@jzny.localdomain> <20050117165626.GE26856@postel.suug.ch> <1106002197.1046.19.camel@jzny.localdomain> <20050118134406.GR26856@postel.suug.ch> <1106058592.1035.95.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1106058592.1035.95.camel@jzny.localdomain>; from hadi@cyberus.ca on Tue, Jan 18, 2005 at 09:29:52AM -0500 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 436 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: werner@almesberger.net Precedence: bulk X-list: netdev jamal wrote: > On Tue, 2005-01-18 at 08:44, Thomas Graf wrote: > > I'm aware of [tcng] but naturally it always lags behind a bit and keeping > > it up to date requires quite some work and I already have problems > > finding the time for my own changes ;-> Sigh, yes, I don't have all that much time for it myself, and my focus of interest has shifted, too. Unfortunately, everybody I've tried to talk in to taking over its maintenance so far was wise enough to politely pass up the offer :-( There's also the issue of classifier construction: while I think that the language for this is near-perfect, the internal processing is scary at best, and doesn't produce very nice results. I dream of a new classifier works on a state machine constructed from single-bit classification decisions, but the graph theory required for ordering them properly is a bit above me. (Construction of an unordered and redundant FSM is almost trivial - tcng can already do this.) > > - interactive shell supporting context help + completion > > MUST I'm not so sure about interactive use of "tc". In general, a single configuration line has no meaning. You almost always need a lot more context to understand what it does. Think of the interactive BASIC systems on ancient PCs. There, you would enter/edit/remove lines by their number. Now, would you want to use something like this for C ? Me, I prefer a free-format text editor :-) An interactive help system that could be called from an editor, e.g. when editing tcng configurations, would certainly be a nice touch. But that's an orthogonal issue. A set of man, info, etc. pages would serve nicely, too. - Werner -- _________________________________________________________________________ / Werner Almesberger, Buenos Aires, Argentina werner@almesberger.net / /_http://www.almesberger.net/____________________________________________/ From buytenh@wantstofly.org Tue Jan 18 07:20:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 07:20:26 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IFKIac029809 for ; Tue, 18 Jan 2005 07:20:20 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id 801AF2B0EC; Tue, 18 Jan 2005 16:20:17 +0100 (MET) Date: Tue, 18 Jan 2005 16:20:17 +0100 From: Lennert Buytenhek To: jamal Cc: Thomas Graf , Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com, Werner Almesberger Subject: Re: [RFC] batched tc to improve change throughput Message-ID: <20050118152017.GA11798@xi.wantstofly.org> References: <20050117152312.GC26856@postel.suug.ch> <1105976711.1078.1.camel@jzny.localdomain> <20050117160539.GD26856@postel.suug.ch> <1105979807.1078.16.camel@jzny.localdomain> <20050117165626.GE26856@postel.suug.ch> <1106002197.1046.19.camel@jzny.localdomain> <20050118134406.GR26856@postel.suug.ch> <1106058592.1035.95.camel@jzny.localdomain> <20050118143658.GA11474@xi.wantstofly.org> <1106059431.1035.101.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1106059431.1035.101.camel@jzny.localdomain> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 437 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev On Tue, Jan 18, 2005 at 09:43:51AM -0500, jamal wrote: > > If you do this, please consider using Juniper config syntax instead > > of doing it the Cisco/quagga way. > > Juniper is XML driven config files? Uhm, no :) The main advantage over Cisco (IMHO, the last thing I want is to start a holy war) is hierarchical config syntax, and the ability to commit/rollback all your changes in one go. It's unfortunately rather more verbose, though. Example at the bottom. > btw, libio uses libevent; i recall you said you had some alternative to > it. Yeah, ivykis (http://libivykis.sourceforge.net/) has been happily used in-house at my last job for years but never really caught on anywhere else, which is perhaps because I never did much lobbying for it. The way it works also requires all code written for it to be fully async (can't use blocking code anywhere), which I think is an advantage but everyone else thinks is a disadvantage. cheers, Lennert This is an example of a Juniper policy-statement, which is basically just a prefix filter. This particular filter controls which non-OSPF prefixes are exported to OSPF. buytenh@asd-tc2-m20core1> show configuration policy-options policy-statement ospf-export term accept-default { from { route-filter 0.0.0.0/0 exact; } then { external { type 1; } accept; } } term accept-peering { from { protocol direct; route-filter 0.0.0.0/0 prefix-length-range /30-/30; } then { external { type 1; } accept; } } term accept-ams-ix { from { protocol direct; route-filter 195.69.144.0/23 exact; } then { external { type 1; } accept; } } term reject-rest { then reject; } buytenh@asd-tc2-m20core1> From buytenh@wantstofly.org Tue Jan 18 07:23:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 07:23:32 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IFNQsE030354 for ; Tue, 18 Jan 2005 07:23:28 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id 6535A2B0EE; Tue, 18 Jan 2005 16:23:26 +0100 (MET) Date: Tue, 18 Jan 2005 16:23:26 +0100 From: Lennert Buytenhek To: Thomas Graf Cc: jamal , Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com, Werner Almesberger Subject: Re: [RFC] batched tc to improve change throughput Message-ID: <20050118152326.GB11798@xi.wantstofly.org> References: <20050117152312.GC26856@postel.suug.ch> <1105976711.1078.1.camel@jzny.localdomain> <20050117160539.GD26856@postel.suug.ch> <1105979807.1078.16.camel@jzny.localdomain> <20050117165626.GE26856@postel.suug.ch> <1106002197.1046.19.camel@jzny.localdomain> <20050118134406.GR26856@postel.suug.ch> <1106058592.1035.95.camel@jzny.localdomain> <20050118145830.GS26856@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050118145830.GS26856@postel.suug.ch> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 438 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev On Tue, Jan 18, 2005 at 03:58:30PM +0100, Thomas Graf wrote: > > u32> ? > > gives me help > > u32> context > > filter dev lo parent ffff: protocol ip prio 10 > > u32> add > > u32> match ip src 10.0.0.21/32 flowid 1:16 action drop > > u32> match ip src 0/0 flowid 1:16 action ok > > u32> commit > > filters submitted .. > > What do you if there is an error? To what kind of context do you > go? Let's say the kernel reports -EINVAL. You just refuse the commit and stay where you are: buytenh@asd-tc2-m20core1> configure exclusive Entering configuration mode [edit] buytenh@asd-tc2-m20core1# edit policy-options policy-statement test [edit policy-options policy-statement test] buytenh@asd-tc2-m20core1# set from prefix-list test [edit policy-options policy-statement test] buytenh@asd-tc2-m20core1# set then accept [edit policy-options policy-statement test] buytenh@asd-tc2-m20core1# show from { prefix-list test; } then accept; [edit policy-options policy-statement test] buytenh@asd-tc2-m20core1# commit [edit] 'policy-options' Policy error: test prefix-list referenced but not defined error: configuration check-out failed [edit policy-options policy-statement test] buytenh@asd-tc2-m20core1# top [edit] buytenh@asd-tc2-m20core1# rollback load complete [edit] buytenh@asd-tc2-m20core1# From galak@freescale.com Tue Jan 18 07:35:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 07:35:35 -0800 (PST) Received: from az33egw01.freescale.net (az33egw01.freescale.net [192.88.158.102]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IFZQG7031090 for ; Tue, 18 Jan 2005 07:35:26 -0800 Received: from az33smr01.freescale.net (az33smr01.freescale.net [10.64.34.199]) by az33egw01.freescale.net (8.12.11/az33egw01) with ESMTP id j0IFfpaI003739; Tue, 18 Jan 2005 08:41:51 -0700 (MST) Received: from postal.somerset.sps.mot.com ([163.12.132.5]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id j0IFePOl014119; Tue, 18 Jan 2005 09:40:26 -0600 (CST) Received: from blarg.somerset.sps.mot.com (blarg.somerset.sps.mot.com [163.12.112.65]) by postal.somerset.sps.mot.com (8.11.0/8.11.0) with ESMTP id j0IFZL825790; Tue, 18 Jan 2005 09:35:21 -0600 (CST) Received: from blarg.somerset.sps.mot.com (localhost.localdomain [127.0.0.1]) by blarg.somerset.sps.mot.com (8.12.11/8.11.0) with ESMTP id j0IFZLFw011359; Tue, 18 Jan 2005 09:35:21 -0600 Received: from localhost (galak@localhost) by blarg.somerset.sps.mot.com (8.12.11/8.12.11/Submit) with ESMTP id j0IFZJiF011356; Tue, 18 Jan 2005 09:35:19 -0600 X-Authentication-Warning: blarg.somerset.sps.mot.com: galak owned process doing -bs Date: Tue, 18 Jan 2005 09:35:19 -0600 (CST) From: Kumar Gala X-X-Sender: galak@blarg.somerset.sps.mot.com To: torvalds@osdl.org, akpm@osdl.org, jgarzik@pobox.com cc: linux-kernel@vger.kernel.org, linuxppc-embedded@ozlabs.org, netdev@oss.sgi.com Subject: [PATCH 4/4] ppc32: platform_device conversion from OCP Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 439 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: galak@freescale.com Precedence: bulk X-list: netdev Convert gianfar ethernet driver from using an OCP to platform_device. Signed-off-by: Kumar Gala --- diff -Nru a/drivers/net/gianfar.c b/drivers/net/gianfar.c --- a/drivers/net/gianfar.c 2005-01-17 22:31:44 -06:00 +++ b/drivers/net/gianfar.c 2005-01-17 22:31:44 -06:00 @@ -26,7 +26,7 @@ * controllers on the Freescale 8540/8560 integrated processors, * as well as the Fast Ethernet Controller on the 8540. * - * The driver is initialized through OCP. Structures which + * The driver is initialized through platform_device. Structures which * define the configuration needed by the board are defined in a * board structure in arch/ppc/platforms (though I do not * discount the possibility that other architectures could one @@ -85,6 +85,7 @@ #include #include #include +#include #include #include @@ -130,8 +131,8 @@ static void adjust_link(struct net_device *dev); static void init_registers(struct net_device *dev); static int init_phy(struct net_device *dev); -static int gfar_probe(struct ocp_device *ocpdev); -static void gfar_remove(struct ocp_device *ocpdev); +static int gfar_probe(struct device *device); +static int gfar_remove(struct device *device); void free_skb_resources(struct gfar_private *priv); static void gfar_set_multi(struct net_device *dev); static void gfar_set_hash_for_addr(struct net_device *dev, u8 *addr); @@ -148,45 +149,27 @@ MODULE_DESCRIPTION("Gianfar Ethernet Driver"); MODULE_LICENSE("GPL"); -/* Called by the ocp code to initialize device data structures - * required for bringing up the device - * returns 0 on success */ -static int gfar_probe(struct ocp_device *ocpdev) +static int gfar_probe(struct device *device) { u32 tempval; - struct ocp_device *mdiodev; struct net_device *dev = NULL; struct gfar_private *priv = NULL; - struct ocp_gfar_data *einfo; + struct platform_device *pdev = to_platform_device(device); + struct gianfar_platform_data *einfo; + struct resource *r; int idx; int err = 0; int dev_ethtool_ops = 0; - einfo = (struct ocp_gfar_data *) ocpdev->def->additions; + einfo = (struct gianfar_platform_data *) pdev->dev.platform_data; if (einfo == NULL) { printk(KERN_ERR "gfar %d: Missing additional data!\n", - ocpdev->def->index); + pdev->id); return -ENODEV; } - - /* get a pointer to the register memory which can - * configure the PHYs. If it's different from this set, - * get the device which has those regs */ - if ((einfo->phyregidx >= 0) && - (einfo->phyregidx != ocpdev->def->index)) { - mdiodev = ocp_find_device(OCP_ANY_ID, - OCP_FUNC_GFAR, einfo->phyregidx); - - /* If the device which holds the MDIO regs isn't - * up, wait for it to come up */ - if (mdiodev == NULL) - return -EAGAIN; - } else { - mdiodev = ocpdev; - } - + /* Create an ethernet device instance */ dev = alloc_etherdev(sizeof (*priv)); @@ -198,9 +181,19 @@ /* Set the info in the priv to the current info */ priv->einfo = einfo; + /* fill out IRQ fields */ + if (einfo->device_flags & FSL_GIANFAR_DEV_HAS_MULTI_INTR) { + priv->interruptTransmit = platform_get_irq_byname(pdev, "tx"); + priv->interruptReceive = platform_get_irq_byname(pdev, "rx"); + priv->interruptError = platform_get_irq_byname(pdev, "error"); + } else { + priv->interruptTransmit = platform_get_irq(pdev, 0); + } + /* get a pointer to the register memory */ + r = platform_get_resource(pdev, IORESOURCE_MEM, 0); priv->regs = (struct gfar *) - ioremap(ocpdev->def->paddr, sizeof (struct gfar)); + ioremap(r->start, sizeof (struct gfar)); if (priv->regs == NULL) { err = -ENOMEM; @@ -209,7 +202,7 @@ /* Set the PHY base address */ priv->phyregs = (struct gfar *) - ioremap(mdiodev->def->paddr, sizeof (struct gfar)); + ioremap(einfo->phy_reg_addr, sizeof (struct gfar)); if (priv->phyregs == NULL) { err = -ENOMEM; @@ -218,7 +211,7 @@ spin_lock_init(&priv->lock); - ocp_set_drvdata(ocpdev, dev); + dev_set_drvdata(device, dev); /* Stop the DMA engine now, in case it was running before */ /* (The firmware could have used it, and left it running). */ @@ -255,7 +248,7 @@ dev->base_addr = (unsigned long) (priv->regs); SET_MODULE_OWNER(dev); - SET_NETDEV_DEV(dev, &ocpdev->dev); + SET_NETDEV_DEV(dev, device); /* Fill in the dev structure */ dev->open = gfar_enet_open; @@ -274,10 +267,10 @@ /* Index into the array of possible ethtool * ops to catch all 4 possibilities */ - if((priv->einfo->flags & GFAR_HAS_RMON) == 0) + if((priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_RMON) == 0) dev_ethtool_ops += 1; - if((priv->einfo->flags & GFAR_HAS_COALESCE) == 0) + if((priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_COALESCE) == 0) dev_ethtool_ops += 2; dev->ethtool_ops = gfar_op_array[dev_ethtool_ops]; @@ -332,18 +325,21 @@ return -ENOMEM; } -static void gfar_remove(struct ocp_device *ocpdev) +static int gfar_remove(struct device *device) { - struct net_device *dev = ocp_get_drvdata(ocpdev); + struct net_device *dev = dev_get_drvdata(device); struct gfar_private *priv = netdev_priv(dev); - ocp_set_drvdata(ocpdev, NULL); + dev_set_drvdata(device, NULL); iounmap((void *) priv->regs); iounmap((void *) priv->phyregs); free_netdev(dev); + + return 0; } + /* Configure the PHY for dev. * returns 0 if success. -1 if failure */ @@ -470,7 +466,7 @@ gfar_write(&priv->regs->rctrl, 0x00000000); /* Zero out the rmon mib registers if it has them */ - if (priv->einfo->flags & GFAR_HAS_RMON) { + if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_RMON) { memset((void *) &(priv->regs->rmon), 0, sizeof (struct rmon_mib)); @@ -536,7 +532,7 @@ tempval &= ~(MACCFG1_RX_EN | MACCFG1_TX_EN); gfar_write(®s->maccfg1, tempval); - if (priv->einfo->flags & GFAR_HAS_PHY_INTR) { + if (priv->einfo->board_flags & FSL_GIANFAR_BRD_HAS_PHY_INTR) { /* Clear any pending interrupts */ mii_clear_phy_interrupt(priv->mii_info); @@ -548,15 +544,15 @@ spin_unlock_irqrestore(&priv->lock, flags); /* Free the IRQs */ - if (priv->einfo->flags & GFAR_HAS_MULTI_INTR) { - free_irq(priv->einfo->interruptError, dev); - free_irq(priv->einfo->interruptTransmit, dev); - free_irq(priv->einfo->interruptReceive, dev); + if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_MULTI_INTR) { + free_irq(priv->interruptError, dev); + free_irq(priv->interruptTransmit, dev); + free_irq(priv->interruptReceive, dev); } else { - free_irq(priv->einfo->interruptTransmit, dev); + free_irq(priv->interruptTransmit, dev); } - if (priv->einfo->flags & GFAR_HAS_PHY_INTR) { + if (priv->einfo->board_flags & FSL_GIANFAR_BRD_HAS_PHY_INTR) { free_irq(priv->einfo->interruptPHY, dev); } else { del_timer_sync(&priv->phy_info_timer); @@ -727,41 +723,41 @@ /* If the device has multiple interrupts, register for * them. Otherwise, only register for the one */ - if (priv->einfo->flags & GFAR_HAS_MULTI_INTR) { + if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_MULTI_INTR) { /* Install our interrupt handlers for Error, * Transmit, and Receive */ - if (request_irq(priv->einfo->interruptError, gfar_error, + if (request_irq(priv->interruptError, gfar_error, 0, "enet_error", dev) < 0) { printk(KERN_ERR "%s: Can't get IRQ %d\n", - dev->name, priv->einfo->interruptError); + dev->name, priv->interruptError); err = -1; goto err_irq_fail; } - if (request_irq(priv->einfo->interruptTransmit, gfar_transmit, + if (request_irq(priv->interruptTransmit, gfar_transmit, 0, "enet_tx", dev) < 0) { printk(KERN_ERR "%s: Can't get IRQ %d\n", - dev->name, priv->einfo->interruptTransmit); + dev->name, priv->interruptTransmit); err = -1; goto tx_irq_fail; } - if (request_irq(priv->einfo->interruptReceive, gfar_receive, + if (request_irq(priv->interruptReceive, gfar_receive, 0, "enet_rx", dev) < 0) { printk(KERN_ERR "%s: Can't get IRQ %d (receive0)\n", - dev->name, priv->einfo->interruptReceive); + dev->name, priv->interruptReceive); err = -1; goto rx_irq_fail; } } else { - if (request_irq(priv->einfo->interruptTransmit, gfar_interrupt, + if (request_irq(priv->interruptTransmit, gfar_interrupt, 0, "gfar_interrupt", dev) < 0) { printk(KERN_ERR "%s: Can't get IRQ %d\n", - dev->name, priv->einfo->interruptError); + dev->name, priv->interruptError); err = -1; goto err_irq_fail; @@ -815,9 +811,9 @@ return 0; rx_irq_fail: - free_irq(priv->einfo->interruptTransmit, dev); + free_irq(priv->interruptTransmit, dev); tx_irq_fail: - free_irq(priv->einfo->interruptError, dev); + free_irq(priv->interruptError, dev); err_irq_fail: rx_skb_fail: free_skb_resources(priv); @@ -1490,7 +1486,7 @@ adjust_link(dev); /* Reenable interrupts, if needed */ - if (priv->einfo->flags & GFAR_HAS_PHY_INTR) + if (priv->einfo->board_flags & FSL_GIANFAR_BRD_HAS_PHY_INTR) mii_configure_phy_interrupt(priv->mii_info, MII_INTERRUPT_ENABLED); } @@ -1547,7 +1543,7 @@ del_timer_sync(&priv->phy_info_timer); /* Grab the PHY interrupt, if necessary/possible */ - if (priv->einfo->flags & GFAR_HAS_PHY_INTR) { + if (priv->einfo->board_flags & FSL_GIANFAR_BRD_HAS_PHY_INTR) { if (request_irq(priv->einfo->interruptPHY, phy_interrupt, SA_SHIRQ, @@ -1758,7 +1754,7 @@ /* Hmm... */ #if defined (BRIEF_GFAR_ERRORS) || defined (VERBOSE_GFAR_ERRORS) printk(KERN_DEBUG "%s: error interrupt (ievent=0x%08x imask=0x%08x)\n", - dev->name, events, gfar_read(priv->regs->imask)); + dev->name, events, gfar_read(&priv->regs->imask)); #endif /* Update the error counters */ @@ -1829,36 +1825,23 @@ } /* Structure for a device driver */ -static struct ocp_device_id gfar_ids[] = { - {.vendor = OCP_ANY_ID,.function = OCP_FUNC_GFAR}, - {.vendor = OCP_VENDOR_INVALID} -}; - -static struct ocp_driver gfar_driver = { - .name = "gianfar", - .id_table = gfar_ids, - +static struct device_driver gfar_driver = { + .name = "fsl-gianfar", + .bus = &platform_bus_type, .probe = gfar_probe, .remove = gfar_remove, }; static int __init gfar_init(void) { - int rc; - - rc = ocp_register_driver(&gfar_driver); - if (rc != 0) { - ocp_unregister_driver(&gfar_driver); - return -ENODEV; - } - - return 0; + return driver_register(&gfar_driver); } static void __exit gfar_exit(void) { - ocp_unregister_driver(&gfar_driver); + driver_unregister(&gfar_driver); } module_init(gfar_init); module_exit(gfar_exit); + diff -Nru a/drivers/net/gianfar.h b/drivers/net/gianfar.h --- a/drivers/net/gianfar.h 2005-01-17 22:31:44 -06:00 +++ b/drivers/net/gianfar.h 2005-01-17 22:31:44 -06:00 @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -47,7 +48,6 @@ #include #include #include -#include #include "gianfar_phy.h" /* The maximum number of packets to be handled in one call of gfar_poll */ @@ -510,7 +510,10 @@ unsigned int rxclean; /* Info structure initialized by board setup code */ - struct ocp_gfar_data *einfo; + unsigned int interruptTransmit; + unsigned int interruptReceive; + unsigned int interruptError; + struct gianfar_platform_data *einfo; struct gfar_mii_info *mii_info; int oldspeed; diff -Nru a/drivers/net/gianfar_ethtool.c b/drivers/net/gianfar_ethtool.c --- a/drivers/net/gianfar_ethtool.c 2005-01-17 22:31:44 -06:00 +++ b/drivers/net/gianfar_ethtool.c 2005-01-17 22:31:44 -06:00 @@ -186,9 +186,11 @@ { struct gfar_private *priv = netdev_priv(dev); uint gigabit_support = - priv->einfo->flags & GFAR_HAS_GIGABIT ? SUPPORTED_1000baseT_Full : 0; + priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_GIGABIT ? + SUPPORTED_1000baseT_Full : 0; uint gigabit_advert = - priv->einfo->flags & GFAR_HAS_GIGABIT ? ADVERTISED_1000baseT_Full: 0; + priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_GIGABIT ? + ADVERTISED_1000baseT_Full: 0; cmd->supported = (SUPPORTED_10baseT_Half | SUPPORTED_100baseT_Half From christian@borntraeger.net Tue Jan 18 07:54:22 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 07:54:27 -0800 (PST) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.184]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IFsLaN032065 for ; Tue, 18 Jan 2005 07:54:22 -0800 Received: from [212.227.126.209] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1Cqvg4-00009r-00; Tue, 18 Jan 2005 16:53:56 +0100 Received: from [84.56.138.54] (helo=cubus.S-IK) by mrelayng.kundenserver.de with asmtp (TLSv1:RC4-MD5:128) (Exim 3.35 #1) id 1Cqvg3-0002vM-00; Tue, 18 Jan 2005 16:53:55 +0100 From: Christian =?iso-8859-1?q?Borntr=E4ger?= To: hadi@cyberus.ca Subject: Re: [PATCH] ipv6: alternative version of S/390 shared NIC support Date: Tue, 18 Jan 2005 16:53:58 +0100 User-Agent: KMail/1.7.1 Cc: Christoph Hellwig , "David S. Miller" , pavlic@de.ibm.com, waldi@debian.org, netdev@oss.sgi.com References: <20050116115431.GA13617@lst.de> <200501180037.58453.christian@borntraeger.net> <1106009385.1046.49.camel@jzny.localdomain> In-Reply-To: <1106009385.1046.49.camel@jzny.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Message-Id: <200501181653.59041.christian@borntraeger.net> X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:5a8b66f42810086ecd21595c2d6103b9 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j0IFsLaN032065 X-archive-position: 440 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: christian@borntraeger.net Precedence: bulk X-list: netdev Frank, please correct me, if I am wrong.... jamal wrote: > On Mon, 2005-01-17 at 18:37, Christian Bornträger wrote: > > I am trying a small simplification here: > > Each physical network adapter offers hundreds of device addresses. You > > need 3 of them to have one logical network adapter(read,write,data). > > the "card" concept is what you call network adapter, correct? > I take it that read and write are control channels and data is where the > skb comes through? don't ask me about naming.... > > S/390 has > > hardware supported virtualization. Therefore can then use the > > hypervisor (LPAR or z/VM) to give specific LPARs or VM guests exactly 3 > > device addresses out of these hundreds. > > Can you provision multiple of these cards per VM? if yes, is there some > ID that will break it down to OSInstance:cardid? > > The qeth driver has to register the IP address at the logical network > > card (using 3 device addresses) Afterwards the physical network card > > knows which packet belongs to which device numbers. > > I think i understood but confused: before you attach IP address though, > you cant receive packets? Is there a concept of MAC address which you > can pass to the hypervisor or can you run in promiscmous mode? Right, without registering the IP address, you can not receive any packet. As the logical network interface has no own MAC address you actually speak IP to the card. That also means, that without some additional effort, tools like tcpdump fail and you need some patches in the dhcp tools. You can define options for routers to get more than your own packages, but IIRC you can only define a primary and secondary router per port. > > Another question: When that driver runs for the physical card - it runs The driver never ever runs for the physical card. It runs for 3 devices addresses, which are already behind a layer of virtualization and represent a logical IP stack in the physical card. To Linux it looks like a physical card. > in the context of a specific VM, correct? In other words it would be > impossible to see the "card" of another instance? By VM you mean virtual machine? Right. We are talking about real hardware emulation. Think about it as VMWARE in hardware or with hardware support. So you have no access to logical cards of other Linuxes. One difference to real hardware is, that multiple Linuxes have the same MAC address. The physical OSA network card and z/VM ensure, that incoming packets are delivered to the right Linux. cheers Christian From roland@topspin.com Tue Jan 18 09:33:51 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 09:33:57 -0800 (PST) Received: from umhlanga.STRATNET.NET (umhlanga.stratnet.net [12.162.17.40]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IHXpsj006079 for ; Tue, 18 Jan 2005 09:33:51 -0800 Received: from exch-1.topspincom.com ([12.162.17.3]) by umhlanga.STRATNET.NET with Microsoft SMTPSVC(5.0.2195.5329); Tue, 18 Jan 2005 09:33:50 -0800 Received: from eddore ([10.10.253.169]) by exch-1.topspincom.com with Microsoft SMTPSVC(5.0.2195.5329); Tue, 18 Jan 2005 09:33:50 -0800 Received: from roland by eddore with local (Exim 4.34) id 1CqxEh-0003vl-4L; Tue, 18 Jan 2005 09:33:50 -0800 To: davem@davemloft.net, netdev@oss.sgi.com Cc: openib-general@openib.org, ipoverib@ietf.org X-Message-Flag: Warning: May contain useful information From: Roland Dreier Date: Tue, 18 Jan 2005 09:33:47 -0800 Message-ID: <528y6qej5w.fsf@topspin.com> User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Corporate Culture, linux) MIME-Version: 1.0 X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: roland@topspin.com Subject: [PATCH] IPv6: Add correct padding to IPoIB link addr option Content-Type: text/plain; charset=us-ascii X-SA-Exim-Version: 4.1 (built Tue, 17 Aug 2004 11:06:07 +0200) X-SA-Exim-Scanned: No (on eddore); Unknown failure X-OriginalArrivalTime: 18 Jan 2005 17:33:50.0157 (UTC) FILETIME=[DF4487D0:01C4FD83] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 441 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: roland@topspin.com Precedence: bulk X-list: netdev +++ linux-bk/net/ipv6/ndisc.c 2005-01-14 21:20:55.736745091 -0800 @@ -169,12 +169,33 @@ #define NDISC_OPT_SPACE(len) (((len)+2+7)&~7) -static u8 *ndisc_fill_option(u8 *opt, int type, void *data, int data_len) +/* + * Return the padding between the option length and the start of the + * link addr. Currently only IP-over-InfiniBand needs this, although + * if RFC 3831 IPv6-over-Fibre Channel is ever implemented it may + * also need a pad of 2. + */ +static int ndisc_addr_option_pad(unsigned short type) +{ + switch (type) { + case ARPHRD_INFINIBAND: return 2; + default: return 0; + } +} + +static u8 *ndisc_fill_addr_option(u8 *opt, int type, void *data, int data_len, + unsigned short addr_type) { int space = NDISC_OPT_SPACE(data_len); + int pad = ndisc_addr_option_pad(addr_type); opt[0] = type; opt[1] = space>>3; + + memset(opt + 2, 0, pad); + opt += pad; + space -= pad; + memcpy(opt+2, data, data_len); data_len += 2; opt += data_len; @@ -453,7 +474,8 @@ ipv6_addr_copy(&msg->target, solicited_addr); if (inc_opt) - ndisc_fill_option(msg->opt, ND_OPT_TARGET_LL_ADDR, dev->dev_addr, dev->addr_len); + ndisc_fill_addr_option(msg->opt, ND_OPT_TARGET_LL_ADDR, dev->dev_addr, + dev->addr_len, dev->type); /* checksum */ msg->icmph.icmp6_cksum = csum_ipv6_magic(src_addr, daddr, len, @@ -536,7 +558,8 @@ ipv6_addr_copy(&msg->target, solicit); if (send_llinfo) - ndisc_fill_option(msg->opt, ND_OPT_SOURCE_LL_ADDR, dev->dev_addr, dev->addr_len); + ndisc_fill_addr_option(msg->opt, ND_OPT_SOURCE_LL_ADDR, dev->dev_addr, + dev->addr_len, dev->type); /* checksum */ msg->icmph.icmp6_cksum = csum_ipv6_magic(&skb->nh.ipv6h->saddr, @@ -610,7 +633,8 @@ opt = (u8*) (hdr + 1); if (dev->addr_len) - ndisc_fill_option(opt, ND_OPT_SOURCE_LL_ADDR, dev->dev_addr, dev->addr_len); + ndisc_fill_addr_option(opt, ND_OPT_SOURCE_LL_ADDR, dev->dev_addr, + dev->addr_len, dev->type); /* checksum */ hdr->icmp6_cksum = csum_ipv6_magic(&skb->nh.ipv6h->saddr, daddr, len, @@ -717,7 +741,8 @@ } if (ndopts.nd_opts_src_lladdr) { - lladdr = (u8*)(ndopts.nd_opts_src_lladdr + 1); + lladdr = (u8*)(ndopts.nd_opts_src_lladdr + 1) + + ndisc_addr_option_pad(dev->type); lladdrlen = ndopts.nd_opts_src_lladdr->nd_opt_len << 3; if (lladdrlen != NDISC_OPT_SPACE(dev->addr_len)) { ND_PRINTK2(KERN_WARNING @@ -874,7 +899,8 @@ return; } if (ndopts.nd_opts_tgt_lladdr) { - lladdr = (u8*)(ndopts.nd_opts_tgt_lladdr + 1); + lladdr = (u8*)(ndopts.nd_opts_tgt_lladdr + 1) + + ndisc_addr_option_pad(dev->type); lladdrlen = ndopts.nd_opts_tgt_lladdr->nd_opt_len << 3; if (lladdrlen != NDISC_OPT_SPACE(dev->addr_len)) { ND_PRINTK2(KERN_WARNING @@ -964,7 +990,8 @@ } if (ndopts.nd_opts_src_lladdr) { - lladdr = (u8 *)(ndopts.nd_opts_src_lladdr + 1); + lladdr = (u8 *)(ndopts.nd_opts_src_lladdr + 1) + + ndisc_addr_option_pad(skb->dev->type); lladdrlen = ndopts.nd_opts_src_lladdr->nd_opt_len << 3; if (lladdrlen != NDISC_OPT_SPACE(skb->dev->addr_len)) goto out; @@ -1130,7 +1157,8 @@ u8 *lladdr = NULL; int lladdrlen; if (ndopts.nd_opts_src_lladdr) { - lladdr = (u8*)((ndopts.nd_opts_src_lladdr)+1); + lladdr = (u8*)((ndopts.nd_opts_src_lladdr)+1) + + ndisc_addr_option_pad(skb->dev->type); lladdrlen = ndopts.nd_opts_src_lladdr->nd_opt_len << 3; if (lladdrlen != NDISC_OPT_SPACE(skb->dev->addr_len)) { ND_PRINTK2(KERN_WARNING @@ -1250,7 +1278,8 @@ return; } if (ndopts.nd_opts_tgt_lladdr) { - lladdr = (u8*)(ndopts.nd_opts_tgt_lladdr + 1); + lladdr = (u8*)(ndopts.nd_opts_tgt_lladdr + 1) + + ndisc_addr_option_pad(skb->dev->type); lladdrlen = ndopts.nd_opts_tgt_lladdr->nd_opt_len << 3; if (lladdrlen != NDISC_OPT_SPACE(skb->dev->addr_len)) { ND_PRINTK2(KERN_WARNING @@ -1379,7 +1408,8 @@ */ if (dev->addr_len) - opt = ndisc_fill_option(opt, ND_OPT_TARGET_LL_ADDR, neigh->ha, dev->addr_len); + opt = ndisc_fill_addr_option(opt, ND_OPT_TARGET_LL_ADDR, neigh->ha, + dev->addr_len, dev->type); /* * build redirect option and copy skb over to the new packet. From dsp@llnl.gov Tue Jan 18 09:35:50 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 09:35:54 -0800 (PST) Received: from smtp-4.llnl.gov (smtp-4.llnl.gov [128.115.41.84]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IHZnXn006458 for ; Tue, 18 Jan 2005 09:35:50 -0800 Received: from hypatia.llnl.gov (localhost [127.0.0.1]) by smtp-4.llnl.gov (8.12.3p2-20030917/8.12.3/LLNL evision: 1.16 $) with ESMTP id j0IHZQpg007058; Tue, 18 Jan 2005 09:35:27 -0800 (PST) Received: from hypatia.llnl.gov (localhost.localdomain [127.0.0.1]) by hypatia.llnl.gov (8.12.11/8.12.10) with ESMTP id j0IHZQ2s019970; Tue, 18 Jan 2005 09:35:26 -0800 Received: from localhost (localhost [[UNIX: localhost]]) by hypatia.llnl.gov (8.12.11/8.12.11/Submit) id j0IHZPKY019968; Tue, 18 Jan 2005 09:35:25 -0800 From: Dave Peterson To: Robert Olsson Subject: Re: possible bug in net/core/pktgen.c (2.6.10 kernel) Date: Tue, 18 Jan 2005 09:35:25 -0800 User-Agent: KMail/1.5.3 Cc: robert.olsson@its.uu.se, netdev@oss.sgi.com References: <200501141129.21461.dsp@llnl.gov> <16874.25146.335366.990655@robur.slu.se> In-Reply-To: <16874.25146.335366.990655@robur.slu.se> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501180935.25419.dsp@llnl.gov> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 442 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dsp@llnl.gov Precedence: bulk X-list: netdev On Sunday 16 January 2005 04:46 am, Robert Olsson wrote: > Dave Peterson writes: > > I found a piece of code that looks problematic in the 2.6.10 kernel. > > The following code appears starting on line 746 in function inject() > > of net/core/pktgen.c: > > schedule(); > > else > > do_softirq(); > > Thanks! > So it should be? Cool! Looks like a fix to me. > --- net/core/pktgen.c.orig 2005-01-16 13:39:10.933427120 +0100 > +++ net/core/pktgen.c 2005-01-16 13:40:41.926751672 +0100 > @@ -753,8 +753,11 @@ > } > if (need_resched()) > schedule(); > - else > + else { > + preempt_disable(); > do_softirq(); > + preempt_enable(); > + } > } while (netif_queue_stopped(odev)); > idle = cycles() - idle_start; > info->idle_acc += idle; > > > > --ro From roland@topspin.com Tue Jan 18 09:49:23 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 09:49:30 -0800 (PST) Received: from umhlanga.STRATNET.NET (umhlanga.stratnet.net [12.162.17.40]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IHnKAa007394 for ; Tue, 18 Jan 2005 09:49:23 -0800 Received: from exch-1.topspincom.com ([12.162.17.3]) by umhlanga.STRATNET.NET with Microsoft SMTPSVC(5.0.2195.5329); Tue, 18 Jan 2005 09:49:20 -0800 Received: from eddore ([10.10.253.169]) by exch-1.topspincom.com with Microsoft SMTPSVC(5.0.2195.5329); Tue, 18 Jan 2005 09:49:19 -0800 Received: from roland by eddore with local (Exim 4.34) id 1CqxTg-0003wN-Pn; Tue, 18 Jan 2005 09:49:19 -0800 To: davem@davemloft.net Cc: netdev@oss.sgi.com, ipoverib@ietf.org, openib-general@openib.org X-Message-Flag: Warning: May contain useful information References: <528y6qej5w.fsf@topspin.com> From: Roland Dreier Date: Tue, 18 Jan 2005 09:49:16 -0800 In-Reply-To: <528y6qej5w.fsf@topspin.com> (Roland Dreier's message of "Tue, 18 Jan 2005 09:33:47 -0800") Message-ID: <524qheeig3.fsf@topspin.com> User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Corporate Culture, linux) MIME-Version: 1.0 X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: roland@topspin.com Subject: Re: [openib-general] [PATCH] IPv6: Add correct padding to IPoIB link addr option Content-Type: text/plain; charset=us-ascii X-SA-Exim-Version: 4.1 (built Tue, 17 Aug 2004 11:06:07 +0200) X-SA-Exim-Scanned: No (on eddore); Unknown failure X-OriginalArrivalTime: 18 Jan 2005 17:49:19.0829 (UTC) FILETIME=[09653850:01C4FD86] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 443 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: roland@topspin.com Precedence: bulk X-list: netdev Sorry, somehow I left out the description of the patch saying why you might want to apply it.... Anand Parthasarathy pointed out that draft-ietf-ipoib-ip-over-infiniband-09.txt says: [DISC] specifies the length of source/target option in number of 8-octets as indicated by a length of '3' above. Since the IPoIB link-layer address is only 20-octet long, two octets of zero MUST be prepended to fill the total option length of 24 octets. The current Linux neighbour discovery code puts the padding after the link address. This patch fixes up ndisc.c to put the padding in the correct place by adding a general ndisc_addr_option_pad() function (which could be used in the future if someone ever implements RFC 3831 IPv6-over-FC or some other encapsulation that requires padding). Signed-off-by: Roland Dreier --- linux-bk.orig/net/ipv6/ndisc.c 2005-01-12 13:27:52.000000000 -0800 +++ linux-bk/net/ipv6/ndisc.c 2005-01-14 21:20:55.736745091 -0800 @@ -169,12 +169,33 @@ #define NDISC_OPT_SPACE(len) (((len)+2+7)&~7) -static u8 *ndisc_fill_option(u8 *opt, int type, void *data, int data_len) +/* + * Return the padding between the option length and the start of the + * link addr. Currently only IP-over-InfiniBand needs this, although + * if RFC 3831 IPv6-over-Fibre Channel is ever implemented it may + * also need a pad of 2. + */ +static int ndisc_addr_option_pad(unsigned short type) +{ + switch (type) { + case ARPHRD_INFINIBAND: return 2; + default: return 0; + } +} + +static u8 *ndisc_fill_addr_option(u8 *opt, int type, void *data, int data_len, + unsigned short addr_type) { int space = NDISC_OPT_SPACE(data_len); + int pad = ndisc_addr_option_pad(addr_type); opt[0] = type; opt[1] = space>>3; + + memset(opt + 2, 0, pad); + opt += pad; + space -= pad; + memcpy(opt+2, data, data_len); data_len += 2; opt += data_len; @@ -453,7 +474,8 @@ ipv6_addr_copy(&msg->target, solicited_addr); if (inc_opt) - ndisc_fill_option(msg->opt, ND_OPT_TARGET_LL_ADDR, dev->dev_addr, dev->addr_len); + ndisc_fill_addr_option(msg->opt, ND_OPT_TARGET_LL_ADDR, dev->dev_addr, + dev->addr_len, dev->type); /* checksum */ msg->icmph.icmp6_cksum = csum_ipv6_magic(src_addr, daddr, len, @@ -536,7 +558,8 @@ ipv6_addr_copy(&msg->target, solicit); if (send_llinfo) - ndisc_fill_option(msg->opt, ND_OPT_SOURCE_LL_ADDR, dev->dev_addr, dev->addr_len); + ndisc_fill_addr_option(msg->opt, ND_OPT_SOURCE_LL_ADDR, dev->dev_addr, + dev->addr_len, dev->type); /* checksum */ msg->icmph.icmp6_cksum = csum_ipv6_magic(&skb->nh.ipv6h->saddr, @@ -610,7 +633,8 @@ opt = (u8*) (hdr + 1); if (dev->addr_len) - ndisc_fill_option(opt, ND_OPT_SOURCE_LL_ADDR, dev->dev_addr, dev->addr_len); + ndisc_fill_addr_option(opt, ND_OPT_SOURCE_LL_ADDR, dev->dev_addr, + dev->addr_len, dev->type); /* checksum */ hdr->icmp6_cksum = csum_ipv6_magic(&skb->nh.ipv6h->saddr, daddr, len, @@ -717,7 +741,8 @@ } if (ndopts.nd_opts_src_lladdr) { - lladdr = (u8*)(ndopts.nd_opts_src_lladdr + 1); + lladdr = (u8*)(ndopts.nd_opts_src_lladdr + 1) + + ndisc_addr_option_pad(dev->type); lladdrlen = ndopts.nd_opts_src_lladdr->nd_opt_len << 3; if (lladdrlen != NDISC_OPT_SPACE(dev->addr_len)) { ND_PRINTK2(KERN_WARNING @@ -874,7 +899,8 @@ return; } if (ndopts.nd_opts_tgt_lladdr) { - lladdr = (u8*)(ndopts.nd_opts_tgt_lladdr + 1); + lladdr = (u8*)(ndopts.nd_opts_tgt_lladdr + 1) + + ndisc_addr_option_pad(dev->type); lladdrlen = ndopts.nd_opts_tgt_lladdr->nd_opt_len << 3; if (lladdrlen != NDISC_OPT_SPACE(dev->addr_len)) { ND_PRINTK2(KERN_WARNING @@ -964,7 +990,8 @@ } if (ndopts.nd_opts_src_lladdr) { - lladdr = (u8 *)(ndopts.nd_opts_src_lladdr + 1); + lladdr = (u8 *)(ndopts.nd_opts_src_lladdr + 1) + + ndisc_addr_option_pad(skb->dev->type); lladdrlen = ndopts.nd_opts_src_lladdr->nd_opt_len << 3; if (lladdrlen != NDISC_OPT_SPACE(skb->dev->addr_len)) goto out; @@ -1130,7 +1157,8 @@ u8 *lladdr = NULL; int lladdrlen; if (ndopts.nd_opts_src_lladdr) { - lladdr = (u8*)((ndopts.nd_opts_src_lladdr)+1); + lladdr = (u8*)((ndopts.nd_opts_src_lladdr)+1) + + ndisc_addr_option_pad(skb->dev->type); lladdrlen = ndopts.nd_opts_src_lladdr->nd_opt_len << 3; if (lladdrlen != NDISC_OPT_SPACE(skb->dev->addr_len)) { ND_PRINTK2(KERN_WARNING @@ -1250,7 +1278,8 @@ return; } if (ndopts.nd_opts_tgt_lladdr) { - lladdr = (u8*)(ndopts.nd_opts_tgt_lladdr + 1); + lladdr = (u8*)(ndopts.nd_opts_tgt_lladdr + 1) + + ndisc_addr_option_pad(skb->dev->type); lladdrlen = ndopts.nd_opts_tgt_lladdr->nd_opt_len << 3; if (lladdrlen != NDISC_OPT_SPACE(skb->dev->addr_len)) { ND_PRINTK2(KERN_WARNING @@ -1379,7 +1408,8 @@ */ if (dev->addr_len) - opt = ndisc_fill_option(opt, ND_OPT_TARGET_LL_ADDR, neigh->ha, dev->addr_len); + opt = ndisc_fill_addr_option(opt, ND_OPT_TARGET_LL_ADDR, neigh->ha, + dev->addr_len, dev->type); /* * build redirect option and copy skb over to the new packet. From PAVLIC@de.ibm.com Tue Jan 18 10:33:56 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 10:34:00 -0800 (PST) Received: from mtagate3.de.ibm.com (mtagate3.de.ibm.com [195.212.29.152]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IIXsv6010639 for ; Tue, 18 Jan 2005 10:33:55 -0800 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate3.de.ibm.com (8.12.10/8.12.10) with ESMTP id j0IIXmdt155650 for ; Tue, 18 Jan 2005 18:33:48 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j0IIYkeY160884 for ; Tue, 18 Jan 2005 19:34:46 +0100 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11/8.12.11) with ESMTP id j0IIXmZU031079 for ; Tue, 18 Jan 2005 19:33:48 +0100 Received: from d12ml068.megacenter.de.ibm.com (d12ml068.megacenter.de.ibm.com [9.149.164.163]) by d12av02.megacenter.de.ibm.com (8.12.11/8.12.11) with ESMTP id j0IIXl0Z031073; Tue, 18 Jan 2005 19:33:47 +0100 In-Reply-To: <200501181653.59041.christian@borntraeger.net> Subject: Re: [PATCH] ipv6: alternative version of S/390 shared NIC support To: Christian =?ISO-8859-1?Q?Borntr=E4ger?= Cc: "David S. Miller" , hadi@cyberus.ca, Christoph Hellwig , netdev@oss.sgi.com, waldi@debian.org X-Mailer: Lotus Notes Build V651_12042003 December 04, 2003 Message-ID: From: Frank Pavlic Date: Tue, 18 Jan 2005 19:25:25 +0100 X-MIMETrack: Serialize by Router on D12ML068/12/M/IBM(Release 6.51HF338 | June 21, 2004) at 18/01/2005 19:34:19 MIME-Version: 1.0 Content-type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j0IIXsv6010639 X-archive-position: 444 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: PAVLIC@de.ibm.com Precedence: bulk X-list: netdev Christian Bornträger wrote on 18.01.2005 16:53:58: > Frank, please correct me, if I am wrong.... It's all correct .... sorry Christian but I didn't make it to answer :-( > > jamal wrote: > > On Mon, 2005-01-17 at 18:37, Christian Bornträger wrote: > > > I am trying a small simplification here: > > > Each physical network adapter offers hundreds of device addresses. You > > > need 3 of them to have one logical network adapter(read,write,data). > > > > the "card" concept is what you call network adapter, correct? > > I take it that read and write are control channels and data is where the > > skb comes through? > > don't ask me about naming.... > > > > S/390 has > > > hardware supported virtualization. Therefore can then use the > > > hypervisor (LPAR or z/VM) to give specific LPARs or VM guests exactly 3 > > > device addresses out of these hundreds. > > > > Can you provision multiple of these cards per VM? if yes, is there some > > ID that will break it down to OSInstance:cardid? > > > The qeth driver has to register the IP address at the logical network > > > card (using 3 device addresses) Afterwards the physical network card > > > knows which packet belongs to which device numbers. > > > > I think i understood but confused: before you attach IP address though, > > you cant receive packets? Is there a concept of MAC address which you > > can pass to the hypervisor or can you run in promiscmous mode? > > Right, without registering the IP address, you can not receive any packet. > As the logical network interface has no own MAC address you actually speak > IP to the card. That also means, that without some additional effort, tools > like tcpdump fail and you need some patches in the dhcp tools. > You can define options for routers to get more than your own packages, but > IIRC you can only define a primary and secondary router per port. > > > > > Another question: When that driver runs for the physical card - it runs > > The driver never ever runs for the physical card. It runs for 3 devices > addresses, which are already behind a layer of virtualization and represent > a logical IP stack in the physical card. To Linux it looks like a physical > card. > > > in the context of a specific VM, correct? In other words it would be > > impossible to see the "card" of another instance? > > By VM you mean virtual machine? Right. We are talking about real hardware > emulation. Think about it as VMWARE in hardware or with hardware support. > So you have no access to logical cards of other Linuxes. > One difference to real hardware is, that multiple Linuxes have the same MAC > address. The physical OSA network card and z/VM ensure, that incoming > packets are delivered to the right Linux. > > > cheers > Christian From chas@cmf.nrl.navy.mil Tue Jan 18 11:03:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 11:03:10 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IJ33AX011956 for ; Tue, 18 Jan 2005 11:03:03 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.11/8.12.11) with ESMTP id j0IJ2nif022216; Tue, 18 Jan 2005 14:02:49 -0500 (EST) Message-Id: <200501181902.j0IJ2nif022216@ginger.cmf.nrl.navy.mil> To: netdev@oss.sgi.com Cc: davem@redhat.com Subject: [PATCH][1 of 7][ATM]: [drivers] pci_enable_device() before finding irq Date: Tue, 18 Jan 2005 14:02:49 -0500 From: "chas williams - CONTRACTOR" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-Virus-Status: Clean X-archive-position: 445 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev please apply to 2.6. thanks! # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/06 13:13:50-05:00 chas@relax.cmf.nrl.navy.mil # [ATM]: [drivers] pci_enable_device() before finding irq # # Signed-off-by: Chas Williams # # drivers/atm/horizon.c # 2005/01/06 13:13:32-05:00 chas@relax.cmf.nrl.navy.mil +10 -9 # [ATM]: [drivers] pci_enable_device() before finding irq # # Signed-off-by: Chas Williams # # drivers/atm/ambassador.c # 2005/01/06 13:13:32-05:00 chas@relax.cmf.nrl.navy.mil +15 -17 # [ATM]: [drivers] pci_enable_device() before finding irq # # Signed-off-by: Chas Williams # diff -Nru a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c --- a/drivers/atm/ambassador.c 2005-01-14 08:42:14 -05:00 +++ b/drivers/atm/ambassador.c 2005-01-14 08:42:14 -05:00 @@ -2228,17 +2228,12 @@ spin_lock_init (&dev->rxq[pool].lock); } -static int setup_pci_dev(struct pci_dev *pci_dev) +static void setup_pci_dev(struct pci_dev *pci_dev) { unsigned char lat; - int ret; // enable bus master accesses pci_set_master(pci_dev); - - ret = pci_enable_device(pci_dev); - if (ret < 0) - goto out; // frobnicate latency (upwards, usually) pci_read_config_byte (pci_dev, PCI_LATENCY_TIMER, &lat); @@ -2251,22 +2246,27 @@ lat, pci_lat); pci_write_config_byte(pci_dev, PCI_LATENCY_TIMER, pci_lat); } -out: - return ret; } static int __devinit amb_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent) { amb_dev * dev; int err; + unsigned int irq; + + err = pci_enable_device(pci_dev); + if (err < 0) { + PRINTK (KERN_ERR, "skipped broken (PLX rev 2) card"); + goto out; + } // read resources from PCI configuration space - unsigned int irq = pci_dev->irq; + irq = pci_dev->irq; if (pci_dev->device == PCI_DEVICE_ID_MADGE_AMBASSADOR_BAD) { PRINTK (KERN_ERR, "skipped broken (PLX rev 2) card"); err = -EINVAL; - goto out; + goto out_disable; } PRINTD (DBG_INFO, "found Madge ATM adapter (amb) at" @@ -2277,7 +2277,7 @@ err = pci_request_region(pci_dev, 1, DEV_LABEL); if (err < 0) { PRINTK (KERN_ERR, "IO range already in use!"); - goto out; + goto out_disable; } dev = kmalloc (sizeof(amb_dev), GFP_KERNEL); @@ -2295,15 +2295,13 @@ goto out_free; } - err = setup_pci_dev(pci_dev); - if (err < 0) - goto out_reset; + setup_pci_dev(pci_dev); // grab (but share) IRQ and install handler err = request_irq(irq, interrupt_handler, SA_SHIRQ, DEV_LABEL, dev); if (err < 0) { PRINTK (KERN_ERR, "request IRQ failed!"); - goto out_disable; + goto out_reset; } dev->atm_dev = atm_dev_register (DEV_LABEL, &amb_ops, -1, NULL); @@ -2337,14 +2335,14 @@ out_free_irq: free_irq(irq, dev); -out_disable: - pci_disable_device(pci_dev); out_reset: amb_reset(dev, 0); out_free: kfree(dev); out_release: pci_release_region(pci_dev, 1); +out_disable: + pci_disable_device(pci_dev); goto out; } diff -Nru a/drivers/atm/horizon.c b/drivers/atm/horizon.c --- a/drivers/atm/horizon.c 2005-01-14 08:42:14 -05:00 +++ b/drivers/atm/horizon.c 2005-01-14 08:42:14 -05:00 @@ -2706,18 +2706,18 @@ // adapter slot free, read resources from PCI configuration space u32 iobase = pci_resource_start (pci_dev, 0); u32 * membase = bus_to_virt (pci_resource_start (pci_dev, 1)); - u8 irq = pci_dev->irq; + unsigned int irq; unsigned char lat; PRINTD (DBG_FLOW, "hrz_probe"); - /* XXX DEV_LABEL is a guess */ - if (!request_region(iobase, HRZ_IO_EXTENT, DEV_LABEL)) + if (pci_enable_device(pci_dev)) return -EINVAL; - if (pci_enable_device(pci_dev)) { - err = -EINVAL; - goto out_release; + /* XXX DEV_LABEL is a guess */ + if (!request_region(iobase, HRZ_IO_EXTENT, DEV_LABEL)) { + return -EINVAL; + goto out_disable; } dev = kmalloc(sizeof(hrz_dev), GFP_KERNEL); @@ -2725,7 +2725,7 @@ // perhaps we should be nice: deregister all adapters and abort? PRINTD(DBG_ERR, "out of memory"); err = -ENOMEM; - goto out_disable; + goto out_release; } memset(dev, 0, sizeof(hrz_dev)); @@ -2733,6 +2733,7 @@ pci_set_drvdata(pci_dev, dev); // grab IRQ and install handler - move this someplace more sensible + irq = pci_dev->irq; if (request_irq(irq, interrupt_handler, SA_SHIRQ, /* irqflags guess */ @@ -2846,10 +2847,10 @@ free_irq(dev->irq, dev); out_free: kfree(dev); -out_disable: - pci_disable_device(pci_dev); out_release: release_region(iobase, HRZ_IO_EXTENT); +out_disable: + pci_disable_device(pci_dev); goto out; } From chas@cmf.nrl.navy.mil Tue Jan 18 11:04:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 11:04:10 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IJ43h7012235 for ; Tue, 18 Jan 2005 11:04:04 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.11/8.12.11) with ESMTP id j0IJ3oxB022242; Tue, 18 Jan 2005 14:03:50 -0500 (EST) Message-Id: <200501181903.j0IJ3oxB022242@ginger.cmf.nrl.navy.mil> To: netdev@oss.sgi.com Cc: davem@redhat.com Subject: [PATCH][2 of 7][ATM]: [lec] rewrite to eliminate lec_arp_users in favor of lec_arp_lock Date: Tue, 18 Jan 2005 14:03:50 -0500 From: "chas williams - CONTRACTOR" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-Virus-Status: Clean X-archive-position: 446 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev please apply to 2.6. thanks! # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/06 13:15:38-05:00 chas@relax.cmf.nrl.navy.mil # [ATM]: [lec] rewrite to eliminate lec_arp_users in favor of lec_arp_lock # # Signed-off-by: Chas Williams # # net/atm/lec.h # 2005/01/06 13:15:22-05:00 chas@relax.cmf.nrl.navy.mil +0 -1 # [ATM]: [lec] rewrite to eliminate lec_arp_users in favor of lec_arp_lock # # Signed-off-by: Chas Williams # # net/atm/lec.c # 2005/01/06 13:15:21-05:00 chas@relax.cmf.nrl.navy.mil +157 -165 # [ATM]: [lec] rewrite to eliminate lec_arp_users in favor of lec_arp_lock # # Signed-off-by: Chas Williams # diff -Nru a/net/atm/lec.c b/net/atm/lec.c --- a/net/atm/lec.c 2005-01-14 08:42:30 -05:00 +++ b/net/atm/lec.c 2005-01-14 08:42:30 -05:00 @@ -422,6 +422,7 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb) { + unsigned long flags; struct net_device *dev = (struct net_device*)vcc->proto_data; struct lec_priv *priv = (struct lec_priv*)dev->priv; struct atmlec_msg *mesg; @@ -456,8 +457,10 @@ lec_flush_complete(priv, mesg->content.normal.flag); break; case l_narp_req: /* LANE2: see 7.1.35 in the lane2 spec */ + spin_lock_irqsave(&priv->lec_arp_lock, flags); entry = lec_arp_find(priv, mesg->content.normal.mac_addr); lec_arp_remove(priv, entry); + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); if (mesg->content.normal.no_source_le_narp) break; @@ -1222,17 +1225,20 @@ static int lane2_resolve(struct net_device *dev, u8 *dst_mac, int force, u8 **tlvs, u32 *sizeoftlvs) { + unsigned long flags; struct lec_priv *priv = (struct lec_priv *)dev->priv; struct lec_arp_table *table; struct sk_buff *skb; int retval; if (force == 0) { + spin_lock_irqsave(&priv->lec_arp_lock, flags); table = lec_arp_find(priv, dst_mac); + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); if(table == NULL) return -1; - *tlvs = kmalloc(table->sizeoftlvs, GFP_KERNEL); + *tlvs = kmalloc(table->sizeoftlvs, GFP_ATOMIC); if (*tlvs == NULL) return -1; @@ -1377,18 +1383,6 @@ #define HASH(ch) (ch & (LEC_ARP_TABLE_SIZE -1)) -static __inline__ void -lec_arp_get(struct lec_priv *priv) -{ - atomic_inc(&priv->lec_arp_users); -} - -static __inline__ void -lec_arp_put(struct lec_priv *priv) -{ - atomic_dec(&priv->lec_arp_users); -} - /* * Initialization of arp-cache */ @@ -1397,12 +1391,12 @@ { unsigned short i; - for (i=0;ilec_arp_tables[i] = NULL; } spin_lock_init(&priv->lec_arp_lock); init_timer(&priv->lec_arp_timer); - priv->lec_arp_timer.expires = jiffies+LEC_ARP_REFRESH_INTERVAL; + priv->lec_arp_timer.expires = jiffies + LEC_ARP_REFRESH_INTERVAL; priv->lec_arp_timer.data = (unsigned long)priv; priv->lec_arp_timer.function = lec_arp_check_expire; add_timer(&priv->lec_arp_timer); @@ -1439,12 +1433,9 @@ static inline void lec_arp_add(struct lec_priv *priv, struct lec_arp_table *to_add) { - unsigned long flags; unsigned short place; struct lec_arp_table *tmp; - spin_lock_irqsave(&priv->lec_arp_lock, flags); - place = HASH(to_add->mac_addr[ETH_ALEN-1]); tmp = priv->lec_arp_tables[place]; to_add->next = NULL; @@ -1457,8 +1448,6 @@ tmp->next = to_add; } - spin_unlock_irqrestore(&priv->lec_arp_lock, flags); - DPRINTK("LEC_ARP: Added entry:%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n", 0xff&to_add->mac_addr[0], 0xff&to_add->mac_addr[1], 0xff&to_add->mac_addr[2], 0xff&to_add->mac_addr[3], @@ -1472,15 +1461,11 @@ lec_arp_remove(struct lec_priv *priv, struct lec_arp_table *to_remove) { - unsigned long flags; unsigned short place; struct lec_arp_table *tmp; int remove_vcc=1; - spin_lock_irqsave(&priv->lec_arp_lock, flags); - if (!to_remove) { - spin_unlock_irqrestore(&priv->lec_arp_lock, flags); return -1; } place = HASH(to_remove->mac_addr[ETH_ALEN-1]); @@ -1492,7 +1477,6 @@ tmp = tmp->next; } if (!tmp) {/* Entry was not found */ - spin_unlock_irqrestore(&priv->lec_arp_lock, flags); return -1; } } @@ -1505,7 +1489,7 @@ /* * ESI_FLUSH_PENDING, ESI_FORWARD_DIRECT */ - for(place=0;placelec_arp_tables[place]; tmp != NULL; tmp = tmp->next) { if (memcmp(tmp->atm_addr, to_remove->atm_addr, ATM_ESA_LEN)==0) { @@ -1519,8 +1503,6 @@ } skb_queue_purge(&to_remove->tx_wait); /* FIXME: good place for this? */ - spin_unlock_irqrestore(&priv->lec_arp_lock, flags); - DPRINTK("LEC_ARP: Removed entry:%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n", 0xff&to_remove->mac_addr[0], 0xff&to_remove->mac_addr[1], 0xff&to_remove->mac_addr[2], 0xff&to_remove->mac_addr[3], @@ -1704,6 +1686,7 @@ void lec_arp_destroy(struct lec_priv *priv) { + unsigned long flags; struct lec_arp_table *entry, *next; int i; @@ -1712,8 +1695,10 @@ /* * Remove all entries */ - for (i=0;ilec_arp_tables[i];entry != NULL; entry=next) { + + spin_lock_irqsave(&priv->lec_arp_lock, flags); + for (i = 0; i < LEC_ARP_TABLE_SIZE; i++) { + for(entry = priv->lec_arp_tables[i]; entry != NULL; entry=next) { next = entry->next; lec_arp_remove(priv, entry); kfree(entry); @@ -1748,7 +1733,8 @@ priv->mcast_fwds = NULL; priv->mcast_vcc = NULL; memset(priv->lec_arp_tables, 0, - sizeof(struct lec_arp_table*)*LEC_ARP_TABLE_SIZE); + sizeof(struct lec_arp_table *) * LEC_ARP_TABLE_SIZE); + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); } @@ -1765,18 +1751,15 @@ DPRINTK("LEC_ARP: lec_arp_find :%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n", mac_addr[0]&0xff, mac_addr[1]&0xff, mac_addr[2]&0xff, mac_addr[3]&0xff, mac_addr[4]&0xff, mac_addr[5]&0xff); - lec_arp_get(priv); place = HASH(mac_addr[ETH_ALEN-1]); to_return = priv->lec_arp_tables[place]; while(to_return) { if (memcmp(mac_addr, to_return->mac_addr, ETH_ALEN) == 0) { - lec_arp_put(priv); return to_return; } to_return = to_return->next; } - lec_arp_put(priv); return NULL; } @@ -1785,17 +1768,17 @@ { struct lec_arp_table *to_return; - to_return=(struct lec_arp_table *)kmalloc(sizeof(struct lec_arp_table), - GFP_ATOMIC); + to_return = (struct lec_arp_table *) kmalloc(sizeof(struct lec_arp_table), + GFP_ATOMIC); if (!to_return) { printk("LEC: Arp entry kmalloc failed\n"); return NULL; } - memset(to_return,0,sizeof(struct lec_arp_table)); + memset(to_return, 0, sizeof(struct lec_arp_table)); memcpy(to_return->mac_addr, mac_addr, ETH_ALEN); init_timer(&to_return->timer); to_return->timer.function = lec_arp_expire_arp; - to_return->timer.data = (unsigned long)to_return; + to_return->timer.data = (unsigned long) to_return; to_return->last_used = jiffies; to_return->priv = priv; skb_queue_head_init(&to_return->tx_wait); @@ -1835,6 +1818,7 @@ static void lec_arp_expire_vcc(unsigned long data) { + unsigned flags; struct lec_arp_table *to_remove = (struct lec_arp_table*)data; struct lec_priv *priv = (struct lec_priv *)to_remove->priv; struct lec_arp_table *entry = NULL; @@ -1846,6 +1830,8 @@ to_remove->vcc?to_remove->recv_vcc->vpi:0, to_remove->vcc?to_remove->recv_vcc->vci:0); DPRINTK("eo:%p nf:%p\n",priv->lec_arp_empty_ones,priv->lec_no_forward); + + spin_lock_irqsave(&priv->lec_arp_lock, flags); if (to_remove == priv->lec_arp_empty_ones) priv->lec_arp_empty_ones = to_remove->next; else { @@ -1866,6 +1852,8 @@ entry->next = to_remove->next; } } + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); + lec_arp_clear_vccs(to_remove); kfree(to_remove); } @@ -1889,69 +1877,67 @@ static void lec_arp_check_expire(unsigned long data) { + unsigned long flags; struct lec_priv *priv = (struct lec_priv *)data; struct lec_arp_table *entry, *next; unsigned long now; unsigned long time_to_check; int i; - DPRINTK("lec_arp_check_expire %p,%d\n",priv, - atomic_read(&priv->lec_arp_users)); + DPRINTK("lec_arp_check_expire %p\n",priv); DPRINTK("expire: eo:%p nf:%p\n",priv->lec_arp_empty_ones, priv->lec_no_forward); - if (!atomic_read(&priv->lec_arp_users)) { - lec_arp_get(priv); - now = jiffies; - for(i=0;ilec_arp_tables[i]; entry != NULL; ) { - if ((entry->flags) & LEC_REMOTE_FLAG && - priv->topology_change) - time_to_check=priv->forward_delay_time; - else - time_to_check = priv->aging_time; - - DPRINTK("About to expire: %lx - %lx > %lx\n", - now,entry->last_used, time_to_check); - if( time_after(now, entry->last_used+ - time_to_check) && - !(entry->flags & LEC_PERMANENT_FLAG) && - !(entry->mac_addr[0] & 0x01) ) { /* LANE2: 7.1.20 */ - /* Remove entry */ - DPRINTK("LEC:Entry timed out\n"); - next = entry->next; - lec_arp_remove(priv, entry); - kfree(entry); - entry = next; - } else { - /* Something else */ - if ((entry->status == ESI_VC_PENDING || - entry->status == ESI_ARP_PENDING) - && time_after_eq(now, - entry->timestamp + - priv->max_unknown_frame_time)) { - entry->timestamp = jiffies; - entry->packets_flooded = 0; - if (entry->status == ESI_VC_PENDING) - send_to_lecd(priv, l_svc_setup, entry->mac_addr, entry->atm_addr, NULL); - } - if (entry->status == ESI_FLUSH_PENDING - && - time_after_eq(now, entry->timestamp+ - priv->path_switching_delay)) { - struct sk_buff *skb; - - while ((skb = skb_dequeue(&entry->tx_wait)) != NULL) - lec_send(entry->vcc, skb, entry->priv); - entry->last_used = jiffies; - entry->status = - ESI_FORWARD_DIRECT; - } - entry = entry->next; - } - } - } - lec_arp_put(priv); - } + now = jiffies; + spin_lock_irqsave(&priv->lec_arp_lock, flags); + for(i = 0; i < LEC_ARP_TABLE_SIZE; i++) { + for(entry = priv->lec_arp_tables[i]; entry != NULL; ) { + if ((entry->flags) & LEC_REMOTE_FLAG && + priv->topology_change) + time_to_check = priv->forward_delay_time; + else + time_to_check = priv->aging_time; + + DPRINTK("About to expire: %lx - %lx > %lx\n", + now,entry->last_used, time_to_check); + if( time_after(now, entry->last_used+ + time_to_check) && + !(entry->flags & LEC_PERMANENT_FLAG) && + !(entry->mac_addr[0] & 0x01) ) { /* LANE2: 7.1.20 */ + /* Remove entry */ + DPRINTK("LEC:Entry timed out\n"); + next = entry->next; + lec_arp_remove(priv, entry); + kfree(entry); + entry = next; + } else { + /* Something else */ + if ((entry->status == ESI_VC_PENDING || + entry->status == ESI_ARP_PENDING) + && time_after_eq(now, + entry->timestamp + + priv->max_unknown_frame_time)) { + entry->timestamp = jiffies; + entry->packets_flooded = 0; + if (entry->status == ESI_VC_PENDING) + send_to_lecd(priv, l_svc_setup, entry->mac_addr, entry->atm_addr, NULL); + } + if (entry->status == ESI_FLUSH_PENDING + && + time_after_eq(now, entry->timestamp+ + priv->path_switching_delay)) { + struct sk_buff *skb; + + while ((skb = skb_dequeue(&entry->tx_wait)) != NULL) + lec_send(entry->vcc, skb, entry->priv); + entry->last_used = jiffies; + entry->status = + ESI_FORWARD_DIRECT; + } + entry = entry->next; + } + } + } + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); mod_timer(&priv->lec_arp_timer, jiffies + LEC_ARP_REFRESH_INTERVAL); } @@ -1963,9 +1949,11 @@ lec_arp_resolve(struct lec_priv *priv, unsigned char *mac_to_find, int is_rdesc, struct lec_arp_table **ret_entry) { + unsigned long flags; struct lec_arp_table *entry; + struct atm_vcc *found; - if (mac_to_find[0]&0x01) { + if (mac_to_find[0] & 0x01) { switch (priv->lane_version) { case 1: return priv->mcast_vcc; @@ -1979,6 +1967,7 @@ } } + spin_lock_irqsave(&priv->lec_arp_lock, flags); entry = lec_arp_find(priv, mac_to_find); if (entry) { @@ -1986,7 +1975,8 @@ /* Connection Ok */ entry->last_used = jiffies; *ret_entry = entry; - return entry->vcc; + found = entry->vcc; + goto out; } /* Data direct VC not yet set up, check to see if the unknown frame count is greater than the limit. If the limit has @@ -1996,7 +1986,8 @@ entry->packets_floodedmaximum_unknown_frame_count) { entry->packets_flooded++; DPRINTK("LEC_ARP: Flooding..\n"); - return priv->mcast_vcc; + found = priv->mcast_vcc; + goto out; } /* We got here because entry->status == ESI_FLUSH_PENDING * or BUS flood limit was reached for an entry which is @@ -2004,13 +1995,14 @@ */ *ret_entry = entry; DPRINTK("lec: entry->status %d entry->vcc %p\n", entry->status, entry->vcc); - return NULL; + found = NULL; } else { /* No matching entry was found */ entry = make_entry(priv, mac_to_find); DPRINTK("LEC_ARP: Making entry\n"); if (!entry) { - return priv->mcast_vcc; + found = priv->mcast_vcc; + goto out; } lec_arp_add(priv, entry); /* We want arp-request(s) to be sent */ @@ -2026,33 +2018,38 @@ entry->timer.expires = jiffies + (1*HZ); entry->timer.function = lec_arp_expire_arp; add_timer(&entry->timer); - return priv->mcast_vcc; + found = priv->mcast_vcc; } + +out: + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); + return found; } int lec_addr_delete(struct lec_priv *priv, unsigned char *atm_addr, unsigned long permanent) { + unsigned long flags; struct lec_arp_table *entry, *next; int i; - lec_arp_get(priv); DPRINTK("lec_addr_delete\n"); - for(i=0;ilec_arp_tables[i];entry != NULL; entry=next) { + spin_lock_irqsave(&priv->lec_arp_lock, flags); + for(i = 0; i < LEC_ARP_TABLE_SIZE; i++) { + for(entry = priv->lec_arp_tables[i]; entry != NULL; entry = next) { next = entry->next; if (!memcmp(atm_addr, entry->atm_addr, ATM_ESA_LEN) && (permanent || !(entry->flags & LEC_PERMANENT_FLAG))) { - lec_arp_remove(priv, entry); + lec_arp_remove(priv, entry); kfree(entry); } - lec_arp_put(priv); + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); return 0; } } - lec_arp_put(priv); + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); return -1; } @@ -2064,6 +2061,7 @@ unsigned char *atm_addr, unsigned long remoteflag, unsigned int targetless_le_arp) { + unsigned long flags; struct lec_arp_table *entry, *tmp; int i; @@ -2072,12 +2070,12 @@ mac_addr[0],mac_addr[1],mac_addr[2],mac_addr[3], mac_addr[4],mac_addr[5]); + spin_lock_irqsave(&priv->lec_arp_lock, flags); entry = lec_arp_find(priv, mac_addr); if (entry == NULL && targetless_le_arp) - return; /* LANE2: ignore targetless LE_ARPs for which - * we have no entry in the cache. 7.1.30 - */ - lec_arp_get(priv); + goto out; /* LANE2: ignore targetless LE_ARPs for which + * we have no entry in the cache. 7.1.30 + */ if (priv->lec_arp_empty_ones) { entry = priv->lec_arp_empty_ones; if (!memcmp(entry->atm_addr, atm_addr, ATM_ESA_LEN)) { @@ -2117,27 +2115,24 @@ entry->flags|=LEC_REMOTE_FLAG; else entry->flags&=~LEC_REMOTE_FLAG; - lec_arp_put(priv); DPRINTK("After update\n"); dump_arp_table(priv); - return; + goto out; } } entry = lec_arp_find(priv, mac_addr); if (!entry) { entry = make_entry(priv, mac_addr); - if (!entry) { - lec_arp_put(priv); - return; - } + if (!entry) + goto out; entry->status = ESI_UNKNOWN; lec_arp_add(priv, entry); /* Temporary, changes before end of function */ } memcpy(entry->atm_addr, atm_addr, ATM_ESA_LEN); del_timer(&entry->timer); - for(i=0;ilec_arp_tables[i];tmp;tmp=tmp->next) { + for(i = 0; i < LEC_ARP_TABLE_SIZE; i++) { + for(tmp = priv->lec_arp_tables[i]; tmp; tmp=tmp->next) { if (entry != tmp && !memcmp(tmp->atm_addr, atm_addr, ATM_ESA_LEN)) { @@ -2166,7 +2161,8 @@ } DPRINTK("After update2\n"); dump_arp_table(priv); - lec_arp_put(priv); +out: + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); } /* @@ -2177,10 +2173,11 @@ struct atm_vcc *vcc, void (*old_push)(struct atm_vcc *vcc, struct sk_buff *skb)) { + unsigned long flags; struct lec_arp_table *entry; int i, found_entry=0; - lec_arp_get(priv); + spin_lock_irqsave(&priv->lec_arp_lock, flags); if (ioc_data->receive == 2) { /* Vcc for Multicast Forward. No timer, LANEv2 7.1.20 and 2.3.5.3 */ @@ -2189,26 +2186,22 @@ entry = lec_arp_find(priv, bus_mac); if (!entry) { printk("LEC_ARP: Multicast entry not found!\n"); - lec_arp_put(priv); - return; + goto out; } memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); entry->recv_vcc = vcc; entry->old_recv_push = old_push; #endif entry = make_entry(priv, bus_mac); - if (entry == NULL) { - lec_arp_put(priv); - return; - } + if (entry == NULL) + goto out; del_timer(&entry->timer); memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); entry->recv_vcc = vcc; entry->old_recv_push = old_push; entry->next = priv->mcast_fwds; priv->mcast_fwds = entry; - lec_arp_put(priv); - return; + goto out; } else if (ioc_data->receive == 1) { /* Vcc which we don't want to make default vcc, attach it anyway. */ @@ -2224,10 +2217,8 @@ ioc_data->atm_addr[16],ioc_data->atm_addr[17], ioc_data->atm_addr[18],ioc_data->atm_addr[19]); entry = make_entry(priv, bus_mac); - if (entry == NULL) { - lec_arp_put(priv); - return; - } + if (entry == NULL) + goto out; memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); memset(entry->mac_addr, 0, ETH_ALEN); entry->recv_vcc = vcc; @@ -2238,9 +2229,8 @@ add_timer(&entry->timer); entry->next = priv->lec_no_forward; priv->lec_no_forward = entry; - lec_arp_put(priv); dump_arp_table(priv); - return; + goto out; } DPRINTK("LEC_ARP:Attaching data direct, default:%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x\n", ioc_data->atm_addr[0],ioc_data->atm_addr[1], @@ -2253,8 +2243,8 @@ ioc_data->atm_addr[14],ioc_data->atm_addr[15], ioc_data->atm_addr[16],ioc_data->atm_addr[17], ioc_data->atm_addr[18],ioc_data->atm_addr[19]); - for (i=0;ilec_arp_tables[i];entry;entry=entry->next) { + for (i = 0; i < LEC_ARP_TABLE_SIZE; i++) { + for (entry = priv->lec_arp_tables[i]; entry; entry=entry->next) { if (memcmp(ioc_data->atm_addr, entry->atm_addr, ATM_ESA_LEN)==0) { DPRINTK("LEC_ARP: Attaching data direct\n"); @@ -2297,18 +2287,15 @@ } } if (found_entry) { - lec_arp_put(priv); DPRINTK("After vcc was added\n"); dump_arp_table(priv); - return; + goto out; } /* Not found, snatch address from first data packet that arrives from this vcc */ entry = make_entry(priv, bus_mac); - if (!entry) { - lec_arp_put(priv); - return; - } + if (!entry) + goto out; entry->vcc = vcc; entry->old_push = old_push; memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN); @@ -2319,20 +2306,23 @@ entry->timer.expires = jiffies + priv->vcc_timeout_period; entry->timer.function = lec_arp_expire_vcc; add_timer(&entry->timer); - lec_arp_put(priv); DPRINTK("After vcc was added\n"); dump_arp_table(priv); +out: + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); } void lec_flush_complete(struct lec_priv *priv, unsigned long tran_id) { + unsigned long flags; struct lec_arp_table *entry; int i; DPRINTK("LEC:lec_flush_complete %lx\n",tran_id); - for (i=0;ilec_arp_tables[i];entry;entry=entry->next) { + spin_lock_irqsave(&priv->lec_arp_lock, flags); + for (i = 0; i < LEC_ARP_TABLE_SIZE; i++) { + for (entry = priv->lec_arp_tables[i]; entry; entry=entry->next) { if (entry->flush_tran_id == tran_id && entry->status == ESI_FLUSH_PENDING) { struct sk_buff *skb; @@ -2344,6 +2334,7 @@ } } } + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); dump_arp_table(priv); } @@ -2351,24 +2342,29 @@ lec_set_flush_tran_id(struct lec_priv *priv, unsigned char *atm_addr, unsigned long tran_id) { + unsigned long flags; struct lec_arp_table *entry; int i; - for (i=0;ilec_arp_tables[i];entry;entry=entry->next) + spin_lock_irqsave(&priv->lec_arp_lock, flags); + for (i = 0; i < LEC_ARP_TABLE_SIZE; i++) + for(entry = priv->lec_arp_tables[i]; entry; entry=entry->next) if (!memcmp(atm_addr, entry->atm_addr, ATM_ESA_LEN)) { entry->flush_tran_id = tran_id; DPRINTK("Set flush transaction id to %lx for %p\n",tran_id,entry); } + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); } int lec_mcast_make(struct lec_priv *priv, struct atm_vcc *vcc) { + unsigned long flags; unsigned char mac_addr[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; struct lec_arp_table *to_add; struct lec_vcc_priv *vpriv; + int err = 0; if (!(vpriv = kmalloc(sizeof(struct lec_vcc_priv), GFP_KERNEL))) return -ENOMEM; @@ -2376,13 +2372,13 @@ vpriv->old_pop = vcc->pop; vcc->user_back = vpriv; vcc->pop = lec_pop; - lec_arp_get(priv); + spin_lock_irqsave(&priv->lec_arp_lock, flags); to_add = make_entry(priv, mac_addr); if (!to_add) { - lec_arp_put(priv); vcc->pop = vpriv->old_pop; kfree(vpriv); - return -ENOMEM; + err = -ENOMEM; + goto out; } memcpy(to_add->atm_addr, vcc->remote.sas_addr.prv, ATM_ESA_LEN); to_add->status = ESI_FORWARD_DIRECT; @@ -2392,19 +2388,21 @@ vcc->push = lec_push; priv->mcast_vcc = vcc; lec_arp_add(priv, to_add); - lec_arp_put(priv); - return 0; +out: + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); + return err; } void lec_vcc_close(struct lec_priv *priv, struct atm_vcc *vcc) { + unsigned long flags; struct lec_arp_table *entry, *next; int i; DPRINTK("LEC_ARP: lec_vcc_close vpi:%d vci:%d\n",vcc->vpi,vcc->vci); dump_arp_table(priv); - lec_arp_get(priv); + spin_lock_irqsave(&priv->lec_arp_lock, flags); for(i=0;ilec_arp_tables[i];entry; entry=next) { next = entry->next; @@ -2466,7 +2464,7 @@ entry = next; } - lec_arp_put(priv); + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); dump_arp_table(priv); } @@ -2486,26 +2484,22 @@ #endif src = hdr->h_source; - lec_arp_get(priv); + spin_lock_irqsave(&priv->lec_arp_lock, flags); entry = priv->lec_arp_empty_ones; if (vcc == entry->vcc) { - spin_lock_irqsave(&priv->lec_arp_lock, flags); del_timer(&entry->timer); memcpy(entry->mac_addr, src, ETH_ALEN); entry->status = ESI_FORWARD_DIRECT; entry->last_used = jiffies; priv->lec_arp_empty_ones = entry->next; - spin_unlock_irqrestore(&priv->lec_arp_lock, flags); /* We might have got an entry */ - if ((prev=lec_arp_find(priv,src))) { + if ((prev = lec_arp_find(priv,src))) { lec_arp_remove(priv, prev); kfree(prev); } lec_arp_add(priv, entry); - lec_arp_put(priv); - return; + goto out; } - spin_lock_irqsave(&priv->lec_arp_lock, flags); prev = entry; entry = entry->next; while (entry && entry->vcc != vcc) { @@ -2514,21 +2508,19 @@ } if (!entry) { DPRINTK("LEC_ARP: Arp_check_empties: entry not found!\n"); - lec_arp_put(priv); - spin_unlock_irqrestore(&priv->lec_arp_lock, flags); - return; + goto out; } del_timer(&entry->timer); memcpy(entry->mac_addr, src, ETH_ALEN); entry->status = ESI_FORWARD_DIRECT; entry->last_used = jiffies; prev->next = entry->next; - spin_unlock_irqrestore(&priv->lec_arp_lock, flags); if ((prev = lec_arp_find(priv, src))) { lec_arp_remove(priv, prev); kfree(prev); } lec_arp_add(priv, entry); - lec_arp_put(priv); +out: + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); } MODULE_LICENSE("GPL"); diff -Nru a/net/atm/lec.h b/net/atm/lec.h --- a/net/atm/lec.h 2005-01-14 08:42:30 -05:00 +++ b/net/atm/lec.h 2005-01-14 08:42:30 -05:00 @@ -95,7 +95,6 @@ establishes multiple Multicast Forward VCCs to us. This list collects all those VCCs. LANEv1 client has only one item in this list. These entries are not aged out. */ - atomic_t lec_arp_users; spinlock_t lec_arp_lock; struct atm_vcc *mcast_vcc; /* Default Multicast Send VCC */ struct atm_vcc *lecd; From chas@cmf.nrl.navy.mil Tue Jan 18 11:07:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 11:07:15 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IJ78UI012965 for ; Tue, 18 Jan 2005 11:07:08 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.11/8.12.11) with ESMTP id j0IJ72Du022318; Tue, 18 Jan 2005 14:07:02 -0500 (EST) Message-Id: <200501181907.j0IJ72Du022318@ginger.cmf.nrl.navy.mil> To: netdev@oss.sgi.com Cc: davem@redhat.com Subject: [PATCH][3 of 7][ATM]: [he] remove dead code and unneeded zero initializers Date: Tue, 18 Jan 2005 14:07:02 -0500 From: "chas williams - CONTRACTOR" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-Virus-Status: Clean X-archive-position: 447 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev please apply to 2.6. thanks! # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/06 13:31:00-05:00 chas@relax.cmf.nrl.navy.mil # [ATM]: [he] remove dead code and unneeded zero initializers # # Signed-off-by: Marcel Sebek # Signed-off-by: Domen Puncer # Signed-off-by: Chas Williams # # drivers/atm/he.c # 2005/01/06 13:30:43-05:00 chas@relax.cmf.nrl.navy.mil +6 -31 # [ATM]: [he] remove dead code and unneeded zero initializers # # Signed-off-by: Marcel Sebek # Signed-off-by: Domen Puncer # Signed-off-by: Chas Williams # diff -Nru a/drivers/atm/he.c b/drivers/atm/he.c --- a/drivers/atm/he.c 2005-01-14 08:42:49 -05:00 +++ b/drivers/atm/he.c 2005-01-14 08:42:49 -05:00 @@ -86,44 +86,19 @@ #undef USE_RBPL_POOL /* if memory is tight try this */ #define USE_TPD_POOL /* #undef CONFIG_ATM_HE_USE_SUNI */ - -/* compatibility */ - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69) -typedef void irqreturn_t; -#define IRQ_NONE -#define IRQ_HANDLED -#define IRQ_RETVAL(x) -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,9) -#define __devexit_p(func) func -#endif - -#ifndef MODULE_LICENSE -#define MODULE_LICENSE(x) -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,3) -#define pci_set_drvdata(pci_dev, data) (pci_dev)->driver_data = (data) -#define pci_get_drvdata(pci_dev) (pci_dev)->driver_data -#endif +/* #undef HE_DEBUG */ #include "he.h" - #include "suni.h" - #include #define hprintk(fmt,args...) printk(KERN_ERR DEV_LABEL "%d: " fmt, he_dev->number , ##args) -#undef DEBUG -#ifdef DEBUG +#ifdef HE_DEBUG #define HPRINTK(fmt,args...) printk(KERN_DEBUG DEV_LABEL "%d: " fmt, he_dev->number , ##args) -#else +#else /* !HE_DEBUG */ #define HPRINTK(fmt,args...) do { } while (0) -#endif /* DEBUG */ - +#endif /* HE_DEBUG */ /* version definition */ @@ -147,8 +122,8 @@ /* globals */ -static struct he_dev *he_devs = NULL; -static int disable64 = 0; +static struct he_dev *he_devs; +static int disable64; static short nvpibits = -1; static short nvcibits = -1; static short rx_skb_reserve = 16; From chas@cmf.nrl.navy.mil Tue Jan 18 11:08:24 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 11:08:28 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IJ8OV2013587 for ; Tue, 18 Jan 2005 11:08:24 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.11/8.12.11) with ESMTP id j0IJ8Efe022365; Tue, 18 Jan 2005 14:08:14 -0500 (EST) Message-Id: <200501181908.j0IJ8Efe022365@ginger.cmf.nrl.navy.mil> To: netdev@oss.sgi.com Cc: davem@redhat.com Subject: [PATCH][4 of 7][ATM]: change atm address functions to use list_add Date: Tue, 18 Jan 2005 14:08:14 -0500 From: "chas williams - CONTRACTOR" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-Virus-Status: Clean X-archive-position: 448 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev please apply to 2.6. thanks! # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/07 15:04:51-05:00 chas@relax.cmf.nrl.navy.mil # [ATM]: change atm address functions to use list_add # # Signed-off-by: Chas Williams # # net/atm/resources.c # 2005/01/07 15:04:34-05:00 chas@relax.cmf.nrl.navy.mil +1 -0 # [ATM]: change atm address functions to use list_add # # Signed-off-by: Chas Williams # # net/atm/addr.c # 2005/01/07 15:04:33-05:00 chas@relax.cmf.nrl.navy.mil +43 -50 # [ATM]: change atm address functions to use list_add # # Signed-off-by: Chas Williams # # include/linux/atmdev.h # 2005/01/07 15:04:33-05:00 chas@relax.cmf.nrl.navy.mil +2 -2 # [ATM]: change atm address functions to use list_add # # Signed-off-by: Chas Williams # diff -Nru a/include/linux/atmdev.h b/include/linux/atmdev.h --- a/include/linux/atmdev.h 2005-01-14 08:43:06 -05:00 +++ b/include/linux/atmdev.h 2005-01-14 08:43:06 -05:00 @@ -313,7 +313,7 @@ struct atm_dev_addr { struct sockaddr_atmsvc addr; /* ATM address */ - struct atm_dev_addr *next; /* next address */ + struct list_head entry; /* next address */ }; struct atm_dev { @@ -325,7 +325,7 @@ void *dev_data; /* per-device data */ void *phy_data; /* private PHY date */ unsigned long flags; /* device flags (ATM_DF_*) */ - struct atm_dev_addr *local; /* local ATM addresses */ + struct list_head local; /* local ATM addresses */ unsigned char esi[ESI_LEN]; /* ESI ("MAC" addr) */ struct atm_cirange ci_range; /* VPI/VCI range */ struct k_atm_dev_stats stats; /* statistics */ diff -Nru a/net/atm/addr.c b/net/atm/addr.c --- a/net/atm/addr.c 2005-01-14 08:43:06 -05:00 +++ b/net/atm/addr.c 2005-01-14 08:43:06 -05:00 @@ -2,7 +2,6 @@ /* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ - #include #include #include @@ -11,127 +10,121 @@ #include "signaling.h" #include "addr.h" - static int check_addr(struct sockaddr_atmsvc *addr) { int i; - if (addr->sas_family != AF_ATMSVC) return -EAFNOSUPPORT; + if (addr->sas_family != AF_ATMSVC) + return -EAFNOSUPPORT; if (!*addr->sas_addr.pub) return *addr->sas_addr.prv ? 0 : -EINVAL; - for (i = 1; i < ATM_E164_LEN+1; i++) /* make sure it's \0-terminated */ - if (!addr->sas_addr.pub[i]) return 0; + for (i = 1; i < ATM_E164_LEN + 1; i++) /* make sure it's \0-terminated */ + if (!addr->sas_addr.pub[i]) + return 0; return -EINVAL; } - -static int identical(struct sockaddr_atmsvc *a,struct sockaddr_atmsvc *b) +static int identical(struct sockaddr_atmsvc *a, struct sockaddr_atmsvc *b) { if (*a->sas_addr.prv) - if (memcmp(a->sas_addr.prv,b->sas_addr.prv,ATM_ESA_LEN)) + if (memcmp(a->sas_addr.prv, b->sas_addr.prv, ATM_ESA_LEN)) return 0; - if (!*a->sas_addr.pub) return !*b->sas_addr.pub; - if (!*b->sas_addr.pub) return 0; - return !strcmp(a->sas_addr.pub,b->sas_addr.pub); + if (!*a->sas_addr.pub) + return !*b->sas_addr.pub; + if (!*b->sas_addr.pub) + return 0; + return !strcmp(a->sas_addr.pub, b->sas_addr.pub); } - static void notify_sigd(struct atm_dev *dev) { struct sockaddr_atmpvc pvc; pvc.sap_addr.itf = dev->number; - sigd_enq(NULL,as_itf_notify,NULL,&pvc,NULL); + sigd_enq(NULL, as_itf_notify, NULL, &pvc, NULL); } - void atm_reset_addr(struct atm_dev *dev) { unsigned long flags; - struct atm_dev_addr *this; + struct atm_dev_addr *this, *p; spin_lock_irqsave(&dev->lock, flags); - while (dev->local) { - this = dev->local; - dev->local = this->next; - kfree(this); - } + list_for_each_entry_safe(this, p, &dev->local, entry) + kfree(this); spin_unlock_irqrestore(&dev->lock, flags); notify_sigd(dev); } - -int atm_add_addr(struct atm_dev *dev,struct sockaddr_atmsvc *addr) +int atm_add_addr(struct atm_dev *dev, struct sockaddr_atmsvc *addr) { unsigned long flags; - struct atm_dev_addr **walk; + struct atm_dev_addr *this; int error; error = check_addr(addr); if (error) return error; spin_lock_irqsave(&dev->lock, flags); - for (walk = &dev->local; *walk; walk = &(*walk)->next) - if (identical(&(*walk)->addr,addr)) { + list_for_each_entry(this, &dev->local, entry) { + if (identical(&this->addr, addr)) { spin_unlock_irqrestore(&dev->lock, flags); return -EEXIST; } - *walk = kmalloc(sizeof(struct atm_dev_addr), GFP_ATOMIC); - if (!*walk) { + } + this = kmalloc(sizeof(struct atm_dev_addr), GFP_ATOMIC); + if (!this) { spin_unlock_irqrestore(&dev->lock, flags); return -ENOMEM; } - (*walk)->addr = *addr; - (*walk)->next = NULL; + this->addr = *addr; + list_add(&this->entry, &dev->local); spin_unlock_irqrestore(&dev->lock, flags); notify_sigd(dev); return 0; } - -int atm_del_addr(struct atm_dev *dev,struct sockaddr_atmsvc *addr) +int atm_del_addr(struct atm_dev *dev, struct sockaddr_atmsvc *addr) { unsigned long flags; - struct atm_dev_addr **walk,*this; + struct atm_dev_addr *this; int error; error = check_addr(addr); if (error) return error; spin_lock_irqsave(&dev->lock, flags); - for (walk = &dev->local; *walk; walk = &(*walk)->next) - if (identical(&(*walk)->addr,addr)) break; - if (!*walk) { - spin_unlock_irqrestore(&dev->lock, flags); - return -ENOENT; + list_for_each_entry(this, &dev->local, entry) { + if (identical(&this->addr, addr)) { + list_del(&this->entry); + spin_unlock_irqrestore(&dev->lock, flags); + kfree(this); + notify_sigd(dev); + return 0; + } } - this = *walk; - *walk = this->next; - kfree(this); spin_unlock_irqrestore(&dev->lock, flags); - notify_sigd(dev); - return 0; + return -ENOENT; } - -int atm_get_addr(struct atm_dev *dev,struct sockaddr_atmsvc __user *buf,int size) +int atm_get_addr(struct atm_dev *dev, struct sockaddr_atmsvc __user * buf, + int size) { unsigned long flags; - struct atm_dev_addr *walk; + struct atm_dev_addr *this; int total = 0, error; struct sockaddr_atmsvc *tmp_buf, *tmp_bufp; - spin_lock_irqsave(&dev->lock, flags); - for (walk = dev->local; walk; walk = walk->next) - total += sizeof(struct sockaddr_atmsvc); + list_for_each_entry(this, &dev->local, entry) + total += sizeof(struct sockaddr_atmsvc); tmp_buf = tmp_bufp = kmalloc(total, GFP_ATOMIC); if (!tmp_buf) { spin_unlock_irqrestore(&dev->lock, flags); return -ENOMEM; } - for (walk = dev->local; walk; walk = walk->next) - memcpy(tmp_bufp++, &walk->addr, sizeof(struct sockaddr_atmsvc)); + list_for_each_entry(this, &dev->local, entry) + memcpy(tmp_bufp++, &this->addr, sizeof(struct sockaddr_atmsvc)); spin_unlock_irqrestore(&dev->lock, flags); error = total > size ? -E2BIG : total; if (copy_to_user(buf, tmp_buf, total < size ? total : size)) diff -Nru a/net/atm/resources.c b/net/atm/resources.c --- a/net/atm/resources.c 2005-01-14 08:43:06 -05:00 +++ b/net/atm/resources.c 2005-01-14 08:43:06 -05:00 @@ -38,6 +38,7 @@ dev->signal = ATM_PHY_SIG_UNKNOWN; dev->link_rate = ATM_OC3_PCR; spin_lock_init(&dev->lock); + INIT_LIST_HEAD(&dev->local); return dev; } From chas@cmf.nrl.navy.mil Tue Jan 18 11:09:27 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 11:09:31 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IJ9Qt2014056 for ; Tue, 18 Jan 2005 11:09:26 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.11/8.12.11) with ESMTP id j0IJ9KO8022381; Tue, 18 Jan 2005 14:09:20 -0500 (EST) Message-Id: <200501181909.j0IJ9KO8022381@ginger.cmf.nrl.navy.mil> To: netdev@oss.sgi.com Cc: davem@redhat.com Subject: [PATCH][5 of 7][ATM]: avoid race between svc_disconnect and sigd exiting Date: Tue, 18 Jan 2005 14:09:20 -0500 From: "chas williams - CONTRACTOR" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-Virus-Status: Clean X-archive-position: 449 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev please apply to 2.6. thanks! # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/14 08:47:48-05:00 chas@relax.cmf.nrl.navy.mil # [ATM]: avoid race between svc_disconnect and sigd exiting # # Signed-off-by: Chas Williams # # net/atm/svc.c # 2005/01/14 08:47:31-05:00 chas@relax.cmf.nrl.navy.mil +4 -7 # [ATM]: avoid race between svc_disconnect and sigd exiting # # Signed-off-by: Chas Williams # diff -Nru a/net/atm/svc.c b/net/atm/svc.c --- a/net/atm/svc.c 2005-01-14 08:49:39 -05:00 +++ b/net/atm/svc.c 2005-01-14 08:49:39 -05:00 @@ -71,9 +71,7 @@ sigd_enq2(NULL,as_reject,vcc,NULL,NULL,&vcc->qos,0); dev_kfree_skb(skb); } - clear_bit(ATM_VF_REGIS,&vcc->flags); - clear_bit(ATM_VF_RELEASED,&vcc->flags); - clear_bit(ATM_VF_CLOSE,&vcc->flags); + clear_bit(ATM_VF_REGIS, &vcc->flags); /* ... may retry later */ } @@ -90,10 +88,8 @@ /* VCC pointer is used as a reference, so we must not free it (thereby subjecting it to re-use) before all pending connections are closed */ - sock_hold(sk); - vcc_release(sock); svc_disconnect(vcc); - sock_put(sk); + vcc_release(sock); } return 0; } @@ -286,7 +282,8 @@ */ if (!(error = vcc_connect(sock, vcc->itf, vcc->vpi, vcc->vci))) sock->state = SS_CONNECTED; - else (void) svc_disconnect(vcc); + else + (void) svc_disconnect(vcc); out: release_sock(sk); return error; From chas@cmf.nrl.navy.mil Tue Jan 18 11:09:59 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 11:10:04 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IJ9wGk014244 for ; Tue, 18 Jan 2005 11:09:59 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.11/8.12.11) with ESMTP id j0IJ9q4n022396; Tue, 18 Jan 2005 14:09:52 -0500 (EST) Message-Id: <200501181909.j0IJ9q4n022396@ginger.cmf.nrl.navy.mil> To: netdev@oss.sgi.com Cc: davem@redhat.com Subject: [PATCH][6 of 7][ATM]: [ambassador] use msleep() instead of schedule_timeout() Date: Tue, 18 Jan 2005 14:09:52 -0500 From: "chas williams - CONTRACTOR" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-Virus-Status: Clean X-archive-position: 450 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev please apply to 2.6. thanks! # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/14 08:54:21-05:00 chas@relax.cmf.nrl.navy.mil # [ATM]: [ambassador] use msleep() instead of schedule_timeout() # # Signed-off-by: Nishanth Aravamudan # Signed-off-by: Domen Puncer # Signed-off-by: Chas Williams # # drivers/atm/ambassador.c # 2005/01/14 08:54:02-05:00 chas@relax.cmf.nrl.navy.mil +14 -29 # [ATM]: [ambassador] use msleep() instead of schedule_timeout() # # Signed-off-by: Nishanth Aravamudan # Signed-off-by: Domen Puncer # Signed-off-by: Chas Williams # diff -Nru a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c --- a/drivers/atm/ambassador.c 2005-01-14 09:02:07 -05:00 +++ b/drivers/atm/ambassador.c 2005-01-14 09:02:07 -05:00 @@ -574,7 +574,6 @@ amb_cq * cq = &dev->cq; volatile amb_cq_ptrs * ptrs = &cq->ptrs; command * my_slot; - unsigned long timeout; PRINTD (DBG_FLOW|DBG_CMD, "command_do %p", dev); @@ -599,20 +598,14 @@ // mail the command wr_mem (dev, offsetof(amb_mem, mb.adapter.cmd_address), virt_to_bus (ptrs->in)); - // prepare to wait for cq->pending milliseconds - // effectively one centisecond on i386 - timeout = (cq->pending*HZ+999)/1000; - if (cq->pending > cq->high) cq->high = cq->pending; spin_unlock (&cq->lock); - while (timeout) { - // go to sleep - // PRINTD (DBG_CMD, "wait: sleeping %lu for command", timeout); - set_current_state(TASK_UNINTERRUPTIBLE); - timeout = schedule_timeout (timeout); - } + // these comments were in a while-loop before, msleep removes the loop + // go to sleep + // PRINTD (DBG_CMD, "wait: sleeping %lu for command", timeout); + msleep(cq->pending); // wait for my slot to be reached (all waiters are here or above, until...) while (ptrs->out != my_slot) { @@ -1799,12 +1792,11 @@ // dump_loader_block (lb); wr_mem (dev, offsetof(amb_mem, doorbell), virt_to_bus (lb) & ~onegigmask); - timeout = command_timeouts[cmd] * HZ/100; + timeout = command_timeouts[cmd] * 10; while (!lb->result || lb->result == cpu_to_be32 (COMMAND_IN_PROGRESS)) if (timeout) { - set_current_state(TASK_UNINTERRUPTIBLE); - timeout = schedule_timeout (timeout); + timeout = msleep_interruptible(timeout); } else { PRINTD (DBG_LOAD|DBG_ERR, "command %d timed out", cmd); dump_registers (dev); @@ -1814,10 +1806,10 @@ if (cmd == adapter_start) { // wait for start command to acknowledge... - timeout = HZ/10; + timeout = 100; while (rd_plain (dev, offsetof(amb_mem, doorbell))) if (timeout) { - timeout = schedule_timeout (timeout); + timeout = msleep_interruptible(timeout); } else { PRINTD (DBG_LOAD|DBG_ERR, "start command did not clear doorbell, res=%08x", be32_to_cpu (lb->result)); @@ -1932,17 +1924,12 @@ if (diags) { unsigned long timeout; // 4.2 second wait - timeout = HZ*42/10; - while (timeout) { - set_current_state(TASK_UNINTERRUPTIBLE); - timeout = schedule_timeout (timeout); - } + msleep(4200); // half second time-out - timeout = HZ/2; + timeout = 500; while (!rd_plain (dev, offsetof(amb_mem, mb.loader.ready))) if (timeout) { - set_current_state(TASK_UNINTERRUPTIBLE); - timeout = schedule_timeout (timeout); + timeout = msleep_interruptible(timeout); } else { PRINTD (DBG_LOAD|DBG_ERR, "reset timed out"); return -ETIMEDOUT; @@ -2056,14 +2043,12 @@ wr_mem (dev, offsetof(amb_mem, doorbell), virt_to_bus (&a)); // 2.2 second wait (must not touch doorbell during 2 second DMA test) - timeout = HZ*22/10; - while (timeout) - timeout = schedule_timeout (timeout); + msleep(2200); // give the adapter another half second? - timeout = HZ/2; + timeout = 500; while (rd_plain (dev, offsetof(amb_mem, doorbell))) if (timeout) { - timeout = schedule_timeout (timeout); + timeout = msleep_interruptible(timeout); } else { PRINTD (DBG_INIT|DBG_ERR, "adapter init timed out"); return -ETIMEDOUT; From chas@cmf.nrl.navy.mil Tue Jan 18 11:10:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 11:10:30 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IJAP72014673 for ; Tue, 18 Jan 2005 11:10:25 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.11/8.12.11) with ESMTP id j0IJAJi5022407; Tue, 18 Jan 2005 14:10:19 -0500 (EST) Message-Id: <200501181910.j0IJAJi5022407@ginger.cmf.nrl.navy.mil> To: netdev@oss.sgi.com Cc: davem@redhat.com Subject: [PATCH] [ATM]: [idt77252] vfree() checking cleanups [ATM]: [idt77252] vfree() checking cleanups Date: Tue, 18 Jan 2005 14:10:19 -0500 From: "chas williams - CONTRACTOR" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-Virus-Status: Clean X-archive-position: 451 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev please apply to 2.6. thanks! # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/14 08:57:04-05:00 chas@relax.cmf.nrl.navy.mil # [ATM]: [idt77252] vfree() checking cleanups # # Signed-off by: James Lamanna # Signed-off-by: Domen Puncer # Signed-off-by: Chas Williams # # drivers/atm/idt77252.c # 2005/01/14 08:56:46-05:00 chas@relax.cmf.nrl.navy.mil +3 -6 # [ATM]: [idt77252] vfree() checking cleanups # # Signed-off by: James Lamanna # Signed-off-by: Domen Puncer # Signed-off-by: Chas Williams # diff -Nru a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c --- a/drivers/atm/idt77252.c 2005-01-14 09:02:26 -05:00 +++ b/drivers/atm/idt77252.c 2005-01-14 09:02:26 -05:00 @@ -3136,14 +3136,11 @@ } } - if (card->soft_tst) - vfree(card->soft_tst); + vfree(card->soft_tst); - if (card->scd2vc) - vfree(card->scd2vc); + vfree(card->scd2vc); - if (card->vcs) - vfree(card->vcs); + vfree(card->vcs); if (card->raw_cell_hnd) { pci_free_consistent(card->pcidev, 2 * sizeof(u32), From davem@davemloft.net Tue Jan 18 12:42:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 12:42:47 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IKgg8C020858 for ; Tue, 18 Jan 2005 12:42:42 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cr078-0001Ll-00; Tue, 18 Jan 2005 12:38:10 -0800 Date: Tue, 18 Jan 2005 12:38:09 -0800 From: "David S. Miller" To: Adrian Bunk Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [2.6 patch] unexport xfrm_policy_delete Message-Id: <20050118123809.3a051164.davem@davemloft.net> In-Reply-To: <20050118102932.GD4274@stusta.de> References: <20050118102932.GD4274@stusta.de> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 453 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Tue, 18 Jan 2005 11:29:32 +0100 Adrian Bunk wrote: > I haven't found any way how xfrm_policy_delete could be called from > modular code in 2.6.11-rc1-mm1. > > Unless I'm wrong or a patch for a modular usage is pending, I'm > therefore suggesting this patch for removing the EXPORT_SYMBOL. Looks good to me, applied. Thanks Adrian. From davem@davemloft.net Tue Jan 18 12:42:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 12:42:37 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IKgURI020831 for ; Tue, 18 Jan 2005 12:42:31 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cr09t-0001Mp-00; Tue, 18 Jan 2005 12:41:01 -0800 Date: Tue, 18 Jan 2005 12:41:00 -0800 From: "David S. Miller" To: Dave Peterson Cc: Robert.Olsson@data.slu.se, robert.olsson@its.uu.se, netdev@oss.sgi.com Subject: Re: possible bug in net/core/pktgen.c (2.6.10 kernel) Message-Id: <20050118124100.17b7f47a.davem@davemloft.net> In-Reply-To: <200501180935.25419.dsp@llnl.gov> References: <200501141129.21461.dsp@llnl.gov> <16874.25146.335366.990655@robur.slu.se> <200501180935.25419.dsp@llnl.gov> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 452 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Tue, 18 Jan 2005 09:35:25 -0800 Dave Peterson wrote: > On Sunday 16 January 2005 04:46 am, Robert Olsson wrote: > > Dave Peterson writes: > > > I found a piece of code that looks problematic in the 2.6.10 kernel. > > > The following code appears starting on line 746 in function inject() > > > of net/core/pktgen.c: > > > schedule(); > > > else > > > do_softirq(); > > > > Thanks! > > So it should be? > > Cool! Looks like a fix to me. I'm still a little bit confused on this one. Since when does do_softirq() need preemption disabled around calls to it? do_softirq() disabled hard IRQs during the duration of it's execution, thus effectively disabling preemption. What is the problematic case again? From davem@davemloft.net Tue Jan 18 13:00:50 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 13:00:55 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IL0nmq022240 for ; Tue, 18 Jan 2005 13:00:50 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cr0Rl-0001Qp-00; Tue, 18 Jan 2005 12:59:29 -0800 Date: Tue, 18 Jan 2005 12:59:29 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: netdev@oss.sgi.com Subject: Re: [BK PATCH] sk_dst_cache annotation Message-Id: <20050118125929.6868bd60.davem@davemloft.net> In-Reply-To: <20050118.114034.89476074.yoshfuji@linux-ipv6.org> References: <20050115.160008.04476889.yoshfuji@linux-ipv6.org> <20050117124913.49c253b6.davem@davemloft.net> <20050118.114034.89476074.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j0IL0nmq022240 X-archive-position: 455 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Tue, 18 Jan 2005 11:40:34 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > Let me clarify: > if all the code paths (for each socket type) lock socket, > we don't need sk_dst_lock at all (for that socket type). > otherwise, we have races; we need sk_dst_lock (for that socket type). > > Am I corrent? That's correct. From davem@davemloft.net Tue Jan 18 13:00:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 13:00:32 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0IL0PLP022149 for ; Tue, 18 Jan 2005 13:00:26 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cr0R9-0001Qd-00; Tue, 18 Jan 2005 12:58:51 -0800 Date: Tue, 18 Jan 2005 12:58:51 -0800 From: "David S. Miller" To: Arnaldo Carvalho de Melo Cc: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [IPV6] merge raw6_opt with raw6_sock Message-Id: <20050118125851.14857b71.davem@davemloft.net> In-Reply-To: <41EC66B8.9080907@conectiva.com.br> References: <41EC66B8.9080907@conectiva.com.br> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 454 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Mon, 17 Jan 2005 23:30:32 -0200 Arnaldo Carvalho de Melo wrote: > This finishes the inet protos part, now to the legacy protocols. > > Available at the usual place: > > bk://kernel.bkbits.net/acme/connection_sock-2.6 Pulled, thanks Arnaldo. From greearb@candelatech.com Tue Jan 18 13:18:18 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 13:18:23 -0800 (PST) Received: from www.lanforge.com (ns1.lanforge.com [66.165.47.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ILIH06024020 for ; Tue, 18 Jan 2005 13:18:18 -0800 Received: from [4.33.45.22] (evrtwa1-ar2-4-33-045-022.evrtwa1.dsl-verizon.net [4.33.45.22]) (authenticated bits=0) by www.lanforge.com (8.12.8/8.12.8) with ESMTP id j0ILZYLH022291; Tue, 18 Jan 2005 13:35:34 -0800 Message-ID: <41ED7D18.30506@candelatech.com> Date: Tue, 18 Jan 2005 13:18:16 -0800 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041020 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com CC: "David S. Miller" Subject: Re: An interface goes away while a socket is bound to it..what happens? References: <41EC825B.4030603@candelatech.com> <20050117193945.3d3b1860.davem@davemloft.net> <41ECB05B.8060207@candelatech.com> In-Reply-To: <41ECB05B.8060207@candelatech.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 456 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Ben Greear wrote: > David S. Miller wrote: > >> On Mon, 17 Jan 2005 19:28:27 -0800 >> Ben Greear wrote: >> >> >>> The interesting part to me is that I do not appearantly see any errors >>> while continuing to send UDP packets on the socket that was bound to the >>> original ppp0 interface, and yet no packets are ever routed over the new >>> ppp0 interface. I would expect it to either fail the write, or to just >>> magically keep working. >> >> >> >> If you have bound to the local IP address, when your T1 goes down >> that local IP address should no longer be assosciated with the >> system even when the PPP interface comes back up, so what should >> happen is that the route lookup in udp_sendmsg() will fail and sendmsg() >> will return with that error code. > > > Well, the new interface will come back with the same name, and same IP. > > Also, I bind to the local interface with BIND_TO_DEVICE. I can imagine > how that might confuse things... > > I will do some double-checking to make sure I'm not missing an error > code on the sendmsg call... I've done some more checking. The call to sendto is returning the number of bytes I tried to write, ie no errors. The (new) ppp0 interface is showing no increase in tx or rx packets. I groped the kernel, and and so far my conjecture of how things are working is this: When I BINDTODEVICE, the kernel socket struct saves the interface id. It uses this for it's routing tricks from here on out. When the old ppp0 device goes away, and the new one comes back, the device-index is different. This means, as far as I can tell, that udp_sendmsg should return -ENODEV. What it actually seems to do is to start generating traffic out of eth0 (which holds the default route). I guess one could argue that if the bound-to device does not actually exist, then we might as well send the packet to the default gateway. But, that could also be considered a security risk if indeed you are using BINDTODEVICE to make sure traffic goes out a specific interface... Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From housley@vigilsec.com Tue Jan 18 13:19:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 13:19:42 -0800 (PST) Received: from woodstock.binhost.com (woodstock.binhost.com [144.202.240.3] (may be forged)) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0ILJYjG024407 for ; Tue, 18 Jan 2005 13:19:35 -0800 Received: (qmail 21533 invoked by uid 0); 18 Jan 2005 16:57:35 -0000 Received: from unknown (HELO Russ-Laptop.vigilsec.com) (67.131.226.2) by woodstock.binhost.com with SMTP; 18 Jan 2005 16:57:35 -0000 Message-Id: <6.2.0.14.2.20050118115647.05617eb0@mail.binhost.com> X-Mailer: QUALCOMM Windows Eudora Version 6.2.0.14 Date: Tue, 18 Jan 2005 11:57:28 -0500 To: "Hollenbeck, Scott" , "'Lennert Buytenhek'" , "'jamal'" From: Russ Housley Subject: RE: tunneling in linux (was: Re: [PATCH][RFC] etherip: Ethernet-i n-IPv4 tunneling) Cc: "'netdev@oss.sgi.com'" , "'Pekka Savola'" , "'shemminger@osdl.org'" In-Reply-To: <046F43A8D79C794FA4733814869CDF07057840@dul1wnexmb01.vcorp. ad.vrsn.com> References: <046F43A8D79C794FA4733814869CDF07057840@dul1wnexmb01.vcorp.ad.vrsn.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 457 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: housley@vigilsec.com Precedence: bulk X-list: netdev The protocol is also used in one of the BSD distributions as part of a VPN tunnelling solution. Russ At 07:54 AM 1/18/2005, Hollenbeck, Scott wrote: > > > BTW, in one of your emails i > > > noticed you cced the authors of that RFC - did they > > respond? Whats their > > > deployment experiences? > > > > The @rsa.. address bounces, the other address is still in the CC list > > and I didn't hear from him yet :-) > >The correct current address for Russ is housley@vigilsec.com. I've cc'd him >here. > >So what do you want to hear? As the RFC says, etherIP documents work that >Russ and I did at Xerox during the early 1990s. It was developed and >deployed for use in conjunction with the Xerox Encryption Unit (XEU), a >layer 2 (Ethernet/802.3) network encryption device. As the XEU was never a >big seller etherIP never really got "out there", either, but it certainly >worked in the environment for which it was intended. > >-Scott- From davem@davemloft.net Tue Jan 18 13:24:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 13:24:54 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ILOnts025054 for ; Tue, 18 Jan 2005 13:24:49 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cr0oy-0001WZ-00; Tue, 18 Jan 2005 13:23:28 -0800 Date: Tue, 18 Jan 2005 13:23:28 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: netdev@oss.sgi.com Subject: Re: [PATCH] [IPV6]: Ensure to learn link-layer address from RA. Message-Id: <20050118132328.07cd3cab.davem@davemloft.net> In-Reply-To: <20050118.223718.112287192.yoshfuji@linux-ipv6.org> References: <20050118.223718.112287192.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j0ILOnts025054 X-archive-position: 458 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Tue, 18 Jan 2005 22:37:18 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > Here's a patch to ensure to learn link-layer address from RA. > > Signed-off-by: Hideaki YOSHIFUJI Looks good, applied. Thanks. From davem@davemloft.net Tue Jan 18 13:28:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 13:28:32 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ILSSLs025579 for ; Tue, 18 Jan 2005 13:28:28 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cr0sW-0001XB-00; Tue, 18 Jan 2005 13:27:08 -0800 Date: Tue, 18 Jan 2005 13:27:07 -0800 From: "David S. Miller" To: Roland Dreier Cc: netdev@oss.sgi.com, ipoverib@ietf.org, openib-general@openib.org Subject: Re: [openib-general] [PATCH] IPv6: Add correct padding to IPoIB link addr option Message-Id: <20050118132707.01a99d6b.davem@davemloft.net> In-Reply-To: <524qheeig3.fsf@topspin.com> References: <528y6qej5w.fsf@topspin.com> <524qheeig3.fsf@topspin.com> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 459 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Applied, thanks Roland. From davem@davemloft.net Tue Jan 18 13:35:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 13:35:12 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ILZ8CH026296 for ; Tue, 18 Jan 2005 13:35:08 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cr0yq-0001ZY-00; Tue, 18 Jan 2005 13:33:40 -0800 Date: Tue, 18 Jan 2005 13:33:40 -0800 From: "David S. Miller" To: "chas williams - CONTRACTOR" Cc: netdev@oss.sgi.com, davem@redhat.com Subject: Re: [PATCH] [ATM]: [idt77252] vfree() checking cleanups [ATM]: [idt77252] vfree() checking cleanups Message-Id: <20050118133340.4ad58bc3.davem@davemloft.net> In-Reply-To: <200501181910.j0IJAJi5022407@ginger.cmf.nrl.navy.mil> References: <200501181910.j0IJAJi5022407@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 460 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev All 7 patches applied, thanks Chas. From dsp@llnl.gov Tue Jan 18 13:47:23 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 13:47:27 -0800 (PST) Received: from smtp-1.llnl.gov (smtp-1.llnl.gov [128.115.250.81]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ILlM4A027031 for ; Tue, 18 Jan 2005 13:47:23 -0800 Received: from hypatia.llnl.gov (localhost [127.0.0.1]) by smtp-1.llnl.gov (8.12.3p2-20030917/8.12.3/LLNL evision: 1.15 $) with ESMTP id j0ILkOFO000242; Tue, 18 Jan 2005 13:46:24 -0800 (PST) Received: from hypatia.llnl.gov (localhost.localdomain [127.0.0.1]) by hypatia.llnl.gov (8.12.11/8.12.10) with ESMTP id j0ILkOnL021820; Tue, 18 Jan 2005 13:46:24 -0800 Received: from localhost (localhost [[UNIX: localhost]]) by hypatia.llnl.gov (8.12.11/8.12.11/Submit) id j0ILkNcI021818; Tue, 18 Jan 2005 13:46:23 -0800 From: Dave Peterson To: "David S. Miller" Subject: Re: possible bug in net/core/pktgen.c (2.6.10 kernel) Date: Tue, 18 Jan 2005 13:46:22 -0800 User-Agent: KMail/1.5.3 Cc: Robert.Olsson@data.slu.se, robert.olsson@its.uu.se, netdev@oss.sgi.com References: <200501141129.21461.dsp@llnl.gov> <200501180935.25419.dsp@llnl.gov> <20050118124100.17b7f47a.davem@davemloft.net> In-Reply-To: <20050118124100.17b7f47a.davem@davemloft.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501181346.22905.dsp@llnl.gov> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 461 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dsp@llnl.gov Precedence: bulk X-list: netdev On Tuesday 18 January 2005 12:41 pm, David S. Miller wrote: > I'm still a little bit confused on this one. > > Since when does do_softirq() need preemption disabled > around calls to it? > > do_softirq() disabled hard IRQs during the duration of it's > execution, thus effectively disabling preemption. > > What is the problematic case again? Oops... My mistake. Looking at __do_softirq() I noticed that it enables interrupts before executing the softirqs. However I didn't notice that the call to local_bh_disable() in __do_softirq() disables preemption before interrupts are enabled. On second thought everything looks OK and no bug fix is needed. Dave From davem@davemloft.net Tue Jan 18 13:51:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 13:51:52 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ILpkmB027668 for ; Tue, 18 Jan 2005 13:51:47 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cr1Ex-0001db-00; Tue, 18 Jan 2005 13:50:19 -0800 Date: Tue, 18 Jan 2005 13:50:19 -0800 From: "David S. Miller" To: Dave Peterson Cc: Robert.Olsson@data.slu.se, robert.olsson@its.uu.se, netdev@oss.sgi.com Subject: Re: possible bug in net/core/pktgen.c (2.6.10 kernel) Message-Id: <20050118135019.068ff57a.davem@davemloft.net> In-Reply-To: <200501181346.22905.dsp@llnl.gov> References: <200501141129.21461.dsp@llnl.gov> <200501180935.25419.dsp@llnl.gov> <20050118124100.17b7f47a.davem@davemloft.net> <200501181346.22905.dsp@llnl.gov> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 462 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Tue, 18 Jan 2005 13:46:22 -0800 Dave Peterson wrote: > > Since when does do_softirq() need preemption disabled > > around calls to it? > > > > do_softirq() disabled hard IRQs during the duration of it's > > execution, thus effectively disabling preemption. > > > > What is the problematic case again? > > Oops... My mistake. Looking at __do_softirq() I noticed that it enables > interrupts before executing the softirqs. However I didn't notice that > the call to local_bh_disable() in __do_softirq() disables preemption > before interrupts are enabled. On second thought everything looks OK > and no bug fix is needed. Great, looks like things are OK then. From davem@davemloft.net Tue Jan 18 13:59:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 13:59:21 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ILxCRS028237 for ; Tue, 18 Jan 2005 13:59:15 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cr1Lz-0001fb-00; Tue, 18 Jan 2005 13:57:35 -0800 Date: Tue, 18 Jan 2005 13:57:35 -0800 From: "David S. Miller" To: Bart De Schuymer Cc: shemminger@osdl.org, dwmw2@infradead.org, ak@suse.de, snort2004@mail.ru, bridge@osdl.org, netdev@oss.sgi.com, rusty@rustcorp.com.au Subject: Re: do_IRQ: stack overflow: 872.. Message-Id: <20050118135735.4b77d38d.davem@davemloft.net> In-Reply-To: <1105133241.3375.16.camel@localhost.localdomain> References: <1131604877.20041218092730@mail.ru.suse.lists.linux.kernel> <1105117559.11753.34.camel@baythorne.infradead.org> <20050107100017.454ddadc@dxpl.pdx.osdl.net> <1105133241.3375.16.camel@localhost.localdomain> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 463 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Fri, 07 Jan 2005 22:27:21 +0100 Bart De Schuymer wrote: > How about something like the patch below (untested but compiles)? > The current netfilter scheme adds one function call to the call chain > for each NF_HOOK and NF_HOOK_THRESH. This can be prevented by executing > the okfn in the calling function instead of in nf_hook_slow(). > I didn't check if there's any code that actually uses the return value > from NF_HOOK. If so, this patch won't work well in its current form as - > EPERM is now also returned for NF_QUEUE and NF_STOLEN. > > Another 2 calls of okfn can be postponed in br_netfilter.c by adding > NF_STOP, which would work like NF_STOLEN except that okfn is still > called. But I'd first like to get the IPv4/IPv6 fix for br_netfilter.c > accepted (see another thread on netdev). I believe I put in your ipv4/ipv6 br_netfilter fix already. This NF_HOOK() change looks interesting. Could we also do something like running the deeper ->hard_start_xmit() via a triggered tasklet or something similar? From yoshfuji@linux-ipv6.org Tue Jan 18 16:19:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 16:19:47 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0J0Jgt5004045 for ; Tue, 18 Jan 2005 16:19:42 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id 902F033CC2; Wed, 19 Jan 2005 09:20:20 +0900 (JST) Date: Wed, 19 Jan 2005 09:20:18 +0900 (JST) Message-Id: <20050119.092018.07351674.yoshfuji@linux-ipv6.org> To: roland@topspin.com, davem@davemloft.net Cc: netdev@oss.sgi.com, ipoverib@ietf.org, openib-general@openib.org Subject: Re: [Ipoverib] [PATCH] IPv6: Add correct padding to IPoIB link addr option From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <528y6qej5w.fsf@topspin.com> References: <528y6qej5w.fsf@topspin.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 464 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev David, let me tkink about this. Thanks. In article <528y6qej5w.fsf@topspin.com> (at Tue, 18 Jan 2005 09:33:47 -0800), Roland Dreier says: > +++ linux-bk/net/ipv6/ndisc.c 2005-01-14 21:20:55.736745091 -0800 > @@ -169,12 +169,33 @@ > > #define NDISC_OPT_SPACE(len) (((len)+2+7)&~7) > > -static u8 *ndisc_fill_option(u8 *opt, int type, void *data, int data_len) > +/* > + * Return the padding between the option length and the start of the > + * link addr. Currently only IP-over-InfiniBand needs this, although > + * if RFC 3831 IPv6-over-Fibre Channel is ever implemented it may > + * also need a pad of 2. > + */ > +static int ndisc_addr_option_pad(unsigned short type) > +{ > + switch (type) { > + case ARPHRD_INFINIBAND: return 2; > + default: return 0; > + } > +} > + > +static u8 *ndisc_fill_addr_option(u8 *opt, int type, void *data, int data_len, > + unsigned short addr_type) > { > int space = NDISC_OPT_SPACE(data_len); > + int pad = ndisc_addr_option_pad(addr_type); > > opt[0] = type; > opt[1] = space>>3; > + > + memset(opt + 2, 0, pad); > + opt += pad; > + space -= pad; > + > memcpy(opt+2, data, data_len); > data_len += 2; > opt += data_len; -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From jt@hpl.hp.com Tue Jan 18 16:47:30 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 16:47:35 -0800 (PST) Received: from palrel10.hp.com (palrel10.hp.com [156.153.255.245]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0J0lTgP005145 for ; Tue, 18 Jan 2005 16:47:30 -0800 Received: from tomil.hpl.hp.com (tomil.hpl.hp.com [15.0.152.100]) by palrel10.hp.com (Postfix) with ESMTP id 03FD15F7C; Tue, 18 Jan 2005 16:47:23 -0800 (PST) Received: from bougret.hpl.hp.com (bougret.hpl.hp.com [15.4.92.227]) by tomil.hpl.hp.com (8.9.3 (PHNE_29774)/8.9.3 HPLabs Timeshare Server) with ESMTP id QAA19384; Tue, 18 Jan 2005 16:49:02 -0800 (PST) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 1Cr40I-00070U-00; Tue, 18 Jan 2005 16:47:22 -0800 Date: Tue, 18 Jan 2005 16:47:22 -0800 To: Rusty Russell , Linux kernel mailing list , netdev@oss.sgi.com Subject: [BUG] MODULE_PARM conversions introduces bug in Wavelan driver Message-ID: <20050119004722.GA26468@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i Organisation: HP Labs Palo Alto Address: HP Labs, 1U-17, 1501 Page Mill road, Palo Alto, CA 94304, USA. E-mail: jt@hpl.hp.com From: Jean Tourrilhes X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 465 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jt@hpl.hp.com Precedence: bulk X-list: netdev Hi Rusty, (If you are not the culprit, please forward to the guilty party). The patch the the Wavelan driver that I quote below introduces a nice bug that can crash the kernel. Maybe you want to think about fixing it, or maybe I should revert the patch... As a side note... I personally don't like the "string pointer" module parameter, previously 'p' and currently 'charp', because I can easily lead to this kind of bug, add extra bloat in the module for various checks and doesn't have a clean way to return the error to user space. I personally introduced the "double char array" module parameter, 'c', to fix that. I even sent you the patch to add 'c' support in your new module loader (see set_obsolete()). Would it be possible to carry this feature with the new module_param_array ? Thanks in advance... Jean ------------------------------------------------------------- diff -Nru a/drivers/net/wireless/wavelan.c b/drivers/net/wireless/wavelan.c --- a/drivers/net/wireless/wavelan.c 2005-01-11 20:03:09 -08:00 +++ b/drivers/net/wireless/wavelan.c 2005-01-11 20:03:09 -08:00 @@ -4344,7 +4344,8 @@ struct net_device *dev = alloc_etherdev(sizeof(net_local)); if (!dev) break; - memcpy(dev->name, name[i], IFNAMSIZ); /* Copy name */ + if (name[i]) + strcpy(dev->name, name[i]); /* Copy name */ dev->base_addr = io[i]; dev->irq = irq[i]; diff -Nru a/drivers/net/wireless/wavelan.p.h b/drivers/net/wireless/wavelan.p.h --- a/drivers/net/wireless/wavelan.p.h 2005-01-11 20:03:07 -08:00 +++ b/drivers/net/wireless/wavelan.p.h 2005-01-11 20:03:07 -08:00 @@ -703,10 +703,11 @@ /* Parameters set by insmod */ static int io[4]; static int irq[4]; -static char name[4][IFNAMSIZ]; -MODULE_PARM(io, "1-4i"); -MODULE_PARM(irq, "1-4i"); -MODULE_PARM(name, "1-4c" __MODULE_STRING(IFNAMSIZ)); +static char *name[4]; +module_param_array(io, int, NULL, 0); +module_param_array(irq, int, NULL, 0); +module_param_array(name, charp, NULL, 0); + MODULE_PARM_DESC(io, "WaveLAN I/O base address(es),required"); MODULE_PARM_DESC(irq, "WaveLAN IRQ number(s)"); MODULE_PARM_DESC(name, "WaveLAN interface neme(s)"); From acme@conectiva.com.br Tue Jan 18 19:40:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 19:40:28 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0J3eHRx013097 for ; Tue, 18 Jan 2005 19:40:20 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1Cr5xd-0007Pe-00; Wed, 19 Jan 2005 00:52:45 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 3D9DB1462D; Wed, 19 Jan 2005 01:40:13 -0200 (BRST) Message-ID: <41EDD7C4.90309@conectiva.com.br> Date: Wed, 19 Jan 2005 01:45:08 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" Cc: Networking Team Subject: [PATCH] make ipx use a slab cache for its socks X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------070106010204030107050203" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 466 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------070106010204030107050203 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David, This is the start of a series of patches converting the legacy protocols to use slab caches, this is needed in preparation to introduce struct connection_sock, most of them are trivial and small due to the fact that we have been abstracting away access to the protocols private area with things like {ipx,at,ax25,netrom,rose,etc}_sk(sk), there are more involved cases, namely: atm: yesterday I sent a message to Chas explaining the situation (CCed netdev) ax25 & its upper layer protos (rose, netrom): I have the bulk of the work done, making it use the same approach used in the inet protos: tcp_sock is a inet_sock is a sock, for ax25 it is netrom/rose is a ax25_sock is a sock, Ralf Baechle is reviewing the patch and seems to be happy with it so far. bluetooth: Still have to do further analysis, but it mostly replicates the core infrastructure for registering a proto family, using both slab caches and sk_protinfo, I'm thinking about generalising somewhat inet_register_protosw API style or something along these lines. All the others (pfkey, decnet, netlink, appletalk, llc, etc) are already converted in my private tree and I'll be sending it as you merge the previous one, starting with this one for IPX. In the end of this series sk->sk_protinfo will be deleted, the generic sk_cachep will be deleted and all proto families will have private slab caches. So struct sock shrinks a bit again 8) I didn't benchmarked these changed on a before/after way, but I expect some performance gains like the ones we got when we did the same thing for TCP, AF_UNIX, etc. After all of this is merged I'll introduce struct connection_sock and move on to the next target, that is to move all proto families to use sk->sk_prot, as the inet protos do today, so as to remove sk->sk_slab and use sk->sk_prot->slab, at this point we can change sk_alloc to have this prototype: struct sock *sk_alloc(struct proto *prot, int priority, int zero_it); where today we have this one: struct sock *sk_alloc(int family, int priority, int zero_it, kmem_cache_t *slab); because we will be able to get the relevant slab cache from sk->sk_prot->slab, zero_it gets its original semantic, becoming again just a boolean, because we can get the proto sock size from sk->sk_prot->slab_obj_size. This, in turn... OK, enough "roadmap dumping" for today! 8) Comments on this course of action will be greatly appreciated. Ah, this changeset is available at: bk://kernel.bkbits.net/acme/connection_sock-2.6 Best Regards, - Arnaldo --------------070106010204030107050203 Content-Type: text/plain; name="ipx_slab.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ipx_slab.patch" =================================================================== ChangeSet@1.2336, 2005-01-18 00:45:37-02:00, acme@toy.ghostprotocols.net [IPX] use a private slab cache for socks Renaming ipx_opt to ipx_sock, tested with mars-nwe/ncpmount. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller include/net/ipx.h | 13 ++++++++- net/ipx/af_ipx.c | 69 ++++++++++++++++++++++++++-------------------------- net/ipx/ipx_proc.c | 4 +-- net/ipx/ipx_route.c | 2 - 4 files changed, 49 insertions(+), 39 deletions(-) diff -Nru a/include/net/ipx.h b/include/net/ipx.h --- a/include/net/ipx.h 2005-01-19 01:00:01 -02:00 +++ b/include/net/ipx.h 2005-01-19 01:00:01 -02:00 @@ -90,7 +90,11 @@ } last_hop; }; -struct ipx_opt { +#include + +struct ipx_sock { + /* struct sock has to be the first member of ipx_sock */ + struct sock sk; struct ipx_address dest_addr; struct ipx_interface *intrfc; unsigned short port; @@ -105,9 +109,14 @@ unsigned short ipx_ncp_conn; }; -#define ipx_sk(__sk) ((struct ipx_opt *)(__sk)->sk_protinfo) +static inline struct ipx_sock *ipx_sk(struct sock *sk) +{ + return (struct ipx_sock *)sk; +} + #define IPX_SKB_CB(__skb) ((struct ipx_cb *)&((__skb)->cb[0])) #endif + #define IPX_MIN_EPHEMERAL_SOCKET 0x4000 #define IPX_MAX_EPHEMERAL_SOCKET 0x7fff diff -Nru a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c --- a/net/ipx/af_ipx.c 2005-01-19 01:00:01 -02:00 +++ b/net/ipx/af_ipx.c 2005-01-19 01:00:01 -02:00 @@ -80,6 +80,8 @@ LIST_HEAD(ipx_interfaces); DEFINE_SPINLOCK(ipx_interfaces_lock); +static kmem_cache_t *ipx_sk_slab; + struct ipx_interface *ipx_primary_net; struct ipx_interface *ipx_internal_net; @@ -277,7 +279,7 @@ spin_lock_bh(&intrfc->if_sklist_lock); sk_for_each(s, node, &intrfc->if_sklist) { - struct ipx_opt *ipxs = ipx_sk(s); + struct ipx_sock *ipxs = ipx_sk(s); if (ipxs->port == port && !memcmp(ipx_node, ipxs->node, IPX_NODE_LEN)) @@ -302,7 +304,7 @@ spin_lock_bh(&intrfc->if_sklist_lock); /* error sockets */ sk_for_each_safe(s, node, t, &intrfc->if_sklist) { - struct ipx_opt *ipxs = ipx_sk(s); + struct ipx_sock *ipxs = ipx_sk(s); s->sk_err = ENOLINK; s->sk_error_report(s); @@ -400,7 +402,7 @@ spin_lock_bh(&intrfc->if_sklist_lock); sk_for_each(s, node, &intrfc->if_sklist) { - struct ipx_opt *ipxs = ipx_sk(s); + struct ipx_sock *ipxs = ipx_sk(s); if (ipxs->port == ipx->ipx_dest.sock && (is_broadcast || !memcmp(ipx->ipx_dest.node, @@ -1348,32 +1350,21 @@ static int ipx_create(struct socket *sock, int protocol) { int rc = -ESOCKTNOSUPPORT; - struct ipx_opt *ipx = NULL; struct sock *sk; - switch (sock->type) { - case SOCK_DGRAM: - sk = sk_alloc(PF_IPX, GFP_KERNEL, 1, NULL); - rc = -ENOMEM; - if (!sk) - goto out; - ipx = sk->sk_protinfo = kmalloc(sizeof(*ipx), GFP_KERNEL); - if (!ipx) - goto outsk; - memset(ipx, 0, sizeof(*ipx)); - sock->ops = &ipx_dgram_ops; - break; - case SOCK_SEQPACKET: - /* - * SPX support is not anymore in the kernel sources. If - * you want to ressurrect it, completing it and making - * it understand shared skbs, be fully multithreaded, - * etc, grab the sources in an early 2.5 kernel tree. - */ - case SOCK_STREAM: /* Allow higher levels to piggyback */ - default: + /* + * SPX support is not anymore in the kernel sources. If you want to + * ressurrect it, completing it and making it understand shared skbs, + * be fully multithreaded, etc, grab the sources in an early 2.5 kernel + * tree. + */ + if (sock->type != SOCK_DGRAM) + goto out; + + sk = sk_alloc(PF_IPX, GFP_KERNEL, sizeof(struct ipx_sock), ipx_sk_slab); + rc = -ENOMEM; + if (!sk) goto out; - } #ifdef IPX_REFCNT_DEBUG atomic_inc(&ipx_sock_nr); printk(KERN_DEBUG "IPX socket %p created, now we have %d alive\n", sk, @@ -1382,12 +1373,10 @@ sock_init_data(sock, sk); sk_set_owner(sk, THIS_MODULE); sk->sk_no_check = 1; /* Checksum off by default */ + sock->ops = &ipx_dgram_ops; rc = 0; out: return rc; -outsk: - sk_free(sk); - goto out; } static int ipx_release(struct socket *sock) @@ -1433,7 +1422,7 @@ static int ipx_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) { struct sock *sk = sock->sk; - struct ipx_opt *ipxs = ipx_sk(sk); + struct ipx_sock *ipxs = ipx_sk(sk); struct ipx_interface *intrfc; struct sockaddr_ipx *addr = (struct sockaddr_ipx *)uaddr; int rc = -EINVAL; @@ -1529,7 +1518,7 @@ int addr_len, int flags) { struct sock *sk = sock->sk; - struct ipx_opt *ipxs = ipx_sk(sk); + struct ipx_sock *ipxs = ipx_sk(sk); struct sockaddr_ipx *addr; int rc = -EINVAL; struct ipx_route *rt; @@ -1593,7 +1582,7 @@ struct ipx_address *addr; struct sockaddr_ipx sipx; struct sock *sk = sock->sk; - struct ipx_opt *ipxs = ipx_sk(sk); + struct ipx_sock *ipxs = ipx_sk(sk); int rc; *uaddr_len = sizeof(struct sockaddr_ipx); @@ -1693,7 +1682,7 @@ struct msghdr *msg, size_t len) { struct sock *sk = sock->sk; - struct ipx_opt *ipxs = ipx_sk(sk); + struct ipx_sock *ipxs = ipx_sk(sk); struct sockaddr_ipx *usipx = (struct sockaddr_ipx *)msg->msg_name; struct sockaddr_ipx local_sipx; int rc = -EINVAL; @@ -1758,7 +1747,7 @@ struct msghdr *msg, size_t size, int flags) { struct sock *sk = sock->sk; - struct ipx_opt *ipxs = ipx_sk(sk); + struct ipx_sock *ipxs = ipx_sk(sk); struct sockaddr_ipx *sipx = (struct sockaddr_ipx *)msg->msg_name; struct ipxhdr *ipx = NULL; struct sk_buff *skb; @@ -1965,6 +1954,13 @@ static int __init ipx_init(void) { + ipx_sk_slab = kmem_cache_create("ipx_sock", + sizeof(struct ipx_sock), 0, + SLAB_HWCACHE_ALIGN, NULL, NULL); + + if (ipx_sk_slab == NULL) + return -ENOMEM; + sock_register(&ipx_family_ops); pEII_datalink = make_EII_client(); @@ -2015,6 +2011,11 @@ dev_remove_pack(&ipx_dix_packet_type); destroy_EII_client(pEII_datalink); pEII_datalink = NULL; + + if (ipx_sk_slab != NULL) { + kmem_cache_destroy(ipx_sk_slab); + ipx_sk_slab = NULL; + } sock_unregister(ipx_family_ops.family); } diff -Nru a/net/ipx/ipx_proc.c b/net/ipx/ipx_proc.c --- a/net/ipx/ipx_proc.c 2005-01-19 01:00:01 -02:00 +++ b/net/ipx/ipx_proc.c 2005-01-19 01:00:01 -02:00 @@ -202,7 +202,7 @@ { struct sock* sk, *next; struct ipx_interface *i; - struct ipx_opt *ipxs; + struct ipx_sock *ipxs; ++*pos; if (v == SEQ_START_TOKEN) { @@ -243,7 +243,7 @@ static int ipx_seq_socket_show(struct seq_file *seq, void *v) { struct sock *s; - struct ipx_opt *ipxs; + struct ipx_sock *ipxs; if (v == SEQ_START_TOKEN) { #ifdef CONFIG_IPX_INTERN diff -Nru a/net/ipx/ipx_route.c b/net/ipx/ipx_route.c --- a/net/ipx/ipx_route.c 2005-01-19 01:00:01 -02:00 +++ b/net/ipx/ipx_route.c 2005-01-19 01:00:01 -02:00 @@ -172,7 +172,7 @@ struct iovec *iov, size_t len, int noblock) { struct sk_buff *skb; - struct ipx_opt *ipxs = ipx_sk(sk); + struct ipx_sock *ipxs = ipx_sk(sk); struct ipx_interface *intrfc; struct ipxhdr *ipx; size_t size; --------------070106010204030107050203-- From rusty@rustcorp.com.au Tue Jan 18 19:59:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 19:59:06 -0800 (PST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0J3x0o2014212 for ; Tue, 18 Jan 2005 19:59:01 -0800 Received: from localhost.localdomain (localhost [127.0.0.1]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTP id 698D667A2C; Wed, 19 Jan 2005 14:58:54 +1100 (EST) Subject: Re: [BUG] MODULE_PARM conversions introduces bug in Wavelan driver From: Rusty Russell To: jt@hpl.hp.com Cc: Linux kernel mailing list , netdev@oss.sgi.com In-Reply-To: <20050119004722.GA26468@bougret.hpl.hp.com> References: <20050119004722.GA26468@bougret.hpl.hp.com> Content-Type: text/plain Date: Wed, 19 Jan 2005 13:42:33 +1100 Message-Id: <1106102553.20879.4.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.3 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 467 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rusty@rustcorp.com.au Precedence: bulk X-list: netdev On Tue, 2005-01-18 at 16:47 -0800, Jean Tourrilhes wrote: > Hi Rusty, > > (If you are not the culprit, please forward to the guilty party). Almost certainly me. We gave people warning, we even marked MODULE_PARM deprecated, but eventually I had to roll through and try to autoconvert. > I personally introduced the "double char array" module > parameter, 'c', to fix that. I even sent you the patch to add 'c' > support in your new module loader (see set_obsolete()). Would it be > possible to carry this feature with the new module_param_array ? > Thanks in advance... Actually, it's designed so you can extend it yourself: at its base, module_param_call() is just a callback mechanism. Thanks! Rusty. -- A bad analogy is like a leaky screwdriver -- Richard Braakman From kaber@trash.net Tue Jan 18 20:26:43 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 20:26:48 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0J4Qhq6018763 for ; Tue, 18 Jan 2005 20:26:43 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Cr7Pv-0003gU-IW; Wed, 19 Jan 2005 05:26:03 +0100 Message-ID: <41EDE15B.40300@trash.net> Date: Wed, 19 Jan 2005 05:26:03 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: hadi@cyberus.ca CC: Thomas Graf , "David S. Miller" , netdev@oss.sgi.com Subject: Re: path: module replay References: <1105900522.1090.798.camel@jzny.localdomain> <41EAB74F.6060507@trash.net> <20050116185630.GZ26856@postel.suug.ch> <1105903033.1097.829.camel@jzny.localdomain> <1105903960.1097.836.camel@jzny.localdomain> In-Reply-To: <1105903960.1097.836.camel@jzny.localdomain> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 468 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev jamal wrote: >Ok, here is the last patch. I think module replay should be done from >that spot and to be consistent as well from cls_api.c for legacy stuff. >I also fixed a module ref count leak. >the act_api piece is dependent on what i sent earlier for namsiz. >the cls_api change i believe conflicts with what Thomas sent yesterday. > +replay: act = tcf_action_init_1(tb[i], est, name, ovr, bind, err); - if (act == NULL) - goto err; + if (act == NULL) { + if (*err == -EAGAIN) + goto replay; + goto err_out; + } This part is wrong. We can replay single action requests in the act_api init path, but not in tcf_exts_init. We are coming from a classifier initialization path and have dropped the RTNL, so we also have to replay the classifier request. Please send a fixed patch without the bogus module refcnt change. Regards Patrick From kaber@trash.net Tue Jan 18 20:38:52 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 20:38:58 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0J4cqov019604 for ; Tue, 18 Jan 2005 20:38:52 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Cr7cE-0003mD-CH; Wed, 19 Jan 2005 05:38:46 +0100 Message-ID: <41EDE456.3050600@trash.net> Date: Wed, 19 Jan 2005 05:38:46 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: Maillist netdev Subject: [PATCH PKT_SCHED 3/4]: cls_route: fix tcf_exts fallout Content-Type: multipart/mixed; boundary="------------080206020809050403010709" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 472 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------080206020809050403010709 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------080206020809050403010709 Content-Type: text/x-patch; name="03.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="03.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/19 04:53:51+01:00 kaber@coreworks.de # [PKT_SCHED]: cls_route: fix tcf_exts fallout # # handle is computed wrong, this makes creating a filter not using # "from" fail. # # Signed-off-by: Patrick McHardy # # net/sched/cls_route.c # 2005/01/19 04:53:43+01:00 kaber@coreworks.de +2 -2 # [PKT_SCHED]: cls_route: fix tcf_exts fallout # # handle is computed wrong, this makes creating a filter not using # "from" fail. # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/cls_route.c b/net/sched/cls_route.c --- a/net/sched/cls_route.c 2005-01-19 05:29:55 +01:00 +++ b/net/sched/cls_route.c 2005-01-19 05:29:55 +01:00 @@ -384,9 +384,9 @@ id = *(u32*)RTA_DATA(tb[TCA_ROUTE4_IIF-1]); if (id > 0x7FFF) goto errout; - nhandle = (id | 0x8000) << 16; + nhandle |= (id | 0x8000) << 16; } else - nhandle = 0xFFFF << 16; + nhandle |= 0xFFFF << 16; if (handle && new) { nhandle |= handle & 0x7F00; --------------080206020809050403010709-- From kaber@trash.net Tue Jan 18 20:38:50 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 20:38:55 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0J4coMH019598 for ; Tue, 18 Jan 2005 20:38:50 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Cr7cC-0003m9-K7; Wed, 19 Jan 2005 05:38:44 +0100 Message-ID: <41EDE454.5070004@trash.net> Date: Wed, 19 Jan 2005 05:38:44 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: Maillist netdev Subject: [PATCH PKT_SCHED 2/4]: cls_api.c: fix module reference leak on module load Content-Type: multipart/mixed; boundary="------------050308090500020407000506" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 471 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------050308090500020407000506 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------050308090500020407000506 Content-Type: text/x-patch; name="02.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="02.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/19 03:58:05+01:00 kaber@coreworks.de # [PKT_SCHED]: cls_api.c: fix module reference leak on module load # # Signed-off-by: Patrick McHardy # # net/sched/cls_api.c # 2005/01/19 03:57:58+01:00 kaber@coreworks.de +3 -1 # [PKT_SCHED]: cls_api.c: fix module reference leak on module load # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/cls_api.c b/net/sched/cls_api.c --- a/net/sched/cls_api.c 2005-01-19 05:29:50 +01:00 +++ b/net/sched/cls_api.c 2005-01-19 05:29:50 +01:00 @@ -239,8 +239,10 @@ * replay the request. We indicate this using * -EAGAIN. */ - if (tp_ops != NULL) + if (tp_ops != NULL) { + module_put(tp_ops->owner); err = -EAGAIN; + } } #endif kfree(tp); --------------050308090500020407000506-- From kaber@trash.net Tue Jan 18 20:39:05 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 20:39:12 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0J4d3Ir019731 for ; Tue, 18 Jan 2005 20:39:04 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Cr7cQ-0003mH-C9; Wed, 19 Jan 2005 05:38:58 +0100 Message-ID: <41EDE462.9040602@trash.net> Date: Wed, 19 Jan 2005 05:38:58 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: Maillist netdev Subject: [PATCH PKT_SCHED 4/4]: fix CONFIG_NET_CLS_ACT skb leaks in HFSC/CBQ Content-Type: multipart/mixed; boundary="------------090400050402010302070004" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 473 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------090400050402010302070004 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------090400050402010302070004 Content-Type: text/x-patch; name="04.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="04.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/19 05:15:16+01:00 kaber@coreworks.de # [PKT_SCHED]: fix CONFIG_NET_CLS_ACT skb leaks in HFSC/CBQ # # Both HFSC and CBQ leak unclassified skbs with CONFIG_NET_CLS_ACT. # Move freeing to enqueue where it belongs. Same change for in HTB/prio, # they just don't leak because they don't have unclassified packets. # # Signed-off-by: Patrick McHardy # # net/sched/sch_prio.c # 2005/01/19 05:15:07+01:00 kaber@coreworks.de +30 -44 # [PKT_SCHED]: fix CONFIG_NET_CLS_ACT skb leaks in HFSC/CBQ # # Both HFSC and CBQ leak unclassified skbs with CONFIG_NET_CLS_ACT. # Move freeing to enqueue where it belongs. Same change for in HTB/prio, # they just don't leak because they don't have unclassified packets. # # Signed-off-by: Patrick McHardy # # net/sched/sch_htb.c # 2005/01/19 05:15:07+01:00 kaber@coreworks.de +16 -44 # [PKT_SCHED]: fix CONFIG_NET_CLS_ACT skb leaks in HFSC/CBQ # # Both HFSC and CBQ leak unclassified skbs with CONFIG_NET_CLS_ACT. # Move freeing to enqueue where it belongs. Same change for in HTB/prio, # they just don't leak because they don't have unclassified packets. # # Signed-off-by: Patrick McHardy # # net/sched/sch_hfsc.c # 2005/01/19 05:15:07+01:00 kaber@coreworks.de +11 -34 # [PKT_SCHED]: fix CONFIG_NET_CLS_ACT skb leaks in HFSC/CBQ # # Both HFSC and CBQ leak unclassified skbs with CONFIG_NET_CLS_ACT. # Move freeing to enqueue where it belongs. Same change for in HTB/prio, # they just don't leak because they don't have unclassified packets. # # Signed-off-by: Patrick McHardy # # net/sched/sch_cbq.c # 2005/01/19 05:15:07+01:00 kaber@coreworks.de +26 -53 # [PKT_SCHED]: fix CONFIG_NET_CLS_ACT skb leaks in HFSC/CBQ # # Both HFSC and CBQ leak unclassified skbs with CONFIG_NET_CLS_ACT. # Move freeing to enqueue where it belongs. Same change for in HTB/prio, # they just don't leak because they classify all packets. # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c --- a/net/sched/sch_cbq.c 2005-01-19 05:30:01 +01:00 +++ b/net/sched/sch_cbq.c 2005-01-19 05:30:01 +01:00 @@ -241,7 +241,7 @@ */ static struct cbq_class * -cbq_classify(struct sk_buff *skb, struct Qdisc *sch, int *qres) +cbq_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr) { struct cbq_sched_data *q = qdisc_priv(sch); struct cbq_class *head = &q->link; @@ -255,13 +255,11 @@ */ if (TC_H_MAJ(prio^sch->handle) == 0 && (cl = cbq_class_lookup(q, prio)) != NULL) - return cl; + return cl; + *qerr = NET_XMIT_DROP; for (;;) { int result = 0; -#ifdef CONFIG_NET_CLS_ACT - int terminal = 0; -#endif defmap = head->defaults; /* @@ -282,27 +280,13 @@ #ifdef CONFIG_NET_CLS_ACT switch (result) { - case TC_ACT_SHOT: /* Stop and kfree */ - *qres = NET_XMIT_DROP; - terminal = 1; - break; case TC_ACT_QUEUED: case TC_ACT_STOLEN: - terminal = 1; - break; - case TC_ACT_RECLASSIFY: /* Things look good */ - case TC_ACT_OK: - case TC_ACT_UNSPEC: - default: - break; - } - - if (terminal) { - kfree_skb(skb); + *qerr = NET_XMIT_SUCCESS; + case TC_ACT_SHOT: return NULL; } -#else -#ifdef CONFIG_NET_CLS_POLICE +#elif defined(CONFIG_NET_CLS_POLICE) switch (result) { case TC_POLICE_RECLASSIFY: return cbq_reclassify(skb, cl); @@ -312,7 +296,6 @@ break; } #endif -#endif if (cl->level == 0) return cl; @@ -423,45 +406,35 @@ { struct cbq_sched_data *q = qdisc_priv(sch); int len = skb->len; - int ret = NET_XMIT_SUCCESS; - struct cbq_class *cl = cbq_classify(skb, sch,&ret); + int ret; + struct cbq_class *cl = cbq_classify(skb, sch, &ret); #ifdef CONFIG_NET_CLS_POLICE q->rx_class = cl; #endif - if (cl) { -#ifdef CONFIG_NET_CLS_POLICE - cl->q->__parent = sch; -#endif - if ((ret = cl->q->enqueue(skb, cl->q)) == NET_XMIT_SUCCESS) { - sch->q.qlen++; - sch->bstats.packets++; - sch->bstats.bytes+=len; - cbq_mark_toplevel(q, cl); - if (!cl->next_alive) - cbq_activate_class(cl); - return ret; - } - } - -#ifndef CONFIG_NET_CLS_ACT - sch->qstats.drops++; - if (cl == NULL) + if (cl == NULL) { + if (ret == NET_XMIT_DROP) + sch->qstats.drops++; kfree_skb(skb); - else { - cbq_mark_toplevel(q, cl); - cl->qstats.drops++; - } -#else - if ( NET_XMIT_DROP == ret) { - sch->qstats.drops++; + return ret; } - if (cl != NULL) { +#ifdef CONFIG_NET_CLS_POLICE + cl->q->__parent = sch; +#endif + if ((ret = cl->q->enqueue(skb, cl->q)) == NET_XMIT_SUCCESS) { + sch->q.qlen++; + sch->bstats.packets++; + sch->bstats.bytes+=len; cbq_mark_toplevel(q, cl); - cl->qstats.drops++; + if (!cl->next_alive) + cbq_activate_class(cl); + return ret; } -#endif + + sch->qstats.drops++; + cbq_mark_toplevel(q, cl); + cl->qstats.drops++; return ret; } diff -Nru a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c --- a/net/sched/sch_hfsc.c 2005-01-19 05:30:01 +01:00 +++ b/net/sched/sch_hfsc.c 2005-01-19 05:30:01 +01:00 @@ -1214,7 +1214,7 @@ } static struct hfsc_class * -hfsc_classify(struct sk_buff *skb, struct Qdisc *sch, int *qres) +hfsc_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr) { struct hfsc_sched *q = qdisc_priv(sch); struct hfsc_class *cl; @@ -1227,36 +1227,21 @@ if (cl->level == 0) return cl; + *qerr = NET_XMIT_DROP; tcf = q->root.filter_list; while (tcf && (result = tc_classify(skb, tcf, &res)) >= 0) { #ifdef CONFIG_NET_CLS_ACT - int terminal = 0; switch (result) { - case TC_ACT_SHOT: - *qres = NET_XMIT_DROP; - terminal = 1; - break; case TC_ACT_QUEUED: case TC_ACT_STOLEN: - terminal = 1; - break; - case TC_ACT_RECLASSIFY: - case TC_ACT_OK: - case TC_ACT_UNSPEC: - default: - break; - } - - if (terminal) { - kfree_skb(skb); + *qerr = NET_XMIT_SUCCESS; + case TC_ACT_SHOT: return NULL; } -#else -#ifdef CONFIG_NET_CLS_POLICE +#elif defined(CONFIG_NET_CLS_POLICE) if (result == TC_POLICE_SHOT) return NULL; #endif -#endif if ((cl = (struct hfsc_class *)res.class) == NULL) { if ((cl = hfsc_find_class(res.classid, sch)) == NULL) break; /* filter selected invalid classid */ @@ -1652,27 +1637,19 @@ static int hfsc_enqueue(struct sk_buff *skb, struct Qdisc *sch) { - int ret = NET_XMIT_SUCCESS; - struct hfsc_class *cl = hfsc_classify(skb, sch, &ret); - unsigned int len = skb->len; + struct hfsc_class *cl; + unsigned int len; int err; - -#ifdef CONFIG_NET_CLS_ACT + cl = hfsc_classify(skb, sch, &err); if (cl == NULL) { - if (NET_XMIT_DROP == ret) { + if (err == NET_XMIT_DROP) sch->qstats.drops++; - } - return ret; - } -#else - if (cl == NULL) { kfree_skb(skb); - sch->qstats.drops++; - return NET_XMIT_DROP; + return err; } -#endif + len = skb->len; err = cl->qdisc->enqueue(skb, cl->qdisc); if (unlikely(err != NET_XMIT_SUCCESS)) { cl->qstats.drops++; diff -Nru a/net/sched/sch_htb.c b/net/sched/sch_htb.c --- a/net/sched/sch_htb.c 2005-01-19 05:30:01 +01:00 +++ b/net/sched/sch_htb.c 2005-01-19 05:30:01 +01:00 @@ -305,7 +305,7 @@ return (cl && cl != HTB_DIRECT) ? cl->classid : TC_H_UNSPEC; } -static struct htb_class *htb_classify(struct sk_buff *skb, struct Qdisc *sch, int *qres) +static struct htb_class *htb_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr) { struct htb_sched *q = qdisc_priv(sch); struct htb_class *cl; @@ -321,35 +321,20 @@ if ((cl = htb_find(skb->priority,sch)) != NULL && cl->level == 0) return cl; + *qerr = NET_XMIT_DROP; tcf = q->filter_list; while (tcf && (result = tc_classify(skb, tcf, &res)) >= 0) { #ifdef CONFIG_NET_CLS_ACT - int terminal = 0; switch (result) { - case TC_ACT_SHOT: /* Stop and kfree */ - *qres = NET_XMIT_DROP; - terminal = 1; - break; case TC_ACT_QUEUED: case TC_ACT_STOLEN: - terminal = 1; - break; - case TC_ACT_RECLASSIFY: /* Things look good */ - case TC_ACT_OK: - case TC_ACT_UNSPEC: - default: - break; - } - - if (terminal) { - kfree_skb(skb); + *qerr = NET_XMIT_SUCCESS; + case TC_ACT_SHOT: return NULL; } -#else -#ifdef CONFIG_NET_CLS_POLICE +#elif defined(CONFIG_NET_CLS_POLICE) if (result == TC_POLICE_SHOT) - return NULL; -#endif + return HTB_DIRECT; #endif if ((cl = (void*)res.class) == NULL) { if (res.classid == sch->handle) @@ -723,37 +708,24 @@ static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch) { - int ret = NET_XMIT_SUCCESS; + int ret; struct htb_sched *q = qdisc_priv(sch); struct htb_class *cl = htb_classify(skb,sch,&ret); - -#ifdef CONFIG_NET_CLS_ACT - if (cl == HTB_DIRECT ) { - if (q->direct_queue.qlen < q->direct_qlen ) { - __skb_queue_tail(&q->direct_queue, skb); - q->direct_pkts++; - } - } else if (!cl) { - if (NET_XMIT_DROP == ret) { - sch->qstats.drops++; - } - return ret; - } -#else - if (cl == HTB_DIRECT || !cl) { + if (cl == HTB_DIRECT) { /* enqueue to helper queue */ - if (q->direct_queue.qlen < q->direct_qlen && cl) { + if (q->direct_queue.qlen < q->direct_qlen) { __skb_queue_tail(&q->direct_queue, skb); q->direct_pkts++; - } else { - kfree_skb (skb); - sch->qstats.drops++; - return NET_XMIT_DROP; } - } +#ifdef CONFIG_NET_CLS_ACT + } else if (!cl) { + if (ret == NET_XMIT_DROP) + sch->qstats.drops++; + kfree_skb (skb); + return ret; #endif - else if (cl->un.leaf.q->enqueue(skb, cl->un.leaf.q) != NET_XMIT_SUCCESS) { + } else if (cl->un.leaf.q->enqueue(skb, cl->un.leaf.q) != NET_XMIT_SUCCESS) { sch->qstats.drops++; cl->qstats.drops++; return NET_XMIT_DROP; diff -Nru a/net/sched/sch_prio.c b/net/sched/sch_prio.c --- a/net/sched/sch_prio.c 2005-01-19 05:30:01 +01:00 +++ b/net/sched/sch_prio.c 2005-01-19 05:30:01 +01:00 @@ -47,37 +47,23 @@ }; -static struct Qdisc *prio_classify(struct sk_buff *skb, - struct Qdisc *sch, int *r) +static struct Qdisc * +prio_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr) { struct prio_sched_data *q = qdisc_priv(sch); u32 band = skb->priority; struct tcf_result res; + *qerr = NET_XMIT_DROP; if (TC_H_MAJ(skb->priority) != sch->handle) { #ifdef CONFIG_NET_CLS_ACT - int result = 0, terminal = 0; - result = tc_classify(skb, q->filter_list, &res); - - switch (result) { - case TC_ACT_SHOT: - *r = NET_XMIT_DROP; - terminal = 1; - break; - case TC_ACT_STOLEN: - case TC_ACT_QUEUED: - terminal = 1; - break; - case TC_ACT_RECLASSIFY: - case TC_ACT_OK: - case TC_ACT_UNSPEC: - default: - break; - }; - if (terminal) { - kfree_skb(skb); + switch (tc_classify(skb, q->filter_list, &res)) { + case TC_ACT_STOLEN: + case TC_ACT_QUEUED: + *qerr = NET_XMIT_SUCCESS; + case TC_ACT_SHOT: return NULL; - } + }; if (!q->filter_list ) { #else @@ -97,15 +83,20 @@ } static int -prio_enqueue(struct sk_buff *skb, struct Qdisc* sch) +prio_enqueue(struct sk_buff *skb, struct Qdisc *sch) { struct Qdisc *qdisc; - int ret = NET_XMIT_SUCCESS; + int ret; qdisc = prio_classify(skb, sch, &ret); - - if (NULL == qdisc) - goto dropped; +#ifdef CONFIG_NET_CLS_ACT + if (qdisc == NULL) { + if (ret == NET_XMIT_DROP) + sch->qstats.drops++; + kfree_skb(skb); + return ret; + } +#endif if ((ret = qdisc->enqueue(skb, qdisc)) == NET_XMIT_SUCCESS) { sch->bstats.bytes += skb->len; @@ -113,17 +104,7 @@ sch->q.qlen++; return NET_XMIT_SUCCESS; } - -dropped: -#ifdef CONFIG_NET_CLS_ACT - if (NET_XMIT_DROP == ret) { -#endif - sch->qstats.drops++; -#ifdef CONFIG_NET_CLS_ACT - } else { - sch->qstats.overlimits++; /* abuse, but noone uses it */ - } -#endif + sch->qstats.drops++; return ret; } @@ -132,18 +113,23 @@ prio_requeue(struct sk_buff *skb, struct Qdisc* sch) { struct Qdisc *qdisc; - int ret = NET_XMIT_DROP; + int ret; qdisc = prio_classify(skb, sch, &ret); - if (qdisc == NULL) - goto dropped; +#ifdef CONFIG_NET_CLS_ACT + if (qdisc == NULL) { + if (ret == NET_XMIT_DROP) + sch->qstats.drops++; + kfree_skb(skb); + return ret; + } +#endif - if ((ret = qdisc->ops->requeue(skb, qdisc)) == 0) { + if ((ret = qdisc->ops->requeue(skb, qdisc)) == NET_XMIT_SUCCESS) { sch->q.qlen++; sch->qstats.requeues++; return 0; } -dropped: sch->qstats.drops++; return NET_XMIT_DROP; } --------------090400050402010302070004-- From kaber@trash.net Tue Jan 18 20:38:45 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 20:38:49 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0J4cjHS019595 for ; Tue, 18 Jan 2005 20:38:45 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Cr7c6-0003m1-Ck; Wed, 19 Jan 2005 05:38:38 +0100 Message-ID: <41EDE44E.9050609@trash.net> Date: Wed, 19 Jan 2005 05:38:38 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: Maillist netdev Subject: [PATCH PKT_SCHED 0/4]: more fixes Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 469 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Hi Dave, following are a couple assorted fixes for some bugs recently introduced. You can pull all changes from bk://212.42.230.204/net-2.6-sched Regards Patrick Patrick McHardy: o Merge coreworks.de:/home/kaber/src/bk-repos/net-2.6 into coreworks.de:/home/kaber/src/net/net-2.6-sched o [PKT_SCHED]: fix CONFIG_NET_CLS_ACT skb leaks in HFSC/CBQ o [PKT_SCHED]: cls_route: fix tcf_exts fallout o [PKT_SCHED]: cls_api.c: fix module reference leak on module load o [PKT_SCHED]: cls_rsvp: fix tcf_exts fallout From kaber@trash.net Tue Jan 18 20:38:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 20:38:54 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0J4clGd019597 for ; Tue, 18 Jan 2005 20:38:47 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Cr7cA-0003m5-96; Wed, 19 Jan 2005 05:38:42 +0100 Message-ID: <41EDE452.8000007@trash.net> Date: Wed, 19 Jan 2005 05:38:42 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: Maillist netdev Subject: [PATCH PKT_SCHED 1/4]: cls_rsvp: fix tcf_exts fallout Content-Type: multipart/mixed; boundary="------------030207030206010306030600" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 470 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------030207030206010306030600 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit --------------030207030206010306030600 Content-Type: text/x-patch; name="01.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="01.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/19 02:49:12+01:00 kaber@coreworks.de # [PKT_SCHED]: cls_rsvp: fix tcf_exts fallout # # The continue is supposed to continue the outer loop, not break # out of the do { } while (0) loop. cls_route.c is also changed # in a similar way for clarity, although it behaved correctly. # # Signed-off-by: Patrick McHardy # # net/sched/cls_rsvp.h # 2005/01/19 02:49:04+01:00 kaber@coreworks.de +8 -8 # [PKT_SCHED]: cls_rsvp: fix tcf_exts fallout # # The continue is supposed to continue the outer loop, not break # out of the do { } while (0) loop. cls_route.c is also changed # in a similar way for clarity, although it behaved correctly. # # Signed-off-by: Patrick McHardy # # net/sched/cls_route.c # 2005/01/19 02:49:04+01:00 kaber@coreworks.de +14 -14 # [PKT_SCHED]: cls_rsvp: fix tcf_exts fallout # # The continue is supposed to continue the outer loop, not break # out of the do { } while (0) loop. cls_route.c is also changed # in a similar way for clarity, although it behaved correctly. # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/cls_route.c b/net/sched/cls_route.c --- a/net/sched/cls_route.c 2005-01-19 05:29:45 +01:00 +++ b/net/sched/cls_route.c 2005-01-19 05:29:45 +01:00 @@ -125,20 +125,20 @@ return 32; } -#define ROUTE4_APPLY_RESULT() \ - do { \ - *res = f->res; \ - if (tcf_exts_is_available(&f->exts)) { \ - int r = tcf_exts_exec(skb, &f->exts, res); \ - if (r < 0) { \ - dont_cache = 1; \ - continue; \ - } \ - return r; \ - } else if (!dont_cache) \ - route4_set_fastmap(head, id, iif, f); \ - return 0; \ - } while(0) +#define ROUTE4_APPLY_RESULT() \ +{ \ + *res = f->res; \ + if (tcf_exts_is_available(&f->exts)) { \ + int r = tcf_exts_exec(skb, &f->exts, res); \ + if (r < 0) { \ + dont_cache = 1; \ + continue; \ + } \ + return r; \ + } else if (!dont_cache) \ + route4_set_fastmap(head, id, iif, f); \ + return 0; \ +} static int route4_classify(struct sk_buff *skb, struct tcf_proto *tp, struct tcf_result *res) diff -Nru a/net/sched/cls_rsvp.h b/net/sched/cls_rsvp.h --- a/net/sched/cls_rsvp.h 2005-01-19 05:29:44 +01:00 +++ b/net/sched/cls_rsvp.h 2005-01-19 05:29:45 +01:00 @@ -123,14 +123,14 @@ .action = TCA_RSVP_ACT }; -#define RSVP_APPLY_RESULT() \ - do { \ - int r = tcf_exts_exec(skb, &f->exts, res); \ - if (r < 0) \ - continue; \ - else if (r > 0) \ - return r; \ - } while(0) +#define RSVP_APPLY_RESULT() \ +{ \ + int r = tcf_exts_exec(skb, &f->exts, res); \ + if (r < 0) \ + continue; \ + else if (r > 0) \ + return r; \ +} static int rsvp_classify(struct sk_buff *skb, struct tcf_proto *tp, struct tcf_result *res) --------------030207030206010306030600-- From kaber@trash.net Tue Jan 18 21:09:51 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 21:09:55 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0J59oWB022815 for ; Tue, 18 Jan 2005 21:09:51 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1Cr86B-0003wp-MX; Wed, 19 Jan 2005 06:09:43 +0100 Message-ID: <41EDEB97.3080503@trash.net> Date: Wed, 19 Jan 2005 06:09:43 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: jamal CC: Maillist netdev Subject: More tc action mess Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 474 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev I probably found the reason for the problems with the ipt action you were talking about. netfilter targets, like tc actions, expect a struct sk_buff **, but the ipt action does: struct sk_buff *skb = *pskb; ... ret = p->t->u.kernel.target->target(&skb, skb->dev, NULL, which of course doesn't make much sense. Unfortunately, tcf_action_exec does the same nonsense: int tcf_action_exec(struct sk_buff *skb, struct tc_action *act, ... ret = a->ops->act(&skb, a); This means we must convert all paths on which tcf_action_exec is called to use struct sk_buff ** :( On egress q->enqueue owns the skb, so for this path we must convert the qdiscs classification function and all classifierts. On ingress the skb is owned by netif_receive_skb, so we need to convert the ingress qdisc's enqueue function to take a sk_buff **, or better add a ingress_filter function to avoid changing all enqueue calls in other qdiscs. I have an big, ugly, incomplete patch that does this, but teaching classifiers to behave correctly when the packet changes under them in the middle of classification is hard, so any other solutions are welcome. Regards Patrick From yoshfuji@linux-ipv6.org Tue Jan 18 21:17:39 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 21:17:44 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0J5Hdd0023504 for ; Tue, 18 Jan 2005 21:17:39 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id 8837C33CC2; Wed, 19 Jan 2005 14:18:17 +0900 (JST) Date: Wed, 19 Jan 2005 14:18:17 +0900 (JST) Message-Id: <20050119.141817.84595066.yoshfuji@linux-ipv6.org> To: davem@davemloft.net Cc: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: [PATCH] [IPV6]: kill needless initialization and comparison. From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 475 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Hello. I believe that compilers are clever enough, but anyway... Thanks. ---- [IPV6] kill needless initialization and comparison. Signed-off-by: Hideaki YOSHIFUJI diff -Nru a/net/ipv6/icmp.c b/net/ipv6/icmp.c --- a/net/ipv6/icmp.c 2005-01-19 14:10:16 +09:00 +++ b/net/ipv6/icmp.c 2005-01-19 14:10:16 +09:00 @@ -287,7 +287,7 @@ int iif = 0; int addr_type = 0; int len; - int hlimit = -1; + int hlimit; int err = 0; if ((u8*)hdr < skb->head || (u8*)(hdr+1) > skb->tail) @@ -375,14 +375,12 @@ if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) goto out_dst_release; - if (hlimit < 0) { - if (ipv6_addr_is_multicast(&fl.fl6_dst)) - hlimit = np->mcast_hops; - else - hlimit = np->hop_limit; - if (hlimit < 0) - hlimit = dst_metric(dst, RTAX_HOPLIMIT); - } + if (ipv6_addr_is_multicast(&fl.fl6_dst)) + hlimit = np->mcast_hops; + else + hlimit = np->hop_limit; + if (hlimit < 0) + hlimit = dst_metric(dst, RTAX_HOPLIMIT); msg.skb = skb; msg.offset = skb->nh.raw - skb->data; @@ -433,7 +431,7 @@ struct icmpv6_msg msg; struct dst_entry *dst; int err = 0; - int hlimit = -1; + int hlimit; saddr = &skb->nh.ipv6h->daddr; @@ -463,14 +461,12 @@ if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) goto out_dst_release; - if (hlimit < 0) { - if (ipv6_addr_is_multicast(&fl.fl6_dst)) - hlimit = np->mcast_hops; - else - hlimit = np->hop_limit; - if (hlimit < 0) - hlimit = dst_metric(dst, RTAX_HOPLIMIT); - } + if (ipv6_addr_is_multicast(&fl.fl6_dst)) + hlimit = np->mcast_hops; + else + hlimit = np->hop_limit; + if (hlimit < 0) + hlimit = dst_metric(dst, RTAX_HOPLIMIT); idev = in6_dev_get(skb->dev); -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From kumarkr@us.ibm.com Tue Jan 18 23:50:12 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 18 Jan 2005 23:50:18 -0800 (PST) Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.131]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0J7o4C0006512 for ; Tue, 18 Jan 2005 23:50:11 -0800 Received: from westrelay03.boulder.ibm.com (westrelay03.boulder.ibm.com [9.17.195.12]) by e33.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j0J7nwCO380342 for ; Wed, 19 Jan 2005 02:49:58 -0500 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by westrelay03.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j0J7nwTo340800 for ; Wed, 19 Jan 2005 00:49:58 -0700 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j0J7nvXD014859 for ; Wed, 19 Jan 2005 00:49:58 -0700 Received: from d03mc021.boulder.ibm.com (d03mc021.boulder.ibm.com [9.17.195.205]) by d03av03.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j0J7nviO014856; Wed, 19 Jan 2005 00:49:57 -0700 In-Reply-To: <20050119.092018.07351674.yoshfuji@linux-ipv6.org> Subject: Re: [Ipoverib] [PATCH] IPv6: Add correct padding to IPoIB link addr option To: YOSHIFUJI Hideaki / =?ISO-2022-JP?B?GyRCNUhGIzFRTEAbKEI=?= Cc: davem@davemloft.net, ipoverib@ietf.org, netdev@oss.sgi.com, openib-general@openib.org, roland@topspin.com X-Mailer: Lotus Notes Release 6.5.1IBM February 19, 2004 Message-ID: From: Krishna Kumar Date: Wed, 19 Jan 2005 13:19:55 +0530 X-MIMETrack: Serialize by Router on D03MC021/03/M/IBM(Release 6.51HF338 | June 21, 2004) at 01/19/2005 00:49:56 MIME-Version: 1.0 Content-type: multipart/related; Boundary="0__=08BBE51DDFB3CBDF8f9e8a93df938690918c08BBE51DDFB3CBDF" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 476 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kumarkr@us.ibm.com Precedence: bulk X-list: netdev --0__=08BBE51DDFB3CBDF8f9e8a93df938690918c08BBE51DDFB3CBDF Content-type: multipart/alternative; Boundary="1__=08BBE51DDFB3CBDF8f9e8a93df938690918c08BBE51DDFB3CBDF" --1__=08BBE51DDFB3CBDF8f9e8a93df938690918c08BBE51DDFB3CBDF Content-type: text/plain; charset=ISO-2022-JP Content-transfer-encoding: quoted-printable Hi Roland, Couple of minor comments on this : 1 : In "+static int ndisc_addr_option_pad(unsigned short type)", chang= e the function name to ndisc_lladdr_option_pad() and the argument name to addr_ty= pe, to be more precise ? addr_option seems confusing, unless it is known tha= t this is a LL address option (not a big deal, though). 2. I know memset has optimized check for count, but isn't it better to check for pad before this code since most of time it is going to be zero (unless = you are doing only IB traffic) ? + if (pad) { memset(opt + 2, 0, pad); opt +=3D pad; space -=3D pad; + } 3. I guess there is no clean way to avoid changing all consumers of ll_= addr to not worry about the padding after the length and before the LL address, but i= t would be nice if that were possible (eg via the ndisc_parse_options). Also, Dave/Yoshifuji, can't ndisc_options have just nd_opt_array[5] ins= tead of nd_opt_array[7], with indices-1 being used to store/access the options ? In any case, I = was expecting 6 rather than 7 in the current code, since there are 5 options with the array[0]= being unused. thanks, - KK = YOSHIFUJI Hideaki = / =1B$B5HF#1QL@=1B(B = roland@topspin.com, = Sent by: davem@davemloft.net = netdev-bounce@oss = cc .sgi.com netdev@oss.sgi.com, = ipoverib@ietf.org, = openib-general@openib.org = 01/19/2005 05:50 Subj= ect AM Re: [Ipoverib] [PATCH] IPv6: Add= correct padding to IPoIB link ad= dr option = = = = = = = David, let me tkink about this. Thanks. In article <528y6qej5w.fsf@topspin.com> (at Tue, 18 Jan 2005 09:33:47 -0800), Roland Dreier says: > +++ linux-bk/net/ipv6/ndisc.c 2005-01-14 21:20:55.73674509= 1 -0800 > @@ -169,12 +169,33 @@ > > #define NDISC_OPT_SPACE(len) (((len)+2+7)&~7) > > -static u8 *ndisc_fill_option(u8 *opt, int type, void *data, int data_len) > +/* > + * Return the padding between the option length and the start of the= > + * link addr. Currently only IP-over-InfiniBand needs this, althoug= h > + * if RFC 3831 IPv6-over-Fibre Channel is ever implemented it may > + * also need a pad of 2. > + */ > +static int ndisc_addr_option_pad(unsigned short type) > +{ > + switch (type) { > + case ARPHRD_INFINIBAND: return 2; > + default: return 0; > + } > +} > + > +static u8 *ndisc_fill_addr_option(u8 *opt, int type, void *data, int= data_len, > + unsigned short addr_type) > { > int space =3D NDISC_OPT_SPACE(data_len); > + int pad =3D ndisc_addr_option_pad(addr_type); > > opt[0] =3D type; > opt[1] =3D space>>3; > + > + memset(opt + 2, 0, pad); > + opt +=3D pad; > + space -=3D pad; > + > memcpy(opt+2, data, data_len); > data_len +=3D 2; > opt +=3D data_len; -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA = --1__=08BBE51DDFB3CBDF8f9e8a93df938690918c08BBE51DDFB3CBDF Content-type: text/html; charset=ISO-2022-JP Content-Disposition: inline Content-transfer-encoding: quoted-printable

Hi Roland,

Couple of minor comments on this :

1 : In  "+static int ndisc_addr_option_pad(unsigned short= type)", change the function
name to ndisc_lladdr_option_pad() and the argument name to addr_ty= pe, to be
more precise ? addr_option seems confusing, unless it is known tha= t this is a LL
address option (not a big deal, though).

2. I know memset has optimized check for count, but isn't it better to = check for pad
before this code since most of time it is going to be zero (unless = you are doing only
IB traffic) ?

+ if (pad) {
memset(opt + 2, 0, pad);
opt   +=3D pad;
space -=3D pad;

+ }

3. I guess there is no clean way to avoid changing all consumers of= ll_addr to not worry
   about the padding after the length and before the LL = address, but it would be nice if
   that were possible (eg via the ndisc_parse_options).<= /tt>

Also, Dave/Yoshifuji, can't ndisc_options have just nd_opt_array[5]= instead of nd_opt_array[7],
with indices-1 being used to store/access the options ? In any case= , I was expecting 6 rather
than 7 in the current code, since there are 5 options with the arra= y[0] being unused.

thanks,

- KK

3D"InactiveYOSHIFUJI Hideaki = / =1B$B5HF#1QL@=1B(B <yoshfuji@linux-ipv6.org>


=
          YOSHIFUJI Hideaki / =1B$B5HF#1QL@=1B(B <yosh= fuji@linux-ipv6.org>
          Sent by: netdev-bounce@oss.sgi.com

          01/19/2005 05:50 AM

=
3D""
To
3D""
roland@topspin.com, davem@davemloft.net
3D""
cc
3D""
netdev@oss.sgi.com, ipoverib@ietf.org, openib-general@= openib.org
3D""
Subject
3D""
Re: [Ipoverib] [PATCH] IPv6: Add correct padding to IP= oIB link addr option
=3D""3D""<= /td>

David, let me tkink about this.
Thanks.

In article <528y6qej5w.fsf@topspin.com> (at Tue, 18 Jan 2005 09:3= 3:47 -0800), Roland Dreier <roland@topspin.com> says:

> +++ linux-bk/net/ipv6/ndisc.c 2005-01-14 21:20:55.736745091 -080= 0
> @@ -169,12 +169,33 @@
>  
>  #define NDISC_OPT_SPACE(len) (((len)+2+7)&~7)
>  
> -static u8 *ndisc_fill_option(u8 *opt, int type, void *data, int d= ata_len)
> +/*
> + * Return the padding between the option length and the start of = the
> + * link addr.  Currently only IP-over-InfiniBand needs this,= although
> + * if RFC 3831 IPv6-over-Fibre Channel is ever implemented it may=
> + * also need a pad of 2.
> + */
> +static int ndisc_addr_option_pad(unsigned short type)
> +{
> + switch (type) {
> + case ARPHRD_INFINIBAND: return 2;
> + default:               &nbs= p;return 0;
> + }
> +}
> +
> +static u8 *ndisc_fill_addr_option(u8 *opt, int type, void *data, = int data_len,
> +   unsigned short addr_type)
>  {
>   int space =3D NDISC_OPT_SPACE(data_len);
> + int pad   =3D ndisc_addr_option_pad(addr_type);
>  
>   opt[0] =3D type;
>   opt[1] =3D space>>3;
> +
> + memset(opt + 2, 0, pad);
> + opt   +=3D pad;
> + space -=3D pad;
> +
>   memcpy(opt+2, data, data_len);
>   data_len +=3D 2;
>   opt +=3D data_len;

--
Hideaki YOSHIFUJI @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG FP: 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA


= --1__=08BBE51DDFB3CBDF8f9e8a93df938690918c08BBE51DDFB3CBDF-- --0__=08BBE51DDFB3CBDF8f9e8a93df938690918c08BBE51DDFB3CBDF Content-type: image/gif; name="graycol.gif" Content-Disposition: inline; filename="graycol.gif" Content-ID: <10__=08BBE51DDFB3CBDF8f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 R0lGODlhEAAQAKECAMzMzAAAAP///wAAACH5BAEAAAIALAAAAAAQABAAAAIXlI+py+0PopwxUbpu ZRfKZ2zgSJbmSRYAIf4fT3B0aW1pemVkIGJ5IFVsZWFkIFNtYXJ0U2F2ZXIhAAA7 --0__=08BBE51DDFB3CBDF8f9e8a93df938690918c08BBE51DDFB3CBDF Content-type: image/gif; name="pic32399.gif" Content-Disposition: inline; filename="pic32399.gif" Content-ID: <20__=08BBE51DDFB3CBDF8f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 R0lGODlhWABDALP/AAAAAK04Qf79/o+Gm7WuwlNObwoJFCsoSMDAwGFsmIuezf///wAAAAAAAAAA AAAAACH5BAEAAAgALAAAAABYAEMAQAT/EMlJq704682770RiFMRinqggEUNSHIchG0BCfHhOjAuh EDeUqTASLCbBhQrhG7xis2j0lssNDopE4jfIJhDaggI8YB1sZeZgLVA9YVCpnGagVjV171aRVrYR RghXcAGFhoUETwYxcXNyADJ3GlcSKGAwLwllVC1vjIUHBWsFilKQdI8GA5IcpApeJQt8L09lmgkH LZikoU5wjqcyAMMFrJIDPAKvCFletKSev1HBw8KrxtjZ2tvc3d5VyKtCKW3jfz4uMKmq3xu4N0nK BVoJQmx2LGVOmrqNjjJf2hHAQo/eDwJGTKhQMcgQEEAnEjFS98+RnW3smGkZU6ncCWav/4wYOnAI TihRL/4FEwbp28BXMMcoscQCVxlepL4IGDSCyJyVQOu0o7CjmLN50OZlqWmyFy5/6yBBuji0AxFR M00oQAqNIstqI6qKHUsWRAEAvagsmfUEAImyxgbmUpJk3IklNUtJOUAVLoUr1+wqDGTE4zk+T6FG uQb3SizBCwatiiUgCBN8vrz+zFjVyQ8FWkOlg4NQiZMB5QS8QO3mpOaKnL0Z2EKvNMSILEThKhCg zMKPVxYJh23qm9KNW7pArPynMqZDiErsTMqI+LRi3QAgkFUbXpuFKhSYZALd0O5RKa2z9EYKBbpb qxIKsjUPRgD7I2XYV6wyrOw92ykExP8NW4URhknC5dKGE4v4NENQj2jXjmfNgOZDaXb5glRmXQ33 YEWQYNcZFnrYcIQLNzyTFDQNkXIff0ExVlY4srziQk43inZgL4rwxxINMvpFFAz1KOODHiu+4aEw NEjFl5B3JIKWKF3k6I9bfUGp5ZZcdunll5IA4cuHvQQJ5gcsoCWOOUwgltIwAKRxJgbIkJAQZEq0 2YliZnpZZ4BH3CnYOXldOUOfQoYDqF1LFHbXCrO8xmRsfoXDXJ6ChjCAH3QlhJcT6VWE6FCkfCco CgrMFsROrIEX3o2whVjWDjoJccN3LdggSGXLCdLEgHr1lyU3O3QxhgohNKXJCWv8JQr/PDdaqd6w 2rj1inLiGeiCJoDspAoQlYE6QWLSECehcWIYxIQES6zhbn1iImTHEQyqJ4eIxJJoUBc+3CbBuwZE V5cJPPkIjFDdeEabQbd6WgICTxiiz0f5dBKquXF6k4senwEhYGnKEFJeGrxUZy8dB8gmAXI/sPvH ESfCwVt5hTgYiqQqtdRNHQIU1PJ33ZqmzgE90OwLaoJcnMop1WiMmgkPHQRIrwgFuNV90A3doNKT mrKIN07AnGcI9BQjhCBN4RfA1qIZnMqorJCogKfGQnxSCDilTVIA0yl5ciTovgLuBDKFUDE9aQcw 9SA+rjSNf9/M1gxrj6VwDTS0IUSElMzBfsj0NFXR2kwsV1A5IF1grLgLL/r1R40BZEnuBWgmQEyb jqRwSAt6bqMCOFkvKFN2GPPkUzIm/SCF8z8pVzpbjVnMsy0vOr1hw3SaSRUhpY09v0z0J1FnwzPl fmh+xl4WtR0zGu24I4KbMQm3lnVu2oNWxI9W/lcyzA+mCKF4DBikxb/+UWtOGRiFP8qEwAayIgIA Ow== --0__=08BBE51DDFB3CBDF8f9e8a93df938690918c08BBE51DDFB3CBDF Content-type: image/gif; name="ecblank.gif" Content-Disposition: inline; filename="ecblank.gif" Content-ID: <30__=08BBE51DDFB3CBDF8f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 R0lGODlhEAABAIAAAAAAAP///yH5BAEAAAEALAAAAAAQAAEAAAIEjI8ZBQA7 --0__=08BBE51DDFB3CBDF8f9e8a93df938690918c08BBE51DDFB3CBDF-- From kashyapv@us.ibm.com Wed Jan 19 00:19:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 00:19:23 -0800 (PST) Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.131]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0J8IxfW008540 for ; Wed, 19 Jan 2005 00:19:00 -0800 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e33.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j0J8IrCO638756 for ; Wed, 19 Jan 2005 03:18:53 -0500 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j0J8Ir95450902 for ; Wed, 19 Jan 2005 01:18:53 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j0J8IqpE030851 for ; Wed, 19 Jan 2005 01:18:52 -0700 Received: from sig-9-65-30-18.mts.ibm.com (sig-9-65-30-18.mts.ibm.com [9.65.30.18]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j0J8Ipr9030818; Wed, 19 Jan 2005 01:18:51 -0700 Date: Wed, 19 Jan 2005 00:18:37 -0800 (PST) From: Vivek Kashyap X-X-Sender: kashyapv@localhost.localdomain To: Krishna Kumar cc: YOSHIFUJI Hideaki / =?ISO-2022-JP?B?GyRCNUhGIzFRTEAbKEI=?= , , , , Subject: Re: [Ipoverib] [PATCH] IPv6: Add correct padding to IPoIB link addr option In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 477 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kashyapv@us.ibm.com Precedence: bulk X-list: netdev I suggest that the implementation discussion not be reflected on ipoverib. I've bcc'd to ipoverib for this mail. Those interested in the details can follow it on netdev/openib. Thanks, Vivek On Wed, 19 Jan 2005, Krishna Kumar wrote: > > > > > > Hi Roland, > > Couple of minor comments on this : > > 1 : In "+static int ndisc_addr_option_pad(unsigned short type)", change > the function > name to ndisc_lladdr_option_pad() and the argument name to addr_type, > to be > more precise ? addr_option seems confusing, unless it is known that > this is a LL > address option (not a big deal, though). > > 2. I know memset has optimized check for count, but isn't it better to > check for pad > before this code since most of time it is going to be zero (unless you > are doing only > IB traffic) ? > > + if (pad) { > memset(opt + 2, 0, pad); > opt += pad; > space -= pad; > + } > > 3. I guess there is no clean way to avoid changing all consumers of ll_addr > to not worry > about the padding after the length and before the LL address, but it > would be nice if > that were possible (eg via the ndisc_parse_options). > > Also, Dave/Yoshifuji, can't ndisc_options have just nd_opt_array[5] instead > of nd_opt_array[7], > with indices-1 being used to store/access the options ? In any case, I was > expecting 6 rather > than 7 in the current code, since there are 5 options with the array[0] > being unused. > > thanks, > > - KK > > > > > YOSHIFUJI Hideaki > / $B5HF#1QL@(B > pv6.org> roland@topspin.com, > Sent by: davem@davemloft.net > netdev-bounce@oss cc > .sgi.com netdev@oss.sgi.com, > ipoverib@ietf.org, > openib-general@openib.org > 01/19/2005 05:50 Subject > AM Re: [Ipoverib] [PATCH] IPv6: Add > correct padding to IPoIB link addr > option > > > > > > > > > > > David, let me tkink about this. > Thanks. > > In article <528y6qej5w.fsf@topspin.com> (at Tue, 18 Jan 2005 09:33:47 > -0800), Roland Dreier says: > > > +++ linux-bk/net/ipv6/ndisc.c 2005-01-14 21:20:55.736745091 > -0800 > > @@ -169,12 +169,33 @@ > > > > #define NDISC_OPT_SPACE(len) (((len)+2+7)&~7) > > > > -static u8 *ndisc_fill_option(u8 *opt, int type, void *data, int > data_len) > > +/* > > + * Return the padding between the option length and the start of the > > + * link addr. Currently only IP-over-InfiniBand needs this, although > > + * if RFC 3831 IPv6-over-Fibre Channel is ever implemented it may > > + * also need a pad of 2. > > + */ > > +static int ndisc_addr_option_pad(unsigned short type) > > +{ > > + switch (type) { > > + case ARPHRD_INFINIBAND: return 2; > > + default: return 0; > > + } > > +} > > + > > +static u8 *ndisc_fill_addr_option(u8 *opt, int type, void *data, int > data_len, > > + unsigned short > addr_type) > > { > > int space = NDISC_OPT_SPACE(data_len); > > + int pad = ndisc_addr_option_pad(addr_type); > > > > opt[0] = type; > > opt[1] = space>>3; > > + > > + memset(opt + 2, 0, pad); > > + opt += pad; > > + space -= pad; > > + > > memcpy(opt+2, data, data_len); > > data_len += 2; > > opt += data_len; > > -- > Hideaki YOSHIFUJI @ USAGI Project > GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA > > From klassert@mathematik.tu-chemnitz.de Wed Jan 19 00:31:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 00:31:14 -0800 (PST) Received: from john.hrz.tu-chemnitz.de (john.hrz.tu-chemnitz.de [134.109.132.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0J8V6iX012795 for ; Wed, 19 Jan 2005 00:31:07 -0800 Received: from gareth.mathematik.tu-chemnitz.de ([134.109.40.156]) by john.hrz.tu-chemnitz.de with esmtp (Exim 4.41) id 1CrBF1-0007OB-9p; Wed, 19 Jan 2005 09:31:03 +0100 Received: by gareth.mathematik.tu-chemnitz.de (Postfix, from userid 274) id 1A2863744E; Wed, 19 Jan 2005 09:31:02 +0100 (CET) Date: Wed, 19 Jan 2005 09:31:02 +0100 From: Steffen Klassert To: Andrew Morton , Jeff Garzik Cc: Network Development Mailing List Subject: [PATCH] 3c59x ethtool: provide NIC-specific stats Message-ID: <20050119083102.GD24947@gareth.mathematik.tu-chemnitz.de> Mail-Followup-To: Andrew Morton , Jeff Garzik , Network Development Mailing List Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Scan-Signature: 4f13e4471bca5f924f497d06c94ddf0f X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 478 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: klassert@mathematik.tu-chemnitz.de Precedence: bulk X-list: netdev With this patch get_ethtool_stats() provides the NIC-specific extra stats. Signed-off-by: Steffen Klassert --- vanilla-2.6.11-rc1/drivers/net/3c59x.c Wed Jan 12 11:56:16 2005 +++ linux-2.6.11-rc1/drivers/net/3c59x.c Tue Jan 18 20:17:26 2005 @@ -752,6 +752,12 @@ /* Chip features we care about in vp->capabilities, read from the EEPROM. */ enum ChipCaps { CapBusMaster=0x20, CapPwrMgmt=0x2000 }; +struct vortex_extra_stats { + unsigned long tx_deferred; + unsigned long tx_multiple_collisions; + unsigned long rx_bad_ssd; +}; + struct vortex_private { /* The Rx and Tx rings should be quad-word-aligned. */ struct boom_rx_desc* rx_ring; @@ -763,7 +769,8 @@ struct sk_buff* tx_skbuff[TX_RING_SIZE]; unsigned int cur_rx, cur_tx; /* The next free ring entry */ unsigned int dirty_rx, dirty_tx; /* The ring entries to be free()ed. */ - struct net_device_stats stats; + struct net_device_stats stats; /* Generic stats */ + struct vortex_extra_stats xstats; /* NIC-specific extra stats */ struct sk_buff *tx_skb; /* Packet being eaten by bus master ctrl. */ dma_addr_t tx_skb_dma; /* Allocated DMA address for bus master ctrl DMA. */ @@ -854,18 +861,13 @@ static struct { const char str[ETH_GSTRING_LEN]; } ethtool_stats_keys[] = { - { "rx_packets" }, - { "tx_packets" }, - { "rx_bytes" }, - { "tx_bytes" }, - { "collisions" }, - { "tx_carrier_errors" }, - { "tx_heartbeat_errors" }, - { "tx_window_errors" }, + { "tx_deferred" }, + { "tx_multiple_collisions" }, + { "rx_bad_ssd" }, }; /* number of ETHTOOL_GSTATS u64's */ -#define VORTEX_NUM_STATS 8 +#define VORTEX_NUM_STATS 3 static int vortex_probe1(struct device *gendev, long ioaddr, int irq, int chip_idx, int card_idx); @@ -2871,23 +2873,23 @@ /* Switch to the stats window, and read everything. */ EL3WINDOW(6); vp->stats.tx_carrier_errors += inb(ioaddr + 0); - vp->stats.tx_heartbeat_errors += inb(ioaddr + 1); - /* Multiple collisions. */ inb(ioaddr + 2); + vp->stats.tx_heartbeat_errors += inb(ioaddr + 1); vp->stats.collisions += inb(ioaddr + 3); vp->stats.tx_window_errors += inb(ioaddr + 4); vp->stats.rx_fifo_errors += inb(ioaddr + 5); vp->stats.tx_packets += inb(ioaddr + 6); vp->stats.tx_packets += (inb(ioaddr + 9)&0x30) << 4; - /* Rx packets */ inb(ioaddr + 7); /* Must read to clear */ - /* Tx deferrals */ inb(ioaddr + 8); + /* Rx packets */ inb(ioaddr + 7); /* Must read to clear */ /* Don't bother with register 9, an extension of registers 6&7. If we do use the 6&7 values the atomic update assumption above is invalid. */ - vp->stats.rx_bytes += inw(ioaddr + 10); - vp->stats.tx_bytes += inw(ioaddr + 12); - /* New: On the Vortex we must also clear the BadSSD counter. */ + vp->stats.rx_bytes += inw(ioaddr + 10); + vp->stats.tx_bytes += inw(ioaddr + 12); + /* Extra stats for get_ethtool_stats() */ + vp->xstats.tx_multiple_collisions += inb(ioaddr + 2); + vp->xstats.tx_deferred += inb(ioaddr + 8); EL3WINDOW(4); - inb(ioaddr + 12); + vp->xstats.rx_bad_ssd += inb(ioaddr + 12); { u8 up = inb(ioaddr + 13); @@ -2980,14 +2982,9 @@ update_stats(dev->base_addr, dev); spin_unlock_irqrestore(&vp->lock, flags); - data[0] = vp->stats.rx_packets; - data[1] = vp->stats.tx_packets; - data[2] = vp->stats.rx_bytes; - data[3] = vp->stats.tx_bytes; - data[4] = vp->stats.collisions; - data[5] = vp->stats.tx_carrier_errors; - data[6] = vp->stats.tx_heartbeat_errors; - data[7] = vp->stats.tx_window_errors; + data[0] = vp->xstats.tx_deferred; + data[1] = vp->xstats.tx_multiple_collisions; + data[2] = vp->xstats.rx_bad_ssd; } From yoshfuji@linux-ipv6.org Wed Jan 19 01:01:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 01:01:53 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0J91Y6c014816 for ; Wed, 19 Jan 2005 01:01:34 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id 1D18A33CC2; Wed, 19 Jan 2005 18:02:13 +0900 (JST) Date: Wed, 19 Jan 2005 18:02:12 +0900 (JST) Message-Id: <20050119.180212.65445666.yoshfuji@linux-ipv6.org> To: kumarkr@us.ibm.com Cc: davem@davemloft.net, netdev@oss.sgi.com, openib-general@openib.org, roland@topspin.com, yoshfuji@linux-ipv6.org Subject: Re: [Ipoverib] [PATCH] IPv6: Add correct padding to IPoIB link addr option From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: <20050119.092018.07351674.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 479 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev In article (at Wed, 19 Jan 2005 13:19:55 +0530), Krishna Kumar says: > Couple of minor comments on this : : > 3. I guess there is no clean way to avoid changing all consumers of ll_addr > to not worry > about the padding after the length and before the LL address, but it > would be nice if > that were possible (eg via the ndisc_parse_options). > > Also, Dave/Yoshifuji, can't ndisc_options have just nd_opt_array[5] instead > of nd_opt_array[7], > with indices-1 being used to store/access the options ? In any case, I was > expecting 6 rather > than 7 in the current code, since there are 5 options with the array[0] > being unused. > I'll take care of both. Thank you! --yoshfuji From bunk@stusta.de Wed Jan 19 01:17:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 01:17:34 -0800 (PST) Received: from mailout.stusta.mhn.de (mailout.stusta.mhn.de [141.84.69.5]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0J9HNOZ015804 for ; Wed, 19 Jan 2005 01:17:24 -0800 Received: (qmail 28312 invoked from network); 19 Jan 2005 09:17:17 -0000 Received: from r063144.stusta.swh.mhn.de (10.150.63.144) by mailout.stusta.mhn.de with SMTP; 19 Jan 2005 09:17:17 -0000 Received: by r063144.stusta.swh.mhn.de (Postfix, from userid 1000) id 2D20EBC081; Wed, 19 Jan 2005 10:17:16 +0100 (CET) Date: Wed, 19 Jan 2005 10:17:15 +0100 From: Adrian Bunk To: netdev@oss.sgi.com Cc: linux-kernel@vger.kernel.org Subject: [2.6 patch] kill xfrm_export.c Message-ID: <20050119091715.GQ1841@stusta.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 480 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bunk@stusta.de Precedence: bulk X-list: netdev This patch removes xfrm_export.c and moves the EXPORT_SYMBOL{,_GPL}'s to the files where the actual functions are. Signed-off-by: Adrian Bunk --- diffstat output: net/xfrm/Makefile | 3 - net/xfrm/xfrm_algo.c | 12 +++++++ net/xfrm/xfrm_export.c | 62 ----------------------------------------- net/xfrm/xfrm_input.c | 4 ++ net/xfrm/xfrm_policy.c | 20 ++++++++++++- net/xfrm/xfrm_state.c | 29 +++++++++++++++++-- 6 files changed, 63 insertions(+), 67 deletions(-) --- linux-2.6.11-rc1-mm1-full/net/xfrm/Makefile.old 2005-01-19 09:43:09.000000000 +0100 +++ linux-2.6.11-rc1-mm1-full/net/xfrm/Makefile 2005-01-19 09:43:23.000000000 +0100 @@ -2,7 +2,6 @@ # Makefile for the XFRM subsystem. # -obj-$(CONFIG_XFRM) := xfrm_policy.o xfrm_state.o xfrm_input.o xfrm_algo.o \ - xfrm_export.o +obj-$(CONFIG_XFRM) := xfrm_policy.o xfrm_state.o xfrm_input.o xfrm_algo.o obj-$(CONFIG_XFRM_USER) += xfrm_user.o --- linux-2.6.11-rc1-mm1-full/net/xfrm/xfrm_state.c.old 2005-01-19 09:44:46.000000000 +0100 +++ linux-2.6.11-rc1-mm1-full/net/xfrm/xfrm_state.c 2005-01-19 09:58:22.000000000 +0100 @@ -17,6 +17,7 @@ #include #include #include +#include #include /* Each xfrm_state may be linked to two tables: @@ -38,6 +39,7 @@ static struct list_head xfrm_state_byspi[XFRM_DST_HSIZE]; DECLARE_WAIT_QUEUE_HEAD(km_waitq); +EXPORT_SYMBOL(km_waitq); static DEFINE_RWLOCK(xfrm_state_afinfo_lock); static struct xfrm_state_afinfo *xfrm_state_afinfo[NPROTO]; @@ -193,6 +195,7 @@ } return x; } +EXPORT_SYMBOL(xfrm_state_alloc); void __xfrm_state_destroy(struct xfrm_state *x) { @@ -203,6 +206,7 @@ spin_unlock_bh(&xfrm_state_gc_lock); schedule_work(&xfrm_state_gc_work); } +EXPORT_SYMBOL(__xfrm_state_destroy); static void __xfrm_state_delete(struct xfrm_state *x) { @@ -241,6 +245,7 @@ __xfrm_state_delete(x); spin_unlock_bh(&x->lock); } +EXPORT_SYMBOL(xfrm_state_delete); void xfrm_state_flush(u8 proto) { @@ -267,6 +272,7 @@ spin_unlock_bh(&xfrm_state_lock); wake_up(&km_waitq); } +EXPORT_SYMBOL(xfrm_state_flush); static int xfrm_init_tempsel(struct xfrm_state *x, struct flowi *fl, @@ -392,6 +398,7 @@ __xfrm_state_insert(x); spin_unlock_bh(&xfrm_state_lock); } +EXPORT_SYMBOL(xfrm_state_insert); static struct xfrm_state *__xfrm_find_acq_byseq(u32 seq); @@ -444,6 +451,7 @@ return err; } +EXPORT_SYMBOL(xfrm_state_add); int xfrm_state_update(struct xfrm_state *x) { @@ -508,6 +516,7 @@ return err; } +EXPORT_SYMBOL(xfrm_state_update); int xfrm_state_check_expire(struct xfrm_state *x) { @@ -531,6 +540,7 @@ km_state_expired(x, 0); return 0; } +EXPORT_SYMBOL(xfrm_state_check_expire); static int xfrm_state_check_space(struct xfrm_state *x, struct sk_buff *skb) { @@ -553,6 +563,7 @@ err: return err; } +EXPORT_SYMBOL(xfrm_state_check); struct xfrm_state * xfrm_state_lookup(xfrm_address_t *daddr, u32 spi, u8 proto, @@ -569,6 +580,7 @@ xfrm_state_put_afinfo(afinfo); return x; } +EXPORT_SYMBOL(xfrm_state_lookup); struct xfrm_state * xfrm_find_acq(u8 mode, u32 reqid, u8 proto, @@ -586,6 +598,7 @@ xfrm_state_put_afinfo(afinfo); return x; } +EXPORT_SYMBOL(xfrm_find_acq); /* Silly enough, but I'm lazy to build resolution list */ @@ -614,7 +627,8 @@ spin_unlock_bh(&xfrm_state_lock); return x; } - +EXPORT_SYMBOL(xfrm_find_acq_byseq); + u32 xfrm_get_acqseq(void) { u32 res; @@ -626,6 +640,7 @@ spin_unlock_bh(&acqseq_lock); return res; } +EXPORT_SYMBOL(xfrm_get_acqseq); void xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi) @@ -666,6 +681,7 @@ wake_up(&km_waitq); } } +EXPORT_SYMBOL(xfrm_alloc_spi); int xfrm_state_walk(u8 proto, int (*func)(struct xfrm_state *, int, void*), void *data) @@ -700,7 +716,7 @@ spin_unlock_bh(&xfrm_state_lock); return err; } - +EXPORT_SYMBOL(xfrm_state_walk); int xfrm_replay_check(struct xfrm_state *x, u32 seq) { @@ -726,6 +742,7 @@ } return 0; } +EXPORT_SYMBOL(xfrm_replay_check); void xfrm_replay_advance(struct xfrm_state *x, u32 seq) { @@ -745,6 +762,7 @@ x->replay.bitmap |= (1U << diff); } } +EXPORT_SYMBOL(xfrm_replay_advance); static struct list_head xfrm_km_list = LIST_HEAD_INIT(xfrm_km_list); static DEFINE_RWLOCK(xfrm_km_lock); @@ -797,6 +815,7 @@ read_unlock(&xfrm_km_lock); return err; } +EXPORT_SYMBOL(km_new_mapping); void km_policy_expired(struct xfrm_policy *pol, int dir, int hard) { @@ -850,6 +869,7 @@ kfree(data); return err; } +EXPORT_SYMBOL(xfrm_user_policy); int xfrm_register_km(struct xfrm_mgr *km) { @@ -858,6 +878,7 @@ write_unlock_bh(&xfrm_km_lock); return 0; } +EXPORT_SYMBOL(xfrm_register_km); int xfrm_unregister_km(struct xfrm_mgr *km) { @@ -866,6 +887,7 @@ write_unlock_bh(&xfrm_km_lock); return 0; } +EXPORT_SYMBOL(xfrm_unregister_km); int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo) { @@ -885,6 +907,7 @@ write_unlock(&xfrm_state_afinfo_lock); return err; } +EXPORT_SYMBOL(xfrm_state_register_afinfo); int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo) { @@ -906,6 +929,7 @@ write_unlock(&xfrm_state_afinfo_lock); return err; } +EXPORT_SYMBOL(xfrm_state_unregister_afinfo); static struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned short family) { @@ -940,6 +964,7 @@ x->tunnel = NULL; } } +EXPORT_SYMBOL(xfrm_state_delete_tunnel); void __init xfrm_state_init(void) { --- linux-2.6.11-rc1-mm1-full/net/xfrm/xfrm_policy.c.old 2005-01-19 09:47:53.000000000 +0100 +++ linux-2.6.11-rc1-mm1-full/net/xfrm/xfrm_policy.c 2005-01-19 10:00:08.000000000 +0100 @@ -21,14 +21,17 @@ #include #include #include +#include #include #include DECLARE_MUTEX(xfrm_cfg_sem); +EXPORT_SYMBOL(xfrm_cfg_sem); static DEFINE_RWLOCK(xfrm_policy_lock); struct xfrm_policy *xfrm_policy_list[XFRM_POLICY_MAX*2]; +EXPORT_SYMBOL(xfrm_policy_list); static DEFINE_RWLOCK(xfrm_policy_afinfo_lock); static struct xfrm_policy_afinfo *xfrm_policy_afinfo[NPROTO]; @@ -62,6 +65,7 @@ xfrm_policy_put_afinfo(afinfo); return err; } +EXPORT_SYMBOL(xfrm_register_type); int xfrm_unregister_type(struct xfrm_type *type, unsigned short family) { @@ -82,6 +86,7 @@ xfrm_policy_put_afinfo(afinfo); return err; } +EXPORT_SYMBOL(xfrm_unregister_type); struct xfrm_type *xfrm_get_type(u8 proto, unsigned short family) { @@ -112,6 +117,7 @@ xfrm_policy_put_afinfo(afinfo); return type; } +EXPORT_SYMBOL(xfrm_get_type); int xfrm_dst_lookup(struct xfrm_dst **dst, struct flowi *fl, unsigned short family) @@ -129,6 +135,7 @@ xfrm_policy_put_afinfo(afinfo); return err; } +EXPORT_SYMBOL(xfrm_dst_lookup); void xfrm_put_type(struct xfrm_type *type) { @@ -234,6 +241,7 @@ } return policy; } +EXPORT_SYMBOL(xfrm_policy_alloc); /* Destroy xfrm_policy: descendant resources must be released to this moment. */ @@ -250,6 +258,7 @@ kfree(policy); } +EXPORT_SYMBOL(__xfrm_policy_destroy); static void xfrm_policy_gc_kill(struct xfrm_policy *policy) { @@ -373,6 +382,7 @@ } return 0; } +EXPORT_SYMBOL(xfrm_policy_insert); struct xfrm_policy *xfrm_policy_bysel(int dir, struct xfrm_selector *sel, int delete) @@ -396,6 +406,7 @@ } return pol; } +EXPORT_SYMBOL(xfrm_policy_bysel); struct xfrm_policy *xfrm_policy_byid(int dir, u32 id, int delete) { @@ -418,6 +429,7 @@ } return pol; } +EXPORT_SYMBOL(xfrm_policy_byid); void xfrm_policy_flush(void) { @@ -438,6 +450,7 @@ atomic_inc(&flow_cache_genid); write_unlock_bh(&xfrm_policy_lock); } +EXPORT_SYMBOL(xfrm_policy_flush); int xfrm_policy_walk(int (*func)(struct xfrm_policy *, int, int, void*), void *data) @@ -470,7 +483,7 @@ read_unlock_bh(&xfrm_policy_lock); return error; } - +EXPORT_SYMBOL(xfrm_policy_walk); /* Find policy to apply to this flow. */ @@ -845,6 +858,7 @@ *dst_p = NULL; return err; } +EXPORT_SYMBOL(xfrm_lookup); /* When skb is transformed back to its "native" form, we have to * check policy restrictions. At the moment we make this in maximally @@ -981,6 +995,7 @@ xfrm_pol_put(pol); return 0; } +EXPORT_SYMBOL(__xfrm_policy_check); int __xfrm_route_forward(struct sk_buff *skb, unsigned short family) { @@ -991,6 +1006,7 @@ return xfrm_lookup(&skb->dst, &fl, NULL, 0) == 0; } +EXPORT_SYMBOL(__xfrm_route_forward); /* Optimize later using cookies and generation ids. */ @@ -1163,6 +1179,7 @@ write_unlock(&xfrm_policy_afinfo_lock); return err; } +EXPORT_SYMBOL(xfrm_policy_register_afinfo); int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo) { @@ -1190,6 +1207,7 @@ write_unlock(&xfrm_policy_afinfo_lock); return err; } +EXPORT_SYMBOL(xfrm_policy_unregister_afinfo); static struct xfrm_policy_afinfo *xfrm_policy_get_afinfo(unsigned short family) { --- linux-2.6.11-rc1-mm1-full/net/xfrm/xfrm_input.c.old 2005-01-19 09:53:59.000000000 +0100 +++ linux-2.6.11-rc1-mm1-full/net/xfrm/xfrm_input.c 2005-01-19 09:55:24.000000000 +0100 @@ -8,6 +8,7 @@ */ #include +#include #include #include @@ -20,6 +21,7 @@ xfrm_state_put(sp->x[i].xvec); kmem_cache_free(secpath_cachep, sp); } +EXPORT_SYMBOL(__secpath_destroy); struct sec_path *secpath_dup(struct sec_path *src) { @@ -40,6 +42,7 @@ atomic_set(&sp->refcnt, 1); return sp; } +EXPORT_SYMBOL(secpath_dup); /* Fetch spi and seq from ipsec header */ @@ -73,6 +76,7 @@ *seq = *(u32*)(skb->h.raw + offset_seq); return 0; } +EXPORT_SYMBOL(xfrm_parse_spi); void __init xfrm_input_init(void) { --- linux-2.6.11-rc1-mm1-full/net/xfrm/xfrm_algo.c.old 2005-01-19 10:00:47.000000000 +0100 +++ linux-2.6.11-rc1-mm1-full/net/xfrm/xfrm_algo.c 2005-01-19 10:03:51.000000000 +0100 @@ -315,6 +315,7 @@ } return NULL; } +EXPORT_SYMBOL_GPL(xfrm_aalg_get_byid); struct xfrm_algo_desc *xfrm_ealg_get_byid(int alg_id) { @@ -330,6 +331,7 @@ } return NULL; } +EXPORT_SYMBOL_GPL(xfrm_ealg_get_byid); struct xfrm_algo_desc *xfrm_calg_get_byid(int alg_id) { @@ -345,6 +347,7 @@ } return NULL; } +EXPORT_SYMBOL_GPL(xfrm_calg_get_byid); struct xfrm_algo_desc *xfrm_aalg_get_byname(char *name) { @@ -363,6 +366,7 @@ } return NULL; } +EXPORT_SYMBOL_GPL(xfrm_aalg_get_byname); struct xfrm_algo_desc *xfrm_ealg_get_byname(char *name) { @@ -381,6 +385,7 @@ } return NULL; } +EXPORT_SYMBOL_GPL(xfrm_ealg_get_byname); struct xfrm_algo_desc *xfrm_calg_get_byname(char *name) { @@ -399,6 +404,7 @@ } return NULL; } +EXPORT_SYMBOL_GPL(xfrm_calg_get_byname); struct xfrm_algo_desc *xfrm_aalg_get_byidx(unsigned int idx) { @@ -407,6 +413,7 @@ return &aalg_list[idx]; } +EXPORT_SYMBOL_GPL(xfrm_aalg_get_byidx); struct xfrm_algo_desc *xfrm_ealg_get_byidx(unsigned int idx) { @@ -415,6 +422,7 @@ return &ealg_list[idx]; } +EXPORT_SYMBOL_GPL(xfrm_ealg_get_byidx); /* * Probe for the availability of crypto algorithms, and set the available @@ -447,6 +455,7 @@ } #endif } +EXPORT_SYMBOL_GPL(xfrm_probe_algs); int xfrm_count_auth_supported(void) { @@ -457,6 +466,7 @@ n++; return n; } +EXPORT_SYMBOL_GPL(xfrm_count_auth_supported); int xfrm_count_enc_supported(void) { @@ -467,6 +477,7 @@ n++; return n; } +EXPORT_SYMBOL_GPL(xfrm_count_enc_supported); /* Move to common area: it is shared with AH. */ @@ -541,6 +552,7 @@ if (len) BUG(); } +EXPORT_SYMBOL_GPL(skb_icv_walk); #if defined(CONFIG_INET_ESP) || defined(CONFIG_INET_ESP_MODULE) || defined(CONFIG_INET6_ESP) || defined(CONFIG_INET6_ESP_MODULE) --- linux-2.6.11-rc1-mm1-full/net/xfrm/xfrm_export.c 2005-01-14 12:58:51.000000000 +0100 +++ /dev/null 2004-11-25 03:16:25.000000000 +0100 @@ -1,62 +0,0 @@ -#include -#include - -EXPORT_SYMBOL(xfrm_user_policy); -EXPORT_SYMBOL(km_waitq); -EXPORT_SYMBOL(km_new_mapping); -EXPORT_SYMBOL(xfrm_cfg_sem); -EXPORT_SYMBOL(xfrm_policy_alloc); -EXPORT_SYMBOL(__xfrm_policy_destroy); -EXPORT_SYMBOL(xfrm_lookup); -EXPORT_SYMBOL(__xfrm_policy_check); -EXPORT_SYMBOL(__xfrm_route_forward); -EXPORT_SYMBOL(xfrm_state_alloc); -EXPORT_SYMBOL(__xfrm_state_destroy); -EXPORT_SYMBOL(xfrm_state_insert); -EXPORT_SYMBOL(xfrm_state_add); -EXPORT_SYMBOL(xfrm_state_update); -EXPORT_SYMBOL(xfrm_state_check_expire); -EXPORT_SYMBOL(xfrm_state_check); -EXPORT_SYMBOL(xfrm_state_lookup); -EXPORT_SYMBOL(xfrm_state_register_afinfo); -EXPORT_SYMBOL(xfrm_state_unregister_afinfo); -EXPORT_SYMBOL(xfrm_state_delete_tunnel); -EXPORT_SYMBOL(xfrm_replay_check); -EXPORT_SYMBOL(xfrm_replay_advance); -EXPORT_SYMBOL(__secpath_destroy); -EXPORT_SYMBOL(secpath_dup); -EXPORT_SYMBOL(xfrm_get_acqseq); -EXPORT_SYMBOL(xfrm_parse_spi); -EXPORT_SYMBOL(xfrm_register_type); -EXPORT_SYMBOL(xfrm_unregister_type); -EXPORT_SYMBOL(xfrm_get_type); -EXPORT_SYMBOL(xfrm_register_km); -EXPORT_SYMBOL(xfrm_unregister_km); -EXPORT_SYMBOL(xfrm_state_delete); -EXPORT_SYMBOL(xfrm_state_walk); -EXPORT_SYMBOL(xfrm_find_acq_byseq); -EXPORT_SYMBOL(xfrm_find_acq); -EXPORT_SYMBOL(xfrm_alloc_spi); -EXPORT_SYMBOL(xfrm_state_flush); -EXPORT_SYMBOL(xfrm_policy_bysel); -EXPORT_SYMBOL(xfrm_policy_insert); -EXPORT_SYMBOL(xfrm_policy_walk); -EXPORT_SYMBOL(xfrm_policy_flush); -EXPORT_SYMBOL(xfrm_policy_byid); -EXPORT_SYMBOL(xfrm_policy_list); -EXPORT_SYMBOL(xfrm_dst_lookup); -EXPORT_SYMBOL(xfrm_policy_register_afinfo); -EXPORT_SYMBOL(xfrm_policy_unregister_afinfo); - -EXPORT_SYMBOL_GPL(xfrm_probe_algs); -EXPORT_SYMBOL_GPL(xfrm_count_auth_supported); -EXPORT_SYMBOL_GPL(xfrm_count_enc_supported); -EXPORT_SYMBOL_GPL(xfrm_aalg_get_byidx); -EXPORT_SYMBOL_GPL(xfrm_ealg_get_byidx); -EXPORT_SYMBOL_GPL(xfrm_aalg_get_byid); -EXPORT_SYMBOL_GPL(xfrm_ealg_get_byid); -EXPORT_SYMBOL_GPL(xfrm_calg_get_byid); -EXPORT_SYMBOL_GPL(xfrm_aalg_get_byname); -EXPORT_SYMBOL_GPL(xfrm_ealg_get_byname); -EXPORT_SYMBOL_GPL(xfrm_calg_get_byname); -EXPORT_SYMBOL_GPL(skb_icv_walk); From tgraf@suug.ch Wed Jan 19 03:46:50 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 03:46:56 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JBknUB025017 for ; Wed, 19 Jan 2005 03:46:50 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 9DC4AF; Wed, 19 Jan 2005 12:46:26 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 9E8F01C0EA; Wed, 19 Jan 2005 12:47:08 +0100 (CET) Date: Wed, 19 Jan 2005 12:47:08 +0100 From: Thomas Graf To: Patrick McHardy Cc: "David S. Miller" , Maillist netdev Subject: Re: [PATCH PKT_SCHED 0/4]: more fixes Message-ID: <20050119114708.GX26856@postel.suug.ch> References: <41EDE44E.9050609@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41EDE44E.9050609@trash.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 481 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * Patrick McHardy <41EDE44E.9050609@trash.net> 2005-01-19 05:38 > o [PKT_SCHED]: fix CONFIG_NET_CLS_ACT skb leaks in HFSC/CBQ > o [PKT_SCHED]: cls_route: fix tcf_exts fallout > o [PKT_SCHED]: cls_api.c: fix module reference leak on module load > o [PKT_SCHED]: cls_rsvp: fix tcf_exts fallout Good catches. They all look good from here. From hadi@cyberus.ca Wed Jan 19 05:26:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 05:26:58 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JDQr2a001343 for ; Wed, 19 Jan 2005 05:26:54 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1CrFrF-0001WU-K0 for netdev@oss.sgi.com; Wed, 19 Jan 2005 08:26:49 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CrFrE-0002iD-NO; Wed, 19 Jan 2005 08:26:48 -0500 Subject: Re: [PATCH PKT_SCHED 4/4]: fix CONFIG_NET_CLS_ACT skb leaks in HFSC/CBQ From: jamal Reply-To: hadi@cyberus.ca To: Patrick McHardy Cc: "David S. Miller" , Maillist netdev In-Reply-To: <41EDE462.9040602@trash.net> References: <41EDE462.9040602@trash.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1106141206.1047.937.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 19 Jan 2005 08:26:46 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 482 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev I dont have time, but please double check that the following still applies: 1) A qdisc receiving a STOLEN/QUEUED/SHOT signal from the classification result MUST free the packet and immediately stop processing that packet. The infrastructure code will clone packets if they want to steal or queue it. 2) Return code of qdisc from enqueue function need to be dealt with care. For example if the packet is localy generated and it is a TCP packet you could confuse the stack by telling it the packet was dropped because it will retransmit (and some things will happen with the window adjustments). 3) packets that are dropped because of a full Q should continue to return a XMIT_DROP (you want TCP for example to know about this) cheers, jamal On Tue, 2005-01-18 at 23:38, Patrick McHardy wrote: > # This is a BitKeeper generated diff -Nru style patch. > # From kaber@trash.net Wed Jan 19 05:34:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 05:34:29 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JDYOZ4002102 for ; Wed, 19 Jan 2005 05:34:24 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CrFxy-0005J4-Hs; Wed, 19 Jan 2005 14:33:46 +0100 Message-ID: <41EE61BA.4030406@trash.net> Date: Wed, 19 Jan 2005 14:33:46 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: hadi@cyberus.ca CC: "David S. Miller" , Maillist netdev Subject: Re: [PATCH PKT_SCHED 4/4]: fix CONFIG_NET_CLS_ACT skb leaks in HFSC/CBQ References: <41EDE462.9040602@trash.net> <1106141206.1047.937.camel@jzny.localdomain> In-Reply-To: <1106141206.1047.937.camel@jzny.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 483 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev jamal wrote: >I dont have time, but please double check that the following still >applies: > >1) A qdisc receiving a STOLEN/QUEUED/SHOT signal from the classification >result MUST free the packet and immediately stop processing that packet. >The infrastructure code will clone packets if they want to steal or >queue it. > It does now. Before there were things like "unsigned int len = skb->len" after the call to tc_classify. >2) Return code of qdisc from enqueue function need to be dealt with >care. For example if the packet is localy generated and it is a TCP >packet you could confuse the stack by telling it the packet was dropped >because it will retransmit (and some things will happen with the window >adjustments). > TC_ACT_SHOT => NET_XMIT_DROP TC_ACT_STOLEN | TC_ACT_QUEUED => NET_XMIT_SUCCESS >3) packets that are dropped because of a full Q should continue to >return a XMIT_DROP (you want TCP for example to know about this) > They do. From hadi@cyberus.ca Wed Jan 19 05:35:19 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 05:35:23 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JDZJ23002466 for ; Wed, 19 Jan 2005 05:35:19 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1CrFzO-0006FR-Di for netdev@oss.sgi.com; Wed, 19 Jan 2005 08:35:14 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CrFzJ-0004UW-EL; Wed, 19 Jan 2005 08:35:09 -0500 Subject: Re: path: module replay From: jamal Reply-To: hadi@cyberus.ca To: Patrick McHardy Cc: Thomas Graf , "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <41EDE15B.40300@trash.net> References: <1105900522.1090.798.camel@jzny.localdomain> <41EAB74F.6060507@trash.net> <20050116185630.GZ26856@postel.suug.ch> <1105903033.1097.829.camel@jzny.localdomain> <1105903960.1097.836.camel@jzny.localdomain> <41EDE15B.40300@trash.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1106141706.1048.953.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 19 Jan 2005 08:35:07 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 484 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Tue, 2005-01-18 at 23:26, Patrick McHardy wrote: > jamal wrote: > > >Ok, here is the last patch. I think module replay should be done from > >that spot and to be consistent as well from cls_api.c for legacy stuff. > >I also fixed a module ref count leak. > >the act_api piece is dependent on what i sent earlier for namsiz. > >the cls_api change i believe conflicts with what Thomas sent yesterday. > > > +replay: > act = tcf_action_init_1(tb[i], est, name, ovr, bind, err); > - if (act == NULL) > - goto err; > + if (act == NULL) { > + if (*err == -EAGAIN) > + goto replay; > + goto err_out; > + } > > This part is wrong. And we exchanged emails on this topic already in private and you said you will fix and send out the patch;-> So please do just that or you can wait until i have more time and my hardware at the same spot. cheers, jamal From korpela@jill.ssl.berkeley.edu Wed Jan 19 05:45:50 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 05:45:55 -0800 (PST) Received: from jill.ssl.berkeley.edu (jill.SSL.Berkeley.EDU [128.32.18.174]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JDjouW005297 for ; Wed, 19 Jan 2005 05:45:50 -0800 Received: (from korpela@localhost) by jill.ssl.berkeley.edu (8.9.3p2/8.9.3) id FAA08320 for netdev@oss.sgi.com; Wed, 19 Jan 2005 05:45:45 -0800 (PST) Date: Wed, 19 Jan 2005 05:45:45 -0800 (PST) From: "Eric J. Korpela" Message-Id: <200501191345.FAA08320@jill.ssl.berkeley.edu> Subject: Re: [Spam:********* SpamScore] Re: excel document MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----8280-8280-8280-8280-----" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 485 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: korpela@ssl.berkeley.edu Precedence: bulk X-list: netdev This is a multi-part message in MIME format ------8280-8280-8280-8280----- Content-Type: text/plain Hi All, Spam has finally gotten bad enough that I need to rework my mail setup. Unfortunately, it's gotten to the point where 1000 spams a day were making it through my spam filter and an additional 10000 were being deleted unread. The result was that I was still getting too much spam and I was missing some important messages. The message you just sent didn't get through because your email address isn't yet on my "allowed" list. Please resend your message with the code in the image below included somewhere in the subject line. You should only need to do this once. Once you are on the list, any messages from your email address should get through. Sorry for the trouble. Eric ------8280-8280-8280-8280----- Content-Type: image/gif; name="code.gif" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="code.gif" R0lGODlhLAE6APABAAAAAP///yH5BAAAAAAAIf4yIEltYWdlIGdlbmVyYXRlZCBieSBBRlBM IEdob3N0c2NyaXB0IChkZXZpY2U9cGJtKQoALAAAAAAsAToAAAL+BAgQIECAAAECBAgQIECA AAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECA AAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECA AAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECA AAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECA AAECBAgQIECAAAECBAgQIECAAAECBAj+ECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBA gAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBA gAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBA gAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBA gAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBA gAABAgQIECD+QIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAg QIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAg QIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAg QIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAg QIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQID+AAECBAgQ IECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQ IECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQ IECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQ IECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQ IECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAH+AgQIECBAgAABAgQIECBAgAABAgQI ECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQI ECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQI ECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQI ECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQI ECBAgAABAgQIECBAgAABAgT+CBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIE CBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIE CBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIE CBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIE CBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIE CBD+IECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAEC BAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAEC BAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAEC BAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAEC BAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIED+gAABAgQIECBAgAAB AgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAAB AgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAAB AgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAAB AgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAAB AgQIECBAgAABAgQIECBAgAABAgQIECBAgAD+AQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAA AQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAA AQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAA AQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIQJEyZMmDAhQIAA AQIEmDBhwoQJEwIECBAgQIAJEyZMmDAhQIAAAQIEmDBhwoQJEwIECBAgQIAJEyZMmDAhQIAA AQIECBAgQIAAAQL+BAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECA AAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgwYcKE CRMmTBgQIECAABMmTJgwYcKECRMmBAgwYcKECRMmTJgwYUKAABMmTJgwYcKECRMmBAgwYcKE CRMmTJgwYUKAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECA AAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAj+ECBA gAABJkyYMGHChAkTJgwIECDChAkTJkyYMGHChAkBIkyYMGHChAkTJkyYECDChAkTJkyYMGHC hAkBIkyYMGHChAkTJkyYECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBA gAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBA gAABAgQIECBAhAkTJgQIECDChAkTAgSYMGHCgAABIkyYMGFCgAkTJgwIECDChAkTJgSYMGHC gAABIkyYMGFCgAkTJgwIECDChAkTJgQIECBAgAABAgQIECD+QIAAAQIECBAgQIAAAQIECBAg QIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAg QIAAAQIECBAgQIAAAQIECBBhwoQBAQIECDBhwoQAESZMGBAgQIAAEQZEmBBhwoQBAQIECBBh QIQJESZMGBAgQIAAEQZEmBBhwoQBAQIECBBhQIQJAQIECBAgQIAAAQIECBAgQIAAAQIECBAg QIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAg QIAAAQIECBAgQIAAAQIECBAgQID+AAECTJgwIECECRMCBJgwYUCECRMCBJgwYUCAAREmRJgw IUCACRMGBBgQYUKECRMCBJgwYUCAAREmRJgwIUCACRMGBBgQYUKAAAECBAgQIECAAAECBAgQ IECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQ IECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAABMmBIgwYcKECQEiTBgwYcKAABMmTJgw IECECRMmDAgwYcKECQMCRJgwYcKAABMmTJgwIECECRMmDAgwYcKECQMCRJgQIECAAAECBAgQ IECAAAH+AgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQI ECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECDAhAkBJkyYMGHCgAgTJkyY ECDChAkTJkwIEGHChAkBIkyYMGHChAARJkyYECDChAkTJkwIEGHChAkBIkyYMGHChAARJgQI ECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQI ECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgT+iDBhQIQJEyZM mDAhwIQJEyYEmDBhwoQJEwJEmDBhQoAJEyZMmDAhQIQJEyYEmDBhwoQJEwJEmDBhQoAJEyZM mDAhQIQJAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIE CBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAASJM GBBhwoQJEyZMGDBhwoQBASZMGBBgwoQBESZMGBBgwoQBASZMGBBhwoQBASZMGBBgwoQBESZM GBBgwoQBASZMGBBhQoAAAQIECBAgQIAAAQIECBD+IECAAAECBAgQIECAAAECBAgQIECAAAEC BAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAEC BAgQIECACBMGRJgwYcKECRMGRJgwYUCACRMCBIgwYcKECRMGBJgwIUCACBMmTJgwYUCACRMC BIgwYcKECRMGBJgwIUCACBMmTJgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAEC BAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAEC BAgQIECAAAECBAgQIML+hAABAgQIECBAgAARJkwYEGHCgAABIkyYMGHChAERJgwIECDChAkT JkwYEGHCgAABIkyYMGHChAERJgwIECDChAkTJgQIECBAgAABAgQIECBAgAABAgQIECBAgAAB AgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAAB AgQIECBAgAABAgQIECBAgAABAgSIMCFAgAABAgQIECBAhAkTBkSYMCBAgAATJkyYMGFAhAkD AgQIMGHChAkTBkSYMCBAgAATJkyYMGFAhAkDAgQIMGHChAkBAgQIECBAgAABAgQIECBAgAD+ AQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAA AQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAASJMCBBhwoQJEyZMmDBhwoQBESYMCBAgQIAA AQJMGBBhwoAAAQIECBAgwIQBESYMCBAgQIAAAQJMGBBhwoAAAQIECBAgQIAAAQIECBAgQIAA AQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAA AQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAIEwL+RJgwYcKECRMmTJgwYUCE CRMCBAgwYcKECRMGRJgwIUCAABMmTJgwYUCECRMCBAgwYcKECRMGRJgwIUCAABMmTJgQIECA AAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECA AAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIMKEAREmTJgwYcKE CRMmTBgQYMKEAQEiTJgwYcKEAQEmTBgQIMKECRMmTBgQYMKEAQEiTJgwYcKEAQEmTBgQIMKE CRMmBAgQIECAAAECBAgQIECAAAECBAj+ECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBA gAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgSIMGFA hAkTJkyYMGHChAkTJgSYMGHChAkTJkyYMGFCgAkTJkyYMGHChAkTJgSYMGHChAkTJkyYMGFC gAkTJkyYMGHChAkBAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBA gAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBA gAABIkyYEGD+woQJEyZMGDBhwoQJASJMmDBhwoQBESZMmBAgwoQJEyZMGBBhwoQJASJMmDBh woQBESZMmBAgwoQJEyZMGBBhQoAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAg QIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAg QIAAAQIECBAgQIAAEyYMiDBhwoQJEwJEmDBhwoAAEyZMmDAhQIQJEyYMCDBhwoQJEwJEmDBh woAAEyZMmDAhQIQJEyYMCDBhwoQJEwJEmBAgQIAAAQIECBAgQIAAAQIECBAgQID+AAECBAgQ IECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQ IECAAAECBAgQIECAAAECBAgQIMCECRMCBJgwYUCAABMmRJgwIUCACRMGBAgwYUKECRMCBJgw YUCAABMmRJgwIUCACRMGBAgwYUKECRMCBJgwYUCAABMmBAgQIECAAAECBAgQIECAAAECBAgQ IECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQ IECAAAECBAgQIECAAAECBAgQIECAAAECBAgQYcKEAQH+AgQIEGDChAkRJkwYECBAgAABJkyY EGHChAEBAgQIEGDChAkRJkwYECBAgAABJkyYEGHChAEBAgQIEGDChAkBAgQIECBAgAABAgQI ECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQI ECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgSYMGHCgAABAkyYMGFCgAkTJgwI ECDAhAkTJgSYMGHCgAABAkyYMGFCgAkTJgwIECDAhAkTJgSYMGHCgAABAkyYMGFCgAABAgQI ECBAgAABAgQIECBAgAABAgT+CBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIE CBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAASJMmDBhwoQJEyZM GBAgwoQJEyZMmDBhwoQBASJMmDBhwoQJEyZMGBAgwoQJEyZMmDBhwoQBASJMmDBhwoQJEyZM GBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIE CBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAEyZM mDD+YcKECQMCBAgwYcKECRMmTJgwIECAABMmTJgwYcKECQMCBAgwYcKECRMmTJgwIECAABMm TJgwYcKECQMCBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAEC BAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAEC BAgQIECACRMmTJgwYUCAAAECBJgwYcKECRMGBAgQIECACRMmTJgwYUCAAAECBJgwYcKECRMG BAgQIECACRMmTJgwYUCAAAECBAgQIECAAAECBAgQIECAAAECBAgQIED+gAABAgQIECBAgAAB AgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAAB AgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAAB AgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAAB AgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAAB AgQIECBAgAABAgQIECBAgAABAgQIECBAgAD+AQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAA AQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAA AQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAA AQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAA AQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAA AQIECBAgQIAAAQL+BAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECA AAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECA AAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECA AAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECA AAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAj+ECBA gAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBA gAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBA gAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBA gAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBA gAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECD+QIAAAQIECBAgQIAAAQIECBAg QIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAg QIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAg QIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAg QIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAg QIAAAQIECBAgQIAAAQIECBAgQID+AAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQ IECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQ IECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQ IECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQ IECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQ IECAAAH+AgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQI ECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQI ECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQI ECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQI ECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgT+CBAgQIAAAQIE CBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIE CBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIE CBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIE CBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIE CBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBD+IECAAAECBAgQIECAAAECBAgQIECAAAEC BAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAEC BAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAEC BAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAEC BAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAEC BAgQIECAAAECBAgQIED+gAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAAB AgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAAB AgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAAB AgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAAB AgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAD+ AQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAA AQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAA AQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAA AQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAA AQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQL+BAgQIECAAAECBAgQIECA AAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECA AAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECA AAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECA AAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECAAAECBAgQIECA AAECBAgQIECAAAECBAgQIECAAAECBAj+ECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBA gAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBA gAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBA gAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBA gAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBAgAABAgQIECBA gAABAgQIECCIQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAg QIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAg QIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgUAA7 ------8280-8280-8280-8280------- From hadi@cyberus.ca Wed Jan 19 05:49:41 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 05:49:46 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JDnf1i005964 for ; Wed, 19 Jan 2005 05:49:41 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1CrGDJ-0002jj-CR for netdev@oss.sgi.com; Wed, 19 Jan 2005 08:49:37 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CrGDC-0006l8-PL; Wed, 19 Jan 2005 08:49:31 -0500 Subject: Re: [PATCH] ipv6: alternative version of S/390 shared NIC support From: jamal Reply-To: hadi@cyberus.ca To: Christian =?ISO-8859-1?Q?Borntr=E4ger?= Cc: Christoph Hellwig , "David S. Miller" , pavlic@de.ibm.com, waldi@debian.org, netdev@oss.sgi.com In-Reply-To: <200501181653.59041.christian@borntraeger.net> References: <20050116115431.GA13617@lst.de> <200501180037.58453.christian@borntraeger.net> <1106009385.1046.49.camel@jzny.localdomain> <200501181653.59041.christian@borntraeger.net> Content-Type: text/plain; charset=ISO-8859-1 Organization: jamalopolous Message-Id: <1106142567.1049.970.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 19 Jan 2005 08:49:28 -0500 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 486 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Tue, 2005-01-18 at 10:53, Christian Bornträger wrote: > Frank, please correct me, if I am wrong.... > > jamal wrote: > > On Mon, 2005-01-17 at 18:37, Christian Bornträger wrote: > > > I am trying a small simplification here: > > > Each physical network adapter offers hundreds of device addresses. You > > > need 3 of them to have one logical network adapter(read,write,data). > > > > the "card" concept is what you call network adapter, correct? > > I take it that read and write are control channels and data is where the > > skb comes through? > > don't ask me about naming.... thats fine, I think it doesnt matter what they are used for; important part is you need all 3 addresses to have a "card"; so got it. > > > > S/390 has > > > hardware supported virtualization. Therefore can then use the > > > hypervisor (LPAR or z/VM) to give specific LPARs or VM guests exactly 3 > > > device addresses out of these hundreds. > > > > Can you provision multiple of these cards per VM? if yes, is there some > > ID that will break it down to OSInstance:cardid? You did not answer this question. Let me draw a diagram to show what i think the hierachy is: Physical Card: MAC address X | | +--- OSInstance A | | | +-- "CARD" with IP A | +-- "CARD" with IP B | +-- "CARD" with IP C | +-- "CARD" with IP D . . . | +--- OSInstance N | +-- "CARD" with IP Z Is the above reflective of what happens? In other words, packet comes from the wire (with MAC address X); somehow the hypervisor(?) or firmware figures based on IP address A (assuming no other instance has that IP) it has to send packet to OSInstanceA. OSInstanceA then selects further the CARD based on something probably in a descriptor? Let me get to the point: I think it would make sense for the "CARD" to be just another netdevice (call it "card" netdevice for this discussion). The representation of the physical card in the OSInstance is also a netdevice(call it physical netdevice for this discussion) as it is now (excpet it has no IP address ever). The "card netdevices" are stacked on top of the physical netdevice. This would be like an upside down bridge stacking relationship of netdevices.... It actually is no different from a few tunnel netdevices that sit on top of say eth0 or multiple PPP devices on top of ethx in a PPPOE relationship. The demuxing for incoming packets is done at physical card netdevice to select the "card" netdevice whose receive method is then called. Reverse direction for transmit (we could go into details later, just wanna make sure this is sensible to begin with). Does this sound reasonable? If yes, then if you do this you wont need to hack anything like IPV6 etc in your driver - they become merely netdevices. It should also allow for all standard features like ifconfig up/down etc of the "card" and setting IP addresses, VLANS etc to work as is. And you wont need to put any speacilized code in the driver. If its off tangent, then i just wasted 1/2 a cup of coffee energy typing away ;-> > Right, without registering the IP address, you can not receive any packet. If this is firmware issue, it would be wise to fix it. You should be able to register multiple MAC addresses hidden in the firmware (not at the Linux level) and have your "cards" netdevice use them. i.e the "card" netdevices would own those. > As the logical network interface has no own MAC address you actually speak > IP to the card. That also means, that without some additional effort, tools > like tcpdump fail and you need some patches in the dhcp tools. Refer to above. If you actually have your virtual/"card" netdevice on top of the physical netdevice have a MAC address, then all tools should work as is with zero changes IMO. > > You can define options for routers to get more than your own packages, but > IIRC you can only define a primary and secondary router per port. > Ok, this is new information - what does a "router" mean in relation to a port? cheers, jamal From kaber@trash.net Wed Jan 19 06:03:24 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 06:03:28 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JE3NLk007040 for ; Wed, 19 Jan 2005 06:03:24 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CrGQ0-0005Kv-Db; Wed, 19 Jan 2005 15:02:44 +0100 Message-ID: <41EE6884.9010904@trash.net> Date: Wed, 19 Jan 2005 15:02:44 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: hadi@cyberus.ca CC: Thomas Graf , "David S. Miller" , netdev@oss.sgi.com Subject: Re: path: module replay References: <1105900522.1090.798.camel@jzny.localdomain> <41EAB74F.6060507@trash.net> <20050116185630.GZ26856@postel.suug.ch> <1105903033.1097.829.camel@jzny.localdomain> <1105903960.1097.836.camel@jzny.localdomain> <41EDE15B.40300@trash.net> <1106141706.1048.953.camel@jzny.localdomain> In-Reply-To: <1106141706.1048.953.camel@jzny.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 487 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev jamal wrote: > >And we exchanged emails on this topic already in private and you said >you will fix and send out the patch;-> So please do just that or you can >wait until i have more time and my hardware at the same spot. > I said I'm going to remove the bogus module loading changes and apply the patch if there aren't more problems. But there are, and my time is limited too, so I'm going to wait for a new patch. Regards Patrick From tgraf@suug.ch Wed Jan 19 06:07:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 06:07:54 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JE7kcs007674 for ; Wed, 19 Jan 2005 06:07:46 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 0A81EF; Wed, 19 Jan 2005 15:07:21 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 2D6BC1C0EA; Wed, 19 Jan 2005 15:08:04 +0100 (CET) Date: Wed, 19 Jan 2005 15:08:04 +0100 From: Thomas Graf To: Werner Almesberger Cc: jamal , Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com Subject: Re: [RFC] batched tc to improve change throughput Message-ID: <20050119140804.GZ26856@postel.suug.ch> References: <20050117152312.GC26856@postel.suug.ch> <1105976711.1078.1.camel@jzny.localdomain> <20050117160539.GD26856@postel.suug.ch> <1105979807.1078.16.camel@jzny.localdomain> <20050117165626.GE26856@postel.suug.ch> <1106002197.1046.19.camel@jzny.localdomain> <20050118134406.GR26856@postel.suug.ch> <1106058592.1035.95.camel@jzny.localdomain> <20050118120737.I15303@almesberger.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050118120737.I15303@almesberger.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 488 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * Werner Almesberger <20050118120737.I15303@almesberger.net> 2005-01-18 12:07 > There's also the issue of classifier construction: while I think > that the language for this is near-perfect, the internal > processing is scary at best, and doesn't produce very nice > results. I dream of a new classifier works on a state machine > constructed from single-bit classification decisions, but the > graph theory required for ordering them properly is a bit above > me. (Construction of an unordered and redundant FSM is almost > trivial - tcng can already do this.) I did some experiments in this direction where one could write code in c-like syntax which is transformed into an insturction set understood by the state machine in the kernel. Similiar to BPF but not focused on parsing but rather on classification. The main disadvantage is speed, the idea isn't new and has been implemented various times already. It didn't performen well enough and everyone switched to the current way of packet filtering. The mistake they did was to completely rely on the state machine for even the most simple packet classification problems. Now that we have specialized classifiers for often used filtering problems we can pick up the idea again and add it _additionaly_ for all these cases that the specialized classifiers do not cover yet. Basically to get a state machine capable solving almost every problem the following parts must be provided: - a small instruction set for basic operations to implement arithmetic, branching, and loops. - some abstract way to access data from various sources, be it packet data, constant values, registers, or meta data. - an advanced instruction set to improve the performance of the state machine for often used patterns, e.g. find-byte, classify, byte order transformations, header length calculation shortcuts, find-next-ipv6-opt, etc. - a good optimizer able to transform multiple simple instructions into a larger instruction, because the main bottleneck in a software state machine is aver number of instructions needed to process to get to a result. - stack frames to allow building libraries for often used problem not worth making a single instruction out of it. > I'm not so sure about interactive use of "tc". In general, a > single configuration line has no meaning. You almost always > need a lot more context to understand what it does. I think the interactive mode is very useful for maintaince. I agree with you that for the initial script a higher language at the level of the big picture is more apppropriate. However, we're moving slowly towards new aspects with the actionts bits and also ematches, things get more complicated and less rules are required. Therefore in my opinion it would be nice to have an interactive shell assisting you with the initial construction. It also heavly depends on the usage of tc et al, the normal dscp, port, and address classification schemas perfectly fit into tcng and the big picture is most important. OTOH, as soon as we get to more complex classifiction and the more classification possibilities we get the more important it is to have some way to interactively construct single filters. So in my opinion the whole problem needs be divided into two parts, the logical big picture part best solved with tcng were logic groupings count more than single bits in the packet and the interactive shell with context help to assist in creating complex filters and do the maintaince jobs. Combined together the result is a more useable interface. > Think of the interactive BASIC systems on ancient PCs. There, > you would enter/edit/remove lines by their number. Now, would > you want to use something like this for C ? Me, I prefer a > free-format text editor :-) Yes but I think you also like context based assistance tools such as cscope where you can get help based on your current context, e.g. symbols, types, references. > An interactive help system that could be called from an > editor, e.g. when editing tcng configurations, would certainly > be a nice touch. But that's an orthogonal issue. A set of man, > info, etc. pages would serve nicely, too. To make it really useful the help system needs to parse your current line to find out the context. Assuming we implement a interactive shell like I described in a earlier post, we could add a parameter to put iproute2 into explanation mode not doing anything put parse the input and print a help text based on it. It shouldn't be too hard to tell your editor to call it. Thoughts? From hadi@cyberus.ca Wed Jan 19 06:08:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 06:08:16 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JE8Br8007802 for ; Wed, 19 Jan 2005 06:08:11 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1CrFby-0008UY-Sp for netdev@oss.sgi.com; Wed, 19 Jan 2005 08:11:02 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CrFbv-0000f4-Bq; Wed, 19 Jan 2005 08:10:59 -0500 Subject: Re: More tc action mess From: jamal Reply-To: hadi@cyberus.ca To: Patrick McHardy Cc: Maillist netdev In-Reply-To: <41EDEB97.3080503@trash.net> References: <41EDEB97.3080503@trash.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1106140256.1049.903.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 19 Jan 2005 08:10:57 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 489 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Wed, 2005-01-19 at 00:09, Patrick McHardy wrote: > I probably found the reason for the problems with the ipt action you were > talking about. netfilter targets, like tc actions, expect a struct > sk_buff **, > but the ipt action does: > > struct sk_buff *skb = *pskb; > ... > ret = p->t->u.kernel.target->target(&skb, skb->dev, NULL, > > which of course doesn't make much sense. Unfortunately, tcf_action_exec > does the same nonsense: > > int tcf_action_exec(struct sk_buff *skb, struct tc_action *act, > ... > ret = a->ops->act(&skb, a); > > This means we must convert all paths on which tcf_action_exec is called > to use struct sk_buff ** :( No, just restore the code that you took out in one of your patches right above that line which reads: ---- if (skb_cloned(skb)) { if (pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) { return -1; } } ---- Depending on what you do in netfilter lately, you may wanna take out the skb_cloned() call. cheers, jamal From hadi@cyberus.ca Wed Jan 19 06:13:38 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 06:13:42 -0800 (PST) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JEDcMT008805 for ; Wed, 19 Jan 2005 06:13:38 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.30) id 1CrGaU-0004C8-Lf for netdev@oss.sgi.com; Wed, 19 Jan 2005 09:13:34 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CrGaS-0001rQ-S4; Wed, 19 Jan 2005 09:13:33 -0500 Subject: Re: [RFC] batched tc to improve change throughput From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com, Werner Almesberger In-Reply-To: <20050118145830.GS26856@postel.suug.ch> References: <20050117152312.GC26856@postel.suug.ch> <1105976711.1078.1.camel@jzny.localdomain> <20050117160539.GD26856@postel.suug.ch> <1105979807.1078.16.camel@jzny.localdomain> <20050117165626.GE26856@postel.suug.ch> <1106002197.1046.19.camel@jzny.localdomain> <20050118134406.GR26856@postel.suug.ch> <1106058592.1035.95.camel@jzny.localdomain> <20050118145830.GS26856@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1106144009.1047.989.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 19 Jan 2005 09:13:30 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 490 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Tue, 2005-01-18 at 09:58, Thomas Graf wrote: > * jamal <1106058592.1035.95.camel@jzny.localdomain> 2005-01-18 09:29 > > On Tue, 2005-01-18 at 08:44, Thomas Graf wrote: > > > I'm not sure if > > > entering/leaving subsystem features makes any sense. I find a context > > > help by pressing '?' and normal completion most useful. It's not > > > that I dislike your idea but I think it's not worth it. > > > > What doesnt make sense or is not worth it? > > My very personal opinion is that it's not worth it. Ok, lets discuss more see if we can change that ;-> > > a) usability. > > i) I dont need to remember how the parse tree looks like or where i am > > on the parse tree. > > I go: > > tc > > tc> ? > > i get some help on the next levels. > > ii) I should be able to ssh to this thing from some remote location. > > This way i can write some scripts to automate things > > > > b) extrenous typing on command line. > > I go to the filter level > > > > u32> ? > > gives me help > > u32> context > > filter dev lo parent ffff: protocol ip prio 10 > > u32> add > > u32> match ip src 10.0.0.21/32 flowid 1:16 action drop > > u32> match ip src 0/0 flowid 1:16 action ok > > u32> commit > > filters submitted .. > > What do you if there is an error? To what kind of context do you > go? Let's say the kernel reports -EINVAL. > As Lennert was saying, puke whatever the kernel said and allow for rollback. i.e undo the first one if it succeeded for example. > tgr:axs ~/dev/netconfig/src ./netconfig [some really neat stuff deleted for brevity] > Again, It's not that I dislike contexts but in the end it all > gets down to make error correction as easy as possible. Everytime > you request a completion or context help the command will get > parsed and a very verbose message including the possibilities you > have will be printed and you can correct your error. > > It's more typing work I know, but usually one only types the first > 1..3 chars of the commands. > Same as in what i showed. Probably not a very big deal. The one neat thing about the context approach is it allows you to remember state easily. As an example, after commiting those two u32 filters and you want to undo, you then remember what it is that you can undo. What you have is really nice because you could use standard tools such as "| grep forsomething | formatit etc" to manipulate further. This would be hard to do in the case of what i described earlier. The best solution we can have is to have a mix of the two approaches IMO. > > > It includes a quite easy to use API to define the grammar which > > > can be used by readline to do the completion and print context > > > aware help. > > > > what does readline provide you again? > > It basically takes over the reading of a line and allows manipulation > of the input buffer. It implements all the useful line editing like > in bash and helps with completion. You can bind the '?' key to a > help function so that '?' will not be printed on the screen but instead > the help text is printed and you get back your original line untouched. > It also gives the user a chance to bind keys to certain actions so > everyone can keep the bindings they like with the additional > possibilities to export functions so one could for example bind C-N > to "list-neighbours". These are all very nice features to have. > > I think iproute2 should stay as is - dont wanna break someones scripts > > or make it fatter than it is already. Any app to provide the above > > should be standalone. > > Well, you mean like generating iproute2 input? This means we'd have to > reimplement the logic twice and handling errors from iproute2 gets > really hard. It's not a problem to keep the old way of iproute2 as-is. What i mean is that we should probably leave iproute2 code alone so that people can run old scripts etc with it. i.e the netsh tool should just either reuse libnetlink and add any things to it or create a brand new library. cheers, jamal From hadi@cyberus.ca Wed Jan 19 06:24:34 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 06:24:40 -0800 (PST) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JEOYSD009725 for ; Wed, 19 Jan 2005 06:24:34 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.30) id 1CrGl4-0004T7-82 for netdev@oss.sgi.com; Wed, 19 Jan 2005 09:24:30 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CrGl2-0003bT-TX; Wed, 19 Jan 2005 09:24:29 -0500 Subject: Re: [RFC] batched tc to improve change throughput From: jamal Reply-To: hadi@cyberus.ca To: Lennert Buytenhek Cc: Thomas Graf , Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com, Werner Almesberger In-Reply-To: <20050118152017.GA11798@xi.wantstofly.org> References: <20050117152312.GC26856@postel.suug.ch> <1105976711.1078.1.camel@jzny.localdomain> <20050117160539.GD26856@postel.suug.ch> <1105979807.1078.16.camel@jzny.localdomain> <20050117165626.GE26856@postel.suug.ch> <1106002197.1046.19.camel@jzny.localdomain> <20050118134406.GR26856@postel.suug.ch> <1106058592.1035.95.camel@jzny.localdomain> <20050118143658.GA11474@xi.wantstofly.org> <1106059431.1035.101.camel@jzny.localdomain> <20050118152017.GA11798@xi.wantstofly.org> Content-Type: text/plain Organization: jamalopolous Message-Id: <1106144666.1049.994.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 19 Jan 2005 09:24:26 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 491 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Tue, 2005-01-18 at 10:20, Lennert Buytenhek wrote: > On Tue, Jan 18, 2005 at 09:43:51AM -0500, jamal wrote: > > > > If you do this, please consider using Juniper config syntax instead > > > of doing it the Cisco/quagga way. > > > > Juniper is XML driven config files? > > Uhm, no :) The main advantage over Cisco (IMHO, the last thing I want > is to start a holy war) is hierarchical config syntax, and the ability > to commit/rollback all your changes in one go. It's unfortunately > rather more verbose, though. As long as a machine(as opposed to a human) is worrying about the verbosity - should be fine ;-> > Example at the bottom. It has a well defined structure. Do you know if the publish the bnf to it? Are these guys gonna come after us if we replicate it you think? > > > btw, libio uses libevent; i recall you said you had some alternative to > > it. > > Yeah, ivykis (http://libivykis.sourceforge.net/) has been happily used > in-house at my last job for years but never really caught on anywhere > else, which is perhaps because I never did much lobbying for it. The > way it works also requires all code written for it to be fully async > (can't use blocking code anywhere), which I think is an advantage but > everyone else thinks is a disadvantage. very similar to libevent. I am gonna start using yours because then i could send you emails which start with "Dear sir, .. i have doubts because it doesnt work" ;-> cheers, jamal From hadi@cyberus.ca Wed Jan 19 06:30:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 06:30:30 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JEUPcj010428 for ; Wed, 19 Jan 2005 06:30:25 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CrGqk-0002ML-Ml for netdev@oss.sgi.com; Wed, 19 Jan 2005 09:30:22 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CrGqi-0004Z3-I9; Wed, 19 Jan 2005 09:30:20 -0500 Subject: Re: [PATCH PKT_SCHED 4/4]: fix CONFIG_NET_CLS_ACT skb leaks in HFSC/CBQ From: jamal Reply-To: hadi@cyberus.ca To: Patrick McHardy Cc: "David S. Miller" , Maillist netdev In-Reply-To: <41EE61BA.4030406@trash.net> References: <41EDE462.9040602@trash.net> <1106141206.1047.937.camel@jzny.localdomain> <41EE61BA.4030406@trash.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1106145017.1050.996.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 19 Jan 2005 09:30:18 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 492 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Ok, Patrick - then i have no issues; i will look closely when it shows up in bk. On Wed, 2005-01-19 at 08:33, Patrick McHardy wrote: > jamal wrote: > > >I dont have time, but please double check that the following still > >applies: > > > >1) A qdisc receiving a STOLEN/QUEUED/SHOT signal from the classification > >result MUST free the packet and immediately stop processing that packet. > >The infrastructure code will clone packets if they want to steal or > >queue it. > > > It does now. Before there were things like "unsigned int len = skb->len" > after the call to tc_classify. > > >2) Return code of qdisc from enqueue function need to be dealt with > >care. For example if the packet is localy generated and it is a TCP > >packet you could confuse the stack by telling it the packet was dropped > >because it will retransmit (and some things will happen with the window > >adjustments). > > > TC_ACT_SHOT => NET_XMIT_DROP > TC_ACT_STOLEN | TC_ACT_QUEUED => NET_XMIT_SUCCESS > > >3) packets that are dropped because of a full Q should continue to > >return a XMIT_DROP (you want TCP for example to know about this) > > > They do. > > > > From tgraf@suug.ch Wed Jan 19 06:36:14 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 06:36:19 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JEaDps011078 for ; Wed, 19 Jan 2005 06:36:13 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 3FEE3F; Wed, 19 Jan 2005 15:35:50 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 9DB381C0EA; Wed, 19 Jan 2005 15:36:32 +0100 (CET) Date: Wed, 19 Jan 2005 15:36:32 +0100 From: Thomas Graf To: jamal Cc: Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com, Werner Almesberger Subject: Re: [RFC] batched tc to improve change throughput Message-ID: <20050119143632.GA26856@postel.suug.ch> References: <20050117152312.GC26856@postel.suug.ch> <1105976711.1078.1.camel@jzny.localdomain> <20050117160539.GD26856@postel.suug.ch> <1105979807.1078.16.camel@jzny.localdomain> <20050117165626.GE26856@postel.suug.ch> <1106002197.1046.19.camel@jzny.localdomain> <20050118134406.GR26856@postel.suug.ch> <1106058592.1035.95.camel@jzny.localdomain> <20050118145830.GS26856@postel.suug.ch> <1106144009.1047.989.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1106144009.1047.989.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 493 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1106144009.1047.989.camel@jzny.localdomain> 2005-01-19 09:13 > On Tue, 2005-01-18 at 09:58, Thomas Graf wrote: > > What do you if there is an error? To what kind of context do you > > go? Let's say the kernel reports -EINVAL. > > > > As Lennert was saying, puke whatever the kernel said and allow for > rollback. i.e undo the first one if it succeeded for example. Yes but this is not dependant on a context, is it? It is possible, I have it working for most netlink messages but it is non trivial. > > Again, It's not that I dislike contexts but in the end it all > > gets down to make error correction as easy as possible. Everytime > > you request a completion or context help the command will get > > parsed and a very verbose message including the possibilities you > > have will be printed and you can correct your error. > > > > It's more typing work I know, but usually one only types the first > > 1..3 chars of the commands. > > > > Same as in what i showed. Probably not a very big deal. > The one neat thing about the context approach is it allows you to > remember state easily. As an example, after commiting those two u32 > filters and you want to undo, you then remember what it is that you can > undo. So it seems you really want to do commit/rollback on context level. Can you maybe explain this more verbosely, maybe it's easier than I think. The commit/rollback is only useful for groupings of requests such as complete filtering configurations, the consistency of a single addition should be handled properly by the kernel. The changes in my tcf_exts patches solved most of them except for the indev stuff. > > > I think iproute2 should stay as is - dont wanna break someones scripts > > > or make it fatter than it is already. Any app to provide the above > > > should be standalone. > > > > Well, you mean like generating iproute2 input? This means we'd have to > > reimplement the logic twice and handling errors from iproute2 gets > > really hard. It's not a problem to keep the old way of iproute2 as-is. > > What i mean is that we should probably leave iproute2 code alone so that > people can run old scripts etc with it. i.e the netsh tool should just > either reuse libnetlink and add any things to it or create a brand new > library. Well, libnetlink contains 1% of the code required, 99% are in the modules and that's the hard work. Remeber libnl? netsh is based on it and it took me 2 weeks to get neighbour and link code finished and working, it is more powerful than ip now though. The basic features of ip and tc isn't very difficult but there's quite a lot more in iproute2 which needs to be mostly rewritten to fit into a library. From jeremy.guthrie@berbee.com Wed Jan 19 07:03:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 07:04:02 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JF3sZx012894 for ; Wed, 19 Jan 2005 07:03:55 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 19 Jan 2005 09:03:46 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Wed, 19 Jan 2005 09:03:42 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson References: <200501141326.29575.jeremy.guthrie@berbee.com> <16874.24305.461492.48668@robur.slu.se> In-Reply-To: <16874.24305.461492.48668@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1140883.XAXnEGKz2f"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501190903.45671.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 19 Jan 2005 15:03:46.0304 (UTC) FILETIME=[12F75800:01C4FE38] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 494 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart1140883.XAXnEGKz2f Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Sunday 16 January 2005 06:32 am, Robert Olsson wrote: > Some time ago an "in-flow" GC (as opposed to timer based) was added to > the routing code look for cand in route.c. In setup like yours (and ours) > it would be better to relay on this process to a higher extent. Anyway > in /proc/sys/net/ipv4/route/ you have the files. > > gc_elasticity, gc_interval, gc_thresh etc I would avoid gc_min_interval. > > And you can play with your running system and for drops without causing > your users to much pain. I have done a little tweaking. I now hold at around 520K routes in the has= h. =20 I still drop packets every secret_interval but I've upped that counter so I= =20 don't whack all of my hash entries all that often. =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart1140883.XAXnEGKz2f Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB7nbRqtjaBHGZBeURAlELAKCXBqq6fxLX9IOJiMYzGuTiaeGP6QCffX6C 5h7IY4v/kvc4yavt1ej7grk= =Mgdd -----END PGP SIGNATURE----- --nextPart1140883.XAXnEGKz2f-- From werner@almesberger.net Wed Jan 19 08:34:14 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 08:34:20 -0800 (PST) Received: from host.almesberger.net (almesberger.net [63.105.73.238]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JGYEXv027756 for ; Wed, 19 Jan 2005 08:34:14 -0800 Received: from almesberger.net (vpnwa-home [10.200.0.2]) by host.almesberger.net (8.12.8/8.9.3) with ESMTP id j0JGXwTO000300; Wed, 19 Jan 2005 08:34:00 -0800 Received: (from werner@localhost) by almesberger.net (8.11.6/8.11.6) id j0JGXrq20006; Wed, 19 Jan 2005 13:33:53 -0300 Date: Wed, 19 Jan 2005 13:33:53 -0300 From: Werner Almesberger To: Thomas Graf Cc: jamal , Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com Subject: Re: [RFC] batched tc to improve change throughput Message-ID: <20050119133353.H15303@almesberger.net> References: <20050117152312.GC26856@postel.suug.ch> <1105976711.1078.1.camel@jzny.localdomain> <20050117160539.GD26856@postel.suug.ch> <1105979807.1078.16.camel@jzny.localdomain> <20050117165626.GE26856@postel.suug.ch> <1106002197.1046.19.camel@jzny.localdomain> <20050118134406.GR26856@postel.suug.ch> <1106058592.1035.95.camel@jzny.localdomain> <20050118120737.I15303@almesberger.net> <20050119140804.GZ26856@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050119140804.GZ26856@postel.suug.ch>; from tgraf@suug.ch on Wed, Jan 19, 2005 at 03:08:04PM +0100 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 495 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: werner@almesberger.net Precedence: bulk X-list: netdev Thomas Graf wrote: > filtering. The mistake they did was to completely rely on the > state machine for even the most simple packet classification > problems. I don't see much of a performance problem: once you have a nice FSM with single-bit decisions, you can quite easily construct various efficient matcher stages. You can even prepare (or compile on the fly) suitable specialized matchers. If doing the matching in hardware, you may even use just the FSM. > Basically to get a state machine capable solving almost every > problem the following parts must be provided: > > - a small instruction set for basic operations to implement > arithmetic, branching, and loops. You need arithmetic only for pointers, and there it's basically mask and shift. You can do surprisingly well without loops. E.g. tcng doesn't have loops. (Although they would be a nice addition, particularly if you move more in the direction of firewalls.) > - some abstract way to access data from various sources, be it > packet data, constant values, registers, or meta data. You can just define some "magic" offsets, e.g. negative ones. > - an advanced instruction set to improve the performance > of the state machine for often used patterns, e.g. > find-byte, classify, byte order transformations, header > length calculation shortcuts, find-next-ipv6-opt, etc. This can be nicely separated and put into post-processing stages. Most of the time, you probably don't notice a difference anyway. > - a good optimizer able to transform multiple simple > instructions into a larger instruction, because the main > bottleneck in a software state machine is aver number of > instructions needed to process to get to a result. Yes, that would be part of the post-processing: combine things, detect patterns, and emit the right high-level construct. > - stack frames to allow building libraries for often used > problem not worth making a single instruction out of it. Huh ? Probably too complex already. Also, if you're in software, you may very well compile your own helper modules on the fly. tcng has this as a proof-of-concept with the "C" target. > I think the interactive mode is very useful for maintaince. Hmm, I kind of doubt it. You're quicker with your editor, just changing that line. What you need is a nice way for updating the in-kernel configuration without loss of state. You also need some "handles" where you can attach automated rule generation and/or modification. That's something tcng doesn't support very well. > It also heavly depends on the usage of tc et al, the normal > dscp, port, and address classification schemas perfectly fit > into tcng and the big picture is most important. Ah, but you know that that first thing tcng does when it sees an "if" is that it rips the expression apart and then works on "anonymous" fields or even single bits ? > soon as we get to more complex classifiction and the more > classification possibilities we get the more important it is > to have some way to interactively construct single filters. I think the contrary is the case :-) If things get complex enough, you'll want to dry-run them in tcsim or such. It's really not very different from programming - if I want to change some complicated expression, I just edit it. It wouldn't occur to me to tweak assembler instructions, no matter how convenient the assembler is. - Werner -- _________________________________________________________________________ / Werner Almesberger, Buenos Aires, Argentina werner@almesberger.net / /_http://www.almesberger.net/____________________________________________/ From werner@almesberger.net Wed Jan 19 08:45:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 08:45:53 -0800 (PST) Received: from host.almesberger.net (almesberger.net [63.105.73.238]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JGjmGX028673 for ; Wed, 19 Jan 2005 08:45:49 -0800 Received: from almesberger.net (vpnwa-home [10.200.0.2]) by host.almesberger.net (8.12.8/8.9.3) with ESMTP id j0JGjeTO000338; Wed, 19 Jan 2005 08:45:42 -0800 Received: (from werner@localhost) by almesberger.net (8.11.6/8.11.6) id j0JGjcS20174; Wed, 19 Jan 2005 13:45:38 -0300 Date: Wed, 19 Jan 2005 13:45:38 -0300 From: Werner Almesberger To: jamal Cc: Thomas Graf , Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com Subject: Re: [RFC] batched tc to improve change throughput Message-ID: <20050119134538.J15303@almesberger.net> References: <20050117152312.GC26856@postel.suug.ch> <1105976711.1078.1.camel@jzny.localdomain> <20050117160539.GD26856@postel.suug.ch> <1105979807.1078.16.camel@jzny.localdomain> <20050117165626.GE26856@postel.suug.ch> <1106002197.1046.19.camel@jzny.localdomain> <20050118134406.GR26856@postel.suug.ch> <1106058592.1035.95.camel@jzny.localdomain> <20050118145830.GS26856@postel.suug.ch> <1106144009.1047.989.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1106144009.1047.989.camel@jzny.localdomain>; from hadi@cyberus.ca on Wed, Jan 19, 2005 at 09:13:30AM -0500 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 496 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: werner@almesberger.net Precedence: bulk X-list: netdev jamal wrote: > As Lennert was saying, puke whatever the kernel said and allow for > rollback. i.e undo the first one if it succeeded for example. How about this: you have a shadow configuration tree on each ingress and egress point (i.e. two per interface). An update generates the shadow tree. If done, you commit the shadow tree to become the new config, and then you can quietly dismantle the old config. If you didn't like the changes, you kill the shadow tree, without committing it. To preserve queue content and element state (e.g. policer state), you'd also have to have a means to tell where to take things from, e.g. "shadow" qdisc X inherits the packets from "real" qdisc Y. All this could be checked for consistency at setup time. There are of course limitations, e.g. when you merge or split flows. As an optimization, you could have some "lazy copy": instead of creating new qdisc "inheriting" from some other, you just move it from the old to the new tree. - Werner -- _________________________________________________________________________ / Werner Almesberger, Buenos Aires, Argentina werner@almesberger.net / /_http://www.almesberger.net/____________________________________________/ From tgraf@suug.ch Wed Jan 19 08:54:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 08:54:08 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JGs1im029584 for ; Wed, 19 Jan 2005 08:54:02 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id A9EF0F; Wed, 19 Jan 2005 17:53:38 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 73FFA1C0EA; Wed, 19 Jan 2005 17:54:21 +0100 (CET) Date: Wed, 19 Jan 2005 17:54:21 +0100 From: Thomas Graf To: jamal Cc: Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com, Werner Almesberger Subject: Re: [RFC] batched tc to improve change throughput Message-ID: <20050119165421.GB26856@postel.suug.ch> References: <20050117152312.GC26856@postel.suug.ch> <1105976711.1078.1.camel@jzny.localdomain> <20050117160539.GD26856@postel.suug.ch> <1105979807.1078.16.camel@jzny.localdomain> <20050117165626.GE26856@postel.suug.ch> <1106002197.1046.19.camel@jzny.localdomain> <20050118134406.GR26856@postel.suug.ch> <1106058592.1035.95.camel@jzny.localdomain> <20050118145830.GS26856@postel.suug.ch> <1106144009.1047.989.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1106144009.1047.989.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 497 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1106144009.1047.989.camel@jzny.localdomain> 2005-01-19 09:13 > What i mean is that we should probably leave iproute2 code alone so that > people can run old scripts etc with it. i.e the netsh tool should just > either reuse libnetlink and add any things to it or create a brand new > library. Inspected some more code and I've finished already more than I thought. The architecture currently allows specifying the grammar with macros like this: NODELIST(neigh_modify_dev) NODE(dev) CALLBACK(set_dev) FOLLOW(neigh_modify) ARG(GA_TEXT, &storage.dev, CACHE_MGEN_FUNC(ifname_dst), "") DESC("Link") END_NODE END_NODELIST NODELIST(neigh_ops) NODE(add) FOLLOW(neigh_add_dev) CALLBACK(do_neigh_add) ARG(GA_TEXT, &storage.dst, CACHE_MGEN_FUNC(dst), "") DESC("Add a neighbour") END_NODE NODE(modify) FOLLOW(neigh_modify_dev) CALLBACK(do_neigh_modify) ARG(GA_TEXT, &storage.dst, CACHE_MGEN_FUNC(dst), "") DESC("Modify a neighbour") END_NODE NODE(delete) FOLLOW(neigh_del_dev) CALLBACK(do_neigh_del) ARG(GA_TEXT, &storage.dst, CACHE_MGEN_FUNC(dst), "") DESC("Delete a neighbour") END_NODE NODE(list) FOLLOW(neigh_list_attrs) CALLBACK(do_neigh_list) DESC("List neighbour attributes") END_NODE END_NODELIST TOPNODE(ng, neighbour) FOLLOW(neigh_ops) DESC("Neighbour (ARP) configuration") LONG_DESC( " Module to view and modify the neighbour tables.\n" " \n" \ " The neighbour table establishes bindings between protocol\n" \ " addresses and link layer addresses for hosts sharing the same\n" \ " physical link. This module allows you to view the content of\n" \ " these tables and to manipulate their content.\n") END_TOPNODE Looks a bit complicated but is actually quite easy, you can do it the linux way. This will get your full completion and context help for your grammar and also completion of arguments like link names, addresses in neighbour cache, etc. All you have to do is specify a function returning a list of possibilities. It allows you to build recursive grammars and multiple end points in the automation. The above results in this: axs# neigh ? Backtrace: ->neighbour - Neighbour (ARP) configuration Description: Module to view and modify the neighbour tables. The neighbour table establishes bindings between protocol addresses and link layer addresses for hosts sharing the same physical link. This module allows you to view the content of these tables and to manipulate their content. Next level commands: add ... Add a neighbour modify ... Modify a neighbour delete ... Delete a neighbour list ... List neighbour attributes axs# neigh modify ? Backtrace: ->neighbour - Neighbour (ARP) configuration ->modify - Modify a neighbour Expecting argument: axs# neigh modify 192.168.23.12 192.168.23.13 axs# neigh modify 192.168.23.1 Note: the above will look up the addresses in the neighbour table and list the possible entries, since all share a common prefix it is automatically filled in. There is quite some thinking in these completion functions, the link name completion in neighbour context will only show up links which actually have neighbour entries. The status of the whole thing: link and neighbour are finished, core architecture finished as well, route is half done, addresses are half done (both easy to finish). libnl has net/sched/ finished but is still missing code for a lot of modules. Session management (commit/rollback) was once in but was too unstable, needs a partial rewrite (design flaws) but should fit in quite easly because libnl was designed to support it. It will basically look like: nl_session_start(); ... any high level operations .. if (nl_session_commit() < 0) nl_session_rollback(); Problems? Keeping the cache valid (multiple netlink programs). The final update just before the commit and the commit itself must be atomic. Solutions: - Use ATOMIC flag (dangerous) - Seq counter in netlink, increased evertime a netlink message gets processed and returned in ack. A netlink request may contain a flag and the expected sequence number and the request gets only processed if they match, otherwise the request fails. (my favourite) - Lock file in userspace (how to enfroce everyone to use it?) - Try to detect changes from third party after commit. Quite hard but possible, reduces race window but doesn't close it completely. Background: I keep 2 caches, 1 cache represents the current state in the kernel, it gets updated when required. The second cache contains the local caches. The first cache gets merged into the second before the update and then gets commited. In case of a failure the first cache is used to restore things. Thoughts? From tgraf@suug.ch Wed Jan 19 09:22:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 09:22:11 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JHM31F031013 for ; Wed, 19 Jan 2005 09:22:03 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 24B1BF; Wed, 19 Jan 2005 18:21:40 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id DBFBE1C0EA; Wed, 19 Jan 2005 18:22:22 +0100 (CET) Date: Wed, 19 Jan 2005 18:22:22 +0100 From: Thomas Graf To: Werner Almesberger Cc: jamal , Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com Subject: Re: [RFC] batched tc to improve change throughput Message-ID: <20050119172222.GC26856@postel.suug.ch> References: <1105976711.1078.1.camel@jzny.localdomain> <20050117160539.GD26856@postel.suug.ch> <1105979807.1078.16.camel@jzny.localdomain> <20050117165626.GE26856@postel.suug.ch> <1106002197.1046.19.camel@jzny.localdomain> <20050118134406.GR26856@postel.suug.ch> <1106058592.1035.95.camel@jzny.localdomain> <20050118120737.I15303@almesberger.net> <20050119140804.GZ26856@postel.suug.ch> <20050119133353.H15303@almesberger.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050119133353.H15303@almesberger.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 498 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * Werner Almesberger <20050119133353.H15303@almesberger.net> 2005-01-19 13:33 > Thomas Graf wrote: > > filtering. The mistake they did was to completely rely on the > > state machine for even the most simple packet classification > > problems. > > I don't see much of a performance problem: once you have a nice > FSM with single-bit decisions, you can quite easily construct > various efficient matcher stages. You can even prepare (or > compile on the fly) suitable specialized matchers. If doing the > matching in hardware, you may even use just the FSM. I guess we're speaking of slightly different FSMs. I assume yours is 100% hardcoded and only works for static patterns? Those you could also implement in FPGAs quite easly. Assuming one needs 2K rules for classyfing on top of some kind of dynamic header, assuming IPv4 and IPv6 for now. The static FSMs needs to parse the headers everytime which isn't much of a problem with IPv4 but gets really expensive with IPv6 even with specialized instructions to parse through the options. Sure, one can put packets into classes and build filters on top of it, but once splitted one can never merge them together again. I've seen many static FSMs based on BPF, which I assume is what you're talking about. _All_ of them break in practical situations no longer matching the theory. The only way I see to solve this is to put more logic into the state machine. Give the state machine the chance to share data, that's why you need local and global registers. To really make use of it you want to be able to modify the data and thus need arithmetic instructions. I know, I'm pretty lonely on this path but I think this is the way to go. > You need arithmetic only for pointers, and there it's basically > mask and shift. You can do surprisingly well without loops. E.g. > tcng doesn't have loops. (Although they would be a nice addition, > particularly if you move more in the direction of firewalls.) How do you parse IPv6 options? Specialized classifiers? mask and shift might be enough to transform IHL but it won't be sufficent for higher protocols. > Huh ? Probably too complex already. Also, if you're in software, > you may very well compile your own helper modules on the fly. > tcng has this as a proof-of-concept with the "C" target. Of course stack frames are only necessary if you introduce variables and they may only exist in user space and then eliminated for the kernel state machine. > > I think the interactive mode is very useful for maintaince. > > Hmm, I kind of doubt it. You're quicker with your editor, just > changing that line. What you need is a nice way for updating the > in-kernel configuration without loss of state. I'm talking about maintaince stuff in terms of checking statistics, inspecting your filter tree, etc. I fully aggree that the construction of the configuration belongs into a text editor. > You also need some "handles" where you can attach automated > rule generation and/or modification. That's something tcng doesn't > support very well. I don't get this. > Ah, but you know that that first thing tcng does when it sees an > "if" is that it rips the expression apart and then works on > "anonymous" fields or even single bits ? Sure, this is the way to go. > I think the contrary is the case :-) If things get complex > enough, you'll want to dry-run them in tcsim or such. It's > really not very different from programming - if I want to > change some complicated expression, I just edit it. It wouldn't > occur to me to tweak assembler instructions, no matter how > convenient the assembler is. I agreed, I'm solely and only talking about getting help while constructing a filter. With all the new extensions comming in the construction will get more complex with logic expressions, various small classification tools and one needs to look up their parameters etc. I think tcng will never be able to 100% support all of them, because of their easy usage many will write their own so we might see dozens of new ones like in netfilter. From jt@hpl.hp.com Wed Jan 19 09:31:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 09:31:18 -0800 (PST) Received: from palrel13.hp.com (palrel13.hp.com [156.153.255.238]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JHVDOM031921 for ; Wed, 19 Jan 2005 09:31:13 -0800 Received: from tomil.hpl.hp.com (tomil.hpl.hp.com [15.0.152.100]) by palrel13.hp.com (Postfix) with ESMTP id 67C311C17E21; Wed, 19 Jan 2005 09:31:12 -0800 (PST) Received: from bougret.hpl.hp.com (bougret.hpl.hp.com [15.4.92.227]) by tomil.hpl.hp.com (8.9.3 (PHNE_29774)/8.9.3 HPLabs Timeshare Server) with ESMTP id JAA13706; Wed, 19 Jan 2005 09:32:53 -0800 (PST) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 1CrJfj-0006tF-00; Wed, 19 Jan 2005 09:31:11 -0800 Date: Wed, 19 Jan 2005 09:31:11 -0800 To: Rusty Russell Cc: Linux kernel mailing list , netdev@oss.sgi.com Subject: Re: [BUG] MODULE_PARM conversions introduces bug in Wavelan driver Message-ID: <20050119173111.GB25969@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com References: <20050119004722.GA26468@bougret.hpl.hp.com> <1106102553.20879.4.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1106102553.20879.4.camel@localhost.localdomain> User-Agent: Mutt/1.3.28i Organisation: HP Labs Palo Alto Address: HP Labs, 1U-17, 1501 Page Mill road, Palo Alto, CA 94304, USA. E-mail: jt@hpl.hp.com From: Jean Tourrilhes X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 499 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jt@hpl.hp.com Precedence: bulk X-list: netdev On Wed, Jan 19, 2005 at 01:42:33PM +1100, Rusty Russell wrote: > On Tue, 2005-01-18 at 16:47 -0800, Jean Tourrilhes wrote: > > Hi Rusty, > > > > (If you are not the culprit, please forward to the guilty party). > > Almost certainly me. We gave people warning, we even marked MODULE_PARM > deprecated, but eventually I had to roll through and try to autoconvert. I have nothing against the change to module_param_array(), and I even think that it's a good idea. Just doing my job of peer review. > > I personally introduced the "double char array" module > > parameter, 'c', to fix that. I even sent you the patch to add 'c' > > support in your new module loader (see set_obsolete()). Would it be > > possible to carry this feature with the new module_param_array ? > > Thanks in advance... > > Actually, it's designed so you can extend it yourself: at its base, > module_param_call() is just a callback mechanism. Yes, I could do my little hack in my corner, but I think it would be counter productive. I'm sure that compared to adding a check on strlen, it would be more bloat. But, more importantly, I would make the code more obscure and unmaintanable. But, I think you are missing the point I'm making. We are striving to make APIs that are simple, efficient and avoid users to make stupid mistakes. The conversion from MODULE_PARM to module_param goes exactly in this direction, as it adds more type safety. This is good, as module_param is probably the most used user/kernel interface. I believe that buffer overrun is the number one security problem in Linux. It seems that it even happens to the best of us. So, it would seem to me that making the module_param API a bit more bullet proof with regard to buffer overrun might be a good idea. So, I'm not advocating that you build this feature just for me, but that you make it the standard and force people to use it. > Thanks! > Rusty. Have fun... Jean From kaber@trash.net Wed Jan 19 12:23:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 12:23:07 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JKN0qb012096 for ; Wed, 19 Jan 2005 12:23:01 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CrMLs-0007N8-03; Wed, 19 Jan 2005 21:22:52 +0100 Message-ID: <41EEC19B.3010504@trash.net> Date: Wed, 19 Jan 2005 21:22:51 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: hadi@cyberus.ca CC: Maillist netdev Subject: Re: More tc action mess References: <41EDEB97.3080503@trash.net> <1106140256.1049.903.camel@jzny.localdomain> In-Reply-To: <1106140256.1049.903.camel@jzny.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 500 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev jamal wrote: >On Wed, 2005-01-19 at 00:09, Patrick McHardy wrote: > > >>This means we must convert all paths on which tcf_action_exec is called >>to use struct sk_buff ** :( >> >> > > >No, just restore the code that you took out in one of your patches >right above that line which reads: > >---- > if (skb_cloned(skb)) { > if (pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) { > return -1; > } > } >---- > >Depending on what you do in netfilter lately, you may wanna take out >the skb_cloned() call. > > This does not help. Netfilter calls skb_ip_make_writable if it has to touch the packet, if it is shared or cloned the packet will be copied. Despite this, this is hardly a fix as long as the ->act function takes a struct sk_buff **. Regards Patrick From cborntra@de.ibm.com Wed Jan 19 12:52:27 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 12:52:34 -0800 (PST) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.185]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JKqObm013674 for ; Wed, 19 Jan 2005 12:52:25 -0800 Received: from [212.227.126.155] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1CrMoI-0004KW-00; Wed, 19 Jan 2005 21:52:14 +0100 Received: from [84.56.128.128] (helo=cubus.S-IK) by mrelayng.kundenserver.de with asmtp (TLSv1:RC4-MD5:128) (Exim 3.35 #1) id 1CrMoI-0007Hs-00; Wed, 19 Jan 2005 21:52:14 +0100 From: Christian Borntraeger To: hadi@cyberus.ca Subject: Re: [PATCH] ipv6: alternative version of S/390 shared NIC support Date: Wed, 19 Jan 2005 21:52:23 +0100 User-Agent: KMail/1.7.1 Cc: Christoph Hellwig , "David S. Miller" , pavlic@de.ibm.com, waldi@debian.org, netdev@oss.sgi.com References: <20050116115431.GA13617@lst.de> <200501181653.59041.christian@borntraeger.net> <1106142567.1049.970.camel@jzny.localdomain> In-Reply-To: <1106142567.1049.970.camel@jzny.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501192152.23865.cborntra@de.ibm.com> X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:5a8b66f42810086ecd21595c2d6103b9 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 501 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cborntra@de.ibm.com Precedence: bulk X-list: netdev jamal wrote: [...] > > > Can you provision multiple of these cards per VM? if yes, is there > > > some ID that will break it down to OSInstance:cardid? > > You did not answer this question. > Let me draw a diagram to show what i think the hierachy is: > > Physical Card: MAC address X > > > +--- OSInstance A > > | +-- "CARD" with IP A > | +-- "CARD" with IP B > | +-- "CARD" with IP C > | +-- "CARD" with IP D > > . > . > . > > +--- OSInstance N > > +-- "CARD" with IP Z > > > Is the above reflective of what happens? No. Its in the simplest case a one level hierarchy, but always outside Linux. Just for demonstration purposes, just IMAGINE, that a cards has only one device address (devno): -----net-------\ || |hardware | \------------------/ | | | | | | | /--devno---/ | | | | | | | | . . . . | | | | Linux1 Linux2 ....... Linuxn > In other words, packet comes from the wire (with MAC address X); somehow > the hypervisor(?) or firmware figures based on IP address A (assuming no > other instance has that IP) it has to send packet to OSInstanceA. Right. Basically, the card has a table: DEVNO | IP address | ROUTER? 0-ffff | .... | primary, secondary If then a packet arrives it has an IP address. The card looks this address up in this table: | | V is it registered ----yes----> forward to the device number | | V is there a primary router? ----yes----> forward to device number of the | the primary router | | V is there a secondary router? ----yes----> forward to device number of the | the secondary router | V drop packet. > OSInstanceA then selects further the CARD based on something probably in > a descriptor? No. The packet arrives on one "CARD" and Linux gets an "interrupt" and fetches the packet from that card. You can of course have more cards per linux by providing more device numbers in the profile of the virtual machine. But that makes no sense unless you do some testing or the guest operating system is a hypervisor itself and can dispatch the device addresses to its virtual machines. > > Let me get to the point: > I think it would make sense for the "CARD" to be just another netdevice > (call it "card" netdevice for this discussion). > The representation of the physical card in the OSInstance is also a > netdevice(call it physical netdevice for this discussion) as it is now > (excpet it has no IP address ever). > The "card netdevices" are stacked on top of the physical netdevice. This > would be like an upside down bridge stacking relationship of > netdevices.... > It actually is no different from a few tunnel netdevices that sit on top > of say eth0 or multiple PPP devices on top of ethx in a PPPOE > relationship. > The demuxing for incoming packets is done at physical card netdevice > to select the "card" netdevice whose receive method is then called. > Reverse direction for transmit (we could go into details later, just > wanna make sure this is sensible to begin with). If I understood you right, you think that Linux has any control of the real hardware device and the card itself is created in the qeth linux driver as some obscure thing. No, for Linux the device backed by the 3 device addresses is as real as you and me. The qeth driver calls alloc_etherdev for the device represented by the 3 device addresses and, therefore, creating a netdevice for this card. Thats all we have. A card that only speaks IPv4 and IPv6 with us and that handles ARP for magically. To make it worse, the card only cooperates if we tell the card, which IP addresses we want to use. (by the way, the card recognizes duplicates) > Does this sound reasonable? If yes, then if you do this you wont need to > hack anything like IPV6 etc in your driver - they become merely > netdevices. It should also allow for all standard features like ifconfig > up/down etc of the "card" and setting IP addresses, VLANS etc to work as > is. And you wont need to put any speacilized code in the driver. > If its off tangent, then i just wasted 1/2 a cup of coffee energy typing > away ;-> Well, I think you havent been fully aware of the way the card works. I hope my explanation above makes it clearer. In one sentence: our Linux qeth "CARDS" _are_ already netdevices. (We are speaking about struct net_device, right?) Furthermore, as long as there is only one MAC address we need one hack for IPv6, and Christophs version looks very nice and elegant. > > > Right, without registering the IP address, you can not receive any > > packet. > > If this is firmware issue, it would be wise to fix it. You should be > able to register multiple MAC addresses hidden in the firmware (not at > the Linux level) and have your "cards" netdevice use them. i.e the > "card" netdevices would own those. Well,newer cards support something like this (see the hardware announcement) http://www-306.ibm.com/common/ssi/fcgi-bin/ssialias?infotype=an&subtype=ca&supplier=897&appname=IBMLinkRedirect&letternum=ENUS104-346 ) its called Layer 2 support. Unfortunately this feature is only available on a subset of cards and newer zSeries machines. Just for explanation, there is a good reason that you only see the packets for your IP address: scalability of virtualization. Imagine you have a gigabit card shared among 80 Linuxes (quite realistic numbers). If you dont filter early, you have to forward all traffic to every guest system (which then can discard unneeded packages). Then you have to provide an internal bandwith of 80 Gbit/sec. Not a good idea. Therefore you have to multiplex very very early and cannot set every Linux in promiscous mode for performance reasons. Furthermore, it is not that easy to change the way the card works. There are other operating systems like z/OS z/VSE or z/VM running on the same hardware. You dont hastily change the behaviour of hardware, firmware and operating systems which runs in lots of banks and insurance companies with 99.999% availability without making sure that everything works flawlessly. > > As the logical network interface has no own MAC address you actually > > speak IP to the card. That also means, that without some additional > > effort, tools like tcpdump fail and you need some patches in the dhcp > > tools. > > Refer to above. If you actually have your virtual/"card" netdevice on > top of the physical netdevice have a MAC address, then all tools should > work as is with zero changes IMO. Right. Buts that just not the way the hardware works. Pick almost any random linux driver to see ugly code to cicumvent a hardware limitation. Have a look at the amount of traps in the kernel to fix cpu "errata". There is no perfect hardware. > > You can define options for routers to get more than your own packages, > > but IIRC you can only define a primary and secondary router per port. > > Ok, this is new information - what does a "router" mean in relation to a > port? see above. You can have one primary and one secondary router. I hope that helps to understand the problem. If not, please dont hesitate to ask. Christian From eric.lemoine@gmail.com Wed Jan 19 12:52:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 12:52:48 -0800 (PST) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.193]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JKqfov013741 for ; Wed, 19 Jan 2005 12:52:41 -0800 Received: by wproxy.gmail.com with SMTP id 50so32696wri for ; Wed, 19 Jan 2005 12:52:35 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=Wu4DpUISkV25XOqBNLHEHvKbO1VqwyOfYqoN9oseHUQk6m/GR9IwEe+b89o4hu+X/olYzu2rpWjii4IUXlKVu7Xw/mjd/Otw6uaHRks4wbyreDXsHdtA30RHoJrF0B24uNBAKutzpI5NUv8xJZo4LZBkymv8mU5cKG8Fu1U/nUM= Received: by 10.54.30.61 with SMTP id d61mr249966wrd; Wed, 19 Jan 2005 12:52:35 -0800 (PST) Received: by 10.54.30.41 with HTTP; Wed, 19 Jan 2005 12:52:35 -0800 (PST) Message-ID: <5cac192f0501191252406a13f2@mail.gmail.com> Date: Wed, 19 Jan 2005 21:52:35 +0100 From: Eric Lemoine Reply-To: Eric Lemoine To: Lennert Buytenhek Subject: Re: sis900: eth0: NULL pointer encountered in Rx ring, skipping Cc: netdev@oss.sgi.com In-Reply-To: <20050118102139.GA9507@xi.wantstofly.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_264_30301378.1106167955403" References: <20050118101358.GA9335@xi.wantstofly.org> <20050118102139.GA9507@xi.wantstofly.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 502 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: eric.lemoine@gmail.com Precedence: bulk X-list: netdev ------=_Part_264_30301378.1106167955403 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Tue, 18 Jan 2005 11:21:39 +0100, Lennert Buytenhek wrote: > On Tue, Jan 18, 2005 at 11:13:58AM +0100, Lennert Buytenhek wrote: > > > I can make one of my machines, which has an on-board sis900 NIC, lose > > network connectivity within seconds by doing something like > > "nc -l -p 6666 > /dev/null" and then blasting some data towards it. When > > this happens, syslog fills up with these messages: > > > > eth0: NULL pointer encountered in Rx ring, skipping > > Just before it starts spewing these it says: > > eth0: Memory squeeze,deferring packet. > > So apparently it just doesn't deal with OOM very well. There are dev_alloc_skb()'s failing due to memory shortage. I think anyhow that the sis9000 driver doesnt handle "memory squeeze" situations right. Why not throwing current rx packet away and reuse ring entry instead of leaving holes (null skb's) in the ring. I would suggest a patch to the sis900 driver around that attached. Warning: patch compiling but untested - dont have hardware handy. -- Eric ------=_Part_264_30301378.1106167955403 Content-Type: application/octet-stream; name="sis900.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="sis900.patch" PT09PT0gZHJpdmVycy9uZXQvc2lzOTAwLmMgMS41NiB2cyBlZGl0ZWQgPT09PT0KLS0tIDEuNTYv ZHJpdmVycy9uZXQvc2lzOTAwLmMJMjAwNC0wOC0yNSAwOToxNToyMCArMDI6MDAKKysrIGVkaXRl ZC9kcml2ZXJzL25ldC9zaXM5MDAuYwkyMDA1LTAxLTE5IDIxOjQ4OjI3ICswMTowMApAQCAtMTY1 MCw3ICsxNjUwLDcgQEAKIAkJCS8qIHJlc2V0IGJ1ZmZlciBkZXNjcmlwdG9yIHN0YXRlICovCiAJ CQlzaXNfcHJpdi0+cnhfcmluZ1tlbnRyeV0uY21kc3RzID0gUlhfQlVGX1NJWkU7CiAJCX0gZWxz ZSB7Ci0JCQlzdHJ1Y3Qgc2tfYnVmZiAqIHNrYjsKKwkJCXN0cnVjdCBza19idWZmICogc2tiLCAq bmV3X3NrYjsKIAogCQkJLyogVGhpcyBzaXR1YXRpb24gc2hvdWxkIG5ldmVyIGhhcHBlbiwgYnV0 IGR1ZSB0bwogCQkJICAgc29tZSB1bmtub3cgYnVncywgaXQgaXMgcG9zc2libGUgdGhhdApAQCAt MTY2MiwxMSArMTY2MiwzMCBAQAogCQkJCWJyZWFrOwogCQkJfQogCisJCQlza2IgPSBzaXNfcHJp di0+cnhfc2tidWZmW2VudHJ5XTsKKworCQkJaWYgKChuZXdfc2tiID0gZGV2X2FsbG9jX3NrYihS WF9CVUZfU0laRSkpID09IE5VTEwpIHsKKwkJCQlwcmludGsoS0VSTl9JTkZPICIlczogbWVtb3J5 IHNob3J0YWdlLCByeCBwYWNrZXQgZHJvcHBlZFxuIiwKKwkJCQkJbmV0X2Rldi0+bmFtZSk7CisK KwkJCQlzaXNfcHJpdi0+cnhfcmluZ1tlbnRyeV0uY21kc3RzID0gUlhfQlVGX1NJWkU7CisJCQkJ c2lzX3ByaXYtPnN0YXRzLnJ4X2Ryb3BwZWQrKzsKKwkJCQlzaXNfcHJpdi0+ZGlydHlfcngrKzsg LyogZGlydHkgbm8gbG9uZ2VyIG5lZWRlZD8gKi8KKwkJCQlicmVhazsgLyogbmV4dCAqLworCQkJ fQorCiAJCQlwY2lfdW5tYXBfc2luZ2xlKHNpc19wcml2LT5wY2lfZGV2LCAKIAkJCQlzaXNfcHJp di0+cnhfcmluZ1tlbnRyeV0uYnVmcHRyLCBSWF9CVUZfU0laRSwgCiAJCQkJUENJX0RNQV9GUk9N REVWSUNFKTsKKworCQkJbmV3X3NrYi0+ZGV2ID0gbmV0X2RldjsKKwkJCXNpc19wcml2LT5yeF9z a2J1ZmZbZW50cnldID0gbmV3X3NrYjsKKwkJCXNpc19wcml2LT5yeF9yaW5nW2VudHJ5XS5jbWRz dHMgPSBSWF9CVUZfU0laRTsKKyAgICAgICAgICAgICAgICAJc2lzX3ByaXYtPnJ4X3JpbmdbZW50 cnldLmJ1ZnB0ciA9IAorCQkJCXBjaV9tYXBfc2luZ2xlKHNpc19wcml2LT5wY2lfZGV2LCBuZXdf c2tiLT50YWlsLCAKKwkJCQkJUlhfQlVGX1NJWkUsIFBDSV9ETUFfRlJPTURFVklDRSk7CisKIAkJ CS8qIGdpdmUgdGhlIHNvY2tldCBidWZmZXIgdG8gdXBwZXIgbGF5ZXJzICovCi0JCQlza2IgPSBz aXNfcHJpdi0+cnhfc2tidWZmW2VudHJ5XTsKIAkJCXNrYl9wdXQoc2tiLCByeF9zaXplKTsKIAkJ CXNrYi0+cHJvdG9jb2wgPSBldGhfdHlwZV90cmFucyhza2IsIG5ldF9kZXYpOwogCQkJbmV0aWZf cngoc2tiKTsKQEAgLTE2NzgsMjkgKzE2OTcsNiBAQAogCQkJc2lzX3ByaXYtPnN0YXRzLnJ4X2J5 dGVzICs9IHJ4X3NpemU7CiAJCQlzaXNfcHJpdi0+c3RhdHMucnhfcGFja2V0cysrOwogCi0JCQkv KiByZWZpbGwgdGhlIFJ4IGJ1ZmZlciwgd2hhdCBpZiB0aGVyZSBpcyBub3QgZW5vdWdodCBtZW1v cnkgZm9yCi0JCQkgICBuZXcgc29ja2V0IGJ1ZmZlciA/PyAqLwotCQkJaWYgKChza2IgPSBkZXZf YWxsb2Nfc2tiKFJYX0JVRl9TSVpFKSkgPT0gTlVMTCkgewotCQkJCS8qIG5vdCBlbm91Z2ggbWVt b3J5IGZvciBza2J1ZmYsIHRoaXMgbWFrZXMgYSAiaG9sZSIKLQkJCQkgICBvbiB0aGUgYnVmZmVy IHJpbmcsIGl0IGlzIG5vdCBjbGVhciBob3cgdGhlCi0JCQkJICAgaGFyZHdhcmUgd2lsbCByZWFj dCB0byB0aGlzIGtpbmQgb2YgZGVnZW5lcmF0ZWQKLQkJCQkgICBidWZmZXIgKi8KLQkJCQlwcmlu dGsoS0VSTl9JTkZPICIlczogTWVtb3J5IHNxdWVlemUsIgotCQkJCSAgICAgICAiZGVmZXJyaW5n IHBhY2tldC5cbiIsCi0JCQkJICAgICAgIG5ldF9kZXYtPm5hbWUpOwotCQkJCXNpc19wcml2LT5y eF9za2J1ZmZbZW50cnldID0gTlVMTDsKLQkJCQkvKiByZXNldCBidWZmZXIgZGVzY3JpcHRvciBz dGF0ZSAqLwotCQkJCXNpc19wcml2LT5yeF9yaW5nW2VudHJ5XS5jbWRzdHMgPSAwOwotCQkJCXNp c19wcml2LT5yeF9yaW5nW2VudHJ5XS5idWZwdHIgPSAwOwotCQkJCXNpc19wcml2LT5zdGF0cy5y eF9kcm9wcGVkKys7Ci0JCQkJYnJlYWs7Ci0JCQl9Ci0JCQlza2ItPmRldiA9IG5ldF9kZXY7Ci0J CQlzaXNfcHJpdi0+cnhfc2tidWZmW2VudHJ5XSA9IHNrYjsKLQkJCXNpc19wcml2LT5yeF9yaW5n W2VudHJ5XS5jbWRzdHMgPSBSWF9CVUZfU0laRTsKLSAgICAgICAgICAgICAgICAJc2lzX3ByaXYt PnJ4X3JpbmdbZW50cnldLmJ1ZnB0ciA9IAotCQkJCXBjaV9tYXBfc2luZ2xlKHNpc19wcml2LT5w Y2lfZGV2LCBza2ItPnRhaWwsIAotCQkJCQlSWF9CVUZfU0laRSwgUENJX0RNQV9GUk9NREVWSUNF KTsKIAkJCXNpc19wcml2LT5kaXJ0eV9yeCsrOwogCQl9CiAJCXNpc19wcml2LT5jdXJfcngrKzsK QEAgLTE3MDgsNiArMTcwNCw3IEBACiAJCXJ4X3N0YXR1cyA9IHNpc19wcml2LT5yeF9yaW5nW2Vu dHJ5XS5jbWRzdHM7CiAJfSAvLyB3aGlsZQogCisjaWYgMCAvKiBubyBuZWVkIHRvIHJlZmlsbCBz a2JzIGFyZSBhZGRlZCB0byB0aGUgcnggcmluZyBhcyBwYWNrZXRzIGFyZSByZWNlaXZlZCAqLwog CS8qIHJlZmlsbCB0aGUgUnggYnVmZmVyLCB3aGF0IGlmIHRoZSByYXRlIG9mIHJlZmlsbGluZyBp cyBzbG93ZXIgdGhhbiAKIAkgICBjb25zdW1pbmcgPz8gKi8KIAlmb3IgKDtzaXNfcHJpdi0+Y3Vy X3J4IC0gc2lzX3ByaXYtPmRpcnR5X3J4ID4gMDsgc2lzX3ByaXYtPmRpcnR5X3J4KyspIHsKQEAg LTE3MzUsNiArMTczMiw3IEBACiAJCQkJCVJYX0JVRl9TSVpFLCBQQ0lfRE1BX0ZST01ERVZJQ0Up OwogCQl9CiAJfQorI2VuZGlmCiAJLyogcmUtZW5hYmxlIHRoZSBwb3RlbnRpYWxseSBpZGxlIHJl Y2VpdmUgc3RhdGUgbWF0Y2hpbmUgKi8KIAlvdXRsKFJ4RU5BIHwgaW5sKGlvYWRkciArIGNyKSwg aW9hZGRyICsgY3IgKTsKIAo= ------=_Part_264_30301378.1106167955403-- From romieu@fr.zoreil.com Wed Jan 19 13:53:40 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 13:53:45 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JLrcuA017003 for ; Wed, 19 Jan 2005 13:53:39 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.13.1/8.12.1) with ESMTP id j0JLnXkr003906; Wed, 19 Jan 2005 22:49:33 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.13.1/8.13.1/Submit) id j0JLnStD003905; Wed, 19 Jan 2005 22:49:28 +0100 Date: Wed, 19 Jan 2005 22:49:27 +0100 From: Francois Romieu To: Eric Lemoine Cc: Lennert Buytenhek , netdev@oss.sgi.com Subject: Re: sis900: eth0: NULL pointer encountered in Rx ring, skipping Message-ID: <20050119214927.GA2330@electric-eye.fr.zoreil.com> References: <20050118101358.GA9335@xi.wantstofly.org> <20050118102139.GA9507@xi.wantstofly.org> <5cac192f0501191252406a13f2@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5cac192f0501191252406a13f2@mail.gmail.com> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 504 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Eric Lemoine : [...] > There are dev_alloc_skb()'s failing due to memory shortage. I think > anyhow that the sis9000 driver doesnt handle "memory squeeze" > situations right. Why not throwing current rx packet away and reuse > ring entry instead of leaving holes (null skb's) in the ring. I would > suggest a patch to the sis900 driver around that attached. Imho it should not be necessary as long as the hardware is not completely b0rken. I'd rather see how the driver behaves when it is really short of memory (i.e. no entry is available for DMA in the ring). Patch below. Make the driver own a Rx descriptor entry as long as it is not refilled. Signed-off-by: Francois Romieu diff -puN drivers/net/sis900.c~sis900-000 drivers/net/sis900.c --- linux-2.6.11-rc1-bk6/drivers/net/sis900.c~sis900-000 2005-01-19 22:28:38.633282552 +0100 +++ linux-2.6.11-rc1-bk6-fr/drivers/net/sis900.c 2005-01-19 22:34:16.362996145 +0100 @@ -1643,13 +1643,15 @@ static int sis900_rx(struct net_device * long ioaddr = net_dev->base_addr; unsigned int entry = sis_priv->cur_rx % NUM_RX_DESC; u32 rx_status = sis_priv->rx_ring[entry].cmdsts; + int rx_left; if (sis900_debug > 3) printk(KERN_INFO "sis900_rx, cur_rx:%4.4d, dirty_rx:%4.4d " "status:0x%8.8x\n", sis_priv->cur_rx, sis_priv->dirty_rx, rx_status); - while (rx_status & OWN) { + rx_left = NUM_RX_DESC + sis_priv->dirty_rx - sis_priv->cur_rx; + while ((rx_left > 0) && (rx_status & OWN)) { unsigned int rx_size; rx_size = (rx_status & DSIZE) - CRC_SIZE; @@ -1712,7 +1714,7 @@ static int sis900_rx(struct net_device * net_dev->name); sis_priv->rx_skbuff[entry] = NULL; /* reset buffer descriptor state */ - sis_priv->rx_ring[entry].cmdsts = 0; + sis_priv->rx_ring[entry].cmdsts = OWN; sis_priv->rx_ring[entry].bufptr = 0; sis_priv->stats.rx_dropped++; break; @@ -1728,6 +1730,8 @@ static int sis900_rx(struct net_device * sis_priv->cur_rx++; entry = sis_priv->cur_rx % NUM_RX_DESC; + rmb(); rx_status = sis_priv->rx_ring[entry].cmdsts; + rx_left--; } // while /* refill the Rx buffer, what if the rate of refilling is slower _ From shemminger@osdl.org Wed Jan 19 13:52:27 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 13:52:57 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JLqPBI016835 for ; Wed, 19 Jan 2005 13:52:25 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0JLqEl14737; Wed, 19 Jan 2005 13:52:14 -0800 Date: Wed, 19 Jan 2005 13:52:17 -0800 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [RFT] skge: new syskonnect gigabit ethernet driver Message-ID: <20050119135217.38fe5f05@dxpl.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 503 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev This is the second public release of my new rewrite of the SysKonnect Gigabit Ethernet driver. This 0.3 version fixes bugs with link up/down and ethtool phys_id support. It adds ethtool support for interrupt coalescing and pause parameters. Performance is good, I am able to get 941 Mbit/sec receiving (TCP using iperf). But obviously, the driver is still experimental. This driver doesn't support Yukon2 (yet), and there is report of problem with D-Link card (Yukon-EC). The patch should work on 2.6.8 or later, I am testing with 2.6.11-rc1. Also available as download from http://developer.osdl.org/shemminge/skge diff -Nru a/drivers/net/Kconfig b/drivers/net/Kconfig --- a/drivers/net/Kconfig 2005-01-19 13:42:49 -08:00 +++ b/drivers/net/Kconfig 2005-01-19 13:42:49 -08:00 @@ -1980,6 +1980,18 @@ If in doubt, say Y. +config SKGE + tristate "New SysKonnect GigaEthernet support (EXPERIMENTAL)" + depends on PCI && EXPERIMENTAL + select CRC32 + ---help--- + This driver support the Marvell Yukon or SysKonnect SK-98xx/SK-95xx + and related Gigabit Ethernet adapters. It is a new smaller driver + driver with better performance and more complete ethtool support. + + It does not support the link failover and network management + features that "portable" vendor supplied sk98lin driver does. + config SK98LIN tristate "Marvell Yukon Chipset / SysKonnect SK-98xx Support" depends on PCI diff -Nru a/drivers/net/Makefile b/drivers/net/Makefile --- a/drivers/net/Makefile 2005-01-19 13:42:49 -08:00 +++ b/drivers/net/Makefile 2005-01-19 13:42:49 -08:00 @@ -52,6 +52,7 @@ obj-$(CONFIG_FEALNX) += fealnx.o obj-$(CONFIG_TIGON3) += tg3.o obj-$(CONFIG_TC35815) += tc35815.o +obj-$(CONFIG_SKGE) += skge.o obj-$(CONFIG_SK98LIN) += sk98lin/ obj-$(CONFIG_SKFP) += skfp/ obj-$(CONFIG_VIA_RHINE) += via-rhine.o diff -Nru a/drivers/net/skge.c b/drivers/net/skge.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/net/skge.c 2005-01-19 13:42:49 -08:00 @@ -0,0 +1,3268 @@ +/* + * New driver for Marvell Yukon chipsent and SysKonnect Gigabit + * Ethernet adapters. Based on earlier sk98lin, e100 and + * Freebsd if_sk drivers. + * + * This driver intentionally does not support all the features + * of the original driver such as link failover and link management because + * those should be done at higher levels. + * + * Copyright (C) 2004, Stephen Hemminger + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "skge.h" + +#define DRV_NAME "skge" +#define DRV_VERSION "0.3" +#define PFX DRV_NAME " " + +#define DEFAULT_TX_RING_SIZE 128 +#define DEFAULT_RX_RING_SIZE 512 +#define MAX_TX_RING_SIZE 1024 +#define MAX_RX_RING_SIZE 4096 +#define PHY_RETRIES 1000 +#define ETH_JUMBO_MTU 9000 +#define TX_WATCHDOG (2 * HZ) +#define NAPI_WEIGHT 64 + +MODULE_DESCRIPTION("SysKonnect Gigabit Ethernet driver"); +MODULE_AUTHOR("Stephen Hemminger "); +MODULE_LICENSE("GPL"); +MODULE_VERSION(DRV_VERSION); + +static const u32 default_msg + = NETIF_MSG_DRV| NETIF_MSG_PROBE| NETIF_MSG_LINK + | NETIF_MSG_IFUP| NETIF_MSG_IFDOWN; + +static int debug = -1; /* defaults above */ +module_param(debug, int, 0); +MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); + +static const struct pci_device_id skge_id_table[] = { + { PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C940, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C940B, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_GE, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_YU, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_SYSKONNECT, 0x9E00, /* SK-9Exx 10/100/1000Base-T Adapter */ + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_DLINK, PCI_DEVICE_ID_DLINK_DGE510T, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_MARVELL, 0x4320, /* Gigabit Ethernet Controller */ + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_MARVELL, 0x5005, /* Marvell (11ab), Belkin */ + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_CNET, PCI_DEVICE_ID_CNET_GIGACARD, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_LINKSYS, PCI_DEVICE_ID_LINKSYS_EG1032, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_LINKSYS, PCI_DEVICE_ID_LINKSYS_EG1064, + PCI_ANY_ID, PCI_ANY_ID }, + { 0 } +}; +MODULE_DEVICE_TABLE(pci, skge_id_table); + +static int skge_up(struct net_device *dev); +static int skge_down(struct net_device *dev); +static void skge_tx_clean(struct skge_port *skge); +static void skge_xm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val); +static void skge_gm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val); +static void genesis_get_stats(struct skge_port *skge, u64 *data); +static void yukon_get_stats(struct skge_port *skge, u64 *data); + +static const int txq[] = { Q_XA1, Q_XA2 }; +static const int rxq[] = { Q_R1, Q_R2 }; + +/* Don't need to look at whole 16K. + * last interesting register is descriptor poll timer. + */ +#define SKGE_REGS_LEN (29*128) + +static int skge_get_regs_len(struct net_device *dev) +{ + return SKGE_REGS_LEN; +} + +/* + * Returns copy of control register region + * I/O region is divided into banks and certain regions + * are unreadable + */ +static void skge_get_regs(struct net_device *dev, struct ethtool_regs *regs, + void *p) +{ + struct skge_port *skge = netdev_priv(dev); + unsigned long offs; + void __iomem *io = skge->hw->regs; + static const unsigned long bankmap + = (1<<0) | (1<<2) | (1<<8) | (1<<9) + | (1<<12) | (1<<13) | (1<<14) | (1<<15) | (1<<16) + | (1<<17) | (1<<20) | (1<<21) | (1<<22) | (1<<23) + | (1<<24) | (1<<25) | (1<<26) | (1<<27) | (1<<28); + + regs->version = 1; + for (offs = 0; offs < regs->len; offs += 128) { + u32 len = min_t(u32, 128, regs->len - offs); + + if (bankmap & (1<<(offs/128))) + memcpy_fromio(p + offs, io + offs, len); + else + memset(p + offs, 0, len); + } +} + +static int skge_get_settings(struct net_device *dev, + struct ethtool_cmd *ecmd) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + + ecmd->transceiver = XCVR_INTERNAL; + + if (iscopper(hw)) { + if (hw->chip_id == CHIP_ID_GENESIS) + ecmd->supported = SUPPORTED_1000baseT_Full + | SUPPORTED_1000baseT_Half + | SUPPORTED_Autoneg | SUPPORTED_TP; + else { + ecmd->supported = SUPPORTED_10baseT_Half + | SUPPORTED_10baseT_Full + | SUPPORTED_100baseT_Half + | SUPPORTED_100baseT_Full + | SUPPORTED_1000baseT_Half + | SUPPORTED_1000baseT_Full + | SUPPORTED_Autoneg| SUPPORTED_TP; + + if (hw->chip_id == CHIP_ID_YUKON) + ecmd->supported &= ~SUPPORTED_1000baseT_Half; + + else if (hw->chip_id == CHIP_ID_YUKON_FE) + ecmd->supported &= ~(SUPPORTED_1000baseT_Half + | SUPPORTED_1000baseT_Full); + } + + ecmd->advertising = ADVERTISED_TP | ADVERTISED_Autoneg; + ecmd->port = PORT_TP; + ecmd->phy_address = hw->phy_addr; + + ecmd->speed = skge->speed; + ecmd->duplex = skge->duplex; + } else { + ecmd->supported = SUPPORTED_1000baseT_Full + | SUPPORTED_FIBRE + | SUPPORTED_Autoneg; + + ecmd->advertising = ADVERTISED_1000baseT_Full + | ADVERTISED_FIBRE + | ADVERTISED_Autoneg; + ecmd->port = PORT_FIBRE; + ecmd->autoneg = AUTONEG_ENABLE; + ecmd->speed = SPEED_1000; + ecmd->duplex = DUPLEX_FULL; + } + + return 0; +} + +static int skge_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) +{ + struct skge_port *skge = netdev_priv(dev); + + skge->autoneg = ecmd->autoneg; + skge->speed = ecmd->speed; + skge->duplex = ecmd->duplex; + + if (netif_running(dev)) { + skge_down(dev); + skge_up(dev); + } + return (0); +} + +static void skge_get_drvinfo(struct net_device *dev, + struct ethtool_drvinfo *info) +{ + struct skge_port *skge = netdev_priv(dev); + + strcpy(info->driver, DRV_NAME); + strcpy(info->version, DRV_VERSION); + strcpy(info->fw_version, "N/A"); + strcpy(info->bus_info, pci_name(skge->hw->pdev)); +} + +/* + * The VPD config area contains Vital Product Data, as suggested in + * the PCI 2.1 specification. The VPD data is separared into areas + * denoted by resource IDs. The SysKonnect VPD contains an ID string + * resource (the name of the adapter), a read-only area resource + * containing various key/data fields and a read/write area which + * can be used to store asset management information or log messages. + */ +static int skge_vpd_read(struct pci_dev *pci, u8 *buf, u16 offset, u32 len) +{ + int i; + u16 reg; + unsigned long timeout = jiffies + 2*HZ; + + if (offset & 3) + return -EINVAL; + + for (i = 0; i < len; i += 4) { + pci_write_config_word(pci, PCI_VPD+PCI_VPD_ADDR, offset); + + for(;;) { + pci_read_config_word(pci, PCI_VPD+PCI_VPD_ADDR, ®); + + if (reg & PCI_VPD_ADDR_F) + break; + + if (time_after(jiffies, timeout)) { + printk(KERN_ERR "%s: VPD read timed out\n", + pci_name(pci)); + return -ETIMEDOUT; + } + cpu_relax(); + } + + pci_read_config_byte(pci, PCI_VPD+PCI_VPD_DATA, buf+i); + pci_read_config_byte(pci, PCI_VPD+PCI_VPD_DATA+1,buf+i+1); + pci_read_config_byte(pci, PCI_VPD+PCI_VPD_DATA+2,buf+i+2); + pci_read_config_byte(pci, PCI_VPD+PCI_VPD_DATA+3,buf+i+3); + + offset += 4; + } + return 0; +} + +static const struct skge_stat { + char name[ETH_GSTRING_LEN]; + u16 xmac_offset; + u16 gma_offset; +} skge_stats[] = { + { "tx_bytes", XM_TXO_OK_HI, GM_TXO_OK_HI }, + { "rx_bytes", XM_RXO_OK_HI, GM_RXO_OK_HI }, + + { "tx_broadcast", XM_TXF_BC_OK, GM_TXF_BC_OK }, + { "rx_broadcast", XM_RXF_BC_OK, GM_RXF_BC_OK }, + { "tx_multicast", XM_TXF_MC_OK, GM_TXF_MC_OK }, + { "rx_multicast", XM_RXF_MC_OK, GM_RXF_MC_OK }, + { "tx_unicast", XM_TXF_UC_OK, GM_TXF_UC_OK }, + { "rx_unicast", XM_RXF_UC_OK, GM_RXF_UC_OK }, + { "tx_mac_pause", XM_TXF_MPAUSE, GM_TXF_MPAUSE }, + { "rx_mac_pause", XM_RXF_MPAUSE, GM_RXF_MPAUSE }, + + { "collisions", XM_TXF_SNG_COL, GM_TXF_SNG_COL }, + { "multi_collisions", XM_TXF_MUL_COL, GM_TXF_MUL_COL }, + { "aborted", XM_TXF_ABO_COL, GM_TXF_ABO_COL}, + { "late_collision", XM_TXF_LAT_COL, GM_TXF_LAT_COL }, + { "fifo_underrun", XM_TXE_FIFO_UR, GM_TXE_FIFO_UR }, + { "fifo_overflow", XM_RXE_FIFO_OV, GM_RXE_FIFO_OV }, + + { "rx_toolong", XM_RXF_LNG_ERR, GM_RXF_LNG_ERR }, + { "rx_jabber", XM_RXF_JAB_PKT, GM_RXF_JAB_PKT }, + { "rx_runt", XM_RXE_RUNT, GM_RXE_FRAG }, + { "rx_too_long", XM_RXF_LNG_ERR, GM_RXF_LNG_ERR }, + { "rx_fcs_error", XM_RXF_FCS_ERR, GM_RXF_FCS_ERR }, +}; + +static int skge_get_stats_count(struct net_device *dev) +{ + return ARRAY_SIZE(skge_stats); +} + +static void skge_get_ethtool_stats(struct net_device *dev, + struct ethtool_stats *stats, u64 *data) +{ + struct skge_port *skge = netdev_priv(dev); + + if (skge->hw->chip_id == CHIP_ID_GENESIS) + genesis_get_stats(skge, data); + else + yukon_get_stats(skge, data); +} + +static void skge_get_strings(struct net_device *dev, u32 stringset, u8 *data) +{ + int i; + + switch(stringset) { + case ETH_SS_STATS: + for (i = 0; i < ARRAY_SIZE(skge_stats); i++) + memcpy(data + i * ETH_GSTRING_LEN, + skge_stats[i].name, ETH_GSTRING_LEN); + break; + } +} + +static void skge_get_ring_param(struct net_device *dev, + struct ethtool_ringparam *p) +{ + struct skge_port *skge = netdev_priv(dev); + + p->rx_max_pending = MAX_RX_RING_SIZE; + p->tx_max_pending = MAX_TX_RING_SIZE; + p->rx_mini_max_pending = 0; + p->rx_jumbo_max_pending = 0; + + p->rx_pending = skge->rx_ring.count; + p->tx_pending = skge->tx_ring.count; + p->rx_mini_pending = 0; + p->rx_jumbo_pending = 0; +} + +static int skge_set_ring_param(struct net_device *dev, + struct ethtool_ringparam *p) +{ + struct skge_port *skge = netdev_priv(dev); + + if (p->rx_pending == 0 || p->rx_pending > MAX_RX_RING_SIZE || + p->tx_pending == 0 || p->tx_pending > MAX_TX_RING_SIZE) + return -EINVAL; + + skge->rx_ring.count = p->rx_pending; + skge->tx_ring.count = p->tx_pending; + + if (netif_running(dev)) { + skge_down(dev); + skge_up(dev); + } + + return 0; +} + +static u32 skge_get_msglevel(struct net_device *netdev) +{ + struct skge_port *skge = netdev_priv(netdev); + return skge->msg_enable; +} + +static void skge_set_msglevel(struct net_device *netdev, u32 value) +{ + struct skge_port *skge = netdev_priv(netdev); + skge->msg_enable = value; +} + +static int skge_set_sg(struct net_device *dev, u32 data) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + + if (hw->chip_id == CHIP_ID_GENESIS && data) + return -EOPNOTSUPP; + return ethtool_op_set_sg(dev, data); +} + +static u32 skge_get_rx_csum(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + + return skge->rx_csum; +} + +static int skge_set_rx_csum(struct net_device *dev, u32 data) +{ + struct skge_port *skge = netdev_priv(dev); + + if (skge->hw->chip_id == CHIP_ID_GENESIS && data) + return -EOPNOTSUPP; + + skge->rx_csum = data; + return 0; +} + +static int skge_set_tso(struct net_device *dev, u32 data) +{ + if (data) + return -EOPNOTSUPP; + return 0; +} + +static void skge_get_pauseparam(struct net_device *dev, + struct ethtool_pauseparam *ecmd) +{ + struct skge_port *skge = netdev_priv(dev); + + ecmd->tx_pause = (skge->flow_control == FLOW_MODE_LOC_SEND) + || (skge->flow_control == FLOW_MODE_SYMMETRIC); + ecmd->rx_pause = (skge->flow_control == FLOW_MODE_REM_SEND) + || (skge->flow_control == FLOW_MODE_SYMMETRIC); + + ecmd->autoneg = skge->autoneg; +} + +static int skge_set_pauseparam(struct net_device *dev, + struct ethtool_pauseparam *ecmd) +{ + struct skge_port *skge = netdev_priv(dev); + + skge->autoneg = ecmd->autoneg; + if (ecmd->rx_pause && ecmd->tx_pause) + skge->flow_control = FLOW_MODE_SYMMETRIC; + else if(ecmd->rx_pause && !ecmd->tx_pause) + skge->flow_control = FLOW_MODE_REM_SEND; + else if(!ecmd->rx_pause && ecmd->tx_pause) + skge->flow_control = FLOW_MODE_LOC_SEND; + else + skge->flow_control = FLOW_MODE_NONE; + + if (netif_running(dev)) { + skge_down(dev); + skge_up(dev); + } + return 0; +} + +static inline u32 skge_freq(const struct skge_hw *hw) +{ + if (hw->chip_id == CHIP_ID_GENESIS) + return 53215000; /* or: 53.125 MHz */ + else if (hw->chip_id == CHIP_ID_YUKON_EC) + return 125000000; /* or: 125.000 MHz */ + else + return 78215000; /* or: 78.125 MHz */ +} + +static int skge_get_coalesce(struct net_device *dev, + struct ethtool_coalesce *ecmd) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + int port = skge->port; + + ecmd->rx_coalesce_usecs = 0; + ecmd->tx_coalesce_usecs = 0; + + if (skge_read32(hw, B2_IRQM_CTRL) & TIM_START) { + u32 msk; + u64 delay = skge_read32(hw, B2_IRQM_INI); + + pr_debug("irqm = %lld\n", delay); + delay *= USEC_PER_SEC; + + do_div(delay, skge_freq(hw)); + msk = skge_read32(hw, B2_IRQM_MSK); + + if (((port == 0) && (msk & IS_R1_F)) || + ((port == 1) && (msk & IS_R2_F))) + ecmd->rx_coalesce_usecs = delay; + if (((port == 0) && (msk & IS_XA1_F)) || + ((port == 1) && (msk & IS_XA1_F))) + ecmd->tx_coalesce_usecs = delay; + } + + return 0; +} + +/* Not interrupt coalescing is per board, not per device */ +static int skge_set_coalesce(struct net_device *dev, + struct ethtool_coalesce *ecmd) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + int port = skge->port; + u32 msk = skge_read32(hw, B2_IRQM_MSK); + u32 delay = 25; + + if (ecmd->rx_coalesce_usecs == 0) + msk &= ~(port == 0 ? IS_R1_F : IS_R2_F); + else if (ecmd->rx_coalesce_usecs < 25 || + ecmd->rx_coalesce_usecs > 33333) + return -EINVAL; + else { + msk |= port == 0 ? IS_R1_F : IS_R2_F; + delay = ecmd->rx_coalesce_usecs; + } + + if (ecmd->tx_coalesce_usecs == 0) + msk &= ~((port == 0) ? IS_XA1_F : IS_XA2_F); + else if (ecmd->tx_coalesce_usecs < 25 || + ecmd->tx_coalesce_usecs > 33333) + return -EINVAL; + else { + msk |= (port == 0) ? IS_XA1_F : IS_XA2_F; + delay = min(delay, ecmd->rx_coalesce_usecs); + } + + skge_write32(hw, B2_IRQM_MSK, msk); + if (msk == 0) + skge_write32(hw, B2_IRQM_CTRL, TIM_STOP); + else { + u64 ticks = (u64) delay * skge_freq(hw); + pr_debug("ticks * 10^6=%lld\n", ticks); + do_div(ticks, USEC_PER_SEC); + skge_write32(hw, B2_IRQM_INI, ticks); + skge_write32(hw, B2_IRQM_CTRL, TIM_START); + } + return 0; +} + +static void skge_led_on(struct skge_hw *hw, int port) +{ + if (hw->chip_id == CHIP_ID_GENESIS) { + skge_write8(hw, SKGEMAC_REG(port, LNK_LED_REG), LINKLED_ON); + skge_write8(hw, B0_LED, LED_STAT_ON); + + skge_write8(hw, SKGEMAC_REG(port, RX_LED_TST), LED_T_ON); + skge_write32(hw, SKGEMAC_REG(port, RX_LED_VAL), 100); + skge_write8(hw, SKGEMAC_REG(port, RX_LED_CTRL), LED_START); + + switch (hw->phy_type) { + case SK_PHY_BCOM: + skge_xm_phy_write(hw, port, PHY_BCOM_P_EXT_CTRL, + PHY_B_PEC_LED_ON); + break; + case SK_PHY_LONE: + skge_xm_phy_write(hw, port, PHY_LONE_LED_CFG, + 0x0800); + break; + default: + skge_write8(hw, SKGEMAC_REG(port, TX_LED_TST), LED_T_ON); + skge_write32(hw, SKGEMAC_REG(port, TX_LED_VAL), 100); + skge_write8(hw, SKGEMAC_REG(port, TX_LED_CTRL), LED_START); + } + } else { + skge_gm_phy_write(hw, port, PHY_MARV_LED_CTRL, 0); + skge_gm_phy_write(hw, port, PHY_MARV_LED_OVER, + PHY_M_LED_MO_DUP(MO_LED_ON) | + PHY_M_LED_MO_10(MO_LED_ON) | + PHY_M_LED_MO_100(MO_LED_ON) | + PHY_M_LED_MO_1000(MO_LED_ON) | + PHY_M_LED_MO_RX(MO_LED_ON)); + } +} + +static void skge_led_off(struct skge_hw *hw, int port) +{ + if (hw->chip_id == CHIP_ID_GENESIS) { + skge_write8(hw, SKGEMAC_REG(port, LNK_LED_REG), LINKLED_OFF); + skge_write8(hw, B0_LED, LED_STAT_OFF); + + skge_write32(hw, SKGEMAC_REG(port, RX_LED_VAL), 0); + skge_write8(hw, SKGEMAC_REG(port, RX_LED_CTRL), LED_T_OFF); + + switch (hw->phy_type) { + case SK_PHY_BCOM: + skge_xm_phy_write(hw, port, PHY_BCOM_P_EXT_CTRL, + PHY_B_PEC_LED_OFF); + break; + case SK_PHY_LONE: + skge_xm_phy_write(hw, port, PHY_LONE_LED_CFG, + PHY_L_LC_LEDT); + break; + default: + skge_write32(hw, SKGEMAC_REG(port, TX_LED_VAL), 0); + skge_write8(hw, SKGEMAC_REG(port, TX_LED_CTRL), LED_T_OFF); + } + } else { + skge_gm_phy_write(hw, port, PHY_MARV_LED_CTRL, 0); + skge_gm_phy_write(hw, port, PHY_MARV_LED_OVER, + PHY_M_LED_MO_DUP(MO_LED_OFF) | + PHY_M_LED_MO_10(MO_LED_OFF) | + PHY_M_LED_MO_100(MO_LED_OFF) | + PHY_M_LED_MO_1000(MO_LED_OFF) | + PHY_M_LED_MO_RX(MO_LED_OFF)); + } +} + +static void skge_blink_timer(unsigned long data) +{ + struct skge_port *skge = (struct skge_port *) data; + struct skge_hw *hw = skge->hw; + unsigned long flags; + + spin_lock_irqsave(&hw->phy_lock, flags); + if (skge->blink_on) + skge_led_on(hw, skge->port); + else + skge_led_off(hw, skge->port); + spin_unlock_irqrestore(&hw->phy_lock, flags); + + skge->blink_on = !skge->blink_on; + mod_timer(&skge->led_blink, jiffies + HZ/4); +} + +static int skge_phys_id(struct net_device *dev, u32 data) +{ + struct skge_port *skge = netdev_priv(dev); + + if(!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ)) + data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ); + + /* start blinking */ + skge->blink_on = 1; + mod_timer(&skge->led_blink, jiffies); + + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(data * HZ); + del_timer_sync(&skge->led_blink); + + skge_led_off(skge->hw, skge->port); + + return 0; +} + +static struct ethtool_ops skge_ethtool_ops = { + .get_settings = skge_get_settings, + .set_settings = skge_set_settings, + .get_drvinfo = skge_get_drvinfo, + .get_regs_len = skge_get_regs_len, + .get_regs = skge_get_regs, + .get_msglevel = skge_get_msglevel, + .set_msglevel = skge_set_msglevel, + .get_link = ethtool_op_get_link, + .get_ringparam = skge_get_ring_param, + .set_ringparam = skge_set_ring_param, + .get_pauseparam = skge_get_pauseparam, + .set_pauseparam = skge_set_pauseparam, + .get_coalesce = skge_get_coalesce, + .set_coalesce = skge_set_coalesce, + .get_tso = ethtool_op_get_tso, + .set_tso = skge_set_tso, + .get_sg = ethtool_op_get_sg, + .set_sg = skge_set_sg, + .get_tx_csum = ethtool_op_get_tx_csum, + .set_tx_csum = ethtool_op_set_tx_csum, + .get_rx_csum = skge_get_rx_csum, + .set_rx_csum = skge_set_rx_csum, + .get_strings = skge_get_strings, + .phys_id = skge_phys_id, + .get_stats_count = skge_get_stats_count, + .get_ethtool_stats = skge_get_ethtool_stats, +}; + +/* + * Allocate ring elements and chain them together + * One-to-one association of board descriptors with ring elements + */ +static int skge_ring_alloc(struct skge_ring *ring, void *vaddr, u64 base) +{ + struct skge_tx_desc *d; + struct skge_element *e; + int i; + + ring->start = kmalloc(sizeof(*e)*ring->count, GFP_KERNEL); + if (!ring->start) + return -ENOMEM; + + for (i = 0, e = ring->start, d = vaddr; i < ring->count; i++, e++, d++) { + e->desc = d; + if (i == ring->count - 1) { + e->next = ring->start; + d->next_offset = base; + } else { + e->next = e + 1; + d->next_offset = base + (i+1) * sizeof(*d); + } + } + ring->to_use = ring->to_clean = ring->start; + + return 0; +} + +/* Setup buffer for receiving */ +static inline int skge_rx_alloc(struct skge_port *skge, + struct skge_element *e) +{ + unsigned long bufsize = skge->netdev->mtu + ETH_HLEN; /* VLAN? */ + struct skge_rx_desc *rd = e->desc; + struct sk_buff *skb; + u64 map; + + skb = dev_alloc_skb(bufsize + NET_IP_ALIGN); + if (unlikely(!skb)) { + printk(KERN_DEBUG PFX "%s: out of memory for receive\n", + skge->netdev->name); + return -ENOMEM; + } + + skb->dev = skge->netdev; + skb_reserve(skb, NET_IP_ALIGN); + + map = pci_map_single(skge->hw->pdev, skb->data, bufsize, + PCI_DMA_FROMDEVICE); + + rd->dma_lo = map; + rd->dma_hi = map >> 32; + e->skb = skb; + rd->csum1_start = ETH_HLEN; + rd->csum2_start = ETH_HLEN; + rd->csum1 = 0; + rd->csum2 = 0; + + wmb(); + + rd->control = BMU_OWN | BMU_STF | BMU_IRQ_EOF | BMU_TCP_CHECK | bufsize; + pci_unmap_addr_set(e, mapaddr, map); + pci_unmap_len_set(e, maplen, bufsize); + return 0; +} + +/* Free all unused buffers in receive ring, assumes receiver stopped */ +static void skge_rx_clean(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + struct skge_ring *ring = &skge->rx_ring; + struct skge_element *e; + + for (e = ring->to_clean; e != ring->to_use; e = e->next) { + struct skge_rx_desc *rd = e->desc; + rd->control = 0; + + pci_unmap_single(hw->pdev, + pci_unmap_addr(e, mapaddr), + pci_unmap_len(e, maplen), + PCI_DMA_FROMDEVICE); + dev_kfree_skb(e->skb); + e->skb = NULL; + } + ring->to_clean = e; +} + +/* Allocate buffers for receive ring + * For receive: to_use is refill location + * to_clean is next received frame. + * + * if (to_use == to_clean) + * then ring all frames in ring need buffers + * if (to_use->next == to_clean) + * then ring all frames in ring have buffers + */ +static int skge_rx_fill(struct skge_port *skge) +{ + struct skge_ring *ring = &skge->rx_ring; + struct skge_element *e; + int ret = 0; + + for (e = ring->to_use; e->next != ring->to_clean; e = e->next) { + if (skge_rx_alloc(skge, e)) { + ret = 1; + break; + } + + } + ring->to_use = e; + + return ret; +} + +static void skge_link_report(struct skge_port *skge) +{ + if (!netif_msg_link(skge)) + return; + + if (netif_carrier_ok(skge->netdev)) { + printk(KERN_INFO PFX + "%s: Link is up at %d Mbps, %s duplex, flow control %s\n", + skge->netdev->name, skge->speed, + skge->duplex == DUPLEX_FULL ? "full" : "half", + (skge->flow_control == FLOW_MODE_NONE) ? "none" : + (skge->flow_control == FLOW_MODE_LOC_SEND) ? "tx only" : + (skge->flow_control == FLOW_MODE_REM_SEND) ? "rx only" : + (skge->flow_control == FLOW_MODE_SYMMETRIC) ? "tx and rx" : + "unknown"); + } else + printk(KERN_INFO PFX "%s: Link is down.\n", skge->netdev->name); +} + +static u16 skge_xm_phy_read(struct skge_hw *hw, int port, u16 reg) +{ + int i; + u16 v; + + skge_xm_write16(hw, port, XM_PHY_ADDR, reg | hw->phy_addr); + v = skge_xm_read16(hw, port, XM_PHY_DATA); + if (hw->phy_type != SK_PHY_XMAC) { + for (i = 0; i < PHY_RETRIES; i++) { + udelay(1); + if (skge_xm_read16(hw, port, XM_MMU_CMD) + & XM_MMU_PHY_RDY) + goto ready; + } + + printk(KERN_WARNING PFX "%s: phy read timed out\n", + hw->dev[port]->name); + return 0; + ready: + v = skge_xm_read16(hw, port, XM_PHY_DATA); + } + + return v; +} + +static void skge_xm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val) +{ + int i; + + skge_xm_write16(hw, port, XM_PHY_ADDR, reg | hw->phy_addr); + for (i = 0; i < PHY_RETRIES; i++) { + if (!(skge_xm_read16(hw, port, XM_MMU_CMD) & XM_MMU_PHY_BUSY)) + goto ready; + cpu_relax(); + } + printk(KERN_WARNING PFX "%s: phy write failed to come ready\n", + hw->dev[port]->name); + + + ready: + skge_xm_write16(hw, port, XM_PHY_DATA, val); + for (i = 0; i < PHY_RETRIES; i++) { + udelay(1); + if (!(skge_xm_read16(hw, port, XM_MMU_CMD) & XM_MMU_PHY_BUSY)) + return; + } + printk(KERN_WARNING PFX "%s: phy write timed out\n", + hw->dev[port]->name); +} + +static void genesis_init(struct skge_hw *hw) +{ + /* set blink source counter */ + skge_write32(hw, B2_BSC_INI, (SK_BLK_DUR * SK_FACT_53) / 100); + skge_write8(hw, B2_BSC_CTRL, BSC_START); + + /* configure mac arbiter */ + skge_write16(hw, B3_MA_TO_CTRL, MA_RST_CLR); + + /* configure mac arbiter timeout values */ + skge_write8(hw, B3_MA_TOINI_RX1, SK_MAC_TO_53); + skge_write8(hw, B3_MA_TOINI_RX2, SK_MAC_TO_53); + skge_write8(hw, B3_MA_TOINI_TX1, SK_MAC_TO_53); + skge_write8(hw, B3_MA_TOINI_TX2, SK_MAC_TO_53); + + skge_write8(hw, B3_MA_RCINI_RX1, 0); + skge_write8(hw, B3_MA_RCINI_RX2, 0); + skge_write8(hw, B3_MA_RCINI_TX1, 0); + skge_write8(hw, B3_MA_RCINI_TX2, 0); + + /* configure packet arbiter timeout */ + skge_write16(hw, B3_PA_CTRL, PA_RST_CLR); + skge_write16(hw, B3_PA_TOINI_RX1, SK_PKT_TO_MAX); + skge_write16(hw, B3_PA_TOINI_TX1, SK_PKT_TO_MAX); + skge_write16(hw, B3_PA_TOINI_RX2, SK_PKT_TO_MAX); + skge_write16(hw, B3_PA_TOINI_TX2, SK_PKT_TO_MAX); +} + +static void genesis_reset(struct skge_hw *hw, int port) +{ + int i; + u64 zero = 0; + + /* reset the statistics module */ + skge_xm_write32(hw, port, XM_GP_PORT, XM_GP_RES_STAT); + skge_xm_write16(hw, port, XM_IMSK, 0xffff); /* disable XMAC IRQs */ + skge_xm_write32(hw, port, XM_MODE, 0); /* clear Mode Reg */ + skge_xm_write16(hw, port, XM_TX_CMD, 0); /* reset TX CMD Reg */ + skge_xm_write16(hw, port, XM_RX_CMD, 0); /* reset RX CMD Reg */ + + /* disable all PHY IRQs */ + if (hw->phy_type == SK_PHY_BCOM) + skge_xm_write16(hw, port, PHY_BCOM_INT_MASK, 0xffff); + + skge_xm_outhash(hw, port, XM_HSM, (u8 *) &zero); + for (i = 0; i < 15; i++) + skge_xm_outaddr(hw, port, XM_EXM(i), (u8 *) &zero); + skge_xm_outhash(hw, port, XM_SRC_CHK, (u8 *) &zero); +} + + +static void genesis_mac_init(struct skge_hw *hw, int port) +{ + struct skge_port *skge = netdev_priv(hw->dev[port]); + int i; + u32 r; + u16 id1; + u16 ctrl1, ctrl2, ctrl3, ctrl4, ctrl5; + + /* magic workaround patterns for Broadcom */ + static const struct { + u16 reg; + u16 val; + } A1hack[] = { + { 0x18, 0x0c20 }, { 0x17, 0x0012 }, { 0x15, 0x1104 }, + { 0x17, 0x0013 }, { 0x15, 0x0404 }, { 0x17, 0x8006 }, + { 0x15, 0x0132 }, { 0x17, 0x8006 }, { 0x15, 0x0232 }, + { 0x17, 0x800D }, { 0x15, 0x000F }, { 0x18, 0x0420 }, + }, C0hack[] = { + { 0x18, 0x0c20 }, { 0x17, 0x0012 }, { 0x15, 0x1204 }, + { 0x17, 0x0013 }, { 0x15, 0x0A04 }, { 0x18, 0x0420 }, + }; + + + /* initialize Rx, Tx and Link LED */ + skge_write8(hw, SKGEMAC_REG(port, LNK_LED_REG), LINKLED_ON); + skge_write8(hw, SKGEMAC_REG(port, LNK_LED_REG), LINKLED_LINKSYNC_ON); + + skge_write8(hw, SKGEMAC_REG(port, RX_LED_CTRL), LED_START); + skge_write8(hw, SKGEMAC_REG(port, TX_LED_CTRL), LED_START); + + /* Unreset the XMAC. */ + skge_write16(hw, SKGEMAC_REG(port, TX_MFF_CTRL1), MFF_CLR_MAC_RST); + + /* + * Perform additional initialization for external PHYs, + * namely for the 1000baseTX cards that use the XMAC's + * GMII mode. + */ + spin_lock_bh(&hw->phy_lock); + if (hw->phy_type != SK_PHY_XMAC) { + /* Take PHY out of reset. */ + r = skge_read32(hw, B2_GP_IO); + if (port == 0) + r |= GP_DIR_0|GP_IO_0; + else + r |= GP_DIR_2|GP_IO_2; + + skge_write32(hw, B2_GP_IO, r); + skge_read32(hw, B2_GP_IO); + + /* Enable GMII mode on the XMAC. */ + skge_xm_write16(hw, port, XM_HW_CFG, XM_HW_GMII_MD); + + id1 = skge_xm_phy_read(hw, port, PHY_XMAC_ID1); + + /* Optimize MDIO transfer by suppressing preamble. */ + skge_xm_write16(hw, port, XM_MMU_CMD, + skge_xm_read16(hw, port, XM_MMU_CMD) + | XM_MMU_NO_PRE); + + if (id1 == PHY_BCOM_ID1_C0) { + /* + * Workaround BCOM Errata for the C0 type. + * Write magic patterns to reserved registers. + */ + for (i = 0; i < ARRAY_SIZE(C0hack); i++) + skge_xm_phy_write(hw, port, + C0hack[i].reg, C0hack[i].val); + + } else if (id1 == PHY_BCOM_ID1_A1) { + /* + * Workaround BCOM Errata for the A1 type. + * Write magic patterns to reserved registers. + */ + for (i = 0; i < ARRAY_SIZE(A1hack); i++) + skge_xm_phy_write(hw, port, + A1hack[i].reg, A1hack[i].val); + } + + /* + * Workaround BCOM Errata (#10523) for all BCom PHYs. + * Disable Power Management after reset. + */ + r = skge_xm_phy_read(hw, port, PHY_BCOM_AUX_CTRL); + skge_xm_phy_write(hw, port, PHY_BCOM_AUX_CTRL, r | PHY_B_AC_DIS_PM); + } + + /* Dummy read */ + skge_xm_read16(hw, port, XM_ISRC); + + r = skge_xm_read32(hw, port, XM_MODE); + skge_xm_write32(hw, port, XM_MODE, r|XM_MD_CSA); + + /* We don't need the FCS appended to the packet. */ + r = skge_xm_read16(hw, port, XM_RX_CMD); + skge_xm_write16(hw, port, XM_RX_CMD, r | XM_RX_STRIP_FCS); + + /* We want short frames padded to 60 bytes. */ + r = skge_xm_read16(hw, port, XM_TX_CMD); + skge_xm_write16(hw, port, XM_TX_CMD, r | XM_TX_AUTO_PAD); + + /* + * Enable the reception of all error frames. This is is + * a necessary evil due to the design of the XMAC. The + * XMAC's receive FIFO is only 8K in size, however jumbo + * frames can be up to 9000 bytes in length. When bad + * frame filtering is enabled, the XMAC's RX FIFO operates + * in 'store and forward' mode. For this to work, the + * entire frame has to fit into the FIFO, but that means + * that jumbo frames larger than 8192 bytes will be + * truncated. Disabling all bad frame filtering causes + * the RX FIFO to operate in streaming mode, in which + * case the XMAC will start transfering frames out of the + * RX FIFO as soon as the FIFO threshold is reached. + */ + r = skge_xm_read32(hw, port, XM_MODE); + skge_xm_write32(hw, port, XM_MODE, + XM_MD_RX_CRCE|XM_MD_RX_LONG|XM_MD_RX_RUNT| + XM_MD_RX_ERR|XM_MD_RX_IRLE); + + skge_xm_outaddr(hw, port, XM_SA, hw->dev[port]->dev_addr); + skge_xm_outaddr(hw, port, XM_EXM(0), hw->dev[port]->dev_addr); + + /* + * Bump up the transmit threshold. This helps hold off transmit + * underruns when we're blasting traffic from both ports at once. + */ + skge_xm_write16(hw, port, XM_TX_THR, 512); + + /* Configure MAC arbiter */ + skge_write16(hw, B3_MA_TO_CTRL, MA_RST_CLR); + + /* configure timeout values */ + skge_write8(hw, B3_MA_TOINI_RX1, 72); + skge_write8(hw, B3_MA_TOINI_RX2, 72); + skge_write8(hw, B3_MA_TOINI_TX1, 72); + skge_write8(hw, B3_MA_TOINI_TX2, 72); + + skge_write8(hw, B3_MA_RCINI_RX1, 0); + skge_write8(hw, B3_MA_RCINI_RX2, 0); + skge_write8(hw, B3_MA_RCINI_TX1, 0); + skge_write8(hw, B3_MA_RCINI_TX2, 0); + + /* Configure Rx MAC FIFO */ + skge_write8(hw, SKGEMAC_REG(port, RX_MFF_CTRL2), MFF_RST_CLR); + skge_write16(hw, SKGEMAC_REG(port, RX_MFF_CTRL1), MFF_ENA_TIM_PAT); + skge_write8(hw, SKGEMAC_REG(port, RX_MFF_CTRL2), MFF_ENA_OP_MD); + + /* Configure Tx MAC FIFO */ + skge_write8(hw, SKGEMAC_REG(port, TX_MFF_CTRL2), MFF_RST_CLR); + skge_write16(hw, SKGEMAC_REG(port, TX_MFF_CTRL1), MFF_TX_CTRL_DEF); + skge_write8(hw, SKGEMAC_REG(port, TX_MFF_CTRL2), MFF_ENA_OP_MD); + + if (hw->dev[port]->mtu > ETH_DATA_LEN) { + /* Enable frame flushing if jumbo frames used */ + skge_write16(hw, SKGEMAC_REG(port,RX_MFF_CTRL1), MFF_ENA_FLUSH); + } else { + /* enable timeout timers if normal frames */ + skge_write16(hw, B3_PA_CTRL, + port == 0 ? PA_ENA_TO_TX1 : PA_ENA_TO_TX2); + } + + + r = skge_xm_read16(hw, port, XM_RX_CMD); + if (hw->dev[port]->mtu > ETH_DATA_LEN) + skge_xm_write16(hw, port, XM_RX_CMD, r | XM_RX_BIG_PK_OK); + else + skge_xm_write16(hw, port, XM_RX_CMD, r & ~(XM_RX_BIG_PK_OK)); + + switch (hw->phy_type) { + case SK_PHY_XMAC: + if (skge->autoneg == AUTONEG_ENABLE) { + ctrl1 = PHY_X_AN_FD | PHY_X_AN_HD; + + switch (skge->flow_control) { + case FLOW_MODE_NONE: + ctrl1 |= PHY_X_P_NO_PAUSE; + break; + case FLOW_MODE_LOC_SEND: + ctrl1 |= PHY_X_P_ASYM_MD; + break; + case FLOW_MODE_SYMMETRIC: + ctrl1 |= PHY_X_P_SYM_MD; + break; + case FLOW_MODE_REM_SEND: + ctrl1 |= PHY_X_P_BOTH_MD; + break; + } + + skge_xm_phy_write(hw, port, PHY_XMAC_AUNE_ADV, ctrl1); + ctrl2 = PHY_CT_ANE | PHY_CT_RE_CFG; + } else { + ctrl2 = 0; + if (skge->duplex == DUPLEX_FULL) + ctrl2 |= PHY_CT_DUP_MD; + } + + skge_xm_phy_write(hw, port, PHY_XMAC_CTRL, ctrl2); + break; + + case SK_PHY_BCOM: + ctrl1 = PHY_CT_SP1000; + ctrl2 = 0; + ctrl3 = PHY_SEL_TYPE; + ctrl4 = PHY_B_PEC_EN_LTR; + ctrl5 = PHY_B_AC_TX_TST; + + if (skge->autoneg == AUTONEG_ENABLE) { + /* + * Workaround BCOM Errata #1 for the C5 type. + * 1000Base-T Link Acquisition Failure in Slave Mode + * Set Repeater/DTE bit 10 of the 1000Base-T Control Register + */ + ctrl2 |= PHY_B_1000C_RD; + ctrl2 |= PHY_B_1000C_AFD | PHY_B_1000C_AHD; + + /* Set Flow-control capabilities */ + switch (skge->flow_control) { + case FLOW_MODE_NONE: + ctrl3 |= PHY_B_P_NO_PAUSE; + break; + case FLOW_MODE_LOC_SEND: + ctrl3 |= PHY_B_P_ASYM_MD; + break; + case FLOW_MODE_SYMMETRIC: + ctrl3 |= PHY_B_P_SYM_MD; + break; + case FLOW_MODE_REM_SEND: + ctrl3 |= PHY_B_P_BOTH_MD; + break; + } + + /* Restart Auto-negotiation */ + ctrl1 |= PHY_CT_ANE | PHY_CT_RE_CFG; + } else { + if (skge->duplex == DUPLEX_FULL) + ctrl1 |= PHY_CT_DUP_MD; + + ctrl2 |= PHY_B_1000C_MSE; /* set it to Slave */ + } + + skge_xm_phy_write(hw, port, PHY_BCOM_1000T_CTRL, ctrl2); + skge_xm_phy_write(hw, port, PHY_BCOM_AUNE_ADV, ctrl3); + + if (skge->netdev->mtu > ETH_DATA_LEN) { + ctrl4 |= PHY_B_PEC_HIGH_LA; + ctrl5 |= PHY_B_AC_LONG_PACK; + + skge_xm_phy_write(hw, port,PHY_BCOM_AUX_CTRL, ctrl5); + } + + skge_xm_phy_write(hw, port, PHY_BCOM_P_EXT_CTRL, ctrl4); + skge_xm_phy_write(hw, port, PHY_BCOM_CTRL, ctrl1); + break; + } + spin_unlock_bh(&hw->phy_lock); + + /* Clear MIB counters */ + skge_xm_write16(hw, port, XM_STAT_CMD, + XM_SC_CLR_RXC | XM_SC_CLR_TXC); + /* Clear two times according to Errata #3 */ + skge_xm_write16(hw, port, XM_STAT_CMD, + XM_SC_CLR_RXC | XM_SC_CLR_TXC); + + /* Start polling for link status */ + mod_timer(&skge->link_check, jiffies + HZ/10); +} + +static void genesis_stop(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + + /* Clear Tx packet arbiter timeout IRQ */ + skge_write16(hw, B3_PA_CTRL, + port == 0 ? PA_CLR_TO_TX1 : PA_CLR_TO_TX2); + + /* + * If the transfer stucks at the MAC the STOP command will not + * terminate if we don't flush the XMAC's transmit FIFO ! + */ + skge_xm_write32(hw, port, XM_MODE, + skge_xm_read32(hw, port, XM_MODE)|XM_MD_FTF); + + + /* Reset the MAC */ + skge_write16(hw, SKGEMAC_REG(port, TX_MFF_CTRL1), MFF_SET_MAC_RST); + + /* For external PHYs there must be special handling */ + if (hw->phy_type != SK_PHY_XMAC) { + u32 reg = skge_read32(hw, B2_GP_IO); + + if (port == 0) { + reg |= GP_DIR_0; + reg &= ~GP_IO_0; + } else { + reg |= GP_DIR_2; + reg &= ~GP_IO_2; + } + skge_write32(hw, B2_GP_IO, reg); + skge_read32(hw, B2_GP_IO); + } + + skge_xm_write16(hw, port, XM_MMU_CMD, + skge_xm_read16(hw, port, XM_MMU_CMD) + & ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX)); + + skge_xm_read16(hw, port, XM_MMU_CMD); +} + + +static void genesis_get_stats(struct skge_port *skge, u64 *data) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + int i; + unsigned long timeout = jiffies + HZ; + + skge_xm_write16(hw, port, + XM_STAT_CMD, XM_SC_SNP_TXC | XM_SC_SNP_RXC); + + /* wait for update to complete */ + while (skge_xm_read16(hw, port, XM_STAT_CMD) + & (XM_SC_SNP_TXC | XM_SC_SNP_RXC)) { + if (time_after(jiffies, timeout)) + break; + udelay(10); + } + + /* special case for 64 bit octet counter */ + data[0] = (u64) skge_xm_read32(hw, port, XM_TXO_OK_HI) << 32 + | skge_xm_read32(hw, port, XM_TXO_OK_LO); + data[1] = (u64) skge_xm_read32(hw, port, XM_RXO_OK_HI) << 32 + | skge_xm_read32(hw, port, XM_RXO_OK_LO); + + for (i = 2; i < ARRAY_SIZE(skge_stats); i++) + data[i] = skge_xm_read32(hw, port, skge_stats[i].xmac_offset); +} + +static void genesis_mac_intr(struct skge_hw *hw, int port) +{ + struct skge_port *skge = netdev_priv(hw->dev[port]); + u16 status = skge_xm_read16(hw, port, XM_ISRC); + + pr_debug("genesis_intr status %x\n", status); + if (hw->phy_type == SK_PHY_XMAC) { + /* LInk down, start polling for state change */ + if (status & XM_IS_INP_ASS) { + skge_xm_write16(hw, port, XM_IMSK, + skge_xm_read16(hw, port, XM_IMSK) | XM_IS_INP_ASS); + mod_timer(&skge->link_check, jiffies + HZ/10); + } + else if (status & XM_IS_AND) + mod_timer(&skge->link_check, jiffies + HZ/10); + } + + if (status & XM_IS_TXF_UR) { + skge_xm_write32(hw, port, XM_MODE, XM_MD_FTF); + ++skge->net_stats.tx_fifo_errors; + } + if (status & XM_IS_RXF_OV) { + skge_xm_write32(hw, port, XM_MODE, XM_MD_FRF); + ++skge->net_stats.rx_fifo_errors; + } +} + +static void skge_gm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val) +{ + int i; + + skge_gma_write16(hw, port, GM_SMI_DATA, val); + skge_gma_write16(hw, port, GM_SMI_CTRL, + GM_SMI_CT_PHY_AD(hw->phy_addr) | GM_SMI_CT_REG_AD(reg)); + for (i = 0; i < PHY_RETRIES; i++) { + udelay(1); + + if (!(skge_gma_read16(hw, port, GM_SMI_CTRL) & GM_SMI_CT_BUSY)) + break; + } +} + +static u16 skge_gm_phy_read(struct skge_hw *hw, int port, u16 reg) +{ + int i; + + skge_gma_write16(hw, port, GM_SMI_CTRL, + GM_SMI_CT_PHY_AD(hw->phy_addr) + | GM_SMI_CT_REG_AD(reg) | GM_SMI_CT_OP_RD); + + for (i = 0; i < PHY_RETRIES; i++) { + udelay(1); + if (skge_gma_read16(hw, port, GM_SMI_CTRL) & GM_SMI_CT_RD_VAL) + goto ready; + } + + printk(KERN_WARNING PFX "%s: phy read timeout\n", + hw->dev[port]->name); + return 0; + ready: + return skge_gma_read16(hw, port, GM_SMI_DATA); +} + +static void genesis_link_down(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + + pr_debug("genesis_link_down\n"); + + netif_carrier_off(skge->netdev); + skge_xm_write16(hw, port, XM_MMU_CMD, + skge_xm_read16(hw, port, XM_MMU_CMD) + & ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX)); + + /* dummy read to ensure writing */ + (void) skge_xm_read16(hw, port, XM_MMU_CMD); + + skge_link_report(skge); +} + +static void genesis_link_up(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + u16 cmd; + u32 mode, msk; + + pr_debug("genesis_link_up\n"); + netif_wake_queue(skge->netdev); + netif_carrier_on(skge->netdev); + + cmd = skge_xm_read16(hw, port, XM_MMU_CMD); + + /* + * enabling pause frame reception is required for 1000BT + * because the XMAC is not reset if the link is going down + */ + if (skge->flow_control == FLOW_MODE_NONE || + skge->flow_control == FLOW_MODE_LOC_SEND) + cmd |= XM_MMU_IGN_PF; + else + /* Enable Pause Frame Reception */ + cmd &= ~XM_MMU_IGN_PF; + + skge_xm_write16(hw, port, XM_MMU_CMD, cmd); + + mode = skge_xm_read32(hw, port, XM_MODE); + if (skge->flow_control == FLOW_MODE_SYMMETRIC || + skge->flow_control == FLOW_MODE_LOC_SEND) { + /* + * Configure Pause Frame Generation + * Use internal and external Pause Frame Generation. + * Sending pause frames is edge triggered. + * Send a Pause frame with the maximum pause time if + * internal oder external FIFO full condition occurs. + * Send a zero pause time frame to re-start transmission. + */ + /* XM_PAUSE_DA = '010000C28001' (default) */ + /* XM_MAC_PTIME = 0xffff (maximum) */ + /* remember this value is defined in big endian (!) */ + skge_xm_write16(hw, port, XM_MAC_PTIME, 0xffff); + + mode |= XM_PAUSE_MODE; + skge_write16(hw, SKGEMAC_REG(port, RX_MFF_CTRL1), MFF_ENA_PAUSE); + } else { + /* + * disable pause frame generation is required for 1000BT + * because the XMAC is not reset if the link is going down + */ + /* Disable Pause Mode in Mode Register */ + mode &= ~XM_PAUSE_MODE; + + skge_write16(hw, SKGEMAC_REG(port, RX_MFF_CTRL1), MFF_DIS_PAUSE); + } + + skge_xm_write32(hw, port, XM_MODE, mode); + + msk = XM_DEF_MSK; + if (hw->phy_type != SK_PHY_XMAC) + msk |= XM_IS_INP_ASS; /* disable GP0 interrupt bit */ + + skge_xm_write16(hw, port, XM_IMSK, msk); + skge_xm_read16(hw, port, XM_ISRC); + + /* get MMU Command Reg. */ + cmd = skge_xm_read16(hw, port, XM_MMU_CMD); + if (hw->phy_type != SK_PHY_XMAC && skge->duplex == DUPLEX_FULL) + cmd |= XM_MMU_GMII_FD; + + if (hw->phy_type == SK_PHY_BCOM) { + /* + * Workaround BCOM Errata (#10523) for all BCom Phys + * Enable Power Management after link up + */ + skge_xm_phy_write(hw, port, PHY_BCOM_AUX_CTRL, + skge_xm_phy_read(hw, port, PHY_BCOM_AUX_CTRL) + & ~PHY_B_AC_DIS_PM); + skge_xm_phy_write(hw, port, PHY_BCOM_INT_MASK, + PHY_B_DEF_MSK); + } + + /* enable Rx/Tx */ + skge_xm_write16(hw, port, XM_MMU_CMD, + cmd | XM_MMU_ENA_RX | XM_MMU_ENA_TX); + skge_link_report(skge); +} + + +static void genesis_bcom_intr(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + u16 stat = skge_xm_phy_read(hw, port, PHY_BCOM_INT_STAT); + + pr_debug("genesis_bcom intr stat=%x\n", stat); + + /* Workaround BCom Errata: + * enable and disable loopback mode if "NO HCD" occurs. + */ + if (stat & PHY_B_IS_NO_HDCL) { + u16 ctrl = skge_xm_phy_read(hw, port, PHY_BCOM_CTRL); + skge_xm_phy_write(hw, port, PHY_BCOM_CTRL, + ctrl | PHY_CT_LOOP); + skge_xm_phy_write(hw, port, PHY_BCOM_CTRL, + ctrl & ~PHY_CT_LOOP); + } + + stat = skge_xm_phy_read(hw, port, PHY_BCOM_STAT); + if (stat & (PHY_B_IS_AN_PR | PHY_B_IS_LST_CHANGE)) { + u16 aux = skge_xm_phy_read(hw, port, PHY_BCOM_AUX_STAT); + if ( !(aux & PHY_B_AS_LS) && netif_carrier_ok(skge->netdev)) + genesis_link_down(skge); + + else if (stat & PHY_B_IS_LST_CHANGE) { + if (aux & PHY_B_AS_AN_C) { + switch (aux & PHY_B_AS_AN_RES_MSK) { + case PHY_B_RES_1000FD: + skge->duplex = DUPLEX_FULL; + break; + case PHY_B_RES_1000HD: + skge->duplex = DUPLEX_HALF; + break; + } + + switch (aux & PHY_B_AS_PAUSE_MSK) { + case PHY_B_AS_PAUSE_MSK: + skge->flow_control = FLOW_MODE_SYMMETRIC; + break; + case PHY_B_AS_PRR: + skge->flow_control = FLOW_MODE_REM_SEND; + break; + case PHY_B_AS_PRT: + skge->flow_control = FLOW_MODE_LOC_SEND; + break; + default: + skge->flow_control = FLOW_MODE_NONE; + } + skge->speed = SPEED_1000; + } + genesis_link_up(skge); + } + else + mod_timer(&skge->link_check, jiffies + HZ/10); + } +} + +/* Perodic poll of phy status to check for link transistion */ +static void skge_link_timer(unsigned long __arg) +{ + struct skge_port *skge = (struct skge_port *) __arg; + struct skge_hw *hw = skge->hw; + int port = skge->port; + + if (hw->chip_id != CHIP_ID_GENESIS || !netif_running(skge->netdev)) + return; + + spin_lock_bh(&hw->phy_lock); + if (hw->phy_type == SK_PHY_BCOM) + genesis_bcom_intr(skge); + else { + int i; + for (i = 0; i < 3; i++) + if (skge_xm_read16(hw, port, XM_ISRC) & XM_IS_INP_ASS) + break; + + if (i == 3) + mod_timer(&skge->link_check, jiffies + HZ/10); + else + genesis_link_up(skge); + } + spin_unlock_bh(&hw->phy_lock); +} + +/* Marvell Phy Initailization */ +static void yukon_init(struct skge_hw *hw, int port) +{ + struct skge_port *skge = netdev_priv(hw->dev[port]); + u16 ctrl, ct1000, adv; + u16 ledctrl, ledover; + + pr_debug("yukon_init\n"); + if (skge->autoneg == AUTONEG_ENABLE) { + u16 ectrl = skge_gm_phy_read(hw, port, PHY_MARV_EXT_CTRL); + + ectrl &= ~(PHY_M_EC_M_DSC_MSK | PHY_M_EC_S_DSC_MSK | + PHY_M_EC_MAC_S_MSK); + ectrl |= PHY_M_EC_MAC_S(MAC_TX_CLK_25_MHZ); + + /* on PHY 88E1111 there is a change for downshift control */ + if (hw->chip_id == CHIP_ID_YUKON_EC) + ectrl |= PHY_M_EC_M_DSC_2(0) | PHY_M_EC_DOWN_S_ENA; + else + ectrl |= PHY_M_EC_M_DSC(0) | PHY_M_EC_S_DSC(1); + + skge_gm_phy_write(hw, port, PHY_MARV_EXT_CTRL, ectrl); + } + + ctrl = skge_gm_phy_read(hw, port, PHY_MARV_CTRL); + if (skge->autoneg == AUTONEG_DISABLE) + ctrl &= ~PHY_CT_ANE; + + ctrl |= PHY_CT_RESET; + skge_gm_phy_write(hw, port, PHY_MARV_CTRL, ctrl); + + ctrl = 0; + ct1000 = 0; + adv = PHY_SEL_TYPE; + + if (skge->autoneg == AUTONEG_ENABLE) { + if (iscopper(hw)) { + ct1000 |= PHY_M_1000C_AHD | PHY_M_1000C_AFD; + adv |= PHY_M_AN_100_FD | PHY_M_AN_100_HD | + PHY_M_AN_10_FD | PHY_M_AN_10_HD; + + /* Set Flow-control capabilities */ + switch (skge->flow_control) { + case FLOW_MODE_NONE: + adv |= PHY_B_P_NO_PAUSE; + break; + case FLOW_MODE_LOC_SEND: + adv |= PHY_B_P_ASYM_MD; + break; + case FLOW_MODE_SYMMETRIC: + adv |= PHY_B_P_SYM_MD; + break; + case FLOW_MODE_REM_SEND: + adv |= PHY_B_P_BOTH_MD; + break; + } + } else { /* special defines for FIBER (88E1011S only) */ + adv |= PHY_M_AN_1000X_AHD | PHY_M_AN_1000X_AFD; + + /* Set Flow-control capabilities */ + switch (skge->flow_control) { + case FLOW_MODE_NONE: + adv |= PHY_M_P_NO_PAUSE_X; + break; + case FLOW_MODE_LOC_SEND: + adv |= PHY_M_P_ASYM_MD_X; + break; + case FLOW_MODE_SYMMETRIC: + adv |= PHY_M_P_SYM_MD_X; + break; + case FLOW_MODE_REM_SEND: + adv |= PHY_M_P_BOTH_MD_X; + break; + } + } + /* Restart Auto-negotiation */ + ctrl |= PHY_CT_ANE | PHY_CT_RE_CFG; + } else { + /* forced speed/duplex settings */ + ct1000 = PHY_M_1000C_MSE; + + if (skge->duplex == DUPLEX_FULL) + ctrl |= PHY_CT_DUP_MD; + + switch (skge->speed) { + case SPEED_1000: + ctrl |= PHY_CT_SP1000; + break; + case SPEED_100: + ctrl |= PHY_CT_SP100; + break; + } + + ctrl |= PHY_CT_RESET; + } + + if (hw->chip_id != CHIP_ID_YUKON_FE) + skge_gm_phy_write(hw, port, PHY_MARV_1000T_CTRL, ct1000); + + skge_gm_phy_write(hw, port, PHY_MARV_AUNE_ADV, adv); + skge_gm_phy_write(hw, port, PHY_MARV_CTRL, ctrl); + + /* Setup Phy LED's */ + ledctrl = PHY_M_LED_PULS_DUR(PULS_170MS); + ledover = 0; + + if (hw->chip_id == CHIP_ID_YUKON_FE) { + /* on 88E3082 these bits are at 11..9 (shifted left) */ + ledctrl |= PHY_M_LED_BLINK_RT(BLINK_84MS) << 1; + + skge_gm_phy_write(hw, port, PHY_MARV_FE_LED_PAR, + ((skge_gm_phy_read(hw, port, PHY_MARV_FE_LED_PAR) + + & ~PHY_M_FELP_LED1_MSK) + | PHY_M_FELP_LED1_CTRL(LED_PAR_CTRL_ACT_BL))); + } else { + /* set Tx LED (LED_TX) to blink mode on Rx OR Tx activity */ + ledctrl |= PHY_M_LED_BLINK_RT(BLINK_84MS) | PHY_M_LEDC_TX_CTRL; + + /* turn off the Rx LED (LED_RX) */ + ledover |= PHY_M_LED_MO_RX(MO_LED_OFF); + } + + /* disable blink mode (LED_DUPLEX) on collisions */ + ctrl |= PHY_M_LEDC_DP_CTRL; + skge_gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl); + + if (skge->autoneg == AUTONEG_DISABLE || skge->speed == SPEED_100) { + /* turn on 100 Mbps LED (LED_LINK100) */ + ledover |= PHY_M_LED_MO_100(MO_LED_ON); + } + + if (ledover) + skge_gm_phy_write(hw, port, PHY_MARV_LED_OVER, ledover); + + /* Enable phy interrupt on autonegotiation complete (or link up) */ + if (skge->autoneg == AUTONEG_ENABLE) + skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_IS_AN_COMPL); + else + skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_DEF_MSK); +} + +static void yukon_reset(struct skge_hw *hw, int port) +{ + skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, 0);/* disable PHY IRQs */ + skge_gma_write16(hw, port, GM_MC_ADDR_H1, 0); /* clear MC hash */ + skge_gma_write16(hw, port, GM_MC_ADDR_H2, 0); + skge_gma_write16(hw, port, GM_MC_ADDR_H3, 0); + skge_gma_write16(hw, port, GM_MC_ADDR_H4, 0); + + skge_gma_write16(hw, port, GM_RX_CTRL, + skge_gma_read16(hw, port, GM_RX_CTRL) + | GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA); +} + +static void yukon_mac_init(struct skge_hw *hw, int port) +{ + struct skge_port *skge = netdev_priv(hw->dev[port]); + int i; + u32 reg; + const u8 *addr = hw->dev[port]->dev_addr; + + /* WA code for COMA mode -- set PHY reset */ + if (hw->chip_id == CHIP_ID_YUKON_LITE && + chip_rev(hw) == CHIP_REV_YU_LITE_A3) + skge_write32(hw, B2_GP_IO, + (skge_read32(hw, B2_GP_IO) | GP_DIR_9 | GP_IO_9)); + + /* hard reset */ + skge_write32(hw, SKGEMAC_REG(port, GPHY_CTRL), GPC_RST_SET); + skge_write32(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_RST_SET); + + /* WA code for COMA mode -- clear PHY reset */ + if (hw->chip_id == CHIP_ID_YUKON_LITE && + chip_rev(hw) == CHIP_REV_YU_LITE_A3) + skge_write32(hw, B2_GP_IO, + (skge_read32(hw, B2_GP_IO) | GP_DIR_9) + & ~GP_IO_9); + + /* Set hardware config mode */ + reg = GPC_INT_POL_HI | GPC_DIS_FC | GPC_DIS_SLEEP | + GPC_ENA_XC | GPC_ANEG_ADV_ALL_M | GPC_ENA_PAUSE; + reg |= iscopper(hw) ? GPC_HWCFG_GMII_COP : GPC_HWCFG_GMII_FIB; + + /* Clear GMC reset */ + skge_write32(hw, SKGEMAC_REG(port, GPHY_CTRL), reg | GPC_RST_SET); + skge_write32(hw, SKGEMAC_REG(port, GPHY_CTRL), reg | GPC_RST_CLR); + skge_write32(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_PAUSE_ON | GMC_RST_CLR); + if (skge->autoneg == AUTONEG_DISABLE) { + reg = GM_GPCR_AU_ALL_DIS; + skge_gma_write16(hw, port, GM_GP_CTRL, + skge_gma_read16(hw, port, GM_GP_CTRL) | reg); + + switch (skge->speed) { + case SPEED_1000: + reg |= GM_GPCR_SPEED_1000; + /* fallthru */ + case SPEED_100: + reg |= GM_GPCR_SPEED_100; + } + + if (skge->duplex == DUPLEX_FULL) + reg |= GM_GPCR_DUP_FULL; + } else + reg = GM_GPCR_SPEED_1000 | GM_GPCR_SPEED_100 | GM_GPCR_DUP_FULL; + switch (skge->flow_control) { + case FLOW_MODE_NONE: + skge_write32(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_PAUSE_OFF); + reg |= GM_GPCR_FC_TX_DIS | GM_GPCR_FC_RX_DIS | GM_GPCR_AU_FCT_DIS; + break; + case FLOW_MODE_LOC_SEND: + /* disable Rx flow-control */ + reg |= GM_GPCR_FC_RX_DIS | GM_GPCR_AU_FCT_DIS; + } + + skge_gma_write16(hw, port, GM_GP_CTRL, reg); + skge_read16(hw, GMAC_IRQ_SRC); + + spin_lock_bh(&hw->phy_lock); + yukon_init(hw, port); + spin_unlock_bh(&hw->phy_lock); + + /* MIB clear */ + reg = skge_gma_read16(hw, port, GM_PHY_ADDR); + skge_gma_write16(hw, port, GM_PHY_ADDR, reg | GM_PAR_MIB_CLR); + + for (i = 0; i < GM_MIB_CNT_SIZE; i++) + skge_gma_read16(hw, port, GM_MIB_CNT_BASE + 8*i); + skge_gma_write16(hw, port, GM_PHY_ADDR, reg); + + /* transmit control */ + skge_gma_write16(hw, port, GM_TX_CTRL, TX_COL_THR(TX_COL_DEF)); + + /* receive control reg: unicast + multicast + no FCS */ + skge_gma_write16(hw, port, GM_RX_CTRL, + GM_RXCR_UCF_ENA | GM_RXCR_CRC_DIS | GM_RXCR_MCF_ENA); + + /* transmit flow control */ + skge_gma_write16(hw, port, GM_TX_FLOW_CTRL, 0xffff); + + /* transmit parameter */ + skge_gma_write16(hw, port, GM_TX_PARAM, + TX_JAM_LEN_VAL(TX_JAM_LEN_DEF) | + TX_JAM_IPG_VAL(TX_JAM_IPG_DEF) | + TX_IPG_JAM_DATA(TX_IPG_JAM_DEF)); + + /* serial mode register */ + reg = GM_SMOD_VLAN_ENA | IPG_DATA_VAL(IPG_DATA_DEF); + if (hw->dev[port]->mtu > 1500) + reg |= GM_SMOD_JUMBO_ENA; + + skge_gma_write16(hw, port, GM_SERIAL_MODE, reg); + + /* physical address: used for pause frames */ + skge_gm_set_addr(hw, port, GM_SRC_ADDR_1L, addr); + /* virtual address for data */ + skge_gm_set_addr(hw, port, GM_SRC_ADDR_2L, addr); + + /* enable interrupt mask for counter overflows */ + skge_gma_write16(hw, port, GM_TX_IRQ_MSK, 0); + skge_gma_write16(hw, port, GM_RX_IRQ_MSK, 0); + skge_gma_write16(hw, port, GM_TR_IRQ_MSK, 0); + + /* Initialize Mac Fifo */ + + /* Configure Rx MAC FIFO */ + skge_write16(hw, SKGEMAC_REG(port, RX_GMF_FL_MSK), RX_FF_FL_DEF_MSK); + reg = GMF_OPER_ON | GMF_RX_F_FL_ON; + if (hw->chip_id == CHIP_ID_YUKON_LITE && + chip_rev(hw) == CHIP_REV_YU_LITE_A3) + reg &= ~GMF_RX_F_FL_ON; + skge_write8(hw, SKGEMAC_REG(port, RX_GMF_CTRL_T), GMF_RST_CLR); + skge_write16(hw, SKGEMAC_REG(port, RX_GMF_CTRL_T), reg); + skge_write16(hw, SKGEMAC_REG(port, RX_GMF_FL_THR), RX_GMF_FL_THR_DEF); + + /* Configure Tx MAC FIFO */ + skge_write8(hw, SKGEMAC_REG(port, TX_GMF_CTRL_T), GMF_RST_CLR); + skge_write16(hw, SKGEMAC_REG(port, TX_GMF_CTRL_T), GMF_OPER_ON); +} + +static void yukon_stop(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + + if (hw->chip_id == CHIP_ID_YUKON_LITE && + chip_rev(hw) == CHIP_REV_YU_LITE_A3) { + skge_write32(hw, B2_GP_IO, + skge_read32(hw, B2_GP_IO) | GP_DIR_9 | GP_IO_9); + } + + skge_gma_write16(hw, port, GM_GP_CTRL, + skge_gma_read16(hw, port, GM_GP_CTRL) + & ~(GM_GPCR_RX_ENA|GM_GPCR_RX_ENA)); + skge_gma_read16(hw, port, GM_GP_CTRL); + + /* set GPHY Control reset */ + skge_gma_write32(hw, port, GPHY_CTRL, GPC_RST_SET); + skge_gma_write32(hw, port, GMAC_CTRL, GMC_RST_SET); +} + +static void yukon_get_stats(struct skge_port *skge, u64 *data) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + int i; + + data[0] = (u64) skge_gma_read32(hw, port, GM_TXO_OK_HI) << 32 + | skge_gma_read32(hw, port, GM_TXO_OK_LO); + data[1] = (u64) skge_gma_read32(hw, port, GM_RXO_OK_HI) << 32 + | skge_gma_read32(hw, port, GM_RXO_OK_LO); + + for (i = 2; i < ARRAY_SIZE(skge_stats); i++) + data[i] = skge_gma_read32(hw, port, + skge_stats[i].gma_offset); +} + +static void yukon_mac_intr(struct skge_hw *hw, int port) +{ + struct skge_port *skge = netdev_priv(hw->dev[port]); + u8 status = skge_read8(hw, SKGEMAC_REG(port, GMAC_IRQ_SRC)); + + pr_debug("yukon_intr status %x\n", status); + if (status & GM_IS_RX_FF_OR) { + ++skge->net_stats.rx_fifo_errors; + skge_gma_write8(hw, port, RX_GMF_CTRL_T, GMF_CLI_RX_FO); + } + if (status & GM_IS_TX_FF_UR) { + ++skge->net_stats.tx_fifo_errors; + skge_gma_write8(hw, port, TX_GMF_CTRL_T, GMF_CLI_TX_FU); + } + +} + +static u16 yukon_speed(const struct skge_hw *hw, u16 aux) +{ + if (hw->chip_id == CHIP_ID_YUKON_FE) + return (aux & PHY_M_PS_SPEED_100) ? SPEED_100 : SPEED_10; + + switch(aux & PHY_M_PS_SPEED_MSK) { + case PHY_M_PS_SPEED_1000: + return SPEED_1000; + case PHY_M_PS_SPEED_100: + return SPEED_100; + default: + return SPEED_10; + } +} + +static void yukon_link_up(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + u16 reg; + + pr_debug("yukon_link_up\n"); + netif_wake_queue(skge->netdev); + netif_carrier_on(skge->netdev); + + /* Enable Transmit FIFO Underrun */ + skge_write8(hw, GMAC_IRQ_MSK, GMAC_DEF_MSK); + + reg = skge_gma_read16(hw, port, GM_GP_CTRL); + if (skge->duplex == DUPLEX_FULL || skge->autoneg == AUTONEG_ENABLE) + reg |= GM_GPCR_DUP_FULL; + + /* enable Rx/Tx */ + reg |= GM_GPCR_RX_ENA | GM_GPCR_TX_ENA; + skge_gma_write16(hw, port, GM_GP_CTRL, reg); + + skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_DEF_MSK); + skge_link_report(skge); +} + +static void yukon_link_down(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + + netif_carrier_off(skge->netdev); + + pr_debug("yukon_link_down\n"); + skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, 0); + skge_gm_phy_write(hw, port, GM_GP_CTRL, + skge_gm_phy_read(hw, port, GM_GP_CTRL) + & ~(GM_GPCR_RX_ENA | GM_GPCR_TX_ENA)); + + if (hw->chip_id != CHIP_ID_YUKON_FE && + skge->flow_control == FLOW_MODE_REM_SEND) { + /* restore Asymmetric Pause bit */ + skge_gm_phy_write(hw, port, PHY_MARV_AUNE_ADV, + skge_gm_phy_read(hw, port, + PHY_MARV_AUNE_ADV) + | PHY_M_AN_ASP); + + } + + yukon_reset(hw, port); + skge_link_report(skge); + yukon_init(hw, port); +} + +static void yukon_phy_intr(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + const char *reason = NULL; + u16 istatus, phystat; + + istatus = skge_gm_phy_read(hw, port, PHY_MARV_INT_STAT); + phystat = skge_gm_phy_read(hw, port, PHY_MARV_PHY_STAT); + pr_debug("yukon phy intr istat=%x phy_stat=%x\n", istatus, phystat); + + if (istatus & PHY_M_IS_AN_COMPL) { + if (skge_gm_phy_read(hw, port, PHY_MARV_AUNE_LP) + & PHY_M_AN_RF) { + reason = "remote fault"; + goto failed; + } + + if (!(hw->chip_id == CHIP_ID_YUKON_FE || hw->chip_id == CHIP_ID_YUKON_EC) + && (skge_gm_phy_read(hw, port, PHY_MARV_1000T_STAT) + & PHY_B_1000S_MSF)) { + reason = "master/slave fault"; + goto failed; + } + + if (!(phystat & PHY_M_PS_SPDUP_RES)) { + reason = "speed/duplex"; + goto failed; + } + + skge->duplex = (phystat & PHY_M_PS_FULL_DUP) + ? DUPLEX_FULL : DUPLEX_HALF; + skge->speed = yukon_speed(hw, phystat); + + /* Tx & Rx Pause Enabled bits are at 9..8 */ + if (hw->chip_id == CHIP_ID_YUKON_XL) + phystat >>= 6; + + /* We are using IEEE 802.3z/D5.0 Table 37-4 */ + switch (phystat & PHY_M_PS_PAUSE_MSK) { + case PHY_M_PS_PAUSE_MSK: + skge->flow_control = FLOW_MODE_SYMMETRIC; + break; + case PHY_M_PS_RX_P_EN: + skge->flow_control = FLOW_MODE_REM_SEND; + break; + case PHY_M_PS_TX_P_EN: + skge->flow_control = FLOW_MODE_LOC_SEND; + break; + default: + skge->flow_control = FLOW_MODE_NONE; + } + + if (skge->flow_control == FLOW_MODE_NONE || + (skge->speed < SPEED_1000 && skge->duplex == DUPLEX_HALF)) + skge_write8(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_PAUSE_OFF); + else + skge_write8(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_PAUSE_ON); + yukon_link_up(skge); + return; + } + + if (istatus & PHY_M_IS_LSP_CHANGE) + skge->speed = yukon_speed(hw, phystat); + + if (istatus & PHY_M_IS_DUP_CHANGE) + skge->duplex = (phystat & PHY_M_PS_FULL_DUP) ? DUPLEX_FULL : DUPLEX_HALF; + if (istatus & PHY_M_IS_LST_CHANGE) { + if (phystat & PHY_M_PS_LINK_UP) + yukon_link_up(skge); + else + yukon_link_down(skge); + } + return; + failed: + printk(KERN_ERR PFX "%s: autonegotiation failed (%s)\n", + skge->netdev->name, reason); + + /* XXX restart autonegotiation? */ +} + +static void skge_ramset(struct skge_hw *hw, u16 q, u32 start, size_t len) +{ + u32 end; + + start /= 8; + len /= 8; + end = start + len - 1; + + skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_RST_CLR); + skge_write32(hw, RB_ADDR(q, RB_START), start); + skge_write32(hw, RB_ADDR(q, RB_WP), start); + skge_write32(hw, RB_ADDR(q, RB_RP), start); + skge_write32(hw, RB_ADDR(q, RB_END), end); + + if (q == Q_R1 || q == Q_R2) { + /* Set thresholds on receive queue's */ + skge_write32(hw, RB_ADDR(q, RB_RX_UTPP), + start + (2*len)/3); + skge_write32(hw, RB_ADDR(q, RB_RX_LTPP), + start + (len/3)); + } else { + /* Enable store & forward on Tx queue's because + * Tx FIFO is only 4K on Genesis and 1K on Yukon + */ + skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_ENA_STFWD); + } + + skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_ENA_OP_MD); +} + +/* Setup Bus Memory Interface */ +static void skge_qset(struct skge_port *skge, u16 q, + const struct skge_element *e) +{ + struct skge_hw *hw = skge->hw; + u32 watermark = 0x600; + u64 base = skge->dma + (e->desc - skge->mem); + + /* optimization to reduce window on 32bit/33mhz */ + if ((skge_read16(hw, B0_CTST) & (CS_BUS_CLOCK | CS_BUS_SLOT_SZ)) == 0) + watermark /= 2; + + skge_write32(hw, Q_ADDR(q, Q_CSR), CSR_CLR_RESET); + skge_write32(hw, Q_ADDR(q, Q_F), watermark); + skge_write32(hw, Q_ADDR(q, Q_DA_H), (u32)(base >> 32)); + skge_write32(hw, Q_ADDR(q, Q_DA_L), (u32)base); +} + +static int skge_up(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + int port = skge->port; + u32 chunk, ram_addr; + size_t rx_size, tx_size; + int err; + + if (netif_msg_ifup(skge)) + printk(KERN_INFO PFX "%s: enabling interface\n", dev->name); + + rx_size = skge->rx_ring.count * sizeof(struct skge_rx_desc); + tx_size = skge->tx_ring.count * sizeof(struct skge_tx_desc); + skge->mem_size = tx_size + rx_size; + skge->mem = pci_alloc_consistent(hw->pdev, skge->mem_size, &skge->dma); + if (!skge->mem) + return -ENOMEM; + + memset(skge->mem, 0, skge->mem_size); + + if ((err = skge_ring_alloc(&skge->rx_ring, skge->mem, skge->dma))) + goto free_pci_mem; + + if (skge_rx_fill(skge)) + goto free_rx_ring; + + if ((err = skge_ring_alloc(&skge->tx_ring, skge->mem + rx_size, + skge->dma + rx_size))) + goto free_rx_ring; + + skge->tx_avail = skge->tx_ring.count - 1; + + /* Initialze MAC */ + if (hw->chip_id == CHIP_ID_GENESIS) + genesis_mac_init(hw, port); + else + yukon_mac_init(hw, port); + + /* Configure RAMbuffers */ + chunk = hw->ram_size / (isdualport(hw) ? 4 : 2); + ram_addr = hw->ram_offset + 2 * chunk * port; + + skge_ramset(hw, rxq[port], ram_addr, chunk); + skge_qset(skge, rxq[port], skge->rx_ring.to_clean); + + BUG_ON(skge->tx_ring.to_use != skge->tx_ring.to_clean); + skge_ramset(hw, txq[port], ram_addr+chunk, chunk); + skge_qset(skge, txq[port], skge->tx_ring.to_use); + + /* Start receiver BMU */ + wmb(); + skge_write8(hw, Q_ADDR(rxq[port], Q_CSR), CSR_START | CSR_IRQ_CL_F); + + pr_debug("skge_up completed\n"); + return 0; + + free_rx_ring: + skge_rx_clean(skge); + kfree(skge->rx_ring.start); + free_pci_mem: + pci_free_consistent(hw->pdev, skge->mem_size, skge->mem, skge->dma); + + return err; +} + +static int skge_down(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + int port = skge->port; + + if (netif_msg_ifdown(skge)) + printk(KERN_INFO PFX "%s: disabling interface\n", dev->name); + + netif_stop_queue(dev); + + /* Stop transmitter */ + skge_write8(hw, Q_ADDR(txq[port], Q_CSR), CSR_STOP); + skge_write32(hw, RB_ADDR(txq[port], RB_CTRL), + RB_RST_SET|RB_DIS_OP_MD); + + if (hw->chip_id == CHIP_ID_GENESIS) + genesis_stop(skge); + else + yukon_stop(skge); + + /* Disable Force Sync bit and Enable Alloc bit */ + skge_write8(hw, SKGEMAC_REG(port, TXA_CTRL), + TXA_DIS_FSYNC | TXA_DIS_ALLOC | TXA_STOP_RC); + + /* Stop Interval Timer and Limit Counter of Tx Arbiter */ + skge_write32(hw, SKGEMAC_REG(port, TXA_ITI_INI), 0L); + skge_write32(hw, SKGEMAC_REG(port, TXA_LIM_INI), 0L); + + /* Reset PCI FIFO */ + skge_write32(hw, Q_ADDR(txq[port], Q_CSR), CSR_SET_RESET); + skge_write32(hw, RB_ADDR(txq[port], RB_CTRL), RB_RST_SET); + + /* Reset the RAM Buffer async Tx queue */ + skge_write8(hw, RB_ADDR(port == 0 ? Q_XA1 : Q_XA2, RB_CTRL), RB_RST_SET); + /* stop receiver */ + skge_write8(hw, Q_ADDR(rxq[port], Q_CSR), CSR_STOP); + skge_write32(hw, RB_ADDR(port ? Q_R2 : Q_R1, RB_CTRL), + RB_RST_SET|RB_DIS_OP_MD); + skge_write32(hw, Q_ADDR(rxq[port], Q_CSR), CSR_SET_RESET); + + if (hw->chip_id == CHIP_ID_GENESIS) { + skge_write8(hw, SKGEMAC_REG(port, TX_MFF_CTRL2), MFF_RST_SET); + skge_write8(hw, SKGEMAC_REG(port, RX_MFF_CTRL2), MFF_RST_SET); + skge_write8(hw, SKGEMAC_REG(port, TX_LED_CTRL), LED_STOP); + skge_write8(hw, SKGEMAC_REG(port, RX_LED_CTRL), LED_STOP); + } else { + skge_write8(hw, SKGEMAC_REG(port, RX_GMF_CTRL_T), GMF_RST_SET); + skge_write8(hw, SKGEMAC_REG(port, TX_GMF_CTRL_T), GMF_RST_SET); + } + + /* turn off led's */ + skge_write16(hw, B0_LED, LED_STAT_OFF); + + skge_tx_clean(skge); + skge_rx_clean(skge); + + kfree(skge->rx_ring.start); + kfree(skge->tx_ring.start); + pci_free_consistent(hw->pdev, skge->mem_size, skge->mem, skge->dma); + return 0; +} + +static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + struct skge_ring *ring = &skge->tx_ring; + struct skge_element *e; + struct skge_tx_desc *td; + int i; + u32 control, len; + u64 map; + unsigned long flags; + + if(unlikely(skb->len <= 0)) { + dev_kfree_skb_any(skb); + return NETDEV_TX_OK; + } + + len = skb_headlen(skb); + skb = skb_padto(skb, ETH_ZLEN); + if (!skb) + return NETDEV_TX_OK; + + local_irq_save(flags); + if (!spin_trylock(&skge->tx_lock)) { + /* Collision - tell upper layer to requeue */ + local_irq_restore(flags); + return NETDEV_TX_LOCKED; + } + + if (unlikely(skge->tx_avail < skb_shinfo(skb)->nr_frags +1)) { + netif_stop_queue(dev); + spin_unlock_irqrestore(&skge->tx_lock, flags); + + printk(KERN_WARNING PFX "%s: ring full when queue awake!\n", + dev->name); + return NETDEV_TX_BUSY; + } + + e = ring->to_use; + td = e->desc; + e->skb = skb; + map = pci_map_single(hw->pdev, skb->data, len, PCI_DMA_TODEVICE); + pci_unmap_addr_set(e, mapaddr, map); + pci_unmap_len_set(e, maplen, len); + + td->dma_lo = map; + td->dma_hi = map >> 32; + + if (skb->ip_summed == CHECKSUM_HW) { + const struct iphdr *ip + = (const struct iphdr *) skb->h.raw; + u32 offset = skb->h.raw - skb->data; + + /* + ** We have to use the opcode for tcp here, because the + ** opcode for udp is not working in the hardware yet + ** (Revision 2.0) + */ + if (ip->protocol == IPPROTO_UDP && + chip_rev(hw) == 0 && hw->chip_id == CHIP_ID_YUKON) + control = BMU_TCP_CHECK; + else + control = BMU_UDP_CHECK; + + td->csum_startval = 0; + td->csum_startpos = offset; + td->csum_writepos = offset + skb->csum; + } else + control = BMU_CHECK; + + if (!skb_shinfo(skb)->nr_frags) { + /* single buffer i.e. no fragments */ + control |= BMU_EOF| BMU_IRQ_EOF; + } else { + /* multiple fragments (note always hardware checksum) */ + struct skge_tx_desc *tf = td; + + control |= BMU_STFWD; + + for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { + skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; + + map = pci_map_page(hw->pdev, frag->page, frag->page_offset, + frag->size, PCI_DMA_TODEVICE); + + e = e->next; + e->skb = NULL; + tf = e->desc; + tf->dma_lo = map; + tf->dma_hi = (u64) map >> 32; + pci_unmap_addr_set(e, mapaddr, map); + pci_unmap_len_set(e, maplen, frag->size); + + tf->control = BMU_OWN | BMU_SW | BMU_STFWD | control | frag->size; + } + tf->control |= BMU_EOF | BMU_IRQ_EOF; + } + /* Make sure all the chained buffers are ready before + * updating start of chain. + */ + wmb(); + + td->control = BMU_OWN | BMU_SW | BMU_STF | control | len; + wmb(); + + skge_write8(skge->hw, Q_ADDR(txq[skge->port], Q_CSR), CSR_START); + + if (netif_msg_tx_queued(skge)) + printk(KERN_DEBUG "%s: tx queued, slot %d, len %d\n", + dev->name, e - ring->start, skb->len); + + ring->to_use = e->next; + skge->tx_avail -= skb_shinfo(skb)->nr_frags + 1; + if (skge->tx_avail <= MAX_SKB_FRAGS + 1) { + pr_debug("%s: transmit queue full\n", dev->name); + netif_stop_queue(dev); + } + + skge->net_stats.tx_packets++; + skge->net_stats.tx_bytes += skb->len; + + dev->trans_start = jiffies; + spin_unlock_irqrestore(&skge->tx_lock, flags); + + return NETDEV_TX_OK; +} + +static inline void skge_tx_free(struct skge_hw *hw, struct skge_element *e) +{ + if (e->skb) { + pci_unmap_single(hw->pdev, + pci_unmap_addr(e, mapaddr), + pci_unmap_len(e, maplen), + PCI_DMA_TODEVICE); + dev_kfree_skb_any(e->skb); + e->skb = NULL; + } else { + pci_unmap_page(hw->pdev, + pci_unmap_addr(e, mapaddr), + pci_unmap_len(e, maplen), + PCI_DMA_TODEVICE); + } +} + +static void skge_tx_clean(struct skge_port *skge) +{ + struct skge_ring *ring = &skge->tx_ring; + struct skge_element *e; + unsigned long flags; + + spin_lock_irqsave(&skge->tx_lock, flags); + for (e = ring->to_clean; e != ring->to_use; e = e->next) { + ++skge->tx_avail; + skge_tx_free(skge->hw, e); + } + ring->to_clean = e; + spin_unlock_irqrestore(&skge->tx_lock, flags); +} + +static void skge_tx_timeout(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + + if (netif_msg_timer(skge)) + printk(KERN_DEBUG PFX "%s: tx timeout\n", dev->name); + + skge_write8(skge->hw, Q_ADDR(txq[skge->port], Q_CSR), CSR_STOP); + skge_tx_clean(skge); +} + +static int skge_change_mtu(struct net_device *dev, int new_mtu) +{ + int err = 0; + + if(new_mtu < ETH_ZLEN || new_mtu > ETH_JUMBO_MTU) + return -EINVAL; + + dev->mtu = new_mtu; + + if (netif_running(dev)) { + skge_down(dev); + skge_up(dev); + } + + return err; +} + +static void genesis_set_multicast(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + int port = skge->port; + int i, count = dev->mc_count; + struct dev_mc_list *list = dev->mc_list; + u32 mode; + u8 filter[8]; + + mode = skge_xm_read32(hw, port, XM_MODE); + mode |= XM_MD_ENA_HASH; + if (dev->flags & IFF_PROMISC) + mode |= XM_MD_ENA_PROM; + else + mode &= ~XM_MD_ENA_PROM; + + if (dev->flags & IFF_ALLMULTI) + memset(filter, 0xff, sizeof(filter)); + else { + memset(filter, 0, sizeof(filter)); + for(i = 0; list && i < count; i++, list = list->next) { + u32 crc = crc32_le(~0, list->dmi_addr, ETH_ALEN); + u8 bit = 63 - (crc & 63); + + filter[bit/8] |= 1 << (bit%8); + } + } + + skge_xm_outhash(hw, port, XM_HSM, filter); + + skge_xm_write32(hw, port, XM_MODE, mode); +} + +static void yukon_set_multicast(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + int port = skge->port; + struct dev_mc_list *list = dev->mc_list; + u16 reg; + u8 filter[8]; + + memset(filter, 0, sizeof(filter)); + + reg = skge_gma_read16(hw, port, GM_RX_CTRL); + reg |= GM_RXCR_UCF_ENA; + + if (dev->flags & IFF_PROMISC) /* promiscious */ + reg &= ~(GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA); + else if (dev->flags & IFF_ALLMULTI) /* all multicast */ + memset(filter, 0xff, sizeof(filter)); + else if (dev->mc_count == 0) /* no multicast */ + reg &= ~GM_RXCR_MCF_ENA; + else { + int i; + reg |= GM_RXCR_MCF_ENA; + + for(i = 0; list && i < dev->mc_count; i++, list = list->next) { + u32 bit = ether_crc(ETH_ALEN, list->dmi_addr) & 0x3f; + filter[bit/8] |= 1 << (bit%8); + } + } + + + skge_gma_write16(hw, port, GM_MC_ADDR_H1, + (u16)filter[0] | ((u16)filter[1] << 8)); + skge_gma_write16(hw, port, GM_MC_ADDR_H2, + (u16)filter[2] | ((u16)filter[3] << 8)); + skge_gma_write16(hw, port, GM_MC_ADDR_H3, + (u16)filter[4] | ((u16)filter[5] << 8)); + skge_gma_write16(hw, port, GM_MC_ADDR_H4, + (u16)filter[6] | ((u16)filter[7] << 8)); + + skge_gma_write16(hw, port, GM_RX_CTRL, reg); +} + +static inline int bad_phy_status(const struct skge_hw *hw, u32 status) +{ + if (hw->chip_id == CHIP_ID_GENESIS) + return (status & (XMR_FS_ERR | XMR_FS_2L_VLAN)) != 0; + else + return (status & GMR_FS_ANY_ERR) || + (status & GMR_FS_RX_OK) == 0; +} + +static void skge_rx_error(struct skge_port *skge, int slot, + u32 control, u32 status) +{ + if (netif_msg_rx_err(skge)) + printk(KERN_DEBUG PFX "%s: rx err, slot %d control 0x%x status 0x%x\n", + skge->netdev->name, slot, control, status); + + if ((control & (BMU_EOF|BMU_STF)) != (BMU_STF|BMU_EOF) + || (control & BMU_BBC) > skge->netdev->mtu + VLAN_ETH_HLEN) + skge->net_stats.rx_length_errors++; + else { + if (skge->hw->chip_id == CHIP_ID_GENESIS) { + if (status & (XMR_FS_RUNT|XMR_FS_LNG_ERR)) + skge->net_stats.rx_length_errors++; + if (status & XMR_FS_FRA_ERR) + skge->net_stats.rx_frame_errors++; + if (status & XMR_FS_FCS_ERR) + skge->net_stats.rx_crc_errors++; + } else { + if (status & (GMR_FS_LONG_ERR|GMR_FS_UN_SIZE)) + skge->net_stats.rx_length_errors++; + if (status & GMR_FS_FRAGMENT) + skge->net_stats.rx_frame_errors++; + if (status & GMR_FS_CRC_ERR) + skge->net_stats.rx_crc_errors++; + } + } +} + +static int skge_poll(struct net_device *dev, int *budget) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + struct skge_ring *ring = &skge->rx_ring; + struct skge_element *e; + unsigned int to_do = min(dev->quota, *budget); + unsigned int work_done = 0; + int done; + static const u32 irqmask[] = { IS_PORT_1, IS_PORT_2 }; + + for (e = ring->to_clean; e != ring->to_use && work_done < to_do; + e = e->next) { + struct skge_rx_desc *rd = e->desc; + struct sk_buff *skb = e->skb; + u32 control, len, status; + + rmb(); + control = rd->control; + if (control & BMU_OWN) + break; + + len = control & BMU_BBC; + e->skb = NULL; + + pci_unmap_single(hw->pdev, + pci_unmap_addr(e, mapaddr), + pci_unmap_len(e, maplen), + PCI_DMA_FROMDEVICE); + + status = rd->status; + if ((control & (BMU_EOF|BMU_STF)) != (BMU_STF|BMU_EOF) + || len > dev->mtu + VLAN_ETH_HLEN + || bad_phy_status(hw, status)) { + skge_rx_error(skge, e - ring->start, control, status); + dev_kfree_skb(skb); + continue; + } + + if (netif_msg_rx_status(skge)) + printk(KERN_DEBUG PFX "%s: rx slot %d status 0x%x len %d\n", + dev->name, e - ring->start, rd->status, len); + + skb_put(skb, len); + skb->protocol = eth_type_trans(skb, dev); + + if (skge->rx_csum) { + skb->csum = le16_to_cpu(rd->csum2); + skb->ip_summed = CHECKSUM_HW; + } + + dev->last_rx = jiffies; + skge->net_stats.rx_packets++; + skge->net_stats.rx_bytes += skb->len; + netif_receive_skb(skb); + + ++work_done; + } + ring->to_clean = e; + + *budget -= work_done; + dev->quota -= work_done; + done = work_done < to_do; + + if (skge_rx_fill(skge)) + done = 0; + + /* restart receiver */ + wmb(); + skge_write8(hw, Q_ADDR(rxq[skge->port], Q_CSR), + CSR_START | CSR_IRQ_CL_F); + + if (done) { + local_irq_disable(); + hw->intr_mask |= irqmask[skge->port]; + /* Order is important since data can get interrupted */ + skge_write32(hw, B0_IMSK, hw->intr_mask); + __netif_rx_complete(dev); + local_irq_enable(); + } + + return !done; +} + +static inline void skge_tx_intr(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + struct skge_ring *ring = &skge->tx_ring; + struct skge_element *e; + + spin_lock(&skge->tx_lock); + for(e = ring->to_clean; e != ring->to_use; e = e->next) { + struct skge_tx_desc *td = e->desc; + u32 control; + + rmb(); + control = td->control; + if (control & BMU_OWN) + break; + + if (unlikely(netif_msg_tx_done(skge))) + printk(KERN_DEBUG PFX "%s: tx done slot %d status 0x%x\n", + dev->name, e - ring->start, td->status); + + skge_tx_free(hw, e); + e->skb = NULL; + ++skge->tx_avail; + } + ring->to_clean = e; + skge_write8(hw, Q_ADDR(txq[skge->port], Q_CSR), CSR_IRQ_CL_F); + + if (skge->tx_avail > MAX_SKB_FRAGS + 1) + netif_wake_queue(dev); + + spin_unlock(&skge->tx_lock); +} + +static void skge_mac_parity(struct skge_hw *hw, int port) +{ + if (hw->chip_id == CHIP_ID_GENESIS) + skge_write16(hw, SKGEMAC_REG(port, TX_MFF_CTRL1), + MFF_CLR_PERR); + else + /* HW-Bug #8: cleared by GMF_CLI_TX_FC instead of GMF_CLI_TX_PE */ + skge_write8(hw, SKGEMAC_REG(port, TX_GMF_CTRL_T), + (hw->chip_id == CHIP_ID_YUKON && chip_rev(hw) == 0) + ? GMF_CLI_TX_FC : GMF_CLI_TX_PE); +} + +static void skge_pci_clear(struct skge_hw *hw) +{ + u16 status; + + status = skge_read16(hw, SKGEPCI_REG(PCI_STATUS)); + skge_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); + skge_write16(hw, SKGEPCI_REG(PCI_STATUS), + status | PCI_STATUS_ERROR_BITS); + skge_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF); +} + +/* Handle device specific framing and timeout interrupts */ +static void skge_error_irq(struct skge_hw *hw) +{ + u32 hwstatus = skge_read32(hw, B0_HWE_ISRC); + + printk(KERN_ERR PFX "hardware error detected (status 0x%x)\n", + hwstatus); + + skge_pci_clear(hw); + + if (hw->chip_id == CHIP_ID_GENESIS) { + /* clear xmac errors */ + if (hwstatus & (IS_NO_STAT_M1|IS_NO_TIST_M1)) + + skge_write16(hw, SKGEMAC_REG(0, RX_MFF_CTRL1), MFF_CLR_INSTAT); + if (hwstatus & (IS_NO_STAT_M2|IS_NO_TIST_M2)) + skge_write16(hw, SKGEMAC_REG(0, RX_MFF_CTRL2), MFF_CLR_INSTAT); + } else { + if (hwstatus & IS_IRQ_SENSOR) { + /* no sensors on 32-bit Yukon */ + if ((skge_read16(hw, B0_CTST) & CS_BUS_SLOT_SZ) == 32) + hw->intr_mask &= ~IS_HW_ERR; + } + + } + + if (hwstatus & IS_RAM_RD_PAR) + skge_write16(hw, B3_RI_CTRL, RI_CLR_RD_PERR); + + if (hwstatus & IS_RAM_WR_PAR) + skge_write16(hw, B3_RI_CTRL, RI_CLR_WR_PERR); + + if (hwstatus & IS_M1_PAR_ERR) + skge_mac_parity(hw, 0); + + if (hwstatus & IS_M2_PAR_ERR) + skge_mac_parity(hw, 1); + + if (hwstatus & IS_R1_PAR_ERR) + skge_write32(hw, B0_R1_CSR, CSR_IRQ_CL_P); + + if (hwstatus & IS_R2_PAR_ERR) + skge_write32(hw, B0_R2_CSR, CSR_IRQ_CL_P); +} + +/* + * Interrrupt from PHY are handled in tasklet (soft irq) + * because accessing phy registers requires spin wait which might + * cause excess interrupt latency. + */ +static void skge_extirq(unsigned long data) +{ + struct skge_hw *hw = (struct skge_hw *) data; + int port; + + spin_lock(&hw->phy_lock); + for (port = 0; port < 2; port++) { + struct net_device *dev = hw->dev[port]; + + if (dev && netif_running(dev)) { + struct skge_port *skge = netdev_priv(dev); + + if (hw->chip_id != CHIP_ID_GENESIS) + yukon_phy_intr(skge); + else if (hw->phy_type == SK_PHY_BCOM) + genesis_bcom_intr(skge); + } + } + spin_unlock(&hw->phy_lock); + + local_irq_disable(); + hw->intr_mask |= IS_EXT_REG; + skge_write32(hw, B0_IMSK, hw->intr_mask); + local_irq_enable(); +} + +static irqreturn_t skge_intr(int irq, void *dev_id, struct pt_regs *regs) +{ + struct skge_hw *hw = dev_id; + u32 status = skge_read32(hw, B0_SP_ISRC); + + if (status == 0 || status == ~0) /* hotplug or shared irq */ + return IRQ_NONE; + + status &= hw->intr_mask; + + if (status & IS_R1_F) { + hw->intr_mask &= ~IS_R1_F; + netif_rx_schedule(hw->dev[0]); + } + + if (status & IS_R2_F) { + hw->intr_mask &= ~IS_R2_F; + netif_rx_schedule(hw->dev[1]); + } + + if (status & IS_XA1_F) + skge_tx_intr(hw->dev[0]); + + if (status & IS_XA2_F) + skge_tx_intr(hw->dev[1]); + + if (hw->chip_id == CHIP_ID_GENESIS) { + if (status & IS_MAC1) + genesis_mac_intr(hw, 0); + + if (status & IS_MAC2) + genesis_mac_intr(hw, 1); + } else { + if (status & IS_MAC1) + yukon_mac_intr(hw, 0); + + if (status & IS_MAC2) + yukon_mac_intr(hw, 1); + } + + if (status & IS_HW_ERR) + skge_error_irq(hw); + + if (status & IS_EXT_REG) { + hw->intr_mask &= ~IS_EXT_REG; + tasklet_schedule(&hw->ext_tasklet); + } + skge_write32(hw, B0_IMSK, hw->intr_mask); + + return IRQ_HANDLED; +} + +#ifdef CONFIG_NET_POLL_CONTROLLER +static void skge_netpoll(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + + disable_irq(dev->irq); + skge_intr(dev->irq, skge->hw, NULL); + enable_irq(dev->irq); +} +#endif + +/* TODO: use MIB counters instead?? */ +static struct net_device_stats *skge_get_stats(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + + return &skge->net_stats; +} + + +static int skge_set_mac_address(struct net_device *dev, void *p) +{ + struct skge_port *skge = netdev_priv(dev); + struct sockaddr *addr = p; + int err = 0; + + if (!is_valid_ether_addr(addr->sa_data)) + return -EADDRNOTAVAIL; + + skge_down(dev); + memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); + memcpy_toio(skge->hw->regs + B2_MAC_1 + skge->port*8, + dev->dev_addr, ETH_ALEN); + memcpy_toio(skge->hw->regs + B2_MAC_2 + skge->port*8, + dev->dev_addr, ETH_ALEN); + if (dev->flags & IFF_UP) + err = skge_up(dev); + return err; +} + +/* + * Setup the board data structure, but don't bring up + * the port(s) + */ +static __devinit struct skge_hw *skge_hwinit(struct pci_dev *pdev) +{ + struct skge_hw *hw; + u32 sz; + u16 ctst; + u8 t8; + int i, ports; + char *name = pci_name(pdev); + + hw = kmalloc(sizeof(*hw), GFP_KERNEL); + if (!hw) { + printk(KERN_ERR "skge %s: cannot allocate hardware struct\n", name); + goto err_out1; + } + + memset(hw, 0, sizeof(*hw)); + hw->pdev = pdev; + spin_lock_init(&hw->phy_lock); + tasklet_init(&hw->ext_tasklet, skge_extirq, (unsigned long) hw); + + hw->regs = ioremap_nocache(pci_resource_start(pdev, 0), 0x4000); + if (!hw->regs) { + printk(KERN_ERR "skge %s: cannot map device registers\n", name); + goto err_out2; + } + + ctst = skge_read16(hw, B0_CTST); + + /* do a SW reset */ + skge_write8(hw, B0_CTST, CS_RST_SET); + skge_write8(hw, B0_CTST, CS_RST_CLR); + + /* clear PCI errors, if any */ + skge_pci_clear(hw); + + skge_write8(hw, B0_CTST, CS_MRST_CLR); + + /* restore CLK_RUN bits (for Yukon-Lite) */ + skge_write16(hw, B0_CTST, + ctst & (CS_CLK_RUN_HOT|CS_CLK_RUN_RST|CS_CLK_RUN_ENA)); + + hw->chip_id = skge_read8(hw, B2_CHIP_ID); + hw->phy_type = skge_read8(hw, B2_E_1) & 0xf; + hw->pmd_type = skge_read8(hw, B2_PMD_TYP); + + switch(hw->chip_id) { + case CHIP_ID_GENESIS: + switch (hw->phy_type) { + case SK_PHY_XMAC: + hw->phy_addr = PHY_ADDR_XMAC; + break; + case SK_PHY_BCOM: + hw->phy_addr = PHY_ADDR_BCOM; + break; + default: + printk(KERN_ERR PFX "%s: unsupported phy type 0x%x\n", + name, hw->phy_type); + goto err_out3; + } + break; + + case CHIP_ID_YUKON: + case CHIP_ID_YUKON_LITE: + case CHIP_ID_YUKON_LP: + if (hw->phy_type < SK_PHY_MARV_COPPER && hw->pmd_type != 'S') + hw->phy_type = SK_PHY_MARV_COPPER; + + hw->phy_addr = PHY_ADDR_MARV; + if (!iscopper(hw)) + hw->phy_type = SK_PHY_MARV_FIBER; + + break; + + default: + printk(KERN_ERR PFX "%s: unsupported chip type 0x%x\n", + name, hw->chip_id); + goto err_out3; + } + + hw->mac_cfg = skge_read8(hw, B2_MAC_CFG); + ports = isdualport(hw) ? 2 : 1; + + /* read the adapters RAM size */ + t8 = skge_read8(hw, B2_E_0); + if (hw->chip_id == CHIP_ID_GENESIS) { + if (t8 == 3) { + /* special case: 4 x 64k x 36, offset = 0x80000 */ + hw->ram_size = 0x100000; + hw->ram_offset = 0x80000; + } else + hw->ram_size = t8 * 512; + } + else if (t8 == 0) + hw->ram_size = 0x20000; + else + hw->ram_size = t8 * 4096; + + pci_read_config_dword(hw->pdev, PCI_DEV_REG2, &sz); + hw->rom_size = 256 << ((sz & PCI_VPD_ROM_SZ) >> 14); + + if (hw->chip_id == CHIP_ID_GENESIS) + genesis_init(hw); +#if USE_TIST + else + skge_write8(hw, GMAC_TI_ST_CTRL, GMT_ST_START); +#endif + + /* + * looks like it ignores stuck sensor interrupts + */ + if (hw->chip_id != CHIP_ID_GENESIS) { + /* switch power to VCC (WA for VAUX problem) */ + skge_write8(hw, B0_POWER_CTRL, + PC_VAUX_ENA | PC_VCC_ENA | PC_VAUX_OFF | PC_VCC_ON); + if ((skge_read32(hw, B0_ISRC) & IS_HW_ERR) && + (skge_read32(hw, B0_HWE_ISRC & IS_IRQ_SENSOR))) + hw->intr_mask &= ~IS_HW_ERR; + + for (i = 0; i < ports; i++) { + skge_write16(hw, SKGEMAC_REG(i, GMAC_LINK_CTRL), GMLC_RST_SET); + skge_write16(hw, SKGEMAC_REG(i, GMAC_LINK_CTRL), GMLC_RST_CLR); + } + } + + /* turn off hardware timer (unused) */ + skge_write8(hw, B2_TI_CTRL, TIM_STOP); + skge_write8(hw, B2_TI_CTRL, TIM_CLR_IRQ); + skge_write8(hw, B0_LED, LED_STAT_ON); + + /* enable the Tx Arbiters */ + for (i = 0; i < ports; i++) + skge_write8(hw, SKGEMAC_REG(i, TXA_CTRL), TXA_ENA_ARB); + + /* Initialize ram interface */ + skge_write16(hw, B3_RI_CTRL, RI_RST_CLR); + + skge_write8(hw, B3_RI_WTO_R1, SK_RI_TO_53); + skge_write8(hw, B3_RI_WTO_XA1, SK_RI_TO_53); + skge_write8(hw, B3_RI_WTO_XS1, SK_RI_TO_53); + skge_write8(hw, B3_RI_RTO_R1, SK_RI_TO_53); + skge_write8(hw, B3_RI_RTO_XA1, SK_RI_TO_53); + skge_write8(hw, B3_RI_RTO_XS1, SK_RI_TO_53); + skge_write8(hw, B3_RI_WTO_R2, SK_RI_TO_53); + skge_write8(hw, B3_RI_WTO_XA2, SK_RI_TO_53); + skge_write8(hw, B3_RI_WTO_XS2, SK_RI_TO_53); + skge_write8(hw, B3_RI_RTO_R2, SK_RI_TO_53); + skge_write8(hw, B3_RI_RTO_XA2, SK_RI_TO_53); + skge_write8(hw, B3_RI_RTO_XS2, SK_RI_TO_53); + + skge_write32(hw, B0_HWE_IMSK, IS_ERR_MSK); + + hw->intr_mask = IS_HW_ERR | IS_EXT_REG | IS_PORT_1; + if (isdualport(hw)) + hw->intr_mask |= IS_PORT_2; + skge_write32(hw, B0_IMSK, hw->intr_mask); + + if (hw->chip_id != CHIP_ID_GENESIS) + skge_write8(hw, GMAC_IRQ_MSK, 0); + + spin_lock_bh(&hw->phy_lock); + for (i = 0; i < ports; i++) { + if (hw->chip_id == CHIP_ID_GENESIS) + genesis_reset(hw, i); + else + yukon_reset(hw, i); + } + spin_unlock_bh(&hw->phy_lock); + + return hw; + + err_out3: + iounmap(hw->regs); + err_out2: + kfree(hw); + err_out1: + return NULL; +} + +/* Release board resources */ +static void skge_hwfree(struct skge_hw *hw) +{ + skge_write16(hw, B0_LED, LED_STAT_OFF); + iounmap(hw->regs); + kfree(hw); +} + +/* Initialize network device */ +static struct net_device *skge_devinit(struct skge_hw *hw, int port) +{ + struct skge_port *skge; + struct net_device *dev = alloc_etherdev(sizeof(*skge)); + int i; + + if (!dev) { + printk(KERN_ERR "skge etherdev alloc failed"); + return NULL; + } + + SET_MODULE_OWNER(dev); + SET_NETDEV_DEV(dev, &hw->pdev->dev); + dev->open = skge_up; + dev->stop = skge_down; + dev->hard_start_xmit = skge_xmit_frame; + dev->get_stats = skge_get_stats; + if (hw->chip_id == CHIP_ID_GENESIS) + dev->set_multicast_list = genesis_set_multicast; + else + dev->set_multicast_list = yukon_set_multicast; + + dev->set_mac_address = skge_set_mac_address; + dev->change_mtu = skge_change_mtu; + SET_ETHTOOL_OPS(dev, &skge_ethtool_ops); + dev->tx_timeout = skge_tx_timeout; + dev->watchdog_timeo = TX_WATCHDOG; + dev->poll = skge_poll; + dev->weight = NAPI_WEIGHT; +#ifdef CONFIG_NET_POLL_CONTROLLER + dev->poll_controller = skge_netpoll; +#endif + dev->irq = hw->pdev->irq; + + dev->features |= NETIF_F_LLTX; + if (hw->chip_id != CHIP_ID_GENESIS) + dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; + + skge = netdev_priv(dev); + skge->netdev = dev; + skge->hw = hw; + skge->msg_enable = netif_msg_init(debug, default_msg); + skge->rx_csum = 1; + skge->tx_ring.count = DEFAULT_TX_RING_SIZE; + skge->rx_ring.count = DEFAULT_RX_RING_SIZE; + + /* Auto speed and flow control */ + skge->autoneg = AUTONEG_ENABLE; + skge->flow_control = FLOW_MODE_SYMMETRIC; + hw->dev[port] = dev; + + skge->port = port; + + spin_lock_init(&skge->tx_lock); + + init_timer(&skge->link_check); + skge->link_check.function = skge_link_timer; + skge->link_check.data = (unsigned long) skge; + + init_timer(&skge->led_blink); + skge->led_blink.function = skge_blink_timer; + skge->led_blink.data = (unsigned long) skge; + + /* read the mac address */ + for (i = 0; i < ETH_ALEN; i++) + dev->dev_addr[i] = skge_read8(hw, B2_MAC_1 + port*8 + i); + + /* device is off until link detection */ + netif_carrier_off(dev); + netif_stop_queue(dev); + + return dev; +} + +static const char *skge_board_name(const struct skge_hw *hw) +{ + static char buf[16]; + + switch(hw->chip_id) { + case CHIP_ID_GENESIS: + return "Genesis"; + case CHIP_ID_YUKON: + return "Yukon"; + case CHIP_ID_YUKON_LITE: + return "Yukon-Lite"; + case CHIP_ID_YUKON_LP: + return "Yukon-LP"; + case CHIP_ID_YUKON_XL: + return "Yukon-2 XL"; + case CHIP_ID_YUKON_EC: + return "YUKON-2 EC"; + case CHIP_ID_YUKON_FE: + return "YUKON-2 FE"; + default: + snprintf(buf, sizeof buf, "chipid 0x%x", hw->chip_id); + return buf; + } +} + +/* Read the board name out of the EEPROM and print it */ +static __devinit void skge_board_info(struct skge_hw *hw) +{ + const struct net_device *dev = hw->dev[0]; + const u8 *ea = dev->dev_addr; + u16 cs = skge_read16(hw, B0_CTST); + u8 *rom; + int len; + const u8 *dp; + + printk("%s: %s rev %d (PCI %d Mhz: %d-bit)" + " addr %02x:%02x:%02x:%02x:%02x:%02x\n", + dev->name, skge_board_name(hw), chip_rev(hw), + (cs & CS_BUS_CLOCK) ? 66 : 33, + (cs & CS_BUS_SLOT_SZ) ? 64 : 32, + ea[0],ea[1],ea[2],ea[3],ea[4],ea[5]); + + rom = kmalloc(hw->rom_size, GFP_KERNEL); + if (!rom) { + printk(KERN_WARNING PFX "couldn't allocate %d for rom\n", hw->rom_size); + return; + } + + if (skge_vpd_read(hw->pdev, rom, 0, hw->rom_size) != 0) { + printk(KERN_ERR PFX "Vpd rom read error\n"); + goto out; + } + + /* missing VPID rom? */ + if (rom[0] == 0xff || rom[1] == 0xff) + goto out; + + dp = rom; + if (*dp != VPD_RES_ID) { + printk(KERN_ERR PFX "bad VPD resource id: expected %x got %x\n", + VPD_RES_ID, *dp); + goto out; + } + + len = dp[1]; + dp += 3; + + printk(KERN_INFO "%*.*s\n", len, len, (char *)dp); + + /* Dump more detailed vpd info for debugging */ + dp += len; + if (*dp != VPD_RES_READ) { + printk(KERN_ERR PFX "bad VPD resource id: expected %x got %x\n", + VPD_RES_READ, *dp); + goto out; + } + len = dp[1]; + dp += 3; + + while (dp < rom + hw->rom_size && len > 3) { + const char *id = (const char *) dp; + u8 l = dp[2]; + + /* RV is end of read only area */ + if (id[0] == 'R' && id[1] == 'V') + break; + + /* Ignore Extended Capability value */ + if (!(id[0] == 'C' && id[1] == 'P')) + printk(KERN_INFO " %2.2s: %*.*s\n", id, l, l, id+3); + + len -= 3 + l; + dp += 3 + l; + } + + + out: + kfree(rom); +} + +static int __devinit skge_probe(struct pci_dev *pdev, + const struct pci_device_id *ent) +{ + struct net_device *dev; + struct skge_hw *hw; + int err, using_dac = 0; + + if ((err = pci_enable_device(pdev))) { + printk(KERN_ERR "%s cannot enable PCI device\n", + pci_name(pdev)); + goto err_out; + } + + if ((err = pci_request_regions(pdev, DRV_NAME))) { + printk(KERN_ERR "%s cannot obtain PCI resources\n", + pci_name(pdev)); + goto err_out_disable_pdev; + } + + pci_set_master(pdev); + + if (!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK))) + using_dac = 1; + else if (!(err = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) { + printk(KERN_ERR "%s no usable DMA configuration\n", + pci_name(pdev)); + goto err_out_free_regions; + } + +#ifdef __BIG_ENDIAN + /* byte swap decriptors in hardware */ + { + u32 reg; + + pci_read_config_dword(pdev, PCI_DEV_REG2, ®); + reg |= SKGEPCI_REV_DESC; + pci_write_config_dword(pdev, PCI_DEV_REG2, reg); + } +#endif + + err = -ENOMEM; + hw = skge_hwinit(pdev); + if (!hw) + goto err_out_free_regions; + + if ((err = request_irq(pdev->irq, skge_intr, SA_SHIRQ, DRV_NAME, hw))) { + printk(KERN_ERR "%s: cannot assign irq %d\n", + pci_name(pdev), pdev->irq); + goto err_out_free_hw; + } + + if ((dev = skge_devinit(hw, 0)) == NULL) + goto err_out_free_irq; + + if (using_dac) + dev->features |= NETIF_F_HIGHDMA; + + if ((err = register_netdev(dev))) { + printk(KERN_ERR "%s: cannot register net device\n", + pci_name(pdev)); + goto err_out_free_netdev; + } + + pci_set_drvdata(pdev, hw); + + if (isdualport(hw)) { + struct net_device *dev1 = skge_devinit(hw, 1); + + if (using_dac) + dev1->features |= NETIF_F_HIGHDMA; + + if (dev1 && register_netdev(dev1)) { + hw->dev[1] = NULL; + free_netdev(dev1); + } + + } + + skge_board_info(hw); + + return 0; + +err_out_free_netdev: + free_netdev(dev); +err_out_free_irq: + free_irq(pdev->irq, hw); +err_out_free_hw: + skge_hwfree(hw); +err_out_free_regions: + pci_release_regions(pdev); +err_out_disable_pdev: + pci_disable_device(pdev); + pci_set_drvdata(pdev, NULL); +err_out: + return err; +} + +static void __devexit skge_remove(struct pci_dev *pdev) +{ + struct skge_hw *hw = pci_get_drvdata(pdev); + struct net_device *dev0, *dev1; + + if(!hw) + return; + + if ((dev1 = hw->dev[1])) + unregister_netdev(dev1); + dev0 = hw->dev[0]; + unregister_netdev(dev0); + + tasklet_kill(&hw->ext_tasklet); + free_irq(pdev->irq, hw); + pci_release_regions(pdev); + pci_disable_device(pdev); + if (dev1) + free_netdev(dev1); + free_netdev(dev0); + skge_hwfree(hw); + pci_set_drvdata(pdev, NULL); +} + +static struct pci_driver skge_driver = { + .name = DRV_NAME, + .id_table = skge_id_table, + .probe = skge_probe, + .remove = __devexit_p(skge_remove), +}; + +static int __init skge_init_module(void) +{ + return pci_module_init(&skge_driver); +} + +static void __exit skge_cleanup_module(void) +{ + pci_unregister_driver(&skge_driver); +} + +module_init(skge_init_module); +module_exit(skge_cleanup_module); diff -Nru a/drivers/net/skge.h b/drivers/net/skge.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/net/skge.h 2005-01-19 13:42:49 -08:00 @@ -0,0 +1,3005 @@ +/* + * Definitions for the new Marvell Yukon / SysKonenct driver. + */ +#ifndef _SKGE_H +#define _SKGE_H + +/* PCI config registers */ +#define PCI_DEV_REG1 0x40 +#define PCI_DEV_REG2 0x44 +#ifndef PCI_VPD +#define PCI_VPD 0x50 +#endif + +/* PCI_OUR_REG_2 32 bit Our Register 2 */ +enum { + PCI_VPD_WR_THR = 0xff<<24, /* Bit 31..24: VPD Write Threshold */ + PCI_DEV_SEL = 0x7f<<17, /* Bit 23..17: EEPROM Device Select */ + PCI_VPD_ROM_SZ = 7 <<14, /* Bit 16..14: VPD ROM Size */ + /* Bit 13..12: reserved */ + PCI_EN_DUMMY_RD = 1<<3, /* Enable Dummy Read */ + PCI_REV_DESC = 1<<2, /* Reverse Desc. Bytes */ + PCI_USEDATA64 = 1<<0, /* Use 64Bit Data bus ext */ +}; + +/* PCI_VPD_ADR_REG 16 bit VPD Address Register */ +enum { + PCI_VPD_FLAG = 1<<15, /* starts VPD rd/wr cycle */ + PCI_VPD_ADR_MSK =0x7fffL, /* Bit 14.. 0: VPD Address Mask */ + VPD_RES_ID = 0x82, + VPD_RES_READ = 0x90, + VPD_RES_WRITE = 0x81, + VPD_RES_END = 0x78, +}; + + +#define PCI_STATUS_ERROR_BITS (PCI_STATUS_DETECTED_PARITY | \ + PCI_STATUS_SIG_SYSTEM_ERROR | \ + PCI_STATUS_REC_MASTER_ABORT | \ + PCI_STATUS_REC_TARGET_ABORT | \ + PCI_STATUS_PARITY) + + +enum csr_regs { + B0_RAP = 0x0000, + B0_CTST = 0x0004, + B0_LED = 0x0006, + B0_POWER_CTRL = 0x0007, + B0_ISRC = 0x0008, + B0_IMSK = 0x000c, + B0_HWE_ISRC = 0x0010, + B0_HWE_IMSK = 0x0014, + B0_SP_ISRC = 0x0018, + B0_XM1_IMSK = 0x0020, + B0_XM1_ISRC = 0x0028, + B0_XM1_PHY_ADDR = 0x0030, + B0_XM1_PHY_DATA = 0x0034, + B0_XM2_IMSK = 0x0040, + B0_XM2_ISRC = 0x0048, + B0_XM2_PHY_ADDR = 0x0050, + B0_XM2_PHY_DATA = 0x0054, + B0_R1_CSR = 0x0060, + B0_R2_CSR = 0x0064, + B0_XS1_CSR = 0x0068, + B0_XA1_CSR = 0x006c, + B0_XS2_CSR = 0x0070, + B0_XA2_CSR = 0x0074, + + B2_MAC_1 = 0x0100, + B2_MAC_2 = 0x0108, + B2_MAC_3 = 0x0110, + B2_CONN_TYP = 0x0118, + B2_PMD_TYP = 0x0119, + B2_MAC_CFG = 0x011a, + B2_CHIP_ID = 0x011b, + B2_E_0 = 0x011c, + B2_E_1 = 0x011d, + B2_E_2 = 0x011e, + B2_E_3 = 0x011f, + B2_FAR = 0x0120, + B2_FDP = 0x0124, + B2_LD_CTRL = 0x0128, + B2_LD_TEST = 0x0129, + B2_TI_INI = 0x0130, + B2_TI_VAL = 0x0134, + B2_TI_CTRL = 0x0138, + B2_TI_TEST = 0x0139, + B2_IRQM_INI = 0x0140, + B2_IRQM_VAL = 0x0144, + B2_IRQM_CTRL = 0x0148, + B2_IRQM_TEST = 0x0149, + B2_IRQM_MSK = 0x014c, + B2_IRQM_HWE_MSK = 0x0150, + B2_TST_CTRL1 = 0x0158, + B2_TST_CTRL2 = 0x0159, + B2_GP_IO = 0x015c, + B2_I2C_CTRL = 0x0160, + B2_I2C_DATA = 0x0164, + B2_I2C_IRQ = 0x0168, + B2_I2C_SW = 0x016c, + B2_BSC_INI = 0x0170, + B2_BSC_VAL = 0x0174, + B2_BSC_CTRL = 0x0178, + B2_BSC_STAT = 0x0179, + B2_BSC_TST = 0x017a, + + B3_RAM_ADDR = 0x0180, + B3_RAM_DATA_LO = 0x0184, + B3_RAM_DATA_HI = 0x0188, + B3_RI_WTO_R1 = 0x0190, + B3_RI_WTO_XA1 = 0x0191, + B3_RI_WTO_XS1 = 0x0192, + B3_RI_RTO_R1 = 0x0193, + B3_RI_RTO_XA1 = 0x0194, + B3_RI_RTO_XS1 = 0x0195, + B3_RI_WTO_R2 = 0x0196, + B3_RI_WTO_XA2 = 0x0197, + B3_RI_WTO_XS2 = 0x0198, + B3_RI_RTO_R2 = 0x0199, + B3_RI_RTO_XA2 = 0x019a, + B3_RI_RTO_XS2 = 0x019b, + B3_RI_TO_VAL = 0x019c, + B3_RI_CTRL = 0x01a0, + B3_RI_TEST = 0x01a2, + B3_MA_TOINI_RX1 = 0x01b0, + B3_MA_TOINI_RX2 = 0x01b1, + B3_MA_TOINI_TX1 = 0x01b2, + B3_MA_TOINI_TX2 = 0x01b3, + B3_MA_TOVAL_RX1 = 0x01b4, + B3_MA_TOVAL_RX2 = 0x01b5, + B3_MA_TOVAL_TX1 = 0x01b6, + B3_MA_TOVAL_TX2 = 0x01b7, + B3_MA_TO_CTRL = 0x01b8, + B3_MA_TO_TEST = 0x01ba, + B3_MA_RCINI_RX1 = 0x01c0, + B3_MA_RCINI_RX2 = 0x01c1, + B3_MA_RCINI_TX1 = 0x01c2, + B3_MA_RCINI_TX2 = 0x01c3, + B3_MA_RCVAL_RX1 = 0x01c4, + B3_MA_RCVAL_RX2 = 0x01c5, + B3_MA_RCVAL_TX1 = 0x01c6, + B3_MA_RCVAL_TX2 = 0x01c7, + B3_MA_RC_CTRL = 0x01c8, + B3_MA_RC_TEST = 0x01ca, + B3_PA_TOINI_RX1 = 0x01d0, + B3_PA_TOINI_RX2 = 0x01d4, + B3_PA_TOINI_TX1 = 0x01d8, + B3_PA_TOINI_TX2 = 0x01dc, + B3_PA_TOVAL_RX1 = 0x01e0, + B3_PA_TOVAL_RX2 = 0x01e4, + B3_PA_TOVAL_TX1 = 0x01e8, + B3_PA_TOVAL_TX2 = 0x01ec, + B3_PA_CTRL = 0x01f0, + B3_PA_TEST = 0x01f2, +}; + +/* B0_CTST 16 bit Control/Status register */ +enum { + CS_CLK_RUN_HOT = 1<<13,/* CLK_RUN hot m. (YUKON-Lite only) */ + CS_CLK_RUN_RST = 1<<12,/* CLK_RUN reset (YUKON-Lite only) */ + CS_CLK_RUN_ENA = 1<<11,/* CLK_RUN enable (YUKON-Lite only) */ + CS_VAUX_AVAIL = 1<<10,/* VAUX available (YUKON only) */ + CS_BUS_CLOCK = 1<<9, /* Bus Clock 0/1 = 33/66 MHz */ + CS_BUS_SLOT_SZ = 1<<8, /* Slot Size 0/1 = 32/64 bit slot */ + CS_ST_SW_IRQ = 1<<7, /* Set IRQ SW Request */ + CS_CL_SW_IRQ = 1<<6, /* Clear IRQ SW Request */ + CS_STOP_DONE = 1<<5, /* Stop Master is finished */ + CS_STOP_MAST = 1<<4, /* Command Bit to stop the master */ + CS_MRST_CLR = 1<<3, /* Clear Master reset */ + CS_MRST_SET = 1<<2, /* Set Master reset */ + CS_RST_CLR = 1<<1, /* Clear Software reset */ + CS_RST_SET = 1, /* Set Software reset */ + +/* B0_LED 8 Bit LED register */ +/* Bit 7.. 2: reserved */ + LED_STAT_ON = 1<<1, /* Status LED on */ + LED_STAT_OFF = 1, /* Status LED off */ + +/* B0_POWER_CTRL 8 Bit Power Control reg (YUKON only) */ + PC_VAUX_ENA = 1<<7, /* Switch VAUX Enable */ + PC_VAUX_DIS = 1<<6, /* Switch VAUX Disable */ + PC_VCC_ENA = 1<<5, /* Switch VCC Enable */ + PC_VCC_DIS = 1<<4, /* Switch VCC Disable */ + PC_VAUX_ON = 1<<3, /* Switch VAUX On */ + PC_VAUX_OFF = 1<<2, /* Switch VAUX Off */ + PC_VCC_ON = 1<<1, /* Switch VCC On */ + PC_VCC_OFF = 1<<0, /* Switch VCC Off */ +}; + +/* B2_IRQM_MSK 32 bit IRQ Moderation Mask */ +enum { + IS_ALL_MSK = 0xbffffffful, /* All Interrupt bits */ + IS_HW_ERR = 1<<31, /* Interrupt HW Error */ + /* Bit 30: reserved */ + IS_PA_TO_RX1 = 1<<29, /* Packet Arb Timeout Rx1 */ + IS_PA_TO_RX2 = 1<<28, /* Packet Arb Timeout Rx2 */ + IS_PA_TO_TX1 = 1<<27, /* Packet Arb Timeout Tx1 */ + IS_PA_TO_TX2 = 1<<26, /* Packet Arb Timeout Tx2 */ + IS_I2C_READY = 1<<25, /* IRQ on end of I2C Tx */ + IS_IRQ_SW = 1<<24, /* SW forced IRQ */ + IS_EXT_REG = 1<<23, /* IRQ from LM80 or PHY (GENESIS only) */ + /* IRQ from PHY (YUKON only) */ + IS_TIMINT = 1<<22, /* IRQ from Timer */ + IS_MAC1 = 1<<21, /* IRQ from MAC 1 */ + IS_LNK_SYNC_M1 = 1<<20, /* Link Sync Cnt wrap MAC 1 */ + IS_MAC2 = 1<<19, /* IRQ from MAC 2 */ + IS_LNK_SYNC_M2 = 1<<18, /* Link Sync Cnt wrap MAC 2 */ +/* Receive Queue 1 */ + IS_R1_B = 1<<17, /* Q_R1 End of Buffer */ + IS_R1_F = 1<<16, /* Q_R1 End of Frame */ + IS_R1_C = 1<<15, /* Q_R1 Encoding Error */ +/* Receive Queue 2 */ + IS_R2_B = 1<<14, /* Q_R2 End of Buffer */ + IS_R2_F = 1<<13, /* Q_R2 End of Frame */ + IS_R2_C = 1<<12, /* Q_R2 Encoding Error */ +/* Synchronous Transmit Queue 1 */ + IS_XS1_B = 1<<11, /* Q_XS1 End of Buffer */ + IS_XS1_F = 1<<10, /* Q_XS1 End of Frame */ + IS_XS1_C = 1<<9, /* Q_XS1 Encoding Error */ +/* Asynchronous Transmit Queue 1 */ + IS_XA1_B = 1<<8, /* Q_XA1 End of Buffer */ + IS_XA1_F = 1<<7, /* Q_XA1 End of Frame */ + IS_XA1_C = 1<<6, /* Q_XA1 Encoding Error */ +/* Synchronous Transmit Queue 2 */ + IS_XS2_B = 1<<5, /* Q_XS2 End of Buffer */ + IS_XS2_F = 1<<4, /* Q_XS2 End of Frame */ + IS_XS2_C = 1<<3, /* Q_XS2 Encoding Error */ +/* Asynchronous Transmit Queue 2 */ + IS_XA2_B = 1<<2, /* Q_XA2 End of Buffer */ + IS_XA2_F = 1<<1, /* Q_XA2 End of Frame */ + IS_XA2_C = 1<<0, /* Q_XA2 Encoding Error */ + + IS_PORT_1 = IS_XA1_F| IS_R1_F| IS_MAC1, + IS_PORT_2 = IS_XA2_F| IS_R2_F| IS_MAC2, +}; + + +/* B2_IRQM_HWE_MSK 32 bit IRQ Moderation HW Error Mask */ +enum { + IS_ERR_MSK = 0x00000fff,/* All Error bits */ + + IS_IRQ_TIST_OV = 1<<13, /* Time Stamp Timer Overflow (YUKON only) */ + IS_IRQ_SENSOR = 1<<12, /* IRQ from Sensor (YUKON only) */ + IS_IRQ_MST_ERR = 1<<11, /* IRQ master error detected */ + IS_IRQ_STAT = 1<<10, /* IRQ status exception */ + IS_NO_STAT_M1 = 1<<9, /* No Rx Status from MAC 1 */ + IS_NO_STAT_M2 = 1<<8, /* No Rx Status from MAC 2 */ + IS_NO_TIST_M1 = 1<<7, /* No Time Stamp from MAC 1 */ + IS_NO_TIST_M2 = 1<<6, /* No Time Stamp from MAC 2 */ + IS_RAM_RD_PAR = 1<<5, /* RAM Read Parity Error */ + IS_RAM_WR_PAR = 1<<4, /* RAM Write Parity Error */ + IS_M1_PAR_ERR = 1<<3, /* MAC 1 Parity Error */ + IS_M2_PAR_ERR = 1<<2, /* MAC 2 Parity Error */ + IS_R1_PAR_ERR = 1<<1, /* Queue R1 Parity Error */ + IS_R2_PAR_ERR = 1<<0, /* Queue R2 Parity Error */ +}; + +/* B2_TST_CTRL1 8 bit Test Control Register 1 */ +enum { + TST_FRC_DPERR_MR = 1<<7, /* force DATAPERR on MST RD */ + TST_FRC_DPERR_MW = 1<<6, /* force DATAPERR on MST WR */ + TST_FRC_DPERR_TR = 1<<5, /* force DATAPERR on TRG RD */ + TST_FRC_DPERR_TW = 1<<4, /* force DATAPERR on TRG WR */ + TST_FRC_APERR_M = 1<<3, /* force ADDRPERR on MST */ + TST_FRC_APERR_T = 1<<2, /* force ADDRPERR on TRG */ + TST_CFG_WRITE_ON = 1<<1, /* Enable Config Reg WR */ + TST_CFG_WRITE_OFF= 1<<0, /* Disable Config Reg WR */ +}; + +/* B2_MAC_CFG 8 bit MAC Configuration / Chip Revision */ +enum { + CFG_CHIP_R_MSK = 0xf<<4, /* Bit 7.. 4: Chip Revision */ + /* Bit 3.. 2: reserved */ + CFG_DIS_M2_CLK = 1<<1, /* Disable Clock for 2nd MAC */ + CFG_SNG_MAC = 1<<0, /* MAC Config: 0=2 MACs / 1=1 MAC*/ +}; + +/* B2_CHIP_ID 8 bit Chip Identification Number */ +enum { + CHIP_ID_GENESIS = 0x0a, /* Chip ID for GENESIS */ + CHIP_ID_YUKON = 0xb0, /* Chip ID for YUKON */ + CHIP_ID_YUKON_LITE = 0xb1, /* Chip ID for YUKON-Lite (Rev. A1-A3) */ + CHIP_ID_YUKON_LP = 0xb2, /* Chip ID for YUKON-LP */ + CHIP_ID_YUKON_XL = 0xb3, /* Chip ID for YUKON-2 XL */ + CHIP_ID_YUKON_EC = 0xb6, /* Chip ID for YUKON-2 EC */ + CHIP_ID_YUKON_FE = 0xb7, /* Chip ID for YUKON-2 FE */ + + CHIP_REV_YU_LITE_A1 = 3, /* Chip Rev. for YUKON-Lite A1,A2 */ + CHIP_REV_YU_LITE_A3 = 7, /* Chip Rev. for YUKON-Lite A3 */ +}; + +/* B2_LD_TEST 8 bit EPROM loader test register */ +enum { + LD_T_ON = 1<<3, /* Loader Test mode on */ + LD_T_OFF = 1<<2, /* Loader Test mode off */ + LD_T_STEP = 1<<1, /* Decrement FPROM addr. Counter */ + LD_START = 1<<0, /* Start loading FPROM */ +}; + +/* B2_TI_CTRL 8 bit Timer control */ +/* B2_IRQM_CTRL 8 bit IRQ Moderation Timer Control */ +enum { + TIM_START = 1<<2, /* Start Timer */ + TIM_STOP = 1<<1, /* Stop Timer */ + TIM_CLR_IRQ = 1<<0, /* Clear Timer IRQ (!IRQM) */ +}; + +/* B2_TI_TEST 8 Bit Timer Test */ +/* B2_IRQM_TEST 8 bit IRQ Moderation Timer Test */ +/* B28_DPT_TST 8 bit Descriptor Poll Timer Test Reg */ +enum { + TIM_T_ON = 1<<2, /* Test mode on */ + TIM_T_OFF = 1<<1, /* Test mode off */ + TIM_T_STEP = 1<<0, /* Test step */ +}; + +/* B28_DPT_INI 32 bit Descriptor Poll Timer Init Val */ +/* B28_DPT_VAL 32 bit Descriptor Poll Timer Curr Val */ +/* B28_DPT_CTRL 8 bit Descriptor Poll Timer Ctrl Reg */ +enum { + DPT_MSK = 0x00ffffffL, /* Bit 23.. 0: Desc Poll Timer Bits */ + + DPT_START = 1<<1, /* Start Descriptor Poll Timer */ + DPT_STOP = 1<<0, /* Stop Descriptor Poll Timer */ +}; + +/* B2_GP_IO 32 bit General Purpose I/O Register */ +enum { + GP_DIR_9 = 1<<25, /* IO_9 direct, 0=In/1=Out */ + GP_DIR_8 = 1<<24, /* IO_8 direct, 0=In/1=Out */ + GP_DIR_7 = 1<<23, /* IO_7 direct, 0=In/1=Out */ + GP_DIR_6 = 1<<22, /* IO_6 direct, 0=In/1=Out */ + GP_DIR_5 = 1<<21, /* IO_5 direct, 0=In/1=Out */ + GP_DIR_4 = 1<<20, /* IO_4 direct, 0=In/1=Out */ + GP_DIR_3 = 1<<19, /* IO_3 direct, 0=In/1=Out */ + GP_DIR_2 = 1<<18, /* IO_2 direct, 0=In/1=Out */ + GP_DIR_1 = 1<<17, /* IO_1 direct, 0=In/1=Out */ + GP_DIR_0 = 1<<16, /* IO_0 direct, 0=In/1=Out */ + + GP_IO_9 = 1<<9, /* IO_9 pin */ + GP_IO_8 = 1<<8, /* IO_8 pin */ + GP_IO_7 = 1<<7, /* IO_7 pin */ + GP_IO_6 = 1<<6, /* IO_6 pin */ + GP_IO_5 = 1<<5, /* IO_5 pin */ + GP_IO_4 = 1<<4, /* IO_4 pin */ + GP_IO_3 = 1<<3, /* IO_3 pin */ + GP_IO_2 = 1<<2, /* IO_2 pin */ + GP_IO_1 = 1<<1, /* IO_1 pin */ + GP_IO_0 = 1<<0, /* IO_0 pin */ +}; + +/* Rx/Tx Path related Arbiter Test Registers */ +/* B3_MA_TO_TEST 16 bit MAC Arbiter Timeout Test Reg */ +/* B3_MA_RC_TEST 16 bit MAC Arbiter Recovery Test Reg */ +/* B3_PA_TEST 16 bit Packet Arbiter Test Register */ +/* Bit 15, 11, 7, and 3 are reserved in B3_PA_TEST */ +enum { + TX2_T_EV = 1<<15,/* TX2 Timeout/Recv Event occured */ + TX2_T_ON = 1<<14,/* TX2 Timeout/Recv Timer Test On */ + TX2_T_OFF = 1<<13,/* TX2 Timeout/Recv Timer Tst Off */ + TX2_T_STEP = 1<<12,/* TX2 Timeout/Recv Timer Step */ + TX1_T_EV = 1<<11,/* TX1 Timeout/Recv Event occured */ + TX1_T_ON = 1<<10,/* TX1 Timeout/Recv Timer Test On */ + TX1_T_OFF = 1<<9, /* TX1 Timeout/Recv Timer Tst Off */ + TX1_T_STEP = 1<<8, /* TX1 Timeout/Recv Timer Step */ + RX2_T_EV = 1<<7, /* RX2 Timeout/Recv Event occured */ + RX2_T_ON = 1<<6, /* RX2 Timeout/Recv Timer Test On */ + RX2_T_OFF = 1<<5, /* RX2 Timeout/Recv Timer Tst Off */ + RX2_T_STEP = 1<<4, /* RX2 Timeout/Recv Timer Step */ + RX1_T_EV = 1<<3, /* RX1 Timeout/Recv Event occured */ + RX1_T_ON = 1<<2, /* RX1 Timeout/Recv Timer Test On */ + RX1_T_OFF = 1<<1, /* RX1 Timeout/Recv Timer Tst Off */ + RX1_T_STEP = 1<<0, /* RX1 Timeout/Recv Timer Step */ +}; + +/* Descriptor Bit Definition */ +/* TxCtrl Transmit Buffer Control Field */ +/* RxCtrl Receive Buffer Control Field */ +enum { + BMU_OWN = 1<<31, /* OWN bit: 0=host/1=BMU */ + BMU_STF = 1<<30, /* Start of Frame */ + BMU_EOF = 1<<29, /* End of Frame */ + BMU_IRQ_EOB = 1<<28, /* Req "End of Buffer" IRQ */ + BMU_IRQ_EOF = 1<<27, /* Req "End of Frame" IRQ */ + /* TxCtrl specific bits */ + BMU_STFWD = 1<<26, /* (Tx) Store & Forward Frame */ + BMU_NO_FCS = 1<<25, /* (Tx) Disable MAC FCS (CRC) generation */ + BMU_SW = 1<<24, /* (Tx) 1 bit res. for SW use */ + /* RxCtrl specific bits */ + BMU_DEV_0 = 1<<26, /* (Rx) Transfer data to Dev0 */ + BMU_STAT_VAL = 1<<25, /* (Rx) Rx Status Valid */ + BMU_TIST_VAL = 1<<24, /* (Rx) Rx TimeStamp Valid */ + /* Bit 23..16: BMU Check Opcodes */ + BMU_CHECK = 0x55<<16, /* Default BMU check */ + BMU_TCP_CHECK = 0x56<<16, /* Descr with TCP ext */ + BMU_UDP_CHECK = 0x57<<16, /* Descr with UDP ext (YUKON only) */ + BMU_BBC = 0xffffL, /* Bit 15.. 0: Buffer Byte Counter */ +}; + +/* B2_BSC_CTRL 8 bit Blink Source Counter Control */ +enum { + BSC_START = 1<<1, /* Start Blink Source Counter */ + BSC_STOP = 1<<0, /* Stop Blink Source Counter */ +}; + +/* B2_BSC_STAT 8 bit Blink Source Counter Status */ +enum { + BSC_SRC = 1<<0, /* Blink Source, 0=Off / 1=On */ +}; + +/* B2_BSC_TST 16 bit Blink Source Counter Test Reg */ +enum { + BSC_T_ON = 1<<2, /* Test mode on */ + BSC_T_OFF = 1<<1, /* Test mode off */ + BSC_T_STEP = 1<<0, /* Test step */ +}; + +/* B3_RAM_ADDR 32 bit RAM Address, to read or write */ + /* Bit 31..19: reserved */ +#define RAM_ADR_RAN 0x0007ffffL /* Bit 18.. 0: RAM Address Range */ +/* RAM Interface Registers */ + +/* B3_RI_CTRL 16 bit RAM Iface Control Register */ +enum { + RI_CLR_RD_PERR = 1<<9, /* Clear IRQ RAM Read Parity Err */ + RI_CLR_WR_PERR = 1<<8, /* Clear IRQ RAM Write Parity Err*/ + + RI_RST_CLR = 1<<1, /* Clear RAM Interface Reset */ + RI_RST_SET = 1<<0, /* Set RAM Interface Reset */ +}; + +/* B3_RI_TEST 8 bit RAM Iface Test Register */ +enum { + RI_T_EV = 1<<3, /* Timeout Event occured */ + RI_T_ON = 1<<2, /* Timeout Timer Test On */ + RI_T_OFF = 1<<1, /* Timeout Timer Test Off */ + RI_T_STEP = 1<<0, /* Timeout Timer Step */ +}; + +/* MAC Arbiter Registers */ +/* B3_MA_TO_CTRL 16 bit MAC Arbiter Timeout Ctrl Reg */ +enum { + MA_FOE_ON = 1<<3, /* XMAC Fast Output Enable ON */ + MA_FOE_OFF = 1<<2, /* XMAC Fast Output Enable OFF */ + MA_RST_CLR = 1<<1, /* Clear MAC Arbiter Reset */ + MA_RST_SET = 1<<0, /* Set MAC Arbiter Reset */ + +}; + +/* Timeout values */ +#define SK_MAC_TO_53 72 /* MAC arbiter timeout */ +#define SK_PKT_TO_53 0x2000 /* Packet arbiter timeout */ +#define SK_PKT_TO_MAX 0xffff /* Maximum value */ +#define SK_RI_TO_53 36 /* RAM interface timeout */ + + +/* B3_MA_RC_CTRL 16 bit MAC Arbiter Recovery Ctrl Reg */ +enum { + MA_ENA_REC_TX2 = 1<<7, /* Enable Recovery Timer TX2 */ + MA_DIS_REC_TX2 = 1<<6, /* Disable Recovery Timer TX2 */ + MA_ENA_REC_TX1 = 1<<5, /* Enable Recovery Timer TX1 */ + MA_DIS_REC_TX1 = 1<<4, /* Disable Recovery Timer TX1 */ + MA_ENA_REC_RX2 = 1<<3, /* Enable Recovery Timer RX2 */ + MA_DIS_REC_RX2 = 1<<2, /* Disable Recovery Timer RX2 */ + MA_ENA_REC_RX1 = 1<<1, /* Enable Recovery Timer RX1 */ + MA_DIS_REC_RX1 = 1<<0, /* Disable Recovery Timer RX1 */ +}; + +/* Packet Arbiter Registers */ +/* B3_PA_CTRL 16 bit Packet Arbiter Ctrl Register */ +enum { + PA_CLR_TO_TX2 = 1<<13, /* Clear IRQ Packet Timeout TX2 */ + PA_CLR_TO_TX1 = 1<<12, /* Clear IRQ Packet Timeout TX1 */ + PA_CLR_TO_RX2 = 1<<11, /* Clear IRQ Packet Timeout RX2 */ + PA_CLR_TO_RX1 = 1<<10, /* Clear IRQ Packet Timeout RX1 */ + PA_ENA_TO_TX2 = 1<<9, /* Enable Timeout Timer TX2 */ + PA_DIS_TO_TX2 = 1<<8, /* Disable Timeout Timer TX2 */ + PA_ENA_TO_TX1 = 1<<7, /* Enable Timeout Timer TX1 */ + PA_DIS_TO_TX1 = 1<<6, /* Disable Timeout Timer TX1 */ + PA_ENA_TO_RX2 = 1<<5, /* Enable Timeout Timer RX2 */ + PA_DIS_TO_RX2 = 1<<4, /* Disable Timeout Timer RX2 */ + PA_ENA_TO_RX1 = 1<<3, /* Enable Timeout Timer RX1 */ + PA_DIS_TO_RX1 = 1<<2, /* Disable Timeout Timer RX1 */ + PA_RST_CLR = 1<<1, /* Clear MAC Arbiter Reset */ + PA_RST_SET = 1<<0, /* Set MAC Arbiter Reset */ +}; + +#define PA_ENA_TO_ALL (PA_ENA_TO_RX1 | PA_ENA_TO_RX2 |\ + PA_ENA_TO_TX1 | PA_ENA_TO_TX2) + + +/* Transmit Arbiter Registers MAC 1 and 2, use MR_ADDR() to access */ +/* TXA_ITI_INI 32 bit Tx Arb Interval Timer Init Val */ +/* TXA_ITI_VAL 32 bit Tx Arb Interval Timer Value */ +/* TXA_LIM_INI 32 bit Tx Arb Limit Counter Init Val */ +/* TXA_LIM_VAL 32 bit Tx Arb Limit Counter Value */ + +#define TXA_MAX_VAL 0x00ffffffUL /* Bit 23.. 0: Max TXA Timer/Cnt Val */ + +/* TXA_CTRL 8 bit Tx Arbiter Control Register */ +enum { + TXA_ENA_FSYNC = 1<<7, /* Enable force of sync Tx queue */ + TXA_DIS_FSYNC = 1<<6, /* Disable force of sync Tx queue */ + TXA_ENA_ALLOC = 1<<5, /* Enable alloc of free bandwidth */ + TXA_DIS_ALLOC = 1<<4, /* Disable alloc of free bandwidth */ + TXA_START_RC = 1<<3, /* Start sync Rate Control */ + TXA_STOP_RC = 1<<2, /* Stop sync Rate Control */ + TXA_ENA_ARB = 1<<1, /* Enable Tx Arbiter */ + TXA_DIS_ARB = 1<<0, /* Disable Tx Arbiter */ +}; + +/* + * Bank 4 - 5 + */ +/* Transmit Arbiter Registers MAC 1 and 2, use MR_ADDR() to access */ +enum { + TXA_ITI_INI = 0x0200,/* 32 bit Tx Arb Interval Timer Init Val*/ + TXA_ITI_VAL = 0x0204,/* 32 bit Tx Arb Interval Timer Value */ + TXA_LIM_INI = 0x0208,/* 32 bit Tx Arb Limit Counter Init Val */ + TXA_LIM_VAL = 0x020c,/* 32 bit Tx Arb Limit Counter Value */ + TXA_CTRL = 0x0210,/* 8 bit Tx Arbiter Control Register */ + TXA_TEST = 0x0211,/* 8 bit Tx Arbiter Test Register */ + TXA_STAT = 0x0212,/* 8 bit Tx Arbiter Status Register */ +}; + + +enum { + B6_EXT_REG = 0x0300,/* External registers (GENESIS only) */ + B7_CFG_SPC = 0x0380,/* copy of the Configuration register */ + B8_RQ1_REGS = 0x0400,/* Receive Queue 1 */ + B8_RQ2_REGS = 0x0480,/* Receive Queue 2 */ + B8_TS1_REGS = 0x0600,/* Transmit sync queue 1 */ + B8_TA1_REGS = 0x0680,/* Transmit async queue 1 */ + B8_TS2_REGS = 0x0700,/* Transmit sync queue 2 */ + B8_TA2_REGS = 0x0780,/* Transmit sync queue 2 */ + B16_RAM_REGS = 0x0800,/* RAM Buffer Registers */ +}; + +/* Queue Register Offsets, use Q_ADDR() to access */ +enum { + B8_Q_REGS = 0x0400, /* base of Queue registers */ + Q_D = 0x00, /* 8*32 bit Current Descriptor */ + Q_DA_L = 0x20, /* 32 bit Current Descriptor Address Low dWord */ + Q_DA_H = 0x24, /* 32 bit Current Descriptor Address High dWord */ + Q_AC_L = 0x28, /* 32 bit Current Address Counter Low dWord */ + Q_AC_H = 0x2c, /* 32 bit Current Address Counter High dWord */ + Q_BC = 0x30, /* 32 bit Current Byte Counter */ + Q_CSR = 0x34, /* 32 bit BMU Control/Status Register */ + Q_F = 0x38, /* 32 bit Flag Register */ + Q_T1 = 0x3c, /* 32 bit Test Register 1 */ + Q_T1_TR = 0x3c, /* 8 bit Test Register 1 Transfer SM */ + Q_T1_WR = 0x3d, /* 8 bit Test Register 1 Write Descriptor SM */ + Q_T1_RD = 0x3e, /* 8 bit Test Register 1 Read Descriptor SM */ + Q_T1_SV = 0x3f, /* 8 bit Test Register 1 Supervisor SM */ + Q_T2 = 0x40, /* 32 bit Test Register 2 */ + Q_T3 = 0x44, /* 32 bit Test Register 3 */ + +/* Yukon-2 */ + Q_DONE = 0x24, /* 16 bit Done Index (Yukon-2 only) */ + Q_WM = 0x40, /* 16 bit FIFO Watermark */ + Q_AL = 0x42, /* 8 bit FIFO Alignment */ + Q_RSP = 0x44, /* 16 bit FIFO Read Shadow Pointer */ + Q_RSL = 0x46, /* 8 bit FIFO Read Shadow Level */ + Q_RP = 0x48, /* 8 bit FIFO Read Pointer */ + Q_RL = 0x4a, /* 8 bit FIFO Read Level */ + Q_WP = 0x4c, /* 8 bit FIFO Write Pointer */ + Q_WSP = 0x4d, /* 8 bit FIFO Write Shadow Pointer */ + Q_WL = 0x4e, /* 8 bit FIFO Write Level */ + Q_WSL = 0x4f, /* 8 bit FIFO Write Shadow Level */ +}; +#define Q_ADDR(reg, offs) (B8_Q_REGS + (reg) + (offs)) + +/* RAM Buffer Register Offsets */ +enum { + + RB_START = 0x00,/* 32 bit RAM Buffer Start Address */ + RB_END = 0x04,/* 32 bit RAM Buffer End Address */ + RB_WP = 0x08,/* 32 bit RAM Buffer Write Pointer */ + RB_RP = 0x0c,/* 32 bit RAM Buffer Read Pointer */ + RB_RX_UTPP = 0x10,/* 32 bit Rx Upper Threshold, Pause Packet */ + RB_RX_LTPP = 0x14,/* 32 bit Rx Lower Threshold, Pause Packet */ + RB_RX_UTHP = 0x18,/* 32 bit Rx Upper Threshold, High Prio */ + RB_RX_LTHP = 0x1c,/* 32 bit Rx Lower Threshold, High Prio */ + /* 0x10 - 0x1f: reserved at Tx RAM Buffer Registers */ + RB_PC = 0x20,/* 32 bit RAM Buffer Packet Counter */ + RB_LEV = 0x24,/* 32 bit RAM Buffer Level Register */ + RB_CTRL = 0x28,/* 32 bit RAM Buffer Control Register */ + RB_TST1 = 0x29,/* 8 bit RAM Buffer Test Register 1 */ + RB_TST2 = 0x2a,/* 8 bit RAM Buffer Test Register 2 */ +}; + +/* Receive and Transmit Queues */ +enum { + Q_R1 = 0x0000, /* Receive Queue 1 */ + Q_R2 = 0x0080, /* Receive Queue 2 */ + Q_XS1 = 0x0200, /* Synchronous Transmit Queue 1 */ + Q_XA1 = 0x0280, /* Asynchronous Transmit Queue 1 */ + Q_XS2 = 0x0300, /* Synchronous Transmit Queue 2 */ + Q_XA2 = 0x0380, /* Asynchronous Transmit Queue 2 */ +}; + +/* Different MAC Types */ +enum { + SK_MAC_XMAC = 0, /* Xaqti XMAC II */ + SK_MAC_GMAC = 1, /* Marvell GMAC */ +}; + +/* Different PHY Types */ +enum { + SK_PHY_XMAC = 0,/* integrated in XMAC II */ + SK_PHY_BCOM = 1,/* Broadcom BCM5400 */ + SK_PHY_LONE = 2,/* Level One LXT1000 [not supported]*/ + SK_PHY_NAT = 3,/* National DP83891 [not supported] */ + SK_PHY_MARV_COPPER= 4,/* Marvell 88E1011S */ + SK_PHY_MARV_FIBER = 5,/* Marvell 88E1011S working on fiber */ +}; + +/* PHY addresses (bits 12..8 of PHY address reg) */ +enum { + PHY_ADDR_XMAC = 0<<8, + PHY_ADDR_BCOM = 1<<8, + PHY_ADDR_LONE = 3<<8, + PHY_ADDR_NAT = 0<<8, +/* GPHY address (bits 15..11 of SMI control reg) */ + PHY_ADDR_MARV = 0, +}; + +#define RB_ADDR(offs, queue) (B16_RAM_REGS + (queue) + (offs)) + +/* Receive MAC FIFO, Receive LED, and Link_Sync regs (GENESIS only) */ +enum { + RX_MFF_EA = 0x0c00,/* 32 bit Receive MAC FIFO End Address */ + RX_MFF_WP = 0x0c04,/* 32 bit Receive MAC FIFO Write Pointer */ + + RX_MFF_RP = 0x0c0c,/* 32 bit Receive MAC FIFO Read Pointer */ + RX_MFF_PC = 0x0c10,/* 32 bit Receive MAC FIFO Packet Cnt */ + RX_MFF_LEV = 0x0c14,/* 32 bit Receive MAC FIFO Level */ + RX_MFF_CTRL1 = 0x0c18,/* 16 bit Receive MAC FIFO Control Reg 1*/ + RX_MFF_STAT_TO = 0x0c1a,/* 8 bit Receive MAC Status Timeout */ + RX_MFF_TIST_TO = 0x0c1b,/* 8 bit Receive MAC Time Stamp Timeout */ + RX_MFF_CTRL2 = 0x0c1c,/* 8 bit Receive MAC FIFO Control Reg 2*/ + RX_MFF_TST1 = 0x0c1d,/* 8 bit Receive MAC FIFO Test Reg 1 */ + RX_MFF_TST2 = 0x0c1e,/* 8 bit Receive MAC FIFO Test Reg 2 */ + + RX_LED_INI = 0x0c20,/* 32 bit Receive LED Cnt Init Value */ + RX_LED_VAL = 0x0c24,/* 32 bit Receive LED Cnt Current Value */ + RX_LED_CTRL = 0x0c28,/* 8 bit Receive LED Cnt Control Reg */ + RX_LED_TST = 0x0c29,/* 8 bit Receive LED Cnt Test Register */ + + LNK_SYNC_INI = 0x0c30,/* 32 bit Link Sync Cnt Init Value */ + LNK_SYNC_VAL = 0x0c34,/* 32 bit Link Sync Cnt Current Value */ + LNK_SYNC_CTRL = 0x0c38,/* 8 bit Link Sync Cnt Control Register */ + LNK_SYNC_TST = 0x0c39,/* 8 bit Link Sync Cnt Test Register */ + LNK_LED_REG = 0x0c3c,/* 8 bit Link LED Register */ +}; + +/* Receive and Transmit MAC FIFO Registers (GENESIS only) */ +/* RX_MFF_CTRL1 16 bit Receive MAC FIFO Control Reg 1 */ +enum { + MFF_ENA_RDY_PAT = 1<<13, /* Enable Ready Patch */ + MFF_DIS_RDY_PAT = 1<<12, /* Disable Ready Patch */ + MFF_ENA_TIM_PAT = 1<<11, /* Enable Timing Patch */ + MFF_DIS_TIM_PAT = 1<<10, /* Disable Timing Patch */ + MFF_ENA_ALM_FUL = 1<<9, /* Enable AlmostFull Sign */ + MFF_DIS_ALM_FUL = 1<<8, /* Disable AlmostFull Sign */ + MFF_ENA_PAUSE = 1<<7, /* Enable Pause Signaling */ + MFF_DIS_PAUSE = 1<<6, /* Disable Pause Signaling */ + MFF_ENA_FLUSH = 1<<5, /* Enable Frame Flushing */ + MFF_DIS_FLUSH = 1<<4, /* Disable Frame Flushing */ + MFF_ENA_TIST = 1<<3, /* Enable Time Stamp Gener */ + MFF_DIS_TIST = 1<<2, /* Disable Time Stamp Gener */ + MFF_CLR_INTIST = 1<<1, /* Clear IRQ No Time Stamp */ + MFF_CLR_INSTAT = 1<<0, /* Clear IRQ No Status */ +#define MFF_RX_CTRL_DEF MFF_ENA_TIM_PAT +}; + +/* TX_MFF_CTRL1 16 bit Transmit MAC FIFO Control Reg 1 */ +enum { + MFF_CLR_PERR = 1<<15, /* Clear Parity Error IRQ */ + /* Bit 14: reserved */ + MFF_ENA_PKT_REC = 1<<13, /* Enable Packet Recovery */ + MFF_DIS_PKT_REC = 1<<12, /* Disable Packet Recovery */ + + MFF_ENA_W4E = 1<<7, /* Enable Wait for Empty */ + MFF_DIS_W4E = 1<<6, /* Disable Wait for Empty */ + + MFF_ENA_LOOPB = 1<<3, /* Enable Loopback */ + MFF_DIS_LOOPB = 1<<2, /* Disable Loopback */ + MFF_CLR_MAC_RST = 1<<1, /* Clear XMAC Reset */ + MFF_SET_MAC_RST = 1<<0, /* Set XMAC Reset */ +}; + +#define MFF_TX_CTRL_DEF (MFF_ENA_PKT_REC | MFF_ENA_TIM_PAT | MFF_ENA_FLUSH) + +/* RX_MFF_TST2 8 bit Receive MAC FIFO Test Register 2 */ +/* TX_MFF_TST2 8 bit Transmit MAC FIFO Test Register 2 */ +enum { + MFF_WSP_T_ON = 1<<6, /* Tx: Write Shadow Ptr TestOn */ + MFF_WSP_T_OFF = 1<<5, /* Tx: Write Shadow Ptr TstOff */ + MFF_WSP_INC = 1<<4, /* Tx: Write Shadow Ptr Increment */ + MFF_PC_DEC = 1<<3, /* Packet Counter Decrement */ + MFF_PC_T_ON = 1<<2, /* Packet Counter Test On */ + MFF_PC_T_OFF = 1<<1, /* Packet Counter Test Off */ + MFF_PC_INC = 1<<0, /* Packet Counter Increment */ +}; + +/* RX_MFF_TST1 8 bit Receive MAC FIFO Test Register 1 */ +/* TX_MFF_TST1 8 bit Transmit MAC FIFO Test Register 1 */ +enum { + MFF_WP_T_ON = 1<<6, /* Write Pointer Test On */ + MFF_WP_T_OFF = 1<<5, /* Write Pointer Test Off */ + MFF_WP_INC = 1<<4, /* Write Pointer Increm */ + + MFF_RP_T_ON = 1<<2, /* Read Pointer Test On */ + MFF_RP_T_OFF = 1<<1, /* Read Pointer Test Off */ + MFF_RP_DEC = 1<<0, /* Read Pointer Decrement */ +}; + +/* RX_MFF_CTRL2 8 bit Receive MAC FIFO Control Reg 2 */ +/* TX_MFF_CTRL2 8 bit Transmit MAC FIFO Control Reg 2 */ +enum { + MFF_ENA_OP_MD = 1<<3, /* Enable Operation Mode */ + MFF_DIS_OP_MD = 1<<2, /* Disable Operation Mode */ + MFF_RST_CLR = 1<<1, /* Clear MAC FIFO Reset */ + MFF_RST_SET = 1<<0, /* Set MAC FIFO Reset */ +}; + + +/* Link LED Counter Registers (GENESIS only) */ + +/* RX_LED_CTRL 8 bit Receive LED Cnt Control Reg */ +/* TX_LED_CTRL 8 bit Transmit LED Cnt Control Reg */ +/* LNK_SYNC_CTRL 8 bit Link Sync Cnt Control Register */ +enum { + LED_START = 1<<2, /* Start Timer */ + LED_STOP = 1<<1, /* Stop Timer */ + LED_STATE = 1<<0, /* Rx/Tx: LED State, 1=LED on */ +}; + +/* RX_LED_TST 8 bit Receive LED Cnt Test Register */ +/* TX_LED_TST 8 bit Transmit LED Cnt Test Register */ +/* LNK_SYNC_TST 8 bit Link Sync Cnt Test Register */ +enum { + LED_T_ON = 1<<2, /* LED Counter Test mode On */ + LED_T_OFF = 1<<1, /* LED Counter Test mode Off */ + LED_T_STEP = 1<<0, /* LED Counter Step */ +}; + +/* LNK_LED_REG 8 bit Link LED Register */ +enum { + LED_BLK_ON = 1<<5, /* Link LED Blinking On */ + LED_BLK_OFF = 1<<4, /* Link LED Blinking Off */ + LED_SYNC_ON = 1<<3, /* Use Sync Wire to switch LED */ + LED_SYNC_OFF = 1<<2, /* Disable Sync Wire Input */ + LED_ON = 1<<1, /* switch LED on */ + LED_OFF = 1<<0, /* switch LED off */ +}; + +/* Receive GMAC FIFO (YUKON and Yukon-2) */ +enum { + RX_GMF_EA = 0x0c40,/* 32 bit Rx GMAC FIFO End Address */ + RX_GMF_AF_THR = 0x0c44,/* 32 bit Rx GMAC FIFO Almost Full Thresh. */ + RX_GMF_CTRL_T = 0x0c48,/* 32 bit Rx GMAC FIFO Control/Test */ + RX_GMF_FL_MSK = 0x0c4c,/* 32 bit Rx GMAC FIFO Flush Mask */ + RX_GMF_FL_THR = 0x0c50,/* 32 bit Rx GMAC FIFO Flush Threshold */ + RX_GMF_TR_THR = 0x0c54,/* 32 bit Rx Truncation Threshold (Yukon-2) */ + + RX_GMF_VLAN = 0x0c5c,/* 32 bit Rx VLAN Type Register (Yukon-2) */ + RX_GMF_WP = 0x0c60,/* 32 bit Rx GMAC FIFO Write Pointer */ + + RX_GMF_WLEV = 0x0c68,/* 32 bit Rx GMAC FIFO Write Level */ + + RX_GMF_RP = 0x0c70,/* 32 bit Rx GMAC FIFO Read Pointer */ + + RX_GMF_RLEV = 0x0c78,/* 32 bit Rx GMAC FIFO Read Level */ +}; + + +/* TXA_TEST 8 bit Tx Arbiter Test Register */ +enum { + TXA_INT_T_ON = 1<<5, /* Tx Arb Interval Timer Test On */ + TXA_INT_T_OFF = 1<<4, /* Tx Arb Interval Timer Test Off */ + TXA_INT_T_STEP = 1<<3, /* Tx Arb Interval Timer Step */ + TXA_LIM_T_ON = 1<<2, /* Tx Arb Limit Timer Test On */ + TXA_LIM_T_OFF = 1<<1, /* Tx Arb Limit Timer Test Off */ + TXA_LIM_T_STEP = 1<<0, /* Tx Arb Limit Timer Step */ +}; + +/* TXA_STAT 8 bit Tx Arbiter Status Register */ +enum { + TXA_PRIO_XS = 1<<0, /* sync queue has prio to send */ +}; + + +/* Q_BC 32 bit Current Byte Counter */ + +/* BMU Control Status Registers */ +/* B0_R1_CSR 32 bit BMU Ctrl/Stat Rx Queue 1 */ +/* B0_R2_CSR 32 bit BMU Ctrl/Stat Rx Queue 2 */ +/* B0_XA1_CSR 32 bit BMU Ctrl/Stat Sync Tx Queue 1 */ +/* B0_XS1_CSR 32 bit BMU Ctrl/Stat Async Tx Queue 1 */ +/* B0_XA2_CSR 32 bit BMU Ctrl/Stat Sync Tx Queue 2 */ +/* B0_XS2_CSR 32 bit BMU Ctrl/Stat Async Tx Queue 2 */ +/* Q_CSR 32 bit BMU Control/Status Register */ + +enum { + CSR_SV_IDLE = 1<<24, /* BMU SM Idle */ + + CSR_DESC_CLR = 1<<21, /* Clear Reset for Descr */ + CSR_DESC_SET = 1<<20, /* Set Reset for Descr */ + CSR_FIFO_CLR = 1<<19, /* Clear Reset for FIFO */ + CSR_FIFO_SET = 1<<18, /* Set Reset for FIFO */ + CSR_HPI_RUN = 1<<17, /* Release HPI SM */ + CSR_HPI_RST = 1<<16, /* Reset HPI SM to Idle */ + CSR_SV_RUN = 1<<15, /* Release Supervisor SM */ + CSR_SV_RST = 1<<14, /* Reset Supervisor SM */ + CSR_DREAD_RUN = 1<<13, /* Release Descr Read SM */ + CSR_DREAD_RST = 1<<12, /* Reset Descr Read SM */ + CSR_DWRITE_RUN = 1<<11, /* Release Descr Write SM */ + CSR_DWRITE_RST = 1<<10, /* Reset Descr Write SM */ + CSR_TRANS_RUN = 1<<9, /* Release Transfer SM */ + CSR_TRANS_RST = 1<<8, /* Reset Transfer SM */ + CSR_ENA_POL = 1<<7, /* Enable Descr Polling */ + CSR_DIS_POL = 1<<6, /* Disable Descr Polling */ + CSR_STOP = 1<<5, /* Stop Rx/Tx Queue */ + CSR_START = 1<<4, /* Start Rx/Tx Queue */ + CSR_IRQ_CL_P = 1<<3, /* (Rx) Clear Parity IRQ */ + CSR_IRQ_CL_B = 1<<2, /* Clear EOB IRQ */ + CSR_IRQ_CL_F = 1<<1, /* Clear EOF IRQ */ + CSR_IRQ_CL_C = 1<<0, /* Clear ERR IRQ */ +}; + +#define CSR_SET_RESET (CSR_DESC_SET | CSR_FIFO_SET | CSR_HPI_RST |\ + CSR_SV_RST | CSR_DREAD_RST | CSR_DWRITE_RST |\ + CSR_TRANS_RST) +#define CSR_CLR_RESET (CSR_DESC_CLR | CSR_FIFO_CLR | CSR_HPI_RUN |\ + CSR_SV_RUN | CSR_DREAD_RUN | CSR_DWRITE_RUN |\ + CSR_TRANS_RUN) + +/* Q_F 32 bit Flag Register */ +enum { + F_ALM_FULL = 1<<27, /* Rx FIFO: almost full */ + F_EMPTY = 1<<27, /* Tx FIFO: empty flag */ + F_FIFO_EOF = 1<<26, /* Tag (EOF Flag) bit in FIFO */ + F_WM_REACHED = 1<<25, /* Watermark reached */ + + F_FIFO_LEVEL = 0x1fL<<16, /* Bit 23..16: # of Qwords in FIFO */ + F_WATER_MARK = 0x0007ffL, /* Bit 10.. 0: Watermark */ +}; + +/* RAM Buffer Register Offsets, use RB_ADDR(Queue, Offs) to access */ +/* RB_START 32 bit RAM Buffer Start Address */ +/* RB_END 32 bit RAM Buffer End Address */ +/* RB_WP 32 bit RAM Buffer Write Pointer */ +/* RB_RP 32 bit RAM Buffer Read Pointer */ +/* RB_RX_UTPP 32 bit Rx Upper Threshold, Pause Pack */ +/* RB_RX_LTPP 32 bit Rx Lower Threshold, Pause Pack */ +/* RB_RX_UTHP 32 bit Rx Upper Threshold, High Prio */ +/* RB_RX_LTHP 32 bit Rx Lower Threshold, High Prio */ +/* RB_PC 32 bit RAM Buffer Packet Counter */ +/* RB_LEV 32 bit RAM Buffer Level Register */ + +#define RB_MSK 0x0007ffff /* Bit 18.. 0: RAM Buffer Pointer Bits */ +/* RB_TST2 8 bit RAM Buffer Test Register 2 */ +/* RB_TST1 8 bit RAM Buffer Test Register 1 */ + +/* RB_CTRL 8 bit RAM Buffer Control Register */ +enum { + RB_ENA_STFWD = 1<<5, /* Enable Store & Forward */ + RB_DIS_STFWD = 1<<4, /* Disable Store & Forward */ + RB_ENA_OP_MD = 1<<3, /* Enable Operation Mode */ + RB_DIS_OP_MD = 1<<2, /* Disable Operation Mode */ + RB_RST_CLR = 1<<1, /* Clear RAM Buf STM Reset */ + RB_RST_SET = 1<<0, /* Set RAM Buf STM Reset */ +}; + +/* Transmit MAC FIFO and Transmit LED Registers (GENESIS only), */ +enum { + TX_MFF_EA = 0x0d00,/* 32 bit Transmit MAC FIFO End Address */ + TX_MFF_WP = 0x0d04,/* 32 bit Transmit MAC FIFO WR Pointer */ + TX_MFF_WSP = 0x0d08,/* 32 bit Transmit MAC FIFO WR Shadow Ptr */ + TX_MFF_RP = 0x0d0c,/* 32 bit Transmit MAC FIFO RD Pointer */ + TX_MFF_PC = 0x0d10,/* 32 bit Transmit MAC FIFO Packet Cnt */ + TX_MFF_LEV = 0x0d14,/* 32 bit Transmit MAC FIFO Level */ + TX_MFF_CTRL1 = 0x0d18,/* 16 bit Transmit MAC FIFO Ctrl Reg 1 */ + TX_MFF_WAF = 0x0d1a,/* 8 bit Transmit MAC Wait after flush */ + + TX_MFF_CTRL2 = 0x0d1c,/* 8 bit Transmit MAC FIFO Ctrl Reg 2 */ + TX_MFF_TST1 = 0x0d1d,/* 8 bit Transmit MAC FIFO Test Reg 1 */ + TX_MFF_TST2 = 0x0d1e,/* 8 bit Transmit MAC FIFO Test Reg 2 */ + + TX_LED_INI = 0x0d20,/* 32 bit Transmit LED Cnt Init Value */ + TX_LED_VAL = 0x0d24,/* 32 bit Transmit LED Cnt Current Val */ + TX_LED_CTRL = 0x0d28,/* 8 bit Transmit LED Cnt Control Reg */ + TX_LED_TST = 0x0d29,/* 8 bit Transmit LED Cnt Test Reg */ +}; + +/* Counter and Timer constants, for a host clock of 62.5 MHz */ +#define SK_XMIT_DUR 0x002faf08UL /* 50 ms */ +#define SK_BLK_DUR 0x01dcd650UL /* 500 ms */ + +#define SK_DPOLL_DEF 0x00ee6b28UL /* 250 ms at 62.5 MHz */ + +#define SK_DPOLL_MAX 0x00ffffffUL /* 268 ms at 62.5 MHz */ + /* 215 ms at 78.12 MHz */ + +#define SK_FACT_62 100 /* is given in percent */ +#define SK_FACT_53 85 /* on GENESIS: 53.12 MHz */ +#define SK_FACT_78 125 /* on YUKON: 78.12 MHz */ + + +/* Transmit GMAC FIFO (YUKON only) */ +enum { + TX_GMF_EA = 0x0d40,/* 32 bit Tx GMAC FIFO End Address */ + TX_GMF_AE_THR = 0x0d44,/* 32 bit Tx GMAC FIFO Almost Empty Thresh.*/ + TX_GMF_CTRL_T = 0x0d48,/* 32 bit Tx GMAC FIFO Control/Test */ + + TX_GMF_WP = 0x0d60,/* 32 bit Tx GMAC FIFO Write Pointer */ + TX_GMF_WSP = 0x0d64,/* 32 bit Tx GMAC FIFO Write Shadow Ptr. */ + TX_GMF_WLEV = 0x0d68,/* 32 bit Tx GMAC FIFO Write Level */ + + TX_GMF_RP = 0x0d70,/* 32 bit Tx GMAC FIFO Read Pointer */ + TX_GMF_RSTP = 0x0d74,/* 32 bit Tx GMAC FIFO Restart Pointer */ + TX_GMF_RLEV = 0x0d78,/* 32 bit Tx GMAC FIFO Read Level */ + + /* Descriptor Poll Timer Registers */ + B28_DPT_INI = 0x0e00,/* 24 bit Descriptor Poll Timer Init Val */ + B28_DPT_VAL = 0x0e04,/* 24 bit Descriptor Poll Timer Curr Val */ + B28_DPT_CTRL = 0x0e08,/* 8 bit Descriptor Poll Timer Ctrl Reg */ + + B28_DPT_TST = 0x0e0a,/* 8 bit Descriptor Poll Timer Test Reg */ + + /* Time Stamp Timer Registers (YUKON only) */ + GMAC_TI_ST_VAL = 0x0e14,/* 32 bit Time Stamp Timer Curr Val */ + GMAC_TI_ST_CTRL = 0x0e18,/* 8 bit Time Stamp Timer Ctrl Reg */ + GMAC_TI_ST_TST = 0x0e1a,/* 8 bit Time Stamp Timer Test Reg */ +}; + +/* Status BMU Registers (Yukon-2 only)*/ +enum { + STAT_CTRL = 0x0e80,/* 32 bit Status BMU Control Reg */ + STAT_LAST_IDX = 0x0e84,/* 16 bit Status BMU Last Index */ + /* 0x0e85 - 0x0e86: reserved */ + STAT_LIST_ADDR_LO = 0x0e88,/* 32 bit Status List Start Addr (low) */ + STAT_LIST_ADDR_HI = 0x0e8c,/* 32 bit Status List Start Addr (high) */ + STAT_TXA1_RIDX = 0x0e90,/* 16 bit Status TxA1 Report Index Reg */ + STAT_TXS1_RIDX = 0x0e92,/* 16 bit Status TxS1 Report Index Reg */ + STAT_TXA2_RIDX = 0x0e94,/* 16 bit Status TxA2 Report Index Reg */ + STAT_TXS2_RIDX = 0x0e96,/* 16 bit Status TxS2 Report Index Reg */ + STAT_TX_IDX_TH = 0x0e98,/* 16 bit Status Tx Index Threshold Reg */ + STAT_PUT_IDX = 0x0e9c,/* 16 bit Status Put Index Reg */ + +/* FIFO Control/Status Registers (Yukon-2 only)*/ + STAT_FIFO_WP = 0x0ea0,/* 8 bit Status FIFO Write Pointer Reg */ + STAT_FIFO_RP = 0x0ea4,/* 8 bit Status FIFO Read Pointer Reg */ + STAT_FIFO_RSP = 0x0ea6,/* 8 bit Status FIFO Read Shadow Ptr */ + STAT_FIFO_LEVEL = 0x0ea8,/* 8 bit Status FIFO Level Reg */ + STAT_FIFO_SHLVL = 0x0eaa,/* 8 bit Status FIFO Shadow Level Reg */ + STAT_FIFO_WM = 0x0eac,/* 8 bit Status FIFO Watermark Reg */ + STAT_FIFO_ISR_WM = 0x0ead,/* 8 bit Status FIFO ISR Watermark Reg */ + +/* Level and ISR Timer Registers (Yukon-2 only)*/ + STAT_LEV_TIMER_INI = 0x0eb0,/* 32 bit Level Timer Init. Value Reg */ + STAT_LEV_TIMER_CNT = 0x0eb4,/* 32 bit Level Timer Counter Reg */ + STAT_LEV_TIMER_CTRL = 0x0eb8,/* 8 bit Level Timer Control Reg */ + STAT_LEV_TIMER_TEST = 0x0eb9,/* 8 bit Level Timer Test Reg */ + STAT_TX_TIMER_INI = 0x0ec0,/* 32 bit Tx Timer Init. Value Reg */ + STAT_TX_TIMER_CNT = 0x0ec4,/* 32 bit Tx Timer Counter Reg */ + STAT_TX_TIMER_CTRL = 0x0ec8,/* 8 bit Tx Timer Control Reg */ + STAT_TX_TIMER_TEST = 0x0ec9,/* 8 bit Tx Timer Test Reg */ + STAT_ISR_TIMER_INI = 0x0ed0,/* 32 bit ISR Timer Init. Value Reg */ + STAT_ISR_TIMER_CNT = 0x0ed4,/* 32 bit ISR Timer Counter Reg */ + STAT_ISR_TIMER_CTRL = 0x0ed8,/* 8 bit ISR Timer Control Reg */ + STAT_ISR_TIMER_TEST = 0x0ed9,/* 8 bit ISR Timer Test Reg */ + + ST_LAST_IDX_MASK = 0x007f,/* Last Index Mask */ + ST_TXRP_IDX_MASK = 0x0fff,/* Tx Report Index Mask */ + ST_TXTH_IDX_MASK = 0x0fff,/* Tx Threshold Index Mask */ + ST_WM_IDX_MASK = 0x3f,/* FIFO Watermark Index Mask */ +}; + +enum { + LINKLED_OFF = 0x01, + LINKLED_ON = 0x02, + LINKLED_LINKSYNC_OFF = 0x04, + LINKLED_LINKSYNC_ON = 0x08, + LINKLED_BLINK_OFF = 0x10, + LINKLED_BLINK_ON = 0x20, +}; + +/* GMAC and GPHY Control Registers (YUKON only) */ +enum { + GMAC_CTRL = 0x0f00,/* 32 bit GMAC Control Reg */ + GPHY_CTRL = 0x0f04,/* 32 bit GPHY Control Reg */ + GMAC_IRQ_SRC = 0x0f08,/* 8 bit GMAC Interrupt Source Reg */ + GMAC_IRQ_MSK = 0x0f0c,/* 8 bit GMAC Interrupt Mask Reg */ + GMAC_LINK_CTRL = 0x0f10,/* 16 bit Link Control Reg */ + +/* Wake-up Frame Pattern Match Control Registers (YUKON only) */ + + WOL_REG_OFFS = 0x20,/* HW-Bug: Address is + 0x20 against spec. */ + + WOL_CTRL_STAT = 0x0f20,/* 16 bit WOL Control/Status Reg */ + WOL_MATCH_CTL = 0x0f22,/* 8 bit WOL Match Control Reg */ + WOL_MATCH_RES = 0x0f23,/* 8 bit WOL Match Result Reg */ + WOL_MAC_ADDR_LO = 0x0f24,/* 32 bit WOL MAC Address Low */ + WOL_MAC_ADDR_HI = 0x0f28,/* 16 bit WOL MAC Address High */ + WOL_PATT_PME = 0x0f2a,/* 8 bit WOL PME Match Enable (Yukon-2) */ + WOL_PATT_ASFM = 0x0f2b,/* 8 bit WOL ASF Match Enable (Yukon-2) */ + WOL_PATT_RPTR = 0x0f2c,/* 8 bit WOL Pattern Read Pointer */ + +/* WOL Pattern Length Registers (YUKON only) */ + + WOL_PATT_LEN_LO = 0x0f30,/* 32 bit WOL Pattern Length 3..0 */ + WOL_PATT_LEN_HI = 0x0f34,/* 24 bit WOL Pattern Length 6..4 */ + +/* WOL Pattern Counter Registers (YUKON only) */ + + WOL_PATT_CNT_0 = 0x0f38,/* 32 bit WOL Pattern Counter 3..0 */ + WOL_PATT_CNT_4 = 0x0f3c,/* 24 bit WOL Pattern Counter 6..4 */ +}; + +enum { + WOL_PATT_RAM_1 = 0x1000,/* WOL Pattern RAM Link 1 */ + WOL_PATT_RAM_2 = 0x1400,/* WOL Pattern RAM Link 2 */ +}; + +enum { + BASE_XMAC_1 = 0x2000,/* XMAC 1 registers */ + BASE_GMAC_1 = 0x2800,/* GMAC 1 registers */ + BASE_XMAC_2 = 0x3000,/* XMAC 2 registers */ + BASE_GMAC_2 = 0x3800,/* GMAC 2 registers */ +}; + +/* + * Receive Frame Status Encoding + */ +enum { + XMR_FS_LEN = 0x3fff<<18, /* Bit 31..18: Rx Frame Length */ + XMR_FS_2L_VLAN = 1<<17, /* Bit 17: tagged wh 2Lev VLAN ID*/ + XMR_FS_1_VLAN = 1<<16, /* Bit 16: tagged wh 1ev VLAN ID*/ + XMR_FS_BC = 1<<15, /* Bit 15: Broadcast Frame */ + XMR_FS_MC = 1<<14, /* Bit 14: Multicast Frame */ + XMR_FS_UC = 1<<13, /* Bit 13: Unicast Frame */ + + XMR_FS_BURST = 1<<11, /* Bit 11: Burst Mode */ + XMR_FS_CEX_ERR = 1<<10, /* Bit 10: Carrier Ext. Error */ + XMR_FS_802_3 = 1<<9, /* Bit 9: 802.3 Frame */ + XMR_FS_COL_ERR = 1<<8, /* Bit 8: Collision Error */ + XMR_FS_CAR_ERR = 1<<7, /* Bit 7: Carrier Event Error */ + XMR_FS_LEN_ERR = 1<<6, /* Bit 6: In-Range Length Error */ + XMR_FS_FRA_ERR = 1<<5, /* Bit 5: Framing Error */ + XMR_FS_RUNT = 1<<4, /* Bit 4: Runt Frame */ + XMR_FS_LNG_ERR = 1<<3, /* Bit 3: Giant (Jumbo) Frame */ + XMR_FS_FCS_ERR = 1<<2, /* Bit 2: Frame Check Sequ Err */ + XMR_FS_ERR = 1<<1, /* Bit 1: Frame Error */ + XMR_FS_MCTRL = 1<<0, /* Bit 0: MAC Control Packet */ + +/* + * XMR_FS_ERR will be set if + * XMR_FS_FCS_ERR, XMR_FS_LNG_ERR, XMR_FS_RUNT, + * XMR_FS_FRA_ERR, XMR_FS_LEN_ERR, or XMR_FS_CEX_ERR + * is set. XMR_FS_LNG_ERR and XMR_FS_LEN_ERR will issue + * XMR_FS_ERR unless the corresponding bit in the Receive Command + * Register is set. + */ +}; + +/* +,* XMAC-PHY Registers, indirect addressed over the XMAC + */ +enum { + PHY_XMAC_CTRL = 0x00,/* 16 bit r/w PHY Control Register */ + PHY_XMAC_STAT = 0x01,/* 16 bit r/w PHY Status Register */ + PHY_XMAC_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */ + PHY_XMAC_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */ + PHY_XMAC_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */ + PHY_XMAC_AUNE_LP = 0x05,/* 16 bit r/o Link Partner Abi Reg */ + PHY_XMAC_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */ + PHY_XMAC_NEPG = 0x07,/* 16 bit r/w Next Page Register */ + PHY_XMAC_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner */ + + PHY_XMAC_EXT_STAT = 0x0f,/* 16 bit r/o Ext Status Register */ + PHY_XMAC_RES_ABI = 0x10,/* 16 bit r/o PHY Resolved Ability */ +}; +/* + * Broadcom-PHY Registers, indirect addressed over XMAC + */ +enum { + PHY_BCOM_CTRL = 0x00,/* 16 bit r/w PHY Control Register */ + PHY_BCOM_STAT = 0x01,/* 16 bit r/o PHY Status Register */ + PHY_BCOM_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */ + PHY_BCOM_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */ + PHY_BCOM_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */ + PHY_BCOM_AUNE_LP = 0x05,/* 16 bit r/o Link Part Ability Reg */ + PHY_BCOM_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */ + PHY_BCOM_NEPG = 0x07,/* 16 bit r/w Next Page Register */ + PHY_BCOM_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner */ + /* Broadcom-specific registers */ + PHY_BCOM_1000T_CTRL = 0x09,/* 16 bit r/w 1000Base-T Control Reg */ + PHY_BCOM_1000T_STAT = 0x0a,/* 16 bit r/o 1000Base-T Status Reg */ + PHY_BCOM_EXT_STAT = 0x0f,/* 16 bit r/o Extended Status Reg */ + PHY_BCOM_P_EXT_CTRL = 0x10,/* 16 bit r/w PHY Extended Ctrl Reg */ + PHY_BCOM_P_EXT_STAT = 0x11,/* 16 bit r/o PHY Extended Stat Reg */ + PHY_BCOM_RE_CTR = 0x12,/* 16 bit r/w Receive Error Counter */ + PHY_BCOM_FC_CTR = 0x13,/* 16 bit r/w False Carrier Sense Cnt */ + PHY_BCOM_RNO_CTR = 0x14,/* 16 bit r/w Receiver NOT_OK Cnt */ + + PHY_BCOM_AUX_CTRL = 0x18,/* 16 bit r/w Auxiliary Control Reg */ + PHY_BCOM_AUX_STAT = 0x19,/* 16 bit r/o Auxiliary Stat Summary */ + PHY_BCOM_INT_STAT = 0x1a,/* 16 bit r/o Interrupt Status Reg */ + PHY_BCOM_INT_MASK = 0x1b,/* 16 bit r/w Interrupt Mask Reg */ +}; + +/* + * Marvel-PHY Registers, indirect addressed over GMAC + */ +enum { + PHY_MARV_CTRL = 0x00,/* 16 bit r/w PHY Control Register */ + PHY_MARV_STAT = 0x01,/* 16 bit r/o PHY Status Register */ + PHY_MARV_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */ + PHY_MARV_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */ + PHY_MARV_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */ + PHY_MARV_AUNE_LP = 0x05,/* 16 bit r/o Link Part Ability Reg */ + PHY_MARV_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */ + PHY_MARV_NEPG = 0x07,/* 16 bit r/w Next Page Register */ + PHY_MARV_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner */ + /* Marvel-specific registers */ + PHY_MARV_1000T_CTRL = 0x09,/* 16 bit r/w 1000Base-T Control Reg */ + PHY_MARV_1000T_STAT = 0x0a,/* 16 bit r/o 1000Base-T Status Reg */ + PHY_MARV_EXT_STAT = 0x0f,/* 16 bit r/o Extended Status Reg */ + PHY_MARV_PHY_CTRL = 0x10,/* 16 bit r/w PHY Specific Ctrl Reg */ + PHY_MARV_PHY_STAT = 0x11,/* 16 bit r/o PHY Specific Stat Reg */ + PHY_MARV_INT_MASK = 0x12,/* 16 bit r/w Interrupt Mask Reg */ + PHY_MARV_INT_STAT = 0x13,/* 16 bit r/o Interrupt Status Reg */ + PHY_MARV_EXT_CTRL = 0x14,/* 16 bit r/w Ext. PHY Specific Ctrl */ + PHY_MARV_RXE_CNT = 0x15,/* 16 bit r/w Receive Error Counter */ + PHY_MARV_EXT_ADR = 0x16,/* 16 bit r/w Ext. Ad. for Cable Diag. */ + PHY_MARV_PORT_IRQ = 0x17,/* 16 bit r/o Port 0 IRQ (88E1111 only) */ + PHY_MARV_LED_CTRL = 0x18,/* 16 bit r/w LED Control Reg */ + PHY_MARV_LED_OVER = 0x19,/* 16 bit r/w Manual LED Override Reg */ + PHY_MARV_EXT_CTRL_2 = 0x1a,/* 16 bit r/w Ext. PHY Specific Ctrl 2 */ + PHY_MARV_EXT_P_STAT = 0x1b,/* 16 bit r/w Ext. PHY Spec. Stat Reg */ + PHY_MARV_CABLE_DIAG = 0x1c,/* 16 bit r/o Cable Diagnostic Reg */ + PHY_MARV_PAGE_ADDR = 0x1d,/* 16 bit r/w Extended Page Address Reg */ + PHY_MARV_PAGE_DATA = 0x1e,/* 16 bit r/w Extended Page Data Reg */ + +/* for 10/100 Fast Ethernet PHY (88E3082 only) */ + PHY_MARV_FE_LED_PAR = 0x16,/* 16 bit r/w LED Parallel Select Reg. */ + PHY_MARV_FE_LED_SER = 0x17,/* 16 bit r/w LED Stream Select S. LED */ + PHY_MARV_FE_VCT_TX = 0x1a,/* 16 bit r/w VCT Reg. for TXP/N Pins */ + PHY_MARV_FE_VCT_RX = 0x1b,/* 16 bit r/o VCT Reg. for RXP/N Pins */ + PHY_MARV_FE_SPEC_2 = 0x1c,/* 16 bit r/w Specific Control Reg. 2 */ +}; + +/* Level One-PHY Registers, indirect addressed over XMAC */ +enum { + PHY_LONE_CTRL = 0x00,/* 16 bit r/w PHY Control Register */ + PHY_LONE_STAT = 0x01,/* 16 bit r/o PHY Status Register */ + PHY_LONE_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */ + PHY_LONE_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */ + PHY_LONE_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */ + PHY_LONE_AUNE_LP = 0x05,/* 16 bit r/o Link Part Ability Reg */ + PHY_LONE_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */ + PHY_LONE_NEPG = 0x07,/* 16 bit r/w Next Page Register */ + PHY_LONE_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner */ + /* Level One-specific registers */ + PHY_LONE_1000T_CTRL = 0x09,/* 16 bit r/w 1000Base-T Control Reg */ + PHY_LONE_1000T_STAT = 0x0a,/* 16 bit r/o 1000Base-T Status Reg */ + PHY_LONE_EXT_STAT = 0x0f,/* 16 bit r/o Extended Status Reg */ + PHY_LONE_PORT_CFG = 0x10,/* 16 bit r/w Port Configuration Reg*/ + PHY_LONE_Q_STAT = 0x11,/* 16 bit r/o Quick Status Reg */ + PHY_LONE_INT_ENAB = 0x12,/* 16 bit r/w Interrupt Enable Reg */ + PHY_LONE_INT_STAT = 0x13,/* 16 bit r/o Interrupt Status Reg */ + PHY_LONE_LED_CFG = 0x14,/* 16 bit r/w LED Configuration Reg */ + PHY_LONE_PORT_CTRL = 0x15,/* 16 bit r/w Port Control Reg */ + PHY_LONE_CIM = 0x16,/* 16 bit r/o CIM Reg */ +}; + +/* National-PHY Registers, indirect addressed over XMAC */ +enum { + PHY_NAT_CTRL = 0x00,/* 16 bit r/w PHY Control Register */ + PHY_NAT_STAT = 0x01,/* 16 bit r/w PHY Status Register */ + PHY_NAT_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */ + PHY_NAT_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */ + PHY_NAT_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */ + PHY_NAT_AUNE_LP = 0x05,/* 16 bit r/o Link Partner Ability Reg */ + PHY_NAT_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */ + PHY_NAT_NEPG = 0x07,/* 16 bit r/w Next Page Register */ + PHY_NAT_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner Reg */ + /* National-specific registers */ + PHY_NAT_1000T_CTRL = 0x09,/* 16 bit r/w 1000Base-T Control Reg */ + PHY_NAT_1000T_STAT = 0x0a,/* 16 bit r/o 1000Base-T Status Reg */ + PHY_NAT_EXT_STAT = 0x0f,/* 16 bit r/o Extended Status Register */ + PHY_NAT_EXT_CTRL1 = 0x10,/* 16 bit r/o Extended Control Reg1 */ + PHY_NAT_Q_STAT1 = 0x11,/* 16 bit r/o Quick Status Reg1 */ + PHY_NAT_10B_OP = 0x12,/* 16 bit r/o 10Base-T Operations Reg */ + PHY_NAT_EXT_CTRL2 = 0x13,/* 16 bit r/o Extended Control Reg1 */ + PHY_NAT_Q_STAT2 = 0x14,/* 16 bit r/o Quick Status Reg2 */ + + PHY_NAT_PHY_ADDR = 0x19,/* 16 bit r/o PHY Address Register */ +}; + +enum { + PHY_CT_RESET = 1<<15, /* Bit 15: (sc) clear all PHY related regs */ + PHY_CT_LOOP = 1<<14, /* Bit 14: enable Loopback over PHY */ + PHY_CT_SPS_LSB = 1<<13, /* Bit 13: Speed select, lower bit */ + PHY_CT_ANE = 1<<12, /* Bit 12: Auto-Negotiation Enabled */ + PHY_CT_PDOWN = 1<<11, /* Bit 11: Power Down Mode */ + PHY_CT_ISOL = 1<<10, /* Bit 10: Isolate Mode */ + PHY_CT_RE_CFG = 1<<9, /* Bit 9: (sc) Restart Auto-Negotiation */ + PHY_CT_DUP_MD = 1<<8, /* Bit 8: Duplex Mode */ + PHY_CT_COL_TST = 1<<7, /* Bit 7: Collision Test enabled */ + PHY_CT_SPS_MSB = 1<<6, /* Bit 6: Speed select, upper bit */ +}; + +enum { + PHY_CT_SP1000 = PHY_CT_SPS_MSB, /* enable speed of 1000 Mbps */ + PHY_CT_SP100 = PHY_CT_SPS_LSB, /* enable speed of 100 Mbps */ + PHY_CT_SP10 = 0, /* enable speed of 10 Mbps */ +}; + +enum { + PHY_ST_EXT_ST = 1<<8, /* Bit 8: Extended Status Present */ + + PHY_ST_PRE_SUP = 1<<6, /* Bit 6: Preamble Suppression */ + PHY_ST_AN_OVER = 1<<5, /* Bit 5: Auto-Negotiation Over */ + PHY_ST_REM_FLT = 1<<4, /* Bit 4: Remote Fault Condition Occured */ + PHY_ST_AN_CAP = 1<<3, /* Bit 3: Auto-Negotiation Capability */ + PHY_ST_LSYNC = 1<<2, /* Bit 2: Link Synchronized */ + PHY_ST_JAB_DET = 1<<1, /* Bit 1: Jabber Detected */ + PHY_ST_EXT_REG = 1<<0, /* Bit 0: Extended Register available */ +}; + +enum { + PHY_I1_OUI_MSK = 0x3f<<10, /* Bit 15..10: Organization Unique ID */ + PHY_I1_MOD_NUM = 0x3f<<4, /* Bit 9.. 4: Model Number */ + PHY_I1_REV_MSK = 0xf, /* Bit 3.. 0: Revision Number */ +}; + +/* different Broadcom PHY Ids */ +enum { + PHY_BCOM_ID1_A1 = 0x6041, + PHY_BCOM_ID1_B2 = 0x6043, + PHY_BCOM_ID1_C0 = 0x6044, + PHY_BCOM_ID1_C5 = 0x6047, +}; + +/* different Marvell PHY Ids */ +enum { + PHY_MARV_ID0_VAL= 0x0141, /* Marvell Unique Identifier */ + PHY_MARV_ID1_B0 = 0x0C23, /* Yukon (PHY 88E1011) */ + PHY_MARV_ID1_B2 = 0x0C25, /* Yukon-Plus (PHY 88E1011) */ + PHY_MARV_ID1_C2 = 0x0CC2, /* Yukon-EC (PHY 88E1111) */ + PHY_MARV_ID1_Y2 = 0x0C91, /* Yukon-2 (PHY 88E1112) */ +}; + +enum { + PHY_AN_NXT_PG = 1<<15, /* Bit 15: Request Next Page */ + PHY_X_AN_ACK = 1<<14, /* Bit 14: (ro) Acknowledge Received */ + PHY_X_AN_RFB = 3<<12,/* Bit 13..12: Remote Fault Bits */ + + PHY_X_AN_PAUSE = 3<<7,/* Bit 8.. 7: Pause Bits */ + PHY_X_AN_HD = 1<<6, /* Bit 6: Half Duplex */ + PHY_X_AN_FD = 1<<5, /* Bit 5: Full Duplex */ +}; + +enum { + PHY_B_AN_RF = 1<<13, /* Bit 13: Remote Fault */ + + PHY_B_AN_ASP = 1<<11, /* Bit 11: Asymmetric Pause */ + PHY_B_AN_PC = 1<<10, /* Bit 10: Pause Capable */ + PHY_B_AN_SEL = 0x1f, /* Bit 4..0: Selector Field, 00001=Ethernet*/ +}; + +enum { + PHY_L_AN_RF = 1<<13, /* Bit 13: Remote Fault */ + /* Bit 12: reserved */ + PHY_L_AN_ASP = 1<<11, /* Bit 11: Asymmetric Pause */ + PHY_L_AN_PC = 1<<10, /* Bit 10: Pause Capable */ + + PHY_L_AN_SEL = 0x1f, /* Bit 4..0: Selector Field, 00001=Ethernet*/ +}; + +/* PHY_NAT_AUNE_ADV 16 bit r/w Auto-Negotiation Advertisement */ +/* PHY_NAT_AUNE_LP 16 bit r/o Link Partner Ability Reg *****/ +/* PHY_AN_NXT_PG (see XMAC) Bit 15: Request Next Page */ +enum { + PHY_N_AN_RF = 1<<13, /* Bit 13: Remote Fault */ + + PHY_N_AN_100F = 1<<11, /* Bit 11: 100Base-T2 FD Support */ + PHY_N_AN_100H = 1<<10, /* Bit 10: 100Base-T2 HD Support */ + + PHY_N_AN_SEL = 0x1f, /* Bit 4..0: Selector Field, 00001=Ethernet*/ +}; + +/* field type definition for PHY_x_AN_SEL */ +enum { + PHY_SEL_TYPE = 1, /* 00001 = Ethernet */ +}; + +enum { + PHY_ANE_LP_NP = 1<<3, /* Bit 3: Link Partner can Next Page */ + PHY_ANE_LOC_NP = 1<<2, /* Bit 2: Local PHY can Next Page */ + PHY_ANE_RX_PG = 1<<1, /* Bit 1: Page Received */ +}; + +enum { + PHY_ANE_PAR_DF = 1<<4, /* Bit 4: Parallel Detection Fault */ + + PHY_ANE_LP_CAP = 1<<0, /* Bit 0: Link Partner Auto-Neg. Cap. */ +}; + +enum { + PHY_NP_MORE = 1<<15, /* Bit 15: More, Next Pages to follow */ + PHY_NP_ACK1 = 1<<14, /* Bit 14: (ro) Ack1, for receiving a message */ + PHY_NP_MSG_VAL = 1<<13, /* Bit 13: Message Page valid */ + PHY_NP_ACK2 = 1<<12, /* Bit 12: Ack2, comply with msg content */ + PHY_NP_TOG = 1<<11, /* Bit 11: Toggle Bit, ensure sync */ + PHY_NP_MSG = 0x07ff, /* Bit 10..0: Message from/to Link Partner */ +}; + +enum { + PHY_X_EX_FD = 1<<15, /* Bit 15: Device Supports Full Duplex */ + PHY_X_EX_HD = 1<<14, /* Bit 14: Device Supports Half Duplex */ +}; + +enum { + PHY_X_RS_PAUSE = 3<<7,/* Bit 8..7: selected Pause Mode */ + PHY_X_RS_HD = 1<<6, /* Bit 6: Half Duplex Mode selected */ + PHY_X_RS_FD = 1<<5, /* Bit 5: Full Duplex Mode selected */ + PHY_X_RS_ABLMIS = 1<<4, /* Bit 4: duplex or pause cap mismatch */ + PHY_X_RS_PAUMIS = 1<<3, /* Bit 3: pause capability mismatch */ +}; + +/** Remote Fault Bits (PHY_X_AN_RFB) encoding */ +enum { + X_RFB_OK = 0<<12,/* Bit 13..12 No errors, Link OK */ + X_RFB_LF = 1<<12, /* Bit 13..12 Link Failure */ + X_RFB_OFF = 2<<12,/* Bit 13..12 Offline */ + X_RFB_AN_ERR = 3<<12,/* Bit 13..12 Auto-Negotiation Error */ +}; + +/* Pause Bits (PHY_X_AN_PAUSE and PHY_X_RS_PAUSE) encoding */ +enum { + PHY_X_P_NO_PAUSE = 0<<7,/* Bit 8..7: no Pause Mode */ + PHY_X_P_SYM_MD = 1<<7, /* Bit 8..7: symmetric Pause Mode */ + PHY_X_P_ASYM_MD = 2<<7,/* Bit 8..7: asymmetric Pause Mode */ + PHY_X_P_BOTH_MD = 3<<7,/* Bit 8..7: both Pause Mode */ +}; + + +/* Broadcom-Specific */ +/***** PHY_BCOM_1000T_CTRL 16 bit r/w 1000Base-T Control Reg *****/ +enum { + PHY_B_1000C_TEST = 7<<13,/* Bit 15..13: Test Modes */ + PHY_B_1000C_MSE = 1<<12, /* Bit 12: Master/Slave Enable */ + PHY_B_1000C_MSC = 1<<11, /* Bit 11: M/S Configuration */ + PHY_B_1000C_RD = 1<<10, /* Bit 10: Repeater/DTE */ + PHY_B_1000C_AFD = 1<<9, /* Bit 9: Advertise Full Duplex */ + PHY_B_1000C_AHD = 1<<8, /* Bit 8: Advertise Half Duplex */ +}; + +/***** PHY_BCOM_1000T_STAT 16 bit r/o 1000Base-T Status Reg *****/ +/***** PHY_MARV_1000T_STAT 16 bit r/o 1000Base-T Status Reg *****/ +enum { + PHY_B_1000S_MSF = 1<<15, /* Bit 15: Master/Slave Fault */ + PHY_B_1000S_MSR = 1<<14, /* Bit 14: Master/Slave Result */ + PHY_B_1000S_LRS = 1<<13, /* Bit 13: Local Receiver Status */ + PHY_B_1000S_RRS = 1<<12, /* Bit 12: Remote Receiver Status */ + PHY_B_1000S_LP_FD = 1<<11, /* Bit 11: Link Partner can FD */ + PHY_B_1000S_LP_HD = 1<<10, /* Bit 10: Link Partner can HD */ + /* Bit 9..8: reserved */ + PHY_B_1000S_IEC = 0xff, /* Bit 7..0: Idle Error Count */ +}; + +/***** PHY_BCOM_EXT_STAT 16 bit r/o Extended Status Register *****/ +enum { + PHY_B_ES_X_FD_CAP = 1<<15, /* Bit 15: 1000Base-X FD capable */ + PHY_B_ES_X_HD_CAP = 1<<14, /* Bit 14: 1000Base-X HD capable */ + PHY_B_ES_T_FD_CAP = 1<<13, /* Bit 13: 1000Base-T FD capable */ + PHY_B_ES_T_HD_CAP = 1<<12, /* Bit 12: 1000Base-T HD capable */ +}; + +/***** PHY_BCOM_P_EXT_CTRL 16 bit r/w PHY Extended Control Reg *****/ +enum { + PHY_B_PEC_MAC_PHY = 1<<15, /* Bit 15: 10BIT/GMI-Interface */ + PHY_B_PEC_DIS_CROSS = 1<<14, /* Bit 14: Disable MDI Crossover */ + PHY_B_PEC_TX_DIS = 1<<13, /* Bit 13: Tx output Disabled */ + PHY_B_PEC_INT_DIS = 1<<12, /* Bit 12: Interrupts Disabled */ + PHY_B_PEC_F_INT = 1<<11, /* Bit 11: Force Interrupt */ + PHY_B_PEC_BY_45 = 1<<10, /* Bit 10: Bypass 4B5B-Decoder */ + PHY_B_PEC_BY_SCR = 1<<9, /* Bit 9: Bypass Scrambler */ + PHY_B_PEC_BY_MLT3 = 1<<8, /* Bit 8: Bypass MLT3 Encoder */ + PHY_B_PEC_BY_RXA = 1<<7, /* Bit 7: Bypass Rx Alignm. */ + PHY_B_PEC_RES_SCR = 1<<6, /* Bit 6: Reset Scrambler */ + PHY_B_PEC_EN_LTR = 1<<5, /* Bit 5: Ena LED Traffic Mode */ + PHY_B_PEC_LED_ON = 1<<4, /* Bit 4: Force LED's on */ + PHY_B_PEC_LED_OFF = 1<<3, /* Bit 3: Force LED's off */ + PHY_B_PEC_EX_IPG = 1<<2, /* Bit 2: Extend Tx IPG Mode */ + PHY_B_PEC_3_LED = 1<<1, /* Bit 1: Three Link LED mode */ + PHY_B_PEC_HIGH_LA = 1<<0, /* Bit 0: GMII FIFO Elasticy */ +}; + +/***** PHY_BCOM_P_EXT_STAT 16 bit r/o PHY Extended Status Reg *****/ +enum { + PHY_B_PES_CROSS_STAT = 1<<13, /* Bit 13: MDI Crossover Status */ + PHY_B_PES_INT_STAT = 1<<12, /* Bit 12: Interrupt Status */ + PHY_B_PES_RRS = 1<<11, /* Bit 11: Remote Receiver Stat. */ + PHY_B_PES_LRS = 1<<10, /* Bit 10: Local Receiver Stat. */ + PHY_B_PES_LOCKED = 1<<9, /* Bit 9: Locked */ + PHY_B_PES_LS = 1<<8, /* Bit 8: Link Status */ + PHY_B_PES_RF = 1<<7, /* Bit 7: Remote Fault */ + PHY_B_PES_CE_ER = 1<<6, /* Bit 6: Carrier Ext Error */ + PHY_B_PES_BAD_SSD = 1<<5, /* Bit 5: Bad SSD */ + PHY_B_PES_BAD_ESD = 1<<4, /* Bit 4: Bad ESD */ + PHY_B_PES_RX_ER = 1<<3, /* Bit 3: Receive Error */ + PHY_B_PES_TX_ER = 1<<2, /* Bit 2: Transmit Error */ + PHY_B_PES_LOCK_ER = 1<<1, /* Bit 1: Lock Error */ + PHY_B_PES_MLT3_ER = 1<<0, /* Bit 0: MLT3 code Error */ +}; + +/***** PHY_BCOM_FC_CTR 16 bit r/w False Carrier Counter *****/ +enum { + PHY_B_FC_CTR = 0xff, /* Bit 7..0: False Carrier Counter */ + +/***** PHY_BCOM_RNO_CTR 16 bit r/w Receive NOT_OK Counter *****/ + PHY_B_RC_LOC_MSK = 0xff00, /* Bit 15..8: Local Rx NOT_OK cnt */ + PHY_B_RC_REM_MSK = 0x00ff, /* Bit 7..0: Remote Rx NOT_OK cnt */ + +/***** PHY_BCOM_AUX_CTRL 16 bit r/w Auxiliary Control Reg *****/ + PHY_B_AC_L_SQE = 1<<15, /* Bit 15: Low Squelch */ + PHY_B_AC_LONG_PACK = 1<<14, /* Bit 14: Rx Long Packets */ + PHY_B_AC_ER_CTRL = 3<<12,/* Bit 13..12: Edgerate Control */ + /* Bit 11: reserved */ + PHY_B_AC_TX_TST = 1<<10, /* Bit 10: Tx test bit, always 1 */ + /* Bit 9.. 8: reserved */ + PHY_B_AC_DIS_PRF = 1<<7, /* Bit 7: dis part resp filter */ + /* Bit 6: reserved */ + PHY_B_AC_DIS_PM = 1<<5, /* Bit 5: dis power management */ + /* Bit 4: reserved */ + PHY_B_AC_DIAG = 1<<3, /* Bit 3: Diagnostic Mode */ +}; + +/***** PHY_BCOM_AUX_STAT 16 bit r/o Auxiliary Status Reg *****/ +enum { + PHY_B_AS_AN_C = 1<<15, /* Bit 15: AutoNeg complete */ + PHY_B_AS_AN_CA = 1<<14, /* Bit 14: AN Complete Ack */ + PHY_B_AS_ANACK_D = 1<<13, /* Bit 13: AN Ack Detect */ + PHY_B_AS_ANAB_D = 1<<12, /* Bit 12: AN Ability Detect */ + PHY_B_AS_NPW = 1<<11, /* Bit 11: AN Next Page Wait */ + PHY_B_AS_AN_RES_MSK = 7<<8,/* Bit 10..8: AN HDC */ + PHY_B_AS_PDF = 1<<7, /* Bit 7: Parallel Detect. Fault */ + PHY_B_AS_RF = 1<<6, /* Bit 6: Remote Fault */ + PHY_B_AS_ANP_R = 1<<5, /* Bit 5: AN Page Received */ + PHY_B_AS_LP_ANAB = 1<<4, /* Bit 4: LP AN Ability */ + PHY_B_AS_LP_NPAB = 1<<3, /* Bit 3: LP Next Page Ability */ + PHY_B_AS_LS = 1<<2, /* Bit 2: Link Status */ + PHY_B_AS_PRR = 1<<1, /* Bit 1: Pause Resolution-Rx */ + PHY_B_AS_PRT = 1<<0, /* Bit 0: Pause Resolution-Tx */ +}; +#define PHY_B_AS_PAUSE_MSK (PHY_B_AS_PRR | PHY_B_AS_PRT) + +/***** PHY_BCOM_INT_STAT 16 bit r/o Interrupt Status Reg *****/ +/***** PHY_BCOM_INT_MASK 16 bit r/w Interrupt Mask Reg *****/ +enum { + PHY_B_IS_PSE = 1<<14, /* Bit 14: Pair Swap Error */ + PHY_B_IS_MDXI_SC = 1<<13, /* Bit 13: MDIX Status Change */ + PHY_B_IS_HCT = 1<<12, /* Bit 12: counter above 32k */ + PHY_B_IS_LCT = 1<<11, /* Bit 11: counter above 128 */ + PHY_B_IS_AN_PR = 1<<10, /* Bit 10: Page Received */ + PHY_B_IS_NO_HDCL = 1<<9, /* Bit 9: No HCD Link */ + PHY_B_IS_NO_HDC = 1<<8, /* Bit 8: No HCD */ + PHY_B_IS_NEG_USHDC = 1<<7, /* Bit 7: Negotiated Unsup. HCD */ + PHY_B_IS_SCR_S_ER = 1<<6, /* Bit 6: Scrambler Sync Error */ + PHY_B_IS_RRS_CHANGE = 1<<5, /* Bit 5: Remote Rx Stat Change */ + PHY_B_IS_LRS_CHANGE = 1<<4, /* Bit 4: Local Rx Stat Change */ + PHY_B_IS_DUP_CHANGE = 1<<3, /* Bit 3: Duplex Mode Change */ + PHY_B_IS_LSP_CHANGE = 1<<2, /* Bit 2: Link Speed Change */ + PHY_B_IS_LST_CHANGE = 1<<1, /* Bit 1: Link Status Changed */ + PHY_B_IS_CRC_ER = 1<<0, /* Bit 0: CRC Error */ +}; +#define PHY_B_DEF_MSK (~(PHY_B_IS_AN_PR | PHY_B_IS_LST_CHANGE)) + +/* Pause Bits (PHY_B_AN_ASP and PHY_B_AN_PC) encoding */ +enum { + PHY_B_P_NO_PAUSE = 0<<10,/* Bit 11..10: no Pause Mode */ + PHY_B_P_SYM_MD = 1<<10, /* Bit 11..10: symmetric Pause Mode */ + PHY_B_P_ASYM_MD = 2<<10,/* Bit 11..10: asymmetric Pause Mode */ + PHY_B_P_BOTH_MD = 3<<10,/* Bit 11..10: both Pause Mode */ +}; +/* + * Resolved Duplex mode and Capabilities (Aux Status Summary Reg) + */ +enum { + PHY_B_RES_1000FD = 7<<8,/* Bit 10..8: 1000Base-T Full Dup. */ + PHY_B_RES_1000HD = 6<<8,/* Bit 10..8: 1000Base-T Half Dup. */ +}; + +/* + * Level One-Specific + */ +/***** PHY_LONE_1000T_CTRL 16 bit r/w 1000Base-T Control Reg *****/ +enum { + PHY_L_1000C_TEST = 7<<13,/* Bit 15..13: Test Modes */ + PHY_L_1000C_MSE = 1<<12, /* Bit 12: Master/Slave Enable */ + PHY_L_1000C_MSC = 1<<11, /* Bit 11: M/S Configuration */ + PHY_L_1000C_RD = 1<<10, /* Bit 10: Repeater/DTE */ + PHY_L_1000C_AFD = 1<<9, /* Bit 9: Advertise Full Duplex */ + PHY_L_1000C_AHD = 1<<8, /* Bit 8: Advertise Half Duplex */ +}; + +/***** PHY_LONE_1000T_STAT 16 bit r/o 1000Base-T Status Reg *****/ +enum { + PHY_L_1000S_MSF = 1<<15, /* Bit 15: Master/Slave Fault */ + PHY_L_1000S_MSR = 1<<14, /* Bit 14: Master/Slave Result */ + PHY_L_1000S_LRS = 1<<13, /* Bit 13: Local Receiver Status */ + PHY_L_1000S_RRS = 1<<12, /* Bit 12: Remote Receiver Status */ + PHY_L_1000S_LP_FD = 1<<11, /* Bit 11: Link Partner can FD */ + PHY_L_1000S_LP_HD = 1<<10, /* Bit 10: Link Partner can HD */ + + PHY_L_1000S_IEC = 0xff, /* Bit 7..0: Idle Error Count */ + +/***** PHY_LONE_EXT_STAT 16 bit r/o Extended Status Register *****/ + PHY_L_ES_X_FD_CAP = 1<<15, /* Bit 15: 1000Base-X FD capable */ + PHY_L_ES_X_HD_CAP = 1<<14, /* Bit 14: 1000Base-X HD capable */ + PHY_L_ES_T_FD_CAP = 1<<13, /* Bit 13: 1000Base-T FD capable */ + PHY_L_ES_T_HD_CAP = 1<<12, /* Bit 12: 1000Base-T HD capable */ +}; + +/***** PHY_LONE_PORT_CFG 16 bit r/w Port Configuration Reg *****/ +enum { + PHY_L_PC_REP_MODE = 1<<15, /* Bit 15: Repeater Mode */ + + PHY_L_PC_TX_DIS = 1<<13, /* Bit 13: Tx output Disabled */ + PHY_L_PC_BY_SCR = 1<<12, /* Bit 12: Bypass Scrambler */ + PHY_L_PC_BY_45 = 1<<11, /* Bit 11: Bypass 4B5B-Decoder */ + PHY_L_PC_JAB_DIS = 1<<10, /* Bit 10: Jabber Disabled */ + PHY_L_PC_SQE = 1<<9, /* Bit 9: Enable Heartbeat */ + PHY_L_PC_TP_LOOP = 1<<8, /* Bit 8: TP Loopback */ + PHY_L_PC_SSS = 1<<7, /* Bit 7: Smart Speed Selection */ + PHY_L_PC_FIFO_SIZE = 1<<6, /* Bit 6: FIFO Size */ + PHY_L_PC_PRE_EN = 1<<5, /* Bit 5: Preamble Enable */ + PHY_L_PC_CIM = 1<<4, /* Bit 4: Carrier Integrity Mon */ + PHY_L_PC_10_SER = 1<<3, /* Bit 3: Use Serial Output */ + PHY_L_PC_ANISOL = 1<<2, /* Bit 2: Unisolate Port */ + PHY_L_PC_TEN_BIT = 1<<1, /* Bit 1: 10bit iface mode on */ + PHY_L_PC_ALTCLOCK = 1<<0, /* Bit 0: (ro) ALTCLOCK Mode on */ +}; + +/***** PHY_LONE_Q_STAT 16 bit r/o Quick Status Reg *****/ +enum { + PHY_L_QS_D_RATE = 3<<14,/* Bit 15..14: Data Rate */ + PHY_L_QS_TX_STAT = 1<<13, /* Bit 13: Transmitting */ + PHY_L_QS_RX_STAT = 1<<12, /* Bit 12: Receiving */ + PHY_L_QS_COL_STAT = 1<<11, /* Bit 11: Collision */ + PHY_L_QS_L_STAT = 1<<10, /* Bit 10: Link is up */ + PHY_L_QS_DUP_MOD = 1<<9, /* Bit 9: Full/Half Duplex */ + PHY_L_QS_AN = 1<<8, /* Bit 8: AutoNeg is On */ + PHY_L_QS_AN_C = 1<<7, /* Bit 7: AN is Complete */ + PHY_L_QS_LLE = 7<<4,/* Bit 6..4: Line Length Estim. */ + PHY_L_QS_PAUSE = 1<<3, /* Bit 3: LP advertised Pause */ + PHY_L_QS_AS_PAUSE = 1<<2, /* Bit 2: LP adv. asym. Pause */ + PHY_L_QS_ISOLATE = 1<<1, /* Bit 1: CIM Isolated */ + PHY_L_QS_EVENT = 1<<0, /* Bit 0: Event has occurred */ +}; + +/***** PHY_LONE_INT_ENAB 16 bit r/w Interrupt Enable Reg *****/ +/***** PHY_LONE_INT_STAT 16 bit r/o Interrupt Status Reg *****/ +enum { + PHY_L_IS_AN_F = 1<<13, /* Bit 13: Auto-Negotiation fault */ + PHY_L_IS_CROSS = 1<<11, /* Bit 11: Crossover used */ + PHY_L_IS_POL = 1<<10, /* Bit 10: Polarity correct. used */ + PHY_L_IS_SS = 1<<9, /* Bit 9: Smart Speed Downgrade */ + PHY_L_IS_CFULL = 1<<8, /* Bit 8: Counter Full */ + PHY_L_IS_AN_C = 1<<7, /* Bit 7: AutoNeg Complete */ + PHY_L_IS_SPEED = 1<<6, /* Bit 6: Speed Changed */ + PHY_L_IS_DUP = 1<<5, /* Bit 5: Duplex Changed */ + PHY_L_IS_LS = 1<<4, /* Bit 4: Link Status Changed */ + PHY_L_IS_ISOL = 1<<3, /* Bit 3: Isolate Occured */ + PHY_L_IS_MDINT = 1<<2, /* Bit 2: (ro) STAT: MII Int Pending */ + PHY_L_IS_INTEN = 1<<1, /* Bit 1: ENAB: Enable IRQs */ + PHY_L_IS_FORCE = 1<<0, /* Bit 0: ENAB: Force Interrupt */ +}; + +/* int. mask */ +#define PHY_L_DEF_MSK (PHY_L_IS_LS | PHY_L_IS_ISOL | PHY_L_IS_INTEN) + +/***** PHY_LONE_LED_CFG 16 bit r/w LED Configuration Reg *****/ +enum { + PHY_L_LC_LEDC = 3<<14,/* Bit 15..14: Col/Blink/On/Off */ + PHY_L_LC_LEDR = 3<<12,/* Bit 13..12: Rx/Blink/On/Off */ + PHY_L_LC_LEDT = 3<<10,/* Bit 11..10: Tx/Blink/On/Off */ + PHY_L_LC_LEDG = 3<<8,/* Bit 9..8: Giga/Blink/On/Off */ + PHY_L_LC_LEDS = 3<<6,/* Bit 7..6: 10-100/Blink/On/Off */ + PHY_L_LC_LEDL = 3<<4,/* Bit 5..4: Link/Blink/On/Off */ + PHY_L_LC_LEDF = 3<<2,/* Bit 3..2: Duplex/Blink/On/Off */ + PHY_L_LC_PSTRECH= 1<<1, /* Bit 1: Strech LED Pulses */ + PHY_L_LC_FREQ = 1<<0, /* Bit 0: 30/100 ms */ +}; + +/***** PHY_LONE_PORT_CTRL 16 bit r/w Port Control Reg *****/ +enum { + PHY_L_PC_TX_TCLK = 1<<15, /* Bit 15: Enable TX_TCLK */ + PHY_L_PC_ALT_NP = 1<<13, /* Bit 14: Alternate Next Page */ + PHY_L_PC_GMII_ALT= 1<<12, /* Bit 13: Alternate GMII driver */ + PHY_L_PC_TEN_CRS = 1<<10, /* Bit 10: Extend CRS*/ +}; + +/***** PHY_LONE_CIM 16 bit r/o CIM Reg *****/ +enum { + PHY_L_CIM_ISOL = 0xff<<8,/* Bit 15..8: Isolate Count */ + PHY_L_CIM_FALSE_CAR = 0xff, /* Bit 7..0: False Carrier Count */ +}; + +/* + * Pause Bits (PHY_L_AN_ASP and PHY_L_AN_PC) encoding + */ +enum { + PHY_L_P_NO_PAUSE= 0<<10,/* Bit 11..10: no Pause Mode */ + PHY_L_P_SYM_MD = 1<<10, /* Bit 11..10: symmetric Pause Mode */ + PHY_L_P_ASYM_MD = 2<<10,/* Bit 11..10: asymmetric Pause Mode */ + PHY_L_P_BOTH_MD = 3<<10,/* Bit 11..10: both Pause Mode */ +}; + +/* + * National-Specific + */ +/***** PHY_NAT_1000T_CTRL 16 bit r/w 1000Base-T Control Reg *****/ +enum { + PHY_N_1000C_TEST= 7<<13,/* Bit 15..13: Test Modes */ + PHY_N_1000C_MSE = 1<<12, /* Bit 12: Master/Slave Enable */ + PHY_N_1000C_MSC = 1<<11, /* Bit 11: M/S Configuration */ + PHY_N_1000C_RD = 1<<10, /* Bit 10: Repeater/DTE */ + PHY_N_1000C_AFD = 1<<9, /* Bit 9: Advertise Full Duplex */ + PHY_N_1000C_AHD = 1<<8, /* Bit 8: Advertise Half Duplex */ + PHY_N_1000C_APC = 1<<7, /* Bit 7: Asymmetric Pause Cap. */}; + + +/***** PHY_NAT_1000T_STAT 16 bit r/o 1000Base-T Status Reg *****/ +enum { + PHY_N_1000S_MSF = 1<<15, /* Bit 15: Master/Slave Fault */ + PHY_N_1000S_MSR = 1<<14, /* Bit 14: Master/Slave Result */ + PHY_N_1000S_LRS = 1<<13, /* Bit 13: Local Receiver Status */ + PHY_N_1000S_RRS = 1<<12, /* Bit 12: Remote Receiver Status*/ + PHY_N_1000S_LP_FD= 1<<11, /* Bit 11: Link Partner can FD */ + PHY_N_1000S_LP_HD= 1<<10, /* Bit 10: Link Partner can HD */ + PHY_N_1000C_LP_APC= 1<<9, /* Bit 9: LP Asym. Pause Cap. */ + PHY_N_1000S_IEC = 0xff, /* Bit 7..0: Idle Error Count */ +}; + +/***** PHY_NAT_EXT_STAT 16 bit r/o Extended Status Register *****/ +enum { + PHY_N_ES_X_FD_CAP= 1<<15, /* Bit 15: 1000Base-X FD capable */ + PHY_N_ES_X_HD_CAP= 1<<14, /* Bit 14: 1000Base-X HD capable */ + PHY_N_ES_T_FD_CAP= 1<<13, /* Bit 13: 1000Base-T FD capable */ + PHY_N_ES_T_HD_CAP= 1<<12, /* Bit 12: 1000Base-T HD capable */ +}; + +/** Marvell-Specific */ +enum { + PHY_M_AN_NXT_PG = 1<<15, /* Request Next Page */ + PHY_M_AN_ACK = 1<<14, /* (ro) Acknowledge Received */ + PHY_M_AN_RF = 1<<13, /* Remote Fault */ + + PHY_M_AN_ASP = 1<<11, /* Asymmetric Pause */ + PHY_M_AN_PC = 1<<10, /* MAC Pause implemented */ + PHY_M_AN_100_T4 = 1<<9, /* Not cap. 100Base-T4 (always 0) */ + PHY_M_AN_100_FD = 1<<8, /* Advertise 100Base-TX Full Duplex */ + PHY_M_AN_100_HD = 1<<7, /* Advertise 100Base-TX Half Duplex */ + PHY_M_AN_10_FD = 1<<6, /* Advertise 10Base-TX Full Duplex */ + PHY_M_AN_10_HD = 1<<5, /* Advertise 10Base-TX Half Duplex */ + PHY_M_AN_SEL_MSK =0x1f<<4, /* Bit 4.. 0: Selector Field Mask */ +}; + +/* special defines for FIBER (88E1011S only) */ +enum { + PHY_M_AN_ASP_X = 1<<8, /* Asymmetric Pause */ + PHY_M_AN_PC_X = 1<<7, /* MAC Pause implemented */ + PHY_M_AN_1000X_AHD = 1<<6, /* Advertise 10000Base-X Half Duplex */ + PHY_M_AN_1000X_AFD = 1<<5, /* Advertise 10000Base-X Full Duplex */ +}; + +/* Pause Bits (PHY_M_AN_ASP_X and PHY_M_AN_PC_X) encoding */ +enum { + PHY_M_P_NO_PAUSE_X = 0<<7,/* Bit 8.. 7: no Pause Mode */ + PHY_M_P_SYM_MD_X = 1<<7, /* Bit 8.. 7: symmetric Pause Mode */ + PHY_M_P_ASYM_MD_X = 2<<7,/* Bit 8.. 7: asymmetric Pause Mode */ + PHY_M_P_BOTH_MD_X = 3<<7,/* Bit 8.. 7: both Pause Mode */ +}; + +/***** PHY_MARV_1000T_CTRL 16 bit r/w 1000Base-T Control Reg *****/ +enum { + PHY_M_1000C_TEST = 7<<13,/* Bit 15..13: Test Modes */ + PHY_M_1000C_MSE = 1<<12, /* Manual Master/Slave Enable */ + PHY_M_1000C_MSC = 1<<11, /* M/S Configuration (1=Master) */ + PHY_M_1000C_MPD = 1<<10, /* Multi-Port Device */ + PHY_M_1000C_AFD = 1<<9, /* Advertise Full Duplex */ + PHY_M_1000C_AHD = 1<<8, /* Advertise Half Duplex */ +}; + +/***** PHY_MARV_PHY_CTRL 16 bit r/w PHY Specific Ctrl Reg *****/ +enum { + PHY_M_PC_TX_FFD_MSK = 3<<14,/* Bit 15..14: Tx FIFO Depth Mask */ + PHY_M_PC_RX_FFD_MSK = 3<<12,/* Bit 13..12: Rx FIFO Depth Mask */ + PHY_M_PC_ASS_CRS_TX = 1<<11, /* Assert CRS on Transmit */ + PHY_M_PC_FL_GOOD = 1<<10, /* Force Link Good */ + PHY_M_PC_EN_DET_MSK = 3<<8,/* Bit 9.. 8: Energy Detect Mask */ + PHY_M_PC_ENA_EXT_D = 1<<7, /* Enable Ext. Distance (10BT) */ + PHY_M_PC_MDIX_MSK = 3<<5,/* Bit 6.. 5: MDI/MDIX Config. Mask */ + PHY_M_PC_DIS_125CLK = 1<<4, /* Disable 125 CLK */ + PHY_M_PC_MAC_POW_UP = 1<<3, /* MAC Power up */ + PHY_M_PC_SQE_T_ENA = 1<<2, /* SQE Test Enabled */ + PHY_M_PC_POL_R_DIS = 1<<1, /* Polarity Reversal Disabled */ + PHY_M_PC_DIS_JABBER = 1<<0, /* Disable Jabber */ +}; + +enum { + PHY_M_PC_EN_DET = 2<<8, /* Energy Detect (Mode 1) */ + PHY_M_PC_EN_DET_PLUS = 3<<8, /* Energy Detect Plus (Mode 2) */ +}; + +#define PHY_M_PC_MDI_XMODE(x) (((x)<<5) & PHY_M_PC_MDIX_MSK) + +enum { + PHY_M_PC_MAN_MDI = 0, /* 00 = Manual MDI configuration */ + PHY_M_PC_MAN_MDIX = 1, /* 01 = Manual MDIX configuration */ + PHY_M_PC_ENA_AUTO = 3, /* 11 = Enable Automatic Crossover */ +}; + +/* for 10/100 Fast Ethernet PHY (88E3082 only) */ +enum { + PHY_M_PC_ENA_DTE_DT = 1<<15, /* Enable Data Terminal Equ. (DTE) Detect */ + PHY_M_PC_ENA_ENE_DT = 1<<14, /* Enable Energy Detect (sense & pulse) */ + PHY_M_PC_DIS_NLP_CK = 1<<13, /* Disable Normal Link Puls (NLP) Check */ + PHY_M_PC_ENA_LIP_NP = 1<<12, /* Enable Link Partner Next Page Reg. */ + PHY_M_PC_DIS_NLP_GN = 1<<11, /* Disable Normal Link Puls Generation */ + + PHY_M_PC_DIS_SCRAMB = 1<<9, /* Disable Scrambler */ + PHY_M_PC_DIS_FEFI = 1<<8, /* Disable Far End Fault Indic. (FEFI) */ + + PHY_M_PC_SH_TP_SEL = 1<<6, /* Shielded Twisted Pair Select */ + PHY_M_PC_RX_FD_MSK = 3<<2,/* Bit 3.. 2: Rx FIFO Depth Mask */ +}; + +/***** PHY_MARV_PHY_STAT 16 bit r/o PHY Specific Status Reg *****/ +enum { + PHY_M_PS_SPEED_MSK = 3<<14, /* Bit 15..14: Speed Mask */ + PHY_M_PS_SPEED_1000 = 1<<15, /* 10 = 1000 Mbps */ + PHY_M_PS_SPEED_100 = 1<<14, /* 01 = 100 Mbps */ + PHY_M_PS_SPEED_10 = 0, /* 00 = 10 Mbps */ + PHY_M_PS_FULL_DUP = 1<<13, /* Full Duplex */ + PHY_M_PS_PAGE_REC = 1<<12, /* Page Received */ + PHY_M_PS_SPDUP_RES = 1<<11, /* Speed & Duplex Resolved */ + PHY_M_PS_LINK_UP = 1<<10, /* Link Up */ + PHY_M_PS_CABLE_MSK = 7<<7, /* Bit 9.. 7: Cable Length Mask */ + PHY_M_PS_MDI_X_STAT = 1<<6, /* MDI Crossover Stat (1=MDIX) */ + PHY_M_PS_DOWNS_STAT = 1<<5, /* Downshift Status (1=downsh.) */ + PHY_M_PS_ENDET_STAT = 1<<4, /* Energy Detect Status (1=act) */ + PHY_M_PS_TX_P_EN = 1<<3, /* Tx Pause Enabled */ + PHY_M_PS_RX_P_EN = 1<<2, /* Rx Pause Enabled */ + PHY_M_PS_POL_REV = 1<<1, /* Polarity Reversed */ + PHY_M_PS_JABBER = 1<<0, /* Jabber */ +}; + +#define PHY_M_PS_PAUSE_MSK (PHY_M_PS_TX_P_EN | PHY_M_PS_RX_P_EN) + +/* for 10/100 Fast Ethernet PHY (88E3082 only) */ +enum { + PHY_M_PS_DTE_DETECT = 1<<15, /* Data Terminal Equipment (DTE) Detected */ + PHY_M_PS_RES_SPEED = 1<<14, /* Resolved Speed (1=100 Mbps, 0=10 Mbps */ +}; + +enum { + PHY_M_IS_AN_ERROR = 1<<15, /* Auto-Negotiation Error */ + PHY_M_IS_LSP_CHANGE = 1<<14, /* Link Speed Changed */ + PHY_M_IS_DUP_CHANGE = 1<<13, /* Duplex Mode Changed */ + PHY_M_IS_AN_PR = 1<<12, /* Page Received */ + PHY_M_IS_AN_COMPL = 1<<11, /* Auto-Negotiation Completed */ + PHY_M_IS_LST_CHANGE = 1<<10, /* Link Status Changed */ + PHY_M_IS_SYMB_ERROR = 1<<9, /* Symbol Error */ + PHY_M_IS_FALSE_CARR = 1<<8, /* False Carrier */ + PHY_M_IS_FIFO_ERROR = 1<<7, /* FIFO Overflow/Underrun Error */ + PHY_M_IS_MDI_CHANGE = 1<<6, /* MDI Crossover Changed */ + PHY_M_IS_DOWNSH_DET = 1<<5, /* Downshift Detected */ + PHY_M_IS_END_CHANGE = 1<<4, /* Energy Detect Changed */ + + PHY_M_IS_DTE_CHANGE = 1<<2, /* DTE Power Det. Status Changed */ + PHY_M_IS_POL_CHANGE = 1<<1, /* Polarity Changed */ + PHY_M_IS_JABBER = 1<<0, /* Jabber */ +}; + +#define PHY_M_DEF_MSK ( PHY_M_IS_AN_ERROR | PHY_M_IS_LSP_CHANGE | \ + PHY_M_IS_LST_CHANGE | PHY_M_IS_FIFO_ERROR) + +/***** PHY_MARV_EXT_CTRL 16 bit r/w Ext. PHY Specific Ctrl *****/ +enum { + PHY_M_EC_ENA_BC_EXT = 1<<15, /* Enable Block Carr. Ext. (88E1111 only) */ + PHY_M_EC_ENA_LIN_LB = 1<<14, /* Enable Line Loopback (88E1111 only) */ + + PHY_M_EC_DIS_LINK_P = 1<<12, /* Disable Link Pulses (88E1111 only) */ + PHY_M_EC_M_DSC_MSK = 3<<10, /* Bit 11..10: Master Downshift Counter */ + /* (88E1011 only) */ + PHY_M_EC_S_DSC_MSK = 3<<8,/* Bit 9.. 8: Slave Downshift Counter */ + /* (88E1011 only) */ + PHY_M_EC_M_DSC_MSK2 = 7<<9,/* Bit 11.. 9: Master Downshift Counter */ + /* (88E1111 only) */ + PHY_M_EC_DOWN_S_ENA = 1<<8, /* Downshift Enable (88E1111 only) */ + /* !!! Errata in spec. (1 = disable) */ + PHY_M_EC_RX_TIM_CT = 1<<7, /* RGMII Rx Timing Control*/ + PHY_M_EC_MAC_S_MSK = 7<<4,/* Bit 6.. 4: Def. MAC interface speed */ + PHY_M_EC_FIB_AN_ENA = 1<<3, /* Fiber Auto-Neg. Enable (88E1011S only) */ + PHY_M_EC_DTE_D_ENA = 1<<2, /* DTE Detect Enable (88E1111 only) */ + PHY_M_EC_TX_TIM_CT = 1<<1, /* RGMII Tx Timing Control */ + PHY_M_EC_TRANS_DIS = 1<<0, /* Transmitter Disable (88E1111 only) */}; + +#define PHY_M_EC_M_DSC(x) ((x)<<10) /* 00=1x; 01=2x; 10=3x; 11=4x */ +#define PHY_M_EC_S_DSC(x) ((x)<<8) /* 00=dis; 01=1x; 10=2x; 11=3x */ +#define PHY_M_EC_MAC_S(x) ((x)<<4) /* 01X=0; 110=2.5; 111=25 (MHz) */ + +#define PHY_M_EC_M_DSC_2(x) ((x)<<9) /* 000=1x; 001=2x; 010=3x; 011=4x */ + /* 100=5x; 101=6x; 110=7x; 111=8x */ +enum { + MAC_TX_CLK_0_MHZ = 2, + MAC_TX_CLK_2_5_MHZ = 6, + MAC_TX_CLK_25_MHZ = 7, +}; + +/***** PHY_MARV_LED_CTRL 16 bit r/w LED Control Reg *****/ +enum { + PHY_M_LEDC_DIS_LED = 1<<15, /* Disable LED */ + PHY_M_LEDC_PULS_MSK = 7<<12,/* Bit 14..12: Pulse Stretch Mask */ + PHY_M_LEDC_F_INT = 1<<11, /* Force Interrupt */ + PHY_M_LEDC_BL_R_MSK = 7<<8,/* Bit 10.. 8: Blink Rate Mask */ + PHY_M_LEDC_DP_C_LSB = 1<<7, /* Duplex Control (LSB, 88E1111 only) */ + PHY_M_LEDC_TX_C_LSB = 1<<6, /* Tx Control (LSB, 88E1111 only) */ + PHY_M_LEDC_LK_C_MSK = 7<<3,/* Bit 5.. 3: Link Control Mask */ + /* (88E1111 only) */ +}; + +enum { + PHY_M_LEDC_LINK_MSK = 3<<3,/* Bit 4.. 3: Link Control Mask */ + /* (88E1011 only) */ + PHY_M_LEDC_DP_CTRL = 1<<2, /* Duplex Control */ + PHY_M_LEDC_DP_C_MSB = 1<<2, /* Duplex Control (MSB, 88E1111 only) */ + PHY_M_LEDC_RX_CTRL = 1<<1, /* Rx Activity / Link */ + PHY_M_LEDC_TX_CTRL = 1<<0, /* Tx Activity / Link */ + PHY_M_LEDC_TX_C_MSB = 1<<0, /* Tx Control (MSB, 88E1111 only) */ +}; + +#define PHY_M_LED_PULS_DUR(x) ( ((x)<<12) & PHY_M_LEDC_PULS_MSK) + +enum { + PULS_NO_STR = 0,/* no pulse stretching */ + PULS_21MS = 1,/* 21 ms to 42 ms */ + PULS_42MS = 2,/* 42 ms to 84 ms */ + PULS_84MS = 3,/* 84 ms to 170 ms */ + PULS_170MS = 4,/* 170 ms to 340 ms */ + PULS_340MS = 5,/* 340 ms to 670 ms */ + PULS_670MS = 6,/* 670 ms to 1.3 s */ + PULS_1300MS = 7,/* 1.3 s to 2.7 s */ +}; + +#define PHY_M_LED_BLINK_RT(x) ( ((x)<<8) & PHY_M_LEDC_BL_R_MSK) + +enum { + BLINK_42MS = 0,/* 42 ms */ + BLINK_84MS = 1,/* 84 ms */ + BLINK_170MS = 2,/* 170 ms */ + BLINK_340MS = 3,/* 340 ms */ + BLINK_670MS = 4,/* 670 ms */ +}; + +/***** PHY_MARV_LED_OVER 16 bit r/w Manual LED Override Reg *****/ +#define PHY_M_LED_MO_SGMII(x) ((x)<<14) /* Bit 15..14: SGMII AN Timer */ + /* Bit 13..12: reserved */ +#define PHY_M_LED_MO_DUP(x) ((x)<<10) /* Bit 11..10: Duplex */ +#define PHY_M_LED_MO_10(x) ((x)<<8) /* Bit 9.. 8: Link 10 */ +#define PHY_M_LED_MO_100(x) ((x)<<6) /* Bit 7.. 6: Link 100 */ +#define PHY_M_LED_MO_1000(x) ((x)<<4) /* Bit 5.. 4: Link 1000 */ +#define PHY_M_LED_MO_RX(x) ((x)<<2) /* Bit 3.. 2: Rx */ +#define PHY_M_LED_MO_TX(x) ((x)<<0) /* Bit 1.. 0: Tx */ + +enum { + MO_LED_NORM = 0, + MO_LED_BLINK = 1, + MO_LED_OFF = 2, + MO_LED_ON = 3, +}; + +/***** PHY_MARV_EXT_CTRL_2 16 bit r/w Ext. PHY Specific Ctrl 2 *****/ +enum { + PHY_M_EC2_FI_IMPED = 1<<6, /* Fiber Input Impedance */ + PHY_M_EC2_FO_IMPED = 1<<5, /* Fiber Output Impedance */ + PHY_M_EC2_FO_M_CLK = 1<<4, /* Fiber Mode Clock Enable */ + PHY_M_EC2_FO_BOOST = 1<<3, /* Fiber Output Boost */ + PHY_M_EC2_FO_AM_MSK = 7,/* Bit 2.. 0: Fiber Output Amplitude */ +}; + +/***** PHY_MARV_EXT_P_STAT 16 bit r/w Ext. PHY Specific Status *****/ +enum { + PHY_M_FC_AUTO_SEL = 1<<15, /* Fiber/Copper Auto Sel. Dis. */ + PHY_M_FC_AN_REG_ACC = 1<<14, /* Fiber/Copper AN Reg. Access */ + PHY_M_FC_RESOLUTION = 1<<13, /* Fiber/Copper Resolution */ + PHY_M_SER_IF_AN_BP = 1<<12, /* Ser. IF AN Bypass Enable */ + PHY_M_SER_IF_BP_ST = 1<<11, /* Ser. IF AN Bypass Status */ + PHY_M_IRQ_POLARITY = 1<<10, /* IRQ polarity */ + PHY_M_DIS_AUT_MED = 1<<9, /* Disable Aut. Medium Reg. Selection */ + /* (88E1111 only) */ + /* Bit 9.. 4: reserved (88E1011 only) */ + PHY_M_UNDOC1 = 1<<7, /* undocumented bit !! */ + PHY_M_DTE_POW_STAT = 1<<4, /* DTE Power Status (88E1111 only) */ + PHY_M_MODE_MASK = 0xf, /* Bit 3.. 0: copy of HWCFG MODE[3:0] */ +}; + +/***** PHY_MARV_CABLE_DIAG 16 bit r/o Cable Diagnostic Reg *****/ +enum { + PHY_M_CABD_ENA_TEST = 1<<15, /* Enable Test (Page 0) */ + PHY_M_CABD_DIS_WAIT = 1<<15, /* Disable Waiting Period (Page 1) */ + /* (88E1111 only) */ + PHY_M_CABD_STAT_MSK = 3<<13, /* Bit 14..13: Status Mask */ + PHY_M_CABD_AMPL_MSK = 0x1f<<8,/* Bit 12.. 8: Amplitude Mask */ + /* (88E1111 only) */ + PHY_M_CABD_DIST_MSK = 0xff, /* Bit 7.. 0: Distance Mask */ +}; + +/* values for Cable Diagnostic Status (11=fail; 00=OK; 10=open; 01=short) */ +enum { + CABD_STAT_NORMAL= 0, + CABD_STAT_SHORT = 1, + CABD_STAT_OPEN = 2, + CABD_STAT_FAIL = 3, +}; + +/* for 10/100 Fast Ethernet PHY (88E3082 only) */ +/***** PHY_MARV_FE_LED_PAR 16 bit r/w LED Parallel Select Reg. *****/ + /* Bit 15..12: reserved (used internally) */ +enum { + PHY_M_FELP_LED2_MSK = 0xf<<8, /* Bit 11.. 8: LED2 Mask (LINK) */ + PHY_M_FELP_LED1_MSK = 0xf<<4, /* Bit 7.. 4: LED1 Mask (ACT) */ + PHY_M_FELP_LED0_MSK = 0xf, /* Bit 3.. 0: LED0 Mask (SPEED) */ +}; + +#define PHY_M_FELP_LED2_CTRL(x) ( ((x)<<8) & PHY_M_FELP_LED2_MSK) +#define PHY_M_FELP_LED1_CTRL(x) ( ((x)<<4) & PHY_M_FELP_LED1_MSK) +#define PHY_M_FELP_LED0_CTRL(x) ( ((x)<<0) & PHY_M_FELP_LED0_MSK) + +enum { + LED_PAR_CTRL_COLX = 0x00, + LED_PAR_CTRL_ERROR = 0x01, + LED_PAR_CTRL_DUPLEX = 0x02, + LED_PAR_CTRL_DP_COL = 0x03, + LED_PAR_CTRL_SPEED = 0x04, + LED_PAR_CTRL_LINK = 0x05, + LED_PAR_CTRL_TX = 0x06, + LED_PAR_CTRL_RX = 0x07, + LED_PAR_CTRL_ACT = 0x08, + LED_PAR_CTRL_LNK_RX = 0x09, + LED_PAR_CTRL_LNK_AC = 0x0a, + LED_PAR_CTRL_ACT_BL = 0x0b, + LED_PAR_CTRL_TX_BL = 0x0c, + LED_PAR_CTRL_RX_BL = 0x0d, + LED_PAR_CTRL_COL_BL = 0x0e, + LED_PAR_CTRL_INACT = 0x0f +}; + +/*****,PHY_MARV_FE_SPEC_2 16 bit r/w Specific Control Reg. 2 *****/ +enum { + PHY_M_FESC_DIS_WAIT = 1<<2, /* Disable TDR Waiting Period */ + PHY_M_FESC_ENA_MCLK = 1<<1, /* Enable MAC Rx Clock in sleep mode */ + PHY_M_FESC_SEL_CL_A = 1<<0, /* Select Class A driver (100B-TX) */ +}; + +/* for Yukon-2 Gigabit Ethernet PHY (88E1112 only) */ +/***** PHY_MARV_PHY_CTRL (page 2) 16 bit r/w MAC Specific Ctrl *****/ +enum { + PHY_M_MAC_MD_MSK = 7<<7, /* Bit 9.. 7: Mode Select Mask */ + PHY_M_MAC_MD_AUTO = 3,/* Auto Copper/1000Base-X */ + PHY_M_MAC_MD_COPPER = 5,/* Copper only */ + PHY_M_MAC_MD_1000BX = 7,/* 1000Base-X only */ +}; +#define PHY_M_MAC_MODE_SEL(x) ( ((x)<<7) & PHY_M_MAC_MD_MSK) + +/***** PHY_MARV_PHY_CTRL (page 3) 16 bit r/w LED Control Reg. *****/ +enum { + PHY_M_LEDC_LOS_MSK = 0xf<<12,/* Bit 15..12: LOS LED Ctrl. Mask */ + PHY_M_LEDC_INIT_MSK = 0xf<<8, /* Bit 11.. 8: INIT LED Ctrl. Mask */ + PHY_M_LEDC_STA1_MSK = 0xf<<4,/* Bit 7.. 4: STAT1 LED Ctrl. Mask */ + PHY_M_LEDC_STA0_MSK = 0xf, /* Bit 3.. 0: STAT0 LED Ctrl. Mask */ +}; + +#define PHY_M_LEDC_LOS_CTRL(x) ( ((x)<<12) & PHY_M_LEDC_LOS_MSK) +#define PHY_M_LEDC_INIT_CTRL(x) ( ((x)<<8) & PHY_M_LEDC_INIT_MSK) +#define PHY_M_LEDC_STA1_CTRL(x) ( ((x)<<4) & PHY_M_LEDC_STA1_MSK) +#define PHY_M_LEDC_STA0_CTRL(x) ( ((x)<<0) & PHY_M_LEDC_STA0_MSK) + +/* GMAC registers */ +/* Port Registers */ +enum { + GM_GP_STAT = 0x0000, /* 16 bit r/o General Purpose Status */ + GM_GP_CTRL = 0x0004, /* 16 bit r/w General Purpose Control */ + GM_TX_CTRL = 0x0008, /* 16 bit r/w Transmit Control Reg. */ + GM_RX_CTRL = 0x000c, /* 16 bit r/w Receive Control Reg. */ + GM_TX_FLOW_CTRL = 0x0010, /* 16 bit r/w Transmit Flow-Control */ + GM_TX_PARAM = 0x0014, /* 16 bit r/w Transmit Parameter Reg. */ + GM_SERIAL_MODE = 0x0018, /* 16 bit r/w Serial Mode Register */ +/* Source Address Registers */ + GM_SRC_ADDR_1L = 0x001c, /* 16 bit r/w Source Address 1 (low) */ + GM_SRC_ADDR_1M = 0x0020, /* 16 bit r/w Source Address 1 (middle) */ + GM_SRC_ADDR_1H = 0x0024, /* 16 bit r/w Source Address 1 (high) */ + GM_SRC_ADDR_2L = 0x0028, /* 16 bit r/w Source Address 2 (low) */ + GM_SRC_ADDR_2M = 0x002c, /* 16 bit r/w Source Address 2 (middle) */ + GM_SRC_ADDR_2H = 0x0030, /* 16 bit r/w Source Address 2 (high) */ + +/* Multicast Address Hash Registers */ + GM_MC_ADDR_H1 = 0x0034, /* 16 bit r/w Multicast Address Hash 1 */ + GM_MC_ADDR_H2 = 0x0038, /* 16 bit r/w Multicast Address Hash 2 */ + GM_MC_ADDR_H3 = 0x003c, /* 16 bit r/w Multicast Address Hash 3 */ + GM_MC_ADDR_H4 = 0x0040, /* 16 bit r/w Multicast Address Hash 4 */ + +/* Interrupt Source Registers */ + GM_TX_IRQ_SRC = 0x0044, /* 16 bit r/o Tx Overflow IRQ Source */ + GM_RX_IRQ_SRC = 0x0048, /* 16 bit r/o Rx Overflow IRQ Source */ + GM_TR_IRQ_SRC = 0x004c, /* 16 bit r/o Tx/Rx Over. IRQ Source */ + +/* Interrupt Mask Registers */ + GM_TX_IRQ_MSK = 0x0050, /* 16 bit r/w Tx Overflow IRQ Mask */ + GM_RX_IRQ_MSK = 0x0054, /* 16 bit r/w Rx Overflow IRQ Mask */ + GM_TR_IRQ_MSK = 0x0058, /* 16 bit r/w Tx/Rx Over. IRQ Mask */ + +/* Serial Management Interface (SMI) Registers */ + GM_SMI_CTRL = 0x0080, /* 16 bit r/w SMI Control Register */ + GM_SMI_DATA = 0x0084, /* 16 bit r/w SMI Data Register */ + GM_PHY_ADDR = 0x0088, /* 16 bit r/w GPHY Address Register */ +}; + +/* MIB Counters */ +#define GM_MIB_CNT_BASE 0x0100 /* Base Address of MIB Counters */ +#define GM_MIB_CNT_SIZE 44 /* Number of MIB Counters */ + +/* + * MIB Counters base address definitions (low word) - + * use offset 4 for access to high word (32 bit r/o) + */ +enum { + GM_RXF_UC_OK = GM_MIB_CNT_BASE + 0, /* Unicast Frames Received OK */ + GM_RXF_BC_OK = GM_MIB_CNT_BASE + 8, /* Broadcast Frames Received OK */ + GM_RXF_MPAUSE = GM_MIB_CNT_BASE + 16, /* Pause MAC Ctrl Frames Received */ + GM_RXF_MC_OK = GM_MIB_CNT_BASE + 24, /* Multicast Frames Received OK */ + GM_RXF_FCS_ERR = GM_MIB_CNT_BASE + 32, /* Rx Frame Check Seq. Error */ + /* GM_MIB_CNT_BASE + 40: reserved */ + GM_RXO_OK_LO = GM_MIB_CNT_BASE + 48, /* Octets Received OK Low */ + GM_RXO_OK_HI = GM_MIB_CNT_BASE + 56, /* Octets Received OK High */ + GM_RXO_ERR_LO = GM_MIB_CNT_BASE + 64, /* Octets Received Invalid Low */ + GM_RXO_ERR_HI = GM_MIB_CNT_BASE + 72, /* Octets Received Invalid High */ + GM_RXF_SHT = GM_MIB_CNT_BASE + 80, /* Frames <64 Byte Received OK */ + GM_RXE_FRAG = GM_MIB_CNT_BASE + 88, /* Frames <64 Byte Received with FCS Err */ + GM_RXF_64B = GM_MIB_CNT_BASE + 96, /* 64 Byte Rx Frame */ + GM_RXF_127B = GM_MIB_CNT_BASE + 104, /* 65-127 Byte Rx Frame */ + GM_RXF_255B = GM_MIB_CNT_BASE + 112, /* 128-255 Byte Rx Frame */ + GM_RXF_511B = GM_MIB_CNT_BASE + 120, /* 256-511 Byte Rx Frame */ + GM_RXF_1023B = GM_MIB_CNT_BASE + 128, /* 512-1023 Byte Rx Frame */ + GM_RXF_1518B = GM_MIB_CNT_BASE + 136, /* 1024-1518 Byte Rx Frame */ + GM_RXF_MAX_SZ = GM_MIB_CNT_BASE + 144, /* 1519-MaxSize Byte Rx Frame */ + GM_RXF_LNG_ERR = GM_MIB_CNT_BASE + 152, /* Rx Frame too Long Error */ + GM_RXF_JAB_PKT = GM_MIB_CNT_BASE + 160, /* Rx Jabber Packet Frame */ + /* GM_MIB_CNT_BASE + 168: reserved */ + GM_RXE_FIFO_OV = GM_MIB_CNT_BASE + 176, /* Rx FIFO overflow Event */ + /* GM_MIB_CNT_BASE + 184: reserved */ + GM_TXF_UC_OK = GM_MIB_CNT_BASE + 192, /* Unicast Frames Xmitted OK */ + GM_TXF_BC_OK = GM_MIB_CNT_BASE + 200, /* Broadcast Frames Xmitted OK */ + GM_TXF_MPAUSE = GM_MIB_CNT_BASE + 208, /* Pause MAC Ctrl Frames Xmitted */ + GM_TXF_MC_OK = GM_MIB_CNT_BASE + 216, /* Multicast Frames Xmitted OK */ + GM_TXO_OK_LO = GM_MIB_CNT_BASE + 224, /* Octets Transmitted OK Low */ + GM_TXO_OK_HI = GM_MIB_CNT_BASE + 232, /* Octets Transmitted OK High */ + GM_TXF_64B = GM_MIB_CNT_BASE + 240, /* 64 Byte Tx Frame */ + GM_TXF_127B = GM_MIB_CNT_BASE + 248, /* 65-127 Byte Tx Frame */ + GM_TXF_255B = GM_MIB_CNT_BASE + 256, /* 128-255 Byte Tx Frame */ + GM_TXF_511B = GM_MIB_CNT_BASE + 264, /* 256-511 Byte Tx Frame */ + GM_TXF_1023B = GM_MIB_CNT_BASE + 272, /* 512-1023 Byte Tx Frame */ + GM_TXF_1518B = GM_MIB_CNT_BASE + 280, /* 1024-1518 Byte Tx Frame */ + GM_TXF_MAX_SZ = GM_MIB_CNT_BASE + 288, /* 1519-MaxSize Byte Tx Frame */ + + GM_TXF_COL = GM_MIB_CNT_BASE + 304, /* Tx Collision */ + GM_TXF_LAT_COL = GM_MIB_CNT_BASE + 312, /* Tx Late Collision */ + GM_TXF_ABO_COL = GM_MIB_CNT_BASE + 320, /* Tx aborted due to Exces. Col. */ + GM_TXF_MUL_COL = GM_MIB_CNT_BASE + 328, /* Tx Multiple Collision */ + GM_TXF_SNG_COL = GM_MIB_CNT_BASE + 336, /* Tx Single Collision */ + GM_TXE_FIFO_UR = GM_MIB_CNT_BASE + 344, /* Tx FIFO Underrun Event */ +}; + +/* GMAC Bit Definitions */ +/* GM_GP_STAT 16 bit r/o General Purpose Status Register */ +enum { + GM_GPSR_SPEED = 1<<15, /* Bit 15: Port Speed (1 = 100 Mbps) */ + GM_GPSR_DUPLEX = 1<<14, /* Bit 14: Duplex Mode (1 = Full) */ + GM_GPSR_FC_TX_DIS = 1<<13, /* Bit 13: Tx Flow-Control Mode Disabled */ + GM_GPSR_LINK_UP = 1<<12, /* Bit 12: Link Up Status */ + GM_GPSR_PAUSE = 1<<11, /* Bit 11: Pause State */ + GM_GPSR_TX_ACTIVE = 1<<10, /* Bit 10: Tx in Progress */ + GM_GPSR_EXC_COL = 1<<9, /* Bit 9: Excessive Collisions Occured */ + GM_GPSR_LAT_COL = 1<<8, /* Bit 8: Late Collisions Occured */ + + GM_GPSR_PHY_ST_CH = 1<<5, /* Bit 5: PHY Status Change */ + GM_GPSR_GIG_SPEED = 1<<4, /* Bit 4: Gigabit Speed (1 = 1000 Mbps) */ + GM_GPSR_PART_MODE = 1<<3, /* Bit 3: Partition mode */ + GM_GPSR_FC_RX_DIS = 1<<2, /* Bit 2: Rx Flow-Control Mode Disabled */ + GM_GPSR_PROM_EN = 1<<1, /* Bit 1: Promiscuous Mode Enabled */ +}; + +/* GM_GP_CTRL 16 bit r/w General Purpose Control Register */ +enum { + GM_GPCR_PROM_ENA = 1<<14, /* Bit 14: Enable Promiscuous Mode */ + GM_GPCR_FC_TX_DIS = 1<<13, /* Bit 13: Disable Tx Flow-Control Mode */ + GM_GPCR_TX_ENA = 1<<12, /* Bit 12: Enable Transmit */ + GM_GPCR_RX_ENA = 1<<11, /* Bit 11: Enable Receive */ + GM_GPCR_BURST_ENA = 1<<10, /* Bit 10: Enable Burst Mode */ + GM_GPCR_LOOP_ENA = 1<<9, /* Bit 9: Enable MAC Loopback Mode */ + GM_GPCR_PART_ENA = 1<<8, /* Bit 8: Enable Partition Mode */ + GM_GPCR_GIGS_ENA = 1<<7, /* Bit 7: Gigabit Speed (1000 Mbps) */ + GM_GPCR_FL_PASS = 1<<6, /* Bit 6: Force Link Pass */ + GM_GPCR_DUP_FULL = 1<<5, /* Bit 5: Full Duplex Mode */ + GM_GPCR_FC_RX_DIS = 1<<4, /* Bit 4: Disable Rx Flow-Control Mode */ + GM_GPCR_SPEED_100 = 1<<3, /* Bit 3: Port Speed 100 Mbps */ + GM_GPCR_AU_DUP_DIS = 1<<2, /* Bit 2: Disable Auto-Update Duplex */ + GM_GPCR_AU_FCT_DIS = 1<<1, /* Bit 1: Disable Auto-Update Flow-C. */ + GM_GPCR_AU_SPD_DIS = 1<<0, /* Bit 0: Disable Auto-Update Speed */ +}; + +#define GM_GPCR_SPEED_1000 (GM_GPCR_GIGS_ENA | GM_GPCR_SPEED_100) +#define GM_GPCR_AU_ALL_DIS (GM_GPCR_AU_DUP_DIS | GM_GPCR_AU_FCT_DIS|GM_GPCR_AU_SPD_DIS) + +/* GM_TX_CTRL 16 bit r/w Transmit Control Register */ +enum { + GM_TXCR_FORCE_JAM = 1<<15, /* Bit 15: Force Jam / Flow-Control */ + GM_TXCR_CRC_DIS = 1<<14, /* Bit 14: Disable insertion of CRC */ + GM_TXCR_PAD_DIS = 1<<13, /* Bit 13: Disable padding of packets */ + GM_TXCR_COL_THR_MSK = 1<<10, /* Bit 12..10: Collision Threshold */ +}; + +#define TX_COL_THR(x) (((x)<<10) & GM_TXCR_COL_THR_MSK) +#define TX_COL_DEF 0x04 + +/* GM_RX_CTRL 16 bit r/w Receive Control Register */ +enum { + GM_RXCR_UCF_ENA = 1<<15, /* Bit 15: Enable Unicast filtering */ + GM_RXCR_MCF_ENA = 1<<14, /* Bit 14: Enable Multicast filtering */ + GM_RXCR_CRC_DIS = 1<<13, /* Bit 13: Remove 4-byte CRC */ + GM_RXCR_PASS_FC = 1<<12, /* Bit 12: Pass FC packets to FIFO */ +}; + +/* GM_TX_PARAM 16 bit r/w Transmit Parameter Register */ +enum { + GM_TXPA_JAMLEN_MSK = 0x03<<14, /* Bit 15..14: Jam Length */ + GM_TXPA_JAMIPG_MSK = 0x1f<<9, /* Bit 13..9: Jam IPG */ + GM_TXPA_JAMDAT_MSK = 0x1f<<4, /* Bit 8..4: IPG Jam to Data */ + + TX_JAM_LEN_DEF = 0x03, + TX_JAM_IPG_DEF = 0x0b, + TX_IPG_JAM_DEF = 0x1c, +}; + +#define TX_JAM_LEN_VAL(x) (((x)<<14) & GM_TXPA_JAMLEN_MSK) +#define TX_JAM_IPG_VAL(x) (((x)<<9) & GM_TXPA_JAMIPG_MSK) +#define TX_IPG_JAM_DATA(x) (((x)<<4) & GM_TXPA_JAMDAT_MSK) + + +/* GM_SERIAL_MODE 16 bit r/w Serial Mode Register */ +enum { + GM_SMOD_DATABL_MSK = 0x1f<<11, /* Bit 15..11: Data Blinder (r/o) */ + GM_SMOD_LIMIT_4 = 1<<10, /* Bit 10: 4 consecutive Tx trials */ + GM_SMOD_VLAN_ENA = 1<<9, /* Bit 9: Enable VLAN (Max. Frame Len) */ + GM_SMOD_JUMBO_ENA = 1<<8, /* Bit 8: Enable Jumbo (Max. Frame Len) */ + GM_SMOD_IPG_MSK = 0x1f /* Bit 4..0: Inter-Packet Gap (IPG) */ +}; + +#define DATA_BLIND_VAL(x) (((x)<<11) & GM_SMOD_DATABL_MSK) +#define DATA_BLIND_DEF 0x04 + +#define IPG_DATA_VAL(x) (x & GM_SMOD_IPG_MSK) +#define IPG_DATA_DEF 0x1e + +/* GM_SMI_CTRL 16 bit r/w SMI Control Register */ +enum { + GM_SMI_CT_PHY_A_MSK = 0x1f<<11,/* Bit 15..11: PHY Device Address */ + GM_SMI_CT_REG_A_MSK = 0x1f<<6,/* Bit 10.. 6: PHY Register Address */ + GM_SMI_CT_OP_RD = 1<<5, /* Bit 5: OpCode Read (0=Write)*/ + GM_SMI_CT_RD_VAL = 1<<4, /* Bit 4: Read Valid (Read completed) */ + GM_SMI_CT_BUSY = 1<<3, /* Bit 3: Busy (Operation in progress) */ +}; + +#define GM_SMI_CT_PHY_AD(x) (((x)<<11) & GM_SMI_CT_PHY_A_MSK) +#define GM_SMI_CT_REG_AD(x) (((x)<<6) & GM_SMI_CT_REG_A_MSK) + +/* GM_PHY_ADDR 16 bit r/w GPHY Address Register */ +enum { + GM_PAR_MIB_CLR = 1<<5, /* Bit 5: Set MIB Clear Counter Mode */ + GM_PAR_MIB_TST = 1<<4, /* Bit 4: MIB Load Counter (Test Mode) */ +}; + +/* Receive Frame Status Encoding */ +enum { + GMR_FS_LEN = 0xffff<<16, /* Bit 31..16: Rx Frame Length */ + GMR_FS_VLAN = 1<<13, /* Bit 13: VLAN Packet */ + GMR_FS_JABBER = 1<<12, /* Bit 12: Jabber Packet */ + GMR_FS_UN_SIZE = 1<<11, /* Bit 11: Undersize Packet */ + GMR_FS_MC = 1<<10, /* Bit 10: Multicast Packet */ + GMR_FS_BC = 1<<9, /* Bit 9: Broadcast Packet */ + GMR_FS_RX_OK = 1<<8, /* Bit 8: Receive OK (Good Packet) */ + GMR_FS_GOOD_FC = 1<<7, /* Bit 7: Good Flow-Control Packet */ + GMR_FS_BAD_FC = 1<<6, /* Bit 6: Bad Flow-Control Packet */ + GMR_FS_MII_ERR = 1<<5, /* Bit 5: MII Error */ + GMR_FS_LONG_ERR = 1<<4, /* Bit 4: Too Long Packet */ + GMR_FS_FRAGMENT = 1<<3, /* Bit 3: Fragment */ + + GMR_FS_CRC_ERR = 1<<1, /* Bit 1: CRC Error */ + GMR_FS_RX_FF_OV = 1<<0, /* Bit 0: Rx FIFO Overflow */ + +/* + * GMR_FS_ANY_ERR (analogous to XMR_FS_ANY_ERR) + */ + GMR_FS_ANY_ERR = GMR_FS_CRC_ERR | GMR_FS_LONG_ERR | + GMR_FS_MII_ERR | GMR_FS_BAD_FC | GMR_FS_GOOD_FC | + GMR_FS_JABBER, +/* Rx GMAC FIFO Flush Mask (default) */ + RX_FF_FL_DEF_MSK = GMR_FS_CRC_ERR | GMR_FS_RX_FF_OV |GMR_FS_MII_ERR | + GMR_FS_BAD_FC | GMR_FS_GOOD_FC | GMR_FS_UN_SIZE | + GMR_FS_JABBER, +}; + +/* RX_GMF_CTRL_T 32 bit Rx GMAC FIFO Control/Test */ +enum { + GMF_WP_TST_ON = 1<<14, /* Write Pointer Test On */ + GMF_WP_TST_OFF = 1<<13, /* Write Pointer Test Off */ + GMF_WP_STEP = 1<<12, /* Write Pointer Step/Increment */ + + GMF_RP_TST_ON = 1<<10, /* Read Pointer Test On */ + GMF_RP_TST_OFF = 1<<9, /* Read Pointer Test Off */ + GMF_RP_STEP = 1<<8, /* Read Pointer Step/Increment */ + GMF_RX_F_FL_ON = 1<<7, /* Rx FIFO Flush Mode On */ + GMF_RX_F_FL_OFF = 1<<6, /* Rx FIFO Flush Mode Off */ + GMF_CLI_RX_FO = 1<<5, /* Clear IRQ Rx FIFO Overrun */ + GMF_CLI_RX_FC = 1<<4, /* Clear IRQ Rx Frame Complete */ + GMF_OPER_ON = 1<<3, /* Operational Mode On */ + GMF_OPER_OFF = 1<<2, /* Operational Mode Off */ + GMF_RST_CLR = 1<<1, /* Clear GMAC FIFO Reset */ + GMF_RST_SET = 1<<0, /* Set GMAC FIFO Reset */ + + RX_GMF_FL_THR_DEF = 0xa, /* flush threshold (default) */ +}; + + +/* TX_GMF_CTRL_T 32 bit Tx GMAC FIFO Control/Test */ +enum { + GMF_WSP_TST_ON = 1<<18,/* Write Shadow Pointer Test On */ + GMF_WSP_TST_OFF = 1<<17,/* Write Shadow Pointer Test Off */ + GMF_WSP_STEP = 1<<16,/* Write Shadow Pointer Step/Increment */ + + GMF_CLI_TX_FU = 1<<6, /* Clear IRQ Tx FIFO Underrun */ + GMF_CLI_TX_FC = 1<<5, /* Clear IRQ Tx Frame Complete */ + GMF_CLI_TX_PE = 1<<4, /* Clear IRQ Tx Parity Error */ +}; + +/* GMAC_TI_ST_CTRL 8 bit Time Stamp Timer Ctrl Reg (YUKON only) */ +enum { + GMT_ST_START = 1<<2, /* Start Time Stamp Timer */ + GMT_ST_STOP = 1<<1, /* Stop Time Stamp Timer */ + GMT_ST_CLR_IRQ = 1<<0, /* Clear Time Stamp Timer IRQ */ +}; + +/* GMAC_CTRL 32 bit GMAC Control Reg (YUKON only) */ +enum { + GMC_H_BURST_ON = 1<<7, /* Half Duplex Burst Mode On */ + GMC_H_BURST_OFF = 1<<6, /* Half Duplex Burst Mode Off */ + GMC_F_LOOPB_ON = 1<<5, /* FIFO Loopback On */ + GMC_F_LOOPB_OFF = 1<<4, /* FIFO Loopback Off */ + GMC_PAUSE_ON = 1<<3, /* Pause On */ + GMC_PAUSE_OFF = 1<<2, /* Pause Off */ + GMC_RST_CLR = 1<<1, /* Clear GMAC Reset */ + GMC_RST_SET = 1<<0, /* Set GMAC Reset */ +}; + +/* GPHY_CTRL 32 bit GPHY Control Reg (YUKON only) */ +enum { + GPC_SEL_BDT = 1<<28, /* Select Bi-Dir. Transfer for MDC/MDIO */ + GPC_INT_POL_HI = 1<<27, /* IRQ Polarity is Active HIGH */ + GPC_75_OHM = 1<<26, /* Use 75 Ohm Termination instead of 50 */ + GPC_DIS_FC = 1<<25, /* Disable Automatic Fiber/Copper Detection */ + GPC_DIS_SLEEP = 1<<24, /* Disable Energy Detect */ + GPC_HWCFG_M_3 = 1<<23, /* HWCFG_MODE[3] */ + GPC_HWCFG_M_2 = 1<<22, /* HWCFG_MODE[2] */ + GPC_HWCFG_M_1 = 1<<21, /* HWCFG_MODE[1] */ + GPC_HWCFG_M_0 = 1<<20, /* HWCFG_MODE[0] */ + GPC_ANEG_0 = 1<<19, /* ANEG[0] */ + GPC_ENA_XC = 1<<18, /* Enable MDI crossover */ + GPC_DIS_125 = 1<<17, /* Disable 125 MHz clock */ + GPC_ANEG_3 = 1<<16, /* ANEG[3] */ + GPC_ANEG_2 = 1<<15, /* ANEG[2] */ + GPC_ANEG_1 = 1<<14, /* ANEG[1] */ + GPC_ENA_PAUSE = 1<<13, /* Enable Pause (SYM_OR_REM) */ + GPC_PHYADDR_4 = 1<<12, /* Bit 4 of Phy Addr */ + GPC_PHYADDR_3 = 1<<11, /* Bit 3 of Phy Addr */ + GPC_PHYADDR_2 = 1<<10, /* Bit 2 of Phy Addr */ + GPC_PHYADDR_1 = 1<<9, /* Bit 1 of Phy Addr */ + GPC_PHYADDR_0 = 1<<8, /* Bit 0 of Phy Addr */ + /* Bits 7..2: reserved */ + GPC_RST_CLR = 1<<1, /* Clear GPHY Reset */ + GPC_RST_SET = 1<<0, /* Set GPHY Reset */ +}; + +#define GPC_HWCFG_GMII_COP (GPC_HWCFG_M_3|GPC_HWCFG_M_2 | GPC_HWCFG_M_1 | GPC_HWCFG_M_0) +#define GPC_HWCFG_GMII_FIB (GPC_HWCFG_M_2 | GPC_HWCFG_M_1 | GPC_HWCFG_M_0) +#define GPC_ANEG_ADV_ALL_M (GPC_ANEG_3 | GPC_ANEG_2 | GPC_ANEG_1 | GPC_ANEG_0) + +/* forced speed and duplex mode (don't mix with other ANEG bits) */ +#define GPC_FRC10MBIT_HALF 0 +#define GPC_FRC10MBIT_FULL GPC_ANEG_0 +#define GPC_FRC100MBIT_HALF GPC_ANEG_1 +#define GPC_FRC100MBIT_FULL (GPC_ANEG_0 | GPC_ANEG_1) + +/* auto-negotiation with limited advertised speeds */ +/* mix only with master/slave settings (for copper) */ +#define GPC_ADV_1000_HALF GPC_ANEG_2 +#define GPC_ADV_1000_FULL GPC_ANEG_3 +#define GPC_ADV_ALL (GPC_ANEG_2 | GPC_ANEG_3) + +/* master/slave settings */ +/* only for copper with 1000 Mbps */ +#define GPC_FORCE_MASTER 0 +#define GPC_FORCE_SLAVE GPC_ANEG_0 +#define GPC_PREF_MASTER GPC_ANEG_1 +#define GPC_PREF_SLAVE (GPC_ANEG_1 | GPC_ANEG_0) + +/* GMAC_IRQ_SRC 8 bit GMAC Interrupt Source Reg (YUKON only) */ +/* GMAC_IRQ_MSK 8 bit GMAC Interrupt Mask Reg (YUKON only) */ +enum { + GM_IS_TX_CO_OV = 1<<5, /* Transmit Counter Overflow IRQ */ + GM_IS_RX_CO_OV = 1<<4, /* Receive Counter Overflow IRQ */ + GM_IS_TX_FF_UR = 1<<3, /* Transmit FIFO Underrun */ + GM_IS_TX_COMPL = 1<<2, /* Frame Transmission Complete */ + GM_IS_RX_FF_OR = 1<<1, /* Receive FIFO Overrun */ + GM_IS_RX_COMPL = 1<<0, /* Frame Reception Complete */ + +#define GMAC_DEF_MSK (GM_IS_TX_CO_OV | GM_IS_RX_CO_OV | GM_IS_TX_FF_UR) + +/* GMAC_LINK_CTRL 16 bit GMAC Link Control Reg (YUKON only) */ + /* Bits 15.. 2: reserved */ + GMLC_RST_CLR = 1<<1, /* Clear GMAC Link Reset */ + GMLC_RST_SET = 1<<0, /* Set GMAC Link Reset */ + + +/* WOL_CTRL_STAT 16 bit WOL Control/Status Reg */ + WOL_CTL_LINK_CHG_OCC = 1<<15, + WOL_CTL_MAGIC_PKT_OCC = 1<<14, + WOL_CTL_PATTERN_OCC = 1<<13, + + WOL_CTL_CLEAR_RESULT = 1<<12, + WOL_CTL_ENA_PME_ON_LINK_CHG = 1<<11, + WOL_CTL_DIS_PME_ON_LINK_CHG = 1<<10, + WOL_CTL_ENA_PME_ON_MAGIC_PKT = 1<<9, + WOL_CTL_DIS_PME_ON_MAGIC_PKT = 1<<8, + WOL_CTL_ENA_PME_ON_PATTERN = 1<<7, + WOL_CTL_DIS_PME_ON_PATTERN = 1<<6, + WOL_CTL_ENA_LINK_CHG_UNIT = 1<<5, + WOL_CTL_DIS_LINK_CHG_UNIT = 1<<4, + WOL_CTL_ENA_MAGIC_PKT_UNIT = 1<<3, + WOL_CTL_DIS_MAGIC_PKT_UNIT = 1<<2, + WOL_CTL_ENA_PATTERN_UNIT = 1<<1, + WOL_CTL_DIS_PATTERN_UNIT = 1<<0, +}; + +#define WOL_CTL_DEFAULT \ + (WOL_CTL_DIS_PME_ON_LINK_CHG | \ + WOL_CTL_DIS_PME_ON_PATTERN | \ + WOL_CTL_DIS_PME_ON_MAGIC_PKT | \ + WOL_CTL_DIS_LINK_CHG_UNIT | \ + WOL_CTL_DIS_PATTERN_UNIT | \ + WOL_CTL_DIS_MAGIC_PKT_UNIT) + +/* WOL_MATCH_CTL 8 bit WOL Match Control Reg */ +#define WOL_CTL_PATT_ENA(x) (BIT_0 << (x)) + + +/* XMAC II registers */ +enum { + XM_MMU_CMD = 0x0000, /* 16 bit r/w MMU Command Register */ + XM_POFF = 0x0008, /* 32 bit r/w Packet Offset Register */ + XM_BURST = 0x000c, /* 32 bit r/w Burst Register for half duplex*/ + XM_1L_VLAN_TAG = 0x0010, /* 16 bit r/w One Level VLAN Tag ID */ + XM_2L_VLAN_TAG = 0x0014, /* 16 bit r/w Two Level VLAN Tag ID */ + XM_TX_CMD = 0x0020, /* 16 bit r/w Transmit Command Register */ + XM_TX_RT_LIM = 0x0024, /* 16 bit r/w Transmit Retry Limit Register */ + XM_TX_STIME = 0x0028, /* 16 bit r/w Transmit Slottime Register */ + XM_TX_IPG = 0x002c, /* 16 bit r/w Transmit Inter Packet Gap */ + XM_RX_CMD = 0x0030, /* 16 bit r/w Receive Command Register */ + XM_PHY_ADDR = 0x0034, /* 16 bit r/w PHY Address Register */ + XM_PHY_DATA = 0x0038, /* 16 bit r/w PHY Data Register */ + XM_GP_PORT = 0x0040, /* 32 bit r/w General Purpose Port Register */ + XM_IMSK = 0x0044, /* 16 bit r/w Interrupt Mask Register */ + XM_ISRC = 0x0048, /* 16 bit r/o Interrupt Status Register */ + XM_HW_CFG = 0x004c, /* 16 bit r/w Hardware Config Register */ + XM_TX_LO_WM = 0x0060, /* 16 bit r/w Tx FIFO Low Water Mark */ + XM_TX_HI_WM = 0x0062, /* 16 bit r/w Tx FIFO High Water Mark */ + XM_TX_THR = 0x0064, /* 16 bit r/w Tx Request Threshold */ + XM_HT_THR = 0x0066, /* 16 bit r/w Host Request Threshold */ + XM_PAUSE_DA = 0x0068, /* NA reg r/w Pause Destination Address */ + XM_CTL_PARA = 0x0070, /* 32 bit r/w Control Parameter Register */ + XM_MAC_OPCODE = 0x0074, /* 16 bit r/w Opcode for MAC control frames */ + XM_MAC_PTIME = 0x0076, /* 16 bit r/w Pause time for MAC ctrl frames*/ + XM_TX_STAT = 0x0078, /* 32 bit r/o Tx Status LIFO Register */ + + XM_EXM_START = 0x0080, /* r/w Start Address of the EXM Regs */ +#define XM_EXM(reg) (XM_EXM_START + ((reg) << 3)) +}; + +enum { + XM_SRC_CHK = 0x0100, /* NA reg r/w Source Check Address Register */ + XM_SA = 0x0108, /* NA reg r/w Station Address Register */ + XM_HSM = 0x0110, /* 64 bit r/w Hash Match Address Registers */ + XM_RX_LO_WM = 0x0118, /* 16 bit r/w Receive Low Water Mark */ + XM_RX_HI_WM = 0x011a, /* 16 bit r/w Receive High Water Mark */ + XM_RX_THR = 0x011c, /* 32 bit r/w Receive Request Threshold */ + XM_DEV_ID = 0x0120, /* 32 bit r/o Device ID Register */ + XM_MODE = 0x0124, /* 32 bit r/w Mode Register */ + XM_LSA = 0x0128, /* NA reg r/o Last Source Register */ + XM_TS_READ = 0x0130, /* 32 bit r/o Time Stamp Read Register */ + XM_TS_LOAD = 0x0134, /* 32 bit r/o Time Stamp Load Value */ + XM_STAT_CMD = 0x0200, /* 16 bit r/w Statistics Command Register */ + XM_RX_CNT_EV = 0x0204, /* 32 bit r/o Rx Counter Event Register */ + XM_TX_CNT_EV = 0x0208, /* 32 bit r/o Tx Counter Event Register */ + XM_RX_EV_MSK = 0x020c, /* 32 bit r/w Rx Counter Event Mask */ + XM_TX_EV_MSK = 0x0210, /* 32 bit r/w Tx Counter Event Mask */ + XM_TXF_OK = 0x0280, /* 32 bit r/o Frames Transmitted OK Conuter */ + XM_TXO_OK_HI = 0x0284, /* 32 bit r/o Octets Transmitted OK High Cnt*/ + XM_TXO_OK_LO = 0x0288, /* 32 bit r/o Octets Transmitted OK Low Cnt */ + XM_TXF_BC_OK = 0x028c, /* 32 bit r/o Broadcast Frames Xmitted OK */ + XM_TXF_MC_OK = 0x0290, /* 32 bit r/o Multicast Frames Xmitted OK */ + XM_TXF_UC_OK = 0x0294, /* 32 bit r/o Unicast Frames Xmitted OK */ + XM_TXF_LONG = 0x0298, /* 32 bit r/o Tx Long Frame Counter */ + XM_TXE_BURST = 0x029c, /* 32 bit r/o Tx Burst Event Counter */ + XM_TXF_MPAUSE = 0x02a0, /* 32 bit r/o Tx Pause MAC Ctrl Frame Cnt */ + XM_TXF_MCTRL = 0x02a4, /* 32 bit r/o Tx MAC Ctrl Frame Counter */ + XM_TXF_SNG_COL = 0x02a8, /* 32 bit r/o Tx Single Collision Counter */ + XM_TXF_MUL_COL = 0x02ac, /* 32 bit r/o Tx Multiple Collision Counter */ + XM_TXF_ABO_COL = 0x02b0, /* 32 bit r/o Tx aborted due to Exces. Col. */ + XM_TXF_LAT_COL = 0x02b4, /* 32 bit r/o Tx Late Collision Counter */ + XM_TXF_DEF = 0x02b8, /* 32 bit r/o Tx Deferred Frame Counter */ + XM_TXF_EX_DEF = 0x02bc, /* 32 bit r/o Tx Excessive Deferall Counter */ + XM_TXE_FIFO_UR = 0x02c0, /* 32 bit r/o Tx FIFO Underrun Event Cnt */ + XM_TXE_CS_ERR = 0x02c4, /* 32 bit r/o Tx Carrier Sense Error Cnt */ + XM_TXP_UTIL = 0x02c8, /* 32 bit r/o Tx Utilization in % */ + XM_TXF_64B = 0x02d0, /* 32 bit r/o 64 Byte Tx Frame Counter */ + XM_TXF_127B = 0x02d4, /* 32 bit r/o 65-127 Byte Tx Frame Counter */ + XM_TXF_255B = 0x02d8, /* 32 bit r/o 128-255 Byte Tx Frame Counter */ + XM_TXF_511B = 0x02dc, /* 32 bit r/o 256-511 Byte Tx Frame Counter */ + XM_TXF_1023B = 0x02e0, /* 32 bit r/o 512-1023 Byte Tx Frame Counter*/ + XM_TXF_MAX_SZ = 0x02e4, /* 32 bit r/o 1024-MaxSize Byte Tx Frame Cnt*/ + XM_RXF_OK = 0x0300, /* 32 bit r/o Frames Received OK */ + XM_RXO_OK_HI = 0x0304, /* 32 bit r/o Octets Received OK High Cnt */ + XM_RXO_OK_LO = 0x0308, /* 32 bit r/o Octets Received OK Low Counter*/ + XM_RXF_BC_OK = 0x030c, /* 32 bit r/o Broadcast Frames Received OK */ + XM_RXF_MC_OK = 0x0310, /* 32 bit r/o Multicast Frames Received OK */ + XM_RXF_UC_OK = 0x0314, /* 32 bit r/o Unicast Frames Received OK */ + XM_RXF_MPAUSE = 0x0318, /* 32 bit r/o Rx Pause MAC Ctrl Frame Cnt */ + XM_RXF_MCTRL = 0x031c, /* 32 bit r/o Rx MAC Ctrl Frame Counter */ + XM_RXF_INV_MP = 0x0320, /* 32 bit r/o Rx invalid Pause Frame Cnt */ + XM_RXF_INV_MOC = 0x0324, /* 32 bit r/o Rx Frames with inv. MAC Opcode*/ + XM_RXE_BURST = 0x0328, /* 32 bit r/o Rx Burst Event Counter */ + XM_RXE_FMISS = 0x032c, /* 32 bit r/o Rx Missed Frames Event Cnt */ + XM_RXF_FRA_ERR = 0x0330, /* 32 bit r/o Rx Framing Error Counter */ + XM_RXE_FIFO_OV = 0x0334, /* 32 bit r/o Rx FIFO overflow Event Cnt */ + XM_RXF_JAB_PKT = 0x0338, /* 32 bit r/o Rx Jabber Packet Frame Cnt */ + XM_RXE_CAR_ERR = 0x033c, /* 32 bit r/o Rx Carrier Event Error Cnt */ + XM_RXF_LEN_ERR = 0x0340, /* 32 bit r/o Rx in Range Length Error */ + XM_RXE_SYM_ERR = 0x0344, /* 32 bit r/o Rx Symbol Error Counter */ + XM_RXE_SHT_ERR = 0x0348, /* 32 bit r/o Rx Short Event Error Cnt */ + XM_RXE_RUNT = 0x034c, /* 32 bit r/o Rx Runt Event Counter */ + XM_RXF_LNG_ERR = 0x0350, /* 32 bit r/o Rx Frame too Long Error Cnt */ + XM_RXF_FCS_ERR = 0x0354, /* 32 bit r/o Rx Frame Check Seq. Error Cnt */ + XM_RXF_CEX_ERR = 0x035c, /* 32 bit r/o Rx Carrier Ext Error Frame Cnt*/ + XM_RXP_UTIL = 0x0360, /* 32 bit r/o Rx Utilization in % */ + XM_RXF_64B = 0x0368, /* 32 bit r/o 64 Byte Rx Frame Counter */ + XM_RXF_127B = 0x036c, /* 32 bit r/o 65-127 Byte Rx Frame Counter */ + XM_RXF_255B = 0x0370, /* 32 bit r/o 128-255 Byte Rx Frame Counter */ + XM_RXF_511B = 0x0374, /* 32 bit r/o 256-511 Byte Rx Frame Counter */ + XM_RXF_1023B = 0x0378, /* 32 bit r/o 512-1023 Byte Rx Frame Counter*/ + XM_RXF_MAX_SZ = 0x037c, /* 32 bit r/o 1024-MaxSize Byte Rx Frame Cnt*/ +}; + +/* XM_MMU_CMD 16 bit r/w MMU Command Register */ +enum { + XM_MMU_PHY_RDY = 1<<12,/* Bit 12: PHY Read Ready */ + XM_MMU_PHY_BUSY = 1<<11,/* Bit 11: PHY Busy */ + XM_MMU_IGN_PF = 1<<10,/* Bit 10: Ignore Pause Frame */ + XM_MMU_MAC_LB = 1<<9, /* Bit 9: Enable MAC Loopback */ + XM_MMU_FRC_COL = 1<<7, /* Bit 7: Force Collision */ + XM_MMU_SIM_COL = 1<<6, /* Bit 6: Simulate Collision */ + XM_MMU_NO_PRE = 1<<5, /* Bit 5: No MDIO Preamble */ + XM_MMU_GMII_FD = 1<<4, /* Bit 4: GMII uses Full Duplex */ + XM_MMU_RAT_CTRL = 1<<3, /* Bit 3: Enable Rate Control */ + XM_MMU_GMII_LOOP= 1<<2, /* Bit 2: PHY is in Loopback Mode */ + XM_MMU_ENA_RX = 1<<1, /* Bit 1: Enable Receiver */ + XM_MMU_ENA_TX = 1<<0, /* Bit 0: Enable Transmitter */ +}; + + +/* XM_TX_CMD 16 bit r/w Transmit Command Register */ +enum { + XM_TX_BK2BK = 1<<6, /* Bit 6: Ignor Carrier Sense (Tx Bk2Bk)*/ + XM_TX_ENC_BYP = 1<<5, /* Bit 5: Set Encoder in Bypass Mode */ + XM_TX_SAM_LINE = 1<<4, /* Bit 4: (sc) Start utilization calculation */ + XM_TX_NO_GIG_MD = 1<<3, /* Bit 3: Disable Carrier Extension */ + XM_TX_NO_PRE = 1<<2, /* Bit 2: Disable Preamble Generation */ + XM_TX_NO_CRC = 1<<1, /* Bit 1: Disable CRC Generation */ + XM_TX_AUTO_PAD = 1<<0, /* Bit 0: Enable Automatic Padding */ +}; + +/* XM_TX_RT_LIM 16 bit r/w Transmit Retry Limit Register */ +#define XM_RT_LIM_MSK 0x1f /* Bit 4..0: Tx Retry Limit */ + + +/* XM_TX_STIME 16 bit r/w Transmit Slottime Register */ +#define XM_STIME_MSK 0x7f /* Bit 6..0: Tx Slottime bits */ + + +/* XM_TX_IPG 16 bit r/w Transmit Inter Packet Gap */ +#define XM_IPG_MSK 0xff /* Bit 7..0: IPG value bits */ + + +/* XM_RX_CMD 16 bit r/w Receive Command Register */ +enum { + XM_RX_LENERR_OK = 1<<8, /* Bit 8 don't set Rx Err bit for */ + /* inrange error packets */ + XM_RX_BIG_PK_OK = 1<<7, /* Bit 7 don't set Rx Err bit for */ + /* jumbo packets */ + XM_RX_IPG_CAP = 1<<6, /* Bit 6 repl. type field with IPG */ + XM_RX_TP_MD = 1<<5, /* Bit 5: Enable transparent Mode */ + XM_RX_STRIP_FCS = 1<<4, /* Bit 4: Enable FCS Stripping */ + XM_RX_SELF_RX = 1<<3, /* Bit 3: Enable Rx of own packets */ + XM_RX_SAM_LINE = 1<<2, /* Bit 2: (sc) Start utilization calculation */ + XM_RX_STRIP_PAD = 1<<1, /* Bit 1: Strip pad bytes of Rx frames */ + XM_RX_DIS_CEXT = 1<<0, /* Bit 0: Disable carrier ext. check */ +}; + + +/* XM_PHY_ADDR 16 bit r/w PHY Address Register */ +#define XM_PHY_ADDR_SZ 0x1f /* Bit 4..0: PHY Address bits */ + + +/* XM_GP_PORT 32 bit r/w General Purpose Port Register */ +enum { + XM_GP_ANIP = 1<<6, /* Bit 6: (ro) Auto-Neg. in progress */ + XM_GP_FRC_INT = 1<<5, /* Bit 5: (sc) Force Interrupt */ + XM_GP_RES_MAC = 1<<3, /* Bit 3: (sc) Reset MAC and FIFOs */ + XM_GP_RES_STAT = 1<<2, /* Bit 2: (sc) Reset the statistics module */ + XM_GP_INP_ASS = 1<<0, /* Bit 0: (ro) GP Input Pin asserted */ +}; + + +/* XM_IMSK 16 bit r/w Interrupt Mask Register */ +/* XM_ISRC 16 bit r/o Interrupt Status Register */ +enum { + XM_IS_LNK_AE = 1<<14, /* Bit 14: Link Asynchronous Event */ + XM_IS_TX_ABORT = 1<<13, /* Bit 13: Transmit Abort, late Col. etc */ + XM_IS_FRC_INT = 1<<12, /* Bit 12: Force INT bit set in GP */ + XM_IS_INP_ASS = 1<<11, /* Bit 11: Input Asserted, GP bit 0 set */ + XM_IS_LIPA_RC = 1<<10, /* Bit 10: Link Partner requests config */ + XM_IS_RX_PAGE = 1<<9, /* Bit 9: Page Received */ + XM_IS_TX_PAGE = 1<<8, /* Bit 8: Next Page Loaded for Transmit */ + XM_IS_AND = 1<<7, /* Bit 7: Auto-Negotiation Done */ + XM_IS_TSC_OV = 1<<6, /* Bit 6: Time Stamp Counter Overflow */ + XM_IS_RXC_OV = 1<<5, /* Bit 5: Rx Counter Event Overflow */ + XM_IS_TXC_OV = 1<<4, /* Bit 4: Tx Counter Event Overflow */ + XM_IS_RXF_OV = 1<<3, /* Bit 3: Receive FIFO Overflow */ + XM_IS_TXF_UR = 1<<2, /* Bit 2: Transmit FIFO Underrun */ + XM_IS_TX_COMP = 1<<1, /* Bit 1: Frame Tx Complete */ + XM_IS_RX_COMP = 1<<0, /* Bit 0: Frame Rx Complete */ +}; + +#define XM_DEF_MSK (~(XM_IS_INP_ASS | XM_IS_LIPA_RC | XM_IS_RX_PAGE | \ + XM_IS_AND | XM_IS_RXC_OV | XM_IS_TXC_OV | \ + XM_IS_RXF_OV | XM_IS_TXF_UR)) + + +/* XM_HW_CFG 16 bit r/w Hardware Config Register */ +enum { + XM_HW_GEN_EOP = 1<<3, /* Bit 3: generate End of Packet pulse */ + XM_HW_COM4SIG = 1<<2, /* Bit 2: use Comma Detect for Sig. Det.*/ + XM_HW_GMII_MD = 1<<0, /* Bit 0: GMII Interface selected */ +}; + + +/* XM_TX_LO_WM 16 bit r/w Tx FIFO Low Water Mark */ +/* XM_TX_HI_WM 16 bit r/w Tx FIFO High Water Mark */ +#define XM_TX_WM_MSK 0x01ff /* Bit 9.. 0 Tx FIFO Watermark bits */ + +/* XM_TX_THR 16 bit r/w Tx Request Threshold */ +/* XM_HT_THR 16 bit r/w Host Request Threshold */ +/* XM_RX_THR 16 bit r/w Rx Request Threshold */ +#define XM_THR_MSK 0x03ff /* Bit 10.. 0 Rx/Tx Request Threshold bits */ + + +/* XM_TX_STAT 32 bit r/o Tx Status LIFO Register */ +enum { + XM_ST_VALID = (1UL<<31), /* Bit 31: Status Valid */ + XM_ST_BYTE_CNT = (0x3fffL<<17), /* Bit 30..17: Tx frame Length */ + XM_ST_RETRY_CNT = (0x1fL<<12), /* Bit 16..12: Retry Count */ + XM_ST_EX_COL = 1<<11, /* Bit 11: Excessive Collisions */ + XM_ST_EX_DEF = 1<<10, /* Bit 10: Excessive Deferral */ + XM_ST_BURST = 1<<9, /* Bit 9: p. xmitted in burst md*/ + XM_ST_DEFER = 1<<8, /* Bit 8: packet was defered */ + XM_ST_BC = 1<<7, /* Bit 7: Broadcast packet */ + XM_ST_MC = 1<<6, /* Bit 6: Multicast packet */ + XM_ST_UC = 1<<5, /* Bit 5: Unicast packet */ + XM_ST_TX_UR = 1<<4, /* Bit 4: FIFO Underrun occured */ + XM_ST_CS_ERR = 1<<3, /* Bit 3: Carrier Sense Error */ + XM_ST_LAT_COL = 1<<2, /* Bit 2: Late Collision Error */ + XM_ST_MUL_COL = 1<<1, /* Bit 1: Multiple Collisions */ + XM_ST_SGN_COL = 1<<0, /* Bit 0: Single Collision */ +}; + +/* XM_RX_LO_WM 16 bit r/w Receive Low Water Mark */ +/* XM_RX_HI_WM 16 bit r/w Receive High Water Mark */ +#define XM_RX_WM_MSK 0x03ff /* Bit 11.. 0: Rx FIFO Watermark bits */ + + +/* XM_DEV_ID 32 bit r/o Device ID Register */ +#define XM_DEV_OUI (0x00ffffffUL<<8) /* Bit 31..8: Device OUI */ +#define XM_DEV_REV (0x07L << 5) /* Bit 7..5: Chip Rev Num */ + + +/* XM_MODE 32 bit r/w Mode Register */ +enum { + XM_MD_ENA_REJ = 1<<26, /* Bit 26: Enable Frame Reject */ + XM_MD_SPOE_E = 1<<25, /* Bit 25: Send Pause on Edge */ + /* extern generated */ + XM_MD_TX_REP = 1<<24, /* Bit 24: Transmit Repeater Mode */ + XM_MD_SPOFF_I = 1<<23, /* Bit 23: Send Pause on FIFO full */ + /* intern generated */ + XM_MD_LE_STW = 1<<22, /* Bit 22: Rx Stat Word in Little Endian */ + XM_MD_TX_CONT = 1<<21, /* Bit 21: Send Continuous */ + XM_MD_TX_PAUSE = 1<<20, /* Bit 20: (sc) Send Pause Frame */ + XM_MD_ATS = 1<<19, /* Bit 19: Append Time Stamp */ + XM_MD_SPOL_I = 1<<18, /* Bit 18: Send Pause on Low */ + /* intern generated */ + XM_MD_SPOH_I = 1<<17, /* Bit 17: Send Pause on High */ + /* intern generated */ + XM_MD_CAP = 1<<16, /* Bit 16: Check Address Pair */ + XM_MD_ENA_HASH = 1<<15, /* Bit 15: Enable Hashing */ + XM_MD_CSA = 1<<14, /* Bit 14: Check Station Address */ + XM_MD_CAA = 1<<13, /* Bit 13: Check Address Array */ + XM_MD_RX_MCTRL = 1<<12, /* Bit 12: Rx MAC Control Frame */ + XM_MD_RX_RUNT = 1<<11, /* Bit 11: Rx Runt Frames */ + XM_MD_RX_IRLE = 1<<10, /* Bit 10: Rx in Range Len Err Frame */ + XM_MD_RX_LONG = 1<<9, /* Bit 9: Rx Long Frame */ + XM_MD_RX_CRCE = 1<<8, /* Bit 8: Rx CRC Error Frame */ + XM_MD_RX_ERR = 1<<7, /* Bit 7: Rx Error Frame */ + XM_MD_DIS_UC = 1<<6, /* Bit 6: Disable Rx Unicast */ + XM_MD_DIS_MC = 1<<5, /* Bit 5: Disable Rx Multicast */ + XM_MD_DIS_BC = 1<<4, /* Bit 4: Disable Rx Broadcast */ + XM_MD_ENA_PROM = 1<<3, /* Bit 3: Enable Promiscuous */ + XM_MD_ENA_BE = 1<<2, /* Bit 2: Enable Big Endian */ + XM_MD_FTF = 1<<1, /* Bit 1: (sc) Flush Tx FIFO */ + XM_MD_FRF = 1<<0, /* Bit 0: (sc) Flush Rx FIFO */ +}; + +#define XM_PAUSE_MODE (XM_MD_SPOE_E | XM_MD_SPOL_I | XM_MD_SPOH_I) +#define XM_DEF_MODE (XM_MD_RX_RUNT | XM_MD_RX_IRLE | XM_MD_RX_LONG |\ + XM_MD_RX_CRCE | XM_MD_RX_ERR | XM_MD_CSA | XM_MD_CAA) + +/* XM_STAT_CMD 16 bit r/w Statistics Command Register */ +enum { + XM_SC_SNP_RXC = 1<<5, /* Bit 5: (sc) Snap Rx Counters */ + XM_SC_SNP_TXC = 1<<4, /* Bit 4: (sc) Snap Tx Counters */ + XM_SC_CP_RXC = 1<<3, /* Bit 3: Copy Rx Counters Continuously */ + XM_SC_CP_TXC = 1<<2, /* Bit 2: Copy Tx Counters Continuously */ + XM_SC_CLR_RXC = 1<<1, /* Bit 1: (sc) Clear Rx Counters */ + XM_SC_CLR_TXC = 1<<0, /* Bit 0: (sc) Clear Tx Counters */ +}; + + +/* XM_RX_CNT_EV 32 bit r/o Rx Counter Event Register */ +/* XM_RX_EV_MSK 32 bit r/w Rx Counter Event Mask */ +enum { + XMR_MAX_SZ_OV = 1<<31, /* Bit 31: 1024-MaxSize Rx Cnt Ov*/ + XMR_1023B_OV = 1<<30, /* Bit 30: 512-1023Byte Rx Cnt Ov*/ + XMR_511B_OV = 1<<29, /* Bit 29: 256-511 Byte Rx Cnt Ov*/ + XMR_255B_OV = 1<<28, /* Bit 28: 128-255 Byte Rx Cnt Ov*/ + XMR_127B_OV = 1<<27, /* Bit 27: 65-127 Byte Rx Cnt Ov */ + XMR_64B_OV = 1<<26, /* Bit 26: 64 Byte Rx Cnt Ov */ + XMR_UTIL_OV = 1<<25, /* Bit 25: Rx Util Cnt Overflow */ + XMR_UTIL_UR = 1<<24, /* Bit 24: Rx Util Cnt Underrun */ + XMR_CEX_ERR_OV = 1<<23, /* Bit 23: CEXT Err Cnt Ov */ + XMR_FCS_ERR_OV = 1<<21, /* Bit 21: Rx FCS Error Cnt Ov */ + XMR_LNG_ERR_OV = 1<<20, /* Bit 20: Rx too Long Err Cnt Ov*/ + XMR_RUNT_OV = 1<<19, /* Bit 19: Runt Event Cnt Ov */ + XMR_SHT_ERR_OV = 1<<18, /* Bit 18: Rx Short Ev Err Cnt Ov*/ + XMR_SYM_ERR_OV = 1<<17, /* Bit 17: Rx Sym Err Cnt Ov */ + XMR_CAR_ERR_OV = 1<<15, /* Bit 15: Rx Carr Ev Err Cnt Ov */ + XMR_JAB_PKT_OV = 1<<14, /* Bit 14: Rx Jabb Packet Cnt Ov */ + XMR_FIFO_OV = 1<<13, /* Bit 13: Rx FIFO Ov Ev Cnt Ov */ + XMR_FRA_ERR_OV = 1<<12, /* Bit 12: Rx Framing Err Cnt Ov */ + XMR_FMISS_OV = 1<<11, /* Bit 11: Rx Missed Ev Cnt Ov */ + XMR_BURST = 1<<10, /* Bit 10: Rx Burst Event Cnt Ov */ + XMR_INV_MOC = 1<<9, /* Bit 9: Rx with inv. MAC OC Ov*/ + XMR_INV_MP = 1<<8, /* Bit 8: Rx inv Pause Frame Ov */ + XMR_MCTRL_OV = 1<<7, /* Bit 7: Rx MAC Ctrl-F Cnt Ov */ + XMR_MPAUSE_OV = 1<<6, /* Bit 6: Rx Pause MAC Ctrl-F Ov*/ + XMR_UC_OK_OV = 1<<5, /* Bit 5: Rx Unicast Frame CntOv*/ + XMR_MC_OK_OV = 1<<4, /* Bit 4: Rx Multicast Cnt Ov */ + XMR_BC_OK_OV = 1<<3, /* Bit 3: Rx Broadcast Cnt Ov */ + XMR_OK_LO_OV = 1<<2, /* Bit 2: Octets Rx OK Low CntOv*/ + XMR_OK_HI_OV = 1<<1, /* Bit 1: Octets Rx OK Hi Cnt Ov*/ + XMR_OK_OV = 1<<0, /* Bit 0: Frames Received Ok Ov */ +}; + +#define XMR_DEF_MSK (XMR_OK_LO_OV | XMR_OK_HI_OV) + +/* XM_TX_CNT_EV 32 bit r/o Tx Counter Event Register */ +/* XM_TX_EV_MSK 32 bit r/w Tx Counter Event Mask */ +enum { + XMT_MAX_SZ_OV = 1<<25, /* Bit 25: 1024-MaxSize Tx Cnt Ov*/ + XMT_1023B_OV = 1<<24, /* Bit 24: 512-1023Byte Tx Cnt Ov*/ + XMT_511B_OV = 1<<23, /* Bit 23: 256-511 Byte Tx Cnt Ov*/ + XMT_255B_OV = 1<<22, /* Bit 22: 128-255 Byte Tx Cnt Ov*/ + XMT_127B_OV = 1<<21, /* Bit 21: 65-127 Byte Tx Cnt Ov */ + XMT_64B_OV = 1<<20, /* Bit 20: 64 Byte Tx Cnt Ov */ + XMT_UTIL_OV = 1<<19, /* Bit 19: Tx Util Cnt Overflow */ + XMT_UTIL_UR = 1<<18, /* Bit 18: Tx Util Cnt Underrun */ + XMT_CS_ERR_OV = 1<<17, /* Bit 17: Tx Carr Sen Err Cnt Ov*/ + XMT_FIFO_UR_OV = 1<<16, /* Bit 16: Tx FIFO Ur Ev Cnt Ov */ + XMT_EX_DEF_OV = 1<<15, /* Bit 15: Tx Ex Deferall Cnt Ov */ + XMT_DEF = 1<<14, /* Bit 14: Tx Deferred Cnt Ov */ + XMT_LAT_COL_OV = 1<<13, /* Bit 13: Tx Late Col Cnt Ov */ + XMT_ABO_COL_OV = 1<<12, /* Bit 12: Tx abo dueto Ex Col Ov*/ + XMT_MUL_COL_OV = 1<<11, /* Bit 11: Tx Mult Col Cnt Ov */ + XMT_SNG_COL = 1<<10, /* Bit 10: Tx Single Col Cnt Ov */ + XMT_MCTRL_OV = 1<<9, /* Bit 9: Tx MAC Ctrl Counter Ov*/ + XMT_MPAUSE = 1<<8, /* Bit 8: Tx Pause MAC Ctrl-F Ov*/ + XMT_BURST = 1<<7, /* Bit 7: Tx Burst Event Cnt Ov */ + XMT_LONG = 1<<6, /* Bit 6: Tx Long Frame Cnt Ov */ + XMT_UC_OK_OV = 1<<5, /* Bit 5: Tx Unicast Cnt Ov */ + XMT_MC_OK_OV = 1<<4, /* Bit 4: Tx Multicast Cnt Ov */ + XMT_BC_OK_OV = 1<<3, /* Bit 3: Tx Broadcast Cnt Ov */ + XMT_OK_LO_OV = 1<<2, /* Bit 2: Octets Tx OK Low CntOv*/ + XMT_OK_HI_OV = 1<<1, /* Bit 1: Octets Tx OK Hi Cnt Ov*/ + XMT_OK_OV = 1<<0, /* Bit 0: Frames Tx Ok Ov */ +}; + +#define XMT_DEF_MSK (XMT_OK_LO_OV | XMT_OK_HI_OV) + +struct skge_rx_desc { + u32 control; + u32 next_offset; + u32 dma_lo; + u32 dma_hi; + u32 status; + u32 timestamp; + u16 csum2; + u16 csum1; + u16 csum2_start; + u16 csum1_start; +}; + +struct skge_tx_desc { + u32 control; + u32 next_offset; + u32 dma_lo; + u32 dma_hi; + u32 status; + u32 csum_startval; + u16 csum_writepos; + u16 csum_startpos; + u32 rsvd; +}; + +struct skge_element { + struct skge_element *next; + void *desc; + struct sk_buff *skb; + DECLARE_PCI_UNMAP_ADDR(mapaddr); + DECLARE_PCI_UNMAP_LEN(maplen); +}; + +struct skge_ring { + struct skge_element *to_clean; + struct skge_element *to_use; + struct skge_element *start; + unsigned long count; +}; + + +struct skge_hw { + void __iomem *regs; + struct pci_dev *pdev; + u32 intr_mask; + struct net_device *dev[2]; + + spinlock_t phy_lock; + struct tasklet_struct ext_tasklet; + + u8 chip_id; + u8 mac_cfg; + u8 phy_type; + u8 pmd_type; + u16 phy_addr; + + u32 rom_size; + u32 ram_size; + u32 ram_offset; + +}; + +static inline int isdualport(const struct skge_hw *hw) +{ + return !(hw->mac_cfg & CFG_SNG_MAC); +} + +static inline u8 chip_rev(const struct skge_hw *hw) +{ + return (hw->mac_cfg & CFG_CHIP_R_MSK) >> 4; +} + +static inline int iscopper(const struct skge_hw *hw) +{ + return (hw->pmd_type == 'T'); +} + +enum { + FLOW_MODE_NONE = 0, /* No Flow-Control */ + FLOW_MODE_LOC_SEND = 1, /* Local station sends PAUSE */ + FLOW_MODE_REM_SEND = 2, /* Symmetric or just remote */ + FLOW_MODE_SYMMETRIC = 3, /* Both stations may send PAUSE */ +}; + +struct skge_port { + struct skge_hw *hw; + struct net_device *netdev; + u32 msg_enable; + u8 port; + u8 rx_csum; + u8 blink_on; + u8 flow_control; + u8 autoneg; /* AUTONEG_ENABLE, AUTONEG_DISABLE */ + u8 duplex; /* DUPLEX_HALF, DUPLEX_FULL */ + u16 speed; /* SPEED_1000, SPEED_100, ... */ + + void *mem; /* PCI memory for rings */ + dma_addr_t dma; + unsigned long mem_size; + + spinlock_t tx_lock; + u32 tx_avail; + struct skge_ring tx_ring; + struct skge_ring rx_ring; + + struct net_device_stats net_stats; + struct timer_list link_check; + struct timer_list led_blink; +}; + + +/* Register accessor for memory mapped device */ +static inline u32 skge_read32(const struct skge_hw *hw, int reg) +{ + return readl(hw->regs + reg); + +} + +static inline u16 skge_read16(const struct skge_hw *hw, int reg) +{ + return readw(hw->regs + reg); +} + +static inline u8 skge_read8(const struct skge_hw *hw, int reg) +{ + return readb(hw->regs + reg); +} + +static inline void skge_write32(const struct skge_hw *hw, int reg, u32 val) +{ + writel(val, hw->regs + reg); +} + +static inline void skge_write16(const struct skge_hw *hw, int reg, u16 val) +{ + writew(val, hw->regs + reg); +} + +static inline void skge_write8(const struct skge_hw *hw, int reg, u8 val) +{ + writeb(val, hw->regs + reg); +} + +/* MAC Related Registers inside the device. */ +#define SKGEMAC_REG(port,reg) (((port)<<7)+(reg)) + +/* PCI config space can be accessed via memory mapped space */ +#define SKGEPCI_REG(reg) ((reg)+ 0x380) + +#define SKGEXM_REG(port, reg) \ + ((BASE_XMAC_1 + (port) * (BASE_XMAC_2 - BASE_XMAC_1)) | (reg) << 1) + +static inline u32 skge_xm_read32(const struct skge_hw *hw, int port, int reg) +{ + return skge_read32(hw, SKGEXM_REG(port,reg)); +} + +static inline u16 skge_xm_read16(const struct skge_hw *hw, int port, int reg) +{ + return skge_read16(hw, SKGEXM_REG(port,reg)); +} + +static inline u8 skge_xm_read8(const struct skge_hw *hw, int port, int reg) +{ + return skge_read8(hw, SKGEXM_REG(port,reg)); +} + +static inline void skge_xm_write32(const struct skge_hw *hw, int port, int r, u32 v) +{ + skge_write32(hw, SKGEXM_REG(port,r), v); +} + +static inline void skge_xm_write16(const struct skge_hw *hw, int port, int r, u16 v) +{ + skge_write16(hw, SKGEXM_REG(port,r), v); +} + +static inline void skge_xm_write8(const struct skge_hw *hw, int port, int r, u8 v) +{ + skge_write8(hw, SKGEXM_REG(port,r), v); +} + +static inline void skge_xm_outhash(const struct skge_hw *hw, int port, int reg, + const u8 *hash) +{ + skge_xm_write16(hw, port, reg, + (u16)hash[0] | ((u16)hash[1] << 8)); + skge_xm_write16(hw, port, reg+2, + (u16)hash[2] | ((u16)hash[3] << 8)); + skge_xm_write16(hw, port, reg+4, + (u16)hash[4] | ((u16)hash[5] << 8)); + skge_xm_write16(hw, port, reg+6, + (u16)hash[6] | ((u16)hash[7] << 8)); +} + +static inline void skge_xm_outaddr(const struct skge_hw *hw, int port, int reg, + const u8 *addr) +{ + skge_xm_write16(hw, port, reg, + (u16)addr[0] | ((u16)addr[1] << 8)); + skge_xm_write16(hw, port, reg, + (u16)addr[2] | ((u16)addr[3] << 8)); + skge_xm_write16(hw, port, reg, + (u16)addr[4] | ((u16)addr[5] << 8)); +} + + +#define SKGEGMA_REG(port,reg) \ + ((reg) + BASE_GMAC_1 + \ + (port) * (BASE_GMAC_2-BASE_GMAC_1)) + +static inline u16 skge_gma_read16(const struct skge_hw *hw, int port, int reg) +{ + return skge_read16(hw, SKGEGMA_REG(port,reg)); +} + +static inline u32 skge_gma_read32(const struct skge_hw *hw, int port, int reg) +{ + return (u32) skge_read16(hw, SKGEGMA_REG(port,reg)) + | ((u32)skge_read16(hw, SKGEGMA_REG(port,reg+4)) << 16); +} + +static inline u8 skge_gma_read8(const struct skge_hw *hw, int port, int reg) +{ + return skge_read8(hw, SKGEGMA_REG(port,reg)); +} + +static inline void skge_gma_write16(const struct skge_hw *hw, int port, int r, u16 v) +{ + skge_write16(hw, SKGEGMA_REG(port,r), v); +} + +static inline void skge_gma_write32(const struct skge_hw *hw, int port, int r, u32 v) +{ + skge_write16(hw, SKGEGMA_REG(port, r), (u16) v); + skge_write32(hw, SKGEGMA_REG(port, r+4), (u16)(v >> 16)); +} + +static inline void skge_gma_write8(const struct skge_hw *hw, int port, int r, u8 v) +{ + skge_write8(hw, SKGEGMA_REG(port,r), v); +} + +static inline void skge_gm_set_addr(struct skge_hw *hw, int port, int reg, + const u8 *addr) +{ + skge_gma_write16(hw, port, reg, + (u16) addr[0] | ((u16) addr[1] << 8)); + skge_gma_write16(hw, port, reg+4, + (u16) addr[2] | ((u16) addr[3] << 8)); + skge_gma_write16(hw, port, reg+8, + (u16) addr[4] | ((u16) addr[5] << 8)); +} + +#endif From davem@davemloft.net Wed Jan 19 14:05:52 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 14:05:58 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JM5qll018414 for ; Wed, 19 Jan 2005 14:05:52 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CrNvt-0006r5-00; Wed, 19 Jan 2005 14:04:09 -0800 Date: Wed, 19 Jan 2005 14:04:09 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: netdev@oss.sgi.com Subject: Re: [PATCH] [IPV6]: kill needless initialization and comparison. Message-Id: <20050119140409.44da7776.davem@davemloft.net> In-Reply-To: <20050119.141817.84595066.yoshfuji@linux-ipv6.org> References: <20050119.141817.84595066.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j0JM5qll018414 X-archive-position: 505 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Wed, 19 Jan 2005 14:18:17 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > I believe that compilers are clever enough, but anyway... Applied, thanks. From davem@davemloft.net Wed Jan 19 14:07:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 14:07:07 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JM72WM018569 for ; Wed, 19 Jan 2005 14:07:02 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CrNx0-0006rM-00; Wed, 19 Jan 2005 14:05:18 -0800 Date: Wed, 19 Jan 2005 14:05:18 -0800 From: "David S. Miller" To: Patrick McHardy Cc: netdev@oss.sgi.com Subject: Re: [PATCH PKT_SCHED 0/4]: more fixes Message-Id: <20050119140518.49ce70be.davem@davemloft.net> In-Reply-To: <41EDE44E.9050609@trash.net> References: <41EDE44E.9050609@trash.net> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 506 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Wed, 19 Jan 2005 05:38:38 +0100 Patrick McHardy wrote: > following are a couple assorted fixes for some bugs recently introduced. > You can pull all changes from bk://212.42.230.204/net-2.6-sched Pulled, thanks Patrick. From PAVLIC@de.ibm.com Wed Jan 19 14:07:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 14:07:43 -0800 (PST) Received: from mtagate4.de.ibm.com (mtagate4.de.ibm.com [195.212.29.153]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JM7Yec018779 for ; Wed, 19 Jan 2005 14:07:35 -0800 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate4.de.ibm.com (8.12.10/8.12.10) with ESMTP id j0JM7SvU234472 for ; Wed, 19 Jan 2005 22:07:28 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j0JM8QKp134004 for ; Wed, 19 Jan 2005 23:08:26 +0100 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11/8.12.11) with ESMTP id j0JM7RiE017440 for ; Wed, 19 Jan 2005 23:07:28 +0100 Received: from d12ml062.megacenter.de.ibm.com (d12ml062.megacenter.de.ibm.com [9.149.166.219]) by d12av02.megacenter.de.ibm.com (8.12.11/8.12.11) with ESMTP id j0JM7RWv017437; Wed, 19 Jan 2005 23:07:27 +0100 In-Reply-To: <1106142567.1049.970.camel@jzny.localdomain> Subject: Re: [PATCH] ipv6: alternative version of S/390 shared NIC support To: hadi@cyberus.ca Cc: Christian =?ISO-8859-1?Q?Borntr=E4ger?= , "David S. Miller" , Christoph Hellwig , netdev@oss.sgi.com, waldi@debian.org X-Mailer: Lotus Notes Build V651_12042003 December 04, 2003 Message-ID: From: Frank Pavlic Date: Wed, 19 Jan 2005 22:32:32 +0100 X-MIMETrack: Serialize by Router on D12ML062/12/M/IBM(Release 6.51HF338 | June 21, 2004) at 19/01/2005 23:08:14 MIME-Version: 1.0 Content-type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j0JM7Yec018779 X-archive-position: 507 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: PAVLIC@de.ibm.com Precedence: bulk X-list: netdev Mit freundlichen Grüssen / Best regards Frank Pavlic Linux for eServer Development Schoenaicher Str. 220, 71032 Boeblingen Phone: ext. +49-(0)7031/16-2463, int. *120-2463 mailto: pavlic@de.ibm.com jamal wrote on 19.01.2005 14:49:28: > > On Tue, 2005-01-18 at 10:53, Christian Bornträger wrote: > > Frank, please correct me, if I am wrong.... > > > > jamal wrote: > > > On Mon, 2005-01-17 at 18:37, Christian Bornträger wrote: > > > > I am trying a small simplification here: > > > > Each physical network adapter offers hundreds of device addresses. You > > > > need 3 of them to have one logical network adapter(read,write,data). > > > > > > the "card" concept is what you call network adapter, correct? > > > I take it that read and write are control channels and data is where the > > > skb comes through? > > > > don't ask me about naming.... > > thats fine, > I think it doesnt matter what they are used for; important part is > you need all 3 addresses to have a "card"; so got it. > > > > > > > S/390 has > > > > hardware supported virtualization. Therefore can then use the > > > > hypervisor (LPAR or z/VM) to give specific LPARs or VM guests exactly 3 > > > > device addresses out of these hundreds. > > > > > > Can you provision multiple of these cards per VM? if yes, is there some > > > ID that will break it down to OSInstance:cardid? > > You did not answer this question. > Let me draw a diagram to show what i think the hierachy is: > > Physical Card: MAC address X > | > | > +--- OSInstance A > | | > | +-- "CARD" with IP A > | +-- "CARD" with IP B > | +-- "CARD" with IP C > | +-- "CARD" with IP D > . > . > . > | > +--- OSInstance N > | > +-- "CARD" with IP Z > > > Is the above reflective of what happens? > In other words, packet comes from the wire (with MAC address X); somehow > the hypervisor(?) or firmware figures based on IP address A (assuming no > other instance has that IP) it has to send packet to OSInstanceA. > OSInstanceA then selects further the CARD based on something probably in > a descriptor? > > Let me get to the point: > I think it would make sense for the "CARD" to be just another netdevice > (call it "card" netdevice for this discussion). > The representation of the physical card in the OSInstance is also a > netdevice(call it physical netdevice for this discussion) as it is now > (excpet it has no IP address ever). > The "card netdevices" are stacked on top of the physical netdevice. This > would be like an upside down bridge stacking relationship of > netdevices.... Let me break your description here. The following two lines are an output from /proc/qeth. Issueing a cat /proc/qeth you will get all to this Linux system frank1 attached and configured devices : 0.0.f504/0.0.f505/0.0.f503 xB5 eth0 OSD_1000 0 sw always_q_2 no no 64k 16 0.0.f506/0.0.f507/0.0.f508 xB5 eth1 OSD_1000 0 sw always_q_0 no no 64k 16 This output shows you already that for every device triple we are initializing and registering one struct net_device at the Linux network stack. But let me take these two lines for trying to explain you how this stuff is working now ,means how packets make their way from OSA to the network stack . As you mentioned above an ethernet frame comes from the wire . Reading the IP address OSA (firmware or not, I don't care :-) ) checks his local address table if an entry for this IP address is existing. Since we have to register the IP address for eth0 and eth1 OSA knows which read/write/data channel belongs to which IP address. So if an entry is existing in OSA's table firmware puts the packet without Ethernet Header on the corresponding data device (it's too complicated to explain in short how it really works but for this description it's ok ) and initiate an interrupt on the same data device of course. Now the interrupt arrives at qeth driver. Out of the interrupt information which is passed to qeth interrupt handler we are able to determine on which data device the packet has arrived and thus we know the struct net_device. qeth processes then the interrupt, some error checks, allocating skb and put the appropriate members like protocol , pkt_type and so on and passes the IP packet to the stack ! From Linux frank1 point of view it has two pyhsical devices ,eth0 and eth1 ,running . But the truth is that both are sending packets out through the same physical built OSA card ,but packets going out to eth0 have to take another way through the huge machine,means different data channel, than packets going out through eth1 . What do you have to do on a x86 to be able to send packets out to the world and of course receive it on different ways? well you have to put in two network cards on your PCI bus ,motherboard respectively ... Maybe I can answer your questions from above now : "CARD" IP address A is nothing else than eth0 (ok to be clear: struct qeth_card is more correctly but in struct qeth_card we have a struct net_device member ) with IP address A, CARD with IP address B eth1 ,and so on ... so packets for eth0 will come directly to "CARD" and so of course to OSInstanceA but OSInstanceA does not make any decisions at all ,the interrupt information passed to qeth driver is clear enough . > It actually is no different from a few tunnel netdevices that sit on top > of say eth0 or multiple PPP devices on top of ethx in a PPPOE > relationship. Yes it is different since you have for every device triple one struct net_device registered at network stack. The problem with IPv6 is that other Linux systems like frank2 ,frank3 .... have also device triples configured (but different from linux 1 e.g. f508,f509,f510 on frank2 , f512,f513,f514 on frank3 ,...) which are also from the same OSA card as frank1 has already, all struct net_device will all get the same MAC address (one MAC per physical network card). generating an EUI64 address which is the base for an automatically generated IPv6 address for ethernet hardware all ethx on all the different frank systems will get the same IPv6 address and the result is that IPv6 traffic will stall after a few seconds .... > The demuxing for incoming packets is done at physical card netdevice > to select the "card" netdevice whose receive method is then called. > Reverse direction for transmit (we could go into details later, just > wanna make sure this is sensible to begin with). > Does this sound reasonable? If yes, then if you do this you wont need to > hack anything like IPV6 etc in your driver - they become merely > netdevices. It should also allow for all standard features like ifconfig > up/down etc of the "card" and setting IP addresses, VLANS etc to work as > is. And you wont need to put any speacilized code in the driver. > If its off tangent, then i just wasted 1/2 a cup of coffee energy typing > away ;-> I'm sorry to hear this , I can make you some if you want ;-) > > > Right, without registering the IP address, you can not receive any packet. > > If this is firmware issue, it would be wise to fix it. You should be > able to register multiple MAC addresses hidden in the firmware (not at > the Linux level) and have your "cards" netdevice use them. i.e the > "card" netdevices would own those. > > > As the logical network interface has no own MAC address you actually speak > > IP to the card. That also means, that without some additional effort, tools > > like tcpdump fail and you need some patches in the dhcp tools. CORRECT, tcpdump and dhcp has to be patched I hope my description helps to get a better understanding of the IPv6 problem and how this works ,if not just say no to save the another 1/2 cup of coffee ;-) if you are interested to get more detailed information about OSA running in Linux I can give you a link to a documentation which describes this stuff pretty well ! From Robert.Olsson@data.slu.se Wed Jan 19 14:18:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 14:18:25 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JMIKAu020227 for ; Wed, 19 Jan 2005 14:18:21 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0JMIFeD018325; Wed, 19 Jan 2005 23:18:16 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id A3B1FEC1A1; Wed, 19 Jan 2005 23:18:15 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16878.56487.600435.442912@robur.slu.se> Date: Wed, 19 Jan 2005 23:18:15 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501190903.45671.jeremy.guthrie@berbee.com> References: <200501141326.29575.jeremy.guthrie@berbee.com> <16874.24305.461492.48668@robur.slu.se> <200501190903.45671.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 508 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > > gc_elasticity, gc_interval, gc_thresh etc I would avoid gc_min_interval. > I have done a little tweaking. I now hold at around 520K routes in the hash. > I still drop packets every secret_interval but I've upped that counter so I > don't whack all of my hash entries all that often. Sounds you done progress. This with relative conservative setting if RX-buffers? secret_interval needs special care as it flushes the cache totally. What did you tweak? Your output from rtstat will be very interesting. --ro From davem@davemloft.net Wed Jan 19 14:23:40 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 14:23:45 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JMNdt5020876 for ; Wed, 19 Jan 2005 14:23:40 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CrOCz-0006wR-00; Wed, 19 Jan 2005 14:21:49 -0800 Date: Wed, 19 Jan 2005 14:21:49 -0800 From: "David S. Miller" To: Arnaldo Carvalho de Melo Cc: netdev@oss.sgi.com Subject: Re: [PATCH] make ipx use a slab cache for its socks Message-Id: <20050119142149.48e65e4e.davem@davemloft.net> In-Reply-To: <41EDD7C4.90309@conectiva.com.br> References: <41EDD7C4.90309@conectiva.com.br> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 509 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Wed, 19 Jan 2005 01:45:08 -0200 Arnaldo Carvalho de Melo wrote: > Ah, this changeset is available at: > > bk://kernel.bkbits.net/acme/connection_sock-2.6 Sounds great, keep up the good work :-) I'm having some trouble pulling from your tree at the moment though: Pull bk://kernel.bkbits.net/acme/connection_sock-2.6 -> file://disk1/BK/net-2.6 ERROR-Can't get read lock on the repository. pull: remote locked, trying again... From davem@davemloft.net Wed Jan 19 14:36:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 14:37:31 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JMa7I4021670 for ; Wed, 19 Jan 2005 14:36:08 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CrOOb-000710-00; Wed, 19 Jan 2005 14:33:49 -0800 Date: Wed, 19 Jan 2005 14:33:49 -0800 From: "David S. Miller" To: Herbert Xu Cc: tommy.christensen@tpack.net, simon.roscic@chello.at, netdev@oss.sgi.com Subject: Re: [NETLINK] Do not netlink_unicast shared packet in kernel/audit.c Message-Id: <20050119143349.0c8ad5a5.davem@davemloft.net> In-Reply-To: <20050117231128.GA21204@gondor.apana.org.au> References: <41E942AF.3030202@tpack.net> <20050115183023.GA31211@gondor.apana.org.au> <41E97B1A.30205@tpack.net> <20050116080254.GA2997@gondor.apana.org.au> <20050117133640.0405d791.davem@davemloft.net> <20050117231128.GA21204@gondor.apana.org.au> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 510 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Tue, 18 Jan 2005 10:11:28 +1100 Herbert Xu wrote: > Doh! Here is the corrected version. > > Signed-off-by: Herbert Xu Looks great, applied. Thanks Herbert. From davem@davemloft.net Wed Jan 19 14:38:51 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 14:38:57 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JMcpIJ021953 for ; Wed, 19 Jan 2005 14:38:51 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CrORg-00071l-00; Wed, 19 Jan 2005 14:37:00 -0800 Date: Wed, 19 Jan 2005 14:37:00 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: sri@us.ibm.com, lksctp-developers@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [PATCH] kill needless addrconf lock in sctp. Message-Id: <20050119143700.3caa0187.davem@davemloft.net> In-Reply-To: <20050107.124123.07582199.yoshfuji@linux-ipv6.org> References: <20050107.123519.125017441.yoshfuji@linux-ipv6.org> <20050107.124123.07582199.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j0JMcpIJ021953 X-archive-position: 511 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Fri, 07 Jan 2005 12:41:23 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > In article <20050107.123519.125017441.yoshfuji@linux-ipv6.org> (at Fri, 07 Jan 2005 12:35:19 +0900 (JST)), YOSHIFUJI Hideaki / $B5HF#1QL@(B says: > > > After applying this patch, I think we can stop exporting > > addrconf_lock. > > Oops, sorry, we can't, because in6_dev_get() is inlined function, > and it uses addrconf_lock. Right. I think we should just leave the SCTP code as-is for now. From davem@davemloft.net Wed Jan 19 14:49:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 14:49:09 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JMn25B023247 for ; Wed, 19 Jan 2005 14:49:02 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CrObX-00074m-00; Wed, 19 Jan 2005 14:47:11 -0800 Date: Wed, 19 Jan 2005 14:47:11 -0800 From: "David S. Miller" To: hadi@cyberus.ca Cc: iod00d@hp.com, eric.lemoine@gmail.com, roland@topspin.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [openib-general] Re: LLTX and netif_stop_queue Message-Id: <20050119144711.3fdd3d93.davem@davemloft.net> In-Reply-To: <1104812294.1085.53.camel@jzny.localdomain> References: <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> <5cac192f0501021530672a908a@mail.gmail.com> <1104764660.1048.578.camel@jzny.localdomain> <52brc68q05.fsf@topspin.com> <5cac192f05010308414a25b548@mail.gmail.com> <527jmu8nbw.fsf@topspin.com> <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 512 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On 03 Jan 2005 23:18:14 -0500 jamal wrote: > On Mon, 2005-01-03 at 12:12, Grant Grundler wrote: > > > Some workloads that Jamal cares about (routing) only need 2 cpus. > > What bothers me is more the complexity this has introduced more than > the workload. OTOH, 1-2% improvement posted by Roland is good > justification. I think I'm going to put in something like Eric's patch and fix up the other LLTX drivers as per his sungem patch. There is a part of me that does want to yank LLTX for non-loopback out of the tree. From shemminger@osdl.org Wed Jan 19 15:19:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 15:19:42 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JNJYeh025508 for ; Wed, 19 Jan 2005 15:19:34 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0JNInl32081; Wed, 19 Jan 2005 15:18:49 -0800 Date: Wed, 19 Jan 2005 15:18:53 -0800 From: Stephen Hemminger To: "David S. Miller" Cc: hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, roland@topspin.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [openib-general] Re: LLTX and netif_stop_queue Message-ID: <20050119151853.259de49a@dxpl.pdx.osdl.net> In-Reply-To: <20050119144711.3fdd3d93.davem@davemloft.net> References: <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> <5cac192f0501021530672a908a@mail.gmail.com> <1104764660.1048.578.camel@jzny.localdomain> <52brc68q05.fsf@topspin.com> <5cac192f05010308414a25b548@mail.gmail.com> <527jmu8nbw.fsf@topspin.com> <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 513 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev On Wed, 19 Jan 2005 14:47:11 -0800 "David S. Miller" wrote: > On 03 Jan 2005 23:18:14 -0500 > jamal wrote: > > > On Mon, 2005-01-03 at 12:12, Grant Grundler wrote: > > > > > Some workloads that Jamal cares about (routing) only need 2 cpus. > > > > What bothers me is more the complexity this has introduced more than > > the workload. OTOH, 1-2% improvement posted by Roland is good > > justification. > > I think I'm going to put in something like Eric's patch and fix > up the other LLTX drivers as per his sungem patch. > > There is a part of me that does want to yank LLTX for non-loopback > out of the tree. Wondering, why not just have the drivers have a way to lock dev->queue_lock in the interrupt handler, and change the xmit to do spin_lock_irqsave? Any driver that assumes it is being called with irq's enabled in transmit is probably already busted anyway. -- Stephen Hemminger From davem@davemloft.net Wed Jan 19 15:43:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 15:43:34 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0JNhQCT026788 for ; Wed, 19 Jan 2005 15:43:27 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CrPS8-0007Fu-00; Wed, 19 Jan 2005 15:41:32 -0800 Date: Wed, 19 Jan 2005 15:41:32 -0800 From: "David S. Miller" To: Stephen Hemminger Cc: hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, roland@topspin.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [openib-general] Re: LLTX and netif_stop_queue Message-Id: <20050119154132.68f0bb4f.davem@davemloft.net> In-Reply-To: <20050119151853.259de49a@dxpl.pdx.osdl.net> References: <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> <5cac192f0501021530672a908a@mail.gmail.com> <1104764660.1048.578.camel@jzny.localdomain> <52brc68q05.fsf@topspin.com> <5cac192f05010308414a25b548@mail.gmail.com> <527jmu8nbw.fsf@topspin.com> <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 514 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Wed, 19 Jan 2005 15:18:53 -0800 Stephen Hemminger wrote: > Wondering, why not just have the drivers have a way to lock dev->queue_lock > in the interrupt handler, and change the xmit to do spin_lock_irqsave? > > Any driver that assumes it is being called with irq's enabled in transmit > is probably already busted anyway. Yes, that's an idea. Effectively, LLTX is working around the fact that dev->xmit_lock is BH disabling instead of IRQ disabling. And there is no fundamental reason for that. Usually we strive for BH disabling locks in order to decrease the amount of hard IRQ disabling time in the kernel. But here, as soon as we call into ->hard_start_xmit(), the driver typically turns hard IRQs off anyways. There are other things using this though, such as multicast list upload. If we change dev->xmit_lock to be an IRQ disabling lock, then drivers can use it in place of their private tx_lock. We would still need something special for loopback, which wants and needs no locking at all. Also, changing dev->xmit_lock to be IRQ disabling is not %100 trivial. We'd need to verify the side-effects this has on gems like the spin_unlock_wait(&dev->xmit_lock) in the Tulip winbond power management code. There is another fun case in the 6pack hamradio driver where it is doing IRQ disabling when taking dev->xmit_lock. Originally, dev->xmit_lock was added so that drivers that were SMP dumb could stay that way. Thus preserving the guarentee that there would be only one active call into the dev->hard_start_xmit method across the entire system. I don't think any of that is relevant any longer. All of our network drivers are pretty clean in this regard. From jgarzik@pobox.com Wed Jan 19 16:01:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 16:01:21 -0800 (PST) Received: from parcelfarce.linux.theplanet.co.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K014FE028130 for ; Wed, 19 Jan 2005 16:01:05 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by parcelfarce.linux.theplanet.co.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CrPkx-0001Nh-4r; Thu, 20 Jan 2005 00:01:03 +0000 Message-ID: <41EEF49F.5090504@pobox.com> Date: Wed, 19 Jan 2005 19:00:31 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [RFT] skge: new syskonnect gigabit ethernet driver References: <20050119135217.38fe5f05@dxpl.pdx.osdl.net> In-Reply-To: <20050119135217.38fe5f05@dxpl.pdx.osdl.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 515 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Stephen Hemminger wrote: > This is the second public release of my new rewrite of the SysKonnect Gigabit > Ethernet driver. This 0.3 version fixes bugs with link up/down and ethtool > phys_id support. It adds ethtool support for interrupt coalescing and pause > parameters. Performance is good, I am able to get 941 Mbit/sec receiving > (TCP using iperf). But obviously, the driver is still experimental. > > This driver doesn't support Yukon2 (yet), and there is report of problem > with D-Link card (Yukon-EC). > > The patch should work on 2.6.8 or later, I am testing with 2.6.11-rc1. > Also available as download from http://developer.osdl.org/shemminge/skge > > > diff -Nru a/drivers/net/Kconfig b/drivers/net/Kconfig > --- a/drivers/net/Kconfig 2005-01-19 13:42:49 -08:00 > +++ b/drivers/net/Kconfig 2005-01-19 13:42:49 -08:00 > @@ -1980,6 +1980,18 @@ > > If in doubt, say Y. > > +config SKGE > + tristate "New SysKonnect GigaEthernet support (EXPERIMENTAL)" > + depends on PCI && EXPERIMENTAL > + select CRC32 > + ---help--- > + This driver support the Marvell Yukon or SysKonnect SK-98xx/SK-95xx > + and related Gigabit Ethernet adapters. It is a new smaller driver > + driver with better performance and more complete ethtool support. > + > + It does not support the link failover and network management > + features that "portable" vendor supplied sk98lin driver does. > + > config SK98LIN > tristate "Marvell Yukon Chipset / SysKonnect SK-98xx Support" > depends on PCI > diff -Nru a/drivers/net/Makefile b/drivers/net/Makefile > --- a/drivers/net/Makefile 2005-01-19 13:42:49 -08:00 > +++ b/drivers/net/Makefile 2005-01-19 13:42:49 -08:00 > @@ -52,6 +52,7 @@ > obj-$(CONFIG_FEALNX) += fealnx.o > obj-$(CONFIG_TIGON3) += tg3.o > obj-$(CONFIG_TC35815) += tc35815.o > +obj-$(CONFIG_SKGE) += skge.o > obj-$(CONFIG_SK98LIN) += sk98lin/ > obj-$(CONFIG_SKFP) += skfp/ > obj-$(CONFIG_VIA_RHINE) += via-rhine.o > diff -Nru a/drivers/net/skge.c b/drivers/net/skge.c > --- /dev/null Wed Dec 31 16:00:00 196900 > +++ b/drivers/net/skge.c 2005-01-19 13:42:49 -08:00 > @@ -0,0 +1,3268 @@ > +/* > + * New driver for Marvell Yukon chipsent and SysKonnect Gigabit > + * Ethernet adapters. Based on earlier sk98lin, e100 and > + * Freebsd if_sk drivers. > + * > + * This driver intentionally does not support all the features > + * of the original driver such as link failover and link management because > + * those should be done at higher levels. > + * > + * Copyright (C) 2004, Stephen Hemminger > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation; either version 2 of the License, or > + * (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. > + */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include "skge.h" > + > +#define DRV_NAME "skge" > +#define DRV_VERSION "0.3" > +#define PFX DRV_NAME " " > + > +#define DEFAULT_TX_RING_SIZE 128 > +#define DEFAULT_RX_RING_SIZE 512 > +#define MAX_TX_RING_SIZE 1024 > +#define MAX_RX_RING_SIZE 4096 > +#define PHY_RETRIES 1000 > +#define ETH_JUMBO_MTU 9000 > +#define TX_WATCHDOG (2 * HZ) TX_WATCHDOG seems a little short. Most others are 5. > +#define NAPI_WEIGHT 64 > + > +MODULE_DESCRIPTION("SysKonnect Gigabit Ethernet driver"); > +MODULE_AUTHOR("Stephen Hemminger "); > +MODULE_LICENSE("GPL"); > +MODULE_VERSION(DRV_VERSION); > + > +static const u32 default_msg > + = NETIF_MSG_DRV| NETIF_MSG_PROBE| NETIF_MSG_LINK > + | NETIF_MSG_IFUP| NETIF_MSG_IFDOWN; > + > +static int debug = -1; /* defaults above */ > +module_param(debug, int, 0); > +MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); > + > +static const struct pci_device_id skge_id_table[] = { > + { PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C940, > + PCI_ANY_ID, PCI_ANY_ID }, > + { PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C940B, > + PCI_ANY_ID, PCI_ANY_ID }, > + { PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_GE, > + PCI_ANY_ID, PCI_ANY_ID }, > + { PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_YU, > + PCI_ANY_ID, PCI_ANY_ID }, > + { PCI_VENDOR_ID_SYSKONNECT, 0x9E00, /* SK-9Exx 10/100/1000Base-T Adapter */ > + PCI_ANY_ID, PCI_ANY_ID }, > + { PCI_VENDOR_ID_DLINK, PCI_DEVICE_ID_DLINK_DGE510T, > + PCI_ANY_ID, PCI_ANY_ID }, > + { PCI_VENDOR_ID_MARVELL, 0x4320, /* Gigabit Ethernet Controller */ > + PCI_ANY_ID, PCI_ANY_ID }, > + { PCI_VENDOR_ID_MARVELL, 0x5005, /* Marvell (11ab), Belkin */ > + PCI_ANY_ID, PCI_ANY_ID }, > + { PCI_VENDOR_ID_CNET, PCI_DEVICE_ID_CNET_GIGACARD, > + PCI_ANY_ID, PCI_ANY_ID }, > + { PCI_VENDOR_ID_LINKSYS, PCI_DEVICE_ID_LINKSYS_EG1032, > + PCI_ANY_ID, PCI_ANY_ID }, > + { PCI_VENDOR_ID_LINKSYS, PCI_DEVICE_ID_LINKSYS_EG1064, > + PCI_ANY_ID, PCI_ANY_ID }, > + { 0 } > +}; > +MODULE_DEVICE_TABLE(pci, skge_id_table); > + > +static int skge_up(struct net_device *dev); > +static int skge_down(struct net_device *dev); > +static void skge_tx_clean(struct skge_port *skge); > +static void skge_xm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val); > +static void skge_gm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val); > +static void genesis_get_stats(struct skge_port *skge, u64 *data); > +static void yukon_get_stats(struct skge_port *skge, u64 *data); > + > +static const int txq[] = { Q_XA1, Q_XA2 }; > +static const int rxq[] = { Q_R1, Q_R2 }; > + > +/* Don't need to look at whole 16K. > + * last interesting register is descriptor poll timer. > + */ > +#define SKGE_REGS_LEN (29*128) > + > +static int skge_get_regs_len(struct net_device *dev) > +{ > + return SKGE_REGS_LEN; > +} > + > +/* > + * Returns copy of control register region > + * I/O region is divided into banks and certain regions > + * are unreadable > + */ > +static void skge_get_regs(struct net_device *dev, struct ethtool_regs *regs, > + void *p) > +{ > + struct skge_port *skge = netdev_priv(dev); > + unsigned long offs; > + void __iomem *io = skge->hw->regs; > + static const unsigned long bankmap > + = (1<<0) | (1<<2) | (1<<8) | (1<<9) > + | (1<<12) | (1<<13) | (1<<14) | (1<<15) | (1<<16) > + | (1<<17) | (1<<20) | (1<<21) | (1<<22) | (1<<23) > + | (1<<24) | (1<<25) | (1<<26) | (1<<27) | (1<<28); > + > + regs->version = 1; > + for (offs = 0; offs < regs->len; offs += 128) { > + u32 len = min_t(u32, 128, regs->len - offs); > + > + if (bankmap & (1<<(offs/128))) > + memcpy_fromio(p + offs, io + offs, len); > + else > + memset(p + offs, 0, len); > + } > +} > + > +static int skge_get_settings(struct net_device *dev, > + struct ethtool_cmd *ecmd) > +{ > + struct skge_port *skge = netdev_priv(dev); > + struct skge_hw *hw = skge->hw; > + > + ecmd->transceiver = XCVR_INTERNAL; > + > + if (iscopper(hw)) { > + if (hw->chip_id == CHIP_ID_GENESIS) > + ecmd->supported = SUPPORTED_1000baseT_Full > + | SUPPORTED_1000baseT_Half > + | SUPPORTED_Autoneg | SUPPORTED_TP; > + else { > + ecmd->supported = SUPPORTED_10baseT_Half > + | SUPPORTED_10baseT_Full > + | SUPPORTED_100baseT_Half > + | SUPPORTED_100baseT_Full > + | SUPPORTED_1000baseT_Half > + | SUPPORTED_1000baseT_Full > + | SUPPORTED_Autoneg| SUPPORTED_TP; > + > + if (hw->chip_id == CHIP_ID_YUKON) > + ecmd->supported &= ~SUPPORTED_1000baseT_Half; > + > + else if (hw->chip_id == CHIP_ID_YUKON_FE) > + ecmd->supported &= ~(SUPPORTED_1000baseT_Half > + | SUPPORTED_1000baseT_Full); > + } > + > + ecmd->advertising = ADVERTISED_TP | ADVERTISED_Autoneg; > + ecmd->port = PORT_TP; > + ecmd->phy_address = hw->phy_addr; > + > + ecmd->speed = skge->speed; > + ecmd->duplex = skge->duplex; > + } else { > + ecmd->supported = SUPPORTED_1000baseT_Full > + | SUPPORTED_FIBRE > + | SUPPORTED_Autoneg; > + > + ecmd->advertising = ADVERTISED_1000baseT_Full > + | ADVERTISED_FIBRE > + | ADVERTISED_Autoneg; > + ecmd->port = PORT_FIBRE; > + ecmd->autoneg = AUTONEG_ENABLE; > + ecmd->speed = SPEED_1000; > + ecmd->duplex = DUPLEX_FULL; > + } > + > + return 0; > +} > + > +static int skge_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) > +{ > + struct skge_port *skge = netdev_priv(dev); > + > + skge->autoneg = ecmd->autoneg; > + skge->speed = ecmd->speed; > + skge->duplex = ecmd->duplex; needs more sanity checking of values > + if (netif_running(dev)) { > + skge_down(dev); > + skge_up(dev); > + } > + return (0); > +} > + > +static void skge_get_drvinfo(struct net_device *dev, > + struct ethtool_drvinfo *info) > +{ > + struct skge_port *skge = netdev_priv(dev); > + > + strcpy(info->driver, DRV_NAME); > + strcpy(info->version, DRV_VERSION); > + strcpy(info->fw_version, "N/A"); > + strcpy(info->bus_info, pci_name(skge->hw->pdev)); > +} > + > +/* > + * The VPD config area contains Vital Product Data, as suggested in > + * the PCI 2.1 specification. The VPD data is separared into areas > + * denoted by resource IDs. The SysKonnect VPD contains an ID string > + * resource (the name of the adapter), a read-only area resource > + * containing various key/data fields and a read/write area which > + * can be used to store asset management information or log messages. > + */ > +static int skge_vpd_read(struct pci_dev *pci, u8 *buf, u16 offset, u32 len) > +{ > + int i; > + u16 reg; > + unsigned long timeout = jiffies + 2*HZ; put timeout magic number in definitions section > + if (offset & 3) > + return -EINVAL; > + > + for (i = 0; i < len; i += 4) { > + pci_write_config_word(pci, PCI_VPD+PCI_VPD_ADDR, offset); > + > + for(;;) { > + pci_read_config_word(pci, PCI_VPD+PCI_VPD_ADDR, ®); > + > + if (reg & PCI_VPD_ADDR_F) > + break; > + > + if (time_after(jiffies, timeout)) { > + printk(KERN_ERR "%s: VPD read timed out\n", > + pci_name(pci)); > + return -ETIMEDOUT; > + } > + cpu_relax(); > + } > + > + pci_read_config_byte(pci, PCI_VPD+PCI_VPD_DATA, buf+i); > + pci_read_config_byte(pci, PCI_VPD+PCI_VPD_DATA+1,buf+i+1); > + pci_read_config_byte(pci, PCI_VPD+PCI_VPD_DATA+2,buf+i+2); > + pci_read_config_byte(pci, PCI_VPD+PCI_VPD_DATA+3,buf+i+3); > + > + offset += 4; > + } > + return 0; > +} > + > +static const struct skge_stat { > + char name[ETH_GSTRING_LEN]; > + u16 xmac_offset; > + u16 gma_offset; > +} skge_stats[] = { > + { "tx_bytes", XM_TXO_OK_HI, GM_TXO_OK_HI }, > + { "rx_bytes", XM_RXO_OK_HI, GM_RXO_OK_HI }, > + > + { "tx_broadcast", XM_TXF_BC_OK, GM_TXF_BC_OK }, > + { "rx_broadcast", XM_RXF_BC_OK, GM_RXF_BC_OK }, > + { "tx_multicast", XM_TXF_MC_OK, GM_TXF_MC_OK }, > + { "rx_multicast", XM_RXF_MC_OK, GM_RXF_MC_OK }, > + { "tx_unicast", XM_TXF_UC_OK, GM_TXF_UC_OK }, > + { "rx_unicast", XM_RXF_UC_OK, GM_RXF_UC_OK }, > + { "tx_mac_pause", XM_TXF_MPAUSE, GM_TXF_MPAUSE }, > + { "rx_mac_pause", XM_RXF_MPAUSE, GM_RXF_MPAUSE }, > + > + { "collisions", XM_TXF_SNG_COL, GM_TXF_SNG_COL }, > + { "multi_collisions", XM_TXF_MUL_COL, GM_TXF_MUL_COL }, > + { "aborted", XM_TXF_ABO_COL, GM_TXF_ABO_COL}, > + { "late_collision", XM_TXF_LAT_COL, GM_TXF_LAT_COL }, > + { "fifo_underrun", XM_TXE_FIFO_UR, GM_TXE_FIFO_UR }, > + { "fifo_overflow", XM_RXE_FIFO_OV, GM_RXE_FIFO_OV }, > + > + { "rx_toolong", XM_RXF_LNG_ERR, GM_RXF_LNG_ERR }, > + { "rx_jabber", XM_RXF_JAB_PKT, GM_RXF_JAB_PKT }, > + { "rx_runt", XM_RXE_RUNT, GM_RXE_FRAG }, > + { "rx_too_long", XM_RXF_LNG_ERR, GM_RXF_LNG_ERR }, > + { "rx_fcs_error", XM_RXF_FCS_ERR, GM_RXF_FCS_ERR }, > +}; > + > +static int skge_get_stats_count(struct net_device *dev) > +{ > + return ARRAY_SIZE(skge_stats); > +} > + > +static void skge_get_ethtool_stats(struct net_device *dev, > + struct ethtool_stats *stats, u64 *data) > +{ > + struct skge_port *skge = netdev_priv(dev); > + > + if (skge->hw->chip_id == CHIP_ID_GENESIS) > + genesis_get_stats(skge, data); > + else > + yukon_get_stats(skge, data); > +} > + > +static void skge_get_strings(struct net_device *dev, u32 stringset, u8 *data) > +{ > + int i; > + > + switch(stringset) { > + case ETH_SS_STATS: > + for (i = 0; i < ARRAY_SIZE(skge_stats); i++) > + memcpy(data + i * ETH_GSTRING_LEN, > + skge_stats[i].name, ETH_GSTRING_LEN); > + break; > + } > +} > + > +static void skge_get_ring_param(struct net_device *dev, > + struct ethtool_ringparam *p) > +{ > + struct skge_port *skge = netdev_priv(dev); > + > + p->rx_max_pending = MAX_RX_RING_SIZE; > + p->tx_max_pending = MAX_TX_RING_SIZE; > + p->rx_mini_max_pending = 0; > + p->rx_jumbo_max_pending = 0; > + > + p->rx_pending = skge->rx_ring.count; > + p->tx_pending = skge->tx_ring.count; > + p->rx_mini_pending = 0; > + p->rx_jumbo_pending = 0; > +} > + > +static int skge_set_ring_param(struct net_device *dev, > + struct ethtool_ringparam *p) > +{ > + struct skge_port *skge = netdev_priv(dev); > + > + if (p->rx_pending == 0 || p->rx_pending > MAX_RX_RING_SIZE || > + p->tx_pending == 0 || p->tx_pending > MAX_TX_RING_SIZE) > + return -EINVAL; > + > + skge->rx_ring.count = p->rx_pending; > + skge->tx_ring.count = p->tx_pending; > + > + if (netif_running(dev)) { > + skge_down(dev); > + skge_up(dev); > + } > + > + return 0; > +} > + > +static u32 skge_get_msglevel(struct net_device *netdev) > +{ > + struct skge_port *skge = netdev_priv(netdev); > + return skge->msg_enable; > +} > + > +static void skge_set_msglevel(struct net_device *netdev, u32 value) > +{ > + struct skge_port *skge = netdev_priv(netdev); > + skge->msg_enable = value; > +} > + > +static int skge_set_sg(struct net_device *dev, u32 data) > +{ > + struct skge_port *skge = netdev_priv(dev); > + struct skge_hw *hw = skge->hw; > + > + if (hw->chip_id == CHIP_ID_GENESIS && data) > + return -EOPNOTSUPP; > + return ethtool_op_set_sg(dev, data); > +} > + > +static u32 skge_get_rx_csum(struct net_device *dev) > +{ > + struct skge_port *skge = netdev_priv(dev); > + > + return skge->rx_csum; > +} > + > +static int skge_set_rx_csum(struct net_device *dev, u32 data) > +{ > + struct skge_port *skge = netdev_priv(dev); > + > + if (skge->hw->chip_id == CHIP_ID_GENESIS && data) > + return -EOPNOTSUPP; > + > + skge->rx_csum = data; > + return 0; > +} > + > +static int skge_set_tso(struct net_device *dev, u32 data) > +{ > + if (data) > + return -EOPNOTSUPP; > + return 0; > +} > + > +static void skge_get_pauseparam(struct net_device *dev, > + struct ethtool_pauseparam *ecmd) > +{ > + struct skge_port *skge = netdev_priv(dev); > + > + ecmd->tx_pause = (skge->flow_control == FLOW_MODE_LOC_SEND) > + || (skge->flow_control == FLOW_MODE_SYMMETRIC); > + ecmd->rx_pause = (skge->flow_control == FLOW_MODE_REM_SEND) > + || (skge->flow_control == FLOW_MODE_SYMMETRIC); > + > + ecmd->autoneg = skge->autoneg; > +} > + > +static int skge_set_pauseparam(struct net_device *dev, > + struct ethtool_pauseparam *ecmd) > +{ > + struct skge_port *skge = netdev_priv(dev); > + > + skge->autoneg = ecmd->autoneg; > + if (ecmd->rx_pause && ecmd->tx_pause) > + skge->flow_control = FLOW_MODE_SYMMETRIC; > + else if(ecmd->rx_pause && !ecmd->tx_pause) > + skge->flow_control = FLOW_MODE_REM_SEND; > + else if(!ecmd->rx_pause && ecmd->tx_pause) > + skge->flow_control = FLOW_MODE_LOC_SEND; > + else > + skge->flow_control = FLOW_MODE_NONE; > + > + if (netif_running(dev)) { > + skge_down(dev); > + skge_up(dev); > + } > + return 0; > +} > + > +static inline u32 skge_freq(const struct skge_hw *hw) > +{ > + if (hw->chip_id == CHIP_ID_GENESIS) > + return 53215000; /* or: 53.125 MHz */ > + else if (hw->chip_id == CHIP_ID_YUKON_EC) > + return 125000000; /* or: 125.000 MHz */ > + else > + return 78215000; /* or: 78.125 MHz */ > +} > + > +static int skge_get_coalesce(struct net_device *dev, > + struct ethtool_coalesce *ecmd) > +{ > + struct skge_port *skge = netdev_priv(dev); > + struct skge_hw *hw = skge->hw; > + int port = skge->port; > + > + ecmd->rx_coalesce_usecs = 0; > + ecmd->tx_coalesce_usecs = 0; > + > + if (skge_read32(hw, B2_IRQM_CTRL) & TIM_START) { > + u32 msk; > + u64 delay = skge_read32(hw, B2_IRQM_INI); > + > + pr_debug("irqm = %lld\n", delay); > + delay *= USEC_PER_SEC; > + > + do_div(delay, skge_freq(hw)); > + msk = skge_read32(hw, B2_IRQM_MSK); > + > + if (((port == 0) && (msk & IS_R1_F)) || > + ((port == 1) && (msk & IS_R2_F))) > + ecmd->rx_coalesce_usecs = delay; > + if (((port == 0) && (msk & IS_XA1_F)) || > + ((port == 1) && (msk & IS_XA1_F))) > + ecmd->tx_coalesce_usecs = delay; > + } > + > + return 0; > +} > + > +/* Not interrupt coalescing is per board, not per device */ trivial spelling: s/Not/Note/ > +static int skge_set_coalesce(struct net_device *dev, > + struct ethtool_coalesce *ecmd) > +{ > + struct skge_port *skge = netdev_priv(dev); > + struct skge_hw *hw = skge->hw; > + int port = skge->port; > + u32 msk = skge_read32(hw, B2_IRQM_MSK); > + u32 delay = 25; > + > + if (ecmd->rx_coalesce_usecs == 0) > + msk &= ~(port == 0 ? IS_R1_F : IS_R2_F); > + else if (ecmd->rx_coalesce_usecs < 25 || > + ecmd->rx_coalesce_usecs > 33333) > + return -EINVAL; > + else { > + msk |= port == 0 ? IS_R1_F : IS_R2_F; > + delay = ecmd->rx_coalesce_usecs; > + } > + > + if (ecmd->tx_coalesce_usecs == 0) > + msk &= ~((port == 0) ? IS_XA1_F : IS_XA2_F); > + else if (ecmd->tx_coalesce_usecs < 25 || > + ecmd->tx_coalesce_usecs > 33333) > + return -EINVAL; > + else { > + msk |= (port == 0) ? IS_XA1_F : IS_XA2_F; > + delay = min(delay, ecmd->rx_coalesce_usecs); > + } > + > + skge_write32(hw, B2_IRQM_MSK, msk); > + if (msk == 0) > + skge_write32(hw, B2_IRQM_CTRL, TIM_STOP); > + else { > + u64 ticks = (u64) delay * skge_freq(hw); > + pr_debug("ticks * 10^6=%lld\n", ticks); > + do_div(ticks, USEC_PER_SEC); > + skge_write32(hw, B2_IRQM_INI, ticks); > + skge_write32(hw, B2_IRQM_CTRL, TIM_START); > + } > + return 0; > +} > + > +static void skge_led_on(struct skge_hw *hw, int port) > +{ > + if (hw->chip_id == CHIP_ID_GENESIS) { > + skge_write8(hw, SKGEMAC_REG(port, LNK_LED_REG), LINKLED_ON); > + skge_write8(hw, B0_LED, LED_STAT_ON); > + > + skge_write8(hw, SKGEMAC_REG(port, RX_LED_TST), LED_T_ON); > + skge_write32(hw, SKGEMAC_REG(port, RX_LED_VAL), 100); > + skge_write8(hw, SKGEMAC_REG(port, RX_LED_CTRL), LED_START); > + > + switch (hw->phy_type) { > + case SK_PHY_BCOM: > + skge_xm_phy_write(hw, port, PHY_BCOM_P_EXT_CTRL, > + PHY_B_PEC_LED_ON); > + break; > + case SK_PHY_LONE: > + skge_xm_phy_write(hw, port, PHY_LONE_LED_CFG, > + 0x0800); > + break; > + default: > + skge_write8(hw, SKGEMAC_REG(port, TX_LED_TST), LED_T_ON); > + skge_write32(hw, SKGEMAC_REG(port, TX_LED_VAL), 100); > + skge_write8(hw, SKGEMAC_REG(port, TX_LED_CTRL), LED_START); > + } > + } else { > + skge_gm_phy_write(hw, port, PHY_MARV_LED_CTRL, 0); > + skge_gm_phy_write(hw, port, PHY_MARV_LED_OVER, > + PHY_M_LED_MO_DUP(MO_LED_ON) | > + PHY_M_LED_MO_10(MO_LED_ON) | > + PHY_M_LED_MO_100(MO_LED_ON) | > + PHY_M_LED_MO_1000(MO_LED_ON) | > + PHY_M_LED_MO_RX(MO_LED_ON)); > + } > +} > + > +static void skge_led_off(struct skge_hw *hw, int port) > +{ > + if (hw->chip_id == CHIP_ID_GENESIS) { > + skge_write8(hw, SKGEMAC_REG(port, LNK_LED_REG), LINKLED_OFF); > + skge_write8(hw, B0_LED, LED_STAT_OFF); > + > + skge_write32(hw, SKGEMAC_REG(port, RX_LED_VAL), 0); > + skge_write8(hw, SKGEMAC_REG(port, RX_LED_CTRL), LED_T_OFF); > + > + switch (hw->phy_type) { > + case SK_PHY_BCOM: > + skge_xm_phy_write(hw, port, PHY_BCOM_P_EXT_CTRL, > + PHY_B_PEC_LED_OFF); > + break; > + case SK_PHY_LONE: > + skge_xm_phy_write(hw, port, PHY_LONE_LED_CFG, > + PHY_L_LC_LEDT); > + break; > + default: > + skge_write32(hw, SKGEMAC_REG(port, TX_LED_VAL), 0); > + skge_write8(hw, SKGEMAC_REG(port, TX_LED_CTRL), LED_T_OFF); > + } > + } else { > + skge_gm_phy_write(hw, port, PHY_MARV_LED_CTRL, 0); > + skge_gm_phy_write(hw, port, PHY_MARV_LED_OVER, > + PHY_M_LED_MO_DUP(MO_LED_OFF) | > + PHY_M_LED_MO_10(MO_LED_OFF) | > + PHY_M_LED_MO_100(MO_LED_OFF) | > + PHY_M_LED_MO_1000(MO_LED_OFF) | > + PHY_M_LED_MO_RX(MO_LED_OFF)); > + } > +} > + > +static void skge_blink_timer(unsigned long data) > +{ > + struct skge_port *skge = (struct skge_port *) data; > + struct skge_hw *hw = skge->hw; > + unsigned long flags; > + > + spin_lock_irqsave(&hw->phy_lock, flags); > + if (skge->blink_on) > + skge_led_on(hw, skge->port); > + else > + skge_led_off(hw, skge->port); > + spin_unlock_irqrestore(&hw->phy_lock, flags); > + > + skge->blink_on = !skge->blink_on; > + mod_timer(&skge->led_blink, jiffies + HZ/4); > +} > + > +static int skge_phys_id(struct net_device *dev, u32 data) > +{ > + struct skge_port *skge = netdev_priv(dev); > + > + if(!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ)) > + data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ); > + > + /* start blinking */ > + skge->blink_on = 1; > + mod_timer(&skge->led_blink, jiffies); > + > + set_current_state(TASK_INTERRUPTIBLE); > + schedule_timeout(data * HZ); > + del_timer_sync(&skge->led_blink); > + > + skge_led_off(skge->hw, skge->port); > + > + return 0; > +} > + > +static struct ethtool_ops skge_ethtool_ops = { > + .get_settings = skge_get_settings, > + .set_settings = skge_set_settings, > + .get_drvinfo = skge_get_drvinfo, > + .get_regs_len = skge_get_regs_len, > + .get_regs = skge_get_regs, > + .get_msglevel = skge_get_msglevel, > + .set_msglevel = skge_set_msglevel, > + .get_link = ethtool_op_get_link, > + .get_ringparam = skge_get_ring_param, > + .set_ringparam = skge_set_ring_param, > + .get_pauseparam = skge_get_pauseparam, > + .set_pauseparam = skge_set_pauseparam, > + .get_coalesce = skge_get_coalesce, > + .set_coalesce = skge_set_coalesce, > + .get_tso = ethtool_op_get_tso, > + .set_tso = skge_set_tso, > + .get_sg = ethtool_op_get_sg, > + .set_sg = skge_set_sg, > + .get_tx_csum = ethtool_op_get_tx_csum, > + .set_tx_csum = ethtool_op_set_tx_csum, > + .get_rx_csum = skge_get_rx_csum, > + .set_rx_csum = skge_set_rx_csum, > + .get_strings = skge_get_strings, > + .phys_id = skge_phys_id, > + .get_stats_count = skge_get_stats_count, > + .get_ethtool_stats = skge_get_ethtool_stats, > +}; > + > +/* > + * Allocate ring elements and chain them together > + * One-to-one association of board descriptors with ring elements > + */ > +static int skge_ring_alloc(struct skge_ring *ring, void *vaddr, u64 base) > +{ > + struct skge_tx_desc *d; > + struct skge_element *e; > + int i; > + > + ring->start = kmalloc(sizeof(*e)*ring->count, GFP_KERNEL); > + if (!ring->start) > + return -ENOMEM; > + > + for (i = 0, e = ring->start, d = vaddr; i < ring->count; i++, e++, d++) { > + e->desc = d; > + if (i == ring->count - 1) { > + e->next = ring->start; > + d->next_offset = base; > + } else { > + e->next = e + 1; > + d->next_offset = base + (i+1) * sizeof(*d); > + } > + } > + ring->to_use = ring->to_clean = ring->start; > + > + return 0; > +} > + > +/* Setup buffer for receiving */ > +static inline int skge_rx_alloc(struct skge_port *skge, > + struct skge_element *e) > +{ > + unsigned long bufsize = skge->netdev->mtu + ETH_HLEN; /* VLAN? */ > + struct skge_rx_desc *rd = e->desc; > + struct sk_buff *skb; > + u64 map; > + > + skb = dev_alloc_skb(bufsize + NET_IP_ALIGN); > + if (unlikely(!skb)) { > + printk(KERN_DEBUG PFX "%s: out of memory for receive\n", > + skge->netdev->name); > + return -ENOMEM; > + } > + > + skb->dev = skge->netdev; > + skb_reserve(skb, NET_IP_ALIGN); > + > + map = pci_map_single(skge->hw->pdev, skb->data, bufsize, > + PCI_DMA_FROMDEVICE); check for error > + rd->dma_lo = map; > + rd->dma_hi = map >> 32; > + e->skb = skb; > + rd->csum1_start = ETH_HLEN; > + rd->csum2_start = ETH_HLEN; > + rd->csum1 = 0; > + rd->csum2 = 0; > + > + wmb(); > + > + rd->control = BMU_OWN | BMU_STF | BMU_IRQ_EOF | BMU_TCP_CHECK | bufsize; > + pci_unmap_addr_set(e, mapaddr, map); > + pci_unmap_len_set(e, maplen, bufsize); > + return 0; > +} > + > +/* Free all unused buffers in receive ring, assumes receiver stopped */ > +static void skge_rx_clean(struct skge_port *skge) > +{ > + struct skge_hw *hw = skge->hw; > + struct skge_ring *ring = &skge->rx_ring; > + struct skge_element *e; > + > + for (e = ring->to_clean; e != ring->to_use; e = e->next) { > + struct skge_rx_desc *rd = e->desc; > + rd->control = 0; > + > + pci_unmap_single(hw->pdev, > + pci_unmap_addr(e, mapaddr), > + pci_unmap_len(e, maplen), > + PCI_DMA_FROMDEVICE); > + dev_kfree_skb(e->skb); > + e->skb = NULL; > + } > + ring->to_clean = e; > +} > + > +/* Allocate buffers for receive ring > + * For receive: to_use is refill location > + * to_clean is next received frame. > + * > + * if (to_use == to_clean) > + * then ring all frames in ring need buffers > + * if (to_use->next == to_clean) > + * then ring all frames in ring have buffers > + */ > +static int skge_rx_fill(struct skge_port *skge) > +{ > + struct skge_ring *ring = &skge->rx_ring; > + struct skge_element *e; > + int ret = 0; > + > + for (e = ring->to_use; e->next != ring->to_clean; e = e->next) { > + if (skge_rx_alloc(skge, e)) { > + ret = 1; > + break; > + } > + > + } > + ring->to_use = e; > + > + return ret; > +} > + > +static void skge_link_report(struct skge_port *skge) > +{ > + if (!netif_msg_link(skge)) > + return; > + > + if (netif_carrier_ok(skge->netdev)) { > + printk(KERN_INFO PFX > + "%s: Link is up at %d Mbps, %s duplex, flow control %s\n", > + skge->netdev->name, skge->speed, > + skge->duplex == DUPLEX_FULL ? "full" : "half", > + (skge->flow_control == FLOW_MODE_NONE) ? "none" : > + (skge->flow_control == FLOW_MODE_LOC_SEND) ? "tx only" : > + (skge->flow_control == FLOW_MODE_REM_SEND) ? "rx only" : > + (skge->flow_control == FLOW_MODE_SYMMETRIC) ? "tx and rx" : > + "unknown"); > + } else > + printk(KERN_INFO PFX "%s: Link is down.\n", skge->netdev->name); > +} > + > +static u16 skge_xm_phy_read(struct skge_hw *hw, int port, u16 reg) > +{ > + int i; > + u16 v; > + > + skge_xm_write16(hw, port, XM_PHY_ADDR, reg | hw->phy_addr); > + v = skge_xm_read16(hw, port, XM_PHY_DATA); > + if (hw->phy_type != SK_PHY_XMAC) { > + for (i = 0; i < PHY_RETRIES; i++) { > + udelay(1); > + if (skge_xm_read16(hw, port, XM_MMU_CMD) > + & XM_MMU_PHY_RDY) > + goto ready; > + } > + > + printk(KERN_WARNING PFX "%s: phy read timed out\n", > + hw->dev[port]->name); > + return 0; > + ready: > + v = skge_xm_read16(hw, port, XM_PHY_DATA); > + } > + > + return v; > +} > + > +static void skge_xm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val) > +{ > + int i; > + > + skge_xm_write16(hw, port, XM_PHY_ADDR, reg | hw->phy_addr); > + for (i = 0; i < PHY_RETRIES; i++) { > + if (!(skge_xm_read16(hw, port, XM_MMU_CMD) & XM_MMU_PHY_BUSY)) > + goto ready; > + cpu_relax(); > + } > + printk(KERN_WARNING PFX "%s: phy write failed to come ready\n", > + hw->dev[port]->name); > + > + > + ready: > + skge_xm_write16(hw, port, XM_PHY_DATA, val); > + for (i = 0; i < PHY_RETRIES; i++) { > + udelay(1); > + if (!(skge_xm_read16(hw, port, XM_MMU_CMD) & XM_MMU_PHY_BUSY)) > + return; > + } > + printk(KERN_WARNING PFX "%s: phy write timed out\n", > + hw->dev[port]->name); > +} > + > +static void genesis_init(struct skge_hw *hw) > +{ > + /* set blink source counter */ > + skge_write32(hw, B2_BSC_INI, (SK_BLK_DUR * SK_FACT_53) / 100); > + skge_write8(hw, B2_BSC_CTRL, BSC_START); > + > + /* configure mac arbiter */ > + skge_write16(hw, B3_MA_TO_CTRL, MA_RST_CLR); > + > + /* configure mac arbiter timeout values */ > + skge_write8(hw, B3_MA_TOINI_RX1, SK_MAC_TO_53); > + skge_write8(hw, B3_MA_TOINI_RX2, SK_MAC_TO_53); > + skge_write8(hw, B3_MA_TOINI_TX1, SK_MAC_TO_53); > + skge_write8(hw, B3_MA_TOINI_TX2, SK_MAC_TO_53); > + > + skge_write8(hw, B3_MA_RCINI_RX1, 0); > + skge_write8(hw, B3_MA_RCINI_RX2, 0); > + skge_write8(hw, B3_MA_RCINI_TX1, 0); > + skge_write8(hw, B3_MA_RCINI_TX2, 0); > + > + /* configure packet arbiter timeout */ > + skge_write16(hw, B3_PA_CTRL, PA_RST_CLR); > + skge_write16(hw, B3_PA_TOINI_RX1, SK_PKT_TO_MAX); > + skge_write16(hw, B3_PA_TOINI_TX1, SK_PKT_TO_MAX); > + skge_write16(hw, B3_PA_TOINI_RX2, SK_PKT_TO_MAX); > + skge_write16(hw, B3_PA_TOINI_TX2, SK_PKT_TO_MAX); > +} > + > +static void genesis_reset(struct skge_hw *hw, int port) > +{ > + int i; > + u64 zero = 0; > + > + /* reset the statistics module */ > + skge_xm_write32(hw, port, XM_GP_PORT, XM_GP_RES_STAT); > + skge_xm_write16(hw, port, XM_IMSK, 0xffff); /* disable XMAC IRQs */ > + skge_xm_write32(hw, port, XM_MODE, 0); /* clear Mode Reg */ > + skge_xm_write16(hw, port, XM_TX_CMD, 0); /* reset TX CMD Reg */ > + skge_xm_write16(hw, port, XM_RX_CMD, 0); /* reset RX CMD Reg */ > + > + /* disable all PHY IRQs */ > + if (hw->phy_type == SK_PHY_BCOM) > + skge_xm_write16(hw, port, PHY_BCOM_INT_MASK, 0xffff); > + > + skge_xm_outhash(hw, port, XM_HSM, (u8 *) &zero); > + for (i = 0; i < 15; i++) > + skge_xm_outaddr(hw, port, XM_EXM(i), (u8 *) &zero); > + skge_xm_outhash(hw, port, XM_SRC_CHK, (u8 *) &zero); > +} > + > + > +static void genesis_mac_init(struct skge_hw *hw, int port) > +{ > + struct skge_port *skge = netdev_priv(hw->dev[port]); > + int i; > + u32 r; > + u16 id1; > + u16 ctrl1, ctrl2, ctrl3, ctrl4, ctrl5; > + > + /* magic workaround patterns for Broadcom */ > + static const struct { > + u16 reg; > + u16 val; > + } A1hack[] = { > + { 0x18, 0x0c20 }, { 0x17, 0x0012 }, { 0x15, 0x1104 }, > + { 0x17, 0x0013 }, { 0x15, 0x0404 }, { 0x17, 0x8006 }, > + { 0x15, 0x0132 }, { 0x17, 0x8006 }, { 0x15, 0x0232 }, > + { 0x17, 0x800D }, { 0x15, 0x000F }, { 0x18, 0x0420 }, > + }, C0hack[] = { > + { 0x18, 0x0c20 }, { 0x17, 0x0012 }, { 0x15, 0x1204 }, > + { 0x17, 0x0013 }, { 0x15, 0x0A04 }, { 0x18, 0x0420 }, > + }; > + > + > + /* initialize Rx, Tx and Link LED */ > + skge_write8(hw, SKGEMAC_REG(port, LNK_LED_REG), LINKLED_ON); > + skge_write8(hw, SKGEMAC_REG(port, LNK_LED_REG), LINKLED_LINKSYNC_ON); > + > + skge_write8(hw, SKGEMAC_REG(port, RX_LED_CTRL), LED_START); > + skge_write8(hw, SKGEMAC_REG(port, TX_LED_CTRL), LED_START); > + > + /* Unreset the XMAC. */ > + skge_write16(hw, SKGEMAC_REG(port, TX_MFF_CTRL1), MFF_CLR_MAC_RST); > + > + /* > + * Perform additional initialization for external PHYs, > + * namely for the 1000baseTX cards that use the XMAC's > + * GMII mode. > + */ > + spin_lock_bh(&hw->phy_lock); > + if (hw->phy_type != SK_PHY_XMAC) { > + /* Take PHY out of reset. */ > + r = skge_read32(hw, B2_GP_IO); > + if (port == 0) > + r |= GP_DIR_0|GP_IO_0; > + else > + r |= GP_DIR_2|GP_IO_2; > + > + skge_write32(hw, B2_GP_IO, r); > + skge_read32(hw, B2_GP_IO); > + > + /* Enable GMII mode on the XMAC. */ > + skge_xm_write16(hw, port, XM_HW_CFG, XM_HW_GMII_MD); > + > + id1 = skge_xm_phy_read(hw, port, PHY_XMAC_ID1); > + > + /* Optimize MDIO transfer by suppressing preamble. */ > + skge_xm_write16(hw, port, XM_MMU_CMD, > + skge_xm_read16(hw, port, XM_MMU_CMD) > + | XM_MMU_NO_PRE); > + > + if (id1 == PHY_BCOM_ID1_C0) { > + /* > + * Workaround BCOM Errata for the C0 type. > + * Write magic patterns to reserved registers. > + */ > + for (i = 0; i < ARRAY_SIZE(C0hack); i++) > + skge_xm_phy_write(hw, port, > + C0hack[i].reg, C0hack[i].val); > + > + } else if (id1 == PHY_BCOM_ID1_A1) { > + /* > + * Workaround BCOM Errata for the A1 type. > + * Write magic patterns to reserved registers. > + */ > + for (i = 0; i < ARRAY_SIZE(A1hack); i++) > + skge_xm_phy_write(hw, port, > + A1hack[i].reg, A1hack[i].val); > + } > + > + /* > + * Workaround BCOM Errata (#10523) for all BCom PHYs. > + * Disable Power Management after reset. > + */ > + r = skge_xm_phy_read(hw, port, PHY_BCOM_AUX_CTRL); > + skge_xm_phy_write(hw, port, PHY_BCOM_AUX_CTRL, r | PHY_B_AC_DIS_PM); > + } > + > + /* Dummy read */ > + skge_xm_read16(hw, port, XM_ISRC); > + > + r = skge_xm_read32(hw, port, XM_MODE); > + skge_xm_write32(hw, port, XM_MODE, r|XM_MD_CSA); > + > + /* We don't need the FCS appended to the packet. */ > + r = skge_xm_read16(hw, port, XM_RX_CMD); > + skge_xm_write16(hw, port, XM_RX_CMD, r | XM_RX_STRIP_FCS); > + > + /* We want short frames padded to 60 bytes. */ > + r = skge_xm_read16(hw, port, XM_TX_CMD); > + skge_xm_write16(hw, port, XM_TX_CMD, r | XM_TX_AUTO_PAD); > + > + /* > + * Enable the reception of all error frames. This is is > + * a necessary evil due to the design of the XMAC. The > + * XMAC's receive FIFO is only 8K in size, however jumbo > + * frames can be up to 9000 bytes in length. When bad > + * frame filtering is enabled, the XMAC's RX FIFO operates > + * in 'store and forward' mode. For this to work, the > + * entire frame has to fit into the FIFO, but that means > + * that jumbo frames larger than 8192 bytes will be > + * truncated. Disabling all bad frame filtering causes > + * the RX FIFO to operate in streaming mode, in which > + * case the XMAC will start transfering frames out of the > + * RX FIFO as soon as the FIFO threshold is reached. > + */ > + r = skge_xm_read32(hw, port, XM_MODE); > + skge_xm_write32(hw, port, XM_MODE, > + XM_MD_RX_CRCE|XM_MD_RX_LONG|XM_MD_RX_RUNT| > + XM_MD_RX_ERR|XM_MD_RX_IRLE); > + > + skge_xm_outaddr(hw, port, XM_SA, hw->dev[port]->dev_addr); > + skge_xm_outaddr(hw, port, XM_EXM(0), hw->dev[port]->dev_addr); > + > + /* > + * Bump up the transmit threshold. This helps hold off transmit > + * underruns when we're blasting traffic from both ports at once. > + */ > + skge_xm_write16(hw, port, XM_TX_THR, 512); > + > + /* Configure MAC arbiter */ > + skge_write16(hw, B3_MA_TO_CTRL, MA_RST_CLR); > + > + /* configure timeout values */ > + skge_write8(hw, B3_MA_TOINI_RX1, 72); > + skge_write8(hw, B3_MA_TOINI_RX2, 72); > + skge_write8(hw, B3_MA_TOINI_TX1, 72); > + skge_write8(hw, B3_MA_TOINI_TX2, 72); > + > + skge_write8(hw, B3_MA_RCINI_RX1, 0); > + skge_write8(hw, B3_MA_RCINI_RX2, 0); > + skge_write8(hw, B3_MA_RCINI_TX1, 0); > + skge_write8(hw, B3_MA_RCINI_TX2, 0); > + > + /* Configure Rx MAC FIFO */ > + skge_write8(hw, SKGEMAC_REG(port, RX_MFF_CTRL2), MFF_RST_CLR); > + skge_write16(hw, SKGEMAC_REG(port, RX_MFF_CTRL1), MFF_ENA_TIM_PAT); > + skge_write8(hw, SKGEMAC_REG(port, RX_MFF_CTRL2), MFF_ENA_OP_MD); > + > + /* Configure Tx MAC FIFO */ > + skge_write8(hw, SKGEMAC_REG(port, TX_MFF_CTRL2), MFF_RST_CLR); > + skge_write16(hw, SKGEMAC_REG(port, TX_MFF_CTRL1), MFF_TX_CTRL_DEF); > + skge_write8(hw, SKGEMAC_REG(port, TX_MFF_CTRL2), MFF_ENA_OP_MD); > + > + if (hw->dev[port]->mtu > ETH_DATA_LEN) { > + /* Enable frame flushing if jumbo frames used */ > + skge_write16(hw, SKGEMAC_REG(port,RX_MFF_CTRL1), MFF_ENA_FLUSH); > + } else { > + /* enable timeout timers if normal frames */ > + skge_write16(hw, B3_PA_CTRL, > + port == 0 ? PA_ENA_TO_TX1 : PA_ENA_TO_TX2); > + } > + > + > + r = skge_xm_read16(hw, port, XM_RX_CMD); > + if (hw->dev[port]->mtu > ETH_DATA_LEN) > + skge_xm_write16(hw, port, XM_RX_CMD, r | XM_RX_BIG_PK_OK); > + else > + skge_xm_write16(hw, port, XM_RX_CMD, r & ~(XM_RX_BIG_PK_OK)); > + > + switch (hw->phy_type) { > + case SK_PHY_XMAC: > + if (skge->autoneg == AUTONEG_ENABLE) { > + ctrl1 = PHY_X_AN_FD | PHY_X_AN_HD; > + > + switch (skge->flow_control) { > + case FLOW_MODE_NONE: > + ctrl1 |= PHY_X_P_NO_PAUSE; > + break; > + case FLOW_MODE_LOC_SEND: > + ctrl1 |= PHY_X_P_ASYM_MD; > + break; > + case FLOW_MODE_SYMMETRIC: > + ctrl1 |= PHY_X_P_SYM_MD; > + break; > + case FLOW_MODE_REM_SEND: > + ctrl1 |= PHY_X_P_BOTH_MD; > + break; > + } > + > + skge_xm_phy_write(hw, port, PHY_XMAC_AUNE_ADV, ctrl1); > + ctrl2 = PHY_CT_ANE | PHY_CT_RE_CFG; > + } else { > + ctrl2 = 0; > + if (skge->duplex == DUPLEX_FULL) > + ctrl2 |= PHY_CT_DUP_MD; > + } > + > + skge_xm_phy_write(hw, port, PHY_XMAC_CTRL, ctrl2); > + break; > + > + case SK_PHY_BCOM: > + ctrl1 = PHY_CT_SP1000; > + ctrl2 = 0; > + ctrl3 = PHY_SEL_TYPE; > + ctrl4 = PHY_B_PEC_EN_LTR; > + ctrl5 = PHY_B_AC_TX_TST; > + > + if (skge->autoneg == AUTONEG_ENABLE) { > + /* > + * Workaround BCOM Errata #1 for the C5 type. > + * 1000Base-T Link Acquisition Failure in Slave Mode > + * Set Repeater/DTE bit 10 of the 1000Base-T Control Register > + */ > + ctrl2 |= PHY_B_1000C_RD; > + ctrl2 |= PHY_B_1000C_AFD | PHY_B_1000C_AHD; > + > + /* Set Flow-control capabilities */ > + switch (skge->flow_control) { > + case FLOW_MODE_NONE: > + ctrl3 |= PHY_B_P_NO_PAUSE; > + break; > + case FLOW_MODE_LOC_SEND: > + ctrl3 |= PHY_B_P_ASYM_MD; > + break; > + case FLOW_MODE_SYMMETRIC: > + ctrl3 |= PHY_B_P_SYM_MD; > + break; > + case FLOW_MODE_REM_SEND: > + ctrl3 |= PHY_B_P_BOTH_MD; > + break; > + } > + > + /* Restart Auto-negotiation */ > + ctrl1 |= PHY_CT_ANE | PHY_CT_RE_CFG; > + } else { > + if (skge->duplex == DUPLEX_FULL) > + ctrl1 |= PHY_CT_DUP_MD; > + > + ctrl2 |= PHY_B_1000C_MSE; /* set it to Slave */ > + } > + > + skge_xm_phy_write(hw, port, PHY_BCOM_1000T_CTRL, ctrl2); > + skge_xm_phy_write(hw, port, PHY_BCOM_AUNE_ADV, ctrl3); > + > + if (skge->netdev->mtu > ETH_DATA_LEN) { > + ctrl4 |= PHY_B_PEC_HIGH_LA; > + ctrl5 |= PHY_B_AC_LONG_PACK; > + > + skge_xm_phy_write(hw, port,PHY_BCOM_AUX_CTRL, ctrl5); > + } > + > + skge_xm_phy_write(hw, port, PHY_BCOM_P_EXT_CTRL, ctrl4); > + skge_xm_phy_write(hw, port, PHY_BCOM_CTRL, ctrl1); > + break; > + } > + spin_unlock_bh(&hw->phy_lock); > + > + /* Clear MIB counters */ > + skge_xm_write16(hw, port, XM_STAT_CMD, > + XM_SC_CLR_RXC | XM_SC_CLR_TXC); > + /* Clear two times according to Errata #3 */ > + skge_xm_write16(hw, port, XM_STAT_CMD, > + XM_SC_CLR_RXC | XM_SC_CLR_TXC); > + > + /* Start polling for link status */ > + mod_timer(&skge->link_check, jiffies + HZ/10); > +} > + > +static void genesis_stop(struct skge_port *skge) > +{ > + struct skge_hw *hw = skge->hw; > + int port = skge->port; > + > + /* Clear Tx packet arbiter timeout IRQ */ > + skge_write16(hw, B3_PA_CTRL, > + port == 0 ? PA_CLR_TO_TX1 : PA_CLR_TO_TX2); > + > + /* > + * If the transfer stucks at the MAC the STOP command will not > + * terminate if we don't flush the XMAC's transmit FIFO ! > + */ > + skge_xm_write32(hw, port, XM_MODE, > + skge_xm_read32(hw, port, XM_MODE)|XM_MD_FTF); > + > + > + /* Reset the MAC */ > + skge_write16(hw, SKGEMAC_REG(port, TX_MFF_CTRL1), MFF_SET_MAC_RST); > + > + /* For external PHYs there must be special handling */ > + if (hw->phy_type != SK_PHY_XMAC) { > + u32 reg = skge_read32(hw, B2_GP_IO); > + > + if (port == 0) { > + reg |= GP_DIR_0; > + reg &= ~GP_IO_0; > + } else { > + reg |= GP_DIR_2; > + reg &= ~GP_IO_2; > + } > + skge_write32(hw, B2_GP_IO, reg); > + skge_read32(hw, B2_GP_IO); > + } > + > + skge_xm_write16(hw, port, XM_MMU_CMD, > + skge_xm_read16(hw, port, XM_MMU_CMD) > + & ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX)); > + > + skge_xm_read16(hw, port, XM_MMU_CMD); > +} > + > + > +static void genesis_get_stats(struct skge_port *skge, u64 *data) > +{ > + struct skge_hw *hw = skge->hw; > + int port = skge->port; > + int i; > + unsigned long timeout = jiffies + HZ; > + > + skge_xm_write16(hw, port, > + XM_STAT_CMD, XM_SC_SNP_TXC | XM_SC_SNP_RXC); > + > + /* wait for update to complete */ > + while (skge_xm_read16(hw, port, XM_STAT_CMD) > + & (XM_SC_SNP_TXC | XM_SC_SNP_RXC)) { > + if (time_after(jiffies, timeout)) > + break; > + udelay(10); > + } > + > + /* special case for 64 bit octet counter */ > + data[0] = (u64) skge_xm_read32(hw, port, XM_TXO_OK_HI) << 32 > + | skge_xm_read32(hw, port, XM_TXO_OK_LO); > + data[1] = (u64) skge_xm_read32(hw, port, XM_RXO_OK_HI) << 32 > + | skge_xm_read32(hw, port, XM_RXO_OK_LO); > + > + for (i = 2; i < ARRAY_SIZE(skge_stats); i++) > + data[i] = skge_xm_read32(hw, port, skge_stats[i].xmac_offset); > +} > + > +static void genesis_mac_intr(struct skge_hw *hw, int port) > +{ > + struct skge_port *skge = netdev_priv(hw->dev[port]); > + u16 status = skge_xm_read16(hw, port, XM_ISRC); > + > + pr_debug("genesis_intr status %x\n", status); > + if (hw->phy_type == SK_PHY_XMAC) { > + /* LInk down, start polling for state change */ > + if (status & XM_IS_INP_ASS) { > + skge_xm_write16(hw, port, XM_IMSK, > + skge_xm_read16(hw, port, XM_IMSK) | XM_IS_INP_ASS); > + mod_timer(&skge->link_check, jiffies + HZ/10); > + } > + else if (status & XM_IS_AND) > + mod_timer(&skge->link_check, jiffies + HZ/10); > + } > + > + if (status & XM_IS_TXF_UR) { > + skge_xm_write32(hw, port, XM_MODE, XM_MD_FTF); > + ++skge->net_stats.tx_fifo_errors; > + } > + if (status & XM_IS_RXF_OV) { > + skge_xm_write32(hw, port, XM_MODE, XM_MD_FRF); > + ++skge->net_stats.rx_fifo_errors; > + } > +} > + > +static void skge_gm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val) > +{ > + int i; > + > + skge_gma_write16(hw, port, GM_SMI_DATA, val); > + skge_gma_write16(hw, port, GM_SMI_CTRL, > + GM_SMI_CT_PHY_AD(hw->phy_addr) | GM_SMI_CT_REG_AD(reg)); > + for (i = 0; i < PHY_RETRIES; i++) { > + udelay(1); > + > + if (!(skge_gma_read16(hw, port, GM_SMI_CTRL) & GM_SMI_CT_BUSY)) > + break; > + } > +} > + > +static u16 skge_gm_phy_read(struct skge_hw *hw, int port, u16 reg) > +{ > + int i; > + > + skge_gma_write16(hw, port, GM_SMI_CTRL, > + GM_SMI_CT_PHY_AD(hw->phy_addr) > + | GM_SMI_CT_REG_AD(reg) | GM_SMI_CT_OP_RD); > + > + for (i = 0; i < PHY_RETRIES; i++) { > + udelay(1); > + if (skge_gma_read16(hw, port, GM_SMI_CTRL) & GM_SMI_CT_RD_VAL) > + goto ready; > + } > + > + printk(KERN_WARNING PFX "%s: phy read timeout\n", > + hw->dev[port]->name); > + return 0; > + ready: > + return skge_gma_read16(hw, port, GM_SMI_DATA); > +} > + > +static void genesis_link_down(struct skge_port *skge) > +{ > + struct skge_hw *hw = skge->hw; > + int port = skge->port; > + > + pr_debug("genesis_link_down\n"); > + > + netif_carrier_off(skge->netdev); > + skge_xm_write16(hw, port, XM_MMU_CMD, > + skge_xm_read16(hw, port, XM_MMU_CMD) > + & ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX)); > + > + /* dummy read to ensure writing */ > + (void) skge_xm_read16(hw, port, XM_MMU_CMD); > + > + skge_link_report(skge); > +} > + > +static void genesis_link_up(struct skge_port *skge) > +{ > + struct skge_hw *hw = skge->hw; > + int port = skge->port; > + u16 cmd; > + u32 mode, msk; > + > + pr_debug("genesis_link_up\n"); > + netif_wake_queue(skge->netdev); only wake queue is TX is not full > + netif_carrier_on(skge->netdev); > + > + cmd = skge_xm_read16(hw, port, XM_MMU_CMD); > + > + /* > + * enabling pause frame reception is required for 1000BT > + * because the XMAC is not reset if the link is going down > + */ > + if (skge->flow_control == FLOW_MODE_NONE || > + skge->flow_control == FLOW_MODE_LOC_SEND) > + cmd |= XM_MMU_IGN_PF; > + else > + /* Enable Pause Frame Reception */ > + cmd &= ~XM_MMU_IGN_PF; > + > + skge_xm_write16(hw, port, XM_MMU_CMD, cmd); > + > + mode = skge_xm_read32(hw, port, XM_MODE); > + if (skge->flow_control == FLOW_MODE_SYMMETRIC || > + skge->flow_control == FLOW_MODE_LOC_SEND) { > + /* > + * Configure Pause Frame Generation > + * Use internal and external Pause Frame Generation. > + * Sending pause frames is edge triggered. > + * Send a Pause frame with the maximum pause time if > + * internal oder external FIFO full condition occurs. > + * Send a zero pause time frame to re-start transmission. > + */ > + /* XM_PAUSE_DA = '010000C28001' (default) */ > + /* XM_MAC_PTIME = 0xffff (maximum) */ > + /* remember this value is defined in big endian (!) */ > + skge_xm_write16(hw, port, XM_MAC_PTIME, 0xffff); > + > + mode |= XM_PAUSE_MODE; > + skge_write16(hw, SKGEMAC_REG(port, RX_MFF_CTRL1), MFF_ENA_PAUSE); > + } else { > + /* > + * disable pause frame generation is required for 1000BT > + * because the XMAC is not reset if the link is going down > + */ > + /* Disable Pause Mode in Mode Register */ > + mode &= ~XM_PAUSE_MODE; > + > + skge_write16(hw, SKGEMAC_REG(port, RX_MFF_CTRL1), MFF_DIS_PAUSE); > + } > + > + skge_xm_write32(hw, port, XM_MODE, mode); > + > + msk = XM_DEF_MSK; > + if (hw->phy_type != SK_PHY_XMAC) > + msk |= XM_IS_INP_ASS; /* disable GP0 interrupt bit */ > + > + skge_xm_write16(hw, port, XM_IMSK, msk); > + skge_xm_read16(hw, port, XM_ISRC); > + > + /* get MMU Command Reg. */ > + cmd = skge_xm_read16(hw, port, XM_MMU_CMD); > + if (hw->phy_type != SK_PHY_XMAC && skge->duplex == DUPLEX_FULL) > + cmd |= XM_MMU_GMII_FD; > + > + if (hw->phy_type == SK_PHY_BCOM) { > + /* > + * Workaround BCOM Errata (#10523) for all BCom Phys > + * Enable Power Management after link up > + */ > + skge_xm_phy_write(hw, port, PHY_BCOM_AUX_CTRL, > + skge_xm_phy_read(hw, port, PHY_BCOM_AUX_CTRL) > + & ~PHY_B_AC_DIS_PM); > + skge_xm_phy_write(hw, port, PHY_BCOM_INT_MASK, > + PHY_B_DEF_MSK); > + } > + > + /* enable Rx/Tx */ > + skge_xm_write16(hw, port, XM_MMU_CMD, > + cmd | XM_MMU_ENA_RX | XM_MMU_ENA_TX); > + skge_link_report(skge); > +} > + > + > +static void genesis_bcom_intr(struct skge_port *skge) > +{ > + struct skge_hw *hw = skge->hw; > + int port = skge->port; > + u16 stat = skge_xm_phy_read(hw, port, PHY_BCOM_INT_STAT); > + > + pr_debug("genesis_bcom intr stat=%x\n", stat); > + > + /* Workaround BCom Errata: > + * enable and disable loopback mode if "NO HCD" occurs. > + */ > + if (stat & PHY_B_IS_NO_HDCL) { > + u16 ctrl = skge_xm_phy_read(hw, port, PHY_BCOM_CTRL); > + skge_xm_phy_write(hw, port, PHY_BCOM_CTRL, > + ctrl | PHY_CT_LOOP); > + skge_xm_phy_write(hw, port, PHY_BCOM_CTRL, > + ctrl & ~PHY_CT_LOOP); > + } > + > + stat = skge_xm_phy_read(hw, port, PHY_BCOM_STAT); > + if (stat & (PHY_B_IS_AN_PR | PHY_B_IS_LST_CHANGE)) { > + u16 aux = skge_xm_phy_read(hw, port, PHY_BCOM_AUX_STAT); > + if ( !(aux & PHY_B_AS_LS) && netif_carrier_ok(skge->netdev)) > + genesis_link_down(skge); > + > + else if (stat & PHY_B_IS_LST_CHANGE) { > + if (aux & PHY_B_AS_AN_C) { > + switch (aux & PHY_B_AS_AN_RES_MSK) { > + case PHY_B_RES_1000FD: > + skge->duplex = DUPLEX_FULL; > + break; > + case PHY_B_RES_1000HD: > + skge->duplex = DUPLEX_HALF; > + break; > + } > + > + switch (aux & PHY_B_AS_PAUSE_MSK) { > + case PHY_B_AS_PAUSE_MSK: > + skge->flow_control = FLOW_MODE_SYMMETRIC; > + break; > + case PHY_B_AS_PRR: > + skge->flow_control = FLOW_MODE_REM_SEND; > + break; > + case PHY_B_AS_PRT: > + skge->flow_control = FLOW_MODE_LOC_SEND; > + break; > + default: > + skge->flow_control = FLOW_MODE_NONE; > + } > + skge->speed = SPEED_1000; > + } > + genesis_link_up(skge); > + } > + else > + mod_timer(&skge->link_check, jiffies + HZ/10); > + } > +} > + > +/* Perodic poll of phy status to check for link transistion */ > +static void skge_link_timer(unsigned long __arg) > +{ > + struct skge_port *skge = (struct skge_port *) __arg; > + struct skge_hw *hw = skge->hw; > + int port = skge->port; > + > + if (hw->chip_id != CHIP_ID_GENESIS || !netif_running(skge->netdev)) > + return; > + > + spin_lock_bh(&hw->phy_lock); > + if (hw->phy_type == SK_PHY_BCOM) > + genesis_bcom_intr(skge); > + else { > + int i; > + for (i = 0; i < 3; i++) > + if (skge_xm_read16(hw, port, XM_ISRC) & XM_IS_INP_ASS) > + break; > + > + if (i == 3) > + mod_timer(&skge->link_check, jiffies + HZ/10); > + else > + genesis_link_up(skge); > + } > + spin_unlock_bh(&hw->phy_lock); > +} > + > +/* Marvell Phy Initailization */ > +static void yukon_init(struct skge_hw *hw, int port) > +{ > + struct skge_port *skge = netdev_priv(hw->dev[port]); > + u16 ctrl, ct1000, adv; > + u16 ledctrl, ledover; > + > + pr_debug("yukon_init\n"); > + if (skge->autoneg == AUTONEG_ENABLE) { > + u16 ectrl = skge_gm_phy_read(hw, port, PHY_MARV_EXT_CTRL); > + > + ectrl &= ~(PHY_M_EC_M_DSC_MSK | PHY_M_EC_S_DSC_MSK | > + PHY_M_EC_MAC_S_MSK); > + ectrl |= PHY_M_EC_MAC_S(MAC_TX_CLK_25_MHZ); > + > + /* on PHY 88E1111 there is a change for downshift control */ > + if (hw->chip_id == CHIP_ID_YUKON_EC) > + ectrl |= PHY_M_EC_M_DSC_2(0) | PHY_M_EC_DOWN_S_ENA; > + else > + ectrl |= PHY_M_EC_M_DSC(0) | PHY_M_EC_S_DSC(1); > + > + skge_gm_phy_write(hw, port, PHY_MARV_EXT_CTRL, ectrl); > + } > + > + ctrl = skge_gm_phy_read(hw, port, PHY_MARV_CTRL); > + if (skge->autoneg == AUTONEG_DISABLE) > + ctrl &= ~PHY_CT_ANE; > + > + ctrl |= PHY_CT_RESET; > + skge_gm_phy_write(hw, port, PHY_MARV_CTRL, ctrl); > + > + ctrl = 0; > + ct1000 = 0; > + adv = PHY_SEL_TYPE; > + > + if (skge->autoneg == AUTONEG_ENABLE) { > + if (iscopper(hw)) { > + ct1000 |= PHY_M_1000C_AHD | PHY_M_1000C_AFD; > + adv |= PHY_M_AN_100_FD | PHY_M_AN_100_HD | > + PHY_M_AN_10_FD | PHY_M_AN_10_HD; > + > + /* Set Flow-control capabilities */ > + switch (skge->flow_control) { > + case FLOW_MODE_NONE: > + adv |= PHY_B_P_NO_PAUSE; > + break; > + case FLOW_MODE_LOC_SEND: > + adv |= PHY_B_P_ASYM_MD; > + break; > + case FLOW_MODE_SYMMETRIC: > + adv |= PHY_B_P_SYM_MD; > + break; > + case FLOW_MODE_REM_SEND: > + adv |= PHY_B_P_BOTH_MD; > + break; > + } > + } else { /* special defines for FIBER (88E1011S only) */ > + adv |= PHY_M_AN_1000X_AHD | PHY_M_AN_1000X_AFD; > + > + /* Set Flow-control capabilities */ > + switch (skge->flow_control) { > + case FLOW_MODE_NONE: > + adv |= PHY_M_P_NO_PAUSE_X; > + break; > + case FLOW_MODE_LOC_SEND: > + adv |= PHY_M_P_ASYM_MD_X; > + break; > + case FLOW_MODE_SYMMETRIC: > + adv |= PHY_M_P_SYM_MD_X; > + break; > + case FLOW_MODE_REM_SEND: > + adv |= PHY_M_P_BOTH_MD_X; > + break; > + } > + } > + /* Restart Auto-negotiation */ > + ctrl |= PHY_CT_ANE | PHY_CT_RE_CFG; > + } else { > + /* forced speed/duplex settings */ > + ct1000 = PHY_M_1000C_MSE; > + > + if (skge->duplex == DUPLEX_FULL) > + ctrl |= PHY_CT_DUP_MD; > + > + switch (skge->speed) { > + case SPEED_1000: > + ctrl |= PHY_CT_SP1000; > + break; > + case SPEED_100: > + ctrl |= PHY_CT_SP100; > + break; > + } > + > + ctrl |= PHY_CT_RESET; > + } > + > + if (hw->chip_id != CHIP_ID_YUKON_FE) > + skge_gm_phy_write(hw, port, PHY_MARV_1000T_CTRL, ct1000); > + > + skge_gm_phy_write(hw, port, PHY_MARV_AUNE_ADV, adv); > + skge_gm_phy_write(hw, port, PHY_MARV_CTRL, ctrl); > + > + /* Setup Phy LED's */ > + ledctrl = PHY_M_LED_PULS_DUR(PULS_170MS); > + ledover = 0; > + > + if (hw->chip_id == CHIP_ID_YUKON_FE) { > + /* on 88E3082 these bits are at 11..9 (shifted left) */ > + ledctrl |= PHY_M_LED_BLINK_RT(BLINK_84MS) << 1; > + > + skge_gm_phy_write(hw, port, PHY_MARV_FE_LED_PAR, > + ((skge_gm_phy_read(hw, port, PHY_MARV_FE_LED_PAR) > + > + & ~PHY_M_FELP_LED1_MSK) > + | PHY_M_FELP_LED1_CTRL(LED_PAR_CTRL_ACT_BL))); > + } else { > + /* set Tx LED (LED_TX) to blink mode on Rx OR Tx activity */ > + ledctrl |= PHY_M_LED_BLINK_RT(BLINK_84MS) | PHY_M_LEDC_TX_CTRL; > + > + /* turn off the Rx LED (LED_RX) */ > + ledover |= PHY_M_LED_MO_RX(MO_LED_OFF); > + } > + > + /* disable blink mode (LED_DUPLEX) on collisions */ > + ctrl |= PHY_M_LEDC_DP_CTRL; > + skge_gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl); > + > + if (skge->autoneg == AUTONEG_DISABLE || skge->speed == SPEED_100) { > + /* turn on 100 Mbps LED (LED_LINK100) */ > + ledover |= PHY_M_LED_MO_100(MO_LED_ON); > + } > + > + if (ledover) > + skge_gm_phy_write(hw, port, PHY_MARV_LED_OVER, ledover); > + > + /* Enable phy interrupt on autonegotiation complete (or link up) */ > + if (skge->autoneg == AUTONEG_ENABLE) > + skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_IS_AN_COMPL); > + else > + skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_DEF_MSK); > +} > + > +static void yukon_reset(struct skge_hw *hw, int port) > +{ > + skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, 0);/* disable PHY IRQs */ > + skge_gma_write16(hw, port, GM_MC_ADDR_H1, 0); /* clear MC hash */ > + skge_gma_write16(hw, port, GM_MC_ADDR_H2, 0); > + skge_gma_write16(hw, port, GM_MC_ADDR_H3, 0); > + skge_gma_write16(hw, port, GM_MC_ADDR_H4, 0); > + > + skge_gma_write16(hw, port, GM_RX_CTRL, > + skge_gma_read16(hw, port, GM_RX_CTRL) > + | GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA); > +} > + > +static void yukon_mac_init(struct skge_hw *hw, int port) > +{ > + struct skge_port *skge = netdev_priv(hw->dev[port]); > + int i; > + u32 reg; > + const u8 *addr = hw->dev[port]->dev_addr; > + > + /* WA code for COMA mode -- set PHY reset */ > + if (hw->chip_id == CHIP_ID_YUKON_LITE && > + chip_rev(hw) == CHIP_REV_YU_LITE_A3) > + skge_write32(hw, B2_GP_IO, > + (skge_read32(hw, B2_GP_IO) | GP_DIR_9 | GP_IO_9)); > + > + /* hard reset */ > + skge_write32(hw, SKGEMAC_REG(port, GPHY_CTRL), GPC_RST_SET); > + skge_write32(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_RST_SET); > + > + /* WA code for COMA mode -- clear PHY reset */ > + if (hw->chip_id == CHIP_ID_YUKON_LITE && > + chip_rev(hw) == CHIP_REV_YU_LITE_A3) > + skge_write32(hw, B2_GP_IO, > + (skge_read32(hw, B2_GP_IO) | GP_DIR_9) > + & ~GP_IO_9); > + > + /* Set hardware config mode */ > + reg = GPC_INT_POL_HI | GPC_DIS_FC | GPC_DIS_SLEEP | > + GPC_ENA_XC | GPC_ANEG_ADV_ALL_M | GPC_ENA_PAUSE; > + reg |= iscopper(hw) ? GPC_HWCFG_GMII_COP : GPC_HWCFG_GMII_FIB; > + > + /* Clear GMC reset */ > + skge_write32(hw, SKGEMAC_REG(port, GPHY_CTRL), reg | GPC_RST_SET); > + skge_write32(hw, SKGEMAC_REG(port, GPHY_CTRL), reg | GPC_RST_CLR); > + skge_write32(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_PAUSE_ON | GMC_RST_CLR); > + if (skge->autoneg == AUTONEG_DISABLE) { > + reg = GM_GPCR_AU_ALL_DIS; > + skge_gma_write16(hw, port, GM_GP_CTRL, > + skge_gma_read16(hw, port, GM_GP_CTRL) | reg); > + > + switch (skge->speed) { > + case SPEED_1000: > + reg |= GM_GPCR_SPEED_1000; > + /* fallthru */ > + case SPEED_100: > + reg |= GM_GPCR_SPEED_100; > + } > + > + if (skge->duplex == DUPLEX_FULL) > + reg |= GM_GPCR_DUP_FULL; > + } else > + reg = GM_GPCR_SPEED_1000 | GM_GPCR_SPEED_100 | GM_GPCR_DUP_FULL; > + switch (skge->flow_control) { > + case FLOW_MODE_NONE: > + skge_write32(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_PAUSE_OFF); > + reg |= GM_GPCR_FC_TX_DIS | GM_GPCR_FC_RX_DIS | GM_GPCR_AU_FCT_DIS; > + break; > + case FLOW_MODE_LOC_SEND: > + /* disable Rx flow-control */ > + reg |= GM_GPCR_FC_RX_DIS | GM_GPCR_AU_FCT_DIS; > + } > + > + skge_gma_write16(hw, port, GM_GP_CTRL, reg); > + skge_read16(hw, GMAC_IRQ_SRC); > + > + spin_lock_bh(&hw->phy_lock); > + yukon_init(hw, port); > + spin_unlock_bh(&hw->phy_lock); > + > + /* MIB clear */ > + reg = skge_gma_read16(hw, port, GM_PHY_ADDR); > + skge_gma_write16(hw, port, GM_PHY_ADDR, reg | GM_PAR_MIB_CLR); > + > + for (i = 0; i < GM_MIB_CNT_SIZE; i++) > + skge_gma_read16(hw, port, GM_MIB_CNT_BASE + 8*i); > + skge_gma_write16(hw, port, GM_PHY_ADDR, reg); > + > + /* transmit control */ > + skge_gma_write16(hw, port, GM_TX_CTRL, TX_COL_THR(TX_COL_DEF)); > + > + /* receive control reg: unicast + multicast + no FCS */ > + skge_gma_write16(hw, port, GM_RX_CTRL, > + GM_RXCR_UCF_ENA | GM_RXCR_CRC_DIS | GM_RXCR_MCF_ENA); > + > + /* transmit flow control */ > + skge_gma_write16(hw, port, GM_TX_FLOW_CTRL, 0xffff); > + > + /* transmit parameter */ > + skge_gma_write16(hw, port, GM_TX_PARAM, > + TX_JAM_LEN_VAL(TX_JAM_LEN_DEF) | > + TX_JAM_IPG_VAL(TX_JAM_IPG_DEF) | > + TX_IPG_JAM_DATA(TX_IPG_JAM_DEF)); > + > + /* serial mode register */ > + reg = GM_SMOD_VLAN_ENA | IPG_DATA_VAL(IPG_DATA_DEF); > + if (hw->dev[port]->mtu > 1500) > + reg |= GM_SMOD_JUMBO_ENA; > + > + skge_gma_write16(hw, port, GM_SERIAL_MODE, reg); > + > + /* physical address: used for pause frames */ > + skge_gm_set_addr(hw, port, GM_SRC_ADDR_1L, addr); > + /* virtual address for data */ > + skge_gm_set_addr(hw, port, GM_SRC_ADDR_2L, addr); > + > + /* enable interrupt mask for counter overflows */ > + skge_gma_write16(hw, port, GM_TX_IRQ_MSK, 0); > + skge_gma_write16(hw, port, GM_RX_IRQ_MSK, 0); > + skge_gma_write16(hw, port, GM_TR_IRQ_MSK, 0); > + > + /* Initialize Mac Fifo */ > + > + /* Configure Rx MAC FIFO */ > + skge_write16(hw, SKGEMAC_REG(port, RX_GMF_FL_MSK), RX_FF_FL_DEF_MSK); > + reg = GMF_OPER_ON | GMF_RX_F_FL_ON; > + if (hw->chip_id == CHIP_ID_YUKON_LITE && > + chip_rev(hw) == CHIP_REV_YU_LITE_A3) > + reg &= ~GMF_RX_F_FL_ON; > + skge_write8(hw, SKGEMAC_REG(port, RX_GMF_CTRL_T), GMF_RST_CLR); > + skge_write16(hw, SKGEMAC_REG(port, RX_GMF_CTRL_T), reg); > + skge_write16(hw, SKGEMAC_REG(port, RX_GMF_FL_THR), RX_GMF_FL_THR_DEF); > + > + /* Configure Tx MAC FIFO */ > + skge_write8(hw, SKGEMAC_REG(port, TX_GMF_CTRL_T), GMF_RST_CLR); > + skge_write16(hw, SKGEMAC_REG(port, TX_GMF_CTRL_T), GMF_OPER_ON); > +} > + > +static void yukon_stop(struct skge_port *skge) > +{ > + struct skge_hw *hw = skge->hw; > + int port = skge->port; > + > + if (hw->chip_id == CHIP_ID_YUKON_LITE && > + chip_rev(hw) == CHIP_REV_YU_LITE_A3) { > + skge_write32(hw, B2_GP_IO, > + skge_read32(hw, B2_GP_IO) | GP_DIR_9 | GP_IO_9); > + } > + > + skge_gma_write16(hw, port, GM_GP_CTRL, > + skge_gma_read16(hw, port, GM_GP_CTRL) > + & ~(GM_GPCR_RX_ENA|GM_GPCR_RX_ENA)); > + skge_gma_read16(hw, port, GM_GP_CTRL); > + > + /* set GPHY Control reset */ > + skge_gma_write32(hw, port, GPHY_CTRL, GPC_RST_SET); > + skge_gma_write32(hw, port, GMAC_CTRL, GMC_RST_SET); > +} > + > +static void yukon_get_stats(struct skge_port *skge, u64 *data) > +{ > + struct skge_hw *hw = skge->hw; > + int port = skge->port; > + int i; > + > + data[0] = (u64) skge_gma_read32(hw, port, GM_TXO_OK_HI) << 32 > + | skge_gma_read32(hw, port, GM_TXO_OK_LO); > + data[1] = (u64) skge_gma_read32(hw, port, GM_RXO_OK_HI) << 32 > + | skge_gma_read32(hw, port, GM_RXO_OK_LO); > + > + for (i = 2; i < ARRAY_SIZE(skge_stats); i++) > + data[i] = skge_gma_read32(hw, port, > + skge_stats[i].gma_offset); > +} > + > +static void yukon_mac_intr(struct skge_hw *hw, int port) > +{ > + struct skge_port *skge = netdev_priv(hw->dev[port]); > + u8 status = skge_read8(hw, SKGEMAC_REG(port, GMAC_IRQ_SRC)); > + > + pr_debug("yukon_intr status %x\n", status); > + if (status & GM_IS_RX_FF_OR) { > + ++skge->net_stats.rx_fifo_errors; > + skge_gma_write8(hw, port, RX_GMF_CTRL_T, GMF_CLI_RX_FO); > + } > + if (status & GM_IS_TX_FF_UR) { > + ++skge->net_stats.tx_fifo_errors; > + skge_gma_write8(hw, port, TX_GMF_CTRL_T, GMF_CLI_TX_FU); > + } > + > +} > + > +static u16 yukon_speed(const struct skge_hw *hw, u16 aux) > +{ > + if (hw->chip_id == CHIP_ID_YUKON_FE) > + return (aux & PHY_M_PS_SPEED_100) ? SPEED_100 : SPEED_10; > + > + switch(aux & PHY_M_PS_SPEED_MSK) { > + case PHY_M_PS_SPEED_1000: > + return SPEED_1000; > + case PHY_M_PS_SPEED_100: > + return SPEED_100; > + default: > + return SPEED_10; > + } > +} > + > +static void yukon_link_up(struct skge_port *skge) > +{ > + struct skge_hw *hw = skge->hw; > + int port = skge->port; > + u16 reg; > + > + pr_debug("yukon_link_up\n"); > + netif_wake_queue(skge->netdev); only wake queue if TX is not full > + netif_carrier_on(skge->netdev); > + > + /* Enable Transmit FIFO Underrun */ > + skge_write8(hw, GMAC_IRQ_MSK, GMAC_DEF_MSK); > + > + reg = skge_gma_read16(hw, port, GM_GP_CTRL); > + if (skge->duplex == DUPLEX_FULL || skge->autoneg == AUTONEG_ENABLE) > + reg |= GM_GPCR_DUP_FULL; > + > + /* enable Rx/Tx */ > + reg |= GM_GPCR_RX_ENA | GM_GPCR_TX_ENA; > + skge_gma_write16(hw, port, GM_GP_CTRL, reg); > + > + skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_DEF_MSK); > + skge_link_report(skge); > +} > + > +static void yukon_link_down(struct skge_port *skge) > +{ > + struct skge_hw *hw = skge->hw; > + int port = skge->port; > + > + netif_carrier_off(skge->netdev); > + > + pr_debug("yukon_link_down\n"); > + skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, 0); > + skge_gm_phy_write(hw, port, GM_GP_CTRL, > + skge_gm_phy_read(hw, port, GM_GP_CTRL) > + & ~(GM_GPCR_RX_ENA | GM_GPCR_TX_ENA)); > + > + if (hw->chip_id != CHIP_ID_YUKON_FE && > + skge->flow_control == FLOW_MODE_REM_SEND) { > + /* restore Asymmetric Pause bit */ > + skge_gm_phy_write(hw, port, PHY_MARV_AUNE_ADV, > + skge_gm_phy_read(hw, port, > + PHY_MARV_AUNE_ADV) > + | PHY_M_AN_ASP); > + > + } > + > + yukon_reset(hw, port); > + skge_link_report(skge); > + yukon_init(hw, port); > +} > + > +static void yukon_phy_intr(struct skge_port *skge) > +{ > + struct skge_hw *hw = skge->hw; > + int port = skge->port; > + const char *reason = NULL; > + u16 istatus, phystat; > + > + istatus = skge_gm_phy_read(hw, port, PHY_MARV_INT_STAT); > + phystat = skge_gm_phy_read(hw, port, PHY_MARV_PHY_STAT); > + pr_debug("yukon phy intr istat=%x phy_stat=%x\n", istatus, phystat); > + > + if (istatus & PHY_M_IS_AN_COMPL) { > + if (skge_gm_phy_read(hw, port, PHY_MARV_AUNE_LP) > + & PHY_M_AN_RF) { > + reason = "remote fault"; > + goto failed; > + } > + > + if (!(hw->chip_id == CHIP_ID_YUKON_FE || hw->chip_id == CHIP_ID_YUKON_EC) > + && (skge_gm_phy_read(hw, port, PHY_MARV_1000T_STAT) > + & PHY_B_1000S_MSF)) { > + reason = "master/slave fault"; > + goto failed; > + } > + > + if (!(phystat & PHY_M_PS_SPDUP_RES)) { > + reason = "speed/duplex"; > + goto failed; > + } > + > + skge->duplex = (phystat & PHY_M_PS_FULL_DUP) > + ? DUPLEX_FULL : DUPLEX_HALF; > + skge->speed = yukon_speed(hw, phystat); > + > + /* Tx & Rx Pause Enabled bits are at 9..8 */ > + if (hw->chip_id == CHIP_ID_YUKON_XL) > + phystat >>= 6; > + > + /* We are using IEEE 802.3z/D5.0 Table 37-4 */ > + switch (phystat & PHY_M_PS_PAUSE_MSK) { > + case PHY_M_PS_PAUSE_MSK: > + skge->flow_control = FLOW_MODE_SYMMETRIC; > + break; > + case PHY_M_PS_RX_P_EN: > + skge->flow_control = FLOW_MODE_REM_SEND; > + break; > + case PHY_M_PS_TX_P_EN: > + skge->flow_control = FLOW_MODE_LOC_SEND; > + break; > + default: > + skge->flow_control = FLOW_MODE_NONE; > + } > + > + if (skge->flow_control == FLOW_MODE_NONE || > + (skge->speed < SPEED_1000 && skge->duplex == DUPLEX_HALF)) > + skge_write8(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_PAUSE_OFF); > + else > + skge_write8(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_PAUSE_ON); > + yukon_link_up(skge); > + return; > + } > + > + if (istatus & PHY_M_IS_LSP_CHANGE) > + skge->speed = yukon_speed(hw, phystat); > + > + if (istatus & PHY_M_IS_DUP_CHANGE) > + skge->duplex = (phystat & PHY_M_PS_FULL_DUP) ? DUPLEX_FULL : DUPLEX_HALF; > + if (istatus & PHY_M_IS_LST_CHANGE) { > + if (phystat & PHY_M_PS_LINK_UP) > + yukon_link_up(skge); > + else > + yukon_link_down(skge); > + } > + return; > + failed: > + printk(KERN_ERR PFX "%s: autonegotiation failed (%s)\n", > + skge->netdev->name, reason); > + > + /* XXX restart autonegotiation? */ > +} > + > +static void skge_ramset(struct skge_hw *hw, u16 q, u32 start, size_t len) > +{ > + u32 end; > + > + start /= 8; > + len /= 8; > + end = start + len - 1; > + > + skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_RST_CLR); > + skge_write32(hw, RB_ADDR(q, RB_START), start); > + skge_write32(hw, RB_ADDR(q, RB_WP), start); > + skge_write32(hw, RB_ADDR(q, RB_RP), start); > + skge_write32(hw, RB_ADDR(q, RB_END), end); > + > + if (q == Q_R1 || q == Q_R2) { > + /* Set thresholds on receive queue's */ > + skge_write32(hw, RB_ADDR(q, RB_RX_UTPP), > + start + (2*len)/3); > + skge_write32(hw, RB_ADDR(q, RB_RX_LTPP), > + start + (len/3)); > + } else { > + /* Enable store & forward on Tx queue's because > + * Tx FIFO is only 4K on Genesis and 1K on Yukon > + */ > + skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_ENA_STFWD); > + } > + > + skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_ENA_OP_MD); > +} > + > +/* Setup Bus Memory Interface */ > +static void skge_qset(struct skge_port *skge, u16 q, > + const struct skge_element *e) > +{ > + struct skge_hw *hw = skge->hw; > + u32 watermark = 0x600; > + u64 base = skge->dma + (e->desc - skge->mem); > + > + /* optimization to reduce window on 32bit/33mhz */ > + if ((skge_read16(hw, B0_CTST) & (CS_BUS_CLOCK | CS_BUS_SLOT_SZ)) == 0) > + watermark /= 2; > + > + skge_write32(hw, Q_ADDR(q, Q_CSR), CSR_CLR_RESET); > + skge_write32(hw, Q_ADDR(q, Q_F), watermark); > + skge_write32(hw, Q_ADDR(q, Q_DA_H), (u32)(base >> 32)); > + skge_write32(hw, Q_ADDR(q, Q_DA_L), (u32)base); > +} > + > +static int skge_up(struct net_device *dev) > +{ > + struct skge_port *skge = netdev_priv(dev); > + struct skge_hw *hw = skge->hw; > + int port = skge->port; > + u32 chunk, ram_addr; > + size_t rx_size, tx_size; > + int err; > + > + if (netif_msg_ifup(skge)) > + printk(KERN_INFO PFX "%s: enabling interface\n", dev->name); > + > + rx_size = skge->rx_ring.count * sizeof(struct skge_rx_desc); > + tx_size = skge->tx_ring.count * sizeof(struct skge_tx_desc); > + skge->mem_size = tx_size + rx_size; > + skge->mem = pci_alloc_consistent(hw->pdev, skge->mem_size, &skge->dma); > + if (!skge->mem) > + return -ENOMEM; > + > + memset(skge->mem, 0, skge->mem_size); > + > + if ((err = skge_ring_alloc(&skge->rx_ring, skge->mem, skge->dma))) > + goto free_pci_mem; > + > + if (skge_rx_fill(skge)) > + goto free_rx_ring; > + > + if ((err = skge_ring_alloc(&skge->tx_ring, skge->mem + rx_size, > + skge->dma + rx_size))) > + goto free_rx_ring; > + > + skge->tx_avail = skge->tx_ring.count - 1; > + > + /* Initialze MAC */ > + if (hw->chip_id == CHIP_ID_GENESIS) > + genesis_mac_init(hw, port); > + else > + yukon_mac_init(hw, port); > + > + /* Configure RAMbuffers */ > + chunk = hw->ram_size / (isdualport(hw) ? 4 : 2); > + ram_addr = hw->ram_offset + 2 * chunk * port; > + > + skge_ramset(hw, rxq[port], ram_addr, chunk); > + skge_qset(skge, rxq[port], skge->rx_ring.to_clean); > + > + BUG_ON(skge->tx_ring.to_use != skge->tx_ring.to_clean); > + skge_ramset(hw, txq[port], ram_addr+chunk, chunk); > + skge_qset(skge, txq[port], skge->tx_ring.to_use); > + > + /* Start receiver BMU */ > + wmb(); > + skge_write8(hw, Q_ADDR(rxq[port], Q_CSR), CSR_START | CSR_IRQ_CL_F); > + > + pr_debug("skge_up completed\n"); > + return 0; > + > + free_rx_ring: > + skge_rx_clean(skge); > + kfree(skge->rx_ring.start); > + free_pci_mem: > + pci_free_consistent(hw->pdev, skge->mem_size, skge->mem, skge->dma); > + > + return err; > +} > + > +static int skge_down(struct net_device *dev) > +{ > + struct skge_port *skge = netdev_priv(dev); > + struct skge_hw *hw = skge->hw; > + int port = skge->port; > + > + if (netif_msg_ifdown(skge)) > + printk(KERN_INFO PFX "%s: disabling interface\n", dev->name); > + > + netif_stop_queue(dev); > + > + /* Stop transmitter */ > + skge_write8(hw, Q_ADDR(txq[port], Q_CSR), CSR_STOP); > + skge_write32(hw, RB_ADDR(txq[port], RB_CTRL), > + RB_RST_SET|RB_DIS_OP_MD); > + > + if (hw->chip_id == CHIP_ID_GENESIS) > + genesis_stop(skge); > + else > + yukon_stop(skge); > + > + /* Disable Force Sync bit and Enable Alloc bit */ > + skge_write8(hw, SKGEMAC_REG(port, TXA_CTRL), > + TXA_DIS_FSYNC | TXA_DIS_ALLOC | TXA_STOP_RC); > + > + /* Stop Interval Timer and Limit Counter of Tx Arbiter */ > + skge_write32(hw, SKGEMAC_REG(port, TXA_ITI_INI), 0L); > + skge_write32(hw, SKGEMAC_REG(port, TXA_LIM_INI), 0L); > + > + /* Reset PCI FIFO */ > + skge_write32(hw, Q_ADDR(txq[port], Q_CSR), CSR_SET_RESET); > + skge_write32(hw, RB_ADDR(txq[port], RB_CTRL), RB_RST_SET); > + > + /* Reset the RAM Buffer async Tx queue */ > + skge_write8(hw, RB_ADDR(port == 0 ? Q_XA1 : Q_XA2, RB_CTRL), RB_RST_SET); > + /* stop receiver */ > + skge_write8(hw, Q_ADDR(rxq[port], Q_CSR), CSR_STOP); > + skge_write32(hw, RB_ADDR(port ? Q_R2 : Q_R1, RB_CTRL), > + RB_RST_SET|RB_DIS_OP_MD); > + skge_write32(hw, Q_ADDR(rxq[port], Q_CSR), CSR_SET_RESET); > + > + if (hw->chip_id == CHIP_ID_GENESIS) { > + skge_write8(hw, SKGEMAC_REG(port, TX_MFF_CTRL2), MFF_RST_SET); > + skge_write8(hw, SKGEMAC_REG(port, RX_MFF_CTRL2), MFF_RST_SET); > + skge_write8(hw, SKGEMAC_REG(port, TX_LED_CTRL), LED_STOP); > + skge_write8(hw, SKGEMAC_REG(port, RX_LED_CTRL), LED_STOP); > + } else { > + skge_write8(hw, SKGEMAC_REG(port, RX_GMF_CTRL_T), GMF_RST_SET); > + skge_write8(hw, SKGEMAC_REG(port, TX_GMF_CTRL_T), GMF_RST_SET); > + } > + > + /* turn off led's */ > + skge_write16(hw, B0_LED, LED_STAT_OFF); > + > + skge_tx_clean(skge); > + skge_rx_clean(skge); > + > + kfree(skge->rx_ring.start); > + kfree(skge->tx_ring.start); > + pci_free_consistent(hw->pdev, skge->mem_size, skge->mem, skge->dma); > + return 0; > +} > + > +static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev) > +{ > + struct skge_port *skge = netdev_priv(dev); > + struct skge_hw *hw = skge->hw; > + struct skge_ring *ring = &skge->tx_ring; > + struct skge_element *e; > + struct skge_tx_desc *td; > + int i; > + u32 control, len; > + u64 map; > + unsigned long flags; > + > + if(unlikely(skb->len <= 0)) { > + dev_kfree_skb_any(skb); > + return NETDEV_TX_OK; > + } why does this check exist? is it ever actually tripped? > + len = skb_headlen(skb); > + skb = skb_padto(skb, ETH_ZLEN); > + if (!skb) > + return NETDEV_TX_OK; > + > + local_irq_save(flags); > + if (!spin_trylock(&skge->tx_lock)) { > + /* Collision - tell upper layer to requeue */ > + local_irq_restore(flags); > + return NETDEV_TX_LOCKED; > + } > + > + if (unlikely(skge->tx_avail < skb_shinfo(skb)->nr_frags +1)) { > + netif_stop_queue(dev); > + spin_unlock_irqrestore(&skge->tx_lock, flags); > + > + printk(KERN_WARNING PFX "%s: ring full when queue awake!\n", > + dev->name); > + return NETDEV_TX_BUSY; > + } > + > + e = ring->to_use; > + td = e->desc; > + e->skb = skb; > + map = pci_map_single(hw->pdev, skb->data, len, PCI_DMA_TODEVICE); check return value > + pci_unmap_addr_set(e, mapaddr, map); > + pci_unmap_len_set(e, maplen, len); > + > + td->dma_lo = map; > + td->dma_hi = map >> 32; > + > + if (skb->ip_summed == CHECKSUM_HW) { > + const struct iphdr *ip > + = (const struct iphdr *) skb->h.raw; > + u32 offset = skb->h.raw - skb->data; > + > + /* > + ** We have to use the opcode for tcp here, because the > + ** opcode for udp is not working in the hardware yet > + ** (Revision 2.0) > + */ > + if (ip->protocol == IPPROTO_UDP && > + chip_rev(hw) == 0 && hw->chip_id == CHIP_ID_YUKON) > + control = BMU_TCP_CHECK; > + else > + control = BMU_UDP_CHECK; > + > + td->csum_startval = 0; > + td->csum_startpos = offset; > + td->csum_writepos = offset + skb->csum; > + } else > + control = BMU_CHECK; > + > + if (!skb_shinfo(skb)->nr_frags) { > + /* single buffer i.e. no fragments */ > + control |= BMU_EOF| BMU_IRQ_EOF; > + } else { > + /* multiple fragments (note always hardware checksum) */ > + struct skge_tx_desc *tf = td; > + > + control |= BMU_STFWD; > + > + for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { > + skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; > + > + map = pci_map_page(hw->pdev, frag->page, frag->page_offset, > + frag->size, PCI_DMA_TODEVICE); > + > + e = e->next; > + e->skb = NULL; > + tf = e->desc; > + tf->dma_lo = map; > + tf->dma_hi = (u64) map >> 32; > + pci_unmap_addr_set(e, mapaddr, map); > + pci_unmap_len_set(e, maplen, frag->size); > + > + tf->control = BMU_OWN | BMU_SW | BMU_STFWD | control | frag->size; > + } > + tf->control |= BMU_EOF | BMU_IRQ_EOF; > + } > + /* Make sure all the chained buffers are ready before > + * updating start of chain. > + */ > + wmb(); > + > + td->control = BMU_OWN | BMU_SW | BMU_STF | control | len; > + wmb(); > + > + skge_write8(skge->hw, Q_ADDR(txq[skge->port], Q_CSR), CSR_START); > + > + if (netif_msg_tx_queued(skge)) > + printk(KERN_DEBUG "%s: tx queued, slot %d, len %d\n", > + dev->name, e - ring->start, skb->len); > + > + ring->to_use = e->next; > + skge->tx_avail -= skb_shinfo(skb)->nr_frags + 1; > + if (skge->tx_avail <= MAX_SKB_FRAGS + 1) { > + pr_debug("%s: transmit queue full\n", dev->name); > + netif_stop_queue(dev); > + } > + > + skge->net_stats.tx_packets++; > + skge->net_stats.tx_bytes += skb->len; > + > + dev->trans_start = jiffies; > + spin_unlock_irqrestore(&skge->tx_lock, flags); > + > + return NETDEV_TX_OK; > +} > + > +static inline void skge_tx_free(struct skge_hw *hw, struct skge_element *e) > +{ > + if (e->skb) { > + pci_unmap_single(hw->pdev, > + pci_unmap_addr(e, mapaddr), > + pci_unmap_len(e, maplen), > + PCI_DMA_TODEVICE); > + dev_kfree_skb_any(e->skb); > + e->skb = NULL; > + } else { > + pci_unmap_page(hw->pdev, > + pci_unmap_addr(e, mapaddr), > + pci_unmap_len(e, maplen), > + PCI_DMA_TODEVICE); > + } > +} > + > +static void skge_tx_clean(struct skge_port *skge) > +{ > + struct skge_ring *ring = &skge->tx_ring; > + struct skge_element *e; > + unsigned long flags; > + > + spin_lock_irqsave(&skge->tx_lock, flags); > + for (e = ring->to_clean; e != ring->to_use; e = e->next) { > + ++skge->tx_avail; > + skge_tx_free(skge->hw, e); > + } > + ring->to_clean = e; > + spin_unlock_irqrestore(&skge->tx_lock, flags); > +} > + > +static void skge_tx_timeout(struct net_device *dev) > +{ > + struct skge_port *skge = netdev_priv(dev); > + > + if (netif_msg_timer(skge)) > + printk(KERN_DEBUG PFX "%s: tx timeout\n", dev->name); > + > + skge_write8(skge->hw, Q_ADDR(txq[skge->port], Q_CSR), CSR_STOP); > + skge_tx_clean(skge); > +} > + > +static int skge_change_mtu(struct net_device *dev, int new_mtu) > +{ > + int err = 0; > + > + if(new_mtu < ETH_ZLEN || new_mtu > ETH_JUMBO_MTU) > + return -EINVAL; > + > + dev->mtu = new_mtu; > + > + if (netif_running(dev)) { > + skge_down(dev); > + skge_up(dev); > + } > + > + return err; > +} > + > +static void genesis_set_multicast(struct net_device *dev) > +{ > + struct skge_port *skge = netdev_priv(dev); > + struct skge_hw *hw = skge->hw; > + int port = skge->port; > + int i, count = dev->mc_count; > + struct dev_mc_list *list = dev->mc_list; > + u32 mode; > + u8 filter[8]; > + > + mode = skge_xm_read32(hw, port, XM_MODE); > + mode |= XM_MD_ENA_HASH; > + if (dev->flags & IFF_PROMISC) > + mode |= XM_MD_ENA_PROM; > + else > + mode &= ~XM_MD_ENA_PROM; > + > + if (dev->flags & IFF_ALLMULTI) > + memset(filter, 0xff, sizeof(filter)); > + else { > + memset(filter, 0, sizeof(filter)); > + for(i = 0; list && i < count; i++, list = list->next) { > + u32 crc = crc32_le(~0, list->dmi_addr, ETH_ALEN); > + u8 bit = 63 - (crc & 63); > + > + filter[bit/8] |= 1 << (bit%8); > + } for some large value of dev->mc_count, you should just use IFF_ALLMULTI behavior. > + skge_xm_outhash(hw, port, XM_HSM, filter); > + > + skge_xm_write32(hw, port, XM_MODE, mode); > +} > + > +static void yukon_set_multicast(struct net_device *dev) > +{ > + struct skge_port *skge = netdev_priv(dev); > + struct skge_hw *hw = skge->hw; > + int port = skge->port; > + struct dev_mc_list *list = dev->mc_list; > + u16 reg; > + u8 filter[8]; > + > + memset(filter, 0, sizeof(filter)); > + > + reg = skge_gma_read16(hw, port, GM_RX_CTRL); > + reg |= GM_RXCR_UCF_ENA; > + > + if (dev->flags & IFF_PROMISC) /* promiscious */ > + reg &= ~(GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA); > + else if (dev->flags & IFF_ALLMULTI) /* all multicast */ > + memset(filter, 0xff, sizeof(filter)); > + else if (dev->mc_count == 0) /* no multicast */ > + reg &= ~GM_RXCR_MCF_ENA; > + else { > + int i; > + reg |= GM_RXCR_MCF_ENA; > + > + for(i = 0; list && i < dev->mc_count; i++, list = list->next) { > + u32 bit = ether_crc(ETH_ALEN, list->dmi_addr) & 0x3f; > + filter[bit/8] |= 1 << (bit%8); > + } > + } ditto > + skge_gma_write16(hw, port, GM_MC_ADDR_H1, > + (u16)filter[0] | ((u16)filter[1] << 8)); > + skge_gma_write16(hw, port, GM_MC_ADDR_H2, > + (u16)filter[2] | ((u16)filter[3] << 8)); > + skge_gma_write16(hw, port, GM_MC_ADDR_H3, > + (u16)filter[4] | ((u16)filter[5] << 8)); > + skge_gma_write16(hw, port, GM_MC_ADDR_H4, > + (u16)filter[6] | ((u16)filter[7] << 8)); > + > + skge_gma_write16(hw, port, GM_RX_CTRL, reg); > +} > + > +static inline int bad_phy_status(const struct skge_hw *hw, u32 status) > +{ > + if (hw->chip_id == CHIP_ID_GENESIS) > + return (status & (XMR_FS_ERR | XMR_FS_2L_VLAN)) != 0; > + else > + return (status & GMR_FS_ANY_ERR) || > + (status & GMR_FS_RX_OK) == 0; > +} > + > +static void skge_rx_error(struct skge_port *skge, int slot, > + u32 control, u32 status) > +{ > + if (netif_msg_rx_err(skge)) > + printk(KERN_DEBUG PFX "%s: rx err, slot %d control 0x%x status 0x%x\n", > + skge->netdev->name, slot, control, status); > + > + if ((control & (BMU_EOF|BMU_STF)) != (BMU_STF|BMU_EOF) > + || (control & BMU_BBC) > skge->netdev->mtu + VLAN_ETH_HLEN) > + skge->net_stats.rx_length_errors++; > + else { > + if (skge->hw->chip_id == CHIP_ID_GENESIS) { > + if (status & (XMR_FS_RUNT|XMR_FS_LNG_ERR)) > + skge->net_stats.rx_length_errors++; > + if (status & XMR_FS_FRA_ERR) > + skge->net_stats.rx_frame_errors++; > + if (status & XMR_FS_FCS_ERR) > + skge->net_stats.rx_crc_errors++; > + } else { > + if (status & (GMR_FS_LONG_ERR|GMR_FS_UN_SIZE)) > + skge->net_stats.rx_length_errors++; > + if (status & GMR_FS_FRAGMENT) > + skge->net_stats.rx_frame_errors++; > + if (status & GMR_FS_CRC_ERR) > + skge->net_stats.rx_crc_errors++; > + } > + } > +} > + > +static int skge_poll(struct net_device *dev, int *budget) > +{ > + struct skge_port *skge = netdev_priv(dev); > + struct skge_hw *hw = skge->hw; > + struct skge_ring *ring = &skge->rx_ring; > + struct skge_element *e; > + unsigned int to_do = min(dev->quota, *budget); > + unsigned int work_done = 0; > + int done; > + static const u32 irqmask[] = { IS_PORT_1, IS_PORT_2 }; > + > + for (e = ring->to_clean; e != ring->to_use && work_done < to_do; > + e = e->next) { > + struct skge_rx_desc *rd = e->desc; > + struct sk_buff *skb = e->skb; > + u32 control, len, status; > + > + rmb(); > + control = rd->control; > + if (control & BMU_OWN) > + break; > + > + len = control & BMU_BBC; > + e->skb = NULL; > + > + pci_unmap_single(hw->pdev, > + pci_unmap_addr(e, mapaddr), > + pci_unmap_len(e, maplen), > + PCI_DMA_FROMDEVICE); > + > + status = rd->status; > + if ((control & (BMU_EOF|BMU_STF)) != (BMU_STF|BMU_EOF) > + || len > dev->mtu + VLAN_ETH_HLEN > + || bad_phy_status(hw, status)) { > + skge_rx_error(skge, e - ring->start, control, status); > + dev_kfree_skb(skb); > + continue; > + } > + > + if (netif_msg_rx_status(skge)) > + printk(KERN_DEBUG PFX "%s: rx slot %d status 0x%x len %d\n", > + dev->name, e - ring->start, rd->status, len); > + > + skb_put(skb, len); > + skb->protocol = eth_type_trans(skb, dev); > + > + if (skge->rx_csum) { > + skb->csum = le16_to_cpu(rd->csum2); > + skb->ip_summed = CHECKSUM_HW; > + } > + > + dev->last_rx = jiffies; > + skge->net_stats.rx_packets++; > + skge->net_stats.rx_bytes += skb->len; > + netif_receive_skb(skb); > + > + ++work_done; > + } > + ring->to_clean = e; > + > + *budget -= work_done; > + dev->quota -= work_done; > + done = work_done < to_do; > + > + if (skge_rx_fill(skge)) > + done = 0; > + > + /* restart receiver */ > + wmb(); > + skge_write8(hw, Q_ADDR(rxq[skge->port], Q_CSR), > + CSR_START | CSR_IRQ_CL_F); > + > + if (done) { > + local_irq_disable(); > + hw->intr_mask |= irqmask[skge->port]; > + /* Order is important since data can get interrupted */ > + skge_write32(hw, B0_IMSK, hw->intr_mask); > + __netif_rx_complete(dev); > + local_irq_enable(); > + } why not local_irq_{save,restore}? > + return !done; > +} > + > +static inline void skge_tx_intr(struct net_device *dev) > +{ > + struct skge_port *skge = netdev_priv(dev); > + struct skge_hw *hw = skge->hw; > + struct skge_ring *ring = &skge->tx_ring; > + struct skge_element *e; > + > + spin_lock(&skge->tx_lock); > + for(e = ring->to_clean; e != ring->to_use; e = e->next) { > + struct skge_tx_desc *td = e->desc; > + u32 control; > + > + rmb(); > + control = td->control; > + if (control & BMU_OWN) > + break; > + > + if (unlikely(netif_msg_tx_done(skge))) > + printk(KERN_DEBUG PFX "%s: tx done slot %d status 0x%x\n", > + dev->name, e - ring->start, td->status); > + > + skge_tx_free(hw, e); > + e->skb = NULL; > + ++skge->tx_avail; > + } > + ring->to_clean = e; > + skge_write8(hw, Q_ADDR(txq[skge->port], Q_CSR), CSR_IRQ_CL_F); > + > + if (skge->tx_avail > MAX_SKB_FRAGS + 1) > + netif_wake_queue(dev); > + > + spin_unlock(&skge->tx_lock); > +} > + > +static void skge_mac_parity(struct skge_hw *hw, int port) > +{ > + if (hw->chip_id == CHIP_ID_GENESIS) > + skge_write16(hw, SKGEMAC_REG(port, TX_MFF_CTRL1), > + MFF_CLR_PERR); > + else > + /* HW-Bug #8: cleared by GMF_CLI_TX_FC instead of GMF_CLI_TX_PE */ > + skge_write8(hw, SKGEMAC_REG(port, TX_GMF_CTRL_T), > + (hw->chip_id == CHIP_ID_YUKON && chip_rev(hw) == 0) > + ? GMF_CLI_TX_FC : GMF_CLI_TX_PE); > +} > + > +static void skge_pci_clear(struct skge_hw *hw) > +{ > + u16 status; > + > + status = skge_read16(hw, SKGEPCI_REG(PCI_STATUS)); > + skge_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); > + skge_write16(hw, SKGEPCI_REG(PCI_STATUS), > + status | PCI_STATUS_ERROR_BITS); > + skge_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF); > +} > + > +/* Handle device specific framing and timeout interrupts */ > +static void skge_error_irq(struct skge_hw *hw) > +{ > + u32 hwstatus = skge_read32(hw, B0_HWE_ISRC); > + > + printk(KERN_ERR PFX "hardware error detected (status 0x%x)\n", > + hwstatus); > + > + skge_pci_clear(hw); > + > + if (hw->chip_id == CHIP_ID_GENESIS) { > + /* clear xmac errors */ > + if (hwstatus & (IS_NO_STAT_M1|IS_NO_TIST_M1)) > + > + skge_write16(hw, SKGEMAC_REG(0, RX_MFF_CTRL1), MFF_CLR_INSTAT); > + if (hwstatus & (IS_NO_STAT_M2|IS_NO_TIST_M2)) > + skge_write16(hw, SKGEMAC_REG(0, RX_MFF_CTRL2), MFF_CLR_INSTAT); > + } else { > + if (hwstatus & IS_IRQ_SENSOR) { > + /* no sensors on 32-bit Yukon */ > + if ((skge_read16(hw, B0_CTST) & CS_BUS_SLOT_SZ) == 32) > + hw->intr_mask &= ~IS_HW_ERR; > + } > + > + } > + > + if (hwstatus & IS_RAM_RD_PAR) > + skge_write16(hw, B3_RI_CTRL, RI_CLR_RD_PERR); > + > + if (hwstatus & IS_RAM_WR_PAR) > + skge_write16(hw, B3_RI_CTRL, RI_CLR_WR_PERR); > + > + if (hwstatus & IS_M1_PAR_ERR) > + skge_mac_parity(hw, 0); > + > + if (hwstatus & IS_M2_PAR_ERR) > + skge_mac_parity(hw, 1); > + > + if (hwstatus & IS_R1_PAR_ERR) > + skge_write32(hw, B0_R1_CSR, CSR_IRQ_CL_P); > + > + if (hwstatus & IS_R2_PAR_ERR) > + skge_write32(hw, B0_R2_CSR, CSR_IRQ_CL_P); > +} > + > +/* > + * Interrrupt from PHY are handled in tasklet (soft irq) > + * because accessing phy registers requires spin wait which might > + * cause excess interrupt latency. > + */ > +static void skge_extirq(unsigned long data) > +{ > + struct skge_hw *hw = (struct skge_hw *) data; > + int port; > + > + spin_lock(&hw->phy_lock); > + for (port = 0; port < 2; port++) { > + struct net_device *dev = hw->dev[port]; > + > + if (dev && netif_running(dev)) { > + struct skge_port *skge = netdev_priv(dev); > + > + if (hw->chip_id != CHIP_ID_GENESIS) > + yukon_phy_intr(skge); > + else if (hw->phy_type == SK_PHY_BCOM) > + genesis_bcom_intr(skge); > + } > + } > + spin_unlock(&hw->phy_lock); > + > + local_irq_disable(); > + hw->intr_mask |= IS_EXT_REG; > + skge_write32(hw, B0_IMSK, hw->intr_mask); > + local_irq_enable(); > +} > + > +static irqreturn_t skge_intr(int irq, void *dev_id, struct pt_regs *regs) > +{ > + struct skge_hw *hw = dev_id; > + u32 status = skge_read32(hw, B0_SP_ISRC); > + > + if (status == 0 || status == ~0) /* hotplug or shared irq */ > + return IRQ_NONE; > + > + status &= hw->intr_mask; > + > + if (status & IS_R1_F) { > + hw->intr_mask &= ~IS_R1_F; > + netif_rx_schedule(hw->dev[0]); > + } > + > + if (status & IS_R2_F) { > + hw->intr_mask &= ~IS_R2_F; > + netif_rx_schedule(hw->dev[1]); > + } > + > + if (status & IS_XA1_F) > + skge_tx_intr(hw->dev[0]); > + > + if (status & IS_XA2_F) > + skge_tx_intr(hw->dev[1]); > + > + if (hw->chip_id == CHIP_ID_GENESIS) { > + if (status & IS_MAC1) > + genesis_mac_intr(hw, 0); > + > + if (status & IS_MAC2) > + genesis_mac_intr(hw, 1); > + } else { > + if (status & IS_MAC1) > + yukon_mac_intr(hw, 0); > + > + if (status & IS_MAC2) > + yukon_mac_intr(hw, 1); > + } > + > + if (status & IS_HW_ERR) > + skge_error_irq(hw); > + > + if (status & IS_EXT_REG) { > + hw->intr_mask &= ~IS_EXT_REG; > + tasklet_schedule(&hw->ext_tasklet); > + } > + skge_write32(hw, B0_IMSK, hw->intr_mask); > + > + return IRQ_HANDLED; > +} > + > +#ifdef CONFIG_NET_POLL_CONTROLLER > +static void skge_netpoll(struct net_device *dev) > +{ > + struct skge_port *skge = netdev_priv(dev); > + > + disable_irq(dev->irq); > + skge_intr(dev->irq, skge->hw, NULL); > + enable_irq(dev->irq); > +} > +#endif > + > +/* TODO: use MIB counters instead?? */ > +static struct net_device_stats *skge_get_stats(struct net_device *dev) > +{ > + struct skge_port *skge = netdev_priv(dev); > + > + return &skge->net_stats; > +} > + > + > +static int skge_set_mac_address(struct net_device *dev, void *p) > +{ > + struct skge_port *skge = netdev_priv(dev); > + struct sockaddr *addr = p; > + int err = 0; > + > + if (!is_valid_ether_addr(addr->sa_data)) > + return -EADDRNOTAVAIL; > + > + skge_down(dev); > + memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); > + memcpy_toio(skge->hw->regs + B2_MAC_1 + skge->port*8, > + dev->dev_addr, ETH_ALEN); > + memcpy_toio(skge->hw->regs + B2_MAC_2 + skge->port*8, > + dev->dev_addr, ETH_ALEN); > + if (dev->flags & IFF_UP) > + err = skge_up(dev); > + return err; > +} > + > +/* > + * Setup the board data structure, but don't bring up > + * the port(s) > + */ > +static __devinit struct skge_hw *skge_hwinit(struct pci_dev *pdev) > +{ > + struct skge_hw *hw; > + u32 sz; > + u16 ctst; > + u8 t8; > + int i, ports; > + char *name = pci_name(pdev); > + > + hw = kmalloc(sizeof(*hw), GFP_KERNEL); > + if (!hw) { > + printk(KERN_ERR "skge %s: cannot allocate hardware struct\n", name); > + goto err_out1; > + } > + > + memset(hw, 0, sizeof(*hw)); > + hw->pdev = pdev; > + spin_lock_init(&hw->phy_lock); > + tasklet_init(&hw->ext_tasklet, skge_extirq, (unsigned long) hw); > + > + hw->regs = ioremap_nocache(pci_resource_start(pdev, 0), 0x4000); > + if (!hw->regs) { > + printk(KERN_ERR "skge %s: cannot map device registers\n", name); > + goto err_out2; > + } > + > + ctst = skge_read16(hw, B0_CTST); > + > + /* do a SW reset */ > + skge_write8(hw, B0_CTST, CS_RST_SET); > + skge_write8(hw, B0_CTST, CS_RST_CLR); > + > + /* clear PCI errors, if any */ > + skge_pci_clear(hw); > + > + skge_write8(hw, B0_CTST, CS_MRST_CLR); > + > + /* restore CLK_RUN bits (for Yukon-Lite) */ > + skge_write16(hw, B0_CTST, > + ctst & (CS_CLK_RUN_HOT|CS_CLK_RUN_RST|CS_CLK_RUN_ENA)); > + > + hw->chip_id = skge_read8(hw, B2_CHIP_ID); > + hw->phy_type = skge_read8(hw, B2_E_1) & 0xf; > + hw->pmd_type = skge_read8(hw, B2_PMD_TYP); > + > + switch(hw->chip_id) { > + case CHIP_ID_GENESIS: > + switch (hw->phy_type) { > + case SK_PHY_XMAC: > + hw->phy_addr = PHY_ADDR_XMAC; > + break; > + case SK_PHY_BCOM: > + hw->phy_addr = PHY_ADDR_BCOM; > + break; > + default: > + printk(KERN_ERR PFX "%s: unsupported phy type 0x%x\n", > + name, hw->phy_type); > + goto err_out3; > + } > + break; > + > + case CHIP_ID_YUKON: > + case CHIP_ID_YUKON_LITE: > + case CHIP_ID_YUKON_LP: > + if (hw->phy_type < SK_PHY_MARV_COPPER && hw->pmd_type != 'S') > + hw->phy_type = SK_PHY_MARV_COPPER; > + > + hw->phy_addr = PHY_ADDR_MARV; > + if (!iscopper(hw)) > + hw->phy_type = SK_PHY_MARV_FIBER; > + > + break; > + > + default: > + printk(KERN_ERR PFX "%s: unsupported chip type 0x%x\n", > + name, hw->chip_id); > + goto err_out3; > + } > + > + hw->mac_cfg = skge_read8(hw, B2_MAC_CFG); > + ports = isdualport(hw) ? 2 : 1; > + > + /* read the adapters RAM size */ > + t8 = skge_read8(hw, B2_E_0); > + if (hw->chip_id == CHIP_ID_GENESIS) { > + if (t8 == 3) { > + /* special case: 4 x 64k x 36, offset = 0x80000 */ > + hw->ram_size = 0x100000; > + hw->ram_offset = 0x80000; > + } else > + hw->ram_size = t8 * 512; > + } > + else if (t8 == 0) > + hw->ram_size = 0x20000; > + else > + hw->ram_size = t8 * 4096; > + > + pci_read_config_dword(hw->pdev, PCI_DEV_REG2, &sz); > + hw->rom_size = 256 << ((sz & PCI_VPD_ROM_SZ) >> 14); > + > + if (hw->chip_id == CHIP_ID_GENESIS) > + genesis_init(hw); > +#if USE_TIST > + else > + skge_write8(hw, GMAC_TI_ST_CTRL, GMT_ST_START); > +#endif > + > + /* > + * looks like it ignores stuck sensor interrupts > + */ > + if (hw->chip_id != CHIP_ID_GENESIS) { > + /* switch power to VCC (WA for VAUX problem) */ > + skge_write8(hw, B0_POWER_CTRL, > + PC_VAUX_ENA | PC_VCC_ENA | PC_VAUX_OFF | PC_VCC_ON); > + if ((skge_read32(hw, B0_ISRC) & IS_HW_ERR) && > + (skge_read32(hw, B0_HWE_ISRC & IS_IRQ_SENSOR))) > + hw->intr_mask &= ~IS_HW_ERR; > + > + for (i = 0; i < ports; i++) { > + skge_write16(hw, SKGEMAC_REG(i, GMAC_LINK_CTRL), GMLC_RST_SET); > + skge_write16(hw, SKGEMAC_REG(i, GMAC_LINK_CTRL), GMLC_RST_CLR); > + } > + } > + > + /* turn off hardware timer (unused) */ > + skge_write8(hw, B2_TI_CTRL, TIM_STOP); > + skge_write8(hw, B2_TI_CTRL, TIM_CLR_IRQ); > + skge_write8(hw, B0_LED, LED_STAT_ON); > + > + /* enable the Tx Arbiters */ > + for (i = 0; i < ports; i++) > + skge_write8(hw, SKGEMAC_REG(i, TXA_CTRL), TXA_ENA_ARB); > + > + /* Initialize ram interface */ > + skge_write16(hw, B3_RI_CTRL, RI_RST_CLR); > + > + skge_write8(hw, B3_RI_WTO_R1, SK_RI_TO_53); > + skge_write8(hw, B3_RI_WTO_XA1, SK_RI_TO_53); > + skge_write8(hw, B3_RI_WTO_XS1, SK_RI_TO_53); > + skge_write8(hw, B3_RI_RTO_R1, SK_RI_TO_53); > + skge_write8(hw, B3_RI_RTO_XA1, SK_RI_TO_53); > + skge_write8(hw, B3_RI_RTO_XS1, SK_RI_TO_53); > + skge_write8(hw, B3_RI_WTO_R2, SK_RI_TO_53); > + skge_write8(hw, B3_RI_WTO_XA2, SK_RI_TO_53); > + skge_write8(hw, B3_RI_WTO_XS2, SK_RI_TO_53); > + skge_write8(hw, B3_RI_RTO_R2, SK_RI_TO_53); > + skge_write8(hw, B3_RI_RTO_XA2, SK_RI_TO_53); > + skge_write8(hw, B3_RI_RTO_XS2, SK_RI_TO_53); > + > + skge_write32(hw, B0_HWE_IMSK, IS_ERR_MSK); > + > + hw->intr_mask = IS_HW_ERR | IS_EXT_REG | IS_PORT_1; > + if (isdualport(hw)) > + hw->intr_mask |= IS_PORT_2; > + skge_write32(hw, B0_IMSK, hw->intr_mask); > + > + if (hw->chip_id != CHIP_ID_GENESIS) > + skge_write8(hw, GMAC_IRQ_MSK, 0); > + > + spin_lock_bh(&hw->phy_lock); > + for (i = 0; i < ports; i++) { > + if (hw->chip_id == CHIP_ID_GENESIS) > + genesis_reset(hw, i); > + else > + yukon_reset(hw, i); > + } > + spin_unlock_bh(&hw->phy_lock); > + > + return hw; > + > + err_out3: > + iounmap(hw->regs); > + err_out2: > + kfree(hw); > + err_out1: > + return NULL; > +} > + > +/* Release board resources */ > +static void skge_hwfree(struct skge_hw *hw) > +{ > + skge_write16(hw, B0_LED, LED_STAT_OFF); > + iounmap(hw->regs); > + kfree(hw); > +} > + > +/* Initialize network device */ > +static struct net_device *skge_devinit(struct skge_hw *hw, int port) > +{ > + struct skge_port *skge; > + struct net_device *dev = alloc_etherdev(sizeof(*skge)); > + int i; > + > + if (!dev) { > + printk(KERN_ERR "skge etherdev alloc failed"); > + return NULL; > + } > + > + SET_MODULE_OWNER(dev); > + SET_NETDEV_DEV(dev, &hw->pdev->dev); > + dev->open = skge_up; > + dev->stop = skge_down; > + dev->hard_start_xmit = skge_xmit_frame; > + dev->get_stats = skge_get_stats; > + if (hw->chip_id == CHIP_ID_GENESIS) > + dev->set_multicast_list = genesis_set_multicast; > + else > + dev->set_multicast_list = yukon_set_multicast; > + > + dev->set_mac_address = skge_set_mac_address; > + dev->change_mtu = skge_change_mtu; > + SET_ETHTOOL_OPS(dev, &skge_ethtool_ops); > + dev->tx_timeout = skge_tx_timeout; > + dev->watchdog_timeo = TX_WATCHDOG; > + dev->poll = skge_poll; > + dev->weight = NAPI_WEIGHT; > +#ifdef CONFIG_NET_POLL_CONTROLLER > + dev->poll_controller = skge_netpoll; > +#endif > + dev->irq = hw->pdev->irq; > + > + dev->features |= NETIF_F_LLTX; > + if (hw->chip_id != CHIP_ID_GENESIS) > + dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; > + > + skge = netdev_priv(dev); > + skge->netdev = dev; > + skge->hw = hw; > + skge->msg_enable = netif_msg_init(debug, default_msg); > + skge->rx_csum = 1; > + skge->tx_ring.count = DEFAULT_TX_RING_SIZE; > + skge->rx_ring.count = DEFAULT_RX_RING_SIZE; > + > + /* Auto speed and flow control */ > + skge->autoneg = AUTONEG_ENABLE; > + skge->flow_control = FLOW_MODE_SYMMETRIC; > + hw->dev[port] = dev; > + > + skge->port = port; > + > + spin_lock_init(&skge->tx_lock); > + > + init_timer(&skge->link_check); > + skge->link_check.function = skge_link_timer; > + skge->link_check.data = (unsigned long) skge; > + > + init_timer(&skge->led_blink); > + skge->led_blink.function = skge_blink_timer; > + skge->led_blink.data = (unsigned long) skge; > + > + /* read the mac address */ > + for (i = 0; i < ETH_ALEN; i++) > + dev->dev_addr[i] = skge_read8(hw, B2_MAC_1 + port*8 + i); > + /* device is off until link detection */ > + netif_carrier_off(dev); > + netif_stop_queue(dev); > + > + return dev; > +} > + > +static const char *skge_board_name(const struct skge_hw *hw) > +{ > + static char buf[16]; > + > + switch(hw->chip_id) { > + case CHIP_ID_GENESIS: > + return "Genesis"; > + case CHIP_ID_YUKON: > + return "Yukon"; > + case CHIP_ID_YUKON_LITE: > + return "Yukon-Lite"; > + case CHIP_ID_YUKON_LP: > + return "Yukon-LP"; > + case CHIP_ID_YUKON_XL: > + return "Yukon-2 XL"; > + case CHIP_ID_YUKON_EC: > + return "YUKON-2 EC"; > + case CHIP_ID_YUKON_FE: > + return "YUKON-2 FE"; more compact and maintainable as a lookup table. From jgarzik@pobox.com Wed Jan 19 16:03:29 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 16:03:34 -0800 (PST) Received: from parcelfarce.linux.theplanet.co.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K03SN5028532 for ; Wed, 19 Jan 2005 16:03:28 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by parcelfarce.linux.theplanet.co.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CrPnE-0001aI-Q6; Thu, 20 Jan 2005 00:03:21 +0000 Message-ID: <41EEF52C.8000905@pobox.com> Date: Wed, 19 Jan 2005 19:02:52 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: Stephen Hemminger , hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, roland@topspin.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [openib-general] Re: LLTX and netif_stop_queue References: <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> <5cac192f0501021530672a908a@mail.gmail.com> <1104764660.1048.578.camel@jzny.localdomain> <52brc68q05.fsf@topspin.com> <5cac192f05010308414a25b548@mail.gmail.com> <527jmu8nbw.fsf@topspin.com> <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119154132.68f0bb4f.davem@davemloft.net> In-Reply-To: <20050119154132.68f0bb4f.davem@davemloft.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 516 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev David S. Miller wrote: > Usually we strive for BH disabling locks in order to decrease the > amount of hard IRQ disabling time in the kernel. But here, as soon > as we call into ->hard_start_xmit(), the driver typically turns hard > IRQs off anyways. [...] > Also, changing dev->xmit_lock to be IRQ disabling is not %100 trivial. Agreed on both counts... From nish.aravamudan@gmail.com Wed Jan 19 16:41:33 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 16:41:40 -0800 (PST) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.199]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K0fW4o001854 for ; Wed, 19 Jan 2005 16:41:33 -0800 Received: by rproxy.gmail.com with SMTP id c16so23297rne for ; Wed, 19 Jan 2005 16:41:32 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=m6pzO37QffEclp6GkFf7+wl4pKOjFQjxvtX3sLyS0lWKYMlg4S7pnGmBjiS2EJGn6+441l7ZI2t9mjajiLwb5eZYPnnwCnrqjliDkuyqt7YcAGiuLesTIOuZadNPSny8f8uiRHeUgg/KsKktSZ6YMYHOHnP5ZvHVoplxzL3cjIM= Received: by 10.38.67.53 with SMTP id p53mr125266rna; Wed, 19 Jan 2005 16:41:32 -0800 (PST) Received: by 10.38.72.12 with HTTP; Wed, 19 Jan 2005 16:41:32 -0800 (PST) Message-ID: <29495f1d05011916414a82da64@mail.gmail.com> Date: Wed, 19 Jan 2005 16:41:32 -0800 From: Nish Aravamudan Reply-To: Nish Aravamudan To: Jeff Garzik Subject: Re: [RFT] skge: new syskonnect gigabit ethernet driver Cc: Stephen Hemminger , netdev@oss.sgi.com, linux-kernel@vger.kernel.org In-Reply-To: <41EEF49F.5090504@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <20050119135217.38fe5f05@dxpl.pdx.osdl.net> <41EEF49F.5090504@pobox.com> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 517 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nish.aravamudan@gmail.com Precedence: bulk X-list: netdev On Wed, 19 Jan 2005 19:00:31 -0500, Jeff Garzik wrote: > Stephen Hemminger wrote: > > This is the second public release of my new rewrite of the SysKonnect Gigabit > > Ethernet driver. This 0.3 version fixes bugs with link up/down and ethtool > > phys_id support. It adds ethtool support for interrupt coalescing and pause > > parameters. Performance is good, I am able to get 941 Mbit/sec receiving > > (TCP using iperf). But obviously, the driver is still experimental. > > > > This driver doesn't support Yukon2 (yet), and there is report of problem > > with D-Link card (Yukon-EC). > > > > The patch should work on 2.6.8 or later, I am testing with 2.6.11-rc1. > > Also available as download from http://developer.osdl.org/shemminge/skge > > +static int skge_phys_id(struct net_device *dev, u32 data) > > +{ > > + struct skge_port *skge = netdev_priv(dev); > > + > > + if(!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ)) > > + data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ); > > + > > + /* start blinking */ > > + skge->blink_on = 1; > > + mod_timer(&skge->led_blink, jiffies); > > + > > + set_current_state(TASK_INTERRUPTIBLE); > > + schedule_timeout(data * HZ); > > + del_timer_sync(&skge->led_blink); Please consider using msleep_interruptible(data * 1000) here. The same substitution has worked in other drivers that have used the exact same code. Thanks, Nish From shemminger@osdl.org Wed Jan 19 16:46:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 16:46:59 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K0krIg002484 for ; Wed, 19 Jan 2005 16:46:54 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0K0kAl16011; Wed, 19 Jan 2005 16:46:10 -0800 Date: Wed, 19 Jan 2005 16:46:14 -0800 From: Stephen Hemminger To: Jeff Garzik Cc: "David S. Miller" , hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, roland@topspin.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [openib-general] Re: LLTX and netif_stop_queue Message-ID: <20050119164614.6f74daf3@dxpl.pdx.osdl.net> In-Reply-To: <41EEF52C.8000905@pobox.com> References: <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> <5cac192f0501021530672a908a@mail.gmail.com> <1104764660.1048.578.camel@jzny.localdomain> <52brc68q05.fsf@topspin.com> <5cac192f05010308414a25b548@mail.gmail.com> <527jmu8nbw.fsf@topspin.com> <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119154132.68f0bb4f.davem@davemloft.net> <41EEF52C.8000905@pobox.com> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 518 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev On Wed, 19 Jan 2005 19:02:52 -0500 Jeff Garzik wrote: > David S. Miller wrote: > > Usually we strive for BH disabling locks in order to decrease the > > amount of hard IRQ disabling time in the kernel. But here, as soon > > as we call into ->hard_start_xmit(), the driver typically turns hard > > IRQs off anyways. > [...] > > Also, changing dev->xmit_lock to be IRQ disabling is not %100 trivial. > > > Agreed on both counts... But in the end it would be safer than the current LLTX usage in drivers which seems like it opening up problems. -- Stephen Hemminger From davem@davemloft.net Wed Jan 19 16:48:45 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 16:48:53 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K0mieV003017 for ; Wed, 19 Jan 2005 16:48:44 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CrQTB-0007dU-00; Wed, 19 Jan 2005 16:46:41 -0800 Date: Wed, 19 Jan 2005 16:46:40 -0800 From: "David S. Miller" To: Stephen Hemminger Cc: hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, roland@topspin.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: [PATCH]: was Re: LLTX and netif_stop_queue Message-Id: <20050119164640.6c67bdfa.davem@davemloft.net> In-Reply-To: <20050119151853.259de49a@dxpl.pdx.osdl.net> References: <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> <5cac192f0501021530672a908a@mail.gmail.com> <1104764660.1048.578.camel@jzny.localdomain> <52brc68q05.fsf@topspin.com> <5cac192f05010308414a25b548@mail.gmail.com> <527jmu8nbw.fsf@topspin.com> <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 519 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Ok, here is what something like this might look like. In summary: 1) dev->xmit_lock is now IRQ disabling instead of BH disabling 2) Drivers can use dev->xmit_lock in place of their private driver_priv->tx_lock and this is effectively the same gain LLTX gave drivers sans the race condition which started this thread. 3) NETDEV_TX_LOCKED is gone 4) LLTX stays, but this means that the driver's TX routine is %100 lockless. It is only to be used by loopback and other queueless software devices such as tunnels. BTW, one next step would be to implement things as Alexey prescribes in net/core/dev.c, that is to make all software devices %100 lockless and use LLTX. Then all the locking code under his comment in dev_queue_xmit() for the queueless device case can be deleted. We can assert the LLTX flag being set in that code path in order to catch unconverted software devices. Also, this new semantic of LLTX means that it should never be seen set in qdisc_restart() any longer. So we could remove all of that LLTX complexity from that code and assert on it not being set. That would be quite a welcome cleanup. Comments? ===== Documentation/networking/netdevices.txt 1.5 vs edited ===== --- 1.5/Documentation/networking/netdevices.txt 2004-09-12 16:55:06 -07:00 +++ edited/Documentation/networking/netdevices.txt 2005-01-19 16:09:50 -08:00 @@ -45,10 +45,9 @@ Synchronization: dev->xmit_lock spinlock. When the driver sets NETIF_F_LLTX in dev->features this will be called without holding xmit_lock. In this case the driver - has to lock by itself when needed. It is recommended to use a try lock - for this and return -1 when the spin lock fails. - The locking there should also properly protect against - set_multicast_list + has to execute it's transmission routine in a completely lockless + manner. It is recommended only for queueless devices such + loopback and tunnels. Context: BHs disabled Notes: netif_queue_stopped() is guaranteed false Return codes: @@ -56,8 +55,6 @@ o NETDEV_TX_BUSY Cannot transmit packet, try later Usually a bug, means queue start/stop flow control is broken in the driver. Note: the driver must NOT put the skb in its DMA ring. - o NETDEV_TX_LOCKED Locking failed, please retry quickly. - Only valid when NETIF_F_LLTX is set. dev->tx_timeout: Synchronization: dev->xmit_lock spinlock. ===== drivers/infiniband/ulp/ipoib/ipoib.h 1.3 vs edited ===== --- 1.3/drivers/infiniband/ulp/ipoib/ipoib.h 2005-01-15 14:01:50 -08:00 +++ edited/drivers/infiniband/ulp/ipoib/ipoib.h 2005-01-19 15:50:47 -08:00 @@ -104,10 +104,10 @@ }; /* - * Device private locking: tx_lock protects members used in TX fast - * path (and we use LLTX so upper layers don't do extra locking). - * lock protects everything else. lock nests inside of tx_lock (ie - * tx_lock must be acquired first if needed). + * Device private locking: netdev->xmit_lock protects members used + * in TX fast path. + * lock protects everything else. lock nests inside of xmit_lock (ie + * xmit_lock must be acquired first if needed). */ struct ipoib_dev_priv { spinlock_t lock; @@ -150,7 +150,6 @@ struct ipoib_buf *rx_ring; - spinlock_t tx_lock; struct ipoib_buf *tx_ring; unsigned tx_head; unsigned tx_tail; ===== drivers/infiniband/ulp/ipoib/ipoib_ib.c 1.4 vs edited ===== --- 1.4/drivers/infiniband/ulp/ipoib/ipoib_ib.c 2005-01-15 14:01:50 -08:00 +++ edited/drivers/infiniband/ulp/ipoib/ipoib_ib.c 2005-01-19 15:51:36 -08:00 @@ -247,12 +247,12 @@ dev_kfree_skb_any(tx_req->skb); - spin_lock_irqsave(&priv->tx_lock, flags); + spin_lock_irqsave(&dev->xmit_lock, flags); ++priv->tx_tail; if (netif_queue_stopped(dev) && priv->tx_head - priv->tx_tail <= IPOIB_TX_RING_SIZE / 2) netif_wake_queue(dev); - spin_unlock_irqrestore(&priv->tx_lock, flags); + spin_unlock_irqrestore(&dev->xmit_lock, flags); if (wc->status != IB_WC_SUCCESS && wc->status != IB_WC_WR_FLUSH_ERR) ===== drivers/infiniband/ulp/ipoib/ipoib_main.c 1.3 vs edited ===== --- 1.3/drivers/infiniband/ulp/ipoib/ipoib_main.c 2005-01-15 14:01:48 -08:00 +++ edited/drivers/infiniband/ulp/ipoib/ipoib_main.c 2005-01-19 15:53:27 -08:00 @@ -411,7 +411,7 @@ /* * We can only be called from ipoib_start_xmit, so we're - * inside tx_lock -- no need to save/restore flags. + * inside dev->xmit_lock -- no need to save/restore flags. */ spin_lock(&priv->lock); @@ -483,7 +483,7 @@ /* * We can only be called from ipoib_start_xmit, so we're - * inside tx_lock -- no need to save/restore flags. + * inside dev->xmit_lock -- no need to save/restore flags. */ spin_lock(&priv->lock); @@ -526,27 +526,11 @@ spin_unlock(&priv->lock); } +/* Called with dev->xmit_lock held and IRQs disabled. */ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct ipoib_dev_priv *priv = netdev_priv(dev); struct ipoib_neigh *neigh; - unsigned long flags; - - local_irq_save(flags); - if (!spin_trylock(&priv->tx_lock)) { - local_irq_restore(flags); - return NETDEV_TX_LOCKED; - } - - /* - * Check if our queue is stopped. Since we have the LLTX bit - * set, we can't rely on netif_stop_queue() preventing our - * xmit function from being called with a full queue. - */ - if (unlikely(netif_queue_stopped(dev))) { - spin_unlock_irqrestore(&priv->tx_lock, flags); - return NETDEV_TX_BUSY; - } if (skb->dst && skb->dst->neighbour) { if (unlikely(!*to_ipoib_neigh(skb->dst->neighbour))) { @@ -601,7 +585,6 @@ } out: - spin_unlock_irqrestore(&priv->tx_lock, flags); return NETDEV_TX_OK; } @@ -797,7 +780,7 @@ dev->addr_len = INFINIBAND_ALEN; dev->type = ARPHRD_INFINIBAND; dev->tx_queue_len = IPOIB_TX_RING_SIZE * 2; - dev->features = NETIF_F_VLAN_CHALLENGED | NETIF_F_LLTX; + dev->features = NETIF_F_VLAN_CHALLENGED; /* MTU will be reset when mcast join happens */ dev->mtu = IPOIB_PACKET_SIZE - IPOIB_ENCAP_LEN; @@ -812,7 +795,6 @@ priv->dev = dev; spin_lock_init(&priv->lock); - spin_lock_init(&priv->tx_lock); init_MUTEX(&priv->mcast_mutex); init_MUTEX(&priv->vlan_mutex); ===== drivers/net/sungem.c 1.72 vs edited ===== --- 1.72/drivers/net/sungem.c 2004-11-05 15:56:15 -08:00 +++ edited/drivers/net/sungem.c 2005-01-19 15:58:26 -08:00 @@ -835,9 +835,9 @@ } /* Run TX completion thread */ - spin_lock(&gp->tx_lock); + spin_lock(&dev->xmit_lock); gem_tx(dev, gp, gp->status); - spin_unlock(&gp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irqrestore(&gp->lock, flags); @@ -932,12 +932,12 @@ readl(gp->regs + MAC_RXCFG)); spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&dev->xmit_lock); gp->reset_task_pending = 2; schedule_work(&gp->reset_task); - spin_unlock(&gp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&gp->lock); } @@ -955,7 +955,6 @@ struct gem *gp = dev->priv; int entry; u64 ctrl; - unsigned long flags; ctrl = 0; if (skb->ip_summed == CHECKSUM_HW) { @@ -969,17 +968,9 @@ (csum_stuff_off << 21)); } - local_irq_save(flags); - if (!spin_trylock(&gp->tx_lock)) { - /* Tell upper layer to requeue */ - local_irq_restore(flags); - return NETDEV_TX_LOCKED; - } - /* This is a hard error, log it. */ if (TX_BUFFS_AVAIL(gp) <= (skb_shinfo(skb)->nr_frags + 1)) { netif_stop_queue(dev); - spin_unlock_irqrestore(&gp->tx_lock, flags); printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n", dev->name); return NETDEV_TX_BUSY; @@ -1066,7 +1057,6 @@ dev->name, entry, skb->len); mb(); writel(gp->tx_new, gp->regs + TXDMA_KICK); - spin_unlock_irqrestore(&gp->tx_lock, flags); dev->trans_start = jiffies; @@ -1097,11 +1087,11 @@ } spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&dev->xmit_lock); dev->mtu = new_mtu; gp->reset_task_pending = 1; schedule_work(&gp->reset_task); - spin_unlock(&gp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&gp->lock); flush_scheduled_work(); @@ -1111,7 +1101,7 @@ #define STOP_TRIES 32 -/* Must be invoked under gp->lock and gp->tx_lock. */ +/* Must be invoked under gp->lock and dev->xmit_lock. */ static void gem_stop(struct gem *gp) { int limit; @@ -1137,7 +1127,7 @@ printk(KERN_ERR "%s: SW reset is ghetto.\n", gp->dev->name); } -/* Must be invoked under gp->lock and gp->tx_lock. */ +/* Must be invoked under gp->lock and dev->xmit_lock. */ static void gem_start_dma(struct gem *gp) { unsigned long val; @@ -1162,7 +1152,7 @@ } -/* Must be invoked under gp->lock and gp->tx_lock. */ +/* Must be invoked under gp->lock and dev->xmit_lock. */ // XXX dbl check what that function should do when called on PCS PHY static void gem_begin_auto_negotiation(struct gem *gp, struct ethtool_cmd *ep) { @@ -1249,7 +1239,7 @@ /* A link-up condition has occurred, initialize and enable the * rest of the chip. * - * Must be invoked under gp->lock and gp->tx_lock. + * Must be invoked under gp->lock and dev->xmit_lock. */ static int gem_set_link_modes(struct gem *gp) { @@ -1356,7 +1346,7 @@ return 0; } -/* Must be invoked under gp->lock and gp->tx_lock. */ +/* Must be invoked under gp->lock and dev->xmit_lock. */ static int gem_mdio_link_not_up(struct gem *gp) { switch (gp->lstate) { @@ -1414,7 +1404,7 @@ netif_poll_disable(gp->dev); spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&gp->dev->xmit_lock); if (gp->hw_running && gp->opened) { netif_stop_queue(gp->dev); @@ -1430,7 +1420,7 @@ } gp->reset_task_pending = 0; - spin_unlock(&gp->tx_lock); + spin_unlock(&gp->dev->xmit_lock); spin_unlock_irq(&gp->lock); netif_poll_enable(gp->dev); } @@ -1444,7 +1434,7 @@ return; spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&gp->dev->xmit_lock); /* If the link of task is still pending, we just * reschedule the link timer @@ -1514,11 +1504,11 @@ restart: mod_timer(&gp->link_timer, jiffies + ((12 * HZ) / 10)); out_unlock: - spin_unlock(&gp->tx_lock); + spin_unlock(&gp->dev->xmit_lock); spin_unlock_irq(&gp->lock); } -/* Must be invoked under gp->lock and gp->tx_lock. */ +/* Must be invoked under gp->lock and dev->xmit_lock. */ static void gem_clean_rings(struct gem *gp) { struct gem_init_block *gb = gp->init_block; @@ -1569,7 +1559,7 @@ } } -/* Must be invoked under gp->lock and gp->tx_lock. */ +/* Must be invoked under gp->lock and dev->xmit_lock. */ static void gem_init_rings(struct gem *gp) { struct gem_init_block *gb = gp->init_block; @@ -1619,7 +1609,7 @@ wmb(); } -/* Must be invoked under gp->lock and gp->tx_lock. */ +/* Must be invoked under gp->lock and dev->xmit_lock. */ static void gem_init_phy(struct gem *gp) { u32 mifcfg; @@ -1757,7 +1747,7 @@ } } -/* Must be invoked under gp->lock and gp->tx_lock. */ +/* Must be invoked under gp->lock and dev->xmit_lock. */ static void gem_init_dma(struct gem *gp) { u64 desc_dma = (u64) gp->gblock_dvma; @@ -1795,7 +1785,7 @@ gp->regs + RXDMA_BLANK); } -/* Must be invoked under gp->lock and gp->tx_lock. */ +/* Must be invoked under gp->lock and dev->xmit_lock. */ static u32 gem_setup_multicast(struct gem *gp) { @@ -1838,7 +1828,7 @@ return rxcfg; } -/* Must be invoked under gp->lock and gp->tx_lock. */ +/* Must be invoked under gp->lock and dev->xmit_lock. */ static void gem_init_mac(struct gem *gp) { unsigned char *e = &gp->dev->dev_addr[0]; @@ -1916,7 +1906,7 @@ writel(0xffffffff, gp->regs + MAC_MCMASK); } -/* Must be invoked under gp->lock and gp->tx_lock. */ +/* Must be invoked under gp->lock and dev->xmit_lock. */ static void gem_init_pause_thresholds(struct gem *gp) { u32 cfg; @@ -2052,7 +2042,7 @@ return 0; } -/* Must be invoked under gp->lock and gp->tx_lock. */ +/* Must be invoked under gp->lock and dev->xmit_lock. */ static void gem_init_hw(struct gem *gp, int restart_link) { /* On Apple's gmac, I initialize the PHY only after @@ -2150,11 +2140,11 @@ if (!gp->wake_on_lan) { spin_lock_irqsave(&gp->lock, flags); - spin_lock(&gp->tx_lock); + spin_lock(&gp->dev->xmit_lock); gem_stop(gp); writel(MAC_TXRST_CMD, gp->regs + MAC_TXRST); writel(MAC_RXRST_CMD, gp->regs + MAC_RXRST); - spin_unlock(&gp->tx_lock); + spin_unlock(&gp->dev->xmit_lock); spin_unlock_irqrestore(&gp->lock, flags); } @@ -2202,9 +2192,9 @@ unsigned long flags; spin_lock_irqsave(&gp->lock, flags); - spin_lock(&gp->tx_lock); + spin_lock(&gp->dev->xmit_lock); gem_stop(gp); - spin_unlock(&gp->tx_lock); + spin_unlock(&gp->dev->xmit_lock); spin_unlock_irqrestore(&gp->lock, flags); } } @@ -2265,9 +2255,9 @@ /* Reset the chip */ spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&gp->dev->xmit_lock); gem_stop(gp); - spin_unlock(&gp->tx_lock); + spin_unlock(&gp->dev->xmit_lock); spin_unlock_irq(&gp->lock); gp->hw_running = 1; @@ -2281,7 +2271,7 @@ printk(KERN_ERR "%s: failed to request irq !\n", gp->dev->name); spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&gp->dev->xmit_lock); #ifdef CONFIG_PPC_PMAC if (!hw_was_up && gp->pdev->vendor == PCI_VENDOR_ID_APPLE) gem_apple_powerdown(gp); @@ -2290,14 +2280,14 @@ gp->pm_timer.expires = jiffies + 10*HZ; add_timer(&gp->pm_timer); up(&gp->pm_sem); - spin_unlock(&gp->tx_lock); + spin_unlock(&gp->dev->xmit_lock); spin_unlock_irq(&gp->lock); return -EAGAIN; } spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&gp->dev->xmit_lock); /* Allocate & setup ring buffers */ gem_init_rings(gp); @@ -2307,7 +2297,7 @@ gp->opened = 1; - spin_unlock(&gp->tx_lock); + spin_unlock(&gp->dev->xmit_lock); spin_unlock_irq(&gp->lock); up(&gp->pm_sem); @@ -2328,7 +2318,7 @@ /* Stop traffic, mark us closed */ spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&gp->dev->xmit_lock); gp->opened = 0; @@ -2343,7 +2333,7 @@ /* Bye, the pm timer will finish the job */ free_irq(gp->pdev->irq, (void *) dev); - spin_unlock(&gp->tx_lock); + spin_unlock(&gp->dev->xmit_lock); spin_unlock_irq(&gp->lock); /* Fire the PM timer that will shut us down in about 10 seconds */ @@ -2374,7 +2364,7 @@ /* If the driver is opened, we stop the DMA */ if (gp->opened) { spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&gp->dev->xmit_lock); /* Stop traffic, mark us closed */ netif_device_detach(dev); @@ -2385,7 +2375,7 @@ /* Get rid of ring buffers */ gem_clean_rings(gp); - spin_unlock(&gp->tx_lock); + spin_unlock(&gp->dev->xmit_lock); spin_unlock_irq(&gp->lock); if (gp->pdev->vendor == PCI_VENDOR_ID_APPLE) @@ -2419,14 +2409,14 @@ } #endif /* CONFIG_PPC_PMAC */ spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&gp->dev->xmit_lock); gem_stop(gp); gp->hw_running = 1; gem_init_rings(gp); gem_init_hw(gp, 1); - spin_unlock(&gp->tx_lock); + spin_unlock(&gp->dev->xmit_lock); spin_unlock_irq(&gp->lock); netif_device_attach(dev); @@ -2447,7 +2437,7 @@ struct net_device_stats *stats = &gp->net_stats; spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&dev->xmit_lock); if (gp->hw_running) { stats->rx_crc_errors += readl(gp->regs + MAC_FCSERR); @@ -2467,7 +2457,7 @@ writel(0, gp->regs + MAC_LCOLL); } - spin_unlock(&gp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&gp->lock); return &gp->net_stats; @@ -2483,7 +2473,7 @@ return; spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&dev->xmit_lock); netif_stop_queue(dev); @@ -2508,7 +2498,7 @@ netif_wake_queue(dev); - spin_unlock(&gp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&gp->lock); } @@ -2540,7 +2530,7 @@ /* Return current PHY settings */ spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&dev->xmit_lock); cmd->autoneg = gp->want_autoneg; cmd->speed = gp->phy_mii.speed; cmd->duplex = gp->phy_mii.duplex; @@ -2552,7 +2542,7 @@ */ if (cmd->advertising == 0) cmd->advertising = cmd->supported; - spin_unlock(&gp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&gp->lock); } else { // XXX PCS ? cmd->supported = @@ -2592,9 +2582,9 @@ /* Apply settings and restart link process. */ spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&dev->xmit_lock); gem_begin_auto_negotiation(gp, cmd); - spin_unlock(&gp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&gp->lock); return 0; @@ -2609,9 +2599,9 @@ /* Restart link process. */ spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&dev->xmit_lock); gem_begin_auto_negotiation(gp, NULL); - spin_unlock(&gp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&gp->lock); return 0; @@ -2863,7 +2853,6 @@ gp->msg_enable = DEFAULT_MSG; spin_lock_init(&gp->lock); - spin_lock_init(&gp->tx_lock); init_MUTEX(&gp->pm_sem); init_timer(&gp->link_timer); @@ -2899,9 +2888,9 @@ gem_apple_powerup(gp); #endif spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&dev->xmit_lock); gem_stop(gp); - spin_unlock(&gp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&gp->lock); /* Fill up the mii_phy structure (even if we won't use it) */ @@ -2967,11 +2956,11 @@ /* Detect & init PHY, start autoneg */ spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&dev->xmit_lock); gp->hw_running = 1; gem_init_phy(gp); gem_begin_auto_negotiation(gp, NULL); - spin_unlock(&gp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&gp->lock); if (gp->phy_type == phy_mii_mdio0 || @@ -2982,7 +2971,7 @@ pci_set_drvdata(pdev, dev); /* GEM can do it all... */ - dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_LLTX; + dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM; if (pci_using_dac) dev->features |= NETIF_F_HIGHDMA; ===== drivers/net/sungem.h 1.18 vs edited ===== --- 1.18/drivers/net/sungem.h 2004-09-15 08:16:05 -07:00 +++ edited/drivers/net/sungem.h 2005-01-19 15:54:08 -08:00 @@ -953,7 +953,6 @@ struct gem { spinlock_t lock; - spinlock_t tx_lock; void __iomem *regs; int rx_new, rx_old; int tx_new, tx_old; ===== drivers/net/tg3.c 1.227 vs edited ===== --- 1.227/drivers/net/tg3.c 2005-01-17 13:40:31 -08:00 +++ edited/drivers/net/tg3.c 2005-01-19 15:43:48 -08:00 @@ -2816,9 +2816,9 @@ /* run TX completion thread */ if (sblk->idx[0].tx_consumer != tp->tx_cons) { - spin_lock(&tp->tx_lock); + spin_lock(&netdev->xmit_lock); tg3_tx(tp); - spin_unlock(&tp->tx_lock); + spin_unlock(&netdev->xmit_lock); } spin_unlock_irqrestore(&tp->lock, flags); @@ -2939,7 +2939,7 @@ tg3_netif_stop(tp); spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&tp->dev->xmit_lock); restart_timer = tp->tg3_flags2 & TG3_FLG2_RESTART_TIMER; tp->tg3_flags2 &= ~TG3_FLG2_RESTART_TIMER; @@ -2949,7 +2949,7 @@ tg3_netif_start(tp); - spin_unlock(&tp->tx_lock); + spin_unlock(&tp->dev->xmit_lock); spin_unlock_irq(&tp->lock); if (restart_timer) @@ -3048,6 +3048,7 @@ (base + len + 8 < base)); } +/* dev->xmit_lock is held and IRQs are disabled. */ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct tg3 *tp = netdev_priv(dev); @@ -3055,39 +3056,12 @@ unsigned int i; u32 len, entry, base_flags, mss; int would_hit_hwbug; - unsigned long flags; len = skb_headlen(skb); - /* No BH disabling for tx_lock here. We are running in BH disabled - * context and TX reclaim runs via tp->poll inside of a software - * interrupt. Rejoice! - * - * Actually, things are not so simple. If we are to take a hw - * IRQ here, we can deadlock, consider: - * - * CPU1 CPU2 - * tg3_start_xmit - * take tp->tx_lock - * tg3_timer - * take tp->lock - * tg3_interrupt - * spin on tp->lock - * spin on tp->tx_lock - * - * So we really do need to disable interrupts when taking - * tx_lock here. - */ - local_irq_save(flags); - if (!spin_trylock(&tp->tx_lock)) { - local_irq_restore(flags); - return NETDEV_TX_LOCKED; - } - /* This is a hard error, log it. */ if (unlikely(TX_BUFFS_AVAIL(tp) <= (skb_shinfo(skb)->nr_frags + 1))) { netif_stop_queue(dev); - spin_unlock_irqrestore(&tp->tx_lock, flags); printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n", dev->name); return NETDEV_TX_BUSY; @@ -3224,7 +3198,7 @@ entry, len, last_plus_one, &start, mss)) - goto out_unlock; + goto out; entry = start; } @@ -3236,9 +3210,8 @@ if (TX_BUFFS_AVAIL(tp) <= (MAX_SKB_FRAGS + 1)) netif_stop_queue(dev); -out_unlock: +out: mmiowb(); - spin_unlock_irqrestore(&tp->tx_lock, flags); dev->trans_start = jiffies; @@ -3273,7 +3246,7 @@ tg3_netif_stop(tp); spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); tg3_halt(tp); @@ -3283,7 +3256,7 @@ tg3_netif_start(tp); - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); return 0; @@ -5574,7 +5547,7 @@ unsigned long flags; spin_lock_irqsave(&tp->lock, flags); - spin_lock(&tp->tx_lock); + spin_lock(&tp->dev->xmit_lock); /* All of this garbage is because when using non-tagged * IRQ status the mailbox/status_block protocol the chip @@ -5590,7 +5563,7 @@ if (!(tr32(WDMAC_MODE) & WDMAC_MODE_ENABLE)) { tp->tg3_flags2 |= TG3_FLG2_RESTART_TIMER; - spin_unlock(&tp->tx_lock); + spin_unlock(&tp->dev->xmit_lock); spin_unlock_irqrestore(&tp->lock, flags); schedule_work(&tp->reset_task); return; @@ -5659,7 +5632,7 @@ tp->asf_counter = tp->asf_multiplier; } - spin_unlock(&tp->tx_lock); + spin_unlock(&tp->dev->xmit_lock); spin_unlock_irqrestore(&tp->lock, flags); tp->timer.expires = jiffies + tp->timer_offset; @@ -5672,12 +5645,12 @@ int err; spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); tg3_disable_ints(tp); tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE; - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); /* The placement of this call is tied @@ -5696,7 +5669,7 @@ } spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); err = tg3_init_hw(tp); if (err) { @@ -5716,7 +5689,7 @@ tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE; } - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); if (err) { @@ -5726,11 +5699,11 @@ } spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); tg3_enable_ints(tp); - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); netif_start_queue(dev); @@ -5978,7 +5951,7 @@ del_timer_sync(&tp->timer); spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); #if 0 tg3_dump_state(tp); #endif @@ -5992,7 +5965,7 @@ TG3_FLAG_GOT_SERDES_FLOWCTL); netif_carrier_off(tp->dev); - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); free_irq(dev->irq, dev); @@ -6296,9 +6269,9 @@ struct tg3 *tp = netdev_priv(dev); spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); __tg3_set_rx_mode(dev); - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); } @@ -6322,7 +6295,7 @@ memset(p, 0, TG3_REGDUMP_LEN); spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); #define __GET_REG32(reg) (*(p)++ = tr32(reg)) #define GET_REG32_LOOP(base,len) \ @@ -6372,7 +6345,7 @@ #undef GET_REG32_LOOP #undef GET_REG32_1 - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); } @@ -6496,7 +6469,7 @@ } spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); tp->link_config.autoneg = cmd->autoneg; if (cmd->autoneg == AUTONEG_ENABLE) { @@ -6510,7 +6483,7 @@ } tg3_setup_phy(tp, 1); - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); return 0; @@ -6627,7 +6600,7 @@ tg3_netif_stop(tp); spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); tp->rx_pending = ering->rx_pending; @@ -6640,7 +6613,7 @@ tg3_halt(tp); tg3_init_hw(tp); tg3_netif_start(tp); - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); return 0; @@ -6661,7 +6634,7 @@ tg3_netif_stop(tp); spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); if (epause->autoneg) tp->tg3_flags |= TG3_FLAG_PAUSE_AUTONEG; else @@ -6677,7 +6650,7 @@ tg3_halt(tp); tg3_init_hw(tp); tg3_netif_start(tp); - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); return 0; @@ -6803,14 +6776,14 @@ struct tg3 *tp = netdev_priv(dev); spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); tp->vlgrp = grp; /* Update RX_MODE_KEEP_VLAN_TAG bit in RX_MODE register. */ __tg3_set_rx_mode(dev); - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); } @@ -6819,10 +6792,10 @@ struct tg3 *tp = netdev_priv(dev); spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); if (tp->vlgrp) tp->vlgrp->vlan_devices[vid] = NULL; - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); } #endif @@ -8241,7 +8214,6 @@ if (pci_using_dac) dev->features |= NETIF_F_HIGHDMA; - dev->features |= NETIF_F_LLTX; #if TG3_VLAN_TAG_USED dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; dev->vlan_rx_register = tg3_vlan_rx_register; @@ -8283,7 +8255,6 @@ tp->grc_mode |= GRC_MODE_BSWAP_NONFRM_DATA; #endif spin_lock_init(&tp->lock); - spin_lock_init(&tp->tx_lock); spin_lock_init(&tp->indirect_lock); INIT_WORK(&tp->reset_task, tg3_reset_task, tp); @@ -8496,23 +8467,23 @@ del_timer_sync(&tp->timer); spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); tg3_disable_ints(tp); - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); netif_device_detach(dev); spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); tg3_halt(tp); - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); err = tg3_set_power_state(tp, state); if (err) { spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); tg3_init_hw(tp); @@ -8522,7 +8493,7 @@ netif_device_attach(dev); tg3_netif_start(tp); - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); } @@ -8547,7 +8518,7 @@ netif_device_attach(dev); spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); tg3_init_hw(tp); @@ -8558,7 +8529,7 @@ tg3_netif_start(tp); - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); return 0; ===== drivers/net/tg3.h 1.52 vs edited ===== --- 1.52/drivers/net/tg3.h 2004-11-15 15:41:31 -08:00 +++ edited/drivers/net/tg3.h 2005-01-19 15:37:29 -08:00 @@ -1980,12 +1980,11 @@ * lock: Held during all operations except TX packet * processing. * - * tx_lock: Held during tg3_start_xmit{,_4gbug} and tg3_tx + * dev->xmit_lock: Held during tg3_start_xmit and tg3_tx * * If you want to shut up all asynchronous processing you must - * acquire both locks, 'lock' taken before 'tx_lock'. IRQs must - * be disabled to take 'lock' but only softirq disabling is - * necessary for acquisition of 'tx_lock'. + * acquire both locks, 'lock' taken before 'xmit_lock'. IRQs must + * be disabled to take either lock. */ spinlock_t lock; spinlock_t indirect_lock; @@ -2003,8 +2002,6 @@ u32 tx_prod; u32 tx_cons; u32 tx_pending; - - spinlock_t tx_lock; struct tg3_tx_buffer_desc *tx_ring; struct tx_ring_info *tx_buffers; ===== drivers/net/e1000/e1000.h 1.58 vs edited ===== --- 1.58/drivers/net/e1000/e1000.h 2004-10-25 18:13:57 -07:00 +++ edited/drivers/net/e1000/e1000.h 2005-01-19 15:45:31 -08:00 @@ -209,7 +209,6 @@ /* TX */ struct e1000_desc_ring tx_ring; - spinlock_t tx_lock; uint32_t txd_cmd; uint32_t tx_int_delay; uint32_t tx_abs_int_delay; ===== drivers/net/e1000/e1000_main.c 1.145 vs edited ===== --- 1.145/drivers/net/e1000/e1000_main.c 2005-01-10 21:03:21 -08:00 +++ edited/drivers/net/e1000/e1000_main.c 2005-01-19 15:46:15 -08:00 @@ -520,9 +520,6 @@ if(pci_using_dac) netdev->features |= NETIF_F_HIGHDMA; - /* hard_start_xmit is safe against parallel locking */ - netdev->features |= NETIF_F_LLTX; - /* before reading the EEPROM, reset the controller to * put the device in a known good starting state */ @@ -732,7 +729,6 @@ atomic_set(&adapter->irq_sem, 1); spin_lock_init(&adapter->stats_lock); - spin_lock_init(&adapter->tx_lock); return 0; } @@ -1308,7 +1304,7 @@ /* Check for Promiscuous and All Multicast modes */ - spin_lock_irqsave(&adapter->tx_lock, flags); + spin_lock_irqsave(&netdev->xmit_lock, flags); rctl = E1000_READ_REG(hw, RCTL); @@ -1359,7 +1355,7 @@ if(hw->mac_type == e1000_82542_rev2_0) e1000_leave_82542_rst(adapter); - spin_unlock_irqrestore(&adapter->tx_lock, flags); + spin_unlock_irqrestore(&netdev->xmit_lock, flags); } /* Need to wait a few seconds after link up to get diagnostic information from @@ -1786,6 +1782,8 @@ } #define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1 ) + +/* Called with dev->xmit_lock held and interrupts disabled. */ static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) { @@ -1794,7 +1792,6 @@ unsigned int max_txd_pwr = E1000_MAX_TXD_PWR; unsigned int tx_flags = 0; unsigned int len = skb->len; - unsigned long flags; unsigned int nr_frags = 0; unsigned int mss = 0; int count = 0; @@ -1838,18 +1835,10 @@ if(adapter->pcix_82544) count += nr_frags; - local_irq_save(flags); - if (!spin_trylock(&adapter->tx_lock)) { - /* Collision - tell upper layer to requeue */ - local_irq_restore(flags); - return NETDEV_TX_LOCKED; - } - /* need: count + 2 desc gap to keep tail from touching * head, otherwise try next time */ if(unlikely(E1000_DESC_UNUSED(&adapter->tx_ring) < count + 2)) { netif_stop_queue(netdev); - spin_unlock_irqrestore(&adapter->tx_lock, flags); return NETDEV_TX_BUSY; } @@ -1857,7 +1846,6 @@ if(unlikely(e1000_82547_fifo_workaround(adapter, skb))) { netif_stop_queue(netdev); mod_timer(&adapter->tx_fifo_stall_timer, jiffies); - spin_unlock_irqrestore(&adapter->tx_lock, flags); return NETDEV_TX_BUSY; } } @@ -1884,7 +1872,6 @@ if(unlikely(E1000_DESC_UNUSED(&adapter->tx_ring) < MAX_SKB_FRAGS + 2)) netif_stop_queue(netdev); - spin_unlock_irqrestore(&adapter->tx_lock, flags); return NETDEV_TX_OK; } @@ -2234,13 +2221,13 @@ tx_ring->next_to_clean = i; - spin_lock(&adapter->tx_lock); + spin_lock(&netdev->xmit_lock); if(unlikely(cleaned && netif_queue_stopped(netdev) && netif_carrier_ok(netdev))) netif_wake_queue(netdev); - spin_unlock(&adapter->tx_lock); + spin_unlock(&netdev->xmit_lock); return cleaned; } ===== include/linux/netdevice.h 1.96 vs edited ===== --- 1.96/include/linux/netdevice.h 2005-01-17 13:13:31 -08:00 +++ edited/include/linux/netdevice.h 2005-01-19 16:07:45 -08:00 @@ -76,7 +76,6 @@ /* Driver transmit return codes */ #define NETDEV_TX_OK 0 /* driver took care of packet */ #define NETDEV_TX_BUSY 1 /* driver tx path was busy*/ -#define NETDEV_TX_LOCKED -1 /* driver tx lock was already taken */ /* * Compute the worst case header length according to the protocols @@ -415,7 +414,7 @@ #define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */ #define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ #define NETIF_F_TSO 2048 /* Can offload TCP/IP segmentation */ -#define NETIF_F_LLTX 4096 /* LockLess TX */ +#define NETIF_F_LLTX 4096 /* Do not grab xmit_lock during ->hard_start_xmit */ /* Called after device is detached from network. */ void (*uninit)(struct net_device *dev); @@ -894,9 +893,11 @@ static inline void netif_tx_disable(struct net_device *dev) { - spin_lock_bh(&dev->xmit_lock); + unsigned long flags; + + spin_lock_irqsave(&dev->xmit_lock, flags); netif_stop_queue(dev); - spin_unlock_bh(&dev->xmit_lock); + spin_unlock_irqrestore(&dev->xmit_lock, flags); } /* These functions live elsewhere (drivers/net/net_init.c, but related) */ ===== net/atm/clip.c 1.43 vs edited ===== --- 1.43/net/atm/clip.c 2004-10-01 14:50:07 -07:00 +++ edited/net/atm/clip.c 2005-01-19 16:04:55 -08:00 @@ -97,7 +97,7 @@ printk(KERN_CRIT "!clip_vcc->entry (clip_vcc %p)\n",clip_vcc); return; } - spin_lock_bh(&entry->neigh->dev->xmit_lock); /* block clip_start_xmit() */ + spin_lock_irq(&entry->neigh->dev->xmit_lock); /* block clip_start_xmit() */ entry->neigh->used = jiffies; for (walk = &entry->vccs; *walk; walk = &(*walk)->next) if (*walk == clip_vcc) { @@ -121,7 +121,7 @@ printk(KERN_CRIT "ATMARP: unlink_clip_vcc failed (entry %p, vcc " "0x%p)\n",entry,clip_vcc); out: - spin_unlock_bh(&entry->neigh->dev->xmit_lock); + spin_unlock_irq(&entry->neigh->dev->xmit_lock); } /* The neighbour entry n->lock is held. */ ===== net/core/dev.c 1.181 vs edited ===== --- 1.181/net/core/dev.c 2005-01-13 20:41:04 -08:00 +++ edited/net/core/dev.c 2005-01-19 16:00:08 -08:00 @@ -1190,7 +1190,7 @@ #define HARD_TX_LOCK(dev, cpu) { \ if ((dev->features & NETIF_F_LLTX) == 0) { \ - spin_lock(&dev->xmit_lock); \ + spin_lock_irq(&dev->xmit_lock); \ dev->xmit_lock_owner = cpu; \ } \ } @@ -1198,7 +1198,7 @@ #define HARD_TX_UNLOCK(dev) { \ if ((dev->features & NETIF_F_LLTX) == 0) { \ dev->xmit_lock_owner = -1; \ - spin_unlock(&dev->xmit_lock); \ + spin_unlock_irq(&dev->xmit_lock); \ } \ } ===== net/core/dev_mcast.c 1.4 vs edited ===== --- 1.4/net/core/dev_mcast.c 2004-10-20 01:37:15 -07:00 +++ edited/net/core/dev_mcast.c 2005-01-19 16:05:35 -08:00 @@ -93,9 +93,9 @@ void dev_mc_upload(struct net_device *dev) { - spin_lock_bh(&dev->xmit_lock); + spin_lock_irq(&dev->xmit_lock); __dev_mc_upload(dev); - spin_unlock_bh(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); } /* @@ -107,7 +107,7 @@ int err = 0; struct dev_mc_list *dmi, **dmip; - spin_lock_bh(&dev->xmit_lock); + spin_lock_irq(&dev->xmit_lock); for (dmip = &dev->mc_list; (dmi = *dmip) != NULL; dmip = &dmi->next) { /* @@ -139,13 +139,13 @@ */ __dev_mc_upload(dev); - spin_unlock_bh(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); return 0; } } err = -ENOENT; done: - spin_unlock_bh(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); return err; } @@ -160,7 +160,7 @@ dmi1 = (struct dev_mc_list *)kmalloc(sizeof(*dmi), GFP_ATOMIC); - spin_lock_bh(&dev->xmit_lock); + spin_lock_irq(&dev->xmit_lock); for (dmi = dev->mc_list; dmi != NULL; dmi = dmi->next) { if (memcmp(dmi->dmi_addr, addr, dmi->dmi_addrlen) == 0 && dmi->dmi_addrlen == alen) { @@ -176,7 +176,7 @@ } if ((dmi = dmi1) == NULL) { - spin_unlock_bh(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); return -ENOMEM; } memcpy(dmi->dmi_addr, addr, alen); @@ -189,11 +189,11 @@ __dev_mc_upload(dev); - spin_unlock_bh(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); return 0; done: - spin_unlock_bh(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); if (dmi1) kfree(dmi1); return err; @@ -205,7 +205,7 @@ void dev_mc_discard(struct net_device *dev) { - spin_lock_bh(&dev->xmit_lock); + spin_lock_irq(&dev->xmit_lock); while (dev->mc_list != NULL) { struct dev_mc_list *tmp = dev->mc_list; @@ -216,7 +216,7 @@ } dev->mc_count = 0; - spin_unlock_bh(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); } #ifdef CONFIG_PROC_FS @@ -251,7 +251,7 @@ struct dev_mc_list *m; struct net_device *dev = v; - spin_lock_bh(&dev->xmit_lock); + spin_lock_irq(&dev->xmit_lock); for (m = dev->mc_list; m; m = m->next) { int i; @@ -263,7 +263,7 @@ seq_putc(seq, '\n'); } - spin_unlock_bh(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); return 0; } ===== net/core/netpoll.c 1.24 vs edited ===== --- 1.24/net/core/netpoll.c 2005-01-13 20:41:04 -08:00 +++ edited/net/core/netpoll.c 2005-01-19 16:05:56 -08:00 @@ -188,7 +188,7 @@ return; } - spin_lock(&np->dev->xmit_lock); + spin_lock_irq(&np->dev->xmit_lock); np->dev->xmit_lock_owner = smp_processor_id(); /* @@ -197,7 +197,7 @@ */ if (netif_queue_stopped(np->dev)) { np->dev->xmit_lock_owner = -1; - spin_unlock(&np->dev->xmit_lock); + spin_unlock_irq(&np->dev->xmit_lock); netpoll_poll(np); goto repeat; @@ -205,7 +205,7 @@ status = np->dev->hard_start_xmit(skb, np->dev); np->dev->xmit_lock_owner = -1; - spin_unlock(&np->dev->xmit_lock); + spin_unlock_irq(&np->dev->xmit_lock); /* transmit busy */ if(status) { ===== net/core/pktgen.c 1.21 vs edited ===== --- 1.21/net/core/pktgen.c 2005-01-10 11:32:10 -08:00 +++ edited/net/core/pktgen.c 2005-01-19 16:07:58 -08:00 @@ -2664,12 +2664,11 @@ } } - spin_lock_bh(&odev->xmit_lock); + spin_lock_irq(&odev->xmit_lock); if (!netif_queue_stopped(odev)) { u64 now; atomic_inc(&(pkt_dev->skb->users)); -retry_now: ret = odev->hard_start_xmit(pkt_dev->skb, odev); if (likely(ret == NETDEV_TX_OK)) { pkt_dev->last_ok = 1; @@ -2677,10 +2676,6 @@ pkt_dev->seq_num++; pkt_dev->tx_bytes += pkt_dev->cur_pkt_size; - } else if (ret == NETDEV_TX_LOCKED - && (odev->features & NETIF_F_LLTX)) { - cpu_relax(); - goto retry_now; } else { /* Retry it next time */ atomic_dec(&(pkt_dev->skb->users)); @@ -2716,7 +2711,7 @@ pkt_dev->next_tx_ns = 0; } - spin_unlock_bh(&odev->xmit_lock); + spin_unlock_irq(&odev->xmit_lock); /* If pkt_dev->count is zero, then run forever */ if ((pkt_dev->count != 0) && (pkt_dev->sofar >= pkt_dev->count)) { ===== net/sched/sch_generic.c 1.33 vs edited ===== --- 1.33/net/sched/sch_generic.c 2005-01-13 20:41:07 -08:00 +++ edited/net/sched/sch_generic.c 2005-01-19 16:10:49 -08:00 @@ -99,16 +99,11 @@ if ((skb = q->dequeue(q)) != NULL) { unsigned nolock = (dev->features & NETIF_F_LLTX); /* - * When the driver has LLTX set it does its own locking - * in start_xmit. No need to add additional overhead by - * locking again. These checks are worth it because - * even uncongested locks can be quite expensive. - * The driver can do trylock like here too, in case - * of lock congestion it should return -1 and the packet - * will be requeued. + * When the driver has LLTX set it does not require any + * locking in start_xmit. */ if (!nolock) { - if (!spin_trylock(&dev->xmit_lock)) { + if (!spin_trylock_irq(&dev->xmit_lock)) { collision: /* So, someone grabbed the driver. */ @@ -143,22 +138,18 @@ if (ret == NETDEV_TX_OK) { if (!nolock) { dev->xmit_lock_owner = -1; - spin_unlock(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); } spin_lock(&dev->queue_lock); return -1; } - if (ret == NETDEV_TX_LOCKED && nolock) { - spin_lock(&dev->queue_lock); - goto collision; - } } /* NETDEV_TX_BUSY - we need to requeue */ /* Release the driver */ if (!nolock) { dev->xmit_lock_owner = -1; - spin_unlock(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); } spin_lock(&dev->queue_lock); q = dev->qdisc; @@ -186,7 +177,7 @@ { struct net_device *dev = (struct net_device *)arg; - spin_lock(&dev->xmit_lock); + spin_lock_irq(&dev->xmit_lock); if (dev->qdisc != &noop_qdisc) { if (netif_device_present(dev) && netif_running(dev) && @@ -200,7 +191,7 @@ dev_hold(dev); } } - spin_unlock(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); dev_put(dev); } @@ -224,17 +215,17 @@ static void dev_watchdog_up(struct net_device *dev) { - spin_lock_bh(&dev->xmit_lock); + spin_lock_irq(&dev->xmit_lock); __netdev_watchdog_up(dev); - spin_unlock_bh(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); } static void dev_watchdog_down(struct net_device *dev) { - spin_lock_bh(&dev->xmit_lock); + spin_lock_irq(&dev->xmit_lock); if (del_timer(&dev->watchdog_timer)) __dev_put(dev); - spin_unlock_bh(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); } /* "NOOP" scheduler: the best scheduler, recommended for all interfaces ===== net/sched/sch_teql.c 1.16 vs edited ===== --- 1.16/net/sched/sch_teql.c 2004-10-21 22:21:24 -07:00 +++ edited/net/sched/sch_teql.c 2005-01-19 16:06:11 -08:00 @@ -301,12 +301,12 @@ switch (teql_resolve(skb, skb_res, slave)) { case 0: - if (spin_trylock(&slave->xmit_lock)) { + if (spin_trylock_irq(&slave->xmit_lock)) { slave->xmit_lock_owner = smp_processor_id(); if (!netif_queue_stopped(slave) && slave->hard_start_xmit(skb, slave) == 0) { slave->xmit_lock_owner = -1; - spin_unlock(&slave->xmit_lock); + spin_unlock_irq(&slave->xmit_lock); master->slaves = NEXT_SLAVE(q); netif_wake_queue(dev); master->stats.tx_packets++; @@ -314,7 +314,7 @@ return 0; } slave->xmit_lock_owner = -1; - spin_unlock(&slave->xmit_lock); + spin_unlock_irq(&slave->xmit_lock); } if (netif_queue_stopped(dev)) busy = 1; From davem@davemloft.net Wed Jan 19 16:49:14 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 16:49:19 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K0nEKD003126 for ; Wed, 19 Jan 2005 16:49:14 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CrQTq-0007dl-00; Wed, 19 Jan 2005 16:47:22 -0800 Date: Wed, 19 Jan 2005 16:47:21 -0800 From: "David S. Miller" To: Stephen Hemminger Cc: jgarzik@pobox.com, hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, roland@topspin.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [openib-general] Re: LLTX and netif_stop_queue Message-Id: <20050119164721.34745a81.davem@davemloft.net> In-Reply-To: <20050119164614.6f74daf3@dxpl.pdx.osdl.net> References: <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> <5cac192f0501021530672a908a@mail.gmail.com> <1104764660.1048.578.camel@jzny.localdomain> <52brc68q05.fsf@topspin.com> <5cac192f05010308414a25b548@mail.gmail.com> <527jmu8nbw.fsf@topspin.com> <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119154132.68f0bb4f.davem@davemloft.net> <41EEF52C.8000905@pobox.com> <20050119164614.6f74daf3@dxpl.pdx.osdl.net> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 520 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Wed, 19 Jan 2005 16:46:14 -0800 Stephen Hemminger wrote: > But in the end it would be safer than the current LLTX usage in drivers > which seems like it opening up problems. Agreed, see my prototype patch in a posting I just made. From romieu@fr.zoreil.com Wed Jan 19 16:50:18 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 16:50:23 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K0oGRp003531 for ; Wed, 19 Jan 2005 16:50:17 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.13.1/8.12.1) with ESMTP id j0K0m1No006719; Thu, 20 Jan 2005 01:48:01 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.13.1/8.13.1/Submit) id j0K0lreh006718; Thu, 20 Jan 2005 01:47:53 +0100 Date: Thu, 20 Jan 2005 01:47:53 +0100 From: Francois Romieu To: "David S. Miller" Cc: Stephen Hemminger , hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, roland@topspin.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [openib-general] Re: LLTX and netif_stop_queue Message-ID: <20050120004753.GB2330@electric-eye.fr.zoreil.com> References: <1104764660.1048.578.camel@jzny.localdomain> <52brc68q05.fsf@topspin.com> <5cac192f05010308414a25b548@mail.gmail.com> <527jmu8nbw.fsf@topspin.com> <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119154132.68f0bb4f.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050119154132.68f0bb4f.davem@davemloft.net> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 521 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev David S. Miller : [...] > Originally, dev->xmit_lock was added so that drivers that were SMP dumb > could stay that way. Thus preserving the guarentee that there would be > only one active call into the dev->hard_start_xmit method across the > entire system. I don't think any of that is relevant any longer. All > of our network drivers are pretty clean in this regard. (nit) Almost all. I used the fact that dev->hard_start_xmit was issued in a bh disabled context to exchange spinlock_irqsave for ordered ops on ring indexes so as to sync hard_start_xmit and the irq handler in the r8169 driver. It is a bit sick but Jon Mason reported it made a noticeable difference to avoid the irqsave on its 4 way ppc64 and nobody complained about it. -- Ueimor From davem@davemloft.net Wed Jan 19 16:54:45 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 16:54:51 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K0sie5004814 for ; Wed, 19 Jan 2005 16:54:45 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CrQZ5-0007fj-00; Wed, 19 Jan 2005 16:52:47 -0800 Date: Wed, 19 Jan 2005 16:52:47 -0800 From: "David S. Miller" To: Francois Romieu Cc: shemminger@osdl.org, hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, roland@topspin.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [openib-general] Re: LLTX and netif_stop_queue Message-Id: <20050119165247.5d4cec51.davem@davemloft.net> In-Reply-To: <20050120004753.GB2330@electric-eye.fr.zoreil.com> References: <1104764660.1048.578.camel@jzny.localdomain> <52brc68q05.fsf@topspin.com> <5cac192f05010308414a25b548@mail.gmail.com> <527jmu8nbw.fsf@topspin.com> <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119154132.68f0bb4f.davem@davemloft.net> <20050120004753.GB2330@electric-eye.fr.zoreil.com> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 522 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Thu, 20 Jan 2005 01:47:53 +0100 Francois Romieu wrote: > David S. Miller : > [...] > > Originally, dev->xmit_lock was added so that drivers that were SMP dumb > > could stay that way. Thus preserving the guarentee that there would be > > only one active call into the dev->hard_start_xmit method across the > > entire system. I don't think any of that is relevant any longer. All > > of our network drivers are pretty clean in this regard. > > (nit) > > Almost all. I used the fact that dev->hard_start_xmit was issued in > a bh disabled context to exchange spinlock_irqsave for ordered ops > on ring indexes so as to sync hard_start_xmit and the irq handler in > the r8169 driver. It is a bit sick but Jon Mason reported it made a > noticeable difference to avoid the irqsave on its 4 way ppc64 and > nobody complained about it. Hmmm... ok then. Unfortunately, my prototype patch I just posted will make IRQs get disabled in the ->hard_start_xmit() path. BTW, in your close() routine you do this: /* Give a racing hard_start_xmit a few cycles to complete. */ set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(1); This is no guarentee of progress. You might instead want to do a synchronize_kernel() or similar, which does in fact guarentee a quiescent state. Or if my patch goes in use spin_unlock_wait(&netdev->xmit_lock) ;-) From romieu@fr.zoreil.com Wed Jan 19 17:22:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 17:22:18 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K1MCaX006146 for ; Wed, 19 Jan 2005 17:22:13 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.13.1/8.12.1) with ESMTP id j0K1HhrP007217; Thu, 20 Jan 2005 02:17:43 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.13.1/8.13.1/Submit) id j0K1HUwF007196; Thu, 20 Jan 2005 02:17:30 +0100 Date: Thu, 20 Jan 2005 02:17:30 +0100 From: Francois Romieu To: "David S. Miller" Cc: shemminger@osdl.org, hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, roland@topspin.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [openib-general] Re: LLTX and netif_stop_queue Message-ID: <20050120011729.GA6775@electric-eye.fr.zoreil.com> References: <5cac192f05010308414a25b548@mail.gmail.com> <527jmu8nbw.fsf@topspin.com> <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119154132.68f0bb4f.davem@davemloft.net> <20050120004753.GB2330@electric-eye.fr.zoreil.com> <20050119165247.5d4cec51.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050119165247.5d4cec51.davem@davemloft.net> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 523 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev David S. Miller : [...] > Hmmm... ok then. Unfortunately, my prototype patch I just posted > will make IRQs get disabled in the ->hard_start_xmit() path. I'm completely fine with the prototype patch. It will allow to cut some code in the driver and the r8169 has room for improvement anyway. Point taken for the close() routine. -- Ueimor From jeremy.guthrie@berbee.com Wed Jan 19 17:50:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 17:50:28 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K1oJgw007508 for ; Wed, 19 Jan 2005 17:50:20 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Wed, 19 Jan 2005 19:50:13 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Wed, 19 Jan 2005 19:50:07 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson References: <200501190903.45671.jeremy.guthrie@berbee.com> <16878.56487.600435.442912@robur.slu.se> In-Reply-To: <16878.56487.600435.442912@robur.slu.se> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501191950.08567.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 20 Jan 2005 01:50:13.0624 (UTC) FILETIME=[6202AF80:01C4FE92] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 524 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev @ 14:51:44 we can see the secret_interval kick in. Otherwise we run very solid. 101Kpps 8) 1024 buffers on the RX of eth3. echo 86400 > /proc/sys/net/ipv4/route/secret_interval echo 524288 > /proc/sys/net/ipv4/route/gc_thresh It appears to be cruising right along now. ----------- 01/19/05 14:49:57 entries: 0007fffa Pkts: 1413598 Err: 0 PPS: 94239 Drop %: 0.0% Eth3RXInt: 309669 Eth2TXInt: 36693 01/19/05 14:50:13 entries: 0007fff7 Pkts: 1448829 Err: 0 PPS: 96588 Drop %: 0.0% Eth3RXInt: 295522 Eth2TXInt: 36475 01/19/05 14:50:28 entries: 0007ffff Pkts: 1449774 Err: 0 PPS: 96651 Drop %: 0.0% Eth3RXInt: 292556 Eth2TXInt: 36780 01/19/05 14:50:43 entries: 00080000 Pkts: 1454807 Err: 0 PPS: 96987 Drop %: 0.0% Eth3RXInt: 300945 Eth2TXInt: 35358 01/19/05 14:50:58 entries: 00080000 Pkts: 1426412 Err: 0 PPS: 95094 Drop %: 0.0% Eth3RXInt: 303005 Eth2TXInt: 35118 01/19/05 14:51:14 entries: 00080002 Pkts: 1471279 Err: 0 PPS: 98085 Drop %: 0.0% Eth3RXInt: 298152 Eth2TXInt: 35573 01/19/05 14:51:29 entries: 00080002 Pkts: 1402715 Err: 0 PPS: 93514 Drop %: 0.0% Eth3RXInt: 314880 Eth2TXInt: 37688 01/19/05 14:51:44 entries: 00007ef6 Pkts: 1335367 Err: 204660 PPS: 89024 Drop %: 15.32% Eth3RXInt: 203518 Eth2TXInt: 54907 01/19/05 14:52:00 entries: 00014a3a Pkts: 1484009 Err: 0 PPS: 98933 Drop %: 0.0% Eth3RXInt: 138942 Eth2TXInt: 60283 01/19/05 14:52:15 entries: 0001f092 Pkts: 1441979 Err: 0 PPS: 96131 Drop %: 0.0% Eth3RXInt: 175142 Eth2TXInt: 53552 01/19/05 14:52:30 entries: 00028f95 Pkts: 1460829 Err: 0 PPS: 97388 Drop %: 0.0% Eth3RXInt: 181189 Eth2TXInt: 53574 01/19/05 14:52:45 entries: 000303a3 Pkts: 1423530 Err: 0 PPS: 94902 Drop %: 0.0% Eth3RXInt: 234029 Eth2TXInt: 48046 01/19/05 14:53:01 entries: 00035167 Pkts: 1443491 Err: 0 PPS: 96232 Drop %: 0.0% Eth3RXInt: 270393 Eth2TXInt: 40791 01/19/05 14:53:16 entries: 0003994a Pkts: 1455118 Err: 0 PPS: 97007 Drop %: 0.0% Eth3RXInt: 276102 Eth2TXInt: 39695 01/19/05 14:53:31 entries: 0003df5a Pkts: 1405048 Err: 0 PPS: 93669 Drop %: 0.0% Eth3RXInt: 287641 Eth2TXInt: 39903 01/19/05 14:53:46 entries: 00041f5c Pkts: 1392438 Err: 0 PPS: 92829 Drop %: 0.0% Eth3RXInt: 307840 Eth2TXInt: 40216 01/19/05 14:54:01 entries: 00045da3 Pkts: 1486506 Err: 0 PPS: 99100 Drop %: 0.0% Eth3RXInt: 280067 Eth2TXInt: 38030 01/19/05 14:54:17 entries: 00049a78 Pkts: 1504340 Err: 0 PPS: 100289 Drop %: 0.0% Eth3RXInt: 276769 Eth2TXInt: 36982 01/19/05 14:54:32 entries: 0004d72b Pkts: 1489358 Err: 0 PPS: 99290 Drop %: 0.0% Eth3RXInt: 280576 Eth2TXInt: 37378 01/19/05 14:54:47 entries: 00051214 Pkts: 1475776 Err: 0 PPS: 98385 Drop %: 0.0% Eth3RXInt: 289098 Eth2TXInt: 36632 01/19/05 14:55:02 entries: 00054ceb Pkts: 1527761 Err: 0 PPS: 101850 Drop %: 0.0% Eth3RXInt: 273478 Eth2TXInt: 35447 01/19/05 14:55:18 entries: 000584f7 Pkts: 1482312 Err: 0 PPS: 98820 Drop %: 0.0% Eth3RXInt: 288181 Eth2TXInt: 35792 01/19/05 14:55:33 entries: 0005be56 Pkts: 1477823 Err: 0 PPS: 98521 Drop %: 0.0% Eth3RXInt: 284099 Eth2TXInt: 36698 01/19/05 14:55:48 entries: 0005f55b Pkts: 1489107 Err: 0 PPS: 99273 Drop %: 0.0% Eth3RXInt: 289669 Eth2TXInt: 36162 01/19/05 14:56:03 entries: 00062ae8 Pkts: 1451832 Err: 0 PPS: 96788 Drop %: 0.0% Eth3RXInt: 299549 Eth2TXInt: 36259 01/19/05 14:56:19 entries: 000660cd Pkts: 1423292 Err: 0 PPS: 94886 Drop %: 0.0% Eth3RXInt: 306119 Eth2TXInt: 36382 01/19/05 14:56:34 entries: 000697a1 Pkts: 1458930 Err: 0 PPS: 97262 Drop %: 0.0% Eth3RXInt: 302765 Eth2TXInt: 37878 On Wednesday 19 January 2005 04:18 pm, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > > gc_elasticity, gc_interval, gc_thresh etc I would avoid > > > gc_min_interval. > > > > I have done a little tweaking. I now hold at around 520K routes in the > > hash. I still drop packets every secret_interval but I've upped that > > counter so I don't whack all of my hash entries all that often. > > Sounds you done progress. > This with relative conservative setting if RX-buffers? > > secret_interval needs special care as it flushes the cache totally. > > What did you tweak? > Your output from rtstat will be very interesting. > > > --ro -- -------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 From acme@conectiva.com.br Wed Jan 19 18:01:19 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 18:01:25 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K21IrR008449 for ; Wed, 19 Jan 2005 18:01:18 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CrQtT-00009i-00; Wed, 19 Jan 2005 23:13:51 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id D01D91462D; Thu, 20 Jan 2005 00:01:16 -0200 (BRST) Message-ID: <41EF1195.40302@conectiva.com.br> Date: Thu, 20 Jan 2005 00:04:05 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" Cc: Networking Team Subject: [PATCH 1/9] appletalk: use sock slab cache X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------030908010103020604090602" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 526 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------030908010103020604090602 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit David, Subject says it all. Regards, - Arnaldo --------------030908010103020604090602 Content-Type: text/plain; name="appletalk_sock.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="appletalk_sock.patch" =================================================================== ChangeSet@1.2337, 2005-01-19 23:01:48-02:00, acme@toy.ghostprotocols.net [APPLETALK] use a private slab cache for socks Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller include/linux/atalk.h | 9 +++++++-- net/appletalk/ddp.c | 25 ++++++++++++++++--------- 2 files changed, 23 insertions(+), 11 deletions(-) diff -Nru a/include/linux/atalk.h b/include/linux/atalk.h --- a/include/linux/atalk.h 2005-01-19 23:13:41 -02:00 +++ b/include/linux/atalk.h 2005-01-19 23:13:41 -02:00 @@ -63,6 +63,8 @@ }; struct atalk_sock { + /* struct sock has to be the first member of atalk_sock */ + struct sock sk; unsigned short dest_net; unsigned short src_net; unsigned char dest_node; @@ -71,6 +73,11 @@ unsigned char src_port; }; +static inline struct atalk_sock *at_sk(struct sock *sk) +{ + return (struct atalk_sock *)sk; +} + #ifdef __KERNEL__ #include @@ -196,8 +203,6 @@ struct atalk_addr *sa); extern void aarp_cleanup_module(void); - -#define at_sk(__sk) ((struct atalk_sock *)(__sk)->sk_protinfo) extern struct hlist_head atalk_sockets; extern rwlock_t atalk_sockets_lock; diff -Nru a/net/appletalk/ddp.c b/net/appletalk/ddp.c --- a/net/appletalk/ddp.c 2005-01-19 23:13:41 -02:00 +++ b/net/appletalk/ddp.c 2005-01-19 23:13:41 -02:00 @@ -74,6 +74,8 @@ HLIST_HEAD(atalk_sockets); DEFINE_RWLOCK(atalk_sockets_lock); +static kmem_cache_t *atalk_sk_slab; + static inline void __atalk_insert_socket(struct sock *sk) { sk_add_node(sk, &atalk_sockets); @@ -1022,7 +1024,6 @@ static int atalk_create(struct socket *sock, int protocol) { struct sock *sk; - struct atalk_sock *at; int rc = -ESOCKTNOSUPPORT; /* @@ -1032,13 +1033,10 @@ if (sock->type != SOCK_RAW && sock->type != SOCK_DGRAM) goto out; rc = -ENOMEM; - sk = sk_alloc(PF_APPLETALK, GFP_KERNEL, 1, NULL); + sk = sk_alloc(PF_APPLETALK, GFP_KERNEL, + sizeof(struct atalk_sock), atalk_sk_slab); if (!sk) goto out; - at = sk->sk_protinfo = kmalloc(sizeof(*at), GFP_KERNEL); - if (!at) - goto outsk; - memset(at, 0, sizeof(*at)); rc = 0; sock->ops = &atalk_dgram_ops; sock_init_data(sock, sk); @@ -1048,9 +1046,6 @@ sk->sk_zapped = 1; out: return rc; -outsk: - sk_free(sk); - goto out; } /* Free a socket. No work needed */ @@ -1880,6 +1875,13 @@ /* Called by proto.c on kernel start up */ static int __init atalk_init(void) { + atalk_sk_slab = kmem_cache_create("appletalk_sock", + sizeof(struct atalk_sock), 0, + SLAB_HWCACHE_ALIGN, NULL, NULL); + + if (atalk_sk_slab == NULL) + return -ENOMEM; + (void)sock_register(&atalk_family_ops); ddp_dl = register_snap_client(ddp_snap_id, atalk_rcv); if (!ddp_dl) @@ -1917,6 +1919,11 @@ dev_remove_pack(&ppptalk_packet_type); unregister_snap_client(ddp_dl); sock_unregister(PF_APPLETALK); + + if (atalk_sk_slab != NULL) { + kmem_cache_destroy(atalk_sk_slab); + atalk_sk_slab = NULL; + } } module_exit(atalk_exit); --------------030908010103020604090602-- From acme@conectiva.com.br Wed Jan 19 18:01:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 18:01:21 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K21Eqd008442 for ; Wed, 19 Jan 2005 18:01:15 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CrQtO-00009d-00; Wed, 19 Jan 2005 23:13:46 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 731E41462D; Thu, 20 Jan 2005 00:01:11 -0200 (BRST) Message-ID: <41EF1190.2080702@conectiva.com.br> Date: Thu, 20 Jan 2005 00:04:00 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" Cc: Networking Team Subject: [PATCH 0/9] trivial slab cache conversions X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 525 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Hi David, These are trivial, so I'm batching them. Available at: bk://kernel.bkbits.net/acme/connection_sock-2.6 Please let me know if something needs reworking, Best Regards, - Arnaldo From acme@conectiva.com.br Wed Jan 19 18:01:56 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 18:02:00 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K21tP9008752 for ; Wed, 19 Jan 2005 18:01:55 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CrQu4-0000AP-00; Wed, 19 Jan 2005 23:14:28 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id ACAFB1462D; Thu, 20 Jan 2005 00:01:53 -0200 (BRST) Message-ID: <41EF11BA.4020804@conectiva.com.br> Date: Thu, 20 Jan 2005 00:04:42 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" Cc: Networking Team Subject: [PATCH 8/9] pf_key: use sock slab cache X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------020409040101090700030603" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 533 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------020409040101090700030603 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David, Now the pf_key one. - Arnaldo --------------020409040101090700030603 Content-Type: text/plain; name="pf_key_sock.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="pf_key_sock.patch" =================================================================== ChangeSet@1.2344, 2005-01-19 23:06:58-02:00, acme@toy.ghostprotocols.net [PF_KEY] use a private slab cache for socks Required to get rid of sk_protinfo and to introduce struct connection_sock, also for consistency with other protocol families implementations. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller af_key.c | 48 +++++++++++++++++++++++++++++------------------- 1 files changed, 29 insertions(+), 19 deletions(-) diff -Nru a/net/key/af_key.c b/net/key/af_key.c --- a/net/key/af_key.c 2005-01-19 23:50:16 -02:00 +++ b/net/key/af_key.c 2005-01-19 23:50:16 -02:00 @@ -42,11 +42,19 @@ static atomic_t pfkey_socks_nr = ATOMIC_INIT(0); -struct pfkey_opt { - int registered; - int promisc; +struct pfkey_sock { + /* struct sock must be the first member of struct pfkey_sock */ + struct sock sk; + int registered; + int promisc; }; -#define pfkey_sk(__sk) ((struct pfkey_opt *)(__sk)->sk_protinfo) + +static inline struct pfkey_sock *pfkey_sk(struct sock *sk) +{ + return (struct pfkey_sock *)sk; +} + +static kmem_cache_t *pfkey_sk_slab; static void pfkey_sock_destruct(struct sock *sk) { @@ -60,8 +68,6 @@ BUG_TRAP(!atomic_read(&sk->sk_rmem_alloc)); BUG_TRAP(!atomic_read(&sk->sk_wmem_alloc)); - kfree(pfkey_sk(sk)); - atomic_dec(&pfkey_socks_nr); } @@ -128,7 +134,6 @@ static int pfkey_create(struct socket *sock, int protocol) { struct sock *sk; - struct pfkey_opt *pfk; int err; if (!capable(CAP_NET_ADMIN)) @@ -139,7 +144,8 @@ return -EPROTONOSUPPORT; err = -ENOMEM; - sk = sk_alloc(PF_KEY, GFP_KERNEL, 1, NULL); + sk = sk_alloc(PF_KEY, GFP_KERNEL, + sizeof(struct pfkey_sock), pfkey_sk_slab); if (sk == NULL) goto out; @@ -147,14 +153,6 @@ sock_init_data(sock, sk); sk_set_owner(sk, THIS_MODULE); - err = -ENOMEM; - pfk = sk->sk_protinfo = kmalloc(sizeof(*pfk), GFP_KERNEL); - if (!pfk) { - sk_free(sk); - goto out; - } - memset(pfk, 0, sizeof(*pfk)); - sk->sk_family = PF_KEY; sk->sk_destruct = pfkey_sock_destruct; @@ -233,7 +231,7 @@ pfkey_lock_table(); sk_for_each(sk, node, &pfkey_table) { - struct pfkey_opt *pfk = pfkey_sk(sk); + struct pfkey_sock *pfk = pfkey_sk(sk); int err2; /* Yes, it means that if you are meant to receive this @@ -1418,7 +1416,7 @@ static int pfkey_register(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hdr, void **ext_hdrs) { - struct pfkey_opt *pfk = pfkey_sk(sk); + struct pfkey_sock *pfk = pfkey_sk(sk); struct sk_buff *supp_skb; if (hdr->sadb_msg_satype > SADB_SATYPE_MAX) @@ -1514,7 +1512,7 @@ static int pfkey_promisc(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hdr, void **ext_hdrs) { - struct pfkey_opt *pfk = pfkey_sk(sk); + struct pfkey_sock *pfk = pfkey_sk(sk); int satype = hdr->sadb_msg_satype; if (hdr->sadb_msg_len == (sizeof(*hdr) / sizeof(uint64_t))) { @@ -2863,10 +2861,22 @@ xfrm_unregister_km(&pfkeyv2_mgr); remove_proc_entry("net/pfkey", NULL); sock_unregister(PF_KEY); + + if (pfkey_sk_slab != NULL) { + kmem_cache_destroy(pfkey_sk_slab); + pfkey_sk_slab = NULL; + } } static int __init ipsec_pfkey_init(void) { + pfkey_sk_slab = kmem_cache_create("pfkey_sock", + sizeof(struct pfkey_sock), 0, + SLAB_HWCACHE_ALIGN, NULL, NULL); + + if (pfkey_sk_slab == NULL) + return -ENOMEM; + sock_register(&pfkey_family_ops); #ifdef CONFIG_PROC_FS create_proc_read_entry("net/pfkey", 0, NULL, pfkey_read_proc, NULL); --------------020409040101090700030603-- From acme@conectiva.com.br Wed Jan 19 18:01:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 18:01:29 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K21O3P008482 for ; Wed, 19 Jan 2005 18:01:24 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CrQtX-00009n-00; Wed, 19 Jan 2005 23:13:55 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 1DACD1462D; Thu, 20 Jan 2005 00:01:21 -0200 (BRST) Message-ID: <41EF119A.5040803@conectiva.com.br> Date: Thu, 20 Jan 2005 00:04:10 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" , Patrick Caulfield Cc: linux-decnet-user@lists.sourceforge.net, Networking Team Subject: [PATCH 2/9] decnet: Don't use sk_protinfo + private sock slab cache X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------000700080901050300050602" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 527 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------000700080901050300050602 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David, Patrick, The log has the reason for this patch. Regards, - Arnaldo --------------000700080901050300050602 Content-Type: text/plain; name="decnet.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="decnet.patch" =================================================================== ChangeSet@1.2338, 2005-01-19 23:02:32-02:00, acme@toy.ghostprotocols.net [DECNET] Don't use sk_protinfo + private sock slab cache DecNET already uses a private sock slab cache, but initializes sk->sk_protinfo, pointing to (sk + 1), this is wrong because at sk_free time we call sk->sk_destruct, that by default points to sock_def_destruct, that does a kfree on sk->sk_protinfo, since it was initialized at net_proto_family->create() time (dn_create), but in decnet sk_protinfo was not kmalloced, it was allocated piggybacked to struct sock. This doesn't causes problems because decnet sets sk->sk_destruct to a custom function that doesn't calls kfree(sk->sk_protinfo), but to reach a long time goal of killing sk_protinfo lets just make DN_SK return sk + 1. I left merging dn_scp with dn_sock for later, as the current state suits my needs to introduce connection_sock. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller include/net/dn.h | 6 +++++- net/decnet/af_decnet.c | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff -Nru a/include/net/dn.h b/include/net/dn.h --- a/include/net/dn.h 2005-01-19 23:18:06 -02:00 +++ b/include/net/dn.h 2005-01-19 23:18:06 -02:00 @@ -2,6 +2,7 @@ #define _NET_DN_H #include +#include #include typedef unsigned short dn_address; @@ -133,7 +134,10 @@ }; -#define DN_SK(__sk) ((struct dn_scp *)(__sk)->sk_protinfo) +static inline struct dn_scp *DN_SK(struct sock *sk) +{ + return (struct dn_scp *)(sk + 1); +} /* * src,dst : Source and Destination DECnet addresses diff -Nru a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c --- a/net/decnet/af_decnet.c 2005-01-19 23:18:06 -02:00 +++ b/net/decnet/af_decnet.c 2005-01-19 23:18:06 -02:00 @@ -456,8 +456,6 @@ if (!sk) goto out; - sk->sk_protinfo = scp = (struct dn_scp *)(sk + 1); - if (sock) sock->ops = &dn_proto_ops; sock_init_data(sock, sk); @@ -471,6 +469,7 @@ sk->sk_allocation = gfp; /* Initialization of DECnet Session Control Port */ + scp = DN_SK(sk); scp->state = DN_O; /* Open */ scp->numdat = 1; /* Next data seg to tx */ scp->numoth = 1; /* Next oth data to tx */ --------------000700080901050300050602-- From acme@conectiva.com.br Wed Jan 19 18:01:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 18:01:33 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K21RXN008516 for ; Wed, 19 Jan 2005 18:01:27 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CrQtc-00009u-00; Wed, 19 Jan 2005 23:14:00 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 8F95B1462D; Thu, 20 Jan 2005 00:01:25 -0200 (BRST) Message-ID: <41EF119E.4000404@conectiva.com.br> Date: Thu, 20 Jan 2005 00:04:14 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" Cc: Networking Team Subject: [PATCH 3/9] af_packet: use sock slab cache X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------050307090103090905040701" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 528 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------050307090103090905040701 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit David, Subject says it all. Regards, - Arnaldo --------------050307090103090905040701 Content-Type: text/plain; name="af_packet_sock.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="af_packet_sock.patch" =================================================================== ChangeSet@1.2339, 2005-01-19 23:02:59-02:00, acme@toy.ghostprotocols.net [AF_PACKET] use a private slab cache for socks Required to get rid of sk_protinfo and to introduce struct connection_sock, also for consistency with other protocol families implementations. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller af_packet.c | 69 ++++++++++++++++++++++++++++++++++-------------------------- 1 files changed, 40 insertions(+), 29 deletions(-) diff -Nru a/net/packet/af_packet.c b/net/packet/af_packet.c --- a/net/packet/af_packet.c 2005-01-19 23:21:03 -02:00 +++ b/net/packet/af_packet.c 2005-01-19 23:21:03 -02:00 @@ -148,6 +148,8 @@ static HLIST_HEAD(packet_sklist); static DEFINE_RWLOCK(packet_sklist_lock); +static kmem_cache_t *packet_sk_slab; + static atomic_t packet_socks_nr; @@ -170,8 +172,9 @@ static void packet_flush_mclist(struct sock *sk); -struct packet_opt -{ +struct packet_sock { + /* struct sock has to be the first member of packet_sock */ + struct sock sk; struct tpacket_stats stats; #ifdef CONFIG_PACKET_MMAP char * *pg_vec; @@ -199,7 +202,7 @@ #ifdef CONFIG_PACKET_MMAP -static inline char *packet_lookup_frame(struct packet_opt *po, unsigned int position) +static inline char *packet_lookup_frame(struct packet_sock *po, unsigned int position) { unsigned int pg_vec_pos, frame_offset; char *frame; @@ -213,7 +216,10 @@ } #endif -#define pkt_sk(__sk) ((struct packet_opt *)(__sk)->sk_protinfo) +static inline struct packet_sock *pkt_sk(struct sock *sk) +{ + return (struct packet_sock *)sk; +} static void packet_sock_destruct(struct sock *sk) { @@ -225,8 +231,6 @@ return; } - if (pkt_sk(sk)) - kfree(pkt_sk(sk)); atomic_dec(&packet_socks_nr); #ifdef PACKET_REFCNT_DEBUG printk(KERN_DEBUG "PACKET socket %p is free, %d are alive\n", sk, atomic_read(&packet_socks_nr)); @@ -440,7 +444,7 @@ { struct sock *sk; struct sockaddr_ll *sll; - struct packet_opt *po; + struct packet_sock *po; u8 * skb_head = skb->data; int skb_len = skb->len; unsigned snaplen; @@ -541,7 +545,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt) { struct sock *sk; - struct packet_opt *po; + struct packet_sock *po; struct sockaddr_ll *sll; struct tpacket_hdr *h; u8 * skb_head = skb->data; @@ -699,7 +703,7 @@ */ if (saddr == NULL) { - struct packet_opt *po = pkt_sk(sk); + struct packet_sock *po = pkt_sk(sk); ifindex = po->ifindex; proto = po->num; @@ -786,7 +790,7 @@ static int packet_release(struct socket *sock) { struct sock *sk = sock->sk; - struct packet_opt *po; + struct packet_sock *po; if (!sk) return 0; @@ -844,7 +848,7 @@ static int packet_do_bind(struct sock *sk, struct net_device *dev, int protocol) { - struct packet_opt *po = pkt_sk(sk); + struct packet_sock *po = pkt_sk(sk); /* * Detach an existing hook if present. */ @@ -961,7 +965,7 @@ static int packet_create(struct socket *sock, int protocol) { struct sock *sk; - struct packet_opt *po; + struct packet_sock *po; int err; if (!capable(CAP_NET_RAW)) @@ -976,7 +980,8 @@ sock->state = SS_UNCONNECTED; err = -ENOBUFS; - sk = sk_alloc(PF_PACKET, GFP_KERNEL, 1, NULL); + sk = sk_alloc(PF_PACKET, GFP_KERNEL, + sizeof(struct packet_sock), packet_sk_slab); if (sk == NULL) goto out; @@ -988,10 +993,7 @@ sock_init_data(sock,sk); sk_set_owner(sk, THIS_MODULE); - po = sk->sk_protinfo = kmalloc(sizeof(*po), GFP_KERNEL); - if (!po) - goto out_free; - memset(po, 0, sizeof(*po)); + po = pkt_sk(sk); sk->sk_family = PF_PACKET; po->num = protocol; @@ -1021,9 +1023,6 @@ sk_add_node(sk, &packet_sklist); write_unlock_bh(&packet_sklist_lock); return(0); - -out_free: - sk_free(sk); out: return err; } @@ -1141,7 +1140,7 @@ { struct net_device *dev; struct sock *sk = sock->sk; - struct packet_opt *po = pkt_sk(sk); + struct packet_sock *po = pkt_sk(sk); struct sockaddr_ll *sll = (struct sockaddr_ll*)uaddr; if (peer) @@ -1195,7 +1194,7 @@ static int packet_mc_add(struct sock *sk, struct packet_mreq *mreq) { - struct packet_opt *po = pkt_sk(sk); + struct packet_sock *po = pkt_sk(sk); struct packet_mclist *ml, *i; struct net_device *dev; int err; @@ -1274,7 +1273,7 @@ static void packet_flush_mclist(struct sock *sk) { - struct packet_opt *po = pkt_sk(sk); + struct packet_sock *po = pkt_sk(sk); struct packet_mclist *ml; if (!po->mclist) @@ -1355,7 +1354,7 @@ { int len; struct sock *sk = sock->sk; - struct packet_opt *po = pkt_sk(sk); + struct packet_sock *po = pkt_sk(sk); if (level != SOL_PACKET) return -ENOPROTOOPT; @@ -1401,7 +1400,7 @@ read_lock(&packet_sklist_lock); sk_for_each(sk, node, &packet_sklist) { - struct packet_opt *po = pkt_sk(sk); + struct packet_sock *po = pkt_sk(sk); switch (msg) { case NETDEV_UNREGISTER: @@ -1504,7 +1503,7 @@ poll_table *wait) { struct sock *sk = sock->sk; - struct packet_opt *po = pkt_sk(sk); + struct packet_sock *po = pkt_sk(sk); unsigned int mask = datagram_poll(file, sock, wait); spin_lock_bh(&sk->sk_receive_queue.lock); @@ -1579,7 +1578,7 @@ static int packet_set_ring(struct sock *sk, struct tpacket_req *req, int closing) { char **pg_vec = NULL; - struct packet_opt *po = pkt_sk(sk); + struct packet_sock *po = pkt_sk(sk); int was_running, num, order = 0; int err = 0; @@ -1709,7 +1708,7 @@ static int packet_mmap(struct file *file, struct socket *sock, struct vm_area_struct *vma) { struct sock *sk = sock->sk; - struct packet_opt *po = pkt_sk(sk); + struct packet_sock *po = pkt_sk(sk); unsigned long size; unsigned long start; int err = -EINVAL; @@ -1839,7 +1838,7 @@ seq_puts(seq, "sk RefCnt Type Proto Iface R Rmem User Inode\n"); else { struct sock *s = v; - const struct packet_opt *po = pkt_sk(s); + const struct packet_sock *po = pkt_sk(s); seq_printf(seq, "%p %-6d %-4d %04x %-5d %1d %-6u %-6u %-6lu\n", @@ -1884,11 +1883,23 @@ proc_net_remove("packet"); unregister_netdevice_notifier(&packet_netdev_notifier); sock_unregister(PF_PACKET); + + if (packet_sk_slab != NULL) { + kmem_cache_destroy(packet_sk_slab); + packet_sk_slab = NULL; + } return; } static int __init packet_init(void) { + packet_sk_slab = kmem_cache_create("packet_sock", + sizeof(struct packet_sock), 0, + SLAB_HWCACHE_ALIGN, NULL, NULL); + + if (packet_sk_slab == NULL) + return -ENOMEM; + sock_register(&packet_family_ops); register_netdevice_notifier(&packet_netdev_notifier); proc_net_fops_create("packet", 0, &packet_seq_fops); --------------050307090103090905040701-- From acme@conectiva.com.br Wed Jan 19 18:01:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 18:01:58 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K21pdK008729 for ; Wed, 19 Jan 2005 18:01:52 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CrQtz-0000AJ-00; Wed, 19 Jan 2005 23:14:23 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 015BE1462D; Thu, 20 Jan 2005 00:01:48 -0200 (BRST) Message-ID: <41EF11B6.7030702@conectiva.com.br> Date: Thu, 20 Jan 2005 00:04:38 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" , Aristeu Rozanski Cc: Networking Team Subject: [PATCH 7/9] x25: use sock slab cache X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------050703090608090704090009" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 532 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------050703090608090704090009 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David, Aristeu, Please read the log in the patch. - Arnaldo --------------050703090608090704090009 Content-Type: text/plain; name="x25_sock.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="x25_sock.patch" =================================================================== ChangeSet@1.2343, 2005-01-19 23:06:19-02:00, acme@toy.ghostprotocols.net [X25] use a private slab cache for socks Required to get rid of sk_protinfo and to introduce struct connection_sock, also for consistency with other protocol families implementations. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller include/net/x25.h | 10 ++++++--- net/x25/af_x25.c | 50 +++++++++++++++++++++++++---------------------- net/x25/x25_facilities.c | 2 - net/x25/x25_in.c | 10 ++++----- net/x25/x25_out.c | 8 +++---- net/x25/x25_proc.c | 2 - net/x25/x25_subr.c | 14 ++++++------- net/x25/x25_timer.c | 14 ++++++------- 8 files changed, 59 insertions(+), 51 deletions(-) diff -Nru a/include/net/x25.h b/include/net/x25.h --- a/include/net/x25.h 2005-01-19 23:47:43 -02:00 +++ b/include/net/x25.h 2005-01-19 23:47:43 -02:00 @@ -10,6 +10,7 @@ #ifndef _X25_H #define _X25_H #include +#include #define X25_ADDR_LEN 16 @@ -129,7 +130,8 @@ atomic_t refcnt; }; -struct x25_opt { +struct x25_sock { + struct sock sk; struct x25_address source_addr, dest_addr; struct x25_neigh *neighbour; unsigned int lci; @@ -141,7 +143,6 @@ struct sk_buff_head fragment_queue; struct sk_buff_head interrupt_in_queue; struct sk_buff_head interrupt_out_queue; - struct sock *sk; /* Backlink to socket */ struct timer_list timer; struct x25_causediag causediag; struct x25_facilities facilities; @@ -149,7 +150,10 @@ unsigned long vc_facil_mask; /* inc_call facilities mask */ }; -#define x25_sk(__sk) ((struct x25_opt *)(__sk)->sk_protinfo) +static inline struct x25_sock *x25_sk(const struct sock *sk) +{ + return (struct x25_sock *)sk; +} /* af_x25.c */ extern int sysctl_x25_restart_request_timeout; diff -Nru a/net/x25/af_x25.c b/net/x25/af_x25.c --- a/net/x25/af_x25.c 2005-01-19 23:47:43 -02:00 +++ b/net/x25/af_x25.c 2005-01-19 23:47:43 -02:00 @@ -60,6 +60,8 @@ HLIST_HEAD(x25_list); DEFINE_RWLOCK(x25_list_lock); +static kmem_cache_t *x25_sk_slab; + static struct proto_ops x25_proto_ops; static struct x25_address null_x25_address = {" "}; @@ -444,33 +446,23 @@ static struct sock *x25_alloc_socket(void) { - struct x25_opt *x25; - struct sock *sk = sk_alloc(AF_X25, GFP_ATOMIC, 1, NULL); + struct x25_sock *x25; + struct sock *sk = sk_alloc(AF_X25, GFP_ATOMIC, + sizeof(struct x25_sock), x25_sk_slab); if (!sk) goto out; - x25 = sk->sk_protinfo = kmalloc(sizeof(*x25), GFP_ATOMIC); - if (!x25) - goto frees; - - memset(x25, 0, sizeof(*x25)); - - x25->sk = sk; - sock_init_data(NULL, sk); sk_set_owner(sk, THIS_MODULE); + x25 = x25_sk(sk); skb_queue_head_init(&x25->ack_queue); skb_queue_head_init(&x25->fragment_queue); skb_queue_head_init(&x25->interrupt_in_queue); skb_queue_head_init(&x25->interrupt_out_queue); out: return sk; -frees: - sk_free(sk); - sk = NULL; - goto out; } void x25_init_timers(struct sock *sk); @@ -478,7 +470,7 @@ static int x25_create(struct socket *sock, int protocol) { struct sock *sk; - struct x25_opt *x25; + struct x25_sock *x25; int rc = -ESOCKTNOSUPPORT; if (sock->type != SOCK_SEQPACKET || protocol) @@ -519,7 +511,7 @@ static struct sock *x25_make_new(struct sock *osk) { struct sock *sk = NULL; - struct x25_opt *x25, *ox25; + struct x25_sock *x25, *ox25; if (osk->sk_type != SOCK_SEQPACKET) goto out; @@ -557,7 +549,7 @@ static int x25_release(struct socket *sock) { struct sock *sk = sock->sk; - struct x25_opt *x25; + struct x25_sock *x25; if (!sk) goto out; @@ -644,7 +636,7 @@ int addr_len, int flags) { struct sock *sk = sock->sk; - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); struct sockaddr_x25 *addr = (struct sockaddr_x25 *)uaddr; struct x25_route *rt; int rc = 0; @@ -802,7 +794,7 @@ { struct sockaddr_x25 *sx25 = (struct sockaddr_x25 *)uaddr; struct sock *sk = sock->sk; - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); if (peer) { if (sk->sk_state != TCP_ESTABLISHED) @@ -822,7 +814,7 @@ { struct sock *sk; struct sock *make; - struct x25_opt *makex25; + struct x25_sock *makex25; struct x25_address source_addr, dest_addr; struct x25_facilities facilities; struct x25_calluserdata calluserdata; @@ -935,7 +927,7 @@ struct msghdr *msg, size_t len) { struct sock *sk = sock->sk; - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); struct sockaddr_x25 *usx25 = (struct sockaddr_x25 *)msg->msg_name; struct sockaddr_x25 sx25; struct sk_buff *skb; @@ -1112,7 +1104,7 @@ int flags) { struct sock *sk = sock->sk; - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); struct sockaddr_x25 *sx25 = (struct sockaddr_x25 *)msg->msg_name; size_t copied; int qbit; @@ -1201,7 +1193,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) { struct sock *sk = sock->sk; - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); void __user *argp = (void __user *)arg; int rc; @@ -1391,6 +1383,13 @@ static int __init x25_init(void) { + x25_sk_slab = kmem_cache_create("x25_sock", + sizeof(struct x25_sock), 0, + SLAB_HWCACHE_ALIGN, NULL, NULL); + + if (x25_sk_slab == NULL) + return -ENOMEM; + sock_register(&x25_family_ops); dev_add_pack(&x25_packet_type); @@ -1422,6 +1421,11 @@ dev_remove_pack(&x25_packet_type); sock_unregister(AF_X25); + + if (x25_sk_slab != NULL) { + kmem_cache_destroy(x25_sk_slab); + x25_sk_slab = NULL; + } } module_exit(x25_exit); diff -Nru a/net/x25/x25_facilities.c b/net/x25/x25_facilities.c --- a/net/x25/x25_facilities.c 2005-01-19 23:47:43 -02:00 +++ b/net/x25/x25_facilities.c 2005-01-19 23:47:43 -02:00 @@ -158,7 +158,7 @@ int x25_negotiate_facilities(struct sk_buff *skb, struct sock *sk, struct x25_facilities *new) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); struct x25_facilities *ours = &x25->facilities; struct x25_facilities theirs; int len; diff -Nru a/net/x25/x25_in.c b/net/x25/x25_in.c --- a/net/x25/x25_in.c 2005-01-19 23:47:43 -02:00 +++ b/net/x25/x25_in.c 2005-01-19 23:47:43 -02:00 @@ -34,7 +34,7 @@ static int x25_queue_rx_frame(struct sock *sk, struct sk_buff *skb, int more) { struct sk_buff *skbo, *skbn = skb; - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); if (more) { x25->fraglen += skb->len; @@ -89,7 +89,7 @@ switch (frametype) { case X25_CALL_ACCEPTED: { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); x25_stop_timer(sk); x25->condition = 0x00; @@ -165,7 +165,7 @@ { int queued = 0; int modulus; - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); modulus = (x25->neighbour->extended) ? X25_EMODULUS : X25_SMODULUS; @@ -295,7 +295,7 @@ case X25_RESET_REQUEST: x25_write_internal(sk, X25_RESET_CONFIRMATION); case X25_RESET_CONFIRMATION: { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); x25_stop_timer(sk); x25->condition = 0x00; @@ -322,7 +322,7 @@ /* Higher level upcall for a LAPB frame */ int x25_process_rx_frame(struct sock *sk, struct sk_buff *skb) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); int queued = 0, frametype, ns, nr, q, d, m; if (x25->state == X25_STATE_0) diff -Nru a/net/x25/x25_out.c b/net/x25/x25_out.c --- a/net/x25/x25_out.c 2005-01-19 23:47:43 -02:00 +++ b/net/x25/x25_out.c 2005-01-19 23:47:43 -02:00 @@ -54,7 +54,7 @@ unsigned char header[X25_EXT_MIN_LEN]; int err, frontlen, len; int sent=0, noblock = X25_SKB_CB(skb)->flags & MSG_DONTWAIT; - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); int header_len = x25->neighbour->extended ? X25_EXT_MIN_LEN : X25_STD_MIN_LEN; int max_len = x25_pacsize_to_bytes(x25->facilities.pacsize_out); @@ -116,7 +116,7 @@ */ static void x25_send_iframe(struct sock *sk, struct sk_buff *skb) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); if (!skb) return; @@ -139,7 +139,7 @@ struct sk_buff *skb, *skbn; unsigned short start, end; int modulus; - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); if (x25->state != X25_STATE_3) return; @@ -212,7 +212,7 @@ void x25_enquiry_response(struct sock *sk) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); if (x25->condition & X25_COND_OWN_RX_BUSY) x25_write_internal(sk, X25_RNR); diff -Nru a/net/x25/x25_proc.c b/net/x25/x25_proc.c --- a/net/x25/x25_proc.c 2005-01-19 23:47:43 -02:00 +++ b/net/x25/x25_proc.c 2005-01-19 23:47:43 -02:00 @@ -134,7 +134,7 @@ static int x25_seq_socket_show(struct seq_file *seq, void *v) { struct sock *s; - struct x25_opt *x25; + struct x25_sock *x25; struct net_device *dev; const char *devname; diff -Nru a/net/x25/x25_subr.c b/net/x25/x25_subr.c --- a/net/x25/x25_subr.c 2005-01-19 23:47:43 -02:00 +++ b/net/x25/x25_subr.c 2005-01-19 23:47:43 -02:00 @@ -33,7 +33,7 @@ */ void x25_clear_queues(struct sock *sk) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); skb_queue_purge(&sk->sk_write_queue); skb_queue_purge(&x25->ack_queue); @@ -51,7 +51,7 @@ void x25_frames_acked(struct sock *sk, unsigned short nr) { struct sk_buff *skb; - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); int modulus = x25->neighbour->extended ? X25_EMODULUS : X25_SMODULUS; /* @@ -89,7 +89,7 @@ */ int x25_validate_nr(struct sock *sk, unsigned short nr) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); unsigned short vc = x25->va; int modulus = x25->neighbour->extended ? X25_EMODULUS : X25_SMODULUS; @@ -108,7 +108,7 @@ */ void x25_write_internal(struct sock *sk, int frametype) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); struct sk_buff *skb; unsigned char *dptr; unsigned char facilities[X25_MAX_FAC_LEN]; @@ -248,7 +248,7 @@ int x25_decode(struct sock *sk, struct sk_buff *skb, int *ns, int *nr, int *q, int *d, int *m) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); unsigned char *frame = skb->data; *ns = *nr = *q = *d = *m = 0; @@ -315,7 +315,7 @@ void x25_disconnect(struct sock *sk, int reason, unsigned char cause, unsigned char diagnostic) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); x25_clear_queues(sk); x25_stop_timer(sk); @@ -342,7 +342,7 @@ */ void x25_check_rbuf(struct sock *sk) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); if (atomic_read(&sk->sk_rmem_alloc) < (sk->sk_rcvbuf / 2) && (x25->condition & X25_COND_OWN_RX_BUSY)) { diff -Nru a/net/x25/x25_timer.c b/net/x25/x25_timer.c --- a/net/x25/x25_timer.c 2005-01-19 23:47:43 -02:00 +++ b/net/x25/x25_timer.c 2005-01-19 23:47:43 -02:00 @@ -31,7 +31,7 @@ void x25_init_timers(struct sock *sk) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); init_timer(&x25->timer); x25->timer.data = (unsigned long)sk; @@ -54,28 +54,28 @@ void x25_start_t2timer(struct sock *sk) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); mod_timer(&x25->timer, jiffies + x25->t2); } void x25_start_t21timer(struct sock *sk) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); mod_timer(&x25->timer, jiffies + x25->t21); } void x25_start_t22timer(struct sock *sk) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); mod_timer(&x25->timer, jiffies + x25->t22); } void x25_start_t23timer(struct sock *sk) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); mod_timer(&x25->timer, jiffies + x25->t23); } @@ -87,7 +87,7 @@ unsigned long x25_display_timer(struct sock *sk) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); if (!timer_pending(&x25->timer)) return 0; @@ -138,7 +138,7 @@ */ static inline void x25_do_timer_expiry(struct sock * sk) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); switch (x25->state) { --------------050703090608090704090009-- From acme@conectiva.com.br Wed Jan 19 18:02:05 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 18:02:11 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K223aS008822 for ; Wed, 19 Jan 2005 18:02:03 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CrQuC-0000AU-00; Wed, 19 Jan 2005 23:14:36 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 7BCAA1462D; Thu, 20 Jan 2005 00:02:01 -0200 (BRST) Message-ID: <41EF11C2.5020900@conectiva.com.br> Date: Thu, 20 Jan 2005 00:04:50 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" Cc: Networking Team Subject: [PATCH 9/9] llc: use sock slab cache X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------070707050508020109050103" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 534 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------070707050508020109050103 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit David, The last one in this series, for LLC. - Arnaldo --------------070707050508020109050103 Content-Type: text/plain; name="llc_sock.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="llc_sock.patch" =================================================================== ChangeSet@1.2345, 2005-01-19 23:07:31-02:00, acme@toy.ghostprotocols.net [LLC] use a private slab cache for socks Required to get rid of sk_protinfo and to introduce struct connection_sock, also for consistency with other protocol families implementations. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller include/net/llc_conn.h | 13 +++++- net/llc/af_llc.c | 40 +++++++++++++++------ net/llc/llc_c_ac.c | 92 ++++++++++++++++++++++++------------------------- net/llc/llc_c_ev.c | 2 - net/llc/llc_conn.c | 50 +++++++++----------------- net/llc/llc_if.c | 4 +- net/llc/llc_proc.c | 8 ++-- net/llc/llc_sap.c | 2 - 8 files changed, 111 insertions(+), 100 deletions(-) diff -Nru a/include/net/llc_conn.h b/include/net/llc_conn.h --- a/include/net/llc_conn.h 2005-01-19 23:52:40 -02:00 +++ b/include/net/llc_conn.h 2005-01-19 23:52:40 -02:00 @@ -13,6 +13,7 @@ */ #include #include +#include #include #define LLC_EVENT 1 @@ -28,8 +29,9 @@ u16 expire; /* timer expire time */ }; -struct llc_opt { - struct sock *sk; /* sock that has this llc_opt */ +struct llc_sock { + /* struct sock must be the first member of llc_sock */ + struct sock sk; struct sockaddr_llc addr; /* address sock is bound to */ u8 state; /* state of connection */ struct llc_sap *sap; /* pointer to parent SAP */ @@ -75,7 +77,12 @@ Used for resending FRMR */ }; -#define llc_sk(__sk) ((struct llc_opt *)(__sk)->sk_protinfo) +static inline struct llc_sock *llc_sk(const struct sock *sk) +{ + return (struct llc_sock *)sk; +} + +extern kmem_cache_t *llc_sk_slab; static __inline__ void llc_set_backlog_type(struct sk_buff *skb, char type) { diff -Nru a/net/llc/af_llc.c b/net/llc/af_llc.c --- a/net/llc/af_llc.c 2005-01-19 23:52:40 -02:00 +++ b/net/llc/af_llc.c 2005-01-19 23:52:40 -02:00 @@ -42,6 +42,8 @@ static int llc_ui_wait_for_data(struct sock *sk, int timeout); static int llc_ui_wait_for_busy_core(struct sock *sk, int timeout); +kmem_cache_t *llc_sk_slab; + #if 0 #define dprintk(args...) printk(KERN_DEBUG args) #else @@ -113,7 +115,7 @@ */ static int llc_ui_send_data(struct sock* sk, struct sk_buff *skb, int noblock) { - struct llc_opt* llc = llc_sk(sk); + struct llc_sock* llc = llc_sk(sk); int rc = 0; if (llc_data_accept_state(llc->state) || llc->p_flag) { @@ -169,7 +171,7 @@ static int llc_ui_release(struct socket *sock) { struct sock *sk = sock->sk; - struct llc_opt *llc; + struct llc_sock *llc; if (!sk) goto out; @@ -244,7 +246,7 @@ static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr) { struct sock *sk = sock->sk; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap; int rc = -EINVAL; @@ -293,7 +295,7 @@ { struct sockaddr_llc *addr = (struct sockaddr_llc *)uaddr; struct sock *sk = sock->sk; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap; int rc = -EINVAL; @@ -394,7 +396,7 @@ int addrlen, int flags) { struct sock *sk = sock->sk; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct sockaddr_llc *addr = (struct sockaddr_llc *)uaddr; struct net_device *dev; int rc = -EINVAL; @@ -571,7 +573,7 @@ static int llc_ui_wait_for_busy_core(struct sock *sk, int timeout) { DECLARE_WAITQUEUE(wait, current); - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); int rc; add_wait_queue_exclusive(sk->sk_sleep, &wait); @@ -612,7 +614,7 @@ static int llc_ui_accept(struct socket *sock, struct socket *newsock, int flags) { struct sock *sk = sock->sk, *newsk; - struct llc_opt *llc, *newllc; + struct llc_sock *llc, *newllc; struct sk_buff *skb; int rc = -EOPNOTSUPP; @@ -728,7 +730,7 @@ struct msghdr *msg, size_t len) { struct sock *sk = sock->sk; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct sockaddr_llc *addr = (struct sockaddr_llc *)msg->msg_name; int flags = msg->msg_flags; int noblock = flags & MSG_DONTWAIT; @@ -819,7 +821,7 @@ { struct sockaddr_llc sllc; struct sock *sk = sock->sk; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); int rc = 0; lock_sock(sk); @@ -883,7 +885,7 @@ char __user *optval, int optlen) { struct sock *sk = sock->sk; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); int rc = -EINVAL, opt; lock_sock(sk); @@ -958,7 +960,7 @@ char __user *optval, int __user *optlen) { struct sock *sk = sock->sk; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); int val = 0, len = 0, rc = -EINVAL; lock_sock(sk); @@ -1032,6 +1034,13 @@ static int __init llc2_init(void) { int rc; + + llc_sk_slab = kmem_cache_create("llc_sock", + sizeof(struct llc_sock), 0, + SLAB_HWCACHE_ALIGN, NULL, NULL); + + if (llc_sk_slab == NULL) + return -ENOMEM; llc_build_offset_table(); llc_station_init(); @@ -1041,7 +1050,11 @@ sock_register(&llc_ui_family_ops); llc_add_pack(LLC_DEST_SAP, llc_sap_handler); llc_add_pack(LLC_DEST_CONN, llc_conn_handler); + } else { + kmem_cache_destroy(llc_sk_slab); + llc_sk_slab = NULL; } + return rc; } @@ -1052,6 +1065,11 @@ llc_remove_pack(LLC_DEST_CONN); sock_unregister(PF_LLC); llc_proc_exit(); + + if (llc_sk_slab != NULL) { + kmem_cache_destroy(llc_sk_slab); + llc_sk_slab = NULL; + } } module_init(llc2_init); diff -Nru a/net/llc/llc_c_ac.c b/net/llc/llc_c_ac.c --- a/net/llc/llc_c_ac.c 2005-01-19 23:52:40 -02:00 +++ b/net/llc/llc_c_ac.c 2005-01-19 23:52:40 -02:00 @@ -44,7 +44,7 @@ int llc_conn_ac_clear_remote_busy(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); if (llc->remote_busy_flag) { u8 nr; @@ -68,7 +68,7 @@ sap = llc_sap_find(dsap); if (sap) { struct llc_conn_state_ev *ev = llc_conn_ev(skb); - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); llc_pdu_decode_sa(skb, llc->daddr.mac); llc_pdu_decode_da(skb, llc->laddr.mac); @@ -146,7 +146,7 @@ int rc = 1; struct llc_conn_state_ev *ev = llc_conn_ev(skb); struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb); - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); switch (ev->type) { case LLC_CONN_EV_TYPE_PDU: @@ -207,7 +207,7 @@ int llc_conn_ac_stop_rej_tmr_if_data_flag_eq_2(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); if (llc->data_flag == 2) del_timer(&llc->rej_sent_timer.timer); @@ -220,7 +220,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; nskb->dev = llc->dev; @@ -246,7 +246,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; u8 f_bit; @@ -273,7 +273,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; u8 f_bit = 1; @@ -299,7 +299,7 @@ int rc = -ENOBUFS; struct sk_buff *nskb; struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb); - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); llc->rx_pdu_hdr = *((u32 *)pdu); if (LLC_PDU_IS_CMD(pdu)) @@ -334,7 +334,7 @@ if (nskb) { u8 f_bit = 0; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)&llc->rx_pdu_hdr; @@ -364,7 +364,7 @@ llc_pdu_decode_pf_bit(skb, &f_bit); nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb); @@ -388,7 +388,7 @@ int llc_conn_ac_send_i_cmd_p_set_1(struct sock *sk, struct sk_buff *skb) { int rc; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; llc_pdu_header_init(skb, LLC_PDU_TYPE_I, sap->laddr.lsap, @@ -405,7 +405,7 @@ static int llc_conn_ac_send_i_cmd_p_set_0(struct sock *sk, struct sk_buff *skb) { int rc; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; llc_pdu_header_init(skb, LLC_PDU_TYPE_I, sap->laddr.lsap, @@ -422,7 +422,7 @@ int llc_conn_ac_send_i_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) { int rc; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; llc_pdu_header_init(skb, LLC_PDU_TYPE_I, sap->laddr.lsap, @@ -454,7 +454,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; nskb->dev = llc->dev; @@ -490,7 +490,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; nskb->dev = llc->dev; @@ -516,7 +516,7 @@ if (nskb) { u8 f_bit = 1; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; nskb->dev = llc->dev; @@ -541,7 +541,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; u8 f_bit = 0; @@ -567,7 +567,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; nskb->dev = llc->dev; @@ -592,7 +592,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; u8 f_bit = 1; @@ -619,7 +619,7 @@ if (nskb) { u8 f_bit = 0; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; nskb->dev = llc->dev; @@ -640,7 +640,7 @@ int llc_conn_ac_set_remote_busy(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); if (!llc->remote_busy_flag) { llc->remote_busy_flag = 1; @@ -656,7 +656,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; nskb->dev = llc->dev; @@ -681,7 +681,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; nskb->dev = llc->dev; @@ -706,7 +706,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; u8 f_bit = 1; @@ -732,7 +732,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; u8 f_bit = 1; @@ -758,7 +758,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; nskb->dev = llc->dev; @@ -783,7 +783,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; nskb->dev = llc->dev; @@ -816,7 +816,7 @@ { int rc = -ENOBUFS; struct sk_buff *nskb = llc_alloc_frame(); - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); if (nskb) { struct llc_sap *sap = llc->sap; @@ -849,7 +849,7 @@ llc_pdu_decode_pf_bit(skb, &f_bit); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; nskb->dev = llc->dev; @@ -882,7 +882,7 @@ int llc_conn_ac_start_p_timer(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); llc_conn_set_p_flag(sk, 1); mod_timer(&llc->pf_cycle_timer.timer, @@ -903,7 +903,7 @@ int llc_conn_ac_send_ack_if_needed(struct sock *sk, struct sk_buff *skb) { u8 pf_bit; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); llc_pdu_decode_pf_bit(skb, &pf_bit); llc->ack_pf |= pf_bit & 1; @@ -950,7 +950,7 @@ struct sk_buff *skb) { int rc; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; llc_pdu_header_init(skb, LLC_PDU_TYPE_I, sap->laddr.lsap, @@ -976,7 +976,7 @@ */ int llc_conn_ac_send_i_as_ack(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); if (llc->ack_must_be_send) { llc_conn_ac_send_i_rsp_f_set_ackpf(sk, skb); @@ -1004,7 +1004,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; nskb->dev = llc->dev; @@ -1035,7 +1035,7 @@ */ static int llc_conn_ac_inc_npta_value(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); if (!llc->inc_cntr) { llc->dec_step = 0; @@ -1058,7 +1058,7 @@ */ int llc_conn_ac_adjust_npta_by_rr(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); if (!llc->connect_step && !llc->remote_busy_flag) { if (!llc->dec_step) { @@ -1084,7 +1084,7 @@ */ int llc_conn_ac_adjust_npta_by_rnr(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); if (llc->remote_busy_flag) if (!llc->dec_step) { @@ -1109,7 +1109,7 @@ */ int llc_conn_ac_dec_tx_win_size(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); u8 unacked_pdu = skb_queue_len(&llc->pdu_unack_q); llc->k -= unacked_pdu; @@ -1128,7 +1128,7 @@ */ int llc_conn_ac_inc_tx_win_size(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); llc->k += 1; if (llc->k > 128) @@ -1138,7 +1138,7 @@ int llc_conn_ac_stop_all_timers(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); del_timer(&llc->pf_cycle_timer.timer); del_timer(&llc->ack_timer.timer); @@ -1151,7 +1151,7 @@ int llc_conn_ac_stop_other_timers(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); del_timer(&llc->rej_sent_timer.timer); del_timer(&llc->pf_cycle_timer.timer); @@ -1163,7 +1163,7 @@ int llc_conn_ac_start_ack_timer(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); mod_timer(&llc->ack_timer.timer, jiffies + llc->ack_timer.expire * HZ); return 0; @@ -1171,7 +1171,7 @@ int llc_conn_ac_start_rej_timer(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); mod_timer(&llc->rej_sent_timer.timer, jiffies + llc->rej_sent_timer.expire * HZ); @@ -1181,7 +1181,7 @@ int llc_conn_ac_start_ack_tmr_if_not_running(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); if (!timer_pending(&llc->ack_timer.timer)) mod_timer(&llc->ack_timer.timer, @@ -1197,7 +1197,7 @@ int llc_conn_ac_stop_p_timer(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); del_timer(&llc->pf_cycle_timer.timer); llc_conn_set_p_flag(sk, 0); @@ -1215,7 +1215,7 @@ int acked; u16 unacked = 0; struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb); - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); llc->last_nr = PDU_SUPV_GET_Nr(pdu); acked = llc_conn_remove_acked_pdus(sk, llc->last_nr, &unacked); diff -Nru a/net/llc/llc_c_ev.c b/net/llc/llc_c_ev.c --- a/net/llc/llc_c_ev.c 2005-01-19 23:52:40 -02:00 +++ b/net/llc/llc_c_ev.c 2005-01-19 23:52:40 -02:00 @@ -78,7 +78,7 @@ u8 nr1, nr2; struct sk_buff *skb; struct llc_pdu_sn *pdu; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); int rc = 0; if (llc->dev->flags & IFF_LOOPBACK) diff -Nru a/net/llc/llc_conn.c b/net/llc/llc_conn.c --- a/net/llc/llc_conn.c 2005-01-19 23:52:40 -02:00 +++ b/net/llc/llc_conn.c 2005-01-19 23:52:40 -02:00 @@ -53,7 +53,7 @@ int llc_conn_state_process(struct sock *sk, struct sk_buff *skb) { int rc; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_conn_state_ev *ev = llc_conn_ev(skb); /* @@ -221,7 +221,7 @@ struct sk_buff *skb; struct llc_pdu_sn *pdu; u16 nbr_unack_pdus; - struct llc_opt *llc; + struct llc_sock *llc; u8 howmany_resend = 0; llc_conn_remove_acked_pdus(sk, nr, &nbr_unack_pdus); @@ -263,7 +263,7 @@ { struct sk_buff *skb; u16 nbr_unack_pdus; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); u8 howmany_resend = 0; llc_conn_remove_acked_pdus(sk, nr, &nbr_unack_pdus); @@ -305,7 +305,7 @@ struct sk_buff *skb; struct llc_pdu_sn *pdu; int nbr_acked = 0; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); int q_len = skb_queue_len(&llc->pdu_unack_q); if (!q_len) @@ -366,7 +366,7 @@ static int llc_conn_service(struct sock *sk, struct sk_buff *skb) { int rc = 1; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_conn_state_trans *trans; if (llc->state > NBR_CONN_STATES) @@ -399,7 +399,7 @@ struct llc_conn_state_trans **next_trans; llc_conn_ev_qfyr_t *next_qualifier; struct llc_conn_state_ev *ev = llc_conn_ev(skb); - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_conn_state *curr_state = &llc_conn_state_table[llc->state - 1]; @@ -478,7 +478,7 @@ read_lock_bh(&sap->sk_list.lock); sk_for_each(rc, node, &sap->sk_list.list) { - struct llc_opt *llc = llc_sk(rc); + struct llc_sock *llc = llc_sk(rc); if (llc->laddr.lsap == laddr->lsap && llc->daddr.lsap == daddr->lsap && @@ -511,7 +511,7 @@ read_lock_bh(&sap->sk_list.lock); sk_for_each(rc, node, &sap->sk_list.list) { - struct llc_opt *llc = llc_sk(rc); + struct llc_sock *llc = llc_sk(rc); if (rc->sk_type == SOCK_STREAM && rc->sk_state == TCP_LISTEN && llc->laddr.lsap == laddr->lsap && @@ -650,7 +650,7 @@ static int llc_conn_rcv(struct sock* sk, struct sk_buff *skb) { struct llc_conn_state_ev *ev = llc_conn_ev(skb); - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); if (!llc->dev) llc->dev = skb->dev; @@ -675,7 +675,7 @@ * Didn't find an active connection; verify if there * is a listening socket for this llc addr */ - struct llc_opt *llc; + struct llc_sock *llc; struct sock *parent = llc_lookup_listener(sap, &daddr); if (!parent) { @@ -756,7 +756,7 @@ static int llc_backlog_rcv(struct sock *sk, struct sk_buff *skb) { int rc = 0; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); if (llc_backlog_type(skb) == LLC_PACKET) { if (llc->state > 1) /* not closed */ @@ -786,17 +786,10 @@ * * Initializes a socket with default llc values. */ -static int llc_sk_init(struct sock* sk) +static void llc_sk_init(struct sock* sk) { - struct llc_opt *llc = kmalloc(sizeof(*llc), GFP_ATOMIC); - int rc = -ENOMEM; + struct llc_sock *llc = llc_sk(sk); - if (!llc) - goto out; - memset(llc, 0, sizeof(*llc)); - rc = 0; - - llc->sk = sk; llc->state = LLC_CONN_STATE_ADM; llc->inc_cntr = llc->dec_cntr = 2; llc->dec_step = llc->connect_step = 1; @@ -827,9 +820,6 @@ * tx_win of remote LLC) */ skb_queue_head_init(&llc->pdu_unack_q); sk->sk_backlog_rcv = llc_backlog_rcv; - sk->sk_protinfo = llc; -out: - return rc; } /** @@ -842,12 +832,12 @@ */ struct sock *llc_sk_alloc(int family, int priority) { - struct sock *sk = sk_alloc(family, priority, 1, NULL); + struct sock *sk = sk_alloc(family, priority, + sizeof(struct llc_sock), llc_sk_slab); if (!sk) goto out; - if (llc_sk_init(sk)) - goto outsk; + llc_sk_init(sk); sock_init_data(NULL, sk); sk_set_owner(sk, THIS_MODULE); #ifdef LLC_REFCNT_DEBUG @@ -857,10 +847,6 @@ #endif out: return sk; -outsk: - sk_free(sk); - sk = NULL; - goto out; } /** @@ -871,7 +857,7 @@ */ void llc_sk_free(struct sock *sk) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); llc->state = LLC_CONN_OUT_OF_SVC; /* Stop all (possibly) running timers */ @@ -908,7 +894,7 @@ */ void llc_sk_reset(struct sock *sk) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); llc_conn_ac_stop_all_timers(sk, NULL); skb_queue_purge(&sk->sk_write_queue); diff -Nru a/net/llc/llc_if.c b/net/llc/llc_if.c --- a/net/llc/llc_if.c 2005-01-19 23:52:40 -02:00 +++ b/net/llc/llc_if.c 2005-01-19 23:52:40 -02:00 @@ -45,7 +45,7 @@ { struct llc_conn_state_ev *ev; int rc = -ECONNABORTED; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); if (llc->state == LLC_CONN_STATE_ADM) goto out; @@ -86,7 +86,7 @@ int rc = -EISCONN; struct llc_addr laddr, daddr; struct sk_buff *skb; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct sock *existing; laddr.lsap = llc->sap->laddr.lsap; diff -Nru a/net/llc/llc_proc.c b/net/llc/llc_proc.c --- a/net/llc/llc_proc.c 2005-01-19 23:52:40 -02:00 +++ b/net/llc/llc_proc.c 2005-01-19 23:52:40 -02:00 @@ -65,7 +65,7 @@ static void *llc_seq_next(struct seq_file *seq, void *v, loff_t *pos) { struct sock* sk, *next; - struct llc_opt *llc; + struct llc_sock *llc; struct llc_sap *sap; ++*pos; @@ -102,7 +102,7 @@ { if (v && v != SEQ_START_TOKEN) { struct sock *sk = v; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; read_unlock_bh(&sap->sk_list.lock); @@ -113,7 +113,7 @@ static int llc_seq_socket_show(struct seq_file *seq, void *v) { struct sock* sk; - struct llc_opt *llc; + struct llc_sock *llc; if (v == SEQ_START_TOKEN) { seq_puts(seq, "SKt Mc local_mac_sap remote_mac_sap " @@ -160,7 +160,7 @@ static int llc_seq_core_show(struct seq_file *seq, void *v) { struct sock* sk; - struct llc_opt *llc; + struct llc_sock *llc; if (v == SEQ_START_TOKEN) { seq_puts(seq, "Connection list:\n" diff -Nru a/net/llc/llc_sap.c b/net/llc/llc_sap.c --- a/net/llc/llc_sap.c 2005-01-19 23:52:40 -02:00 +++ b/net/llc/llc_sap.c 2005-01-19 23:52:40 -02:00 @@ -283,7 +283,7 @@ read_lock_bh(&sap->sk_list.lock); sk_for_each(rc, node, &sap->sk_list.list) { - struct llc_opt *llc = llc_sk(rc); + struct llc_sock *llc = llc_sk(rc); if (rc->sk_type == SOCK_DGRAM && llc->laddr.lsap == laddr->lsap && --------------070707050508020109050103-- From acme@conectiva.com.br Wed Jan 19 18:01:32 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 18:01:37 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K21VRe008560 for ; Wed, 19 Jan 2005 18:01:32 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CrQtg-0000A0-00; Wed, 19 Jan 2005 23:14:04 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 9FB101462D; Thu, 20 Jan 2005 00:01:29 -0200 (BRST) Message-ID: <41EF11A2.1010009@conectiva.com.br> Date: Thu, 20 Jan 2005 00:04:18 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" , Philip Blundell Cc: Networking Team Subject: [PATCH 4/9] econet: use sock slab cache X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------080204050504020308020602" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 529 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------080204050504020308020602 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit David, See log in the patch. Regards, - Arnaldo --------------080204050504020308020602 Content-Type: text/plain; name="econet_sock.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="econet_sock.patch" =================================================================== ChangeSet@1.2340, 2005-01-19 23:03:32-02:00, acme@toy.ghostprotocols.net [ECONET] use a private slab cache for socks Required to get rid of sk_protinfo and to introduce struct connection_sock, also for consistency with other protocol families implementations. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller include/linux/if_ec.h | 10 +++++++--- net/econet/af_econet.c | 35 ++++++++++++++++++++++------------- 2 files changed, 29 insertions(+), 16 deletions(-) diff -Nru a/include/linux/if_ec.h b/include/linux/if_ec.h --- a/include/linux/if_ec.h 2005-01-19 23:37:25 -02:00 +++ b/include/linux/if_ec.h 2005-01-19 23:37:25 -02:00 @@ -47,8 +47,9 @@ unsigned char port; }; -struct econet_opt -{ +struct econet_sock { + /* struct sock has to be the first member of econet_sock */ + struct sock sk; unsigned char cb; unsigned char port; unsigned char station; @@ -56,7 +57,10 @@ unsigned short num; }; -#define ec_sk(__sk) ((struct econet_opt *)(__sk)->sk_protinfo) +static inline struct econet_sock *ec_sk(const struct sock *sk) +{ + return (struct econet_sock *)sk; +} struct ec_device { diff -Nru a/net/econet/af_econet.c b/net/econet/af_econet.c --- a/net/econet/af_econet.c 2005-01-19 23:37:25 -02:00 +++ b/net/econet/af_econet.c 2005-01-19 23:37:25 -02:00 @@ -49,6 +49,8 @@ static struct hlist_head econet_sklist; static DEFINE_RWLOCK(econet_lock); +static kmem_cache_t *econet_sk_slab; + /* Since there are only 256 possible network numbers (or fewer, depends how you count) it makes sense to use a simple lookup table. */ static struct net_device *net2dev_map[256]; @@ -184,7 +186,7 @@ { struct sockaddr_ec *sec = (struct sockaddr_ec *)uaddr; struct sock *sk=sock->sk; - struct econet_opt *eo = ec_sk(sk); + struct econet_sock *eo = ec_sk(sk); /* * Check legality @@ -284,7 +286,7 @@ */ if (saddr == NULL) { - struct econet_opt *eo = ec_sk(sk); + struct econet_sock *eo = ec_sk(sk); addr.station = eo->station; addr.net = eo->net; @@ -485,7 +487,7 @@ int *uaddr_len, int peer) { struct sock *sk = sock->sk; - struct econet_opt *eo = ec_sk(sk); + struct econet_sock *eo = ec_sk(sk); struct sockaddr_ec *sec = (struct sockaddr_ec *)uaddr; if (peer) @@ -562,7 +564,7 @@ static int econet_create(struct socket *sock, int protocol) { struct sock *sk; - struct econet_opt *eo; + struct econet_sock *eo; int err; /* Econet only provides datagram services. */ @@ -572,7 +574,8 @@ sock->state = SS_UNCONNECTED; err = -ENOBUFS; - sk = sk_alloc(PF_ECONET, GFP_KERNEL, 1, NULL); + sk = sk_alloc(PF_ECONET, GFP_KERNEL, + sizeof(struct econet_sock), econet_sk_slab); if (sk == NULL) goto out; @@ -581,19 +584,13 @@ sock_init_data(sock,sk); sk_set_owner(sk, THIS_MODULE); - eo = sk->sk_protinfo = kmalloc(sizeof(*eo), GFP_KERNEL); - if (!eo) - goto out_free; - memset(eo, 0, sizeof(*eo)); + eo = ec_sk(sk); sk->sk_zapped = 0; sk->sk_family = PF_ECONET; eo->num = protocol; econet_insert_socket(&econet_sklist, sk); return(0); - -out_free: - sk_free(sk); out: return err; } @@ -735,7 +732,7 @@ struct hlist_node *node; sk_for_each(sk, node, &econet_sklist) { - struct econet_opt *opt = ec_sk(sk); + struct econet_sock *opt = ec_sk(sk); if ((opt->port == port || opt->port == 0) && (opt->station == station || opt->station == 0) && (opt->net == net || opt->net == 0)) @@ -1101,10 +1098,22 @@ #endif unregister_netdevice_notifier(&econet_netdev_notifier); sock_unregister(econet_family_ops.family); + + if (econet_sk_slab != NULL) { + kmem_cache_destroy(econet_sk_slab); + econet_sk_slab = NULL; + } } static int __init econet_proto_init(void) { + econet_sk_slab = kmem_cache_create("econet_sock", + sizeof(struct econet_sock), 0, + SLAB_HWCACHE_ALIGN, NULL, NULL); + + if (econet_sk_slab == NULL) + return -ENOMEM; + sock_register(&econet_family_ops); #ifdef CONFIG_ECONET_AUNUDP spin_lock_init(&aun_queue_lock); --------------080204050504020308020602-- From acme@conectiva.com.br Wed Jan 19 18:01:38 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 18:01:43 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K21bWT008626 for ; Wed, 19 Jan 2005 18:01:38 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CrQtm-0000A6-00; Wed, 19 Jan 2005 23:14:10 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id F24731462D; Thu, 20 Jan 2005 00:01:35 -0200 (BRST) Message-ID: <41EF11A9.3030104@conectiva.com.br> Date: Thu, 20 Jan 2005 00:04:25 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" Cc: Networking Team Subject: [PATCH 5/9] netlink: use sock slab cache X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------040604040408030709030001" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 530 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------040604040408030709030001 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit David, The netlink one. - Arnaldo --------------040604040408030709030001 Content-Type: text/plain; name="netlink_sock.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="netlink_sock.patch" =================================================================== ChangeSet@1.2341, 2005-01-19 23:04:10-02:00, acme@toy.ghostprotocols.net [NETLINK] use a private slab cache for socks Required to get rid of sk_protinfo and to introduce struct connection_sock, also for consistency with other protocol families implementations. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller af_netlink.c | 82 ++++++++++++++++++++++++++++++++++------------------------- 1 files changed, 48 insertions(+), 34 deletions(-) diff -Nru a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c --- a/net/netlink/af_netlink.c 2005-01-19 23:40:04 -02:00 +++ b/net/netlink/af_netlink.c 2005-01-19 23:40:04 -02:00 @@ -59,8 +59,9 @@ #define NL_EMULATE_DEV #endif -struct netlink_opt -{ +struct netlink_sock { + /* struct sock has to be the first member of netlink_sock */ + struct sock sk; u32 pid; unsigned int groups; u32 dst_pid; @@ -73,7 +74,12 @@ void (*data_ready)(struct sock *sk, int bytes); }; -#define nlk_sk(__sk) ((struct netlink_opt *)(__sk)->sk_protinfo) +static inline struct netlink_sock *nlk_sk(struct sock *sk) +{ + return (struct netlink_sock *)sk; +} + +static kmem_cache_t *netlink_sk_slab; struct nl_pid_hash { struct hlist_head *table; @@ -122,8 +128,6 @@ BUG_TRAP(!atomic_read(&sk->sk_rmem_alloc)); BUG_TRAP(!atomic_read(&sk->sk_wmem_alloc)); BUG_TRAP(!nlk_sk(sk)->cb); - - kfree(nlk_sk(sk)); } /* This lock without WQ_FLAG_EXCLUSIVE is good on UP and it is _very_ bad on SMP. @@ -327,7 +331,7 @@ static int netlink_create(struct socket *sock, int protocol) { struct sock *sk; - struct netlink_opt *nlk; + struct netlink_sock *nlk; sock->state = SS_UNCONNECTED; @@ -339,19 +343,15 @@ sock->ops = &netlink_ops; - sk = sk_alloc(PF_NETLINK, GFP_KERNEL, 1, NULL); + sk = sk_alloc(PF_NETLINK, GFP_KERNEL, + sizeof(struct netlink_sock), netlink_sk_slab); if (!sk) return -ENOMEM; sock_init_data(sock,sk); sk_set_owner(sk, THIS_MODULE); - nlk = sk->sk_protinfo = kmalloc(sizeof(*nlk), GFP_KERNEL); - if (!nlk) { - sk_free(sk); - return -ENOMEM; - } - memset(nlk, 0, sizeof(*nlk)); + nlk = nlk_sk(sk); spin_lock_init(&nlk->cb_lock); init_waitqueue_head(&nlk->wait); @@ -364,7 +364,7 @@ static int netlink_release(struct socket *sock) { struct sock *sk = sock->sk; - struct netlink_opt *nlk; + struct netlink_sock *nlk; if (!sk) return 0; @@ -445,7 +445,7 @@ static int netlink_bind(struct socket *sock, struct sockaddr *addr, int addr_len) { struct sock *sk = sock->sk; - struct netlink_opt *nlk = nlk_sk(sk); + struct netlink_sock *nlk = nlk_sk(sk); struct sockaddr_nl *nladdr = (struct sockaddr_nl *)addr; int err; @@ -486,7 +486,7 @@ { int err = 0; struct sock *sk = sock->sk; - struct netlink_opt *nlk = nlk_sk(sk); + struct netlink_sock *nlk = nlk_sk(sk); struct sockaddr_nl *nladdr=(struct sockaddr_nl*)addr; if (addr->sa_family == AF_UNSPEC) { @@ -517,7 +517,7 @@ static int netlink_getname(struct socket *sock, struct sockaddr *addr, int *addr_len, int peer) { struct sock *sk = sock->sk; - struct netlink_opt *nlk = nlk_sk(sk); + struct netlink_sock *nlk = nlk_sk(sk); struct sockaddr_nl *nladdr=(struct sockaddr_nl *)addr; nladdr->nl_family = AF_NETLINK; @@ -546,7 +546,7 @@ { int protocol = ssk->sk_protocol; struct sock *sock; - struct netlink_opt *nlk; + struct netlink_sock *nlk; sock = netlink_lookup(protocol, pid); if (!sock) @@ -592,7 +592,7 @@ */ int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, long timeo) { - struct netlink_opt *nlk; + struct netlink_sock *nlk; nlk = nlk_sk(sk); @@ -636,7 +636,7 @@ int netlink_sendskb(struct sock *sk, struct sk_buff *skb, int protocol) { - struct netlink_opt *nlk; + struct netlink_sock *nlk; int len = skb->len; nlk = nlk_sk(sk); @@ -704,7 +704,7 @@ static __inline__ int netlink_broadcast_deliver(struct sock *sk, struct sk_buff *skb) { - struct netlink_opt *nlk = nlk_sk(sk); + struct netlink_sock *nlk = nlk_sk(sk); #ifdef NL_EMULATE_DEV if (nlk->handler) { skb_orphan(skb); @@ -737,7 +737,7 @@ static inline int do_one_broadcast(struct sock *sk, struct netlink_broadcast_data *p) { - struct netlink_opt *nlk = nlk_sk(sk); + struct netlink_sock *nlk = nlk_sk(sk); int val; if (p->exclude_sk == sk) @@ -829,7 +829,7 @@ static inline int do_one_set_err(struct sock *sk, struct netlink_set_err_data *p) { - struct netlink_opt *nlk = nlk_sk(sk); + struct netlink_sock *nlk = nlk_sk(sk); if (sk == p->exclude_sk) goto out; @@ -864,7 +864,7 @@ static inline void netlink_rcv_wake(struct sock *sk) { - struct netlink_opt *nlk = nlk_sk(sk); + struct netlink_sock *nlk = nlk_sk(sk); if (!skb_queue_len(&sk->sk_receive_queue)) clear_bit(0, &nlk->state); @@ -877,7 +877,7 @@ { struct sock_iocb *siocb = kiocb_to_siocb(kiocb); struct sock *sk = sock->sk; - struct netlink_opt *nlk = nlk_sk(sk); + struct netlink_sock *nlk = nlk_sk(sk); struct sockaddr_nl *addr=msg->msg_name; u32 dst_pid; u32 dst_groups; @@ -961,7 +961,7 @@ struct sock_iocb *siocb = kiocb_to_siocb(kiocb); struct scm_cookie scm; struct sock *sk = sock->sk; - struct netlink_opt *nlk = nlk_sk(sk); + struct netlink_sock *nlk = nlk_sk(sk); int noblock = flags&MSG_DONTWAIT; size_t copied; struct sk_buff *skb; @@ -1015,7 +1015,7 @@ static void netlink_data_ready(struct sock *sk, int len) { - struct netlink_opt *nlk = nlk_sk(sk); + struct netlink_sock *nlk = nlk_sk(sk); if (nlk->data_ready) nlk->data_ready(sk, len); @@ -1079,7 +1079,7 @@ static int netlink_dump(struct sock *sk) { - struct netlink_opt *nlk = nlk_sk(sk); + struct netlink_sock *nlk = nlk_sk(sk); struct netlink_callback *cb; struct sk_buff *skb; struct nlmsghdr *nlh; @@ -1129,7 +1129,7 @@ { struct netlink_callback *cb; struct sock *sk; - struct netlink_opt *nlk; + struct netlink_sock *nlk; cb = kmalloc(sizeof(*cb), GFP_KERNEL); if (cb == NULL) @@ -1286,7 +1286,7 @@ "Rmem Wmem Dump Locks\n"); else { struct sock *s = v; - struct netlink_opt *nlk = nlk_sk(s); + struct netlink_sock *nlk = nlk_sk(s); seq_printf(seq, "%p %-3d %-6d %08x %-8d %-8d %p %d\n", s, @@ -1392,9 +1392,18 @@ if (sizeof(struct netlink_skb_parms) > sizeof(dummy_skb->cb)) netlink_skb_parms_too_large(); + netlink_sk_slab = kmem_cache_create("netlink_sock", + sizeof(struct netlink_sock), 0, + SLAB_HWCACHE_ALIGN, NULL, NULL); + + if (netlink_sk_slab == NULL) + return -ENOMEM; + nl_table = kmalloc(sizeof(*nl_table) * MAX_LINKS, GFP_KERNEL); if (!nl_table) { enomem: + kmem_cache_destroy(netlink_sk_slab); + netlink_sk_slab = NULL; printk(KERN_CRIT "netlink_init: Cannot allocate nl_table\n"); return -ENOMEM; } @@ -1439,10 +1448,15 @@ static void __exit netlink_proto_exit(void) { - sock_unregister(PF_NETLINK); - proc_net_remove("netlink"); - kfree(nl_table); - nl_table = NULL; + sock_unregister(PF_NETLINK); + proc_net_remove("netlink"); + kfree(nl_table); + nl_table = NULL; + + if (netlink_sk_slab != NULL) { + kmem_cache_destroy(netlink_sk_slab); + netlink_sk_slab = NULL; + } } core_initcall(netlink_proto_init); --------------040604040408030709030001-- From acme@conectiva.com.br Wed Jan 19 18:01:45 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 18:01:49 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K21iDa008674 for ; Wed, 19 Jan 2005 18:01:44 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CrQts-0000AB-00; Wed, 19 Jan 2005 23:14:16 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 130261462D; Thu, 20 Jan 2005 00:01:42 -0200 (BRST) Message-ID: <41EF11AF.70203@conectiva.com.br> Date: Thu, 20 Jan 2005 00:04:31 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" , Jean Tourrilhes Cc: irda-users@lists.sourceforge.net, Networking Team Subject: [PATCH 6/9] irda: use sock slab cache X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------000202030007010503090107" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 531 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------000202030007010503090107 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David, Jean, Please read the log in the patch. Regards, - Arnaldo --------------000202030007010503090107 Content-Type: text/plain; name="irda_sock.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="irda_sock.patch" =================================================================== ChangeSet@1.2342, 2005-01-19 23:04:52-02:00, acme@toy.ghostprotocols.net [IRDA] use a private slab cache for socks Required to get rid of sk_protinfo and to introduce struct connection_sock, also for consistency with other protocol families implementations. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller include/net/irda/af_irda.h | 9 ++++++- net/irda/af_irda.c | 52 +++++++++++++++++++++++---------------------- 2 files changed, 34 insertions(+), 27 deletions(-) diff -Nru a/include/net/irda/af_irda.h b/include/net/irda/af_irda.h --- a/include/net/irda/af_irda.h 2005-01-19 23:43:00 -02:00 +++ b/include/net/irda/af_irda.h 2005-01-19 23:43:00 -02:00 @@ -33,9 +33,12 @@ #include /* struct lsap_cb */ #include /* struct tsap_cb */ #include /* struct discovery_t */ +#include /* IrDA Socket */ struct irda_sock { + /* struct sock has to be the first member of irda_sock */ + struct sock sk; __u32 saddr; /* my local address */ __u32 daddr; /* peer address */ @@ -69,7 +72,6 @@ int errno; /* status of the IAS query */ - struct sock *sk; wait_queue_head_t query_wait; /* Wait for the answer to a query */ struct timer_list watchdog; /* Timeout for discovery */ @@ -77,6 +79,9 @@ LOCAL_FLOW rx_flow; }; -#define irda_sk(__sk) ((struct irda_sock *)(__sk)->sk_protinfo) +static inline struct irda_sock *irda_sk(struct sock *sk) +{ + return (struct irda_sock *)sk; +} #endif /* AF_IRDA_H */ diff -Nru a/net/irda/af_irda.c b/net/irda/af_irda.c --- a/net/irda/af_irda.c 2005-01-19 23:43:00 -02:00 +++ b/net/irda/af_irda.c 2005-01-19 23:43:00 -02:00 @@ -60,6 +60,8 @@ #include +static kmem_cache_t *irda_sk_slab; + static int irda_create(struct socket *sock, int protocol); static struct proto_ops irda_stream_ops; @@ -87,10 +89,10 @@ IRDA_DEBUG(3, "%s()\n", __FUNCTION__); - self = (struct irda_sock *) instance; + self = instance; ASSERT(self != NULL, return -1;); - sk = self->sk; + sk = instance; ASSERT(sk != NULL, return -1;); err = sock_queue_rcv_skb(sk, skb); @@ -117,7 +119,7 @@ struct irda_sock *self; struct sock *sk; - self = (struct irda_sock *) instance; + self = instance; IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self); @@ -125,7 +127,7 @@ if(skb) dev_kfree_skb(skb); - sk = self->sk; + sk = instance; if (sk == NULL) { IRDA_DEBUG(0, "%s(%p) : BUG : sk is NULL\n", __FUNCTION__, self); @@ -183,11 +185,11 @@ struct irda_sock *self; struct sock *sk; - self = (struct irda_sock *) instance; + self = instance; IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self); - sk = self->sk; + sk = instance; if (sk == NULL) { dev_kfree_skb(skb); return; @@ -245,11 +247,11 @@ struct irda_sock *self; struct sock *sk; - self = (struct irda_sock *) instance; + self = instance; IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self); - sk = self->sk; + sk = instance; if (sk == NULL) { dev_kfree_skb(skb); return; @@ -332,10 +334,10 @@ IRDA_DEBUG(2, "%s()\n", __FUNCTION__); - self = (struct irda_sock *) instance; + self = instance; ASSERT(self != NULL, return;); - sk = self->sk; + sk = instance; ASSERT(sk != NULL, return;); switch (flow) { @@ -1082,17 +1084,12 @@ } /* Allocate networking socket */ - if ((sk = sk_alloc(PF_IRDA, GFP_ATOMIC, 1, NULL)) == NULL) + sk = sk_alloc(PF_IRDA, GFP_ATOMIC, + sizeof(struct irda_sock), irda_sk_slab); + if (sk == NULL) return -ENOMEM; - /* Allocate IrDA socket */ - self = sk->sk_protinfo = kmalloc(sizeof(struct irda_sock), GFP_ATOMIC); - if (self == NULL) { - sk_free(sk); - return -ENOMEM; - } - memset(self, 0, sizeof(struct irda_sock)); - + self = irda_sk(sk); IRDA_DEBUG(2, "%s() : self is %p\n", __FUNCTION__, self); init_waitqueue_head(&self->query_wait); @@ -1102,8 +1099,6 @@ sk_set_owner(sk, THIS_MODULE); sk->sk_family = PF_IRDA; sk->sk_protocol = protocol; - /* Link networking socket and IrDA socket structs together */ - self->sk = sk; switch (sock->type) { case SOCK_STREAM: @@ -1187,7 +1182,6 @@ self->lsap = NULL; } #endif /* CONFIG_IRDA_ULTRA */ - kfree(self); } /* @@ -1208,8 +1202,6 @@ /* Destroy IrDA socket */ irda_destroy_socket(irda_sk(sk)); - /* Prevent sock_def_destruct() to create havoc */ - sk->sk_protinfo = NULL; sock_orphan(sk); sock->sk = NULL; @@ -2557,6 +2549,13 @@ */ int __init irsock_init(void) { + irda_sk_slab = kmem_cache_create("irda_sock", + sizeof(struct irda_sock), 0, + SLAB_HWCACHE_ALIGN, NULL, NULL); + + if (irda_sk_slab == NULL) + return -ENOMEM; + sock_register(&irda_family_ops); return 0; @@ -2572,5 +2571,8 @@ { sock_unregister(PF_IRDA); - return; + if (irda_sk_slab != NULL) { + kmem_cache_destroy(irda_sk_slab); + irda_sk_slab = NULL; + } } --------------000202030007010503090107-- From jt@hpl.hp.com Wed Jan 19 18:16:14 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 18:16:18 -0800 (PST) Received: from palrel12.hp.com (palrel12.hp.com [156.153.255.237]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K2GD7G013405 for ; Wed, 19 Jan 2005 18:16:14 -0800 Received: from tomil.hpl.hp.com (tomil.hpl.hp.com [15.0.152.100]) by palrel12.hp.com (Postfix) with ESMTP id 53476420814; Wed, 19 Jan 2005 18:16:07 -0800 (PST) Received: from bougret.hpl.hp.com (bougret.hpl.hp.com [15.4.92.227]) by tomil.hpl.hp.com (8.9.3 (PHNE_29774)/8.9.3 HPLabs Timeshare Server) with ESMTP id SAA26832; Wed, 19 Jan 2005 18:17:49 -0800 (PST) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 1CrRrj-0002vP-00; Wed, 19 Jan 2005 18:16:07 -0800 Date: Wed, 19 Jan 2005 18:16:07 -0800 To: Arnaldo Carvalho de Melo Cc: "David S. Miller" , irda-users@lists.sourceforge.net, netdev@oss.sgi.com, Stephen Hemminger Subject: Re: [PATCH 6/9] irda: use sock slab cache Message-ID: <20050120021607.GA11216@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com References: <41EF11AF.70203@conectiva.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41EF11AF.70203@conectiva.com.br> User-Agent: Mutt/1.3.28i Organisation: HP Labs Palo Alto Address: HP Labs, 1U-17, 1501 Page Mill road, Palo Alto, CA 94304, USA. E-mail: jt@hpl.hp.com From: Jean Tourrilhes X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 535 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jt@hpl.hp.com Precedence: bulk X-list: netdev On Thu, Jan 20, 2005 at 12:04:31AM -0200, Arnaldo Carvalho de Melo wrote: > Hi David, Jean, > > Please read the log in the patch. > > Regards, > > - Arnaldo > > =================================================================== > > > ChangeSet@1.2342, 2005-01-19 23:04:52-02:00, acme@toy.ghostprotocols.net > [IRDA] use a private slab cache for socks > > Required to get rid of sk_protinfo and to introduce struct connection_sock, > also for consistency with other protocol families implementations. I don't have anything against this patch, as it looks clean and straightforward. Stephen might have something to say. I'm way behind, so it may take a while before I test that. I'm just curious about the overhead of adding a specific slab for IrDA sockets. Most users never create any (using IrCOMM), or maximum one (using Obex), so it's not like it will get a lot of use (except here, of course). Thanks, and have fun... Jean From ak@suse.de Wed Jan 19 19:14:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 19:14:46 -0800 (PST) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K3EfG1015752 for ; Wed, 19 Jan 2005 19:14:42 -0800 Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 537E713706D9; Thu, 20 Jan 2005 04:14:35 +0100 (CET) Date: Thu, 20 Jan 2005 04:14:23 +0100 From: Andi Kleen To: "David S. Miller" Cc: Stephen Hemminger , hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, roland@topspin.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [PATCH]: was Re: LLTX and netif_stop_queue Message-ID: <20050120031423.GC30088@wotan.suse.de> References: <1104764660.1048.578.camel@jzny.localdomain> <52brc68q05.fsf@topspin.com> <5cac192f05010308414a25b548@mail.gmail.com> <527jmu8nbw.fsf@topspin.com> <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119164640.6c67bdfa.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050119164640.6c67bdfa.davem@davemloft.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 536 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@suse.de Precedence: bulk X-list: netdev On Wed, Jan 19, 2005 at 04:46:40PM -0800, David S. Miller wrote: > Ok, here is what something like this might look like. > > In summary: > > 1) dev->xmit_lock is now IRQ disabling instead of BH disabling > 2) Drivers can use dev->xmit_lock in place of their private > driver_priv->tx_lock and this is effectively the same gain > LLTX gave drivers sans the race condition which started this > thread. > 3) NETDEV_TX_LOCKED is gone > 4) LLTX stays, but this means that the driver's TX routine is > %100 lockless. It is only to be used by loopback and other > queueless software devices such as tunnels. Looks good to me and much cleaner than what I initially did. Thanks. -Andi From roland@topspin.com Wed Jan 19 19:43:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 19:43:52 -0800 (PST) Received: from umhlanga.STRATNET.NET (umhlanga.stratnet.net [12.162.17.40]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K3hjVj017140 for ; Wed, 19 Jan 2005 19:43:47 -0800 Received: from exch-1.topspincom.com ([12.162.17.3]) by umhlanga.STRATNET.NET with Microsoft SMTPSVC(5.0.2195.5329); Wed, 19 Jan 2005 19:43:43 -0800 Received: from localhost.localdomain ([10.10.253.169]) by exch-1.topspincom.com with Microsoft SMTPSVC(5.0.2195.5329); Wed, 19 Jan 2005 19:43:43 -0800 Received: by localhost.localdomain (Postfix, from userid 1113) id DDEB4221AF; Wed, 19 Jan 2005 19:43:42 -0800 (PST) To: "David S. Miller" Cc: Stephen Hemminger , hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [PATCH]: was Re: LLTX and netif_stop_queue X-Message-Flag: Warning: May contain useful information References: <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> <5cac192f0501021530672a908a@mail.gmail.com> <1104764660.1048.578.camel@jzny.localdomain> <52brc68q05.fsf@topspin.com> <5cac192f05010308414a25b548@mail.gmail.com> <527jmu8nbw.fsf@topspin.com> <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119164640.6c67bdfa.davem@davemloft.net> From: Roland Dreier Date: Wed, 19 Jan 2005 19:43:42 -0800 In-Reply-To: <20050119164640.6c67bdfa.davem@davemloft.net> (David S. Miller's message of "Wed, 19 Jan 2005 16:46:40 -0800") Message-ID: <52r7kgu5n5.fsf@topspin.com> User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Corporate Culture, linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-OriginalArrivalTime: 20 Jan 2005 03:43:43.0070 (UTC) FILETIME=[3CC1AFE0:01C4FEA2] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 537 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: roland@topspin.com Precedence: bulk X-list: netdev Looks reasonable to me. I'll try the IPoIB changes out to make sure it still works. Thanks, Roland From acme@conectiva.com.br Wed Jan 19 19:44:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 19:44:31 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K3iPa4017310 for ; Wed, 19 Jan 2005 19:44:25 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CrSVD-0000CI-00; Thu, 20 Jan 2005 00:56:55 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 6A6171462D; Thu, 20 Jan 2005 01:44:20 -0200 (BRST) Message-ID: <41EF29BE.2020807@conectiva.com.br> Date: Thu, 20 Jan 2005 01:47:10 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: jt@hpl.hp.com Cc: "David S. Miller" , irda-users@lists.sourceforge.net, netdev@oss.sgi.com, Stephen Hemminger Subject: Re: [PATCH 6/9] irda: use sock slab cache References: <41EF11AF.70203@conectiva.com.br> <20050120021607.GA11216@bougret.hpl.hp.com> In-Reply-To: <20050120021607.GA11216@bougret.hpl.hp.com> X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 538 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Jean Tourrilhes escreveu: > I'm just curious about the overhead of adding a specific slab > for IrDA sockets. Most users never create any (using IrCOMM), or > maximum one (using Obex), so it's not like it will get a lot of use > (except here, of course). Well, lets start with something that may sound funny: when this series of patches is finished the overhead will _decrease_ for most people. Why? Today we have in most machines five slab caches of this nature: udp_sock, raw_sock, tcp_sock, unix_sock (PF_LOCAL) and the generic, sock, that only is used by the protocols that are using kmalloc(pritave_sock) + sk_protinfo. When all protos use private slab caches, the generic slab "sock" is no longer needed. So most users will have only the udp, raw, tcp and unix slabs, if they require another family, say AF_IRDA, they are back to the previous situation, with 5 sock slabs, only when users need two or more extra slabs we get some overhead wrt the previous situation, but this is compensated by likely performance gains associated with less cacheline trashing, as noticed when I first introduced sock slabs, with all the protos converted at that time, i.e. the 4 most common mentioned above. And not having two ways to allocate the private area for protos reduces the networking infrastructure complexity and makes all the networking families look more similar in its implementation, which facilitates indentifying common code patterns that can be made generic. All of this is part of an effort I've been working on for a long time, with the ultimate goals of reducing the costs associated with maintaining the support for legacy protocols, taking advantage of the work done on the mainstream protocols and easing the implementation of new network protocols, such as DCCP, which I'm working on. Regards, - Arnaldo From hadi@cyberus.ca Wed Jan 19 20:02:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 20:02:05 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K4201g018664 for ; Wed, 19 Jan 2005 20:02:00 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CrTWC-0000Iv-0G for netdev@oss.sgi.com; Wed, 19 Jan 2005 23:02:00 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CrTW4-0006L3-Kl; Wed, 19 Jan 2005 23:01:52 -0500 Subject: Re: [PATCH]: was Re: LLTX and netif_stop_queue From: jamal Reply-To: hadi@cyberus.ca To: "David S. Miller" Cc: Stephen Hemminger , iod00d@hp.com, eric.lemoine@gmail.com, roland@topspin.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net In-Reply-To: <20050119164640.6c67bdfa.davem@davemloft.net> References: <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> <5cac192f0501021530672a908a@mail.gmail.com> <1104764660.1048.578.camel@jzny.localdomain> <52brc68q05.fsf@topspin.com> <5cac192f05010308414a25b548@mail.gmail.com> <527jmu8nbw.fsf@topspin.com> <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119164640.6c67bdfa.davem@davemloft.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1106193707.1048.4.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 19 Jan 2005 23:01:47 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 539 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev One thing i didnt quiet follow Dave in some of the drivers, example in the e1000: ----- /* Called with dev->xmit_lock held and interrupts disabled. */ static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) --- Who calls that with dev->xmit_lock held and interrupts disabled? Shouldnt the spin_unlock(&netdev->xmit_lock); be right at the top of that routine now? cheers, jamal From hadi@cyberus.ca Wed Jan 19 20:30:23 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 20:30:28 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K4UM9D023306 for ; Wed, 19 Jan 2005 20:30:23 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1CrTxc-0000MV-UB for netdev@oss.sgi.com; Wed, 19 Jan 2005 23:30:20 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CrTxa-0000s6-QW; Wed, 19 Jan 2005 23:30:19 -0500 Subject: Re: More tc action mess From: jamal Reply-To: hadi@cyberus.ca To: Patrick McHardy Cc: Maillist netdev In-Reply-To: <41EEC19B.3010504@trash.net> References: <41EDEB97.3080503@trash.net> <1106140256.1049.903.camel@jzny.localdomain> <41EEC19B.3010504@trash.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1106195414.1048.34.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 19 Jan 2005 23:30:14 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 540 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Wed, 2005-01-19 at 15:22, Patrick McHardy wrote: > jamal wrote: > > >On Wed, 2005-01-19 at 00:09, Patrick McHardy wrote: > > > > > >>This means we must convert all paths on which tcf_action_exec is called > >>to use struct sk_buff ** :( > >> > >> > > > > > >No, just restore the code that you took out in one of your patches > >right above that line which reads: > > > >---- > > if (skb_cloned(skb)) { > > if (pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) { > > return -1; > > } > > } > >---- > > > >Depending on what you do in netfilter lately, you may wanna take out > >the skb_cloned() call. > > > > > > This does not help. Netfilter calls skb_ip_make_writable if it has to > touch the packet, if it is shared or cloned the packet will be copied. for ipt, just restore: if (pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) return -ENOMEM for the rest, the action code will handle all just fine. There will only be one copy per serious of tramplings. This is design intent. Note when i said i had issues with iptable targets, it has absolutely nothing to do with this - quiet a few of iptable targets i tested work fine; the problem was that the ones that didnt work were crashing and i did trace to some missing checks (which would be non-issue if the invocation was made from netfilter). I still need your help on this. > Despite this, this is hardly a fix as long as the ->act function takes > a struct sk_buff **. Are shared skbs broken or do you see any memory leaks? These would be worth fixing[1]. Give me some examples which show something is broken then we can have a more coherent discussion. I am willing to kill ipt if it is the problem. cheers, jamal [1]Yes, someday it may be worth going through all of the stack and easing the way skbs are shuttled around so we dont need to play games; but even i didnt dare when i was doing this code given the amount of work and intrusiveness involved. From hadi@cyberus.ca Wed Jan 19 20:47:40 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 20:47:45 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K4lejo024260 for ; Wed, 19 Jan 2005 20:47:40 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1CrUEN-0003AH-Ib for netdev@oss.sgi.com; Wed, 19 Jan 2005 23:47:39 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CrUEI-0002lg-U8; Wed, 19 Jan 2005 23:47:35 -0500 Subject: Re: [PATCH] ipv6: alternative version of S/390 shared NIC support From: jamal Reply-To: hadi@cyberus.ca To: Frank Pavlic Cc: Christian =?ISO-8859-1?Q?Borntr=E4ger?= , "David S. Miller" , Christoph Hellwig , netdev@oss.sgi.com, waldi@debian.org In-Reply-To: References: Content-Type: text/plain; charset=ISO-8859-1 Organization: jamalopolous Message-Id: <1106196449.1042.46.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 19 Jan 2005 23:47:30 -0500 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 541 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Wed, 2005-01-19 at 16:32, Frank Pavlic wrote: > Mit freundlichen Grüssen / Best regards > Frank Pavlic Ok, thanks to both you and Christian for the explanations. I think i understand better now. So essentially the hypervisor assumes the OSInstance speaks L3 (but not exactly L2);-> Yep, that would be a little challenging .. I have other suggestions on resolving some of this but i sympathize with the process you have to go through so i wont burden you with it;-> I think the patch that was in is good nuf a solution. BTW, How did this work out in other OSes you mentioned? For something as expensive as these beasts i have heard are, I have to say i am a little suprised by this "deficiency". cheers, jamal From davem@davemloft.net Wed Jan 19 21:20:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 21:20:41 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K5KY0n025831 for ; Wed, 19 Jan 2005 21:20:35 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CrUiJ-000059-00; Wed, 19 Jan 2005 21:18:35 -0800 Date: Wed, 19 Jan 2005 21:18:35 -0800 From: "David S. Miller" To: hadi@cyberus.ca Cc: shemminger@osdl.org, iod00d@hp.com, eric.lemoine@gmail.com, roland@topspin.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [PATCH]: was Re: LLTX and netif_stop_queue Message-Id: <20050119211835.67bfdf12.davem@davemloft.net> In-Reply-To: <1106193707.1048.4.camel@jzny.localdomain> References: <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> <5cac192f0501021530672a908a@mail.gmail.com> <1104764660.1048.578.camel@jzny.localdomain> <52brc68q05.fsf@topspin.com> <5cac192f05010308414a25b548@mail.gmail.com> <527jmu8nbw.fsf@topspin.com> <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119164640.6c67bdfa.davem@davemloft.net> <1106193707.1048.4.camel@jzny.localdomain> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 542 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On 19 Jan 2005 23:01:47 -0500 jamal wrote: > ----- > /* Called with dev->xmit_lock held and interrupts disabled. */ > static int > e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) > --- > > Who calls that with dev->xmit_lock held and interrupts disabled? qdisc_restart() and dev_queue_xmit(), via netdev->hard_start_xmit(). > Shouldnt the spin_unlock(&netdev->xmit_lock); be right at the top of > that routine now? Nope, the idea now is that netdev->xmit_lock replaces the driver private tx_lock From kaber@trash.net Wed Jan 19 22:32:57 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 22:33:01 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K6WuJP028744 for ; Wed, 19 Jan 2005 22:32:57 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CrVs9-0000wl-Dz; Thu, 20 Jan 2005 07:32:49 +0100 Message-ID: <41EF5091.9040402@trash.net> Date: Thu, 20 Jan 2005 07:32:49 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: hadi@cyberus.ca CC: Maillist netdev Subject: Re: More tc action mess References: <41EDEB97.3080503@trash.net> <1106140256.1049.903.camel@jzny.localdomain> <41EEC19B.3010504@trash.net> <1106195414.1048.34.camel@jzny.localdomain> In-Reply-To: <1106195414.1048.34.camel@jzny.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 543 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev jamal wrote: >On Wed, 2005-01-19 at 15:22, Patrick McHardy wrote: > > >>This does not help. Netfilter calls skb_ip_make_writable if it has to >>touch the packet, if it is shared or cloned the packet will be copied. >> >> > >for ipt, just restore: > >if (pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) > return -ENOMEM > >for the rest, the action code will handle all just fine. There will only >be one copy per serious of tramplings. This is design intent. > > It seems to be more clever than I initially realized :) But it does need some fixing for ipt. The ->act function takes a struct sk_buff **, which implies the skb might get replaced, but tcf_action_exec only takes a struct sk_buff * and doesn't own the skb. So if the skb is replaced in the action the owner ends up with a pointer to freed memory. pskb_expand_head is not enough to stop netfilter from copying, at ingress the the skb might be nonlinear, in which case it is copied. On egress it seems fine. >Give me some examples which show something is broken then we can have a >more coherent discussion. I am willing to kill ipt if it is the problem. > Instead of killing ipt we could teach netfilter to be smarter about this. If the data that needs to be mangled is in the non-linear range we could just linearize the skb. Additionally we should change act_api to only pass single skb pointers around, to avoid all confusion and possible trouble. This seems a lot better than changing almost entire net/sched to pass double pointers around :) Regards Patrick From davem@davemloft.net Wed Jan 19 23:07:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 23:07:51 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K77kbf030313 for ; Wed, 19 Jan 2005 23:07:46 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CrWNz-0000ND-00; Wed, 19 Jan 2005 23:05:43 -0800 Date: Wed, 19 Jan 2005 23:05:43 -0800 From: "David S. Miller" To: Andi Kleen Cc: shemminger@osdl.org, hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, roland@topspin.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [PATCH]: was Re: LLTX and netif_stop_queue Message-Id: <20050119230543.22a04473.davem@davemloft.net> In-Reply-To: <20050120031423.GC30088@wotan.suse.de> References: <1104764660.1048.578.camel@jzny.localdomain> <52brc68q05.fsf@topspin.com> <5cac192f05010308414a25b548@mail.gmail.com> <527jmu8nbw.fsf@topspin.com> <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119164640.6c67bdfa.davem@davemloft.net> <20050120031423.GC30088@wotan.suse.de> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 545 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Thu, 20 Jan 2005 04:14:23 +0100 Andi Kleen wrote: > Looks good to me and much cleaner than what I initially did. > Thanks. Thanks for the review Andi. From davem@davemloft.net Wed Jan 19 23:07:30 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 19 Jan 2005 23:07:39 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K77TfF030263 for ; Wed, 19 Jan 2005 23:07:29 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CrWNi-0000N5-00; Wed, 19 Jan 2005 23:05:26 -0800 Date: Wed, 19 Jan 2005 23:05:26 -0800 From: "David S. Miller" To: Roland Dreier Cc: shemminger@osdl.org, hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [PATCH]: was Re: LLTX and netif_stop_queue Message-Id: <20050119230526.393a5184.davem@davemloft.net> In-Reply-To: <52r7kgu5n5.fsf@topspin.com> References: <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> <5cac192f0501021530672a908a@mail.gmail.com> <1104764660.1048.578.camel@jzny.localdomain> <52brc68q05.fsf@topspin.com> <5cac192f05010308414a25b548@mail.gmail.com> <527jmu8nbw.fsf@topspin.com> <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119164640.6c67bdfa.davem@davemloft.net> <52r7kgu5n5.fsf@topspin.com> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 544 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Wed, 19 Jan 2005 19:43:42 -0800 Roland Dreier wrote: > Looks reasonable to me. I'll try the IPoIB changes out to make sure > it still works. Great. I actually tested my patch out, and there was a deadlock added to the tg3 and sungem drivers which is fixed in this updated version. Basically, since the multicast code now takes dev->xmit_lock the ->set_multicast_list() routines should not grab it anymore. To prevent ABBA deadlock, I had to remove the acquisition of the usual priv->lock in tg3 and sungem multicast list settings. Grabbing priv->lock was overkill and this new scheme of just holding dev->xmit_lock is OK, because: 1) Messing with the RX mode and multicast hash is safe even in parallel with RX packet processing. 2) All code paths that want to shut up all chip programming code paths still take both dev->xmit_lock and priv->lock thus still able to block out ->set_multicast_list() processing. So I'm going to check this in and push upstream. Let me know if folks find any other errors. Thanks. ===== Documentation/networking/netdevices.txt 1.5 vs edited ===== --- 1.5/Documentation/networking/netdevices.txt 2004-09-12 16:55:06 -07:00 +++ edited/Documentation/networking/netdevices.txt 2005-01-19 16:09:50 -08:00 @@ -45,10 +45,9 @@ Synchronization: dev->xmit_lock spinlock. When the driver sets NETIF_F_LLTX in dev->features this will be called without holding xmit_lock. In this case the driver - has to lock by itself when needed. It is recommended to use a try lock - for this and return -1 when the spin lock fails. - The locking there should also properly protect against - set_multicast_list + has to execute it's transmission routine in a completely lockless + manner. It is recommended only for queueless devices such + loopback and tunnels. Context: BHs disabled Notes: netif_queue_stopped() is guaranteed false Return codes: @@ -56,8 +55,6 @@ o NETDEV_TX_BUSY Cannot transmit packet, try later Usually a bug, means queue start/stop flow control is broken in the driver. Note: the driver must NOT put the skb in its DMA ring. - o NETDEV_TX_LOCKED Locking failed, please retry quickly. - Only valid when NETIF_F_LLTX is set. dev->tx_timeout: Synchronization: dev->xmit_lock spinlock. ===== drivers/infiniband/ulp/ipoib/ipoib.h 1.3 vs edited ===== --- 1.3/drivers/infiniband/ulp/ipoib/ipoib.h 2005-01-15 14:01:50 -08:00 +++ edited/drivers/infiniband/ulp/ipoib/ipoib.h 2005-01-19 15:50:47 -08:00 @@ -104,10 +104,10 @@ }; /* - * Device private locking: tx_lock protects members used in TX fast - * path (and we use LLTX so upper layers don't do extra locking). - * lock protects everything else. lock nests inside of tx_lock (ie - * tx_lock must be acquired first if needed). + * Device private locking: netdev->xmit_lock protects members used + * in TX fast path. + * lock protects everything else. lock nests inside of xmit_lock (ie + * xmit_lock must be acquired first if needed). */ struct ipoib_dev_priv { spinlock_t lock; @@ -150,7 +150,6 @@ struct ipoib_buf *rx_ring; - spinlock_t tx_lock; struct ipoib_buf *tx_ring; unsigned tx_head; unsigned tx_tail; ===== drivers/infiniband/ulp/ipoib/ipoib_ib.c 1.4 vs edited ===== --- 1.4/drivers/infiniband/ulp/ipoib/ipoib_ib.c 2005-01-15 14:01:50 -08:00 +++ edited/drivers/infiniband/ulp/ipoib/ipoib_ib.c 2005-01-19 15:51:36 -08:00 @@ -247,12 +247,12 @@ dev_kfree_skb_any(tx_req->skb); - spin_lock_irqsave(&priv->tx_lock, flags); + spin_lock_irqsave(&dev->xmit_lock, flags); ++priv->tx_tail; if (netif_queue_stopped(dev) && priv->tx_head - priv->tx_tail <= IPOIB_TX_RING_SIZE / 2) netif_wake_queue(dev); - spin_unlock_irqrestore(&priv->tx_lock, flags); + spin_unlock_irqrestore(&dev->xmit_lock, flags); if (wc->status != IB_WC_SUCCESS && wc->status != IB_WC_WR_FLUSH_ERR) ===== drivers/infiniband/ulp/ipoib/ipoib_main.c 1.3 vs edited ===== --- 1.3/drivers/infiniband/ulp/ipoib/ipoib_main.c 2005-01-15 14:01:48 -08:00 +++ edited/drivers/infiniband/ulp/ipoib/ipoib_main.c 2005-01-19 15:53:27 -08:00 @@ -411,7 +411,7 @@ /* * We can only be called from ipoib_start_xmit, so we're - * inside tx_lock -- no need to save/restore flags. + * inside dev->xmit_lock -- no need to save/restore flags. */ spin_lock(&priv->lock); @@ -483,7 +483,7 @@ /* * We can only be called from ipoib_start_xmit, so we're - * inside tx_lock -- no need to save/restore flags. + * inside dev->xmit_lock -- no need to save/restore flags. */ spin_lock(&priv->lock); @@ -526,27 +526,11 @@ spin_unlock(&priv->lock); } +/* Called with dev->xmit_lock held and IRQs disabled. */ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct ipoib_dev_priv *priv = netdev_priv(dev); struct ipoib_neigh *neigh; - unsigned long flags; - - local_irq_save(flags); - if (!spin_trylock(&priv->tx_lock)) { - local_irq_restore(flags); - return NETDEV_TX_LOCKED; - } - - /* - * Check if our queue is stopped. Since we have the LLTX bit - * set, we can't rely on netif_stop_queue() preventing our - * xmit function from being called with a full queue. - */ - if (unlikely(netif_queue_stopped(dev))) { - spin_unlock_irqrestore(&priv->tx_lock, flags); - return NETDEV_TX_BUSY; - } if (skb->dst && skb->dst->neighbour) { if (unlikely(!*to_ipoib_neigh(skb->dst->neighbour))) { @@ -601,7 +585,6 @@ } out: - spin_unlock_irqrestore(&priv->tx_lock, flags); return NETDEV_TX_OK; } @@ -797,7 +780,7 @@ dev->addr_len = INFINIBAND_ALEN; dev->type = ARPHRD_INFINIBAND; dev->tx_queue_len = IPOIB_TX_RING_SIZE * 2; - dev->features = NETIF_F_VLAN_CHALLENGED | NETIF_F_LLTX; + dev->features = NETIF_F_VLAN_CHALLENGED; /* MTU will be reset when mcast join happens */ dev->mtu = IPOIB_PACKET_SIZE - IPOIB_ENCAP_LEN; @@ -812,7 +795,6 @@ priv->dev = dev; spin_lock_init(&priv->lock); - spin_lock_init(&priv->tx_lock); init_MUTEX(&priv->mcast_mutex); init_MUTEX(&priv->vlan_mutex); ===== drivers/net/sungem.c 1.72 vs edited ===== --- 1.72/drivers/net/sungem.c 2004-11-05 15:56:15 -08:00 +++ edited/drivers/net/sungem.c 2005-01-19 22:29:14 -08:00 @@ -835,9 +835,9 @@ } /* Run TX completion thread */ - spin_lock(&gp->tx_lock); + spin_lock(&dev->xmit_lock); gem_tx(dev, gp, gp->status); - spin_unlock(&gp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irqrestore(&gp->lock, flags); @@ -932,12 +932,12 @@ readl(gp->regs + MAC_RXCFG)); spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&dev->xmit_lock); gp->reset_task_pending = 2; schedule_work(&gp->reset_task); - spin_unlock(&gp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&gp->lock); } @@ -955,7 +955,6 @@ struct gem *gp = dev->priv; int entry; u64 ctrl; - unsigned long flags; ctrl = 0; if (skb->ip_summed == CHECKSUM_HW) { @@ -969,17 +968,9 @@ (csum_stuff_off << 21)); } - local_irq_save(flags); - if (!spin_trylock(&gp->tx_lock)) { - /* Tell upper layer to requeue */ - local_irq_restore(flags); - return NETDEV_TX_LOCKED; - } - /* This is a hard error, log it. */ if (TX_BUFFS_AVAIL(gp) <= (skb_shinfo(skb)->nr_frags + 1)) { netif_stop_queue(dev); - spin_unlock_irqrestore(&gp->tx_lock, flags); printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n", dev->name); return NETDEV_TX_BUSY; @@ -1066,7 +1057,6 @@ dev->name, entry, skb->len); mb(); writel(gp->tx_new, gp->regs + TXDMA_KICK); - spin_unlock_irqrestore(&gp->tx_lock, flags); dev->trans_start = jiffies; @@ -1097,11 +1087,11 @@ } spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&dev->xmit_lock); dev->mtu = new_mtu; gp->reset_task_pending = 1; schedule_work(&gp->reset_task); - spin_unlock(&gp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&gp->lock); flush_scheduled_work(); @@ -1111,7 +1101,7 @@ #define STOP_TRIES 32 -/* Must be invoked under gp->lock and gp->tx_lock. */ +/* Must be invoked under gp->lock and dev->xmit_lock. */ static void gem_stop(struct gem *gp) { int limit; @@ -1137,7 +1127,7 @@ printk(KERN_ERR "%s: SW reset is ghetto.\n", gp->dev->name); } -/* Must be invoked under gp->lock and gp->tx_lock. */ +/* Must be invoked under gp->lock and dev->xmit_lock. */ static void gem_start_dma(struct gem *gp) { unsigned long val; @@ -1162,7 +1152,7 @@ } -/* Must be invoked under gp->lock and gp->tx_lock. */ +/* Must be invoked under gp->lock and dev->xmit_lock. */ // XXX dbl check what that function should do when called on PCS PHY static void gem_begin_auto_negotiation(struct gem *gp, struct ethtool_cmd *ep) { @@ -1249,7 +1239,7 @@ /* A link-up condition has occurred, initialize and enable the * rest of the chip. * - * Must be invoked under gp->lock and gp->tx_lock. + * Must be invoked under gp->lock and dev->xmit_lock. */ static int gem_set_link_modes(struct gem *gp) { @@ -1356,7 +1346,7 @@ return 0; } -/* Must be invoked under gp->lock and gp->tx_lock. */ +/* Must be invoked under gp->lock and dev->xmit_lock. */ static int gem_mdio_link_not_up(struct gem *gp) { switch (gp->lstate) { @@ -1414,7 +1404,7 @@ netif_poll_disable(gp->dev); spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&gp->dev->xmit_lock); if (gp->hw_running && gp->opened) { netif_stop_queue(gp->dev); @@ -1430,7 +1420,7 @@ } gp->reset_task_pending = 0; - spin_unlock(&gp->tx_lock); + spin_unlock(&gp->dev->xmit_lock); spin_unlock_irq(&gp->lock); netif_poll_enable(gp->dev); } @@ -1444,7 +1434,7 @@ return; spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&gp->dev->xmit_lock); /* If the link of task is still pending, we just * reschedule the link timer @@ -1514,11 +1504,11 @@ restart: mod_timer(&gp->link_timer, jiffies + ((12 * HZ) / 10)); out_unlock: - spin_unlock(&gp->tx_lock); + spin_unlock(&gp->dev->xmit_lock); spin_unlock_irq(&gp->lock); } -/* Must be invoked under gp->lock and gp->tx_lock. */ +/* Must be invoked under gp->lock and dev->xmit_lock. */ static void gem_clean_rings(struct gem *gp) { struct gem_init_block *gb = gp->init_block; @@ -1569,7 +1559,7 @@ } } -/* Must be invoked under gp->lock and gp->tx_lock. */ +/* Must be invoked under gp->lock and dev->xmit_lock. */ static void gem_init_rings(struct gem *gp) { struct gem_init_block *gb = gp->init_block; @@ -1619,7 +1609,7 @@ wmb(); } -/* Must be invoked under gp->lock and gp->tx_lock. */ +/* Must be invoked under gp->lock and dev->xmit_lock. */ static void gem_init_phy(struct gem *gp) { u32 mifcfg; @@ -1757,7 +1747,7 @@ } } -/* Must be invoked under gp->lock and gp->tx_lock. */ +/* Must be invoked under gp->lock and dev->xmit_lock. */ static void gem_init_dma(struct gem *gp) { u64 desc_dma = (u64) gp->gblock_dvma; @@ -1795,7 +1785,7 @@ gp->regs + RXDMA_BLANK); } -/* Must be invoked under gp->lock and gp->tx_lock. */ +/* Must be invoked under dev->xmit_lock. */ static u32 gem_setup_multicast(struct gem *gp) { @@ -1838,7 +1828,7 @@ return rxcfg; } -/* Must be invoked under gp->lock and gp->tx_lock. */ +/* Must be invoked under gp->lock and dev->xmit_lock. */ static void gem_init_mac(struct gem *gp) { unsigned char *e = &gp->dev->dev_addr[0]; @@ -1916,7 +1906,7 @@ writel(0xffffffff, gp->regs + MAC_MCMASK); } -/* Must be invoked under gp->lock and gp->tx_lock. */ +/* Must be invoked under gp->lock and dev->xmit_lock. */ static void gem_init_pause_thresholds(struct gem *gp) { u32 cfg; @@ -2052,7 +2042,7 @@ return 0; } -/* Must be invoked under gp->lock and gp->tx_lock. */ +/* Must be invoked under gp->lock and dev->xmit_lock. */ static void gem_init_hw(struct gem *gp, int restart_link) { /* On Apple's gmac, I initialize the PHY only after @@ -2150,11 +2140,11 @@ if (!gp->wake_on_lan) { spin_lock_irqsave(&gp->lock, flags); - spin_lock(&gp->tx_lock); + spin_lock(&gp->dev->xmit_lock); gem_stop(gp); writel(MAC_TXRST_CMD, gp->regs + MAC_TXRST); writel(MAC_RXRST_CMD, gp->regs + MAC_RXRST); - spin_unlock(&gp->tx_lock); + spin_unlock(&gp->dev->xmit_lock); spin_unlock_irqrestore(&gp->lock, flags); } @@ -2202,9 +2192,9 @@ unsigned long flags; spin_lock_irqsave(&gp->lock, flags); - spin_lock(&gp->tx_lock); + spin_lock(&gp->dev->xmit_lock); gem_stop(gp); - spin_unlock(&gp->tx_lock); + spin_unlock(&gp->dev->xmit_lock); spin_unlock_irqrestore(&gp->lock, flags); } } @@ -2265,9 +2255,9 @@ /* Reset the chip */ spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&gp->dev->xmit_lock); gem_stop(gp); - spin_unlock(&gp->tx_lock); + spin_unlock(&gp->dev->xmit_lock); spin_unlock_irq(&gp->lock); gp->hw_running = 1; @@ -2281,7 +2271,7 @@ printk(KERN_ERR "%s: failed to request irq !\n", gp->dev->name); spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&gp->dev->xmit_lock); #ifdef CONFIG_PPC_PMAC if (!hw_was_up && gp->pdev->vendor == PCI_VENDOR_ID_APPLE) gem_apple_powerdown(gp); @@ -2290,14 +2280,14 @@ gp->pm_timer.expires = jiffies + 10*HZ; add_timer(&gp->pm_timer); up(&gp->pm_sem); - spin_unlock(&gp->tx_lock); + spin_unlock(&gp->dev->xmit_lock); spin_unlock_irq(&gp->lock); return -EAGAIN; } spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&gp->dev->xmit_lock); /* Allocate & setup ring buffers */ gem_init_rings(gp); @@ -2307,7 +2297,7 @@ gp->opened = 1; - spin_unlock(&gp->tx_lock); + spin_unlock(&gp->dev->xmit_lock); spin_unlock_irq(&gp->lock); up(&gp->pm_sem); @@ -2328,7 +2318,7 @@ /* Stop traffic, mark us closed */ spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&gp->dev->xmit_lock); gp->opened = 0; @@ -2343,7 +2333,7 @@ /* Bye, the pm timer will finish the job */ free_irq(gp->pdev->irq, (void *) dev); - spin_unlock(&gp->tx_lock); + spin_unlock(&gp->dev->xmit_lock); spin_unlock_irq(&gp->lock); /* Fire the PM timer that will shut us down in about 10 seconds */ @@ -2374,7 +2364,7 @@ /* If the driver is opened, we stop the DMA */ if (gp->opened) { spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&gp->dev->xmit_lock); /* Stop traffic, mark us closed */ netif_device_detach(dev); @@ -2385,7 +2375,7 @@ /* Get rid of ring buffers */ gem_clean_rings(gp); - spin_unlock(&gp->tx_lock); + spin_unlock(&gp->dev->xmit_lock); spin_unlock_irq(&gp->lock); if (gp->pdev->vendor == PCI_VENDOR_ID_APPLE) @@ -2419,14 +2409,14 @@ } #endif /* CONFIG_PPC_PMAC */ spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&gp->dev->xmit_lock); gem_stop(gp); gp->hw_running = 1; gem_init_rings(gp); gem_init_hw(gp, 1); - spin_unlock(&gp->tx_lock); + spin_unlock(&gp->dev->xmit_lock); spin_unlock_irq(&gp->lock); netif_device_attach(dev); @@ -2447,7 +2437,7 @@ struct net_device_stats *stats = &gp->net_stats; spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&dev->xmit_lock); if (gp->hw_running) { stats->rx_crc_errors += readl(gp->regs + MAC_FCSERR); @@ -2467,12 +2457,13 @@ writel(0, gp->regs + MAC_LCOLL); } - spin_unlock(&gp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&gp->lock); return &gp->net_stats; } +/* Called with dev->xmit_lock held and IRQs disabled. */ static void gem_set_multicast(struct net_device *dev) { struct gem *gp = dev->priv; @@ -2482,9 +2473,6 @@ if (!gp->hw_running) return; - spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); - netif_stop_queue(dev); rxcfg = readl(gp->regs + MAC_RXCFG); @@ -2507,9 +2495,6 @@ writel(rxcfg, gp->regs + MAC_RXCFG); netif_wake_queue(dev); - - spin_unlock(&gp->tx_lock); - spin_unlock_irq(&gp->lock); } static void gem_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) @@ -2540,7 +2525,7 @@ /* Return current PHY settings */ spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&dev->xmit_lock); cmd->autoneg = gp->want_autoneg; cmd->speed = gp->phy_mii.speed; cmd->duplex = gp->phy_mii.duplex; @@ -2552,7 +2537,7 @@ */ if (cmd->advertising == 0) cmd->advertising = cmd->supported; - spin_unlock(&gp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&gp->lock); } else { // XXX PCS ? cmd->supported = @@ -2592,9 +2577,9 @@ /* Apply settings and restart link process. */ spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&dev->xmit_lock); gem_begin_auto_negotiation(gp, cmd); - spin_unlock(&gp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&gp->lock); return 0; @@ -2609,9 +2594,9 @@ /* Restart link process. */ spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&dev->xmit_lock); gem_begin_auto_negotiation(gp, NULL); - spin_unlock(&gp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&gp->lock); return 0; @@ -2863,7 +2848,6 @@ gp->msg_enable = DEFAULT_MSG; spin_lock_init(&gp->lock); - spin_lock_init(&gp->tx_lock); init_MUTEX(&gp->pm_sem); init_timer(&gp->link_timer); @@ -2899,9 +2883,9 @@ gem_apple_powerup(gp); #endif spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&dev->xmit_lock); gem_stop(gp); - spin_unlock(&gp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&gp->lock); /* Fill up the mii_phy structure (even if we won't use it) */ @@ -2967,11 +2951,11 @@ /* Detect & init PHY, start autoneg */ spin_lock_irq(&gp->lock); - spin_lock(&gp->tx_lock); + spin_lock(&dev->xmit_lock); gp->hw_running = 1; gem_init_phy(gp); gem_begin_auto_negotiation(gp, NULL); - spin_unlock(&gp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&gp->lock); if (gp->phy_type == phy_mii_mdio0 || @@ -2982,7 +2966,7 @@ pci_set_drvdata(pdev, dev); /* GEM can do it all... */ - dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_LLTX; + dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM; if (pci_using_dac) dev->features |= NETIF_F_HIGHDMA; ===== drivers/net/sungem.h 1.18 vs edited ===== --- 1.18/drivers/net/sungem.h 2004-09-15 08:16:05 -07:00 +++ edited/drivers/net/sungem.h 2005-01-19 15:54:08 -08:00 @@ -953,7 +953,6 @@ struct gem { spinlock_t lock; - spinlock_t tx_lock; void __iomem *regs; int rx_new, rx_old; int tx_new, tx_old; ===== drivers/net/tg3.c 1.227 vs edited ===== --- 1.227/drivers/net/tg3.c 2005-01-17 13:40:31 -08:00 +++ edited/drivers/net/tg3.c 2005-01-19 16:41:08 -08:00 @@ -2816,9 +2816,9 @@ /* run TX completion thread */ if (sblk->idx[0].tx_consumer != tp->tx_cons) { - spin_lock(&tp->tx_lock); + spin_lock(&netdev->xmit_lock); tg3_tx(tp); - spin_unlock(&tp->tx_lock); + spin_unlock(&netdev->xmit_lock); } spin_unlock_irqrestore(&tp->lock, flags); @@ -2939,7 +2939,7 @@ tg3_netif_stop(tp); spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&tp->dev->xmit_lock); restart_timer = tp->tg3_flags2 & TG3_FLG2_RESTART_TIMER; tp->tg3_flags2 &= ~TG3_FLG2_RESTART_TIMER; @@ -2949,7 +2949,7 @@ tg3_netif_start(tp); - spin_unlock(&tp->tx_lock); + spin_unlock(&tp->dev->xmit_lock); spin_unlock_irq(&tp->lock); if (restart_timer) @@ -3048,6 +3048,7 @@ (base + len + 8 < base)); } +/* dev->xmit_lock is held and IRQs are disabled. */ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct tg3 *tp = netdev_priv(dev); @@ -3055,39 +3056,12 @@ unsigned int i; u32 len, entry, base_flags, mss; int would_hit_hwbug; - unsigned long flags; len = skb_headlen(skb); - /* No BH disabling for tx_lock here. We are running in BH disabled - * context and TX reclaim runs via tp->poll inside of a software - * interrupt. Rejoice! - * - * Actually, things are not so simple. If we are to take a hw - * IRQ here, we can deadlock, consider: - * - * CPU1 CPU2 - * tg3_start_xmit - * take tp->tx_lock - * tg3_timer - * take tp->lock - * tg3_interrupt - * spin on tp->lock - * spin on tp->tx_lock - * - * So we really do need to disable interrupts when taking - * tx_lock here. - */ - local_irq_save(flags); - if (!spin_trylock(&tp->tx_lock)) { - local_irq_restore(flags); - return NETDEV_TX_LOCKED; - } - /* This is a hard error, log it. */ if (unlikely(TX_BUFFS_AVAIL(tp) <= (skb_shinfo(skb)->nr_frags + 1))) { netif_stop_queue(dev); - spin_unlock_irqrestore(&tp->tx_lock, flags); printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n", dev->name); return NETDEV_TX_BUSY; @@ -3224,7 +3198,7 @@ entry, len, last_plus_one, &start, mss)) - goto out_unlock; + goto out; entry = start; } @@ -3236,9 +3210,8 @@ if (TX_BUFFS_AVAIL(tp) <= (MAX_SKB_FRAGS + 1)) netif_stop_queue(dev); -out_unlock: +out: mmiowb(); - spin_unlock_irqrestore(&tp->tx_lock, flags); dev->trans_start = jiffies; @@ -3273,7 +3246,7 @@ tg3_netif_stop(tp); spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); tg3_halt(tp); @@ -3283,7 +3256,7 @@ tg3_netif_start(tp); - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); return 0; @@ -5574,7 +5547,7 @@ unsigned long flags; spin_lock_irqsave(&tp->lock, flags); - spin_lock(&tp->tx_lock); + spin_lock(&tp->dev->xmit_lock); /* All of this garbage is because when using non-tagged * IRQ status the mailbox/status_block protocol the chip @@ -5590,7 +5563,7 @@ if (!(tr32(WDMAC_MODE) & WDMAC_MODE_ENABLE)) { tp->tg3_flags2 |= TG3_FLG2_RESTART_TIMER; - spin_unlock(&tp->tx_lock); + spin_unlock(&tp->dev->xmit_lock); spin_unlock_irqrestore(&tp->lock, flags); schedule_work(&tp->reset_task); return; @@ -5659,7 +5632,7 @@ tp->asf_counter = tp->asf_multiplier; } - spin_unlock(&tp->tx_lock); + spin_unlock(&tp->dev->xmit_lock); spin_unlock_irqrestore(&tp->lock, flags); tp->timer.expires = jiffies + tp->timer_offset; @@ -5672,12 +5645,12 @@ int err; spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); tg3_disable_ints(tp); tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE; - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); /* The placement of this call is tied @@ -5696,7 +5669,7 @@ } spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); err = tg3_init_hw(tp); if (err) { @@ -5716,7 +5689,7 @@ tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE; } - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); if (err) { @@ -5726,11 +5699,11 @@ } spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); tg3_enable_ints(tp); - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); netif_start_queue(dev); @@ -5978,7 +5951,7 @@ del_timer_sync(&tp->timer); spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); #if 0 tg3_dump_state(tp); #endif @@ -5992,7 +5965,7 @@ TG3_FLAG_GOT_SERDES_FLOWCTL); netif_carrier_off(tp->dev); - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); free_irq(dev->irq, dev); @@ -6291,15 +6264,10 @@ } } +/* Called with dev->xmit_lock held and IRQs disabled. */ static void tg3_set_rx_mode(struct net_device *dev) { - struct tg3 *tp = netdev_priv(dev); - - spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); __tg3_set_rx_mode(dev); - spin_unlock(&tp->tx_lock); - spin_unlock_irq(&tp->lock); } #define TG3_REGDUMP_LEN (32 * 1024) @@ -6322,7 +6290,7 @@ memset(p, 0, TG3_REGDUMP_LEN); spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); #define __GET_REG32(reg) (*(p)++ = tr32(reg)) #define GET_REG32_LOOP(base,len) \ @@ -6372,7 +6340,7 @@ #undef GET_REG32_LOOP #undef GET_REG32_1 - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); } @@ -6496,7 +6464,7 @@ } spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); tp->link_config.autoneg = cmd->autoneg; if (cmd->autoneg == AUTONEG_ENABLE) { @@ -6510,7 +6478,7 @@ } tg3_setup_phy(tp, 1); - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); return 0; @@ -6627,7 +6595,7 @@ tg3_netif_stop(tp); spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); tp->rx_pending = ering->rx_pending; @@ -6640,7 +6608,7 @@ tg3_halt(tp); tg3_init_hw(tp); tg3_netif_start(tp); - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); return 0; @@ -6661,7 +6629,7 @@ tg3_netif_stop(tp); spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); if (epause->autoneg) tp->tg3_flags |= TG3_FLAG_PAUSE_AUTONEG; else @@ -6677,7 +6645,7 @@ tg3_halt(tp); tg3_init_hw(tp); tg3_netif_start(tp); - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); return 0; @@ -6803,14 +6771,14 @@ struct tg3 *tp = netdev_priv(dev); spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); tp->vlgrp = grp; /* Update RX_MODE_KEEP_VLAN_TAG bit in RX_MODE register. */ __tg3_set_rx_mode(dev); - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); } @@ -6819,10 +6787,10 @@ struct tg3 *tp = netdev_priv(dev); spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); if (tp->vlgrp) tp->vlgrp->vlan_devices[vid] = NULL; - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); } #endif @@ -8241,7 +8209,6 @@ if (pci_using_dac) dev->features |= NETIF_F_HIGHDMA; - dev->features |= NETIF_F_LLTX; #if TG3_VLAN_TAG_USED dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; dev->vlan_rx_register = tg3_vlan_rx_register; @@ -8283,7 +8250,6 @@ tp->grc_mode |= GRC_MODE_BSWAP_NONFRM_DATA; #endif spin_lock_init(&tp->lock); - spin_lock_init(&tp->tx_lock); spin_lock_init(&tp->indirect_lock); INIT_WORK(&tp->reset_task, tg3_reset_task, tp); @@ -8496,23 +8462,23 @@ del_timer_sync(&tp->timer); spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); tg3_disable_ints(tp); - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); netif_device_detach(dev); spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); tg3_halt(tp); - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); err = tg3_set_power_state(tp, state); if (err) { spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); tg3_init_hw(tp); @@ -8522,7 +8488,7 @@ netif_device_attach(dev); tg3_netif_start(tp); - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); } @@ -8547,7 +8513,7 @@ netif_device_attach(dev); spin_lock_irq(&tp->lock); - spin_lock(&tp->tx_lock); + spin_lock(&dev->xmit_lock); tg3_init_hw(tp); @@ -8558,7 +8524,7 @@ tg3_netif_start(tp); - spin_unlock(&tp->tx_lock); + spin_unlock(&dev->xmit_lock); spin_unlock_irq(&tp->lock); return 0; ===== drivers/net/tg3.h 1.52 vs edited ===== --- 1.52/drivers/net/tg3.h 2004-11-15 15:41:31 -08:00 +++ edited/drivers/net/tg3.h 2005-01-19 15:37:29 -08:00 @@ -1980,12 +1980,11 @@ * lock: Held during all operations except TX packet * processing. * - * tx_lock: Held during tg3_start_xmit{,_4gbug} and tg3_tx + * dev->xmit_lock: Held during tg3_start_xmit and tg3_tx * * If you want to shut up all asynchronous processing you must - * acquire both locks, 'lock' taken before 'tx_lock'. IRQs must - * be disabled to take 'lock' but only softirq disabling is - * necessary for acquisition of 'tx_lock'. + * acquire both locks, 'lock' taken before 'xmit_lock'. IRQs must + * be disabled to take either lock. */ spinlock_t lock; spinlock_t indirect_lock; @@ -2003,8 +2002,6 @@ u32 tx_prod; u32 tx_cons; u32 tx_pending; - - spinlock_t tx_lock; struct tg3_tx_buffer_desc *tx_ring; struct tx_ring_info *tx_buffers; ===== drivers/net/e1000/e1000.h 1.58 vs edited ===== --- 1.58/drivers/net/e1000/e1000.h 2004-10-25 18:13:57 -07:00 +++ edited/drivers/net/e1000/e1000.h 2005-01-19 15:45:31 -08:00 @@ -209,7 +209,6 @@ /* TX */ struct e1000_desc_ring tx_ring; - spinlock_t tx_lock; uint32_t txd_cmd; uint32_t tx_int_delay; uint32_t tx_abs_int_delay; ===== drivers/net/e1000/e1000_main.c 1.145 vs edited ===== --- 1.145/drivers/net/e1000/e1000_main.c 2005-01-10 21:03:21 -08:00 +++ edited/drivers/net/e1000/e1000_main.c 2005-01-19 16:37:55 -08:00 @@ -291,7 +291,9 @@ e1000_phy_reset(&adapter->hw); } + spin_lock_irq(&netdev->xmit_lock); e1000_set_multi(netdev); + spin_unlock_irq(&netdev->xmit_lock); e1000_restore_vlan(adapter); @@ -520,9 +522,6 @@ if(pci_using_dac) netdev->features |= NETIF_F_HIGHDMA; - /* hard_start_xmit is safe against parallel locking */ - netdev->features |= NETIF_F_LLTX; - /* before reading the EEPROM, reset the controller to * put the device in a known good starting state */ @@ -732,7 +731,6 @@ atomic_set(&adapter->irq_sem, 1); spin_lock_init(&adapter->stats_lock); - spin_lock_init(&adapter->tx_lock); return 0; } @@ -1293,6 +1291,8 @@ * list or the network interface flags are updated. This routine is * responsible for configuring the hardware for proper multicast, * promiscuous mode, and all-multi behavior. + * + * Called with netdev->xmit_lock held and IRQs disabled. **/ static void @@ -1304,12 +1304,9 @@ uint32_t rctl; uint32_t hash_value; int i; - unsigned long flags; /* Check for Promiscuous and All Multicast modes */ - spin_lock_irqsave(&adapter->tx_lock, flags); - rctl = E1000_READ_REG(hw, RCTL); if(netdev->flags & IFF_PROMISC) { @@ -1358,8 +1355,6 @@ if(hw->mac_type == e1000_82542_rev2_0) e1000_leave_82542_rst(adapter); - - spin_unlock_irqrestore(&adapter->tx_lock, flags); } /* Need to wait a few seconds after link up to get diagnostic information from @@ -1786,6 +1781,8 @@ } #define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1 ) + +/* Called with dev->xmit_lock held and interrupts disabled. */ static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) { @@ -1794,7 +1791,6 @@ unsigned int max_txd_pwr = E1000_MAX_TXD_PWR; unsigned int tx_flags = 0; unsigned int len = skb->len; - unsigned long flags; unsigned int nr_frags = 0; unsigned int mss = 0; int count = 0; @@ -1838,18 +1834,10 @@ if(adapter->pcix_82544) count += nr_frags; - local_irq_save(flags); - if (!spin_trylock(&adapter->tx_lock)) { - /* Collision - tell upper layer to requeue */ - local_irq_restore(flags); - return NETDEV_TX_LOCKED; - } - /* need: count + 2 desc gap to keep tail from touching * head, otherwise try next time */ if(unlikely(E1000_DESC_UNUSED(&adapter->tx_ring) < count + 2)) { netif_stop_queue(netdev); - spin_unlock_irqrestore(&adapter->tx_lock, flags); return NETDEV_TX_BUSY; } @@ -1857,7 +1845,6 @@ if(unlikely(e1000_82547_fifo_workaround(adapter, skb))) { netif_stop_queue(netdev); mod_timer(&adapter->tx_fifo_stall_timer, jiffies); - spin_unlock_irqrestore(&adapter->tx_lock, flags); return NETDEV_TX_BUSY; } } @@ -1884,7 +1871,6 @@ if(unlikely(E1000_DESC_UNUSED(&adapter->tx_ring) < MAX_SKB_FRAGS + 2)) netif_stop_queue(netdev); - spin_unlock_irqrestore(&adapter->tx_lock, flags); return NETDEV_TX_OK; } @@ -2234,13 +2220,13 @@ tx_ring->next_to_clean = i; - spin_lock(&adapter->tx_lock); + spin_lock(&netdev->xmit_lock); if(unlikely(cleaned && netif_queue_stopped(netdev) && netif_carrier_ok(netdev))) netif_wake_queue(netdev); - spin_unlock(&adapter->tx_lock); + spin_unlock(&netdev->xmit_lock); return cleaned; } @@ -2819,7 +2805,10 @@ if(wufc) { e1000_setup_rctl(adapter); + + spin_lock_irq(&netdev->xmit_lock); e1000_set_multi(netdev); + spin_unlock_irq(&netdev->xmit_lock); /* turn on all-multi mode if wake on multicast is enabled */ if(adapter->wol & E1000_WUFC_MC) { ===== include/linux/netdevice.h 1.96 vs edited ===== --- 1.96/include/linux/netdevice.h 2005-01-17 13:13:31 -08:00 +++ edited/include/linux/netdevice.h 2005-01-19 16:07:45 -08:00 @@ -76,7 +76,6 @@ /* Driver transmit return codes */ #define NETDEV_TX_OK 0 /* driver took care of packet */ #define NETDEV_TX_BUSY 1 /* driver tx path was busy*/ -#define NETDEV_TX_LOCKED -1 /* driver tx lock was already taken */ /* * Compute the worst case header length according to the protocols @@ -415,7 +414,7 @@ #define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */ #define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ #define NETIF_F_TSO 2048 /* Can offload TCP/IP segmentation */ -#define NETIF_F_LLTX 4096 /* LockLess TX */ +#define NETIF_F_LLTX 4096 /* Do not grab xmit_lock during ->hard_start_xmit */ /* Called after device is detached from network. */ void (*uninit)(struct net_device *dev); @@ -894,9 +893,11 @@ static inline void netif_tx_disable(struct net_device *dev) { - spin_lock_bh(&dev->xmit_lock); + unsigned long flags; + + spin_lock_irqsave(&dev->xmit_lock, flags); netif_stop_queue(dev); - spin_unlock_bh(&dev->xmit_lock); + spin_unlock_irqrestore(&dev->xmit_lock, flags); } /* These functions live elsewhere (drivers/net/net_init.c, but related) */ ===== net/atm/clip.c 1.43 vs edited ===== --- 1.43/net/atm/clip.c 2004-10-01 14:50:07 -07:00 +++ edited/net/atm/clip.c 2005-01-19 16:04:55 -08:00 @@ -97,7 +97,7 @@ printk(KERN_CRIT "!clip_vcc->entry (clip_vcc %p)\n",clip_vcc); return; } - spin_lock_bh(&entry->neigh->dev->xmit_lock); /* block clip_start_xmit() */ + spin_lock_irq(&entry->neigh->dev->xmit_lock); /* block clip_start_xmit() */ entry->neigh->used = jiffies; for (walk = &entry->vccs; *walk; walk = &(*walk)->next) if (*walk == clip_vcc) { @@ -121,7 +121,7 @@ printk(KERN_CRIT "ATMARP: unlink_clip_vcc failed (entry %p, vcc " "0x%p)\n",entry,clip_vcc); out: - spin_unlock_bh(&entry->neigh->dev->xmit_lock); + spin_unlock_irq(&entry->neigh->dev->xmit_lock); } /* The neighbour entry n->lock is held. */ ===== net/core/dev.c 1.181 vs edited ===== --- 1.181/net/core/dev.c 2005-01-13 20:41:04 -08:00 +++ edited/net/core/dev.c 2005-01-19 16:00:08 -08:00 @@ -1190,7 +1190,7 @@ #define HARD_TX_LOCK(dev, cpu) { \ if ((dev->features & NETIF_F_LLTX) == 0) { \ - spin_lock(&dev->xmit_lock); \ + spin_lock_irq(&dev->xmit_lock); \ dev->xmit_lock_owner = cpu; \ } \ } @@ -1198,7 +1198,7 @@ #define HARD_TX_UNLOCK(dev) { \ if ((dev->features & NETIF_F_LLTX) == 0) { \ dev->xmit_lock_owner = -1; \ - spin_unlock(&dev->xmit_lock); \ + spin_unlock_irq(&dev->xmit_lock); \ } \ } ===== net/core/dev_mcast.c 1.4 vs edited ===== --- 1.4/net/core/dev_mcast.c 2004-10-20 01:37:15 -07:00 +++ edited/net/core/dev_mcast.c 2005-01-19 16:05:35 -08:00 @@ -93,9 +93,9 @@ void dev_mc_upload(struct net_device *dev) { - spin_lock_bh(&dev->xmit_lock); + spin_lock_irq(&dev->xmit_lock); __dev_mc_upload(dev); - spin_unlock_bh(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); } /* @@ -107,7 +107,7 @@ int err = 0; struct dev_mc_list *dmi, **dmip; - spin_lock_bh(&dev->xmit_lock); + spin_lock_irq(&dev->xmit_lock); for (dmip = &dev->mc_list; (dmi = *dmip) != NULL; dmip = &dmi->next) { /* @@ -139,13 +139,13 @@ */ __dev_mc_upload(dev); - spin_unlock_bh(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); return 0; } } err = -ENOENT; done: - spin_unlock_bh(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); return err; } @@ -160,7 +160,7 @@ dmi1 = (struct dev_mc_list *)kmalloc(sizeof(*dmi), GFP_ATOMIC); - spin_lock_bh(&dev->xmit_lock); + spin_lock_irq(&dev->xmit_lock); for (dmi = dev->mc_list; dmi != NULL; dmi = dmi->next) { if (memcmp(dmi->dmi_addr, addr, dmi->dmi_addrlen) == 0 && dmi->dmi_addrlen == alen) { @@ -176,7 +176,7 @@ } if ((dmi = dmi1) == NULL) { - spin_unlock_bh(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); return -ENOMEM; } memcpy(dmi->dmi_addr, addr, alen); @@ -189,11 +189,11 @@ __dev_mc_upload(dev); - spin_unlock_bh(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); return 0; done: - spin_unlock_bh(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); if (dmi1) kfree(dmi1); return err; @@ -205,7 +205,7 @@ void dev_mc_discard(struct net_device *dev) { - spin_lock_bh(&dev->xmit_lock); + spin_lock_irq(&dev->xmit_lock); while (dev->mc_list != NULL) { struct dev_mc_list *tmp = dev->mc_list; @@ -216,7 +216,7 @@ } dev->mc_count = 0; - spin_unlock_bh(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); } #ifdef CONFIG_PROC_FS @@ -251,7 +251,7 @@ struct dev_mc_list *m; struct net_device *dev = v; - spin_lock_bh(&dev->xmit_lock); + spin_lock_irq(&dev->xmit_lock); for (m = dev->mc_list; m; m = m->next) { int i; @@ -263,7 +263,7 @@ seq_putc(seq, '\n'); } - spin_unlock_bh(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); return 0; } ===== net/core/netpoll.c 1.24 vs edited ===== --- 1.24/net/core/netpoll.c 2005-01-13 20:41:04 -08:00 +++ edited/net/core/netpoll.c 2005-01-19 16:05:56 -08:00 @@ -188,7 +188,7 @@ return; } - spin_lock(&np->dev->xmit_lock); + spin_lock_irq(&np->dev->xmit_lock); np->dev->xmit_lock_owner = smp_processor_id(); /* @@ -197,7 +197,7 @@ */ if (netif_queue_stopped(np->dev)) { np->dev->xmit_lock_owner = -1; - spin_unlock(&np->dev->xmit_lock); + spin_unlock_irq(&np->dev->xmit_lock); netpoll_poll(np); goto repeat; @@ -205,7 +205,7 @@ status = np->dev->hard_start_xmit(skb, np->dev); np->dev->xmit_lock_owner = -1; - spin_unlock(&np->dev->xmit_lock); + spin_unlock_irq(&np->dev->xmit_lock); /* transmit busy */ if(status) { ===== net/core/pktgen.c 1.21 vs edited ===== --- 1.21/net/core/pktgen.c 2005-01-10 11:32:10 -08:00 +++ edited/net/core/pktgen.c 2005-01-19 16:07:58 -08:00 @@ -2664,12 +2664,11 @@ } } - spin_lock_bh(&odev->xmit_lock); + spin_lock_irq(&odev->xmit_lock); if (!netif_queue_stopped(odev)) { u64 now; atomic_inc(&(pkt_dev->skb->users)); -retry_now: ret = odev->hard_start_xmit(pkt_dev->skb, odev); if (likely(ret == NETDEV_TX_OK)) { pkt_dev->last_ok = 1; @@ -2677,10 +2676,6 @@ pkt_dev->seq_num++; pkt_dev->tx_bytes += pkt_dev->cur_pkt_size; - } else if (ret == NETDEV_TX_LOCKED - && (odev->features & NETIF_F_LLTX)) { - cpu_relax(); - goto retry_now; } else { /* Retry it next time */ atomic_dec(&(pkt_dev->skb->users)); @@ -2716,7 +2711,7 @@ pkt_dev->next_tx_ns = 0; } - spin_unlock_bh(&odev->xmit_lock); + spin_unlock_irq(&odev->xmit_lock); /* If pkt_dev->count is zero, then run forever */ if ((pkt_dev->count != 0) && (pkt_dev->sofar >= pkt_dev->count)) { ===== net/sched/sch_generic.c 1.33 vs edited ===== --- 1.33/net/sched/sch_generic.c 2005-01-13 20:41:07 -08:00 +++ edited/net/sched/sch_generic.c 2005-01-19 16:25:02 -08:00 @@ -99,17 +99,11 @@ if ((skb = q->dequeue(q)) != NULL) { unsigned nolock = (dev->features & NETIF_F_LLTX); /* - * When the driver has LLTX set it does its own locking - * in start_xmit. No need to add additional overhead by - * locking again. These checks are worth it because - * even uncongested locks can be quite expensive. - * The driver can do trylock like here too, in case - * of lock congestion it should return -1 and the packet - * will be requeued. + * When the driver has LLTX set it does not require any + * locking in start_xmit. */ if (!nolock) { - if (!spin_trylock(&dev->xmit_lock)) { - collision: + if (!spin_trylock_irq(&dev->xmit_lock)) { /* So, someone grabbed the driver. */ /* It may be transient configuration error, @@ -143,22 +137,18 @@ if (ret == NETDEV_TX_OK) { if (!nolock) { dev->xmit_lock_owner = -1; - spin_unlock(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); } spin_lock(&dev->queue_lock); return -1; } - if (ret == NETDEV_TX_LOCKED && nolock) { - spin_lock(&dev->queue_lock); - goto collision; - } } /* NETDEV_TX_BUSY - we need to requeue */ /* Release the driver */ if (!nolock) { dev->xmit_lock_owner = -1; - spin_unlock(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); } spin_lock(&dev->queue_lock); q = dev->qdisc; @@ -186,7 +176,7 @@ { struct net_device *dev = (struct net_device *)arg; - spin_lock(&dev->xmit_lock); + spin_lock_irq(&dev->xmit_lock); if (dev->qdisc != &noop_qdisc) { if (netif_device_present(dev) && netif_running(dev) && @@ -200,7 +190,7 @@ dev_hold(dev); } } - spin_unlock(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); dev_put(dev); } @@ -224,17 +214,17 @@ static void dev_watchdog_up(struct net_device *dev) { - spin_lock_bh(&dev->xmit_lock); + spin_lock_irq(&dev->xmit_lock); __netdev_watchdog_up(dev); - spin_unlock_bh(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); } static void dev_watchdog_down(struct net_device *dev) { - spin_lock_bh(&dev->xmit_lock); + spin_lock_irq(&dev->xmit_lock); if (del_timer(&dev->watchdog_timer)) __dev_put(dev); - spin_unlock_bh(&dev->xmit_lock); + spin_unlock_irq(&dev->xmit_lock); } /* "NOOP" scheduler: the best scheduler, recommended for all interfaces ===== net/sched/sch_teql.c 1.16 vs edited ===== --- 1.16/net/sched/sch_teql.c 2004-10-21 22:21:24 -07:00 +++ edited/net/sched/sch_teql.c 2005-01-19 16:06:11 -08:00 @@ -301,12 +301,12 @@ switch (teql_resolve(skb, skb_res, slave)) { case 0: - if (spin_trylock(&slave->xmit_lock)) { + if (spin_trylock_irq(&slave->xmit_lock)) { slave->xmit_lock_owner = smp_processor_id(); if (!netif_queue_stopped(slave) && slave->hard_start_xmit(skb, slave) == 0) { slave->xmit_lock_owner = -1; - spin_unlock(&slave->xmit_lock); + spin_unlock_irq(&slave->xmit_lock); master->slaves = NEXT_SLAVE(q); netif_wake_queue(dev); master->stats.tx_packets++; @@ -314,7 +314,7 @@ return 0; } slave->xmit_lock_owner = -1; - spin_unlock(&slave->xmit_lock); + spin_unlock_irq(&slave->xmit_lock); } if (netif_queue_stopped(dev)) busy = 1; From SRS0+eccddbb4f006547dfa38+515+infradead.org+hch@pentafluge.srs.infradead.org Thu Jan 20 00:55:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 00:55:20 -0800 (PST) Received: from pentafluge.infradead.org (pentafluge.infradead.org [213.146.154.40]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0K8tEwf005812 for ; Thu, 20 Jan 2005 00:55:15 -0800 Received: from hch by pentafluge.infradead.org with local (Exim 4.43 #1 (Red Hat Linux)) id 1CrY5e-00087m-Pl; Thu, 20 Jan 2005 08:54:54 +0000 Date: Thu, 20 Jan 2005 08:54:54 +0000 From: Christoph Hellwig To: Arnaldo Carvalho de Melo Cc: jt@hpl.hp.com, "David S. Miller" , irda-users@lists.sourceforge.net, netdev@oss.sgi.com, Stephen Hemminger Subject: Re: [PATCH 6/9] irda: use sock slab cache Message-ID: <20050120085454.GA31160@infradead.org> References: <41EF11AF.70203@conectiva.com.br> <20050120021607.GA11216@bougret.hpl.hp.com> <41EF29BE.2020807@conectiva.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41EF29BE.2020807@conectiva.com.br> User-Agent: Mutt/1.4.1i X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 546 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: netdev On Thu, Jan 20, 2005 at 01:47:10AM -0200, Arnaldo Carvalho de Melo wrote: > > I'm just curious about the overhead of adding a specific slab > >for IrDA sockets. Most users never create any (using IrCOMM), or > >maximum one (using Obex), so it's not like it will get a lot of use > >(except here, of course). > > Well, lets start with something that may sound funny: when this series > of patches is finished the overhead will _decrease_ for most people. > > Why? Today we have in most machines five slab caches of this nature: > udp_sock, raw_sock, tcp_sock, unix_sock (PF_LOCAL) and the generic, > sock, that only is used by the protocols that are using > kmalloc(pritave_sock) + > sk_protinfo. But as Jean sais this type of socket is used very little, as are a few other probably (raw, pfkey?), so maybe those should just use kmalloc + kfree instead of their own slab? From Robert.Olsson@data.slu.se Thu Jan 20 03:30:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 03:30:11 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KBU67Z015284 for ; Thu, 20 Jan 2005 03:30:07 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0KBU1Sr026386; Thu, 20 Jan 2005 12:30:02 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 0ABFEEC1A0; Thu, 20 Jan 2005 12:30:01 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16879.38457.4576.598144@robur.slu.se> Date: Thu, 20 Jan 2005 12:30:01 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501191950.08567.jeremy.guthrie@berbee.com> References: <200501190903.45671.jeremy.guthrie@berbee.com> <16878.56487.600435.442912@robur.slu.se> <200501191950.08567.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 547 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > @ 14:51:44 we can see the secret_interval kick in. Otherwise we run very > solid. > > 101Kpps 8) Seems traffic increaed a little bit too? > 1024 buffers on the RX of eth3. > > echo 86400 > /proc/sys/net/ipv4/route/secret_interval > echo 524288 > /proc/sys/net/ipv4/route/gc_thresh rhash_entries? > It appears to be cruising right along now. Nice. rtstat's is still interesting so we can see number fib lookups and linear search and GC dynamics etc. --ro From hadi@cyberus.ca Thu Jan 20 05:44:33 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 05:44:37 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KDiWiq022616 for ; Thu, 20 Jan 2005 05:44:33 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1Crcbt-0004Hd-Sg for netdev@oss.sgi.com; Thu, 20 Jan 2005 08:44:29 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Crcbq-0004b9-1U; Thu, 20 Jan 2005 08:44:26 -0500 Subject: Re: More tc action mess From: jamal Reply-To: hadi@cyberus.ca To: Patrick McHardy Cc: Maillist netdev In-Reply-To: <41EF5091.9040402@trash.net> References: <41EDEB97.3080503@trash.net> <1106140256.1049.903.camel@jzny.localdomain> <41EEC19B.3010504@trash.net> <1106195414.1048.34.camel@jzny.localdomain> <41EF5091.9040402@trash.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1106228663.1041.94.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 20 Jan 2005 08:44:23 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 548 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Thu, 2005-01-20 at 01:32, Patrick McHardy wrote: > It seems to be more clever than I initially realized :) Praise be to the people behind pskb_expand (Alexey and Dave). Amen. > But it does need > some fixing for ipt. The ->act function takes a struct sk_buff **, which > implies the skb might get replaced, but tcf_action_exec only takes a struct > sk_buff * and doesn't own the skb. > So if the skb is replaced in the action the owner ends up with a pointer to > freed memory. pskb_expand_head is not > enough to stop netfilter from copying, at ingress the the skb might be > nonlinear, in which case it is copied. On egress it seems fine. The whole idea behind the psk_expand is to _copy_ the data while preserving the skb head i.e anyone in the path before the expand continues to see the old data (tcpdump for example or copied packets via mirror in the preceeding actions etc) and anyone after the expand sees the new data ;->. Thats the punch line. So there is no problem with tcf_action_exec() way of life. I have some very simple environmental rules which say "thou shalt call skb_expand in the case someone else is referencing the skb". Unfortunately since i have no control over netfilter, its safer to just expand everytime. I added the check for skb cloned after i saw the changes for make_writeable(?) going in. But it may be too dangerous an assumption. I thought netfilter already freed after copying - unless this has changed since about 2.6.5 when i last studied things, there should be no memory leak. Can you get non-linear skbs on ingress? Recall, this is right after packet comes off the NIC. I dont see them at the moment until some clever NIC appears in the market. > >Give me some examples which show something is broken then we can have a > >more coherent discussion. I am willing to kill ipt if it is the problem. > > > Instead of killing ipt we could teach netfilter to be smarter about this. > If the data that needs to be mangled is in the non-linear range we could > just linearize the skb. I have no issue incuring a penalty when using ipt. Its unfortunate, but fine. I cant see any memory leak if copying includes freeing in netfilter already (and in particular that the new scheme seemed to be using expand as well). If that is changed in netilter, restoring it would probably be a good idea. One thing that would be really useful is to be able to tell netfilter its ok to mangle the packet without copying it. Or vice versa receive a signal from it to say "packet has been mangled" so actions can trample some more on it. > Additionally we should change act_api to only pass > single skb pointers around, to avoid all confusion and possible trouble. tou mean exec() call? I would prefer not to do this. My brain has already sweated enough to make sure that this works and performance is good. > This seems a lot better than changing almost entire net/sched to pass > double pointers around :) While i did entertain this thought before submitting the code, and infact that was the avenue i started at, i was pretty sure Dave+Alexey would never have accepted the code (and for a very good reason too) ;-> So nobody ever saw the code ;-> cheers, jamal From tommy.christensen@tpack.net Thu Jan 20 05:51:33 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 05:51:38 -0800 (PST) Received: from mail.tpack.net (ip18.tpack.net [213.173.228.18]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0KDpWIe023173 for ; Thu, 20 Jan 2005 05:51:33 -0800 Received: (qmail 32168 invoked from network); 20 Jan 2005 13:51:25 -0000 Received: from tsc-6.cph.tpack.net (HELO ?192.168.9.22?) (192.168.9.22) by 0 with SMTP; 20 Jan 2005 13:51:25 -0000 Subject: Re: [PATCH]: was Re: LLTX and netif_stop_queue From: Tommy Christensen To: "David S. Miller" Cc: Roland Dreier , shemminger@osdl.org, hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net In-Reply-To: <20050119230526.393a5184.davem@davemloft.net> References: <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> <5cac192f0501021530672a908a@mail.gmail.com> <1104764660.1048.578.camel@jzny.localdomain> <52brc68q05.fsf@topspin.com> <5cac192f05010308414a25b548@mail.gmail.com> <527jmu8nbw.fsf@topspin.com> <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119164640.6c67bdfa.davem@davemloft.net> <52r7kgu5n5.fsf@topspin.com> <20050119230526.393a5184.davem@davemloft.net> Content-Type: text/plain Message-Id: <1106229084.5812.40.camel@tsc-6.cph.tpack.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Thu, 20 Jan 2005 14:51:25 +0100 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 549 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tommy.christensen@tpack.net Precedence: bulk X-list: netdev On Thu, 2005-01-20 at 08:05, David S. Miller wrote: > So I'm going to check this in and push upstream. Let me know > if folks find any other errors. Hi Dave Sorry to be the one with bad news. I am in favour of this idea, but there are still issues that need to be sorted out. > ===== drivers/net/sungem.c 1.72 vs edited ===== > --- 1.72/drivers/net/sungem.c 2004-11-05 15:56:15 -08:00 > +++ edited/drivers/net/sungem.c 2005-01-19 22:29:14 -08:00 > @@ -932,12 +932,12 @@ > readl(gp->regs + MAC_RXCFG)); > > spin_lock_irq(&gp->lock); > - spin_lock(&gp->tx_lock); > + spin_lock(&dev->xmit_lock); > > gp->reset_task_pending = 2; > schedule_work(&gp->reset_task); > > - spin_unlock(&gp->tx_lock); > + spin_unlock(&dev->xmit_lock); > spin_unlock_irq(&gp->lock); > } > ->tx_timeout() can't take dev->xmit_lock, since dev_watchdog already has it held. A lot more serious is the fact that ->tx_timeout() and ->hard_start_xmit() are no longer allowed to do this: spin_lock_irq() ... spin_unlock_irq() since that would leave us with irq's enabled while still holding the xmit_lock. This would have to be fixed for non-LLTX drivers as well. -Tommy From andre@tomt.net Thu Jan 20 06:04:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 06:04:46 -0800 (PST) Received: from mx1.skjellin.no (mail1.skjellin.no [80.239.42.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KE4fDk024579 for ; Thu, 20 Jan 2005 06:04:41 -0800 Received: from localhost (localhost [127.0.0.1]) by mx1.skjellin.no (Postfix) with ESMTP id 17F9F88529; Thu, 20 Jan 2005 15:04:40 +0100 (CET) Received: from puppen.pasop.tomt.net (gw-fe-1.pasop.tomt.net [10.255.1.1]) by mail1.skjellin.no (Postfix) with ESMTP id 4622E884CD; Thu, 20 Jan 2005 15:04:38 +0100 (CET) Received: from [10.255.1.10] (slurv.pasop.tomt.net [10.255.1.10]) by puppen.pasop.tomt.net (Postfix) with ESMTP id 1E0C022825; Thu, 20 Jan 2005 15:04:38 +0100 (CET) Message-ID: <41EFBA76.8040506@tomt.net> Date: Thu, 20 Jan 2005 15:04:38 +0100 From: Andre Tomt User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Hasso Tepper Cc: Ben Greear , netdev@oss.sgi.com Subject: Re: 2.6.10 ipv6/8021q lockup on vconfig on interface removal References: <41EA0A01.2020707@tomt.net> <41EC0F2B.7010002@candelatech.com> <200501181014.12079.hasso@estpak.ee> In-Reply-To: <200501181014.12079.hasso@estpak.ee> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at skjellin.no X-Virus-Status: Clean X-archive-position: 550 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: andre@tomt.net Precedence: bulk X-list: netdev Hasso Tepper wrote: > Ben Greear wrote: > >>Andre Tomt wrote: >> >>>I sent this initially about a week ago, but nobody have said anything, >>>not even a confirmation that its beeing looked into, or about me beeing >>>silly - highly unusual on netdev! So I'm reposting (with slight >>>modifications), boo, shame on me. Just a bit worried it slipped through >>>the cracks. >> >>My take on this is that it is a bug in the IPv6 code. If the IPv6 people >>think that the VLAN code might could be causing this, then I am open to >>suggestions as to how the VLAN code might be in error.... > > > There were similar problems with tunnels in 2.6.8 and 2.6.9 kernels. They > seems to be gone now in 2.6.10. > > Does it help, Andre? As said in the subject, 2.6.10 exibits this. I had a similar issue earlier on in 2.6.8, that one got fixed with a host of other related ones. Then the same symptoms popped up sometime later in the development of the kernel; not sure exactly when this got introduced as we only ran our own internal 2.6.8 tree with the fix in. I should probably do a binary search and at least pinpoint when it happened, but I won't have any free resources to do so until sometime this weekend. From tgraf@suug.ch Thu Jan 20 06:31:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 06:31:26 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KEVJ7e025751 for ; Thu, 20 Jan 2005 06:31:20 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 667DEF; Thu, 20 Jan 2005 15:30:53 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id A29301C0EA; Thu, 20 Jan 2005 15:31:35 +0100 (CET) Date: Thu, 20 Jan 2005 15:31:35 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] NET: Set NLM_F_MULTI for neighbour rtnetlink messages to userspace Message-ID: <20050120143135.GE26856@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 551 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Signed-off-by: Thomas Graf --- linux-2.6.10-bk14.orig/net/core/neighbour.c 2005-01-13 10:56:33.000000000 +0100 +++ linux-2.6.10-bk14/net/core/neighbour.c 2005-01-20 15:29:14.000000000 +0100 @@ -1556,6 +1556,7 @@ sizeof(struct ndmsg)); struct ndmsg *ndm = NLMSG_DATA(nlh); + nlh->nlmsg_flags = pid ? NLM_F_MULTI : 0; ndm->ndm_family = n->ops->family; ndm->ndm_flags = n->flags; ndm->ndm_type = n->type; From jeremy.guthrie@berbee.com Thu Jan 20 06:38:05 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 06:38:12 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KEc4so026315 for ; Thu, 20 Jan 2005 06:38:04 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Thu, 20 Jan 2005 08:37:58 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Thu, 20 Jan 2005 08:37:36 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson References: <200501191950.08567.jeremy.guthrie@berbee.com> <16879.38457.4576.598144@robur.slu.se> In-Reply-To: <16879.38457.4576.598144@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2546304.NdYkW6LUQn"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501200837.40734.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 20 Jan 2005 14:37:58.0966 (UTC) FILETIME=[A3180D60:01C4FEFD] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 552 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart2546304.NdYkW6LUQn Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thursday 20 January 2005 05:30 am, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > @ 14:51:44 we can see the secret_interval kick in. Otherwise we run > > very solid. > > > > 101Kpps 8) > > Seems traffic increaed a little bit too? > > > 1024 buffers on the RX of eth3. > > > > echo 86400 > /proc/sys/net/ipv4/route/secret_interval > > echo 524288 > /proc/sys/net/ipv4/route/gc_thresh > > rhash_entries? I left that at 2.4 million. > > It appears to be cruising right along now. > > Nice. rtstat's is still interesting so we can see number fib lookups and > linear search and GC dynamics etc. size IN: hit tot mc no_rt bcast madst masrc OUT: hit tot = mc=20 GC: tot ignored goal_miss ovrf HASH: in_search out_search 524291 73651 805 0 0 0 0 0 5 0=20 537114631 537 0 0 0 45657 3 524291 74169 779 0 0 0 0 0 2 0=20 1610369017 516 0 0 0 43612 0 524287 74830 777 0 0 0 0 0 6 0 = =20 0 498 0 0 0 40504 1 524285 77458 949 0 0 0 0 0 4 0 = =20 0 619 0 0 0 42731 1 524273 75475 801 0 0 0 0 0 10 0 = =20 0 549 0 0 0 40084 7 524292 76740 902 0 0 0 0 0 5 0 = =20 0 574 0 0 0 41702 3 524295 76681 829 0 0 0 0 0 4 0 = =20 0 527 0 0 0 42328 2 524333 76522 756 0 0 0 0 0 9 1 = =20 0 432 0 0 0 43621 3 524286 80323 792 0 0 0 0 0 6 0 = =20 0 498 0 0 0 44619 2 524294 79409 758 0 0 0 0 0 6 0 = =20 0 508 0 0 0 45864 3 524288 80058 756 0 0 0 0 0 7 0 = =20 0 478 0 0 0 44711 5 524291 77128 794 0 0 0 0 0 8 0 = =20 0 516 0 0 0 42301 3 524288 77433 823 0 0 0 0 0 4 0 = =20 0 539 0 0 0 42357 0 524293 79423 761 0 0 0 0 0 7 0 = =20 0 514 0 0 0 43102 3 524293 80940 804 0 0 0 0 0 6 0 = =20 0 530 0 0 0 45457 3 524287 84864 813 0 0 0 0 0 3 0 = =20 0 532 0 0 0 44309 0 524286 78358 804 0 0 0 0 0 6 0 = =20 0 531 0 0 0 43669 2 524293 72760 717 0 0 0 0 0 2 0 = =20 0 480 0 0 0 41611 0 524287 72833 684 0 0 0 0 0 5 0 = =20 0 464 0 0 0 40571 1 524290 77308 726 0 0 0 0 0 6 0 = =20 0 486 0 0 0 43031 2 size IN: hit tot mc no_rt bcast madst masrc OUT: hit tot = mc=20 GC: tot ignored goal_miss ovrf HASH: in_search out_search 524288 81205 746 0 0 0 0 0 5 0=20 537114631 512 0 0 0 42384 3 524291 81744 736 0 0 0 0 0 5 0=20 1610369017 494 0 0 0 43980 3 524285 85813 766 0 0 0 0 0 5 0 = =20 0 485 0 0 0 45385 3 524290 80609 810 0 0 0 0 0 5 0 = =20 0 547 0 0 0 42037 2 524281 75730 784 0 0 0 0 0 7 0 = =20 0 515 0 0 0 42966 3 524295 78139 805 0 0 0 0 0 6 0 = =20 0 540 0 0 0 43026 3 524292 77198 724 0 0 0 0 0 7 1 = =20 0 484 0 0 0 44583 1 524301 80243 802 0 0 0 0 0 7 0 = =20 0 524 0 0 0 43462 2 524286 78010 822 0 0 0 0 0 8 0 = =20 0 557 0 0 0 44684 4 524292 76739 814 0 0 0 0 0 11 1 = =20 0 539 0 0 0 45128 5 524288 79226 765 0 0 0 0 0 6 0 = =20 0 518 0 0 0 47706 1 524286 78367 757 0 0 0 0 0 8 1 = =20 0 486 0 0 0 44462 1 524292 79453 774 0 0 0 0 0 10 0 = =20 0 514 0 0 0 43612 5 524291 75541 749 0 0 0 0 0 10 0 = =20 0 492 0 0 0 43462 3 524289 77849 748 0 0 0 0 0 14 3 = =20 0 493 0 0 0 43390 7 524296 77628 773 0 0 0 0 0 8 0 = =20 0 505 0 0 0 43900 3 524295 79695 699 0 0 0 0 0 8 0 = =20 0 451 0 0 0 45529 4 524293 78484 770 0 0 0 0 0 7 0 = =20 0 339 0 0 0 44700 2 524298 79257 732 0 0 0 0 0 8 0 = =20 0 486 0 0 0 45880 4 524287 79434 749 0 0 0 0 0 12 0 = =20 0 496 0 0 0 45081 5 =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart2546304.NdYkW6LUQn Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB78I0qtjaBHGZBeURAsTKAJ0Zm9UNi8F662SsdGsRWvEMFMKQkgCgiYI9 epww+bzL/MCI5VTGRztx5Sw= =LjGK -----END PGP SIGNATURE----- --nextPart2546304.NdYkW6LUQn-- From hadi@cyberus.ca Thu Jan 20 06:42:59 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 06:43:04 -0800 (PST) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KEgx3D026826 for ; Thu, 20 Jan 2005 06:42:59 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.30) id 1CrdWQ-00008x-Lt for netdev@oss.sgi.com; Thu, 20 Jan 2005 09:42:54 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CrdWN-0004Z8-Pt; Thu, 20 Jan 2005 09:42:52 -0500 Subject: Re: [RFC] batched tc to improve change throughput From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com, Werner Almesberger In-Reply-To: <20050119165421.GB26856@postel.suug.ch> References: <20050117152312.GC26856@postel.suug.ch> <1105976711.1078.1.camel@jzny.localdomain> <20050117160539.GD26856@postel.suug.ch> <1105979807.1078.16.camel@jzny.localdomain> <20050117165626.GE26856@postel.suug.ch> <1106002197.1046.19.camel@jzny.localdomain> <20050118134406.GR26856@postel.suug.ch> <1106058592.1035.95.camel@jzny.localdomain> <20050118145830.GS26856@postel.suug.ch> <1106144009.1047.989.camel@jzny.localdomain> <20050119165421.GB26856@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1106232168.1041.125.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 20 Jan 2005 09:42:49 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 553 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Wed, 2005-01-19 at 11:54, Thomas Graf wrote: > * jamal <1106144009.1047.989.camel@jzny.localdomain> 2005-01-19 09:13 > > What i mean is that we should probably leave iproute2 code alone so that > > people can run old scripts etc with it. i.e the netsh tool should just > > either reuse libnetlink and add any things to it or create a brand new > > library. > > Inspected some more code and I've finished already more than I thought. > The architecture currently allows specifying the grammar with macros > like this: [.. good stuff was here ..] I like it. Assuming we can have arbitrary hierachies; you just show one level - but that may be just the example at hand. Given that should be able to meet the layout requirements that Lennert alluded to earlier. > Looks a bit complicated but is actually quite easy, you can do it the > linux way. I get it, like it and yes TheLinuxWay is the OnlyWay ;-> [..] > The status of the whole thing: link and neighbour are finished, > core architecture finished as well, route is half done, addresses > are half done (both easy to finish). libnl has net/sched/ > finished but is still missing code for a lot of modules. This is the part i am a little uncomfortable with. If you can make that library maybe part of iproute2 it would ease maintanance. Extend libnetlink or have another layer on top of it. I know you have already put the effort, but consider this thought. > Session > management (commit/rollback) was once in but was too unstable, > needs a partial rewrite (design flaws) but should fit in quite > easly because libnl was designed to support it. It will basically > look like: nl_session_start(); ... any high level operations .. > if (nl_session_commit() < 0) nl_session_rollback(); > Looks right. > Problems? Keeping the cache valid (multiple netlink programs). > The final update just before the commit and the commit itself > must be atomic. > Indeed. > Solutions: > - Use ATOMIC flag (dangerous) Would really need a kernel hack to do right. And .. would slow down traffic while you hold the "atomic lock". > - Seq counter in netlink, increased evertime a netlink message > gets processed and returned in ack. A netlink request may contain > a flag and the expected sequence number and the request gets only > processed if they match, otherwise the request fails. (my favourite) > - Lock file in userspace (how to enfroce everyone to use it?) > - Try to detect changes from third party after commit. Quite > hard but possible, reduces race window but doesn't close it > completely. > Other apps changing things will screw you. If that gets handled then we are set. I actually did start working on a netlink redirect(hook) for a very different reason, but it should serve this purpose. Essentially you register to be the proxy for netlink and all messages go via you. You can then munge them, etc before issuing the response or allowing it to go on to configure things. With this your "lock" would be to ask for certain things to be redirected to you during an update phase. Ok, maybe i will put more effort on it over the weekend (Sunday). > Background: I keep 2 caches, 1 cache represents the current state > in the kernel, it gets updated when required. The second cache > contains the local caches. The first cache gets merged into the > second before the update and then gets commited. In case of a > failure the first cache is used to restore things. > Looks like the right way forward. cheers, jamal From acme@conectiva.com.br Thu Jan 20 06:52:58 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 06:53:03 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KEquk6027644 for ; Thu, 20 Jan 2005 06:52:57 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CrcwB-0000he-00; Thu, 20 Jan 2005 12:05:27 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id CB5071462D; Thu, 20 Jan 2005 12:52:50 -0200 (BRST) Message-ID: <41EFC671.6000706@conectiva.com.br> Date: Thu, 20 Jan 2005 12:55:45 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: Christoph Hellwig Cc: jt@hpl.hp.com, "David S. Miller" , irda-users@lists.sourceforge.net, netdev@oss.sgi.com, Stephen Hemminger Subject: Re: [PATCH 6/9] irda: use sock slab cache References: <41EF11AF.70203@conectiva.com.br> <20050120021607.GA11216@bougret.hpl.hp.com> <41EF29BE.2020807@conectiva.com.br> <20050120085454.GA31160@infradead.org> In-Reply-To: <20050120085454.GA31160@infradead.org> X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 554 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Christoph Hellwig escreveu: > On Thu, Jan 20, 2005 at 01:47:10AM -0200, Arnaldo Carvalho de Melo wrote: > >>> I'm just curious about the overhead of adding a specific slab >>>for IrDA sockets. Most users never create any (using IrCOMM), or >>>maximum one (using Obex), so it's not like it will get a lot of use >>>(except here, of course). >> >>Well, lets start with something that may sound funny: when this series >>of patches is finished the overhead will _decrease_ for most people. >> >>Why? Today we have in most machines five slab caches of this nature: >>udp_sock, raw_sock, tcp_sock, unix_sock (PF_LOCAL) and the generic, >>sock, that only is used by the protocols that are using >>kmalloc(pritave_sock) + >>sk_protinfo. > > > But as Jean sais this type of socket is used very little, as are a few > other probably (raw, pfkey?), so maybe those should just use kmalloc + > kfree instead of their own slab? OK, rethinking the scheme: Now: rename the zero_it sk_alloc parameter to obj_size, kmalloc the whole aggregate sock in sk_alloc (e.g. struct irda_sock in the patch that originated this thread) and set sk->sk_slab to NULL, not using sk_cachep (the generic "sock" slab), at sk_free time we use this logic: if (sk->sk_slab == NULL) kfree(sk); else kmem_cache_free(sk->sk_slab, sk); This works well for the transitional case, i.e. for the protocols that still use the "sock" generic slab cache, for the ones that already use private slab caches (tcp, udp, etc) and for the ones that will be using this new scheme, with just kmalloc/kfree aggregate, derived from struct sock, i.e. we can even leave the parameter as "zero_it" as is, as it will be removed in the future, final scheme, described in the next paragraph. Future: rename sk->sk_prot->slab_obj_size to sk->sk_prot->obj_size, leave sk->sk_prot->slab as NULL, this will make sk_alloc use kmalloc to allocate sk->sk_prot->obj_size bytes, and sk_free, will just use kfree when sk->sk_prot->slab is NULL. What do you guys think? Sane? :-) David, please don't apply this series of patches, I'll rework it with this new scheme if nobody pokes any hole in it and resent. Best Regards, - Arnaldo From acme@conectiva.com.br Thu Jan 20 07:18:00 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 07:18:04 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KFHwjv029243 for ; Thu, 20 Jan 2005 07:17:59 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CrdKR-0000jx-00; Thu, 20 Jan 2005 12:30:31 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 864821462D; Thu, 20 Jan 2005 13:17:54 -0200 (BRST) Message-ID: <41EFCC51.8030700@conectiva.com.br> Date: Thu, 20 Jan 2005 13:20:49 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: Christoph Hellwig Cc: jt@hpl.hp.com, "David S. Miller" , irda-users@lists.sourceforge.net, netdev@oss.sgi.com, Stephen Hemminger Subject: Re: [PATCH 6/9] irda: use sock slab cache References: <41EF11AF.70203@conectiva.com.br> <20050120021607.GA11216@bougret.hpl.hp.com> <41EF29BE.2020807@conectiva.com.br> <20050120085454.GA31160@infradead.org> <41EFC671.6000706@conectiva.com.br> In-Reply-To: <41EFC671.6000706@conectiva.com.br> X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------050006080901010504050201" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 555 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------050006080901010504050201 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Arnaldo Carvalho de Melo escreveu: > Christoph Hellwig escreveu: > >> On Thu, Jan 20, 2005 at 01:47:10AM -0200, Arnaldo Carvalho de Melo wrote: >> >>>> I'm just curious about the overhead of adding a specific slab >>>> for IrDA sockets. Most users never create any (using IrCOMM), or >>>> maximum one (using Obex), so it's not like it will get a lot of use >>>> (except here, of course). >>> >>> >>> Well, lets start with something that may sound funny: when this series >>> of patches is finished the overhead will _decrease_ for most people. >>> >>> Why? Today we have in most machines five slab caches of this nature: >>> udp_sock, raw_sock, tcp_sock, unix_sock (PF_LOCAL) and the generic, >>> sock, that only is used by the protocols that are using >>> kmalloc(pritave_sock) + >>> sk_protinfo. >> >> >> >> But as Jean sais this type of socket is used very little, as are a few >> other probably (raw, pfkey?), so maybe those should just use kmalloc + >> kfree instead of their own slab? > > > OK, rethinking the scheme: > > Now: rename the zero_it sk_alloc parameter to obj_size, kmalloc the whole > aggregate sock in sk_alloc (e.g. struct irda_sock in the patch that > originated > this thread) and set sk->sk_slab to NULL, not using sk_cachep (the generic > "sock" slab), at sk_free time we use this logic: > > if (sk->sk_slab == NULL) > kfree(sk); > else > kmem_cache_free(sk->sk_slab, sk); > > This works well for the transitional case, i.e. for the protocols that > still use the "sock" generic slab cache, for the ones that already > use private slab caches (tcp, udp, etc) and for the ones that will > be using this new scheme, with just kmalloc/kfree aggregate, derived > from struct sock, i.e. we can even leave the parameter as "zero_it" > as is, as it will be removed in the future, final scheme, described > in the next paragraph. > > Future: rename sk->sk_prot->slab_obj_size to sk->sk_prot->obj_size, > leave sk->sk_prot->slab as NULL, this will make sk_alloc use kmalloc to > allocate sk->sk_prot->obj_size bytes, and sk_free, will just use kfree > when sk->sk_prot->slab is NULL. > > What do you guys think? Sane? :-) > > David, please don't apply this series of patches, I'll rework it > with this new scheme if nobody pokes any hole in it and resent. Take a look at this patch, it shows how I think the transitional stage should be, the protocols will just use (IRDA for the example): sk = sk_alloc(PF_IRDA, GFP_KERNEL, sizeof(struct irda_sock), NULL); The ones still using the generic "sock" slab are using this, that works with the patch attached: sk = sk_alloc(PF_AX25, GFP_KERNEL, 1, NULL); sk->sk_protinfo = kmalloc(sizeof(struct ax25_cb), GFP_KERNEL); And the ones already using private slab caches: sk = sk_alloc(PF_UNIX, GFP_KERNEL, sizeof(struct unix_sock), unix_sk_cachep); All of this should work and when the transition to stop using sk->sk_protinfo is finished the generic "sock" cache can be safely removed and the logic in sk_alloc/sk_free will just not use it. Further on, when all families are converted to using sk->sk_prot sk_alloc will have this prototype: struct sock *sk_alloc(struct proto *prot, int priority, int zero_it) it will get the family from prot->family, the slab from prot->slab and the size of the object, if zero_it, that will be just a boolean, like it was before sock slab caches were introduced, is true, we use prot->obj_size to do the zeroing using memset. - Arnaldo --------------050006080901010504050201 Content-Type: text/plain; name="sk_slab.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sk_slab.patch" ===== net/core/sock.c 1.57 vs edited ===== --- 1.57/net/core/sock.c 2005-01-10 18:23:56 -02:00 +++ edited/net/core/sock.c 2005-01-20 13:04:13 -02:00 @@ -621,9 +621,17 @@ { struct sock *sk = NULL; - if (!slab) - slab = sk_cachep; - sk = kmem_cache_alloc(slab, priority); + /* FIXME: + * Transitional, will be removed when all the families stop + * using sk->sk_protinfo + */ + if (zero_it > 1) + sk = kmalloc(zero_it, priority); + else { + if (!slab) + slab = sk_cachep; + sk = kmem_cache_alloc(slab, priority); + } if (sk) { if (zero_it) { memset(sk, 0, @@ -631,10 +639,15 @@ sk->sk_family = family; sock_lock_init(sk); } - sk->sk_slab = slab; + + if (zero_it != 1) + sk->sk_slab = slab; if (security_sk_alloc(sk, family, priority)) { - kmem_cache_free(slab, sk); + if (sk->sk_slab) + kmem_cache_free(slab, sk); + else + kfree(sk); sk = NULL; } } @@ -662,7 +675,10 @@ __FUNCTION__, atomic_read(&sk->sk_omem_alloc)); security_sk_free(sk); - kmem_cache_free(sk->sk_slab, sk); + if (sk->sk_slab) + kmem_cache_free(sk->sk_slab, sk); + else + kfree(sk); module_put(owner); } --------------050006080901010504050201-- From tgraf@suug.ch Thu Jan 20 07:25:58 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 07:26:03 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KFPwGJ029845 for ; Thu, 20 Jan 2005 07:25:58 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 21DEFF; Thu, 20 Jan 2005 16:25:35 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 89B651C0EA; Thu, 20 Jan 2005 16:26:17 +0100 (CET) Date: Thu, 20 Jan 2005 16:26:17 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH 2.4] NET: Set NLM_F_MULTI for neighbour rtnetlink messages to userspace Message-ID: <20050120152617.GF26856@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 556 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Signed-off-by: Thomas Graf --- linux-2.4.29-bk1.orig/net/core/neighbour.c 2005-01-20 15:36:15.000000000 +0100 +++ linux-2.4.29-bk1/net/core/neighbour.c 2005-01-20 16:23:10.000000000 +0100 @@ -1469,6 +1469,7 @@ nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*ndm)); ndm = NLMSG_DATA(nlh); + nlh->nlmsg_flags = pid ? NLM_F_MULTI : 0; ndm->ndm_family = n->ops->family; ndm->ndm_flags = n->flags; ndm->ndm_type = n->type; From tgraf@suug.ch Thu Jan 20 07:35:41 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 07:35:47 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KFZdRN030490 for ; Thu, 20 Jan 2005 07:35:40 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 5B796F; Thu, 20 Jan 2005 16:35:16 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 8F5821C0EA; Thu, 20 Jan 2005 16:35:59 +0100 (CET) Date: Thu, 20 Jan 2005 16:35:59 +0100 From: Thomas Graf To: jamal Cc: Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com, Werner Almesberger Subject: Re: [RFC] batched tc to improve change throughput Message-ID: <20050120153559.GG26856@postel.suug.ch> References: <20050117160539.GD26856@postel.suug.ch> <1105979807.1078.16.camel@jzny.localdomain> <20050117165626.GE26856@postel.suug.ch> <1106002197.1046.19.camel@jzny.localdomain> <20050118134406.GR26856@postel.suug.ch> <1106058592.1035.95.camel@jzny.localdomain> <20050118145830.GS26856@postel.suug.ch> <1106144009.1047.989.camel@jzny.localdomain> <20050119165421.GB26856@postel.suug.ch> <1106232168.1041.125.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1106232168.1041.125.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 557 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * jamal <1106232168.1041.125.camel@jzny.localdomain> 2005-01-20 09:42 > I like it. Assuming we can have arbitrary hierachies; you just show one > level - but that may be just the example at hand. Given that should be > able to meet the layout requirements that Lennert alluded to earlier. It doesn't include any context code, the BNF: PARSER := TOPNODE* TOPNODE := NODELIST DESC LONG_DESC NODELIST := NODE* NODE := DESC [ NODELIST ] [ ARGUMENT ] [ ATTRS ] [ END_POINT ] END_POINT := possible end of command ATTRS := ATTR* ATTR := KEY [ VALUE ] ARGUMENT := VALUE [ DESC ] Not sure if this helps, I attached a complete module below. > > The status of the whole thing: link and neighbour are finished, > > core architecture finished as well, route is half done, addresses > > are half done (both easy to finish). libnl has net/sched/ > > finished but is still missing code for a lot of modules. > > This is the part i am a little uncomfortable with. If you can make that > library maybe part of iproute2 it would ease maintanance. Extend > libnetlink or have another layer on top of it. > I know you have already put the effort, but consider this thought. We can move it into iproute2 but the code really differs from iproute2 and code sharing is almost impossible. We can make iproute2 use it at some point but that doesn't make much sense for me. > > - Seq counter in netlink, increased evertime a netlink message > > gets processed and returned in ack. A netlink request may contain > > a flag and the expected sequence number and the request gets only > > processed if they match, otherwise the request fails. (my favourite) Do you have any objections on this? > > - Lock file in userspace (how to enfroce everyone to use it?) > > - Try to detect changes from third party after commit. Quite > > hard but possible, reduces race window but doesn't close it > > completely. > > > > Other apps changing things will screw you. If that gets handled then we > are set. I actually did start working on a netlink redirect(hook) for a > very different reason, but it should serve this purpose. Essentially you > register to be the proxy for netlink and all messages go via you. You > can then munge them, etc before issuing the response or allowing it to > go on to configure things. With this your "lock" would be to ask for > certain things to be redirected to you during an update phase. > Ok, maybe i will put more effort on it over the weekend (Sunday). Indeed, that would serve me well and we can avoid the userspace daemon. It doesn't even have to be a proxy, a simple callback hook capable of returning an action would be enough for my purpose. NOTE: Read bottom-up: /* * neigh.c linux net config utility * * $Id$ * * Copyright (c) 2004 Thomas Graf * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include static struct nl_cache neigh_cache = RTNL_INIT_NEIGH_CACHE(); static int dump_type = NL_DUMP_BRIEF; static struct rtnl_neigh filter = RTNL_INIT_NEIGH(); static struct { char *lladdr, *dev, *dst, *proxy, *router, *incomplete; char *reachable, *stale, *delay, *probe, *failed, *noarp; char *perm; } storage; static int set_dump_type(struct grammar_node *g) { dump_type = (int) g->gn_data; return 0; } static int set_dev(struct grammar_node *g) { int err; struct nl_cache *c = nl_cache_lookup(RTNL_LINK); BUG_ON(!g); err = update_link_cache(); if (err < 0) return err; return rtnl_neigh_set_ifindex_name(&filter, c, gr_arg_val(g)); } static int set_lladdr(struct grammar_node *g) { BUG_ON(!g); return rtnl_neigh_set_lladdr(&filter, gr_arg_val(g)); } static int set_dst(struct grammar_node *g) { BUG_ON(!g); return rtnl_neigh_set_dst(&filter, gr_arg_val(g)); } static int set_state2(struct grammar_node *g) { BUG_ON(!g); rtnl_neigh_set_state(&filter, (int) g->gn_data); return 0; } static int set_state(struct grammar_node *g) { BUG_ON(!g); if (gr_is_enabled(g)) rtnl_neigh_set_state(&filter, (int) g->gn_data); else if (gr_is_disabled(g)) rtnl_neigh_unset_state(&filter, (int) g->gn_data); else { put_err("Invalid toggle value '%s', must be {on|off}\n", gr_arg_val(g)); return -1; } return 0; } static int set_flag(struct grammar_node *g) { BUG_ON(!g); if (gr_is_enabled(g)) rtnl_neigh_set_flag(&filter, (int) g->gn_data); else if (gr_is_disabled(g)) rtnl_neigh_unset_flag(&filter, (int) g->gn_data); else { put_err("Invalid toggle value '%s', must be {on|off}\n", gr_arg_val(g)); return -1; } return 0; } static inline struct rtnl_neigh * get_neigh(int i) { return (struct rtnl_neigh *) nl_cache_get(&neigh_cache, i); } CACHE_MGEN(lladdr, &nlh_route, &neigh_cache) { return nl_addr2str_r(&(get_neigh(i)->n_lladdr), buf, len); } CACHE_MGEN(dst, &nlh_route, &neigh_cache) { return nl_addr2str_r(&(get_neigh(i)->n_dst), buf, len); } CACHE_MGEN(ifname_dst, &nlh_route, &neigh_cache) { struct nl_cache *c = nl_cache_lookup(RTNL_LINK); struct rtnl_neigh *n = get_neigh(i); if (update_link_cache() < 0) return NULL; if (storage.dst) { struct nl_addr f; if (nl_str2addr(storage.dst, &f) < 0) goto fallback; if (n->n_dst.a_len == f.a_len && !memcmp(n->n_dst.a_addr, f.a_addr, n->n_dst.a_len)) return (char *) rtnl_link_i2name(c, n->n_ifindex); else return NULL; } fallback: return (char *) rtnl_link_i2name(c, n->n_ifindex); } static inline void reset_filter(void) { memset(&filter, 0, sizeof(filter)); } static int update_neigh_cache(void) { if (nl_cache_update(&nlh_route, &neigh_cache) < 0) { put_err("%s\n", nl_geterror()); return -1; } return 0; } static int do_neigh_list(struct grammar_node *g) { int err; BUG_ON(!g); err = update_link_cache(); if (err < 0) goto out; err = update_neigh_cache(); if (err < 0) goto out; nl_cache_dump_filter(dump_type, &neigh_cache, (struct nl_common *) &filter, fd_out); err = 0; out: dump_type = NL_DUMP_BRIEF; reset_filter(); return err; } static int do_neigh_add(struct grammar_node *g) { int err = -1; BUG_ON(!g); filter.n_family = filter.n_lladdr.a_family; err = rtnl_neigh_set_dst(&filter, gr_arg_val(g)); if (err < 0) goto out; err = rtnl_neigh_add(&nlh_route, &filter); if (err < 0) goto out; err = 0; out: reset_filter(); return err; } static int do_neigh_del(struct grammar_node *g) { int err = -1; BUG_ON(!g); err = rtnl_neigh_set_dst(&filter, gr_arg_val(g)); if (err < 0) goto out; err = rtnl_neigh_delete(&nlh_route, &filter); if (err < 0) goto out; err = 0; out: reset_filter(); return err; } static int do_neigh_modify(struct grammar_node *g) { int err; BUG_ON(!g); if (filter.n_mask == 0) return 0; err = rtnl_neigh_set_dst(&filter, gr_arg_val(g)); if (err < 0) goto out; err = rtnl_neigh_change(&nlh_route, &filter, &filter); if (err < 0) goto out; err = 0; out: reset_filter(); return err; } ATTRLIST(neigh_flags_attrs) ATTR_FLAG(proxy, NTF_PROXY, &storage.dst, set_flag, "Proxy") ATTR_FLAG(router, NTF_ROUTER, &storage.router, set_flag, "Router") ATTR_FLAG(incomplete, NUD_INCOMPLETE, &storage.incomplete, set_state, "Lookup is incomplete") ATTR_FLAG(reachable, NUD_REACHABLE, &storage.reachable, set_state, "Reachable") ATTR_FLAG(stale, NUD_STALE, &storage.stale, set_state, "Stale entry") ATTR_FLAG(delay, NUD_DELAY, &storage.delay, set_state, "Delayed") ATTR_FLAG(probe, NUD_PROBE, &storage.probe, set_state, "Probe") ATTR_FLAG(failed, NUD_FAILED, &storage.failed, set_state, "Failed") ATTR_FLAG(noarp, NUD_NOARP, &storage.noarp, set_state, "No ARP") ATTR_FLAG(permanent, NUD_PERMANENT, &storage.perm, set_state, "Permanent entry") END_ATTRLIST NODELIST(neigh_flags) END_POINT NODE(flags) ATTRS(neigh_flags_attrs) END_NODE END_NODELIST ATTRLIST(neigh_filter) ATTR(lladdr) CALLBACK(set_lladdr) ARG(GA_TEXT, &storage.lladdr,CACHE_MGEN_FUNC(lladdr),"") DESC("Link layer address") END_ATTR ATTR(dst) CALLBACK(set_dst) ARG(GA_TEXT, &storage.dst, CACHE_MGEN_FUNC(dst), "") DESC("Destination address") END_ATTR ATTR(dev) CALLBACK(set_dev) ARG(GA_TEXT, &storage.dev, CACHE_MGEN_FUNC(ifname), "") DESC("Link the neighbour is on") END_ATTR END_ATTRLIST NODELIST(neigh_where) END_POINT NODE(where) ATTRS(neigh_filter) FOLLOW(neigh_flags) DESC("Only dump neighbours matching a filter") END_NODE END_NODELIST NODELIST(neigh_list_attrs) END_POINT NODE(brief) DATA(NL_DUMP_BRIEF) FOLLOW(neigh_where) CALLBACK(set_dump_type) DESC("Brief listing of attributes") END_NODE NODE(full) DATA(NL_DUMP_FULL) FOLLOW(neigh_where) CALLBACK(set_dump_type) DESC("Verbose listing (all attributes)") END_NODE NODE(stats) DATA(NL_DUMP_STATS) FOLLOW(neigh_where) CALLBACK(set_dump_type) DESC("Verbose listing (all attributes/statistics)") END_NODE NODE(where) ATTRS(neigh_filter) FOLLOW(neigh_flags) DESC("Only dump neighbours matching a filter") END_NODE END_NODELIST NODELIST(neigh_add_state) NODE(permanent) CALLBACK(set_state2) DATA(NUD_PERMANENT) DESC("Permanent entry") END_NODE NODE(stale) CALLBACK(set_state2) DATA(NUD_STALE) DESC("Stale entry") END_NODE NODE(noarp) CALLBACK(set_state2) DATA(NUD_NOARP) DESC("No ARP") END_NODE NODE(reachable) CALLBACK(set_state2) DATA(NUD_REACHABLE) DESC("Reachable") END_NODE NODE(failed) CALLBACK(set_state2) DATA(NUD_FAILED) DESC("Failed") END_NODE END_NODELIST NODELIST(neigh_add_lladdr) NODE(lladdr) CALLBACK(set_lladdr) FOLLOW(neigh_add_state) ARG(GA_TEXT, &storage.lladdr,CACHE_MGEN_FUNC(lladdr),"") DESC("Link layer address") END_NODE END_NODELIST NODELIST(neigh_add_dev) NODE(dev) CALLBACK(set_dev) FOLLOW(neigh_add_lladdr) ARG(GA_TEXT, &storage.dev, CACHE_MGEN_FUNC(ifname), "") DESC("Link") END_NODE END_NODELIST NODELIST(neigh_del_dev) NODE(dev) CALLBACK(set_dev) ARG(GA_TEXT, &storage.dev, CACHE_MGEN_FUNC(ifname_dst), "") DESC("Link") END_NODE END_NODELIST ATTRLIST(neigh_set_attrs) ATTR(lladdr) CALLBACK(set_lladdr) ARG(GA_TEXT, &storage.lladdr,CACHE_MGEN_FUNC(lladdr),"") DESC("Link layer address") END_ATTR ATTR_FLAG(proxy, NTF_PROXY, &storage.proxy, set_flag, "Proxy") ATTR_FLAG(router, NTF_ROUTER, &storage.router, set_flag, "Router") ATTR_FLAG(incomplete, NUD_INCOMPLETE, &storage.incomplete, set_state, "Incomplete lookup") ATTR_FLAG(reachable, NUD_REACHABLE, &storage.reachable, set_state, "Reachable") ATTR_FLAG(stale, NUD_STALE, &storage.stale, set_state, "Stale entry") ATTR_FLAG(delay, NUD_DELAY, &storage.delay, set_state, "Delayed") ATTR_FLAG(probe, NUD_PROBE, &storage.probe, set_state, "Probe") ATTR_FLAG(failed, NUD_FAILED, &storage.failed, set_state, "Failed") ATTR_FLAG(noarp, NUD_NOARP, &storage.noarp, set_state, "No ARP") ATTR_FLAG(permanent, NUD_PERMANENT, &storage.perm, set_state, "Permanent entry") END_ATTRLIST NODELIST(neigh_modify) NODE(set) ATTRS(neigh_set_attrs) END_NODE END_NODELIST NODELIST(neigh_modify_dev) NODE(dev) CALLBACK(set_dev) FOLLOW(neigh_modify) ARG(GA_TEXT, &storage.dev, CACHE_MGEN_FUNC(ifname_dst), "") DESC("Link") END_NODE END_NODELIST NODELIST(neigh_ops) NODE(add) FOLLOW(neigh_add_dev) CALLBACK(do_neigh_add) ARG(GA_TEXT, &storage.dst, CACHE_MGEN_FUNC(dst), "") DESC("Add a neighbour") END_NODE NODE(modify) FOLLOW(neigh_modify_dev) CALLBACK(do_neigh_modify) ARG(GA_TEXT, &storage.dst, CACHE_MGEN_FUNC(dst), "") DESC("Modify a neighbour") END_NODE NODE(delete) FOLLOW(neigh_del_dev) CALLBACK(do_neigh_del) ARG(GA_TEXT, &storage.dst, CACHE_MGEN_FUNC(dst), "") DESC("Delete a neighbour") END_NODE NODE(list) FOLLOW(neigh_list_attrs) CALLBACK(do_neigh_list) DESC("List neighbour attributes") END_NODE END_NODELIST TOPNODE(ng, neighbour) FOLLOW(neigh_ops) DESC("Neighbour (ARP) configuration") LONG_DESC( " Module to view and modify the neighbour tables.\n" " \n" \ " The neighbour table establishes bindings between protocol\n" \ " addresses and link layer addresses for hosts sharing the same\n" \ " physical link. This module allows you to view the content of\n" \ " these tables and to manipulate their content.\n") END_TOPNODE static void __init neigh_init(void) { MAKE_LIST(neigh_ops); MAKE_LIST(neigh_list_attrs); MAKE_LIST(neigh_where); MAKE_LIST(neigh_filter); MAKE_LIST(neigh_add_dev); MAKE_LIST(neigh_add_lladdr); MAKE_LIST(neigh_add_state); MAKE_LIST(neigh_del_dev); MAKE_LIST(neigh_modify_dev); MAKE_LIST(neigh_modify); MAKE_LIST(neigh_set_attrs); MAKE_LIST(neigh_flags); MAKE_LIST(neigh_flags_attrs); register_top_node(&ng); } From yoshfuji@linux-ipv6.org Thu Jan 20 08:52:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 08:52:55 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KGqlTk003787 for ; Thu, 20 Jan 2005 08:52:47 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id 513B433CC2; Fri, 21 Jan 2005 01:53:27 +0900 (JST) Date: Fri, 21 Jan 2005 01:53:26 +0900 (JST) Message-Id: <20050121.015326.41280602.yoshfuji@linux-ipv6.org> To: davem@davemloft.net Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: [BK PATCH] Ndisc updates From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 558 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Hello. Please pull following changesets available at . Note: Roland already reviewd ipoib changeset. Thank you. HEADLINES --------- ChangeSet@1.2344, 2005-01-21 01:26:45+09:00, yoshfuji@linux-ipv6.org [IPV6] NDISC: save space for ndisc_options{}. ChangeSet@1.2345, 2005-01-21 01:26:57+09:00, yoshfuji@linux-ipv6.org [IPV6] NDISC: make ndisc_opt_lladdr_data() and check length inside. ChangeSet@1.2346, 2005-01-21 01:27:09+09:00, yoshfuji@linux-ipv6.org [IPV6] NDISC: ndisc_opt_len() to calculate ND option length. ChangeSet@1.2347, 2005-01-21 01:27:21+09:00, yoshfuji@linux-ipv6.org [IPV6] NDISC: ndisc_opt_data() to get ND option data. ChangeSet@1.2348, 2005-01-21 01:27:34+09:00, yoshfuji@linux-ipv6.org [IPV6] NDISC: ndisc_opt_lladdr_space() to calculate ND option length for device. ChangeSet@1.2349, 2005-01-21 01:32:39+09:00, yoshfuji@linux-ipv6.org [IPV6] NDISC: prepend correct padding to IPoIB link-layer address option. DIFFSTATS --------- include/net/ndisc.h | 14 +++--- net/ipv6/ndisc.c | 121 +++++++++++++++++++++++++++++++++++----------------- 2 files changed, 91 insertions(+), 44 deletions(-) CHANGESETS ---------- ChangeSet@1.2344, 2005-01-21 01:26:45+09:00, yoshfuji@linux-ipv6.org [IPV6] NDISC: save space for ndisc_options{}. Pointed out by Krishna Kumar . Also, size of structure is now adjusted automatically. Signed-off-by: Hideaki YOSHIFUJI diff -Nru a/include/net/ndisc.h b/include/net/ndisc.h --- a/include/net/ndisc.h 2005-01-21 01:45:48 +09:00 +++ b/include/net/ndisc.h 2005-01-21 01:45:48 +09:00 @@ -15,11 +15,15 @@ * ndisc options */ -#define ND_OPT_SOURCE_LL_ADDR 1 -#define ND_OPT_TARGET_LL_ADDR 2 -#define ND_OPT_PREFIX_INFO 3 -#define ND_OPT_REDIRECT_HDR 4 -#define ND_OPT_MTU 5 +enum { + __ND_OPT_PREFIX_INFO_END = 0, + ND_OPT_SOURCE_LL_ADDR = 1, /* RFC2461 */ + ND_OPT_TARGET_LL_ADDR = 2, /* RFC2461 */ + ND_OPT_PREFIX_INFO = 3, /* RFC2461 */ + ND_OPT_REDIRECT_HDR = 4, /* RFC2461 */ + ND_OPT_MTU = 5, /* RFC2461 */ + __ND_OPT_MAX +}; #define MAX_RTR_SOLICITATION_DELAY HZ diff -Nru a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c --- a/net/ipv6/ndisc.c 2005-01-21 01:45:48 +09:00 +++ b/net/ipv6/ndisc.c 2005-01-21 01:45:48 +09:00 @@ -156,14 +156,13 @@ /* ND options */ struct ndisc_options { - struct nd_opt_hdr *nd_opt_array[7]; - struct nd_opt_hdr *nd_opt_piend; + struct nd_opt_hdr *nd_opt_array[__ND_OPT_MAX]; }; #define nd_opts_src_lladdr nd_opt_array[ND_OPT_SOURCE_LL_ADDR] #define nd_opts_tgt_lladdr nd_opt_array[ND_OPT_TARGET_LL_ADDR] #define nd_opts_pi nd_opt_array[ND_OPT_PREFIX_INFO] -#define nd_opts_pi_end nd_opt_piend +#define nd_opts_pi_end nd_opt_array[__ND_OPT_PREFIX_INFO_END] #define nd_opts_rh nd_opt_array[ND_OPT_REDIRECT_HDR] #define nd_opts_mtu nd_opt_array[ND_OPT_MTU] ChangeSet@1.2345, 2005-01-21 01:26:57+09:00, yoshfuji@linux-ipv6.org [IPV6] NDISC: make ndisc_opt_lladdr_data() and check length inside. What we should do is to check lladdrlen and get pointer for link-layer address option. Since we know lladdrlen == dev->addr_len, we can check inside. Singned-off-by: Hideaki YOSHIFUJI diff -Nru a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c --- a/net/ipv6/ndisc.c 2005-01-21 01:45:52 +09:00 +++ b/net/ipv6/ndisc.c 2005-01-21 01:45:52 +09:00 @@ -245,6 +245,15 @@ return ndopts; } +static inline u8 *ndisc_opt_lladdr_data(struct nd_opt_hdr *p, struct net_device *dev) +{ + u8 *lladdr = (u8 *)(p + 1); + int lladdrlen = p->nd_opt_len << 3; + if (lladdrlen != NDISC_OPT_SPACE(dev->addr_len)) + return NULL; + return lladdr; +} + int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int dir) { switch (dev->type) { @@ -679,7 +688,6 @@ struct in6_addr *saddr = &skb->nh.ipv6h->saddr; struct in6_addr *daddr = &skb->nh.ipv6h->daddr; u8 *lladdr = NULL; - int lladdrlen = 0; u32 ndoptlen = skb->tail - msg->opt; struct ndisc_options ndopts; struct net_device *dev = skb->dev; @@ -716,9 +724,8 @@ } if (ndopts.nd_opts_src_lladdr) { - lladdr = (u8*)(ndopts.nd_opts_src_lladdr + 1); - lladdrlen = ndopts.nd_opts_src_lladdr->nd_opt_len << 3; - if (lladdrlen != NDISC_OPT_SPACE(dev->addr_len)) { + lladdr = ndisc_opt_lladdr_data(ndopts.nd_opts_src_lladdr, dev); + if (!lladdr) { ND_PRINTK2(KERN_WARNING "ICMPv6 NS: invalid link-layer address length\n"); return; @@ -841,7 +848,6 @@ struct in6_addr *saddr = &skb->nh.ipv6h->saddr; struct in6_addr *daddr = &skb->nh.ipv6h->daddr; u8 *lladdr = NULL; - int lladdrlen = 0; u32 ndoptlen = skb->tail - msg->opt; struct ndisc_options ndopts; struct net_device *dev = skb->dev; @@ -873,9 +879,8 @@ return; } if (ndopts.nd_opts_tgt_lladdr) { - lladdr = (u8*)(ndopts.nd_opts_tgt_lladdr + 1); - lladdrlen = ndopts.nd_opts_tgt_lladdr->nd_opt_len << 3; - if (lladdrlen != NDISC_OPT_SPACE(dev->addr_len)) { + lladdr = ndisc_opt_lladdr_data(ndopts.nd_opts_tgt_lladdr, dev); + if (!lladdr) { ND_PRINTK2(KERN_WARNING "ICMPv6 NA: invalid link-layer address length\n"); return; @@ -932,7 +937,6 @@ struct in6_addr *saddr = &skb->nh.ipv6h->saddr; struct ndisc_options ndopts; u8 *lladdr = NULL; - int lladdrlen = 0; if (skb->len < sizeof(*rs_msg)) return; @@ -963,9 +967,8 @@ } if (ndopts.nd_opts_src_lladdr) { - lladdr = (u8 *)(ndopts.nd_opts_src_lladdr + 1); - lladdrlen = ndopts.nd_opts_src_lladdr->nd_opt_len << 3; - if (lladdrlen != NDISC_OPT_SPACE(skb->dev->addr_len)) + lladdr = ndisc_opt_lladdr_data(ndopts.nd_opts_src_lladdr, skb->dev); + if (!lladdr) goto out; } @@ -1127,11 +1130,9 @@ if (rt && (neigh = rt->rt6i_nexthop) != NULL) { u8 *lladdr = NULL; - int lladdrlen; if (ndopts.nd_opts_src_lladdr) { - lladdr = (u8*)((ndopts.nd_opts_src_lladdr)+1); - lladdrlen = ndopts.nd_opts_src_lladdr->nd_opt_len << 3; - if (lladdrlen != NDISC_OPT_SPACE(skb->dev->addr_len)) { + lladdr = ndisc_opt_lladdr_data(ndopts.nd_opts_src_lladdr, skb->dev); + if (!lladdr) { ND_PRINTK2(KERN_WARNING "ICMPv6 RA: invalid link-layer address length\n"); goto out; @@ -1194,7 +1195,6 @@ struct ndisc_options ndopts; int optlen; u8 *lladdr = NULL; - int lladdrlen; if (!(ipv6_addr_type(&skb->nh.ipv6h->saddr) & IPV6_ADDR_LINKLOCAL)) { ND_PRINTK2(KERN_WARNING @@ -1249,9 +1249,8 @@ return; } if (ndopts.nd_opts_tgt_lladdr) { - lladdr = (u8*)(ndopts.nd_opts_tgt_lladdr + 1); - lladdrlen = ndopts.nd_opts_tgt_lladdr->nd_opt_len << 3; - if (lladdrlen != NDISC_OPT_SPACE(skb->dev->addr_len)) { + lladdr = ndisc_opt_lladdr_data(ndopts.nd_opts_tgt_lladdr, skb->dev); + if (!lladdr) { ND_PRINTK2(KERN_WARNING "ICMPv6 Redirect: invalid link-layer address length\n"); in6_dev_put(in6_dev); ChangeSet@1.2346, 2005-01-21 01:27:09+09:00, yoshfuji@linux-ipv6.org [IPV6] NDISC: ndisc_opt_len() to calculate ND option length. Signed-off-by: Hideaki YOSHIFUJI diff -Nru a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c --- a/net/ipv6/ndisc.c 2005-01-21 01:45:57 +09:00 +++ b/net/ipv6/ndisc.c 2005-01-21 01:45:57 +09:00 @@ -168,6 +168,11 @@ #define NDISC_OPT_SPACE(len) (((len)+2+7)&~7) +static inline int ndisc_opt_len(struct nd_opt_hdr *opt) +{ + return (opt->nd_opt_len << 3); +} + static u8 *ndisc_fill_option(u8 *opt, int type, void *data, int data_len) { int space = NDISC_OPT_SPACE(data_len); @@ -190,7 +195,7 @@ return NULL; type = cur->nd_opt_type; do { - cur = ((void *)cur) + (cur->nd_opt_len << 3); + cur = ((void *)cur) + ndisc_opt_len(cur); } while(cur < end && cur->nd_opt_type != type); return (cur <= end && cur->nd_opt_type == type ? cur : NULL); } @@ -207,7 +212,7 @@ int l; if (opt_len < sizeof(struct nd_opt_hdr)) return NULL; - l = nd_opt->nd_opt_len << 3; + l = ndisc_opt_len(nd_opt); if (opt_len < l || l == 0) return NULL; switch (nd_opt->nd_opt_type) { @@ -248,7 +253,7 @@ static inline u8 *ndisc_opt_lladdr_data(struct nd_opt_hdr *p, struct net_device *dev) { u8 *lladdr = (u8 *)(p + 1); - int lladdrlen = p->nd_opt_len << 3; + int lladdrlen = ndisc_opt_len(p); if (lladdrlen != NDISC_OPT_SPACE(dev->addr_len)) return NULL; return lladdr; @@ -1150,7 +1155,7 @@ for (p = ndopts.nd_opts_pi; p; p = ndisc_next_option(p, ndopts.nd_opts_pi_end)) { - addrconf_prefix_rcv(skb->dev, (u8*)p, (p->nd_opt_len) << 3); + addrconf_prefix_rcv(skb->dev, (u8*)p, ndisc_opt_len(p)); } } ChangeSet@1.2347, 2005-01-21 01:27:21+09:00, yoshfuji@linux-ipv6.org [IPV6] NDISC: ndisc_opt_data() to get ND option data. Signed-off-by: Hideaki YOSHIFUJI diff -Nru a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c --- a/net/ipv6/ndisc.c 2005-01-21 01:46:02 +09:00 +++ b/net/ipv6/ndisc.c 2005-01-21 01:46:02 +09:00 @@ -173,6 +173,11 @@ return (opt->nd_opt_len << 3); } +static inline u8 *ndisc_opt_data(struct nd_opt_hdr *opt) +{ + return ((u8 *)(opt + 1)); +} + static u8 *ndisc_fill_option(u8 *opt, int type, void *data, int data_len) { int space = NDISC_OPT_SPACE(data_len); @@ -252,7 +257,7 @@ static inline u8 *ndisc_opt_lladdr_data(struct nd_opt_hdr *p, struct net_device *dev) { - u8 *lladdr = (u8 *)(p + 1); + u8 *lladdr = ndisc_opt_data(p); int lladdrlen = ndisc_opt_len(p); if (lladdrlen != NDISC_OPT_SPACE(dev->addr_len)) return NULL; @@ -1162,7 +1167,7 @@ if (ndopts.nd_opts_mtu) { u32 mtu; - memcpy(&mtu, ((u8*)(ndopts.nd_opts_mtu+1))+2, sizeof(mtu)); + memcpy(&mtu, ndisc_opt_data(ndopts.nd_opts_mtu) + 2, sizeof(mtu)); mtu = ntohl(mtu); if (mtu < IPV6_MIN_MTU || mtu > skb->dev->mtu) { ChangeSet@1.2348, 2005-01-21 01:27:34+09:00, yoshfuji@linux-ipv6.org [IPV6] NDISC: ndisc_opt_lladdr_space() to calculate ND option length for device. Signed-off-by: Hideaki Yoshifuji diff -Nru a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c --- a/net/ipv6/ndisc.c 2005-01-21 01:46:06 +09:00 +++ b/net/ipv6/ndisc.c 2005-01-21 01:46:06 +09:00 @@ -255,6 +255,11 @@ return ndopts; } +static inline int ndisc_opt_lladdr_space(struct net_device *dev) +{ + return NDISC_OPT_SPACE(dev->addr_len); +} + static inline u8 *ndisc_opt_lladdr_data(struct nd_opt_hdr *p, struct net_device *dev) { u8 *lladdr = ndisc_opt_data(p); @@ -436,7 +441,7 @@ if (inc_opt) { if (dev->addr_len) - len += NDISC_OPT_SPACE(dev->addr_len); + len += ndisc_opt_lladdr_space(dev); else inc_opt = 0; } @@ -528,7 +533,7 @@ len = sizeof(struct icmp6hdr) + sizeof(struct in6_addr); send_llinfo = dev->addr_len && !ipv6_addr_any(saddr); if (send_llinfo) - len += NDISC_OPT_SPACE(dev->addr_len); + len += ndisc_opt_lladdr_space(dev); skb = sock_alloc_send_skb(sk, MAX_HEADER + len + LL_RESERVED_SPACE(dev), 1, &err); @@ -603,7 +608,7 @@ len = sizeof(struct icmp6hdr); if (dev->addr_len) - len += NDISC_OPT_SPACE(dev->addr_len); + len += ndisc_opt_lladdr_space(dev); skb = sock_alloc_send_skb(sk, MAX_HEADER + len + LL_RESERVED_SPACE(dev), 1, &err); @@ -1333,7 +1338,7 @@ if (dev->addr_len) { if (neigh->nud_state&NUD_VALID) { - len += NDISC_OPT_SPACE(dev->addr_len); + len += ndisc_opt_lladdr_space(dev); } else { /* If nexthop is not valid, do not redirect! We will make it later, when will be sure, ChangeSet@1.2349, 2005-01-21 01:32:39+09:00, yoshfuji@linux-ipv6.org [IPV6] NDISC: prepend correct padding to IPoIB link-layer address option. Based on patch from Roland Dreier . Signed-off-by: Roland Dreier Signed-off-by: Hideaki YOSHIFUJI diff -Nru a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c --- a/net/ipv6/ndisc.c 2005-01-21 01:46:11 +09:00 +++ b/net/ipv6/ndisc.c 2005-01-21 01:46:11 +09:00 @@ -178,14 +178,17 @@ return ((u8 *)(opt + 1)); } -static u8 *ndisc_fill_option(u8 *opt, int type, void *data, int data_len) +static u8 *ndisc_fill_option(u8 *opt, int type, int prepad, + void *data, int data_len) { - int space = NDISC_OPT_SPACE(data_len); + int space = NDISC_OPT_SPACE(prepad + data_len); opt[0] = type; opt[1] = space>>3; - memcpy(opt+2, data, data_len); - data_len += 2; + if (prepad) + memset(opt + 2, 0, prepad); + memcpy(opt + prepad + 2, data, data_len); + data_len += prepad + 2; opt += data_len; if ((space -= data_len) > 0) memset(opt, 0, space); @@ -255,18 +258,45 @@ return ndopts; } +/* + * Return the padding between the option length and the start of the + * link addr. Currently only IP-over-InfiniBand needs this, although + * if RFC 3831 IPv6-over-Fibre Channel is ever implemented it may + * also need a pad of 2. + */ +static inline int ndisc_opt_lladdr_prepad(unsigned short type) +{ + switch (type) { +#ifdef CONFIG_INFINIBAND_IPOIB + case ARPHRD_INFINIBAND: + return 2; +#endif + default: + return 0; + } +} + static inline int ndisc_opt_lladdr_space(struct net_device *dev) { - return NDISC_OPT_SPACE(dev->addr_len); + return NDISC_OPT_SPACE(dev->addr_len + ndisc_opt_lladdr_prepad(dev->type)); } static inline u8 *ndisc_opt_lladdr_data(struct nd_opt_hdr *p, struct net_device *dev) { u8 *lladdr = ndisc_opt_data(p); int lladdrlen = ndisc_opt_len(p); - if (lladdrlen != NDISC_OPT_SPACE(dev->addr_len)) + int prepad = ndisc_opt_lladdr_prepad(dev->type); + if (lladdrlen != NDISC_OPT_SPACE(dev->addr_len + prepad)) return NULL; - return lladdr; + return (lladdr + prepad); +} + +static inline u8 *ndisc_fill_lladdr_option(u8 *opt, int type, u8 *data, + struct net_device *dev) +{ + return ndisc_fill_option(opt, type, + ndisc_opt_lladdr_prepad(dev->type), + data, dev->addr_len); } int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int dir) @@ -476,7 +506,7 @@ ipv6_addr_copy(&msg->target, solicited_addr); if (inc_opt) - ndisc_fill_option(msg->opt, ND_OPT_TARGET_LL_ADDR, dev->dev_addr, dev->addr_len); + ndisc_fill_lladdr_option(msg->opt, ND_OPT_TARGET_LL_ADDR, dev->dev_addr, dev); /* checksum */ msg->icmph.icmp6_cksum = csum_ipv6_magic(src_addr, daddr, len, @@ -559,7 +589,7 @@ ipv6_addr_copy(&msg->target, solicit); if (send_llinfo) - ndisc_fill_option(msg->opt, ND_OPT_SOURCE_LL_ADDR, dev->dev_addr, dev->addr_len); + ndisc_fill_lladdr_option(msg->opt, ND_OPT_SOURCE_LL_ADDR, dev->dev_addr, dev); /* checksum */ msg->icmph.icmp6_cksum = csum_ipv6_magic(&skb->nh.ipv6h->saddr, @@ -633,7 +663,7 @@ opt = (u8*) (hdr + 1); if (dev->addr_len) - ndisc_fill_option(opt, ND_OPT_SOURCE_LL_ADDR, dev->dev_addr, dev->addr_len); + ndisc_fill_lladdr_option(opt, ND_OPT_SOURCE_LL_ADDR, dev->dev_addr, dev); /* checksum */ hdr->icmp6_cksum = csum_ipv6_magic(&skb->nh.ipv6h->saddr, daddr, len, @@ -1392,7 +1422,7 @@ */ if (dev->addr_len) - opt = ndisc_fill_option(opt, ND_OPT_TARGET_LL_ADDR, neigh->ha, dev->addr_len); + opt = ndisc_fill_lladdr_option(opt, ND_OPT_TARGET_LL_ADDR, neigh->ha, dev); /* * build redirect option and copy skb over to the new packet. -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From shemminger@osdl.org Thu Jan 20 08:56:56 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 08:57:00 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KGuteL006086 for ; Thu, 20 Jan 2005 08:56:55 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0KGu7l24447; Thu, 20 Jan 2005 08:56:07 -0800 Date: Thu, 20 Jan 2005 08:56:11 -0800 From: Stephen Hemminger To: "David S. Miller" Cc: Roland Dreier , hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [PATCH]: was Re: LLTX and netif_stop_queue Message-ID: <20050120085611.33f9485e@dxpl.pdx.osdl.net> In-Reply-To: <20050119230526.393a5184.davem@davemloft.net> References: <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> <5cac192f0501021530672a908a@mail.gmail.com> <1104764660.1048.578.camel@jzny.localdomain> <52brc68q05.fsf@topspin.com> <5cac192f05010308414a25b548@mail.gmail.com> <527jmu8nbw.fsf@topspin.com> <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119164640.6c67bdfa.davem@davemloft.net> <52r7kgu5n5.fsf@topspin.com> <20050119230526.393a5184.davem@davemloft.net> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 559 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev You might want to enforce that LLTX devices like tunnels need to have no transmit queue (tx_queue_len == 0)? I can run a test on 8 way with e1000 if it would help. From Robert.Olsson@data.slu.se Thu Jan 20 09:01:24 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 09:01:28 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KH1N2Y006629 for ; Thu, 20 Jan 2005 09:01:23 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0KH1H71020330; Thu, 20 Jan 2005 18:01:17 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 4A69EEC1A1; Thu, 20 Jan 2005 18:01:17 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16879.58333.266843.335475@robur.slu.se> Date: Thu, 20 Jan 2005 18:01:17 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501200837.40734.jeremy.guthrie@berbee.com> References: <200501191950.08567.jeremy.guthrie@berbee.com> <16879.38457.4576.598144@robur.slu.se> <200501200837.40734.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 560 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > > > 1024 buffers on the RX of eth3. > > > > > > echo 86400 > /proc/sys/net/ipv4/route/secret_interval > > > echo 524288 > /proc/sys/net/ipv4/route/gc_thresh > > > > rhash_entries? > I left that at 2.4 million. > > > > It appears to be cruising right along now. > size IN: hit tot mc no_rt bcast madst masrc OUT: hit tot mc > GC: tot ignored goal_miss ovrf HASH: in_search out_search > 524291 74169 779 0 0 0 0 0 2 0 > 1610369017 516 0 0 0 43612 0 > 524287 74830 777 0 0 0 0 0 6 0 > 0 498 0 0 0 40504 1 > 524285 77458 949 0 0 0 0 0 4 0 > 0 619 0 0 0 42731 1 Linear search is under control and number of dst entries very high but very constant at the cost of calling GC a number of times second. But I don't understand why we do not see any GC ignored. Did you ever write to gc_min_interval in proc? Never seen rtstat's like this but it seems to do the job. --ro From shemminger@osdl.org Thu Jan 20 09:07:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 09:07:19 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KH74Ig007251 for ; Thu, 20 Jan 2005 09:07:04 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0KH6Ol27015; Thu, 20 Jan 2005 09:06:24 -0800 Date: Thu, 20 Jan 2005 09:06:28 -0800 From: Stephen Hemminger To: Thomas Graf Cc: jamal , Patrick McHardy , netdev@oss.sgi.com, Werner Almesberger Subject: Re: [RFC] batched tc to improve change throughput Message-ID: <20050120090628.29205d59@dxpl.pdx.osdl.net> In-Reply-To: <20050120153559.GG26856@postel.suug.ch> References: <20050117160539.GD26856@postel.suug.ch> <1105979807.1078.16.camel@jzny.localdomain> <20050117165626.GE26856@postel.suug.ch> <1106002197.1046.19.camel@jzny.localdomain> <20050118134406.GR26856@postel.suug.ch> <1106058592.1035.95.camel@jzny.localdomain> <20050118145830.GS26856@postel.suug.ch> <1106144009.1047.989.camel@jzny.localdomain> <20050119165421.GB26856@postel.suug.ch> <1106232168.1041.125.camel@jzny.localdomain> <20050120153559.GG26856@postel.suug.ch> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 561 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev On Thu, 20 Jan 2005 16:35:59 +0100 Thomas Graf wrote: > * jamal <1106232168.1041.125.camel@jzny.localdomain> 2005-01-20 09:42 > > I like it. Assuming we can have arbitrary hierachies; you just show one > > level - but that may be just the example at hand. Given that should be > > able to meet the layout requirements that Lennert alluded to earlier. > > It doesn't include any context code, the BNF: > > PARSER := TOPNODE* > TOPNODE := NODELIST DESC LONG_DESC > NODELIST := NODE* > NODE := DESC [ NODELIST ] [ ARGUMENT ] [ ATTRS ] [ END_POINT ] > END_POINT := possible end of command > ATTRS := ATTR* > ATTR := KEY [ VALUE ] > ARGUMENT := VALUE [ DESC ] > > Not sure if this helps, I attached a complete module below. > Go for it! A couple additional suggestions. It would be great to get a useful API to for 'tc' that is one step above actual low level netlink stuff. And it would be great to reuse some existing scripting language grammar and parsing library infrastructure. Don't feel constrained to C on this. If using C++ or even something like phython or ruby would be better go ahead; but please no Perl. -- Stephen Hemminger From jeremy.guthrie@berbee.com Thu Jan 20 09:14:56 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 09:15:03 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KHEt8x007884 for ; Thu, 20 Jan 2005 09:14:56 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Thu, 20 Jan 2005 11:14:50 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Thu, 20 Jan 2005 11:14:46 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson References: <200501200837.40734.jeremy.guthrie@berbee.com> <16879.58333.266843.335475@robur.slu.se> In-Reply-To: <16879.58333.266843.335475@robur.slu.se> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1881411.M4NkWWNZBR"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501201114.49517.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 20 Jan 2005 17:14:50.0255 (UTC) FILETIME=[8CA8C9F0:01C4FF13] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 562 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev --nextPart1881411.M4NkWWNZBR Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thursday 20 January 2005 11:01 am, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > > > 1024 buffers on the RX of eth3. > > > > > > > > echo 86400 > /proc/sys/net/ipv4/route/secret_interval > > > > echo 524288 > /proc/sys/net/ipv4/route/gc_thresh > > > > > > rhash_entries? > > > > I left that at 2.4 million. > > > > > > It appears to be cruising right along now. > > > > size IN: hit tot mc no_rt bcast madst masrc OUT: hit to= t=20 > > mc GC: tot ignored goal_miss ovrf HASH: in_search out_search > > 524291 74169 779 0 0 0 0 0 2 = 0 > > 1610369017 516 0 0 0 43612 0 > > 524287 74830 777 0 0 0 0 0 6 = 0 > > 0 498 0 0 0 40504 1 > > 524285 77458 949 0 0 0 0 0 4 = 0 > > 0 619 0 0 0 42731 1 > > Linear search is under control and number of dst entries very high but > very constant at the cost of calling GC a number of times second. But I > don't understand why we do not see any GC ignored.=20 When does GC normally ignore? > Did you ever write to=20 > gc_min_interval in proc?=20 I left /proc/sys/net/ipv4/route/gc_min_interval at zero. > Never seen rtstat's like this but it seems to do the job. More numbers from right now with higher PPS rate. size IN: hit tot mc no_rt bcast madst masrc OUT: hit tot = mc=20 GC: tot ignored goal_miss ovrf HASH: in_search out_search 524291 92192 848 0 0 0 0 0 17 0=20 537114631 553 0 0 0 50947 18 524287 95496 846 0 0 0 0 0 4 0=20 1610369017 539 0 0 0 52000 4 524293 98503 791 0 0 0 0 0 7 0 = =20 0 525 0 0 0 53119 3 524290 98711 965 0 0 0 0 0 3 0 = =20 0 626 0 0 0 53448 3 =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart1881411.M4NkWWNZBR Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB7+cJqtjaBHGZBeURAjwaAJ4iC+M1ceW6Bxdt1QfihLuBdyukwwCdEOfV AcWUUMGTUkx4XUp9PtlI2Q8= =L3uC -----END PGP SIGNATURE----- --nextPart1881411.M4NkWWNZBR-- From tgraf@suug.ch Thu Jan 20 09:19:23 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 09:19:27 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KHJME7008414 for ; Thu, 20 Jan 2005 09:19:22 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id BFC2C87; Thu, 20 Jan 2005 18:18:58 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id D13911C0EA; Thu, 20 Jan 2005 18:19:40 +0100 (CET) Date: Thu, 20 Jan 2005 18:19:40 +0100 From: Thomas Graf To: Stephen Hemminger Cc: jamal , Patrick McHardy , netdev@oss.sgi.com, Werner Almesberger Subject: Re: [RFC] batched tc to improve change throughput Message-ID: <20050120171940.GJ26856@postel.suug.ch> References: <20050117165626.GE26856@postel.suug.ch> <1106002197.1046.19.camel@jzny.localdomain> <20050118134406.GR26856@postel.suug.ch> <1106058592.1035.95.camel@jzny.localdomain> <20050118145830.GS26856@postel.suug.ch> <1106144009.1047.989.camel@jzny.localdomain> <20050119165421.GB26856@postel.suug.ch> <1106232168.1041.125.camel@jzny.localdomain> <20050120153559.GG26856@postel.suug.ch> <20050120090628.29205d59@dxpl.pdx.osdl.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050120090628.29205d59@dxpl.pdx.osdl.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 563 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev * Stephen Hemminger <20050120090628.29205d59@dxpl.pdx.osdl.net> 2005-01-20 09:06 > On Thu, 20 Jan 2005 16:35:59 +0100 > Thomas Graf wrote: > > > * jamal <1106232168.1041.125.camel@jzny.localdomain> 2005-01-20 09:42 > > > I like it. Assuming we can have arbitrary hierachies; you just show one > > > level - but that may be just the example at hand. Given that should be > > > able to meet the layout requirements that Lennert alluded to earlier. > > > > It doesn't include any context code, the BNF: > > > > PARSER := TOPNODE* > > TOPNODE := NODELIST DESC LONG_DESC > > NODELIST := NODE* > > NODE := DESC [ NODELIST ] [ ARGUMENT ] [ ATTRS ] [ END_POINT ] > > END_POINT := possible end of command > > ATTRS := ATTR* > > ATTR := KEY [ VALUE ] > > ARGUMENT := VALUE [ DESC ] > > > > Not sure if this helps, I attached a complete module below. > > > > A couple additional suggestions. It would be great to get a useful API > to for 'tc' that is one step above actual low level netlink stuff. Planned. Trying to reuse an existing grammar but didn't found that suits well enough yet. > And it would be great to reuse some existing scripting language grammar > and parsing library infrastructure. Tried very hard to do so. I'd really like to build upon readline and its completion method but most parser generators are not made to get along with readline + completion. A c++ hack exist but doesn't really work with completion. That's why I wrote my own grammar definition thing. From dave@thedillows.org Thu Jan 20 09:22:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 09:22:43 -0800 (PST) Received: from iasrv1.idleaire.net (NS1.idleaire.net [65.220.16.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KHMar7008916 for ; Thu, 20 Jan 2005 09:22:37 -0800 Received: by iasrv1.idleaire.net (Postfix, from userid 300) id DE86F236E5C; Thu, 20 Jan 2005 12:22:30 -0500 (EST) Received: from corp4.idleaire.com (corp4.idleaire.com [10.1.66.36]) by iasrv1.idleaire.net (Postfix) with ESMTP id 982CC236E5A; Thu, 20 Jan 2005 12:22:30 -0500 (EST) Received: from knox.voodoobox.net ([10.1.66.124]) by corp4.idleaire.com with Microsoft SMTPSVC(5.0.2195.6713); Thu, 20 Jan 2005 12:22:30 -0500 Subject: Re: [RFC BK 0/22] xfrm offload v2: Add hardware assist for IPSEC crypto From: Dave Dillow To: James Morris Cc: netdev@oss.sgi.com In-Reply-To: References: Content-Type: text/plain Message-Id: <1106241747.7097.5.camel@dillow.idleaire.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Thu, 20 Jan 2005 12:22:27 -0500 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 20 Jan 2005 17:22:30.0600 (UTC) FILETIME=[9F0BDC80:01C4FF14] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 564 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev [Sorry for the delay, my office at home got taken out Monday night...] On Mon, 2005-01-17 at 14:00, James Morris wrote: > On Mon, 10 Jan 2005, David Dillow wrote: > > > * Only the 3Com 3CR990 family of NICs are supported. I don't have hardware > > or documentation for the Intel cards. > > Is documentation for the 3com card freely available? Not to my knowledge, no. It should still be available under NDA, which is how I got ahold of it. > Also, are the cards still available on the market? The 3com site says > the 3CR990-TX-97 and -95 cards are discontinued. You can still find some of those, even though they're discontinuted. The family lives on in the 3CR990B-97 series, which are also supported by the typhoon driver. -- Dave Dillow From jt@hpl.hp.com Thu Jan 20 09:29:58 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 09:30:02 -0800 (PST) Received: from palrel11.hp.com (palrel11.hp.com [156.153.255.246]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KHTvcj009478 for ; Thu, 20 Jan 2005 09:29:58 -0800 Received: from tomil.hpl.hp.com (tomil.hpl.hp.com [15.0.152.100]) by palrel11.hp.com (Postfix) with ESMTP id D15AE53B09; Thu, 20 Jan 2005 09:25:22 -0800 (PST) Received: from bougret.hpl.hp.com (bougret.hpl.hp.com [15.4.92.227]) by tomil.hpl.hp.com (8.9.3 (PHNE_29774)/8.9.3 HPLabs Timeshare Server) with ESMTP id JAA19280; Thu, 20 Jan 2005 09:27:06 -0800 (PST) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 1Crg3e-00022o-00; Thu, 20 Jan 2005 09:25:22 -0800 Date: Thu, 20 Jan 2005 09:25:22 -0800 To: Arnaldo Carvalho de Melo Cc: Christoph Hellwig , "David S. Miller" , irda-users@lists.sourceforge.net, netdev@oss.sgi.com, Stephen Hemminger Subject: Re: [PATCH 6/9] irda: use sock slab cache Message-ID: <20050120172522.GF6839@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com References: <41EF11AF.70203@conectiva.com.br> <20050120021607.GA11216@bougret.hpl.hp.com> <41EF29BE.2020807@conectiva.com.br> <20050120085454.GA31160@infradead.org> <41EFC671.6000706@conectiva.com.br> <41EFCC51.8030700@conectiva.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41EFCC51.8030700@conectiva.com.br> User-Agent: Mutt/1.3.28i Organisation: HP Labs Palo Alto Address: HP Labs, 1U-17, 1501 Page Mill road, Palo Alto, CA 94304, USA. E-mail: jt@hpl.hp.com From: Jean Tourrilhes X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 565 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jt@hpl.hp.com Precedence: bulk X-list: netdev On Thu, Jan 20, 2005 at 01:20:49PM -0200, Arnaldo Carvalho de Melo wrote: > Arnaldo Carvalho de Melo escreveu: > >Christoph Hellwig escreveu: > > > >>On Thu, Jan 20, 2005 at 01:47:10AM -0200, Arnaldo Carvalho de Melo wrote: > >> > >>>> I'm just curious about the overhead of adding a specific slab > >>>>for IrDA sockets. Most users never create any (using IrCOMM), or > >>>>maximum one (using Obex), so it's not like it will get a lot of use > >>>>(except here, of course). > >>> > >>> > >>>Well, lets start with something that may sound funny: when this series > >>>of patches is finished the overhead will _decrease_ for most people. > >>> > >>>Why? Today we have in most machines five slab caches of this nature: > >>>udp_sock, raw_sock, tcp_sock, unix_sock (PF_LOCAL) and the generic, > >>>sock, that only is used by the protocols that are using > >>>kmalloc(pritave_sock) + > >>>sk_protinfo. > >> > >> > >> > >>But as Jean sais this type of socket is used very little, as are a few > >>other probably (raw, pfkey?), so maybe those should just use kmalloc + > >>kfree instead of their own slab? Just to clarify, but I think you already got this nuance. I was not talking about the frequency of people using IrDA. I just say that when people use IrDA, they are likely to use few sockets (as opposed to a web browser that open zillions of TCP sockets). There may be other socket types that falls under this category. One example is raw socket. It's used relatively frequently, but usually the number of raw sockets on the system is limited (how many instance of tcpdump or ethereal will you run in parallel ?). On the other hand, some sockets may be seldom used, but when used many of them are open, and therefore would justify their own slab (on demand). Maybe ATM sockets would be a good example. > Take a look at this patch, it shows how I think the transitional > stage should be, the protocols will just use (IRDA for the example): Can't we just transition IrDA sockets to "future", rather than "transitional". This way we are done, and no longer need to worry about it. I mean, you already did the patch, so what's the reason of holding back ? Thanks... Jean From jgarzik@pobox.com Thu Jan 20 11:17:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 11:17:25 -0800 (PST) Received: from parcelfarce.linux.theplanet.co.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KJHJf3013568 for ; Thu, 20 Jan 2005 11:17:20 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by parcelfarce.linux.theplanet.co.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1Crhnu-0005Uw-Sh; Thu, 20 Jan 2005 19:17:15 +0000 Message-ID: <41F003A8.3050806@pobox.com> Date: Thu, 20 Jan 2005 14:16:56 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: Roland Dreier , shemminger@osdl.org, hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [PATCH]: was Re: LLTX and netif_stop_queue References: <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> <5cac192f0501021530672a908a@mail.gmail.com> <1104764660.1048.578.camel@jzny.localdomain> <52brc68q05.fsf@topspin.com> <5cac192f05010308414a25b548@mail.gmail.com> <527jmu8nbw.fsf@topspin.com> <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119164640.6c67bdfa.davem@davemloft.net> <52r7kgu5n5.fsf@topspin.com> <20050119230526.393a5184.davem@davemloft.net> In-Reply-To: <20050119230526.393a5184.davem@davemloft.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 566 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Reminder: double-check that the locking rules in Documentation/networking/netdevices.txt still apply; update the text file where you changed things. From acme@conectiva.com.br Thu Jan 20 13:05:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 13:05:21 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KL5Ewc019374 for ; Thu, 20 Jan 2005 13:05:15 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CrikV-0001IY-00; Thu, 20 Jan 2005 18:17:47 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 3B4501462D; Thu, 20 Jan 2005 19:05:09 -0200 (BRST) Message-ID: <41F01DB6.3070605@conectiva.com.br> Date: Thu, 20 Jan 2005 19:08:06 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: jt@hpl.hp.com Cc: Christoph Hellwig , "David S. Miller" , irda-users@lists.sourceforge.net, netdev@oss.sgi.com, Stephen Hemminger Subject: Re: [PATCH 6/9] irda: use sock slab cache References: <41EF11AF.70203@conectiva.com.br> <20050120021607.GA11216@bougret.hpl.hp.com> <41EF29BE.2020807@conectiva.com.br> <20050120085454.GA31160@infradead.org> <41EFC671.6000706@conectiva.com.br> <41EFCC51.8030700@conectiva.com.br> <20050120172522.GF6839@bougret.hpl.hp.com> In-Reply-To: <20050120172522.GF6839@bougret.hpl.hp.com> X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 567 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Jean Tourrilhes escreveu: > On Thu, Jan 20, 2005 at 01:20:49PM -0200, Arnaldo Carvalho de Melo wrote: >>Take a look at this patch, it shows how I think the transitional >>stage should be, the protocols will just use (IRDA for the example): > > > Can't we just transition IrDA sockets to "future", rather than > "transitional". This way we are done, and no longer need to worry > about it. I mean, you already did the patch, so what's the reason of > holding back ? No, no reason, this latest scheme is good to balance the needs of performance protocols critical protocols (tcp, etc) and the ones where the overhead of a private slabcache is too much, the transitional solution is just to keep the "old protocols", i.e. the ones not converted yet, working for the time being. IRDA, from what we discussed, will be converted today to its final form, that is, without an slab cache, aggregate kmalloc at sk_alloc time, not using anymore the generic "sock" slab. - Arnaldo From davem@davemloft.net Thu Jan 20 13:36:40 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 13:36:47 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KLae5x020434 for ; Thu, 20 Jan 2005 13:36:40 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Crjwa-0003HI-00; Thu, 20 Jan 2005 13:34:20 -0800 Date: Thu, 20 Jan 2005 13:34:20 -0800 From: "David S. Miller" To: Tommy Christensen Cc: roland@topspin.com, shemminger@osdl.org, hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [PATCH]: was Re: LLTX and netif_stop_queue Message-Id: <20050120133420.317bea31.davem@davemloft.net> In-Reply-To: <1106229084.5812.40.camel@tsc-6.cph.tpack.net> References: <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> <5cac192f0501021530672a908a@mail.gmail.com> <1104764660.1048.578.camel@jzny.localdomain> <52brc68q05.fsf@topspin.com> <5cac192f05010308414a25b548@mail.gmail.com> <527jmu8nbw.fsf@topspin.com> <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119164640.6c67bdfa.davem@davemloft.net> <52r7kgu5n5.fsf@topspin.com> <20050119230526.393a5184.davem@davemloft.net> <1106229084.5812.40.camel@tsc-6.cph.tpack.net> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 568 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Thu, 20 Jan 2005 14:51:25 +0100 Tommy Christensen wrote: > A lot more serious is the fact that ->tx_timeout() and > ->hard_start_xmit() are no longer allowed to do this: > > spin_lock_irq() > ... > spin_unlock_irq() > > since that would leave us with irq's enabled while still > holding the xmit_lock. > This would have to be fixed for non-LLTX drivers as well. Even worse is that this breaks the acenic driver too because it does this: unsigned long maxjiff = jiffies + 3*HZ; if (time_before(jiffies, maxjiff)) { barrier(); cpu_relax(); goto restart; } in it's ->hard_start_xmit() routine. I was auditing spin_lock_irq() usage in ->hard_start_xmit() routines when I caught this. This one isn't impossible to fix though. We can replace the jiffies games with a udelay/mdelay and a "maxloop" variable. Any takers? I'll keep working on the spin_lock_irq() audit then work on the other problems Tommy found. From davem@davemloft.net Thu Jan 20 13:43:43 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 13:43:49 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KLhhjG020965 for ; Thu, 20 Jan 2005 13:43:43 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Crk3c-0003K7-00; Thu, 20 Jan 2005 13:41:36 -0800 Date: Thu, 20 Jan 2005 13:41:35 -0800 From: "David S. Miller" To: Tommy Christensen Cc: roland@topspin.com, shemminger@osdl.org, hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [PATCH]: was Re: LLTX and netif_stop_queue Message-Id: <20050120134135.567e1cee.davem@davemloft.net> In-Reply-To: <1106229084.5812.40.camel@tsc-6.cph.tpack.net> References: <5cac192f0412230110628749e3@mail.gmail.com> <41CAF444.3000305@trash.net> <5cac192f04122408102129af43@mail.gmail.com> <1104240717.1100.66.camel@jzny.localdomain> <5cac192f0501021530672a908a@mail.gmail.com> <1104764660.1048.578.camel@jzny.localdomain> <52brc68q05.fsf@topspin.com> <5cac192f05010308414a25b548@mail.gmail.com> <527jmu8nbw.fsf@topspin.com> <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119164640.6c67bdfa.davem@davemloft.net> <52r7kgu5n5.fsf@topspin.com> <20050119230526.393a5184.davem@davemloft.net> <1106229084.5812.40.camel@tsc-6.cph.tpack.net> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 569 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Thu, 20 Jan 2005 14:51:25 +0100 Tommy Christensen wrote: > A lot more serious is the fact that ->tx_timeout() and > ->hard_start_xmit() are no longer allowed to do this: Sigh, there are even more issues. Now dev_kfree_skb() is illegal in ->hard_start_xmit() because interrupts are disabled, and there are many such cases in the simpler net drivers. I think we might need to revert the change over to IRQ disabling dev->xmit_lock and rethink this. This is just too much fallout. From Robert.Olsson@data.slu.se Thu Jan 20 13:53:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 13:53:40 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KLrXNT021605 for ; Thu, 20 Jan 2005 13:53:34 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0KLrU2T025933; Thu, 20 Jan 2005 22:53:30 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 14D3BEC1A0; Thu, 20 Jan 2005 22:53:30 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16880.10330.49064.721090@robur.slu.se> Date: Thu, 20 Jan 2005 22:53:30 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501201114.49517.jeremy.guthrie@berbee.com> References: <200501200837.40734.jeremy.guthrie@berbee.com> <16879.58333.266843.335475@robur.slu.se> <200501201114.49517.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 570 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeremy M. Guthrie writes: > > > mc GC: tot ignored goal_miss ovrf HASH: in_search out_search > > > 524287 74830 777 0 0 0 0 0 6 0 > > > 0 498 0 0 0 40504 1 > When does GC normally ignore? At a min ip_rt_gc_min_interval = HZ / 2; From what I understand your GC runs more often than that. Do your understand? Test is in rt_garbage_collect() --ro From grundler@cup.hp.com Thu Jan 20 13:57:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 13:57:35 -0800 (PST) Received: from palrel11.hp.com (palrel11.hp.com [156.153.255.246]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KLvSiD022103 for ; Thu, 20 Jan 2005 13:57:31 -0800 Received: from esmail.cup.hp.com (esmail.cup.hp.com [15.0.65.164]) by palrel11.hp.com (Postfix) with ESMTP id D97463AA66; Thu, 20 Jan 2005 13:57:08 -0800 (PST) Received: from localhost.localdomain (postfix@debian.cup.hp.com [15.244.57.47]) by esmail.cup.hp.com (8.9.3 (PHNE_29774)/8.8.6) with ESMTP id NAA20480; Thu, 20 Jan 2005 13:53:42 -0800 (PST) Received: by localhost.localdomain (Postfix, from userid 1000) id 1CD508FF7E; Thu, 20 Jan 2005 13:56:50 -0800 (PST) Date: Thu, 20 Jan 2005 13:56:50 -0800 From: Grant Grundler To: "David S. Miller" Cc: Tommy Christensen , roland@topspin.com, shemminger@osdl.org, hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [PATCH]: was Re: LLTX and netif_stop_queue Message-ID: <20050120215650.GB14521@esmail.cup.hp.com> References: <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119164640.6c67bdfa.davem@davemloft.net> <52r7kgu5n5.fsf@topspin.com> <20050119230526.393a5184.davem@davemloft.net> <1106229084.5812.40.camel@tsc-6.cph.tpack.net> <20050120133420.317bea31.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050120133420.317bea31.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 571 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: iod00d@hp.com Precedence: bulk X-list: netdev On Thu, Jan 20, 2005 at 01:34:20PM -0800, David S. Miller wrote: > Even worse is that this breaks the acenic driver too because > it does this: > > unsigned long maxjiff = jiffies + 3*HZ; > > if (time_before(jiffies, maxjiff)) { > barrier(); > cpu_relax(); > goto restart; > } > > in it's ->hard_start_xmit() routine. > > I was auditing spin_lock_irq() usage in ->hard_start_xmit() > routines when I caught this. > > This one isn't impossible to fix though. We can replace the > jiffies games with a udelay/mdelay and a "maxloop" variable. > Any takers? I saw the next mail suggesting to revert the changes because of more fallout. But if/when acenic needs changes like those proposed above, I can implement and test proposed changes if folks have the patience to wait a week or so. acenic is no where on my "official HP supported NICs" list but I happen to have the HW/infrastructure to test them. grant From syrius.ml@no-log.org Thu Jan 20 14:25:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 14:25:20 -0800 (PST) Received: from main.uucpssh.org (main.uucpssh.org [212.27.33.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KMPEiZ022936 for ; Thu, 20 Jan 2005 14:25:15 -0800 Received: from localhost (localhost [127.0.0.1]) by main.uucpssh.org (Postfix) with ESMTP id 6E5BB2C27 for ; Thu, 20 Jan 2005 23:25:08 +0100 (CET) Received: by main.uucpssh.org (Postfix, from userid 10) id B28C76B9BD; Thu, 20 Jan 2005 23:25:07 +0100 (CET) Received: by f.smtp.localhost (Postfix, from userid 1000) id 93CBC304; Thu, 20 Jan 2005 23:22:16 +0100 (CET) Delivered-To: syrius.ml@no-log.org To: netdev@oss.sgi.com Subject: 2.6.10-ac8 - kernel BUG at net/ipv4/tcp_output.c:922! References: <41DFEDA8.7030805@wasp.net.au> From: syrius.ml@no-log.org Date: Thu, 20 Jan 2005 14:16:42 +0100 In-Reply-To: <41DFEDA8.7030805@wasp.net.au> (Brad Campbell's message of "Sat, 08 Jan 2005 18:26:48 +0400") Message-ID: <87hdlbpwpz.87fz0vpwpz@87ekgfpwpz.message.id> User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 572 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: syrius.ml@no-log.org Precedence: bulk X-list: netdev I should have reported this problem here first (rather than in lmkl) It has been already reported on lkml by Brad Campbell (then forwarded here by randy) Don't know if it has something to do with the tcp bug that was fixed for 2.6.9. here is my original mail: I've just experienced this oops too. The kernel is a 2.6.10-ac8 and it doesn't seem this issue has been fixed in 2.6.10-ac10 nor in 2.6.11-rc1 (sure I'd love to be wrong here ;-) ) kernel BUG at net/ipv4/tcp_output.c:922! invalid operand: 0000 [#1] PREEMPT SMP Modules linked in: nfsd exportfs parport_pc lp parport nfs lockd sunrpc ipt_TCPMSS iptable_mangle ipt_owner iptable_nat ip_conntrack ip_tables uhci_hcd usbcore intel_agp evdev raid5 xor md dm_mod md5 ipv6 adm1021 eeprom i2c_piix4 i2c_isa lm75 lm78 w83781d i2c_sensor i2c_core agpgart scsi_mod 3c59x CPU: 0 EIP: 0060:[] Not tainted VLI EFLAGS: 00010202 (2.6.10-ac8) EIP is at tcp_retrans_try_collapse+0x321/0x340 eax: e2868c80 ebx: c6060e20 ecx: 00000394 edx: 000005ac esi: c9aaa2e8 edi: 00000000 ebp: f39d7ae0 esp: c036de90 ds: 007b es: 007b ss: 0068 Process swapper (pid: 0, threadinfo=c036c000 task=c02f7b40) Stack: c03a287c 00000002 00000002 00000394 00000218 00000010 00000218 d664acd4 d664aae0 0000ffff d664acd4 c6060e20 d664aae0 c0282b0c d664aae0 c6060e20 000005ac c027a447 000005ac d664aae0 d664acd4 d664ab44 00000000 c0284a57 Call Trace: [] tcp_retransmit_skb+0x2ec/0x360 [] tcp_enter_loss+0x67/0x230 [] tcp_retransmit_timer+0x107/0x470 [] rebalance_tick+0xbf/0xd0 [] tcp_write_timer+0xae/0xf0 [] scheduler_tick+0x123/0x480 [] tcp_write_timer+0x0/0xf0 [] run_timer_softirq+0xda/0x1a0 [] __do_softirq+0xba/0xd0 [] do_softirq+0x2d/0x30 [] irq_exit+0x39/0x40 [] apic_timer_interrupt+0x1c/0x24 [] default_idle+0x0/0x40 [] default_idle+0x2c/0x40 [] cpu_idle+0x42/0x60 [] start_kernel+0x154/0x170 [] unknown_bootoption+0x0/0x1e0 Code: e9 7f fe ff ff c7 44 24 08 53 26 28 c0 89 54 24 04 89 1c 24 e8 d1 9c fc ff e9 3a fe ff ff 0f 0b c9 02 cc 1d 2d c0 e9 0a fe ff ff <0f> 0b 9a 03 1a 15 2e c0 e9 c2 fd ff ff 89 f6 31 c0 e9 7f fd ff <0>Kernel panic - not syncing: Fatal exception in interrupt most of the netfilter modules reported above were in used. I can provide more informations if needed. -- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ From mchan@broadcom.com Thu Jan 20 14:52:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 14:52:48 -0800 (PST) Received: from mms3.broadcom.com (mms-nat.broadcom.com [63.70.210.58]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KMqfCP027413 for ; Thu, 20 Jan 2005 14:52:42 -0800 Received: from 63.70.210.1 by mms3.broadcom.com with SMTP (Broadcom SMTP Relay (MMS v5.6.0)); Thu, 20 Jan 2005 14:52:22 -0800 X-Server-Uuid: 062D48FB-9769-4139-967C-478C67B5F9C9 Received: from mail-irva-8.broadcom.com ([10.10.64.221]) by mail-irva-1.broadcom.com (Post.Office MTA v3.5.3 release 223 ID# 0-72233U7200L2200S0V35) with ESMTP id com for ; Thu, 20 Jan 2005 14:52:20 -0800 Received: from mon-irva-10.broadcom.com (mon-irva-10.broadcom.com [10.10.64.171]) by mail-irva-8.broadcom.com (MOS 3.5.6-GR) with ESMTP id AHN00622; Thu, 20 Jan 2005 14:52:15 -0800 (PST) Received: from nt-irva-0741.brcm.ad.broadcom.com ( nt-irva-0741.brcm.ad.broadcom.com [10.8.194.54]) by mon-irva-10.broadcom.com (8.9.1/8.9.1) with ESMTP id OAA22644 for ; Thu, 20 Jan 2005 14:52:15 -0800 (PST) X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Subject: [PATCH 2.6.10] tg3: add tg3_set_eeprom Date: Thu, 20 Jan 2005 14:52:14 -0800 Message-ID: X-MS-Has-Attach: yes Thread-Topic: [PATCH 2.6.10] tg3: add tg3_set_eeprom Thread-Index: AcT/Qq9ZWhdxPRLxTNGyAHji/jjpgQ== From: "Michael Chan" To: netdev@oss.sgi.com X-WSS-ID: 6DEEE9AC1W4478160-01-01 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C4FF42.AF5E5881" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 573 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mchan@broadcom.com Precedence: bulk X-list: netdev This is a multi-part message in MIME format. ------_=_NextPart_001_01C4FF42.AF5E5881 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Add tg3_set_eeprom routine to support configuration changes (e.g. ASF config). Made changes to other nvram related routines. Signed-off-by: Michael Chan ------_=_NextPart_001_01C4FF42.AF5E5881 Content-Type: application/octet-stream; name=tg3_nvram.patch Content-Transfer-Encoding: base64 Content-Description: tg3_nvram.patch Content-Disposition: attachment; filename=tg3_nvram.patch ZGlmZiAtTnJ1IDEvdGczLmMgMi90ZzMuYwotLS0gMS90ZzMuYwkyMDA1LTAxLTE2IDExOjM2OjA4 LjAwMDAwMDAwMCAtMDgwMAorKysgMi90ZzMuYwkyMDA1LTAxLTE5IDE0OjI5OjIxLjAwMDAwMDAw MCAtMDgwMApAQCAtNjM3MCwxMSArNjM3MCwxMyBAQAogCiBzdGF0aWMgaW50IHRnM19nZXRfZWVw cm9tX2xlbihzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KQogewotCXJldHVybiBFRVBST01fQ0hJUF9T SVpFOworCXN0cnVjdCB0ZzMgKnRwID0gbmV0ZGV2X3ByaXYoZGV2KTsKKworCXJldHVybiB0cC0+ bnZyYW1fc2l6ZTsKIH0KIAotc3RhdGljIGludCB0ZzNfbnZyYW1fcmVhZF91c2luZ19lZXByb20o c3RydWN0IHRnMyAqdHAsCi0JCQkJCXUzMiBvZmZzZXQsIHUzMiAqdmFsKTsKK3N0YXRpYyBpbnQg dGczX252cmFtX3JlYWQoc3RydWN0IHRnMyAqdHAsIHUzMiBvZmZzZXQsIHUzMiAqdmFsKTsKKwog c3RhdGljIGludCB0ZzNfZ2V0X2VlcHJvbShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LCBzdHJ1Y3Qg ZXRodG9vbF9lZXByb20gKmVlcHJvbSwgdTggKmRhdGEpCiB7CiAJc3RydWN0IHRnMyAqdHAgPSBu ZXRkZXZfcHJpdihkZXYpOwpAQCAtNjM4NiwxMCArNjM4OCw3IEBACiAJbGVuID0gZWVwcm9tLT5s ZW47CiAJZWVwcm9tLT5sZW4gPSAwOwogCi0JcmV0ID0gdGczX252cmFtX3JlYWRfdXNpbmdfZWVw cm9tKHRwLCAwLCAmZWVwcm9tLT5tYWdpYyk7Ci0JaWYgKHJldCkKLQkJcmV0dXJuIHJldDsKLQll ZXByb20tPm1hZ2ljID0gc3dhYjMyKGVlcHJvbS0+bWFnaWMpOworCWVlcHJvbS0+bWFnaWMgPSBU RzNfRUVQUk9NX01BR0lDOwogCiAJaWYgKG9mZnNldCAmIDMpIHsKIAkJLyogYWRqdXN0bWVudHMg dG8gc3RhcnQgb24gcmVxdWlyZWQgNCBieXRlIGJvdW5kYXJ5ICovCkBAIC02Mzk5LDkgKzYzOTgs MTAgQEAKIAkJCS8qIGkuZS4gb2Zmc2V0PTEgbGVuPTIgKi8KIAkJCWJfY291bnQgPSBsZW47CiAJ CX0KLQkJcmV0ID0gdGczX252cmFtX3JlYWRfdXNpbmdfZWVwcm9tKHRwLCBvZmZzZXQtYl9vZmZz ZXQsICZ2YWwpOworCQlyZXQgPSB0ZzNfbnZyYW1fcmVhZCh0cCwgb2Zmc2V0LWJfb2Zmc2V0LCAm dmFsKTsKIAkJaWYgKHJldCkKIAkJCXJldHVybiByZXQ7CisJCXZhbCA9IGNwdV90b19sZTMyKHZh bCk7CiAJCW1lbWNweShkYXRhLCAoKGNoYXIqKSZ2YWwpICsgYl9vZmZzZXQsIGJfY291bnQpOwog CQlsZW4gLT0gYl9jb3VudDsKIAkJb2Zmc2V0ICs9IGJfY291bnQ7CkBAIC02NDExLDEyICs2NDEx LDEzIEBACiAJLyogcmVhZCBieXRlcyB1cHRvIHRoZSBsYXN0IDQgYnl0ZSBib3VuZGFyeSAqLwog CXBkID0gJmRhdGFbZWVwcm9tLT5sZW5dOwogCWZvciAoaSA9IDA7IGkgPCAobGVuIC0gKGxlbiAm IDMpKTsgaSArPSA0KSB7Ci0JCXJldCA9IHRnM19udnJhbV9yZWFkX3VzaW5nX2VlcHJvbSh0cCwg b2Zmc2V0ICsgaSwgCi0JCQkJKHUzMiopKHBkICsgaSkpOworCQlyZXQgPSB0ZzNfbnZyYW1fcmVh ZCh0cCwgb2Zmc2V0ICsgaSwgJnZhbCk7CiAJCWlmIChyZXQpIHsKIAkJCWVlcHJvbS0+bGVuICs9 IGk7CiAJCQlyZXR1cm4gcmV0OwogCQl9CisJCXZhbCA9IGNwdV90b19sZTMyKHZhbCk7CisJCW1l bWNweShwZCArIGksICZ2YWwsIDQpOwogCX0KIAllZXByb20tPmxlbiArPSBpOwogCkBAIC02NDI1 LDE1ICs2NDI2LDcyIEBACiAJCXBkID0gJmRhdGFbZWVwcm9tLT5sZW5dOwogCQliX2NvdW50ID0g bGVuICYgMzsKIAkJYl9vZmZzZXQgPSBvZmZzZXQgKyBsZW4gLSBiX2NvdW50OwotCQlyZXQgPSB0 ZzNfbnZyYW1fcmVhZF91c2luZ19lZXByb20odHAsIGJfb2Zmc2V0LCAmdmFsKTsKKwkJcmV0ID0g dGczX252cmFtX3JlYWQodHAsIGJfb2Zmc2V0LCAmdmFsKTsKIAkJaWYgKHJldCkKIAkJCXJldHVy biByZXQ7CisJCXZhbCA9IGNwdV90b19sZTMyKHZhbCk7CiAJCW1lbWNweShwZCwgKChjaGFyKikm dmFsKSwgYl9jb3VudCk7CiAJCWVlcHJvbS0+bGVuICs9IGJfY291bnQ7CiAJfQogCXJldHVybiAw OwogfQogCitzdGF0aWMgaW50IHRnM19udnJhbV93cml0ZV9ibG9jayhzdHJ1Y3QgdGczICp0cCwg dTMyIG9mZnNldCwgdTMyIGxlbiwgdTggKmJ1Zik7IAorCitzdGF0aWMgaW50IHRnM19zZXRfZWVw cm9tKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsIHN0cnVjdCBldGh0b29sX2VlcHJvbSAqZWVwcm9t LCB1OCAqZGF0YSkKK3sKKwlzdHJ1Y3QgdGczICp0cCA9IG5ldGRldl9wcml2KGRldik7CisJaW50 IHJldDsKKwl1MzIgb2Zmc2V0LCBsZW4sIGJfb2Zmc2V0LCBvZGRfbGVuLCBzdGFydCwgZW5kOwor CXU4ICpidWY7CisKKwlpZiAoZWVwcm9tLT5tYWdpYyAhPSBURzNfRUVQUk9NX01BR0lDKQorCQly ZXR1cm4gLUVJTlZBTDsKKworCW9mZnNldCA9IGVlcHJvbS0+b2Zmc2V0OworCWxlbiA9IGVlcHJv bS0+bGVuOworCisJaWYgKChiX29mZnNldCA9IChvZmZzZXQgJiAzKSkpIHsKKwkJLyogYWRqdXN0 bWVudHMgdG8gc3RhcnQgb24gcmVxdWlyZWQgNCBieXRlIGJvdW5kYXJ5ICovCisJCXJldCA9IHRn M19udnJhbV9yZWFkKHRwLCBvZmZzZXQtYl9vZmZzZXQsICZzdGFydCk7CisJCWlmIChyZXQpCisJ CQlyZXR1cm4gcmV0OworCQlzdGFydCA9IGNwdV90b19sZTMyKHN0YXJ0KTsKKwkJbGVuICs9IGJf b2Zmc2V0OworCQlvZmZzZXQgJj0gfjM7CisJfQorCisJb2RkX2xlbiA9IDA7CisJaWYgKChsZW4g JiAzKSAmJiAoKGxlbiA+IDQpIHx8IChiX29mZnNldCA9PSAwKSkpIHsKKwkJLyogYWRqdXN0bWVu dHMgdG8gZW5kIG9uIHJlcXVpcmVkIDQgYnl0ZSBib3VuZGFyeSAqLworCQlvZGRfbGVuID0gMTsK KwkJbGVuID0gKGxlbiArIDMpICYgfjM7CisJCXJldCA9IHRnM19udnJhbV9yZWFkKHRwLCBvZmZz ZXQrbGVuLTQsICZlbmQpOworCQlpZiAocmV0KQorCQkJcmV0dXJuIHJldDsKKwkJZW5kID0gY3B1 X3RvX2xlMzIoZW5kKTsKKwl9CisKKwlidWYgPSBkYXRhOworCWlmIChiX29mZnNldCB8fCBvZGRf bGVuKSB7CisJCWJ1ZiA9IGttYWxsb2MobGVuLCBHRlBfS0VSTkVMKTsKKwkJaWYgKGJ1ZiA9PSAw KQorCQkJcmV0dXJuIC1FTk9NRU07CisJCWlmIChiX29mZnNldCkKKwkJCW1lbWNweShidWYsICZz dGFydCwgNCk7CisJCWlmIChvZGRfbGVuKQorCQkJbWVtY3B5KGJ1ZitsZW4tNCwgJmVuZCwgNCk7 CisJCW1lbWNweShidWYgKyBiX29mZnNldCwgZGF0YSwgZWVwcm9tLT5sZW4pOworCX0KKworCXJl dCA9IHRnM19udnJhbV93cml0ZV9ibG9jayh0cCwgb2Zmc2V0LCBsZW4sIGJ1Zik7CisKKwlpZiAo YnVmICE9IGRhdGEpCisJCWtmcmVlKGJ1Zik7CisKKwlyZXR1cm4gcmV0OworfQorCiBzdGF0aWMg aW50IHRnM19nZXRfc2V0dGluZ3Moc3RydWN0IG5ldF9kZXZpY2UgKmRldiwgc3RydWN0IGV0aHRv b2xfY21kICpjbWQpCiB7CiAgIAlzdHJ1Y3QgdGczICp0cCA9IG5ldGRldl9wcml2KGRldik7CkBA IC02ODMzLDYgKzY4OTEsNyBAQAogCS5nZXRfbGluawkJPSBldGh0b29sX29wX2dldF9saW5rLAog CS5nZXRfZWVwcm9tX2xlbgkJPSB0ZzNfZ2V0X2VlcHJvbV9sZW4sCiAJLmdldF9lZXByb20JCT0g dGczX2dldF9lZXByb20sCisJLnNldF9lZXByb20JCT0gdGczX3NldF9lZXByb20sCiAJLmdldF9y aW5ncGFyYW0JCT0gdGczX2dldF9yaW5ncGFyYW0sCiAJLnNldF9yaW5ncGFyYW0JCT0gdGczX3Nl dF9yaW5ncGFyYW0sCiAJLmdldF9wYXVzZXBhcmFtCQk9IHRnM19nZXRfcGF1c2VwYXJhbSwKQEAg LTY4NTIsNiArNjkxMSwxMDMgQEAKIAkuZ2V0X2V0aHRvb2xfc3RhdHMJPSB0ZzNfZ2V0X2V0aHRv b2xfc3RhdHMsCiB9OwogCitzdGF0aWMgdm9pZCBfX2RldmluaXQgdGczX2dldF9lZXByb21fc2l6 ZShzdHJ1Y3QgdGczICp0cCkKK3sKKwl1MzIgY3Vyc2l6ZSwgdmFsOworCisJdHAtPm52cmFtX3Np emUgPSBFRVBST01fQ0hJUF9TSVpFOworCisJaWYgKHRnM19udnJhbV9yZWFkKHRwLCAwLCAmdmFs KSAhPSAwKQorCQlyZXR1cm47CisKKwlpZiAoc3dhYjMyKHZhbCkgIT0gVEczX0VFUFJPTV9NQUdJ QykKKwkJcmV0dXJuOworCisJLyoKKwkgKiBTaXplIHRoZSBjaGlwIGJ5IHJlYWRpbmcgb2Zmc2V0 cyBhdCBpbmNyZWFzaW5nIHBvd2VycyBvZiB0d28uCisJICogV2hlbiB3ZSBlbmNvdW50ZXIgb3Vy IHZhbGlkYXRpb24gc2lnbmF0dXJlLCB3ZSBrbm93IHRoZSBhZGRyZXNzaW5nCisJICogaGFzIHdy YXBwZWQgYXJvdW5kLCBhbmQgdGh1cyBoYXZlIG91ciBjaGlwIHNpemUuCisJICovCisJY3Vyc2l6 ZSA9IDB4ODAwOworCisJd2hpbGUgKGN1cnNpemUgPCB0cC0+bnZyYW1fc2l6ZSkgeworCQlpZiAo dGczX252cmFtX3JlYWQodHAsIGN1cnNpemUsICZ2YWwpICE9IDApCisJCQlyZXR1cm47CisKKwkJ aWYgKHN3YWIzMih2YWwpID09IFRHM19FRVBST01fTUFHSUMpCisJCQlicmVhazsKKworCQljdXJz aXplIDw8PSAxOworCX0KKworCXRwLT5udnJhbV9zaXplID0gY3Vyc2l6ZTsKK30KKwkJCitzdGF0 aWMgdm9pZCBfX2RldmluaXQgdGczX2dldF9udnJhbV9zaXplKHN0cnVjdCB0ZzMgKnRwKQorewor CXUzMiB2YWw7CisKKwlpZiAodGczX252cmFtX3JlYWQodHAsIDB4ZjAsICZ2YWwpID09IDApIHsK KwkJaWYgKHZhbCAhPSAwKSB7CisJCQl0cC0+bnZyYW1fc2l6ZSA9ICh2YWwgPj4gMTYpICogMTAy NDsKKwkJCXJldHVybjsKKwkJfQorCX0KKwl0cC0+bnZyYW1fc2l6ZSA9IDB4MjAwMDA7Cit9CisK K3N0YXRpYyB2b2lkIF9fZGV2aW5pdCB0ZzNfZ2V0X252cmFtX2luZm8oc3RydWN0IHRnMyAqdHAp Cit7CisJdTMyIG52Y2ZnMTsKKworCW52Y2ZnMSA9IHRyMzIoTlZSQU1fQ0ZHMSk7CisJaWYgKG52 Y2ZnMSAmIE5WUkFNX0NGRzFfRkxBU0hJRl9FTkFCKSB7CisJCXRwLT50ZzNfZmxhZ3MyIHw9IFRH M19GTEcyX0ZMQVNIOworCX0KKwllbHNlIHsKKwkJbnZjZmcxICY9IH5OVlJBTV9DRkcxX0NPTVBB VF9CWVBBU1M7CisJCXR3MzIoTlZSQU1fQ0ZHMSwgbnZjZmcxKTsKKwl9CisKKwlpZiAoR0VUX0FT SUNfUkVWKHRwLT5wY2lfY2hpcF9yZXZfaWQpID09IEFTSUNfUkVWXzU3NTApIHsKKwkJc3dpdGNo IChudmNmZzEgJiBOVlJBTV9DRkcxX1ZFTkRPUl9NQVNLKSB7CisJCQljYXNlIEZMQVNIX1ZFTkRP Ul9BVE1FTF9GTEFTSF9CVUZGRVJFRDoKKwkJCQl0cC0+bnZyYW1famVkZWNudW0gPSBKRURFQ19B VE1FTDsKKwkJCQl0cC0+bnZyYW1fcGFnZXNpemUgPSBBVE1FTF9BVDQ1REIwWDFCX1BBR0VfU0la RTsKKwkJCQl0cC0+dGczX2ZsYWdzIHw9IFRHM19GTEFHX05WUkFNX0JVRkZFUkVEOworCQkJCWJy ZWFrOworCQkJY2FzZSBGTEFTSF9WRU5ET1JfQVRNRUxfRkxBU0hfVU5CVUZGRVJFRDoKKwkJCQl0 cC0+bnZyYW1famVkZWNudW0gPSBKRURFQ19BVE1FTDsKKyAgICAgICAgICAgICAgICAgICAgICAg ICAJdHAtPm52cmFtX3BhZ2VzaXplID0gQVRNRUxfQVQyNUY1MTJfUEFHRV9TSVpFOworCQkJCWJy ZWFrOworCQkJY2FzZSBGTEFTSF9WRU5ET1JfQVRNRUxfRUVQUk9NOgorCQkJCXRwLT5udnJhbV9q ZWRlY251bSA9IEpFREVDX0FUTUVMOworICAgICAgICAgICAgICAgICAgICAgICAgIAl0cC0+bnZy YW1fcGFnZXNpemUgPSBBVE1FTF9BVDI0QzUxMl9DSElQX1NJWkU7CisJCQkJdHAtPnRnM19mbGFn cyB8PSBURzNfRkxBR19OVlJBTV9CVUZGRVJFRDsKKwkJCQlicmVhazsKKwkJCWNhc2UgRkxBU0hf VkVORE9SX1NUOgorCQkJCXRwLT5udnJhbV9qZWRlY251bSA9IEpFREVDX1NUOworCQkJCXRwLT5u dnJhbV9wYWdlc2l6ZSA9IFNUX000NVBFWDBfUEFHRV9TSVpFOworCQkJCXRwLT50ZzNfZmxhZ3Mg fD0gVEczX0ZMQUdfTlZSQU1fQlVGRkVSRUQ7CisJCQkJYnJlYWs7CisJCQljYXNlIEZMQVNIX1ZF TkRPUl9TQUlGVU46CisJCQkJdHAtPm52cmFtX2plZGVjbnVtID0gSkVERUNfU0FJRlVOOworCQkJ CXRwLT5udnJhbV9wYWdlc2l6ZSA9IFNBSUZVTl9TQTI1RjBYWF9QQUdFX1NJWkU7CisJCQkJYnJl YWs7CisJCQljYXNlIEZMQVNIX1ZFTkRPUl9TU1RfU01BTEw6CisJCQljYXNlIEZMQVNIX1ZFTkRP Ul9TU1RfTEFSR0U6CisJCQkJdHAtPm52cmFtX2plZGVjbnVtID0gSkVERUNfU1NUOworCQkJCXRw LT5udnJhbV9wYWdlc2l6ZSA9IFNTVF8yNVZGMFgwX1BBR0VfU0laRTsKKwkJCQlicmVhazsKKwkJ fQorCX0KKwllbHNlIHsKKwkJdHAtPm52cmFtX2plZGVjbnVtID0gSkVERUNfQVRNRUw7CisJCXRw LT5udnJhbV9wYWdlc2l6ZSA9IEFUTUVMX0FUNDVEQjBYMUJfUEFHRV9TSVpFOworCQl0cC0+dGcz X2ZsYWdzIHw9IFRHM19GTEFHX05WUkFNX0JVRkZFUkVEOworCX0KK30KKwogLyogQ2hpcHMgb3Ro ZXIgdGhhbiA1NzAwLzU3MDEgdXNlIHRoZSBOVlJBTSBmb3IgZmV0Y2hpbmcgaW5mby4gKi8KIHN0 YXRpYyB2b2lkIF9fZGV2aW5pdCB0ZzNfbnZyYW1faW5pdChzdHJ1Y3QgdGczICp0cCkKIHsKQEAg LTY4NzYsMzIgKzcwMzIsMjcgQEAKIAogCWlmIChHRVRfQVNJQ19SRVYodHAtPnBjaV9jaGlwX3Jl dl9pZCkgIT0gQVNJQ19SRVZfNTcwMCAmJgogCSAgICBHRVRfQVNJQ19SRVYodHAtPnBjaV9jaGlw X3Jldl9pZCkgIT0gQVNJQ19SRVZfNTcwMSkgewotCQl1MzIgbnZjZmcxOworCQl0cC0+dGczX2Zs YWdzIHw9IFRHM19GTEFHX05WUkFNOwogCiAJCWlmIChHRVRfQVNJQ19SRVYodHAtPnBjaV9jaGlw X3Jldl9pZCkgPT0gQVNJQ19SRVZfNTc1MCkgewogCQkJdTMyIG52YWNjZXNzID0gdHIzMihOVlJB TV9BQ0NFU1MpOwogCi0JCQl0dzMyX2YoTlZSQU1fQUNDRVNTLCBudmFjY2VzcyB8IEFDQ0VTU19F TkFCTEUpOworCQkJdHczMihOVlJBTV9BQ0NFU1MsIG52YWNjZXNzIHwgQUNDRVNTX0VOQUJMRSk7 CiAJCX0KIAotCQludmNmZzEgPSB0cjMyKE5WUkFNX0NGRzEpOwotCi0JCXRwLT50ZzNfZmxhZ3Mg fD0gVEczX0ZMQUdfTlZSQU07Ci0JCWlmIChudmNmZzEgJiBOVlJBTV9DRkcxX0ZMQVNISUZfRU5B QikgewotCQkJaWYgKG52Y2ZnMSAmIE5WUkFNX0NGRzFfQlVGRkVSRURfTU9ERSkKLQkJCQl0cC0+ dGczX2ZsYWdzIHw9IFRHM19GTEFHX05WUkFNX0JVRkZFUkVEOwotCQl9IGVsc2UgewotCQkJbnZj ZmcxICY9IH5OVlJBTV9DRkcxX0NPTVBBVF9CWVBBU1M7Ci0JCQl0dzMyKE5WUkFNX0NGRzEsIG52 Y2ZnMSk7Ci0JCX0KKwkJdGczX2dldF9udnJhbV9pbmZvKHRwKTsKKwkJdGczX2dldF9udnJhbV9z aXplKHRwKTsKIAogCQlpZiAoR0VUX0FTSUNfUkVWKHRwLT5wY2lfY2hpcF9yZXZfaWQpID09IEFT SUNfUkVWXzU3NTApIHsKIAkJCXUzMiBudmFjY2VzcyA9IHRyMzIoTlZSQU1fQUNDRVNTKTsKIAot CQkJdHczMl9mKE5WUkFNX0FDQ0VTUywgbnZhY2Nlc3MgJiB+QUNDRVNTX0VOQUJMRSk7CisJCQl0 dzMyKE5WUkFNX0FDQ0VTUywgbnZhY2Nlc3MgJiB+QUNDRVNTX0VOQUJMRSk7CiAJCX0KKwogCX0g ZWxzZSB7CiAJCXRwLT50ZzNfZmxhZ3MgJj0gfihURzNfRkxBR19OVlJBTSB8IFRHM19GTEFHX05W UkFNX0JVRkZFUkVEKTsKKworCQl0ZzNfZ2V0X2VlcHJvbV9zaXplKHRwKTsKIAl9CiB9CiAKQEAg LTY5MzksMTEgKzcwOTAsMzAgQEAKIAlyZXR1cm4gMDsKIH0KIAotc3RhdGljIGludCBfX2Rldmlu aXQgdGczX252cmFtX3JlYWQoc3RydWN0IHRnMyAqdHAsCi0JCQkJICAgIHUzMiBvZmZzZXQsIHUz MiAqdmFsKQorI2RlZmluZSBOVlJBTV9DTURfVElNRU9VVCAxMDAwMAorCitzdGF0aWMgaW50IHRn M19udnJhbV9leGVjX2NtZChzdHJ1Y3QgdGczICp0cCwgdTMyIG52cmFtX2NtZCkKIHsKIAlpbnQg aTsKIAorCXR3MzIoTlZSQU1fQ01ELCBudnJhbV9jbWQpOworCWZvciAoaSA9IDA7IGkgPCBOVlJB TV9DTURfVElNRU9VVDsgaSsrKSB7CisJCXVkZWxheSgxMCk7CisJCWlmICh0cjMyKE5WUkFNX0NN RCkgJiBOVlJBTV9DTURfRE9ORSkgeworCQkJdWRlbGF5KDEwKTsKKwkJCWJyZWFrOworCQl9CisJ fQorCWlmIChpID09IE5WUkFNX0NNRF9USU1FT1VUKSB7CisJCXJldHVybiAtRUJVU1k7CisJfQor CXJldHVybiAwOworfQorCitzdGF0aWMgaW50IHRnM19udnJhbV9yZWFkKHN0cnVjdCB0ZzMgKnRw LCB1MzIgb2Zmc2V0LCB1MzIgKnZhbCkKK3sKKwlpbnQgcmV0OworCiAJaWYgKHRwLT50ZzNfZmxh Z3MyICYgVEczX0ZMRzJfU1VOXzU3MFgpIHsKIAkJcHJpbnRrKEtFUk5fRVJSIFBGWCAiQXR0ZW1w dCB0byBkbyBudnJhbV9yZWFkIG9uIFN1biA1NzBYXG4iKTsKIAkJcmV0dXJuIC1FSU5WQUw7CkBA IC02OTUyLDEwICs3MTIyLDE0IEBACiAJaWYgKCEodHAtPnRnM19mbGFncyAmIFRHM19GTEFHX05W UkFNKSkKIAkJcmV0dXJuIHRnM19udnJhbV9yZWFkX3VzaW5nX2VlcHJvbSh0cCwgb2Zmc2V0LCB2 YWwpOwogCi0JaWYgKHRwLT50ZzNfZmxhZ3MgJiBURzNfRkxBR19OVlJBTV9CVUZGRVJFRCkKLQkJ b2Zmc2V0ID0gKChvZmZzZXQgLyBOVlJBTV9CVUZGRVJFRF9QQUdFX1NJWkUpIDw8Ci0JCQkgIE5W UkFNX0JVRkZFUkVEX1BBR0VfUE9TKSArCi0JCQkob2Zmc2V0ICUgTlZSQU1fQlVGRkVSRURfUEFH RV9TSVpFKTsKKwlpZiAoKHRwLT50ZzNfZmxhZ3MgJiBURzNfRkxBR19OVlJBTV9CVUZGRVJFRCkg JiYKKwkJKHRwLT50ZzNfZmxhZ3MyICYgVEczX0ZMRzJfRkxBU0gpICYmCisJCSh0cC0+bnZyYW1f amVkZWNudW0gPT0gSkVERUNfQVRNRUwpKSB7CisKKwkJb2Zmc2V0ID0gKChvZmZzZXQgLyB0cC0+ bnZyYW1fcGFnZXNpemUpIDw8CisJCQkgIEFUTUVMX0FUNDVEQjBYMUJfUEFHRV9QT1MpICsKKwkJ CShvZmZzZXQgJSB0cC0+bnZyYW1fcGFnZXNpemUpOworCX0KIAogCWlmIChvZmZzZXQgPiBOVlJB TV9BRERSX01TSykKIAkJcmV0dXJuIC1FSU5WQUw7CkBAIC02OTY5LDE5ICs3MTQzLDExIEBACiAJ fQogCiAJdHczMihOVlJBTV9BRERSLCBvZmZzZXQpOwotCXR3MzIoTlZSQU1fQ01ELAotCSAgICAg TlZSQU1fQ01EX1JEIHwgTlZSQU1fQ01EX0dPIHwKLQkgICAgIE5WUkFNX0NNRF9GSVJTVCB8IE5W UkFNX0NNRF9MQVNUIHwgTlZSQU1fQ01EX0RPTkUpOworCXJldCA9IHRnM19udnJhbV9leGVjX2Nt ZCh0cCwgTlZSQU1fQ01EX1JEIHwgTlZSQU1fQ01EX0dPIHwKKwkJTlZSQU1fQ01EX0ZJUlNUIHwg TlZSQU1fQ01EX0xBU1QgfCBOVlJBTV9DTURfRE9ORSk7CiAKLQkvKiBXYWl0IGZvciBkb25lIGJp dCB0byBjbGVhci4gKi8KLQlmb3IgKGkgPSAwOyBpIDwgMTAwMDsgaSsrKSB7Ci0JCXVkZWxheSgx MCk7Ci0JCWlmICh0cjMyKE5WUkFNX0NNRCkgJiBOVlJBTV9DTURfRE9ORSkgewotCQkJdWRlbGF5 KDEwKTsKLQkJCSp2YWwgPSBzd2FiMzIodHIzMihOVlJBTV9SRERBVEEpKTsKLQkJCWJyZWFrOwot CQl9Ci0JfQorCWlmIChyZXQgPT0gMCkKKwkJKnZhbCA9IHN3YWIzMih0cjMyKE5WUkFNX1JEREFU QSkpOwogCiAJdGczX252cmFtX3VubG9jayh0cCk7CiAKQEAgLTY5OTEsMTAgKzcxNTcsMjY4IEBA CiAJCXR3MzJfZihOVlJBTV9BQ0NFU1MsIG52YWNjZXNzICYgfkFDQ0VTU19FTkFCTEUpOwogCX0K IAotCWlmIChpID49IDEwMDApCi0JCXJldHVybiAtRUJVU1k7CisJcmV0dXJuIHJldDsKK30KIAot CXJldHVybiAwOworc3RhdGljIGludCB0ZzNfbnZyYW1fd3JpdGVfYmxvY2tfdXNpbmdfZWVwcm9t KHN0cnVjdCB0ZzMgKnRwLAorCQkJCSAgICB1MzIgb2Zmc2V0LCB1MzIgbGVuLCB1OCAqYnVmKQor eworCWludCBpLCBqLCByYyA9IDA7CisJdTMyIHZhbDsKKworCWZvciAoaSA9IDA7IGkgPCBsZW47 IGkgKz0gNCkgeworCQl1MzIgYWRkciwgZGF0YTsKKworCQlhZGRyID0gb2Zmc2V0ICsgaTsKKwor CQltZW1jcHkoJmRhdGEsIGJ1ZiArIGksIDQpOworCisJCXR3MzIoR1JDX0VFUFJPTV9EQVRBLCBj cHVfdG9fbGUzMihkYXRhKSk7CisKKwkJdmFsID0gdHIzMihHUkNfRUVQUk9NX0FERFIpOworCQl0 dzMyKEdSQ19FRVBST01fQUREUiwgdmFsIHwgRUVQUk9NX0FERFJfQ09NUExFVEUpOworCisJCXZh bCAmPSB+KEVFUFJPTV9BRERSX0FERFJfTUFTSyB8IEVFUFJPTV9BRERSX0RFVklEX01BU0sgfAor CQkJRUVQUk9NX0FERFJfUkVBRCk7CisJCXR3MzIoR1JDX0VFUFJPTV9BRERSLCB2YWwgfAorCQkJ KDAgPDwgRUVQUk9NX0FERFJfREVWSURfU0hJRlQpIHwKKwkJCShhZGRyICYgRUVQUk9NX0FERFJf QUREUl9NQVNLKSB8CisJCQlFRVBST01fQUREUl9TVEFSVCB8CisJCQlFRVBST01fQUREUl9XUklU RSk7CisJCQorCQlmb3IgKGogPSAwOyBqIDwgMTAwMDA7IGorKykgeworCQkJdmFsID0gdHIzMihH UkNfRUVQUk9NX0FERFIpOworCisJCQlpZiAodmFsICYgRUVQUk9NX0FERFJfQ09NUExFVEUpCisJ CQkJYnJlYWs7CisJCQl1ZGVsYXkoMTAwKTsKKwkJfQorCQlpZiAoISh2YWwgJiBFRVBST01fQURE Ul9DT01QTEVURSkpIHsKKwkJCXJjID0gLUVCVVNZOworCQkJYnJlYWs7CisJCX0KKwl9CisKKwly ZXR1cm4gcmM7Cit9CisKKy8qIG9mZnNldCBhbmQgbGVuZ3RoIGFyZSBkd29yZCBhbGlnbmVkICov CitzdGF0aWMgaW50IHRnM19udnJhbV93cml0ZV9ibG9ja191bmJ1ZmZlcmVkKHN0cnVjdCB0ZzMg KnRwLCB1MzIgb2Zmc2V0LCB1MzIgbGVuLAorCQl1OCAqYnVmKQoreworCWludCByZXQgPSAwOwor CXUzMiBwYWdlc2l6ZSA9IHRwLT5udnJhbV9wYWdlc2l6ZTsKKwl1MzIgcGFnZW1hc2sgPSBwYWdl c2l6ZSAtIDE7CisJdTMyIG52cmFtX2NtZDsKKwl1OCAqdG1wOworCisJdG1wID0ga21hbGxvYyhw YWdlc2l6ZSwgR0ZQX0tFUk5FTCk7CisJaWYgKHRtcCA9PSBOVUxMKQorCQlyZXR1cm4gLUVOT01F TTsKKworCXdoaWxlIChsZW4pIHsKKwkJaW50IGo7CisJCXUzMiBwaHlfYWRkciwgcGFnZV9vZmYs IHNpemUsIG52YWNjZXNzOworCisJCXBoeV9hZGRyID0gb2Zmc2V0ICYgfnBhZ2VtYXNrOworCQor CQlmb3IgKGogPSAwOyBqIDwgcGFnZXNpemU7IGogKz0gNCkgeworCQkJaWYgKChyZXQgPSB0ZzNf bnZyYW1fcmVhZCh0cCwgcGh5X2FkZHIgKyBqLAorCQkJCQkJKHUzMiAqKSAodG1wICsgaikpKSkK KwkJCQlicmVhazsKKwkJfQorCQlpZiAocmV0KQorCQkJYnJlYWs7CisKKwkgICAgICAgIHBhZ2Vf b2ZmID0gb2Zmc2V0ICYgcGFnZW1hc2s7CisJCXNpemUgPSBwYWdlc2l6ZTsKKwkJaWYgKGxlbiA8 IHNpemUpCisJCQlzaXplID0gbGVuOworCisJCWxlbiAtPSBzaXplOworCisJCW1lbWNweSh0bXAg KyBwYWdlX29mZiwgYnVmLCBzaXplKTsKKworCQlvZmZzZXQgPSBvZmZzZXQgKyAocGFnZXNpemUg LSBwYWdlX29mZik7CisKKwkJbnZhY2Nlc3MgPSB0cjMyKE5WUkFNX0FDQ0VTUyk7CisJCXR3MzJf ZihOVlJBTV9BQ0NFU1MsIG52YWNjZXNzIHwgQUNDRVNTX0VOQUJMRSk7CisKKwkJLyoKKwkJICog QmVmb3JlIHdlIGNhbiBlcmFzZSB0aGUgZmxhc2ggcGFnZSwgd2UgbmVlZAorCQkgKiB0byBpc3N1 ZSBhIHNwZWNpYWwgIndyaXRlIGVuYWJsZSIgY29tbWFuZC4KKwkJICovCisJCW52cmFtX2NtZCA9 IE5WUkFNX0NNRF9XUkVOIHwgTlZSQU1fQ01EX0dPIHwgTlZSQU1fQ01EX0RPTkU7CisKKwkJaWYg KHRnM19udnJhbV9leGVjX2NtZCh0cCwgbnZyYW1fY21kKSkKKwkJCWJyZWFrOworCisJCS8qIEVy YXNlIHRoZSB0YXJnZXQgcGFnZSAqLworCQl0dzMyKE5WUkFNX0FERFIsIHBoeV9hZGRyKTsKKwor CQludnJhbV9jbWQgPSBOVlJBTV9DTURfR08gfCBOVlJBTV9DTURfRE9ORSB8IE5WUkFNX0NNRF9X UiB8CisJCQlOVlJBTV9DTURfRklSU1QgfCBOVlJBTV9DTURfTEFTVCB8IE5WUkFNX0NNRF9FUkFT RTsKKworCSAgICAgICAgaWYgKHRnM19udnJhbV9leGVjX2NtZCh0cCwgbnZyYW1fY21kKSkKKwkJ CWJyZWFrOworCisJCS8qIElzc3VlIGFub3RoZXIgd3JpdGUgZW5hYmxlIHRvIHN0YXJ0IHRoZSB3 cml0ZS4gKi8KKwkJbnZyYW1fY21kID0gTlZSQU1fQ01EX1dSRU4gfCBOVlJBTV9DTURfR08gfCBO VlJBTV9DTURfRE9ORTsKKworCQlpZiAodGczX252cmFtX2V4ZWNfY21kKHRwLCBudnJhbV9jbWQp KQorCQkJYnJlYWs7CisKKwkJZm9yIChqID0gMDsgaiA8IHBhZ2VzaXplOyBqICs9IDQpIHsKKwkJ CXUzMiBkYXRhOworCisJICAgIAkJZGF0YSA9ICooKHUzMiAqKSAodG1wICsgaikpOworCQkJdHcz MihOVlJBTV9XUkRBVEEsIGNwdV90b19iZTMyKGRhdGEpKTsKKworCQkJdHczMihOVlJBTV9BRERS LCBwaHlfYWRkciArIGopOworCisJCQludnJhbV9jbWQgPSBOVlJBTV9DTURfR08gfCBOVlJBTV9D TURfRE9ORSB8CisJCQkJTlZSQU1fQ01EX1dSOworCisJCQlpZiAoaiA9PSAwKQorCQkJCW52cmFt X2NtZCB8PSBOVlJBTV9DTURfRklSU1Q7CisJCQllbHNlIGlmIChqID09IChwYWdlc2l6ZSAtIDQp KQorCQkJCW52cmFtX2NtZCB8PSBOVlJBTV9DTURfTEFTVDsKKworCQkJaWYgKChyZXQgPSB0ZzNf bnZyYW1fZXhlY19jbWQodHAsIG52cmFtX2NtZCkpKQorCQkJCWJyZWFrOworCQl9CisJCWlmIChy ZXQpCisJCQlicmVhazsKKwl9CisKKwludnJhbV9jbWQgPSBOVlJBTV9DTURfV1JESSB8IE5WUkFN X0NNRF9HTyB8IE5WUkFNX0NNRF9ET05FOworCXRnM19udnJhbV9leGVjX2NtZCh0cCwgbnZyYW1f Y21kKTsKKworCWtmcmVlKHRtcCk7CisKKwlyZXR1cm4gcmV0OworfQorCisvKiBvZmZzZXQgYW5k IGxlbmd0aCBhcmUgZHdvcmQgYWxpZ25lZCAqLworc3RhdGljIGludCB0ZzNfbnZyYW1fd3JpdGVf YmxvY2tfYnVmZmVyZWQoc3RydWN0IHRnMyAqdHAsIHUzMiBvZmZzZXQsIHUzMiBsZW4sCisJCXU4 ICpidWYpCit7CisJaW50IGksIHJldCA9IDA7CisKKwlmb3IgKGkgPSAwOyBpIDwgbGVuOyBpICs9 IDQsIG9mZnNldCArPSA0KSB7CisJCXUzMiBkYXRhLCBwYWdlX29mZiwgcGh5X2FkZHIsIG52cmFt X2NtZDsKKworCQltZW1jcHkoJmRhdGEsIGJ1ZiArIGksIDQpOworCQl0dzMyKE5WUkFNX1dSREFU QSwgY3B1X3RvX2JlMzIoZGF0YSkpOworCisJICAgICAgICBwYWdlX29mZiA9IG9mZnNldCAlIHRw LT5udnJhbV9wYWdlc2l6ZTsKKworCQlpZiAoKHRwLT50ZzNfZmxhZ3MyICYgVEczX0ZMRzJfRkxB U0gpICYmCisJCQkodHAtPm52cmFtX2plZGVjbnVtID09IEpFREVDX0FUTUVMKSkgeworCisJCQlw aHlfYWRkciA9ICgob2Zmc2V0IC8gdHAtPm52cmFtX3BhZ2VzaXplKSA8PAorCQkJCSAgICBBVE1F TF9BVDQ1REIwWDFCX1BBR0VfUE9TKSArIHBhZ2Vfb2ZmOworCQl9CisJCWVsc2UgeworCQkJcGh5 X2FkZHIgPSBvZmZzZXQ7CisJCX0KKworCQl0dzMyKE5WUkFNX0FERFIsIHBoeV9hZGRyKTsKKwor CQludnJhbV9jbWQgPSBOVlJBTV9DTURfR08gfCBOVlJBTV9DTURfRE9ORSB8IE5WUkFNX0NNRF9X UjsKKworCSAgICAgICAgaWYgKChwYWdlX29mZiA9PSAwKSB8fCAoaSA9PSAwKSkKKwkJCW52cmFt X2NtZCB8PSBOVlJBTV9DTURfRklSU1Q7CisJCWVsc2UgaWYgKHBhZ2Vfb2ZmID09ICh0cC0+bnZy YW1fcGFnZXNpemUgLSA0KSkKKwkJCW52cmFtX2NtZCB8PSBOVlJBTV9DTURfTEFTVDsKKworCQlp ZiAoaSA9PSAobGVuIC0gNCkpCisJCQludnJhbV9jbWQgfD0gTlZSQU1fQ01EX0xBU1Q7CisKKwkJ aWYgKCh0cC0+bnZyYW1famVkZWNudW0gPT0gSkVERUNfU1QpICYmCisJCQkobnZyYW1fY21kICYg TlZSQU1fQ01EX0ZJUlNUKSkgeworCisJCQlpZiAoKHJldCA9IHRnM19udnJhbV9leGVjX2NtZCh0 cCwKKwkJCQlOVlJBTV9DTURfV1JFTiB8IE5WUkFNX0NNRF9HTyB8CisJCQkJTlZSQU1fQ01EX0RP TkUpKSkKKworCQkJCWJyZWFrOworCQl9CisJCWlmICghKHRwLT50ZzNfZmxhZ3MyICYgVEczX0ZM RzJfRkxBU0gpKSB7CisJCQkvKiBXZSBhbHdheXMgZG8gY29tcGxldGUgd29yZCB3cml0ZXMgdG8g ZWVwcm9tLiAqLworCQkJbnZyYW1fY21kIHw9IChOVlJBTV9DTURfRklSU1QgfCBOVlJBTV9DTURf TEFTVCk7CisJCX0KKworCQlpZiAoKHJldCA9IHRnM19udnJhbV9leGVjX2NtZCh0cCwgbnZyYW1f Y21kKSkpCisJCQlicmVhazsKKwl9CisJcmV0dXJuIHJldDsKK30KKworLyogb2Zmc2V0IGFuZCBs ZW5ndGggYXJlIGR3b3JkIGFsaWduZWQgKi8KK3N0YXRpYyBpbnQgdGczX252cmFtX3dyaXRlX2Js b2NrKHN0cnVjdCB0ZzMgKnRwLCB1MzIgb2Zmc2V0LCB1MzIgbGVuLCB1OCAqYnVmKQoreworCWlu dCByZXQ7CisKKwlpZiAodHAtPnRnM19mbGFnczIgJiBURzNfRkxHMl9TVU5fNTcwWCkgeworCQlw cmludGsoS0VSTl9FUlIgUEZYICJBdHRlbXB0IHRvIGRvIG52cmFtX3dyaXRlIG9uIFN1biA1NzBY XG4iKTsKKwkJcmV0dXJuIC1FSU5WQUw7CisJfQorCisJaWYgKHRwLT50ZzNfZmxhZ3MgJiBURzNf RkxBR19FRVBST01fV1JJVEVfUFJPVCkgeworCQl0dzMyX2YoR1JDX0xPQ0FMX0NUUkwsIHRwLT5n cmNfbG9jYWxfY3RybCB8CisJCSAgICAgICBHUkNfTENMQ1RSTF9HUElPX09FMSk7CisJCXVkZWxh eSg0MCk7CisJfQorCisJaWYgKCEodHAtPnRnM19mbGFncyAmIFRHM19GTEFHX05WUkFNKSkgewor CQlyZXQgPSB0ZzNfbnZyYW1fd3JpdGVfYmxvY2tfdXNpbmdfZWVwcm9tKHRwLCBvZmZzZXQsIGxl biwgYnVmKTsKKwl9CisJZWxzZSB7CisJCXUzMiBncmNfbW9kZTsKKworCQl0ZzNfbnZyYW1fbG9j ayh0cCk7CisKKwkJaWYgKEdFVF9BU0lDX1JFVih0cC0+cGNpX2NoaXBfcmV2X2lkKSA9PSBBU0lD X1JFVl81NzUwKSB7CisJCQl1MzIgbnZhY2Nlc3MgPSB0cjMyKE5WUkFNX0FDQ0VTUyk7CisKKwkJ CXR3MzIoTlZSQU1fQUNDRVNTLCBudmFjY2VzcyB8IEFDQ0VTU19FTkFCTEUpOworCisJCQl0dzMy KE5WUkFNX1dSSVRFMSwgMHg0MDYpOworCQl9CisKKwkJZ3JjX21vZGUgPSB0cjMyKEdSQ19NT0RF KTsKKwkJdHczMihHUkNfTU9ERSwgZ3JjX21vZGUgfCBHUkNfTU9ERV9OVlJBTV9XUl9FTkFCTEUp OworCisJCWlmICgodHAtPnRnM19mbGFncyAmIFRHM19GTEFHX05WUkFNX0JVRkZFUkVEKSB8fAor CQkJISh0cC0+dGczX2ZsYWdzMiAmIFRHM19GTEcyX0ZMQVNIKSkgeworCisJCQlyZXQgPSB0ZzNf bnZyYW1fd3JpdGVfYmxvY2tfYnVmZmVyZWQodHAsIG9mZnNldCwgbGVuLAorCQkJCWJ1Zik7CisJ CX0KKwkJZWxzZSB7CisJCQlyZXQgPSB0ZzNfbnZyYW1fd3JpdGVfYmxvY2tfdW5idWZmZXJlZCh0 cCwgb2Zmc2V0LCBsZW4sCisJCQkJYnVmKTsKKwkJfQorCisJCWdyY19tb2RlID0gdHIzMihHUkNf TU9ERSk7CisJCXR3MzIoR1JDX01PREUsIGdyY19tb2RlICYgfkdSQ19NT0RFX05WUkFNX1dSX0VO QUJMRSk7CisKKwkJaWYgKEdFVF9BU0lDX1JFVih0cC0+cGNpX2NoaXBfcmV2X2lkKSA9PSBBU0lD X1JFVl81NzUwKSB7CisJCQl1MzIgbnZhY2Nlc3MgPSB0cjMyKE5WUkFNX0FDQ0VTUyk7CisKKwkJ CXR3MzIoTlZSQU1fQUNDRVNTLCBudmFjY2VzcyAmIH5BQ0NFU1NfRU5BQkxFKTsKKwkJfQorCQl0 ZzNfbnZyYW1fdW5sb2NrKHRwKTsKKwl9CisKKwlpZiAodHAtPnRnM19mbGFncyAmIFRHM19GTEFH X0VFUFJPTV9XUklURV9QUk9UKSB7CisJCXR3MzJfZihHUkNfTE9DQUxfQ1RSTCwgdHAtPmdyY19s b2NhbF9jdHJsIHwKKwkJICAgICAgIEdSQ19MQ0xDVFJMX0dQSU9fT0UxIHwgR1JDX0xDTENUUkxf R1BJT19PVVRQVVQxKTsKKwkJdWRlbGF5KDQwKTsKKwl9CisKKwlyZXR1cm4gcmV0OwogfQogCiBz dHJ1Y3Qgc3Vic3lzX3RibF9lbnQgewpkaWZmIC1OcnUgMS90ZzMuaCAyL3RnMy5oCi0tLSAxL3Rn My5oCTIwMDUtMDEtMTYgMTE6MzY6MTEuMDAwMDAwMDAwIC0wODAwCisrKyAyL3RnMy5oCTIwMDUt MDEtMTkgMTQ6MjU6MjAuMDAwMDAwMDAwIC0wODAwCkBAIC0xMjc0LDYgKzEyNzQsNyBAQAogI2Rl ZmluZSAgR1JDX01PREVfSE9TVF9TVEFDS1VQCQkweDAwMDEwMDAwCiAjZGVmaW5lICBHUkNfTU9E RV9IT1NUX1NFTkRCRFMJCTB4MDAwMjAwMDAKICNkZWZpbmUgIEdSQ19NT0RFX05PX1RYX1BIRFJf Q1NVTQkweDAwMTAwMDAwCisjZGVmaW5lICBHUkNfTU9ERV9OVlJBTV9XUl9FTkFCTEUJMHgwMDIw MDAwMAogI2RlZmluZSAgR1JDX01PREVfTk9fUlhfUEhEUl9DU1VNCTB4MDA4MDAwMDAKICNkZWZp bmUgIEdSQ19NT0RFX0lSUV9PTl9UWF9DUFVfQVRUTgkweDAxMDAwMDAwCiAjZGVmaW5lICBHUkNf TU9ERV9JUlFfT05fUlhfQ1BVX0FUVE4JMHgwMjAwMDAwMApAQCAtMTM2Niw2ICsxMzY3LDggQEAK ICNkZWZpbmUgIE5WUkFNX0NNRF9FUkFTRQkJIDB4MDAwMDAwNDAKICNkZWZpbmUgIE5WUkFNX0NN RF9GSVJTVAkJIDB4MDAwMDAwODAKICNkZWZpbmUgIE5WUkFNX0NNRF9MQVNUCQkJIDB4MDAwMDAx MDAKKyNkZWZpbmUgIE5WUkFNX0NNRF9XUkVOCQkJIDB4MDAwMTAwMDAKKyNkZWZpbmUgIE5WUkFN X0NNRF9XUkRJCQkJIDB4MDAwMjAwMDAKICNkZWZpbmUgTlZSQU1fU1RBVAkJCTB4MDAwMDcwMDQK ICNkZWZpbmUgTlZSQU1fV1JEQVRBCQkJMHgwMDAwNzAwOAogI2RlZmluZSBOVlJBTV9BRERSCQkJ MHgwMDAwNzAwYwpAQCAtMTM3NSw4ICsxMzc4LDE4IEBACiAjZGVmaW5lICBOVlJBTV9DRkcxX0ZM QVNISUZfRU5BQgkgMHgwMDAwMDAwMQogI2RlZmluZSAgTlZSQU1fQ0ZHMV9CVUZGRVJFRF9NT0RF CSAweDAwMDAwMDAyCiAjZGVmaW5lICBOVlJBTV9DRkcxX1BBU1NfVEhSVQkJIDB4MDAwMDAwMDQK KyNkZWZpbmUgIE5WUkFNX0NGRzFfU1RBVFVTX0JJVFMJCSAweDAwMDAwMDcwCiAjZGVmaW5lICBO VlJBTV9DRkcxX0JJVF9CQU5HCQkgMHgwMDAwMDAwOAorI2RlZmluZSAgTlZSQU1fQ0ZHMV9GTEFT SF9TSVpFCQkgMHgwMjAwMDAwMAogI2RlZmluZSAgTlZSQU1fQ0ZHMV9DT01QQVRfQllQQVNTCSAw eDgwMDAwMDAwCisjZGVmaW5lICBOVlJBTV9DRkcxX1ZFTkRPUl9NQVNLCQkgMHgwMzAwMDAwMwor I2RlZmluZSAgRkxBU0hfVkVORE9SX0FUTUVMX0VFUFJPTQkgMHgwMjAwMDAwMAorI2RlZmluZSAg RkxBU0hfVkVORE9SX0FUTUVMX0ZMQVNIX0JVRkZFUkVECSAweDAyMDAwMDAzCisjZGVmaW5lICBG TEFTSF9WRU5ET1JfQVRNRUxfRkxBU0hfVU5CVUZGRVJFRAkgMHgwMDAwMDAwMworI2RlZmluZSAg RkxBU0hfVkVORE9SX1NUCQkJIDB4MDMwMDAwMDEKKyNkZWZpbmUgIEZMQVNIX1ZFTkRPUl9TQUlG VU4JCSAweDAxMDAwMDAzCisjZGVmaW5lICBGTEFTSF9WRU5ET1JfU1NUX1NNQUxMCQkgMHgwMDAw MDAwMQorI2RlZmluZSAgRkxBU0hfVkVORE9SX1NTVF9MQVJHRQkJIDB4MDIwMDAwMDEKICNkZWZp bmUgTlZSQU1fQ0ZHMgkJCTB4MDAwMDcwMTgKICNkZWZpbmUgTlZSQU1fQ0ZHMwkJCTB4MDAwMDcw MWMKICNkZWZpbmUgTlZSQU1fU1dBUkIJCQkweDAwMDA3MDIwCkBAIC0xMzk2LDE1ICsxNDA5LDE2 IEBACiAjZGVmaW5lICBTV0FSQl9SRVExCQkJIDB4MDAwMDIwMDAKICNkZWZpbmUgIFNXQVJCX1JF UTIJCQkgMHgwMDAwNDAwMAogI2RlZmluZSAgU1dBUkJfUkVRMwkJCSAweDAwMDA4MDAwCi0jZGVm aW5lICAgIE5WUkFNX0JVRkZFUkVEX1BBR0VfU0laRQkgICAyNjQKLSNkZWZpbmUgICAgTlZSQU1f QlVGRkVSRURfUEFHRV9QT1MJICAgOQogI2RlZmluZSBOVlJBTV9BQ0NFU1MJCQkweDAwMDA3MDI0 CiAjZGVmaW5lICBBQ0NFU1NfRU5BQkxFCQkJIDB4MDAwMDAwMDEKICNkZWZpbmUgIEFDQ0VTU19X Ul9FTkFCTEUJCSAweDAwMDAwMDAyCi0vKiAweDcwMjQgLS0+IDB4NzQwMCB1bnVzZWQgKi8KKyNk ZWZpbmUgTlZSQU1fV1JJVEUxCQkJMHgwMDAwNzAyOAorLyogMHg3MDJjIC0tPiAweDc0MDAgdW51 c2VkICovCiAKIC8qIDB4NzQwMCAtLT4gMHg4MDAwIHVudXNlZCAqLwogCisjZGVmaW5lIFRHM19F RVBST01fTUFHSUMJCTB4NjY5OTU1YWEKKwogLyogMzJLIFdpbmRvdyBpbnRvIE5JQyBpbnRlcm5h bCBtZW1vcnkgKi8KICNkZWZpbmUgTklDX1NSQU1fV0lOX0JBU0UJCTB4MDAwMDgwMDAKIApAQCAt MjA5MCw2ICsyMTA0LDcgQEAKICNkZWZpbmUgVEczX0ZMRzJfUEhZX0pVU1RfSU5JVFRFRAkweDAw MDAxMDAwCiAjZGVmaW5lIFRHM19GTEcyX1BIWV9TRVJERVMJCTB4MDAwMDIwMDAKICNkZWZpbmUg VEczX0ZMRzJfQ0FQQUNJVElWRV9DT1VQTElORwkweDAwMDA0MDAwCisjZGVmaW5lIFRHM19GTEcy X0ZMQVNICQkJMHgwMDAwODAwMAogCiAJdTMyCQkJCXNwbGl0X21vZGVfbWF4X3JlcXM7CiAjZGVm aW5lIFNQTElUX01PREVfNTcwNF9NQVhfUkVRCQkzCkBAIC0yMTYzLDYgKzIxNzgsMzQgQEAKIAlz dHJ1Y3QgdGczX2h3X3N0YXRzCQkqaHdfc3RhdHM7CiAJZG1hX2FkZHJfdAkJCXN0YXRzX21hcHBp bmc7CiAJc3RydWN0IHdvcmtfc3RydWN0CQlyZXNldF90YXNrOworCisJdTMyCQkJCW52cmFtX3Np emU7CisJdTMyCQkJCW52cmFtX3BhZ2VzaXplOworCXUzMgkJCQludnJhbV9qZWRlY251bTsKKwor I2RlZmluZSBKRURFQ19BVE1FTAkJCTB4MWYKKyNkZWZpbmUgSkVERUNfU1QJCQkweDIwCisjZGVm aW5lIEpFREVDX1NBSUZVTgkJCTB4NGYKKyNkZWZpbmUgSkVERUNfU1NUCQkJMHhiZgorCisjZGVm aW5lIEFUTUVMX0FUMjRDNjRfQ0hJUF9TSVpFCQkoNjQgKiAxMDI0KQorI2RlZmluZSBBVE1FTF9B VDI0QzY0X1BBR0VfU0laRQkJKDMyKQorCisjZGVmaW5lIEFUTUVMX0FUMjRDNTEyX0NISVBfU0la RQkoNTEyICogMTAyNCkKKyNkZWZpbmUgQVRNRUxfQVQyNEM1MTJfUEFHRV9TSVpFCSgxMjgpCisK KyNkZWZpbmUgQVRNRUxfQVQ0NURCMFgxQl9QQUdFX1BPUwk5CisjZGVmaW5lIEFUTUVMX0FUNDVE QjBYMUJfUEFHRV9TSVpFCTI2NAorCisjZGVmaW5lIEFUTUVMX0FUMjVGNTEyX1BBR0VfU0laRQky NTYKKworI2RlZmluZSBTVF9NNDVQRVgwX1BBR0VfU0laRQkJMjU2CisKKyNkZWZpbmUgU0FJRlVO X1NBMjVGMFhYX1BBR0VfU0laRQkyNTYKKworI2RlZmluZSBTU1RfMjVWRjBYMF9QQUdFX1NJWkUJ CTQwOTgKKworCiB9OwogCiAjZW5kaWYgLyogIShfVDNfSCkgKi8K ------_=_NextPart_001_01C4FF42.AF5E5881-- From davem@davemloft.net Thu Jan 20 15:01:57 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 15:02:04 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KN1uIW028134 for ; Thu, 20 Jan 2005 15:01:56 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CrlHO-0003gm-00; Thu, 20 Jan 2005 14:59:54 -0800 Date: Thu, 20 Jan 2005 14:59:54 -0800 From: "David S. Miller" To: syrius.ml@no-log.org Cc: netdev@oss.sgi.com Subject: Re: 2.6.10-ac8 - kernel BUG at net/ipv4/tcp_output.c:922! Message-Id: <20050120145954.3c4992a5.davem@davemloft.net> In-Reply-To: <87hdlbpwpz.87fz0vpwpz@87ekgfpwpz.message.id> References: <41DFEDA8.7030805@wasp.net.au> <87hdlbpwpz.87fz0vpwpz@87ekgfpwpz.message.id> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 574 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Thu, 20 Jan 2005 14:16:42 +0100 syrius.ml@no-log.org wrote: > It has been already reported on lkml by Brad Campbell (then forwarded > here by randy) Does this patch, recently merged upstream, fix your problem? # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/18 12:24:11-08:00 kuznet@ms2.inr.ac.ru # [TCP]: Do not try to collapse multi-packet SKBs. # # Signed-off-by: David S. Miller # # net/ipv4/tcp_output.c # 2005/01/18 12:23:36-08:00 kuznet@ms2.inr.ac.ru +1 -0 # [TCP]: Do not try to collapse multi-packet SKBs. # diff -Nru a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c --- a/net/ipv4/tcp_output.c 2005-01-20 14:30:25 -08:00 +++ b/net/ipv4/tcp_output.c 2005-01-20 14:30:25 -08:00 @@ -1069,6 +1069,7 @@ (skb->next != sk->sk_send_head) && (skb->next != (struct sk_buff *)&sk->sk_write_queue) && (skb_shinfo(skb)->nr_frags == 0 && skb_shinfo(skb->next)->nr_frags == 0) && + (tcp_skb_pcount(skb) == 1 && tcp_skb_pcount(skb->next) == 1) && (sysctl_tcp_retrans_collapse != 0)) tcp_retrans_try_collapse(sk, skb, cur_mss); From davem@davemloft.net Thu Jan 20 15:07:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 15:07:25 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0KN7K81028731 for ; Thu, 20 Jan 2005 15:07:21 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CrlMd-0003hK-00; Thu, 20 Jan 2005 15:05:19 -0800 Date: Thu, 20 Jan 2005 15:05:19 -0800 From: "David S. Miller" To: "Michael Chan" Cc: netdev@oss.sgi.com Subject: Re: [PATCH 2.6.10] tg3: add tg3_set_eeprom Message-Id: <20050120150519.08ef54fa.davem@davemloft.net> In-Reply-To: References: X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 575 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Thu, 20 Jan 2005 14:52:14 -0800 "Michael Chan" wrote: > Add tg3_set_eeprom routine to support configuration changes (e.g. ASF > config). > > Made changes to other nvram related routines. Why were the NVRAM_ACCESS writes change to non-flushing register writes? Otherwise I think your patch is fine. Maybe it would be nice if you provided a detailed changelog of sorts, because other's might have similar questions like I did about why the tw32_f() --> tw32() changes were made. From mchan@broadcom.com Thu Jan 20 16:01:16 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 16:01:21 -0800 (PST) Received: from mms2.broadcom.com (mms-nat.broadcom.com [63.70.210.58]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L01A9U030213 for ; Thu, 20 Jan 2005 16:01:15 -0800 Received: from 63.70.210.1 by mms2.broadcom.com with SMTP (Broadcom SMTP Relay (MMS v5.6.0)); Thu, 20 Jan 2005 16:00:45 -0800 X-Server-Uuid: 011F2A72-58F1-4BCE-832F-B0D661E896E8 Received: from mail-irva-8.broadcom.com ([10.10.64.221]) by mail-irva-1.broadcom.com (Post.Office MTA v3.5.3 release 223 ID# 0-72233U7200L2200S0V35) with ESMTP id com; Thu, 20 Jan 2005 16:00:44 -0800 Received: from mon-irva-10.broadcom.com (mon-irva-10.broadcom.com [10.10.64.171]) by mail-irva-8.broadcom.com (MOS 3.5.6-GR) with ESMTP id AHN11568; Thu, 20 Jan 2005 16:00:39 -0800 (PST) Received: from nt-irva-0741.brcm.ad.broadcom.com ( nt-irva-0741.brcm.ad.broadcom.com [10.8.194.54]) by mon-irva-10.broadcom.com (8.9.1/8.9.1) with ESMTP id QAA10460; Thu, 20 Jan 2005 16:00:39 -0800 (PST) X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Subject: RE: [PATCH 2.6.10] tg3: add tg3_set_eeprom Date: Thu, 20 Jan 2005 16:00:38 -0800 Message-ID: X-MS-Has-Attach: yes Thread-Topic: [PATCH 2.6.10] tg3: add tg3_set_eeprom Thread-Index: AcT/RNYoqhl8O7sZQByxO+YWIkWbhgAAiLIA From: "Michael Chan" To: "David S. Miller" cc: netdev@oss.sgi.com X-WSS-ID: 6DEE99A71KS571039-01-01 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C4FF4C.3D76D0CA" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 576 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mchan@broadcom.com Precedence: bulk X-list: netdev This is a multi-part message in MIME format. ------_=_NextPart_001_01C4FF4C.3D76D0CA Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable "David S. Miller" wrote: > Why were the NVRAM_ACCESS writes change to non-flushing=20 > register writes? Otherwise I think your patch is fine. >=20 > Maybe it would be nice if you provided a detailed changelog > of sorts, because other's might have similar questions like I=20 > did about why the tw32_f() --> tw32() changes were made. >=20 >=20 >=20 >=20 No delay is required after writing that register to enable nvram access. It was coded that way for A0 chips which required the flushing write workaround to break fast back-to-back writes. A0 chips are not in production so this workaround can be removed. The new routines were written using the non-flushing write. To be consistent, I changed some of the existing code to use non-flushing write as well. However I wasn't very consistent when cutting and pasting the code, so here is a new patch with more consistent use of the non-flushing write. Detailed changes: - Add nvram size detection - Add appropriate byte swapping to tg3_get_eeprom so that the same byte stream is read in all systems - Fix tg3_get_eeprom to read both eeprom and flash - Add tg3_set_eeprom to write eeprom and flash - Change tg3_nvram_init to detect all supported nvram devices - Change tg3_nvram_read to properly detect Atmel flash that requires address translation - Increase nvram polling delay to account for slower eeprom devices - Remove some of the flushing read that is not required for the production 5750 devices Signed-off-by: Michael Chan ------_=_NextPart_001_01C4FF4C.3D76D0CA Content-Type: application/octet-stream; name=tg3_nvram.patch1 Content-Transfer-Encoding: base64 Content-Description: tg3_nvram.patch1 Content-Disposition: attachment; filename=tg3_nvram.patch1 ZGlmZiAtTnJ1IDEvdGczLmMgMi90ZzMuYwotLS0gMS90ZzMuYwkyMDA1LTAxLTE2IDExOjM2OjA4 LjAwMDAwMDAwMCAtMDgwMAorKysgMi90ZzMuYwkyMDA1LTAxLTE5IDE1OjUxOjM1LjAwMDAwMDAw MCAtMDgwMApAQCAtNjM3MCwxMSArNjM3MCwxMyBAQAogCiBzdGF0aWMgaW50IHRnM19nZXRfZWVw cm9tX2xlbihzdHJ1Y3QgbmV0X2RldmljZSAqZGV2KQogewotCXJldHVybiBFRVBST01fQ0hJUF9T SVpFOworCXN0cnVjdCB0ZzMgKnRwID0gbmV0ZGV2X3ByaXYoZGV2KTsKKworCXJldHVybiB0cC0+ bnZyYW1fc2l6ZTsKIH0KIAotc3RhdGljIGludCB0ZzNfbnZyYW1fcmVhZF91c2luZ19lZXByb20o c3RydWN0IHRnMyAqdHAsCi0JCQkJCXUzMiBvZmZzZXQsIHUzMiAqdmFsKTsKK3N0YXRpYyBpbnQg dGczX252cmFtX3JlYWQoc3RydWN0IHRnMyAqdHAsIHUzMiBvZmZzZXQsIHUzMiAqdmFsKTsKKwog c3RhdGljIGludCB0ZzNfZ2V0X2VlcHJvbShzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LCBzdHJ1Y3Qg ZXRodG9vbF9lZXByb20gKmVlcHJvbSwgdTggKmRhdGEpCiB7CiAJc3RydWN0IHRnMyAqdHAgPSBu ZXRkZXZfcHJpdihkZXYpOwpAQCAtNjM4NiwxMCArNjM4OCw3IEBACiAJbGVuID0gZWVwcm9tLT5s ZW47CiAJZWVwcm9tLT5sZW4gPSAwOwogCi0JcmV0ID0gdGczX252cmFtX3JlYWRfdXNpbmdfZWVw cm9tKHRwLCAwLCAmZWVwcm9tLT5tYWdpYyk7Ci0JaWYgKHJldCkKLQkJcmV0dXJuIHJldDsKLQll ZXByb20tPm1hZ2ljID0gc3dhYjMyKGVlcHJvbS0+bWFnaWMpOworCWVlcHJvbS0+bWFnaWMgPSBU RzNfRUVQUk9NX01BR0lDOwogCiAJaWYgKG9mZnNldCAmIDMpIHsKIAkJLyogYWRqdXN0bWVudHMg dG8gc3RhcnQgb24gcmVxdWlyZWQgNCBieXRlIGJvdW5kYXJ5ICovCkBAIC02Mzk5LDkgKzYzOTgs MTAgQEAKIAkJCS8qIGkuZS4gb2Zmc2V0PTEgbGVuPTIgKi8KIAkJCWJfY291bnQgPSBsZW47CiAJ CX0KLQkJcmV0ID0gdGczX252cmFtX3JlYWRfdXNpbmdfZWVwcm9tKHRwLCBvZmZzZXQtYl9vZmZz ZXQsICZ2YWwpOworCQlyZXQgPSB0ZzNfbnZyYW1fcmVhZCh0cCwgb2Zmc2V0LWJfb2Zmc2V0LCAm dmFsKTsKIAkJaWYgKHJldCkKIAkJCXJldHVybiByZXQ7CisJCXZhbCA9IGNwdV90b19sZTMyKHZh bCk7CiAJCW1lbWNweShkYXRhLCAoKGNoYXIqKSZ2YWwpICsgYl9vZmZzZXQsIGJfY291bnQpOwog CQlsZW4gLT0gYl9jb3VudDsKIAkJb2Zmc2V0ICs9IGJfY291bnQ7CkBAIC02NDExLDEyICs2NDEx LDEzIEBACiAJLyogcmVhZCBieXRlcyB1cHRvIHRoZSBsYXN0IDQgYnl0ZSBib3VuZGFyeSAqLwog CXBkID0gJmRhdGFbZWVwcm9tLT5sZW5dOwogCWZvciAoaSA9IDA7IGkgPCAobGVuIC0gKGxlbiAm IDMpKTsgaSArPSA0KSB7Ci0JCXJldCA9IHRnM19udnJhbV9yZWFkX3VzaW5nX2VlcHJvbSh0cCwg b2Zmc2V0ICsgaSwgCi0JCQkJKHUzMiopKHBkICsgaSkpOworCQlyZXQgPSB0ZzNfbnZyYW1fcmVh ZCh0cCwgb2Zmc2V0ICsgaSwgJnZhbCk7CiAJCWlmIChyZXQpIHsKIAkJCWVlcHJvbS0+bGVuICs9 IGk7CiAJCQlyZXR1cm4gcmV0OwogCQl9CisJCXZhbCA9IGNwdV90b19sZTMyKHZhbCk7CisJCW1l bWNweShwZCArIGksICZ2YWwsIDQpOwogCX0KIAllZXByb20tPmxlbiArPSBpOwogCkBAIC02NDI1 LDE1ICs2NDI2LDcyIEBACiAJCXBkID0gJmRhdGFbZWVwcm9tLT5sZW5dOwogCQliX2NvdW50ID0g bGVuICYgMzsKIAkJYl9vZmZzZXQgPSBvZmZzZXQgKyBsZW4gLSBiX2NvdW50OwotCQlyZXQgPSB0 ZzNfbnZyYW1fcmVhZF91c2luZ19lZXByb20odHAsIGJfb2Zmc2V0LCAmdmFsKTsKKwkJcmV0ID0g dGczX252cmFtX3JlYWQodHAsIGJfb2Zmc2V0LCAmdmFsKTsKIAkJaWYgKHJldCkKIAkJCXJldHVy biByZXQ7CisJCXZhbCA9IGNwdV90b19sZTMyKHZhbCk7CiAJCW1lbWNweShwZCwgKChjaGFyKikm dmFsKSwgYl9jb3VudCk7CiAJCWVlcHJvbS0+bGVuICs9IGJfY291bnQ7CiAJfQogCXJldHVybiAw OwogfQogCitzdGF0aWMgaW50IHRnM19udnJhbV93cml0ZV9ibG9jayhzdHJ1Y3QgdGczICp0cCwg dTMyIG9mZnNldCwgdTMyIGxlbiwgdTggKmJ1Zik7IAorCitzdGF0aWMgaW50IHRnM19zZXRfZWVw cm9tKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYsIHN0cnVjdCBldGh0b29sX2VlcHJvbSAqZWVwcm9t LCB1OCAqZGF0YSkKK3sKKwlzdHJ1Y3QgdGczICp0cCA9IG5ldGRldl9wcml2KGRldik7CisJaW50 IHJldDsKKwl1MzIgb2Zmc2V0LCBsZW4sIGJfb2Zmc2V0LCBvZGRfbGVuLCBzdGFydCwgZW5kOwor CXU4ICpidWY7CisKKwlpZiAoZWVwcm9tLT5tYWdpYyAhPSBURzNfRUVQUk9NX01BR0lDKQorCQly ZXR1cm4gLUVJTlZBTDsKKworCW9mZnNldCA9IGVlcHJvbS0+b2Zmc2V0OworCWxlbiA9IGVlcHJv bS0+bGVuOworCisJaWYgKChiX29mZnNldCA9IChvZmZzZXQgJiAzKSkpIHsKKwkJLyogYWRqdXN0 bWVudHMgdG8gc3RhcnQgb24gcmVxdWlyZWQgNCBieXRlIGJvdW5kYXJ5ICovCisJCXJldCA9IHRn M19udnJhbV9yZWFkKHRwLCBvZmZzZXQtYl9vZmZzZXQsICZzdGFydCk7CisJCWlmIChyZXQpCisJ CQlyZXR1cm4gcmV0OworCQlzdGFydCA9IGNwdV90b19sZTMyKHN0YXJ0KTsKKwkJbGVuICs9IGJf b2Zmc2V0OworCQlvZmZzZXQgJj0gfjM7CisJfQorCisJb2RkX2xlbiA9IDA7CisJaWYgKChsZW4g JiAzKSAmJiAoKGxlbiA+IDQpIHx8IChiX29mZnNldCA9PSAwKSkpIHsKKwkJLyogYWRqdXN0bWVu dHMgdG8gZW5kIG9uIHJlcXVpcmVkIDQgYnl0ZSBib3VuZGFyeSAqLworCQlvZGRfbGVuID0gMTsK KwkJbGVuID0gKGxlbiArIDMpICYgfjM7CisJCXJldCA9IHRnM19udnJhbV9yZWFkKHRwLCBvZmZz ZXQrbGVuLTQsICZlbmQpOworCQlpZiAocmV0KQorCQkJcmV0dXJuIHJldDsKKwkJZW5kID0gY3B1 X3RvX2xlMzIoZW5kKTsKKwl9CisKKwlidWYgPSBkYXRhOworCWlmIChiX29mZnNldCB8fCBvZGRf bGVuKSB7CisJCWJ1ZiA9IGttYWxsb2MobGVuLCBHRlBfS0VSTkVMKTsKKwkJaWYgKGJ1ZiA9PSAw KQorCQkJcmV0dXJuIC1FTk9NRU07CisJCWlmIChiX29mZnNldCkKKwkJCW1lbWNweShidWYsICZz dGFydCwgNCk7CisJCWlmIChvZGRfbGVuKQorCQkJbWVtY3B5KGJ1ZitsZW4tNCwgJmVuZCwgNCk7 CisJCW1lbWNweShidWYgKyBiX29mZnNldCwgZGF0YSwgZWVwcm9tLT5sZW4pOworCX0KKworCXJl dCA9IHRnM19udnJhbV93cml0ZV9ibG9jayh0cCwgb2Zmc2V0LCBsZW4sIGJ1Zik7CisKKwlpZiAo YnVmICE9IGRhdGEpCisJCWtmcmVlKGJ1Zik7CisKKwlyZXR1cm4gcmV0OworfQorCiBzdGF0aWMg aW50IHRnM19nZXRfc2V0dGluZ3Moc3RydWN0IG5ldF9kZXZpY2UgKmRldiwgc3RydWN0IGV0aHRv b2xfY21kICpjbWQpCiB7CiAgIAlzdHJ1Y3QgdGczICp0cCA9IG5ldGRldl9wcml2KGRldik7CkBA IC02ODMzLDYgKzY4OTEsNyBAQAogCS5nZXRfbGluawkJPSBldGh0b29sX29wX2dldF9saW5rLAog CS5nZXRfZWVwcm9tX2xlbgkJPSB0ZzNfZ2V0X2VlcHJvbV9sZW4sCiAJLmdldF9lZXByb20JCT0g dGczX2dldF9lZXByb20sCisJLnNldF9lZXByb20JCT0gdGczX3NldF9lZXByb20sCiAJLmdldF9y aW5ncGFyYW0JCT0gdGczX2dldF9yaW5ncGFyYW0sCiAJLnNldF9yaW5ncGFyYW0JCT0gdGczX3Nl dF9yaW5ncGFyYW0sCiAJLmdldF9wYXVzZXBhcmFtCQk9IHRnM19nZXRfcGF1c2VwYXJhbSwKQEAg LTY4NTIsNiArNjkxMSwxMDMgQEAKIAkuZ2V0X2V0aHRvb2xfc3RhdHMJPSB0ZzNfZ2V0X2V0aHRv b2xfc3RhdHMsCiB9OwogCitzdGF0aWMgdm9pZCBfX2RldmluaXQgdGczX2dldF9lZXByb21fc2l6 ZShzdHJ1Y3QgdGczICp0cCkKK3sKKwl1MzIgY3Vyc2l6ZSwgdmFsOworCisJdHAtPm52cmFtX3Np emUgPSBFRVBST01fQ0hJUF9TSVpFOworCisJaWYgKHRnM19udnJhbV9yZWFkKHRwLCAwLCAmdmFs KSAhPSAwKQorCQlyZXR1cm47CisKKwlpZiAoc3dhYjMyKHZhbCkgIT0gVEczX0VFUFJPTV9NQUdJ QykKKwkJcmV0dXJuOworCisJLyoKKwkgKiBTaXplIHRoZSBjaGlwIGJ5IHJlYWRpbmcgb2Zmc2V0 cyBhdCBpbmNyZWFzaW5nIHBvd2VycyBvZiB0d28uCisJICogV2hlbiB3ZSBlbmNvdW50ZXIgb3Vy IHZhbGlkYXRpb24gc2lnbmF0dXJlLCB3ZSBrbm93IHRoZSBhZGRyZXNzaW5nCisJICogaGFzIHdy YXBwZWQgYXJvdW5kLCBhbmQgdGh1cyBoYXZlIG91ciBjaGlwIHNpemUuCisJICovCisJY3Vyc2l6 ZSA9IDB4ODAwOworCisJd2hpbGUgKGN1cnNpemUgPCB0cC0+bnZyYW1fc2l6ZSkgeworCQlpZiAo dGczX252cmFtX3JlYWQodHAsIGN1cnNpemUsICZ2YWwpICE9IDApCisJCQlyZXR1cm47CisKKwkJ aWYgKHN3YWIzMih2YWwpID09IFRHM19FRVBST01fTUFHSUMpCisJCQlicmVhazsKKworCQljdXJz aXplIDw8PSAxOworCX0KKworCXRwLT5udnJhbV9zaXplID0gY3Vyc2l6ZTsKK30KKwkJCitzdGF0 aWMgdm9pZCBfX2RldmluaXQgdGczX2dldF9udnJhbV9zaXplKHN0cnVjdCB0ZzMgKnRwKQorewor CXUzMiB2YWw7CisKKwlpZiAodGczX252cmFtX3JlYWQodHAsIDB4ZjAsICZ2YWwpID09IDApIHsK KwkJaWYgKHZhbCAhPSAwKSB7CisJCQl0cC0+bnZyYW1fc2l6ZSA9ICh2YWwgPj4gMTYpICogMTAy NDsKKwkJCXJldHVybjsKKwkJfQorCX0KKwl0cC0+bnZyYW1fc2l6ZSA9IDB4MjAwMDA7Cit9CisK K3N0YXRpYyB2b2lkIF9fZGV2aW5pdCB0ZzNfZ2V0X252cmFtX2luZm8oc3RydWN0IHRnMyAqdHAp Cit7CisJdTMyIG52Y2ZnMTsKKworCW52Y2ZnMSA9IHRyMzIoTlZSQU1fQ0ZHMSk7CisJaWYgKG52 Y2ZnMSAmIE5WUkFNX0NGRzFfRkxBU0hJRl9FTkFCKSB7CisJCXRwLT50ZzNfZmxhZ3MyIHw9IFRH M19GTEcyX0ZMQVNIOworCX0KKwllbHNlIHsKKwkJbnZjZmcxICY9IH5OVlJBTV9DRkcxX0NPTVBB VF9CWVBBU1M7CisJCXR3MzIoTlZSQU1fQ0ZHMSwgbnZjZmcxKTsKKwl9CisKKwlpZiAoR0VUX0FT SUNfUkVWKHRwLT5wY2lfY2hpcF9yZXZfaWQpID09IEFTSUNfUkVWXzU3NTApIHsKKwkJc3dpdGNo IChudmNmZzEgJiBOVlJBTV9DRkcxX1ZFTkRPUl9NQVNLKSB7CisJCQljYXNlIEZMQVNIX1ZFTkRP Ul9BVE1FTF9GTEFTSF9CVUZGRVJFRDoKKwkJCQl0cC0+bnZyYW1famVkZWNudW0gPSBKRURFQ19B VE1FTDsKKwkJCQl0cC0+bnZyYW1fcGFnZXNpemUgPSBBVE1FTF9BVDQ1REIwWDFCX1BBR0VfU0la RTsKKwkJCQl0cC0+dGczX2ZsYWdzIHw9IFRHM19GTEFHX05WUkFNX0JVRkZFUkVEOworCQkJCWJy ZWFrOworCQkJY2FzZSBGTEFTSF9WRU5ET1JfQVRNRUxfRkxBU0hfVU5CVUZGRVJFRDoKKwkJCQl0 cC0+bnZyYW1famVkZWNudW0gPSBKRURFQ19BVE1FTDsKKyAgICAgICAgICAgICAgICAgICAgICAg ICAJdHAtPm52cmFtX3BhZ2VzaXplID0gQVRNRUxfQVQyNUY1MTJfUEFHRV9TSVpFOworCQkJCWJy ZWFrOworCQkJY2FzZSBGTEFTSF9WRU5ET1JfQVRNRUxfRUVQUk9NOgorCQkJCXRwLT5udnJhbV9q ZWRlY251bSA9IEpFREVDX0FUTUVMOworICAgICAgICAgICAgICAgICAgICAgICAgIAl0cC0+bnZy YW1fcGFnZXNpemUgPSBBVE1FTF9BVDI0QzUxMl9DSElQX1NJWkU7CisJCQkJdHAtPnRnM19mbGFn cyB8PSBURzNfRkxBR19OVlJBTV9CVUZGRVJFRDsKKwkJCQlicmVhazsKKwkJCWNhc2UgRkxBU0hf VkVORE9SX1NUOgorCQkJCXRwLT5udnJhbV9qZWRlY251bSA9IEpFREVDX1NUOworCQkJCXRwLT5u dnJhbV9wYWdlc2l6ZSA9IFNUX000NVBFWDBfUEFHRV9TSVpFOworCQkJCXRwLT50ZzNfZmxhZ3Mg fD0gVEczX0ZMQUdfTlZSQU1fQlVGRkVSRUQ7CisJCQkJYnJlYWs7CisJCQljYXNlIEZMQVNIX1ZF TkRPUl9TQUlGVU46CisJCQkJdHAtPm52cmFtX2plZGVjbnVtID0gSkVERUNfU0FJRlVOOworCQkJ CXRwLT5udnJhbV9wYWdlc2l6ZSA9IFNBSUZVTl9TQTI1RjBYWF9QQUdFX1NJWkU7CisJCQkJYnJl YWs7CisJCQljYXNlIEZMQVNIX1ZFTkRPUl9TU1RfU01BTEw6CisJCQljYXNlIEZMQVNIX1ZFTkRP Ul9TU1RfTEFSR0U6CisJCQkJdHAtPm52cmFtX2plZGVjbnVtID0gSkVERUNfU1NUOworCQkJCXRw LT5udnJhbV9wYWdlc2l6ZSA9IFNTVF8yNVZGMFgwX1BBR0VfU0laRTsKKwkJCQlicmVhazsKKwkJ fQorCX0KKwllbHNlIHsKKwkJdHAtPm52cmFtX2plZGVjbnVtID0gSkVERUNfQVRNRUw7CisJCXRw LT5udnJhbV9wYWdlc2l6ZSA9IEFUTUVMX0FUNDVEQjBYMUJfUEFHRV9TSVpFOworCQl0cC0+dGcz X2ZsYWdzIHw9IFRHM19GTEFHX05WUkFNX0JVRkZFUkVEOworCX0KK30KKwogLyogQ2hpcHMgb3Ro ZXIgdGhhbiA1NzAwLzU3MDEgdXNlIHRoZSBOVlJBTSBmb3IgZmV0Y2hpbmcgaW5mby4gKi8KIHN0 YXRpYyB2b2lkIF9fZGV2aW5pdCB0ZzNfbnZyYW1faW5pdChzdHJ1Y3QgdGczICp0cCkKIHsKQEAg LTY4NzYsMzIgKzcwMzIsMjcgQEAKIAogCWlmIChHRVRfQVNJQ19SRVYodHAtPnBjaV9jaGlwX3Jl dl9pZCkgIT0gQVNJQ19SRVZfNTcwMCAmJgogCSAgICBHRVRfQVNJQ19SRVYodHAtPnBjaV9jaGlw X3Jldl9pZCkgIT0gQVNJQ19SRVZfNTcwMSkgewotCQl1MzIgbnZjZmcxOworCQl0cC0+dGczX2Zs YWdzIHw9IFRHM19GTEFHX05WUkFNOwogCiAJCWlmIChHRVRfQVNJQ19SRVYodHAtPnBjaV9jaGlw X3Jldl9pZCkgPT0gQVNJQ19SRVZfNTc1MCkgewogCQkJdTMyIG52YWNjZXNzID0gdHIzMihOVlJB TV9BQ0NFU1MpOwogCi0JCQl0dzMyX2YoTlZSQU1fQUNDRVNTLCBudmFjY2VzcyB8IEFDQ0VTU19F TkFCTEUpOworCQkJdHczMihOVlJBTV9BQ0NFU1MsIG52YWNjZXNzIHwgQUNDRVNTX0VOQUJMRSk7 CiAJCX0KIAotCQludmNmZzEgPSB0cjMyKE5WUkFNX0NGRzEpOwotCi0JCXRwLT50ZzNfZmxhZ3Mg fD0gVEczX0ZMQUdfTlZSQU07Ci0JCWlmIChudmNmZzEgJiBOVlJBTV9DRkcxX0ZMQVNISUZfRU5B QikgewotCQkJaWYgKG52Y2ZnMSAmIE5WUkFNX0NGRzFfQlVGRkVSRURfTU9ERSkKLQkJCQl0cC0+ dGczX2ZsYWdzIHw9IFRHM19GTEFHX05WUkFNX0JVRkZFUkVEOwotCQl9IGVsc2UgewotCQkJbnZj ZmcxICY9IH5OVlJBTV9DRkcxX0NPTVBBVF9CWVBBU1M7Ci0JCQl0dzMyKE5WUkFNX0NGRzEsIG52 Y2ZnMSk7Ci0JCX0KKwkJdGczX2dldF9udnJhbV9pbmZvKHRwKTsKKwkJdGczX2dldF9udnJhbV9z aXplKHRwKTsKIAogCQlpZiAoR0VUX0FTSUNfUkVWKHRwLT5wY2lfY2hpcF9yZXZfaWQpID09IEFT SUNfUkVWXzU3NTApIHsKIAkJCXUzMiBudmFjY2VzcyA9IHRyMzIoTlZSQU1fQUNDRVNTKTsKIAot CQkJdHczMl9mKE5WUkFNX0FDQ0VTUywgbnZhY2Nlc3MgJiB+QUNDRVNTX0VOQUJMRSk7CisJCQl0 dzMyKE5WUkFNX0FDQ0VTUywgbnZhY2Nlc3MgJiB+QUNDRVNTX0VOQUJMRSk7CiAJCX0KKwogCX0g ZWxzZSB7CiAJCXRwLT50ZzNfZmxhZ3MgJj0gfihURzNfRkxBR19OVlJBTSB8IFRHM19GTEFHX05W UkFNX0JVRkZFUkVEKTsKKworCQl0ZzNfZ2V0X2VlcHJvbV9zaXplKHRwKTsKIAl9CiB9CiAKQEAg LTY5MzksMTEgKzcwOTAsMzAgQEAKIAlyZXR1cm4gMDsKIH0KIAotc3RhdGljIGludCBfX2Rldmlu aXQgdGczX252cmFtX3JlYWQoc3RydWN0IHRnMyAqdHAsCi0JCQkJICAgIHUzMiBvZmZzZXQsIHUz MiAqdmFsKQorI2RlZmluZSBOVlJBTV9DTURfVElNRU9VVCAxMDAwMAorCitzdGF0aWMgaW50IHRn M19udnJhbV9leGVjX2NtZChzdHJ1Y3QgdGczICp0cCwgdTMyIG52cmFtX2NtZCkKIHsKIAlpbnQg aTsKIAorCXR3MzIoTlZSQU1fQ01ELCBudnJhbV9jbWQpOworCWZvciAoaSA9IDA7IGkgPCBOVlJB TV9DTURfVElNRU9VVDsgaSsrKSB7CisJCXVkZWxheSgxMCk7CisJCWlmICh0cjMyKE5WUkFNX0NN RCkgJiBOVlJBTV9DTURfRE9ORSkgeworCQkJdWRlbGF5KDEwKTsKKwkJCWJyZWFrOworCQl9CisJ fQorCWlmIChpID09IE5WUkFNX0NNRF9USU1FT1VUKSB7CisJCXJldHVybiAtRUJVU1k7CisJfQor CXJldHVybiAwOworfQorCitzdGF0aWMgaW50IHRnM19udnJhbV9yZWFkKHN0cnVjdCB0ZzMgKnRw LCB1MzIgb2Zmc2V0LCB1MzIgKnZhbCkKK3sKKwlpbnQgcmV0OworCiAJaWYgKHRwLT50ZzNfZmxh Z3MyICYgVEczX0ZMRzJfU1VOXzU3MFgpIHsKIAkJcHJpbnRrKEtFUk5fRVJSIFBGWCAiQXR0ZW1w dCB0byBkbyBudnJhbV9yZWFkIG9uIFN1biA1NzBYXG4iKTsKIAkJcmV0dXJuIC1FSU5WQUw7CkBA IC02OTUyLDEwICs3MTIyLDE0IEBACiAJaWYgKCEodHAtPnRnM19mbGFncyAmIFRHM19GTEFHX05W UkFNKSkKIAkJcmV0dXJuIHRnM19udnJhbV9yZWFkX3VzaW5nX2VlcHJvbSh0cCwgb2Zmc2V0LCB2 YWwpOwogCi0JaWYgKHRwLT50ZzNfZmxhZ3MgJiBURzNfRkxBR19OVlJBTV9CVUZGRVJFRCkKLQkJ b2Zmc2V0ID0gKChvZmZzZXQgLyBOVlJBTV9CVUZGRVJFRF9QQUdFX1NJWkUpIDw8Ci0JCQkgIE5W UkFNX0JVRkZFUkVEX1BBR0VfUE9TKSArCi0JCQkob2Zmc2V0ICUgTlZSQU1fQlVGRkVSRURfUEFH RV9TSVpFKTsKKwlpZiAoKHRwLT50ZzNfZmxhZ3MgJiBURzNfRkxBR19OVlJBTV9CVUZGRVJFRCkg JiYKKwkJKHRwLT50ZzNfZmxhZ3MyICYgVEczX0ZMRzJfRkxBU0gpICYmCisJCSh0cC0+bnZyYW1f amVkZWNudW0gPT0gSkVERUNfQVRNRUwpKSB7CisKKwkJb2Zmc2V0ID0gKChvZmZzZXQgLyB0cC0+ bnZyYW1fcGFnZXNpemUpIDw8CisJCQkgIEFUTUVMX0FUNDVEQjBYMUJfUEFHRV9QT1MpICsKKwkJ CShvZmZzZXQgJSB0cC0+bnZyYW1fcGFnZXNpemUpOworCX0KIAogCWlmIChvZmZzZXQgPiBOVlJB TV9BRERSX01TSykKIAkJcmV0dXJuIC1FSU5WQUw7CkBAIC02OTY1LDM2ICs3MTM5LDI4NiBAQAog CWlmIChHRVRfQVNJQ19SRVYodHAtPnBjaV9jaGlwX3Jldl9pZCkgPT0gQVNJQ19SRVZfNTc1MCkg ewogCQl1MzIgbnZhY2Nlc3MgPSB0cjMyKE5WUkFNX0FDQ0VTUyk7CiAKLQkJdHczMl9mKE5WUkFN X0FDQ0VTUywgbnZhY2Nlc3MgfCBBQ0NFU1NfRU5BQkxFKTsKKwkJdHczMihOVlJBTV9BQ0NFU1Ms IG52YWNjZXNzIHwgQUNDRVNTX0VOQUJMRSk7CiAJfQogCiAJdHczMihOVlJBTV9BRERSLCBvZmZz ZXQpOwotCXR3MzIoTlZSQU1fQ01ELAotCSAgICAgTlZSQU1fQ01EX1JEIHwgTlZSQU1fQ01EX0dP IHwKLQkgICAgIE5WUkFNX0NNRF9GSVJTVCB8IE5WUkFNX0NNRF9MQVNUIHwgTlZSQU1fQ01EX0RP TkUpOworCXJldCA9IHRnM19udnJhbV9leGVjX2NtZCh0cCwgTlZSQU1fQ01EX1JEIHwgTlZSQU1f Q01EX0dPIHwKKwkJTlZSQU1fQ01EX0ZJUlNUIHwgTlZSQU1fQ01EX0xBU1QgfCBOVlJBTV9DTURf RE9ORSk7CiAKLQkvKiBXYWl0IGZvciBkb25lIGJpdCB0byBjbGVhci4gKi8KLQlmb3IgKGkgPSAw OyBpIDwgMTAwMDsgaSsrKSB7Ci0JCXVkZWxheSgxMCk7Ci0JCWlmICh0cjMyKE5WUkFNX0NNRCkg JiBOVlJBTV9DTURfRE9ORSkgewotCQkJdWRlbGF5KDEwKTsKLQkJCSp2YWwgPSBzd2FiMzIodHIz MihOVlJBTV9SRERBVEEpKTsKLQkJCWJyZWFrOwotCQl9Ci0JfQorCWlmIChyZXQgPT0gMCkKKwkJ KnZhbCA9IHN3YWIzMih0cjMyKE5WUkFNX1JEREFUQSkpOwogCiAJdGczX252cmFtX3VubG9jayh0 cCk7CiAKIAlpZiAoR0VUX0FTSUNfUkVWKHRwLT5wY2lfY2hpcF9yZXZfaWQpID09IEFTSUNfUkVW XzU3NTApIHsKIAkJdTMyIG52YWNjZXNzID0gdHIzMihOVlJBTV9BQ0NFU1MpOwogCi0JCXR3MzJf ZihOVlJBTV9BQ0NFU1MsIG52YWNjZXNzICYgfkFDQ0VTU19FTkFCTEUpOworCQl0dzMyKE5WUkFN X0FDQ0VTUywgbnZhY2Nlc3MgJiB+QUNDRVNTX0VOQUJMRSk7CiAJfQogCi0JaWYgKGkgPj0gMTAw MCkKLQkJcmV0dXJuIC1FQlVTWTsKKwlyZXR1cm4gcmV0OworfQogCi0JcmV0dXJuIDA7CitzdGF0 aWMgaW50IHRnM19udnJhbV93cml0ZV9ibG9ja191c2luZ19lZXByb20oc3RydWN0IHRnMyAqdHAs CisJCQkJICAgIHUzMiBvZmZzZXQsIHUzMiBsZW4sIHU4ICpidWYpCit7CisJaW50IGksIGosIHJj ID0gMDsKKwl1MzIgdmFsOworCisJZm9yIChpID0gMDsgaSA8IGxlbjsgaSArPSA0KSB7CisJCXUz MiBhZGRyLCBkYXRhOworCisJCWFkZHIgPSBvZmZzZXQgKyBpOworCisJCW1lbWNweSgmZGF0YSwg YnVmICsgaSwgNCk7CisKKwkJdHczMihHUkNfRUVQUk9NX0RBVEEsIGNwdV90b19sZTMyKGRhdGEp KTsKKworCQl2YWwgPSB0cjMyKEdSQ19FRVBST01fQUREUik7CisJCXR3MzIoR1JDX0VFUFJPTV9B RERSLCB2YWwgfCBFRVBST01fQUREUl9DT01QTEVURSk7CisKKwkJdmFsICY9IH4oRUVQUk9NX0FE RFJfQUREUl9NQVNLIHwgRUVQUk9NX0FERFJfREVWSURfTUFTSyB8CisJCQlFRVBST01fQUREUl9S RUFEKTsKKwkJdHczMihHUkNfRUVQUk9NX0FERFIsIHZhbCB8CisJCQkoMCA8PCBFRVBST01fQURE Ul9ERVZJRF9TSElGVCkgfAorCQkJKGFkZHIgJiBFRVBST01fQUREUl9BRERSX01BU0spIHwKKwkJ CUVFUFJPTV9BRERSX1NUQVJUIHwKKwkJCUVFUFJPTV9BRERSX1dSSVRFKTsKKwkJCisJCWZvciAo aiA9IDA7IGogPCAxMDAwMDsgaisrKSB7CisJCQl2YWwgPSB0cjMyKEdSQ19FRVBST01fQUREUik7 CisKKwkJCWlmICh2YWwgJiBFRVBST01fQUREUl9DT01QTEVURSkKKwkJCQlicmVhazsKKwkJCXVk ZWxheSgxMDApOworCQl9CisJCWlmICghKHZhbCAmIEVFUFJPTV9BRERSX0NPTVBMRVRFKSkgewor CQkJcmMgPSAtRUJVU1k7CisJCQlicmVhazsKKwkJfQorCX0KKworCXJldHVybiByYzsKK30KKwor Lyogb2Zmc2V0IGFuZCBsZW5ndGggYXJlIGR3b3JkIGFsaWduZWQgKi8KK3N0YXRpYyBpbnQgdGcz X252cmFtX3dyaXRlX2Jsb2NrX3VuYnVmZmVyZWQoc3RydWN0IHRnMyAqdHAsIHUzMiBvZmZzZXQs IHUzMiBsZW4sCisJCXU4ICpidWYpCit7CisJaW50IHJldCA9IDA7CisJdTMyIHBhZ2VzaXplID0g dHAtPm52cmFtX3BhZ2VzaXplOworCXUzMiBwYWdlbWFzayA9IHBhZ2VzaXplIC0gMTsKKwl1MzIg bnZyYW1fY21kOworCXU4ICp0bXA7CisKKwl0bXAgPSBrbWFsbG9jKHBhZ2VzaXplLCBHRlBfS0VS TkVMKTsKKwlpZiAodG1wID09IE5VTEwpCisJCXJldHVybiAtRU5PTUVNOworCisJd2hpbGUgKGxl bikgeworCQlpbnQgajsKKwkJdTMyIHBoeV9hZGRyLCBwYWdlX29mZiwgc2l6ZSwgbnZhY2Nlc3M7 CisKKwkJcGh5X2FkZHIgPSBvZmZzZXQgJiB+cGFnZW1hc2s7CisJCisJCWZvciAoaiA9IDA7IGog PCBwYWdlc2l6ZTsgaiArPSA0KSB7CisJCQlpZiAoKHJldCA9IHRnM19udnJhbV9yZWFkKHRwLCBw aHlfYWRkciArIGosCisJCQkJCQkodTMyICopICh0bXAgKyBqKSkpKQorCQkJCWJyZWFrOworCQl9 CisJCWlmIChyZXQpCisJCQlicmVhazsKKworCSAgICAgICAgcGFnZV9vZmYgPSBvZmZzZXQgJiBw YWdlbWFzazsKKwkJc2l6ZSA9IHBhZ2VzaXplOworCQlpZiAobGVuIDwgc2l6ZSkKKwkJCXNpemUg PSBsZW47CisKKwkJbGVuIC09IHNpemU7CisKKwkJbWVtY3B5KHRtcCArIHBhZ2Vfb2ZmLCBidWYs IHNpemUpOworCisJCW9mZnNldCA9IG9mZnNldCArIChwYWdlc2l6ZSAtIHBhZ2Vfb2ZmKTsKKwor CQludmFjY2VzcyA9IHRyMzIoTlZSQU1fQUNDRVNTKTsKKwkJdHczMihOVlJBTV9BQ0NFU1MsIG52 YWNjZXNzIHwgQUNDRVNTX0VOQUJMRSk7CisKKwkJLyoKKwkJICogQmVmb3JlIHdlIGNhbiBlcmFz ZSB0aGUgZmxhc2ggcGFnZSwgd2UgbmVlZAorCQkgKiB0byBpc3N1ZSBhIHNwZWNpYWwgIndyaXRl IGVuYWJsZSIgY29tbWFuZC4KKwkJICovCisJCW52cmFtX2NtZCA9IE5WUkFNX0NNRF9XUkVOIHwg TlZSQU1fQ01EX0dPIHwgTlZSQU1fQ01EX0RPTkU7CisKKwkJaWYgKHRnM19udnJhbV9leGVjX2Nt ZCh0cCwgbnZyYW1fY21kKSkKKwkJCWJyZWFrOworCisJCS8qIEVyYXNlIHRoZSB0YXJnZXQgcGFn ZSAqLworCQl0dzMyKE5WUkFNX0FERFIsIHBoeV9hZGRyKTsKKworCQludnJhbV9jbWQgPSBOVlJB TV9DTURfR08gfCBOVlJBTV9DTURfRE9ORSB8IE5WUkFNX0NNRF9XUiB8CisJCQlOVlJBTV9DTURf RklSU1QgfCBOVlJBTV9DTURfTEFTVCB8IE5WUkFNX0NNRF9FUkFTRTsKKworCSAgICAgICAgaWYg KHRnM19udnJhbV9leGVjX2NtZCh0cCwgbnZyYW1fY21kKSkKKwkJCWJyZWFrOworCisJCS8qIElz c3VlIGFub3RoZXIgd3JpdGUgZW5hYmxlIHRvIHN0YXJ0IHRoZSB3cml0ZS4gKi8KKwkJbnZyYW1f Y21kID0gTlZSQU1fQ01EX1dSRU4gfCBOVlJBTV9DTURfR08gfCBOVlJBTV9DTURfRE9ORTsKKwor CQlpZiAodGczX252cmFtX2V4ZWNfY21kKHRwLCBudnJhbV9jbWQpKQorCQkJYnJlYWs7CisKKwkJ Zm9yIChqID0gMDsgaiA8IHBhZ2VzaXplOyBqICs9IDQpIHsKKwkJCXUzMiBkYXRhOworCisJICAg IAkJZGF0YSA9ICooKHUzMiAqKSAodG1wICsgaikpOworCQkJdHczMihOVlJBTV9XUkRBVEEsIGNw dV90b19iZTMyKGRhdGEpKTsKKworCQkJdHczMihOVlJBTV9BRERSLCBwaHlfYWRkciArIGopOwor CisJCQludnJhbV9jbWQgPSBOVlJBTV9DTURfR08gfCBOVlJBTV9DTURfRE9ORSB8CisJCQkJTlZS QU1fQ01EX1dSOworCisJCQlpZiAoaiA9PSAwKQorCQkJCW52cmFtX2NtZCB8PSBOVlJBTV9DTURf RklSU1Q7CisJCQllbHNlIGlmIChqID09IChwYWdlc2l6ZSAtIDQpKQorCQkJCW52cmFtX2NtZCB8 PSBOVlJBTV9DTURfTEFTVDsKKworCQkJaWYgKChyZXQgPSB0ZzNfbnZyYW1fZXhlY19jbWQodHAs IG52cmFtX2NtZCkpKQorCQkJCWJyZWFrOworCQl9CisJCWlmIChyZXQpCisJCQlicmVhazsKKwl9 CisKKwludnJhbV9jbWQgPSBOVlJBTV9DTURfV1JESSB8IE5WUkFNX0NNRF9HTyB8IE5WUkFNX0NN RF9ET05FOworCXRnM19udnJhbV9leGVjX2NtZCh0cCwgbnZyYW1fY21kKTsKKworCWtmcmVlKHRt cCk7CisKKwlyZXR1cm4gcmV0OworfQorCisvKiBvZmZzZXQgYW5kIGxlbmd0aCBhcmUgZHdvcmQg YWxpZ25lZCAqLworc3RhdGljIGludCB0ZzNfbnZyYW1fd3JpdGVfYmxvY2tfYnVmZmVyZWQoc3Ry dWN0IHRnMyAqdHAsIHUzMiBvZmZzZXQsIHUzMiBsZW4sCisJCXU4ICpidWYpCit7CisJaW50IGks IHJldCA9IDA7CisKKwlmb3IgKGkgPSAwOyBpIDwgbGVuOyBpICs9IDQsIG9mZnNldCArPSA0KSB7 CisJCXUzMiBkYXRhLCBwYWdlX29mZiwgcGh5X2FkZHIsIG52cmFtX2NtZDsKKworCQltZW1jcHko JmRhdGEsIGJ1ZiArIGksIDQpOworCQl0dzMyKE5WUkFNX1dSREFUQSwgY3B1X3RvX2JlMzIoZGF0 YSkpOworCisJICAgICAgICBwYWdlX29mZiA9IG9mZnNldCAlIHRwLT5udnJhbV9wYWdlc2l6ZTsK KworCQlpZiAoKHRwLT50ZzNfZmxhZ3MyICYgVEczX0ZMRzJfRkxBU0gpICYmCisJCQkodHAtPm52 cmFtX2plZGVjbnVtID09IEpFREVDX0FUTUVMKSkgeworCisJCQlwaHlfYWRkciA9ICgob2Zmc2V0 IC8gdHAtPm52cmFtX3BhZ2VzaXplKSA8PAorCQkJCSAgICBBVE1FTF9BVDQ1REIwWDFCX1BBR0Vf UE9TKSArIHBhZ2Vfb2ZmOworCQl9CisJCWVsc2UgeworCQkJcGh5X2FkZHIgPSBvZmZzZXQ7CisJ CX0KKworCQl0dzMyKE5WUkFNX0FERFIsIHBoeV9hZGRyKTsKKworCQludnJhbV9jbWQgPSBOVlJB TV9DTURfR08gfCBOVlJBTV9DTURfRE9ORSB8IE5WUkFNX0NNRF9XUjsKKworCSAgICAgICAgaWYg KChwYWdlX29mZiA9PSAwKSB8fCAoaSA9PSAwKSkKKwkJCW52cmFtX2NtZCB8PSBOVlJBTV9DTURf RklSU1Q7CisJCWVsc2UgaWYgKHBhZ2Vfb2ZmID09ICh0cC0+bnZyYW1fcGFnZXNpemUgLSA0KSkK KwkJCW52cmFtX2NtZCB8PSBOVlJBTV9DTURfTEFTVDsKKworCQlpZiAoaSA9PSAobGVuIC0gNCkp CisJCQludnJhbV9jbWQgfD0gTlZSQU1fQ01EX0xBU1Q7CisKKwkJaWYgKCh0cC0+bnZyYW1famVk ZWNudW0gPT0gSkVERUNfU1QpICYmCisJCQkobnZyYW1fY21kICYgTlZSQU1fQ01EX0ZJUlNUKSkg eworCisJCQlpZiAoKHJldCA9IHRnM19udnJhbV9leGVjX2NtZCh0cCwKKwkJCQlOVlJBTV9DTURf V1JFTiB8IE5WUkFNX0NNRF9HTyB8CisJCQkJTlZSQU1fQ01EX0RPTkUpKSkKKworCQkJCWJyZWFr OworCQl9CisJCWlmICghKHRwLT50ZzNfZmxhZ3MyICYgVEczX0ZMRzJfRkxBU0gpKSB7CisJCQkv KiBXZSBhbHdheXMgZG8gY29tcGxldGUgd29yZCB3cml0ZXMgdG8gZWVwcm9tLiAqLworCQkJbnZy YW1fY21kIHw9IChOVlJBTV9DTURfRklSU1QgfCBOVlJBTV9DTURfTEFTVCk7CisJCX0KKworCQlp ZiAoKHJldCA9IHRnM19udnJhbV9leGVjX2NtZCh0cCwgbnZyYW1fY21kKSkpCisJCQlicmVhazsK Kwl9CisJcmV0dXJuIHJldDsKK30KKworLyogb2Zmc2V0IGFuZCBsZW5ndGggYXJlIGR3b3JkIGFs aWduZWQgKi8KK3N0YXRpYyBpbnQgdGczX252cmFtX3dyaXRlX2Jsb2NrKHN0cnVjdCB0ZzMgKnRw LCB1MzIgb2Zmc2V0LCB1MzIgbGVuLCB1OCAqYnVmKQoreworCWludCByZXQ7CisKKwlpZiAodHAt PnRnM19mbGFnczIgJiBURzNfRkxHMl9TVU5fNTcwWCkgeworCQlwcmludGsoS0VSTl9FUlIgUEZY ICJBdHRlbXB0IHRvIGRvIG52cmFtX3dyaXRlIG9uIFN1biA1NzBYXG4iKTsKKwkJcmV0dXJuIC1F SU5WQUw7CisJfQorCisJaWYgKHRwLT50ZzNfZmxhZ3MgJiBURzNfRkxBR19FRVBST01fV1JJVEVf UFJPVCkgeworCQl0dzMyX2YoR1JDX0xPQ0FMX0NUUkwsIHRwLT5ncmNfbG9jYWxfY3RybCB8CisJ CSAgICAgICBHUkNfTENMQ1RSTF9HUElPX09FMSk7CisJCXVkZWxheSg0MCk7CisJfQorCisJaWYg KCEodHAtPnRnM19mbGFncyAmIFRHM19GTEFHX05WUkFNKSkgeworCQlyZXQgPSB0ZzNfbnZyYW1f d3JpdGVfYmxvY2tfdXNpbmdfZWVwcm9tKHRwLCBvZmZzZXQsIGxlbiwgYnVmKTsKKwl9CisJZWxz ZSB7CisJCXUzMiBncmNfbW9kZTsKKworCQl0ZzNfbnZyYW1fbG9jayh0cCk7CisKKwkJaWYgKEdF VF9BU0lDX1JFVih0cC0+cGNpX2NoaXBfcmV2X2lkKSA9PSBBU0lDX1JFVl81NzUwKSB7CisJCQl1 MzIgbnZhY2Nlc3MgPSB0cjMyKE5WUkFNX0FDQ0VTUyk7CisKKwkJCXR3MzIoTlZSQU1fQUNDRVNT LCBudmFjY2VzcyB8IEFDQ0VTU19FTkFCTEUpOworCisJCQl0dzMyKE5WUkFNX1dSSVRFMSwgMHg0 MDYpOworCQl9CisKKwkJZ3JjX21vZGUgPSB0cjMyKEdSQ19NT0RFKTsKKwkJdHczMihHUkNfTU9E RSwgZ3JjX21vZGUgfCBHUkNfTU9ERV9OVlJBTV9XUl9FTkFCTEUpOworCisJCWlmICgodHAtPnRn M19mbGFncyAmIFRHM19GTEFHX05WUkFNX0JVRkZFUkVEKSB8fAorCQkJISh0cC0+dGczX2ZsYWdz MiAmIFRHM19GTEcyX0ZMQVNIKSkgeworCisJCQlyZXQgPSB0ZzNfbnZyYW1fd3JpdGVfYmxvY2tf YnVmZmVyZWQodHAsIG9mZnNldCwgbGVuLAorCQkJCWJ1Zik7CisJCX0KKwkJZWxzZSB7CisJCQly ZXQgPSB0ZzNfbnZyYW1fd3JpdGVfYmxvY2tfdW5idWZmZXJlZCh0cCwgb2Zmc2V0LCBsZW4sCisJ CQkJYnVmKTsKKwkJfQorCisJCWdyY19tb2RlID0gdHIzMihHUkNfTU9ERSk7CisJCXR3MzIoR1JD X01PREUsIGdyY19tb2RlICYgfkdSQ19NT0RFX05WUkFNX1dSX0VOQUJMRSk7CisKKwkJaWYgKEdF VF9BU0lDX1JFVih0cC0+cGNpX2NoaXBfcmV2X2lkKSA9PSBBU0lDX1JFVl81NzUwKSB7CisJCQl1 MzIgbnZhY2Nlc3MgPSB0cjMyKE5WUkFNX0FDQ0VTUyk7CisKKwkJCXR3MzIoTlZSQU1fQUNDRVNT LCBudmFjY2VzcyAmIH5BQ0NFU1NfRU5BQkxFKTsKKwkJfQorCQl0ZzNfbnZyYW1fdW5sb2NrKHRw KTsKKwl9CisKKwlpZiAodHAtPnRnM19mbGFncyAmIFRHM19GTEFHX0VFUFJPTV9XUklURV9QUk9U KSB7CisJCXR3MzJfZihHUkNfTE9DQUxfQ1RSTCwgdHAtPmdyY19sb2NhbF9jdHJsIHwKKwkJICAg ICAgIEdSQ19MQ0xDVFJMX0dQSU9fT0UxIHwgR1JDX0xDTENUUkxfR1BJT19PVVRQVVQxKTsKKwkJ dWRlbGF5KDQwKTsKKwl9CisKKwlyZXR1cm4gcmV0OwogfQogCiBzdHJ1Y3Qgc3Vic3lzX3RibF9l bnQgewpkaWZmIC1OcnUgMS90ZzMuaCAyL3RnMy5oCi0tLSAxL3RnMy5oCTIwMDUtMDEtMTYgMTE6 MzY6MTEuMDAwMDAwMDAwIC0wODAwCisrKyAyL3RnMy5oCTIwMDUtMDEtMTkgMTQ6MjU6MjAuMDAw MDAwMDAwIC0wODAwCkBAIC0xMjc0LDYgKzEyNzQsNyBAQAogI2RlZmluZSAgR1JDX01PREVfSE9T VF9TVEFDS1VQCQkweDAwMDEwMDAwCiAjZGVmaW5lICBHUkNfTU9ERV9IT1NUX1NFTkRCRFMJCTB4 MDAwMjAwMDAKICNkZWZpbmUgIEdSQ19NT0RFX05PX1RYX1BIRFJfQ1NVTQkweDAwMTAwMDAwCisj ZGVmaW5lICBHUkNfTU9ERV9OVlJBTV9XUl9FTkFCTEUJMHgwMDIwMDAwMAogI2RlZmluZSAgR1JD X01PREVfTk9fUlhfUEhEUl9DU1VNCTB4MDA4MDAwMDAKICNkZWZpbmUgIEdSQ19NT0RFX0lSUV9P Tl9UWF9DUFVfQVRUTgkweDAxMDAwMDAwCiAjZGVmaW5lICBHUkNfTU9ERV9JUlFfT05fUlhfQ1BV X0FUVE4JMHgwMjAwMDAwMApAQCAtMTM2Niw2ICsxMzY3LDggQEAKICNkZWZpbmUgIE5WUkFNX0NN RF9FUkFTRQkJIDB4MDAwMDAwNDAKICNkZWZpbmUgIE5WUkFNX0NNRF9GSVJTVAkJIDB4MDAwMDAw ODAKICNkZWZpbmUgIE5WUkFNX0NNRF9MQVNUCQkJIDB4MDAwMDAxMDAKKyNkZWZpbmUgIE5WUkFN X0NNRF9XUkVOCQkJIDB4MDAwMTAwMDAKKyNkZWZpbmUgIE5WUkFNX0NNRF9XUkRJCQkJIDB4MDAw MjAwMDAKICNkZWZpbmUgTlZSQU1fU1RBVAkJCTB4MDAwMDcwMDQKICNkZWZpbmUgTlZSQU1fV1JE QVRBCQkJMHgwMDAwNzAwOAogI2RlZmluZSBOVlJBTV9BRERSCQkJMHgwMDAwNzAwYwpAQCAtMTM3 NSw4ICsxMzc4LDE4IEBACiAjZGVmaW5lICBOVlJBTV9DRkcxX0ZMQVNISUZfRU5BQgkgMHgwMDAw MDAwMQogI2RlZmluZSAgTlZSQU1fQ0ZHMV9CVUZGRVJFRF9NT0RFCSAweDAwMDAwMDAyCiAjZGVm aW5lICBOVlJBTV9DRkcxX1BBU1NfVEhSVQkJIDB4MDAwMDAwMDQKKyNkZWZpbmUgIE5WUkFNX0NG RzFfU1RBVFVTX0JJVFMJCSAweDAwMDAwMDcwCiAjZGVmaW5lICBOVlJBTV9DRkcxX0JJVF9CQU5H CQkgMHgwMDAwMDAwOAorI2RlZmluZSAgTlZSQU1fQ0ZHMV9GTEFTSF9TSVpFCQkgMHgwMjAwMDAw MAogI2RlZmluZSAgTlZSQU1fQ0ZHMV9DT01QQVRfQllQQVNTCSAweDgwMDAwMDAwCisjZGVmaW5l ICBOVlJBTV9DRkcxX1ZFTkRPUl9NQVNLCQkgMHgwMzAwMDAwMworI2RlZmluZSAgRkxBU0hfVkVO RE9SX0FUTUVMX0VFUFJPTQkgMHgwMjAwMDAwMAorI2RlZmluZSAgRkxBU0hfVkVORE9SX0FUTUVM X0ZMQVNIX0JVRkZFUkVECSAweDAyMDAwMDAzCisjZGVmaW5lICBGTEFTSF9WRU5ET1JfQVRNRUxf RkxBU0hfVU5CVUZGRVJFRAkgMHgwMDAwMDAwMworI2RlZmluZSAgRkxBU0hfVkVORE9SX1NUCQkJ IDB4MDMwMDAwMDEKKyNkZWZpbmUgIEZMQVNIX1ZFTkRPUl9TQUlGVU4JCSAweDAxMDAwMDAzCisj ZGVmaW5lICBGTEFTSF9WRU5ET1JfU1NUX1NNQUxMCQkgMHgwMDAwMDAwMQorI2RlZmluZSAgRkxB U0hfVkVORE9SX1NTVF9MQVJHRQkJIDB4MDIwMDAwMDEKICNkZWZpbmUgTlZSQU1fQ0ZHMgkJCTB4 MDAwMDcwMTgKICNkZWZpbmUgTlZSQU1fQ0ZHMwkJCTB4MDAwMDcwMWMKICNkZWZpbmUgTlZSQU1f U1dBUkIJCQkweDAwMDA3MDIwCkBAIC0xMzk2LDE1ICsxNDA5LDE2IEBACiAjZGVmaW5lICBTV0FS Ql9SRVExCQkJIDB4MDAwMDIwMDAKICNkZWZpbmUgIFNXQVJCX1JFUTIJCQkgMHgwMDAwNDAwMAog I2RlZmluZSAgU1dBUkJfUkVRMwkJCSAweDAwMDA4MDAwCi0jZGVmaW5lICAgIE5WUkFNX0JVRkZF UkVEX1BBR0VfU0laRQkgICAyNjQKLSNkZWZpbmUgICAgTlZSQU1fQlVGRkVSRURfUEFHRV9QT1MJ ICAgOQogI2RlZmluZSBOVlJBTV9BQ0NFU1MJCQkweDAwMDA3MDI0CiAjZGVmaW5lICBBQ0NFU1Nf RU5BQkxFCQkJIDB4MDAwMDAwMDEKICNkZWZpbmUgIEFDQ0VTU19XUl9FTkFCTEUJCSAweDAwMDAw MDAyCi0vKiAweDcwMjQgLS0+IDB4NzQwMCB1bnVzZWQgKi8KKyNkZWZpbmUgTlZSQU1fV1JJVEUx CQkJMHgwMDAwNzAyOAorLyogMHg3MDJjIC0tPiAweDc0MDAgdW51c2VkICovCiAKIC8qIDB4NzQw MCAtLT4gMHg4MDAwIHVudXNlZCAqLwogCisjZGVmaW5lIFRHM19FRVBST01fTUFHSUMJCTB4NjY5 OTU1YWEKKwogLyogMzJLIFdpbmRvdyBpbnRvIE5JQyBpbnRlcm5hbCBtZW1vcnkgKi8KICNkZWZp bmUgTklDX1NSQU1fV0lOX0JBU0UJCTB4MDAwMDgwMDAKIApAQCAtMjA5MCw2ICsyMTA0LDcgQEAK ICNkZWZpbmUgVEczX0ZMRzJfUEhZX0pVU1RfSU5JVFRFRAkweDAwMDAxMDAwCiAjZGVmaW5lIFRH M19GTEcyX1BIWV9TRVJERVMJCTB4MDAwMDIwMDAKICNkZWZpbmUgVEczX0ZMRzJfQ0FQQUNJVElW RV9DT1VQTElORwkweDAwMDA0MDAwCisjZGVmaW5lIFRHM19GTEcyX0ZMQVNICQkJMHgwMDAwODAw MAogCiAJdTMyCQkJCXNwbGl0X21vZGVfbWF4X3JlcXM7CiAjZGVmaW5lIFNQTElUX01PREVfNTcw NF9NQVhfUkVRCQkzCkBAIC0yMTYzLDYgKzIxNzgsMzQgQEAKIAlzdHJ1Y3QgdGczX2h3X3N0YXRz CQkqaHdfc3RhdHM7CiAJZG1hX2FkZHJfdAkJCXN0YXRzX21hcHBpbmc7CiAJc3RydWN0IHdvcmtf c3RydWN0CQlyZXNldF90YXNrOworCisJdTMyCQkJCW52cmFtX3NpemU7CisJdTMyCQkJCW52cmFt X3BhZ2VzaXplOworCXUzMgkJCQludnJhbV9qZWRlY251bTsKKworI2RlZmluZSBKRURFQ19BVE1F TAkJCTB4MWYKKyNkZWZpbmUgSkVERUNfU1QJCQkweDIwCisjZGVmaW5lIEpFREVDX1NBSUZVTgkJ CTB4NGYKKyNkZWZpbmUgSkVERUNfU1NUCQkJMHhiZgorCisjZGVmaW5lIEFUTUVMX0FUMjRDNjRf Q0hJUF9TSVpFCQkoNjQgKiAxMDI0KQorI2RlZmluZSBBVE1FTF9BVDI0QzY0X1BBR0VfU0laRQkJ KDMyKQorCisjZGVmaW5lIEFUTUVMX0FUMjRDNTEyX0NISVBfU0laRQkoNTEyICogMTAyNCkKKyNk ZWZpbmUgQVRNRUxfQVQyNEM1MTJfUEFHRV9TSVpFCSgxMjgpCisKKyNkZWZpbmUgQVRNRUxfQVQ0 NURCMFgxQl9QQUdFX1BPUwk5CisjZGVmaW5lIEFUTUVMX0FUNDVEQjBYMUJfUEFHRV9TSVpFCTI2 NAorCisjZGVmaW5lIEFUTUVMX0FUMjVGNTEyX1BBR0VfU0laRQkyNTYKKworI2RlZmluZSBTVF9N NDVQRVgwX1BBR0VfU0laRQkJMjU2CisKKyNkZWZpbmUgU0FJRlVOX1NBMjVGMFhYX1BBR0VfU0la RQkyNTYKKworI2RlZmluZSBTU1RfMjVWRjBYMF9QQUdFX1NJWkUJCTQwOTgKKworCiB9OwogCiAj ZW5kaWYgLyogIShfVDNfSCkgKi8K ------_=_NextPart_001_01C4FF4C.3D76D0CA-- From nacc@us.ibm.com Thu Jan 20 16:20:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 16:20:16 -0800 (PST) Received: from e2.ny.us.ibm.com (e2.ny.us.ibm.com [32.97.182.142]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L0K4hx005161 for ; Thu, 20 Jan 2005 16:20:11 -0800 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e2.ny.us.ibm.com (8.12.10/8.12.10) with ESMTP id j0L0JxSK028077 for ; Thu, 20 Jan 2005 19:19:59 -0500 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j0L0JxXM279782 for ; Thu, 20 Jan 2005 19:19:59 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j0L0JwkN024187 for ; Thu, 20 Jan 2005 19:19:59 -0500 Received: from joust (joust.beaverton.ibm.com [9.47.17.65]) by d01av02.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j0L0Jw13024158; Thu, 20 Jan 2005 19:19:58 -0500 Received: by joust (Postfix, from userid 1000) id 77E0E4F978; Thu, 20 Jan 2005 15:53:52 -0800 (PST) Date: Thu, 20 Jan 2005 15:53:52 -0800 From: Nishanth Aravamudan To: netdev@oss.sgi.com Cc: linux-net@vger.kernel.org, kernel-janitors@lists.osdl.org Subject: [PATCH 19/39] net/dev: replace schedule_timeout() with msleep() Message-ID: <20050120235352.GH2600@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 577 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nacc@us.ibm.com Precedence: bulk X-list: netdev Hi, Please consider applying. Description: Use msleep() instead of schedule_timeout() to guarantee the task delays as expected. The current code uses TASK_INTERRUPTIBLE, but does not respond to signals, so msleep() should be ok. Signed-off-by: Nishanth Aravamudan --- 2.6.11-rc1-kj-v/net/core/dev.c 2005-01-15 16:55:44.000000000 -0800 +++ 2.6.11-rc1-kj/net/core/dev.c 2005-01-18 12:59:16.000000000 -0800 @@ -108,6 +108,7 @@ #include #include #include +#include #ifdef CONFIG_NET_RADIO #include /* Note : will define WIRELESS_EXT */ #include @@ -2899,8 +2900,7 @@ static void netdev_wait_allrefs(struct n rebroadcast_time = jiffies; } - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(HZ / 4); + msleep(250); if (time_after(jiffies, warning_time + 10 * HZ)) { printk(KERN_EMERG "unregister_netdevice: " From nacc@us.ibm.com Thu Jan 20 16:20:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 16:20:26 -0800 (PST) Received: from e5.ny.us.ibm.com (e5.ny.us.ibm.com [32.97.182.145]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L0KLZT005182 for ; Thu, 20 Jan 2005 16:20:21 -0800 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e5.ny.us.ibm.com (8.12.10/8.12.10) with ESMTP id j0L0K0JX005655 for ; Thu, 20 Jan 2005 19:20:00 -0500 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay04.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j0L0K0JS205686 for ; Thu, 20 Jan 2005 19:20:00 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j0L0JxV3024213 for ; Thu, 20 Jan 2005 19:20:00 -0500 Received: from joust (joust.beaverton.ibm.com [9.47.17.65]) by d01av02.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j0L0JxoE024209; Thu, 20 Jan 2005 19:19:59 -0500 Received: by joust (Postfix, from userid 1000) id 581134F97A; Thu, 20 Jan 2005 15:56:34 -0800 (PST) Date: Thu, 20 Jan 2005 15:56:34 -0800 From: Nishanth Aravamudan To: davem@davemloft.net, kuznet@ms2.inr.ac.ru, jmorris@redhat.com, yoshfuji@linux-ipv6.org, kaber@coreworks.de Cc: netdev@oss.sgi.com, kernel-janitors@lists.osdl.org Subject: [PATCH 20/39] net/ip_vs_sync: replace schedule_timeout() with ssleep() Message-ID: <20050120235634.GI2600@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 579 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nacc@us.ibm.com Precedence: bulk X-list: netdev Hi, Please consider applying. Description: Use ssleep() instead of schedule_timeout() to guarantee the task delays as expected. The first two replacements use TASK_INTERRUPTIBLE but do not check for signals, so ssleep() should be appropriate. Signed-off-by: Nishanth Aravamudan --- 2.6.11-rc1-kj-v/net/ipv4/ipvs/ip_vs_sync.c 2005-01-15 16:55:44.000000000 -0800 +++ 2.6.11-rc1-kj/net/ipv4/ipvs/ip_vs_sync.c 2005-01-18 13:03:21.000000000 -0800 @@ -23,7 +23,7 @@ #include #include #include - +#include #include #include #include /* for ip_mc_join_group */ @@ -647,8 +647,7 @@ static void sync_master_loop(void) if (stop_master_sync) break; - __set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(HZ); + ssleep(1); } /* clean up the sync_buff queue */ @@ -705,8 +704,7 @@ static void sync_backup_loop(void) if (stop_backup_sync) break; - __set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(HZ); + ssleep(1); } /* release the sending multicast socket */ @@ -818,8 +816,7 @@ static int fork_sync_thread(void *startu if ((pid = kernel_thread(sync_thread, startup, 0)) < 0) { IP_VS_ERR("could not create sync_thread due to %d... " "retrying.\n", pid); - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ); + ssleep(1); goto repeat; } @@ -853,8 +850,7 @@ int start_sync_thread(int state, char *m if ((pid = kernel_thread(fork_sync_thread, &startup, 0)) < 0) { IP_VS_ERR("could not create fork_sync_thread due to %d... " "retrying.\n", pid); - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ); + ssleep(1); goto repeat; } From nacc@us.ibm.com Thu Jan 20 16:20:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 16:20:20 -0800 (PST) Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.129]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L0K5sw005167 for ; Thu, 20 Jan 2005 16:20:11 -0800 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e31.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j0L0K0m4503328 for ; Thu, 20 Jan 2005 19:20:00 -0500 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j0L0JxU0442794 for ; Thu, 20 Jan 2005 17:19:59 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j0L0Jwij029990 for ; Thu, 20 Jan 2005 17:19:59 -0700 Received: from joust (joust.beaverton.ibm.com [9.47.17.65]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j0L0Jwug029978; Thu, 20 Jan 2005 17:19:58 -0700 Received: by joust (Postfix, from userid 1000) id 4939E4F97C; Thu, 20 Jan 2005 15:57:49 -0800 (PST) Date: Thu, 20 Jan 2005 15:57:49 -0800 From: Nishanth Aravamudan To: davem@davemloft.net, kuznet@ms2.inr.ac.ru, jmorris@redhat.com, yoshfuji@linux-ipv6.org, kaber@coreworks.de Cc: netdev@oss.sgi.com, kernel-janitors@lists.osdl.org Subject: [PATCH 21/39] net/ipconfig: replace schedule_timeout() with msleep() Message-ID: <20050120235749.GJ2600@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 578 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nacc@us.ibm.com Precedence: bulk X-list: netdev Hi, Please consider applying. Description: Use msleep() instead of schedule_timeout() to guarantee the task delays as expected. Change the units of the two constants to be msecs and secs respectively. Signed-off-by: Nishanth Aravamudan --- 2.6.11-rc1-kj-v/net/ipv4/ipconfig.c 2005-01-15 16:55:44.000000000 -0800 +++ 2.6.11-rc1-kj/net/ipv4/ipconfig.c 2005-01-18 13:01:44.000000000 -0800 @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -84,8 +85,8 @@ #endif /* Define the friendly delay before and after opening net devices */ -#define CONF_PRE_OPEN (HZ/2) /* Before opening: 1/2 second */ -#define CONF_POST_OPEN (1*HZ) /* After opening: 1 second */ +#define CONF_PRE_OPEN 500 /* Before opening: 1/2 second */ +#define CONF_POST_OPEN 1 /* After opening: 1 second */ /* Define the timeout for waiting for a DHCP/BOOTP/RARP reply */ #define CONF_OPEN_RETRIES 2 /* (Re)open devices twice */ @@ -1259,16 +1260,14 @@ static int __init ip_auto_config(void) try_try_again: #endif /* Give hardware a chance to settle */ - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(CONF_PRE_OPEN); + msleep(CONF_PRE_OPEN); /* Setup all network devices */ if (ic_open_devs() < 0) return -1; /* Give drivers a chance to settle */ - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(CONF_POST_OPEN); + ssleep(CONF_POST_OPEN); /* * If the config information is insufficient (e.g., our IP address or From pp@ee.oulu.fi Thu Jan 20 16:32:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 16:32:37 -0800 (PST) Received: from ee.oulu.fi (ee.oulu.fi [130.231.61.23]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L0WUnT006736 for ; Thu, 20 Jan 2005 16:32:31 -0800 Received: from tk28.oulu.fi (tk28 [130.231.48.68]) by ee.oulu.fi (8.13.1/8.13.1) with ESMTP id j0L0WMqA022918; Fri, 21 Jan 2005 02:32:22 +0200 (EET) Received: (from pp@localhost) by tk28.oulu.fi (8.13.1/8.13.1/Submit) id j0L0WMML004521; Fri, 21 Jan 2005 02:32:22 +0200 (EET) Date: Fri, 21 Jan 2005 02:32:22 +0200 From: Pekka Pietikainen To: "David S. Miller" Cc: Andrew Morton , netdev@oss.sgi.com Subject: Re: Fw: b44 ifconfig fails with ENOMEM Message-ID: <20050121003222.GA4290@ee.oulu.fi> References: <20050103191836.57f918e5.akpm@osdl.org> <20050104142026.000be2e8.davem@davemloft.net> <20050107220233.GA9639@ee.oulu.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20050107220233.GA9639@ee.oulu.fi> User-Agent: Mutt/1.4.2i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 580 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pp@ee.oulu.fi Precedence: bulk X-list: netdev On Sat, Jan 08, 2005 at 12:02:33AM +0200, Pekka Pietikainen wrote: > On Tue, Jan 04, 2005 at 02:20:26PM -0800, David S. Miller wrote: > > On Mon, 3 Jan 2005 19:18:36 -0800 > > Andrew Morton wrote: > > > > > b44 requires an order-8 allocation? Good luck... > > > > Yes, it allocates a full TX ring worth of bounce buffers > > to work around a DMA addressing limitation. It should do > > a bunch of smaller consistent allocations instead of one > > huge one, that's for sure. > -ENOHARDWARE (Santa got me an Athlon64 with dual GigE) so someone else will > have to pick up the ball. Shouldn't be too difficult, quickly thinking > something like: Found some testers, even when the allocations are done a page at a time it still won't work, something else is always sucking up GFP_DMA. I don't think there really a way to work around the DMA issue and be useful to the 99% of the userbase that don't need the workaround (only people with a non-standard VM layout actually do). IIRC making the ring smaller makes it crash and burn for whatever reason so that's not a solution either. Awful kludge of the day would be to just fake having a 4GB DMA mask and check every consistent allocation until something over 1GB gets used, then set the mask correctly to 1GB and watch the kernel give you <=16MB mem... or the even more trivial: #ifdef CONFIG_4G4G #define B44_DMA_MASK 0x3fffffff #else #define B44_DMA_MASK 0xffffffff #endif Or fix the generic i386 PCI DMA stuff, but is that worth it for just one driver? From shemminger@osdl.org Thu Jan 20 16:45:34 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 16:45:39 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L0jY9w007409 for ; Thu, 20 Jan 2005 16:45:34 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0L0jPl00358; Thu, 20 Jan 2005 16:45:25 -0800 Date: Thu, 20 Jan 2005 16:45:29 -0800 From: Stephen Hemminger To: "David S. Miller" , "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com Subject: [PATCH] Tcp port selection for IPV6. Message-ID: <20050120164529.6d6a5f0b@dxpl.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 581 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev This patch makes TCP over IPV6 select ports the same way the current TCPv4 code does. It uses a hash function to provide a starting offset and a free running counter to provide seed. This changes the port selection semantics to match TCPv4 as well. If the port is in use but to a different remote address, it will get reused. It looks like the TCPv6 code was not updated when the TCPv4 code changed. Now the code in ipv4/tcp_ipv4.c and ipv6/tcp_ipv6.c are almost identical for tcp_hash_connect. Signed-off-by: Stephen Hemminger diff -Nru a/drivers/char/random.c b/drivers/char/random.c --- a/drivers/char/random.c 2005-01-18 14:06:54 -08:00 +++ b/drivers/char/random.c 2005-01-18 14:06:54 -08:00 @@ -2283,6 +2283,21 @@ return halfMD4Transform(hash, keyptr->secret); } +#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) +u32 secure_tcpv6_port_ephemeral(const __u32 *saddr, const __u32 *daddr, __u16 dport) +{ + struct keydata *keyptr = get_keyptr(); + u32 hash[12]; + + memcpy(hash, saddr, 16); + hash[4] = dport; + memcpy(&hash[5],keyptr->secret,sizeof(__u32) * 7); + + return twothirdsMD4Transform(daddr, hash); +} +EXPORT_SYMBOL(secure_tcpv6_port_ephemeral); +#endif + #ifdef CONFIG_SYN_COOKIES /* * Secure SYN cookie computation. This is the algorithm worked out by diff -Nru a/include/linux/random.h b/include/linux/random.h --- a/include/linux/random.h 2005-01-18 14:06:54 -08:00 +++ b/include/linux/random.h 2005-01-18 14:06:54 -08:00 @@ -53,6 +53,8 @@ extern __u32 secure_ip_id(__u32 daddr); extern u32 secure_tcp_port_ephemeral(__u32 saddr, __u32 daddr, __u16 dport); +extern u32 secure_tcpv6_port_ephemeral(const __u32 *saddr, const __u32 *daddr, + __u16 dport); extern __u32 secure_tcp_sequence_number(__u32 saddr, __u32 daddr, __u16 sport, __u16 dport); extern __u32 secure_tcp_syn_cookie(__u32 saddr, __u32 daddr, diff -Nru a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c --- a/net/ipv4/tcp_ipv4.c 2005-01-18 14:06:54 -08:00 +++ b/net/ipv4/tcp_ipv4.c 2005-01-18 14:06:54 -08:00 @@ -2663,4 +2663,5 @@ EXPORT_SYMBOL(sysctl_local_port_range); EXPORT_SYMBOL(sysctl_max_syn_backlog); EXPORT_SYMBOL(sysctl_tcp_low_latency); +EXPORT_SYMBOL(sysctl_tcp_tw_reuse); diff -Nru a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c --- a/net/ipv6/tcp_ipv6.c 2005-01-18 14:06:54 -08:00 +++ b/net/ipv6/tcp_ipv6.c 2005-01-18 14:06:54 -08:00 @@ -441,21 +441,22 @@ } } -static int tcp_v6_check_established(struct sock *sk) +static int __tcp_v6_check_established(struct sock *sk, __u16 lport, + struct tcp_tw_bucket **twp) { struct inet_sock *inet = inet_sk(sk); struct ipv6_pinfo *np = inet6_sk(sk); struct in6_addr *daddr = &np->rcv_saddr; struct in6_addr *saddr = &np->daddr; int dif = sk->sk_bound_dev_if; - u32 ports = TCP_COMBINED_PORTS(inet->dport, inet->num); + u32 ports = TCP_COMBINED_PORTS(inet->dport, lport); int hash = tcp_v6_hashfn(daddr, inet->num, saddr, inet->dport); struct tcp_ehash_bucket *head = &tcp_ehash[hash]; struct sock *sk2; struct hlist_node *node; struct tcp_tw_bucket *tw; - write_lock_bh(&head->lock); + write_lock(&head->lock); /* Check TIME-WAIT sockets first. */ sk_for_each(sk2, node, &(head + tcp_ehash_size)->chain) { @@ -468,7 +469,10 @@ sk2->sk_bound_dev_if == sk->sk_bound_dev_if) { struct tcp_sock *tp = tcp_sk(sk); - if (tw->tw_ts_recent_stamp) { + if (tw->tw_ts_recent_stamp && + (!twp || (sysctl_tcp_tw_reuse && + xtime.tv_sec - + tw->tw_ts_recent_stamp > 1))) { /* See comment in tcp_ipv4.c */ tp->write_seq = tw->tw_snd_nxt + 65535 + 2; if (!tp->write_seq) @@ -494,40 +498,113 @@ __sk_add_node(sk, &head->chain); sk->sk_hashent = hash; sock_prot_inc_use(sk->sk_prot); - write_unlock_bh(&head->lock); + write_unlock(&head->lock); - if (tw) { + if (twp) { + *twp = tw; + NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED); + } else if (tw) { /* Silly. Should hash-dance instead... */ - local_bh_disable(); tcp_tw_deschedule(tw); NET_INC_STATS_BH(LINUX_MIB_TIMEWAITRECYCLED); - local_bh_enable(); tcp_tw_put(tw); } return 0; not_unique: - write_unlock_bh(&head->lock); + write_unlock(&head->lock); return -EADDRNOTAVAIL; } -static int tcp_v6_hash_connect(struct sock *sk) +static inline u32 tcpv6_port_offset(const struct sock *sk) { - struct tcp_bind_hashbucket *head; - struct tcp_bind_bucket *tb; + const struct inet_sock *inet = inet_sk(sk); + const struct ipv6_pinfo *np = inet6_sk(sk); - /* XXX */ - if (inet_sk(sk)->num == 0) { - int err = tcp_v6_get_port(sk, inet_sk(sk)->num); - if (err) - return err; - inet_sk(sk)->sport = htons(inet_sk(sk)->num); - } + return secure_tcpv6_port_ephemeral(np->rcv_saddr.s6_addr32, + np->daddr.s6_addr32, + inet->dport); +} - head = &tcp_bhash[tcp_bhashfn(inet_sk(sk)->num)]; - tb = tb_head(head); +static int tcp_v6_hash_connect(struct sock *sk) +{ + unsigned short snum = inet_sk(sk)->num; + struct tcp_bind_hashbucket *head; + struct tcp_bind_bucket *tb; + int ret; + + if (!snum) { + int low = sysctl_local_port_range[0]; + int high = sysctl_local_port_range[1]; + int range = high - low; + int i; + int port; + static u32 hint; + u32 offset = hint + tcpv6_port_offset(sk); + struct hlist_node *node; + struct tcp_tw_bucket *tw = NULL; + + local_bh_disable(); + for (i = 1; i <= range; i++) { + port = low + (i + offset) % range; + head = &tcp_bhash[tcp_bhashfn(port)]; + spin_lock(&head->lock); + + /* Does not bother with rcv_saddr checks, + * because the established check is already + * unique enough. + */ + tb_for_each(tb, node, &head->chain) { + if (tb->port == port) { + BUG_TRAP(!hlist_empty(&tb->owners)); + if (tb->fastreuse >= 0) + goto next_port; + if (!__tcp_v6_check_established(sk, + port, + &tw)) + goto ok; + goto next_port; + } + } + + tb = tcp_bucket_create(head, port); + if (!tb) { + spin_unlock(&head->lock); + break; + } + tb->fastreuse = -1; + goto ok; + + next_port: + spin_unlock(&head->lock); + } + local_bh_enable(); + + return -EADDRNOTAVAIL; + +ok: + hint += i; + + /* Head lock still held and bh's disabled */ + tcp_bind_hash(sk, tb, port); + if (sk_unhashed(sk)) { + inet_sk(sk)->sport = htons(port); + __tcp_v6_hash(sk); + } + spin_unlock(&head->lock); + + if (tw) { + tcp_tw_deschedule(tw); + tcp_tw_put(tw); + } + + ret = 0; + goto out; + } + head = &tcp_bhash[tcp_bhashfn(snum)]; + tb = tcp_sk(sk)->bind_hash; spin_lock_bh(&head->lock); if (sk_head(&tb->owners) == sk && !sk->sk_bind_node.next) { @@ -535,8 +612,12 @@ spin_unlock_bh(&head->lock); return 0; } else { - spin_unlock_bh(&head->lock); - return tcp_v6_check_established(sk); + spin_unlock(&head->lock); + /* No definite answer... Walk to established hash table */ + ret = __tcp_v6_check_established(sk, snum, NULL); +out: + local_bh_enable(); + return ret; } } From arnaldo.melo@gmail.com Thu Jan 20 16:53:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 16:54:09 -0800 (PST) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.194]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L0rOEr007972 for ; Thu, 20 Jan 2005 16:53:25 -0800 Received: by wproxy.gmail.com with SMTP id 71so36142wra for ; Thu, 20 Jan 2005 16:53:19 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=XjT0/E5ZE4fscvxIlixoTb5iHNbEPdnfIgPLzhGtPiAKyj9UORu5zxT+oezdpPgePaoG6/mrgmB1lgRGSeczaGwA+Nvco4GqlRAa/xRnsZ2zzkyN0IiaAl0Ygcac8O6nlpptYqLSphcAMHRqutAUrUWhp9ggKGPDO6YzJjLfxZk= Received: by 10.54.32.47 with SMTP id f47mr212959wrf; Thu, 20 Jan 2005 16:53:19 -0800 (PST) Received: by 10.54.10.50 with HTTP; Thu, 20 Jan 2005 16:53:18 -0800 (PST) Message-ID: <39e6f6c705012016537fa48ca4@mail.gmail.com> Date: Thu, 20 Jan 2005 22:53:18 -0200 From: Arnaldo Carvalho de Melo Reply-To: acme@ghostprotocols.net To: Stephen Hemminger Subject: Re: [PATCH] Tcp port selection for IPV6. Cc: "David S. Miller" , "YOSHIFUJI Hideaki / _$B5HF#1QL@" , netdev@oss.sgi.com In-Reply-To: <20050120164529.6d6a5f0b@dxpl.pdx.osdl.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <20050120164529.6d6a5f0b@dxpl.pdx.osdl.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 582 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: arnaldo.melo@gmail.com Precedence: bulk X-list: netdev On Thu, 20 Jan 2005 16:45:29 -0800, Stephen Hemminger wrote: > Now the code in ipv4/tcp_ipv4.c and ipv6/tcp_ipv6.c are > almost identical for tcp_hash_connect. Humm, dccp_hash_connect is almost identical to tcp_hash_connect too... /me adds an entry to his TODO list... :-) - Arnaldo From davem@davemloft.net Thu Jan 20 17:01:27 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 17:01:32 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L11QNY008593 for ; Thu, 20 Jan 2005 17:01:27 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Crn91-0004AC-00; Thu, 20 Jan 2005 16:59:23 -0800 Date: Thu, 20 Jan 2005 16:59:23 -0800 From: "David S. Miller" To: "Michael Chan" Cc: netdev@oss.sgi.com Subject: Re: [PATCH 2.6.10] tg3: add tg3_set_eeprom Message-Id: <20050120165923.39f736f4.davem@davemloft.net> In-Reply-To: References: X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 583 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Thu, 20 Jan 2005 16:00:38 -0800 "Michael Chan" wrote: > Detailed changes: Thanks a lot Michael, patch applied. Another thing that makes patches like this one easier to review is to split them up as much as is reasonable possible. As a specific suggestion, for this patch we might have first done a change which added all of the NVRAM chip IDs and probed for them, the next change might be the change from tw32_f() to tw32() for the chip register accesses, the next change would make use of the NVRAM chip ID type and finally we'd have the change that implemented tg3_set_eeprom(). That's how you likely, at least logically, implemented this patch in a step by step fashion. If you really do split the change up into pieces like that, the individual patches are much easier to verify and review than the whole thing put together and submitted all at once. Thanks again. From davem@davemloft.net Thu Jan 20 17:03:33 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 17:03:40 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L13WBk009018 for ; Thu, 20 Jan 2005 17:03:33 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CrnAn-0004AV-00; Thu, 20 Jan 2005 17:01:13 -0800 Date: Thu, 20 Jan 2005 17:01:13 -0800 From: "David S. Miller" To: Grant Grundler Cc: tommy.christensen@tpack.net, roland@topspin.com, shemminger@osdl.org, hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [PATCH]: was Re: LLTX and netif_stop_queue Message-Id: <20050120170113.36ee8225.davem@davemloft.net> In-Reply-To: <20050120215650.GB14521@esmail.cup.hp.com> References: <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119164640.6c67bdfa.davem@davemloft.net> <52r7kgu5n5.fsf@topspin.com> <20050119230526.393a5184.davem@davemloft.net> <1106229084.5812.40.camel@tsc-6.cph.tpack.net> <20050120133420.317bea31.davem@davemloft.net> <20050120215650.GB14521@esmail.cup.hp.com> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 584 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Thu, 20 Jan 2005 13:56:50 -0800 Grant Grundler wrote: > I saw the next mail suggesting to revert the changes because of more fallout. Yeah, that's what I ended up just pushing to Linus. From peterc@gelato.unsw.edu.au Thu Jan 20 17:52:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 17:52:43 -0800 (PST) Received: from note.orchestra.cse.unsw.EDU.AU (root@note.orchestra.cse.unsw.EDU.AU [129.94.242.24]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L1qaP3010993 for ; Thu, 20 Jan 2005 17:52:37 -0800 Received: From lemon.gelato.unsw.edu.au ([129.94.173.27]) By note With Smtp ; Fri, 21 Jan 2005 12:52:32 +1100 Received: from berry.gelato.unsw.edu.au ([129.94.173.230]:54311) by lemon.gelato.unsw.edu.au with esmtp (Exim 4.34) id 1CrnyR-0002ke-TP; Fri, 21 Jan 2005 12:52:31 +1100 Received: from peterc by berry.gelato.unsw.EDU.AU with local (Exim 3.36 #1 (Debian)) id 1CrnyR-0005Pe-00; Fri, 21 Jan 2005 12:52:31 +1100 From: Peter Chubb To: davem@davemloft.net Date: Fri, 21 Jan 2005 12:52:31 +1100 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16880.24671.640491.852938@berry.gelato.unsw.EDU.AU> CC: netdev@oss.sgi.com, mchan@broadcom.com Subject: Fix fallout from tg3_readphy() value is zero on error X-Mailer: VM 7.17 under 21.4 (patch 15) "Security Through Obscurity" XEmacs Lucid Comments: Hyperbole mail buttons accepted, v04.18. X-Face: GgFg(Z>fx((4\32hvXq<)|jndSniCH~~$D)Ka:P@e@JR1P%Vr}EwUdfwf-4j\rUs#JR{'h# !]])6%Jh~b$VA|ALhnpPiHu[-x~@<"@Iv&|%R)Fq[[,(&Z'O)Q)xCqe1\M[F8#9l8~}#u$S$Rm`S9% \'T@`:&8>Sb*c5d'=eDYI&GF`+t[LfDH="MP5rwOO]w>ALi7'=QJHz&y&C&TE_3j! X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 585 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: peterc@gelato.unsw.edu.au Precedence: bulk X-list: netdev After DaveM's patch to make the `default' value returned by tg3_readphy() to be zero, the attached patch fixes the few cases where a zero changes the previous behaviur, and deletes a couple of initialisation to zero that are no longer necessary. ===== drivers/net/tg3.c 1.228 vs edited ===== --- 1.228/drivers/net/tg3.c 2005-01-20 06:37:04 +00:00 +++ edited/drivers/net/tg3.c 2005-01-21 01:10:21 +00:00 @@ -634,7 +634,8 @@ static int tg3_wait_macro_done(struct tg while (limit--) { u32 tmp32; - tg3_readphy(tp, 0x16, &tmp32); + if (tg3_readphy(tp, 0x16, &tmp32) < 0) + continue; if ((tmp32 & 0x1000) == 0) break; } @@ -1379,7 +1380,8 @@ static int tg3_phy_copper_begin(struct t udelay(10); tg3_readphy(tp, MII_BMSR, &tmp); - tg3_readphy(tp, MII_BMSR, &tmp); + if (tg3_readphy(tp, MII_BMSR, &tmp) < 0) + continue; if (!(tmp & BMSR_LSTATUS)) { udelay(40); break; @@ -1558,7 +1560,6 @@ static int tg3_setup_copper_phy(struct t } } - bmsr = 0; for (i = 0; i < 100; i++) { tg3_readphy(tp, MII_BMSR, &bmsr); tg3_readphy(tp, MII_BMSR, &bmsr); @@ -1582,7 +1583,6 @@ static int tg3_setup_copper_phy(struct t ¤t_speed, ¤t_duplex); - bmcr = 0; for (i = 0; i < 200; i++) { tg3_readphy(tp, MII_BMCR, &bmcr); tg3_readphy(tp, MII_BMCR, &bmcr); From jmorris@redhat.com Thu Jan 20 18:37:18 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 18:37:27 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L2bHEC014468 for ; Thu, 20 Jan 2005 18:37:17 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j0L2awbC007643; Thu, 20 Jan 2005 21:36:58 -0500 Received: from mail.boston.redhat.com (mail.boston.redhat.com [172.16.76.12]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j0L2avO24065; Thu, 20 Jan 2005 21:36:58 -0500 Received: from thoron.boston.redhat.com (thoron.boston.redhat.com [172.16.80.63]) by mail.boston.redhat.com (8.12.8/8.12.8) with ESMTP id j0L2agp6004603; Thu, 20 Jan 2005 21:36:52 -0500 Date: Thu, 20 Jan 2005 21:36:42 -0500 (EST) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: Nishanth Aravamudan cc: davem@davemloft.net, , , , , Subject: Re: [PATCH 21/39] net/ipconfig: replace schedule_timeout() with msleep() In-Reply-To: <20050120235749.GJ2600@us.ibm.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 586 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jmorris@redhat.com Precedence: bulk X-list: netdev On Thu, 20 Jan 2005, Nishanth Aravamudan wrote: > Hi, > > Please consider applying. > > Description: Use msleep() instead of schedule_timeout() to guarantee the task > delays as expected. Change the units of the two constants to be msecs and secs > respectively. Looks fine to me. - James -- James Morris From acme@conectiva.com.br Thu Jan 20 19:15:50 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 19:15:55 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L3FoRH016537 for ; Thu, 20 Jan 2005 19:15:50 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CroXB-0007w3-00; Fri, 21 Jan 2005 00:28:26 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 43A431462D; Fri, 21 Jan 2005 01:15:47 -0200 (BRST) Message-ID: <41F07497.4020109@conectiva.com.br> Date: Fri, 21 Jan 2005 01:18:47 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" Cc: Networking Team Subject: [PATCH 0/12] remove sk_protinfo series X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 587 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Hi David, This series addresses Christoph and Jean concerns about the overhead caused by private slab caches in every family, by making sk_alloc use kmalloc if no slab cache is used, and as a transitional mechanism the zero_it semantic is maintained, that is, if slab is NULL and zero_it is 1, use the generic "slab" (sk_cachep) cache. Now only the ham radio protocols (AX25, NETROM and ROSE) and net/wanrouter uses sk_protinfo to store an private area directly, and bluetooth uses it as a second level for proto info while using a private slab cache for the first level of proto info. This series has atm and pppox in addition to the set of families covered in the first series. Available at: bk://kernel.bkbits.net/acme/connection_sock-2.6 Best Regards, - Arnaldo From acme@conectiva.com.br Thu Jan 20 19:15:56 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 19:16:02 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L3Fuhk016578 for ; Thu, 20 Jan 2005 19:15:56 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CroXI-0007wG-00; Fri, 21 Jan 2005 00:28:33 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 89A211462D; Fri, 21 Jan 2005 01:15:54 -0200 (BRST) Message-ID: <41F0749F.1020004@conectiva.com.br> Date: Fri, 21 Jan 2005 01:18:55 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" Cc: Networking Team Subject: [PATCH 1/12][SOCK] make sk_alloc use kmalloc for non performance critical families X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------020501040803020306020406" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 588 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------020501040803020306020406 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David, Please see the log in the patch. Regards, - Arnaldo --------------020501040803020306020406 Content-Type: text/plain; name="1-sk_alloc.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="1-sk_alloc.patch" =================================================================== ChangeSet@1.1999, 2005-01-20 20:25:41-02:00, acme@toy.ghostprotocols.net [SOCK] make sk_alloc use kmalloc for non performance critical families With this we can have aggregate protocol specific struct proto_sock allocated for non performance critical protocols. We still check for slab == NULL && zero_it == 1 to allocate from the generic "sock" slab cache, but this will be removed when all the network families stop using sk_protinfo, when the generic "sock" slab cache will be removed. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller sock.c | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff -Nru a/net/core/sock.c b/net/core/sock.c --- a/net/core/sock.c 2005-01-21 00:24:03 -02:00 +++ b/net/core/sock.c 2005-01-21 00:24:03 -02:00 @@ -621,9 +621,17 @@ { struct sock *sk = NULL; - if (!slab) + /* + * Transitional, this test will be removed when sk_cachep is killed + */ + if (slab == NULL && zero_it == 1) slab = sk_cachep; - sk = kmem_cache_alloc(slab, priority); + + if (slab != NULL) + sk = kmem_cache_alloc(slab, priority); + else + sk = kmalloc(zero_it, priority); + if (sk) { if (zero_it) { memset(sk, 0, @@ -662,7 +670,10 @@ __FUNCTION__, atomic_read(&sk->sk_omem_alloc)); security_sk_free(sk); - kmem_cache_free(sk->sk_slab, sk); + if (sk->sk_slab != NULL) + kmem_cache_free(sk->sk_slab, sk); + else + kfree(sk); module_put(owner); } --------------020501040803020306020406-- From acme@conectiva.com.br Thu Jan 20 19:16:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 19:16:06 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L3G0Tg016601 for ; Thu, 20 Jan 2005 19:16:01 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CroXN-0007wR-00; Fri, 21 Jan 2005 00:28:37 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 313131462D; Fri, 21 Jan 2005 01:15:59 -0200 (BRST) Message-ID: <41F074A3.7090307@conectiva.com.br> Date: Fri, 21 Jan 2005 01:18:59 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" Cc: Networking Team Subject: [PATCH 2/12][APPLETALK] stop using sk_protinfo X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------080601000101060104000700" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 589 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------080601000101060104000700 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David, Subject says it all. Regards, - Arnaldo --------------080601000101060104000700 Content-Type: text/plain; name="2-appletalk.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="2-appletalk.patch" =================================================================== ChangeSet@1.2000, 2005-01-20 20:32:38-02:00, acme@toy.ghostprotocols.net [APPLETALK] stop using sk_protinfo Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller include/linux/atalk.h | 9 +++++++-- net/appletalk/ddp.c | 11 ++--------- 2 files changed, 9 insertions(+), 11 deletions(-) diff -Nru a/include/linux/atalk.h b/include/linux/atalk.h --- a/include/linux/atalk.h 2005-01-21 00:23:51 -02:00 +++ b/include/linux/atalk.h 2005-01-21 00:23:51 -02:00 @@ -63,6 +63,8 @@ }; struct atalk_sock { + /* struct sock has to be the first member of atalk_sock */ + struct sock sk; unsigned short dest_net; unsigned short src_net; unsigned char dest_node; @@ -71,6 +73,11 @@ unsigned char src_port; }; +static inline struct atalk_sock *at_sk(struct sock *sk) +{ + return (struct atalk_sock *)sk; +} + #ifdef __KERNEL__ #include @@ -196,8 +203,6 @@ struct atalk_addr *sa); extern void aarp_cleanup_module(void); - -#define at_sk(__sk) ((struct atalk_sock *)(__sk)->sk_protinfo) extern struct hlist_head atalk_sockets; extern rwlock_t atalk_sockets_lock; diff -Nru a/net/appletalk/ddp.c b/net/appletalk/ddp.c --- a/net/appletalk/ddp.c 2005-01-21 00:23:51 -02:00 +++ b/net/appletalk/ddp.c 2005-01-21 00:23:51 -02:00 @@ -1022,7 +1022,6 @@ static int atalk_create(struct socket *sock, int protocol) { struct sock *sk; - struct atalk_sock *at; int rc = -ESOCKTNOSUPPORT; /* @@ -1032,13 +1031,10 @@ if (sock->type != SOCK_RAW && sock->type != SOCK_DGRAM) goto out; rc = -ENOMEM; - sk = sk_alloc(PF_APPLETALK, GFP_KERNEL, 1, NULL); + sk = sk_alloc(PF_APPLETALK, GFP_KERNEL, + sizeof(struct atalk_sock), NULL); if (!sk) goto out; - at = sk->sk_protinfo = kmalloc(sizeof(*at), GFP_KERNEL); - if (!at) - goto outsk; - memset(at, 0, sizeof(*at)); rc = 0; sock->ops = &atalk_dgram_ops; sock_init_data(sock, sk); @@ -1048,9 +1044,6 @@ sk->sk_zapped = 1; out: return rc; -outsk: - sk_free(sk); - goto out; } /* Free a socket. No work needed */ --------------080601000101060104000700-- From acme@conectiva.com.br Thu Jan 20 19:16:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 19:16:15 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L3G8G0016644 for ; Thu, 20 Jan 2005 19:16:08 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CroXV-0007wl-00; Fri, 21 Jan 2005 00:28:45 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id B34E51462D; Fri, 21 Jan 2005 01:16:06 -0200 (BRST) Message-ID: <41F074AB.2080103@conectiva.com.br> Date: Fri, 21 Jan 2005 01:19:07 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" Cc: Networking Team Subject: [PATCH 4/12][AF_PACKET] stop using sk_protinfo X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------040005070908010906030206" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 590 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------040005070908010906030206 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit David, Subject says it all. Regards, - Arnaldo --------------040005070908010906030206 Content-Type: text/plain; name="4-af_packet.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="4-af_packet.patch" =================================================================== ChangeSet@1.2002, 2005-01-20 20:41:35-02:00, acme@toy.ghostprotocols.net [AF_PACKET] stop using sk_protinfo Required to introduce struct connection_sock. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller af_packet.c | 55 ++++++++++++++++++++++++++----------------------------- 1 files changed, 26 insertions(+), 29 deletions(-) diff -Nru a/net/packet/af_packet.c b/net/packet/af_packet.c --- a/net/packet/af_packet.c 2005-01-21 00:23:28 -02:00 +++ b/net/packet/af_packet.c 2005-01-21 00:23:28 -02:00 @@ -170,8 +170,9 @@ static void packet_flush_mclist(struct sock *sk); -struct packet_opt -{ +struct packet_sock { + /* struct sock has to be the first member of packet_sock */ + struct sock sk; struct tpacket_stats stats; #ifdef CONFIG_PACKET_MMAP char * *pg_vec; @@ -199,7 +200,7 @@ #ifdef CONFIG_PACKET_MMAP -static inline char *packet_lookup_frame(struct packet_opt *po, unsigned int position) +static inline char *packet_lookup_frame(struct packet_sock *po, unsigned int position) { unsigned int pg_vec_pos, frame_offset; char *frame; @@ -213,7 +214,10 @@ } #endif -#define pkt_sk(__sk) ((struct packet_opt *)(__sk)->sk_protinfo) +static inline struct packet_sock *pkt_sk(struct sock *sk) +{ + return (struct packet_sock *)sk; +} static void packet_sock_destruct(struct sock *sk) { @@ -225,8 +229,6 @@ return; } - if (pkt_sk(sk)) - kfree(pkt_sk(sk)); atomic_dec(&packet_socks_nr); #ifdef PACKET_REFCNT_DEBUG printk(KERN_DEBUG "PACKET socket %p is free, %d are alive\n", sk, atomic_read(&packet_socks_nr)); @@ -440,7 +442,7 @@ { struct sock *sk; struct sockaddr_ll *sll; - struct packet_opt *po; + struct packet_sock *po; u8 * skb_head = skb->data; int skb_len = skb->len; unsigned snaplen; @@ -541,7 +543,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt) { struct sock *sk; - struct packet_opt *po; + struct packet_sock *po; struct sockaddr_ll *sll; struct tpacket_hdr *h; u8 * skb_head = skb->data; @@ -699,7 +701,7 @@ */ if (saddr == NULL) { - struct packet_opt *po = pkt_sk(sk); + struct packet_sock *po = pkt_sk(sk); ifindex = po->ifindex; proto = po->num; @@ -786,7 +788,7 @@ static int packet_release(struct socket *sock) { struct sock *sk = sock->sk; - struct packet_opt *po; + struct packet_sock *po; if (!sk) return 0; @@ -844,7 +846,7 @@ static int packet_do_bind(struct sock *sk, struct net_device *dev, int protocol) { - struct packet_opt *po = pkt_sk(sk); + struct packet_sock *po = pkt_sk(sk); /* * Detach an existing hook if present. */ @@ -961,7 +963,7 @@ static int packet_create(struct socket *sock, int protocol) { struct sock *sk; - struct packet_opt *po; + struct packet_sock *po; int err; if (!capable(CAP_NET_RAW)) @@ -976,7 +978,8 @@ sock->state = SS_UNCONNECTED; err = -ENOBUFS; - sk = sk_alloc(PF_PACKET, GFP_KERNEL, 1, NULL); + sk = sk_alloc(PF_PACKET, GFP_KERNEL, + sizeof(struct packet_sock), NULL); if (sk == NULL) goto out; @@ -988,10 +991,7 @@ sock_init_data(sock,sk); sk_set_owner(sk, THIS_MODULE); - po = sk->sk_protinfo = kmalloc(sizeof(*po), GFP_KERNEL); - if (!po) - goto out_free; - memset(po, 0, sizeof(*po)); + po = pkt_sk(sk); sk->sk_family = PF_PACKET; po->num = protocol; @@ -1021,9 +1021,6 @@ sk_add_node(sk, &packet_sklist); write_unlock_bh(&packet_sklist_lock); return(0); - -out_free: - sk_free(sk); out: return err; } @@ -1141,7 +1138,7 @@ { struct net_device *dev; struct sock *sk = sock->sk; - struct packet_opt *po = pkt_sk(sk); + struct packet_sock *po = pkt_sk(sk); struct sockaddr_ll *sll = (struct sockaddr_ll*)uaddr; if (peer) @@ -1195,7 +1192,7 @@ static int packet_mc_add(struct sock *sk, struct packet_mreq *mreq) { - struct packet_opt *po = pkt_sk(sk); + struct packet_sock *po = pkt_sk(sk); struct packet_mclist *ml, *i; struct net_device *dev; int err; @@ -1274,7 +1271,7 @@ static void packet_flush_mclist(struct sock *sk) { - struct packet_opt *po = pkt_sk(sk); + struct packet_sock *po = pkt_sk(sk); struct packet_mclist *ml; if (!po->mclist) @@ -1355,7 +1352,7 @@ { int len; struct sock *sk = sock->sk; - struct packet_opt *po = pkt_sk(sk); + struct packet_sock *po = pkt_sk(sk); if (level != SOL_PACKET) return -ENOPROTOOPT; @@ -1401,7 +1398,7 @@ read_lock(&packet_sklist_lock); sk_for_each(sk, node, &packet_sklist) { - struct packet_opt *po = pkt_sk(sk); + struct packet_sock *po = pkt_sk(sk); switch (msg) { case NETDEV_UNREGISTER: @@ -1504,7 +1501,7 @@ poll_table *wait) { struct sock *sk = sock->sk; - struct packet_opt *po = pkt_sk(sk); + struct packet_sock *po = pkt_sk(sk); unsigned int mask = datagram_poll(file, sock, wait); spin_lock_bh(&sk->sk_receive_queue.lock); @@ -1579,7 +1576,7 @@ static int packet_set_ring(struct sock *sk, struct tpacket_req *req, int closing) { char **pg_vec = NULL; - struct packet_opt *po = pkt_sk(sk); + struct packet_sock *po = pkt_sk(sk); int was_running, num, order = 0; int err = 0; @@ -1709,7 +1706,7 @@ static int packet_mmap(struct file *file, struct socket *sock, struct vm_area_struct *vma) { struct sock *sk = sock->sk; - struct packet_opt *po = pkt_sk(sk); + struct packet_sock *po = pkt_sk(sk); unsigned long size; unsigned long start; int err = -EINVAL; @@ -1839,7 +1836,7 @@ seq_puts(seq, "sk RefCnt Type Proto Iface R Rmem User Inode\n"); else { struct sock *s = v; - const struct packet_opt *po = pkt_sk(s); + const struct packet_sock *po = pkt_sk(s); seq_printf(seq, "%p %-6d %-4d %04x %-5d %1d %-6u %-6u %-6lu\n", --------------040005070908010906030206-- From acme@conectiva.com.br Thu Jan 20 19:16:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 19:16:26 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L3GJgk016895 for ; Thu, 20 Jan 2005 19:16:20 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CroXg-0007x6-00; Fri, 21 Jan 2005 00:28:56 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 0F0141462D; Fri, 21 Jan 2005 01:16:18 -0200 (BRST) Message-ID: <41F074B6.7060203@conectiva.com.br> Date: Fri, 21 Jan 2005 01:19:18 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" Cc: Networking Team Subject: [PATCH 6/12][NETLINK] stop using sk_protinfo X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------020104010007030603050402" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 593 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------020104010007030603050402 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit David, Subject says it all. Regards, - Arnaldo --------------020104010007030603050402 Content-Type: text/plain; name="6-netlink.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="6-netlink.patch" =================================================================== ChangeSet@1.2004, 2005-01-20 20:54:11-02:00, acme@toy.ghostprotocols.net [NETLINK] stop using sk_protinfo Required to introduce struct connection_sock. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller af_netlink.c | 58 ++++++++++++++++++++++++++++------------------------------ 1 files changed, 28 insertions(+), 30 deletions(-) diff -Nru a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c --- a/net/netlink/af_netlink.c 2005-01-21 00:23:05 -02:00 +++ b/net/netlink/af_netlink.c 2005-01-21 00:23:05 -02:00 @@ -59,8 +59,9 @@ #define NL_EMULATE_DEV #endif -struct netlink_opt -{ +struct netlink_sock { + /* struct sock has to be the first member of netlink_sock */ + struct sock sk; u32 pid; unsigned int groups; u32 dst_pid; @@ -73,7 +74,10 @@ void (*data_ready)(struct sock *sk, int bytes); }; -#define nlk_sk(__sk) ((struct netlink_opt *)(__sk)->sk_protinfo) +static inline struct netlink_sock *nlk_sk(struct sock *sk) +{ + return (struct netlink_sock *)sk; +} struct nl_pid_hash { struct hlist_head *table; @@ -122,8 +126,6 @@ BUG_TRAP(!atomic_read(&sk->sk_rmem_alloc)); BUG_TRAP(!atomic_read(&sk->sk_wmem_alloc)); BUG_TRAP(!nlk_sk(sk)->cb); - - kfree(nlk_sk(sk)); } /* This lock without WQ_FLAG_EXCLUSIVE is good on UP and it is _very_ bad on SMP. @@ -327,7 +329,7 @@ static int netlink_create(struct socket *sock, int protocol) { struct sock *sk; - struct netlink_opt *nlk; + struct netlink_sock *nlk; sock->state = SS_UNCONNECTED; @@ -339,19 +341,15 @@ sock->ops = &netlink_ops; - sk = sk_alloc(PF_NETLINK, GFP_KERNEL, 1, NULL); + sk = sk_alloc(PF_NETLINK, GFP_KERNEL, + sizeof(struct netlink_sock), NULL); if (!sk) return -ENOMEM; sock_init_data(sock,sk); sk_set_owner(sk, THIS_MODULE); - nlk = sk->sk_protinfo = kmalloc(sizeof(*nlk), GFP_KERNEL); - if (!nlk) { - sk_free(sk); - return -ENOMEM; - } - memset(nlk, 0, sizeof(*nlk)); + nlk = nlk_sk(sk); spin_lock_init(&nlk->cb_lock); init_waitqueue_head(&nlk->wait); @@ -364,7 +362,7 @@ static int netlink_release(struct socket *sock) { struct sock *sk = sock->sk; - struct netlink_opt *nlk; + struct netlink_sock *nlk; if (!sk) return 0; @@ -445,7 +443,7 @@ static int netlink_bind(struct socket *sock, struct sockaddr *addr, int addr_len) { struct sock *sk = sock->sk; - struct netlink_opt *nlk = nlk_sk(sk); + struct netlink_sock *nlk = nlk_sk(sk); struct sockaddr_nl *nladdr = (struct sockaddr_nl *)addr; int err; @@ -486,7 +484,7 @@ { int err = 0; struct sock *sk = sock->sk; - struct netlink_opt *nlk = nlk_sk(sk); + struct netlink_sock *nlk = nlk_sk(sk); struct sockaddr_nl *nladdr=(struct sockaddr_nl*)addr; if (addr->sa_family == AF_UNSPEC) { @@ -517,7 +515,7 @@ static int netlink_getname(struct socket *sock, struct sockaddr *addr, int *addr_len, int peer) { struct sock *sk = sock->sk; - struct netlink_opt *nlk = nlk_sk(sk); + struct netlink_sock *nlk = nlk_sk(sk); struct sockaddr_nl *nladdr=(struct sockaddr_nl *)addr; nladdr->nl_family = AF_NETLINK; @@ -546,7 +544,7 @@ { int protocol = ssk->sk_protocol; struct sock *sock; - struct netlink_opt *nlk; + struct netlink_sock *nlk; sock = netlink_lookup(protocol, pid); if (!sock) @@ -592,7 +590,7 @@ */ int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, long timeo) { - struct netlink_opt *nlk; + struct netlink_sock *nlk; nlk = nlk_sk(sk); @@ -635,7 +633,7 @@ int netlink_sendskb(struct sock *sk, struct sk_buff *skb, int protocol) { - struct netlink_opt *nlk; + struct netlink_sock *nlk; int len = skb->len; nlk = nlk_sk(sk); @@ -710,7 +708,7 @@ static __inline__ int netlink_broadcast_deliver(struct sock *sk, struct sk_buff *skb) { - struct netlink_opt *nlk = nlk_sk(sk); + struct netlink_sock *nlk = nlk_sk(sk); #ifdef NL_EMULATE_DEV if (nlk->handler) { nlk->handler(sk->sk_protocol, skb); @@ -741,7 +739,7 @@ static inline int do_one_broadcast(struct sock *sk, struct netlink_broadcast_data *p) { - struct netlink_opt *nlk = nlk_sk(sk); + struct netlink_sock *nlk = nlk_sk(sk); int val; if (p->exclude_sk == sk) @@ -833,7 +831,7 @@ static inline int do_one_set_err(struct sock *sk, struct netlink_set_err_data *p) { - struct netlink_opt *nlk = nlk_sk(sk); + struct netlink_sock *nlk = nlk_sk(sk); if (sk == p->exclude_sk) goto out; @@ -868,7 +866,7 @@ static inline void netlink_rcv_wake(struct sock *sk) { - struct netlink_opt *nlk = nlk_sk(sk); + struct netlink_sock *nlk = nlk_sk(sk); if (!skb_queue_len(&sk->sk_receive_queue)) clear_bit(0, &nlk->state); @@ -881,7 +879,7 @@ { struct sock_iocb *siocb = kiocb_to_siocb(kiocb); struct sock *sk = sock->sk; - struct netlink_opt *nlk = nlk_sk(sk); + struct netlink_sock *nlk = nlk_sk(sk); struct sockaddr_nl *addr=msg->msg_name; u32 dst_pid; u32 dst_groups; @@ -965,7 +963,7 @@ struct sock_iocb *siocb = kiocb_to_siocb(kiocb); struct scm_cookie scm; struct sock *sk = sock->sk; - struct netlink_opt *nlk = nlk_sk(sk); + struct netlink_sock *nlk = nlk_sk(sk); int noblock = flags&MSG_DONTWAIT; size_t copied; struct sk_buff *skb; @@ -1019,7 +1017,7 @@ static void netlink_data_ready(struct sock *sk, int len) { - struct netlink_opt *nlk = nlk_sk(sk); + struct netlink_sock *nlk = nlk_sk(sk); if (nlk->data_ready) nlk->data_ready(sk, len); @@ -1083,7 +1081,7 @@ static int netlink_dump(struct sock *sk) { - struct netlink_opt *nlk = nlk_sk(sk); + struct netlink_sock *nlk = nlk_sk(sk); struct netlink_callback *cb; struct sk_buff *skb; struct nlmsghdr *nlh; @@ -1133,7 +1131,7 @@ { struct netlink_callback *cb; struct sock *sk; - struct netlink_opt *nlk; + struct netlink_sock *nlk; cb = kmalloc(sizeof(*cb), GFP_KERNEL); if (cb == NULL) @@ -1290,7 +1288,7 @@ "Rmem Wmem Dump Locks\n"); else { struct sock *s = v; - struct netlink_opt *nlk = nlk_sk(s); + struct netlink_sock *nlk = nlk_sk(s); seq_printf(seq, "%p %-3d %-6d %08x %-8d %-8d %p %d\n", s, --------------020104010007030603050402-- From acme@conectiva.com.br Thu Jan 20 19:16:06 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 19:16:19 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L3G5bp016623 for ; Thu, 20 Jan 2005 19:16:05 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CroXR-0007wc-00; Fri, 21 Jan 2005 00:28:41 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 208AE1462D; Fri, 21 Jan 2005 01:16:03 -0200 (BRST) Message-ID: <41F074A7.4040000@conectiva.com.br> Date: Fri, 21 Jan 2005 01:19:03 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" , Patrick Caulfield Cc: Networking Team Subject: [PATCH 3/12][DECNET] Don't use sk_protinfo + private sock slab cache X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------050508050002080607040404" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 591 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------050508050002080607040404 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David/Patrick, Please see the log in the patch. Best Regards, - Arnaldo --------------050508050002080607040404 Content-Type: text/plain; name="3-decnet.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="3-decnet.patch" =================================================================== ChangeSet@1.2001, 2005-01-20 20:36:07-02:00, acme@toy.ghostprotocols.net [DECNET] Don't use sk_protinfo + private sock slab cache DecNET already uses a private sock slab cache, but initializes sk->sk_protinfo, pointing to (sk + 1), this is wrong because at sk_free time we call sk->sk_destruct, that by default points to sock_def_destruct, that does a kfree on sk->sk_protinfo, since it was initialized at net_proto_family->create() time (dn_create), but in decnet sk_protinfo was not kmalloced, it was allocated piggybacked to struct sock. This doesn't causes problems because decnet sets sk->sk_destruct to a custom function that doesn't calls kfree(sk->sk_protinfo), but to reach a long time goal of killing sk_protinfo lets just make DN_SK return sk + 1. I left merging dn_scp with dn_sock for later, as the current state suits my needs to introduce connection_sock. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller include/net/dn.h | 6 +++++- net/decnet/af_decnet.c | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff -Nru a/include/net/dn.h b/include/net/dn.h --- a/include/net/dn.h 2005-01-21 00:23:40 -02:00 +++ b/include/net/dn.h 2005-01-21 00:23:40 -02:00 @@ -2,6 +2,7 @@ #define _NET_DN_H #include +#include #include typedef unsigned short dn_address; @@ -133,7 +134,10 @@ }; -#define DN_SK(__sk) ((struct dn_scp *)(__sk)->sk_protinfo) +static inline struct dn_scp *DN_SK(struct sock *sk) +{ + return (struct dn_scp *)(sk + 1); +} /* * src,dst : Source and Destination DECnet addresses diff -Nru a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c --- a/net/decnet/af_decnet.c 2005-01-21 00:23:40 -02:00 +++ b/net/decnet/af_decnet.c 2005-01-21 00:23:40 -02:00 @@ -456,8 +456,6 @@ if (!sk) goto out; - sk->sk_protinfo = scp = (struct dn_scp *)(sk + 1); - if (sock) sock->ops = &dn_proto_ops; sock_init_data(sock, sk); @@ -471,6 +469,7 @@ sk->sk_allocation = gfp; /* Initialization of DECnet Session Control Port */ + scp = DN_SK(sk); scp->state = DN_O; /* Open */ scp->numdat = 1; /* Next data seg to tx */ scp->numoth = 1; /* Next oth data to tx */ --------------050508050002080607040404-- From acme@conectiva.com.br Thu Jan 20 19:16:16 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 19:16:22 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L3GFdJ016759 for ; Thu, 20 Jan 2005 19:16:16 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CroXc-0007ww-00; Fri, 21 Jan 2005 00:28:52 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id E43421462D; Fri, 21 Jan 2005 01:16:13 -0200 (BRST) Message-ID: <41F074B2.6010609@conectiva.com.br> Date: Fri, 21 Jan 2005 01:19:14 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" Cc: Networking Team Subject: [PATCH 5/12][ECONET] stop using sk_protinfo X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------070606090704060308020104" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 592 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------070606090704060308020104 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit David, Subject says it all. Regards, - Arnaldo --------------070606090704060308020104 Content-Type: text/plain; name="5-econet.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="5-econet.patch" =================================================================== ChangeSet@1.2003, 2005-01-20 20:44:56-02:00, acme@toy.ghostprotocols.net [ECONET] stop using sk_protinfo Required to introduce struct connection_sock. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller include/linux/if_ec.h | 10 +++++++--- net/econet/af_econet.c | 21 ++++++++------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff -Nru a/include/linux/if_ec.h b/include/linux/if_ec.h --- a/include/linux/if_ec.h 2005-01-21 00:23:17 -02:00 +++ b/include/linux/if_ec.h 2005-01-21 00:23:17 -02:00 @@ -47,8 +47,9 @@ unsigned char port; }; -struct econet_opt -{ +struct econet_sock { + /* struct sock has to be the first member of econet_sock */ + struct sock sk; unsigned char cb; unsigned char port; unsigned char station; @@ -56,7 +57,10 @@ unsigned short num; }; -#define ec_sk(__sk) ((struct econet_opt *)(__sk)->sk_protinfo) +static inline struct econet_sock *ec_sk(const struct sock *sk) +{ + return (struct econet_sock *)sk; +} struct ec_device { diff -Nru a/net/econet/af_econet.c b/net/econet/af_econet.c --- a/net/econet/af_econet.c 2005-01-21 00:23:17 -02:00 +++ b/net/econet/af_econet.c 2005-01-21 00:23:17 -02:00 @@ -184,7 +184,7 @@ { struct sockaddr_ec *sec = (struct sockaddr_ec *)uaddr; struct sock *sk=sock->sk; - struct econet_opt *eo = ec_sk(sk); + struct econet_sock *eo = ec_sk(sk); /* * Check legality @@ -284,7 +284,7 @@ */ if (saddr == NULL) { - struct econet_opt *eo = ec_sk(sk); + struct econet_sock *eo = ec_sk(sk); addr.station = eo->station; addr.net = eo->net; @@ -485,7 +485,7 @@ int *uaddr_len, int peer) { struct sock *sk = sock->sk; - struct econet_opt *eo = ec_sk(sk); + struct econet_sock *eo = ec_sk(sk); struct sockaddr_ec *sec = (struct sockaddr_ec *)uaddr; if (peer) @@ -562,7 +562,7 @@ static int econet_create(struct socket *sock, int protocol) { struct sock *sk; - struct econet_opt *eo; + struct econet_sock *eo; int err; /* Econet only provides datagram services. */ @@ -572,7 +572,8 @@ sock->state = SS_UNCONNECTED; err = -ENOBUFS; - sk = sk_alloc(PF_ECONET, GFP_KERNEL, 1, NULL); + sk = sk_alloc(PF_ECONET, GFP_KERNEL, + sizeof(struct econet_sock), NULL); if (sk == NULL) goto out; @@ -581,19 +582,13 @@ sock_init_data(sock,sk); sk_set_owner(sk, THIS_MODULE); - eo = sk->sk_protinfo = kmalloc(sizeof(*eo), GFP_KERNEL); - if (!eo) - goto out_free; - memset(eo, 0, sizeof(*eo)); + eo = ec_sk(sk); sk->sk_zapped = 0; sk->sk_family = PF_ECONET; eo->num = protocol; econet_insert_socket(&econet_sklist, sk); return(0); - -out_free: - sk_free(sk); out: return err; } @@ -735,7 +730,7 @@ struct hlist_node *node; sk_for_each(sk, node, &econet_sklist) { - struct econet_opt *opt = ec_sk(sk); + struct econet_sock *opt = ec_sk(sk); if ((opt->port == port || opt->port == 0) && (opt->station == station || opt->station == 0) && (opt->net == net || opt->net == 0)) --------------070606090704060308020104-- From acme@conectiva.com.br Thu Jan 20 19:16:32 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 19:16:37 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L3GTgK017092 for ; Thu, 20 Jan 2005 19:16:30 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CroXq-0007xO-00; Fri, 21 Jan 2005 00:29:06 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 1B1B21462D; Fri, 21 Jan 2005 01:16:28 -0200 (BRST) Message-ID: <41F074C0.4040201@conectiva.com.br> Date: Fri, 21 Jan 2005 01:19:28 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" Cc: Networking Team Subject: [PATCH 8/12][PF_KEY] stop using sk_protinfo X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------060007080002060507000701" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 595 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------060007080002060507000701 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David, Subject says it all. Regards, - Arnaldo --------------060007080002060507000701 Content-Type: text/plain; name="8-pf_key.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="8-pf_key.patch" =================================================================== ChangeSet@1.2006, 2005-01-20 21:09:34-02:00, acme@toy.ghostprotocols.net [PF_KEY] stop using sk_protinfo Required to introduce struct connection_sock. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller af_key.c | 33 ++++++++++++++------------------- 1 files changed, 14 insertions(+), 19 deletions(-) diff -Nru a/net/key/af_key.c b/net/key/af_key.c --- a/net/key/af_key.c 2005-01-21 00:22:42 -02:00 +++ b/net/key/af_key.c 2005-01-21 00:22:42 -02:00 @@ -42,11 +42,17 @@ static atomic_t pfkey_socks_nr = ATOMIC_INIT(0); -struct pfkey_opt { - int registered; - int promisc; +struct pfkey_sock { + /* struct sock must be the first member of struct pfkey_sock */ + struct sock sk; + int registered; + int promisc; }; -#define pfkey_sk(__sk) ((struct pfkey_opt *)(__sk)->sk_protinfo) + +static inline struct pfkey_sock *pfkey_sk(struct sock *sk) +{ + return (struct pfkey_sock *)sk; +} static void pfkey_sock_destruct(struct sock *sk) { @@ -60,8 +66,6 @@ BUG_TRAP(!atomic_read(&sk->sk_rmem_alloc)); BUG_TRAP(!atomic_read(&sk->sk_wmem_alloc)); - kfree(pfkey_sk(sk)); - atomic_dec(&pfkey_socks_nr); } @@ -128,7 +132,6 @@ static int pfkey_create(struct socket *sock, int protocol) { struct sock *sk; - struct pfkey_opt *pfk; int err; if (!capable(CAP_NET_ADMIN)) @@ -139,7 +142,7 @@ return -EPROTONOSUPPORT; err = -ENOMEM; - sk = sk_alloc(PF_KEY, GFP_KERNEL, 1, NULL); + sk = sk_alloc(PF_KEY, GFP_KERNEL, sizeof(struct pfkey_sock), NULL); if (sk == NULL) goto out; @@ -147,14 +150,6 @@ sock_init_data(sock, sk); sk_set_owner(sk, THIS_MODULE); - err = -ENOMEM; - pfk = sk->sk_protinfo = kmalloc(sizeof(*pfk), GFP_KERNEL); - if (!pfk) { - sk_free(sk); - goto out; - } - memset(pfk, 0, sizeof(*pfk)); - sk->sk_family = PF_KEY; sk->sk_destruct = pfkey_sock_destruct; @@ -233,7 +228,7 @@ pfkey_lock_table(); sk_for_each(sk, node, &pfkey_table) { - struct pfkey_opt *pfk = pfkey_sk(sk); + struct pfkey_sock *pfk = pfkey_sk(sk); int err2; /* Yes, it means that if you are meant to receive this @@ -1418,7 +1413,7 @@ static int pfkey_register(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hdr, void **ext_hdrs) { - struct pfkey_opt *pfk = pfkey_sk(sk); + struct pfkey_sock *pfk = pfkey_sk(sk); struct sk_buff *supp_skb; if (hdr->sadb_msg_satype > SADB_SATYPE_MAX) @@ -1514,7 +1509,7 @@ static int pfkey_promisc(struct sock *sk, struct sk_buff *skb, struct sadb_msg *hdr, void **ext_hdrs) { - struct pfkey_opt *pfk = pfkey_sk(sk); + struct pfkey_sock *pfk = pfkey_sk(sk); int satype = hdr->sadb_msg_satype; if (hdr->sadb_msg_len == (sizeof(*hdr) / sizeof(uint64_t))) { --------------060007080002060507000701-- From acme@conectiva.com.br Thu Jan 20 19:16:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 19:16:35 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L3GQF8017023 for ; Thu, 20 Jan 2005 19:16:27 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CroXl-0007xF-00; Fri, 21 Jan 2005 00:29:02 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 728B81462D; Fri, 21 Jan 2005 01:16:23 -0200 (BRST) Message-ID: <41F074BB.8090501@conectiva.com.br> Date: Fri, 21 Jan 2005 01:19:23 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" , Aristeu Rozanski Cc: Networking Team Subject: [PATCH 7/12] [X25] stop using sk_protinfo X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------030700020208060201070604" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 594 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------030700020208060201070604 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit David/Aristeu, Subject says it all. Regards, - Arnaldo --------------030700020208060201070604 Content-Type: text/plain; name="7-x25.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="7-x25.patch" =================================================================== ChangeSet@1.2005, 2005-01-20 20:59:08-02:00, acme@toy.ghostprotocols.net [X25] stop using sk_protinfo Required to introduce struct connection_sock. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller include/net/x25.h | 10 +++++++--- net/x25/af_x25.c | 36 +++++++++++++----------------------- net/x25/x25_facilities.c | 2 +- net/x25/x25_in.c | 10 +++++----- net/x25/x25_out.c | 8 ++++---- net/x25/x25_proc.c | 2 +- net/x25/x25_subr.c | 14 +++++++------- net/x25/x25_timer.c | 14 +++++++------- 8 files changed, 45 insertions(+), 51 deletions(-) diff -Nru a/include/net/x25.h b/include/net/x25.h --- a/include/net/x25.h 2005-01-21 00:22:53 -02:00 +++ b/include/net/x25.h 2005-01-21 00:22:53 -02:00 @@ -10,6 +10,7 @@ #ifndef _X25_H #define _X25_H #include +#include #define X25_ADDR_LEN 16 @@ -129,7 +130,8 @@ atomic_t refcnt; }; -struct x25_opt { +struct x25_sock { + struct sock sk; struct x25_address source_addr, dest_addr; struct x25_neigh *neighbour; unsigned int lci; @@ -141,7 +143,6 @@ struct sk_buff_head fragment_queue; struct sk_buff_head interrupt_in_queue; struct sk_buff_head interrupt_out_queue; - struct sock *sk; /* Backlink to socket */ struct timer_list timer; struct x25_causediag causediag; struct x25_facilities facilities; @@ -149,7 +150,10 @@ unsigned long vc_facil_mask; /* inc_call facilities mask */ }; -#define x25_sk(__sk) ((struct x25_opt *)(__sk)->sk_protinfo) +static inline struct x25_sock *x25_sk(const struct sock *sk) +{ + return (struct x25_sock *)sk; +} /* af_x25.c */ extern int sysctl_x25_restart_request_timeout; diff -Nru a/net/x25/af_x25.c b/net/x25/af_x25.c --- a/net/x25/af_x25.c 2005-01-21 00:22:53 -02:00 +++ b/net/x25/af_x25.c 2005-01-21 00:22:53 -02:00 @@ -444,33 +444,23 @@ static struct sock *x25_alloc_socket(void) { - struct x25_opt *x25; - struct sock *sk = sk_alloc(AF_X25, GFP_ATOMIC, 1, NULL); + struct x25_sock *x25; + struct sock *sk = sk_alloc(AF_X25, GFP_ATOMIC, + sizeof(struct x25_sock), NULL); if (!sk) goto out; - x25 = sk->sk_protinfo = kmalloc(sizeof(*x25), GFP_ATOMIC); - if (!x25) - goto frees; - - memset(x25, 0, sizeof(*x25)); - - x25->sk = sk; - sock_init_data(NULL, sk); sk_set_owner(sk, THIS_MODULE); + x25 = x25_sk(sk); skb_queue_head_init(&x25->ack_queue); skb_queue_head_init(&x25->fragment_queue); skb_queue_head_init(&x25->interrupt_in_queue); skb_queue_head_init(&x25->interrupt_out_queue); out: return sk; -frees: - sk_free(sk); - sk = NULL; - goto out; } void x25_init_timers(struct sock *sk); @@ -478,7 +468,7 @@ static int x25_create(struct socket *sock, int protocol) { struct sock *sk; - struct x25_opt *x25; + struct x25_sock *x25; int rc = -ESOCKTNOSUPPORT; if (sock->type != SOCK_SEQPACKET || protocol) @@ -519,7 +509,7 @@ static struct sock *x25_make_new(struct sock *osk) { struct sock *sk = NULL; - struct x25_opt *x25, *ox25; + struct x25_sock *x25, *ox25; if (osk->sk_type != SOCK_SEQPACKET) goto out; @@ -557,7 +547,7 @@ static int x25_release(struct socket *sock) { struct sock *sk = sock->sk; - struct x25_opt *x25; + struct x25_sock *x25; if (!sk) goto out; @@ -644,7 +634,7 @@ int addr_len, int flags) { struct sock *sk = sock->sk; - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); struct sockaddr_x25 *addr = (struct sockaddr_x25 *)uaddr; struct x25_route *rt; int rc = 0; @@ -802,7 +792,7 @@ { struct sockaddr_x25 *sx25 = (struct sockaddr_x25 *)uaddr; struct sock *sk = sock->sk; - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); if (peer) { if (sk->sk_state != TCP_ESTABLISHED) @@ -822,7 +812,7 @@ { struct sock *sk; struct sock *make; - struct x25_opt *makex25; + struct x25_sock *makex25; struct x25_address source_addr, dest_addr; struct x25_facilities facilities; struct x25_calluserdata calluserdata; @@ -935,7 +925,7 @@ struct msghdr *msg, size_t len) { struct sock *sk = sock->sk; - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); struct sockaddr_x25 *usx25 = (struct sockaddr_x25 *)msg->msg_name; struct sockaddr_x25 sx25; struct sk_buff *skb; @@ -1112,7 +1102,7 @@ int flags) { struct sock *sk = sock->sk; - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); struct sockaddr_x25 *sx25 = (struct sockaddr_x25 *)msg->msg_name; size_t copied; int qbit; @@ -1201,7 +1191,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) { struct sock *sk = sock->sk; - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); void __user *argp = (void __user *)arg; int rc; diff -Nru a/net/x25/x25_facilities.c b/net/x25/x25_facilities.c --- a/net/x25/x25_facilities.c 2005-01-21 00:22:53 -02:00 +++ b/net/x25/x25_facilities.c 2005-01-21 00:22:53 -02:00 @@ -158,7 +158,7 @@ int x25_negotiate_facilities(struct sk_buff *skb, struct sock *sk, struct x25_facilities *new) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); struct x25_facilities *ours = &x25->facilities; struct x25_facilities theirs; int len; diff -Nru a/net/x25/x25_in.c b/net/x25/x25_in.c --- a/net/x25/x25_in.c 2005-01-21 00:22:53 -02:00 +++ b/net/x25/x25_in.c 2005-01-21 00:22:53 -02:00 @@ -34,7 +34,7 @@ static int x25_queue_rx_frame(struct sock *sk, struct sk_buff *skb, int more) { struct sk_buff *skbo, *skbn = skb; - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); if (more) { x25->fraglen += skb->len; @@ -89,7 +89,7 @@ switch (frametype) { case X25_CALL_ACCEPTED: { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); x25_stop_timer(sk); x25->condition = 0x00; @@ -165,7 +165,7 @@ { int queued = 0; int modulus; - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); modulus = (x25->neighbour->extended) ? X25_EMODULUS : X25_SMODULUS; @@ -295,7 +295,7 @@ case X25_RESET_REQUEST: x25_write_internal(sk, X25_RESET_CONFIRMATION); case X25_RESET_CONFIRMATION: { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); x25_stop_timer(sk); x25->condition = 0x00; @@ -322,7 +322,7 @@ /* Higher level upcall for a LAPB frame */ int x25_process_rx_frame(struct sock *sk, struct sk_buff *skb) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); int queued = 0, frametype, ns, nr, q, d, m; if (x25->state == X25_STATE_0) diff -Nru a/net/x25/x25_out.c b/net/x25/x25_out.c --- a/net/x25/x25_out.c 2005-01-21 00:22:53 -02:00 +++ b/net/x25/x25_out.c 2005-01-21 00:22:53 -02:00 @@ -54,7 +54,7 @@ unsigned char header[X25_EXT_MIN_LEN]; int err, frontlen, len; int sent=0, noblock = X25_SKB_CB(skb)->flags & MSG_DONTWAIT; - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); int header_len = x25->neighbour->extended ? X25_EXT_MIN_LEN : X25_STD_MIN_LEN; int max_len = x25_pacsize_to_bytes(x25->facilities.pacsize_out); @@ -116,7 +116,7 @@ */ static void x25_send_iframe(struct sock *sk, struct sk_buff *skb) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); if (!skb) return; @@ -139,7 +139,7 @@ struct sk_buff *skb, *skbn; unsigned short start, end; int modulus; - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); if (x25->state != X25_STATE_3) return; @@ -212,7 +212,7 @@ void x25_enquiry_response(struct sock *sk) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); if (x25->condition & X25_COND_OWN_RX_BUSY) x25_write_internal(sk, X25_RNR); diff -Nru a/net/x25/x25_proc.c b/net/x25/x25_proc.c --- a/net/x25/x25_proc.c 2005-01-21 00:22:53 -02:00 +++ b/net/x25/x25_proc.c 2005-01-21 00:22:53 -02:00 @@ -134,7 +134,7 @@ static int x25_seq_socket_show(struct seq_file *seq, void *v) { struct sock *s; - struct x25_opt *x25; + struct x25_sock *x25; struct net_device *dev; const char *devname; diff -Nru a/net/x25/x25_subr.c b/net/x25/x25_subr.c --- a/net/x25/x25_subr.c 2005-01-21 00:22:53 -02:00 +++ b/net/x25/x25_subr.c 2005-01-21 00:22:53 -02:00 @@ -33,7 +33,7 @@ */ void x25_clear_queues(struct sock *sk) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); skb_queue_purge(&sk->sk_write_queue); skb_queue_purge(&x25->ack_queue); @@ -51,7 +51,7 @@ void x25_frames_acked(struct sock *sk, unsigned short nr) { struct sk_buff *skb; - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); int modulus = x25->neighbour->extended ? X25_EMODULUS : X25_SMODULUS; /* @@ -89,7 +89,7 @@ */ int x25_validate_nr(struct sock *sk, unsigned short nr) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); unsigned short vc = x25->va; int modulus = x25->neighbour->extended ? X25_EMODULUS : X25_SMODULUS; @@ -108,7 +108,7 @@ */ void x25_write_internal(struct sock *sk, int frametype) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); struct sk_buff *skb; unsigned char *dptr; unsigned char facilities[X25_MAX_FAC_LEN]; @@ -248,7 +248,7 @@ int x25_decode(struct sock *sk, struct sk_buff *skb, int *ns, int *nr, int *q, int *d, int *m) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); unsigned char *frame = skb->data; *ns = *nr = *q = *d = *m = 0; @@ -315,7 +315,7 @@ void x25_disconnect(struct sock *sk, int reason, unsigned char cause, unsigned char diagnostic) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); x25_clear_queues(sk); x25_stop_timer(sk); @@ -342,7 +342,7 @@ */ void x25_check_rbuf(struct sock *sk) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); if (atomic_read(&sk->sk_rmem_alloc) < (sk->sk_rcvbuf / 2) && (x25->condition & X25_COND_OWN_RX_BUSY)) { diff -Nru a/net/x25/x25_timer.c b/net/x25/x25_timer.c --- a/net/x25/x25_timer.c 2005-01-21 00:22:53 -02:00 +++ b/net/x25/x25_timer.c 2005-01-21 00:22:53 -02:00 @@ -31,7 +31,7 @@ void x25_init_timers(struct sock *sk) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); init_timer(&x25->timer); x25->timer.data = (unsigned long)sk; @@ -54,28 +54,28 @@ void x25_start_t2timer(struct sock *sk) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); mod_timer(&x25->timer, jiffies + x25->t2); } void x25_start_t21timer(struct sock *sk) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); mod_timer(&x25->timer, jiffies + x25->t21); } void x25_start_t22timer(struct sock *sk) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); mod_timer(&x25->timer, jiffies + x25->t22); } void x25_start_t23timer(struct sock *sk) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); mod_timer(&x25->timer, jiffies + x25->t23); } @@ -87,7 +87,7 @@ unsigned long x25_display_timer(struct sock *sk) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); if (!timer_pending(&x25->timer)) return 0; @@ -138,7 +138,7 @@ */ static inline void x25_do_timer_expiry(struct sock * sk) { - struct x25_opt *x25 = x25_sk(sk); + struct x25_sock *x25 = x25_sk(sk); switch (x25->state) { --------------030700020208060201070604-- From acme@conectiva.com.br Thu Jan 20 19:16:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 19:16:45 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L3GYaw017204 for ; Thu, 20 Jan 2005 19:16:35 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CroXv-0007xW-00; Fri, 21 Jan 2005 00:29:11 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 9BAA71462D; Fri, 21 Jan 2005 01:16:32 -0200 (BRST) Message-ID: <41F074C5.2010807@conectiva.com.br> Date: Fri, 21 Jan 2005 01:19:33 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" Cc: Networking Team Subject: [PATCH 9/12][LLC] stop using sk_protinfo X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------080105020201040300010902" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 596 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------080105020201040300010902 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David, Subject says it all. Regards, - Arnaldo --------------080105020201040300010902 Content-Type: text/plain; name="9-llc.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="9-llc.patch" =================================================================== ChangeSet@1.2007, 2005-01-20 21:17:52-02:00, acme@toy.ghostprotocols.net [LLC] stop using sk_protinfo Required to introduce struct connection_sock. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller include/net/llc_conn.h | 11 ++++- net/llc/af_llc.c | 22 +++++------ net/llc/llc_c_ac.c | 92 ++++++++++++++++++++++++------------------------- net/llc/llc_c_ev.c | 2 - net/llc/llc_conn.c | 50 +++++++++----------------- net/llc/llc_if.c | 4 +- net/llc/llc_proc.c | 8 ++-- net/llc/llc_sap.c | 2 - 8 files changed, 91 insertions(+), 100 deletions(-) diff -Nru a/include/net/llc_conn.h b/include/net/llc_conn.h --- a/include/net/llc_conn.h 2005-01-21 00:22:30 -02:00 +++ b/include/net/llc_conn.h 2005-01-21 00:22:30 -02:00 @@ -13,6 +13,7 @@ */ #include #include +#include #include #define LLC_EVENT 1 @@ -28,8 +29,9 @@ u16 expire; /* timer expire time */ }; -struct llc_opt { - struct sock *sk; /* sock that has this llc_opt */ +struct llc_sock { + /* struct sock must be the first member of llc_sock */ + struct sock sk; struct sockaddr_llc addr; /* address sock is bound to */ u8 state; /* state of connection */ struct llc_sap *sap; /* pointer to parent SAP */ @@ -75,7 +77,10 @@ Used for resending FRMR */ }; -#define llc_sk(__sk) ((struct llc_opt *)(__sk)->sk_protinfo) +static inline struct llc_sock *llc_sk(const struct sock *sk) +{ + return (struct llc_sock *)sk; +} static __inline__ void llc_set_backlog_type(struct sk_buff *skb, char type) { diff -Nru a/net/llc/af_llc.c b/net/llc/af_llc.c --- a/net/llc/af_llc.c 2005-01-21 00:22:30 -02:00 +++ b/net/llc/af_llc.c 2005-01-21 00:22:30 -02:00 @@ -113,7 +113,7 @@ */ static int llc_ui_send_data(struct sock* sk, struct sk_buff *skb, int noblock) { - struct llc_opt* llc = llc_sk(sk); + struct llc_sock* llc = llc_sk(sk); int rc = 0; if (llc_data_accept_state(llc->state) || llc->p_flag) { @@ -169,7 +169,7 @@ static int llc_ui_release(struct socket *sock) { struct sock *sk = sock->sk; - struct llc_opt *llc; + struct llc_sock *llc; if (!sk) goto out; @@ -244,7 +244,7 @@ static int llc_ui_autobind(struct socket *sock, struct sockaddr_llc *addr) { struct sock *sk = sock->sk; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap; int rc = -EINVAL; @@ -293,7 +293,7 @@ { struct sockaddr_llc *addr = (struct sockaddr_llc *)uaddr; struct sock *sk = sock->sk; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap; int rc = -EINVAL; @@ -394,7 +394,7 @@ int addrlen, int flags) { struct sock *sk = sock->sk; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct sockaddr_llc *addr = (struct sockaddr_llc *)uaddr; struct net_device *dev; int rc = -EINVAL; @@ -571,7 +571,7 @@ static int llc_ui_wait_for_busy_core(struct sock *sk, int timeout) { DECLARE_WAITQUEUE(wait, current); - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); int rc; add_wait_queue_exclusive(sk->sk_sleep, &wait); @@ -612,7 +612,7 @@ static int llc_ui_accept(struct socket *sock, struct socket *newsock, int flags) { struct sock *sk = sock->sk, *newsk; - struct llc_opt *llc, *newllc; + struct llc_sock *llc, *newllc; struct sk_buff *skb; int rc = -EOPNOTSUPP; @@ -728,7 +728,7 @@ struct msghdr *msg, size_t len) { struct sock *sk = sock->sk; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct sockaddr_llc *addr = (struct sockaddr_llc *)msg->msg_name; int flags = msg->msg_flags; int noblock = flags & MSG_DONTWAIT; @@ -819,7 +819,7 @@ { struct sockaddr_llc sllc; struct sock *sk = sock->sk; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); int rc = 0; lock_sock(sk); @@ -883,7 +883,7 @@ char __user *optval, int optlen) { struct sock *sk = sock->sk; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); int rc = -EINVAL, opt; lock_sock(sk); @@ -958,7 +958,7 @@ char __user *optval, int __user *optlen) { struct sock *sk = sock->sk; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); int val = 0, len = 0, rc = -EINVAL; lock_sock(sk); diff -Nru a/net/llc/llc_c_ac.c b/net/llc/llc_c_ac.c --- a/net/llc/llc_c_ac.c 2005-01-21 00:22:30 -02:00 +++ b/net/llc/llc_c_ac.c 2005-01-21 00:22:30 -02:00 @@ -44,7 +44,7 @@ int llc_conn_ac_clear_remote_busy(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); if (llc->remote_busy_flag) { u8 nr; @@ -68,7 +68,7 @@ sap = llc_sap_find(dsap); if (sap) { struct llc_conn_state_ev *ev = llc_conn_ev(skb); - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); llc_pdu_decode_sa(skb, llc->daddr.mac); llc_pdu_decode_da(skb, llc->laddr.mac); @@ -146,7 +146,7 @@ int rc = 1; struct llc_conn_state_ev *ev = llc_conn_ev(skb); struct llc_pdu_un *pdu = llc_pdu_un_hdr(skb); - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); switch (ev->type) { case LLC_CONN_EV_TYPE_PDU: @@ -207,7 +207,7 @@ int llc_conn_ac_stop_rej_tmr_if_data_flag_eq_2(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); if (llc->data_flag == 2) del_timer(&llc->rej_sent_timer.timer); @@ -220,7 +220,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; nskb->dev = llc->dev; @@ -246,7 +246,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; u8 f_bit; @@ -273,7 +273,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; u8 f_bit = 1; @@ -299,7 +299,7 @@ int rc = -ENOBUFS; struct sk_buff *nskb; struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb); - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); llc->rx_pdu_hdr = *((u32 *)pdu); if (LLC_PDU_IS_CMD(pdu)) @@ -334,7 +334,7 @@ if (nskb) { u8 f_bit = 0; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; struct llc_pdu_sn *pdu = (struct llc_pdu_sn *)&llc->rx_pdu_hdr; @@ -364,7 +364,7 @@ llc_pdu_decode_pf_bit(skb, &f_bit); nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb); @@ -388,7 +388,7 @@ int llc_conn_ac_send_i_cmd_p_set_1(struct sock *sk, struct sk_buff *skb) { int rc; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; llc_pdu_header_init(skb, LLC_PDU_TYPE_I, sap->laddr.lsap, @@ -405,7 +405,7 @@ static int llc_conn_ac_send_i_cmd_p_set_0(struct sock *sk, struct sk_buff *skb) { int rc; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; llc_pdu_header_init(skb, LLC_PDU_TYPE_I, sap->laddr.lsap, @@ -422,7 +422,7 @@ int llc_conn_ac_send_i_xxx_x_set_0(struct sock *sk, struct sk_buff *skb) { int rc; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; llc_pdu_header_init(skb, LLC_PDU_TYPE_I, sap->laddr.lsap, @@ -454,7 +454,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; nskb->dev = llc->dev; @@ -490,7 +490,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; nskb->dev = llc->dev; @@ -516,7 +516,7 @@ if (nskb) { u8 f_bit = 1; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; nskb->dev = llc->dev; @@ -541,7 +541,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; u8 f_bit = 0; @@ -567,7 +567,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; nskb->dev = llc->dev; @@ -592,7 +592,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; u8 f_bit = 1; @@ -619,7 +619,7 @@ if (nskb) { u8 f_bit = 0; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; nskb->dev = llc->dev; @@ -640,7 +640,7 @@ int llc_conn_ac_set_remote_busy(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); if (!llc->remote_busy_flag) { llc->remote_busy_flag = 1; @@ -656,7 +656,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; nskb->dev = llc->dev; @@ -681,7 +681,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; nskb->dev = llc->dev; @@ -706,7 +706,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; u8 f_bit = 1; @@ -732,7 +732,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; u8 f_bit = 1; @@ -758,7 +758,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; nskb->dev = llc->dev; @@ -783,7 +783,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; nskb->dev = llc->dev; @@ -816,7 +816,7 @@ { int rc = -ENOBUFS; struct sk_buff *nskb = llc_alloc_frame(); - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); if (nskb) { struct llc_sap *sap = llc->sap; @@ -849,7 +849,7 @@ llc_pdu_decode_pf_bit(skb, &f_bit); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; nskb->dev = llc->dev; @@ -882,7 +882,7 @@ int llc_conn_ac_start_p_timer(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); llc_conn_set_p_flag(sk, 1); mod_timer(&llc->pf_cycle_timer.timer, @@ -903,7 +903,7 @@ int llc_conn_ac_send_ack_if_needed(struct sock *sk, struct sk_buff *skb) { u8 pf_bit; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); llc_pdu_decode_pf_bit(skb, &pf_bit); llc->ack_pf |= pf_bit & 1; @@ -950,7 +950,7 @@ struct sk_buff *skb) { int rc; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; llc_pdu_header_init(skb, LLC_PDU_TYPE_I, sap->laddr.lsap, @@ -976,7 +976,7 @@ */ int llc_conn_ac_send_i_as_ack(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); if (llc->ack_must_be_send) { llc_conn_ac_send_i_rsp_f_set_ackpf(sk, skb); @@ -1004,7 +1004,7 @@ struct sk_buff *nskb = llc_alloc_frame(); if (nskb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; nskb->dev = llc->dev; @@ -1035,7 +1035,7 @@ */ static int llc_conn_ac_inc_npta_value(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); if (!llc->inc_cntr) { llc->dec_step = 0; @@ -1058,7 +1058,7 @@ */ int llc_conn_ac_adjust_npta_by_rr(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); if (!llc->connect_step && !llc->remote_busy_flag) { if (!llc->dec_step) { @@ -1084,7 +1084,7 @@ */ int llc_conn_ac_adjust_npta_by_rnr(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); if (llc->remote_busy_flag) if (!llc->dec_step) { @@ -1109,7 +1109,7 @@ */ int llc_conn_ac_dec_tx_win_size(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); u8 unacked_pdu = skb_queue_len(&llc->pdu_unack_q); llc->k -= unacked_pdu; @@ -1128,7 +1128,7 @@ */ int llc_conn_ac_inc_tx_win_size(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); llc->k += 1; if (llc->k > 128) @@ -1138,7 +1138,7 @@ int llc_conn_ac_stop_all_timers(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); del_timer(&llc->pf_cycle_timer.timer); del_timer(&llc->ack_timer.timer); @@ -1151,7 +1151,7 @@ int llc_conn_ac_stop_other_timers(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); del_timer(&llc->rej_sent_timer.timer); del_timer(&llc->pf_cycle_timer.timer); @@ -1163,7 +1163,7 @@ int llc_conn_ac_start_ack_timer(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); mod_timer(&llc->ack_timer.timer, jiffies + llc->ack_timer.expire * HZ); return 0; @@ -1171,7 +1171,7 @@ int llc_conn_ac_start_rej_timer(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); mod_timer(&llc->rej_sent_timer.timer, jiffies + llc->rej_sent_timer.expire * HZ); @@ -1181,7 +1181,7 @@ int llc_conn_ac_start_ack_tmr_if_not_running(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); if (!timer_pending(&llc->ack_timer.timer)) mod_timer(&llc->ack_timer.timer, @@ -1197,7 +1197,7 @@ int llc_conn_ac_stop_p_timer(struct sock *sk, struct sk_buff *skb) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); del_timer(&llc->pf_cycle_timer.timer); llc_conn_set_p_flag(sk, 0); @@ -1215,7 +1215,7 @@ int acked; u16 unacked = 0; struct llc_pdu_sn *pdu = llc_pdu_sn_hdr(skb); - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); llc->last_nr = PDU_SUPV_GET_Nr(pdu); acked = llc_conn_remove_acked_pdus(sk, llc->last_nr, &unacked); diff -Nru a/net/llc/llc_c_ev.c b/net/llc/llc_c_ev.c --- a/net/llc/llc_c_ev.c 2005-01-21 00:22:30 -02:00 +++ b/net/llc/llc_c_ev.c 2005-01-21 00:22:30 -02:00 @@ -78,7 +78,7 @@ u8 nr1, nr2; struct sk_buff *skb; struct llc_pdu_sn *pdu; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); int rc = 0; if (llc->dev->flags & IFF_LOOPBACK) diff -Nru a/net/llc/llc_conn.c b/net/llc/llc_conn.c --- a/net/llc/llc_conn.c 2005-01-21 00:22:30 -02:00 +++ b/net/llc/llc_conn.c 2005-01-21 00:22:30 -02:00 @@ -53,7 +53,7 @@ int llc_conn_state_process(struct sock *sk, struct sk_buff *skb) { int rc; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_conn_state_ev *ev = llc_conn_ev(skb); /* @@ -221,7 +221,7 @@ struct sk_buff *skb; struct llc_pdu_sn *pdu; u16 nbr_unack_pdus; - struct llc_opt *llc; + struct llc_sock *llc; u8 howmany_resend = 0; llc_conn_remove_acked_pdus(sk, nr, &nbr_unack_pdus); @@ -263,7 +263,7 @@ { struct sk_buff *skb; u16 nbr_unack_pdus; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); u8 howmany_resend = 0; llc_conn_remove_acked_pdus(sk, nr, &nbr_unack_pdus); @@ -305,7 +305,7 @@ struct sk_buff *skb; struct llc_pdu_sn *pdu; int nbr_acked = 0; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); int q_len = skb_queue_len(&llc->pdu_unack_q); if (!q_len) @@ -366,7 +366,7 @@ static int llc_conn_service(struct sock *sk, struct sk_buff *skb) { int rc = 1; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_conn_state_trans *trans; if (llc->state > NBR_CONN_STATES) @@ -399,7 +399,7 @@ struct llc_conn_state_trans **next_trans; llc_conn_ev_qfyr_t *next_qualifier; struct llc_conn_state_ev *ev = llc_conn_ev(skb); - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_conn_state *curr_state = &llc_conn_state_table[llc->state - 1]; @@ -478,7 +478,7 @@ read_lock_bh(&sap->sk_list.lock); sk_for_each(rc, node, &sap->sk_list.list) { - struct llc_opt *llc = llc_sk(rc); + struct llc_sock *llc = llc_sk(rc); if (llc->laddr.lsap == laddr->lsap && llc->daddr.lsap == daddr->lsap && @@ -511,7 +511,7 @@ read_lock_bh(&sap->sk_list.lock); sk_for_each(rc, node, &sap->sk_list.list) { - struct llc_opt *llc = llc_sk(rc); + struct llc_sock *llc = llc_sk(rc); if (rc->sk_type == SOCK_STREAM && rc->sk_state == TCP_LISTEN && llc->laddr.lsap == laddr->lsap && @@ -650,7 +650,7 @@ static int llc_conn_rcv(struct sock* sk, struct sk_buff *skb) { struct llc_conn_state_ev *ev = llc_conn_ev(skb); - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); if (!llc->dev) llc->dev = skb->dev; @@ -675,7 +675,7 @@ * Didn't find an active connection; verify if there * is a listening socket for this llc addr */ - struct llc_opt *llc; + struct llc_sock *llc; struct sock *parent = llc_lookup_listener(sap, &daddr); if (!parent) { @@ -756,7 +756,7 @@ static int llc_backlog_rcv(struct sock *sk, struct sk_buff *skb) { int rc = 0; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); if (llc_backlog_type(skb) == LLC_PACKET) { if (llc->state > 1) /* not closed */ @@ -786,17 +786,10 @@ * * Initializes a socket with default llc values. */ -static int llc_sk_init(struct sock* sk) +static void llc_sk_init(struct sock* sk) { - struct llc_opt *llc = kmalloc(sizeof(*llc), GFP_ATOMIC); - int rc = -ENOMEM; + struct llc_sock *llc = llc_sk(sk); - if (!llc) - goto out; - memset(llc, 0, sizeof(*llc)); - rc = 0; - - llc->sk = sk; llc->state = LLC_CONN_STATE_ADM; llc->inc_cntr = llc->dec_cntr = 2; llc->dec_step = llc->connect_step = 1; @@ -827,9 +820,6 @@ * tx_win of remote LLC) */ skb_queue_head_init(&llc->pdu_unack_q); sk->sk_backlog_rcv = llc_backlog_rcv; - sk->sk_protinfo = llc; -out: - return rc; } /** @@ -842,12 +832,12 @@ */ struct sock *llc_sk_alloc(int family, int priority) { - struct sock *sk = sk_alloc(family, priority, 1, NULL); + struct sock *sk = sk_alloc(family, priority, + sizeof(struct llc_sock), NULL); if (!sk) goto out; - if (llc_sk_init(sk)) - goto outsk; + llc_sk_init(sk); sock_init_data(NULL, sk); sk_set_owner(sk, THIS_MODULE); #ifdef LLC_REFCNT_DEBUG @@ -857,10 +847,6 @@ #endif out: return sk; -outsk: - sk_free(sk); - sk = NULL; - goto out; } /** @@ -871,7 +857,7 @@ */ void llc_sk_free(struct sock *sk) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); llc->state = LLC_CONN_OUT_OF_SVC; /* Stop all (possibly) running timers */ @@ -908,7 +894,7 @@ */ void llc_sk_reset(struct sock *sk) { - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); llc_conn_ac_stop_all_timers(sk, NULL); skb_queue_purge(&sk->sk_write_queue); diff -Nru a/net/llc/llc_if.c b/net/llc/llc_if.c --- a/net/llc/llc_if.c 2005-01-21 00:22:30 -02:00 +++ b/net/llc/llc_if.c 2005-01-21 00:22:30 -02:00 @@ -45,7 +45,7 @@ { struct llc_conn_state_ev *ev; int rc = -ECONNABORTED; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); if (llc->state == LLC_CONN_STATE_ADM) goto out; @@ -86,7 +86,7 @@ int rc = -EISCONN; struct llc_addr laddr, daddr; struct sk_buff *skb; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct sock *existing; laddr.lsap = llc->sap->laddr.lsap; diff -Nru a/net/llc/llc_proc.c b/net/llc/llc_proc.c --- a/net/llc/llc_proc.c 2005-01-21 00:22:30 -02:00 +++ b/net/llc/llc_proc.c 2005-01-21 00:22:30 -02:00 @@ -65,7 +65,7 @@ static void *llc_seq_next(struct seq_file *seq, void *v, loff_t *pos) { struct sock* sk, *next; - struct llc_opt *llc; + struct llc_sock *llc; struct llc_sap *sap; ++*pos; @@ -102,7 +102,7 @@ { if (v && v != SEQ_START_TOKEN) { struct sock *sk = v; - struct llc_opt *llc = llc_sk(sk); + struct llc_sock *llc = llc_sk(sk); struct llc_sap *sap = llc->sap; read_unlock_bh(&sap->sk_list.lock); @@ -113,7 +113,7 @@ static int llc_seq_socket_show(struct seq_file *seq, void *v) { struct sock* sk; - struct llc_opt *llc; + struct llc_sock *llc; if (v == SEQ_START_TOKEN) { seq_puts(seq, "SKt Mc local_mac_sap remote_mac_sap " @@ -160,7 +160,7 @@ static int llc_seq_core_show(struct seq_file *seq, void *v) { struct sock* sk; - struct llc_opt *llc; + struct llc_sock *llc; if (v == SEQ_START_TOKEN) { seq_puts(seq, "Connection list:\n" diff -Nru a/net/llc/llc_sap.c b/net/llc/llc_sap.c --- a/net/llc/llc_sap.c 2005-01-21 00:22:30 -02:00 +++ b/net/llc/llc_sap.c 2005-01-21 00:22:30 -02:00 @@ -283,7 +283,7 @@ read_lock_bh(&sap->sk_list.lock); sk_for_each(rc, node, &sap->sk_list.list) { - struct llc_opt *llc = llc_sk(rc); + struct llc_sock *llc = llc_sk(rc); if (rc->sk_type == SOCK_DGRAM && llc->laddr.lsap == laddr->lsap && --------------080105020201040300010902-- From acme@conectiva.com.br Thu Jan 20 19:16:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 19:16:52 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L3Gh8n017400 for ; Thu, 20 Jan 2005 19:16:43 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CroY3-0007xt-00; Fri, 21 Jan 2005 00:29:19 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id DA1491462D; Fri, 21 Jan 2005 01:16:40 -0200 (BRST) Message-ID: <41F074CD.9090401@conectiva.com.br> Date: Fri, 21 Jan 2005 01:19:41 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" , mostrows@styx.uwaterloo.ca Cc: Networking Team Subject: [PATCH 11/12][PPPOX] stop using sk_protinfo X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------050401090707020900020306" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 598 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------050401090707020900020306 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David, Michael, Subject says it all, Michal, this is part of a series of patches that intends to remove sk->sk_protinfo, that in turn will allow me to introduce struct connection_sock, if you have any questions, please contact me or look at netdev archives. Regards, - Arnaldo --------------050401090707020900020306 Content-Type: text/plain; name="11-pppox.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="11-pppox.patch" =================================================================== ChangeSet@1.2009, 2005-01-21 00:16:19-02:00, acme@toy.ghostprotocols.net [PPPOX] stop using sk_protinfo Required to introduce struct connection_sock. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller drivers/net/pppoe.c | 101 ++++++++++++++++++----------------------------- drivers/net/pppox.c | 2 include/linux/if_pppox.h | 19 ++++++-- 3 files changed, 55 insertions(+), 67 deletions(-) diff -Nru a/drivers/net/pppoe.c b/drivers/net/pppoe.c --- a/drivers/net/pppoe.c 2005-01-21 00:22:07 -02:00 +++ b/drivers/net/pppoe.c 2005-01-21 00:22:07 -02:00 @@ -120,17 +120,17 @@ } /* zeroed because its in .bss */ -static struct pppox_opt *item_hash_table[PPPOE_HASH_SIZE]; +static struct pppox_sock *item_hash_table[PPPOE_HASH_SIZE]; /********************************************************************** * * Set/get/delete/rehash items (internal versions) * **********************************************************************/ -static struct pppox_opt *__get_item(unsigned long sid, unsigned char *addr) +static struct pppox_sock *__get_item(unsigned long sid, unsigned char *addr) { int hash = hash_item(sid, addr); - struct pppox_opt *ret; + struct pppox_sock *ret; ret = item_hash_table[hash]; @@ -140,10 +140,10 @@ return ret; } -static int __set_item(struct pppox_opt *po) +static int __set_item(struct pppox_sock *po) { int hash = hash_item(po->pppoe_pa.sid, po->pppoe_pa.remote); - struct pppox_opt *ret; + struct pppox_sock *ret; ret = item_hash_table[hash]; while (ret) { @@ -161,10 +161,10 @@ return 0; } -static struct pppox_opt *__delete_item(unsigned long sid, char *addr) +static struct pppox_sock *__delete_item(unsigned long sid, char *addr) { int hash = hash_item(sid, addr); - struct pppox_opt *ret, **src; + struct pppox_sock *ret, **src; ret = item_hash_table[hash]; src = &item_hash_table[hash]; @@ -187,26 +187,26 @@ * Set/get/delete/rehash items * **********************************************************************/ -static inline struct pppox_opt *get_item(unsigned long sid, +static inline struct pppox_sock *get_item(unsigned long sid, unsigned char *addr) { - struct pppox_opt *po; + struct pppox_sock *po; read_lock_bh(&pppoe_hash_lock); po = __get_item(sid, addr); if (po) - sock_hold(po->sk); + sock_hold(sk_pppox(po)); read_unlock_bh(&pppoe_hash_lock); return po; } -static inline struct pppox_opt *get_item_by_addr(struct sockaddr_pppox *sp) +static inline struct pppox_sock *get_item_by_addr(struct sockaddr_pppox *sp) { return get_item(sp->sa_addr.pppoe.sid, sp->sa_addr.pppoe.remote); } -static inline int set_item(struct pppox_opt *po) +static inline int set_item(struct pppox_sock *po) { int i; @@ -220,9 +220,9 @@ return i; } -static inline struct pppox_opt *delete_item(unsigned long sid, char *addr) +static inline struct pppox_sock *delete_item(unsigned long sid, char *addr) { - struct pppox_opt *ret; + struct pppox_sock *ret; write_lock_bh(&pppoe_hash_lock); ret = __delete_item(sid, addr); @@ -248,11 +248,11 @@ read_lock_bh(&pppoe_hash_lock); for (hash = 0; hash < PPPOE_HASH_SIZE; hash++) { - struct pppox_opt *po = item_hash_table[hash]; + struct pppox_sock *po = item_hash_table[hash]; while (po != NULL) { if (po->pppoe_dev == dev) { - struct sock *sk = po->sk; + struct sock *sk = sk_pppox(po); sock_hold(sk); po->pppoe_dev = NULL; @@ -331,8 +331,8 @@ ***********************************************************************/ static int pppoe_rcv_core(struct sock *sk, struct sk_buff *skb) { - struct pppox_opt *po = pppox_sk(sk); - struct pppox_opt *relay_po = NULL; + struct pppox_sock *po = pppox_sk(sk); + struct pppox_sock *relay_po = NULL; if (sk->sk_state & PPPOX_BOUND) { struct pppoe_hdr *ph = (struct pppoe_hdr *) skb->nh.raw; @@ -347,11 +347,11 @@ if (relay_po == NULL) goto abort_kfree; - if ((relay_po->sk->sk_state & PPPOX_CONNECTED) == 0) + if ((sk_pppox(relay_po)->sk_state & PPPOX_CONNECTED) == 0) goto abort_put; skb_pull(skb, sizeof(struct pppoe_hdr)); - if (!__pppoe_xmit( relay_po->sk, skb)) + if (!__pppoe_xmit(sk_pppox(relay_po), skb)) goto abort_put; } else { if (sock_queue_rcv_skb(sk, skb)) @@ -361,7 +361,7 @@ return NET_RX_SUCCESS; abort_put: - sock_put(relay_po->sk); + sock_put(sk_pppox(relay_po)); abort_kfree: kfree_skb(skb); @@ -379,7 +379,7 @@ { struct pppoe_hdr *ph; - struct pppox_opt *po; + struct pppox_sock *po; struct sock *sk; int ret; @@ -395,7 +395,7 @@ if (!po) goto drop; - sk = po->sk; + sk = sk_pppox(po); bh_lock_sock(sk); /* Socket state is unknown, must put skb into backlog. */ @@ -428,7 +428,7 @@ { struct pppoe_hdr *ph; - struct pppox_opt *po; + struct pppox_sock *po; if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr))) goto abort; @@ -442,7 +442,7 @@ po = get_item((unsigned long) ph->sid, eth_hdr(skb)->h_source); if (po) { - struct sock *sk = po->sk; + struct sock *sk = sk_pppox(po); bh_lock_sock(sk); @@ -480,20 +480,6 @@ /*********************************************************************** * - * Really kill the socket. (Called from pppox_sk_free if refcnt == 0.) - * - **********************************************************************/ -static void pppoe_sk_free(struct sock *sk) -{ - struct pppox_opt *po = pppox_sk(sk); - - if (po) - kfree(po); -} - - -/*********************************************************************** - * * Initialize a new struct sock. * **********************************************************************/ @@ -501,9 +487,8 @@ { int error = -ENOMEM; struct sock *sk; - struct pppox_opt *po; - sk = sk_alloc(PF_PPPOX, GFP_KERNEL, 1, NULL); + sk = sk_alloc(PF_PPPOX, GFP_KERNEL, sizeof(struct pppox_sock), NULL); if (!sk) goto out; @@ -517,23 +502,15 @@ sk->sk_type = SOCK_STREAM; sk->sk_family = PF_PPPOX; sk->sk_protocol = PX_PROTO_OE; - sk->sk_destruct = pppoe_sk_free; - po = sk->sk_protinfo = kmalloc(sizeof(*po), GFP_KERNEL); - if (!po) - goto frees; - memset(po, 0, sizeof(*po)); - po->sk = sk; error = 0; out: return error; -frees: sk_free(sk); - goto out; } static int pppoe_release(struct socket *sock) { struct sock *sk = sock->sk; - struct pppox_opt *po; + struct pppox_sock *po; int error = 0; if (!sk) @@ -573,7 +550,7 @@ struct sock *sk = sock->sk; struct net_device *dev = NULL; struct sockaddr_pppox *sp = (struct sockaddr_pppox *) uservaddr; - struct pppox_opt *po = pppox_sk(sk); + struct pppox_sock *po = pppox_sk(sk); int error; lock_sock(sk); @@ -602,8 +579,8 @@ if(po->pppoe_dev) dev_put(po->pppoe_dev); - memset(po, 0, sizeof(struct pppox_opt)); - po->sk = sk; + memset(sk_pppox(po) + 1, 0, + sizeof(struct pppox_sock) - sizeof(struct sock)); sk->sk_state = PPPOX_NONE; } @@ -679,7 +656,7 @@ unsigned long arg) { struct sock *sk = sock->sk; - struct pppox_opt *po = pppox_sk(sk); + struct pppox_sock *po = pppox_sk(sk); int val = 0; int err = 0; @@ -725,7 +702,7 @@ case PPPOEIOCSFWD: { - struct pppox_opt *relay_po; + struct pppox_sock *relay_po; err = -EBUSY; if (sk->sk_state & (PPPOX_BOUND | PPPOX_ZOMBIE | PPPOX_DEAD)) @@ -755,7 +732,7 @@ if (!relay_po) break; - sock_put(relay_po->sk); + sock_put(sk_pppox(relay_po)); sk->sk_state |= PPPOX_RELAY; err = 0; break; @@ -782,7 +759,7 @@ { struct sk_buff *skb = NULL; struct sock *sk = sock->sk; - struct pppox_opt *po = pppox_sk(sk); + struct pppox_sock *po = pppox_sk(sk); int error = 0; struct pppoe_hdr hdr; struct pppoe_hdr *ph; @@ -857,7 +834,7 @@ ***********************************************************************/ static int __pppoe_xmit(struct sock *sk, struct sk_buff *skb) { - struct pppox_opt *po = pppox_sk(sk); + struct pppox_sock *po = pppox_sk(sk); struct net_device *dev = po->pppoe_dev; struct pppoe_hdr hdr; struct pppoe_hdr *ph; @@ -984,7 +961,7 @@ #ifdef CONFIG_PROC_FS static int pppoe_seq_show(struct seq_file *seq, void *v) { - struct pppox_opt *po; + struct pppox_sock *po; char *dev_name; if (v == SEQ_START_TOKEN) { @@ -1004,9 +981,9 @@ return 0; } -static __inline__ struct pppox_opt *pppoe_get_idx(loff_t pos) +static __inline__ struct pppox_sock *pppoe_get_idx(loff_t pos) { - struct pppox_opt *po = NULL; + struct pppox_sock *po = NULL; int i = 0; for (; i < PPPOE_HASH_SIZE; i++) { @@ -1031,7 +1008,7 @@ static void *pppoe_seq_next(struct seq_file *seq, void *v, loff_t *pos) { - struct pppox_opt *po; + struct pppox_sock *po; ++*pos; if (v == SEQ_START_TOKEN) { diff -Nru a/drivers/net/pppox.c b/drivers/net/pppox.c --- a/drivers/net/pppox.c 2005-01-21 00:22:07 -02:00 +++ b/drivers/net/pppox.c 2005-01-21 00:22:07 -02:00 @@ -72,7 +72,7 @@ unsigned long arg) { struct sock *sk = sock->sk; - struct pppox_opt *po = pppox_sk(sk); + struct pppox_sock *po = pppox_sk(sk); int rc = 0; lock_sock(sk); diff -Nru a/include/linux/if_pppox.h b/include/linux/if_pppox.h --- a/include/linux/if_pppox.h 2005-01-21 00:22:07 -02:00 +++ b/include/linux/if_pppox.h 2005-01-21 00:22:07 -02:00 @@ -119,10 +119,13 @@ relayed to (PPPoE relaying) */ }; -struct pppox_opt { +#include + +struct pppox_sock { + /* struct sock must be the first member of pppox_sock */ + struct sock sk; struct ppp_channel chan; - struct sock *sk; - struct pppox_opt *next; /* for hash table */ + struct pppox_sock *next; /* for hash table */ union { struct pppoe_opt pppoe; } proto; @@ -132,7 +135,15 @@ #define pppoe_pa proto.pppoe.pa #define pppoe_relay proto.pppoe.relay -#define pppox_sk(__sk) ((struct pppox_opt *)(__sk)->sk_protinfo) +static inline struct pppox_sock *pppox_sk(struct sock *sk) +{ + return (struct pppox_sock *)sk; +} + +static inline struct sock *sk_pppox(struct pppox_sock *po) +{ + return (struct sock *)po; +} struct module; --------------050401090707020900020306-- From acme@conectiva.com.br Thu Jan 20 19:16:40 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 19:16:48 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L3GcA8017295 for ; Thu, 20 Jan 2005 19:16:38 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CroXy-0007xe-00; Fri, 21 Jan 2005 00:29:14 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id DDFBB1462D; Fri, 21 Jan 2005 01:16:35 -0200 (BRST) Message-ID: <41F074C8.3080305@conectiva.com.br> Date: Fri, 21 Jan 2005 01:19:36 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" , Jean Tourrilhes Cc: Networking Team Subject: [PATCH 10/12][IRDA] stop using sk_protinfo X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------060701060007010909000006" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 597 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------060701060007010909000006 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David/Jean, This one addresses Jean concerns. Regards, - Arnaldo --------------060701060007010909000006 Content-Type: text/plain; name="10-irda.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="10-irda.patch" =================================================================== ChangeSet@1.2008, 2005-01-20 21:21:48-02:00, acme@toy.ghostprotocols.net [IRDA] stop using sk_protinfo Required to introduce struct connection_sock. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller include/net/irda/af_irda.h | 9 +++++++-- net/irda/af_irda.c | 38 ++++++++++++++------------------------ 2 files changed, 21 insertions(+), 26 deletions(-) diff -Nru a/include/net/irda/af_irda.h b/include/net/irda/af_irda.h --- a/include/net/irda/af_irda.h 2005-01-21 00:22:18 -02:00 +++ b/include/net/irda/af_irda.h 2005-01-21 00:22:18 -02:00 @@ -33,9 +33,12 @@ #include /* struct lsap_cb */ #include /* struct tsap_cb */ #include /* struct discovery_t */ +#include /* IrDA Socket */ struct irda_sock { + /* struct sock has to be the first member of irda_sock */ + struct sock sk; __u32 saddr; /* my local address */ __u32 daddr; /* peer address */ @@ -69,7 +72,6 @@ int errno; /* status of the IAS query */ - struct sock *sk; wait_queue_head_t query_wait; /* Wait for the answer to a query */ struct timer_list watchdog; /* Timeout for discovery */ @@ -77,6 +79,9 @@ LOCAL_FLOW rx_flow; }; -#define irda_sk(__sk) ((struct irda_sock *)(__sk)->sk_protinfo) +static inline struct irda_sock *irda_sk(struct sock *sk) +{ + return (struct irda_sock *)sk; +} #endif /* AF_IRDA_H */ diff -Nru a/net/irda/af_irda.c b/net/irda/af_irda.c --- a/net/irda/af_irda.c 2005-01-21 00:22:18 -02:00 +++ b/net/irda/af_irda.c 2005-01-21 00:22:18 -02:00 @@ -87,10 +87,10 @@ IRDA_DEBUG(3, "%s()\n", __FUNCTION__); - self = (struct irda_sock *) instance; + self = instance; ASSERT(self != NULL, return -1;); - sk = self->sk; + sk = instance; ASSERT(sk != NULL, return -1;); err = sock_queue_rcv_skb(sk, skb); @@ -117,7 +117,7 @@ struct irda_sock *self; struct sock *sk; - self = (struct irda_sock *) instance; + self = instance; IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self); @@ -125,7 +125,7 @@ if(skb) dev_kfree_skb(skb); - sk = self->sk; + sk = instance; if (sk == NULL) { IRDA_DEBUG(0, "%s(%p) : BUG : sk is NULL\n", __FUNCTION__, self); @@ -183,11 +183,11 @@ struct irda_sock *self; struct sock *sk; - self = (struct irda_sock *) instance; + self = instance; IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self); - sk = self->sk; + sk = instance; if (sk == NULL) { dev_kfree_skb(skb); return; @@ -245,11 +245,11 @@ struct irda_sock *self; struct sock *sk; - self = (struct irda_sock *) instance; + self = instance; IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self); - sk = self->sk; + sk = instance; if (sk == NULL) { dev_kfree_skb(skb); return; @@ -332,10 +332,10 @@ IRDA_DEBUG(2, "%s()\n", __FUNCTION__); - self = (struct irda_sock *) instance; + self = instance; ASSERT(self != NULL, return;); - sk = self->sk; + sk = instance; ASSERT(sk != NULL, return;); switch (flow) { @@ -1082,17 +1082,12 @@ } /* Allocate networking socket */ - if ((sk = sk_alloc(PF_IRDA, GFP_ATOMIC, 1, NULL)) == NULL) + sk = sk_alloc(PF_IRDA, GFP_ATOMIC, + sizeof(struct irda_sock), NULL); + if (sk == NULL) return -ENOMEM; - /* Allocate IrDA socket */ - self = sk->sk_protinfo = kmalloc(sizeof(struct irda_sock), GFP_ATOMIC); - if (self == NULL) { - sk_free(sk); - return -ENOMEM; - } - memset(self, 0, sizeof(struct irda_sock)); - + self = irda_sk(sk); IRDA_DEBUG(2, "%s() : self is %p\n", __FUNCTION__, self); init_waitqueue_head(&self->query_wait); @@ -1102,8 +1097,6 @@ sk_set_owner(sk, THIS_MODULE); sk->sk_family = PF_IRDA; sk->sk_protocol = protocol; - /* Link networking socket and IrDA socket structs together */ - self->sk = sk; switch (sock->type) { case SOCK_STREAM: @@ -1187,7 +1180,6 @@ self->lsap = NULL; } #endif /* CONFIG_IRDA_ULTRA */ - kfree(self); } /* @@ -1208,8 +1200,6 @@ /* Destroy IrDA socket */ irda_destroy_socket(irda_sk(sk)); - /* Prevent sock_def_destruct() to create havoc */ - sk->sk_protinfo = NULL; sock_orphan(sk); sock->sk = NULL; --------------060701060007010909000006-- From acme@conectiva.com.br Thu Jan 20 19:16:52 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 19:17:02 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L3Gm0a017497 for ; Thu, 20 Jan 2005 19:16:48 -0800 Received: from [200.138.51.5] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CroY8-0007y4-00; Fri, 21 Jan 2005 00:29:24 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 7E22C1462D; Fri, 21 Jan 2005 01:16:45 -0200 (BRST) Message-ID: <41F074D1.3090107@conectiva.com.br> Date: Fri, 21 Jan 2005 01:19:45 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 1.0 (X11/20041220) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: "David S. Miller" , chas@cmf.nrl.navy.mil Cc: Networking Team Subject: [PATCH 12/12][ATM] stop using sk_protinfo X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------010309010202000203030006" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 599 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------010309010202000203030006 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi David, Chas, Subject says it all. Chas, I tried contacting you, but mail to you bounces, so I hope you can read this message thru netdev. Regards, - Arnaldo --------------010309010202000203030006 Content-Type: text/plain; name="12-atm.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="12-atm.patch" =================================================================== ChangeSet@1.2010, 2005-01-21 00:17:51-02:00, acme@toy.ghostprotocols.net [ATM] stop using sk_protinfo Required to introduce struct connection_sock. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller drivers/atm/atmtcp.c | 14 ++++----- drivers/atm/he.c | 2 - drivers/atm/idt77252.c | 9 +++--- drivers/atm/iphase.c | 12 ++++---- include/linux/atmdev.h | 28 +++++++++++++------ net/atm/atm_misc.c | 7 ++-- net/atm/br2684.c | 4 +- net/atm/clip.c | 19 +++++++------ net/atm/common.c | 55 ++++++++++++++++--------------------- net/atm/ioctl.c | 9 +++--- net/atm/lec.c | 38 +++++++++++++++----------- net/atm/mpc.c | 28 ++++++++++++------- net/atm/pppoatm.c | 3 +- net/atm/proc.c | 18 ++++++------ net/atm/raw.c | 14 ++++++--- net/atm/signaling.c | 41 +++++++++++++++------------- net/atm/svc.c | 71 +++++++++++++++++++++++++------------------------ net/sched/sch_atm.c | 2 - 18 files changed, 207 insertions(+), 167 deletions(-) diff -Nru a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c --- a/drivers/atm/atmtcp.c 2005-01-21 00:21:55 -02:00 +++ b/drivers/atm/atmtcp.c 2005-01-21 00:21:55 -02:00 @@ -67,7 +67,7 @@ *(struct atm_vcc **) &new_msg->vcc = vcc; old_test = test_bit(flag,&vcc->flags); out_vcc->push(out_vcc,skb); - add_wait_queue(vcc->sk->sk_sleep, &wait); + add_wait_queue(sk_atm(vcc)->sk_sleep, &wait); while (test_bit(flag,&vcc->flags) == old_test) { mb(); out_vcc = PRIV(vcc->dev) ? PRIV(vcc->dev)->vcc : NULL; @@ -79,7 +79,7 @@ schedule(); } set_current_state(TASK_RUNNING); - remove_wait_queue(vcc->sk->sk_sleep, &wait); + remove_wait_queue(sk_atm(vcc)->sk_sleep, &wait); return error; } @@ -91,7 +91,7 @@ vcc->vpi = msg->addr.sap_addr.vpi; vcc->vci = msg->addr.sap_addr.vci; vcc->qos = msg->qos; - vcc->sk->sk_err = -msg->result; + sk_atm(vcc)->sk_err = -msg->result; switch (msg->type) { case ATMTCP_CTRL_OPEN: change_bit(ATM_VF_READY,&vcc->flags); @@ -104,7 +104,7 @@ msg->type); return -EINVAL; } - wake_up(vcc->sk->sk_sleep); + wake_up(sk_atm(vcc)->sk_sleep); return 0; } @@ -135,7 +135,7 @@ clear_bit(ATM_VF_READY,&vcc->flags); /* just in case ... */ error = atmtcp_send_control(vcc,ATMTCP_CTRL_OPEN,&msg,ATM_VF_READY); if (error) return error; - return -vcc->sk->sk_err; + return -sk_atm(vcc)->sk_err; } @@ -267,7 +267,7 @@ walk = atm_sk(s); if (walk->dev != atmtcp_dev) continue; - wake_up(walk->sk->sk_sleep); + wake_up(s->sk_sleep); } } read_unlock(&vcc_sklist_lock); @@ -417,7 +417,7 @@ } PRIV(dev)->vcc = vcc; vcc->dev = &atmtcp_control_dev; - vcc_insert_socket(vcc->sk); + vcc_insert_socket(sk_atm(vcc)); set_bit(ATM_VF_META,&vcc->flags); set_bit(ATM_VF_READY,&vcc->flags); vcc->dev_data = dev; diff -Nru a/drivers/atm/he.c b/drivers/atm/he.c --- a/drivers/atm/he.c 2005-01-21 00:21:55 -02:00 +++ b/drivers/atm/he.c 2005-01-21 00:21:55 -02:00 @@ -2610,7 +2610,7 @@ * TBRQ, the host issues the close command to the adapter. */ - while (((tx_inuse = atomic_read(&vcc->sk->sk_wmem_alloc)) > 0) && + while (((tx_inuse = atomic_read(&sk_atm(vcc)->sk_wmem_alloc)) > 0) && (retry < MAX_RETRY)) { msleep(sleep); if (sleep < 250) diff -Nru a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c --- a/drivers/atm/idt77252.c 2005-01-21 00:21:55 -02:00 +++ b/drivers/atm/idt77252.c 2005-01-21 00:21:55 -02:00 @@ -727,10 +727,11 @@ spin_lock_irqsave(&vc->lock, flags); if (vc->estimator) { struct atm_vcc *vcc = vc->tx_vcc; + struct sock *sk = sk_atm(vcc); vc->estimator->cells += (skb->len + 47) / 48; - if (atomic_read(&vcc->sk->sk_wmem_alloc) > - (vcc->sk->sk_sndbuf >> 1)) { + if (atomic_read(&sk->sk_wmem_alloc) > + (sk->sk_sndbuf >> 1)) { u32 cps = vc->estimator->maxcps; vc->estimator->cps = cps; @@ -1325,7 +1326,7 @@ goto drop; } - if ((vcc->sk != NULL) && !atm_charge(vcc, sb->truesize)) { + if (!atm_charge(vcc, sb->truesize)) { RXPRINTK("%s: atm_charge() dropped AAL0 packets.\n", card->name); dev_kfree_skb(sb); @@ -2029,7 +2030,7 @@ atomic_inc(&vcc->stats->tx_err); return -ENOMEM; } - atomic_add(skb->truesize, &vcc->sk->sk_wmem_alloc); + atomic_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc); memcpy(skb_put(skb, 52), cell, 52); diff -Nru a/drivers/atm/iphase.c b/drivers/atm/iphase.c --- a/drivers/atm/iphase.c 2005-01-21 00:21:55 -02:00 +++ b/drivers/atm/iphase.c 2005-01-21 00:21:55 -02:00 @@ -1777,16 +1777,18 @@ if (ia_vcc->pcr < iadev->rate_limit) skb_queue_head_init (&ia_vcc->txing_skb); if (ia_vcc->pcr < iadev->rate_limit) { - if (vcc->qos.txtp.max_sdu != 0) { + struct sock *sk = sk_atm(vcc); + + if (vcc->qos.txtp.max_sdu != 0) { if (ia_vcc->pcr > 60000) - vcc->sk->sk_sndbuf = vcc->qos.txtp.max_sdu * 5; + sk->sk_sndbuf = vcc->qos.txtp.max_sdu * 5; else if (ia_vcc->pcr > 2000) - vcc->sk->sk_sndbuf = vcc->qos.txtp.max_sdu * 4; + sk->sk_sndbuf = vcc->qos.txtp.max_sdu * 4; else - vcc->sk->sk_sndbuf = vcc->qos.txtp.max_sdu * 3; + sk->sk_sndbuf = vcc->qos.txtp.max_sdu * 3; } else - vcc->sk->sk_sndbuf = 24576; + sk->sk_sndbuf = 24576; } vc = (struct main_vc *)iadev->MAIN_VC_TABLE_ADDR; diff -Nru a/include/linux/atmdev.h b/include/linux/atmdev.h --- a/include/linux/atmdev.h 2005-01-21 00:21:55 -02:00 +++ b/include/linux/atmdev.h 2005-01-21 00:21:55 -02:00 @@ -30,9 +30,6 @@ #define ATM_DS3_PCR (8000*12) /* DS3: 12 cells in a 125 usec time slot */ -#define atm_sk(__sk) ((struct atm_vcc *)(__sk)->sk_protinfo) -#define ATM_SD(s) (atm_sk((s)->sk)) - #define __AAL_STAT_ITEMS \ __HANDLE_ITEM(tx); /* TX okay */ \ @@ -281,6 +278,8 @@ #define ATM_ATMOPT_CLP 1 /* set CLP bit */ struct atm_vcc { + /* struct sock has to be the first member of atm_vcc */ + struct sock sk; unsigned long flags; /* VCC flags (ATM_VF_*) */ short vpi; /* VPI and VCI (types must be equal */ /* with sockaddr) */ @@ -297,7 +296,6 @@ void *dev_data; /* per-device data */ void *proto_data; /* per-protocol data */ struct k_atm_aal_stats *stats; /* pointer to AAL stats group */ - struct sock *sk; /* socket backpointer */ /* SVC part --- may move later ------------------------------------- */ short itf; /* interface number */ struct sockaddr_atmsvc local; @@ -310,6 +308,20 @@ /* by CLIP and sch_atm. */ }; +static inline struct atm_vcc *atm_sk(struct sock *sk) +{ + return (struct atm_vcc *)sk; +} + +static inline struct atm_vcc *ATM_SD(struct socket *sock) +{ + return atm_sk(sock->sk); +} + +static inline struct sock *sk_atm(struct atm_vcc *vcc) +{ + return (struct sock *)vcc; +} struct atm_dev_addr { struct sockaddr_atmsvc addr; /* ATM address */ @@ -410,20 +422,20 @@ static inline void atm_force_charge(struct atm_vcc *vcc,int truesize) { - atomic_add(truesize, &vcc->sk->sk_rmem_alloc); + atomic_add(truesize, &sk_atm(vcc)->sk_rmem_alloc); } static inline void atm_return(struct atm_vcc *vcc,int truesize) { - atomic_sub(truesize, &vcc->sk->sk_rmem_alloc); + atomic_sub(truesize, &sk_atm(vcc)->sk_rmem_alloc); } static inline int atm_may_send(struct atm_vcc *vcc,unsigned int size) { - return (size + atomic_read(&vcc->sk->sk_wmem_alloc)) < - vcc->sk->sk_sndbuf; + return (size + atomic_read(&sk_atm(vcc)->sk_wmem_alloc)) < + sk_atm(vcc)->sk_sndbuf; } diff -Nru a/net/atm/atm_misc.c b/net/atm/atm_misc.c --- a/net/atm/atm_misc.c 2005-01-21 00:21:55 -02:00 +++ b/net/atm/atm_misc.c 2005-01-21 00:21:55 -02:00 @@ -16,7 +16,7 @@ int atm_charge(struct atm_vcc *vcc,int truesize) { atm_force_charge(vcc,truesize); - if (atomic_read(&vcc->sk->sk_rmem_alloc) <= vcc->sk->sk_rcvbuf) + if (atomic_read(&sk_atm(vcc)->sk_rmem_alloc) <= sk_atm(vcc)->sk_rcvbuf) return 1; atm_return(vcc,truesize); atomic_inc(&vcc->stats->rx_drop); @@ -27,15 +27,16 @@ struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, int gfp_flags) { + struct sock *sk = sk_atm(vcc); int guess = atm_guess_pdu2truesize(pdu_size); atm_force_charge(vcc,guess); - if (atomic_read(&vcc->sk->sk_rmem_alloc) <= vcc->sk->sk_rcvbuf) { + if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf) { struct sk_buff *skb = alloc_skb(pdu_size,gfp_flags); if (skb) { atomic_add(skb->truesize-guess, - &vcc->sk->sk_rmem_alloc); + &sk->sk_rmem_alloc); return skb; } } diff -Nru a/net/atm/br2684.c b/net/atm/br2684.c --- a/net/atm/br2684.c 2005-01-21 00:21:55 -02:00 +++ b/net/atm/br2684.c 2005-01-21 00:21:55 -02:00 @@ -190,7 +190,7 @@ dev_kfree_skb(skb); return 0; } - atomic_add(skb->truesize, &atmvcc->sk->sk_wmem_alloc); + atomic_add(skb->truesize, &sk_atm(atmvcc)->sk_wmem_alloc); ATM_SKB(skb)->atm_options = atmvcc->atm_options; brdev->stats.tx_packets++; brdev->stats.tx_bytes += skb->len; @@ -557,7 +557,7 @@ barrier(); atmvcc->push = br2684_push; skb_queue_head_init(©); - skb_migrate(&atmvcc->sk->sk_receive_queue, ©); + skb_migrate(&sk_atm(atmvcc)->sk_receive_queue, ©); while ((skb = skb_dequeue(©)) != NULL) { BRPRIV(skb->dev)->stats.rx_bytes -= skb->len; BRPRIV(skb->dev)->stats.rx_packets--; diff -Nru a/net/atm/clip.c b/net/atm/clip.c --- a/net/atm/clip.c 2005-01-21 00:21:55 -02:00 +++ b/net/atm/clip.c 2005-01-21 00:21:55 -02:00 @@ -58,6 +58,7 @@ static int to_atmarpd(enum atmarp_ctrl_type type,int itf,unsigned long ip) { + struct sock *sk; struct atmarp_ctrl *ctrl; struct sk_buff *skb; @@ -70,8 +71,10 @@ ctrl->itf_num = itf; ctrl->ip = ip; atm_force_charge(atmarpd,skb->truesize); - skb_queue_tail(&atmarpd->sk->sk_receive_queue, skb); - atmarpd->sk->sk_data_ready(atmarpd->sk, skb->len); + + sk = sk_atm(atmarpd); + skb_queue_tail(&sk->sk_receive_queue, skb); + sk->sk_data_ready(sk, skb->len); return 0; } @@ -434,7 +437,7 @@ memcpy(here,llc_oui,sizeof(llc_oui)); ((u16 *) here)[3] = skb->protocol; } - atomic_add(skb->truesize, &vcc->sk->sk_wmem_alloc); + atomic_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc); ATM_SKB(skb)->atm_options = vcc->atm_options; entry->vccs->last_use = jiffies; DPRINTK("atm_skb(%p)->vcc(%p)->dev(%p)\n",skb,vcc,vcc->dev); @@ -493,7 +496,7 @@ vcc->push = clip_push; vcc->pop = clip_pop; skb_queue_head_init(©); - skb_migrate(&vcc->sk->sk_receive_queue, ©); + skb_migrate(&sk_atm(vcc)->sk_receive_queue, ©); /* re-process everything received between connection setup and MKIP */ while ((skb = skb_dequeue(©)) != NULL) if (!clip_devs) { @@ -686,10 +689,10 @@ barrier(); unregister_inetaddr_notifier(&clip_inet_notifier); unregister_netdevice_notifier(&clip_dev_notifier); - if (skb_peek(&vcc->sk->sk_receive_queue)) + if (skb_peek(&sk_atm(vcc)->sk_receive_queue)) printk(KERN_ERR "atmarpd_close: closing with requests " "pending\n"); - skb_queue_purge(&vcc->sk->sk_receive_queue); + skb_queue_purge(&sk_atm(vcc)->sk_receive_queue); DPRINTK("(done)\n"); module_put(THIS_MODULE); } @@ -723,7 +726,7 @@ set_bit(ATM_VF_READY,&vcc->flags); /* allow replies and avoid getting closed if signaling dies */ vcc->dev = &atmarpd_dev; - vcc_insert_socket(vcc->sk); + vcc_insert_socket(sk_atm(vcc)); vcc->push = NULL; vcc->pop = NULL; /* crash */ vcc->push_oam = NULL; /* crash */ @@ -822,7 +825,7 @@ int svc, llc, off; svc = ((clip_vcc == SEQ_NO_VCC_TOKEN) || - (clip_vcc->vcc->sk->sk_family == AF_ATMSVC)); + (sk_atm(clip_vcc->vcc)->sk_family == AF_ATMSVC)); llc = ((clip_vcc == SEQ_NO_VCC_TOKEN) || clip_vcc->encap); diff -Nru a/net/atm/common.c b/net/atm/common.c --- a/net/atm/common.c 2005-01-21 00:21:55 -02:00 +++ b/net/atm/common.c 2005-01-21 00:21:55 -02:00 @@ -68,17 +68,18 @@ static struct sk_buff *alloc_tx(struct atm_vcc *vcc,unsigned int size) { struct sk_buff *skb; + struct sock *sk = sk_atm(vcc); - if (atomic_read(&vcc->sk->sk_wmem_alloc) && !atm_may_send(vcc, size)) { + if (atomic_read(&sk->sk_wmem_alloc) && !atm_may_send(vcc, size)) { DPRINTK("Sorry: wmem_alloc = %d, size = %d, sndbuf = %d\n", - atomic_read(&vcc->sk->sk_wmem_alloc), size, - vcc->sk->sk_sndbuf); + atomic_read(&sk->sk_wmem_alloc), size, + sk->sk_sndbuf); return NULL; } while (!(skb = alloc_skb(size,GFP_KERNEL))) schedule(); - DPRINTK("AlTx %d += %d\n", atomic_read(&vcc->sk->sk_wmem_alloc), + DPRINTK("AlTx %d += %d\n", atomic_read(&sk->sk_wmem_alloc), skb->truesize); - atomic_add(skb->truesize, &vcc->sk->sk_wmem_alloc); + atomic_add(skb->truesize, &sk->sk_wmem_alloc); return skb; } @@ -89,15 +90,11 @@ static void vcc_sock_destruct(struct sock *sk) { - struct atm_vcc *vcc = atm_sk(sk); - - if (atomic_read(&vcc->sk->sk_rmem_alloc)) + if (atomic_read(&sk->sk_rmem_alloc)) printk(KERN_DEBUG "vcc_sock_destruct: rmem leakage (%d bytes) detected.\n", atomic_read(&sk->sk_rmem_alloc)); - if (atomic_read(&vcc->sk->sk_wmem_alloc)) + if (atomic_read(&sk->sk_wmem_alloc)) printk(KERN_DEBUG "vcc_sock_destruct: wmem leakage (%d bytes) detected.\n", atomic_read(&sk->sk_wmem_alloc)); - - kfree(sk->sk_protinfo); } static void vcc_def_wakeup(struct sock *sk) @@ -139,7 +136,7 @@ sock->sk = NULL; if (sock->type == SOCK_STREAM) return -EINVAL; - sk = sk_alloc(family, GFP_KERNEL, 1, NULL); + sk = sk_alloc(family, GFP_KERNEL, sizeof(struct atm_vcc), NULL); if (!sk) return -ENOMEM; sock_init_data(sock, sk); @@ -147,20 +144,13 @@ sk->sk_state_change = vcc_def_wakeup; sk->sk_write_space = vcc_write_space; - vcc = sk->sk_protinfo = kmalloc(sizeof(*vcc), GFP_KERNEL); - if (!vcc) { - sk_free(sk); - return -ENOMEM; - } - - memset(vcc, 0, sizeof(*vcc)); - vcc->sk = sk; + vcc = atm_sk(sk); vcc->dev = NULL; memset(&vcc->local,0,sizeof(struct sockaddr_atmsvc)); memset(&vcc->remote,0,sizeof(struct sockaddr_atmsvc)); vcc->qos.txtp.max_sdu = 1 << 16; /* for meta VCs */ - atomic_set(&vcc->sk->sk_wmem_alloc, 0); - atomic_set(&vcc->sk->sk_rmem_alloc, 0); + atomic_set(&sk->sk_wmem_alloc, 0); + atomic_set(&sk->sk_rmem_alloc, 0); vcc->push = NULL; vcc->pop = NULL; vcc->push_oam = NULL; @@ -187,7 +177,7 @@ vcc_remove_socket(sk); /* no more receive */ - while ((skb = skb_dequeue(&vcc->sk->sk_receive_queue)) != NULL) { + while ((skb = skb_dequeue(&sk->sk_receive_queue)) != NULL) { atm_return(vcc,skb->truesize); kfree_skb(skb); } @@ -215,11 +205,13 @@ void vcc_release_async(struct atm_vcc *vcc, int reply) { + struct sock *sk = sk_atm(vcc); + set_bit(ATM_VF_CLOSE, &vcc->flags); - vcc->sk->sk_shutdown |= RCV_SHUTDOWN; - vcc->sk->sk_err = -reply; + sk->sk_shutdown |= RCV_SHUTDOWN; + sk->sk_err = -reply; clear_bit(ATM_VF_WAITING, &vcc->flags); - vcc->sk->sk_state_change(vcc->sk); + sk->sk_state_change(sk); } @@ -328,6 +320,7 @@ static int __vcc_connect(struct atm_vcc *vcc, struct atm_dev *dev, short vpi, int vci) { + struct sock *sk = sk_atm(vcc); int error; if ((vpi != ATM_VPI_UNSPEC && vpi != ATM_VPI_ANY && @@ -347,7 +340,7 @@ } vcc->vpi = vpi; vcc->vci = vci; - __vcc_insert_socket(vcc->sk); + __vcc_insert_socket(sk); write_unlock_irq(&vcc_sklist_lock); switch (vcc->qos.aal) { case ATM_AAL0: @@ -386,7 +379,7 @@ return 0; fail: - vcc_remove_socket(vcc->sk); + vcc_remove_socket(sk); fail_module_put: module_put(dev->ops->owner); /* ensure we get dev module ref count correct */ @@ -495,7 +488,7 @@ if (error) return error; sock_recv_timestamp(msg, sk, skb); - DPRINTK("RcvM %d -= %d\n", atomic_read(&vcc->sk->rmem_alloc), skb->truesize); + DPRINTK("RcvM %d -= %d\n", atomic_read(&sk->rmem_alloc), skb->truesize); atm_return(vcc, skb->truesize); skb_free_datagram(sk, skb); return copied; @@ -615,7 +608,7 @@ return mask; if (vcc->qos.txtp.traffic_class != ATM_NONE && - vcc_writable(vcc->sk)) + vcc_writable(sk)) mask |= POLLOUT | POLLWRNORM | POLLWRBAND; return mask; @@ -638,7 +631,7 @@ if (!error) error = adjust_tp(&qos->rxtp,qos->aal); if (error) return error; if (!vcc->dev->ops->change_qos) return -EOPNOTSUPP; - if (vcc->sk->sk_family == AF_ATMPVC) + if (sk_atm(vcc)->sk_family == AF_ATMPVC) return vcc->dev->ops->change_qos(vcc,qos,ATM_MF_SET); return svc_change_qos(vcc,qos); } diff -Nru a/net/atm/ioctl.c b/net/atm/ioctl.c --- a/net/atm/ioctl.c 2005-01-21 00:21:55 -02:00 +++ b/net/atm/ioctl.c 2005-01-21 00:21:55 -02:00 @@ -46,6 +46,7 @@ int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) { + struct sock *sk = sock->sk; struct atm_vcc *vcc; int error; struct list_head * pos; @@ -59,8 +60,8 @@ error = -EINVAL; goto done; } - error = put_user(vcc->sk->sk_sndbuf - - atomic_read(&vcc->sk->sk_wmem_alloc), + error = put_user(sk->sk_sndbuf - + atomic_read(&sk->sk_wmem_alloc), (int __user *) argp) ? -EFAULT : 0; goto done; case SIOCINQ: @@ -71,13 +72,13 @@ error = -EINVAL; goto done; } - skb = skb_peek(&vcc->sk->sk_receive_queue); + skb = skb_peek(&sk->sk_receive_queue); error = put_user(skb ? skb->len : 0, (int __user *)argp) ? -EFAULT : 0; goto done; } case SIOCGSTAMP: /* borrowed from IP */ - error = sock_get_timestamp(vcc->sk, argp); + error = sock_get_timestamp(sk, argp); goto done; case ATM_SETSC: printk(KERN_WARNING "ATM_SETSC is obsolete\n"); diff -Nru a/net/atm/lec.c b/net/atm/lec.c --- a/net/atm/lec.c 2005-01-21 00:21:55 -02:00 +++ b/net/atm/lec.c 2005-01-21 00:21:55 -02:00 @@ -122,6 +122,7 @@ eth = (struct ethhdr *)skb->data; buff = skb->data + skb->dev->hard_header_len; if (*buff++ == 0x42 && *buff++ == 0x42 && *buff++ == 0x03) { + struct sock *sk; struct sk_buff *skb2; struct atmlec_msg *mesg; @@ -135,8 +136,9 @@ priv = (struct lec_priv *)dev->priv; atm_force_charge(priv->lecd, skb2->truesize); - skb_queue_tail(&priv->lecd->sk->sk_receive_queue, skb2); - priv->lecd->sk->sk_data_ready(priv->lecd->sk, skb2->len); + sk = sk_atm(priv->lecd); + skb_queue_tail(&sk->sk_receive_queue, skb2); + sk->sk_data_ready(sk, skb2->len); } return; @@ -214,7 +216,7 @@ ATM_SKB(skb)->vcc = vcc; ATM_SKB(skb)->atm_options = vcc->atm_options; - atomic_add(skb->truesize, &vcc->sk->sk_wmem_alloc); + atomic_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc); if (vcc->send(vcc, skb) < 0) { priv->stats.tx_dropped++; return; @@ -430,7 +432,7 @@ int i; char *tmp; /* FIXME */ - atomic_sub(skb->truesize, &vcc->sk->sk_wmem_alloc); + atomic_sub(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc); mesg = (struct atmlec_msg *)skb->data; tmp = skb->data; tmp += sizeof(struct atmlec_msg); @@ -528,6 +530,7 @@ f->dst->state == BR_STATE_FORWARDING) { /* hit from bridge table, send LE_ARP_RESPONSE */ struct sk_buff *skb2; + struct sock *sk; DPRINTK("%s: entry found, responding to zeppelin\n", dev->name); skb2 = alloc_skb(sizeof(struct atmlec_msg), GFP_ATOMIC); @@ -538,8 +541,9 @@ skb2->len = sizeof(struct atmlec_msg); memcpy(skb2->data, mesg, sizeof(struct atmlec_msg)); atm_force_charge(priv->lecd, skb2->truesize); - skb_queue_tail(&priv->lecd->sk->sk_receive_queue, skb2); - priv->lecd->sk->sk_data_ready(priv->lecd->sk, skb2->len); + sk = sk_atm(priv->lecd); + skb_queue_tail(&sk->sk_receive_queue, skb2); + sk->sk_data_ready(sk, skb2->len); } if (f != NULL) br_fdb_put_hook(f); #endif /* defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) */ @@ -567,10 +571,10 @@ netif_stop_queue(dev); lec_arp_destroy(priv); - if (skb_peek(&vcc->sk->sk_receive_queue)) + if (skb_peek(&sk_atm(vcc)->sk_receive_queue)) printk("%s lec_atm_close: closing with messages pending\n", dev->name); - while ((skb = skb_dequeue(&vcc->sk->sk_receive_queue)) != NULL) { + while ((skb = skb_dequeue(&sk_atm(vcc)->sk_receive_queue)) != NULL) { atm_return(vcc, skb->truesize); dev_kfree_skb(skb); } @@ -600,6 +604,7 @@ unsigned char *mac_addr, unsigned char *atm_addr, struct sk_buff *data) { + struct sock *sk; struct sk_buff *skb; struct atmlec_msg *mesg; @@ -623,14 +628,15 @@ memcpy(&mesg->content.normal.atm_addr, atm_addr, ATM_ESA_LEN); atm_force_charge(priv->lecd, skb->truesize); - skb_queue_tail(&priv->lecd->sk->sk_receive_queue, skb); - priv->lecd->sk->sk_data_ready(priv->lecd->sk, skb->len); + sk = sk_atm(priv->lecd); + skb_queue_tail(&sk->sk_receive_queue, skb); + sk->sk_data_ready(sk, skb->len); if (data != NULL) { DPRINTK("lec: about to send %d bytes of data\n", data->len); atm_force_charge(priv->lecd, data->truesize); - skb_queue_tail(&priv->lecd->sk->sk_receive_queue, data); - priv->lecd->sk->sk_data_ready(priv->lecd->sk, skb->len); + skb_queue_tail(&sk->sk_receive_queue, data); + sk->sk_data_ready(sk, skb->len); } return 0; @@ -711,9 +717,11 @@ printk("%s...\n",buf); #endif /* DUMP_PACKETS > 0 */ if (memcmp(skb->data, lec_ctrl_magic, 4) ==0) { /* Control frame, to daemon*/ + struct sock *sk = sk_atm(vcc); + DPRINTK("%s: To daemon\n",dev->name); - skb_queue_tail(&vcc->sk->sk_receive_queue, skb); - vcc->sk->sk_data_ready(vcc->sk, skb->len); + skb_queue_tail(&sk->sk_receive_queue, skb); + sk->sk_data_ready(sk, skb->len); } else { /* Data frame, queue to protocol handlers */ unsigned char *dst; @@ -866,7 +874,7 @@ priv->itfnum = i; /* LANE2 addition */ priv->lecd = vcc; vcc->dev = &lecatm_dev; - vcc_insert_socket(vcc->sk); + vcc_insert_socket(sk_atm(vcc)); vcc->proto_data = dev_lec[i]; set_bit(ATM_VF_META,&vcc->flags); diff -Nru a/net/atm/mpc.c b/net/atm/mpc.c --- a/net/atm/mpc.c 2005-01-21 00:21:55 -02:00 +++ b/net/atm/mpc.c 2005-01-21 00:21:55 -02:00 @@ -522,7 +522,7 @@ memcpy(skb->data, &llc_snap_mpoa_data, sizeof(struct llc_snap_hdr)); } - atomic_add(skb->truesize, &entry->shortcut->sk->sk_wmem_alloc); + atomic_add(skb->truesize, &sk_atm(entry->shortcut)->sk_wmem_alloc); ATM_SKB(skb)->atm_options = entry->shortcut->atm_options; entry->shortcut->send(entry->shortcut, skb); entry->packets_fwded++; @@ -665,10 +665,12 @@ skb->dev = dev; if (memcmp(skb->data, &llc_snap_mpoa_ctrl, sizeof(struct llc_snap_hdr)) == 0) { + struct sock *sk = sk_atm(vcc); + dprintk("mpoa: (%s) mpc_push: control packet arrived\n", dev->name); /* Pass control packets to daemon */ - skb_queue_tail(&vcc->sk->sk_receive_queue, skb); - vcc->sk->sk_data_ready(vcc->sk, skb->len); + skb_queue_tail(&sk->sk_receive_queue, skb); + sk->sk_data_ready(sk, skb->len); return; } @@ -794,7 +796,7 @@ mpc->mpoad_vcc = vcc; vcc->dev = &mpc_dev; - vcc_insert_socket(vcc->sk); + vcc_insert_socket(sk_atm(vcc)); set_bit(ATM_VF_META,&vcc->flags); set_bit(ATM_VF_READY,&vcc->flags); @@ -853,7 +855,7 @@ mpc->in_ops->destroy_cache(mpc); mpc->eg_ops->destroy_cache(mpc); - while ((skb = skb_dequeue(&vcc->sk->sk_receive_queue))) { + while ((skb = skb_dequeue(&sk_atm(vcc)->sk_receive_queue))) { atm_return(vcc, skb->truesize); kfree_skb(skb); } @@ -873,7 +875,7 @@ struct mpoa_client *mpc = find_mpc_by_vcc(vcc); struct k_message *mesg = (struct k_message*)skb->data; - atomic_sub(skb->truesize, &vcc->sk->sk_wmem_alloc); + atomic_sub(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc); if (mpc == NULL) { printk("mpoa: msg_from_mpoad: no mpc found\n"); @@ -938,6 +940,7 @@ int msg_to_mpoad(struct k_message *mesg, struct mpoa_client *mpc) { struct sk_buff *skb; + struct sock *sk; if (mpc == NULL || !mpc->mpoad_vcc) { printk("mpoa: msg_to_mpoad: mesg %d to a non-existent mpoad\n", mesg->type); @@ -950,8 +953,10 @@ skb_put(skb, sizeof(struct k_message)); memcpy(skb->data, mesg, sizeof(struct k_message)); atm_force_charge(mpc->mpoad_vcc, skb->truesize); - skb_queue_tail(&mpc->mpoad_vcc->sk->sk_receive_queue, skb); - mpc->mpoad_vcc->sk->sk_data_ready(mpc->mpoad_vcc->sk, skb->len); + + sk = sk_atm(mpc->mpoad_vcc); + skb_queue_tail(&sk->sk_receive_queue, skb); + sk->sk_data_ready(sk, skb->len); return 0; } @@ -1206,6 +1211,7 @@ static void purge_egress_shortcut(struct atm_vcc *vcc, eg_cache_entry *entry) { + struct sock *sk; struct k_message *purge_msg; struct sk_buff *skb; @@ -1229,8 +1235,10 @@ purge_msg->content.eg_info = entry->ctrl_info; atm_force_charge(vcc, skb->truesize); - skb_queue_tail(&vcc->sk->sk_receive_queue, skb); - vcc->sk->sk_data_ready(vcc->sk, skb->len); + + sk = sk_atm(vcc); + skb_queue_tail(&sk->sk_receive_queue, skb); + sk->sk_data_ready(sk, skb->len); dprintk("mpoa: purge_egress_shortcut: exiting:\n"); return; diff -Nru a/net/atm/pppoatm.c b/net/atm/pppoatm.c --- a/net/atm/pppoatm.c 2005-01-21 00:21:55 -02:00 +++ b/net/atm/pppoatm.c 2005-01-21 00:21:55 -02:00 @@ -233,7 +233,8 @@ kfree_skb(skb); return 1; } - atomic_add(skb->truesize, &ATM_SKB(skb)->vcc->sk->sk_wmem_alloc); + + atomic_add(skb->truesize, &sk_atm(ATM_SKB(skb)->vcc)->sk_wmem_alloc); ATM_SKB(skb)->atm_options = ATM_SKB(skb)->vcc->atm_options; DPRINTK("(unit %d): atm_skb(%p)->vcc(%p)->dev(%p)\n", pvcc->chan.unit, skb, ATM_SKB(skb)->vcc, diff -Nru a/net/atm/proc.c b/net/atm/proc.c --- a/net/atm/proc.c 2005-01-21 00:21:55 -02:00 +++ b/net/atm/proc.c 2005-01-21 00:21:55 -02:00 @@ -71,9 +71,7 @@ static inline int compare_family(struct sock *sk, int family) { - struct atm_vcc *vcc = atm_sk(sk); - - return !family || (vcc->sk->sk_family == family); + return !family || (sk->sk_family == family); } static int __vcc_walk(struct sock **sock, int family, int *bucket, loff_t l) @@ -203,13 +201,15 @@ static void vcc_info(struct seq_file *seq, struct atm_vcc *vcc) { + struct sock *sk = sk_atm(vcc); + seq_printf(seq, "%p ", vcc); if (!vcc->dev) seq_printf(seq, "Unassigned "); else seq_printf(seq, "%3d %3d %5d ", vcc->dev->number, vcc->vpi, vcc->vci); - switch (vcc->sk->sk_family) { + switch (sk->sk_family) { case AF_ATMPVC: seq_printf(seq, "PVC"); break; @@ -217,12 +217,12 @@ seq_printf(seq, "SVC"); break; default: - seq_printf(seq, "%3d", vcc->sk->sk_family); + seq_printf(seq, "%3d", sk->sk_family); } - seq_printf(seq, " %04lx %5d %7d/%7d %7d/%7d [%d]\n", vcc->flags, vcc->sk->sk_err, - atomic_read(&vcc->sk->sk_wmem_alloc),vcc->sk->sk_sndbuf, - atomic_read(&vcc->sk->sk_rmem_alloc),vcc->sk->sk_rcvbuf, - atomic_read(&vcc->sk->sk_refcnt)); + seq_printf(seq, " %04lx %5d %7d/%7d %7d/%7d [%d]\n", vcc->flags, sk->sk_err, + atomic_read(&sk->sk_wmem_alloc), sk->sk_sndbuf, + atomic_read(&sk->sk_rmem_alloc), sk->sk_rcvbuf, + atomic_read(&sk->sk_refcnt)); } static void svc_info(struct seq_file *seq, struct atm_vcc *vcc) diff -Nru a/net/atm/raw.c b/net/atm/raw.c --- a/net/atm/raw.c 2005-01-21 00:21:55 -02:00 +++ b/net/atm/raw.c 2005-01-21 00:21:55 -02:00 @@ -28,19 +28,23 @@ void atm_push_raw(struct atm_vcc *vcc,struct sk_buff *skb) { if (skb) { - skb_queue_tail(&vcc->sk->sk_receive_queue, skb); - vcc->sk->sk_data_ready(vcc->sk, skb->len); + struct sock *sk = sk_atm(vcc); + + skb_queue_tail(&sk->sk_receive_queue, skb); + sk->sk_data_ready(sk, skb->len); } } static void atm_pop_raw(struct atm_vcc *vcc,struct sk_buff *skb) { - DPRINTK("APopR (%d) %d -= %d\n", vcc->vci, vcc->sk->sk_wmem_alloc, + struct sock *sk = sk_atm(vcc); + + DPRINTK("APopR (%d) %d -= %d\n", vcc->vci, sk->sk_wmem_alloc, skb->truesize); - atomic_sub(skb->truesize, &vcc->sk->sk_wmem_alloc); + atomic_sub(skb->truesize, &sk->sk_wmem_alloc); dev_kfree_skb_any(skb); - vcc->sk->sk_write_space(vcc->sk); + sk->sk_write_space(sk); } diff -Nru a/net/atm/signaling.c b/net/atm/signaling.c --- a/net/atm/signaling.c 2005-01-21 00:21:55 -02:00 +++ b/net/atm/signaling.c 2005-01-21 00:21:55 -02:00 @@ -62,8 +62,8 @@ } #endif atm_force_charge(sigd,skb->truesize); - skb_queue_tail(&sigd->sk->sk_receive_queue,skb); - sigd->sk->sk_data_ready(sigd->sk, skb->len); + skb_queue_tail(&sk_atm(sigd)->sk_receive_queue,skb); + sk_atm(sigd)->sk_data_ready(sk_atm(sigd), skb->len); } @@ -97,15 +97,18 @@ { struct atmsvc_msg *msg; struct atm_vcc *session_vcc; + struct sock *sk; msg = (struct atmsvc_msg *) skb->data; - atomic_sub(skb->truesize, &vcc->sk->sk_wmem_alloc); + atomic_sub(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc); DPRINTK("sigd_send %d (0x%lx)\n",(int) msg->type, (unsigned long) msg->vcc); vcc = *(struct atm_vcc **) &msg->vcc; + sk = sk_atm(vcc); + switch (msg->type) { case as_okay: - vcc->sk->sk_err = -msg->reply; + sk->sk_err = -msg->reply; clear_bit(ATM_VF_WAITING, &vcc->flags); if (!*vcc->local.sas_addr.prv && !*vcc->local.sas_addr.pub) { @@ -126,25 +129,25 @@ case as_error: clear_bit(ATM_VF_REGIS,&vcc->flags); clear_bit(ATM_VF_READY,&vcc->flags); - vcc->sk->sk_err = -msg->reply; + sk->sk_err = -msg->reply; clear_bit(ATM_VF_WAITING, &vcc->flags); break; case as_indicate: vcc = *(struct atm_vcc **) &msg->listen_vcc; DPRINTK("as_indicate!!!\n"); - lock_sock(vcc->sk); - if (vcc->sk->sk_ack_backlog == - vcc->sk->sk_max_ack_backlog) { + lock_sock(sk); + if (sk->sk_ack_backlog == + sk->sk_max_ack_backlog) { sigd_enq(NULL,as_reject,vcc,NULL,NULL); dev_kfree_skb(skb); goto as_indicate_complete; } - vcc->sk->sk_ack_backlog++; - skb_queue_tail(&vcc->sk->sk_receive_queue, skb); - DPRINTK("waking vcc->sk->sk_sleep 0x%p\n", vcc->sk->sk_sleep); - vcc->sk->sk_state_change(vcc->sk); + sk->sk_ack_backlog++; + skb_queue_tail(&sk->sk_receive_queue, skb); + DPRINTK("waking sk->sk_sleep 0x%p\n", sk->sk_sleep); + sk->sk_state_change(sk); as_indicate_complete: - release_sock(vcc->sk); + release_sock(sk); return 0; case as_close: set_bit(ATM_VF_RELEASED,&vcc->flags); @@ -155,7 +158,7 @@ break; case as_addparty: case as_dropparty: - vcc->sk->sk_err_soft = msg->reply; /* < 0 failure, otherwise ep_ref */ + sk->sk_err_soft = msg->reply; /* < 0 failure, otherwise ep_ref */ clear_bit(ATM_VF_WAITING, &vcc->flags); break; default: @@ -163,7 +166,7 @@ (int) msg->type); return -EINVAL; } - vcc->sk->sk_state_change(vcc->sk); + sk->sk_state_change(sk); out: dev_kfree_skb(skb); return 0; @@ -213,7 +216,7 @@ static void purge_vcc(struct atm_vcc *vcc) { - if (vcc->sk->sk_family == PF_ATMSVC && + if (sk_atm(vcc)->sk_family == PF_ATMSVC && !test_bit(ATM_VF_META,&vcc->flags)) { set_bit(ATM_VF_RELEASED,&vcc->flags); vcc_release_async(vcc, -EUNATCH); @@ -229,9 +232,9 @@ DPRINTK("sigd_close\n"); sigd = NULL; - if (skb_peek(&vcc->sk->sk_receive_queue)) + if (skb_peek(&sk_atm(vcc)->sk_receive_queue)) printk(KERN_ERR "sigd_close: closing with requests pending\n"); - skb_queue_purge(&vcc->sk->sk_receive_queue); + skb_queue_purge(&sk_atm(vcc)->sk_receive_queue); read_lock(&vcc_sklist_lock); for(i = 0; i < VCC_HTABLE_SIZE; ++i) { @@ -268,7 +271,7 @@ DPRINTK("sigd_attach\n"); sigd = vcc; vcc->dev = &sigd_dev; - vcc_insert_socket(vcc->sk); + vcc_insert_socket(sk_atm(vcc)); set_bit(ATM_VF_META,&vcc->flags); set_bit(ATM_VF_READY,&vcc->flags); #ifdef WAIT_FOR_DEMON diff -Nru a/net/atm/svc.c b/net/atm/svc.c --- a/net/atm/svc.c 2005-01-21 00:21:55 -02:00 +++ b/net/atm/svc.c 2005-01-21 00:21:55 -02:00 @@ -53,20 +53,21 @@ { DEFINE_WAIT(wait); struct sk_buff *skb; + struct sock *sk = sk_atm(vcc); DPRINTK("svc_disconnect %p\n",vcc); if (test_bit(ATM_VF_REGIS,&vcc->flags)) { - prepare_to_wait(vcc->sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE); + prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE); sigd_enq(vcc,as_close,NULL,NULL,NULL); while (!test_bit(ATM_VF_RELEASED,&vcc->flags) && sigd) { schedule(); - prepare_to_wait(vcc->sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE); + prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE); } - finish_wait(vcc->sk->sk_sleep, &wait); + finish_wait(sk->sk_sleep, &wait); } /* beware - socket is still in use by atmsigd until the last as_indicate has been answered */ - while ((skb = skb_dequeue(&vcc->sk->sk_receive_queue)) != NULL) { + while ((skb = skb_dequeue(&sk->sk_receive_queue)) != NULL) { DPRINTK("LISTEN REL\n"); sigd_enq2(NULL,as_reject,vcc,NULL,NULL,&vcc->qos,0); dev_kfree_skb(skb); @@ -317,8 +318,7 @@ goto out; } set_bit(ATM_VF_LISTEN,&vcc->flags); - vcc->sk->sk_max_ack_backlog = backlog > 0 ? backlog : - ATM_BACKLOG_DEFAULT; + sk->sk_max_ack_backlog = backlog > 0 ? backlog : ATM_BACKLOG_DEFAULT; error = -sk->sk_err; out: release_sock(sk); @@ -347,8 +347,8 @@ while (1) { DEFINE_WAIT(wait); - prepare_to_wait(old_vcc->sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); - while (!(skb = skb_dequeue(&old_vcc->sk->sk_receive_queue)) && + prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); + while (!(skb = skb_dequeue(&sk->sk_receive_queue)) && sigd) { if (test_bit(ATM_VF_RELEASED,&old_vcc->flags)) break; if (test_bit(ATM_VF_CLOSE,&old_vcc->flags)) { @@ -366,9 +366,9 @@ error = -ERESTARTSYS; break; } - prepare_to_wait(old_vcc->sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); + prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); } - finish_wait(old_vcc->sk->sk_sleep, &wait); + finish_wait(sk->sk_sleep, &wait); if (error) goto out; if (!skb) { @@ -384,7 +384,7 @@ error = vcc_connect(newsock, msg->pvc.sap_addr.itf, msg->pvc.sap_addr.vpi, msg->pvc.sap_addr.vci); dev_kfree_skb(skb); - old_vcc->sk->sk_ack_backlog--; + sk->sk_ack_backlog--; if (error) { sigd_enq2(NULL,as_reject,old_vcc,NULL,NULL, &old_vcc->qos,error); @@ -393,23 +393,23 @@ } /* wait should be short, so we ignore the non-blocking flag */ set_bit(ATM_VF_WAITING, &new_vcc->flags); - prepare_to_wait(new_vcc->sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE); + prepare_to_wait(sk_atm(new_vcc)->sk_sleep, &wait, TASK_UNINTERRUPTIBLE); sigd_enq(new_vcc,as_accept,old_vcc,NULL,NULL); while (test_bit(ATM_VF_WAITING, &new_vcc->flags) && sigd) { release_sock(sk); schedule(); lock_sock(sk); - prepare_to_wait(new_vcc->sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE); + prepare_to_wait(sk_atm(new_vcc)->sk_sleep, &wait, TASK_UNINTERRUPTIBLE); } - finish_wait(new_vcc->sk->sk_sleep, &wait); + finish_wait(sk_atm(new_vcc)->sk_sleep, &wait); if (!sigd) { error = -EUNATCH; goto out; } - if (!new_vcc->sk->sk_err) + if (!sk_atm(new_vcc)->sk_err) break; - if (new_vcc->sk->sk_err != ERESTARTSYS) { - error = -new_vcc->sk->sk_err; + if (sk_atm(new_vcc)->sk_err != ERESTARTSYS) { + error = -sk_atm(new_vcc)->sk_err; goto out; } } @@ -435,19 +435,20 @@ int svc_change_qos(struct atm_vcc *vcc,struct atm_qos *qos) { + struct sock *sk = sk_atm(vcc); DEFINE_WAIT(wait); set_bit(ATM_VF_WAITING, &vcc->flags); - prepare_to_wait(vcc->sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE); + prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE); sigd_enq2(vcc,as_modify,NULL,NULL,&vcc->local,qos,0); while (test_bit(ATM_VF_WAITING, &vcc->flags) && !test_bit(ATM_VF_RELEASED, &vcc->flags) && sigd) { schedule(); - prepare_to_wait(vcc->sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE); + prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE); } - finish_wait(vcc->sk->sk_sleep, &wait); + finish_wait(sk->sk_sleep, &wait); if (!sigd) return -EUNATCH; - return -vcc->sk->sk_err; + return -sk->sk_err; } @@ -532,28 +533,29 @@ int sockaddr_len, int flags) { DEFINE_WAIT(wait); + struct sock *sk = sock->sk; struct atm_vcc *vcc = ATM_SD(sock); int error; - lock_sock(vcc->sk); + lock_sock(sk); set_bit(ATM_VF_WAITING, &vcc->flags); - prepare_to_wait(vcc->sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); + prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); sigd_enq(vcc, as_addparty, NULL, NULL, (struct sockaddr_atmsvc *) sockaddr); if (flags & O_NONBLOCK) { - finish_wait(vcc->sk->sk_sleep, &wait); + finish_wait(sk->sk_sleep, &wait); error = -EINPROGRESS; goto out; } DPRINTK("svc_addparty added wait queue\n"); while (test_bit(ATM_VF_WAITING, &vcc->flags) && sigd) { schedule(); - prepare_to_wait(vcc->sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); + prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); } - finish_wait(vcc->sk->sk_sleep, &wait); - error = xchg(&vcc->sk->sk_err_soft, 0); + finish_wait(sk->sk_sleep, &wait); + error = xchg(&sk->sk_err_soft, 0); out: - release_sock(vcc->sk); + release_sock(sk); return error; } @@ -561,25 +563,26 @@ static int svc_dropparty(struct socket *sock, int ep_ref) { DEFINE_WAIT(wait); + struct sock *sk = sock->sk; struct atm_vcc *vcc = ATM_SD(sock); int error; - lock_sock(vcc->sk); + lock_sock(sk); set_bit(ATM_VF_WAITING, &vcc->flags); - prepare_to_wait(vcc->sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); + prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); sigd_enq2(vcc, as_dropparty, NULL, NULL, NULL, NULL, ep_ref); while (test_bit(ATM_VF_WAITING, &vcc->flags) && sigd) { schedule(); - prepare_to_wait(vcc->sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); + prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); } - finish_wait(vcc->sk->sk_sleep, &wait); + finish_wait(sk->sk_sleep, &wait); if (!sigd) { error = -EUNATCH; goto out; } - error = xchg(&vcc->sk->sk_err_soft, 0); + error = xchg(&sk->sk_err_soft, 0); out: - release_sock(vcc->sk); + release_sock(sk); return error; } diff -Nru a/net/sched/sch_atm.c b/net/sched/sch_atm.c --- a/net/sched/sch_atm.c 2005-01-21 00:21:55 -02:00 +++ b/net/sched/sch_atm.c 2005-01-21 00:21:55 -02:00 @@ -519,7 +519,7 @@ memcpy(skb_push(skb,flow->hdr_len),flow->hdr, flow->hdr_len); atomic_add(skb->truesize, - &flow->vcc->sk->sk_wmem_alloc); + &sk_atm(flow->vcc)->sk_wmem_alloc); /* atm.atm_options are already set by atm_tc_enqueue */ (void) flow->vcc->send(flow->vcc,skb); } --------------010309010202000203030006-- From davem@davemloft.net Thu Jan 20 23:38:51 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 23:38:58 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L7cpqT005218 for ; Thu, 20 Jan 2005 23:38:51 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CrtLT-0005MB-00; Thu, 20 Jan 2005 23:36:39 -0800 Date: Thu, 20 Jan 2005 23:36:39 -0800 From: "David S. Miller" To: Peter Chubb Cc: netdev@oss.sgi.com, mchan@broadcom.com Subject: Re: Fix fallout from tg3_readphy() value is zero on error Message-Id: <20050120233639.5e6088ee.davem@davemloft.net> In-Reply-To: <16880.24671.640491.852938@berry.gelato.unsw.EDU.AU> References: <16880.24671.640491.852938@berry.gelato.unsw.EDU.AU> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 600 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Fri, 21 Jan 2005 12:52:31 +1100 Peter Chubb wrote: > After DaveM's patch to make the `default' value returned by > tg3_readphy() to be zero, the attached patch fixes the few cases where > a zero changes the previous behaviur, and deletes a couple of > initialisation to zero that are no longer necessary. The setting to zero was to eliminate a gcc warning because it's flow analysis in earlier versions can't tell that we do always set it to some value. I think it's wiser to just make sure every case checks the tg3_read_phy() return value. So I'll work on that. So is your 16-way system working now with this patch on top of the current driver? From cap@nsc.liu.se Thu Jan 20 23:41:10 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 20 Jan 2005 23:41:16 -0800 (PST) Received: from papput.nsc.liu.se (ns2.nsc.liu.se [130.236.101.9] (may be forged)) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L7f9OC005630 for ; Thu, 20 Jan 2005 23:41:09 -0800 Received: from mail.nsc.liu.se (mail.nsc.liu.se [130.236.101.49]) by papput.nsc.liu.se (Postfix) with ESMTP id 0C8831C31E4; Fri, 21 Jan 2005 08:41:08 +0100 (CET) Date: Fri, 21 Jan 2005 08:41:08 +0100 (CET) From: Peter Kjellstroem To: "Venkatesan, Ganesh" Cc: netdev@oss.sgi.com, Subject: Re: e1000>5.2.30 unstable with InterruptThrottleRate=0 In-Reply-To: <468F3FDA28AA87429AD807992E22D07E037ED6A3@orsmsx408> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 601 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cap@nsc.liu.se Precedence: bulk X-list: netdev On Sun, 5 Dec 2004, Venkatesan, Ganesh wrote: > Hi Peter: > > Thanks for the thorough analysis. I will have to perform a set of tests > with your patch included in our latest version of the driver. I will > respond to you after I am done with my tests. > > Ganesh. Hello, *waking up ooold thread* I've done some more testing with the patch discussed in this thread, rediffed for newer kernels and fixed the oubvious typo. The fix has been extensively tested on two kernels (RHEL-2.4.20-20 and 2.4.28 from kernel.org) and two types of hardware (Dell 750 and Supermircro P4SCi). Further, the original fix (taken out in 2.4.27-pre1) was for all 82547 (which didn't work that well for Scott I think) while this is only for rev2 (82547GI). Worth to notice is that this fix is for non-NAPI cases. With NAPI the problem persists and I don't know how to implement an equivalent fix. Lastly, to repeat some background, we allways have to run e1000 with InterruptThrottleRate=0 to get resonable cluster performance (MPI). This is not possible with 82547 without this patch (it feels bad and keeps resetting (netdev watchdog timeout reset ... something...)). Here follows patches against 2.4.29 and 2.6.10. I have not tested it with 2.6.x but it's really driver local and should not care about the kernel version. Regards, Peter --- linux-2.4.29/drivers/net/e1000/e1000_main.c Thu Jan 20 19:57:29 2005 +++ linux-2.4.29-patched/drivers/net/e1000/e1000_main.c Fri Jan 21 00:00:19 2005 @@ -2132,10 +2132,19 @@ e1000_intr(int irq, void *data, struct p __netif_rx_schedule(netdev); } #else + /* e1000_irq_disable/enable pair added back (removed in 2.4.27-pre1) */ + /* fixed needed for 82547GI (e1000_82547_rev_2) Dell 750, P4SCi */ + /* reliable operation with ITR=0 */ + if(hw->mac_type == e1000_82547_rev_2) + e1000_irq_disable(adapter); + for(i = 0; i < E1000_MAX_INTR; i++) if(unlikely(!e1000_clean_rx_irq(adapter) & !e1000_clean_tx_irq(adapter))) break; + + if(hw->mac_type == e1000_82547_rev_2) + e1000_irq_enable(adapter); #endif return IRQ_HANDLED; --- linux-2.6.10/drivers/net/e1000/e1000_main.c Fri Dec 24 22:35:50 2004 +++ linux-2.6.10-patched/drivers/net/e1000/e1000_main.c Fri Jan 21 00:01:34 2005 @@ -2139,10 +2139,19 @@ e1000_intr(int irq, void *data, struct p __netif_rx_schedule(netdev); } #else + /* e1000_irq_disable/enable pair added back (removed in 2.4.27-pre1) */ + /* fixed needed for 82547GI (e1000_82547_rev_2) Dell 750, P4SCi */ + /* reliable operation with ITR=0 */ + if(hw->mac_type == e1000_82547_rev_2) + e1000_irq_disable(adapter); + for(i = 0; i < E1000_MAX_INTR; i++) if(unlikely(!e1000_clean_rx_irq(adapter) & !e1000_clean_tx_irq(adapter))) break; + + if(hw->mac_type == e1000_82547_rev_2) + e1000_irq_enable(adapter); #endif return IRQ_HANDLED; -- ------------------------------------------------------------ Peter Kjellstroem | E-mail: cap@nsc.liu.se National Supercomputer Centre | Sweden | http://www.nsc.liu.se From rkagan@mail.ru Fri Jan 21 00:54:41 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 00:54:46 -0800 (PST) Received: from Apachihuilliztli.mtu.ru (apachihuilliztli.mtu.ru [195.34.32.124]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0L8seH3011246 for ; Fri, 21 Jan 2005 00:54:40 -0800 Received: from umail.ru (umail.mtu.ru [195.34.32.101]) by Apachihuilliztli.mtu.ru (Postfix) with ESMTP id EA783BE792; Fri, 21 Jan 2005 11:51:27 +0300 (MSK) (envelope-from rkagan@mail.ru) Received: from [83.237.53.150] (HELO localhost) by umail.ru (CommuniGate Pro SMTP 4.2b6) with ESMTP id 387023182; Fri, 21 Jan 2005 11:51:27 +0300 Date: Fri, 21 Jan 2005 11:51:23 +0300 From: Roman Kagan To: netdev@oss.sgi.com, linux-atm-general@lists.sourceforge.net Cc: usbatm@lists.infradead.org Subject: [RFC][PATCH] Very basic sysfs support for ATM devices (updated) Message-ID: <20050121085123.GA2471@katya> References: <20050119174543.GA2418@katya> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050119174543.GA2418@katya> X-Evolution-Account: mail.ru X-Evolution-Format: text/plain X-Mailer: Evolution 2.0.3 User-Agent: Mutt/1.5.6i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 602 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rkagan@mail.ru Precedence: bulk X-list: netdev Hi, Here's a quick patch to add very basic sysfs support to ATM devices. It creates class/atm and provides a couple of attributes for each ATM device and hotplug callout for device addition/removal, which was the main motivation for me to write it up. With this patch, an utility to set up a network interface on the newly registered ATM device can be called automatically via hotplug, just as it is done with net_device. Compared to the first version sent to linux-atm-general mailing list, it fixes the accidentally sneaked in bug using class_device_unregister instead of class_device_del, and replaces mutual references of class_device and atm_dev with container_of. The patch is against 2.6.10. Please comment. Thanks, Roman. include/linux/atmdev.h | 2 net/atm/Makefile | 2 net/atm/atm_sysfs.c | 113 +++++++++++++++++++++++++++++++++++++++++++++++++ net/atm/common.c | 7 ++- net/atm/common.h | 2 net/atm/resources.c | 31 ++++++++++--- net/atm/resources.h | 3 + 7 files changed, 152 insertions(+), 8 deletions(-) diff -rupN -x '*~' linux-2.6.10.orig/include/linux/atmdev.h linux-2.6.10/include/linux/atmdev.h --- linux-2.6.10.orig/include/linux/atmdev.h 2004-12-25 00:35:24.000000000 +0300 +++ linux-2.6.10/include/linux/atmdev.h 2005-01-19 16:44:09.000000000 +0300 @@ -8,6 +8,7 @@ #include +#include #include #include #include @@ -337,6 +338,7 @@ struct atm_dev { struct proc_dir_entry *proc_entry; /* proc entry */ char *proc_name; /* proc entry name */ #endif + struct class_device class_dev; /* sysfs class device */ struct list_head dev_list; /* linkage */ }; diff -rupN -x '*~' linux-2.6.10.orig/net/atm/atm_sysfs.c linux-2.6.10/net/atm/atm_sysfs.c --- linux-2.6.10.orig/net/atm/atm_sysfs.c 1970-01-01 03:00:00.000000000 +0300 +++ linux-2.6.10/net/atm/atm_sysfs.c 2005-01-21 04:03:46.000000000 +0300 @@ -0,0 +1,113 @@ +/* ATM driver model support. */ + +#include +#include +#include +#include +#include +#include "common.h" +#include "resources.h" + +#define to_atm_dev(cldev) container_of(cldev, struct atm_dev, class_dev) + +static ssize_t show_type(struct class_device *cdev, char *buf) +{ + struct atm_dev *adev = to_atm_dev(cdev); + return sprintf(buf, "%s\n", adev->type); +} + +static ssize_t show_address(struct class_device *cdev, char *buf) +{ + int i; + char *pos = buf; + struct atm_dev *adev = to_atm_dev(cdev); + + for (i = 0; i < sizeof(adev->esi); i++) + pos += sprintf(pos, "%02x:", adev->esi[i]); + pos += sprintf(pos, "%02x\n", adev->esi[i]); + + return pos - buf; +} + +static CLASS_DEVICE_ATTR(type, S_IRUGO, show_type, NULL); +static CLASS_DEVICE_ATTR(address, S_IRUGO, show_address, NULL); + +static struct class_device_attribute *atm_attrs[] = { + &class_device_attr_type, + &class_device_attr_address, + NULL +}; + +#ifdef CONFIG_HOTPLUG +static int atm_hotplug(struct class_device *cdev, char **envp, int num_envp, char *buf, int size) +{ + struct atm_dev *adev; + int i = 0; + int length = 0; + + if (!cdev) + return -ENODEV; + + adev = to_atm_dev(cdev); + if (!adev) + return -ENODEV; + + if (add_hotplug_env_var(envp, num_envp, &i, buf, size, &length, + "INTERFACE=%d", adev->number)) + return -ENOMEM; + + envp[i] = NULL; + return 0; +} +#endif + +static void atm_release(struct class_device *cdev) +{ + struct atm_dev *adev = to_atm_dev(cdev); + + kfree(adev); +} + +static struct class atm_class = { + .name = "atm", + .release = atm_release, +#ifdef CONFIG_HOTPLUG + .hotplug = atm_hotplug, +#endif +}; + +int atm_register_sysfs(struct atm_dev *adev) +{ + struct class_device *cdev = &adev->class_dev; + int i, err; + + cdev->class = &atm_class; + class_set_devdata(cdev, adev); + + snprintf(cdev->class_id, BUS_ID_SIZE, "%d", adev->number); + err = class_device_register(cdev); + if (err < 0) + return err; + + for (i = 0; atm_attrs[i]; i++) + class_device_create_file(cdev, atm_attrs[i]); + + return 0; +} + +void atm_unregister_sysfs(struct atm_dev *adev) +{ + struct class_device *cdev = &adev->class_dev; + + class_device_del(cdev); +} + +int __init atm_sysfs_init(void) +{ + return class_register(&atm_class); +} + +void __exit atm_sysfs_exit(void) +{ + class_unregister(&atm_class); +} diff -rupN -x '*~' linux-2.6.10.orig/net/atm/common.c linux-2.6.10/net/atm/common.c --- linux-2.6.10.orig/net/atm/common.c 2004-12-25 00:35:50.000000000 +0300 +++ linux-2.6.10/net/atm/common.c 2005-01-19 17:01:26.000000000 +0300 @@ -793,6 +793,10 @@ static int __init atm_init(void) printk(KERN_ERR "atm_proc_init() failed with %d\n",error); goto failure; } + if ((error = atm_sysfs_init()) < 0) { + printk(KERN_ERR "atm_sysfs_init() failed with %d\n",error); + goto failure; + } return 0; failure: @@ -804,11 +808,12 @@ failure: static void __exit atm_exit(void) { atm_proc_exit(); + atm_sysfs_exit(); atmsvc_exit(); atmpvc_exit(); } -module_init(atm_init); +subsys_initcall(atm_init); module_exit(atm_exit); MODULE_LICENSE("GPL"); diff -rupN -x '*~' linux-2.6.10.orig/net/atm/common.h linux-2.6.10/net/atm/common.h --- linux-2.6.10.orig/net/atm/common.h 2004-12-25 00:35:23.000000000 +0300 +++ linux-2.6.10/net/atm/common.h 2005-01-19 16:09:16.000000000 +0300 @@ -28,6 +28,8 @@ int atmpvc_init(void); void atmpvc_exit(void); int atmsvc_init(void); void atmsvc_exit(void); +int atm_sysfs_init(void); +void atm_sysfs_exit(void); #ifdef CONFIG_PROC_FS int atm_proc_init(void); diff -rupN -x '*~' linux-2.6.10.orig/net/atm/Makefile linux-2.6.10/net/atm/Makefile --- linux-2.6.10.orig/net/atm/Makefile 2004-12-25 00:34:00.000000000 +0300 +++ linux-2.6.10/net/atm/Makefile 2005-01-19 17:04:29.000000000 +0300 @@ -2,7 +2,7 @@ # Makefile for the ATM Protocol Families. # -atm-y := addr.o pvc.o signaling.o svc.o ioctl.o common.o atm_misc.o raw.o resources.o +atm-y := addr.o pvc.o signaling.o svc.o ioctl.o common.o atm_misc.o raw.o resources.o atm_sysfs.o mpoa-objs := mpc.o mpoa_caches.o mpoa_proc.o obj-$(CONFIG_ATM) += atm.o diff -rupN -x '*~' linux-2.6.10.orig/net/atm/resources.c linux-2.6.10/net/atm/resources.c --- linux-2.6.10.orig/net/atm/resources.c 2004-12-25 00:35:29.000000000 +0300 +++ linux-2.6.10/net/atm/resources.c 2005-01-21 04:03:01.000000000 +0300 @@ -47,6 +47,12 @@ static void __free_atm_dev(struct atm_de kfree(dev); } +static void release_atm_dev(struct atm_dev *dev) +{ + /* will free via class release */ + class_device_put(&dev->class_dev); +} + static struct atm_dev *__atm_dev_lookup(int number) { struct atm_dev *dev; @@ -114,14 +120,25 @@ struct atm_dev *atm_dev_register(const c printk(KERN_ERR "atm_dev_register: " "atm_proc_dev_register failed for dev %s\n", type); - spin_lock(&atm_dev_lock); - list_del(&dev->dev_list); - spin_unlock(&atm_dev_lock); - __free_atm_dev(dev); - return NULL; + goto reg_fail; + } + + if (atm_register_sysfs(dev) < 0) { + printk(KERN_ERR "atm_dev_register: " + "atm_register_sysfs failed for dev %s\n", + type); + atm_proc_dev_deregister(dev); + goto reg_fail; } return dev; + +reg_fail: + spin_lock(&atm_dev_lock); + list_del(&dev->dev_list); + spin_unlock(&atm_dev_lock); + __free_atm_dev(dev); + return NULL; } @@ -129,6 +146,8 @@ void atm_dev_deregister(struct atm_dev * { unsigned long warning_time; + atm_unregister_sysfs(dev); + atm_proc_dev_deregister(dev); spin_lock(&atm_dev_lock); @@ -147,7 +166,7 @@ void atm_dev_deregister(struct atm_dev * } } - __free_atm_dev(dev); + release_atm_dev(dev); } void shutdown_atm_dev(struct atm_dev *dev) diff -rupN -x '*~' linux-2.6.10.orig/net/atm/resources.h linux-2.6.10/net/atm/resources.h --- linux-2.6.10.orig/net/atm/resources.h 2004-12-25 00:36:01.000000000 +0300 +++ linux-2.6.10/net/atm/resources.h 2005-01-19 16:55:20.000000000 +0300 @@ -43,4 +43,7 @@ static inline void atm_proc_dev_deregist #endif /* CONFIG_PROC_FS */ +int atm_register_sysfs(struct atm_dev *adev); +void atm_unregister_sysfs(struct atm_dev *adev); + #endif From herbert@gondor.apana.org.au Fri Jan 21 02:20:27 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 02:20:36 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LAKMoq014056 for ; Fri, 21 Jan 2005 02:20:25 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1Crvte-0001XN-00; Fri, 21 Jan 2005 21:20:06 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CrvtC-0000ch-00; Fri, 21 Jan 2005 21:19:38 +1100 Date: Fri, 21 Jan 2005 21:19:38 +1100 To: "David S. Miller" , netdev@oss.sgi.com Subject: [XFRM] Probe selected algorithm only Message-ID: <20050121101938.GA1133@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="G4iJoqBmSsgzjUCe" Content-Disposition: inline User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 603 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev --G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Dave: This patch removes an annoying problem in xfrm_user. As it is every time an SA is added it probes every known algorithm in the universe. Now if they all existed it would be OK. However, for the ones which don't actually exist this causes multiple /sbin/modprobe processes to be spawned which slows the system down when you're adding hundreds of SAs. Since we know the type of algorithm required when we're adding a new SA, we can get away with only probing the selected algorithms. This is what the following patch does for xfrm_user. Signed-off-by: Herbert Xu Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== include/linux/crypto.h 1.31 vs edited ===== --- 1.31/include/linux/crypto.h 2004-12-01 17:00:21 +11:00 +++ edited/include/linux/crypto.h 2005-01-21 21:11:45 +11:00 @@ -16,6 +16,7 @@ #ifndef _LINUX_CRYPTO_H #define _LINUX_CRYPTO_H +#include #include #include #include @@ -121,7 +122,14 @@ /* * Algorithm query interface. */ +#ifdef CONFIG_CRYPTO int crypto_alg_available(const char *name, u32 flags); +#else +static inline int crypto_alg_available(const char *name, u32 flags) +{ + return 0; +} +#endif /* * Transforms: user-instantiated objects which encapsulate algorithms ===== include/net/xfrm.h 1.73 vs edited ===== --- 1.73/include/net/xfrm.h 2004-12-28 14:49:57 +11:00 +++ edited/include/net/xfrm.h 2005-01-21 21:02:36 +11:00 @@ -873,9 +873,9 @@ extern struct xfrm_algo_desc *xfrm_aalg_get_byid(int alg_id); extern struct xfrm_algo_desc *xfrm_ealg_get_byid(int alg_id); extern struct xfrm_algo_desc *xfrm_calg_get_byid(int alg_id); -extern struct xfrm_algo_desc *xfrm_aalg_get_byname(char *name); -extern struct xfrm_algo_desc *xfrm_ealg_get_byname(char *name); -extern struct xfrm_algo_desc *xfrm_calg_get_byname(char *name); +extern struct xfrm_algo_desc *xfrm_aalg_get_byname(char *name, int probe); +extern struct xfrm_algo_desc *xfrm_ealg_get_byname(char *name, int probe); +extern struct xfrm_algo_desc *xfrm_calg_get_byname(char *name, int probe); struct crypto_tfm; typedef void (icv_update_fn_t)(struct crypto_tfm *, struct scatterlist *, unsigned int); ===== net/ipv4/ah4.c 1.40 vs edited ===== --- 1.40/net/ipv4/ah4.c 2004-08-22 15:00:07 +10:00 +++ edited/net/ipv4/ah4.c 2005-01-21 21:03:39 +11:00 @@ -236,7 +236,7 @@ * we need for AH processing. This lookup cannot fail here * after a successful crypto_alloc_tfm(). */ - aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name); + aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name, 0); BUG_ON(!aalg_desc); if (aalg_desc->uinfo.auth.icv_fullbits/8 != ===== net/ipv4/esp4.c 1.54 vs edited ===== --- 1.54/net/ipv4/esp4.c 2004-08-22 15:00:07 +10:00 +++ edited/net/ipv4/esp4.c 2005-01-21 21:04:37 +11:00 @@ -392,7 +392,7 @@ goto error; esp->auth.icv = esp_hmac_digest; - aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name); + aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name, 0); BUG_ON(!aalg_desc); if (aalg_desc->uinfo.auth.icv_fullbits/8 != ===== net/ipv4/ipcomp.c 1.30 vs edited ===== --- 1.30/net/ipv4/ipcomp.c 2004-09-11 07:36:51 +10:00 +++ edited/net/ipv4/ipcomp.c 2005-01-21 21:04:40 +11:00 @@ -472,7 +472,7 @@ goto error_tunnel; } - calg_desc = xfrm_calg_get_byname(x->calg->alg_name); + calg_desc = xfrm_calg_get_byname(x->calg->alg_name, 0); BUG_ON(!calg_desc); ipcd->threshold = calg_desc->uinfo.comp.threshold; x->data = ipcd; ===== net/ipv6/ah6.c 1.41 vs edited ===== --- 1.41/net/ipv6/ah6.c 2004-08-22 15:00:07 +10:00 +++ edited/net/ipv6/ah6.c 2005-01-21 21:04:45 +11:00 @@ -375,7 +375,7 @@ * we need for AH processing. This lookup cannot fail here * after a successful crypto_alloc_tfm(). */ - aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name); + aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name, 0); BUG_ON(!aalg_desc); if (aalg_desc->uinfo.auth.icv_fullbits/8 != ===== net/ipv6/esp6.c 1.37 vs edited ===== --- 1.37/net/ipv6/esp6.c 2004-08-22 15:00:07 +10:00 +++ edited/net/ipv6/esp6.c 2005-01-21 21:04:48 +11:00 @@ -329,7 +329,7 @@ goto error; esp->auth.icv = esp_hmac_digest; - aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name); + aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name, 0); BUG_ON(!aalg_desc); if (aalg_desc->uinfo.auth.icv_fullbits/8 != ===== net/ipv6/ipcomp6.c 1.19 vs edited ===== --- 1.19/net/ipv6/ipcomp6.c 2004-09-11 07:36:51 +10:00 +++ edited/net/ipv6/ipcomp6.c 2005-01-21 21:04:51 +11:00 @@ -468,7 +468,7 @@ goto error_tunnel; } - calg_desc = xfrm_calg_get_byname(x->calg->alg_name); + calg_desc = xfrm_calg_get_byname(x->calg->alg_name, 0); BUG_ON(!calg_desc); ipcd->threshold = calg_desc->uinfo.comp.threshold; x->data = ipcd; ===== net/xfrm/xfrm_algo.c 1.15 vs edited ===== --- 1.15/net/xfrm/xfrm_algo.c 2004-12-28 13:33:32 +11:00 +++ edited/net/xfrm/xfrm_algo.c 2005-01-21 21:17:12 +11:00 @@ -13,6 +13,7 @@ #include #include #include +#include #include #if defined(CONFIG_INET_AH) || defined(CONFIG_INET_AH_MODULE) || defined(CONFIG_INET6_AH) || defined(CONFIG_INET6_AH_MODULE) #include @@ -346,58 +347,48 @@ return NULL; } -struct xfrm_algo_desc *xfrm_aalg_get_byname(char *name) +static struct xfrm_algo_desc *xfrm_get_byname(struct xfrm_algo_desc *list, + int entries, char *name, + int probe) { - int i; + int i, status; if (!name) return NULL; - for (i=0; i < aalg_entries(); i++) { - if (strcmp(name, aalg_list[i].name) == 0) { - if (aalg_list[i].available) - return &aalg_list[i]; - else - break; - } + for (i = 0; i < entries; i++) { + if (!strcmp(name, list[i].name)) + continue; + + if (list[i].available) + return &list[i]; + + if (!probe) + break; + + status = crypto_alg_available(name, 0); + if (!status) + break; + + list[i].available = status; + return &list[i]; } return NULL; } -struct xfrm_algo_desc *xfrm_ealg_get_byname(char *name) +struct xfrm_algo_desc *xfrm_aalg_get_byname(char *name, int probe) { - int i; - - if (!name) - return NULL; - - for (i=0; i < ealg_entries(); i++) { - if (strcmp(name, ealg_list[i].name) == 0) { - if (ealg_list[i].available) - return &ealg_list[i]; - else - break; - } - } - return NULL; + return xfrm_get_byname(aalg_list, aalg_entries(), name, probe); } -struct xfrm_algo_desc *xfrm_calg_get_byname(char *name) +struct xfrm_algo_desc *xfrm_ealg_get_byname(char *name, int probe) { - int i; - - if (!name) - return NULL; + return xfrm_get_byname(ealg_list, ealg_entries(), name, probe); +} - for (i=0; i < calg_entries(); i++) { - if (strcmp(name, calg_list[i].name) == 0) { - if (calg_list[i].available) - return &calg_list[i]; - else - break; - } - } - return NULL; +struct xfrm_algo_desc *xfrm_calg_get_byname(char *name, int probe) +{ + return xfrm_get_byname(calg_list, calg_entries(), name, probe); } struct xfrm_algo_desc *xfrm_aalg_get_byidx(unsigned int idx) ===== net/xfrm/xfrm_user.c 1.51 vs edited ===== --- 1.51/net/xfrm/xfrm_user.c 2004-12-28 13:33:32 +11:00 +++ edited/net/xfrm/xfrm_user.c 2005-01-21 21:05:50 +11:00 @@ -156,7 +156,7 @@ } static int attach_one_algo(struct xfrm_algo **algpp, u8 *props, - struct xfrm_algo_desc *(*get_byname)(char *), + struct xfrm_algo_desc *(*get_byname)(char *, int), struct rtattr *u_arg) { struct rtattr *rta = u_arg; @@ -168,7 +168,7 @@ ualg = RTA_DATA(rta); - algo = get_byname(ualg->alg_name); + algo = get_byname(ualg->alg_name, 1); if (!algo) return -ENOSYS; *props = algo->desc.sadb_alg_id; @@ -272,8 +272,6 @@ err = verify_newsa_info(p, (struct rtattr **) xfrma); if (err) return err; - - xfrm_probe_algs(); x = xfrm_state_construct(p, (struct rtattr **) xfrma, &err); if (!x) --G4iJoqBmSsgzjUCe-- From herbert@gondor.apana.org.au Fri Jan 21 02:23:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 02:23:39 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LANXQF014566 for ; Fri, 21 Jan 2005 02:23:33 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1Crvws-0001YY-00; Fri, 21 Jan 2005 21:23:26 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1Crvwl-0001Cl-00; Fri, 21 Jan 2005 21:23:19 +1100 Date: Fri, 21 Jan 2005 21:23:19 +1100 To: "David S. Miller" , netdev@oss.sgi.com Subject: [IPSEC] Stop using dst->xfrm Message-ID: <20050121102319.GA3160@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="82I3+IH0IqGh5yIs" Content-Disposition: inline User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 604 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Dave: Here is a precursor to the xfrm dst consolidation that I talked about. In order to be able to store multiple SAs in one dst, we need to stop using dst->xfrm directly. The following patch does that for the ->output() functions. Signed-off-by: Herbert Xu -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="xfrm.patch" ===== include/net/xfrm.h 1.73 vs edited ===== --- 1.73/include/net/xfrm.h 2004-12-28 14:49:57 +11:00 +++ edited/include/net/xfrm.h 2005-01-21 11:10:16 +11:00 @@ -212,7 +212,7 @@ void (*destructor)(struct xfrm_state *); int (*input)(struct xfrm_state *, struct xfrm_decap_state *, struct sk_buff *skb); int (*post_input)(struct xfrm_state *, struct xfrm_decap_state *, struct sk_buff *skb); - int (*output)(struct sk_buff *pskb); + int (*output)(struct xfrm_state *, struct sk_buff *pskb); /* Estimate maximal size of result of transformation of a dgram */ u32 (*get_max_size)(struct xfrm_state *, int size); }; ===== net/ipv4/ah4.c 1.40 vs edited ===== --- 1.40/net/ipv4/ah4.c 2004-08-22 15:00:07 +10:00 +++ edited/net/ipv4/ah4.c 2005-01-21 11:10:27 +11:00 @@ -53,11 +53,9 @@ return 0; } -static int ah_output(struct sk_buff *skb) +static int ah_output(struct xfrm_state *x, struct sk_buff *skb) { int err; - struct dst_entry *dst = skb->dst; - struct xfrm_state *x = dst->xfrm; struct iphdr *iph, *top_iph; struct ip_auth_hdr *ah; struct ah_data *ahp; ===== net/ipv4/esp4.c 1.54 vs edited ===== --- 1.54/net/ipv4/esp4.c 2004-08-22 15:00:07 +10:00 +++ edited/net/ipv4/esp4.c 2005-01-21 11:11:30 +11:00 @@ -17,11 +17,9 @@ __u8 proto; }; -static int esp_output(struct sk_buff *skb) +static int esp_output(struct xfrm_state *x, struct sk_buff *skb) { int err; - struct dst_entry *dst = skb->dst; - struct xfrm_state *x = dst->xfrm; struct iphdr *top_iph; struct ip_esp_hdr *esph; struct crypto_tfm *tfm; ===== net/ipv4/ipcomp.c 1.30 vs edited ===== --- 1.30/net/ipv4/ipcomp.c 2004-09-11 07:36:51 +10:00 +++ edited/net/ipv4/ipcomp.c 2005-01-21 11:11:37 +11:00 @@ -154,11 +154,9 @@ return err; } -static int ipcomp_output(struct sk_buff *skb) +static int ipcomp_output(struct xfrm_state *x, struct sk_buff *skb) { int err; - struct dst_entry *dst = skb->dst; - struct xfrm_state *x = dst->xfrm; struct iphdr *iph; struct ip_comp_hdr *ipch; struct ipcomp_data *ipcd = x->data; ===== net/ipv4/xfrm4_output.c 1.5 vs edited ===== --- 1.5/net/ipv4/xfrm4_output.c 2004-10-26 09:10:25 +10:00 +++ edited/net/ipv4/xfrm4_output.c 2005-01-21 11:12:23 +11:00 @@ -116,7 +116,7 @@ xfrm4_encap(skb); - err = x->type->output(skb); + err = x->type->output(x, skb); if (err) goto error; ===== net/ipv4/xfrm4_tunnel.c 1.18 vs edited ===== --- 1.18/net/ipv4/xfrm4_tunnel.c 2004-08-21 06:54:06 +10:00 +++ edited/net/ipv4/xfrm4_tunnel.c 2005-01-21 11:12:43 +11:00 @@ -9,7 +9,7 @@ #include #include -static int ipip_output(struct sk_buff *skb) +static int ipip_output(struct xfrm_state *x, struct sk_buff *skb) { struct iphdr *iph; ===== net/ipv6/ah6.c 1.41 vs edited ===== --- 1.41/net/ipv6/ah6.c 2004-08-22 15:00:07 +10:00 +++ edited/net/ipv6/ah6.c 2005-01-21 11:14:03 +11:00 @@ -154,12 +154,10 @@ return 0; } -static int ah6_output(struct sk_buff *skb) +static int ah6_output(struct xfrm_state *x, struct sk_buff *skb) { int err; int extlen; - struct dst_entry *dst = skb->dst; - struct xfrm_state *x = dst->xfrm; struct ipv6hdr *top_iph; struct ip_auth_hdr *ah; struct ah_data *ahp; ===== net/ipv6/esp6.c 1.37 vs edited ===== --- 1.37/net/ipv6/esp6.c 2004-08-22 15:00:07 +10:00 +++ edited/net/ipv6/esp6.c 2005-01-21 11:14:13 +11:00 @@ -37,12 +37,10 @@ #include #include -static int esp6_output(struct sk_buff *skb) +static int esp6_output(struct xfrm_state *x, struct sk_buff *skb) { int err; int hdr_len; - struct dst_entry *dst = skb->dst; - struct xfrm_state *x = dst->xfrm; struct ipv6hdr *top_iph; struct ipv6_esp_hdr *esph; struct crypto_tfm *tfm; ===== net/ipv6/ipcomp6.c 1.19 vs edited ===== --- 1.19/net/ipv6/ipcomp6.c 2004-09-11 07:36:51 +10:00 +++ edited/net/ipv6/ipcomp6.c 2005-01-21 11:14:29 +11:00 @@ -139,11 +139,9 @@ return err; } -static int ipcomp6_output(struct sk_buff *skb) +static int ipcomp6_output(struct xfrm_state *x, struct sk_buff *skb) { int err; - struct dst_entry *dst = skb->dst; - struct xfrm_state *x = dst->xfrm; struct ipv6hdr *top_iph; int hdr_len; struct ipv6_comp_hdr *ipch; ===== net/ipv6/xfrm6_output.c 1.7 vs edited ===== --- 1.7/net/ipv6/xfrm6_output.c 2004-11-16 13:52:34 +11:00 +++ edited/net/ipv6/xfrm6_output.c 2005-01-21 11:14:37 +11:00 @@ -116,7 +116,7 @@ xfrm6_encap(skb); - err = x->type->output(skb); + err = x->type->output(x, skb); if (err) goto error; ===== net/ipv6/xfrm6_tunnel.c 1.9 vs edited ===== --- 1.9/net/ipv6/xfrm6_tunnel.c 2005-01-14 15:41:06 +11:00 +++ edited/net/ipv6/xfrm6_tunnel.c 2005-01-21 11:14:47 +11:00 @@ -343,7 +343,7 @@ EXPORT_SYMBOL(xfrm6_tunnel_free_spi); -static int xfrm6_tunnel_output(struct sk_buff *skb) +static int xfrm6_tunnel_output(struct xfrm_state *x, struct sk_buff *skb) { struct ipv6hdr *top_iph; --82I3+IH0IqGh5yIs-- From buytenh@wantstofly.org Fri Jan 21 02:54:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 02:54:59 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LAsriX017430 for ; Fri, 21 Jan 2005 02:54:54 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id 996D92B0FB; Fri, 21 Jan 2005 11:54:52 +0100 (MET) Date: Fri, 21 Jan 2005 11:54:52 +0100 From: Lennert Buytenhek To: Stephen Hemminger Cc: "David S. Miller" , Roland Dreier , hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [PATCH]: was Re: LLTX and netif_stop_queue Message-ID: <20050121105452.GA12988@xi.wantstofly.org> References: <527jmu8nbw.fsf@topspin.com> <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119164640.6c67bdfa.davem@davemloft.net> <52r7kgu5n5.fsf@topspin.com> <20050119230526.393a5184.davem@davemloft.net> <20050120085611.33f9485e@dxpl.pdx.osdl.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050120085611.33f9485e@dxpl.pdx.osdl.net> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 605 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev On Thu, Jan 20, 2005 at 08:56:11AM -0800, Stephen Hemminger wrote: > You might want to enforce that LLTX devices like tunnels need to > have no transmit queue (tx_queue_len == 0)? I didn't look at the original LLTX patch, so I'm speaking out of ignorance, but since we're on this subject anyway: I noticed that the ip_gre tunneling driver contains this comment: 1. The most important issue is detecting local dead loops. They would cause complete host lockup in transmit, which would be "resolved" by stack overflow or, if queueing is enabled, with infinite looping in net_bh. We cannot track such dead loops during route installation, it is infeasible task. The most general solutions would be to keep skb->encapsulation counter (sort of local ttl), and silently drop packet when it expires. It is the best solution, but it supposes maintaing new variable in ALL skb, even if no tunneling is used. Current solution: t->recursion lock breaks dead loops. It looks like dev->tbusy flag, but I preferred new variable, because the semantics is different. One day, when hard_start_xmit will be multithreaded we will have to use skb->encapsulation. If multiple CPUs can call into the tunneling drivers without taking any locks, we'd need some extra locking in there, or just do what Alexey describes and keep track of recursion in the skb. The recursion detection in dev_queue_xmit would perhaps also want to use such a per-skb mechanism instead of using dev->xmit_lock_owner. (You really _do_ want the protection that this mechanism offers.) --L From jmorris@redhat.com Fri Jan 21 06:03:52 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 06:03:58 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LE3p6q025690 for ; Fri, 21 Jan 2005 06:03:52 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j0LE1gtj020848; Fri, 21 Jan 2005 09:01:42 -0500 Received: from mail.boston.redhat.com (mail.boston.redhat.com [172.16.76.12]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j0LE1gO13525; Fri, 21 Jan 2005 09:01:42 -0500 Received: from thoron.boston.redhat.com (thoron.boston.redhat.com [172.16.80.63]) by mail.boston.redhat.com (8.12.8/8.12.8) with ESMTP id j0LE1fp6010088; Fri, 21 Jan 2005 09:01:41 -0500 Date: Fri, 21 Jan 2005 09:01:41 -0500 (EST) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: Herbert Xu cc: "David S. Miller" , Subject: Re: [XFRM] Probe selected algorithm only In-Reply-To: <20050121101938.GA1133@gondor.apana.org.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 606 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jmorris@redhat.com Precedence: bulk X-list: netdev On Fri, 21 Jan 2005, Herbert Xu wrote: > Hi Dave: > > This patch removes an annoying problem in xfrm_user. As it is every > time an SA is added it probes every known algorithm in the universe. > Now if they all existed it would be OK. However, for the ones which > don't actually exist this causes multiple /sbin/modprobe processes to > be spawned which slows the system down when you're adding hundreds of > SAs. > > Since we know the type of algorithm required when we're adding a new > SA, we can get away with only probing the selected algorithms. This > is what the following patch does for xfrm_user. > > Signed-off-by: Herbert Xu Looks good to me. Signed-off-by: James Morris - James -- James Morris From Robert.Olsson@data.slu.se Fri Jan 21 07:23:41 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 07:23:45 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LFNdSn028770 for ; Fri, 21 Jan 2005 07:23:40 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0LFNZsG004912; Fri, 21 Jan 2005 16:23:35 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 1B408EE041; Fri, 21 Jan 2005 16:23:35 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16881.7799.47441.33803@robur.slu.se> Date: Fri, 21 Jan 2005 16:23:35 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501201114.49517.jeremy.guthrie@berbee.com> References: <200501200837.40734.jeremy.guthrie@berbee.com> <16879.58333.266843.335475@robur.slu.se> <200501201114.49517.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 607 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev We have to understand the GC details to 100% confident. Some time to digest and a may reboot help. I also mentioned routing without the route hash. No spinning in route hash and no GC but we trade this for doing a fib lookup for every packet. Jamal and I started to play with this at last OLS but it's only tested in lab sofar. For environments with small number of flows it's probably not a good idea Length of flows is of course also important. No idea about the result in your case. I have a patch: ftp:/robur.slu.se:/pub/Linux/net-development/preroute/preroute10.pat If you feel very brave you can test this. The files to monitor is /proc/net/softnet_stat this verify the new packet path. With rtstat (tot) should show all routed packets. The rate in pps we are able to achieve. --ro From rick.jones2@hp.com Fri Jan 21 11:01:06 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 11:01:19 -0800 (PST) Received: from palrel10.hp.com (palrel10.hp.com [156.153.255.245]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LJ121q007634 for ; Fri, 21 Jan 2005 11:01:06 -0800 Received: from tardy.cup.hp.com (tardy.cup.hp.com [15.244.44.58]) by palrel10.hp.com (Postfix) with ESMTP id 4D445180A for ; Fri, 21 Jan 2005 11:01:02 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by tardy.cup.hp.com (8.9.3 (PHNE_28810)/8.9.3 SMKit7.02) with ESMTP id LAA15815 for ; Fri, 21 Jan 2005 11:01:01 -0800 (PST) Message-ID: <41F1516D.5010101@hp.com> Date: Fri, 21 Jan 2005 11:01:01 -0800 From: Rick Jones User-Agent: Mozilla/5.0 (X11; U; HP-UX 9000/785; en-US; rv:1.7.3) Gecko/20041206 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: on the wire behaviour of TSO on/off is supposed to be the same yes? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 608 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rick.jones2@hp.com Precedence: bulk X-list: netdev Is it indeed supposed to be the case that the on the wire behaviour of TCP with TSO on/off is supposed to be the same? I'm seeing some cases (netperf TCP_STREAM 2.6.10 sending to HP-UX 11.23) where the throughput differences are >= 10 MB/s on an e1000 card (TSO being slower). I've got lots of netperf and tcpdump but thought I'd ask first before dumping it onto the list. Actually, i'll probably have to put it up on the net somewhere since it is O(200MB) in total (although I have a smaller point example). sincerely, rick jones From jdmason@us.ibm.com Fri Jan 21 12:00:33 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 12:00:38 -0800 (PST) Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.132]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LK0Xet010667 for ; Fri, 21 Jan 2005 12:00:33 -0800 Received: from westrelay01.boulder.ibm.com (westrelay01.boulder.ibm.com [9.17.195.10]) by e34.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j0LK0RaQ451222 for ; Fri, 21 Jan 2005 15:00:27 -0500 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by westrelay01.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j0LK0RtN331494 for ; Fri, 21 Jan 2005 13:00:27 -0700 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j0LK0QjJ027029 for ; Fri, 21 Jan 2005 13:00:27 -0700 Received: from dreadnought.austin.ibm.com (dreadnought.austin.ibm.com [9.41.94.123]) by d03av01.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j0LK0QAK026993; Fri, 21 Jan 2005 13:00:26 -0700 From: Jon Mason Organization: IBM To: Rick Jones Subject: Re: on the wire behaviour of TSO on/off is supposed to be the same yes? Date: Fri, 21 Jan 2005 13:58:53 -0600 User-Agent: KMail/1.7.2 Cc: netdev@oss.sgi.com References: <41F1516D.5010101@hp.com> In-Reply-To: <41F1516D.5010101@hp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501211358.53783.jdmason@us.ibm.com> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 609 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jdmason@us.ibm.com Precedence: bulk X-list: netdev The benefit of TSO is not throughput, but CPU utilization. Throughput increase is usually a side effect because of better PCI DMA behavior (eg. large PCI transfers are better). Are you seeing a CPU utilization decrease? On Friday 21 January 2005 01:01 pm, Rick Jones wrote: > Is it indeed supposed to be the case that the on the wire behaviour of TCP with > TSO on/off is supposed to be the same? I'm seeing some cases (netperf > TCP_STREAM 2.6.10 sending to HP-UX 11.23) where the throughput differences are > >= 10 MB/s on an e1000 card (TSO being slower). I've got lots of netperf and > tcpdump but thought I'd ask first before dumping it onto the list. Actually, > i'll probably have to put it up on the net somewhere since it is O(200MB) in > total (although I have a smaller point example). > > sincerely, > > rick jones > > > -- Jon Mason jdmason@us.ibm.com From rick.jones2@hp.com Fri Jan 21 12:20:05 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 12:20:10 -0800 (PST) Received: from palrel11.hp.com (palrel11.hp.com [156.153.255.246]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LKK5ie015082 for ; Fri, 21 Jan 2005 12:20:05 -0800 Received: from tardy.cup.hp.com (tardy.cup.hp.com [15.244.44.58]) by palrel11.hp.com (Postfix) with ESMTP id 2486D5EABD for ; Fri, 21 Jan 2005 12:18:53 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by tardy.cup.hp.com (8.9.3 (PHNE_28810)/8.9.3 SMKit7.02) with ESMTP id MAA16166 for ; Fri, 21 Jan 2005 12:18:53 -0800 (PST) Message-ID: <41F163AD.5070400@hp.com> Date: Fri, 21 Jan 2005 12:18:53 -0800 From: Rick Jones User-Agent: Mozilla/5.0 (X11; U; HP-UX 9000/785; en-US; rv:1.7.3) Gecko/20041206 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: Re: on the wire behaviour of TSO on/off is supposed to be the same yes? References: <41F1516D.5010101@hp.com> <200501211358.53783.jdmason@us.ibm.com> In-Reply-To: <200501211358.53783.jdmason@us.ibm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 610 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rick.jones2@hp.com Precedence: bulk X-list: netdev Jon Mason wrote: > The benefit of TSO is not throughput, but CPU utilization. Throughput > increase is usually a side effect because of better PCI DMA behavior (eg. > large PCI transfers are better). I'm not looking for a throughput increase, the systems involved are already capable of link-rate without TSO, just looking for throughput to not drop with TSO. If it were a throughput drop because the NIC CPU (bletch) saturated that would be one thing (such as happened with Tigon2 in another context) but this drop stems from what appears to be not filling cwnd and getting acks delayed by a timer. > Are you seeing a CPU utilization decrease? Yes, at the cost of occasional pauses in the data stream. TSO is on TCP STREAM TEST to 192.168.13.1 Recv Send Send Utilization Service Demand Socket Socket Message Elapsed Send Recv Send Recv Size Size Size Time Throughput local remote local remote bytes bytes bytes secs. 10^6bits/s % S % U us/KB us/KB 131072 262142 262142 10.00 843.86 12.77 -1.00 2.480 -1.000 TSO is off TCP STREAM TEST to 192.168.13.1 Recv Send Send Utilization Service Demand Socket Socket Message Elapsed Send Recv Send Recv Size Size Size Time Throughput local remote local remote bytes bytes bytes secs. 10^6bits/s % S % U us/KB us/KB 131072 262142 262142 10.00 941.13 22.82 -1.00 3.972 -1.000 This is with tcp_tso_win_divisor set to 1 so TSO kicks-in before 200some-oddK are transfered. The service demand drop (modulo the accuracy of CPU util measurements via the -DUSE_PROC_STAT stuff) is rather nice. rick jones subscribed, so mail to netdev will reach me - no need for separate cc From davem@davemloft.net Fri Jan 21 12:47:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 12:47:07 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LKl19r015927 for ; Fri, 21 Jan 2005 12:47:02 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cs5e5-0007sJ-00; Fri, 21 Jan 2005 12:44:41 -0800 Date: Fri, 21 Jan 2005 12:44:41 -0800 From: "David S. Miller" To: Rick Jones Cc: netdev@oss.sgi.com Subject: Re: on the wire behaviour of TSO on/off is supposed to be the same yes? Message-Id: <20050121124441.76cbbfb9.davem@davemloft.net> In-Reply-To: <41F163AD.5070400@hp.com> References: <41F1516D.5010101@hp.com> <200501211358.53783.jdmason@us.ibm.com> <41F163AD.5070400@hp.com> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 611 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Fri, 21 Jan 2005 12:18:53 -0800 Rick Jones wrote: > This is with tcp_tso_win_divisor set to 1 so TSO kicks-in before 200some-oddK > are transfered. The service demand drop (modulo the accuracy of CPU util > measurements via the -DUSE_PROC_STAT stuff) is rather nice. Don't set tcp_tso_win_divisor to such a low value, that's why TCP is being so bursty in your case. The default value of "8" keeps TCP reasonable well ACK clocked, thus avoiding the throughput lossage you are seeing with it set to "1". With a value of "1", TCP will wait for the entire congestion window to be ACK'd before it will spit out a huge TSO frame. From domen@coderock.org Fri Jan 21 13:03:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 13:04:05 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LL3oQQ016679 for ; Fri, 21 Jan 2005 13:03:53 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id 4C9981F2D7; Fri, 21 Jan 2005 22:03:45 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 0EBB01F2D3; Fri, 21 Jan 2005 22:03:44 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 8C2871F2D4; Fri, 21 Jan 2005 22:03:40 +0100 (CET) Subject: [patch 2/3] net/tms380tr: replace direct assignment with set_current_state() To: netdev@oss.sgi.com Cc: domen@coderock.org, nacc@us.ibm.com, janitor@sternwelten.at From: domen@coderock.org Date: Fri, 21 Jan 2005 22:03:39 +0100 Message-Id: <20050121210340.8C2871F2D4@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 613 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Any comments would be appreciated. Description: Use set_current_state() instead of direct assignment of current->state. Signed-off-by: Nishanth Aravamudan Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/tokenring/tms380tr.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN drivers/net/tokenring/tms380tr.c~set_current_state-drivers_net_tokenring_tms380tr drivers/net/tokenring/tms380tr.c --- kj/drivers/net/tokenring/tms380tr.c~set_current_state-drivers_net_tokenring_tms380tr 2005-01-10 18:00:19.000000000 +0100 +++ kj-domen/drivers/net/tokenring/tms380tr.c 2005-01-10 18:00:19.000000000 +0100 @@ -1244,7 +1244,7 @@ void tms380tr_wait(unsigned long time) tmp = jiffies + time/(1000000/HZ); do { - current->state = TASK_INTERRUPTIBLE; + set_current_state(TASK_INTERRUPTIBLE); tmp = schedule_timeout(tmp); } while(time_after(tmp, jiffies)); #else _ From domen@coderock.org Fri Jan 21 13:03:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 13:04:06 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LL3ssT016695 for ; Fri, 21 Jan 2005 13:03:55 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id 98C281F2D5; Fri, 21 Jan 2005 22:03:48 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id BE3C01F2D3; Fri, 21 Jan 2005 22:03:47 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id DC2E81F2D2; Fri, 21 Jan 2005 22:03:43 +0100 (CET) Subject: [patch 3/3] net/lanstreamer: replace schedule_timeout() with ssleep()/msleep_interruptible() To: netdev@oss.sgi.com Cc: domen@coderock.org, nacc@us.ibm.com, janitor@sternwelten.at From: domen@coderock.org Date: Fri, 21 Jan 2005 22:03:43 +0100 Message-Id: <20050121210343.DC2E81F2D2@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 614 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Any comments would be appreciated. Description: Use ssleep() / msleep_interruptible() [as appropriate] instead of schedule_timeout() to guarantee the task delays as expected. Signed-off-by: Nishanth Aravamudan Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/tokenring/lanstreamer.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff -puN drivers/net/tokenring/lanstreamer.c~ssleep+msleep_interruptible-drivers_net_tokenring_lanstreamer drivers/net/tokenring/lanstreamer.c --- kj/drivers/net/tokenring/lanstreamer.c~ssleep+msleep_interruptible-drivers_net_tokenring_lanstreamer 2005-01-10 18:00:21.000000000 +0100 +++ kj-domen/drivers/net/tokenring/lanstreamer.c 2005-01-10 18:00:21.000000000 +0100 @@ -454,8 +454,7 @@ static int streamer_reset(struct net_dev writew(readw(streamer_mmio + BCTL) | BCTL_SOFTRESET, streamer_mmio + BCTL); t = jiffies; /* Hold soft reset bit for a while */ - current->state = TASK_UNINTERRUPTIBLE; - schedule_timeout(HZ); + ssleep(1); writew(readw(streamer_mmio + BCTL) & ~BCTL_SOFTRESET, streamer_mmio + BCTL); @@ -511,8 +510,7 @@ static int streamer_reset(struct net_dev writew(SISR_MI, streamer_mmio + SISR_MASK_SUM); while (!((readw(streamer_mmio + SISR)) & SISR_SRB_REPLY)) { - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(HZ/10); + msleep_interruptible(100); if (jiffies - t > 40 * HZ) { printk(KERN_ERR "IBM PCI tokenring card not responding\n"); _ From domen@coderock.org Fri Jan 21 13:03:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 13:04:04 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LL3o4b016678 for ; Fri, 21 Jan 2005 13:03:53 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id C71251F2D6; Fri, 21 Jan 2005 22:03:41 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 4E3E81F2D3; Fri, 21 Jan 2005 22:03:40 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 47D191F2D2; Fri, 21 Jan 2005 22:03:37 +0100 (CET) Subject: [patch 1/3] net/ibmtr: replace schedule_timeout() with msleep()/msleep_interruptible() To: netdev@oss.sgi.com Cc: domen@coderock.org, nacc@us.ibm.com, janitor@sternwelten.at From: domen@coderock.org Date: Fri, 21 Jan 2005 22:03:35 +0100 Message-Id: <20050121210337.47D191F2D2@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 612 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Any comments would be appreciated. Description: Use msleep() / msleep_interruptible() [as appropriate] instead of schedule_timeout() to guarantee the task delays as expected. Signed-off-by: Nishanth Aravamudan Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/tokenring/ibmtr.c | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff -puN drivers/net/tokenring/ibmtr.c~msleep+msleep_interruptible-drivers_net_tokenring_ibmtr drivers/net/tokenring/ibmtr.c --- kj/drivers/net/tokenring/ibmtr.c~msleep+msleep_interruptible-drivers_net_tokenring_ibmtr 2005-01-10 18:00:13.000000000 +0100 +++ kj-domen/drivers/net/tokenring/ibmtr.c 2005-01-10 18:00:13.000000000 +0100 @@ -108,6 +108,7 @@ in the event that chatty debug messages #define IBMTR_DEBUG_MESSAGES 0 #include +#include #ifdef PCMCIA /* required for ibmtr_cs.c to build */ #undef MODULE /* yes, really */ @@ -317,7 +318,7 @@ static void ibmtr_cleanup_card(struct ne if (dev->base_addr) { outb(0,dev->base_addr+ADAPTRESET); - schedule_timeout(TR_RST_TIME); /* wait 50ms */ + msleep(jiffies_to_msecs(TR_RST_TIME)); /* wait 50ms */ outb(0,dev->base_addr+ADAPTRESETREL); } @@ -858,8 +859,7 @@ static int tok_init_card(struct net_devi writeb(~INT_ENABLE, ti->mmio + ACA_OFFSET + ACA_RESET + ISRP_EVEN); outb(0, PIOaddr + ADAPTRESET); - current->state=TASK_UNINTERRUPTIBLE; - schedule_timeout(TR_RST_TIME); /* wait 50ms */ + msleep(jiffies_to_msecs(TR_RST_TIME)); /* wait 50ms */ outb(0, PIOaddr + ADAPTRESETREL); #ifdef ENABLE_PAGING @@ -912,9 +912,8 @@ static int tok_open(struct net_device *d DPRINTK("Adapter is up and running\n"); return 0; } - current->state=TASK_INTERRUPTIBLE; - i=schedule_timeout(TR_RETRY_INTERVAL); /* wait 30 seconds */ - if(i!=0) break; /*prob. a signal, like the i>24*HZ case above */ + if(msleep_interruptible(jiffies_to_msecs(TR_RETRY_INTERVAL))) + break; /*prob. a signal, like the i>24*HZ case above */ } outb(0, dev->base_addr + ADAPTRESET);/* kill pending interrupts*/ DPRINTK("TERMINATED via signal\n"); /*BMS useful */ _ From jeremy.guthrie@berbee.com Fri Jan 21 13:20:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 13:20:42 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LLKYAo018431 for ; Fri, 21 Jan 2005 13:20:35 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Fri, 21 Jan 2005 15:20:28 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Fri, 21 Jan 2005 15:20:27 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson References: <200501201114.49517.jeremy.guthrie@berbee.com> <16880.10330.49064.721090@robur.slu.se> In-Reply-To: <16880.10330.49064.721090@robur.slu.se> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501211520.28409.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 21 Jan 2005 21:20:28.0925 (UTC) FILETIME=[08011AD0:01C4FFFF] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 615 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev On Thursday 20 January 2005 03:53 pm, Robert Olsson wrote: > Jeremy M. Guthrie writes: > > > > mc GC: tot ignored goal_miss ovrf HASH: in_search out_search > > > > 524287 74830 777 0 0 0 0 0 6 > > > > 0 0 498 0 0 0 40504 1 > > > > When does GC normally ignore? > > At a min ip_rt_gc_min_interval = HZ / 2; > > From what I understand your GC runs more often than that. > Do your understand? Test is in rt_garbage_collect() I'll look in the function and let you know if I have any questions. Thanks -- -------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 From jeremy.guthrie@berbee.com Fri Jan 21 13:24:27 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 13:24:34 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LLORP1018952 for ; Fri, 21 Jan 2005 13:24:27 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Fri, 21 Jan 2005 15:24:22 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Fri, 21 Jan 2005 15:24:19 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson References: <200501201114.49517.jeremy.guthrie@berbee.com> <16881.7799.47441.33803@robur.slu.se> In-Reply-To: <16881.7799.47441.33803@robur.slu.se> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501211524.21364.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 21 Jan 2005 21:24:22.0081 (UTC) FILETIME=[92F9E310:01C4FFFF] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 616 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev On Friday 21 January 2005 09:23 am, Robert Olsson wrote: > We have to understand the GC details to 100% confident. Some time to digest > and a may reboot help. > I also mentioned routing without the route hash. No spinning in route > hash and no GC but we trade this for doing a fib lookup for every packet. > Jamal and I started to play with this at last OLS but it's only tested > in lab sofar. I'd like to hold off on that right now. Things are running pretty good right now. I'm trying to get my hands on a 'test' system to run side-by-side with the production system. We go live Feb 1 with our app so I need to start toning down some of the down time. > For environments with small number of flows it's probably not a good idea > Length of flows is of course also important. No idea about the result in > your case. > > I have a patch: > > ftp:/robur.slu.se:/pub/Linux/net-development/preroute/preroute10.pat > > If you feel very brave you can test this. The files to monitor is > /proc/net/softnet_stat this verify the new packet path. > > With rtstat (tot) should show all routed packets. The rate in pps > we are able to achieve. I actually think I could have our other test system ready early next week. I'll let you know. Have a good weekend. -- -------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 From rick.jones2@hp.com Fri Jan 21 14:00:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 14:00:36 -0800 (PST) Received: from palrel13.hp.com (palrel13.hp.com [156.153.255.238]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LM0U9w019931 for ; Fri, 21 Jan 2005 14:00:31 -0800 Received: from tardy.cup.hp.com (tardy.cup.hp.com [15.244.44.58]) by palrel13.hp.com (Postfix) with ESMTP id C4AB61C2E5C7 for ; Fri, 21 Jan 2005 14:00:30 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by tardy.cup.hp.com (8.9.3 (PHNE_28810)/8.9.3 SMKit7.02) with ESMTP id OAA16705 for ; Fri, 21 Jan 2005 14:00:30 -0800 (PST) Message-ID: <41F17B7E.2020002@hp.com> Date: Fri, 21 Jan 2005 14:00:30 -0800 From: Rick Jones User-Agent: Mozilla/5.0 (X11; U; HP-UX 9000/785; en-US; rv:1.7.3) Gecko/20041206 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: Re: on the wire behaviour of TSO on/off is supposed to be the same yes? References: <41F1516D.5010101@hp.com> <200501211358.53783.jdmason@us.ibm.com> <41F163AD.5070400@hp.com> <20050121124441.76cbbfb9.davem@davemloft.net> In-Reply-To: <20050121124441.76cbbfb9.davem@davemloft.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 617 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rick.jones2@hp.com Precedence: bulk X-list: netdev David S. Miller wrote: > Don't set tcp_tso_win_divisor to such a low value, that's why > TCP is being so bursty in your case. The default value > of "8" keeps TCP reasonable well ACK clocked, thus avoiding > the throughput lossage you are seeing with it set to "1". If my only interest were bulk throughput then that would be fine, but I'm also concerned about shorter lived, request/response sorts of workloads. The netperf TCP_STREAM test was simply a convenient vehicle. If it would be better, I could switch to a different netperf test. > With a value of "1", TCP will wait for the entire congestion > window to be ACK'd before it will spit out a huge TSO frame. It looks though like it then is not spitting-out a full congestion window. Here is the openeing from the TSO on case: 000031 IP 192.168.13.223.33287 > 192.168.13.1.64632: S 2243249440:2243249440(0) win 5840 000095 IP 192.168.13.1.64632 > 192.168.13.223.33287: S 3684332982:3684332982(0) ack 2243249441 win 65535 000014 IP 192.168.13.223.33287 > 192.168.13.1.64632: . ack 1 win 1460 000118 IP 192.168.13.223.33287 > 192.168.13.1.64632: . 1:4345(4344) ack 1 win 1460 000117 IP 192.168.13.1.64632 > 192.168.13.223.33287: . ack 1449 win 32768 000002 IP 192.168.13.1.64632 > 192.168.13.223.33287: . ack 4345 win 32768 000248 IP 192.168.13.223.33287 > 192.168.13.1.64632: . 4345:8689(4344) ack 1 win 1460 Indeed, it waited for the ACK 4335, but then shouldn't it have emitted 4344+1448 or 5792 bytes or perhaps 7240 (since there were two ACKs? (this is a hacked tcpdump to treat an IP length field of zero as a TSO segment and use the other reported length - a patch went to tcpdump-workers, not sure if they will like it or not...) In the TSO off case it does send a full cwnd: 000031 IP 192.168.13.223.33289 > 192.168.13.1.64633: S 2252401705:2252401705(0) win 5840 000099 IP 192.168.13.1.64633 > 192.168.13.223.33289: S 3685848941:3685848941(0) ack 2252401706 win 65535 000014 IP 192.168.13.223.33289 > 192.168.13.1.64633: . ack 1 win 1460 000080 IP 192.168.13.223.33289 > 192.168.13.1.64633: . 1:1449(1448) ack 1 win 1460 000009 IP 192.168.13.223.33289 > 192.168.13.1.64633: . 1449:2897(1448) ack 1 win 1460 000010 IP 192.168.13.223.33289 > 192.168.13.1.64633: . 2897:4345(1448) ack 1 win 1460 000145 IP 192.168.13.1.64633 > 192.168.13.223.33289: . ack 1449 win 32768 000001 IP 192.168.13.1.64633 > 192.168.13.223.33289: . ack 4345 win 32768 000190 IP 192.168.13.223.33289 > 192.168.13.1.64633: . 4345:5793(1448) ack 1 win 1460 000006 IP 192.168.13.223.33289 > 192.168.13.1.64633: . 5793:7241(1448) ack 1 win 1460 000013 IP 192.168.13.223.33289 > 192.168.13.1.64633: . 7241:8689(1448) ack 1 win 1460 000005 IP 192.168.13.223.33289 > 192.168.13.1.64633: . 8689:10137(1448) ack 1 win 1460 000004 IP 192.168.13.223.33289 > 192.168.13.1.64633: . 10137:11585(1448) ack 1 win 1460 Given the relative timestamps (tcpdump -ttt... taken on the sender) it _seems_ that even in the TSO-off case it was waiting for the full cwnd to be ACKed, buth then once ACKed, it send the full 5 segment cwnd. (Although that seeming to wait would really need to be confirmed by an intra-stack trace I suppose...) rick jones From davem@davemloft.net Fri Jan 21 14:20:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 14:20:51 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LMKjoV020917 for ; Fri, 21 Jan 2005 14:20:45 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cs76i-0008CR-00; Fri, 21 Jan 2005 14:18:20 -0800 Date: Fri, 21 Jan 2005 14:18:20 -0800 From: "David S. Miller" To: Rick Jones Cc: netdev@oss.sgi.com Subject: Re: on the wire behaviour of TSO on/off is supposed to be the same yes? Message-Id: <20050121141820.7d59a2d1.davem@davemloft.net> In-Reply-To: <41F17B7E.2020002@hp.com> References: <41F1516D.5010101@hp.com> <200501211358.53783.jdmason@us.ibm.com> <41F163AD.5070400@hp.com> <20050121124441.76cbbfb9.davem@davemloft.net> <41F17B7E.2020002@hp.com> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 618 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Fri, 21 Jan 2005 14:00:30 -0800 Rick Jones wrote: > Indeed, it waited for the ACK 4335, but then shouldn't it have emitted 4344+1448 or 5792 bytes or perhaps 7240 (since there were two > ACKs? The tcp_tso_win_divisor calculation occurs on the congestion window at the time of the user request, not at the time of the ACK. That's an interesting observation actually, thanks for showing it. It means that ideally we might want to try and find a way to either: 1) defer the TSO window size calculation to some later moment, ie. at tcp_write_xmit() time 2) use an optimistic TSO size calculation at the same moment we compute it now, and later if it is found to be too aggressive we chop up the TSO frame and resegment the transmit queue to accomodate Neither is easy to implement as far as I can tell, but it should fix all the problems IBM and others are trying to work around by setting the tcp_tso_win_divisor really small. From davem@davemloft.net Fri Jan 21 14:37:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 14:37:31 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LMbOhl021744 for ; Fri, 21 Jan 2005 14:37:25 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cs7Mt-0008Gq-00; Fri, 21 Jan 2005 14:35:03 -0800 Date: Fri, 21 Jan 2005 14:35:02 -0800 From: "David S. Miller" To: David Dillow Cc: netdev@oss.sgi.com, dave@thedillows.org Subject: Re: [RFC 2.6.10 0/22] Add hardware assist for IPSEC crypto Message-Id: <20050121143502.69c160cc.davem@davemloft.net> In-Reply-To: <20041230035000.01@ori.thedillows.org> References: <20041230035000.01@ori.thedillows.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 619 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Thu, 30 Dec 2004 03:48:34 -0500 David Dillow wrote: > Bandwidth tests > > Config (sender -> receiver) Bandwidth ori CPU tank CPU > No IPSEC (tank->ori) 11494 KB/s 11.9% 18.7% > No IPSEC (ori->tank) 11492 KB/s 9.5% 34.3% > > AH/SHA1 (sw) (tank->ori) 11303 KB/s 29.2% 79.3% > AH/SHA1 (sw) (ori->tank) 11302 KB/s 28.6% 91.1% > ESP/3DES,SHA1 (sw) (tank->ori) 2130 KB/s 29.6% 100% > ESP/3DES,SHA1 (sw) (ori->tank) 2263 KB/s 29.3% 99.7% > ESP-AH/3DES,SHA1-SHA1 (sw) (tank->ori) 1906 KB/s 29.1% 100% > ESP-AH/3DES,SHA1-SHA1 (sw) (ori->tank) 2051 KB/s 29.3% 99.7% It's a shame we don't have an assembler optimized 3DES at least for x86 in the crypto library of the kernel, even if just for tests such as this. I'll start reviewing your patches right now. From davem@davemloft.net Fri Jan 21 14:41:18 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 14:41:22 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LMfIVj022241 for ; Fri, 21 Jan 2005 14:41:18 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cs7Qf-0008HQ-00; Fri, 21 Jan 2005 14:38:57 -0800 Date: Fri, 21 Jan 2005 14:38:57 -0800 From: "David S. Miller" To: David Dillow Cc: netdev@oss.sgi.com, dave@thedillows.org Subject: Re: [RFC 2.6.10 1/22] xfrm: Add direction information to xfrm_state Message-Id: <20050121143857.69282605.davem@davemloft.net> In-Reply-To: <20041230035000.10@ori.thedillows.org> References: <20041230035000.01@ori.thedillows.org> <20041230035000.10@ori.thedillows.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 620 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Thu, 30 Dec 2004 03:48:34 -0500 David Dillow wrote: > # This is a BitKeeper generated diff -Nru style patch. > # > # ChangeSet > # 2004/12/30 00:27:15-05:00 dave@thedillows.org > # Add direction information to xfrm_state. This will be needed to > # offload xfrm processing to the NIC. And xfrm_state, when actually used, does not exist in a vacuum. It is being used in terms of a particular xfrm_policy which has a direction indicator already. Given that, it seems the xfrm_state is not only unnecessary, but also slightly illogical in fact. If you need the direction, you should make sure that at those places you can get back to the policy in order to obtain that piece of information. From davem@davemloft.net Fri Jan 21 14:43:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 14:43:11 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LMh7AV022764 for ; Fri, 21 Jan 2005 14:43:07 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cs7SP-0008Hl-00; Fri, 21 Jan 2005 14:40:45 -0800 Date: Fri, 21 Jan 2005 14:40:45 -0800 From: "David S. Miller" To: David Dillow Cc: netdev@oss.sgi.com, dave@thedillows.org Subject: Re: [RFC 2.6.10 2/22] xfrm: Add xfrm offload management calls to struct netdevice Message-Id: <20050121144045.74d30ef2.davem@davemloft.net> In-Reply-To: <20041230035000.11@ori.thedillows.org> References: <20041230035000.10@ori.thedillows.org> <20041230035000.11@ori.thedillows.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 621 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Thu, 30 Dec 2004 03:48:34 -0500 David Dillow wrote: > # This is a BitKeeper generated diff -Nru style patch. > # > # ChangeSet > # 2004/12/30 00:28:25-05:00 dave@thedillows.org > # Add the xfrm offload management calls to struct netdevice. > # > # xfrm_state_add() is called for inbound xfrm states > # xfrm_bundle_add() is called for outbound xfrm bundles > # xfrm_state_del() is called for all offloaded xfrms, > # inbound or outbound. > # > # If a driver adds NETIF_F_IPSEC to its features, it must > # provide all three callbacks. > # > # Signed-off-by: David Dillow I have no problems with this interface. In fact, just about whatever works for the card you have would be fine for an initial implementation. We know this interface will likely need to change over time so we should explicitly mark these callbacks as in a state of flux so that nobody who tries to play with this gets surprised when we tweak it. From herbert@gondor.apana.org.au Fri Jan 21 14:46:50 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 14:47:07 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LMklke023269 for ; Fri, 21 Jan 2005 14:46:48 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1Cs7Xn-0004tb-00; Sat, 22 Jan 2005 09:46:19 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1Cs7XG-0002GA-00; Sat, 22 Jan 2005 09:45:46 +1100 Date: Sat, 22 Jan 2005 09:45:46 +1100 To: James Morris Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [XFRM] Probe selected algorithm only Message-ID: <20050121224546.GA8654@gondor.apana.org.au> References: <20050121101938.GA1133@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Q68bSM7Ycu6FN28Q" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 622 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Jan 21, 2005 at 09:01:41AM -0500, James Morris wrote: > On Fri, 21 Jan 2005, Herbert Xu wrote: > > > This patch removes an annoying problem in xfrm_user. As it is every > > time an SA is added it probes every known algorithm in the universe. > > Now if they all existed it would be OK. However, for the ones which > > don't actually exist this causes multiple /sbin/modprobe processes to > > be spawned which slows the system down when you're adding hundreds of > > SAs. > > > > Since we know the type of algorithm required when we're adding a new > > SA, we can get away with only probing the selected algorithms. This > > is what the following patch does for xfrm_user. > > > > Signed-off-by: Herbert Xu > > Looks good to me. > > Signed-off-by: James Morris Sorry, I forgot to update the calls in af_key. Here is the corrected version. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== include/linux/crypto.h 1.31 vs edited ===== --- 1.31/include/linux/crypto.h 2004-12-01 17:00:21 +11:00 +++ edited/include/linux/crypto.h 2005-01-21 21:11:45 +11:00 @@ -16,6 +16,7 @@ #ifndef _LINUX_CRYPTO_H #define _LINUX_CRYPTO_H +#include #include #include #include @@ -121,7 +122,14 @@ /* * Algorithm query interface. */ +#ifdef CONFIG_CRYPTO int crypto_alg_available(const char *name, u32 flags); +#else +static inline int crypto_alg_available(const char *name, u32 flags) +{ + return 0; +} +#endif /* * Transforms: user-instantiated objects which encapsulate algorithms ===== include/net/xfrm.h 1.73 vs edited ===== --- 1.73/include/net/xfrm.h 2004-12-28 14:49:57 +11:00 +++ edited/include/net/xfrm.h 2005-01-21 21:02:36 +11:00 @@ -873,9 +873,9 @@ extern struct xfrm_algo_desc *xfrm_aalg_get_byid(int alg_id); extern struct xfrm_algo_desc *xfrm_ealg_get_byid(int alg_id); extern struct xfrm_algo_desc *xfrm_calg_get_byid(int alg_id); -extern struct xfrm_algo_desc *xfrm_aalg_get_byname(char *name); -extern struct xfrm_algo_desc *xfrm_ealg_get_byname(char *name); -extern struct xfrm_algo_desc *xfrm_calg_get_byname(char *name); +extern struct xfrm_algo_desc *xfrm_aalg_get_byname(char *name, int probe); +extern struct xfrm_algo_desc *xfrm_ealg_get_byname(char *name, int probe); +extern struct xfrm_algo_desc *xfrm_calg_get_byname(char *name, int probe); struct crypto_tfm; typedef void (icv_update_fn_t)(struct crypto_tfm *, struct scatterlist *, unsigned int); ===== net/ipv4/ah4.c 1.40 vs edited ===== --- 1.40/net/ipv4/ah4.c 2004-08-22 15:00:07 +10:00 +++ edited/net/ipv4/ah4.c 2005-01-21 21:03:39 +11:00 @@ -236,7 +236,7 @@ * we need for AH processing. This lookup cannot fail here * after a successful crypto_alloc_tfm(). */ - aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name); + aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name, 0); BUG_ON(!aalg_desc); if (aalg_desc->uinfo.auth.icv_fullbits/8 != ===== net/ipv4/esp4.c 1.54 vs edited ===== --- 1.54/net/ipv4/esp4.c 2004-08-22 15:00:07 +10:00 +++ edited/net/ipv4/esp4.c 2005-01-21 21:04:37 +11:00 @@ -392,7 +392,7 @@ goto error; esp->auth.icv = esp_hmac_digest; - aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name); + aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name, 0); BUG_ON(!aalg_desc); if (aalg_desc->uinfo.auth.icv_fullbits/8 != ===== net/ipv4/ipcomp.c 1.30 vs edited ===== --- 1.30/net/ipv4/ipcomp.c 2004-09-11 07:36:51 +10:00 +++ edited/net/ipv4/ipcomp.c 2005-01-21 21:04:40 +11:00 @@ -472,7 +472,7 @@ goto error_tunnel; } - calg_desc = xfrm_calg_get_byname(x->calg->alg_name); + calg_desc = xfrm_calg_get_byname(x->calg->alg_name, 0); BUG_ON(!calg_desc); ipcd->threshold = calg_desc->uinfo.comp.threshold; x->data = ipcd; ===== net/ipv6/ah6.c 1.41 vs edited ===== --- 1.41/net/ipv6/ah6.c 2004-08-22 15:00:07 +10:00 +++ edited/net/ipv6/ah6.c 2005-01-21 21:04:45 +11:00 @@ -375,7 +375,7 @@ * we need for AH processing. This lookup cannot fail here * after a successful crypto_alloc_tfm(). */ - aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name); + aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name, 0); BUG_ON(!aalg_desc); if (aalg_desc->uinfo.auth.icv_fullbits/8 != ===== net/ipv6/esp6.c 1.37 vs edited ===== --- 1.37/net/ipv6/esp6.c 2004-08-22 15:00:07 +10:00 +++ edited/net/ipv6/esp6.c 2005-01-21 21:04:48 +11:00 @@ -329,7 +329,7 @@ goto error; esp->auth.icv = esp_hmac_digest; - aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name); + aalg_desc = xfrm_aalg_get_byname(x->aalg->alg_name, 0); BUG_ON(!aalg_desc); if (aalg_desc->uinfo.auth.icv_fullbits/8 != ===== net/ipv6/ipcomp6.c 1.19 vs edited ===== --- 1.19/net/ipv6/ipcomp6.c 2004-09-11 07:36:51 +10:00 +++ edited/net/ipv6/ipcomp6.c 2005-01-21 21:04:51 +11:00 @@ -468,7 +468,7 @@ goto error_tunnel; } - calg_desc = xfrm_calg_get_byname(x->calg->alg_name); + calg_desc = xfrm_calg_get_byname(x->calg->alg_name, 0); BUG_ON(!calg_desc); ipcd->threshold = calg_desc->uinfo.comp.threshold; x->data = ipcd; ===== net/key/af_key.c 1.68 vs edited ===== --- 1.68/net/key/af_key.c 2005-01-14 15:41:06 +11:00 +++ edited/net/key/af_key.c 2005-01-22 09:44:04 +11:00 @@ -665,18 +665,18 @@ sa->sadb_sa_state = SADB_SASTATE_DEAD; sa->sadb_sa_auth = 0; if (x->aalg) { - struct xfrm_algo_desc *a = xfrm_aalg_get_byname(x->aalg->alg_name); + struct xfrm_algo_desc *a = xfrm_aalg_get_byname(x->aalg->alg_name, 0); sa->sadb_sa_auth = a ? a->desc.sadb_alg_id : 0; } sa->sadb_sa_encrypt = 0; BUG_ON(x->ealg && x->calg); if (x->ealg) { - struct xfrm_algo_desc *a = xfrm_ealg_get_byname(x->ealg->alg_name); + struct xfrm_algo_desc *a = xfrm_ealg_get_byname(x->ealg->alg_name, 0); sa->sadb_sa_encrypt = a ? a->desc.sadb_alg_id : 0; } /* KAME compatible: sadb_sa_encrypt is overloaded with calg id */ if (x->calg) { - struct xfrm_algo_desc *a = xfrm_calg_get_byname(x->calg->alg_name); + struct xfrm_algo_desc *a = xfrm_calg_get_byname(x->calg->alg_name, 0); sa->sadb_sa_encrypt = a ? a->desc.sadb_alg_id : 0; } ===== net/xfrm/xfrm_algo.c 1.15 vs edited ===== --- 1.15/net/xfrm/xfrm_algo.c 2004-12-28 13:33:32 +11:00 +++ edited/net/xfrm/xfrm_algo.c 2005-01-21 21:17:12 +11:00 @@ -13,6 +13,7 @@ #include #include #include +#include #include #if defined(CONFIG_INET_AH) || defined(CONFIG_INET_AH_MODULE) || defined(CONFIG_INET6_AH) || defined(CONFIG_INET6_AH_MODULE) #include @@ -346,58 +347,48 @@ return NULL; } -struct xfrm_algo_desc *xfrm_aalg_get_byname(char *name) +static struct xfrm_algo_desc *xfrm_get_byname(struct xfrm_algo_desc *list, + int entries, char *name, + int probe) { - int i; + int i, status; if (!name) return NULL; - for (i=0; i < aalg_entries(); i++) { - if (strcmp(name, aalg_list[i].name) == 0) { - if (aalg_list[i].available) - return &aalg_list[i]; - else - break; - } + for (i = 0; i < entries; i++) { + if (!strcmp(name, list[i].name)) + continue; + + if (list[i].available) + return &list[i]; + + if (!probe) + break; + + status = crypto_alg_available(name, 0); + if (!status) + break; + + list[i].available = status; + return &list[i]; } return NULL; } -struct xfrm_algo_desc *xfrm_ealg_get_byname(char *name) +struct xfrm_algo_desc *xfrm_aalg_get_byname(char *name, int probe) { - int i; - - if (!name) - return NULL; - - for (i=0; i < ealg_entries(); i++) { - if (strcmp(name, ealg_list[i].name) == 0) { - if (ealg_list[i].available) - return &ealg_list[i]; - else - break; - } - } - return NULL; + return xfrm_get_byname(aalg_list, aalg_entries(), name, probe); } -struct xfrm_algo_desc *xfrm_calg_get_byname(char *name) +struct xfrm_algo_desc *xfrm_ealg_get_byname(char *name, int probe) { - int i; - - if (!name) - return NULL; + return xfrm_get_byname(ealg_list, ealg_entries(), name, probe); +} - for (i=0; i < calg_entries(); i++) { - if (strcmp(name, calg_list[i].name) == 0) { - if (calg_list[i].available) - return &calg_list[i]; - else - break; - } - } - return NULL; +struct xfrm_algo_desc *xfrm_calg_get_byname(char *name, int probe) +{ + return xfrm_get_byname(calg_list, calg_entries(), name, probe); } struct xfrm_algo_desc *xfrm_aalg_get_byidx(unsigned int idx) ===== net/xfrm/xfrm_user.c 1.51 vs edited ===== --- 1.51/net/xfrm/xfrm_user.c 2004-12-28 13:33:32 +11:00 +++ edited/net/xfrm/xfrm_user.c 2005-01-21 21:05:50 +11:00 @@ -156,7 +156,7 @@ } static int attach_one_algo(struct xfrm_algo **algpp, u8 *props, - struct xfrm_algo_desc *(*get_byname)(char *), + struct xfrm_algo_desc *(*get_byname)(char *, int), struct rtattr *u_arg) { struct rtattr *rta = u_arg; @@ -168,7 +168,7 @@ ualg = RTA_DATA(rta); - algo = get_byname(ualg->alg_name); + algo = get_byname(ualg->alg_name, 1); if (!algo) return -ENOSYS; *props = algo->desc.sadb_alg_id; @@ -272,8 +272,6 @@ err = verify_newsa_info(p, (struct rtattr **) xfrma); if (err) return err; - - xfrm_probe_algs(); x = xfrm_state_construct(p, (struct rtattr **) xfrma, &err); if (!x) --Q68bSM7Ycu6FN28Q-- From rick.jones2@hp.com Fri Jan 21 14:48:14 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 14:48:20 -0800 (PST) Received: from palrel10.hp.com (palrel10.hp.com [156.153.255.245]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LMmDqG023627 for ; Fri, 21 Jan 2005 14:48:14 -0800 Received: from tardy.cup.hp.com (tardy.cup.hp.com [15.244.44.58]) by palrel10.hp.com (Postfix) with ESMTP id BC5AA1B09 for ; Fri, 21 Jan 2005 14:48:13 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by tardy.cup.hp.com (8.9.3 (PHNE_28810)/8.9.3 SMKit7.02) with ESMTP id OAA17030 for ; Fri, 21 Jan 2005 14:48:09 -0800 (PST) Message-ID: <41F186A8.9030805@hp.com> Date: Fri, 21 Jan 2005 14:48:08 -0800 From: Rick Jones User-Agent: Mozilla/5.0 (X11; U; HP-UX 9000/785; en-US; rv:1.7.3) Gecko/20041206 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: Re: on the wire behaviour of TSO on/off is supposed to be the same yes? References: <41F1516D.5010101@hp.com> <200501211358.53783.jdmason@us.ibm.com> <41F163AD.5070400@hp.com> <20050121124441.76cbbfb9.davem@davemloft.net> <41F17B7E.2020002@hp.com> <20050121141820.7d59a2d1.davem@davemloft.net> In-Reply-To: <20050121141820.7d59a2d1.davem@davemloft.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 623 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rick.jones2@hp.com Precedence: bulk X-list: netdev David S. Miller wrote: > On Fri, 21 Jan 2005 14:00:30 -0800 Rick Jones wrote: > > >> Indeed, it waited for the ACK 4335, but then shouldn't it have emitted >> 4344+1448 or 5792 bytes or perhaps 7240 (since there were two ACKs? > > > The tcp_tso_win_divisor calculation occurs on the congestion window at the > time of the user request, not at the time of the ACK. Ah, _that_ explains why in so many of my traces it stays at one value for sooo long. And in some places it seemed to jump by fairly large quantities. I thought it was related to the window size, but in a netperf TCP_STREAM test, unless the sender sets the -m option, it is set based on the getsockopt() that follows the setsockopt() from the -s, and since -S was 128K, and since Linux doubles that on the getsockopt().... that explains the O(200K) bit before > 1448 byte sends when the divisor was set to 8. > That's an interesting observation actually, thanks for showing it. My pleasure. > It means that ideally we might want to try and find a way to either: > > 1) defer the TSO window size calculation to some later moment, ie. at > tcp_write_xmit() time > > 2) use an optimistic TSO size calculation at the same moment we compute it > now, and later if it is found to be too aggressive we chop up the TSO frame > and resegment the transmit queue to accomodate > > Neither is easy to implement as far as I can tell, but it should fix all the > problems IBM and others are trying to work around by setting the > tcp_tso_win_divisor really small. Indeed, it seems that one would want to decide about TSO when one is about to transmit, not when the user does a send since otherwise, you penalize users doing larger sends. Someone doing say a sendfile() of a large file would be pretty much precluded from getting benefit from TSO the way things are now right? (There is a netperf TCP_SENDFILE test, but it defaults the send size to the socket buffer size just like TCP_STREAM) And I suspect that is the case for some of the (un)spoken workloads of interest among the system vendors. That's not to say that we still won't have incentive to set tcp_tso_win_divisor (shouldn't that really be tcp_tso_cwnd_divisor?) to 1 :) I suspect we will still want that initial "4380" cwnd bytes to be a single TSO transmission... every cycle's sacred, every cycle's great... :) rick jones BTW, has the whole "reply-to" question already been thrashed about on this list? Is it an open or closed list? I ask because I keep getting two copies of everyone's replies - one to me, one to the list... just a nit... From davem@davemloft.net Fri Jan 21 14:50:00 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 14:50:05 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LMo0XD024242 for ; Fri, 21 Jan 2005 14:50:00 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cs7Z5-0008KA-00; Fri, 21 Jan 2005 14:47:39 -0800 Date: Fri, 21 Jan 2005 14:47:38 -0800 From: "David S. Miller" To: David Dillow Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org, dave@thedillows.org Subject: Re: [RFC 2.6.10 3/22] xfrm: Add offload management routines Message-Id: <20050121144738.7155893e.davem@davemloft.net> In-Reply-To: <20041230035000.12@ori.thedillows.org> References: <20041230035000.11@ori.thedillows.org> <20041230035000.12@ori.thedillows.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 624 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Thu, 30 Dec 2004 03:48:35 -0500 David Dillow wrote: > +static inline struct xfrm_offload * > +xfrm_offload_alloc(int sizeof_priv, struct net_device *dev) This whole scheme looks buggy. The intent is to 8-byte align the object, but look at what the code is actually doing. Whatever kmalloc() returns to xfrm_offload_alloc() is directly used as the xfrm_offload pointer, and the members are initialized. Then xfrm_offload_priv() does the alignments. It is clear that kmalloc() is always giving you 8-byte aligned data else the first time xfrm_offload_priv() is used you'd get a bogus pointer since xfrm_offload_alloc() initialized the object without first aligning the pointer. We do something similar when we allocate netdevs, so have a look at how net/core/dev.c:alloc_netdev() works. From aris@cathedrallabs.org Fri Jan 21 14:53:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 14:53:49 -0800 (PST) Received: from smtp.uol.com.br (smtpout4.uol.com.br [200.221.4.195]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LMrf7r024840 for ; Fri, 21 Jan 2005 14:53:41 -0800 Received: from cathedrallabs.org (unknown [200.181.173.117]) by scorpion4.uol.com.br (Postfix) with ESMTP id 5A05A77D9; Fri, 21 Jan 2005 20:53:29 -0200 (BRST) Received: by cathedrallabs.org (Postfix, from userid 1000) id 1045523611; Fri, 21 Jan 2005 20:52:52 -0200 (GMT+2) Date: Fri, 21 Jan 2005 20:52:51 -0200 From: Aristeu Rozanski To: Arnaldo Carvalho de Melo Cc: "David S. Miller" , Networking Team Subject: Re: [PATCH 7/12] [X25] stop using sk_protinfo Message-ID: <20050121225251.GC2510@cathedrallabs.org> References: <41F074BB.8090501@conectiva.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F074BB.8090501@conectiva.com.br> User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 625 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: aris@cathedrallabs.org Precedence: bulk X-list: netdev Hi Arnaldo, > ChangeSet@1.2005, 2005-01-20 20:59:08-02:00, acme@toy.ghostprotocols.net > [X25] stop using sk_protinfo > > Required to introduce struct connection_sock. > > Signed-off-by: Arnaldo Carvalho de Melo > Signed-off-by: David S. Miller seems sane to me -- Aristeu From davem@davemloft.net Fri Jan 21 14:58:30 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 14:58:36 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LMwU54025371 for ; Fri, 21 Jan 2005 14:58:30 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cs7hJ-0008Mf-00; Fri, 21 Jan 2005 14:56:09 -0800 Date: Fri, 21 Jan 2005 14:56:08 -0800 From: "David S. Miller" To: David Dillow Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org, dave@thedillows.org Subject: Re: [RFC 2.6.10 4/22] xfrm: Try to offload inbound xfrm_states Message-Id: <20050121145608.65ad2d48.davem@davemloft.net> In-Reply-To: <20041230035000.13@ori.thedillows.org> References: <20041230035000.12@ori.thedillows.org> <20041230035000.13@ori.thedillows.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 626 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Thu, 30 Dec 2004 03:48:35 -0500 David Dillow wrote: > # This is a BitKeeper generated diff -Nru style patch. > # > # ChangeSet > # 2004/12/30 00:33:11-05:00 dave@thedillows.org > # Plumb in offloading of inbound xfrm_states. > # > # Signed-off-by: David Dillow Hmmm, this seems to deadlock. xfrm_state_add() is invoked with the RTNL semaphore already acquired. For example, via xfrm_user.c:xfrm_add_sa() From rick.jones2@hp.com Fri Jan 21 14:58:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 14:58:52 -0800 (PST) Received: from palrel13.hp.com (palrel13.hp.com [156.153.255.238]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LMwmnK025456 for ; Fri, 21 Jan 2005 14:58:48 -0800 Received: from tardy.cup.hp.com (tardy.cup.hp.com [15.244.44.58]) by palrel13.hp.com (Postfix) with ESMTP id 56C561C2EBD0 for ; Fri, 21 Jan 2005 14:58:48 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by tardy.cup.hp.com (8.9.3 (PHNE_28810)/8.9.3 SMKit7.02) with ESMTP id OAA17086 for ; Fri, 21 Jan 2005 14:58:47 -0800 (PST) Message-ID: <41F18927.5020607@hp.com> Date: Fri, 21 Jan 2005 14:58:47 -0800 From: Rick Jones User-Agent: Mozilla/5.0 (X11; U; HP-UX 9000/785; en-US; rv:1.7.3) Gecko/20041206 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: Re: on the wire behaviour of TSO on/off is supposed to be the same yes? References: <41F1516D.5010101@hp.com> <200501211358.53783.jdmason@us.ibm.com> <41F163AD.5070400@hp.com> <20050121124441.76cbbfb9.davem@davemloft.net> <41F17B7E.2020002@hp.com> <20050121141820.7d59a2d1.davem@davemloft.net> <41F186A8.9030805@hp.com> In-Reply-To: <41F186A8.9030805@hp.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 627 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rick.jones2@hp.com Precedence: bulk X-list: netdev Rick Jones wrote: > That's not to say that we still won't have incentive to set > tcp_tso_win_divisor (shouldn't that really be tcp_tso_cwnd_divisor?) to 1 :) Speaking of divisor values... is zero (0) supposed to be a legal value? The sysctl seems to allow it but it does seem to behave a triffle strangely. The initial TSO size appeared to be 2MSS. It might be rather interesting if a value of zero were to have the effect of ignoring initial cwnd entirely :) It wouldn't be "legal" in the RFC sense, but I suspect it would make for some interesting experimental opportunities. Rather far down on the list though. rick jones From shemminger@osdl.org Fri Jan 21 15:01:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 15:01:55 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LN1Sj6026374 for ; Fri, 21 Jan 2005 15:01:29 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0LN1Jl07768; Fri, 21 Jan 2005 15:01:19 -0800 Date: Fri, 21 Jan 2005 15:01:24 -0800 From: Stephen Hemminger To: Stephen Hemminger Cc: Jeff Garzik , netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [RFT] skge: new syskonnect gigabit ethernet driver (0.4) Message-ID: <20050121150124.4a1fb80d@dxpl.pdx.osdl.net> In-Reply-To: <20050119135217.38fe5f05@dxpl.pdx.osdl.net> References: <20050119135217.38fe5f05@dxpl.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 628 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Revision to the the new sys-konnect gigabit Ethernet driver. This version 0.4 has: * Merge in (most of) the comments * Fixes for checksum offload code * More complete ethtool advertising/supported interface * Handle D-Link 530T which doesn't really have PCI VPD [sk98lin won't work on this board because of this] Still not tested/debugged: * Genesis chip support -- does anyone still have one of these? May just drop it. * Jumbo frame support Still not implemented: * Marvell Yukon2 88E8050 * VLAN support * Power management suspend/resume * Wake on Lan The patch should work on 2.6.8 or later, I am testing with 2.6.11-rc1. Also available as download from http://developer.osdl.org/shemminger/skge diff -Nru a/drivers/net/Kconfig b/drivers/net/Kconfig --- a/drivers/net/Kconfig 2005-01-21 14:50:41 -08:00 +++ b/drivers/net/Kconfig 2005-01-21 14:50:41 -08:00 @@ -1980,6 +1980,18 @@ If in doubt, say Y. +config SKGE + tristate "New SysKonnect GigaEthernet support (EXPERIMENTAL)" + depends on PCI && EXPERIMENTAL + select CRC32 + ---help--- + This driver support the Marvell Yukon or SysKonnect SK-98xx/SK-95xx + and related Gigabit Ethernet adapters. It is a new smaller driver + driver with better performance and more complete ethtool support. + + It does not support the link failover and network management + features that "portable" vendor supplied sk98lin driver does. + config SK98LIN tristate "Marvell Yukon Chipset / SysKonnect SK-98xx Support" depends on PCI diff -Nru a/drivers/net/Makefile b/drivers/net/Makefile --- a/drivers/net/Makefile 2005-01-21 14:50:41 -08:00 +++ b/drivers/net/Makefile 2005-01-21 14:50:41 -08:00 @@ -52,6 +52,7 @@ obj-$(CONFIG_FEALNX) += fealnx.o obj-$(CONFIG_TIGON3) += tg3.o obj-$(CONFIG_TC35815) += tc35815.o +obj-$(CONFIG_SKGE) += skge.o obj-$(CONFIG_SK98LIN) += sk98lin/ obj-$(CONFIG_SKFP) += skfp/ obj-$(CONFIG_VIA_RHINE) += via-rhine.o diff -Nru a/drivers/net/skge.c b/drivers/net/skge.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/net/skge.c 2005-01-21 14:50:41 -08:00 @@ -0,0 +1,3329 @@ +/* + * New driver for Marvell Yukon chipsent and SysKonnect Gigabit + * Ethernet adapters. Based on earlier sk98lin, e100 and + * Freebsd if_sk drivers. + * + * This driver intentionally does not support all the features + * of the original driver such as link failover and link management because + * those should be done at higher levels. + * + * Copyright (C) 2004, Stephen Hemminger + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "skge.h" + +#define DRV_NAME "skge" +#define DRV_VERSION "0.4" +#define PFX DRV_NAME " " + +#define DEFAULT_TX_RING_SIZE 128 +#define DEFAULT_RX_RING_SIZE 512 +#define MAX_TX_RING_SIZE 1024 +#define MAX_RX_RING_SIZE 4096 +#define PHY_RETRIES 1000 +#define ETH_JUMBO_MTU 9000 +#define TX_WATCHDOG (5 * HZ) +#define NAPI_WEIGHT 64 +#define VPD_TIMEOUT HZ +#define BLINK_HZ (HZ/4) +#define LINK_POLL_HZ (HZ/10) + +MODULE_DESCRIPTION("SysKonnect Gigabit Ethernet driver"); +MODULE_AUTHOR("Stephen Hemminger "); +MODULE_LICENSE("GPL"); +MODULE_VERSION(DRV_VERSION); + +static const u32 default_msg + = NETIF_MSG_DRV| NETIF_MSG_PROBE| NETIF_MSG_LINK + | NETIF_MSG_IFUP| NETIF_MSG_IFDOWN; + +static int debug = -1; /* defaults above */ +module_param(debug, int, 0); +MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); + +static const struct pci_device_id skge_id_table[] = { + { PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C940, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C940B, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_GE, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_YU, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_SYSKONNECT, 0x9E00, /* SK-9Exx */ + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_DLINK, PCI_DEVICE_ID_DLINK_DGE510T, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_MARVELL, 0x4320, /* Gigabit Ethernet Controller */ + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_MARVELL, 0x5005, /* Marvell (11ab), Belkin */ + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_CNET, PCI_DEVICE_ID_CNET_GIGACARD, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_LINKSYS, PCI_DEVICE_ID_LINKSYS_EG1032, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_LINKSYS, PCI_DEVICE_ID_LINKSYS_EG1064, + PCI_ANY_ID, PCI_ANY_ID }, + { 0 } +}; +MODULE_DEVICE_TABLE(pci, skge_id_table); + +static int skge_up(struct net_device *dev); +static int skge_down(struct net_device *dev); +static void skge_tx_clean(struct skge_port *skge); +static void skge_xm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val); +static void skge_gm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val); +static void genesis_get_stats(struct skge_port *skge, u64 *data); +static void yukon_get_stats(struct skge_port *skge, u64 *data); + +static const int txq[] = { Q_XA1, Q_XA2 }; +static const int rxq[] = { Q_R1, Q_R2 }; + +/* Don't need to look at whole 16K. + * last interesting register is descriptor poll timer. + */ +#define SKGE_REGS_LEN (29*128) + +static int skge_get_regs_len(struct net_device *dev) +{ + return SKGE_REGS_LEN; +} + +/* + * Returns copy of control register region + * I/O region is divided into banks and certain regions + * are unreadable + */ +static void skge_get_regs(struct net_device *dev, struct ethtool_regs *regs, + void *p) +{ + const struct skge_port *skge = netdev_priv(dev); + unsigned long offs; + const void __iomem *io = skge->hw->regs; + static const unsigned long bankmap + = (1<<0) | (1<<2) | (1<<8) | (1<<9) + | (1<<12) | (1<<13) | (1<<14) | (1<<15) | (1<<16) + | (1<<17) | (1<<20) | (1<<21) | (1<<22) | (1<<23) + | (1<<24) | (1<<25) | (1<<26) | (1<<27) | (1<<28); + + regs->version = 1; + for (offs = 0; offs < regs->len; offs += 128) { + u32 len = min_t(u32, 128, regs->len - offs); + + if (bankmap & (1<<(offs/128))) + memcpy_fromio(p + offs, io + offs, len); + else + memset(p + offs, 0, len); + } +} + +static int skge_get_settings(struct net_device *dev, + struct ethtool_cmd *ecmd) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + + ecmd->transceiver = XCVR_INTERNAL; + + if (iscopper(hw)) { + if (hw->chip_id == CHIP_ID_GENESIS) + ecmd->supported = SUPPORTED_1000baseT_Full + | SUPPORTED_1000baseT_Half + | SUPPORTED_Autoneg | SUPPORTED_TP; + else { + ecmd->supported = SUPPORTED_10baseT_Half + | SUPPORTED_10baseT_Full + | SUPPORTED_100baseT_Half + | SUPPORTED_100baseT_Full + | SUPPORTED_1000baseT_Half + | SUPPORTED_1000baseT_Full + | SUPPORTED_Autoneg| SUPPORTED_TP; + + if (hw->chip_id == CHIP_ID_YUKON) + ecmd->supported &= ~SUPPORTED_1000baseT_Half; + + else if (hw->chip_id == CHIP_ID_YUKON_FE) + ecmd->supported &= ~(SUPPORTED_1000baseT_Half + | SUPPORTED_1000baseT_Full); + } + + ecmd->port = PORT_TP; + ecmd->phy_address = hw->phy_addr; + } else { + ecmd->supported = SUPPORTED_1000baseT_Full + | SUPPORTED_FIBRE + | SUPPORTED_Autoneg; + + ecmd->port = PORT_FIBRE; + } + + ecmd->advertising = skge->advertising; + ecmd->autoneg = skge->autoneg; + ecmd->speed = skge->speed; + ecmd->duplex = skge->duplex; + return 0; +} + +static u32 skge_modes(const struct skge_hw *hw) +{ + u32 modes = ADVERTISED_Autoneg + | ADVERTISED_1000baseT_Full | ADVERTISED_1000baseT_Half + | ADVERTISED_100baseT_Full | ADVERTISED_100baseT_Half + | ADVERTISED_10baseT_Full | ADVERTISED_10baseT_Half; + + if (iscopper(hw)) { + modes |= ADVERTISED_TP; + switch(hw->chip_id) { + case CHIP_ID_GENESIS: + modes &= ~(ADVERTISED_100baseT_Full + | ADVERTISED_100baseT_Half + | ADVERTISED_10baseT_Full + | ADVERTISED_10baseT_Half); + break; + + case CHIP_ID_YUKON: + modes &= ~ADVERTISED_1000baseT_Half; + break; + + case CHIP_ID_YUKON_FE: + modes &= ~(ADVERTISED_1000baseT_Half|ADVERTISED_1000baseT_Full); + break; + } + } else { + modes |= ADVERTISED_FIBRE; + modes &= ~ADVERTISED_1000baseT_Half; + } + return modes; +} + +static int skge_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) +{ + struct skge_port *skge = netdev_priv(dev); + const struct skge_hw *hw = skge->hw; + + if (ecmd->autoneg == AUTONEG_ENABLE) { + if (ecmd->advertising & skge_modes(hw)) + return -EINVAL; + } else { + switch(ecmd->speed) { + case SPEED_1000: + if (hw->chip_id == CHIP_ID_YUKON_FE) + return -EINVAL; + break; + case SPEED_100: + case SPEED_10: + if (iscopper(hw) || hw->chip_id == CHIP_ID_GENESIS) + return -EINVAL; + break; + default: + return -EINVAL; + } + } + + skge->autoneg = ecmd->autoneg; + skge->speed = ecmd->speed; + skge->duplex = ecmd->duplex; + skge->advertising = ecmd->advertising; + + if (netif_running(dev)) { + skge_down(dev); + skge_up(dev); + } + return (0); +} + +static void skge_get_drvinfo(struct net_device *dev, + struct ethtool_drvinfo *info) +{ + struct skge_port *skge = netdev_priv(dev); + + strcpy(info->driver, DRV_NAME); + strcpy(info->version, DRV_VERSION); + strcpy(info->fw_version, "N/A"); + strcpy(info->bus_info, pci_name(skge->hw->pdev)); +} + +static const struct skge_stat { + char name[ETH_GSTRING_LEN]; + u16 xmac_offset; + u16 gma_offset; +} skge_stats[] = { + { "tx_bytes", XM_TXO_OK_HI, GM_TXO_OK_HI }, + { "rx_bytes", XM_RXO_OK_HI, GM_RXO_OK_HI }, + + { "tx_broadcast", XM_TXF_BC_OK, GM_TXF_BC_OK }, + { "rx_broadcast", XM_RXF_BC_OK, GM_RXF_BC_OK }, + { "tx_multicast", XM_TXF_MC_OK, GM_TXF_MC_OK }, + { "rx_multicast", XM_RXF_MC_OK, GM_RXF_MC_OK }, + { "tx_unicast", XM_TXF_UC_OK, GM_TXF_UC_OK }, + { "rx_unicast", XM_RXF_UC_OK, GM_RXF_UC_OK }, + { "tx_mac_pause", XM_TXF_MPAUSE, GM_TXF_MPAUSE }, + { "rx_mac_pause", XM_RXF_MPAUSE, GM_RXF_MPAUSE }, + + { "collisions", XM_TXF_SNG_COL, GM_TXF_SNG_COL }, + { "multi_collisions", XM_TXF_MUL_COL, GM_TXF_MUL_COL }, + { "aborted", XM_TXF_ABO_COL, GM_TXF_ABO_COL}, + { "late_collision", XM_TXF_LAT_COL, GM_TXF_LAT_COL }, + { "fifo_underrun", XM_TXE_FIFO_UR, GM_TXE_FIFO_UR }, + { "fifo_overflow", XM_RXE_FIFO_OV, GM_RXE_FIFO_OV }, + + { "rx_toolong", XM_RXF_LNG_ERR, GM_RXF_LNG_ERR }, + { "rx_jabber", XM_RXF_JAB_PKT, GM_RXF_JAB_PKT }, + { "rx_runt", XM_RXE_RUNT, GM_RXE_FRAG }, + { "rx_too_long", XM_RXF_LNG_ERR, GM_RXF_LNG_ERR }, + { "rx_fcs_error", XM_RXF_FCS_ERR, GM_RXF_FCS_ERR }, +}; + +static int skge_get_stats_count(struct net_device *dev) +{ + return ARRAY_SIZE(skge_stats); +} + +static void skge_get_ethtool_stats(struct net_device *dev, + struct ethtool_stats *stats, u64 *data) +{ + struct skge_port *skge = netdev_priv(dev); + + if (skge->hw->chip_id == CHIP_ID_GENESIS) + genesis_get_stats(skge, data); + else + yukon_get_stats(skge, data); +} + +static void skge_get_strings(struct net_device *dev, u32 stringset, u8 *data) +{ + int i; + + switch(stringset) { + case ETH_SS_STATS: + for (i = 0; i < ARRAY_SIZE(skge_stats); i++) + memcpy(data + i * ETH_GSTRING_LEN, + skge_stats[i].name, ETH_GSTRING_LEN); + break; + } +} + +static void skge_get_ring_param(struct net_device *dev, + struct ethtool_ringparam *p) +{ + struct skge_port *skge = netdev_priv(dev); + + p->rx_max_pending = MAX_RX_RING_SIZE; + p->tx_max_pending = MAX_TX_RING_SIZE; + p->rx_mini_max_pending = 0; + p->rx_jumbo_max_pending = 0; + + p->rx_pending = skge->rx_ring.count; + p->tx_pending = skge->tx_ring.count; + p->rx_mini_pending = 0; + p->rx_jumbo_pending = 0; +} + +static int skge_set_ring_param(struct net_device *dev, + struct ethtool_ringparam *p) +{ + struct skge_port *skge = netdev_priv(dev); + + if (p->rx_pending == 0 || p->rx_pending > MAX_RX_RING_SIZE || + p->tx_pending == 0 || p->tx_pending > MAX_TX_RING_SIZE) + return -EINVAL; + + skge->rx_ring.count = p->rx_pending; + skge->tx_ring.count = p->tx_pending; + + if (netif_running(dev)) { + skge_down(dev); + skge_up(dev); + } + + return 0; +} + +static u32 skge_get_msglevel(struct net_device *netdev) +{ + struct skge_port *skge = netdev_priv(netdev); + return skge->msg_enable; +} + +static void skge_set_msglevel(struct net_device *netdev, u32 value) +{ + struct skge_port *skge = netdev_priv(netdev); + skge->msg_enable = value; +} + +static int skge_set_sg(struct net_device *dev, u32 data) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + + if (hw->chip_id == CHIP_ID_GENESIS && data) + return -EOPNOTSUPP; + return ethtool_op_set_sg(dev, data); +} + +static u32 skge_get_rx_csum(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + + return skge->rx_csum; +} + +static int skge_set_rx_csum(struct net_device *dev, u32 data) +{ + struct skge_port *skge = netdev_priv(dev); + + if (skge->hw->chip_id == CHIP_ID_GENESIS && data) + return -EOPNOTSUPP; + + skge->rx_csum = data; + return 0; +} + +static int skge_set_tso(struct net_device *dev, u32 data) +{ + if (data) + return -EOPNOTSUPP; + return 0; +} + +static void skge_get_pauseparam(struct net_device *dev, + struct ethtool_pauseparam *ecmd) +{ + struct skge_port *skge = netdev_priv(dev); + + ecmd->tx_pause = (skge->flow_control == FLOW_MODE_LOC_SEND) + || (skge->flow_control == FLOW_MODE_SYMMETRIC); + ecmd->rx_pause = (skge->flow_control == FLOW_MODE_REM_SEND) + || (skge->flow_control == FLOW_MODE_SYMMETRIC); + + ecmd->autoneg = skge->autoneg; +} + +static int skge_set_pauseparam(struct net_device *dev, + struct ethtool_pauseparam *ecmd) +{ + struct skge_port *skge = netdev_priv(dev); + + skge->autoneg = ecmd->autoneg; + if (ecmd->rx_pause && ecmd->tx_pause) + skge->flow_control = FLOW_MODE_SYMMETRIC; + else if(ecmd->rx_pause && !ecmd->tx_pause) + skge->flow_control = FLOW_MODE_REM_SEND; + else if(!ecmd->rx_pause && ecmd->tx_pause) + skge->flow_control = FLOW_MODE_LOC_SEND; + else + skge->flow_control = FLOW_MODE_NONE; + + if (netif_running(dev)) { + skge_down(dev); + skge_up(dev); + } + return 0; +} + +static inline u32 skge_freq(const struct skge_hw *hw) +{ + if (hw->chip_id == CHIP_ID_GENESIS) + return 53215000; /* or: 53.125 MHz */ + else if (hw->chip_id == CHIP_ID_YUKON_EC) + return 125000000; /* or: 125.000 MHz */ + else + return 78215000; /* or: 78.125 MHz */ +} + +static int skge_get_coalesce(struct net_device *dev, + struct ethtool_coalesce *ecmd) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + int port = skge->port; + + ecmd->rx_coalesce_usecs = 0; + ecmd->tx_coalesce_usecs = 0; + + if (skge_read32(hw, B2_IRQM_CTRL) & TIM_START) { + u32 msk; + u64 delay = skge_read32(hw, B2_IRQM_INI); + + pr_debug("irqm = %lld\n", delay); + delay *= USEC_PER_SEC; + + do_div(delay, skge_freq(hw)); + msk = skge_read32(hw, B2_IRQM_MSK); + + if (((port == 0) && (msk & IS_R1_F)) || + ((port == 1) && (msk & IS_R2_F))) + ecmd->rx_coalesce_usecs = delay; + if (((port == 0) && (msk & IS_XA1_F)) || + ((port == 1) && (msk & IS_XA1_F))) + ecmd->tx_coalesce_usecs = delay; + } + + return 0; +} + +/* Note: interrupt timer is per board, but can turn on/off per port */ +static int skge_set_coalesce(struct net_device *dev, + struct ethtool_coalesce *ecmd) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + int port = skge->port; + u32 msk = skge_read32(hw, B2_IRQM_MSK); + u32 delay = 25; + + if (ecmd->rx_coalesce_usecs == 0) + msk &= ~(port == 0 ? IS_R1_F : IS_R2_F); + else if (ecmd->rx_coalesce_usecs < 25 || + ecmd->rx_coalesce_usecs > 33333) + return -EINVAL; + else { + msk |= port == 0 ? IS_R1_F : IS_R2_F; + delay = ecmd->rx_coalesce_usecs; + } + + if (ecmd->tx_coalesce_usecs == 0) + msk &= ~((port == 0) ? IS_XA1_F : IS_XA2_F); + else if (ecmd->tx_coalesce_usecs < 25 || + ecmd->tx_coalesce_usecs > 33333) + return -EINVAL; + else { + msk |= (port == 0) ? IS_XA1_F : IS_XA2_F; + delay = min(delay, ecmd->rx_coalesce_usecs); + } + + skge_write32(hw, B2_IRQM_MSK, msk); + if (msk == 0) + skge_write32(hw, B2_IRQM_CTRL, TIM_STOP); + else { + u64 ticks = (u64) delay * skge_freq(hw); + pr_debug("ticks * 10^6=%lld\n", ticks); + do_div(ticks, USEC_PER_SEC); + skge_write32(hw, B2_IRQM_INI, ticks); + skge_write32(hw, B2_IRQM_CTRL, TIM_START); + } + return 0; +} + +static void skge_led_on(struct skge_hw *hw, int port) +{ + if (hw->chip_id == CHIP_ID_GENESIS) { + skge_write8(hw, SKGEMAC_REG(port, LNK_LED_REG), LINKLED_ON); + skge_write8(hw, B0_LED, LED_STAT_ON); + + skge_write8(hw, SKGEMAC_REG(port, RX_LED_TST), LED_T_ON); + skge_write32(hw, SKGEMAC_REG(port, RX_LED_VAL), 100); + skge_write8(hw, SKGEMAC_REG(port, RX_LED_CTRL), LED_START); + + switch (hw->phy_type) { + case SK_PHY_BCOM: + skge_xm_phy_write(hw, port, PHY_BCOM_P_EXT_CTRL, + PHY_B_PEC_LED_ON); + break; + case SK_PHY_LONE: + skge_xm_phy_write(hw, port, PHY_LONE_LED_CFG, + 0x0800); + break; + default: + skge_write8(hw, SKGEMAC_REG(port, TX_LED_TST), LED_T_ON); + skge_write32(hw, SKGEMAC_REG(port, TX_LED_VAL), 100); + skge_write8(hw, SKGEMAC_REG(port, TX_LED_CTRL), LED_START); + } + } else { + skge_gm_phy_write(hw, port, PHY_MARV_LED_CTRL, 0); + skge_gm_phy_write(hw, port, PHY_MARV_LED_OVER, + PHY_M_LED_MO_DUP(MO_LED_ON) | + PHY_M_LED_MO_10(MO_LED_ON) | + PHY_M_LED_MO_100(MO_LED_ON) | + PHY_M_LED_MO_1000(MO_LED_ON) | + PHY_M_LED_MO_RX(MO_LED_ON)); + } +} + +static void skge_led_off(struct skge_hw *hw, int port) +{ + if (hw->chip_id == CHIP_ID_GENESIS) { + skge_write8(hw, SKGEMAC_REG(port, LNK_LED_REG), LINKLED_OFF); + skge_write8(hw, B0_LED, LED_STAT_OFF); + + skge_write32(hw, SKGEMAC_REG(port, RX_LED_VAL), 0); + skge_write8(hw, SKGEMAC_REG(port, RX_LED_CTRL), LED_T_OFF); + + switch (hw->phy_type) { + case SK_PHY_BCOM: + skge_xm_phy_write(hw, port, PHY_BCOM_P_EXT_CTRL, + PHY_B_PEC_LED_OFF); + break; + case SK_PHY_LONE: + skge_xm_phy_write(hw, port, PHY_LONE_LED_CFG, + PHY_L_LC_LEDT); + break; + default: + skge_write32(hw, SKGEMAC_REG(port, TX_LED_VAL), 0); + skge_write8(hw, SKGEMAC_REG(port, TX_LED_CTRL), LED_T_OFF); + } + } else { + skge_gm_phy_write(hw, port, PHY_MARV_LED_CTRL, 0); + skge_gm_phy_write(hw, port, PHY_MARV_LED_OVER, + PHY_M_LED_MO_DUP(MO_LED_OFF) | + PHY_M_LED_MO_10(MO_LED_OFF) | + PHY_M_LED_MO_100(MO_LED_OFF) | + PHY_M_LED_MO_1000(MO_LED_OFF) | + PHY_M_LED_MO_RX(MO_LED_OFF)); + } +} + +static void skge_blink_timer(unsigned long data) +{ + struct skge_port *skge = (struct skge_port *) data; + struct skge_hw *hw = skge->hw; + unsigned long flags; + + spin_lock_irqsave(&hw->phy_lock, flags); + if (skge->blink_on) + skge_led_on(hw, skge->port); + else + skge_led_off(hw, skge->port); + spin_unlock_irqrestore(&hw->phy_lock, flags); + + skge->blink_on = !skge->blink_on; + mod_timer(&skge->led_blink, jiffies + BLINK_HZ); +} + +/* blink LED's for finding board */ +static int skge_phys_id(struct net_device *dev, u32 data) +{ + struct skge_port *skge = netdev_priv(dev); + + if(!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ)) + data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ); + + /* start blinking */ + skge->blink_on = 1; + mod_timer(&skge->led_blink, jiffies+1); + + msleep_interruptible(data * 1000); + del_timer_sync(&skge->led_blink); + + skge_led_off(skge->hw, skge->port); + + return 0; +} + +static struct ethtool_ops skge_ethtool_ops = { + .get_settings = skge_get_settings, + .set_settings = skge_set_settings, + .get_drvinfo = skge_get_drvinfo, + .get_regs_len = skge_get_regs_len, + .get_regs = skge_get_regs, + .get_msglevel = skge_get_msglevel, + .set_msglevel = skge_set_msglevel, + .get_link = ethtool_op_get_link, + .get_ringparam = skge_get_ring_param, + .set_ringparam = skge_set_ring_param, + .get_pauseparam = skge_get_pauseparam, + .set_pauseparam = skge_set_pauseparam, + .get_coalesce = skge_get_coalesce, + .set_coalesce = skge_set_coalesce, + .get_tso = ethtool_op_get_tso, + .set_tso = skge_set_tso, + .get_sg = ethtool_op_get_sg, + .set_sg = skge_set_sg, + .get_tx_csum = ethtool_op_get_tx_csum, + .set_tx_csum = ethtool_op_set_tx_csum, + .get_rx_csum = skge_get_rx_csum, + .set_rx_csum = skge_set_rx_csum, + .get_strings = skge_get_strings, + .phys_id = skge_phys_id, + .get_stats_count = skge_get_stats_count, + .get_ethtool_stats = skge_get_ethtool_stats, +}; + +/* + * Allocate ring elements and chain them together + * One-to-one association of board descriptors with ring elements + */ +static int skge_ring_alloc(struct skge_ring *ring, void *vaddr, u64 base) +{ + struct skge_tx_desc *d; + struct skge_element *e; + int i; + + ring->start = kmalloc(sizeof(*e)*ring->count, GFP_KERNEL); + if (!ring->start) + return -ENOMEM; + + for (i = 0, e = ring->start, d = vaddr; i < ring->count; i++, e++, d++) { + e->desc = d; + if (i == ring->count - 1) { + e->next = ring->start; + d->next_offset = base; + } else { + e->next = e + 1; + d->next_offset = base + (i+1) * sizeof(*d); + } + } + ring->to_use = ring->to_clean = ring->start; + + return 0; +} + +/* Setup buffer for receiving */ +static inline int skge_rx_alloc(struct skge_port *skge, + struct skge_element *e) +{ + unsigned long bufsize = skge->netdev->mtu + ETH_HLEN; /* VLAN? */ + struct skge_rx_desc *rd = e->desc; + struct sk_buff *skb; + u64 map; + + skb = dev_alloc_skb(bufsize + NET_IP_ALIGN); + if (unlikely(!skb)) { + printk(KERN_DEBUG PFX "%s: out of memory for receive\n", + skge->netdev->name); + return -ENOMEM; + } + + skb->dev = skge->netdev; + skb_reserve(skb, NET_IP_ALIGN); + + map = pci_map_single(skge->hw->pdev, skb->data, bufsize, + PCI_DMA_FROMDEVICE); + + rd->dma_lo = map; + rd->dma_hi = map >> 32; + e->skb = skb; + rd->csum1_start = ETH_HLEN; + rd->csum2_start = ETH_HLEN; + rd->csum1 = 0; + rd->csum2 = 0; + + wmb(); + + rd->control = BMU_OWN | BMU_STF | BMU_IRQ_EOF | BMU_TCP_CHECK | bufsize; + pci_unmap_addr_set(e, mapaddr, map); + pci_unmap_len_set(e, maplen, bufsize); + return 0; +} + +/* Free all unused buffers in receive ring, assumes receiver stopped */ +static void skge_rx_clean(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + struct skge_ring *ring = &skge->rx_ring; + struct skge_element *e; + + for (e = ring->to_clean; e != ring->to_use; e = e->next) { + struct skge_rx_desc *rd = e->desc; + rd->control = 0; + + pci_unmap_single(hw->pdev, + pci_unmap_addr(e, mapaddr), + pci_unmap_len(e, maplen), + PCI_DMA_FROMDEVICE); + dev_kfree_skb(e->skb); + e->skb = NULL; + } + ring->to_clean = e; +} + +/* Allocate buffers for receive ring + * For receive: to_use is refill location + * to_clean is next received frame. + * + * if (to_use == to_clean) + * then ring all frames in ring need buffers + * if (to_use->next == to_clean) + * then ring all frames in ring have buffers + */ +static int skge_rx_fill(struct skge_port *skge) +{ + struct skge_ring *ring = &skge->rx_ring; + struct skge_element *e; + int ret = 0; + + for (e = ring->to_use; e->next != ring->to_clean; e = e->next) { + if (skge_rx_alloc(skge, e)) { + ret = 1; + break; + } + + } + ring->to_use = e; + + return ret; +} + +static void skge_link_up(struct skge_port *skge) +{ + netif_carrier_on(skge->netdev); + if (skge->tx_avail > MAX_SKB_FRAGS + 1) + netif_wake_queue(skge->netdev); + + if (netif_msg_link(skge)) + printk(KERN_INFO PFX + "%s: Link is up at %d Mbps, %s duplex, flow control %s\n", + skge->netdev->name, skge->speed, + skge->duplex == DUPLEX_FULL ? "full" : "half", + (skge->flow_control == FLOW_MODE_NONE) ? "none" : + (skge->flow_control == FLOW_MODE_LOC_SEND) ? "tx only" : + (skge->flow_control == FLOW_MODE_REM_SEND) ? "rx only" : + (skge->flow_control == FLOW_MODE_SYMMETRIC) ? "tx and rx" : + "unknown"); +} + +static void skge_link_down(struct skge_port *skge) +{ + netif_carrier_off(skge->netdev); + netif_stop_queue(skge->netdev); + + if (netif_msg_link(skge)) + printk(KERN_INFO PFX "%s: Link is down.\n", skge->netdev->name); +} + +static u16 skge_xm_phy_read(struct skge_hw *hw, int port, u16 reg) +{ + int i; + u16 v; + + skge_xm_write16(hw, port, XM_PHY_ADDR, reg | hw->phy_addr); + v = skge_xm_read16(hw, port, XM_PHY_DATA); + if (hw->phy_type != SK_PHY_XMAC) { + for (i = 0; i < PHY_RETRIES; i++) { + udelay(1); + if (skge_xm_read16(hw, port, XM_MMU_CMD) + & XM_MMU_PHY_RDY) + goto ready; + } + + printk(KERN_WARNING PFX "%s: phy read timed out\n", + hw->dev[port]->name); + return 0; + ready: + v = skge_xm_read16(hw, port, XM_PHY_DATA); + } + + return v; +} + +static void skge_xm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val) +{ + int i; + + skge_xm_write16(hw, port, XM_PHY_ADDR, reg | hw->phy_addr); + for (i = 0; i < PHY_RETRIES; i++) { + if (!(skge_xm_read16(hw, port, XM_MMU_CMD) & XM_MMU_PHY_BUSY)) + goto ready; + cpu_relax(); + } + printk(KERN_WARNING PFX "%s: phy write failed to come ready\n", + hw->dev[port]->name); + + + ready: + skge_xm_write16(hw, port, XM_PHY_DATA, val); + for (i = 0; i < PHY_RETRIES; i++) { + udelay(1); + if (!(skge_xm_read16(hw, port, XM_MMU_CMD) & XM_MMU_PHY_BUSY)) + return; + } + printk(KERN_WARNING PFX "%s: phy write timed out\n", + hw->dev[port]->name); +} + +static void genesis_init(struct skge_hw *hw) +{ + /* set blink source counter */ + skge_write32(hw, B2_BSC_INI, (SK_BLK_DUR * SK_FACT_53) / 100); + skge_write8(hw, B2_BSC_CTRL, BSC_START); + + /* configure mac arbiter */ + skge_write16(hw, B3_MA_TO_CTRL, MA_RST_CLR); + + /* configure mac arbiter timeout values */ + skge_write8(hw, B3_MA_TOINI_RX1, SK_MAC_TO_53); + skge_write8(hw, B3_MA_TOINI_RX2, SK_MAC_TO_53); + skge_write8(hw, B3_MA_TOINI_TX1, SK_MAC_TO_53); + skge_write8(hw, B3_MA_TOINI_TX2, SK_MAC_TO_53); + + skge_write8(hw, B3_MA_RCINI_RX1, 0); + skge_write8(hw, B3_MA_RCINI_RX2, 0); + skge_write8(hw, B3_MA_RCINI_TX1, 0); + skge_write8(hw, B3_MA_RCINI_TX2, 0); + + /* configure packet arbiter timeout */ + skge_write16(hw, B3_PA_CTRL, PA_RST_CLR); + skge_write16(hw, B3_PA_TOINI_RX1, SK_PKT_TO_MAX); + skge_write16(hw, B3_PA_TOINI_TX1, SK_PKT_TO_MAX); + skge_write16(hw, B3_PA_TOINI_RX2, SK_PKT_TO_MAX); + skge_write16(hw, B3_PA_TOINI_TX2, SK_PKT_TO_MAX); +} + +static void genesis_reset(struct skge_hw *hw, int port) +{ + int i; + u64 zero = 0; + + /* reset the statistics module */ + skge_xm_write32(hw, port, XM_GP_PORT, XM_GP_RES_STAT); + skge_xm_write16(hw, port, XM_IMSK, 0xffff); /* disable XMAC IRQs */ + skge_xm_write32(hw, port, XM_MODE, 0); /* clear Mode Reg */ + skge_xm_write16(hw, port, XM_TX_CMD, 0); /* reset TX CMD Reg */ + skge_xm_write16(hw, port, XM_RX_CMD, 0); /* reset RX CMD Reg */ + + /* disable all PHY IRQs */ + if (hw->phy_type == SK_PHY_BCOM) + skge_xm_write16(hw, port, PHY_BCOM_INT_MASK, 0xffff); + + skge_xm_outhash(hw, port, XM_HSM, (u8 *) &zero); + for (i = 0; i < 15; i++) + skge_xm_outaddr(hw, port, XM_EXM(i), (u8 *) &zero); + skge_xm_outhash(hw, port, XM_SRC_CHK, (u8 *) &zero); +} + + +static void genesis_mac_init(struct skge_hw *hw, int port) +{ + struct skge_port *skge = netdev_priv(hw->dev[port]); + int i; + u32 r; + u16 id1; + u16 ctrl1, ctrl2, ctrl3, ctrl4, ctrl5; + + /* magic workaround patterns for Broadcom */ + static const struct { + u16 reg; + u16 val; + } A1hack[] = { + { 0x18, 0x0c20 }, { 0x17, 0x0012 }, { 0x15, 0x1104 }, + { 0x17, 0x0013 }, { 0x15, 0x0404 }, { 0x17, 0x8006 }, + { 0x15, 0x0132 }, { 0x17, 0x8006 }, { 0x15, 0x0232 }, + { 0x17, 0x800D }, { 0x15, 0x000F }, { 0x18, 0x0420 }, + }, C0hack[] = { + { 0x18, 0x0c20 }, { 0x17, 0x0012 }, { 0x15, 0x1204 }, + { 0x17, 0x0013 }, { 0x15, 0x0A04 }, { 0x18, 0x0420 }, + }; + + + /* initialize Rx, Tx and Link LED */ + skge_write8(hw, SKGEMAC_REG(port, LNK_LED_REG), LINKLED_ON); + skge_write8(hw, SKGEMAC_REG(port, LNK_LED_REG), LINKLED_LINKSYNC_ON); + + skge_write8(hw, SKGEMAC_REG(port, RX_LED_CTRL), LED_START); + skge_write8(hw, SKGEMAC_REG(port, TX_LED_CTRL), LED_START); + + /* Unreset the XMAC. */ + skge_write16(hw, SKGEMAC_REG(port, TX_MFF_CTRL1), MFF_CLR_MAC_RST); + + /* + * Perform additional initialization for external PHYs, + * namely for the 1000baseTX cards that use the XMAC's + * GMII mode. + */ + spin_lock_bh(&hw->phy_lock); + if (hw->phy_type != SK_PHY_XMAC) { + /* Take PHY out of reset. */ + r = skge_read32(hw, B2_GP_IO); + if (port == 0) + r |= GP_DIR_0|GP_IO_0; + else + r |= GP_DIR_2|GP_IO_2; + + skge_write32(hw, B2_GP_IO, r); + skge_read32(hw, B2_GP_IO); + + /* Enable GMII mode on the XMAC. */ + skge_xm_write16(hw, port, XM_HW_CFG, XM_HW_GMII_MD); + + id1 = skge_xm_phy_read(hw, port, PHY_XMAC_ID1); + + /* Optimize MDIO transfer by suppressing preamble. */ + skge_xm_write16(hw, port, XM_MMU_CMD, + skge_xm_read16(hw, port, XM_MMU_CMD) + | XM_MMU_NO_PRE); + + if (id1 == PHY_BCOM_ID1_C0) { + /* + * Workaround BCOM Errata for the C0 type. + * Write magic patterns to reserved registers. + */ + for (i = 0; i < ARRAY_SIZE(C0hack); i++) + skge_xm_phy_write(hw, port, + C0hack[i].reg, C0hack[i].val); + + } else if (id1 == PHY_BCOM_ID1_A1) { + /* + * Workaround BCOM Errata for the A1 type. + * Write magic patterns to reserved registers. + */ + for (i = 0; i < ARRAY_SIZE(A1hack); i++) + skge_xm_phy_write(hw, port, + A1hack[i].reg, A1hack[i].val); + } + + /* + * Workaround BCOM Errata (#10523) for all BCom PHYs. + * Disable Power Management after reset. + */ + r = skge_xm_phy_read(hw, port, PHY_BCOM_AUX_CTRL); + skge_xm_phy_write(hw, port, PHY_BCOM_AUX_CTRL, r | PHY_B_AC_DIS_PM); + } + + /* Dummy read */ + skge_xm_read16(hw, port, XM_ISRC); + + r = skge_xm_read32(hw, port, XM_MODE); + skge_xm_write32(hw, port, XM_MODE, r|XM_MD_CSA); + + /* We don't need the FCS appended to the packet. */ + r = skge_xm_read16(hw, port, XM_RX_CMD); + skge_xm_write16(hw, port, XM_RX_CMD, r | XM_RX_STRIP_FCS); + + /* We want short frames padded to 60 bytes. */ + r = skge_xm_read16(hw, port, XM_TX_CMD); + skge_xm_write16(hw, port, XM_TX_CMD, r | XM_TX_AUTO_PAD); + + /* + * Enable the reception of all error frames. This is is + * a necessary evil due to the design of the XMAC. The + * XMAC's receive FIFO is only 8K in size, however jumbo + * frames can be up to 9000 bytes in length. When bad + * frame filtering is enabled, the XMAC's RX FIFO operates + * in 'store and forward' mode. For this to work, the + * entire frame has to fit into the FIFO, but that means + * that jumbo frames larger than 8192 bytes will be + * truncated. Disabling all bad frame filtering causes + * the RX FIFO to operate in streaming mode, in which + * case the XMAC will start transfering frames out of the + * RX FIFO as soon as the FIFO threshold is reached. + */ + r = skge_xm_read32(hw, port, XM_MODE); + skge_xm_write32(hw, port, XM_MODE, + XM_MD_RX_CRCE|XM_MD_RX_LONG|XM_MD_RX_RUNT| + XM_MD_RX_ERR|XM_MD_RX_IRLE); + + skge_xm_outaddr(hw, port, XM_SA, hw->dev[port]->dev_addr); + skge_xm_outaddr(hw, port, XM_EXM(0), hw->dev[port]->dev_addr); + + /* + * Bump up the transmit threshold. This helps hold off transmit + * underruns when we're blasting traffic from both ports at once. + */ + skge_xm_write16(hw, port, XM_TX_THR, 512); + + /* Configure MAC arbiter */ + skge_write16(hw, B3_MA_TO_CTRL, MA_RST_CLR); + + /* configure timeout values */ + skge_write8(hw, B3_MA_TOINI_RX1, 72); + skge_write8(hw, B3_MA_TOINI_RX2, 72); + skge_write8(hw, B3_MA_TOINI_TX1, 72); + skge_write8(hw, B3_MA_TOINI_TX2, 72); + + skge_write8(hw, B3_MA_RCINI_RX1, 0); + skge_write8(hw, B3_MA_RCINI_RX2, 0); + skge_write8(hw, B3_MA_RCINI_TX1, 0); + skge_write8(hw, B3_MA_RCINI_TX2, 0); + + /* Configure Rx MAC FIFO */ + skge_write8(hw, SKGEMAC_REG(port, RX_MFF_CTRL2), MFF_RST_CLR); + skge_write16(hw, SKGEMAC_REG(port, RX_MFF_CTRL1), MFF_ENA_TIM_PAT); + skge_write8(hw, SKGEMAC_REG(port, RX_MFF_CTRL2), MFF_ENA_OP_MD); + + /* Configure Tx MAC FIFO */ + skge_write8(hw, SKGEMAC_REG(port, TX_MFF_CTRL2), MFF_RST_CLR); + skge_write16(hw, SKGEMAC_REG(port, TX_MFF_CTRL1), MFF_TX_CTRL_DEF); + skge_write8(hw, SKGEMAC_REG(port, TX_MFF_CTRL2), MFF_ENA_OP_MD); + + if (hw->dev[port]->mtu > ETH_DATA_LEN) { + /* Enable frame flushing if jumbo frames used */ + skge_write16(hw, SKGEMAC_REG(port,RX_MFF_CTRL1), MFF_ENA_FLUSH); + } else { + /* enable timeout timers if normal frames */ + skge_write16(hw, B3_PA_CTRL, + port == 0 ? PA_ENA_TO_TX1 : PA_ENA_TO_TX2); + } + + + r = skge_xm_read16(hw, port, XM_RX_CMD); + if (hw->dev[port]->mtu > ETH_DATA_LEN) + skge_xm_write16(hw, port, XM_RX_CMD, r | XM_RX_BIG_PK_OK); + else + skge_xm_write16(hw, port, XM_RX_CMD, r & ~(XM_RX_BIG_PK_OK)); + + switch (hw->phy_type) { + case SK_PHY_XMAC: + if (skge->autoneg == AUTONEG_ENABLE) { + ctrl1 = PHY_X_AN_FD | PHY_X_AN_HD; + + switch (skge->flow_control) { + case FLOW_MODE_NONE: + ctrl1 |= PHY_X_P_NO_PAUSE; + break; + case FLOW_MODE_LOC_SEND: + ctrl1 |= PHY_X_P_ASYM_MD; + break; + case FLOW_MODE_SYMMETRIC: + ctrl1 |= PHY_X_P_SYM_MD; + break; + case FLOW_MODE_REM_SEND: + ctrl1 |= PHY_X_P_BOTH_MD; + break; + } + + skge_xm_phy_write(hw, port, PHY_XMAC_AUNE_ADV, ctrl1); + ctrl2 = PHY_CT_ANE | PHY_CT_RE_CFG; + } else { + ctrl2 = 0; + if (skge->duplex == DUPLEX_FULL) + ctrl2 |= PHY_CT_DUP_MD; + } + + skge_xm_phy_write(hw, port, PHY_XMAC_CTRL, ctrl2); + break; + + case SK_PHY_BCOM: + ctrl1 = PHY_CT_SP1000; + ctrl2 = 0; + ctrl3 = PHY_SEL_TYPE; + ctrl4 = PHY_B_PEC_EN_LTR; + ctrl5 = PHY_B_AC_TX_TST; + + if (skge->autoneg == AUTONEG_ENABLE) { + /* + * Workaround BCOM Errata #1 for the C5 type. + * 1000Base-T Link Acquisition Failure in Slave Mode + * Set Repeater/DTE bit 10 of the 1000Base-T Control Register + */ + ctrl2 |= PHY_B_1000C_RD; + if (skge->advertising & ADVERTISED_1000baseT_Half) + ctrl2 |= PHY_B_1000C_AHD; + if (skge->advertising & ADVERTISED_1000baseT_Full) + ctrl2 |= PHY_B_1000C_AFD; + + /* Set Flow-control capabilities */ + switch (skge->flow_control) { + case FLOW_MODE_NONE: + ctrl3 |= PHY_B_P_NO_PAUSE; + break; + case FLOW_MODE_LOC_SEND: + ctrl3 |= PHY_B_P_ASYM_MD; + break; + case FLOW_MODE_SYMMETRIC: + ctrl3 |= PHY_B_P_SYM_MD; + break; + case FLOW_MODE_REM_SEND: + ctrl3 |= PHY_B_P_BOTH_MD; + break; + } + + /* Restart Auto-negotiation */ + ctrl1 |= PHY_CT_ANE | PHY_CT_RE_CFG; + } else { + if (skge->duplex == DUPLEX_FULL) + ctrl1 |= PHY_CT_DUP_MD; + + ctrl2 |= PHY_B_1000C_MSE; /* set it to Slave */ + } + + skge_xm_phy_write(hw, port, PHY_BCOM_1000T_CTRL, ctrl2); + skge_xm_phy_write(hw, port, PHY_BCOM_AUNE_ADV, ctrl3); + + if (skge->netdev->mtu > ETH_DATA_LEN) { + ctrl4 |= PHY_B_PEC_HIGH_LA; + ctrl5 |= PHY_B_AC_LONG_PACK; + + skge_xm_phy_write(hw, port,PHY_BCOM_AUX_CTRL, ctrl5); + } + + skge_xm_phy_write(hw, port, PHY_BCOM_P_EXT_CTRL, ctrl4); + skge_xm_phy_write(hw, port, PHY_BCOM_CTRL, ctrl1); + break; + } + spin_unlock_bh(&hw->phy_lock); + + /* Clear MIB counters */ + skge_xm_write16(hw, port, XM_STAT_CMD, + XM_SC_CLR_RXC | XM_SC_CLR_TXC); + /* Clear two times according to Errata #3 */ + skge_xm_write16(hw, port, XM_STAT_CMD, + XM_SC_CLR_RXC | XM_SC_CLR_TXC); + + /* Start polling for link status */ + mod_timer(&skge->link_check, jiffies + LINK_POLL_HZ); +} + +static void genesis_stop(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + + /* Clear Tx packet arbiter timeout IRQ */ + skge_write16(hw, B3_PA_CTRL, + port == 0 ? PA_CLR_TO_TX1 : PA_CLR_TO_TX2); + + /* + * If the transfer stucks at the MAC the STOP command will not + * terminate if we don't flush the XMAC's transmit FIFO ! + */ + skge_xm_write32(hw, port, XM_MODE, + skge_xm_read32(hw, port, XM_MODE)|XM_MD_FTF); + + + /* Reset the MAC */ + skge_write16(hw, SKGEMAC_REG(port, TX_MFF_CTRL1), MFF_SET_MAC_RST); + + /* For external PHYs there must be special handling */ + if (hw->phy_type != SK_PHY_XMAC) { + u32 reg = skge_read32(hw, B2_GP_IO); + + if (port == 0) { + reg |= GP_DIR_0; + reg &= ~GP_IO_0; + } else { + reg |= GP_DIR_2; + reg &= ~GP_IO_2; + } + skge_write32(hw, B2_GP_IO, reg); + skge_read32(hw, B2_GP_IO); + } + + skge_xm_write16(hw, port, XM_MMU_CMD, + skge_xm_read16(hw, port, XM_MMU_CMD) + & ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX)); + + skge_xm_read16(hw, port, XM_MMU_CMD); +} + + +static void genesis_get_stats(struct skge_port *skge, u64 *data) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + int i; + unsigned long timeout = jiffies + HZ; + + skge_xm_write16(hw, port, + XM_STAT_CMD, XM_SC_SNP_TXC | XM_SC_SNP_RXC); + + /* wait for update to complete */ + while (skge_xm_read16(hw, port, XM_STAT_CMD) + & (XM_SC_SNP_TXC | XM_SC_SNP_RXC)) { + if (time_after(jiffies, timeout)) + break; + udelay(10); + } + + /* special case for 64 bit octet counter */ + data[0] = (u64) skge_xm_read32(hw, port, XM_TXO_OK_HI) << 32 + | skge_xm_read32(hw, port, XM_TXO_OK_LO); + data[1] = (u64) skge_xm_read32(hw, port, XM_RXO_OK_HI) << 32 + | skge_xm_read32(hw, port, XM_RXO_OK_LO); + + for (i = 2; i < ARRAY_SIZE(skge_stats); i++) + data[i] = skge_xm_read32(hw, port, skge_stats[i].xmac_offset); +} + +static void genesis_mac_intr(struct skge_hw *hw, int port) +{ + struct skge_port *skge = netdev_priv(hw->dev[port]); + u16 status = skge_xm_read16(hw, port, XM_ISRC); + + pr_debug("genesis_intr status %x\n", status); + if (hw->phy_type == SK_PHY_XMAC) { + /* LInk down, start polling for state change */ + if (status & XM_IS_INP_ASS) { + skge_xm_write16(hw, port, XM_IMSK, + skge_xm_read16(hw, port, XM_IMSK) | XM_IS_INP_ASS); + mod_timer(&skge->link_check, jiffies + LINK_POLL_HZ); + } + else if (status & XM_IS_AND) + mod_timer(&skge->link_check, jiffies + LINK_POLL_HZ); + } + + if (status & XM_IS_TXF_UR) { + skge_xm_write32(hw, port, XM_MODE, XM_MD_FTF); + ++skge->net_stats.tx_fifo_errors; + } + if (status & XM_IS_RXF_OV) { + skge_xm_write32(hw, port, XM_MODE, XM_MD_FRF); + ++skge->net_stats.rx_fifo_errors; + } +} + +static void skge_gm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val) +{ + int i; + + skge_gma_write16(hw, port, GM_SMI_DATA, val); + skge_gma_write16(hw, port, GM_SMI_CTRL, + GM_SMI_CT_PHY_AD(hw->phy_addr) | GM_SMI_CT_REG_AD(reg)); + for (i = 0; i < PHY_RETRIES; i++) { + udelay(1); + + if (!(skge_gma_read16(hw, port, GM_SMI_CTRL) & GM_SMI_CT_BUSY)) + break; + } +} + +static u16 skge_gm_phy_read(struct skge_hw *hw, int port, u16 reg) +{ + int i; + + skge_gma_write16(hw, port, GM_SMI_CTRL, + GM_SMI_CT_PHY_AD(hw->phy_addr) + | GM_SMI_CT_REG_AD(reg) | GM_SMI_CT_OP_RD); + + for (i = 0; i < PHY_RETRIES; i++) { + udelay(1); + if (skge_gma_read16(hw, port, GM_SMI_CTRL) & GM_SMI_CT_RD_VAL) + goto ready; + } + + printk(KERN_WARNING PFX "%s: phy read timeout\n", + hw->dev[port]->name); + return 0; + ready: + return skge_gma_read16(hw, port, GM_SMI_DATA); +} + +static void genesis_link_down(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + + pr_debug("genesis_link_down\n"); + + skge_xm_write16(hw, port, XM_MMU_CMD, + skge_xm_read16(hw, port, XM_MMU_CMD) + & ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX)); + + /* dummy read to ensure writing */ + (void) skge_xm_read16(hw, port, XM_MMU_CMD); + + skge_link_down(skge); +} + +static void genesis_link_up(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + u16 cmd; + u32 mode, msk; + + pr_debug("genesis_link_up\n"); + cmd = skge_xm_read16(hw, port, XM_MMU_CMD); + + /* + * enabling pause frame reception is required for 1000BT + * because the XMAC is not reset if the link is going down + */ + if (skge->flow_control == FLOW_MODE_NONE || + skge->flow_control == FLOW_MODE_LOC_SEND) + cmd |= XM_MMU_IGN_PF; + else + /* Enable Pause Frame Reception */ + cmd &= ~XM_MMU_IGN_PF; + + skge_xm_write16(hw, port, XM_MMU_CMD, cmd); + + mode = skge_xm_read32(hw, port, XM_MODE); + if (skge->flow_control == FLOW_MODE_SYMMETRIC || + skge->flow_control == FLOW_MODE_LOC_SEND) { + /* + * Configure Pause Frame Generation + * Use internal and external Pause Frame Generation. + * Sending pause frames is edge triggered. + * Send a Pause frame with the maximum pause time if + * internal oder external FIFO full condition occurs. + * Send a zero pause time frame to re-start transmission. + */ + /* XM_PAUSE_DA = '010000C28001' (default) */ + /* XM_MAC_PTIME = 0xffff (maximum) */ + /* remember this value is defined in big endian (!) */ + skge_xm_write16(hw, port, XM_MAC_PTIME, 0xffff); + + mode |= XM_PAUSE_MODE; + skge_write16(hw, SKGEMAC_REG(port, RX_MFF_CTRL1), MFF_ENA_PAUSE); + } else { + /* + * disable pause frame generation is required for 1000BT + * because the XMAC is not reset if the link is going down + */ + /* Disable Pause Mode in Mode Register */ + mode &= ~XM_PAUSE_MODE; + + skge_write16(hw, SKGEMAC_REG(port, RX_MFF_CTRL1), MFF_DIS_PAUSE); + } + + skge_xm_write32(hw, port, XM_MODE, mode); + + msk = XM_DEF_MSK; + if (hw->phy_type != SK_PHY_XMAC) + msk |= XM_IS_INP_ASS; /* disable GP0 interrupt bit */ + + skge_xm_write16(hw, port, XM_IMSK, msk); + skge_xm_read16(hw, port, XM_ISRC); + + /* get MMU Command Reg. */ + cmd = skge_xm_read16(hw, port, XM_MMU_CMD); + if (hw->phy_type != SK_PHY_XMAC && skge->duplex == DUPLEX_FULL) + cmd |= XM_MMU_GMII_FD; + + if (hw->phy_type == SK_PHY_BCOM) { + /* + * Workaround BCOM Errata (#10523) for all BCom Phys + * Enable Power Management after link up + */ + skge_xm_phy_write(hw, port, PHY_BCOM_AUX_CTRL, + skge_xm_phy_read(hw, port, PHY_BCOM_AUX_CTRL) + & ~PHY_B_AC_DIS_PM); + skge_xm_phy_write(hw, port, PHY_BCOM_INT_MASK, + PHY_B_DEF_MSK); + } + + /* enable Rx/Tx */ + skge_xm_write16(hw, port, XM_MMU_CMD, + cmd | XM_MMU_ENA_RX | XM_MMU_ENA_TX); + skge_link_up(skge); +} + + +static void genesis_bcom_intr(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + u16 stat = skge_xm_phy_read(hw, port, PHY_BCOM_INT_STAT); + + pr_debug("genesis_bcom intr stat=%x\n", stat); + + /* Workaround BCom Errata: + * enable and disable loopback mode if "NO HCD" occurs. + */ + if (stat & PHY_B_IS_NO_HDCL) { + u16 ctrl = skge_xm_phy_read(hw, port, PHY_BCOM_CTRL); + skge_xm_phy_write(hw, port, PHY_BCOM_CTRL, + ctrl | PHY_CT_LOOP); + skge_xm_phy_write(hw, port, PHY_BCOM_CTRL, + ctrl & ~PHY_CT_LOOP); + } + + stat = skge_xm_phy_read(hw, port, PHY_BCOM_STAT); + if (stat & (PHY_B_IS_AN_PR | PHY_B_IS_LST_CHANGE)) { + u16 aux = skge_xm_phy_read(hw, port, PHY_BCOM_AUX_STAT); + if ( !(aux & PHY_B_AS_LS) && netif_carrier_ok(skge->netdev)) + genesis_link_down(skge); + + else if (stat & PHY_B_IS_LST_CHANGE) { + if (aux & PHY_B_AS_AN_C) { + switch (aux & PHY_B_AS_AN_RES_MSK) { + case PHY_B_RES_1000FD: + skge->duplex = DUPLEX_FULL; + break; + case PHY_B_RES_1000HD: + skge->duplex = DUPLEX_HALF; + break; + } + + switch (aux & PHY_B_AS_PAUSE_MSK) { + case PHY_B_AS_PAUSE_MSK: + skge->flow_control = FLOW_MODE_SYMMETRIC; + break; + case PHY_B_AS_PRR: + skge->flow_control = FLOW_MODE_REM_SEND; + break; + case PHY_B_AS_PRT: + skge->flow_control = FLOW_MODE_LOC_SEND; + break; + default: + skge->flow_control = FLOW_MODE_NONE; + } + skge->speed = SPEED_1000; + } + genesis_link_up(skge); + } + else + mod_timer(&skge->link_check, jiffies + LINK_POLL_HZ); + } +} + +/* Perodic poll of phy status to check for link transistion */ +static void skge_link_timer(unsigned long __arg) +{ + struct skge_port *skge = (struct skge_port *) __arg; + struct skge_hw *hw = skge->hw; + int port = skge->port; + + if (hw->chip_id != CHIP_ID_GENESIS || !netif_running(skge->netdev)) + return; + + spin_lock_bh(&hw->phy_lock); + if (hw->phy_type == SK_PHY_BCOM) + genesis_bcom_intr(skge); + else { + int i; + for (i = 0; i < 3; i++) + if (skge_xm_read16(hw, port, XM_ISRC) & XM_IS_INP_ASS) + break; + + if (i == 3) + mod_timer(&skge->link_check, jiffies + LINK_POLL_HZ); + else + genesis_link_up(skge); + } + spin_unlock_bh(&hw->phy_lock); +} + +/* Marvell Phy Initailization */ +static void yukon_init(struct skge_hw *hw, int port) +{ + struct skge_port *skge = netdev_priv(hw->dev[port]); + u16 ctrl, ct1000, adv; + u16 ledctrl, ledover; + + pr_debug("yukon_init\n"); + if (skge->autoneg == AUTONEG_ENABLE) { + u16 ectrl = skge_gm_phy_read(hw, port, PHY_MARV_EXT_CTRL); + + ectrl &= ~(PHY_M_EC_M_DSC_MSK | PHY_M_EC_S_DSC_MSK | + PHY_M_EC_MAC_S_MSK); + ectrl |= PHY_M_EC_MAC_S(MAC_TX_CLK_25_MHZ); + + /* on PHY 88E1111 there is a change for downshift control */ + if (hw->chip_id == CHIP_ID_YUKON_EC) + ectrl |= PHY_M_EC_M_DSC_2(0) | PHY_M_EC_DOWN_S_ENA; + else + ectrl |= PHY_M_EC_M_DSC(0) | PHY_M_EC_S_DSC(1); + + skge_gm_phy_write(hw, port, PHY_MARV_EXT_CTRL, ectrl); + } + + ctrl = skge_gm_phy_read(hw, port, PHY_MARV_CTRL); + if (skge->autoneg == AUTONEG_DISABLE) + ctrl &= ~PHY_CT_ANE; + + ctrl |= PHY_CT_RESET; + skge_gm_phy_write(hw, port, PHY_MARV_CTRL, ctrl); + + ctrl = 0; + ct1000 = 0; + adv = PHY_SEL_TYPE; + + if (skge->autoneg == AUTONEG_ENABLE) { + if (iscopper(hw)) { + if (skge->advertising & ADVERTISED_1000baseT_Full) + ct1000 |= PHY_M_1000C_AFD; + if (skge->advertising & ADVERTISED_1000baseT_Half) + ct1000 |= PHY_M_1000C_AHD; + if (skge->advertising & ADVERTISED_100baseT_Full) + adv |= PHY_M_AN_100_FD; + if (skge->advertising & ADVERTISED_100baseT_Half) + adv |= PHY_M_AN_100_HD; + if (skge->advertising & ADVERTISED_10baseT_Full) + adv |= PHY_M_AN_10_FD; + if (skge->advertising & ADVERTISED_10baseT_Half) + adv |= PHY_M_AN_10_HD; + + /* Set Flow-control capabilities */ + switch (skge->flow_control) { + case FLOW_MODE_NONE: + adv |= PHY_B_P_NO_PAUSE; + break; + case FLOW_MODE_LOC_SEND: + adv |= PHY_B_P_ASYM_MD; + break; + case FLOW_MODE_SYMMETRIC: + adv |= PHY_B_P_SYM_MD; + break; + case FLOW_MODE_REM_SEND: + adv |= PHY_B_P_BOTH_MD; + break; + } + } else { /* special defines for FIBER (88E1011S only) */ + adv |= PHY_M_AN_1000X_AHD | PHY_M_AN_1000X_AFD; + + /* Set Flow-control capabilities */ + switch (skge->flow_control) { + case FLOW_MODE_NONE: + adv |= PHY_M_P_NO_PAUSE_X; + break; + case FLOW_MODE_LOC_SEND: + adv |= PHY_M_P_ASYM_MD_X; + break; + case FLOW_MODE_SYMMETRIC: + adv |= PHY_M_P_SYM_MD_X; + break; + case FLOW_MODE_REM_SEND: + adv |= PHY_M_P_BOTH_MD_X; + break; + } + } + /* Restart Auto-negotiation */ + ctrl |= PHY_CT_ANE | PHY_CT_RE_CFG; + } else { + /* forced speed/duplex settings */ + ct1000 = PHY_M_1000C_MSE; + + if (skge->duplex == DUPLEX_FULL) + ctrl |= PHY_CT_DUP_MD; + + switch (skge->speed) { + case SPEED_1000: + ctrl |= PHY_CT_SP1000; + break; + case SPEED_100: + ctrl |= PHY_CT_SP100; + break; + } + + ctrl |= PHY_CT_RESET; + } + + if (hw->chip_id != CHIP_ID_YUKON_FE) + skge_gm_phy_write(hw, port, PHY_MARV_1000T_CTRL, ct1000); + + skge_gm_phy_write(hw, port, PHY_MARV_AUNE_ADV, adv); + skge_gm_phy_write(hw, port, PHY_MARV_CTRL, ctrl); + + /* Setup Phy LED's */ + ledctrl = PHY_M_LED_PULS_DUR(PULS_170MS); + ledover = 0; + + if (hw->chip_id == CHIP_ID_YUKON_FE) { + /* on 88E3082 these bits are at 11..9 (shifted left) */ + ledctrl |= PHY_M_LED_BLINK_RT(BLINK_84MS) << 1; + + skge_gm_phy_write(hw, port, PHY_MARV_FE_LED_PAR, + ((skge_gm_phy_read(hw, port, PHY_MARV_FE_LED_PAR) + + & ~PHY_M_FELP_LED1_MSK) + | PHY_M_FELP_LED1_CTRL(LED_PAR_CTRL_ACT_BL))); + } else { + /* set Tx LED (LED_TX) to blink mode on Rx OR Tx activity */ + ledctrl |= PHY_M_LED_BLINK_RT(BLINK_84MS) | PHY_M_LEDC_TX_CTRL; + + /* turn off the Rx LED (LED_RX) */ + ledover |= PHY_M_LED_MO_RX(MO_LED_OFF); + } + + /* disable blink mode (LED_DUPLEX) on collisions */ + ctrl |= PHY_M_LEDC_DP_CTRL; + skge_gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl); + + if (skge->autoneg == AUTONEG_DISABLE || skge->speed == SPEED_100) { + /* turn on 100 Mbps LED (LED_LINK100) */ + ledover |= PHY_M_LED_MO_100(MO_LED_ON); + } + + if (ledover) + skge_gm_phy_write(hw, port, PHY_MARV_LED_OVER, ledover); + + /* Enable phy interrupt on autonegotiation complete (or link up) */ + if (skge->autoneg == AUTONEG_ENABLE) + skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_IS_AN_COMPL); + else + skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_DEF_MSK); +} + +static void yukon_reset(struct skge_hw *hw, int port) +{ + skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, 0);/* disable PHY IRQs */ + skge_gma_write16(hw, port, GM_MC_ADDR_H1, 0); /* clear MC hash */ + skge_gma_write16(hw, port, GM_MC_ADDR_H2, 0); + skge_gma_write16(hw, port, GM_MC_ADDR_H3, 0); + skge_gma_write16(hw, port, GM_MC_ADDR_H4, 0); + + skge_gma_write16(hw, port, GM_RX_CTRL, + skge_gma_read16(hw, port, GM_RX_CTRL) + | GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA); +} + +static void yukon_mac_init(struct skge_hw *hw, int port) +{ + struct skge_port *skge = netdev_priv(hw->dev[port]); + int i; + u32 reg; + const u8 *addr = hw->dev[port]->dev_addr; + + /* WA code for COMA mode -- set PHY reset */ + if (hw->chip_id == CHIP_ID_YUKON_LITE && + chip_rev(hw) == CHIP_REV_YU_LITE_A3) + skge_write32(hw, B2_GP_IO, + (skge_read32(hw, B2_GP_IO) | GP_DIR_9 | GP_IO_9)); + + /* hard reset */ + skge_write32(hw, SKGEMAC_REG(port, GPHY_CTRL), GPC_RST_SET); + skge_write32(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_RST_SET); + + /* WA code for COMA mode -- clear PHY reset */ + if (hw->chip_id == CHIP_ID_YUKON_LITE && + chip_rev(hw) == CHIP_REV_YU_LITE_A3) + skge_write32(hw, B2_GP_IO, + (skge_read32(hw, B2_GP_IO) | GP_DIR_9) + & ~GP_IO_9); + + /* Set hardware config mode */ + reg = GPC_INT_POL_HI | GPC_DIS_FC | GPC_DIS_SLEEP | + GPC_ENA_XC | GPC_ANEG_ADV_ALL_M | GPC_ENA_PAUSE; + reg |= iscopper(hw) ? GPC_HWCFG_GMII_COP : GPC_HWCFG_GMII_FIB; + + /* Clear GMC reset */ + skge_write32(hw, SKGEMAC_REG(port, GPHY_CTRL), reg | GPC_RST_SET); + skge_write32(hw, SKGEMAC_REG(port, GPHY_CTRL), reg | GPC_RST_CLR); + skge_write32(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_PAUSE_ON | GMC_RST_CLR); + if (skge->autoneg == AUTONEG_DISABLE) { + reg = GM_GPCR_AU_ALL_DIS; + skge_gma_write16(hw, port, GM_GP_CTRL, + skge_gma_read16(hw, port, GM_GP_CTRL) | reg); + + switch (skge->speed) { + case SPEED_1000: + reg |= GM_GPCR_SPEED_1000; + /* fallthru */ + case SPEED_100: + reg |= GM_GPCR_SPEED_100; + } + + if (skge->duplex == DUPLEX_FULL) + reg |= GM_GPCR_DUP_FULL; + } else + reg = GM_GPCR_SPEED_1000 | GM_GPCR_SPEED_100 | GM_GPCR_DUP_FULL; + switch (skge->flow_control) { + case FLOW_MODE_NONE: + skge_write32(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_PAUSE_OFF); + reg |= GM_GPCR_FC_TX_DIS | GM_GPCR_FC_RX_DIS | GM_GPCR_AU_FCT_DIS; + break; + case FLOW_MODE_LOC_SEND: + /* disable Rx flow-control */ + reg |= GM_GPCR_FC_RX_DIS | GM_GPCR_AU_FCT_DIS; + } + + skge_gma_write16(hw, port, GM_GP_CTRL, reg); + skge_read16(hw, GMAC_IRQ_SRC); + + spin_lock_bh(&hw->phy_lock); + yukon_init(hw, port); + spin_unlock_bh(&hw->phy_lock); + + /* MIB clear */ + reg = skge_gma_read16(hw, port, GM_PHY_ADDR); + skge_gma_write16(hw, port, GM_PHY_ADDR, reg | GM_PAR_MIB_CLR); + + for (i = 0; i < GM_MIB_CNT_SIZE; i++) + skge_gma_read16(hw, port, GM_MIB_CNT_BASE + 8*i); + skge_gma_write16(hw, port, GM_PHY_ADDR, reg); + + /* transmit control */ + skge_gma_write16(hw, port, GM_TX_CTRL, TX_COL_THR(TX_COL_DEF)); + + /* receive control reg: unicast + multicast + no FCS */ + skge_gma_write16(hw, port, GM_RX_CTRL, + GM_RXCR_UCF_ENA | GM_RXCR_CRC_DIS | GM_RXCR_MCF_ENA); + + /* transmit flow control */ + skge_gma_write16(hw, port, GM_TX_FLOW_CTRL, 0xffff); + + /* transmit parameter */ + skge_gma_write16(hw, port, GM_TX_PARAM, + TX_JAM_LEN_VAL(TX_JAM_LEN_DEF) | + TX_JAM_IPG_VAL(TX_JAM_IPG_DEF) | + TX_IPG_JAM_DATA(TX_IPG_JAM_DEF)); + + /* serial mode register */ + reg = GM_SMOD_VLAN_ENA | IPG_DATA_VAL(IPG_DATA_DEF); + if (hw->dev[port]->mtu > 1500) + reg |= GM_SMOD_JUMBO_ENA; + + skge_gma_write16(hw, port, GM_SERIAL_MODE, reg); + + /* physical address: used for pause frames */ + skge_gm_set_addr(hw, port, GM_SRC_ADDR_1L, addr); + /* virtual address for data */ + skge_gm_set_addr(hw, port, GM_SRC_ADDR_2L, addr); + + /* enable interrupt mask for counter overflows */ + skge_gma_write16(hw, port, GM_TX_IRQ_MSK, 0); + skge_gma_write16(hw, port, GM_RX_IRQ_MSK, 0); + skge_gma_write16(hw, port, GM_TR_IRQ_MSK, 0); + + /* Initialize Mac Fifo */ + + /* Configure Rx MAC FIFO */ + skge_write16(hw, SKGEMAC_REG(port, RX_GMF_FL_MSK), RX_FF_FL_DEF_MSK); + reg = GMF_OPER_ON | GMF_RX_F_FL_ON; + if (hw->chip_id == CHIP_ID_YUKON_LITE && + chip_rev(hw) == CHIP_REV_YU_LITE_A3) + reg &= ~GMF_RX_F_FL_ON; + skge_write8(hw, SKGEMAC_REG(port, RX_GMF_CTRL_T), GMF_RST_CLR); + skge_write16(hw, SKGEMAC_REG(port, RX_GMF_CTRL_T), reg); + skge_write16(hw, SKGEMAC_REG(port, RX_GMF_FL_THR), RX_GMF_FL_THR_DEF); + + /* Configure Tx MAC FIFO */ + skge_write8(hw, SKGEMAC_REG(port, TX_GMF_CTRL_T), GMF_RST_CLR); + skge_write16(hw, SKGEMAC_REG(port, TX_GMF_CTRL_T), GMF_OPER_ON); +} + +static void yukon_stop(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + + if (hw->chip_id == CHIP_ID_YUKON_LITE && + chip_rev(hw) == CHIP_REV_YU_LITE_A3) { + skge_write32(hw, B2_GP_IO, + skge_read32(hw, B2_GP_IO) | GP_DIR_9 | GP_IO_9); + } + + skge_gma_write16(hw, port, GM_GP_CTRL, + skge_gma_read16(hw, port, GM_GP_CTRL) + & ~(GM_GPCR_RX_ENA|GM_GPCR_RX_ENA)); + skge_gma_read16(hw, port, GM_GP_CTRL); + + /* set GPHY Control reset */ + skge_gma_write32(hw, port, GPHY_CTRL, GPC_RST_SET); + skge_gma_write32(hw, port, GMAC_CTRL, GMC_RST_SET); +} + +static void yukon_get_stats(struct skge_port *skge, u64 *data) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + int i; + + data[0] = (u64) skge_gma_read32(hw, port, GM_TXO_OK_HI) << 32 + | skge_gma_read32(hw, port, GM_TXO_OK_LO); + data[1] = (u64) skge_gma_read32(hw, port, GM_RXO_OK_HI) << 32 + | skge_gma_read32(hw, port, GM_RXO_OK_LO); + + for (i = 2; i < ARRAY_SIZE(skge_stats); i++) + data[i] = skge_gma_read32(hw, port, + skge_stats[i].gma_offset); +} + +static void yukon_mac_intr(struct skge_hw *hw, int port) +{ + struct skge_port *skge = netdev_priv(hw->dev[port]); + u8 status = skge_read8(hw, SKGEMAC_REG(port, GMAC_IRQ_SRC)); + + pr_debug("yukon_intr status %x\n", status); + if (status & GM_IS_RX_FF_OR) { + ++skge->net_stats.rx_fifo_errors; + skge_gma_write8(hw, port, RX_GMF_CTRL_T, GMF_CLI_RX_FO); + } + if (status & GM_IS_TX_FF_UR) { + ++skge->net_stats.tx_fifo_errors; + skge_gma_write8(hw, port, TX_GMF_CTRL_T, GMF_CLI_TX_FU); + } + +} + +static u16 yukon_speed(const struct skge_hw *hw, u16 aux) +{ + if (hw->chip_id == CHIP_ID_YUKON_FE) + return (aux & PHY_M_PS_SPEED_100) ? SPEED_100 : SPEED_10; + + switch(aux & PHY_M_PS_SPEED_MSK) { + case PHY_M_PS_SPEED_1000: + return SPEED_1000; + case PHY_M_PS_SPEED_100: + return SPEED_100; + default: + return SPEED_10; + } +} + +static void yukon_link_up(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + u16 reg; + + pr_debug("yukon_link_up\n"); + + /* Enable Transmit FIFO Underrun */ + skge_write8(hw, GMAC_IRQ_MSK, GMAC_DEF_MSK); + + reg = skge_gma_read16(hw, port, GM_GP_CTRL); + if (skge->duplex == DUPLEX_FULL || skge->autoneg == AUTONEG_ENABLE) + reg |= GM_GPCR_DUP_FULL; + + /* enable Rx/Tx */ + reg |= GM_GPCR_RX_ENA | GM_GPCR_TX_ENA; + skge_gma_write16(hw, port, GM_GP_CTRL, reg); + + skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_DEF_MSK); + skge_link_up(skge); +} + +static void yukon_link_down(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + + pr_debug("yukon_link_down\n"); + skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, 0); + skge_gm_phy_write(hw, port, GM_GP_CTRL, + skge_gm_phy_read(hw, port, GM_GP_CTRL) + & ~(GM_GPCR_RX_ENA | GM_GPCR_TX_ENA)); + + if (hw->chip_id != CHIP_ID_YUKON_FE && + skge->flow_control == FLOW_MODE_REM_SEND) { + /* restore Asymmetric Pause bit */ + skge_gm_phy_write(hw, port, PHY_MARV_AUNE_ADV, + skge_gm_phy_read(hw, port, + PHY_MARV_AUNE_ADV) + | PHY_M_AN_ASP); + + } + + yukon_reset(hw, port); + skge_link_down(skge); + + yukon_init(hw, port); +} + +static void yukon_phy_intr(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + const char *reason = NULL; + u16 istatus, phystat; + + istatus = skge_gm_phy_read(hw, port, PHY_MARV_INT_STAT); + phystat = skge_gm_phy_read(hw, port, PHY_MARV_PHY_STAT); + pr_debug("yukon phy intr istat=%x phy_stat=%x\n", istatus, phystat); + + if (istatus & PHY_M_IS_AN_COMPL) { + if (skge_gm_phy_read(hw, port, PHY_MARV_AUNE_LP) + & PHY_M_AN_RF) { + reason = "remote fault"; + goto failed; + } + + if (!(hw->chip_id == CHIP_ID_YUKON_FE || hw->chip_id == CHIP_ID_YUKON_EC) + && (skge_gm_phy_read(hw, port, PHY_MARV_1000T_STAT) + & PHY_B_1000S_MSF)) { + reason = "master/slave fault"; + goto failed; + } + + if (!(phystat & PHY_M_PS_SPDUP_RES)) { + reason = "speed/duplex"; + goto failed; + } + + skge->duplex = (phystat & PHY_M_PS_FULL_DUP) + ? DUPLEX_FULL : DUPLEX_HALF; + skge->speed = yukon_speed(hw, phystat); + + /* Tx & Rx Pause Enabled bits are at 9..8 */ + if (hw->chip_id == CHIP_ID_YUKON_XL) + phystat >>= 6; + + /* We are using IEEE 802.3z/D5.0 Table 37-4 */ + switch (phystat & PHY_M_PS_PAUSE_MSK) { + case PHY_M_PS_PAUSE_MSK: + skge->flow_control = FLOW_MODE_SYMMETRIC; + break; + case PHY_M_PS_RX_P_EN: + skge->flow_control = FLOW_MODE_REM_SEND; + break; + case PHY_M_PS_TX_P_EN: + skge->flow_control = FLOW_MODE_LOC_SEND; + break; + default: + skge->flow_control = FLOW_MODE_NONE; + } + + if (skge->flow_control == FLOW_MODE_NONE || + (skge->speed < SPEED_1000 && skge->duplex == DUPLEX_HALF)) + skge_write8(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_PAUSE_OFF); + else + skge_write8(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_PAUSE_ON); + yukon_link_up(skge); + return; + } + + if (istatus & PHY_M_IS_LSP_CHANGE) + skge->speed = yukon_speed(hw, phystat); + + if (istatus & PHY_M_IS_DUP_CHANGE) + skge->duplex = (phystat & PHY_M_PS_FULL_DUP) ? DUPLEX_FULL : DUPLEX_HALF; + if (istatus & PHY_M_IS_LST_CHANGE) { + if (phystat & PHY_M_PS_LINK_UP) + yukon_link_up(skge); + else + yukon_link_down(skge); + } + return; + failed: + printk(KERN_ERR PFX "%s: autonegotiation failed (%s)\n", + skge->netdev->name, reason); + + /* XXX restart autonegotiation? */ +} + +static void skge_ramset(struct skge_hw *hw, u16 q, u32 start, size_t len) +{ + u32 end; + + start /= 8; + len /= 8; + end = start + len - 1; + + skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_RST_CLR); + skge_write32(hw, RB_ADDR(q, RB_START), start); + skge_write32(hw, RB_ADDR(q, RB_WP), start); + skge_write32(hw, RB_ADDR(q, RB_RP), start); + skge_write32(hw, RB_ADDR(q, RB_END), end); + + if (q == Q_R1 || q == Q_R2) { + /* Set thresholds on receive queue's */ + skge_write32(hw, RB_ADDR(q, RB_RX_UTPP), + start + (2*len)/3); + skge_write32(hw, RB_ADDR(q, RB_RX_LTPP), + start + (len/3)); + } else { + /* Enable store & forward on Tx queue's because + * Tx FIFO is only 4K on Genesis and 1K on Yukon + */ + skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_ENA_STFWD); + } + + skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_ENA_OP_MD); +} + +/* Setup Bus Memory Interface */ +static void skge_qset(struct skge_port *skge, u16 q, + const struct skge_element *e) +{ + struct skge_hw *hw = skge->hw; + u32 watermark = 0x600; + u64 base = skge->dma + (e->desc - skge->mem); + + /* optimization to reduce window on 32bit/33mhz */ + if ((skge_read16(hw, B0_CTST) & (CS_BUS_CLOCK | CS_BUS_SLOT_SZ)) == 0) + watermark /= 2; + + skge_write32(hw, Q_ADDR(q, Q_CSR), CSR_CLR_RESET); + skge_write32(hw, Q_ADDR(q, Q_F), watermark); + skge_write32(hw, Q_ADDR(q, Q_DA_H), (u32)(base >> 32)); + skge_write32(hw, Q_ADDR(q, Q_DA_L), (u32)base); +} + +static int skge_up(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + int port = skge->port; + u32 chunk, ram_addr; + size_t rx_size, tx_size; + int err; + + if (netif_msg_ifup(skge)) + printk(KERN_INFO PFX "%s: enabling interface\n", dev->name); + + rx_size = skge->rx_ring.count * sizeof(struct skge_rx_desc); + tx_size = skge->tx_ring.count * sizeof(struct skge_tx_desc); + skge->mem_size = tx_size + rx_size; + skge->mem = pci_alloc_consistent(hw->pdev, skge->mem_size, &skge->dma); + if (!skge->mem) + return -ENOMEM; + + memset(skge->mem, 0, skge->mem_size); + + if ((err = skge_ring_alloc(&skge->rx_ring, skge->mem, skge->dma))) + goto free_pci_mem; + + if (skge_rx_fill(skge)) + goto free_rx_ring; + + if ((err = skge_ring_alloc(&skge->tx_ring, skge->mem + rx_size, + skge->dma + rx_size))) + goto free_rx_ring; + + skge->tx_avail = skge->tx_ring.count - 1; + + /* Initialze MAC */ + if (hw->chip_id == CHIP_ID_GENESIS) + genesis_mac_init(hw, port); + else + yukon_mac_init(hw, port); + + /* Configure RAMbuffers */ + chunk = hw->ram_size / (isdualport(hw) ? 4 : 2); + ram_addr = hw->ram_offset + 2 * chunk * port; + + skge_ramset(hw, rxq[port], ram_addr, chunk); + skge_qset(skge, rxq[port], skge->rx_ring.to_clean); + + BUG_ON(skge->tx_ring.to_use != skge->tx_ring.to_clean); + skge_ramset(hw, txq[port], ram_addr+chunk, chunk); + skge_qset(skge, txq[port], skge->tx_ring.to_use); + + /* Start receiver BMU */ + wmb(); + skge_write8(hw, Q_ADDR(rxq[port], Q_CSR), CSR_START | CSR_IRQ_CL_F); + + pr_debug("skge_up completed\n"); + return 0; + + free_rx_ring: + skge_rx_clean(skge); + kfree(skge->rx_ring.start); + free_pci_mem: + pci_free_consistent(hw->pdev, skge->mem_size, skge->mem, skge->dma); + + return err; +} + +static int skge_down(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + int port = skge->port; + + if (netif_msg_ifdown(skge)) + printk(KERN_INFO PFX "%s: disabling interface\n", dev->name); + + netif_stop_queue(dev); + + /* Stop transmitter */ + skge_write8(hw, Q_ADDR(txq[port], Q_CSR), CSR_STOP); + skge_write32(hw, RB_ADDR(txq[port], RB_CTRL), + RB_RST_SET|RB_DIS_OP_MD); + + if (hw->chip_id == CHIP_ID_GENESIS) + genesis_stop(skge); + else + yukon_stop(skge); + + /* Disable Force Sync bit and Enable Alloc bit */ + skge_write8(hw, SKGEMAC_REG(port, TXA_CTRL), + TXA_DIS_FSYNC | TXA_DIS_ALLOC | TXA_STOP_RC); + + /* Stop Interval Timer and Limit Counter of Tx Arbiter */ + skge_write32(hw, SKGEMAC_REG(port, TXA_ITI_INI), 0L); + skge_write32(hw, SKGEMAC_REG(port, TXA_LIM_INI), 0L); + + /* Reset PCI FIFO */ + skge_write32(hw, Q_ADDR(txq[port], Q_CSR), CSR_SET_RESET); + skge_write32(hw, RB_ADDR(txq[port], RB_CTRL), RB_RST_SET); + + /* Reset the RAM Buffer async Tx queue */ + skge_write8(hw, RB_ADDR(port == 0 ? Q_XA1 : Q_XA2, RB_CTRL), RB_RST_SET); + /* stop receiver */ + skge_write8(hw, Q_ADDR(rxq[port], Q_CSR), CSR_STOP); + skge_write32(hw, RB_ADDR(port ? Q_R2 : Q_R1, RB_CTRL), + RB_RST_SET|RB_DIS_OP_MD); + skge_write32(hw, Q_ADDR(rxq[port], Q_CSR), CSR_SET_RESET); + + if (hw->chip_id == CHIP_ID_GENESIS) { + skge_write8(hw, SKGEMAC_REG(port, TX_MFF_CTRL2), MFF_RST_SET); + skge_write8(hw, SKGEMAC_REG(port, RX_MFF_CTRL2), MFF_RST_SET); + skge_write8(hw, SKGEMAC_REG(port, TX_LED_CTRL), LED_STOP); + skge_write8(hw, SKGEMAC_REG(port, RX_LED_CTRL), LED_STOP); + } else { + skge_write8(hw, SKGEMAC_REG(port, RX_GMF_CTRL_T), GMF_RST_SET); + skge_write8(hw, SKGEMAC_REG(port, TX_GMF_CTRL_T), GMF_RST_SET); + } + + /* turn off led's */ + skge_write16(hw, B0_LED, LED_STAT_OFF); + + skge_tx_clean(skge); + skge_rx_clean(skge); + + kfree(skge->rx_ring.start); + kfree(skge->tx_ring.start); + pci_free_consistent(hw->pdev, skge->mem_size, skge->mem, skge->dma); + return 0; +} + +static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + struct skge_ring *ring = &skge->tx_ring; + struct skge_element *e; + struct skge_tx_desc *td; + int i; + u32 control, len; + u64 map; unsigned long flags; + + skb = skb_padto(skb, ETH_ZLEN); + if (!skb) + return NETDEV_TX_OK; + + spin_lock_irqsave(&skge->tx_lock, flags); + if (unlikely(skge->tx_avail < skb_shinfo(skb)->nr_frags +1)) { + netif_stop_queue(dev); + spin_unlock_irqrestore(&skge->tx_lock, flags); + + printk(KERN_WARNING PFX "%s: ring full when queue awake!\n", + dev->name); + return NETDEV_TX_BUSY; + } + + e = ring->to_use; + td = e->desc; + e->skb = skb; + len = skb_headlen(skb); + map = pci_map_single(hw->pdev, skb->data, len, PCI_DMA_TODEVICE); + pci_unmap_addr_set(e, mapaddr, map); + pci_unmap_len_set(e, maplen, len); + + td->dma_lo = map; + td->dma_hi = map >> 32; + + if (skb->ip_summed == CHECKSUM_HW) { + const struct iphdr *ip + = (const struct iphdr *) (skb->data + ETH_HLEN); + int offset = skb->h.raw - skb->data; + + /* This seems backwards, but it is what the sk98lin + * does. Looks like hardware is wrong? + */ + if (ip->protocol == IPPROTO_UDP + && chip_rev(hw) == 0 && hw->chip_id == CHIP_ID_YUKON) + control = BMU_TCP_CHECK; + else + control = BMU_UDP_CHECK; + + td->csum_offs = 0; + td->csum_start = offset; + td->csum_write = offset + skb->csum; + } else + control = BMU_CHECK; + + if (!skb_shinfo(skb)->nr_frags) /* single buffer i.e. no fragments */ + control |= BMU_EOF| BMU_IRQ_EOF; + else { + struct skge_tx_desc *tf = td; + + control |= BMU_STFWD; + for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { + skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; + + map = pci_map_page(hw->pdev, frag->page, frag->page_offset, + frag->size, PCI_DMA_TODEVICE); + + e = e->next; + e->skb = NULL; + tf = e->desc; + tf->dma_lo = map; + tf->dma_hi = (u64) map >> 32; + pci_unmap_addr_set(e, mapaddr, map); + pci_unmap_len_set(e, maplen, frag->size); + + tf->control = BMU_OWN | BMU_SW | control | frag->size; + } + tf->control |= BMU_EOF | BMU_IRQ_EOF; + } + /* Make sure all the descriptors written */ + wmb(); + td->control = BMU_OWN | BMU_SW | BMU_STF | control | len; + wmb(); + + skge_write8(hw, Q_ADDR(txq[skge->port], Q_CSR), CSR_START); + + if (netif_msg_tx_queued(skge)) + printk(KERN_DEBUG "%s: tx queued, slot %d, len %d\n", + dev->name, e - ring->start, skb->len); + + ring->to_use = e->next; + skge->tx_avail -= skb_shinfo(skb)->nr_frags + 1; + if (skge->tx_avail <= MAX_SKB_FRAGS + 1) { + pr_debug("%s: transmit queue full\n", dev->name); + netif_stop_queue(dev); + } + + skge->net_stats.tx_packets++; + skge->net_stats.tx_bytes += skb->len; + + dev->trans_start = jiffies; + spin_unlock_irqrestore(&skge->tx_lock, flags); + + return NETDEV_TX_OK; +} + +static inline void skge_tx_free(struct skge_hw *hw, struct skge_element *e) +{ + if (e->skb) { + pci_unmap_single(hw->pdev, + pci_unmap_addr(e, mapaddr), + pci_unmap_len(e, maplen), + PCI_DMA_TODEVICE); + dev_kfree_skb_any(e->skb); + e->skb = NULL; + } else { + pci_unmap_page(hw->pdev, + pci_unmap_addr(e, mapaddr), + pci_unmap_len(e, maplen), + PCI_DMA_TODEVICE); + } +} + +static void skge_tx_clean(struct skge_port *skge) +{ + struct skge_ring *ring = &skge->tx_ring; + struct skge_element *e; + unsigned long flags; + + spin_lock_irqsave(&skge->tx_lock, flags); + for (e = ring->to_clean; e != ring->to_use; e = e->next) { + ++skge->tx_avail; + skge_tx_free(skge->hw, e); + } + ring->to_clean = e; + spin_unlock_irqrestore(&skge->tx_lock, flags); +} + +static void skge_tx_timeout(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + + if (netif_msg_timer(skge)) + printk(KERN_DEBUG PFX "%s: tx timeout\n", dev->name); + + skge_write8(skge->hw, Q_ADDR(txq[skge->port], Q_CSR), CSR_STOP); + skge_tx_clean(skge); +} + +static int skge_change_mtu(struct net_device *dev, int new_mtu) +{ + int err = 0; + + if(new_mtu < ETH_ZLEN || new_mtu > ETH_JUMBO_MTU) + return -EINVAL; + + dev->mtu = new_mtu; + + if (netif_running(dev)) { + skge_down(dev); + skge_up(dev); + } + + return err; +} + +static void genesis_set_multicast(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + int port = skge->port; + int i, count = dev->mc_count; + struct dev_mc_list *list = dev->mc_list; + u32 mode; + u8 filter[8]; + + mode = skge_xm_read32(hw, port, XM_MODE); + mode |= XM_MD_ENA_HASH; + if (dev->flags & IFF_PROMISC) + mode |= XM_MD_ENA_PROM; + else + mode &= ~XM_MD_ENA_PROM; + + if (dev->flags & IFF_ALLMULTI) + memset(filter, 0xff, sizeof(filter)); + else { + memset(filter, 0, sizeof(filter)); + for(i = 0; list && i < count; i++, list = list->next) { + u32 crc = crc32_le(~0, list->dmi_addr, ETH_ALEN); + u8 bit = 63 - (crc & 63); + + filter[bit/8] |= 1 << (bit%8); + } + } + + skge_xm_outhash(hw, port, XM_HSM, filter); + + skge_xm_write32(hw, port, XM_MODE, mode); +} + +static void yukon_set_multicast(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + int port = skge->port; + struct dev_mc_list *list = dev->mc_list; + u16 reg; + u8 filter[8]; + + memset(filter, 0, sizeof(filter)); + + reg = skge_gma_read16(hw, port, GM_RX_CTRL); + reg |= GM_RXCR_UCF_ENA; + + if (dev->flags & IFF_PROMISC) /* promiscious */ + reg &= ~(GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA); + else if (dev->flags & IFF_ALLMULTI) /* all multicast */ + memset(filter, 0xff, sizeof(filter)); + else if (dev->mc_count == 0) /* no multicast */ + reg &= ~GM_RXCR_MCF_ENA; + else { + int i; + reg |= GM_RXCR_MCF_ENA; + + for(i = 0; list && i < dev->mc_count; i++, list = list->next) { + u32 bit = ether_crc(ETH_ALEN, list->dmi_addr) & 0x3f; + filter[bit/8] |= 1 << (bit%8); + } + } + + + skge_gma_write16(hw, port, GM_MC_ADDR_H1, + (u16)filter[0] | ((u16)filter[1] << 8)); + skge_gma_write16(hw, port, GM_MC_ADDR_H2, + (u16)filter[2] | ((u16)filter[3] << 8)); + skge_gma_write16(hw, port, GM_MC_ADDR_H3, + (u16)filter[4] | ((u16)filter[5] << 8)); + skge_gma_write16(hw, port, GM_MC_ADDR_H4, + (u16)filter[6] | ((u16)filter[7] << 8)); + + skge_gma_write16(hw, port, GM_RX_CTRL, reg); +} + +static inline int bad_phy_status(const struct skge_hw *hw, u32 status) +{ + if (hw->chip_id == CHIP_ID_GENESIS) + return (status & (XMR_FS_ERR | XMR_FS_2L_VLAN)) != 0; + else + return (status & GMR_FS_ANY_ERR) || + (status & GMR_FS_RX_OK) == 0; +} + +static void skge_rx_error(struct skge_port *skge, int slot, + u32 control, u32 status) +{ + if (netif_msg_rx_err(skge)) + printk(KERN_DEBUG PFX "%s: rx err, slot %d control 0x%x status 0x%x\n", + skge->netdev->name, slot, control, status); + + if ((control & (BMU_EOF|BMU_STF)) != (BMU_STF|BMU_EOF) + || (control & BMU_BBC) > skge->netdev->mtu + VLAN_ETH_HLEN) + skge->net_stats.rx_length_errors++; + else { + if (skge->hw->chip_id == CHIP_ID_GENESIS) { + if (status & (XMR_FS_RUNT|XMR_FS_LNG_ERR)) + skge->net_stats.rx_length_errors++; + if (status & XMR_FS_FRA_ERR) + skge->net_stats.rx_frame_errors++; + if (status & XMR_FS_FCS_ERR) + skge->net_stats.rx_crc_errors++; + } else { + if (status & (GMR_FS_LONG_ERR|GMR_FS_UN_SIZE)) + skge->net_stats.rx_length_errors++; + if (status & GMR_FS_FRAGMENT) + skge->net_stats.rx_frame_errors++; + if (status & GMR_FS_CRC_ERR) + skge->net_stats.rx_crc_errors++; + } + } +} + +static int skge_poll(struct net_device *dev, int *budget) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + struct skge_ring *ring = &skge->rx_ring; + struct skge_element *e; + unsigned int to_do = min(dev->quota, *budget); + unsigned int work_done = 0; + int done; + static const u32 irqmask[] = { IS_PORT_1, IS_PORT_2 }; + + for (e = ring->to_clean; e != ring->to_use && work_done < to_do; + e = e->next) { + struct skge_rx_desc *rd = e->desc; + struct sk_buff *skb = e->skb; + u32 control, len, status; + + rmb(); + control = rd->control; + if (control & BMU_OWN) + break; + + len = control & BMU_BBC; + e->skb = NULL; + + pci_unmap_single(hw->pdev, + pci_unmap_addr(e, mapaddr), + pci_unmap_len(e, maplen), + PCI_DMA_FROMDEVICE); + + status = rd->status; + if ((control & (BMU_EOF|BMU_STF)) != (BMU_STF|BMU_EOF) + || len > dev->mtu + VLAN_ETH_HLEN + || bad_phy_status(hw, status)) { + skge_rx_error(skge, e - ring->start, control, status); + dev_kfree_skb(skb); + continue; + } + + if (netif_msg_rx_status(skge)) + printk(KERN_DEBUG PFX "%s: rx slot %d status 0x%x len %d\n", + dev->name, e - ring->start, rd->status, len); + + skb_put(skb, len); + skb->protocol = eth_type_trans(skb, dev); + + if (skge->rx_csum) { + skb->csum = le16_to_cpu(rd->csum2); + skb->ip_summed = CHECKSUM_HW; + } + + dev->last_rx = jiffies; + skge->net_stats.rx_packets++; + skge->net_stats.rx_bytes += skb->len; + netif_receive_skb(skb); + + ++work_done; + } + ring->to_clean = e; + + *budget -= work_done; + dev->quota -= work_done; + done = work_done < to_do; + + if (skge_rx_fill(skge)) + done = 0; + + /* restart receiver */ + wmb(); + skge_write8(hw, Q_ADDR(rxq[skge->port], Q_CSR), + CSR_START | CSR_IRQ_CL_F); + + if (done) { + local_irq_disable(); + hw->intr_mask |= irqmask[skge->port]; + /* Order is important since data can get interrupted */ + skge_write32(hw, B0_IMSK, hw->intr_mask); + __netif_rx_complete(dev); + local_irq_enable(); + } + + return !done; +} + +static inline void skge_tx_intr(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + struct skge_ring *ring = &skge->tx_ring; + struct skge_element *e; + + spin_lock(&skge->tx_lock); + for(e = ring->to_clean; e != ring->to_use; e = e->next) { + struct skge_tx_desc *td = e->desc; + u32 control; + + rmb(); + control = td->control; + if (control & BMU_OWN) + break; + + if (unlikely(netif_msg_tx_done(skge))) + printk(KERN_DEBUG PFX "%s: tx done slot %d status 0x%x\n", + dev->name, e - ring->start, td->status); + + skge_tx_free(hw, e); + e->skb = NULL; + ++skge->tx_avail; + } + ring->to_clean = e; + skge_write8(hw, Q_ADDR(txq[skge->port], Q_CSR), CSR_IRQ_CL_F); + + if (skge->tx_avail > MAX_SKB_FRAGS + 1) + netif_wake_queue(dev); + + spin_unlock(&skge->tx_lock); +} + +static void skge_mac_parity(struct skge_hw *hw, int port) +{ + if (hw->chip_id == CHIP_ID_GENESIS) + skge_write16(hw, SKGEMAC_REG(port, TX_MFF_CTRL1), + MFF_CLR_PERR); + else + /* HW-Bug #8: cleared by GMF_CLI_TX_FC instead of GMF_CLI_TX_PE */ + skge_write8(hw, SKGEMAC_REG(port, TX_GMF_CTRL_T), + (hw->chip_id == CHIP_ID_YUKON && chip_rev(hw) == 0) + ? GMF_CLI_TX_FC : GMF_CLI_TX_PE); +} + +static void skge_pci_clear(struct skge_hw *hw) +{ + u16 status; + + status = skge_read16(hw, SKGEPCI_REG(PCI_STATUS)); + skge_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); + skge_write16(hw, SKGEPCI_REG(PCI_STATUS), + status | PCI_STATUS_ERROR_BITS); + skge_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF); +} + +/* Handle device specific framing and timeout interrupts */ +static void skge_error_irq(struct skge_hw *hw) +{ + u32 hwstatus = skge_read32(hw, B0_HWE_ISRC); + + printk(KERN_ERR PFX "hardware error detected (status 0x%x)\n", + hwstatus); + + skge_pci_clear(hw); + + if (hw->chip_id == CHIP_ID_GENESIS) { + /* clear xmac errors */ + if (hwstatus & (IS_NO_STAT_M1|IS_NO_TIST_M1)) + + skge_write16(hw, SKGEMAC_REG(0, RX_MFF_CTRL1), MFF_CLR_INSTAT); + if (hwstatus & (IS_NO_STAT_M2|IS_NO_TIST_M2)) + skge_write16(hw, SKGEMAC_REG(0, RX_MFF_CTRL2), MFF_CLR_INSTAT); + } else { + if (hwstatus & IS_IRQ_SENSOR) { + /* no sensors on 32-bit Yukon */ + if ((skge_read16(hw, B0_CTST) & CS_BUS_SLOT_SZ) == 32) + hw->intr_mask &= ~IS_HW_ERR; + } + + } + + if (hwstatus & IS_RAM_RD_PAR) + skge_write16(hw, B3_RI_CTRL, RI_CLR_RD_PERR); + + if (hwstatus & IS_RAM_WR_PAR) + skge_write16(hw, B3_RI_CTRL, RI_CLR_WR_PERR); + + if (hwstatus & IS_M1_PAR_ERR) + skge_mac_parity(hw, 0); + + if (hwstatus & IS_M2_PAR_ERR) + skge_mac_parity(hw, 1); + + if (hwstatus & IS_R1_PAR_ERR) + skge_write32(hw, B0_R1_CSR, CSR_IRQ_CL_P); + + if (hwstatus & IS_R2_PAR_ERR) + skge_write32(hw, B0_R2_CSR, CSR_IRQ_CL_P); +} + +/* + * Interrrupt from PHY are handled in tasklet (soft irq) + * because accessing phy registers requires spin wait which might + * cause excess interrupt latency. + */ +static void skge_extirq(unsigned long data) +{ + struct skge_hw *hw = (struct skge_hw *) data; + int port; + + spin_lock(&hw->phy_lock); + for (port = 0; port < 2; port++) { + struct net_device *dev = hw->dev[port]; + + if (dev && netif_running(dev)) { + struct skge_port *skge = netdev_priv(dev); + + if (hw->chip_id != CHIP_ID_GENESIS) + yukon_phy_intr(skge); + else if (hw->phy_type == SK_PHY_BCOM) + genesis_bcom_intr(skge); + } + } + spin_unlock(&hw->phy_lock); + + local_irq_disable(); + hw->intr_mask |= IS_EXT_REG; + skge_write32(hw, B0_IMSK, hw->intr_mask); + local_irq_enable(); +} + +static irqreturn_t skge_intr(int irq, void *dev_id, struct pt_regs *regs) +{ + struct skge_hw *hw = dev_id; + u32 status = skge_read32(hw, B0_SP_ISRC); + + if (status == 0 || status == ~0) /* hotplug or shared irq */ + return IRQ_NONE; + + status &= hw->intr_mask; + + if (status & IS_R1_F) { + hw->intr_mask &= ~IS_R1_F; + netif_rx_schedule(hw->dev[0]); + } + + if (status & IS_R2_F) { + hw->intr_mask &= ~IS_R2_F; + netif_rx_schedule(hw->dev[1]); + } + + if (status & IS_XA1_F) + skge_tx_intr(hw->dev[0]); + + if (status & IS_XA2_F) + skge_tx_intr(hw->dev[1]); + + if (hw->chip_id == CHIP_ID_GENESIS) { + if (status & IS_MAC1) + genesis_mac_intr(hw, 0); + + if (status & IS_MAC2) + genesis_mac_intr(hw, 1); + } else { + if (status & IS_MAC1) + yukon_mac_intr(hw, 0); + + if (status & IS_MAC2) + yukon_mac_intr(hw, 1); + } + + if (status & IS_HW_ERR) + skge_error_irq(hw); + + if (status & IS_EXT_REG) { + hw->intr_mask &= ~IS_EXT_REG; + tasklet_schedule(&hw->ext_tasklet); + } + skge_write32(hw, B0_IMSK, hw->intr_mask); + + return IRQ_HANDLED; +} + +#ifdef CONFIG_NET_POLL_CONTROLLER +static void skge_netpoll(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + + disable_irq(dev->irq); + skge_intr(dev->irq, skge->hw, NULL); + enable_irq(dev->irq); +} +#endif + +/* TODO: use MIB counters instead?? */ +static struct net_device_stats *skge_get_stats(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + + return &skge->net_stats; +} + + +static int skge_set_mac_address(struct net_device *dev, void *p) +{ + struct skge_port *skge = netdev_priv(dev); + struct sockaddr *addr = p; + int err = 0; + + if (!is_valid_ether_addr(addr->sa_data)) + return -EADDRNOTAVAIL; + + skge_down(dev); + memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); + memcpy_toio(skge->hw->regs + B2_MAC_1 + skge->port*8, + dev->dev_addr, ETH_ALEN); + memcpy_toio(skge->hw->regs + B2_MAC_2 + skge->port*8, + dev->dev_addr, ETH_ALEN); + if (dev->flags & IFF_UP) + err = skge_up(dev); + return err; +} + +/* + * Setup the board data structure, but don't bring up + * the port(s) + */ +static __devinit struct skge_hw *skge_hwinit(struct pci_dev *pdev) +{ + struct skge_hw *hw; + u32 sz; + u16 ctst; + u8 t8; + int i, ports; + char *name = pci_name(pdev); + + hw = kmalloc(sizeof(*hw), GFP_KERNEL); + if (!hw) { + printk(KERN_ERR "skge %s: cannot allocate hardware struct\n", name); + goto err_out1; + } + + memset(hw, 0, sizeof(*hw)); + hw->pdev = pdev; + spin_lock_init(&hw->phy_lock); + tasklet_init(&hw->ext_tasklet, skge_extirq, (unsigned long) hw); + + hw->regs = ioremap_nocache(pci_resource_start(pdev, 0), 0x4000); + if (!hw->regs) { + printk(KERN_ERR "skge %s: cannot map device registers\n", name); + goto err_out2; + } + + ctst = skge_read16(hw, B0_CTST); + + /* do a SW reset */ + skge_write8(hw, B0_CTST, CS_RST_SET); + skge_write8(hw, B0_CTST, CS_RST_CLR); + + /* clear PCI errors, if any */ + skge_pci_clear(hw); + + skge_write8(hw, B0_CTST, CS_MRST_CLR); + + /* restore CLK_RUN bits (for Yukon-Lite) */ + skge_write16(hw, B0_CTST, + ctst & (CS_CLK_RUN_HOT|CS_CLK_RUN_RST|CS_CLK_RUN_ENA)); + + hw->chip_id = skge_read8(hw, B2_CHIP_ID); + hw->phy_type = skge_read8(hw, B2_E_1) & 0xf; + hw->pmd_type = skge_read8(hw, B2_PMD_TYP); + + switch(hw->chip_id) { + case CHIP_ID_GENESIS: + switch (hw->phy_type) { + case SK_PHY_XMAC: + hw->phy_addr = PHY_ADDR_XMAC; + break; + case SK_PHY_BCOM: + hw->phy_addr = PHY_ADDR_BCOM; + break; + default: + printk(KERN_ERR PFX "%s: unsupported phy type 0x%x\n", + name, hw->phy_type); + goto err_out3; + } + break; + + case CHIP_ID_YUKON: + case CHIP_ID_YUKON_LITE: + case CHIP_ID_YUKON_LP: + if (hw->phy_type < SK_PHY_MARV_COPPER && hw->pmd_type != 'S') + hw->phy_type = SK_PHY_MARV_COPPER; + + hw->phy_addr = PHY_ADDR_MARV; + if (!iscopper(hw)) + hw->phy_type = SK_PHY_MARV_FIBER; + + break; + + default: + printk(KERN_ERR PFX "%s: unsupported chip type 0x%x\n", + name, hw->chip_id); + goto err_out3; + } + + hw->mac_cfg = skge_read8(hw, B2_MAC_CFG); + ports = isdualport(hw) ? 2 : 1; + + /* read the adapters RAM size */ + t8 = skge_read8(hw, B2_E_0); + if (hw->chip_id == CHIP_ID_GENESIS) { + if (t8 == 3) { + /* special case: 4 x 64k x 36, offset = 0x80000 */ + hw->ram_size = 0x100000; + hw->ram_offset = 0x80000; + } else + hw->ram_size = t8 * 512; + } + else if (t8 == 0) + hw->ram_size = 0x20000; + else + hw->ram_size = t8 * 4096; + + pci_read_config_dword(hw->pdev, PCI_DEV_REG2, &sz); + hw->rom_size = 256 << ((sz & PCI_VPD_ROM_SZ) >> 14); + + if (hw->chip_id == CHIP_ID_GENESIS) + genesis_init(hw); +#if USE_TIST + else + skge_write8(hw, GMAC_TI_ST_CTRL, GMT_ST_START); +#endif + + /* + * looks like it ignores stuck sensor interrupts + */ + if (hw->chip_id != CHIP_ID_GENESIS) { + /* switch power to VCC (WA for VAUX problem) */ + skge_write8(hw, B0_POWER_CTRL, + PC_VAUX_ENA | PC_VCC_ENA | PC_VAUX_OFF | PC_VCC_ON); + if ((skge_read32(hw, B0_ISRC) & IS_HW_ERR) && + (skge_read32(hw, B0_HWE_ISRC & IS_IRQ_SENSOR))) + hw->intr_mask &= ~IS_HW_ERR; + + for (i = 0; i < ports; i++) { + skge_write16(hw, SKGEMAC_REG(i, GMAC_LINK_CTRL), GMLC_RST_SET); + skge_write16(hw, SKGEMAC_REG(i, GMAC_LINK_CTRL), GMLC_RST_CLR); + } + } + + /* turn off hardware timer (unused) */ + skge_write8(hw, B2_TI_CTRL, TIM_STOP); + skge_write8(hw, B2_TI_CTRL, TIM_CLR_IRQ); + skge_write8(hw, B0_LED, LED_STAT_ON); + + /* enable the Tx Arbiters */ + for (i = 0; i < ports; i++) + skge_write8(hw, SKGEMAC_REG(i, TXA_CTRL), TXA_ENA_ARB); + + /* Initialize ram interface */ + skge_write16(hw, B3_RI_CTRL, RI_RST_CLR); + + skge_write8(hw, B3_RI_WTO_R1, SK_RI_TO_53); + skge_write8(hw, B3_RI_WTO_XA1, SK_RI_TO_53); + skge_write8(hw, B3_RI_WTO_XS1, SK_RI_TO_53); + skge_write8(hw, B3_RI_RTO_R1, SK_RI_TO_53); + skge_write8(hw, B3_RI_RTO_XA1, SK_RI_TO_53); + skge_write8(hw, B3_RI_RTO_XS1, SK_RI_TO_53); + skge_write8(hw, B3_RI_WTO_R2, SK_RI_TO_53); + skge_write8(hw, B3_RI_WTO_XA2, SK_RI_TO_53); + skge_write8(hw, B3_RI_WTO_XS2, SK_RI_TO_53); + skge_write8(hw, B3_RI_RTO_R2, SK_RI_TO_53); + skge_write8(hw, B3_RI_RTO_XA2, SK_RI_TO_53); + skge_write8(hw, B3_RI_RTO_XS2, SK_RI_TO_53); + + skge_write32(hw, B0_HWE_IMSK, IS_ERR_MSK); + + hw->intr_mask = IS_HW_ERR | IS_EXT_REG | IS_PORT_1; + if (isdualport(hw)) + hw->intr_mask |= IS_PORT_2; + skge_write32(hw, B0_IMSK, hw->intr_mask); + + if (hw->chip_id != CHIP_ID_GENESIS) + skge_write8(hw, GMAC_IRQ_MSK, 0); + + spin_lock_bh(&hw->phy_lock); + for (i = 0; i < ports; i++) { + if (hw->chip_id == CHIP_ID_GENESIS) + genesis_reset(hw, i); + else + yukon_reset(hw, i); + } + spin_unlock_bh(&hw->phy_lock); + + return hw; + + err_out3: + iounmap(hw->regs); + err_out2: + kfree(hw); + err_out1: + return NULL; +} + +/* Release board resources */ +static void skge_hwfree(struct skge_hw *hw) +{ + skge_write16(hw, B0_LED, LED_STAT_OFF); + iounmap(hw->regs); + kfree(hw); +} + +/* Initialize network device */ +static struct net_device *skge_devinit(struct skge_hw *hw, int port) +{ + struct skge_port *skge; + struct net_device *dev = alloc_etherdev(sizeof(*skge)); + int i; + + if (!dev) { + printk(KERN_ERR "skge etherdev alloc failed"); + return NULL; + } + + SET_MODULE_OWNER(dev); + SET_NETDEV_DEV(dev, &hw->pdev->dev); + dev->open = skge_up; + dev->stop = skge_down; + dev->hard_start_xmit = skge_xmit_frame; + dev->get_stats = skge_get_stats; + if (hw->chip_id == CHIP_ID_GENESIS) + dev->set_multicast_list = genesis_set_multicast; + else + dev->set_multicast_list = yukon_set_multicast; + + dev->set_mac_address = skge_set_mac_address; + dev->change_mtu = skge_change_mtu; + SET_ETHTOOL_OPS(dev, &skge_ethtool_ops); + dev->tx_timeout = skge_tx_timeout; + dev->watchdog_timeo = TX_WATCHDOG; + dev->poll = skge_poll; + dev->weight = NAPI_WEIGHT; +#ifdef CONFIG_NET_POLL_CONTROLLER + dev->poll_controller = skge_netpoll; +#endif + dev->irq = hw->pdev->irq; + if (hw->chip_id != CHIP_ID_GENESIS) + dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; + + skge = netdev_priv(dev); + skge->netdev = dev; + skge->hw = hw; + skge->msg_enable = netif_msg_init(debug, default_msg); + skge->rx_csum = 1; + skge->tx_ring.count = DEFAULT_TX_RING_SIZE; + skge->rx_ring.count = DEFAULT_RX_RING_SIZE; + + /* Auto speed and flow control */ + skge->autoneg = AUTONEG_ENABLE; + skge->flow_control = FLOW_MODE_SYMMETRIC; + skge->duplex = -1; + skge->speed = -1; + skge->advertising = skge_modes(hw); + + hw->dev[port] = dev; + + skge->port = port; + + spin_lock_init(&skge->tx_lock); + + init_timer(&skge->link_check); + skge->link_check.function = skge_link_timer; + skge->link_check.data = (unsigned long) skge; + + init_timer(&skge->led_blink); + skge->led_blink.function = skge_blink_timer; + skge->led_blink.data = (unsigned long) skge; + + /* read the mac address */ + for (i = 0; i < ETH_ALEN; i++) + dev->dev_addr[i] = skge_read8(hw, B2_MAC_1 + port*8 + i); + + /* device is off until link detection */ + netif_carrier_off(dev); + netif_stop_queue(dev); + + return dev; +} + +static const struct { + u8 id; + const char *name; +} skge_chips[] = { + { CHIP_ID_GENESIS, "Genesis" }, + { CHIP_ID_YUKON, "Yukon" }, + { CHIP_ID_YUKON_LITE, "Yukon-Lite"}, + { CHIP_ID_YUKON_LP, "Yukon-LP"}, + { CHIP_ID_YUKON_XL, "Yukon-2 XL"}, + { CHIP_ID_YUKON_EC, "YUKON-2 EC"}, + { CHIP_ID_YUKON_FE, "YUKON-2 FE"}, +}; + +static const char *skge_board_name(const struct skge_hw *hw) +{ + int i; + static char buf[16]; + + for (i = 0; i < ARRAY_SIZE(skge_chips); i++) + if (skge_chips[i].id == hw->chip_id) + return skge_chips[i].name; + + snprintf(buf, sizeof buf, "chipid 0x%x", hw->chip_id); + return buf; +} + +/* + * The VPD config area contains Vital Product Data, as suggested in + * the PCI 2.1 specification. The VPD data is separared into areas + * denoted by resource IDs. The SysKonnect VPD contains an ID string + * resource (the name of the adapter), a read-only area resource + * containing various key/data fields and a read/write area which + * can be used to store asset management information or log messages. + * + * TODO: replace by generic PCI VPD code through sysfs + */ +static int skge_vpd_read(struct pci_dev *pci, u8 *buf, u16 offset, u32 len) +{ + int i; + u16 reg; + u32 dreg; + unsigned long timeout = jiffies + VPD_TIMEOUT; + + if (offset & 3) + return -EINVAL; + + for (i = 0; i < len; i += 4) { + pci_write_config_word(pci, PCI_VPD+PCI_VPD_ADDR, offset); + + for(;;) { + udelay(10); + pci_read_config_word(pci, PCI_VPD+PCI_VPD_ADDR, ®); + + if (reg & PCI_VPD_ADDR_F) + break; + + if (time_after(jiffies, timeout)) { + printk(KERN_ERR "%s: VPD read timed out\n", + pci_name(pci)); + return -ETIMEDOUT; + } + } + + pci_read_config_dword(pci, PCI_VPD+PCI_VPD_DATA, &dreg); + buf[i] = dreg; + buf[i+1] = dreg >> 8; + buf[i+2] = dreg >> 16; + buf[i+3] = dreg >> 24; + + offset += 4; + } + return 0; +} + +/* Read the board name out of the EEPROM and print it */ +static __devinit void skge_board_info(struct skge_hw *hw) +{ + struct net_device *dev = hw->dev[0]; + struct skge_port *skge = netdev_priv(dev); + const u8 *ea = dev->dev_addr; + u16 cs; + u8 *rom; + int len; + const u8 *dp; + + cs = skge_read16(hw, B0_CTST); + printk("%s: %s rev %d (PCI %d Mhz: %d-bit)" + " addr %02x:%02x:%02x:%02x:%02x:%02x\n", + dev->name, skge_board_name(hw), chip_rev(hw), + (cs & CS_BUS_CLOCK) ? 66 : 33, + (cs & CS_BUS_SLOT_SZ) ? 64 : 32, + ea[0],ea[1],ea[2],ea[3],ea[4],ea[5]); + + /* Only using VPD for console message, so can skip if not needed */ + if (!netif_msg_probe(skge)) + return; + + rom = kmalloc(hw->rom_size, GFP_KERNEL); + if (!rom) { + printk(KERN_WARNING PFX "couldn't allocate %d for rom\n", hw->rom_size); + return; + } + + if (skge_vpd_read(hw->pdev, rom, 0, hw->rom_size) != 0) { + printk(KERN_ERR PFX "Vpd rom read error\n"); + goto out; + } + + /* missing VPID rom? */ + if (rom[0] == 0xff || rom[1] == 0xff) { + printk(KERN_INFO PFX "no VPD available\n"); + goto out; + } + + /* *Gack* Asus K8V Se Deluxe bugfix. Correct VPD content */ + if (memcmp(rom + 62, " 8rom_size && len > 3) { + const char *id = (const char *) dp; + u8 l = dp[2]; + + /* RV is end of read only area */ + if (id[0] == 'R' && id[1] == 'V') + break; + + /* Ignore Extended Capability value */ + if (!(id[0] == 'C' && id[1] == 'P')) + printk(KERN_INFO " %2.2s: %*.*s\n", id, l, l, id+3); + + len -= 3 + l; + dp += 3 + l; + } + + + out: + kfree(rom); +} + +static int __devinit skge_probe(struct pci_dev *pdev, + const struct pci_device_id *ent) +{ + struct net_device *dev; + struct skge_hw *hw; + int err, using_dac = 0; + + if ((err = pci_enable_device(pdev))) { + printk(KERN_ERR "%s cannot enable PCI device\n", + pci_name(pdev)); + goto err_out; + } + + if ((err = pci_request_regions(pdev, DRV_NAME))) { + printk(KERN_ERR "%s cannot obtain PCI resources\n", + pci_name(pdev)); + goto err_out_disable_pdev; + } + + pci_set_master(pdev); + + if (!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK))) + using_dac = 1; + else if (!(err = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) { + printk(KERN_ERR "%s no usable DMA configuration\n", + pci_name(pdev)); + goto err_out_free_regions; + } + +#ifdef __BIG_ENDIAN + /* byte swap decriptors in hardware */ + { + u32 reg; + + pci_read_config_dword(pdev, PCI_DEV_REG2, ®); + reg |= SKGEPCI_REV_DESC; + pci_write_config_dword(pdev, PCI_DEV_REG2, reg); + } +#endif + + err = -ENOMEM; + hw = skge_hwinit(pdev); + if (!hw) + goto err_out_free_regions; + + if ((err = request_irq(pdev->irq, skge_intr, SA_SHIRQ, DRV_NAME, hw))) { + printk(KERN_ERR "%s: cannot assign irq %d\n", + pci_name(pdev), pdev->irq); + goto err_out_free_hw; + } + + if ((dev = skge_devinit(hw, 0)) == NULL) + goto err_out_free_irq; + + if (using_dac) + dev->features |= NETIF_F_HIGHDMA; + + if ((err = register_netdev(dev))) { + printk(KERN_ERR "%s: cannot register net device\n", + pci_name(pdev)); + goto err_out_free_netdev; + } + + pci_set_drvdata(pdev, hw); + + if (isdualport(hw)) { + struct net_device *dev1 = skge_devinit(hw, 1); + + if (using_dac) + dev1->features |= NETIF_F_HIGHDMA; + + if (dev1 && register_netdev(dev1)) { + hw->dev[1] = NULL; + free_netdev(dev1); + } + + } + + skge_board_info(hw); + + return 0; + +err_out_free_netdev: + free_netdev(dev); +err_out_free_irq: + free_irq(pdev->irq, hw); +err_out_free_hw: + skge_hwfree(hw); +err_out_free_regions: + pci_release_regions(pdev); +err_out_disable_pdev: + pci_disable_device(pdev); + pci_set_drvdata(pdev, NULL); +err_out: + return err; +} + +static void __devexit skge_remove(struct pci_dev *pdev) +{ + struct skge_hw *hw = pci_get_drvdata(pdev); + struct net_device *dev0, *dev1; + + if(!hw) + return; + + if ((dev1 = hw->dev[1])) + unregister_netdev(dev1); + dev0 = hw->dev[0]; + unregister_netdev(dev0); + + tasklet_kill(&hw->ext_tasklet); + free_irq(pdev->irq, hw); + pci_release_regions(pdev); + pci_disable_device(pdev); + if (dev1) + free_netdev(dev1); + free_netdev(dev0); + skge_hwfree(hw); + pci_set_drvdata(pdev, NULL); +} + +static struct pci_driver skge_driver = { + .name = DRV_NAME, + .id_table = skge_id_table, + .probe = skge_probe, + .remove = __devexit_p(skge_remove), +}; + +static int __init skge_init_module(void) +{ + return pci_module_init(&skge_driver); +} + +static void __exit skge_cleanup_module(void) +{ + pci_unregister_driver(&skge_driver); +} + +module_init(skge_init_module); +module_exit(skge_cleanup_module); diff -Nru a/drivers/net/skge.h b/drivers/net/skge.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/net/skge.h 2005-01-21 14:50:41 -08:00 @@ -0,0 +1,3007 @@ +/* + * Definitions for the new Marvell Yukon / SysKonenct driver. + */ +#ifndef _SKGE_H +#define _SKGE_H + +/* PCI config registers */ +#define PCI_DEV_REG1 0x40 +#define PCI_DEV_REG2 0x44 +#ifndef PCI_VPD +#define PCI_VPD 0x50 +#endif + +/* PCI_OUR_REG_2 32 bit Our Register 2 */ +enum { + PCI_VPD_WR_THR = 0xff<<24, /* Bit 31..24: VPD Write Threshold */ + PCI_DEV_SEL = 0x7f<<17, /* Bit 23..17: EEPROM Device Select */ + PCI_VPD_ROM_SZ = 7 <<14, /* Bit 16..14: VPD ROM Size */ + /* Bit 13..12: reserved */ + PCI_EN_DUMMY_RD = 1<<3, /* Enable Dummy Read */ + PCI_REV_DESC = 1<<2, /* Reverse Desc. Bytes */ + PCI_USEDATA64 = 1<<0, /* Use 64Bit Data bus ext */ +}; + +/* PCI_VPD_ADR_REG 16 bit VPD Address Register */ +enum { + PCI_VPD_FLAG = 1<<15, /* starts VPD rd/wr cycle */ + PCI_VPD_ADR_MSK =0x7fffL, /* Bit 14.. 0: VPD Address Mask */ + VPD_RES_ID = 0x82, + VPD_RES_READ = 0x90, + VPD_RES_WRITE = 0x81, + VPD_RES_END = 0x78, +}; + + +#define PCI_STATUS_ERROR_BITS (PCI_STATUS_DETECTED_PARITY | \ + PCI_STATUS_SIG_SYSTEM_ERROR | \ + PCI_STATUS_REC_MASTER_ABORT | \ + PCI_STATUS_REC_TARGET_ABORT | \ + PCI_STATUS_PARITY) + + +enum csr_regs { + B0_RAP = 0x0000, + B0_CTST = 0x0004, + B0_LED = 0x0006, + B0_POWER_CTRL = 0x0007, + B0_ISRC = 0x0008, + B0_IMSK = 0x000c, + B0_HWE_ISRC = 0x0010, + B0_HWE_IMSK = 0x0014, + B0_SP_ISRC = 0x0018, + B0_XM1_IMSK = 0x0020, + B0_XM1_ISRC = 0x0028, + B0_XM1_PHY_ADDR = 0x0030, + B0_XM1_PHY_DATA = 0x0034, + B0_XM2_IMSK = 0x0040, + B0_XM2_ISRC = 0x0048, + B0_XM2_PHY_ADDR = 0x0050, + B0_XM2_PHY_DATA = 0x0054, + B0_R1_CSR = 0x0060, + B0_R2_CSR = 0x0064, + B0_XS1_CSR = 0x0068, + B0_XA1_CSR = 0x006c, + B0_XS2_CSR = 0x0070, + B0_XA2_CSR = 0x0074, + + B2_MAC_1 = 0x0100, + B2_MAC_2 = 0x0108, + B2_MAC_3 = 0x0110, + B2_CONN_TYP = 0x0118, + B2_PMD_TYP = 0x0119, + B2_MAC_CFG = 0x011a, + B2_CHIP_ID = 0x011b, + B2_E_0 = 0x011c, + B2_E_1 = 0x011d, + B2_E_2 = 0x011e, + B2_E_3 = 0x011f, + B2_FAR = 0x0120, + B2_FDP = 0x0124, + B2_LD_CTRL = 0x0128, + B2_LD_TEST = 0x0129, + B2_TI_INI = 0x0130, + B2_TI_VAL = 0x0134, + B2_TI_CTRL = 0x0138, + B2_TI_TEST = 0x0139, + B2_IRQM_INI = 0x0140, + B2_IRQM_VAL = 0x0144, + B2_IRQM_CTRL = 0x0148, + B2_IRQM_TEST = 0x0149, + B2_IRQM_MSK = 0x014c, + B2_IRQM_HWE_MSK = 0x0150, + B2_TST_CTRL1 = 0x0158, + B2_TST_CTRL2 = 0x0159, + B2_GP_IO = 0x015c, + B2_I2C_CTRL = 0x0160, + B2_I2C_DATA = 0x0164, + B2_I2C_IRQ = 0x0168, + B2_I2C_SW = 0x016c, + B2_BSC_INI = 0x0170, + B2_BSC_VAL = 0x0174, + B2_BSC_CTRL = 0x0178, + B2_BSC_STAT = 0x0179, + B2_BSC_TST = 0x017a, + + B3_RAM_ADDR = 0x0180, + B3_RAM_DATA_LO = 0x0184, + B3_RAM_DATA_HI = 0x0188, + B3_RI_WTO_R1 = 0x0190, + B3_RI_WTO_XA1 = 0x0191, + B3_RI_WTO_XS1 = 0x0192, + B3_RI_RTO_R1 = 0x0193, + B3_RI_RTO_XA1 = 0x0194, + B3_RI_RTO_XS1 = 0x0195, + B3_RI_WTO_R2 = 0x0196, + B3_RI_WTO_XA2 = 0x0197, + B3_RI_WTO_XS2 = 0x0198, + B3_RI_RTO_R2 = 0x0199, + B3_RI_RTO_XA2 = 0x019a, + B3_RI_RTO_XS2 = 0x019b, + B3_RI_TO_VAL = 0x019c, + B3_RI_CTRL = 0x01a0, + B3_RI_TEST = 0x01a2, + B3_MA_TOINI_RX1 = 0x01b0, + B3_MA_TOINI_RX2 = 0x01b1, + B3_MA_TOINI_TX1 = 0x01b2, + B3_MA_TOINI_TX2 = 0x01b3, + B3_MA_TOVAL_RX1 = 0x01b4, + B3_MA_TOVAL_RX2 = 0x01b5, + B3_MA_TOVAL_TX1 = 0x01b6, + B3_MA_TOVAL_TX2 = 0x01b7, + B3_MA_TO_CTRL = 0x01b8, + B3_MA_TO_TEST = 0x01ba, + B3_MA_RCINI_RX1 = 0x01c0, + B3_MA_RCINI_RX2 = 0x01c1, + B3_MA_RCINI_TX1 = 0x01c2, + B3_MA_RCINI_TX2 = 0x01c3, + B3_MA_RCVAL_RX1 = 0x01c4, + B3_MA_RCVAL_RX2 = 0x01c5, + B3_MA_RCVAL_TX1 = 0x01c6, + B3_MA_RCVAL_TX2 = 0x01c7, + B3_MA_RC_CTRL = 0x01c8, + B3_MA_RC_TEST = 0x01ca, + B3_PA_TOINI_RX1 = 0x01d0, + B3_PA_TOINI_RX2 = 0x01d4, + B3_PA_TOINI_TX1 = 0x01d8, + B3_PA_TOINI_TX2 = 0x01dc, + B3_PA_TOVAL_RX1 = 0x01e0, + B3_PA_TOVAL_RX2 = 0x01e4, + B3_PA_TOVAL_TX1 = 0x01e8, + B3_PA_TOVAL_TX2 = 0x01ec, + B3_PA_CTRL = 0x01f0, + B3_PA_TEST = 0x01f2, +}; + +/* B0_CTST 16 bit Control/Status register */ +enum { + CS_CLK_RUN_HOT = 1<<13,/* CLK_RUN hot m. (YUKON-Lite only) */ + CS_CLK_RUN_RST = 1<<12,/* CLK_RUN reset (YUKON-Lite only) */ + CS_CLK_RUN_ENA = 1<<11,/* CLK_RUN enable (YUKON-Lite only) */ + CS_VAUX_AVAIL = 1<<10,/* VAUX available (YUKON only) */ + CS_BUS_CLOCK = 1<<9, /* Bus Clock 0/1 = 33/66 MHz */ + CS_BUS_SLOT_SZ = 1<<8, /* Slot Size 0/1 = 32/64 bit slot */ + CS_ST_SW_IRQ = 1<<7, /* Set IRQ SW Request */ + CS_CL_SW_IRQ = 1<<6, /* Clear IRQ SW Request */ + CS_STOP_DONE = 1<<5, /* Stop Master is finished */ + CS_STOP_MAST = 1<<4, /* Command Bit to stop the master */ + CS_MRST_CLR = 1<<3, /* Clear Master reset */ + CS_MRST_SET = 1<<2, /* Set Master reset */ + CS_RST_CLR = 1<<1, /* Clear Software reset */ + CS_RST_SET = 1, /* Set Software reset */ + +/* B0_LED 8 Bit LED register */ +/* Bit 7.. 2: reserved */ + LED_STAT_ON = 1<<1, /* Status LED on */ + LED_STAT_OFF = 1, /* Status LED off */ + +/* B0_POWER_CTRL 8 Bit Power Control reg (YUKON only) */ + PC_VAUX_ENA = 1<<7, /* Switch VAUX Enable */ + PC_VAUX_DIS = 1<<6, /* Switch VAUX Disable */ + PC_VCC_ENA = 1<<5, /* Switch VCC Enable */ + PC_VCC_DIS = 1<<4, /* Switch VCC Disable */ + PC_VAUX_ON = 1<<3, /* Switch VAUX On */ + PC_VAUX_OFF = 1<<2, /* Switch VAUX Off */ + PC_VCC_ON = 1<<1, /* Switch VCC On */ + PC_VCC_OFF = 1<<0, /* Switch VCC Off */ +}; + +/* B2_IRQM_MSK 32 bit IRQ Moderation Mask */ +enum { + IS_ALL_MSK = 0xbffffffful, /* All Interrupt bits */ + IS_HW_ERR = 1<<31, /* Interrupt HW Error */ + /* Bit 30: reserved */ + IS_PA_TO_RX1 = 1<<29, /* Packet Arb Timeout Rx1 */ + IS_PA_TO_RX2 = 1<<28, /* Packet Arb Timeout Rx2 */ + IS_PA_TO_TX1 = 1<<27, /* Packet Arb Timeout Tx1 */ + IS_PA_TO_TX2 = 1<<26, /* Packet Arb Timeout Tx2 */ + IS_I2C_READY = 1<<25, /* IRQ on end of I2C Tx */ + IS_IRQ_SW = 1<<24, /* SW forced IRQ */ + IS_EXT_REG = 1<<23, /* IRQ from LM80 or PHY (GENESIS only) */ + /* IRQ from PHY (YUKON only) */ + IS_TIMINT = 1<<22, /* IRQ from Timer */ + IS_MAC1 = 1<<21, /* IRQ from MAC 1 */ + IS_LNK_SYNC_M1 = 1<<20, /* Link Sync Cnt wrap MAC 1 */ + IS_MAC2 = 1<<19, /* IRQ from MAC 2 */ + IS_LNK_SYNC_M2 = 1<<18, /* Link Sync Cnt wrap MAC 2 */ +/* Receive Queue 1 */ + IS_R1_B = 1<<17, /* Q_R1 End of Buffer */ + IS_R1_F = 1<<16, /* Q_R1 End of Frame */ + IS_R1_C = 1<<15, /* Q_R1 Encoding Error */ +/* Receive Queue 2 */ + IS_R2_B = 1<<14, /* Q_R2 End of Buffer */ + IS_R2_F = 1<<13, /* Q_R2 End of Frame */ + IS_R2_C = 1<<12, /* Q_R2 Encoding Error */ +/* Synchronous Transmit Queue 1 */ + IS_XS1_B = 1<<11, /* Q_XS1 End of Buffer */ + IS_XS1_F = 1<<10, /* Q_XS1 End of Frame */ + IS_XS1_C = 1<<9, /* Q_XS1 Encoding Error */ +/* Asynchronous Transmit Queue 1 */ + IS_XA1_B = 1<<8, /* Q_XA1 End of Buffer */ + IS_XA1_F = 1<<7, /* Q_XA1 End of Frame */ + IS_XA1_C = 1<<6, /* Q_XA1 Encoding Error */ +/* Synchronous Transmit Queue 2 */ + IS_XS2_B = 1<<5, /* Q_XS2 End of Buffer */ + IS_XS2_F = 1<<4, /* Q_XS2 End of Frame */ + IS_XS2_C = 1<<3, /* Q_XS2 Encoding Error */ +/* Asynchronous Transmit Queue 2 */ + IS_XA2_B = 1<<2, /* Q_XA2 End of Buffer */ + IS_XA2_F = 1<<1, /* Q_XA2 End of Frame */ + IS_XA2_C = 1<<0, /* Q_XA2 Encoding Error */ + + IS_PORT_1 = IS_XA1_F| IS_R1_F| IS_MAC1, + IS_PORT_2 = IS_XA2_F| IS_R2_F| IS_MAC2, +}; + + +/* B2_IRQM_HWE_MSK 32 bit IRQ Moderation HW Error Mask */ +enum { + IS_ERR_MSK = 0x00000fff,/* All Error bits */ + + IS_IRQ_TIST_OV = 1<<13, /* Time Stamp Timer Overflow (YUKON only) */ + IS_IRQ_SENSOR = 1<<12, /* IRQ from Sensor (YUKON only) */ + IS_IRQ_MST_ERR = 1<<11, /* IRQ master error detected */ + IS_IRQ_STAT = 1<<10, /* IRQ status exception */ + IS_NO_STAT_M1 = 1<<9, /* No Rx Status from MAC 1 */ + IS_NO_STAT_M2 = 1<<8, /* No Rx Status from MAC 2 */ + IS_NO_TIST_M1 = 1<<7, /* No Time Stamp from MAC 1 */ + IS_NO_TIST_M2 = 1<<6, /* No Time Stamp from MAC 2 */ + IS_RAM_RD_PAR = 1<<5, /* RAM Read Parity Error */ + IS_RAM_WR_PAR = 1<<4, /* RAM Write Parity Error */ + IS_M1_PAR_ERR = 1<<3, /* MAC 1 Parity Error */ + IS_M2_PAR_ERR = 1<<2, /* MAC 2 Parity Error */ + IS_R1_PAR_ERR = 1<<1, /* Queue R1 Parity Error */ + IS_R2_PAR_ERR = 1<<0, /* Queue R2 Parity Error */ +}; + +/* B2_TST_CTRL1 8 bit Test Control Register 1 */ +enum { + TST_FRC_DPERR_MR = 1<<7, /* force DATAPERR on MST RD */ + TST_FRC_DPERR_MW = 1<<6, /* force DATAPERR on MST WR */ + TST_FRC_DPERR_TR = 1<<5, /* force DATAPERR on TRG RD */ + TST_FRC_DPERR_TW = 1<<4, /* force DATAPERR on TRG WR */ + TST_FRC_APERR_M = 1<<3, /* force ADDRPERR on MST */ + TST_FRC_APERR_T = 1<<2, /* force ADDRPERR on TRG */ + TST_CFG_WRITE_ON = 1<<1, /* Enable Config Reg WR */ + TST_CFG_WRITE_OFF= 1<<0, /* Disable Config Reg WR */ +}; + +/* B2_MAC_CFG 8 bit MAC Configuration / Chip Revision */ +enum { + CFG_CHIP_R_MSK = 0xf<<4, /* Bit 7.. 4: Chip Revision */ + /* Bit 3.. 2: reserved */ + CFG_DIS_M2_CLK = 1<<1, /* Disable Clock for 2nd MAC */ + CFG_SNG_MAC = 1<<0, /* MAC Config: 0=2 MACs / 1=1 MAC*/ +}; + +/* B2_CHIP_ID 8 bit Chip Identification Number */ +enum { + CHIP_ID_GENESIS = 0x0a, /* Chip ID for GENESIS */ + CHIP_ID_YUKON = 0xb0, /* Chip ID for YUKON */ + CHIP_ID_YUKON_LITE = 0xb1, /* Chip ID for YUKON-Lite (Rev. A1-A3) */ + CHIP_ID_YUKON_LP = 0xb2, /* Chip ID for YUKON-LP */ + CHIP_ID_YUKON_XL = 0xb3, /* Chip ID for YUKON-2 XL */ + CHIP_ID_YUKON_EC = 0xb6, /* Chip ID for YUKON-2 EC */ + CHIP_ID_YUKON_FE = 0xb7, /* Chip ID for YUKON-2 FE */ + + CHIP_REV_YU_LITE_A1 = 3, /* Chip Rev. for YUKON-Lite A1,A2 */ + CHIP_REV_YU_LITE_A3 = 7, /* Chip Rev. for YUKON-Lite A3 */ +}; + +/* B2_LD_TEST 8 bit EPROM loader test register */ +enum { + LD_T_ON = 1<<3, /* Loader Test mode on */ + LD_T_OFF = 1<<2, /* Loader Test mode off */ + LD_T_STEP = 1<<1, /* Decrement FPROM addr. Counter */ + LD_START = 1<<0, /* Start loading FPROM */ +}; + +/* B2_TI_CTRL 8 bit Timer control */ +/* B2_IRQM_CTRL 8 bit IRQ Moderation Timer Control */ +enum { + TIM_START = 1<<2, /* Start Timer */ + TIM_STOP = 1<<1, /* Stop Timer */ + TIM_CLR_IRQ = 1<<0, /* Clear Timer IRQ (!IRQM) */ +}; + +/* B2_TI_TEST 8 Bit Timer Test */ +/* B2_IRQM_TEST 8 bit IRQ Moderation Timer Test */ +/* B28_DPT_TST 8 bit Descriptor Poll Timer Test Reg */ +enum { + TIM_T_ON = 1<<2, /* Test mode on */ + TIM_T_OFF = 1<<1, /* Test mode off */ + TIM_T_STEP = 1<<0, /* Test step */ +}; + +/* B28_DPT_INI 32 bit Descriptor Poll Timer Init Val */ +/* B28_DPT_VAL 32 bit Descriptor Poll Timer Curr Val */ +/* B28_DPT_CTRL 8 bit Descriptor Poll Timer Ctrl Reg */ +enum { + DPT_MSK = 0x00ffffffL, /* Bit 23.. 0: Desc Poll Timer Bits */ + + DPT_START = 1<<1, /* Start Descriptor Poll Timer */ + DPT_STOP = 1<<0, /* Stop Descriptor Poll Timer */ +}; + +/* B2_GP_IO 32 bit General Purpose I/O Register */ +enum { + GP_DIR_9 = 1<<25, /* IO_9 direct, 0=In/1=Out */ + GP_DIR_8 = 1<<24, /* IO_8 direct, 0=In/1=Out */ + GP_DIR_7 = 1<<23, /* IO_7 direct, 0=In/1=Out */ + GP_DIR_6 = 1<<22, /* IO_6 direct, 0=In/1=Out */ + GP_DIR_5 = 1<<21, /* IO_5 direct, 0=In/1=Out */ + GP_DIR_4 = 1<<20, /* IO_4 direct, 0=In/1=Out */ + GP_DIR_3 = 1<<19, /* IO_3 direct, 0=In/1=Out */ + GP_DIR_2 = 1<<18, /* IO_2 direct, 0=In/1=Out */ + GP_DIR_1 = 1<<17, /* IO_1 direct, 0=In/1=Out */ + GP_DIR_0 = 1<<16, /* IO_0 direct, 0=In/1=Out */ + + GP_IO_9 = 1<<9, /* IO_9 pin */ + GP_IO_8 = 1<<8, /* IO_8 pin */ + GP_IO_7 = 1<<7, /* IO_7 pin */ + GP_IO_6 = 1<<6, /* IO_6 pin */ + GP_IO_5 = 1<<5, /* IO_5 pin */ + GP_IO_4 = 1<<4, /* IO_4 pin */ + GP_IO_3 = 1<<3, /* IO_3 pin */ + GP_IO_2 = 1<<2, /* IO_2 pin */ + GP_IO_1 = 1<<1, /* IO_1 pin */ + GP_IO_0 = 1<<0, /* IO_0 pin */ +}; + +/* Rx/Tx Path related Arbiter Test Registers */ +/* B3_MA_TO_TEST 16 bit MAC Arbiter Timeout Test Reg */ +/* B3_MA_RC_TEST 16 bit MAC Arbiter Recovery Test Reg */ +/* B3_PA_TEST 16 bit Packet Arbiter Test Register */ +/* Bit 15, 11, 7, and 3 are reserved in B3_PA_TEST */ +enum { + TX2_T_EV = 1<<15,/* TX2 Timeout/Recv Event occured */ + TX2_T_ON = 1<<14,/* TX2 Timeout/Recv Timer Test On */ + TX2_T_OFF = 1<<13,/* TX2 Timeout/Recv Timer Tst Off */ + TX2_T_STEP = 1<<12,/* TX2 Timeout/Recv Timer Step */ + TX1_T_EV = 1<<11,/* TX1 Timeout/Recv Event occured */ + TX1_T_ON = 1<<10,/* TX1 Timeout/Recv Timer Test On */ + TX1_T_OFF = 1<<9, /* TX1 Timeout/Recv Timer Tst Off */ + TX1_T_STEP = 1<<8, /* TX1 Timeout/Recv Timer Step */ + RX2_T_EV = 1<<7, /* RX2 Timeout/Recv Event occured */ + RX2_T_ON = 1<<6, /* RX2 Timeout/Recv Timer Test On */ + RX2_T_OFF = 1<<5, /* RX2 Timeout/Recv Timer Tst Off */ + RX2_T_STEP = 1<<4, /* RX2 Timeout/Recv Timer Step */ + RX1_T_EV = 1<<3, /* RX1 Timeout/Recv Event occured */ + RX1_T_ON = 1<<2, /* RX1 Timeout/Recv Timer Test On */ + RX1_T_OFF = 1<<1, /* RX1 Timeout/Recv Timer Tst Off */ + RX1_T_STEP = 1<<0, /* RX1 Timeout/Recv Timer Step */ +}; + +/* Descriptor Bit Definition */ +/* TxCtrl Transmit Buffer Control Field */ +/* RxCtrl Receive Buffer Control Field */ +enum { + BMU_OWN = 1<<31, /* OWN bit: 0=host/1=BMU */ + BMU_STF = 1<<30, /* Start of Frame */ + BMU_EOF = 1<<29, /* End of Frame */ + BMU_IRQ_EOB = 1<<28, /* Req "End of Buffer" IRQ */ + BMU_IRQ_EOF = 1<<27, /* Req "End of Frame" IRQ */ + /* TxCtrl specific bits */ + BMU_STFWD = 1<<26, /* (Tx) Store & Forward Frame */ + BMU_NO_FCS = 1<<25, /* (Tx) Disable MAC FCS (CRC) generation */ + BMU_SW = 1<<24, /* (Tx) 1 bit res. for SW use */ + /* RxCtrl specific bits */ + BMU_DEV_0 = 1<<26, /* (Rx) Transfer data to Dev0 */ + BMU_STAT_VAL = 1<<25, /* (Rx) Rx Status Valid */ + BMU_TIST_VAL = 1<<24, /* (Rx) Rx TimeStamp Valid */ + /* Bit 23..16: BMU Check Opcodes */ + BMU_CHECK = 0x55<<16, /* Default BMU check */ + BMU_TCP_CHECK = 0x56<<16, /* Descr with TCP ext */ + BMU_UDP_CHECK = 0x57<<16, /* Descr with UDP ext (YUKON only) */ + BMU_BBC = 0xffffL, /* Bit 15.. 0: Buffer Byte Counter */ +}; + +/* B2_BSC_CTRL 8 bit Blink Source Counter Control */ +enum { + BSC_START = 1<<1, /* Start Blink Source Counter */ + BSC_STOP = 1<<0, /* Stop Blink Source Counter */ +}; + +/* B2_BSC_STAT 8 bit Blink Source Counter Status */ +enum { + BSC_SRC = 1<<0, /* Blink Source, 0=Off / 1=On */ +}; + +/* B2_BSC_TST 16 bit Blink Source Counter Test Reg */ +enum { + BSC_T_ON = 1<<2, /* Test mode on */ + BSC_T_OFF = 1<<1, /* Test mode off */ + BSC_T_STEP = 1<<0, /* Test step */ +}; + +/* B3_RAM_ADDR 32 bit RAM Address, to read or write */ + /* Bit 31..19: reserved */ +#define RAM_ADR_RAN 0x0007ffffL /* Bit 18.. 0: RAM Address Range */ +/* RAM Interface Registers */ + +/* B3_RI_CTRL 16 bit RAM Iface Control Register */ +enum { + RI_CLR_RD_PERR = 1<<9, /* Clear IRQ RAM Read Parity Err */ + RI_CLR_WR_PERR = 1<<8, /* Clear IRQ RAM Write Parity Err*/ + + RI_RST_CLR = 1<<1, /* Clear RAM Interface Reset */ + RI_RST_SET = 1<<0, /* Set RAM Interface Reset */ +}; + +/* B3_RI_TEST 8 bit RAM Iface Test Register */ +enum { + RI_T_EV = 1<<3, /* Timeout Event occured */ + RI_T_ON = 1<<2, /* Timeout Timer Test On */ + RI_T_OFF = 1<<1, /* Timeout Timer Test Off */ + RI_T_STEP = 1<<0, /* Timeout Timer Step */ +}; + +/* MAC Arbiter Registers */ +/* B3_MA_TO_CTRL 16 bit MAC Arbiter Timeout Ctrl Reg */ +enum { + MA_FOE_ON = 1<<3, /* XMAC Fast Output Enable ON */ + MA_FOE_OFF = 1<<2, /* XMAC Fast Output Enable OFF */ + MA_RST_CLR = 1<<1, /* Clear MAC Arbiter Reset */ + MA_RST_SET = 1<<0, /* Set MAC Arbiter Reset */ + +}; + +/* Timeout values */ +#define SK_MAC_TO_53 72 /* MAC arbiter timeout */ +#define SK_PKT_TO_53 0x2000 /* Packet arbiter timeout */ +#define SK_PKT_TO_MAX 0xffff /* Maximum value */ +#define SK_RI_TO_53 36 /* RAM interface timeout */ + + +/* B3_MA_RC_CTRL 16 bit MAC Arbiter Recovery Ctrl Reg */ +enum { + MA_ENA_REC_TX2 = 1<<7, /* Enable Recovery Timer TX2 */ + MA_DIS_REC_TX2 = 1<<6, /* Disable Recovery Timer TX2 */ + MA_ENA_REC_TX1 = 1<<5, /* Enable Recovery Timer TX1 */ + MA_DIS_REC_TX1 = 1<<4, /* Disable Recovery Timer TX1 */ + MA_ENA_REC_RX2 = 1<<3, /* Enable Recovery Timer RX2 */ + MA_DIS_REC_RX2 = 1<<2, /* Disable Recovery Timer RX2 */ + MA_ENA_REC_RX1 = 1<<1, /* Enable Recovery Timer RX1 */ + MA_DIS_REC_RX1 = 1<<0, /* Disable Recovery Timer RX1 */ +}; + +/* Packet Arbiter Registers */ +/* B3_PA_CTRL 16 bit Packet Arbiter Ctrl Register */ +enum { + PA_CLR_TO_TX2 = 1<<13, /* Clear IRQ Packet Timeout TX2 */ + PA_CLR_TO_TX1 = 1<<12, /* Clear IRQ Packet Timeout TX1 */ + PA_CLR_TO_RX2 = 1<<11, /* Clear IRQ Packet Timeout RX2 */ + PA_CLR_TO_RX1 = 1<<10, /* Clear IRQ Packet Timeout RX1 */ + PA_ENA_TO_TX2 = 1<<9, /* Enable Timeout Timer TX2 */ + PA_DIS_TO_TX2 = 1<<8, /* Disable Timeout Timer TX2 */ + PA_ENA_TO_TX1 = 1<<7, /* Enable Timeout Timer TX1 */ + PA_DIS_TO_TX1 = 1<<6, /* Disable Timeout Timer TX1 */ + PA_ENA_TO_RX2 = 1<<5, /* Enable Timeout Timer RX2 */ + PA_DIS_TO_RX2 = 1<<4, /* Disable Timeout Timer RX2 */ + PA_ENA_TO_RX1 = 1<<3, /* Enable Timeout Timer RX1 */ + PA_DIS_TO_RX1 = 1<<2, /* Disable Timeout Timer RX1 */ + PA_RST_CLR = 1<<1, /* Clear MAC Arbiter Reset */ + PA_RST_SET = 1<<0, /* Set MAC Arbiter Reset */ +}; + +#define PA_ENA_TO_ALL (PA_ENA_TO_RX1 | PA_ENA_TO_RX2 |\ + PA_ENA_TO_TX1 | PA_ENA_TO_TX2) + + +/* Transmit Arbiter Registers MAC 1 and 2, use MR_ADDR() to access */ +/* TXA_ITI_INI 32 bit Tx Arb Interval Timer Init Val */ +/* TXA_ITI_VAL 32 bit Tx Arb Interval Timer Value */ +/* TXA_LIM_INI 32 bit Tx Arb Limit Counter Init Val */ +/* TXA_LIM_VAL 32 bit Tx Arb Limit Counter Value */ + +#define TXA_MAX_VAL 0x00ffffffUL /* Bit 23.. 0: Max TXA Timer/Cnt Val */ + +/* TXA_CTRL 8 bit Tx Arbiter Control Register */ +enum { + TXA_ENA_FSYNC = 1<<7, /* Enable force of sync Tx queue */ + TXA_DIS_FSYNC = 1<<6, /* Disable force of sync Tx queue */ + TXA_ENA_ALLOC = 1<<5, /* Enable alloc of free bandwidth */ + TXA_DIS_ALLOC = 1<<4, /* Disable alloc of free bandwidth */ + TXA_START_RC = 1<<3, /* Start sync Rate Control */ + TXA_STOP_RC = 1<<2, /* Stop sync Rate Control */ + TXA_ENA_ARB = 1<<1, /* Enable Tx Arbiter */ + TXA_DIS_ARB = 1<<0, /* Disable Tx Arbiter */ +}; + +/* + * Bank 4 - 5 + */ +/* Transmit Arbiter Registers MAC 1 and 2, use MR_ADDR() to access */ +enum { + TXA_ITI_INI = 0x0200,/* 32 bit Tx Arb Interval Timer Init Val*/ + TXA_ITI_VAL = 0x0204,/* 32 bit Tx Arb Interval Timer Value */ + TXA_LIM_INI = 0x0208,/* 32 bit Tx Arb Limit Counter Init Val */ + TXA_LIM_VAL = 0x020c,/* 32 bit Tx Arb Limit Counter Value */ + TXA_CTRL = 0x0210,/* 8 bit Tx Arbiter Control Register */ + TXA_TEST = 0x0211,/* 8 bit Tx Arbiter Test Register */ + TXA_STAT = 0x0212,/* 8 bit Tx Arbiter Status Register */ +}; + + +enum { + B6_EXT_REG = 0x0300,/* External registers (GENESIS only) */ + B7_CFG_SPC = 0x0380,/* copy of the Configuration register */ + B8_RQ1_REGS = 0x0400,/* Receive Queue 1 */ + B8_RQ2_REGS = 0x0480,/* Receive Queue 2 */ + B8_TS1_REGS = 0x0600,/* Transmit sync queue 1 */ + B8_TA1_REGS = 0x0680,/* Transmit async queue 1 */ + B8_TS2_REGS = 0x0700,/* Transmit sync queue 2 */ + B8_TA2_REGS = 0x0780,/* Transmit sync queue 2 */ + B16_RAM_REGS = 0x0800,/* RAM Buffer Registers */ +}; + +/* Queue Register Offsets, use Q_ADDR() to access */ +enum { + B8_Q_REGS = 0x0400, /* base of Queue registers */ + Q_D = 0x00, /* 8*32 bit Current Descriptor */ + Q_DA_L = 0x20, /* 32 bit Current Descriptor Address Low dWord */ + Q_DA_H = 0x24, /* 32 bit Current Descriptor Address High dWord */ + Q_AC_L = 0x28, /* 32 bit Current Address Counter Low dWord */ + Q_AC_H = 0x2c, /* 32 bit Current Address Counter High dWord */ + Q_BC = 0x30, /* 32 bit Current Byte Counter */ + Q_CSR = 0x34, /* 32 bit BMU Control/Status Register */ + Q_F = 0x38, /* 32 bit Flag Register */ + Q_T1 = 0x3c, /* 32 bit Test Register 1 */ + Q_T1_TR = 0x3c, /* 8 bit Test Register 1 Transfer SM */ + Q_T1_WR = 0x3d, /* 8 bit Test Register 1 Write Descriptor SM */ + Q_T1_RD = 0x3e, /* 8 bit Test Register 1 Read Descriptor SM */ + Q_T1_SV = 0x3f, /* 8 bit Test Register 1 Supervisor SM */ + Q_T2 = 0x40, /* 32 bit Test Register 2 */ + Q_T3 = 0x44, /* 32 bit Test Register 3 */ + +/* Yukon-2 */ + Q_DONE = 0x24, /* 16 bit Done Index (Yukon-2 only) */ + Q_WM = 0x40, /* 16 bit FIFO Watermark */ + Q_AL = 0x42, /* 8 bit FIFO Alignment */ + Q_RSP = 0x44, /* 16 bit FIFO Read Shadow Pointer */ + Q_RSL = 0x46, /* 8 bit FIFO Read Shadow Level */ + Q_RP = 0x48, /* 8 bit FIFO Read Pointer */ + Q_RL = 0x4a, /* 8 bit FIFO Read Level */ + Q_WP = 0x4c, /* 8 bit FIFO Write Pointer */ + Q_WSP = 0x4d, /* 8 bit FIFO Write Shadow Pointer */ + Q_WL = 0x4e, /* 8 bit FIFO Write Level */ + Q_WSL = 0x4f, /* 8 bit FIFO Write Shadow Level */ +}; +#define Q_ADDR(reg, offs) (B8_Q_REGS + (reg) + (offs)) + +/* RAM Buffer Register Offsets */ +enum { + + RB_START = 0x00,/* 32 bit RAM Buffer Start Address */ + RB_END = 0x04,/* 32 bit RAM Buffer End Address */ + RB_WP = 0x08,/* 32 bit RAM Buffer Write Pointer */ + RB_RP = 0x0c,/* 32 bit RAM Buffer Read Pointer */ + RB_RX_UTPP = 0x10,/* 32 bit Rx Upper Threshold, Pause Packet */ + RB_RX_LTPP = 0x14,/* 32 bit Rx Lower Threshold, Pause Packet */ + RB_RX_UTHP = 0x18,/* 32 bit Rx Upper Threshold, High Prio */ + RB_RX_LTHP = 0x1c,/* 32 bit Rx Lower Threshold, High Prio */ + /* 0x10 - 0x1f: reserved at Tx RAM Buffer Registers */ + RB_PC = 0x20,/* 32 bit RAM Buffer Packet Counter */ + RB_LEV = 0x24,/* 32 bit RAM Buffer Level Register */ + RB_CTRL = 0x28,/* 32 bit RAM Buffer Control Register */ + RB_TST1 = 0x29,/* 8 bit RAM Buffer Test Register 1 */ + RB_TST2 = 0x2a,/* 8 bit RAM Buffer Test Register 2 */ +}; + +/* Receive and Transmit Queues */ +enum { + Q_R1 = 0x0000, /* Receive Queue 1 */ + Q_R2 = 0x0080, /* Receive Queue 2 */ + Q_XS1 = 0x0200, /* Synchronous Transmit Queue 1 */ + Q_XA1 = 0x0280, /* Asynchronous Transmit Queue 1 */ + Q_XS2 = 0x0300, /* Synchronous Transmit Queue 2 */ + Q_XA2 = 0x0380, /* Asynchronous Transmit Queue 2 */ +}; + +/* Different MAC Types */ +enum { + SK_MAC_XMAC = 0, /* Xaqti XMAC II */ + SK_MAC_GMAC = 1, /* Marvell GMAC */ +}; + +/* Different PHY Types */ +enum { + SK_PHY_XMAC = 0,/* integrated in XMAC II */ + SK_PHY_BCOM = 1,/* Broadcom BCM5400 */ + SK_PHY_LONE = 2,/* Level One LXT1000 [not supported]*/ + SK_PHY_NAT = 3,/* National DP83891 [not supported] */ + SK_PHY_MARV_COPPER= 4,/* Marvell 88E1011S */ + SK_PHY_MARV_FIBER = 5,/* Marvell 88E1011S working on fiber */ +}; + +/* PHY addresses (bits 12..8 of PHY address reg) */ +enum { + PHY_ADDR_XMAC = 0<<8, + PHY_ADDR_BCOM = 1<<8, + PHY_ADDR_LONE = 3<<8, + PHY_ADDR_NAT = 0<<8, +/* GPHY address (bits 15..11 of SMI control reg) */ + PHY_ADDR_MARV = 0, +}; + +#define RB_ADDR(offs, queue) (B16_RAM_REGS + (queue) + (offs)) + +/* Receive MAC FIFO, Receive LED, and Link_Sync regs (GENESIS only) */ +enum { + RX_MFF_EA = 0x0c00,/* 32 bit Receive MAC FIFO End Address */ + RX_MFF_WP = 0x0c04,/* 32 bit Receive MAC FIFO Write Pointer */ + + RX_MFF_RP = 0x0c0c,/* 32 bit Receive MAC FIFO Read Pointer */ + RX_MFF_PC = 0x0c10,/* 32 bit Receive MAC FIFO Packet Cnt */ + RX_MFF_LEV = 0x0c14,/* 32 bit Receive MAC FIFO Level */ + RX_MFF_CTRL1 = 0x0c18,/* 16 bit Receive MAC FIFO Control Reg 1*/ + RX_MFF_STAT_TO = 0x0c1a,/* 8 bit Receive MAC Status Timeout */ + RX_MFF_TIST_TO = 0x0c1b,/* 8 bit Receive MAC Time Stamp Timeout */ + RX_MFF_CTRL2 = 0x0c1c,/* 8 bit Receive MAC FIFO Control Reg 2*/ + RX_MFF_TST1 = 0x0c1d,/* 8 bit Receive MAC FIFO Test Reg 1 */ + RX_MFF_TST2 = 0x0c1e,/* 8 bit Receive MAC FIFO Test Reg 2 */ + + RX_LED_INI = 0x0c20,/* 32 bit Receive LED Cnt Init Value */ + RX_LED_VAL = 0x0c24,/* 32 bit Receive LED Cnt Current Value */ + RX_LED_CTRL = 0x0c28,/* 8 bit Receive LED Cnt Control Reg */ + RX_LED_TST = 0x0c29,/* 8 bit Receive LED Cnt Test Register */ + + LNK_SYNC_INI = 0x0c30,/* 32 bit Link Sync Cnt Init Value */ + LNK_SYNC_VAL = 0x0c34,/* 32 bit Link Sync Cnt Current Value */ + LNK_SYNC_CTRL = 0x0c38,/* 8 bit Link Sync Cnt Control Register */ + LNK_SYNC_TST = 0x0c39,/* 8 bit Link Sync Cnt Test Register */ + LNK_LED_REG = 0x0c3c,/* 8 bit Link LED Register */ +}; + +/* Receive and Transmit MAC FIFO Registers (GENESIS only) */ +/* RX_MFF_CTRL1 16 bit Receive MAC FIFO Control Reg 1 */ +enum { + MFF_ENA_RDY_PAT = 1<<13, /* Enable Ready Patch */ + MFF_DIS_RDY_PAT = 1<<12, /* Disable Ready Patch */ + MFF_ENA_TIM_PAT = 1<<11, /* Enable Timing Patch */ + MFF_DIS_TIM_PAT = 1<<10, /* Disable Timing Patch */ + MFF_ENA_ALM_FUL = 1<<9, /* Enable AlmostFull Sign */ + MFF_DIS_ALM_FUL = 1<<8, /* Disable AlmostFull Sign */ + MFF_ENA_PAUSE = 1<<7, /* Enable Pause Signaling */ + MFF_DIS_PAUSE = 1<<6, /* Disable Pause Signaling */ + MFF_ENA_FLUSH = 1<<5, /* Enable Frame Flushing */ + MFF_DIS_FLUSH = 1<<4, /* Disable Frame Flushing */ + MFF_ENA_TIST = 1<<3, /* Enable Time Stamp Gener */ + MFF_DIS_TIST = 1<<2, /* Disable Time Stamp Gener */ + MFF_CLR_INTIST = 1<<1, /* Clear IRQ No Time Stamp */ + MFF_CLR_INSTAT = 1<<0, /* Clear IRQ No Status */ +#define MFF_RX_CTRL_DEF MFF_ENA_TIM_PAT +}; + +/* TX_MFF_CTRL1 16 bit Transmit MAC FIFO Control Reg 1 */ +enum { + MFF_CLR_PERR = 1<<15, /* Clear Parity Error IRQ */ + /* Bit 14: reserved */ + MFF_ENA_PKT_REC = 1<<13, /* Enable Packet Recovery */ + MFF_DIS_PKT_REC = 1<<12, /* Disable Packet Recovery */ + + MFF_ENA_W4E = 1<<7, /* Enable Wait for Empty */ + MFF_DIS_W4E = 1<<6, /* Disable Wait for Empty */ + + MFF_ENA_LOOPB = 1<<3, /* Enable Loopback */ + MFF_DIS_LOOPB = 1<<2, /* Disable Loopback */ + MFF_CLR_MAC_RST = 1<<1, /* Clear XMAC Reset */ + MFF_SET_MAC_RST = 1<<0, /* Set XMAC Reset */ +}; + +#define MFF_TX_CTRL_DEF (MFF_ENA_PKT_REC | MFF_ENA_TIM_PAT | MFF_ENA_FLUSH) + +/* RX_MFF_TST2 8 bit Receive MAC FIFO Test Register 2 */ +/* TX_MFF_TST2 8 bit Transmit MAC FIFO Test Register 2 */ +enum { + MFF_WSP_T_ON = 1<<6, /* Tx: Write Shadow Ptr TestOn */ + MFF_WSP_T_OFF = 1<<5, /* Tx: Write Shadow Ptr TstOff */ + MFF_WSP_INC = 1<<4, /* Tx: Write Shadow Ptr Increment */ + MFF_PC_DEC = 1<<3, /* Packet Counter Decrement */ + MFF_PC_T_ON = 1<<2, /* Packet Counter Test On */ + MFF_PC_T_OFF = 1<<1, /* Packet Counter Test Off */ + MFF_PC_INC = 1<<0, /* Packet Counter Increment */ +}; + +/* RX_MFF_TST1 8 bit Receive MAC FIFO Test Register 1 */ +/* TX_MFF_TST1 8 bit Transmit MAC FIFO Test Register 1 */ +enum { + MFF_WP_T_ON = 1<<6, /* Write Pointer Test On */ + MFF_WP_T_OFF = 1<<5, /* Write Pointer Test Off */ + MFF_WP_INC = 1<<4, /* Write Pointer Increm */ + + MFF_RP_T_ON = 1<<2, /* Read Pointer Test On */ + MFF_RP_T_OFF = 1<<1, /* Read Pointer Test Off */ + MFF_RP_DEC = 1<<0, /* Read Pointer Decrement */ +}; + +/* RX_MFF_CTRL2 8 bit Receive MAC FIFO Control Reg 2 */ +/* TX_MFF_CTRL2 8 bit Transmit MAC FIFO Control Reg 2 */ +enum { + MFF_ENA_OP_MD = 1<<3, /* Enable Operation Mode */ + MFF_DIS_OP_MD = 1<<2, /* Disable Operation Mode */ + MFF_RST_CLR = 1<<1, /* Clear MAC FIFO Reset */ + MFF_RST_SET = 1<<0, /* Set MAC FIFO Reset */ +}; + + +/* Link LED Counter Registers (GENESIS only) */ + +/* RX_LED_CTRL 8 bit Receive LED Cnt Control Reg */ +/* TX_LED_CTRL 8 bit Transmit LED Cnt Control Reg */ +/* LNK_SYNC_CTRL 8 bit Link Sync Cnt Control Register */ +enum { + LED_START = 1<<2, /* Start Timer */ + LED_STOP = 1<<1, /* Stop Timer */ + LED_STATE = 1<<0, /* Rx/Tx: LED State, 1=LED on */ +}; + +/* RX_LED_TST 8 bit Receive LED Cnt Test Register */ +/* TX_LED_TST 8 bit Transmit LED Cnt Test Register */ +/* LNK_SYNC_TST 8 bit Link Sync Cnt Test Register */ +enum { + LED_T_ON = 1<<2, /* LED Counter Test mode On */ + LED_T_OFF = 1<<1, /* LED Counter Test mode Off */ + LED_T_STEP = 1<<0, /* LED Counter Step */ +}; + +/* LNK_LED_REG 8 bit Link LED Register */ +enum { + LED_BLK_ON = 1<<5, /* Link LED Blinking On */ + LED_BLK_OFF = 1<<4, /* Link LED Blinking Off */ + LED_SYNC_ON = 1<<3, /* Use Sync Wire to switch LED */ + LED_SYNC_OFF = 1<<2, /* Disable Sync Wire Input */ + LED_ON = 1<<1, /* switch LED on */ + LED_OFF = 1<<0, /* switch LED off */ +}; + +/* Receive GMAC FIFO (YUKON and Yukon-2) */ +enum { + RX_GMF_EA = 0x0c40,/* 32 bit Rx GMAC FIFO End Address */ + RX_GMF_AF_THR = 0x0c44,/* 32 bit Rx GMAC FIFO Almost Full Thresh. */ + RX_GMF_CTRL_T = 0x0c48,/* 32 bit Rx GMAC FIFO Control/Test */ + RX_GMF_FL_MSK = 0x0c4c,/* 32 bit Rx GMAC FIFO Flush Mask */ + RX_GMF_FL_THR = 0x0c50,/* 32 bit Rx GMAC FIFO Flush Threshold */ + RX_GMF_TR_THR = 0x0c54,/* 32 bit Rx Truncation Threshold (Yukon-2) */ + + RX_GMF_VLAN = 0x0c5c,/* 32 bit Rx VLAN Type Register (Yukon-2) */ + RX_GMF_WP = 0x0c60,/* 32 bit Rx GMAC FIFO Write Pointer */ + + RX_GMF_WLEV = 0x0c68,/* 32 bit Rx GMAC FIFO Write Level */ + + RX_GMF_RP = 0x0c70,/* 32 bit Rx GMAC FIFO Read Pointer */ + + RX_GMF_RLEV = 0x0c78,/* 32 bit Rx GMAC FIFO Read Level */ +}; + + +/* TXA_TEST 8 bit Tx Arbiter Test Register */ +enum { + TXA_INT_T_ON = 1<<5, /* Tx Arb Interval Timer Test On */ + TXA_INT_T_OFF = 1<<4, /* Tx Arb Interval Timer Test Off */ + TXA_INT_T_STEP = 1<<3, /* Tx Arb Interval Timer Step */ + TXA_LIM_T_ON = 1<<2, /* Tx Arb Limit Timer Test On */ + TXA_LIM_T_OFF = 1<<1, /* Tx Arb Limit Timer Test Off */ + TXA_LIM_T_STEP = 1<<0, /* Tx Arb Limit Timer Step */ +}; + +/* TXA_STAT 8 bit Tx Arbiter Status Register */ +enum { + TXA_PRIO_XS = 1<<0, /* sync queue has prio to send */ +}; + + +/* Q_BC 32 bit Current Byte Counter */ + +/* BMU Control Status Registers */ +/* B0_R1_CSR 32 bit BMU Ctrl/Stat Rx Queue 1 */ +/* B0_R2_CSR 32 bit BMU Ctrl/Stat Rx Queue 2 */ +/* B0_XA1_CSR 32 bit BMU Ctrl/Stat Sync Tx Queue 1 */ +/* B0_XS1_CSR 32 bit BMU Ctrl/Stat Async Tx Queue 1 */ +/* B0_XA2_CSR 32 bit BMU Ctrl/Stat Sync Tx Queue 2 */ +/* B0_XS2_CSR 32 bit BMU Ctrl/Stat Async Tx Queue 2 */ +/* Q_CSR 32 bit BMU Control/Status Register */ + +enum { + CSR_SV_IDLE = 1<<24, /* BMU SM Idle */ + + CSR_DESC_CLR = 1<<21, /* Clear Reset for Descr */ + CSR_DESC_SET = 1<<20, /* Set Reset for Descr */ + CSR_FIFO_CLR = 1<<19, /* Clear Reset for FIFO */ + CSR_FIFO_SET = 1<<18, /* Set Reset for FIFO */ + CSR_HPI_RUN = 1<<17, /* Release HPI SM */ + CSR_HPI_RST = 1<<16, /* Reset HPI SM to Idle */ + CSR_SV_RUN = 1<<15, /* Release Supervisor SM */ + CSR_SV_RST = 1<<14, /* Reset Supervisor SM */ + CSR_DREAD_RUN = 1<<13, /* Release Descr Read SM */ + CSR_DREAD_RST = 1<<12, /* Reset Descr Read SM */ + CSR_DWRITE_RUN = 1<<11, /* Release Descr Write SM */ + CSR_DWRITE_RST = 1<<10, /* Reset Descr Write SM */ + CSR_TRANS_RUN = 1<<9, /* Release Transfer SM */ + CSR_TRANS_RST = 1<<8, /* Reset Transfer SM */ + CSR_ENA_POL = 1<<7, /* Enable Descr Polling */ + CSR_DIS_POL = 1<<6, /* Disable Descr Polling */ + CSR_STOP = 1<<5, /* Stop Rx/Tx Queue */ + CSR_START = 1<<4, /* Start Rx/Tx Queue */ + CSR_IRQ_CL_P = 1<<3, /* (Rx) Clear Parity IRQ */ + CSR_IRQ_CL_B = 1<<2, /* Clear EOB IRQ */ + CSR_IRQ_CL_F = 1<<1, /* Clear EOF IRQ */ + CSR_IRQ_CL_C = 1<<0, /* Clear ERR IRQ */ +}; + +#define CSR_SET_RESET (CSR_DESC_SET | CSR_FIFO_SET | CSR_HPI_RST |\ + CSR_SV_RST | CSR_DREAD_RST | CSR_DWRITE_RST |\ + CSR_TRANS_RST) +#define CSR_CLR_RESET (CSR_DESC_CLR | CSR_FIFO_CLR | CSR_HPI_RUN |\ + CSR_SV_RUN | CSR_DREAD_RUN | CSR_DWRITE_RUN |\ + CSR_TRANS_RUN) + +/* Q_F 32 bit Flag Register */ +enum { + F_ALM_FULL = 1<<27, /* Rx FIFO: almost full */ + F_EMPTY = 1<<27, /* Tx FIFO: empty flag */ + F_FIFO_EOF = 1<<26, /* Tag (EOF Flag) bit in FIFO */ + F_WM_REACHED = 1<<25, /* Watermark reached */ + + F_FIFO_LEVEL = 0x1fL<<16, /* Bit 23..16: # of Qwords in FIFO */ + F_WATER_MARK = 0x0007ffL, /* Bit 10.. 0: Watermark */ +}; + +/* RAM Buffer Register Offsets, use RB_ADDR(Queue, Offs) to access */ +/* RB_START 32 bit RAM Buffer Start Address */ +/* RB_END 32 bit RAM Buffer End Address */ +/* RB_WP 32 bit RAM Buffer Write Pointer */ +/* RB_RP 32 bit RAM Buffer Read Pointer */ +/* RB_RX_UTPP 32 bit Rx Upper Threshold, Pause Pack */ +/* RB_RX_LTPP 32 bit Rx Lower Threshold, Pause Pack */ +/* RB_RX_UTHP 32 bit Rx Upper Threshold, High Prio */ +/* RB_RX_LTHP 32 bit Rx Lower Threshold, High Prio */ +/* RB_PC 32 bit RAM Buffer Packet Counter */ +/* RB_LEV 32 bit RAM Buffer Level Register */ + +#define RB_MSK 0x0007ffff /* Bit 18.. 0: RAM Buffer Pointer Bits */ +/* RB_TST2 8 bit RAM Buffer Test Register 2 */ +/* RB_TST1 8 bit RAM Buffer Test Register 1 */ + +/* RB_CTRL 8 bit RAM Buffer Control Register */ +enum { + RB_ENA_STFWD = 1<<5, /* Enable Store & Forward */ + RB_DIS_STFWD = 1<<4, /* Disable Store & Forward */ + RB_ENA_OP_MD = 1<<3, /* Enable Operation Mode */ + RB_DIS_OP_MD = 1<<2, /* Disable Operation Mode */ + RB_RST_CLR = 1<<1, /* Clear RAM Buf STM Reset */ + RB_RST_SET = 1<<0, /* Set RAM Buf STM Reset */ +}; + +/* Transmit MAC FIFO and Transmit LED Registers (GENESIS only), */ +enum { + TX_MFF_EA = 0x0d00,/* 32 bit Transmit MAC FIFO End Address */ + TX_MFF_WP = 0x0d04,/* 32 bit Transmit MAC FIFO WR Pointer */ + TX_MFF_WSP = 0x0d08,/* 32 bit Transmit MAC FIFO WR Shadow Ptr */ + TX_MFF_RP = 0x0d0c,/* 32 bit Transmit MAC FIFO RD Pointer */ + TX_MFF_PC = 0x0d10,/* 32 bit Transmit MAC FIFO Packet Cnt */ + TX_MFF_LEV = 0x0d14,/* 32 bit Transmit MAC FIFO Level */ + TX_MFF_CTRL1 = 0x0d18,/* 16 bit Transmit MAC FIFO Ctrl Reg 1 */ + TX_MFF_WAF = 0x0d1a,/* 8 bit Transmit MAC Wait after flush */ + + TX_MFF_CTRL2 = 0x0d1c,/* 8 bit Transmit MAC FIFO Ctrl Reg 2 */ + TX_MFF_TST1 = 0x0d1d,/* 8 bit Transmit MAC FIFO Test Reg 1 */ + TX_MFF_TST2 = 0x0d1e,/* 8 bit Transmit MAC FIFO Test Reg 2 */ + + TX_LED_INI = 0x0d20,/* 32 bit Transmit LED Cnt Init Value */ + TX_LED_VAL = 0x0d24,/* 32 bit Transmit LED Cnt Current Val */ + TX_LED_CTRL = 0x0d28,/* 8 bit Transmit LED Cnt Control Reg */ + TX_LED_TST = 0x0d29,/* 8 bit Transmit LED Cnt Test Reg */ +}; + +/* Counter and Timer constants, for a host clock of 62.5 MHz */ +#define SK_XMIT_DUR 0x002faf08UL /* 50 ms */ +#define SK_BLK_DUR 0x01dcd650UL /* 500 ms */ + +#define SK_DPOLL_DEF 0x00ee6b28UL /* 250 ms at 62.5 MHz */ + +#define SK_DPOLL_MAX 0x00ffffffUL /* 268 ms at 62.5 MHz */ + /* 215 ms at 78.12 MHz */ + +#define SK_FACT_62 100 /* is given in percent */ +#define SK_FACT_53 85 /* on GENESIS: 53.12 MHz */ +#define SK_FACT_78 125 /* on YUKON: 78.12 MHz */ + + +/* Transmit GMAC FIFO (YUKON only) */ +enum { + TX_GMF_EA = 0x0d40,/* 32 bit Tx GMAC FIFO End Address */ + TX_GMF_AE_THR = 0x0d44,/* 32 bit Tx GMAC FIFO Almost Empty Thresh.*/ + TX_GMF_CTRL_T = 0x0d48,/* 32 bit Tx GMAC FIFO Control/Test */ + + TX_GMF_WP = 0x0d60,/* 32 bit Tx GMAC FIFO Write Pointer */ + TX_GMF_WSP = 0x0d64,/* 32 bit Tx GMAC FIFO Write Shadow Ptr. */ + TX_GMF_WLEV = 0x0d68,/* 32 bit Tx GMAC FIFO Write Level */ + + TX_GMF_RP = 0x0d70,/* 32 bit Tx GMAC FIFO Read Pointer */ + TX_GMF_RSTP = 0x0d74,/* 32 bit Tx GMAC FIFO Restart Pointer */ + TX_GMF_RLEV = 0x0d78,/* 32 bit Tx GMAC FIFO Read Level */ + + /* Descriptor Poll Timer Registers */ + B28_DPT_INI = 0x0e00,/* 24 bit Descriptor Poll Timer Init Val */ + B28_DPT_VAL = 0x0e04,/* 24 bit Descriptor Poll Timer Curr Val */ + B28_DPT_CTRL = 0x0e08,/* 8 bit Descriptor Poll Timer Ctrl Reg */ + + B28_DPT_TST = 0x0e0a,/* 8 bit Descriptor Poll Timer Test Reg */ + + /* Time Stamp Timer Registers (YUKON only) */ + GMAC_TI_ST_VAL = 0x0e14,/* 32 bit Time Stamp Timer Curr Val */ + GMAC_TI_ST_CTRL = 0x0e18,/* 8 bit Time Stamp Timer Ctrl Reg */ + GMAC_TI_ST_TST = 0x0e1a,/* 8 bit Time Stamp Timer Test Reg */ +}; + +/* Status BMU Registers (Yukon-2 only)*/ +enum { + STAT_CTRL = 0x0e80,/* 32 bit Status BMU Control Reg */ + STAT_LAST_IDX = 0x0e84,/* 16 bit Status BMU Last Index */ + /* 0x0e85 - 0x0e86: reserved */ + STAT_LIST_ADDR_LO = 0x0e88,/* 32 bit Status List Start Addr (low) */ + STAT_LIST_ADDR_HI = 0x0e8c,/* 32 bit Status List Start Addr (high) */ + STAT_TXA1_RIDX = 0x0e90,/* 16 bit Status TxA1 Report Index Reg */ + STAT_TXS1_RIDX = 0x0e92,/* 16 bit Status TxS1 Report Index Reg */ + STAT_TXA2_RIDX = 0x0e94,/* 16 bit Status TxA2 Report Index Reg */ + STAT_TXS2_RIDX = 0x0e96,/* 16 bit Status TxS2 Report Index Reg */ + STAT_TX_IDX_TH = 0x0e98,/* 16 bit Status Tx Index Threshold Reg */ + STAT_PUT_IDX = 0x0e9c,/* 16 bit Status Put Index Reg */ + +/* FIFO Control/Status Registers (Yukon-2 only)*/ + STAT_FIFO_WP = 0x0ea0,/* 8 bit Status FIFO Write Pointer Reg */ + STAT_FIFO_RP = 0x0ea4,/* 8 bit Status FIFO Read Pointer Reg */ + STAT_FIFO_RSP = 0x0ea6,/* 8 bit Status FIFO Read Shadow Ptr */ + STAT_FIFO_LEVEL = 0x0ea8,/* 8 bit Status FIFO Level Reg */ + STAT_FIFO_SHLVL = 0x0eaa,/* 8 bit Status FIFO Shadow Level Reg */ + STAT_FIFO_WM = 0x0eac,/* 8 bit Status FIFO Watermark Reg */ + STAT_FIFO_ISR_WM = 0x0ead,/* 8 bit Status FIFO ISR Watermark Reg */ + +/* Level and ISR Timer Registers (Yukon-2 only)*/ + STAT_LEV_TIMER_INI = 0x0eb0,/* 32 bit Level Timer Init. Value Reg */ + STAT_LEV_TIMER_CNT = 0x0eb4,/* 32 bit Level Timer Counter Reg */ + STAT_LEV_TIMER_CTRL = 0x0eb8,/* 8 bit Level Timer Control Reg */ + STAT_LEV_TIMER_TEST = 0x0eb9,/* 8 bit Level Timer Test Reg */ + STAT_TX_TIMER_INI = 0x0ec0,/* 32 bit Tx Timer Init. Value Reg */ + STAT_TX_TIMER_CNT = 0x0ec4,/* 32 bit Tx Timer Counter Reg */ + STAT_TX_TIMER_CTRL = 0x0ec8,/* 8 bit Tx Timer Control Reg */ + STAT_TX_TIMER_TEST = 0x0ec9,/* 8 bit Tx Timer Test Reg */ + STAT_ISR_TIMER_INI = 0x0ed0,/* 32 bit ISR Timer Init. Value Reg */ + STAT_ISR_TIMER_CNT = 0x0ed4,/* 32 bit ISR Timer Counter Reg */ + STAT_ISR_TIMER_CTRL = 0x0ed8,/* 8 bit ISR Timer Control Reg */ + STAT_ISR_TIMER_TEST = 0x0ed9,/* 8 bit ISR Timer Test Reg */ + + ST_LAST_IDX_MASK = 0x007f,/* Last Index Mask */ + ST_TXRP_IDX_MASK = 0x0fff,/* Tx Report Index Mask */ + ST_TXTH_IDX_MASK = 0x0fff,/* Tx Threshold Index Mask */ + ST_WM_IDX_MASK = 0x3f,/* FIFO Watermark Index Mask */ +}; + +enum { + LINKLED_OFF = 0x01, + LINKLED_ON = 0x02, + LINKLED_LINKSYNC_OFF = 0x04, + LINKLED_LINKSYNC_ON = 0x08, + LINKLED_BLINK_OFF = 0x10, + LINKLED_BLINK_ON = 0x20, +}; + +/* GMAC and GPHY Control Registers (YUKON only) */ +enum { + GMAC_CTRL = 0x0f00,/* 32 bit GMAC Control Reg */ + GPHY_CTRL = 0x0f04,/* 32 bit GPHY Control Reg */ + GMAC_IRQ_SRC = 0x0f08,/* 8 bit GMAC Interrupt Source Reg */ + GMAC_IRQ_MSK = 0x0f0c,/* 8 bit GMAC Interrupt Mask Reg */ + GMAC_LINK_CTRL = 0x0f10,/* 16 bit Link Control Reg */ + +/* Wake-up Frame Pattern Match Control Registers (YUKON only) */ + + WOL_REG_OFFS = 0x20,/* HW-Bug: Address is + 0x20 against spec. */ + + WOL_CTRL_STAT = 0x0f20,/* 16 bit WOL Control/Status Reg */ + WOL_MATCH_CTL = 0x0f22,/* 8 bit WOL Match Control Reg */ + WOL_MATCH_RES = 0x0f23,/* 8 bit WOL Match Result Reg */ + WOL_MAC_ADDR_LO = 0x0f24,/* 32 bit WOL MAC Address Low */ + WOL_MAC_ADDR_HI = 0x0f28,/* 16 bit WOL MAC Address High */ + WOL_PATT_PME = 0x0f2a,/* 8 bit WOL PME Match Enable (Yukon-2) */ + WOL_PATT_ASFM = 0x0f2b,/* 8 bit WOL ASF Match Enable (Yukon-2) */ + WOL_PATT_RPTR = 0x0f2c,/* 8 bit WOL Pattern Read Pointer */ + +/* WOL Pattern Length Registers (YUKON only) */ + + WOL_PATT_LEN_LO = 0x0f30,/* 32 bit WOL Pattern Length 3..0 */ + WOL_PATT_LEN_HI = 0x0f34,/* 24 bit WOL Pattern Length 6..4 */ + +/* WOL Pattern Counter Registers (YUKON only) */ + + WOL_PATT_CNT_0 = 0x0f38,/* 32 bit WOL Pattern Counter 3..0 */ + WOL_PATT_CNT_4 = 0x0f3c,/* 24 bit WOL Pattern Counter 6..4 */ +}; + +enum { + WOL_PATT_RAM_1 = 0x1000,/* WOL Pattern RAM Link 1 */ + WOL_PATT_RAM_2 = 0x1400,/* WOL Pattern RAM Link 2 */ +}; + +enum { + BASE_XMAC_1 = 0x2000,/* XMAC 1 registers */ + BASE_GMAC_1 = 0x2800,/* GMAC 1 registers */ + BASE_XMAC_2 = 0x3000,/* XMAC 2 registers */ + BASE_GMAC_2 = 0x3800,/* GMAC 2 registers */ +}; + +/* + * Receive Frame Status Encoding + */ +enum { + XMR_FS_LEN = 0x3fff<<18, /* Bit 31..18: Rx Frame Length */ + XMR_FS_2L_VLAN = 1<<17, /* Bit 17: tagged wh 2Lev VLAN ID*/ + XMR_FS_1_VLAN = 1<<16, /* Bit 16: tagged wh 1ev VLAN ID*/ + XMR_FS_BC = 1<<15, /* Bit 15: Broadcast Frame */ + XMR_FS_MC = 1<<14, /* Bit 14: Multicast Frame */ + XMR_FS_UC = 1<<13, /* Bit 13: Unicast Frame */ + + XMR_FS_BURST = 1<<11, /* Bit 11: Burst Mode */ + XMR_FS_CEX_ERR = 1<<10, /* Bit 10: Carrier Ext. Error */ + XMR_FS_802_3 = 1<<9, /* Bit 9: 802.3 Frame */ + XMR_FS_COL_ERR = 1<<8, /* Bit 8: Collision Error */ + XMR_FS_CAR_ERR = 1<<7, /* Bit 7: Carrier Event Error */ + XMR_FS_LEN_ERR = 1<<6, /* Bit 6: In-Range Length Error */ + XMR_FS_FRA_ERR = 1<<5, /* Bit 5: Framing Error */ + XMR_FS_RUNT = 1<<4, /* Bit 4: Runt Frame */ + XMR_FS_LNG_ERR = 1<<3, /* Bit 3: Giant (Jumbo) Frame */ + XMR_FS_FCS_ERR = 1<<2, /* Bit 2: Frame Check Sequ Err */ + XMR_FS_ERR = 1<<1, /* Bit 1: Frame Error */ + XMR_FS_MCTRL = 1<<0, /* Bit 0: MAC Control Packet */ + +/* + * XMR_FS_ERR will be set if + * XMR_FS_FCS_ERR, XMR_FS_LNG_ERR, XMR_FS_RUNT, + * XMR_FS_FRA_ERR, XMR_FS_LEN_ERR, or XMR_FS_CEX_ERR + * is set. XMR_FS_LNG_ERR and XMR_FS_LEN_ERR will issue + * XMR_FS_ERR unless the corresponding bit in the Receive Command + * Register is set. + */ +}; + +/* +,* XMAC-PHY Registers, indirect addressed over the XMAC + */ +enum { + PHY_XMAC_CTRL = 0x00,/* 16 bit r/w PHY Control Register */ + PHY_XMAC_STAT = 0x01,/* 16 bit r/w PHY Status Register */ + PHY_XMAC_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */ + PHY_XMAC_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */ + PHY_XMAC_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */ + PHY_XMAC_AUNE_LP = 0x05,/* 16 bit r/o Link Partner Abi Reg */ + PHY_XMAC_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */ + PHY_XMAC_NEPG = 0x07,/* 16 bit r/w Next Page Register */ + PHY_XMAC_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner */ + + PHY_XMAC_EXT_STAT = 0x0f,/* 16 bit r/o Ext Status Register */ + PHY_XMAC_RES_ABI = 0x10,/* 16 bit r/o PHY Resolved Ability */ +}; +/* + * Broadcom-PHY Registers, indirect addressed over XMAC + */ +enum { + PHY_BCOM_CTRL = 0x00,/* 16 bit r/w PHY Control Register */ + PHY_BCOM_STAT = 0x01,/* 16 bit r/o PHY Status Register */ + PHY_BCOM_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */ + PHY_BCOM_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */ + PHY_BCOM_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */ + PHY_BCOM_AUNE_LP = 0x05,/* 16 bit r/o Link Part Ability Reg */ + PHY_BCOM_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */ + PHY_BCOM_NEPG = 0x07,/* 16 bit r/w Next Page Register */ + PHY_BCOM_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner */ + /* Broadcom-specific registers */ + PHY_BCOM_1000T_CTRL = 0x09,/* 16 bit r/w 1000Base-T Control Reg */ + PHY_BCOM_1000T_STAT = 0x0a,/* 16 bit r/o 1000Base-T Status Reg */ + PHY_BCOM_EXT_STAT = 0x0f,/* 16 bit r/o Extended Status Reg */ + PHY_BCOM_P_EXT_CTRL = 0x10,/* 16 bit r/w PHY Extended Ctrl Reg */ + PHY_BCOM_P_EXT_STAT = 0x11,/* 16 bit r/o PHY Extended Stat Reg */ + PHY_BCOM_RE_CTR = 0x12,/* 16 bit r/w Receive Error Counter */ + PHY_BCOM_FC_CTR = 0x13,/* 16 bit r/w False Carrier Sense Cnt */ + PHY_BCOM_RNO_CTR = 0x14,/* 16 bit r/w Receiver NOT_OK Cnt */ + + PHY_BCOM_AUX_CTRL = 0x18,/* 16 bit r/w Auxiliary Control Reg */ + PHY_BCOM_AUX_STAT = 0x19,/* 16 bit r/o Auxiliary Stat Summary */ + PHY_BCOM_INT_STAT = 0x1a,/* 16 bit r/o Interrupt Status Reg */ + PHY_BCOM_INT_MASK = 0x1b,/* 16 bit r/w Interrupt Mask Reg */ +}; + +/* + * Marvel-PHY Registers, indirect addressed over GMAC + */ +enum { + PHY_MARV_CTRL = 0x00,/* 16 bit r/w PHY Control Register */ + PHY_MARV_STAT = 0x01,/* 16 bit r/o PHY Status Register */ + PHY_MARV_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */ + PHY_MARV_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */ + PHY_MARV_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */ + PHY_MARV_AUNE_LP = 0x05,/* 16 bit r/o Link Part Ability Reg */ + PHY_MARV_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */ + PHY_MARV_NEPG = 0x07,/* 16 bit r/w Next Page Register */ + PHY_MARV_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner */ + /* Marvel-specific registers */ + PHY_MARV_1000T_CTRL = 0x09,/* 16 bit r/w 1000Base-T Control Reg */ + PHY_MARV_1000T_STAT = 0x0a,/* 16 bit r/o 1000Base-T Status Reg */ + PHY_MARV_EXT_STAT = 0x0f,/* 16 bit r/o Extended Status Reg */ + PHY_MARV_PHY_CTRL = 0x10,/* 16 bit r/w PHY Specific Ctrl Reg */ + PHY_MARV_PHY_STAT = 0x11,/* 16 bit r/o PHY Specific Stat Reg */ + PHY_MARV_INT_MASK = 0x12,/* 16 bit r/w Interrupt Mask Reg */ + PHY_MARV_INT_STAT = 0x13,/* 16 bit r/o Interrupt Status Reg */ + PHY_MARV_EXT_CTRL = 0x14,/* 16 bit r/w Ext. PHY Specific Ctrl */ + PHY_MARV_RXE_CNT = 0x15,/* 16 bit r/w Receive Error Counter */ + PHY_MARV_EXT_ADR = 0x16,/* 16 bit r/w Ext. Ad. for Cable Diag. */ + PHY_MARV_PORT_IRQ = 0x17,/* 16 bit r/o Port 0 IRQ (88E1111 only) */ + PHY_MARV_LED_CTRL = 0x18,/* 16 bit r/w LED Control Reg */ + PHY_MARV_LED_OVER = 0x19,/* 16 bit r/w Manual LED Override Reg */ + PHY_MARV_EXT_CTRL_2 = 0x1a,/* 16 bit r/w Ext. PHY Specific Ctrl 2 */ + PHY_MARV_EXT_P_STAT = 0x1b,/* 16 bit r/w Ext. PHY Spec. Stat Reg */ + PHY_MARV_CABLE_DIAG = 0x1c,/* 16 bit r/o Cable Diagnostic Reg */ + PHY_MARV_PAGE_ADDR = 0x1d,/* 16 bit r/w Extended Page Address Reg */ + PHY_MARV_PAGE_DATA = 0x1e,/* 16 bit r/w Extended Page Data Reg */ + +/* for 10/100 Fast Ethernet PHY (88E3082 only) */ + PHY_MARV_FE_LED_PAR = 0x16,/* 16 bit r/w LED Parallel Select Reg. */ + PHY_MARV_FE_LED_SER = 0x17,/* 16 bit r/w LED Stream Select S. LED */ + PHY_MARV_FE_VCT_TX = 0x1a,/* 16 bit r/w VCT Reg. for TXP/N Pins */ + PHY_MARV_FE_VCT_RX = 0x1b,/* 16 bit r/o VCT Reg. for RXP/N Pins */ + PHY_MARV_FE_SPEC_2 = 0x1c,/* 16 bit r/w Specific Control Reg. 2 */ +}; + +/* Level One-PHY Registers, indirect addressed over XMAC */ +enum { + PHY_LONE_CTRL = 0x00,/* 16 bit r/w PHY Control Register */ + PHY_LONE_STAT = 0x01,/* 16 bit r/o PHY Status Register */ + PHY_LONE_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */ + PHY_LONE_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */ + PHY_LONE_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */ + PHY_LONE_AUNE_LP = 0x05,/* 16 bit r/o Link Part Ability Reg */ + PHY_LONE_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */ + PHY_LONE_NEPG = 0x07,/* 16 bit r/w Next Page Register */ + PHY_LONE_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner */ + /* Level One-specific registers */ + PHY_LONE_1000T_CTRL = 0x09,/* 16 bit r/w 1000Base-T Control Reg */ + PHY_LONE_1000T_STAT = 0x0a,/* 16 bit r/o 1000Base-T Status Reg */ + PHY_LONE_EXT_STAT = 0x0f,/* 16 bit r/o Extended Status Reg */ + PHY_LONE_PORT_CFG = 0x10,/* 16 bit r/w Port Configuration Reg*/ + PHY_LONE_Q_STAT = 0x11,/* 16 bit r/o Quick Status Reg */ + PHY_LONE_INT_ENAB = 0x12,/* 16 bit r/w Interrupt Enable Reg */ + PHY_LONE_INT_STAT = 0x13,/* 16 bit r/o Interrupt Status Reg */ + PHY_LONE_LED_CFG = 0x14,/* 16 bit r/w LED Configuration Reg */ + PHY_LONE_PORT_CTRL = 0x15,/* 16 bit r/w Port Control Reg */ + PHY_LONE_CIM = 0x16,/* 16 bit r/o CIM Reg */ +}; + +/* National-PHY Registers, indirect addressed over XMAC */ +enum { + PHY_NAT_CTRL = 0x00,/* 16 bit r/w PHY Control Register */ + PHY_NAT_STAT = 0x01,/* 16 bit r/w PHY Status Register */ + PHY_NAT_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */ + PHY_NAT_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */ + PHY_NAT_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */ + PHY_NAT_AUNE_LP = 0x05,/* 16 bit r/o Link Partner Ability Reg */ + PHY_NAT_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */ + PHY_NAT_NEPG = 0x07,/* 16 bit r/w Next Page Register */ + PHY_NAT_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner Reg */ + /* National-specific registers */ + PHY_NAT_1000T_CTRL = 0x09,/* 16 bit r/w 1000Base-T Control Reg */ + PHY_NAT_1000T_STAT = 0x0a,/* 16 bit r/o 1000Base-T Status Reg */ + PHY_NAT_EXT_STAT = 0x0f,/* 16 bit r/o Extended Status Register */ + PHY_NAT_EXT_CTRL1 = 0x10,/* 16 bit r/o Extended Control Reg1 */ + PHY_NAT_Q_STAT1 = 0x11,/* 16 bit r/o Quick Status Reg1 */ + PHY_NAT_10B_OP = 0x12,/* 16 bit r/o 10Base-T Operations Reg */ + PHY_NAT_EXT_CTRL2 = 0x13,/* 16 bit r/o Extended Control Reg1 */ + PHY_NAT_Q_STAT2 = 0x14,/* 16 bit r/o Quick Status Reg2 */ + + PHY_NAT_PHY_ADDR = 0x19,/* 16 bit r/o PHY Address Register */ +}; + +enum { + PHY_CT_RESET = 1<<15, /* Bit 15: (sc) clear all PHY related regs */ + PHY_CT_LOOP = 1<<14, /* Bit 14: enable Loopback over PHY */ + PHY_CT_SPS_LSB = 1<<13, /* Bit 13: Speed select, lower bit */ + PHY_CT_ANE = 1<<12, /* Bit 12: Auto-Negotiation Enabled */ + PHY_CT_PDOWN = 1<<11, /* Bit 11: Power Down Mode */ + PHY_CT_ISOL = 1<<10, /* Bit 10: Isolate Mode */ + PHY_CT_RE_CFG = 1<<9, /* Bit 9: (sc) Restart Auto-Negotiation */ + PHY_CT_DUP_MD = 1<<8, /* Bit 8: Duplex Mode */ + PHY_CT_COL_TST = 1<<7, /* Bit 7: Collision Test enabled */ + PHY_CT_SPS_MSB = 1<<6, /* Bit 6: Speed select, upper bit */ +}; + +enum { + PHY_CT_SP1000 = PHY_CT_SPS_MSB, /* enable speed of 1000 Mbps */ + PHY_CT_SP100 = PHY_CT_SPS_LSB, /* enable speed of 100 Mbps */ + PHY_CT_SP10 = 0, /* enable speed of 10 Mbps */ +}; + +enum { + PHY_ST_EXT_ST = 1<<8, /* Bit 8: Extended Status Present */ + + PHY_ST_PRE_SUP = 1<<6, /* Bit 6: Preamble Suppression */ + PHY_ST_AN_OVER = 1<<5, /* Bit 5: Auto-Negotiation Over */ + PHY_ST_REM_FLT = 1<<4, /* Bit 4: Remote Fault Condition Occured */ + PHY_ST_AN_CAP = 1<<3, /* Bit 3: Auto-Negotiation Capability */ + PHY_ST_LSYNC = 1<<2, /* Bit 2: Link Synchronized */ + PHY_ST_JAB_DET = 1<<1, /* Bit 1: Jabber Detected */ + PHY_ST_EXT_REG = 1<<0, /* Bit 0: Extended Register available */ +}; + +enum { + PHY_I1_OUI_MSK = 0x3f<<10, /* Bit 15..10: Organization Unique ID */ + PHY_I1_MOD_NUM = 0x3f<<4, /* Bit 9.. 4: Model Number */ + PHY_I1_REV_MSK = 0xf, /* Bit 3.. 0: Revision Number */ +}; + +/* different Broadcom PHY Ids */ +enum { + PHY_BCOM_ID1_A1 = 0x6041, + PHY_BCOM_ID1_B2 = 0x6043, + PHY_BCOM_ID1_C0 = 0x6044, + PHY_BCOM_ID1_C5 = 0x6047, +}; + +/* different Marvell PHY Ids */ +enum { + PHY_MARV_ID0_VAL= 0x0141, /* Marvell Unique Identifier */ + PHY_MARV_ID1_B0 = 0x0C23, /* Yukon (PHY 88E1011) */ + PHY_MARV_ID1_B2 = 0x0C25, /* Yukon-Plus (PHY 88E1011) */ + PHY_MARV_ID1_C2 = 0x0CC2, /* Yukon-EC (PHY 88E1111) */ + PHY_MARV_ID1_Y2 = 0x0C91, /* Yukon-2 (PHY 88E1112) */ +}; + +enum { + PHY_AN_NXT_PG = 1<<15, /* Bit 15: Request Next Page */ + PHY_X_AN_ACK = 1<<14, /* Bit 14: (ro) Acknowledge Received */ + PHY_X_AN_RFB = 3<<12,/* Bit 13..12: Remote Fault Bits */ + + PHY_X_AN_PAUSE = 3<<7,/* Bit 8.. 7: Pause Bits */ + PHY_X_AN_HD = 1<<6, /* Bit 6: Half Duplex */ + PHY_X_AN_FD = 1<<5, /* Bit 5: Full Duplex */ +}; + +enum { + PHY_B_AN_RF = 1<<13, /* Bit 13: Remote Fault */ + + PHY_B_AN_ASP = 1<<11, /* Bit 11: Asymmetric Pause */ + PHY_B_AN_PC = 1<<10, /* Bit 10: Pause Capable */ + PHY_B_AN_SEL = 0x1f, /* Bit 4..0: Selector Field, 00001=Ethernet*/ +}; + +enum { + PHY_L_AN_RF = 1<<13, /* Bit 13: Remote Fault */ + /* Bit 12: reserved */ + PHY_L_AN_ASP = 1<<11, /* Bit 11: Asymmetric Pause */ + PHY_L_AN_PC = 1<<10, /* Bit 10: Pause Capable */ + + PHY_L_AN_SEL = 0x1f, /* Bit 4..0: Selector Field, 00001=Ethernet*/ +}; + +/* PHY_NAT_AUNE_ADV 16 bit r/w Auto-Negotiation Advertisement */ +/* PHY_NAT_AUNE_LP 16 bit r/o Link Partner Ability Reg *****/ +/* PHY_AN_NXT_PG (see XMAC) Bit 15: Request Next Page */ +enum { + PHY_N_AN_RF = 1<<13, /* Bit 13: Remote Fault */ + + PHY_N_AN_100F = 1<<11, /* Bit 11: 100Base-T2 FD Support */ + PHY_N_AN_100H = 1<<10, /* Bit 10: 100Base-T2 HD Support */ + + PHY_N_AN_SEL = 0x1f, /* Bit 4..0: Selector Field, 00001=Ethernet*/ +}; + +/* field type definition for PHY_x_AN_SEL */ +enum { + PHY_SEL_TYPE = 1, /* 00001 = Ethernet */ +}; + +enum { + PHY_ANE_LP_NP = 1<<3, /* Bit 3: Link Partner can Next Page */ + PHY_ANE_LOC_NP = 1<<2, /* Bit 2: Local PHY can Next Page */ + PHY_ANE_RX_PG = 1<<1, /* Bit 1: Page Received */ +}; + +enum { + PHY_ANE_PAR_DF = 1<<4, /* Bit 4: Parallel Detection Fault */ + + PHY_ANE_LP_CAP = 1<<0, /* Bit 0: Link Partner Auto-Neg. Cap. */ +}; + +enum { + PHY_NP_MORE = 1<<15, /* Bit 15: More, Next Pages to follow */ + PHY_NP_ACK1 = 1<<14, /* Bit 14: (ro) Ack1, for receiving a message */ + PHY_NP_MSG_VAL = 1<<13, /* Bit 13: Message Page valid */ + PHY_NP_ACK2 = 1<<12, /* Bit 12: Ack2, comply with msg content */ + PHY_NP_TOG = 1<<11, /* Bit 11: Toggle Bit, ensure sync */ + PHY_NP_MSG = 0x07ff, /* Bit 10..0: Message from/to Link Partner */ +}; + +enum { + PHY_X_EX_FD = 1<<15, /* Bit 15: Device Supports Full Duplex */ + PHY_X_EX_HD = 1<<14, /* Bit 14: Device Supports Half Duplex */ +}; + +enum { + PHY_X_RS_PAUSE = 3<<7,/* Bit 8..7: selected Pause Mode */ + PHY_X_RS_HD = 1<<6, /* Bit 6: Half Duplex Mode selected */ + PHY_X_RS_FD = 1<<5, /* Bit 5: Full Duplex Mode selected */ + PHY_X_RS_ABLMIS = 1<<4, /* Bit 4: duplex or pause cap mismatch */ + PHY_X_RS_PAUMIS = 1<<3, /* Bit 3: pause capability mismatch */ +}; + +/** Remote Fault Bits (PHY_X_AN_RFB) encoding */ +enum { + X_RFB_OK = 0<<12,/* Bit 13..12 No errors, Link OK */ + X_RFB_LF = 1<<12, /* Bit 13..12 Link Failure */ + X_RFB_OFF = 2<<12,/* Bit 13..12 Offline */ + X_RFB_AN_ERR = 3<<12,/* Bit 13..12 Auto-Negotiation Error */ +}; + +/* Pause Bits (PHY_X_AN_PAUSE and PHY_X_RS_PAUSE) encoding */ +enum { + PHY_X_P_NO_PAUSE = 0<<7,/* Bit 8..7: no Pause Mode */ + PHY_X_P_SYM_MD = 1<<7, /* Bit 8..7: symmetric Pause Mode */ + PHY_X_P_ASYM_MD = 2<<7,/* Bit 8..7: asymmetric Pause Mode */ + PHY_X_P_BOTH_MD = 3<<7,/* Bit 8..7: both Pause Mode */ +}; + + +/* Broadcom-Specific */ +/***** PHY_BCOM_1000T_CTRL 16 bit r/w 1000Base-T Control Reg *****/ +enum { + PHY_B_1000C_TEST = 7<<13,/* Bit 15..13: Test Modes */ + PHY_B_1000C_MSE = 1<<12, /* Bit 12: Master/Slave Enable */ + PHY_B_1000C_MSC = 1<<11, /* Bit 11: M/S Configuration */ + PHY_B_1000C_RD = 1<<10, /* Bit 10: Repeater/DTE */ + PHY_B_1000C_AFD = 1<<9, /* Bit 9: Advertise Full Duplex */ + PHY_B_1000C_AHD = 1<<8, /* Bit 8: Advertise Half Duplex */ +}; + +/***** PHY_BCOM_1000T_STAT 16 bit r/o 1000Base-T Status Reg *****/ +/***** PHY_MARV_1000T_STAT 16 bit r/o 1000Base-T Status Reg *****/ +enum { + PHY_B_1000S_MSF = 1<<15, /* Bit 15: Master/Slave Fault */ + PHY_B_1000S_MSR = 1<<14, /* Bit 14: Master/Slave Result */ + PHY_B_1000S_LRS = 1<<13, /* Bit 13: Local Receiver Status */ + PHY_B_1000S_RRS = 1<<12, /* Bit 12: Remote Receiver Status */ + PHY_B_1000S_LP_FD = 1<<11, /* Bit 11: Link Partner can FD */ + PHY_B_1000S_LP_HD = 1<<10, /* Bit 10: Link Partner can HD */ + /* Bit 9..8: reserved */ + PHY_B_1000S_IEC = 0xff, /* Bit 7..0: Idle Error Count */ +}; + +/***** PHY_BCOM_EXT_STAT 16 bit r/o Extended Status Register *****/ +enum { + PHY_B_ES_X_FD_CAP = 1<<15, /* Bit 15: 1000Base-X FD capable */ + PHY_B_ES_X_HD_CAP = 1<<14, /* Bit 14: 1000Base-X HD capable */ + PHY_B_ES_T_FD_CAP = 1<<13, /* Bit 13: 1000Base-T FD capable */ + PHY_B_ES_T_HD_CAP = 1<<12, /* Bit 12: 1000Base-T HD capable */ +}; + +/***** PHY_BCOM_P_EXT_CTRL 16 bit r/w PHY Extended Control Reg *****/ +enum { + PHY_B_PEC_MAC_PHY = 1<<15, /* Bit 15: 10BIT/GMI-Interface */ + PHY_B_PEC_DIS_CROSS = 1<<14, /* Bit 14: Disable MDI Crossover */ + PHY_B_PEC_TX_DIS = 1<<13, /* Bit 13: Tx output Disabled */ + PHY_B_PEC_INT_DIS = 1<<12, /* Bit 12: Interrupts Disabled */ + PHY_B_PEC_F_INT = 1<<11, /* Bit 11: Force Interrupt */ + PHY_B_PEC_BY_45 = 1<<10, /* Bit 10: Bypass 4B5B-Decoder */ + PHY_B_PEC_BY_SCR = 1<<9, /* Bit 9: Bypass Scrambler */ + PHY_B_PEC_BY_MLT3 = 1<<8, /* Bit 8: Bypass MLT3 Encoder */ + PHY_B_PEC_BY_RXA = 1<<7, /* Bit 7: Bypass Rx Alignm. */ + PHY_B_PEC_RES_SCR = 1<<6, /* Bit 6: Reset Scrambler */ + PHY_B_PEC_EN_LTR = 1<<5, /* Bit 5: Ena LED Traffic Mode */ + PHY_B_PEC_LED_ON = 1<<4, /* Bit 4: Force LED's on */ + PHY_B_PEC_LED_OFF = 1<<3, /* Bit 3: Force LED's off */ + PHY_B_PEC_EX_IPG = 1<<2, /* Bit 2: Extend Tx IPG Mode */ + PHY_B_PEC_3_LED = 1<<1, /* Bit 1: Three Link LED mode */ + PHY_B_PEC_HIGH_LA = 1<<0, /* Bit 0: GMII FIFO Elasticy */ +}; + +/***** PHY_BCOM_P_EXT_STAT 16 bit r/o PHY Extended Status Reg *****/ +enum { + PHY_B_PES_CROSS_STAT = 1<<13, /* Bit 13: MDI Crossover Status */ + PHY_B_PES_INT_STAT = 1<<12, /* Bit 12: Interrupt Status */ + PHY_B_PES_RRS = 1<<11, /* Bit 11: Remote Receiver Stat. */ + PHY_B_PES_LRS = 1<<10, /* Bit 10: Local Receiver Stat. */ + PHY_B_PES_LOCKED = 1<<9, /* Bit 9: Locked */ + PHY_B_PES_LS = 1<<8, /* Bit 8: Link Status */ + PHY_B_PES_RF = 1<<7, /* Bit 7: Remote Fault */ + PHY_B_PES_CE_ER = 1<<6, /* Bit 6: Carrier Ext Error */ + PHY_B_PES_BAD_SSD = 1<<5, /* Bit 5: Bad SSD */ + PHY_B_PES_BAD_ESD = 1<<4, /* Bit 4: Bad ESD */ + PHY_B_PES_RX_ER = 1<<3, /* Bit 3: Receive Error */ + PHY_B_PES_TX_ER = 1<<2, /* Bit 2: Transmit Error */ + PHY_B_PES_LOCK_ER = 1<<1, /* Bit 1: Lock Error */ + PHY_B_PES_MLT3_ER = 1<<0, /* Bit 0: MLT3 code Error */ +}; + +/***** PHY_BCOM_FC_CTR 16 bit r/w False Carrier Counter *****/ +enum { + PHY_B_FC_CTR = 0xff, /* Bit 7..0: False Carrier Counter */ + +/***** PHY_BCOM_RNO_CTR 16 bit r/w Receive NOT_OK Counter *****/ + PHY_B_RC_LOC_MSK = 0xff00, /* Bit 15..8: Local Rx NOT_OK cnt */ + PHY_B_RC_REM_MSK = 0x00ff, /* Bit 7..0: Remote Rx NOT_OK cnt */ + +/***** PHY_BCOM_AUX_CTRL 16 bit r/w Auxiliary Control Reg *****/ + PHY_B_AC_L_SQE = 1<<15, /* Bit 15: Low Squelch */ + PHY_B_AC_LONG_PACK = 1<<14, /* Bit 14: Rx Long Packets */ + PHY_B_AC_ER_CTRL = 3<<12,/* Bit 13..12: Edgerate Control */ + /* Bit 11: reserved */ + PHY_B_AC_TX_TST = 1<<10, /* Bit 10: Tx test bit, always 1 */ + /* Bit 9.. 8: reserved */ + PHY_B_AC_DIS_PRF = 1<<7, /* Bit 7: dis part resp filter */ + /* Bit 6: reserved */ + PHY_B_AC_DIS_PM = 1<<5, /* Bit 5: dis power management */ + /* Bit 4: reserved */ + PHY_B_AC_DIAG = 1<<3, /* Bit 3: Diagnostic Mode */ +}; + +/***** PHY_BCOM_AUX_STAT 16 bit r/o Auxiliary Status Reg *****/ +enum { + PHY_B_AS_AN_C = 1<<15, /* Bit 15: AutoNeg complete */ + PHY_B_AS_AN_CA = 1<<14, /* Bit 14: AN Complete Ack */ + PHY_B_AS_ANACK_D = 1<<13, /* Bit 13: AN Ack Detect */ + PHY_B_AS_ANAB_D = 1<<12, /* Bit 12: AN Ability Detect */ + PHY_B_AS_NPW = 1<<11, /* Bit 11: AN Next Page Wait */ + PHY_B_AS_AN_RES_MSK = 7<<8,/* Bit 10..8: AN HDC */ + PHY_B_AS_PDF = 1<<7, /* Bit 7: Parallel Detect. Fault */ + PHY_B_AS_RF = 1<<6, /* Bit 6: Remote Fault */ + PHY_B_AS_ANP_R = 1<<5, /* Bit 5: AN Page Received */ + PHY_B_AS_LP_ANAB = 1<<4, /* Bit 4: LP AN Ability */ + PHY_B_AS_LP_NPAB = 1<<3, /* Bit 3: LP Next Page Ability */ + PHY_B_AS_LS = 1<<2, /* Bit 2: Link Status */ + PHY_B_AS_PRR = 1<<1, /* Bit 1: Pause Resolution-Rx */ + PHY_B_AS_PRT = 1<<0, /* Bit 0: Pause Resolution-Tx */ +}; +#define PHY_B_AS_PAUSE_MSK (PHY_B_AS_PRR | PHY_B_AS_PRT) + +/***** PHY_BCOM_INT_STAT 16 bit r/o Interrupt Status Reg *****/ +/***** PHY_BCOM_INT_MASK 16 bit r/w Interrupt Mask Reg *****/ +enum { + PHY_B_IS_PSE = 1<<14, /* Bit 14: Pair Swap Error */ + PHY_B_IS_MDXI_SC = 1<<13, /* Bit 13: MDIX Status Change */ + PHY_B_IS_HCT = 1<<12, /* Bit 12: counter above 32k */ + PHY_B_IS_LCT = 1<<11, /* Bit 11: counter above 128 */ + PHY_B_IS_AN_PR = 1<<10, /* Bit 10: Page Received */ + PHY_B_IS_NO_HDCL = 1<<9, /* Bit 9: No HCD Link */ + PHY_B_IS_NO_HDC = 1<<8, /* Bit 8: No HCD */ + PHY_B_IS_NEG_USHDC = 1<<7, /* Bit 7: Negotiated Unsup. HCD */ + PHY_B_IS_SCR_S_ER = 1<<6, /* Bit 6: Scrambler Sync Error */ + PHY_B_IS_RRS_CHANGE = 1<<5, /* Bit 5: Remote Rx Stat Change */ + PHY_B_IS_LRS_CHANGE = 1<<4, /* Bit 4: Local Rx Stat Change */ + PHY_B_IS_DUP_CHANGE = 1<<3, /* Bit 3: Duplex Mode Change */ + PHY_B_IS_LSP_CHANGE = 1<<2, /* Bit 2: Link Speed Change */ + PHY_B_IS_LST_CHANGE = 1<<1, /* Bit 1: Link Status Changed */ + PHY_B_IS_CRC_ER = 1<<0, /* Bit 0: CRC Error */ +}; +#define PHY_B_DEF_MSK (~(PHY_B_IS_AN_PR | PHY_B_IS_LST_CHANGE)) + +/* Pause Bits (PHY_B_AN_ASP and PHY_B_AN_PC) encoding */ +enum { + PHY_B_P_NO_PAUSE = 0<<10,/* Bit 11..10: no Pause Mode */ + PHY_B_P_SYM_MD = 1<<10, /* Bit 11..10: symmetric Pause Mode */ + PHY_B_P_ASYM_MD = 2<<10,/* Bit 11..10: asymmetric Pause Mode */ + PHY_B_P_BOTH_MD = 3<<10,/* Bit 11..10: both Pause Mode */ +}; +/* + * Resolved Duplex mode and Capabilities (Aux Status Summary Reg) + */ +enum { + PHY_B_RES_1000FD = 7<<8,/* Bit 10..8: 1000Base-T Full Dup. */ + PHY_B_RES_1000HD = 6<<8,/* Bit 10..8: 1000Base-T Half Dup. */ +}; + +/* + * Level One-Specific + */ +/***** PHY_LONE_1000T_CTRL 16 bit r/w 1000Base-T Control Reg *****/ +enum { + PHY_L_1000C_TEST = 7<<13,/* Bit 15..13: Test Modes */ + PHY_L_1000C_MSE = 1<<12, /* Bit 12: Master/Slave Enable */ + PHY_L_1000C_MSC = 1<<11, /* Bit 11: M/S Configuration */ + PHY_L_1000C_RD = 1<<10, /* Bit 10: Repeater/DTE */ + PHY_L_1000C_AFD = 1<<9, /* Bit 9: Advertise Full Duplex */ + PHY_L_1000C_AHD = 1<<8, /* Bit 8: Advertise Half Duplex */ +}; + +/***** PHY_LONE_1000T_STAT 16 bit r/o 1000Base-T Status Reg *****/ +enum { + PHY_L_1000S_MSF = 1<<15, /* Bit 15: Master/Slave Fault */ + PHY_L_1000S_MSR = 1<<14, /* Bit 14: Master/Slave Result */ + PHY_L_1000S_LRS = 1<<13, /* Bit 13: Local Receiver Status */ + PHY_L_1000S_RRS = 1<<12, /* Bit 12: Remote Receiver Status */ + PHY_L_1000S_LP_FD = 1<<11, /* Bit 11: Link Partner can FD */ + PHY_L_1000S_LP_HD = 1<<10, /* Bit 10: Link Partner can HD */ + + PHY_L_1000S_IEC = 0xff, /* Bit 7..0: Idle Error Count */ + +/***** PHY_LONE_EXT_STAT 16 bit r/o Extended Status Register *****/ + PHY_L_ES_X_FD_CAP = 1<<15, /* Bit 15: 1000Base-X FD capable */ + PHY_L_ES_X_HD_CAP = 1<<14, /* Bit 14: 1000Base-X HD capable */ + PHY_L_ES_T_FD_CAP = 1<<13, /* Bit 13: 1000Base-T FD capable */ + PHY_L_ES_T_HD_CAP = 1<<12, /* Bit 12: 1000Base-T HD capable */ +}; + +/***** PHY_LONE_PORT_CFG 16 bit r/w Port Configuration Reg *****/ +enum { + PHY_L_PC_REP_MODE = 1<<15, /* Bit 15: Repeater Mode */ + + PHY_L_PC_TX_DIS = 1<<13, /* Bit 13: Tx output Disabled */ + PHY_L_PC_BY_SCR = 1<<12, /* Bit 12: Bypass Scrambler */ + PHY_L_PC_BY_45 = 1<<11, /* Bit 11: Bypass 4B5B-Decoder */ + PHY_L_PC_JAB_DIS = 1<<10, /* Bit 10: Jabber Disabled */ + PHY_L_PC_SQE = 1<<9, /* Bit 9: Enable Heartbeat */ + PHY_L_PC_TP_LOOP = 1<<8, /* Bit 8: TP Loopback */ + PHY_L_PC_SSS = 1<<7, /* Bit 7: Smart Speed Selection */ + PHY_L_PC_FIFO_SIZE = 1<<6, /* Bit 6: FIFO Size */ + PHY_L_PC_PRE_EN = 1<<5, /* Bit 5: Preamble Enable */ + PHY_L_PC_CIM = 1<<4, /* Bit 4: Carrier Integrity Mon */ + PHY_L_PC_10_SER = 1<<3, /* Bit 3: Use Serial Output */ + PHY_L_PC_ANISOL = 1<<2, /* Bit 2: Unisolate Port */ + PHY_L_PC_TEN_BIT = 1<<1, /* Bit 1: 10bit iface mode on */ + PHY_L_PC_ALTCLOCK = 1<<0, /* Bit 0: (ro) ALTCLOCK Mode on */ +}; + +/***** PHY_LONE_Q_STAT 16 bit r/o Quick Status Reg *****/ +enum { + PHY_L_QS_D_RATE = 3<<14,/* Bit 15..14: Data Rate */ + PHY_L_QS_TX_STAT = 1<<13, /* Bit 13: Transmitting */ + PHY_L_QS_RX_STAT = 1<<12, /* Bit 12: Receiving */ + PHY_L_QS_COL_STAT = 1<<11, /* Bit 11: Collision */ + PHY_L_QS_L_STAT = 1<<10, /* Bit 10: Link is up */ + PHY_L_QS_DUP_MOD = 1<<9, /* Bit 9: Full/Half Duplex */ + PHY_L_QS_AN = 1<<8, /* Bit 8: AutoNeg is On */ + PHY_L_QS_AN_C = 1<<7, /* Bit 7: AN is Complete */ + PHY_L_QS_LLE = 7<<4,/* Bit 6..4: Line Length Estim. */ + PHY_L_QS_PAUSE = 1<<3, /* Bit 3: LP advertised Pause */ + PHY_L_QS_AS_PAUSE = 1<<2, /* Bit 2: LP adv. asym. Pause */ + PHY_L_QS_ISOLATE = 1<<1, /* Bit 1: CIM Isolated */ + PHY_L_QS_EVENT = 1<<0, /* Bit 0: Event has occurred */ +}; + +/***** PHY_LONE_INT_ENAB 16 bit r/w Interrupt Enable Reg *****/ +/***** PHY_LONE_INT_STAT 16 bit r/o Interrupt Status Reg *****/ +enum { + PHY_L_IS_AN_F = 1<<13, /* Bit 13: Auto-Negotiation fault */ + PHY_L_IS_CROSS = 1<<11, /* Bit 11: Crossover used */ + PHY_L_IS_POL = 1<<10, /* Bit 10: Polarity correct. used */ + PHY_L_IS_SS = 1<<9, /* Bit 9: Smart Speed Downgrade */ + PHY_L_IS_CFULL = 1<<8, /* Bit 8: Counter Full */ + PHY_L_IS_AN_C = 1<<7, /* Bit 7: AutoNeg Complete */ + PHY_L_IS_SPEED = 1<<6, /* Bit 6: Speed Changed */ + PHY_L_IS_DUP = 1<<5, /* Bit 5: Duplex Changed */ + PHY_L_IS_LS = 1<<4, /* Bit 4: Link Status Changed */ + PHY_L_IS_ISOL = 1<<3, /* Bit 3: Isolate Occured */ + PHY_L_IS_MDINT = 1<<2, /* Bit 2: (ro) STAT: MII Int Pending */ + PHY_L_IS_INTEN = 1<<1, /* Bit 1: ENAB: Enable IRQs */ + PHY_L_IS_FORCE = 1<<0, /* Bit 0: ENAB: Force Interrupt */ +}; + +/* int. mask */ +#define PHY_L_DEF_MSK (PHY_L_IS_LS | PHY_L_IS_ISOL | PHY_L_IS_INTEN) + +/***** PHY_LONE_LED_CFG 16 bit r/w LED Configuration Reg *****/ +enum { + PHY_L_LC_LEDC = 3<<14,/* Bit 15..14: Col/Blink/On/Off */ + PHY_L_LC_LEDR = 3<<12,/* Bit 13..12: Rx/Blink/On/Off */ + PHY_L_LC_LEDT = 3<<10,/* Bit 11..10: Tx/Blink/On/Off */ + PHY_L_LC_LEDG = 3<<8,/* Bit 9..8: Giga/Blink/On/Off */ + PHY_L_LC_LEDS = 3<<6,/* Bit 7..6: 10-100/Blink/On/Off */ + PHY_L_LC_LEDL = 3<<4,/* Bit 5..4: Link/Blink/On/Off */ + PHY_L_LC_LEDF = 3<<2,/* Bit 3..2: Duplex/Blink/On/Off */ + PHY_L_LC_PSTRECH= 1<<1, /* Bit 1: Strech LED Pulses */ + PHY_L_LC_FREQ = 1<<0, /* Bit 0: 30/100 ms */ +}; + +/***** PHY_LONE_PORT_CTRL 16 bit r/w Port Control Reg *****/ +enum { + PHY_L_PC_TX_TCLK = 1<<15, /* Bit 15: Enable TX_TCLK */ + PHY_L_PC_ALT_NP = 1<<13, /* Bit 14: Alternate Next Page */ + PHY_L_PC_GMII_ALT= 1<<12, /* Bit 13: Alternate GMII driver */ + PHY_L_PC_TEN_CRS = 1<<10, /* Bit 10: Extend CRS*/ +}; + +/***** PHY_LONE_CIM 16 bit r/o CIM Reg *****/ +enum { + PHY_L_CIM_ISOL = 0xff<<8,/* Bit 15..8: Isolate Count */ + PHY_L_CIM_FALSE_CAR = 0xff, /* Bit 7..0: False Carrier Count */ +}; + +/* + * Pause Bits (PHY_L_AN_ASP and PHY_L_AN_PC) encoding + */ +enum { + PHY_L_P_NO_PAUSE= 0<<10,/* Bit 11..10: no Pause Mode */ + PHY_L_P_SYM_MD = 1<<10, /* Bit 11..10: symmetric Pause Mode */ + PHY_L_P_ASYM_MD = 2<<10,/* Bit 11..10: asymmetric Pause Mode */ + PHY_L_P_BOTH_MD = 3<<10,/* Bit 11..10: both Pause Mode */ +}; + +/* + * National-Specific + */ +/***** PHY_NAT_1000T_CTRL 16 bit r/w 1000Base-T Control Reg *****/ +enum { + PHY_N_1000C_TEST= 7<<13,/* Bit 15..13: Test Modes */ + PHY_N_1000C_MSE = 1<<12, /* Bit 12: Master/Slave Enable */ + PHY_N_1000C_MSC = 1<<11, /* Bit 11: M/S Configuration */ + PHY_N_1000C_RD = 1<<10, /* Bit 10: Repeater/DTE */ + PHY_N_1000C_AFD = 1<<9, /* Bit 9: Advertise Full Duplex */ + PHY_N_1000C_AHD = 1<<8, /* Bit 8: Advertise Half Duplex */ + PHY_N_1000C_APC = 1<<7, /* Bit 7: Asymmetric Pause Cap. */}; + + +/***** PHY_NAT_1000T_STAT 16 bit r/o 1000Base-T Status Reg *****/ +enum { + PHY_N_1000S_MSF = 1<<15, /* Bit 15: Master/Slave Fault */ + PHY_N_1000S_MSR = 1<<14, /* Bit 14: Master/Slave Result */ + PHY_N_1000S_LRS = 1<<13, /* Bit 13: Local Receiver Status */ + PHY_N_1000S_RRS = 1<<12, /* Bit 12: Remote Receiver Status*/ + PHY_N_1000S_LP_FD= 1<<11, /* Bit 11: Link Partner can FD */ + PHY_N_1000S_LP_HD= 1<<10, /* Bit 10: Link Partner can HD */ + PHY_N_1000C_LP_APC= 1<<9, /* Bit 9: LP Asym. Pause Cap. */ + PHY_N_1000S_IEC = 0xff, /* Bit 7..0: Idle Error Count */ +}; + +/***** PHY_NAT_EXT_STAT 16 bit r/o Extended Status Register *****/ +enum { + PHY_N_ES_X_FD_CAP= 1<<15, /* Bit 15: 1000Base-X FD capable */ + PHY_N_ES_X_HD_CAP= 1<<14, /* Bit 14: 1000Base-X HD capable */ + PHY_N_ES_T_FD_CAP= 1<<13, /* Bit 13: 1000Base-T FD capable */ + PHY_N_ES_T_HD_CAP= 1<<12, /* Bit 12: 1000Base-T HD capable */ +}; + +/** Marvell-Specific */ +enum { + PHY_M_AN_NXT_PG = 1<<15, /* Request Next Page */ + PHY_M_AN_ACK = 1<<14, /* (ro) Acknowledge Received */ + PHY_M_AN_RF = 1<<13, /* Remote Fault */ + + PHY_M_AN_ASP = 1<<11, /* Asymmetric Pause */ + PHY_M_AN_PC = 1<<10, /* MAC Pause implemented */ + PHY_M_AN_100_T4 = 1<<9, /* Not cap. 100Base-T4 (always 0) */ + PHY_M_AN_100_FD = 1<<8, /* Advertise 100Base-TX Full Duplex */ + PHY_M_AN_100_HD = 1<<7, /* Advertise 100Base-TX Half Duplex */ + PHY_M_AN_10_FD = 1<<6, /* Advertise 10Base-TX Full Duplex */ + PHY_M_AN_10_HD = 1<<5, /* Advertise 10Base-TX Half Duplex */ + PHY_M_AN_SEL_MSK =0x1f<<4, /* Bit 4.. 0: Selector Field Mask */ +}; + +/* special defines for FIBER (88E1011S only) */ +enum { + PHY_M_AN_ASP_X = 1<<8, /* Asymmetric Pause */ + PHY_M_AN_PC_X = 1<<7, /* MAC Pause implemented */ + PHY_M_AN_1000X_AHD = 1<<6, /* Advertise 10000Base-X Half Duplex */ + PHY_M_AN_1000X_AFD = 1<<5, /* Advertise 10000Base-X Full Duplex */ +}; + +/* Pause Bits (PHY_M_AN_ASP_X and PHY_M_AN_PC_X) encoding */ +enum { + PHY_M_P_NO_PAUSE_X = 0<<7,/* Bit 8.. 7: no Pause Mode */ + PHY_M_P_SYM_MD_X = 1<<7, /* Bit 8.. 7: symmetric Pause Mode */ + PHY_M_P_ASYM_MD_X = 2<<7,/* Bit 8.. 7: asymmetric Pause Mode */ + PHY_M_P_BOTH_MD_X = 3<<7,/* Bit 8.. 7: both Pause Mode */ +}; + +/***** PHY_MARV_1000T_CTRL 16 bit r/w 1000Base-T Control Reg *****/ +enum { + PHY_M_1000C_TEST = 7<<13,/* Bit 15..13: Test Modes */ + PHY_M_1000C_MSE = 1<<12, /* Manual Master/Slave Enable */ + PHY_M_1000C_MSC = 1<<11, /* M/S Configuration (1=Master) */ + PHY_M_1000C_MPD = 1<<10, /* Multi-Port Device */ + PHY_M_1000C_AFD = 1<<9, /* Advertise Full Duplex */ + PHY_M_1000C_AHD = 1<<8, /* Advertise Half Duplex */ +}; + +/***** PHY_MARV_PHY_CTRL 16 bit r/w PHY Specific Ctrl Reg *****/ +enum { + PHY_M_PC_TX_FFD_MSK = 3<<14,/* Bit 15..14: Tx FIFO Depth Mask */ + PHY_M_PC_RX_FFD_MSK = 3<<12,/* Bit 13..12: Rx FIFO Depth Mask */ + PHY_M_PC_ASS_CRS_TX = 1<<11, /* Assert CRS on Transmit */ + PHY_M_PC_FL_GOOD = 1<<10, /* Force Link Good */ + PHY_M_PC_EN_DET_MSK = 3<<8,/* Bit 9.. 8: Energy Detect Mask */ + PHY_M_PC_ENA_EXT_D = 1<<7, /* Enable Ext. Distance (10BT) */ + PHY_M_PC_MDIX_MSK = 3<<5,/* Bit 6.. 5: MDI/MDIX Config. Mask */ + PHY_M_PC_DIS_125CLK = 1<<4, /* Disable 125 CLK */ + PHY_M_PC_MAC_POW_UP = 1<<3, /* MAC Power up */ + PHY_M_PC_SQE_T_ENA = 1<<2, /* SQE Test Enabled */ + PHY_M_PC_POL_R_DIS = 1<<1, /* Polarity Reversal Disabled */ + PHY_M_PC_DIS_JABBER = 1<<0, /* Disable Jabber */ +}; + +enum { + PHY_M_PC_EN_DET = 2<<8, /* Energy Detect (Mode 1) */ + PHY_M_PC_EN_DET_PLUS = 3<<8, /* Energy Detect Plus (Mode 2) */ +}; + +#define PHY_M_PC_MDI_XMODE(x) (((x)<<5) & PHY_M_PC_MDIX_MSK) + +enum { + PHY_M_PC_MAN_MDI = 0, /* 00 = Manual MDI configuration */ + PHY_M_PC_MAN_MDIX = 1, /* 01 = Manual MDIX configuration */ + PHY_M_PC_ENA_AUTO = 3, /* 11 = Enable Automatic Crossover */ +}; + +/* for 10/100 Fast Ethernet PHY (88E3082 only) */ +enum { + PHY_M_PC_ENA_DTE_DT = 1<<15, /* Enable Data Terminal Equ. (DTE) Detect */ + PHY_M_PC_ENA_ENE_DT = 1<<14, /* Enable Energy Detect (sense & pulse) */ + PHY_M_PC_DIS_NLP_CK = 1<<13, /* Disable Normal Link Puls (NLP) Check */ + PHY_M_PC_ENA_LIP_NP = 1<<12, /* Enable Link Partner Next Page Reg. */ + PHY_M_PC_DIS_NLP_GN = 1<<11, /* Disable Normal Link Puls Generation */ + + PHY_M_PC_DIS_SCRAMB = 1<<9, /* Disable Scrambler */ + PHY_M_PC_DIS_FEFI = 1<<8, /* Disable Far End Fault Indic. (FEFI) */ + + PHY_M_PC_SH_TP_SEL = 1<<6, /* Shielded Twisted Pair Select */ + PHY_M_PC_RX_FD_MSK = 3<<2,/* Bit 3.. 2: Rx FIFO Depth Mask */ +}; + +/***** PHY_MARV_PHY_STAT 16 bit r/o PHY Specific Status Reg *****/ +enum { + PHY_M_PS_SPEED_MSK = 3<<14, /* Bit 15..14: Speed Mask */ + PHY_M_PS_SPEED_1000 = 1<<15, /* 10 = 1000 Mbps */ + PHY_M_PS_SPEED_100 = 1<<14, /* 01 = 100 Mbps */ + PHY_M_PS_SPEED_10 = 0, /* 00 = 10 Mbps */ + PHY_M_PS_FULL_DUP = 1<<13, /* Full Duplex */ + PHY_M_PS_PAGE_REC = 1<<12, /* Page Received */ + PHY_M_PS_SPDUP_RES = 1<<11, /* Speed & Duplex Resolved */ + PHY_M_PS_LINK_UP = 1<<10, /* Link Up */ + PHY_M_PS_CABLE_MSK = 7<<7, /* Bit 9.. 7: Cable Length Mask */ + PHY_M_PS_MDI_X_STAT = 1<<6, /* MDI Crossover Stat (1=MDIX) */ + PHY_M_PS_DOWNS_STAT = 1<<5, /* Downshift Status (1=downsh.) */ + PHY_M_PS_ENDET_STAT = 1<<4, /* Energy Detect Status (1=act) */ + PHY_M_PS_TX_P_EN = 1<<3, /* Tx Pause Enabled */ + PHY_M_PS_RX_P_EN = 1<<2, /* Rx Pause Enabled */ + PHY_M_PS_POL_REV = 1<<1, /* Polarity Reversed */ + PHY_M_PS_JABBER = 1<<0, /* Jabber */ +}; + +#define PHY_M_PS_PAUSE_MSK (PHY_M_PS_TX_P_EN | PHY_M_PS_RX_P_EN) + +/* for 10/100 Fast Ethernet PHY (88E3082 only) */ +enum { + PHY_M_PS_DTE_DETECT = 1<<15, /* Data Terminal Equipment (DTE) Detected */ + PHY_M_PS_RES_SPEED = 1<<14, /* Resolved Speed (1=100 Mbps, 0=10 Mbps */ +}; + +enum { + PHY_M_IS_AN_ERROR = 1<<15, /* Auto-Negotiation Error */ + PHY_M_IS_LSP_CHANGE = 1<<14, /* Link Speed Changed */ + PHY_M_IS_DUP_CHANGE = 1<<13, /* Duplex Mode Changed */ + PHY_M_IS_AN_PR = 1<<12, /* Page Received */ + PHY_M_IS_AN_COMPL = 1<<11, /* Auto-Negotiation Completed */ + PHY_M_IS_LST_CHANGE = 1<<10, /* Link Status Changed */ + PHY_M_IS_SYMB_ERROR = 1<<9, /* Symbol Error */ + PHY_M_IS_FALSE_CARR = 1<<8, /* False Carrier */ + PHY_M_IS_FIFO_ERROR = 1<<7, /* FIFO Overflow/Underrun Error */ + PHY_M_IS_MDI_CHANGE = 1<<6, /* MDI Crossover Changed */ + PHY_M_IS_DOWNSH_DET = 1<<5, /* Downshift Detected */ + PHY_M_IS_END_CHANGE = 1<<4, /* Energy Detect Changed */ + + PHY_M_IS_DTE_CHANGE = 1<<2, /* DTE Power Det. Status Changed */ + PHY_M_IS_POL_CHANGE = 1<<1, /* Polarity Changed */ + PHY_M_IS_JABBER = 1<<0, /* Jabber */ +}; + +#define PHY_M_DEF_MSK ( PHY_M_IS_AN_ERROR | PHY_M_IS_LSP_CHANGE | \ + PHY_M_IS_LST_CHANGE | PHY_M_IS_FIFO_ERROR) + +/***** PHY_MARV_EXT_CTRL 16 bit r/w Ext. PHY Specific Ctrl *****/ +enum { + PHY_M_EC_ENA_BC_EXT = 1<<15, /* Enable Block Carr. Ext. (88E1111 only) */ + PHY_M_EC_ENA_LIN_LB = 1<<14, /* Enable Line Loopback (88E1111 only) */ + + PHY_M_EC_DIS_LINK_P = 1<<12, /* Disable Link Pulses (88E1111 only) */ + PHY_M_EC_M_DSC_MSK = 3<<10, /* Bit 11..10: Master Downshift Counter */ + /* (88E1011 only) */ + PHY_M_EC_S_DSC_MSK = 3<<8,/* Bit 9.. 8: Slave Downshift Counter */ + /* (88E1011 only) */ + PHY_M_EC_M_DSC_MSK2 = 7<<9,/* Bit 11.. 9: Master Downshift Counter */ + /* (88E1111 only) */ + PHY_M_EC_DOWN_S_ENA = 1<<8, /* Downshift Enable (88E1111 only) */ + /* !!! Errata in spec. (1 = disable) */ + PHY_M_EC_RX_TIM_CT = 1<<7, /* RGMII Rx Timing Control*/ + PHY_M_EC_MAC_S_MSK = 7<<4,/* Bit 6.. 4: Def. MAC interface speed */ + PHY_M_EC_FIB_AN_ENA = 1<<3, /* Fiber Auto-Neg. Enable (88E1011S only) */ + PHY_M_EC_DTE_D_ENA = 1<<2, /* DTE Detect Enable (88E1111 only) */ + PHY_M_EC_TX_TIM_CT = 1<<1, /* RGMII Tx Timing Control */ + PHY_M_EC_TRANS_DIS = 1<<0, /* Transmitter Disable (88E1111 only) */}; + +#define PHY_M_EC_M_DSC(x) ((x)<<10) /* 00=1x; 01=2x; 10=3x; 11=4x */ +#define PHY_M_EC_S_DSC(x) ((x)<<8) /* 00=dis; 01=1x; 10=2x; 11=3x */ +#define PHY_M_EC_MAC_S(x) ((x)<<4) /* 01X=0; 110=2.5; 111=25 (MHz) */ + +#define PHY_M_EC_M_DSC_2(x) ((x)<<9) /* 000=1x; 001=2x; 010=3x; 011=4x */ + /* 100=5x; 101=6x; 110=7x; 111=8x */ +enum { + MAC_TX_CLK_0_MHZ = 2, + MAC_TX_CLK_2_5_MHZ = 6, + MAC_TX_CLK_25_MHZ = 7, +}; + +/***** PHY_MARV_LED_CTRL 16 bit r/w LED Control Reg *****/ +enum { + PHY_M_LEDC_DIS_LED = 1<<15, /* Disable LED */ + PHY_M_LEDC_PULS_MSK = 7<<12,/* Bit 14..12: Pulse Stretch Mask */ + PHY_M_LEDC_F_INT = 1<<11, /* Force Interrupt */ + PHY_M_LEDC_BL_R_MSK = 7<<8,/* Bit 10.. 8: Blink Rate Mask */ + PHY_M_LEDC_DP_C_LSB = 1<<7, /* Duplex Control (LSB, 88E1111 only) */ + PHY_M_LEDC_TX_C_LSB = 1<<6, /* Tx Control (LSB, 88E1111 only) */ + PHY_M_LEDC_LK_C_MSK = 7<<3,/* Bit 5.. 3: Link Control Mask */ + /* (88E1111 only) */ +}; + +enum { + PHY_M_LEDC_LINK_MSK = 3<<3,/* Bit 4.. 3: Link Control Mask */ + /* (88E1011 only) */ + PHY_M_LEDC_DP_CTRL = 1<<2, /* Duplex Control */ + PHY_M_LEDC_DP_C_MSB = 1<<2, /* Duplex Control (MSB, 88E1111 only) */ + PHY_M_LEDC_RX_CTRL = 1<<1, /* Rx Activity / Link */ + PHY_M_LEDC_TX_CTRL = 1<<0, /* Tx Activity / Link */ + PHY_M_LEDC_TX_C_MSB = 1<<0, /* Tx Control (MSB, 88E1111 only) */ +}; + +#define PHY_M_LED_PULS_DUR(x) ( ((x)<<12) & PHY_M_LEDC_PULS_MSK) + +enum { + PULS_NO_STR = 0,/* no pulse stretching */ + PULS_21MS = 1,/* 21 ms to 42 ms */ + PULS_42MS = 2,/* 42 ms to 84 ms */ + PULS_84MS = 3,/* 84 ms to 170 ms */ + PULS_170MS = 4,/* 170 ms to 340 ms */ + PULS_340MS = 5,/* 340 ms to 670 ms */ + PULS_670MS = 6,/* 670 ms to 1.3 s */ + PULS_1300MS = 7,/* 1.3 s to 2.7 s */ +}; + +#define PHY_M_LED_BLINK_RT(x) ( ((x)<<8) & PHY_M_LEDC_BL_R_MSK) + +enum { + BLINK_42MS = 0,/* 42 ms */ + BLINK_84MS = 1,/* 84 ms */ + BLINK_170MS = 2,/* 170 ms */ + BLINK_340MS = 3,/* 340 ms */ + BLINK_670MS = 4,/* 670 ms */ +}; + +/***** PHY_MARV_LED_OVER 16 bit r/w Manual LED Override Reg *****/ +#define PHY_M_LED_MO_SGMII(x) ((x)<<14) /* Bit 15..14: SGMII AN Timer */ + /* Bit 13..12: reserved */ +#define PHY_M_LED_MO_DUP(x) ((x)<<10) /* Bit 11..10: Duplex */ +#define PHY_M_LED_MO_10(x) ((x)<<8) /* Bit 9.. 8: Link 10 */ +#define PHY_M_LED_MO_100(x) ((x)<<6) /* Bit 7.. 6: Link 100 */ +#define PHY_M_LED_MO_1000(x) ((x)<<4) /* Bit 5.. 4: Link 1000 */ +#define PHY_M_LED_MO_RX(x) ((x)<<2) /* Bit 3.. 2: Rx */ +#define PHY_M_LED_MO_TX(x) ((x)<<0) /* Bit 1.. 0: Tx */ + +enum { + MO_LED_NORM = 0, + MO_LED_BLINK = 1, + MO_LED_OFF = 2, + MO_LED_ON = 3, +}; + +/***** PHY_MARV_EXT_CTRL_2 16 bit r/w Ext. PHY Specific Ctrl 2 *****/ +enum { + PHY_M_EC2_FI_IMPED = 1<<6, /* Fiber Input Impedance */ + PHY_M_EC2_FO_IMPED = 1<<5, /* Fiber Output Impedance */ + PHY_M_EC2_FO_M_CLK = 1<<4, /* Fiber Mode Clock Enable */ + PHY_M_EC2_FO_BOOST = 1<<3, /* Fiber Output Boost */ + PHY_M_EC2_FO_AM_MSK = 7,/* Bit 2.. 0: Fiber Output Amplitude */ +}; + +/***** PHY_MARV_EXT_P_STAT 16 bit r/w Ext. PHY Specific Status *****/ +enum { + PHY_M_FC_AUTO_SEL = 1<<15, /* Fiber/Copper Auto Sel. Dis. */ + PHY_M_FC_AN_REG_ACC = 1<<14, /* Fiber/Copper AN Reg. Access */ + PHY_M_FC_RESOLUTION = 1<<13, /* Fiber/Copper Resolution */ + PHY_M_SER_IF_AN_BP = 1<<12, /* Ser. IF AN Bypass Enable */ + PHY_M_SER_IF_BP_ST = 1<<11, /* Ser. IF AN Bypass Status */ + PHY_M_IRQ_POLARITY = 1<<10, /* IRQ polarity */ + PHY_M_DIS_AUT_MED = 1<<9, /* Disable Aut. Medium Reg. Selection */ + /* (88E1111 only) */ + /* Bit 9.. 4: reserved (88E1011 only) */ + PHY_M_UNDOC1 = 1<<7, /* undocumented bit !! */ + PHY_M_DTE_POW_STAT = 1<<4, /* DTE Power Status (88E1111 only) */ + PHY_M_MODE_MASK = 0xf, /* Bit 3.. 0: copy of HWCFG MODE[3:0] */ +}; + +/***** PHY_MARV_CABLE_DIAG 16 bit r/o Cable Diagnostic Reg *****/ +enum { + PHY_M_CABD_ENA_TEST = 1<<15, /* Enable Test (Page 0) */ + PHY_M_CABD_DIS_WAIT = 1<<15, /* Disable Waiting Period (Page 1) */ + /* (88E1111 only) */ + PHY_M_CABD_STAT_MSK = 3<<13, /* Bit 14..13: Status Mask */ + PHY_M_CABD_AMPL_MSK = 0x1f<<8,/* Bit 12.. 8: Amplitude Mask */ + /* (88E1111 only) */ + PHY_M_CABD_DIST_MSK = 0xff, /* Bit 7.. 0: Distance Mask */ +}; + +/* values for Cable Diagnostic Status (11=fail; 00=OK; 10=open; 01=short) */ +enum { + CABD_STAT_NORMAL= 0, + CABD_STAT_SHORT = 1, + CABD_STAT_OPEN = 2, + CABD_STAT_FAIL = 3, +}; + +/* for 10/100 Fast Ethernet PHY (88E3082 only) */ +/***** PHY_MARV_FE_LED_PAR 16 bit r/w LED Parallel Select Reg. *****/ + /* Bit 15..12: reserved (used internally) */ +enum { + PHY_M_FELP_LED2_MSK = 0xf<<8, /* Bit 11.. 8: LED2 Mask (LINK) */ + PHY_M_FELP_LED1_MSK = 0xf<<4, /* Bit 7.. 4: LED1 Mask (ACT) */ + PHY_M_FELP_LED0_MSK = 0xf, /* Bit 3.. 0: LED0 Mask (SPEED) */ +}; + +#define PHY_M_FELP_LED2_CTRL(x) ( ((x)<<8) & PHY_M_FELP_LED2_MSK) +#define PHY_M_FELP_LED1_CTRL(x) ( ((x)<<4) & PHY_M_FELP_LED1_MSK) +#define PHY_M_FELP_LED0_CTRL(x) ( ((x)<<0) & PHY_M_FELP_LED0_MSK) + +enum { + LED_PAR_CTRL_COLX = 0x00, + LED_PAR_CTRL_ERROR = 0x01, + LED_PAR_CTRL_DUPLEX = 0x02, + LED_PAR_CTRL_DP_COL = 0x03, + LED_PAR_CTRL_SPEED = 0x04, + LED_PAR_CTRL_LINK = 0x05, + LED_PAR_CTRL_TX = 0x06, + LED_PAR_CTRL_RX = 0x07, + LED_PAR_CTRL_ACT = 0x08, + LED_PAR_CTRL_LNK_RX = 0x09, + LED_PAR_CTRL_LNK_AC = 0x0a, + LED_PAR_CTRL_ACT_BL = 0x0b, + LED_PAR_CTRL_TX_BL = 0x0c, + LED_PAR_CTRL_RX_BL = 0x0d, + LED_PAR_CTRL_COL_BL = 0x0e, + LED_PAR_CTRL_INACT = 0x0f +}; + +/*****,PHY_MARV_FE_SPEC_2 16 bit r/w Specific Control Reg. 2 *****/ +enum { + PHY_M_FESC_DIS_WAIT = 1<<2, /* Disable TDR Waiting Period */ + PHY_M_FESC_ENA_MCLK = 1<<1, /* Enable MAC Rx Clock in sleep mode */ + PHY_M_FESC_SEL_CL_A = 1<<0, /* Select Class A driver (100B-TX) */ +}; + +/* for Yukon-2 Gigabit Ethernet PHY (88E1112 only) */ +/***** PHY_MARV_PHY_CTRL (page 2) 16 bit r/w MAC Specific Ctrl *****/ +enum { + PHY_M_MAC_MD_MSK = 7<<7, /* Bit 9.. 7: Mode Select Mask */ + PHY_M_MAC_MD_AUTO = 3,/* Auto Copper/1000Base-X */ + PHY_M_MAC_MD_COPPER = 5,/* Copper only */ + PHY_M_MAC_MD_1000BX = 7,/* 1000Base-X only */ +}; +#define PHY_M_MAC_MODE_SEL(x) ( ((x)<<7) & PHY_M_MAC_MD_MSK) + +/***** PHY_MARV_PHY_CTRL (page 3) 16 bit r/w LED Control Reg. *****/ +enum { + PHY_M_LEDC_LOS_MSK = 0xf<<12,/* Bit 15..12: LOS LED Ctrl. Mask */ + PHY_M_LEDC_INIT_MSK = 0xf<<8, /* Bit 11.. 8: INIT LED Ctrl. Mask */ + PHY_M_LEDC_STA1_MSK = 0xf<<4,/* Bit 7.. 4: STAT1 LED Ctrl. Mask */ + PHY_M_LEDC_STA0_MSK = 0xf, /* Bit 3.. 0: STAT0 LED Ctrl. Mask */ +}; + +#define PHY_M_LEDC_LOS_CTRL(x) ( ((x)<<12) & PHY_M_LEDC_LOS_MSK) +#define PHY_M_LEDC_INIT_CTRL(x) ( ((x)<<8) & PHY_M_LEDC_INIT_MSK) +#define PHY_M_LEDC_STA1_CTRL(x) ( ((x)<<4) & PHY_M_LEDC_STA1_MSK) +#define PHY_M_LEDC_STA0_CTRL(x) ( ((x)<<0) & PHY_M_LEDC_STA0_MSK) + +/* GMAC registers */ +/* Port Registers */ +enum { + GM_GP_STAT = 0x0000, /* 16 bit r/o General Purpose Status */ + GM_GP_CTRL = 0x0004, /* 16 bit r/w General Purpose Control */ + GM_TX_CTRL = 0x0008, /* 16 bit r/w Transmit Control Reg. */ + GM_RX_CTRL = 0x000c, /* 16 bit r/w Receive Control Reg. */ + GM_TX_FLOW_CTRL = 0x0010, /* 16 bit r/w Transmit Flow-Control */ + GM_TX_PARAM = 0x0014, /* 16 bit r/w Transmit Parameter Reg. */ + GM_SERIAL_MODE = 0x0018, /* 16 bit r/w Serial Mode Register */ +/* Source Address Registers */ + GM_SRC_ADDR_1L = 0x001c, /* 16 bit r/w Source Address 1 (low) */ + GM_SRC_ADDR_1M = 0x0020, /* 16 bit r/w Source Address 1 (middle) */ + GM_SRC_ADDR_1H = 0x0024, /* 16 bit r/w Source Address 1 (high) */ + GM_SRC_ADDR_2L = 0x0028, /* 16 bit r/w Source Address 2 (low) */ + GM_SRC_ADDR_2M = 0x002c, /* 16 bit r/w Source Address 2 (middle) */ + GM_SRC_ADDR_2H = 0x0030, /* 16 bit r/w Source Address 2 (high) */ + +/* Multicast Address Hash Registers */ + GM_MC_ADDR_H1 = 0x0034, /* 16 bit r/w Multicast Address Hash 1 */ + GM_MC_ADDR_H2 = 0x0038, /* 16 bit r/w Multicast Address Hash 2 */ + GM_MC_ADDR_H3 = 0x003c, /* 16 bit r/w Multicast Address Hash 3 */ + GM_MC_ADDR_H4 = 0x0040, /* 16 bit r/w Multicast Address Hash 4 */ + +/* Interrupt Source Registers */ + GM_TX_IRQ_SRC = 0x0044, /* 16 bit r/o Tx Overflow IRQ Source */ + GM_RX_IRQ_SRC = 0x0048, /* 16 bit r/o Rx Overflow IRQ Source */ + GM_TR_IRQ_SRC = 0x004c, /* 16 bit r/o Tx/Rx Over. IRQ Source */ + +/* Interrupt Mask Registers */ + GM_TX_IRQ_MSK = 0x0050, /* 16 bit r/w Tx Overflow IRQ Mask */ + GM_RX_IRQ_MSK = 0x0054, /* 16 bit r/w Rx Overflow IRQ Mask */ + GM_TR_IRQ_MSK = 0x0058, /* 16 bit r/w Tx/Rx Over. IRQ Mask */ + +/* Serial Management Interface (SMI) Registers */ + GM_SMI_CTRL = 0x0080, /* 16 bit r/w SMI Control Register */ + GM_SMI_DATA = 0x0084, /* 16 bit r/w SMI Data Register */ + GM_PHY_ADDR = 0x0088, /* 16 bit r/w GPHY Address Register */ +}; + +/* MIB Counters */ +#define GM_MIB_CNT_BASE 0x0100 /* Base Address of MIB Counters */ +#define GM_MIB_CNT_SIZE 44 /* Number of MIB Counters */ + +/* + * MIB Counters base address definitions (low word) - + * use offset 4 for access to high word (32 bit r/o) + */ +enum { + GM_RXF_UC_OK = GM_MIB_CNT_BASE + 0, /* Unicast Frames Received OK */ + GM_RXF_BC_OK = GM_MIB_CNT_BASE + 8, /* Broadcast Frames Received OK */ + GM_RXF_MPAUSE = GM_MIB_CNT_BASE + 16, /* Pause MAC Ctrl Frames Received */ + GM_RXF_MC_OK = GM_MIB_CNT_BASE + 24, /* Multicast Frames Received OK */ + GM_RXF_FCS_ERR = GM_MIB_CNT_BASE + 32, /* Rx Frame Check Seq. Error */ + /* GM_MIB_CNT_BASE + 40: reserved */ + GM_RXO_OK_LO = GM_MIB_CNT_BASE + 48, /* Octets Received OK Low */ + GM_RXO_OK_HI = GM_MIB_CNT_BASE + 56, /* Octets Received OK High */ + GM_RXO_ERR_LO = GM_MIB_CNT_BASE + 64, /* Octets Received Invalid Low */ + GM_RXO_ERR_HI = GM_MIB_CNT_BASE + 72, /* Octets Received Invalid High */ + GM_RXF_SHT = GM_MIB_CNT_BASE + 80, /* Frames <64 Byte Received OK */ + GM_RXE_FRAG = GM_MIB_CNT_BASE + 88, /* Frames <64 Byte Received with FCS Err */ + GM_RXF_64B = GM_MIB_CNT_BASE + 96, /* 64 Byte Rx Frame */ + GM_RXF_127B = GM_MIB_CNT_BASE + 104, /* 65-127 Byte Rx Frame */ + GM_RXF_255B = GM_MIB_CNT_BASE + 112, /* 128-255 Byte Rx Frame */ + GM_RXF_511B = GM_MIB_CNT_BASE + 120, /* 256-511 Byte Rx Frame */ + GM_RXF_1023B = GM_MIB_CNT_BASE + 128, /* 512-1023 Byte Rx Frame */ + GM_RXF_1518B = GM_MIB_CNT_BASE + 136, /* 1024-1518 Byte Rx Frame */ + GM_RXF_MAX_SZ = GM_MIB_CNT_BASE + 144, /* 1519-MaxSize Byte Rx Frame */ + GM_RXF_LNG_ERR = GM_MIB_CNT_BASE + 152, /* Rx Frame too Long Error */ + GM_RXF_JAB_PKT = GM_MIB_CNT_BASE + 160, /* Rx Jabber Packet Frame */ + /* GM_MIB_CNT_BASE + 168: reserved */ + GM_RXE_FIFO_OV = GM_MIB_CNT_BASE + 176, /* Rx FIFO overflow Event */ + /* GM_MIB_CNT_BASE + 184: reserved */ + GM_TXF_UC_OK = GM_MIB_CNT_BASE + 192, /* Unicast Frames Xmitted OK */ + GM_TXF_BC_OK = GM_MIB_CNT_BASE + 200, /* Broadcast Frames Xmitted OK */ + GM_TXF_MPAUSE = GM_MIB_CNT_BASE + 208, /* Pause MAC Ctrl Frames Xmitted */ + GM_TXF_MC_OK = GM_MIB_CNT_BASE + 216, /* Multicast Frames Xmitted OK */ + GM_TXO_OK_LO = GM_MIB_CNT_BASE + 224, /* Octets Transmitted OK Low */ + GM_TXO_OK_HI = GM_MIB_CNT_BASE + 232, /* Octets Transmitted OK High */ + GM_TXF_64B = GM_MIB_CNT_BASE + 240, /* 64 Byte Tx Frame */ + GM_TXF_127B = GM_MIB_CNT_BASE + 248, /* 65-127 Byte Tx Frame */ + GM_TXF_255B = GM_MIB_CNT_BASE + 256, /* 128-255 Byte Tx Frame */ + GM_TXF_511B = GM_MIB_CNT_BASE + 264, /* 256-511 Byte Tx Frame */ + GM_TXF_1023B = GM_MIB_CNT_BASE + 272, /* 512-1023 Byte Tx Frame */ + GM_TXF_1518B = GM_MIB_CNT_BASE + 280, /* 1024-1518 Byte Tx Frame */ + GM_TXF_MAX_SZ = GM_MIB_CNT_BASE + 288, /* 1519-MaxSize Byte Tx Frame */ + + GM_TXF_COL = GM_MIB_CNT_BASE + 304, /* Tx Collision */ + GM_TXF_LAT_COL = GM_MIB_CNT_BASE + 312, /* Tx Late Collision */ + GM_TXF_ABO_COL = GM_MIB_CNT_BASE + 320, /* Tx aborted due to Exces. Col. */ + GM_TXF_MUL_COL = GM_MIB_CNT_BASE + 328, /* Tx Multiple Collision */ + GM_TXF_SNG_COL = GM_MIB_CNT_BASE + 336, /* Tx Single Collision */ + GM_TXE_FIFO_UR = GM_MIB_CNT_BASE + 344, /* Tx FIFO Underrun Event */ +}; + +/* GMAC Bit Definitions */ +/* GM_GP_STAT 16 bit r/o General Purpose Status Register */ +enum { + GM_GPSR_SPEED = 1<<15, /* Bit 15: Port Speed (1 = 100 Mbps) */ + GM_GPSR_DUPLEX = 1<<14, /* Bit 14: Duplex Mode (1 = Full) */ + GM_GPSR_FC_TX_DIS = 1<<13, /* Bit 13: Tx Flow-Control Mode Disabled */ + GM_GPSR_LINK_UP = 1<<12, /* Bit 12: Link Up Status */ + GM_GPSR_PAUSE = 1<<11, /* Bit 11: Pause State */ + GM_GPSR_TX_ACTIVE = 1<<10, /* Bit 10: Tx in Progress */ + GM_GPSR_EXC_COL = 1<<9, /* Bit 9: Excessive Collisions Occured */ + GM_GPSR_LAT_COL = 1<<8, /* Bit 8: Late Collisions Occured */ + + GM_GPSR_PHY_ST_CH = 1<<5, /* Bit 5: PHY Status Change */ + GM_GPSR_GIG_SPEED = 1<<4, /* Bit 4: Gigabit Speed (1 = 1000 Mbps) */ + GM_GPSR_PART_MODE = 1<<3, /* Bit 3: Partition mode */ + GM_GPSR_FC_RX_DIS = 1<<2, /* Bit 2: Rx Flow-Control Mode Disabled */ + GM_GPSR_PROM_EN = 1<<1, /* Bit 1: Promiscuous Mode Enabled */ +}; + +/* GM_GP_CTRL 16 bit r/w General Purpose Control Register */ +enum { + GM_GPCR_PROM_ENA = 1<<14, /* Bit 14: Enable Promiscuous Mode */ + GM_GPCR_FC_TX_DIS = 1<<13, /* Bit 13: Disable Tx Flow-Control Mode */ + GM_GPCR_TX_ENA = 1<<12, /* Bit 12: Enable Transmit */ + GM_GPCR_RX_ENA = 1<<11, /* Bit 11: Enable Receive */ + GM_GPCR_BURST_ENA = 1<<10, /* Bit 10: Enable Burst Mode */ + GM_GPCR_LOOP_ENA = 1<<9, /* Bit 9: Enable MAC Loopback Mode */ + GM_GPCR_PART_ENA = 1<<8, /* Bit 8: Enable Partition Mode */ + GM_GPCR_GIGS_ENA = 1<<7, /* Bit 7: Gigabit Speed (1000 Mbps) */ + GM_GPCR_FL_PASS = 1<<6, /* Bit 6: Force Link Pass */ + GM_GPCR_DUP_FULL = 1<<5, /* Bit 5: Full Duplex Mode */ + GM_GPCR_FC_RX_DIS = 1<<4, /* Bit 4: Disable Rx Flow-Control Mode */ + GM_GPCR_SPEED_100 = 1<<3, /* Bit 3: Port Speed 100 Mbps */ + GM_GPCR_AU_DUP_DIS = 1<<2, /* Bit 2: Disable Auto-Update Duplex */ + GM_GPCR_AU_FCT_DIS = 1<<1, /* Bit 1: Disable Auto-Update Flow-C. */ + GM_GPCR_AU_SPD_DIS = 1<<0, /* Bit 0: Disable Auto-Update Speed */ +}; + +#define GM_GPCR_SPEED_1000 (GM_GPCR_GIGS_ENA | GM_GPCR_SPEED_100) +#define GM_GPCR_AU_ALL_DIS (GM_GPCR_AU_DUP_DIS | GM_GPCR_AU_FCT_DIS|GM_GPCR_AU_SPD_DIS) + +/* GM_TX_CTRL 16 bit r/w Transmit Control Register */ +enum { + GM_TXCR_FORCE_JAM = 1<<15, /* Bit 15: Force Jam / Flow-Control */ + GM_TXCR_CRC_DIS = 1<<14, /* Bit 14: Disable insertion of CRC */ + GM_TXCR_PAD_DIS = 1<<13, /* Bit 13: Disable padding of packets */ + GM_TXCR_COL_THR_MSK = 1<<10, /* Bit 12..10: Collision Threshold */ +}; + +#define TX_COL_THR(x) (((x)<<10) & GM_TXCR_COL_THR_MSK) +#define TX_COL_DEF 0x04 + +/* GM_RX_CTRL 16 bit r/w Receive Control Register */ +enum { + GM_RXCR_UCF_ENA = 1<<15, /* Bit 15: Enable Unicast filtering */ + GM_RXCR_MCF_ENA = 1<<14, /* Bit 14: Enable Multicast filtering */ + GM_RXCR_CRC_DIS = 1<<13, /* Bit 13: Remove 4-byte CRC */ + GM_RXCR_PASS_FC = 1<<12, /* Bit 12: Pass FC packets to FIFO */ +}; + +/* GM_TX_PARAM 16 bit r/w Transmit Parameter Register */ +enum { + GM_TXPA_JAMLEN_MSK = 0x03<<14, /* Bit 15..14: Jam Length */ + GM_TXPA_JAMIPG_MSK = 0x1f<<9, /* Bit 13..9: Jam IPG */ + GM_TXPA_JAMDAT_MSK = 0x1f<<4, /* Bit 8..4: IPG Jam to Data */ + + TX_JAM_LEN_DEF = 0x03, + TX_JAM_IPG_DEF = 0x0b, + TX_IPG_JAM_DEF = 0x1c, +}; + +#define TX_JAM_LEN_VAL(x) (((x)<<14) & GM_TXPA_JAMLEN_MSK) +#define TX_JAM_IPG_VAL(x) (((x)<<9) & GM_TXPA_JAMIPG_MSK) +#define TX_IPG_JAM_DATA(x) (((x)<<4) & GM_TXPA_JAMDAT_MSK) + + +/* GM_SERIAL_MODE 16 bit r/w Serial Mode Register */ +enum { + GM_SMOD_DATABL_MSK = 0x1f<<11, /* Bit 15..11: Data Blinder (r/o) */ + GM_SMOD_LIMIT_4 = 1<<10, /* Bit 10: 4 consecutive Tx trials */ + GM_SMOD_VLAN_ENA = 1<<9, /* Bit 9: Enable VLAN (Max. Frame Len) */ + GM_SMOD_JUMBO_ENA = 1<<8, /* Bit 8: Enable Jumbo (Max. Frame Len) */ + GM_SMOD_IPG_MSK = 0x1f /* Bit 4..0: Inter-Packet Gap (IPG) */ +}; + +#define DATA_BLIND_VAL(x) (((x)<<11) & GM_SMOD_DATABL_MSK) +#define DATA_BLIND_DEF 0x04 + +#define IPG_DATA_VAL(x) (x & GM_SMOD_IPG_MSK) +#define IPG_DATA_DEF 0x1e + +/* GM_SMI_CTRL 16 bit r/w SMI Control Register */ +enum { + GM_SMI_CT_PHY_A_MSK = 0x1f<<11,/* Bit 15..11: PHY Device Address */ + GM_SMI_CT_REG_A_MSK = 0x1f<<6,/* Bit 10.. 6: PHY Register Address */ + GM_SMI_CT_OP_RD = 1<<5, /* Bit 5: OpCode Read (0=Write)*/ + GM_SMI_CT_RD_VAL = 1<<4, /* Bit 4: Read Valid (Read completed) */ + GM_SMI_CT_BUSY = 1<<3, /* Bit 3: Busy (Operation in progress) */ +}; + +#define GM_SMI_CT_PHY_AD(x) (((x)<<11) & GM_SMI_CT_PHY_A_MSK) +#define GM_SMI_CT_REG_AD(x) (((x)<<6) & GM_SMI_CT_REG_A_MSK) + +/* GM_PHY_ADDR 16 bit r/w GPHY Address Register */ +enum { + GM_PAR_MIB_CLR = 1<<5, /* Bit 5: Set MIB Clear Counter Mode */ + GM_PAR_MIB_TST = 1<<4, /* Bit 4: MIB Load Counter (Test Mode) */ +}; + +/* Receive Frame Status Encoding */ +enum { + GMR_FS_LEN = 0xffff<<16, /* Bit 31..16: Rx Frame Length */ + GMR_FS_VLAN = 1<<13, /* Bit 13: VLAN Packet */ + GMR_FS_JABBER = 1<<12, /* Bit 12: Jabber Packet */ + GMR_FS_UN_SIZE = 1<<11, /* Bit 11: Undersize Packet */ + GMR_FS_MC = 1<<10, /* Bit 10: Multicast Packet */ + GMR_FS_BC = 1<<9, /* Bit 9: Broadcast Packet */ + GMR_FS_RX_OK = 1<<8, /* Bit 8: Receive OK (Good Packet) */ + GMR_FS_GOOD_FC = 1<<7, /* Bit 7: Good Flow-Control Packet */ + GMR_FS_BAD_FC = 1<<6, /* Bit 6: Bad Flow-Control Packet */ + GMR_FS_MII_ERR = 1<<5, /* Bit 5: MII Error */ + GMR_FS_LONG_ERR = 1<<4, /* Bit 4: Too Long Packet */ + GMR_FS_FRAGMENT = 1<<3, /* Bit 3: Fragment */ + + GMR_FS_CRC_ERR = 1<<1, /* Bit 1: CRC Error */ + GMR_FS_RX_FF_OV = 1<<0, /* Bit 0: Rx FIFO Overflow */ + +/* + * GMR_FS_ANY_ERR (analogous to XMR_FS_ANY_ERR) + */ + GMR_FS_ANY_ERR = GMR_FS_CRC_ERR | GMR_FS_LONG_ERR | + GMR_FS_MII_ERR | GMR_FS_BAD_FC | GMR_FS_GOOD_FC | + GMR_FS_JABBER, +/* Rx GMAC FIFO Flush Mask (default) */ + RX_FF_FL_DEF_MSK = GMR_FS_CRC_ERR | GMR_FS_RX_FF_OV |GMR_FS_MII_ERR | + GMR_FS_BAD_FC | GMR_FS_GOOD_FC | GMR_FS_UN_SIZE | + GMR_FS_JABBER, +}; + +/* RX_GMF_CTRL_T 32 bit Rx GMAC FIFO Control/Test */ +enum { + GMF_WP_TST_ON = 1<<14, /* Write Pointer Test On */ + GMF_WP_TST_OFF = 1<<13, /* Write Pointer Test Off */ + GMF_WP_STEP = 1<<12, /* Write Pointer Step/Increment */ + + GMF_RP_TST_ON = 1<<10, /* Read Pointer Test On */ + GMF_RP_TST_OFF = 1<<9, /* Read Pointer Test Off */ + GMF_RP_STEP = 1<<8, /* Read Pointer Step/Increment */ + GMF_RX_F_FL_ON = 1<<7, /* Rx FIFO Flush Mode On */ + GMF_RX_F_FL_OFF = 1<<6, /* Rx FIFO Flush Mode Off */ + GMF_CLI_RX_FO = 1<<5, /* Clear IRQ Rx FIFO Overrun */ + GMF_CLI_RX_FC = 1<<4, /* Clear IRQ Rx Frame Complete */ + GMF_OPER_ON = 1<<3, /* Operational Mode On */ + GMF_OPER_OFF = 1<<2, /* Operational Mode Off */ + GMF_RST_CLR = 1<<1, /* Clear GMAC FIFO Reset */ + GMF_RST_SET = 1<<0, /* Set GMAC FIFO Reset */ + + RX_GMF_FL_THR_DEF = 0xa, /* flush threshold (default) */ +}; + + +/* TX_GMF_CTRL_T 32 bit Tx GMAC FIFO Control/Test */ +enum { + GMF_WSP_TST_ON = 1<<18,/* Write Shadow Pointer Test On */ + GMF_WSP_TST_OFF = 1<<17,/* Write Shadow Pointer Test Off */ + GMF_WSP_STEP = 1<<16,/* Write Shadow Pointer Step/Increment */ + + GMF_CLI_TX_FU = 1<<6, /* Clear IRQ Tx FIFO Underrun */ + GMF_CLI_TX_FC = 1<<5, /* Clear IRQ Tx Frame Complete */ + GMF_CLI_TX_PE = 1<<4, /* Clear IRQ Tx Parity Error */ +}; + +/* GMAC_TI_ST_CTRL 8 bit Time Stamp Timer Ctrl Reg (YUKON only) */ +enum { + GMT_ST_START = 1<<2, /* Start Time Stamp Timer */ + GMT_ST_STOP = 1<<1, /* Stop Time Stamp Timer */ + GMT_ST_CLR_IRQ = 1<<0, /* Clear Time Stamp Timer IRQ */ +}; + +/* GMAC_CTRL 32 bit GMAC Control Reg (YUKON only) */ +enum { + GMC_H_BURST_ON = 1<<7, /* Half Duplex Burst Mode On */ + GMC_H_BURST_OFF = 1<<6, /* Half Duplex Burst Mode Off */ + GMC_F_LOOPB_ON = 1<<5, /* FIFO Loopback On */ + GMC_F_LOOPB_OFF = 1<<4, /* FIFO Loopback Off */ + GMC_PAUSE_ON = 1<<3, /* Pause On */ + GMC_PAUSE_OFF = 1<<2, /* Pause Off */ + GMC_RST_CLR = 1<<1, /* Clear GMAC Reset */ + GMC_RST_SET = 1<<0, /* Set GMAC Reset */ +}; + +/* GPHY_CTRL 32 bit GPHY Control Reg (YUKON only) */ +enum { + GPC_SEL_BDT = 1<<28, /* Select Bi-Dir. Transfer for MDC/MDIO */ + GPC_INT_POL_HI = 1<<27, /* IRQ Polarity is Active HIGH */ + GPC_75_OHM = 1<<26, /* Use 75 Ohm Termination instead of 50 */ + GPC_DIS_FC = 1<<25, /* Disable Automatic Fiber/Copper Detection */ + GPC_DIS_SLEEP = 1<<24, /* Disable Energy Detect */ + GPC_HWCFG_M_3 = 1<<23, /* HWCFG_MODE[3] */ + GPC_HWCFG_M_2 = 1<<22, /* HWCFG_MODE[2] */ + GPC_HWCFG_M_1 = 1<<21, /* HWCFG_MODE[1] */ + GPC_HWCFG_M_0 = 1<<20, /* HWCFG_MODE[0] */ + GPC_ANEG_0 = 1<<19, /* ANEG[0] */ + GPC_ENA_XC = 1<<18, /* Enable MDI crossover */ + GPC_DIS_125 = 1<<17, /* Disable 125 MHz clock */ + GPC_ANEG_3 = 1<<16, /* ANEG[3] */ + GPC_ANEG_2 = 1<<15, /* ANEG[2] */ + GPC_ANEG_1 = 1<<14, /* ANEG[1] */ + GPC_ENA_PAUSE = 1<<13, /* Enable Pause (SYM_OR_REM) */ + GPC_PHYADDR_4 = 1<<12, /* Bit 4 of Phy Addr */ + GPC_PHYADDR_3 = 1<<11, /* Bit 3 of Phy Addr */ + GPC_PHYADDR_2 = 1<<10, /* Bit 2 of Phy Addr */ + GPC_PHYADDR_1 = 1<<9, /* Bit 1 of Phy Addr */ + GPC_PHYADDR_0 = 1<<8, /* Bit 0 of Phy Addr */ + /* Bits 7..2: reserved */ + GPC_RST_CLR = 1<<1, /* Clear GPHY Reset */ + GPC_RST_SET = 1<<0, /* Set GPHY Reset */ +}; + +#define GPC_HWCFG_GMII_COP (GPC_HWCFG_M_3|GPC_HWCFG_M_2 | GPC_HWCFG_M_1 | GPC_HWCFG_M_0) +#define GPC_HWCFG_GMII_FIB (GPC_HWCFG_M_2 | GPC_HWCFG_M_1 | GPC_HWCFG_M_0) +#define GPC_ANEG_ADV_ALL_M (GPC_ANEG_3 | GPC_ANEG_2 | GPC_ANEG_1 | GPC_ANEG_0) + +/* forced speed and duplex mode (don't mix with other ANEG bits) */ +#define GPC_FRC10MBIT_HALF 0 +#define GPC_FRC10MBIT_FULL GPC_ANEG_0 +#define GPC_FRC100MBIT_HALF GPC_ANEG_1 +#define GPC_FRC100MBIT_FULL (GPC_ANEG_0 | GPC_ANEG_1) + +/* auto-negotiation with limited advertised speeds */ +/* mix only with master/slave settings (for copper) */ +#define GPC_ADV_1000_HALF GPC_ANEG_2 +#define GPC_ADV_1000_FULL GPC_ANEG_3 +#define GPC_ADV_ALL (GPC_ANEG_2 | GPC_ANEG_3) + +/* master/slave settings */ +/* only for copper with 1000 Mbps */ +#define GPC_FORCE_MASTER 0 +#define GPC_FORCE_SLAVE GPC_ANEG_0 +#define GPC_PREF_MASTER GPC_ANEG_1 +#define GPC_PREF_SLAVE (GPC_ANEG_1 | GPC_ANEG_0) + +/* GMAC_IRQ_SRC 8 bit GMAC Interrupt Source Reg (YUKON only) */ +/* GMAC_IRQ_MSK 8 bit GMAC Interrupt Mask Reg (YUKON only) */ +enum { + GM_IS_TX_CO_OV = 1<<5, /* Transmit Counter Overflow IRQ */ + GM_IS_RX_CO_OV = 1<<4, /* Receive Counter Overflow IRQ */ + GM_IS_TX_FF_UR = 1<<3, /* Transmit FIFO Underrun */ + GM_IS_TX_COMPL = 1<<2, /* Frame Transmission Complete */ + GM_IS_RX_FF_OR = 1<<1, /* Receive FIFO Overrun */ + GM_IS_RX_COMPL = 1<<0, /* Frame Reception Complete */ + +#define GMAC_DEF_MSK (GM_IS_TX_CO_OV | GM_IS_RX_CO_OV | GM_IS_TX_FF_UR) + +/* GMAC_LINK_CTRL 16 bit GMAC Link Control Reg (YUKON only) */ + /* Bits 15.. 2: reserved */ + GMLC_RST_CLR = 1<<1, /* Clear GMAC Link Reset */ + GMLC_RST_SET = 1<<0, /* Set GMAC Link Reset */ + + +/* WOL_CTRL_STAT 16 bit WOL Control/Status Reg */ + WOL_CTL_LINK_CHG_OCC = 1<<15, + WOL_CTL_MAGIC_PKT_OCC = 1<<14, + WOL_CTL_PATTERN_OCC = 1<<13, + + WOL_CTL_CLEAR_RESULT = 1<<12, + WOL_CTL_ENA_PME_ON_LINK_CHG = 1<<11, + WOL_CTL_DIS_PME_ON_LINK_CHG = 1<<10, + WOL_CTL_ENA_PME_ON_MAGIC_PKT = 1<<9, + WOL_CTL_DIS_PME_ON_MAGIC_PKT = 1<<8, + WOL_CTL_ENA_PME_ON_PATTERN = 1<<7, + WOL_CTL_DIS_PME_ON_PATTERN = 1<<6, + WOL_CTL_ENA_LINK_CHG_UNIT = 1<<5, + WOL_CTL_DIS_LINK_CHG_UNIT = 1<<4, + WOL_CTL_ENA_MAGIC_PKT_UNIT = 1<<3, + WOL_CTL_DIS_MAGIC_PKT_UNIT = 1<<2, + WOL_CTL_ENA_PATTERN_UNIT = 1<<1, + WOL_CTL_DIS_PATTERN_UNIT = 1<<0, +}; + +#define WOL_CTL_DEFAULT \ + (WOL_CTL_DIS_PME_ON_LINK_CHG | \ + WOL_CTL_DIS_PME_ON_PATTERN | \ + WOL_CTL_DIS_PME_ON_MAGIC_PKT | \ + WOL_CTL_DIS_LINK_CHG_UNIT | \ + WOL_CTL_DIS_PATTERN_UNIT | \ + WOL_CTL_DIS_MAGIC_PKT_UNIT) + +/* WOL_MATCH_CTL 8 bit WOL Match Control Reg */ +#define WOL_CTL_PATT_ENA(x) (BIT_0 << (x)) + + +/* XMAC II registers */ +enum { + XM_MMU_CMD = 0x0000, /* 16 bit r/w MMU Command Register */ + XM_POFF = 0x0008, /* 32 bit r/w Packet Offset Register */ + XM_BURST = 0x000c, /* 32 bit r/w Burst Register for half duplex*/ + XM_1L_VLAN_TAG = 0x0010, /* 16 bit r/w One Level VLAN Tag ID */ + XM_2L_VLAN_TAG = 0x0014, /* 16 bit r/w Two Level VLAN Tag ID */ + XM_TX_CMD = 0x0020, /* 16 bit r/w Transmit Command Register */ + XM_TX_RT_LIM = 0x0024, /* 16 bit r/w Transmit Retry Limit Register */ + XM_TX_STIME = 0x0028, /* 16 bit r/w Transmit Slottime Register */ + XM_TX_IPG = 0x002c, /* 16 bit r/w Transmit Inter Packet Gap */ + XM_RX_CMD = 0x0030, /* 16 bit r/w Receive Command Register */ + XM_PHY_ADDR = 0x0034, /* 16 bit r/w PHY Address Register */ + XM_PHY_DATA = 0x0038, /* 16 bit r/w PHY Data Register */ + XM_GP_PORT = 0x0040, /* 32 bit r/w General Purpose Port Register */ + XM_IMSK = 0x0044, /* 16 bit r/w Interrupt Mask Register */ + XM_ISRC = 0x0048, /* 16 bit r/o Interrupt Status Register */ + XM_HW_CFG = 0x004c, /* 16 bit r/w Hardware Config Register */ + XM_TX_LO_WM = 0x0060, /* 16 bit r/w Tx FIFO Low Water Mark */ + XM_TX_HI_WM = 0x0062, /* 16 bit r/w Tx FIFO High Water Mark */ + XM_TX_THR = 0x0064, /* 16 bit r/w Tx Request Threshold */ + XM_HT_THR = 0x0066, /* 16 bit r/w Host Request Threshold */ + XM_PAUSE_DA = 0x0068, /* NA reg r/w Pause Destination Address */ + XM_CTL_PARA = 0x0070, /* 32 bit r/w Control Parameter Register */ + XM_MAC_OPCODE = 0x0074, /* 16 bit r/w Opcode for MAC control frames */ + XM_MAC_PTIME = 0x0076, /* 16 bit r/w Pause time for MAC ctrl frames*/ + XM_TX_STAT = 0x0078, /* 32 bit r/o Tx Status LIFO Register */ + + XM_EXM_START = 0x0080, /* r/w Start Address of the EXM Regs */ +#define XM_EXM(reg) (XM_EXM_START + ((reg) << 3)) +}; + +enum { + XM_SRC_CHK = 0x0100, /* NA reg r/w Source Check Address Register */ + XM_SA = 0x0108, /* NA reg r/w Station Address Register */ + XM_HSM = 0x0110, /* 64 bit r/w Hash Match Address Registers */ + XM_RX_LO_WM = 0x0118, /* 16 bit r/w Receive Low Water Mark */ + XM_RX_HI_WM = 0x011a, /* 16 bit r/w Receive High Water Mark */ + XM_RX_THR = 0x011c, /* 32 bit r/w Receive Request Threshold */ + XM_DEV_ID = 0x0120, /* 32 bit r/o Device ID Register */ + XM_MODE = 0x0124, /* 32 bit r/w Mode Register */ + XM_LSA = 0x0128, /* NA reg r/o Last Source Register */ + XM_TS_READ = 0x0130, /* 32 bit r/o Time Stamp Read Register */ + XM_TS_LOAD = 0x0134, /* 32 bit r/o Time Stamp Load Value */ + XM_STAT_CMD = 0x0200, /* 16 bit r/w Statistics Command Register */ + XM_RX_CNT_EV = 0x0204, /* 32 bit r/o Rx Counter Event Register */ + XM_TX_CNT_EV = 0x0208, /* 32 bit r/o Tx Counter Event Register */ + XM_RX_EV_MSK = 0x020c, /* 32 bit r/w Rx Counter Event Mask */ + XM_TX_EV_MSK = 0x0210, /* 32 bit r/w Tx Counter Event Mask */ + XM_TXF_OK = 0x0280, /* 32 bit r/o Frames Transmitted OK Conuter */ + XM_TXO_OK_HI = 0x0284, /* 32 bit r/o Octets Transmitted OK High Cnt*/ + XM_TXO_OK_LO = 0x0288, /* 32 bit r/o Octets Transmitted OK Low Cnt */ + XM_TXF_BC_OK = 0x028c, /* 32 bit r/o Broadcast Frames Xmitted OK */ + XM_TXF_MC_OK = 0x0290, /* 32 bit r/o Multicast Frames Xmitted OK */ + XM_TXF_UC_OK = 0x0294, /* 32 bit r/o Unicast Frames Xmitted OK */ + XM_TXF_LONG = 0x0298, /* 32 bit r/o Tx Long Frame Counter */ + XM_TXE_BURST = 0x029c, /* 32 bit r/o Tx Burst Event Counter */ + XM_TXF_MPAUSE = 0x02a0, /* 32 bit r/o Tx Pause MAC Ctrl Frame Cnt */ + XM_TXF_MCTRL = 0x02a4, /* 32 bit r/o Tx MAC Ctrl Frame Counter */ + XM_TXF_SNG_COL = 0x02a8, /* 32 bit r/o Tx Single Collision Counter */ + XM_TXF_MUL_COL = 0x02ac, /* 32 bit r/o Tx Multiple Collision Counter */ + XM_TXF_ABO_COL = 0x02b0, /* 32 bit r/o Tx aborted due to Exces. Col. */ + XM_TXF_LAT_COL = 0x02b4, /* 32 bit r/o Tx Late Collision Counter */ + XM_TXF_DEF = 0x02b8, /* 32 bit r/o Tx Deferred Frame Counter */ + XM_TXF_EX_DEF = 0x02bc, /* 32 bit r/o Tx Excessive Deferall Counter */ + XM_TXE_FIFO_UR = 0x02c0, /* 32 bit r/o Tx FIFO Underrun Event Cnt */ + XM_TXE_CS_ERR = 0x02c4, /* 32 bit r/o Tx Carrier Sense Error Cnt */ + XM_TXP_UTIL = 0x02c8, /* 32 bit r/o Tx Utilization in % */ + XM_TXF_64B = 0x02d0, /* 32 bit r/o 64 Byte Tx Frame Counter */ + XM_TXF_127B = 0x02d4, /* 32 bit r/o 65-127 Byte Tx Frame Counter */ + XM_TXF_255B = 0x02d8, /* 32 bit r/o 128-255 Byte Tx Frame Counter */ + XM_TXF_511B = 0x02dc, /* 32 bit r/o 256-511 Byte Tx Frame Counter */ + XM_TXF_1023B = 0x02e0, /* 32 bit r/o 512-1023 Byte Tx Frame Counter*/ + XM_TXF_MAX_SZ = 0x02e4, /* 32 bit r/o 1024-MaxSize Byte Tx Frame Cnt*/ + XM_RXF_OK = 0x0300, /* 32 bit r/o Frames Received OK */ + XM_RXO_OK_HI = 0x0304, /* 32 bit r/o Octets Received OK High Cnt */ + XM_RXO_OK_LO = 0x0308, /* 32 bit r/o Octets Received OK Low Counter*/ + XM_RXF_BC_OK = 0x030c, /* 32 bit r/o Broadcast Frames Received OK */ + XM_RXF_MC_OK = 0x0310, /* 32 bit r/o Multicast Frames Received OK */ + XM_RXF_UC_OK = 0x0314, /* 32 bit r/o Unicast Frames Received OK */ + XM_RXF_MPAUSE = 0x0318, /* 32 bit r/o Rx Pause MAC Ctrl Frame Cnt */ + XM_RXF_MCTRL = 0x031c, /* 32 bit r/o Rx MAC Ctrl Frame Counter */ + XM_RXF_INV_MP = 0x0320, /* 32 bit r/o Rx invalid Pause Frame Cnt */ + XM_RXF_INV_MOC = 0x0324, /* 32 bit r/o Rx Frames with inv. MAC Opcode*/ + XM_RXE_BURST = 0x0328, /* 32 bit r/o Rx Burst Event Counter */ + XM_RXE_FMISS = 0x032c, /* 32 bit r/o Rx Missed Frames Event Cnt */ + XM_RXF_FRA_ERR = 0x0330, /* 32 bit r/o Rx Framing Error Counter */ + XM_RXE_FIFO_OV = 0x0334, /* 32 bit r/o Rx FIFO overflow Event Cnt */ + XM_RXF_JAB_PKT = 0x0338, /* 32 bit r/o Rx Jabber Packet Frame Cnt */ + XM_RXE_CAR_ERR = 0x033c, /* 32 bit r/o Rx Carrier Event Error Cnt */ + XM_RXF_LEN_ERR = 0x0340, /* 32 bit r/o Rx in Range Length Error */ + XM_RXE_SYM_ERR = 0x0344, /* 32 bit r/o Rx Symbol Error Counter */ + XM_RXE_SHT_ERR = 0x0348, /* 32 bit r/o Rx Short Event Error Cnt */ + XM_RXE_RUNT = 0x034c, /* 32 bit r/o Rx Runt Event Counter */ + XM_RXF_LNG_ERR = 0x0350, /* 32 bit r/o Rx Frame too Long Error Cnt */ + XM_RXF_FCS_ERR = 0x0354, /* 32 bit r/o Rx Frame Check Seq. Error Cnt */ + XM_RXF_CEX_ERR = 0x035c, /* 32 bit r/o Rx Carrier Ext Error Frame Cnt*/ + XM_RXP_UTIL = 0x0360, /* 32 bit r/o Rx Utilization in % */ + XM_RXF_64B = 0x0368, /* 32 bit r/o 64 Byte Rx Frame Counter */ + XM_RXF_127B = 0x036c, /* 32 bit r/o 65-127 Byte Rx Frame Counter */ + XM_RXF_255B = 0x0370, /* 32 bit r/o 128-255 Byte Rx Frame Counter */ + XM_RXF_511B = 0x0374, /* 32 bit r/o 256-511 Byte Rx Frame Counter */ + XM_RXF_1023B = 0x0378, /* 32 bit r/o 512-1023 Byte Rx Frame Counter*/ + XM_RXF_MAX_SZ = 0x037c, /* 32 bit r/o 1024-MaxSize Byte Rx Frame Cnt*/ +}; + +/* XM_MMU_CMD 16 bit r/w MMU Command Register */ +enum { + XM_MMU_PHY_RDY = 1<<12,/* Bit 12: PHY Read Ready */ + XM_MMU_PHY_BUSY = 1<<11,/* Bit 11: PHY Busy */ + XM_MMU_IGN_PF = 1<<10,/* Bit 10: Ignore Pause Frame */ + XM_MMU_MAC_LB = 1<<9, /* Bit 9: Enable MAC Loopback */ + XM_MMU_FRC_COL = 1<<7, /* Bit 7: Force Collision */ + XM_MMU_SIM_COL = 1<<6, /* Bit 6: Simulate Collision */ + XM_MMU_NO_PRE = 1<<5, /* Bit 5: No MDIO Preamble */ + XM_MMU_GMII_FD = 1<<4, /* Bit 4: GMII uses Full Duplex */ + XM_MMU_RAT_CTRL = 1<<3, /* Bit 3: Enable Rate Control */ + XM_MMU_GMII_LOOP= 1<<2, /* Bit 2: PHY is in Loopback Mode */ + XM_MMU_ENA_RX = 1<<1, /* Bit 1: Enable Receiver */ + XM_MMU_ENA_TX = 1<<0, /* Bit 0: Enable Transmitter */ +}; + + +/* XM_TX_CMD 16 bit r/w Transmit Command Register */ +enum { + XM_TX_BK2BK = 1<<6, /* Bit 6: Ignor Carrier Sense (Tx Bk2Bk)*/ + XM_TX_ENC_BYP = 1<<5, /* Bit 5: Set Encoder in Bypass Mode */ + XM_TX_SAM_LINE = 1<<4, /* Bit 4: (sc) Start utilization calculation */ + XM_TX_NO_GIG_MD = 1<<3, /* Bit 3: Disable Carrier Extension */ + XM_TX_NO_PRE = 1<<2, /* Bit 2: Disable Preamble Generation */ + XM_TX_NO_CRC = 1<<1, /* Bit 1: Disable CRC Generation */ + XM_TX_AUTO_PAD = 1<<0, /* Bit 0: Enable Automatic Padding */ +}; + +/* XM_TX_RT_LIM 16 bit r/w Transmit Retry Limit Register */ +#define XM_RT_LIM_MSK 0x1f /* Bit 4..0: Tx Retry Limit */ + + +/* XM_TX_STIME 16 bit r/w Transmit Slottime Register */ +#define XM_STIME_MSK 0x7f /* Bit 6..0: Tx Slottime bits */ + + +/* XM_TX_IPG 16 bit r/w Transmit Inter Packet Gap */ +#define XM_IPG_MSK 0xff /* Bit 7..0: IPG value bits */ + + +/* XM_RX_CMD 16 bit r/w Receive Command Register */ +enum { + XM_RX_LENERR_OK = 1<<8, /* Bit 8 don't set Rx Err bit for */ + /* inrange error packets */ + XM_RX_BIG_PK_OK = 1<<7, /* Bit 7 don't set Rx Err bit for */ + /* jumbo packets */ + XM_RX_IPG_CAP = 1<<6, /* Bit 6 repl. type field with IPG */ + XM_RX_TP_MD = 1<<5, /* Bit 5: Enable transparent Mode */ + XM_RX_STRIP_FCS = 1<<4, /* Bit 4: Enable FCS Stripping */ + XM_RX_SELF_RX = 1<<3, /* Bit 3: Enable Rx of own packets */ + XM_RX_SAM_LINE = 1<<2, /* Bit 2: (sc) Start utilization calculation */ + XM_RX_STRIP_PAD = 1<<1, /* Bit 1: Strip pad bytes of Rx frames */ + XM_RX_DIS_CEXT = 1<<0, /* Bit 0: Disable carrier ext. check */ +}; + + +/* XM_PHY_ADDR 16 bit r/w PHY Address Register */ +#define XM_PHY_ADDR_SZ 0x1f /* Bit 4..0: PHY Address bits */ + + +/* XM_GP_PORT 32 bit r/w General Purpose Port Register */ +enum { + XM_GP_ANIP = 1<<6, /* Bit 6: (ro) Auto-Neg. in progress */ + XM_GP_FRC_INT = 1<<5, /* Bit 5: (sc) Force Interrupt */ + XM_GP_RES_MAC = 1<<3, /* Bit 3: (sc) Reset MAC and FIFOs */ + XM_GP_RES_STAT = 1<<2, /* Bit 2: (sc) Reset the statistics module */ + XM_GP_INP_ASS = 1<<0, /* Bit 0: (ro) GP Input Pin asserted */ +}; + + +/* XM_IMSK 16 bit r/w Interrupt Mask Register */ +/* XM_ISRC 16 bit r/o Interrupt Status Register */ +enum { + XM_IS_LNK_AE = 1<<14, /* Bit 14: Link Asynchronous Event */ + XM_IS_TX_ABORT = 1<<13, /* Bit 13: Transmit Abort, late Col. etc */ + XM_IS_FRC_INT = 1<<12, /* Bit 12: Force INT bit set in GP */ + XM_IS_INP_ASS = 1<<11, /* Bit 11: Input Asserted, GP bit 0 set */ + XM_IS_LIPA_RC = 1<<10, /* Bit 10: Link Partner requests config */ + XM_IS_RX_PAGE = 1<<9, /* Bit 9: Page Received */ + XM_IS_TX_PAGE = 1<<8, /* Bit 8: Next Page Loaded for Transmit */ + XM_IS_AND = 1<<7, /* Bit 7: Auto-Negotiation Done */ + XM_IS_TSC_OV = 1<<6, /* Bit 6: Time Stamp Counter Overflow */ + XM_IS_RXC_OV = 1<<5, /* Bit 5: Rx Counter Event Overflow */ + XM_IS_TXC_OV = 1<<4, /* Bit 4: Tx Counter Event Overflow */ + XM_IS_RXF_OV = 1<<3, /* Bit 3: Receive FIFO Overflow */ + XM_IS_TXF_UR = 1<<2, /* Bit 2: Transmit FIFO Underrun */ + XM_IS_TX_COMP = 1<<1, /* Bit 1: Frame Tx Complete */ + XM_IS_RX_COMP = 1<<0, /* Bit 0: Frame Rx Complete */ +}; + +#define XM_DEF_MSK (~(XM_IS_INP_ASS | XM_IS_LIPA_RC | XM_IS_RX_PAGE | \ + XM_IS_AND | XM_IS_RXC_OV | XM_IS_TXC_OV | \ + XM_IS_RXF_OV | XM_IS_TXF_UR)) + + +/* XM_HW_CFG 16 bit r/w Hardware Config Register */ +enum { + XM_HW_GEN_EOP = 1<<3, /* Bit 3: generate End of Packet pulse */ + XM_HW_COM4SIG = 1<<2, /* Bit 2: use Comma Detect for Sig. Det.*/ + XM_HW_GMII_MD = 1<<0, /* Bit 0: GMII Interface selected */ +}; + + +/* XM_TX_LO_WM 16 bit r/w Tx FIFO Low Water Mark */ +/* XM_TX_HI_WM 16 bit r/w Tx FIFO High Water Mark */ +#define XM_TX_WM_MSK 0x01ff /* Bit 9.. 0 Tx FIFO Watermark bits */ + +/* XM_TX_THR 16 bit r/w Tx Request Threshold */ +/* XM_HT_THR 16 bit r/w Host Request Threshold */ +/* XM_RX_THR 16 bit r/w Rx Request Threshold */ +#define XM_THR_MSK 0x03ff /* Bit 10.. 0 Rx/Tx Request Threshold bits */ + + +/* XM_TX_STAT 32 bit r/o Tx Status LIFO Register */ +enum { + XM_ST_VALID = (1UL<<31), /* Bit 31: Status Valid */ + XM_ST_BYTE_CNT = (0x3fffL<<17), /* Bit 30..17: Tx frame Length */ + XM_ST_RETRY_CNT = (0x1fL<<12), /* Bit 16..12: Retry Count */ + XM_ST_EX_COL = 1<<11, /* Bit 11: Excessive Collisions */ + XM_ST_EX_DEF = 1<<10, /* Bit 10: Excessive Deferral */ + XM_ST_BURST = 1<<9, /* Bit 9: p. xmitted in burst md*/ + XM_ST_DEFER = 1<<8, /* Bit 8: packet was defered */ + XM_ST_BC = 1<<7, /* Bit 7: Broadcast packet */ + XM_ST_MC = 1<<6, /* Bit 6: Multicast packet */ + XM_ST_UC = 1<<5, /* Bit 5: Unicast packet */ + XM_ST_TX_UR = 1<<4, /* Bit 4: FIFO Underrun occured */ + XM_ST_CS_ERR = 1<<3, /* Bit 3: Carrier Sense Error */ + XM_ST_LAT_COL = 1<<2, /* Bit 2: Late Collision Error */ + XM_ST_MUL_COL = 1<<1, /* Bit 1: Multiple Collisions */ + XM_ST_SGN_COL = 1<<0, /* Bit 0: Single Collision */ +}; + +/* XM_RX_LO_WM 16 bit r/w Receive Low Water Mark */ +/* XM_RX_HI_WM 16 bit r/w Receive High Water Mark */ +#define XM_RX_WM_MSK 0x03ff /* Bit 11.. 0: Rx FIFO Watermark bits */ + + +/* XM_DEV_ID 32 bit r/o Device ID Register */ +#define XM_DEV_OUI (0x00ffffffUL<<8) /* Bit 31..8: Device OUI */ +#define XM_DEV_REV (0x07L << 5) /* Bit 7..5: Chip Rev Num */ + + +/* XM_MODE 32 bit r/w Mode Register */ +enum { + XM_MD_ENA_REJ = 1<<26, /* Bit 26: Enable Frame Reject */ + XM_MD_SPOE_E = 1<<25, /* Bit 25: Send Pause on Edge */ + /* extern generated */ + XM_MD_TX_REP = 1<<24, /* Bit 24: Transmit Repeater Mode */ + XM_MD_SPOFF_I = 1<<23, /* Bit 23: Send Pause on FIFO full */ + /* intern generated */ + XM_MD_LE_STW = 1<<22, /* Bit 22: Rx Stat Word in Little Endian */ + XM_MD_TX_CONT = 1<<21, /* Bit 21: Send Continuous */ + XM_MD_TX_PAUSE = 1<<20, /* Bit 20: (sc) Send Pause Frame */ + XM_MD_ATS = 1<<19, /* Bit 19: Append Time Stamp */ + XM_MD_SPOL_I = 1<<18, /* Bit 18: Send Pause on Low */ + /* intern generated */ + XM_MD_SPOH_I = 1<<17, /* Bit 17: Send Pause on High */ + /* intern generated */ + XM_MD_CAP = 1<<16, /* Bit 16: Check Address Pair */ + XM_MD_ENA_HASH = 1<<15, /* Bit 15: Enable Hashing */ + XM_MD_CSA = 1<<14, /* Bit 14: Check Station Address */ + XM_MD_CAA = 1<<13, /* Bit 13: Check Address Array */ + XM_MD_RX_MCTRL = 1<<12, /* Bit 12: Rx MAC Control Frame */ + XM_MD_RX_RUNT = 1<<11, /* Bit 11: Rx Runt Frames */ + XM_MD_RX_IRLE = 1<<10, /* Bit 10: Rx in Range Len Err Frame */ + XM_MD_RX_LONG = 1<<9, /* Bit 9: Rx Long Frame */ + XM_MD_RX_CRCE = 1<<8, /* Bit 8: Rx CRC Error Frame */ + XM_MD_RX_ERR = 1<<7, /* Bit 7: Rx Error Frame */ + XM_MD_DIS_UC = 1<<6, /* Bit 6: Disable Rx Unicast */ + XM_MD_DIS_MC = 1<<5, /* Bit 5: Disable Rx Multicast */ + XM_MD_DIS_BC = 1<<4, /* Bit 4: Disable Rx Broadcast */ + XM_MD_ENA_PROM = 1<<3, /* Bit 3: Enable Promiscuous */ + XM_MD_ENA_BE = 1<<2, /* Bit 2: Enable Big Endian */ + XM_MD_FTF = 1<<1, /* Bit 1: (sc) Flush Tx FIFO */ + XM_MD_FRF = 1<<0, /* Bit 0: (sc) Flush Rx FIFO */ +}; + +#define XM_PAUSE_MODE (XM_MD_SPOE_E | XM_MD_SPOL_I | XM_MD_SPOH_I) +#define XM_DEF_MODE (XM_MD_RX_RUNT | XM_MD_RX_IRLE | XM_MD_RX_LONG |\ + XM_MD_RX_CRCE | XM_MD_RX_ERR | XM_MD_CSA | XM_MD_CAA) + +/* XM_STAT_CMD 16 bit r/w Statistics Command Register */ +enum { + XM_SC_SNP_RXC = 1<<5, /* Bit 5: (sc) Snap Rx Counters */ + XM_SC_SNP_TXC = 1<<4, /* Bit 4: (sc) Snap Tx Counters */ + XM_SC_CP_RXC = 1<<3, /* Bit 3: Copy Rx Counters Continuously */ + XM_SC_CP_TXC = 1<<2, /* Bit 2: Copy Tx Counters Continuously */ + XM_SC_CLR_RXC = 1<<1, /* Bit 1: (sc) Clear Rx Counters */ + XM_SC_CLR_TXC = 1<<0, /* Bit 0: (sc) Clear Tx Counters */ +}; + + +/* XM_RX_CNT_EV 32 bit r/o Rx Counter Event Register */ +/* XM_RX_EV_MSK 32 bit r/w Rx Counter Event Mask */ +enum { + XMR_MAX_SZ_OV = 1<<31, /* Bit 31: 1024-MaxSize Rx Cnt Ov*/ + XMR_1023B_OV = 1<<30, /* Bit 30: 512-1023Byte Rx Cnt Ov*/ + XMR_511B_OV = 1<<29, /* Bit 29: 256-511 Byte Rx Cnt Ov*/ + XMR_255B_OV = 1<<28, /* Bit 28: 128-255 Byte Rx Cnt Ov*/ + XMR_127B_OV = 1<<27, /* Bit 27: 65-127 Byte Rx Cnt Ov */ + XMR_64B_OV = 1<<26, /* Bit 26: 64 Byte Rx Cnt Ov */ + XMR_UTIL_OV = 1<<25, /* Bit 25: Rx Util Cnt Overflow */ + XMR_UTIL_UR = 1<<24, /* Bit 24: Rx Util Cnt Underrun */ + XMR_CEX_ERR_OV = 1<<23, /* Bit 23: CEXT Err Cnt Ov */ + XMR_FCS_ERR_OV = 1<<21, /* Bit 21: Rx FCS Error Cnt Ov */ + XMR_LNG_ERR_OV = 1<<20, /* Bit 20: Rx too Long Err Cnt Ov*/ + XMR_RUNT_OV = 1<<19, /* Bit 19: Runt Event Cnt Ov */ + XMR_SHT_ERR_OV = 1<<18, /* Bit 18: Rx Short Ev Err Cnt Ov*/ + XMR_SYM_ERR_OV = 1<<17, /* Bit 17: Rx Sym Err Cnt Ov */ + XMR_CAR_ERR_OV = 1<<15, /* Bit 15: Rx Carr Ev Err Cnt Ov */ + XMR_JAB_PKT_OV = 1<<14, /* Bit 14: Rx Jabb Packet Cnt Ov */ + XMR_FIFO_OV = 1<<13, /* Bit 13: Rx FIFO Ov Ev Cnt Ov */ + XMR_FRA_ERR_OV = 1<<12, /* Bit 12: Rx Framing Err Cnt Ov */ + XMR_FMISS_OV = 1<<11, /* Bit 11: Rx Missed Ev Cnt Ov */ + XMR_BURST = 1<<10, /* Bit 10: Rx Burst Event Cnt Ov */ + XMR_INV_MOC = 1<<9, /* Bit 9: Rx with inv. MAC OC Ov*/ + XMR_INV_MP = 1<<8, /* Bit 8: Rx inv Pause Frame Ov */ + XMR_MCTRL_OV = 1<<7, /* Bit 7: Rx MAC Ctrl-F Cnt Ov */ + XMR_MPAUSE_OV = 1<<6, /* Bit 6: Rx Pause MAC Ctrl-F Ov*/ + XMR_UC_OK_OV = 1<<5, /* Bit 5: Rx Unicast Frame CntOv*/ + XMR_MC_OK_OV = 1<<4, /* Bit 4: Rx Multicast Cnt Ov */ + XMR_BC_OK_OV = 1<<3, /* Bit 3: Rx Broadcast Cnt Ov */ + XMR_OK_LO_OV = 1<<2, /* Bit 2: Octets Rx OK Low CntOv*/ + XMR_OK_HI_OV = 1<<1, /* Bit 1: Octets Rx OK Hi Cnt Ov*/ + XMR_OK_OV = 1<<0, /* Bit 0: Frames Received Ok Ov */ +}; + +#define XMR_DEF_MSK (XMR_OK_LO_OV | XMR_OK_HI_OV) + +/* XM_TX_CNT_EV 32 bit r/o Tx Counter Event Register */ +/* XM_TX_EV_MSK 32 bit r/w Tx Counter Event Mask */ +enum { + XMT_MAX_SZ_OV = 1<<25, /* Bit 25: 1024-MaxSize Tx Cnt Ov*/ + XMT_1023B_OV = 1<<24, /* Bit 24: 512-1023Byte Tx Cnt Ov*/ + XMT_511B_OV = 1<<23, /* Bit 23: 256-511 Byte Tx Cnt Ov*/ + XMT_255B_OV = 1<<22, /* Bit 22: 128-255 Byte Tx Cnt Ov*/ + XMT_127B_OV = 1<<21, /* Bit 21: 65-127 Byte Tx Cnt Ov */ + XMT_64B_OV = 1<<20, /* Bit 20: 64 Byte Tx Cnt Ov */ + XMT_UTIL_OV = 1<<19, /* Bit 19: Tx Util Cnt Overflow */ + XMT_UTIL_UR = 1<<18, /* Bit 18: Tx Util Cnt Underrun */ + XMT_CS_ERR_OV = 1<<17, /* Bit 17: Tx Carr Sen Err Cnt Ov*/ + XMT_FIFO_UR_OV = 1<<16, /* Bit 16: Tx FIFO Ur Ev Cnt Ov */ + XMT_EX_DEF_OV = 1<<15, /* Bit 15: Tx Ex Deferall Cnt Ov */ + XMT_DEF = 1<<14, /* Bit 14: Tx Deferred Cnt Ov */ + XMT_LAT_COL_OV = 1<<13, /* Bit 13: Tx Late Col Cnt Ov */ + XMT_ABO_COL_OV = 1<<12, /* Bit 12: Tx abo dueto Ex Col Ov*/ + XMT_MUL_COL_OV = 1<<11, /* Bit 11: Tx Mult Col Cnt Ov */ + XMT_SNG_COL = 1<<10, /* Bit 10: Tx Single Col Cnt Ov */ + XMT_MCTRL_OV = 1<<9, /* Bit 9: Tx MAC Ctrl Counter Ov*/ + XMT_MPAUSE = 1<<8, /* Bit 8: Tx Pause MAC Ctrl-F Ov*/ + XMT_BURST = 1<<7, /* Bit 7: Tx Burst Event Cnt Ov */ + XMT_LONG = 1<<6, /* Bit 6: Tx Long Frame Cnt Ov */ + XMT_UC_OK_OV = 1<<5, /* Bit 5: Tx Unicast Cnt Ov */ + XMT_MC_OK_OV = 1<<4, /* Bit 4: Tx Multicast Cnt Ov */ + XMT_BC_OK_OV = 1<<3, /* Bit 3: Tx Broadcast Cnt Ov */ + XMT_OK_LO_OV = 1<<2, /* Bit 2: Octets Tx OK Low CntOv*/ + XMT_OK_HI_OV = 1<<1, /* Bit 1: Octets Tx OK Hi Cnt Ov*/ + XMT_OK_OV = 1<<0, /* Bit 0: Frames Tx Ok Ov */ +}; + +#define XMT_DEF_MSK (XMT_OK_LO_OV | XMT_OK_HI_OV) + +struct skge_rx_desc { + u32 control; + u32 next_offset; + u32 dma_lo; + u32 dma_hi; + u32 status; + u32 timestamp; + u16 csum2; + u16 csum1; + u16 csum2_start; + u16 csum1_start; +}; + +struct skge_tx_desc { + u32 control; + u32 next_offset; + u32 dma_lo; + u32 dma_hi; + u32 status; + u32 csum_offs; + u16 csum_write; + u16 csum_start; + u32 rsvd; +}; + +struct skge_element { + struct skge_element *next; + void *desc; + struct sk_buff *skb; + DECLARE_PCI_UNMAP_ADDR(mapaddr); + DECLARE_PCI_UNMAP_LEN(maplen); +}; + +struct skge_ring { + struct skge_element *to_clean; + struct skge_element *to_use; + struct skge_element *start; + unsigned long count; +}; + + +struct skge_hw { + void __iomem *regs; + struct pci_dev *pdev; + u32 intr_mask; + struct net_device *dev[2]; + + spinlock_t phy_lock; + struct tasklet_struct ext_tasklet; + + u8 chip_id; + u8 mac_cfg; + u8 phy_type; + u8 pmd_type; + u16 phy_addr; + + u32 rom_size; + u32 ram_size; + u32 ram_offset; + +}; + +static inline int isdualport(const struct skge_hw *hw) +{ + return !(hw->mac_cfg & CFG_SNG_MAC); +} + +static inline u8 chip_rev(const struct skge_hw *hw) +{ + return (hw->mac_cfg & CFG_CHIP_R_MSK) >> 4; +} + +static inline int iscopper(const struct skge_hw *hw) +{ + return (hw->pmd_type == 'T'); +} + +enum { + FLOW_MODE_NONE = 0, /* No Flow-Control */ + FLOW_MODE_LOC_SEND = 1, /* Local station sends PAUSE */ + FLOW_MODE_REM_SEND = 2, /* Symmetric or just remote */ + FLOW_MODE_SYMMETRIC = 3, /* Both stations may send PAUSE */ +}; + +struct skge_port { + struct skge_hw *hw; + struct net_device *netdev; + spinlock_t tx_lock; + u32 tx_avail; + struct skge_ring tx_ring; + struct skge_ring rx_ring; + + struct net_device_stats net_stats; + struct timer_list link_check; + struct timer_list led_blink; + + u32 msg_enable; + u8 port; + u8 rx_csum; + u8 blink_on; + u8 flow_control; + + void *mem; /* PCI memory for rings */ + dma_addr_t dma; + unsigned long mem_size; + + u8 autoneg; /* AUTONEG_ENABLE, AUTONEG_DISABLE */ + u8 duplex; /* DUPLEX_HALF, DUPLEX_FULL */ + u16 speed; /* SPEED_1000, SPEED_100, ... */ + u32 advertising; +}; + + +/* Register accessor for memory mapped device */ +static inline u32 skge_read32(const struct skge_hw *hw, int reg) +{ + return readl(hw->regs + reg); + +} + +static inline u16 skge_read16(const struct skge_hw *hw, int reg) +{ + return readw(hw->regs + reg); +} + +static inline u8 skge_read8(const struct skge_hw *hw, int reg) +{ + return readb(hw->regs + reg); +} + +static inline void skge_write32(const struct skge_hw *hw, int reg, u32 val) +{ + writel(val, hw->regs + reg); +} + +static inline void skge_write16(const struct skge_hw *hw, int reg, u16 val) +{ + writew(val, hw->regs + reg); +} + +static inline void skge_write8(const struct skge_hw *hw, int reg, u8 val) +{ + writeb(val, hw->regs + reg); +} + +/* MAC Related Registers inside the device. */ +#define SKGEMAC_REG(port,reg) (((port)<<7)+(reg)) + +/* PCI config space can be accessed via memory mapped space */ +#define SKGEPCI_REG(reg) ((reg)+ 0x380) + +#define SKGEXM_REG(port, reg) \ + ((BASE_XMAC_1 + (port) * (BASE_XMAC_2 - BASE_XMAC_1)) | (reg) << 1) + +static inline u32 skge_xm_read32(const struct skge_hw *hw, int port, int reg) +{ + return skge_read32(hw, SKGEXM_REG(port,reg)); +} + +static inline u16 skge_xm_read16(const struct skge_hw *hw, int port, int reg) +{ + return skge_read16(hw, SKGEXM_REG(port,reg)); +} + +static inline u8 skge_xm_read8(const struct skge_hw *hw, int port, int reg) +{ + return skge_read8(hw, SKGEXM_REG(port,reg)); +} + +static inline void skge_xm_write32(const struct skge_hw *hw, int port, int r, u32 v) +{ + skge_write32(hw, SKGEXM_REG(port,r), v); +} + +static inline void skge_xm_write16(const struct skge_hw *hw, int port, int r, u16 v) +{ + skge_write16(hw, SKGEXM_REG(port,r), v); +} + +static inline void skge_xm_write8(const struct skge_hw *hw, int port, int r, u8 v) +{ + skge_write8(hw, SKGEXM_REG(port,r), v); +} + +static inline void skge_xm_outhash(const struct skge_hw *hw, int port, int reg, + const u8 *hash) +{ + skge_xm_write16(hw, port, reg, + (u16)hash[0] | ((u16)hash[1] << 8)); + skge_xm_write16(hw, port, reg+2, + (u16)hash[2] | ((u16)hash[3] << 8)); + skge_xm_write16(hw, port, reg+4, + (u16)hash[4] | ((u16)hash[5] << 8)); + skge_xm_write16(hw, port, reg+6, + (u16)hash[6] | ((u16)hash[7] << 8)); +} + +static inline void skge_xm_outaddr(const struct skge_hw *hw, int port, int reg, + const u8 *addr) +{ + skge_xm_write16(hw, port, reg, + (u16)addr[0] | ((u16)addr[1] << 8)); + skge_xm_write16(hw, port, reg, + (u16)addr[2] | ((u16)addr[3] << 8)); + skge_xm_write16(hw, port, reg, + (u16)addr[4] | ((u16)addr[5] << 8)); +} + + +#define SKGEGMA_REG(port,reg) \ + ((reg) + BASE_GMAC_1 + \ + (port) * (BASE_GMAC_2-BASE_GMAC_1)) + +static inline u16 skge_gma_read16(const struct skge_hw *hw, int port, int reg) +{ + return skge_read16(hw, SKGEGMA_REG(port,reg)); +} + +static inline u32 skge_gma_read32(const struct skge_hw *hw, int port, int reg) +{ + return (u32) skge_read16(hw, SKGEGMA_REG(port,reg)) + | ((u32)skge_read16(hw, SKGEGMA_REG(port,reg+4)) << 16); +} + +static inline u8 skge_gma_read8(const struct skge_hw *hw, int port, int reg) +{ + return skge_read8(hw, SKGEGMA_REG(port,reg)); +} + +static inline void skge_gma_write16(const struct skge_hw *hw, int port, int r, u16 v) +{ + skge_write16(hw, SKGEGMA_REG(port,r), v); +} + +static inline void skge_gma_write32(const struct skge_hw *hw, int port, int r, u32 v) +{ + skge_write16(hw, SKGEGMA_REG(port, r), (u16) v); + skge_write32(hw, SKGEGMA_REG(port, r+4), (u16)(v >> 16)); +} + +static inline void skge_gma_write8(const struct skge_hw *hw, int port, int r, u8 v) +{ + skge_write8(hw, SKGEGMA_REG(port,r), v); +} + +static inline void skge_gm_set_addr(struct skge_hw *hw, int port, int reg, + const u8 *addr) +{ + skge_gma_write16(hw, port, reg, + (u16) addr[0] | ((u16) addr[1] << 8)); + skge_gma_write16(hw, port, reg+4, + (u16) addr[2] | ((u16) addr[3] << 8)); + skge_gma_write16(hw, port, reg+8, + (u16) addr[4] | ((u16) addr[5] << 8)); +} + +#endif From davem@davemloft.net Fri Jan 21 15:23:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 15:23:12 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LNN7YK027379 for ; Fri, 21 Jan 2005 15:23:07 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cs857-0008R6-00; Fri, 21 Jan 2005 15:20:45 -0800 Date: Fri, 21 Jan 2005 15:20:45 -0800 From: "David S. Miller" To: David Dillow Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org, dave@thedillows.org Subject: Re: [RFC 2.6.10 5/22] xfrm: Attempt to offload bundled xfrm_states for outbound xfrms Message-Id: <20050121152045.5c92ee05.davem@davemloft.net> In-Reply-To: <20041230035000.14@ori.thedillows.org> References: <20041230035000.13@ori.thedillows.org> <20041230035000.14@ori.thedillows.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 629 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Thu, 30 Dec 2004 03:48:35 -0500 David Dillow wrote: > +static void xfrm_accel_bundle(struct dst_entry *dst) > +{ > + struct xfrm_bundle_list bundle, *xbl, *tmp; > + struct net_device *dev = dst->dev; > + INIT_LIST_HEAD(&bundle.node); > + > + if (dev && netif_running(dev) && (dev->features & NETIF_F_IPSEC)) { netif_running() is only steady while the RTNL semaphore is held, which is not necessarily true when xfrm_lookup() is invoked. From davem@davemloft.net Fri Jan 21 15:23:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 15:23:54 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LNNnai027544 for ; Fri, 21 Jan 2005 15:23:49 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cs85n-0008Ri-00; Fri, 21 Jan 2005 15:21:27 -0800 Date: Fri, 21 Jan 2005 15:21:27 -0800 From: "David S. Miller" To: David Dillow Cc: netdev@oss.sgi.com, dave@thedillows.org Subject: Re: [RFC 2.6.10 6/22] xfrm: add a parameter to xfrm_prune_bundles() Message-Id: <20050121152127.0a89a768.davem@davemloft.net> In-Reply-To: <20041230035000.15@ori.thedillows.org> References: <20041230035000.14@ori.thedillows.org> <20041230035000.15@ori.thedillows.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 630 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Thu, 30 Dec 2004 03:48:35 -0500 David Dillow wrote: > # This is a BitKeeper generated diff -Nru style patch. > # > # ChangeSet > # 2004/12/30 00:35:34-05:00 dave@thedillows.org > # Add a parameter to the decision function(s) used by > # xfrm_prune_bundles(). This will allow us to have more > # fine grained selection of bundles pruned (like, say, > # per device.) > # > # Signed-off-by: David Dillow This one looks OK. From davem@davemloft.net Fri Jan 21 15:26:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 15:26:24 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0LNQJq4028392 for ; Fri, 21 Jan 2005 15:26:20 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cs88E-0008Sr-00; Fri, 21 Jan 2005 15:23:58 -0800 Date: Fri, 21 Jan 2005 15:23:58 -0800 From: "David S. Miller" To: David Dillow Cc: netdev@oss.sgi.com, dave@thedillows.org Subject: Re: [RFC 2.6.10 7/22] xfrm: Allow device drivers to force recalculation of offloads Message-Id: <20050121152358.5c60d0db.davem@davemloft.net> In-Reply-To: <20041230035000.16@ori.thedillows.org> References: <20041230035000.15@ori.thedillows.org> <20041230035000.16@ori.thedillows.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 631 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Thu, 30 Dec 2004 03:48:35 -0500 David Dillow wrote: > # This is a BitKeeper generated diff -Nru style patch. > # > # ChangeSet > # 2004/12/30 00:37:44-05:00 dave@thedillows.org > # Give device drivers a method to allow the use of crypto > # offload features for existing xfrm_states and bundles, as > # well as dynamically remove crypto offload capabilities. > # > # Signed-off-by: David Dillow This change looks fine, but it reminds me of something. We have to make sure there is no way for xfrm_offloads to refer to a device when it is brought down. One way to ensure that, is to make each xfrm_offload attached grab a reference to the device it is for. The refcounting will help catch cases where stale xfrm_offload are around at unregister_netdev() time. From roland@topspin.com Fri Jan 21 19:17:10 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 19:17:15 -0800 (PST) Received: from umhlanga.STRATNET.NET (umhlanga.stratnet.net [12.162.17.40]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0M3H941003986 for ; Fri, 21 Jan 2005 19:17:10 -0800 Received: from exch-1.topspincom.com ([12.162.17.3]) by umhlanga.STRATNET.NET with Microsoft SMTPSVC(5.0.2195.5329); Fri, 21 Jan 2005 19:17:08 -0800 Received: from localhost.localdomain ([10.10.253.169]) by exch-1.topspincom.com with Microsoft SMTPSVC(5.0.2195.5329); Fri, 21 Jan 2005 19:17:08 -0800 Received: by localhost.localdomain (Postfix, from userid 1113) id 94AB92CFBB; Fri, 21 Jan 2005 19:17:07 -0800 (PST) To: "David S. Miller" Cc: Grant Grundler , tommy.christensen@tpack.net, shemminger@osdl.org, hadi@cyberus.ca, eric.lemoine@gmail.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [PATCH]: was Re: LLTX and netif_stop_queue X-Message-Flag: Warning: May contain useful information References: <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119164640.6c67bdfa.davem@davemloft.net> <52r7kgu5n5.fsf@topspin.com> <20050119230526.393a5184.davem@davemloft.net> <1106229084.5812.40.camel@tsc-6.cph.tpack.net> <20050120133420.317bea31.davem@davemloft.net> <20050120215650.GB14521@esmail.cup.hp.com> <20050120170113.36ee8225.davem@davemloft.net> From: Roland Dreier Date: Fri, 21 Jan 2005 19:17:07 -0800 In-Reply-To: <20050120170113.36ee8225.davem@davemloft.net> (David S. Miller's message of "Thu, 20 Jan 2005 17:01:13 -0800") Message-ID: <52is5qp2z0.fsf@topspin.com> User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Corporate Culture, linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-OriginalArrivalTime: 22 Jan 2005 03:17:08.0300 (UTC) FILETIME=[DB0698C0:01C50030] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 632 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: roland@topspin.com Precedence: bulk X-list: netdev So what's the plan here with LLTX? As far as I can tell, 2.6.11-rc2 went out with the changes that disable IRQs in hard_start_xmit... - R. From davem@davemloft.net Fri Jan 21 19:56:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 19:56:36 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0M3uVBk005417 for ; Fri, 21 Jan 2005 19:56:31 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CsCLU-0000sG-00; Fri, 21 Jan 2005 19:53:56 -0800 Date: Fri, 21 Jan 2005 19:53:56 -0800 From: "David S. Miller" To: Roland Dreier Cc: iod00d@hp.com, tommy.christensen@tpack.net, shemminger@osdl.org, hadi@cyberus.ca, eric.lemoine@gmail.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [PATCH]: was Re: LLTX and netif_stop_queue Message-Id: <20050121195356.51cf3ade.davem@davemloft.net> In-Reply-To: <52is5qp2z0.fsf@topspin.com> References: <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119164640.6c67bdfa.davem@davemloft.net> <52r7kgu5n5.fsf@topspin.com> <20050119230526.393a5184.davem@davemloft.net> <1106229084.5812.40.camel@tsc-6.cph.tpack.net> <20050120133420.317bea31.davem@davemloft.net> <20050120215650.GB14521@esmail.cup.hp.com> <20050120170113.36ee8225.davem@davemloft.net> <52is5qp2z0.fsf@topspin.com> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 633 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Fri, 21 Jan 2005 19:17:07 -0800 Roland Dreier wrote: > So what's the plan here with LLTX? As far as I can tell, 2.6.11-rc2 > went out with the changes that disable IRQs in hard_start_xmit... Linus just didn't pull the backout of that stuff in time. I'll repush it to him tonight. From davem@davemloft.net Fri Jan 21 20:46:45 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 20:46:49 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0M4kikb010482 for ; Fri, 21 Jan 2005 20:46:45 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CsD8E-00010p-00; Fri, 21 Jan 2005 20:44:18 -0800 Date: Fri, 21 Jan 2005 20:44:18 -0800 From: "David S. Miller" To: Rick Jones Cc: netdev@oss.sgi.com Subject: Re: on the wire behaviour of TSO on/off is supposed to be the same yes? Message-Id: <20050121204418.2070d76d.davem@davemloft.net> In-Reply-To: <41F18927.5020607@hp.com> References: <41F1516D.5010101@hp.com> <200501211358.53783.jdmason@us.ibm.com> <41F163AD.5070400@hp.com> <20050121124441.76cbbfb9.davem@davemloft.net> <41F17B7E.2020002@hp.com> <20050121141820.7d59a2d1.davem@davemloft.net> <41F186A8.9030805@hp.com> <41F18927.5020607@hp.com> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 634 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Fri, 21 Jan 2005 14:58:47 -0800 Rick Jones wrote: > Speaking of divisor values... is zero (0) supposed to be a legal value? The > sysctl seems to allow it but it does seem to behave a triffle strangely. The > initial TSO size appeared to be 2MSS. The value "0" behaves the same as "1". From davem@davemloft.net Fri Jan 21 20:52:14 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 20:52:19 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0M4qE4T011102 for ; Fri, 21 Jan 2005 20:52:14 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CsDDY-000128-00; Fri, 21 Jan 2005 20:49:48 -0800 Date: Fri, 21 Jan 2005 20:49:48 -0800 From: "David S. Miller" To: Rick Jones Cc: netdev@oss.sgi.com Subject: Re: on the wire behaviour of TSO on/off is supposed to be the same yes? Message-Id: <20050121204948.034b2510.davem@davemloft.net> In-Reply-To: <41F186A8.9030805@hp.com> References: <41F1516D.5010101@hp.com> <200501211358.53783.jdmason@us.ibm.com> <41F163AD.5070400@hp.com> <20050121124441.76cbbfb9.davem@davemloft.net> <41F17B7E.2020002@hp.com> <20050121141820.7d59a2d1.davem@davemloft.net> <41F186A8.9030805@hp.com> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 635 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev On Fri, 21 Jan 2005 14:48:08 -0800 Rick Jones wrote: > Indeed, it seems that one would want to decide about TSO when one is about to > transmit, not when the user does a send since otherwise, you penalize users > doing larger sends. Someone doing say a sendfile() of a large file would be > pretty much precluded from getting benefit from TSO the way things are now right? Not really, if the file is larger than the send buffer limit, we'll have a large enough cwnd once the later packets get built. The cwnd is sampled when we build packets onto the send queue. Each socket has a send buffer limit on that, so we only build until we reach that limit. At user sendmsg/sendfile time is when we do the segmentation and thus the packet sizing, because it is the most logical place to do this. The code can potentially get really messy and ugly if we start preemptively building larger frames "hoping" the cwnd will be large enough by the time we push it onto the wire. Segmenting at send time is completely upside down to the way packets are built currently for transmission. A bad guess also means that we'll spend significant cycles chopping up TSO packets and resegmenting the queue. From dave@thedillows.org Fri Jan 21 21:50:17 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 21:50:23 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0M5oGpI012507 for ; Fri, 21 Jan 2005 21:50:16 -0800 Received: (qmail 29564 invoked by uid 0); 22 Jan 2005 05:58:06 -0000 Received: from unknown (HELO ori.thedillows.org) (69.73.92.110) by smtp8.knology.net with SMTP; 22 Jan 2005 05:58:06 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0M5oNbB005944; Sat, 22 Jan 2005 00:50:23 -0500 Received: (from il1@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0M5oNXH005943; Sat, 22 Jan 2005 00:50:23 -0500 X-Authentication-Warning: ori.thedillows.org: il1 set sender to dave@thedillows.org using -f Subject: Re: [RFC 2.6.10 1/22] xfrm: Add direction information to xfrm_state From: David Dillow To: "David S. Miller" Cc: Netdev In-Reply-To: <20050121143857.69282605.davem@davemloft.net> References: <20041230035000.01@ori.thedillows.org> <20041230035000.10@ori.thedillows.org> <20050121143857.69282605.davem@davemloft.net> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Sat, 22 Jan 2005 00:50:22 -0500 Message-Id: <1106373022.3691.36.camel@ori.thedillows.org> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 636 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev On Fri, 2005-01-21 at 14:38 -0800, David S. Miller wrote: > On Thu, 30 Dec 2004 03:48:34 -0500 > David Dillow wrote: > > > # This is a BitKeeper generated diff -Nru style patch. > > # > > # ChangeSet > > # 2004/12/30 00:27:15-05:00 dave@thedillows.org > > # Add direction information to xfrm_state. This will be needed to > > # offload xfrm processing to the NIC. > > And xfrm_state, when actually used, does not exist in a vacuum. > It is being used in terms of a particular xfrm_policy which has > a direction indicator already. > > Given that, it seems the xfrm_state is not only unnecessary, but > also slightly illogical in fact. If you need the direction, you > should make sure that at those places you can get back to the > policy in order to obtain that piece of information. Hmm, I can see having netdev->xfrm_bundle_add() assume a outbound state, since it's only called for Tx. Rx offloading could be interesting, but it looks like I could hook into net/xfrm/xfrm_policy.c:__xfrm_policy_check(), and add the xfrm_states seen there to a work queue for offloading. netdev->xfrm_state_add() would then only see inbound states. Sound sane? -- David Dillow From dave@thedillows.org Fri Jan 21 21:52:05 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 21:52:10 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0M5q57g012851 for ; Fri, 21 Jan 2005 21:52:05 -0800 Received: (qmail 29734 invoked by uid 0); 22 Jan 2005 05:59:55 -0000 Received: from unknown (HELO ori.thedillows.org) (69.73.92.110) by smtp8.knology.net with SMTP; 22 Jan 2005 05:59:55 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0M5qEKo006021; Sat, 22 Jan 2005 00:52:14 -0500 Received: (from il1@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0M5qErj006020; Sat, 22 Jan 2005 00:52:14 -0500 X-Authentication-Warning: ori.thedillows.org: il1 set sender to dave@thedillows.org using -f Subject: Re: [RFC 2.6.10 4/22] xfrm: Try to offload inbound xfrm_states From: David Dillow To: "David S. Miller" Cc: Netdev In-Reply-To: <20050121145608.65ad2d48.davem@davemloft.net> References: <20041230035000.12@ori.thedillows.org> <20041230035000.13@ori.thedillows.org> <20050121145608.65ad2d48.davem@davemloft.net> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Sat, 22 Jan 2005 00:52:13 -0500 Message-Id: <1106373133.3691.40.camel@ori.thedillows.org> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 637 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev On Fri, 2005-01-21 at 14:56 -0800, David S. Miller wrote: > On Thu, 30 Dec 2004 03:48:35 -0500 > David Dillow wrote: > > > # This is a BitKeeper generated diff -Nru style patch. > > # > > # ChangeSet > > # 2004/12/30 00:33:11-05:00 dave@thedillows.org > > # Plumb in offloading of inbound xfrm_states. > > # > > # Signed-off-by: David Dillow > > Hmmm, this seems to deadlock. xfrm_state_add() is invoked > with the RTNL semaphore already acquired. For example, via > xfrm_user.c:xfrm_add_sa() Are you sure? It worked just fine during testing, and I don't see where in the call chain from xfrm_netlink_rcv() to xfrm_state_add() the RTNL sema is taken. Perhaps you were thinking of xfrm_cfg_sem? -- David Dillow From dave@thedillows.org Fri Jan 21 21:52:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 21:52:58 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0M5qqu4013374 for ; Fri, 21 Jan 2005 21:52:53 -0800 Received: (qmail 18735 invoked by uid 0); 22 Jan 2005 05:52:11 -0000 Received: from unknown (HELO ori.thedillows.org) (69.73.92.110) by smtp1.knology.net with SMTP; 22 Jan 2005 05:52:11 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0M5r1hx006030; Sat, 22 Jan 2005 00:53:01 -0500 Received: (from il1@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0M5r1lN006029; Sat, 22 Jan 2005 00:53:01 -0500 X-Authentication-Warning: ori.thedillows.org: il1 set sender to dave@thedillows.org using -f Subject: Re: [RFC 2.6.10 5/22] xfrm: Attempt to offload bundled xfrm_states for outbound xfrms From: David Dillow To: "David S. Miller" Cc: Netdev In-Reply-To: <20050121152045.5c92ee05.davem@davemloft.net> References: <20041230035000.13@ori.thedillows.org> <20041230035000.14@ori.thedillows.org> <20050121152045.5c92ee05.davem@davemloft.net> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Sat, 22 Jan 2005 00:53:01 -0500 Message-Id: <1106373181.3691.41.camel@ori.thedillows.org> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 638 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev On Fri, 2005-01-21 at 15:20 -0800, David S. Miller wrote: > On Thu, 30 Dec 2004 03:48:35 -0500 > David Dillow wrote: > > > +static void xfrm_accel_bundle(struct dst_entry *dst) > > +{ > > + struct xfrm_bundle_list bundle, *xbl, *tmp; > > + struct net_device *dev = dst->dev; > > + INIT_LIST_HEAD(&bundle.node); > > + > > + if (dev && netif_running(dev) && (dev->features & NETIF_F_IPSEC)) { > > netif_running() is only steady while the RTNL semaphore is held, > which is not necessarily true when xfrm_lookup() is invoked. I've been reworking this area already to add the ability for the user to control which devices/states combinations can be offloaded, so this code will change. What do you think about just having the driver be responsible for ignoring offload requests when they don't make sense, like when the device is down, or in sleep mode? BTW, xfrm_lookup() also calls stale_bundle(), which also relies on netif_running(), among other tests. -- David Dillow From dave@thedillows.org Fri Jan 21 21:53:30 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 21:53:35 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0M5rTqL013813 for ; Fri, 21 Jan 2005 21:53:29 -0800 Received: (qmail 9566 invoked by uid 0); 22 Jan 2005 05:51:18 -0000 Received: from unknown (HELO ori.thedillows.org) (69.73.92.110) by smtp5.knology.net with SMTP; 22 Jan 2005 05:51:18 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0M5raoJ006035; Sat, 22 Jan 2005 00:53:36 -0500 Received: (from il1@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0M5ra9P006034; Sat, 22 Jan 2005 00:53:36 -0500 X-Authentication-Warning: ori.thedillows.org: il1 set sender to dave@thedillows.org using -f Subject: Re: [RFC 2.6.10 7/22] xfrm: Allow device drivers to force recalculation of offloads From: David Dillow To: "David S. Miller" Cc: Netdev In-Reply-To: <20050121152358.5c60d0db.davem@davemloft.net> References: <20041230035000.15@ori.thedillows.org> <20041230035000.16@ori.thedillows.org> <20050121152358.5c60d0db.davem@davemloft.net> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Sat, 22 Jan 2005 00:53:36 -0500 Message-Id: <1106373216.3691.43.camel@ori.thedillows.org> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 639 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev On Fri, 2005-01-21 at 15:23 -0800, David S. Miller wrote: > On Thu, 30 Dec 2004 03:48:35 -0500 > David Dillow wrote: > > > # This is a BitKeeper generated diff -Nru style patch. > > # > > # ChangeSet > > # 2004/12/30 00:37:44-05:00 dave@thedillows.org > > # Give device drivers a method to allow the use of crypto > > # offload features for existing xfrm_states and bundles, as > > # well as dynamically remove crypto offload capabilities. > > # > > # Signed-off-by: David Dillow > > This change looks fine, but it reminds me of something. > > We have to make sure there is no way for xfrm_offloads to > refer to a device when it is brought down. > > One way to ensure that, is to make each xfrm_offload attached > grab a reference to the device it is for. The refcounting will > help catch cases where stale xfrm_offload are around at > unregister_netdev() time. You're right, it would be a problem, and I have the oopsen to prove it. :) In patch 3 of the series, xfrm_offload_add() grabs a reference to the device, and xfrm_offload_release() releases it when the offload's own reference count hits zero. -- David Dillow From dave@thedillows.org Fri Jan 21 21:58:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 21:58:30 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0M5wPbY014649 for ; Fri, 21 Jan 2005 21:58:25 -0800 Received: (qmail 4380 invoked by uid 0); 22 Jan 2005 05:58:47 -0000 Received: from unknown (HELO ori.thedillows.org) (69.73.92.110) by smtp2.knology.net with SMTP; 22 Jan 2005 05:58:47 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0M5wYD7006040; Sat, 22 Jan 2005 00:58:34 -0500 Received: (from il1@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0M5wXiZ006039; Sat, 22 Jan 2005 00:58:33 -0500 X-Authentication-Warning: ori.thedillows.org: il1 set sender to dave@thedillows.org using -f Subject: Re: [IPSEC] Stop using dst->xfrm From: David Dillow To: Herbert Xu Cc: "David S. Miller" , Netdev In-Reply-To: <20050121102319.GA3160@gondor.apana.org.au> References: <20050121102319.GA3160@gondor.apana.org.au> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Sat, 22 Jan 2005 00:58:33 -0500 Message-Id: <1106373513.3691.49.camel@ori.thedillows.org> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 640 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev On Fri, 2005-01-21 at 21:23 +1100, Herbert Xu wrote: > Here is a precursor to the xfrm dst consolidation that I talked about. > In order to be able to store multiple SAs in one dst, we need to stop > using dst->xfrm directly. Can you tell me more about this? A quick search of google and the netdev archives didn't turn up anything that looked relevant. I'd like to see where you're going, so I can meet you there. The xfrm offload patches currently add dst->xfrm_offload to cache the info needed to offload the crypto operations. It'll be slower, but I could lookup that up each time if need be. The part I'm most curious about is the storing of multiple SAs in one dst, since I think may cause the most changes for me. I'd like to start thinking about them early. -- David Dillow From dave@thedillows.org Fri Jan 21 22:00:27 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 21 Jan 2005 22:00:32 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0M60RSV015158 for ; Fri, 21 Jan 2005 22:00:27 -0800 Received: (qmail 2278 invoked by uid 0); 22 Jan 2005 06:00:48 -0000 Received: from unknown (HELO ori.thedillows.org) (69.73.92.110) by smtp6.knology.net with SMTP; 22 Jan 2005 06:00:48 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0M60Z9G006050; Sat, 22 Jan 2005 01:00:35 -0500 Received: (from il1@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0M60Z4d006049; Sat, 22 Jan 2005 01:00:35 -0500 X-Authentication-Warning: ori.thedillows.org: il1 set sender to dave@thedillows.org using -f Subject: Re: [RFC 2.6.10 3/22] xfrm: Add offload management routines From: David Dillow To: "David S. Miller" Cc: Netdev In-Reply-To: <20050121144738.7155893e.davem@davemloft.net> References: <20041230035000.11@ori.thedillows.org> <20041230035000.12@ori.thedillows.org> <20050121144738.7155893e.davem@davemloft.net> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Sat, 22 Jan 2005 01:00:35 -0500 Message-Id: <1106373635.3691.51.camel@ori.thedillows.org> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 641 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev [ Sorry, David, if you get this multiple times. Had a doh! moment... ] On Fri, 2005-01-21 at 14:47 -0800, David S. Miller wrote: > On Thu, 30 Dec 2004 03:48:35 -0500 > David Dillow wrote: > > > +static inline struct xfrm_offload * > > +xfrm_offload_alloc(int sizeof_priv, struct net_device *dev) > > This whole scheme looks buggy. The intent is to 8-byte align > the object, but look at what the code is actually doing. > > Whatever kmalloc() returns to xfrm_offload_alloc() is directly > used as the xfrm_offload pointer, and the members are initialized. > > Then xfrm_offload_priv() does the alignments. Right, I'm not worried about the alignment of the xfrm_offload, as I'm assuming that kmalloc will give us something suitable. However, I do want to make sure that the private section used by the driver is 8 byte aligned in the face of a potentially oddly sized xfrm_offload struct. Am I making a bad assumption that kmalloc() will give me a suitable alignment for the base struct? > It is clear that kmalloc() is always giving you 8-byte aligned > data else the first time xfrm_offload_priv() is used you'd > get a bogus pointer since xfrm_offload_alloc() initialized > the object without first aligning the pointer. The driver calls xfrm_offload_alloc(), then calls xfrm_offload_priv() to get it's private struct, and inits that. I just want to make sure the private struct is 8 byte aligned, which I assume (wrongly?) will be sufficient to prevent misaligned accesses. > We do something similar when we allocate netdevs, so have a look > at how net/core/dev.c:alloc_netdev() works. I copied part of that code to xfrm_offload_alloc(), removing the part that aligned the base xfrm_offload struct. 32 byte alignment seemed a bit much, do you think it is needed? I'll be happy to add that if you want. -- David Dillow From klassert@mathematik.tu-chemnitz.de Sat Jan 22 02:21:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Jan 2005 02:21:34 -0800 (PST) Received: from lana.hrz.tu-chemnitz.de (lana.hrz.tu-chemnitz.de [134.109.132.3]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0MALOKi025084 for ; Sat, 22 Jan 2005 02:21:24 -0800 Received: from bayes.mathematik.tu-chemnitz.de ([134.109.41.17] helo=box17.mathematik.tu-chemnitz.de) by lana.hrz.tu-chemnitz.de with esmtp (Exim 4.41) id 1CsIOP-00062r-33; Sat, 22 Jan 2005 11:21:21 +0100 Received: by box17.mathematik.tu-chemnitz.de (Postfix, from userid 274) id E83E5370B6; Sat, 22 Jan 2005 11:21:20 +0100 (CET) Date: Sat, 22 Jan 2005 11:21:20 +0100 From: Steffen Klassert To: Jeff Garzik Cc: Network Development Mailing List Subject: [PATCH] Use netdev_priv in the 3c515 driver Message-ID: <20050122102120.GA6476@bayes.mathematik.tu-chemnitz.de> Mail-Followup-To: Jeff Garzik , Network Development Mailing List Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Scan-Signature: f9c700c0e7d0de949eedfc795d41e9f3 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 642 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: klassert@mathematik.tu-chemnitz.de Precedence: bulk X-list: netdev Use netdev_priv in the 3c515 driver. Signed-off-by: Steffen Klassert --- vanilla-2.6.11-rc1/drivers/net/3c515.c Wed Jan 12 11:56:16 2005 +++ linux-2.6.11-rc1/drivers/net/3c515.c Wed Jan 19 21:08:20 2005 @@ -472,7 +472,7 @@ static void cleanup_card(struct net_device *dev) { - struct corkscrew_private *vp = (struct corkscrew_private *) dev->priv; + struct corkscrew_private *vp = netdev_priv(dev); list_del_init(&vp->list); if (dev->dma) free_dma(dev->dma); @@ -570,7 +570,7 @@ static void corkscrew_setup(struct net_device *dev, int ioaddr, struct pnp_dev *idev, int card_number) { - struct corkscrew_private *vp = (struct corkscrew_private *) dev->priv; + struct corkscrew_private *vp = netdev_priv(dev); unsigned int eeprom[0x40], checksum = 0; /* EEPROM contents */ int i; int irq; @@ -696,8 +696,7 @@ static int corkscrew_open(struct net_device *dev) { int ioaddr = dev->base_addr; - struct corkscrew_private *vp = - (struct corkscrew_private *) dev->priv; + struct corkscrew_private *vp = netdev_priv(dev); union wn3_config config; int i; @@ -862,7 +861,7 @@ { #ifdef AUTOMEDIA struct net_device *dev = (struct net_device *) data; - struct corkscrew_private *vp = (struct corkscrew_private *) dev->priv; + struct corkscrew_private *vp = netdev_priv(dev); int ioaddr = dev->base_addr; unsigned long flags; int ok = 0; @@ -954,8 +953,7 @@ static void corkscrew_timeout(struct net_device *dev) { int i; - struct corkscrew_private *vp = - (struct corkscrew_private *) dev->priv; + struct corkscrew_private *vp = netdev_priv(dev); int ioaddr = dev->base_addr; printk(KERN_WARNING @@ -994,8 +992,7 @@ static int corkscrew_start_xmit(struct sk_buff *skb, struct net_device *dev) { - struct corkscrew_private *vp = - (struct corkscrew_private *) dev->priv; + struct corkscrew_private *vp = netdev_priv(dev); int ioaddr = dev->base_addr; /* Block a timer-based transmit from overlapping. */ @@ -1123,14 +1120,13 @@ { /* Use the now-standard shared IRQ implementation. */ struct net_device *dev = dev_id; - struct corkscrew_private *lp; + struct corkscrew_private *lp = netdev_priv(dev); int ioaddr, status; int latency; int i = max_interrupt_work; ioaddr = dev->base_addr; latency = inb(ioaddr + Timer); - lp = (struct corkscrew_private *) dev->priv; spin_lock(&lp->lock); @@ -1262,7 +1258,7 @@ static int corkscrew_rx(struct net_device *dev) { - struct corkscrew_private *vp = (struct corkscrew_private *) dev->priv; + struct corkscrew_private *vp = netdev_priv(dev); int ioaddr = dev->base_addr; int i; short rx_status; @@ -1329,8 +1325,7 @@ static int boomerang_rx(struct net_device *dev) { - struct corkscrew_private *vp = - (struct corkscrew_private *) dev->priv; + struct corkscrew_private *vp = netdev_priv(dev); int entry = vp->cur_rx % RX_RING_SIZE; int ioaddr = dev->base_addr; int rx_status; @@ -1420,8 +1415,7 @@ static int corkscrew_close(struct net_device *dev) { - struct corkscrew_private *vp = - (struct corkscrew_private *) dev->priv; + struct corkscrew_private *vp = netdev_priv(dev); int ioaddr = dev->base_addr; int i; @@ -1476,7 +1470,7 @@ static struct net_device_stats *corkscrew_get_stats(struct net_device *dev) { - struct corkscrew_private *vp = (struct corkscrew_private *) dev->priv; + struct corkscrew_private *vp = netdev_priv(dev); unsigned long flags; if (netif_running(dev)) { @@ -1496,8 +1490,7 @@ */ static void update_stats(int ioaddr, struct net_device *dev) { - struct corkscrew_private *vp = - (struct corkscrew_private *) dev->priv; + struct corkscrew_private *vp = netdev_priv(dev); /* Unlike the 3c5x9 we need not turn off stats updates while reading. */ /* Switch to the stats window, and read everything. */ From klassert@mathematik.tu-chemnitz.de Sat Jan 22 02:30:41 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Jan 2005 02:30:54 -0800 (PST) Received: from lana.hrz.tu-chemnitz.de (lana.hrz.tu-chemnitz.de [134.109.132.3]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0MAUeEv025815 for ; Sat, 22 Jan 2005 02:30:40 -0800 Received: from bayes.mathematik.tu-chemnitz.de ([134.109.41.17] helo=box17.mathematik.tu-chemnitz.de) by lana.hrz.tu-chemnitz.de with esmtp (Exim 4.41) id 1CsIXN-0006et-HB; Sat, 22 Jan 2005 11:30:39 +0100 Received: by box17.mathematik.tu-chemnitz.de (Postfix, from userid 274) id 625EF370B6; Sat, 22 Jan 2005 11:30:37 +0100 (CET) Date: Sat, 22 Jan 2005 11:30:37 +0100 From: Steffen Klassert To: Jeff Garzik Cc: Network Development Mailing List Subject: [PATCH] Add MODULE_VERSION to the 3c515 driver Message-ID: <20050122103037.GB6476@bayes.mathematik.tu-chemnitz.de> Mail-Followup-To: Jeff Garzik , Network Development Mailing List Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Scan-Signature: 706061e527a23eaab6b0df22823cde1c X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 643 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: klassert@mathematik.tu-chemnitz.de Precedence: bulk X-list: netdev Add MODULE_VERSION to the 3c515 driver. Signed-off-by: Steffen Klassert --- vanilla-2.6.11-rc1/drivers/net/3c515.c Wed Jan 12 11:56:16 2005 +++ linux-2.6.11-rc1/drivers/net/3c515.c Sat Jan 22 11:25:21 2005 @@ -86,6 +86,7 @@ MODULE_AUTHOR("Donald Becker "); MODULE_DESCRIPTION("3Com 3c515 Corkscrew driver"); MODULE_LICENSE("GPL"); +MODULE_VERSION(DRV_VERSION); /* "Knobs" for adjusting internal parameters. */ /* Put out somewhat more debugging messages. (0 - no msg, 1 minimal msgs). */ From MAILER-DAEMON Sat Jan 22 02:43:59 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Jan 2005 02:44:05 -0800 (PST) Received: from mail.aaa-calif.com (69-224-107-123.ded.pacbell.net [69.224.107.123] (may be forged)) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0MAhwYl028517 for ; Sat, 22 Jan 2005 02:43:58 -0800 X-WSS-ID: 6DECF1D95JO1565372-01 Date: Sat, 22 Jan 2005 02:43:42 -0800 From: "MMS Notifier" To: netdev@oss.sgi.com Message-ID: <6DECF1D95JO1565372-01@MMS__aaa-calif.com_> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="_-==6DECF1D4BSK77364==-_" Subject: SecureMail Server notification X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 644 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mms-notifier@aaa-calif.com Precedence: bulk X-list: netdev --_-==6DECF1D4BSK77364==-_ Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Our EMail system has detected a virus that cannot be cleaned in your original email sent to one of our users. Please take action to clean your system. Virus Scanner found the W32/Lovgate.x@MM!zip virus in the attached file: readme.zip --_-==6DECF1D4BSK77364==-_ Content-Type: message/rfc822 Content-Transfer-Encoding: 7bit Content-Disposition: inline Received: from 69.224.107.86 by mail.aaa-calif.com with ESMTP ( Tumbleweed MMS SMTP Relay); Sat, 22 Jan 2005 02:43:31 -0800 X-Server-Uuid: 0C5A08D0-32A3-4639-8D0C-F6C8FC676303 From: netdev@oss.sgi.com To: john@aaa-calif.com Subject: test Date: Sat, 22 Jan 2005 02:43:13 -0800 MIME-Version: 1.0 X-Priority: 3 X-MSMail-Priority: Normal Content-Type: text/plain Content-Transfer-Encoding: 7bit --_-==6DECF1D4BSK77364==-_-- From rich@phekda.gotadsl.co.uk Sat Jan 22 05:09:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Jan 2005 05:09:43 -0800 (PST) Received: from smtp.nildram.co.uk (smtp.nildram.co.uk [195.112.4.54]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0MD9ZMF003682 for ; Sat, 22 Jan 2005 05:09:36 -0800 Received: from katrina.int.phekda.gotadsl.co.uk (213-208-105-92.dyn.gotadsl.co.uk [213.208.105.92]) by smtp.nildram.co.uk (Postfix) with ESMTP id E7B742BDFC6; Sat, 22 Jan 2005 13:09:32 +0000 (GMT) Received: from [192.168.1.4] (katrina.int.phekda.gotadsl.co.uk [192.168.1.4]) by katrina.int.phekda.gotadsl.co.uk (Postfix) with ESMTP id D54A0353; Sat, 22 Jan 2005 13:11:01 +0000 (GMT) Message-ID: <41F250D1.8000207@phekda.gotadsl.co.uk> Date: Sat, 22 Jan 2005 13:10:41 +0000 From: Richard Dawe User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020 X-Accept-Language: en, de, fr MIME-Version: 1.0 To: Francois Romieu Cc: netdev@oss.sgi.com, Me Subject: Re: Acer Aspire 1524WLMi and RealTek 8169 - very slow References: <41A09541.5040405@phekda.gotadsl.co.uk> <41A0F0D5.9050702@phekda.gotadsl.co.uk> <20041121205814.GA22460@electric-eye.fr.zoreil.com> <41A24F35.5080106@phekda.gotadsl.co.uk> <20041122213008.GA9618@electric-eye.fr.zoreil.com> <41D2844E.5070204@phekda.gotadsl.co.uk> <20041229235203.GA5465@electric-eye.fr.zoreil.com> In-Reply-To: <20041229235203.GA5465@electric-eye.fr.zoreil.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 645 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rich@phekda.gotadsl.co.uk Precedence: bulk X-list: netdev Hello. I created a bug in the kernel bug tracker for this issue: http://bugme.osdl.org/show_bug.cgi?id=4049 I think it may just be an issue with x86_64 and ACPI, but I'm not sure yet. I don't yet have any definite reports that this laptop works fine in 32-bit mode. Thanks, bye, Rich =] -- Richard Dawe [ http://homepages.nildram.co.uk/~phekda/richdawe/ ] "You can't evaluate a man by logic alone." -- McCoy, "I, Mudd", Star Trek From rich@phekda.gotadsl.co.uk Sat Jan 22 07:21:52 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Jan 2005 07:21:57 -0800 (PST) Received: from smtp.nildram.co.uk (smtp.nildram.co.uk [195.112.4.54]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0MFLq5B012027 for ; Sat, 22 Jan 2005 07:21:52 -0800 Received: from katrina.int.phekda.gotadsl.co.uk (195-112-34-60.dyn.gotadsl.co.uk [195.112.34.60]) by smtp.nildram.co.uk (Postfix) with ESMTP id A0EAB2BE29C; Sat, 22 Jan 2005 15:21:48 +0000 (GMT) Received: from [192.168.1.4] (katrina.int.phekda.gotadsl.co.uk [192.168.1.4]) by katrina.int.phekda.gotadsl.co.uk (Postfix) with ESMTP id CC12F353; Sat, 22 Jan 2005 15:23:17 +0000 (GMT) Message-ID: <41F26FD1.2060407@phekda.gotadsl.co.uk> Date: Sat, 22 Jan 2005 15:22:57 +0000 From: Richard Dawe User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020 X-Accept-Language: en, de, fr MIME-Version: 1.0 To: Francois Romieu Cc: Richard Dawe , netdev@oss.sgi.com Subject: Re: Acer Aspire 1524WLMi and RealTek 8169 - very slow References: <41A09541.5040405@phekda.gotadsl.co.uk> <41A0F0D5.9050702@phekda.gotadsl.co.uk> <20041121205814.GA22460@electric-eye.fr.zoreil.com> <41A24F35.5080106@phekda.gotadsl.co.uk> <20041122213008.GA9618@electric-eye.fr.zoreil.com> <41D2844E.5070204@phekda.gotadsl.co.uk> <20041229235203.GA5465@electric-eye.fr.zoreil.com> <41F250D1.8000207@phekda.gotadsl.co.uk> In-Reply-To: <41F250D1.8000207@phekda.gotadsl.co.uk> Content-Type: multipart/mixed; boundary="------------090001080507050808000603" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 646 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rich@phekda.gotadsl.co.uk Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------090001080507050808000603 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hello. I've done some more investigation and I'm happy to report that I managed to get some decent network performance out of my laptop - 7.1Mbps. My laptop seems to have an embedded PHY rather than the separate PHY that they normally come with. The MAC config data is 0x13000000, which masked off with 0x7c800000 gives 0x10000000, which is RTL_GIGA_MAC_VER_X. The PHY data is 0xc912, which masked off with 0x000f gives 0x0002, which is RTL_GIGA_PHY_VER_G. So I looked at the latest RealTek driver for Linux (version 220) and that has some separate initialisation code for RTL_GIGA_MAC_VER_X (MCFG_METHOD_4, they call it). I ported that over to r8169.c in 2.6.11-rc1 and it appears to work. Attached is the patch against 2.6.11-rc1. I'm not sure if it caters to your tastes. Maybe you'll want to rename RTL_GIGA_MAC_VER_X. RTL_GIGA_PHY_VER_H is an invented version, to indicate end-of-list, like RTL_GIGA_PHY_VER_G was before. I'm going to give this a good hammering now by rsync'ing about 20GB of data. Hopefully it'll hold up. Bye, Rich =] -- Richard Dawe [ http://homepages.nildram.co.uk/~phekda/richdawe/ ] "You can't evaluate a man by logic alone." -- McCoy, "I, Mudd", Star Trek --------------090001080507050808000603 Content-Type: text/plain; name="r8169-embedded-phy-20050122.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="r8169-embedded-phy-20050122.diff" --- r8169.c 2005-01-12 04:00:58.000000000 +0000 +++ r8169new.c 2005-01-22 15:01:05.000000000 +0000 @@ -148,6 +148,7 @@ enum phy_version { RTL_GIGA_PHY_VER_E = 0x05, /* PHY Reg 0x03 bit0-3 == 0x0000 */ RTL_GIGA_PHY_VER_F = 0x06, /* PHY Reg 0x03 bit0-3 == 0x0001 */ RTL_GIGA_PHY_VER_G = 0x07, /* PHY Reg 0x03 bit0-3 == 0x0002 */ + RTL_GIGA_PHY_VER_H = 0x08, /* PHY Reg 0x03 bit0-3 == 0x0003 */ }; @@ -161,7 +162,8 @@ const static struct { } rtl_chip_info[] = { _R("RTL8169", RTL_GIGA_MAC_VER_B, 0xff7e1880), _R("RTL8169s/8110s", RTL_GIGA_MAC_VER_D, 0xff7e1880), - _R("RTL8169s/8110s", RTL_GIGA_MAC_VER_E, 0xff7e1880) + _R("RTL8169s/8110s", RTL_GIGA_MAC_VER_E, 0xff7e1880), + _R("RTL8169s/8110s", RTL_GIGA_MAC_VER_X, 0xff7e1880), }; #undef _R @@ -1001,7 +1003,7 @@ static void rtl8169_hw_phy_config(struct if (tp->mac_version <= RTL_GIGA_MAC_VER_B) return; - if (tp->phy_version >= RTL_GIGA_PHY_VER_F) + if (tp->phy_version >= RTL_GIGA_PHY_VER_H) return; dprintk("MAC version != 0 && PHY version == 0 or 1\n"); @@ -1009,11 +1011,25 @@ static void rtl8169_hw_phy_config(struct /* Shazam ! */ - // phy config for RTL8169s mac_version C chip - mdio_write(ioaddr, 31, 0x0001); //w 31 2 0 1 - mdio_write(ioaddr, 21, 0x1000); //w 21 15 0 1000 - mdio_write(ioaddr, 24, 0x65c7); //w 24 15 0 65c7 - rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 0); //w 4 11 11 0 + if (tp->mac_version == RTL_GIGA_MAC_VER_X) + { + mdio_write(ioaddr, 0x1f, 0x0001); + mdio_write(ioaddr, 0x09, 0x273a); + mdio_write(ioaddr, 0x0e, 0x7bfb); + mdio_write(ioaddr, 0x1b, 0x841e); + + mdio_write(ioaddr, 0x1f, 0x0002); + mdio_write(ioaddr, 0x01, 0x90d0); + mdio_write(ioaddr, 0x1f, 0x0000); + } + else + { + // phy config for RTL8169s mac_version C chip + mdio_write(ioaddr, 31, 0x0001); //w 31 2 0 1 + mdio_write(ioaddr, 21, 0x1000); //w 21 15 0 1000 + mdio_write(ioaddr, 24, 0x65c7); //w 24 15 0 65c7 + rtl8169_write_gmii_reg_bit(ioaddr, 4, 11, 0); //w 4 11 11 0 + } for (i = 0; i < ARRAY_SIZE(phy_magic); i++, p++) { int val, pos = 4; @@ -1037,7 +1053,7 @@ static void rtl8169_phy_timer(unsigned l unsigned long timeout = RTL8169_PHY_TIMEOUT; assert(tp->mac_version > RTL_GIGA_MAC_VER_B); - assert(tp->phy_version < RTL_GIGA_PHY_VER_G); + assert(tp->phy_version < RTL_GIGA_PHY_VER_H); if (!(tp->phy_1000_ctrl_reg & PHY_Cap_1000_Full)) return; @@ -1072,7 +1088,7 @@ static inline void rtl8169_delete_timer( struct timer_list *timer = &tp->timer; if ((tp->mac_version <= RTL_GIGA_MAC_VER_B) || - (tp->phy_version >= RTL_GIGA_PHY_VER_G)) + (tp->phy_version >= RTL_GIGA_PHY_VER_H)) return; del_timer_sync(timer); @@ -1084,7 +1100,7 @@ static inline void rtl8169_request_timer struct timer_list *timer = &tp->timer; if ((tp->mac_version <= RTL_GIGA_MAC_VER_B) || - (tp->phy_version >= RTL_GIGA_PHY_VER_G)) + (tp->phy_version >= RTL_GIGA_PHY_VER_H)) return; init_timer(timer); --------------090001080507050808000603-- From rick.jones2@hp.com Sat Jan 22 10:59:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Jan 2005 10:59:38 -0800 (PST) Received: from mailhub.hp.com (mailhub.hp.com [192.151.27.10]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0MIxObl021120 for ; Sat, 22 Jan 2005 10:59:25 -0800 Received: from [192.168.1.100] (adsl-67-116-55-15.dsl.sntc01.pacbell.net [67.116.55.15]) by mailhub.hp.com (Postfix) with ESMTP id 1791327112 for ; Sat, 22 Jan 2005 13:59:13 -0500 (EST) Mime-Version: 1.0 (Apple Message framework v619) In-Reply-To: <20050121204418.2070d76d.davem@davemloft.net> References: <41F1516D.5010101@hp.com> <200501211358.53783.jdmason@us.ibm.com> <41F163AD.5070400@hp.com> <20050121124441.76cbbfb9.davem@davemloft.net> <41F17B7E.2020002@hp.com> <20050121141820.7d59a2d1.davem@davemloft.net> <41F186A8.9030805@hp.com> <41F18927.5020607@hp.com> <20050121204418.2070d76d.davem@davemloft.net> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: rick jones Subject: Re: on the wire behaviour of TSO on/off is supposed to be the same yes? Date: Sat, 22 Jan 2005 10:58:54 -0800 To: netdev@oss.sgi.com X-Mailer: Apple Mail (2.619) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 647 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rick.jones2@hp.com Precedence: bulk X-list: netdev On Jan 21, 2005, at 8:44 PM, David S. Miller wrote: > On Fri, 21 Jan 2005 14:58:47 -0800 > Rick Jones wrote: > >> Speaking of divisor values... is zero (0) supposed to be a legal >> value? The >> sysctl seems to allow it but it does seem to behave a triffle >> strangely. The >> initial TSO size appeared to be 2MSS. > > The value "0" behaves the same as "1". Alas I'm away from my traces at the moment, but I do recall seeing different behaviour with 0 than with one - with one the TSO sends started at 3*1448, with the divisor at zero they started at what appeared to be 2*1448. I'll see if I can get to the traces before monday and send them along. rick jones there is no rest for the wicked, yet the virtuous have no pillows From rick.jones2@hp.com Sat Jan 22 11:05:39 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Jan 2005 11:05:43 -0800 (PST) Received: from mailhub.hp.com (mailhub.hp.com [192.151.27.10]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0MJ5doO021713 for ; Sat, 22 Jan 2005 11:05:39 -0800 Received: from [192.168.1.100] (adsl-67-116-55-15.dsl.sntc01.pacbell.net [67.116.55.15]) by mailhub.hp.com (Postfix) with ESMTP id ABA5127111 for ; Sat, 22 Jan 2005 14:05:33 -0500 (EST) Mime-Version: 1.0 (Apple Message framework v619) In-Reply-To: <20050121204948.034b2510.davem@davemloft.net> References: <41F1516D.5010101@hp.com> <200501211358.53783.jdmason@us.ibm.com> <41F163AD.5070400@hp.com> <20050121124441.76cbbfb9.davem@davemloft.net> <41F17B7E.2020002@hp.com> <20050121141820.7d59a2d1.davem@davemloft.net> <41F186A8.9030805@hp.com> <20050121204948.034b2510.davem@davemloft.net> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <92ADD7B5-6CA8-11D9-86F8-000393765F60@hp.com> Content-Transfer-Encoding: 7bit From: rick jones Subject: Re: on the wire behaviour of TSO on/off is supposed to be the same yes? Date: Sat, 22 Jan 2005 11:05:25 -0800 To: netdev@oss.sgi.com X-Mailer: Apple Mail (2.619) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 648 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rick.jones2@hp.com Precedence: bulk X-list: netdev On Jan 21, 2005, at 8:49 PM, David S. Miller wrote: > The code can potentially get really messy and ugly if we start > preemptively building larger frames "hoping" the cwnd will be > large enough by the time we push it onto the wire. Segmenting > at send time is completely upside down to the way packets are > built currently for transmission. A bad guess also means that > we'll spend significant cycles chopping up TSO packets and > resegmenting the queue. so if i'm parsing correctly, with TSO enabled, at user send time, the send code builds "tso-sized" segments based on the value of cwnd at the time of the send. with TSO disabled, at user send time, the code will build a string of MSS-sized segments and queue them. then at transmit time, cwnd is consulted and either a group of mss-sized segments is sent, or a tso-sized segment is sent down the stack. is it necessary to build TSO-sized segments at the time the user does the send? could just a chain of mss-sized segments be used as the TSO-sized segment? admittedly, it is more buffers to manipulate by the NIC, and the large DMA's don't happen, but it means that TSO can take full advantage of cwnd at transmit time without much resegmentation. rick jones there is no rest for the wicked, yet the virtuous have no pillows From webvenza@libero.it Sat Jan 22 13:47:05 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Jan 2005 13:47:19 -0800 (PST) Received: from gateway.milesteg.arr (venza@adsl-ull-189-134.44-151.net24.it [151.44.134.189]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0MLl4EI029330 for ; Sat, 22 Jan 2005 13:47:05 -0800 MIME-Version: 1.0 Content-Type: multipart/mixed; charset="us-ascii"; boundary="===============1012319623==" Content-Transfer-Encoding: 7bit User-Agent: Python patchbomber v. 0.0.0.0.0.1 Message-ID: <20050122214658.18649.32654@localhost.localdomain> In-Reply-To: <20050122214657.18649.66345@localhost.localdomain> Subject: [PATCH 2/5] sis900 printk audit From: Daniele Venzano To: Jeff Garzik , NetDev Date: Sat, 22 Jan 2005 22:46:58 +0100 (CET) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 652 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: webvenza@libero.it Precedence: bulk X-list: netdev This is a MIME message, see the first attachment for the text and the second for the patch --===============1012319623== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Version bump Remove broken link to documentation Signed-off-by: Daniele Venzano --===============1012319623== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Index: sis900.c =================================================================== --- a/drivers/net/sis900.c (revision 84) +++ b/drivers/net/sis900.c (revision 85) @@ -1,6 +1,6 @@ /* sis900.c: A SiS 900/7016 PCI Fast Ethernet driver for Linux. Copyright 1999 Silicon Integrated System Corporation - Revision: 1.08.06 Sep. 24 2002 + Revision: 1.08.08 Jan. 22 2005 Modified from the driver which is originally written by Donald Becker. @@ -16,8 +16,8 @@ preliminary Rev. 1.0 Nov. 10, 1998 SiS 7014 Single Chip 100BASE-TX/10BASE-T Physical Layer Solution, preliminary Rev. 1.0 Jan. 18, 1998 - http://www.sis.com.tw/support/databook.htm + Rev 1.08.08 Jan. 22 2005 Daniele Venzano use netif_msg for debugging messages Rev 1.08.07 Nov. 2 2003 Daniele Venzano add suspend/resume support Rev 1.08.06 Sep. 24 2002 Mufasa Yang bug fix for Tx timeout & add SiS963 support Rev 1.08.05 Jun. 6 2002 Mufasa Yang bug fix for read_eeprom & Tx descriptor over-boundary @@ -74,7 +74,7 @@ #include "sis900.h" #define SIS900_MODULE_NAME "sis900" -#define SIS900_DRV_VERSION "v1.08.07 11/02/2003" +#define SIS900_DRV_VERSION "v1.08.08 Jan. 22 2005" static char version[] __devinitdata = KERN_INFO "sis900.c: " SIS900_DRV_VERSION "\n"; --===============1012319623==-- From webvenza@libero.it Sat Jan 22 13:47:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Jan 2005 13:47:18 -0800 (PST) Received: from gateway.milesteg.arr (venza@adsl-ull-189-134.44-151.net24.it [151.44.134.189]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0MLl69L029338 for ; Sat, 22 Jan 2005 13:47:06 -0800 MIME-Version: 1.0 Content-Type: multipart/mixed; charset="us-ascii"; boundary="===============0825400047==" Content-Transfer-Encoding: 7bit User-Agent: Python patchbomber v. 0.0.0.0.0.1 Message-ID: <20050122214700.18649.65064@localhost.localdomain> In-Reply-To: <20050122214657.18649.66345@localhost.localdomain> Subject: [PATCH 4/5] sis900 printk audit From: Daniele Venzano To: Jeff Garzik , NetDev Date: Sat, 22 Jan 2005 22:47:00 +0100 (CET) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 650 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: webvenza@libero.it Precedence: bulk X-list: netdev This is a MIME message, see the first attachment for the text and the second for the patch --===============0825400047== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Add some init debugging printk Use netif_msg macros before printing debug messages Signed-off-by: Daniele Venzano --===============0825400047== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Index: sis900.c =================================================================== --- a/drivers/net/sis900.c (revision 86) +++ b/drivers/net/sis900.c (revision 87) @@ -475,8 +475,13 @@ /* Get Mac address according to the chip revision */ pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &revision); + + if(netif_msg_probe(sis_priv)) + printk(KERN_DEBUG "%s: detected revision %2.2x, " + "trying to get MAC address...\n", + net_dev->name, revision); + ret = 0; - if (revision == SIS630E_900_REV) ret = sis630e_get_mac_addr(pci_dev, net_dev); else if ((revision > 0x81) && (revision <= 0x90) ) @@ -487,6 +492,7 @@ ret = sis900_get_mac_addr(pci_dev, net_dev); if (ret == 0) { + printk(KERN_WARNING "%s: Cannot read MAC address.\n", net_dev->name); ret = -ENODEV; goto err_out_unregister; } @@ -497,6 +503,7 @@ /* probe for mii transceiver */ if (sis900_mii_probe(net_dev) == 0) { + printk(KERN_WARNING "%s: Error probing MII device.\n", net_dev->name); ret = -ENODEV; goto err_out_unregister; } @@ -562,9 +569,13 @@ for(i = 0; i < 2; i++) mii_status = mdio_read(net_dev, phy_addr, MII_STATUS); - if (mii_status == 0xffff || mii_status == 0x0000) - /* the mii is not accessible, try next one */ + if (mii_status == 0xffff || mii_status == 0x0000) { + if (netif_msg_probe(sis_priv)) + printk(KERN_DEBUG "%s: MII at address %d" + " not accessible\n", + net_dev->name, phy_addr); continue; + } if ((mii_phy = kmalloc(sizeof(struct mii_phy), GFP_KERNEL)) == NULL) { printk(KERN_WARNING "Cannot allocate mem for struct mii_phy\n"); @@ -593,9 +604,11 @@ if (mii_chip_table[i].phy_types == MIX) mii_phy->phy_types = (mii_status & (MII_STAT_CAN_TX_FDX | MII_STAT_CAN_TX)) ? LAN : HOME; - printk(KERN_INFO "%s: %s transceiver found at address %d.\n", - net_dev->name, mii_chip_table[i].name, - phy_addr); + printk(KERN_INFO "%s: %s transceiver found " + "at address %d.\n", + net_dev->name, + mii_chip_table[i].name, + phy_addr); break; } @@ -1011,6 +1024,7 @@ static void sis900_init_rxfilter (struct net_device * net_dev) { + struct sis900_private *sis_priv = net_dev->priv; long ioaddr = net_dev->base_addr; u32 rfcrSave; u32 i; @@ -1028,7 +1042,7 @@ outl((i << RFADDR_shift), ioaddr + rfcr); outl(w, ioaddr + rfdr); - if (sis900_debug > 2) { + if (netif_msg_hw(sis_priv)) { printk(KERN_DEBUG "%s: Receive Filter Addrss[%d]=%x\n", net_dev->name, i, inl(ioaddr + rfdr)); } @@ -1066,7 +1080,7 @@ /* load Transmit Descriptor Register */ outl(sis_priv->tx_ring_dma, ioaddr + txdp); - if (sis900_debug > 2) + if (netif_msg_hw(sis_priv)) printk(KERN_DEBUG "%s: TX descriptor register loaded with: %8.8x\n", net_dev->name, inl(ioaddr + txdp)); } @@ -1120,7 +1134,7 @@ /* load Receive Descriptor Register */ outl(sis_priv->rx_ring_dma, ioaddr + rxdp); - if (sis900_debug > 2) + if (netif_msg_hw(sis_priv)) printk(KERN_DEBUG "%s: RX descriptor register loaded with: %8.8x\n", net_dev->name, inl(ioaddr + rxdp)); } @@ -1268,7 +1282,8 @@ /* Link ON -> OFF */ if (!(status & MII_STAT_LINK)){ netif_carrier_off(net_dev); - printk(KERN_INFO "%s: Media Link Off\n", net_dev->name); + if(netif_msg_link(sis_priv)) + printk(KERN_INFO "%s: Media Link Off\n", net_dev->name); /* Change mode issue */ if ((mii_phy->phy_id0 == 0x001D) && @@ -1383,7 +1398,8 @@ status = mdio_read(net_dev, phy_addr, MII_STATUS); if (!(status & MII_STAT_LINK)){ - printk(KERN_INFO "%s: Media Link Off\n", net_dev->name); + if(netif_msg_link(sis_priv)) + printk(KERN_INFO "%s: Media Link Off\n", net_dev->name); sis_priv->autong_complete = 1; netif_carrier_off(net_dev); return; @@ -1445,7 +1461,8 @@ *speed = HW_SPEED_100_MBPS; } - printk(KERN_INFO "%s: Media Link On %s %s-duplex \n", + if(netif_msg_link(sis_priv)) + printk(KERN_INFO "%s: Media Link On %s %s-duplex \n", net_dev->name, *speed == HW_SPEED_100_MBPS ? "100mbps" : "10mbps", @@ -1468,8 +1485,9 @@ unsigned long flags; int i; - printk(KERN_INFO "%s: Transmit timeout, status %8.8x %8.8x \n", - net_dev->name, inl(ioaddr + cr), inl(ioaddr + isr)); + if(netif_msg_tx_err(sis_priv)) + printk(KERN_INFO "%s: Transmit timeout, status %8.8x %8.8x \n", + net_dev->name, inl(ioaddr + cr), inl(ioaddr + isr)); /* Disable interrupts by clearing the interrupt mask. */ outl(0x0000, ioaddr + imr); @@ -1570,7 +1588,7 @@ net_dev->trans_start = jiffies; - if (sis900_debug > 3) + if (netif_msg_tx_queued(sis_priv)) printk(KERN_DEBUG "%s: Queued Tx packet at %p size %d " "to slot %d.\n", net_dev->name, skb->data, (int)skb->len, entry); @@ -1618,19 +1636,21 @@ /* something strange happened !!! */ if (status & HIBERR) { - printk(KERN_INFO "%s: Abnormal interrupt," - "status %#8.8x.\n", net_dev->name, status); + if(netif_msg_intr(sis_priv)) + printk(KERN_INFO "%s: Abnormal interrupt," + "status %#8.8x.\n", net_dev->name, status); break; } if (--boguscnt < 0) { - printk(KERN_INFO "%s: Too much work at interrupt, " - "interrupt status = %#8.8x.\n", - net_dev->name, status); + if(netif_msg_intr(sis_priv)) + printk(KERN_INFO "%s: Too much work at interrupt, " + "interrupt status = %#8.8x.\n", + net_dev->name, status); break; } } while (1); - if (sis900_debug > 3) + if(netif_msg_intr(sis_priv)) printk(KERN_DEBUG "%s: exiting interrupt, " "interrupt status = 0x%#8.8x.\n", net_dev->name, inl(ioaddr + isr)); @@ -1656,7 +1676,7 @@ unsigned int entry = sis_priv->cur_rx % NUM_RX_DESC; u32 rx_status = sis_priv->rx_ring[entry].cmdsts; - if (sis900_debug > 3) + if (netif_msg_rx_status(sis_priv)) printk(KERN_DEBUG "sis900_rx, cur_rx:%4.4d, dirty_rx:%4.4d " "status:0x%8.8x\n", sis_priv->cur_rx, sis_priv->dirty_rx, rx_status); @@ -1668,7 +1688,7 @@ if (rx_status & (ABORT|OVERRUN|TOOLONG|RUNT|RXISERR|CRCERR|FAERR)) { /* corrupted packet received */ - if (sis900_debug > 3) + if (netif_msg_rx_err(sis_priv)) printk(KERN_DEBUG "%s: Corrupted packet " "received, buffer status = 0x%8.8x.\n", net_dev->name, rx_status); @@ -1690,9 +1710,10 @@ some unknow bugs, it is possible that we are working on NULL sk_buff :-( */ if (sis_priv->rx_skbuff[entry] == NULL) { - printk(KERN_INFO "%s: NULL pointer " - "encountered in Rx ring, skipping\n", - net_dev->name); + if (netif_msg_rx_err(sis_priv)) + printk(KERN_INFO "%s: NULL pointer " + "encountered in Rx ring, skipping\n", + net_dev->name); break; } @@ -1719,9 +1740,10 @@ * "hole" on the buffer ring, it is not clear * how the hardware will react to this kind * of degenerated buffer */ - printk(KERN_INFO "%s: Memory squeeze," - "deferring packet.\n", - net_dev->name); + if (netif_msg_rx_status(sis_priv)) + printk(KERN_INFO "%s: Memory squeeze," + "deferring packet.\n", + net_dev->name); sis_priv->rx_skbuff[entry] = NULL; /* reset buffer descriptor state */ sis_priv->rx_ring[entry].cmdsts = 0; @@ -1755,9 +1777,10 @@ * "hole" on the buffer ring, it is not clear * how the hardware will react to this kind * of degenerated buffer */ - printk(KERN_INFO "%s: Memory squeeze," - "deferring packet.\n", - net_dev->name); + if (netif_msg_rx_err(sis_priv)) + printk(KERN_INFO "%s: Memory squeeze," + "deferring packet.\n", + net_dev->name); sis_priv->stats.rx_dropped++; break; } @@ -1806,7 +1829,7 @@ if (tx_status & (ABORT | UNDERRUN | OWCOLL)) { /* packet unsuccessfully transmitted */ - if (sis900_debug > 3) + if (netif_msg_tx_err(sis_priv)) printk(KERN_DEBUG "%s: Transmit " "error, Tx status %8.8x.\n", net_dev->name, tx_status); --===============0825400047==-- From webvenza@libero.it Sat Jan 22 13:47:06 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Jan 2005 13:47:16 -0800 (PST) Received: from gateway.milesteg.arr (venza@adsl-ull-189-134.44-151.net24.it [151.44.134.189]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0MLl4ve029329 for ; Sat, 22 Jan 2005 13:47:05 -0800 MIME-Version: 1.0 Content-Type: multipart/mixed; charset="us-ascii"; boundary="===============1085356003==" Content-Transfer-Encoding: 7bit User-Agent: Python patchbomber v. 0.0.0.0.0.1 Message-ID: <20050122214657.18649.66345@localhost.localdomain> Subject: [PATCH 1/5] sis900 printk audit From: Daniele Venzano To: Jeff Garzik , NetDev Date: Sat, 22 Jan 2005 22:46:57 +0100 (CET) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 649 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: webvenza@libero.it Precedence: bulk X-list: netdev This is a MIME message, see the first attachment for the text and the second for the patch --===============1085356003== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Infrastructure needed for standard netif messages - add msg_level to sis900_private - define default msg level - set default value for sis900_debug Update module parameter description Ethtool support for debugging output level Signed-off-by: Daniele Venzano --===============1085356003== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Index: sis900.c =================================================================== --- a/drivers/net/sis900.c (revision 83) +++ b/drivers/net/sis900.c (revision 84) @@ -82,9 +82,14 @@ static int max_interrupt_work = 40; static int multicast_filter_limit = 128; -#define sis900_debug debug -static int sis900_debug; +static int sis900_debug = -1; /* Use SIS900_DEF_MSG as value */ +#define SIS900_DEF_MSG \ + (NETIF_MSG_DRV | \ + NETIF_MSG_LINK | \ + NETIF_MSG_RX_ERR | \ + NETIF_MSG_TX_ERR) + /* Time in jiffies before concluding the transmitter is hung. */ #define TX_TIMEOUT (4*HZ) /* SiS 900 is capable of 32 bits BM DMA */ @@ -160,6 +165,8 @@ struct timer_list timer; /* Link status detection timer. */ u8 autong_complete; /* 1: auto-negotiate complete */ + u32 msg_enable; + unsigned int cur_rx, dirty_rx; /* producer/comsumer pointers for Tx/Rx ring */ unsigned int cur_tx, dirty_tx; @@ -182,10 +189,10 @@ module_param(multicast_filter_limit, int, 0444); module_param(max_interrupt_work, int, 0444); -module_param(debug, int, 0444); +module_param(sis900_debug, int, 0444); MODULE_PARM_DESC(multicast_filter_limit, "SiS 900/7016 maximum number of filtered multicast addresses"); MODULE_PARM_DESC(max_interrupt_work, "SiS 900/7016 maximum events handled per interrupt"); -MODULE_PARM_DESC(debug, "SiS 900/7016 debug level (2-4)"); +MODULE_PARM_DESC(sis900_debug, "SiS 900/7016 bitmapped debugging message level"); static int sis900_open(struct net_device *net_dev); static int sis900_mii_probe (struct net_device * net_dev); @@ -456,6 +463,11 @@ net_dev->tx_timeout = sis900_tx_timeout; net_dev->watchdog_timeo = TX_TIMEOUT; net_dev->ethtool_ops = &sis900_ethtool_ops; + + if (sis900_debug > 0) + sis_priv->msg_enable = sis900_debug; + else + sis_priv->msg_enable = SIS900_DEF_MSG; ret = register_netdev(net_dev); if (ret) @@ -1906,8 +1918,22 @@ strcpy (info->bus_info, pci_name(sis_priv->pci_dev)); } +static u32 sis900_get_msglevel(struct net_device *net_dev) +{ + struct sis900_private *sis_priv = net_dev->priv; + return sis_priv->msg_enable; +} + +static void sis900_set_msglevel(struct net_device *net_dev, u32 value) +{ + struct sis900_private *sis_priv = net_dev->priv; + sis_priv->msg_enable = value; +} + static struct ethtool_ops sis900_ethtool_ops = { - .get_drvinfo = sis900_get_drvinfo, + .get_drvinfo = sis900_get_drvinfo, + .get_msglevel = sis900_get_msglevel, + .set_msglevel = sis900_set_msglevel, }; /** --===============1085356003==-- From webvenza@libero.it Sat Jan 22 13:47:06 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Jan 2005 13:47:16 -0800 (PST) Received: from gateway.milesteg.arr (venza@adsl-ull-189-134.44-151.net24.it [151.44.134.189]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0MLl59u029333 for ; Sat, 22 Jan 2005 13:47:06 -0800 MIME-Version: 1.0 Content-Type: multipart/mixed; charset="us-ascii"; boundary="===============1829249079==" Content-Transfer-Encoding: 7bit User-Agent: Python patchbomber v. 0.0.0.0.0.1 Message-ID: <20050122214659.18649.83119@localhost.localdomain> In-Reply-To: <20050122214657.18649.66345@localhost.localdomain> Subject: [PATCH 3/5] sis900 printk audit From: Daniele Venzano To: Jeff Garzik , NetDev Date: Sat, 22 Jan 2005 22:46:59 +0100 (CET) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 649 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: webvenza@libero.it Precedence: bulk X-list: netdev This is a MIME message, see the first attachment for the text and the second for the patch --===============1829249079== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Change priority of printk where appropriate Remove two cryptic and useless printk Signed-off-by: Daniele Venzano --===============1829249079== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Index: sis900.c =================================================================== --- a/drivers/net/sis900.c (revision 85) +++ b/drivers/net/sis900.c (revision 86) @@ -242,7 +242,7 @@ /* check to see if we have sane EEPROM */ signature = (u16) read_eeprom(ioaddr, EEPROMSignature); if (signature == 0xffff || signature == 0x0000) { - printk (KERN_INFO "%s: Error EERPOM read %x\n", + printk (KERN_WARNING "%s: Error EERPOM read %x\n", net_dev->name, signature); return 0; } @@ -275,7 +275,7 @@ if (!isa_bridge) isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0018, isa_bridge); if (!isa_bridge) { - printk("%s: Can not find ISA bridge\n", net_dev->name); + printk(KERN_WARNING "%s: Can not find ISA bridge\n", net_dev->name); return 0; } pci_read_config_byte(isa_bridge, 0x48, ®); @@ -567,7 +567,7 @@ continue; if ((mii_phy = kmalloc(sizeof(struct mii_phy), GFP_KERNEL)) == NULL) { - printk(KERN_INFO "Cannot allocate mem for struct mii_phy\n"); + printk(KERN_WARNING "Cannot allocate mem for struct mii_phy\n"); mii_phy = sis_priv->first_mii; while (mii_phy) { struct mii_phy *phy; @@ -1029,7 +1029,7 @@ outl(w, ioaddr + rfdr); if (sis900_debug > 2) { - printk(KERN_INFO "%s: Receive Filter Addrss[%d]=%x\n", + printk(KERN_DEBUG "%s: Receive Filter Addrss[%d]=%x\n", net_dev->name, i, inl(ioaddr + rfdr)); } } @@ -1067,7 +1067,7 @@ /* load Transmit Descriptor Register */ outl(sis_priv->tx_ring_dma, ioaddr + txdp); if (sis900_debug > 2) - printk(KERN_INFO "%s: TX descriptor register loaded with: %8.8x\n", + printk(KERN_DEBUG "%s: TX descriptor register loaded with: %8.8x\n", net_dev->name, inl(ioaddr + txdp)); } @@ -1121,7 +1121,7 @@ /* load Receive Descriptor Register */ outl(sis_priv->rx_ring_dma, ioaddr + rxdp); if (sis900_debug > 2) - printk(KERN_INFO "%s: RX descriptor register loaded with: %8.8x\n", + printk(KERN_DEBUG "%s: RX descriptor register loaded with: %8.8x\n", net_dev->name, inl(ioaddr + rxdp)); } @@ -1571,7 +1571,7 @@ net_dev->trans_start = jiffies; if (sis900_debug > 3) - printk(KERN_INFO "%s: Queued Tx packet at %p size %d " + printk(KERN_DEBUG "%s: Queued Tx packet at %p size %d " "to slot %d.\n", net_dev->name, skb->data, (int)skb->len, entry); @@ -1631,7 +1631,7 @@ } while (1); if (sis900_debug > 3) - printk(KERN_INFO "%s: exiting interrupt, " + printk(KERN_DEBUG "%s: exiting interrupt, " "interrupt status = 0x%#8.8x.\n", net_dev->name, inl(ioaddr + isr)); @@ -1657,7 +1657,7 @@ u32 rx_status = sis_priv->rx_ring[entry].cmdsts; if (sis900_debug > 3) - printk(KERN_INFO "sis900_rx, cur_rx:%4.4d, dirty_rx:%4.4d " + printk(KERN_DEBUG "sis900_rx, cur_rx:%4.4d, dirty_rx:%4.4d " "status:0x%8.8x\n", sis_priv->cur_rx, sis_priv->dirty_rx, rx_status); @@ -1669,7 +1669,7 @@ if (rx_status & (ABORT|OVERRUN|TOOLONG|RUNT|RXISERR|CRCERR|FAERR)) { /* corrupted packet received */ if (sis900_debug > 3) - printk(KERN_INFO "%s: Corrupted packet " + printk(KERN_DEBUG "%s: Corrupted packet " "received, buffer status = 0x%8.8x.\n", net_dev->name, rx_status); sis_priv->stats.rx_errors++; @@ -1807,7 +1807,7 @@ if (tx_status & (ABORT | UNDERRUN | OWCOLL)) { /* packet unsuccessfully transmitted */ if (sis900_debug > 3) - printk(KERN_INFO "%s: Transmit " + printk(KERN_DEBUG "%s: Transmit " "error, Tx status %8.8x.\n", net_dev->name, tx_status); sis_priv->stats.tx_errors++; @@ -2074,12 +2074,10 @@ case IF_PORT_AUI: /* AUI */ case IF_PORT_100BASEFX: /* 100BaseFx */ /* These Modes are not supported (are they?)*/ - printk(KERN_INFO "Not supported"); return -EOPNOTSUPP; break; default: - printk(KERN_INFO "Invalid"); return -EINVAL; } } --===============1829249079==-- From webvenza@libero.it Sat Jan 22 13:47:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Jan 2005 13:47:18 -0800 (PST) Received: from gateway.milesteg.arr (venza@adsl-ull-189-134.44-151.net24.it [151.44.134.189]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0MLl7K8029350 for ; Sat, 22 Jan 2005 13:47:08 -0800 MIME-Version: 1.0 Content-Type: multipart/mixed; charset="us-ascii"; boundary="===============1344517621==" Content-Transfer-Encoding: 7bit User-Agent: Python patchbomber v. 0.0.0.0.0.1 Message-ID: <20050122214701.18649.41030@localhost.localdomain> In-Reply-To: <20050122214657.18649.66345@localhost.localdomain> Subject: [PATCH 5/5] sis900 printk audit From: Daniele Venzano To: Jeff Garzik , NetDev Date: Sat, 22 Jan 2005 22:47:01 +0100 (CET) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 651 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: webvenza@libero.it Precedence: bulk X-list: netdev This is a MIME message, see the first attachment for the text and the second for the patch --===============1344517621== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Chip revision is now a member of sis_priv structure Kill all calls to pci_read_config_byte but one Change the code to use sis_priv->chipset_rev Signed-off-by: Daniele Venzano --===============1344517621== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Index: sis900.c =================================================================== --- a/drivers/net/sis900.c (revision 87) +++ b/drivers/net/sis900.c (revision 88) @@ -181,6 +181,7 @@ unsigned int tx_full; /* The Tx queue is full. */ u8 host_bridge_rev; + u8 chipset_rev; }; MODULE_AUTHOR("Jim Huang , Ollie Lho "); @@ -393,7 +394,6 @@ void *ring_space; long ioaddr; int i, ret; - u8 revision; char *card_name = card_names[pci_id->driver_data]; /* when built into the kernel, we only print version if device is found */ @@ -474,19 +474,18 @@ goto err_unmap_rx; /* Get Mac address according to the chip revision */ - pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &revision); - + pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &(sis_priv->chipset_rev)); if(netif_msg_probe(sis_priv)) printk(KERN_DEBUG "%s: detected revision %2.2x, " "trying to get MAC address...\n", - net_dev->name, revision); + net_dev->name, sis_priv->chipset_rev); ret = 0; - if (revision == SIS630E_900_REV) + if (sis_priv->chipset_rev == SIS630E_900_REV) ret = sis630e_get_mac_addr(pci_dev, net_dev); - else if ((revision > 0x81) && (revision <= 0x90) ) + else if ((sis_priv->chipset_rev > 0x81) && (sis_priv->chipset_rev <= 0x90) ) ret = sis635_get_mac_addr(pci_dev, net_dev); - else if (revision == SIS96x_900_REV) + else if (sis_priv->chipset_rev == SIS96x_900_REV) ret = sis96x_get_mac_addr(pci_dev, net_dev); else ret = sis900_get_mac_addr(pci_dev, net_dev); @@ -498,7 +497,7 @@ } /* 630ET : set the mii access mode as software-mode */ - if (revision == SIS630ET_900_REV) + if (sis_priv->chipset_rev == SIS630ET_900_REV) outl(ACCESSMODE | inl(ioaddr + cr), ioaddr + cr); /* probe for mii transceiver */ @@ -555,7 +554,6 @@ u16 poll_bit = MII_STAT_LINK, status = 0; unsigned long timeout = jiffies + 5 * HZ; int phy_addr; - u8 revision; sis_priv->mii = NULL; @@ -652,8 +650,7 @@ } } - pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision); - if (revision == SIS630E_900_REV) { + if (sis_priv->chipset_rev == SIS630E_900_REV) { /* SiS 630E has some bugs on default value of PHY registers */ mdio_write(net_dev, sis_priv->cur_phy, MII_ANADV, 0x05e1); mdio_write(net_dev, sis_priv->cur_phy, MII_CONFIG1, 0x22); @@ -968,15 +965,13 @@ { struct sis900_private *sis_priv = net_dev->priv; long ioaddr = net_dev->base_addr; - u8 revision; int ret; /* Soft reset the chip. */ sis900_reset(net_dev); /* Equalizer workaround Rule */ - pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision); - sis630_set_eq(net_dev, revision); + sis630_set_eq(net_dev, sis_priv->chipset_rev); ret = request_irq(net_dev->irq, &sis900_interrupt, SA_SHIRQ, net_dev->name, net_dev); @@ -1245,7 +1240,6 @@ struct mii_phy *mii_phy = sis_priv->mii; static int next_tick = 5*HZ; u16 status; - u8 revision; if (!sis_priv->autong_complete){ int speed, duplex = 0; @@ -1253,9 +1247,7 @@ sis900_read_mode(net_dev, &speed, &duplex); if (duplex){ sis900_set_mode(net_dev->base_addr, speed, duplex); - pci_read_config_byte(sis_priv->pci_dev, - PCI_CLASS_REVISION, &revision); - sis630_set_eq(net_dev, revision); + sis630_set_eq(net_dev, sis_priv->chipset_rev); netif_start_queue(net_dev); } @@ -1290,9 +1282,7 @@ ((mii_phy->phy_id1 & 0xFFF0) == 0x8000)) sis900_reset_phy(net_dev, sis_priv->cur_phy); - pci_read_config_byte(sis_priv->pci_dev, - PCI_CLASS_REVISION, &revision); - sis630_set_eq(net_dev, revision); + sis630_set_eq(net_dev, sis_priv->chipset_rev); goto LookForLink; } @@ -2146,11 +2136,10 @@ u16 mc_filter[16] = {0}; /* 256/128 bits multicast hash table */ int i, table_entries; u32 rx_mode; - u8 revision; /* 635 Hash Table entires = 256(2^16) */ - pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision); - if((revision >= SIS635A_900_REV) || (revision == SIS900B_900_REV)) + if((sis_priv->chipset_rev >= SIS635A_900_REV) || + (sis_priv->chipset_rev == SIS900B_900_REV)) table_entries = 16; else table_entries = 8; @@ -2176,7 +2165,7 @@ mclist && i < net_dev->mc_count; i++, mclist = mclist->next) { unsigned int bit_nr = - sis900_mcast_bitnr(mclist->dmi_addr, revision); + sis900_mcast_bitnr(mclist->dmi_addr, sis_priv->chipset_rev); mc_filter[bit_nr >> 4] |= (1 << (bit_nr & 0xf)); } } @@ -2222,7 +2211,6 @@ long ioaddr = net_dev->base_addr; int i = 0; u32 status = TxRCMP | RxRCMP; - u8 revision; outl(0, ioaddr + ier); outl(0, ioaddr + imr); @@ -2235,8 +2223,8 @@ status ^= (inl(isr + ioaddr) & status); } - pci_read_config_byte(sis_priv->pci_dev, PCI_CLASS_REVISION, &revision); - if( (revision >= SIS635A_900_REV) || (revision == SIS900B_900_REV) ) + if( (sis_priv->chipset_rev >= SIS635A_900_REV) || + (sis_priv->chipset_rev == SIS900B_900_REV) ) outl(PESEL | RND_CNT, ioaddr + cfg); else outl(PESEL, ioaddr + cfg); --===============1344517621==-- From bdschuym@pandora.be Sat Jan 22 14:25:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Jan 2005 14:25:35 -0800 (PST) Received: from astra.telenet-ops.be (astra.telenet-ops.be [195.130.132.58]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0MMPRhJ000640 for ; Sat, 22 Jan 2005 14:25:28 -0800 Received: from localhost (localhost.localdomain [127.0.0.1]) by astra.telenet-ops.be (Postfix) with SMTP id 98F3B32803D; Sat, 22 Jan 2005 23:25:26 +0100 (MET) Received: from 192.168.0.138 (dD5763CA9.access.telenet.be [213.118.60.169]) by astra.telenet-ops.be (Postfix) with ESMTP id BB01A32807C; Sat, 22 Jan 2005 23:25:25 +0100 (MET) Subject: [PATCH/RFC] Reduce call chain length in netfilter (was: Re: do_IRQ: stack overflow: 872..) From: Bart De Schuymer To: "David S. Miller" Cc: shemminger@osdl.org, dwmw2@infradead.org, ak@suse.de, snort2004@mail.ru, bridge@osdl.org, netdev@oss.sgi.com, rusty@rustcorp.com.au In-Reply-To: <20050118135735.4b77d38d.davem@davemloft.net> References: <1131604877.20041218092730@mail.ru.suse.lists.linux.kernel> <1105117559.11753.34.camel@baythorne.infradead.org> <20050107100017.454ddadc@dxpl.pdx.osdl.net> <1105133241.3375.16.camel@localhost.localdomain> <20050118135735.4b77d38d.davem@davemloft.net> Content-Type: text/plain Date: Sat, 22 Jan 2005 23:30:59 +0100 Message-Id: <1106433059.4486.11.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 653 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bdschuym@pandora.be Precedence: bulk X-list: netdev Op di, 18-01-2005 te 13:57 -0800, schreef David S. Miller: > On Fri, 07 Jan 2005 22:27:21 +0100 > Bart De Schuymer wrote: > > > How about something like the patch below (untested but compiles)? > > The current netfilter scheme adds one function call to the call chain > > for each NF_HOOK and NF_HOOK_THRESH. This can be prevented by executing > > the okfn in the calling function instead of in nf_hook_slow(). > > I didn't check if there's any code that actually uses the return value > > from NF_HOOK. If so, this patch won't work well in its current form as - > > EPERM is now also returned for NF_QUEUE and NF_STOLEN. > > > > Another 2 calls of okfn can be postponed in br_netfilter.c by adding > > NF_STOP, which would work like NF_STOLEN except that okfn is still > > called. > This NF_HOOK() change looks interesting. Could we also do something like > running the deeper ->hard_start_xmit() via a triggered tasklet or something > similar? Hi, The patch below reduces the call chain length for netfilter hooks by executing the okfn() inside the caller function instead of inside nf_hook_slow(). It also reduces the size of netfilter.o from 129590 to 129550 on my system. The return value for NF_HOOK stays the same as before: 0 except when the verdict was NF_DROP (in that case the return value becomes -EPERM). The target NF_STOP is added to postpone two executions of okfn() in br_netfilter.c, it works like NF_STOLEN except that the okfn() will still be called. The downside is that all .o files using NF_HOOK will enlarge. Comments are welcome. cheers, Bart Signed-off-by: Bart De Schuymer --- linux-2.6.1-rc1/include/linux/netfilter.h.old 2005-01-20 21:44:22.000000000 +0100 +++ linux-2.6.1-rc1/include/linux/netfilter.h 2005-01-22 22:06:14.000000000 +0100 @@ -18,7 +18,8 @@ #define NF_STOLEN 2 #define NF_QUEUE 3 #define NF_REPEAT 4 -#define NF_MAX_VERDICT NF_REPEAT +#define NF_STOP 5 +#define NF_MAX_VERDICT NF_STOP /* Generic cache responses from hook functions. <= 0x2000 is used for protocol-flags. */ @@ -138,23 +139,34 @@ void nf_log_packet(int pf, /* This is gross, but inline doesn't cut it for avoiding the function call in fast path: gcc doesn't inline (needs value tracking?). --RR */ #ifdef CONFIG_NETFILTER_DEBUG -#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) \ - nf_hook_slow((pf), (hook), (skb), (indev), (outdev), (okfn), INT_MIN) -#define NF_HOOK_THRESH nf_hook_slow +#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) \ +({int __ret = 0; \ +if (!nf_hook_slow(pf, hook, &(skb), indev, outdev, okfn, INT_MIN, &__ret); \ + __ret = (okfn)(skb); \ +__ret;}) +#define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh) \ +({int __ret = 0; \ +if (!nf_hook_slow(pf, hook, &(skb), indev, outdev, okfn, thresh, &__ret); \ + __ret = (okfn)(skb); \ +__ret;}) #else -#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) \ -(list_empty(&nf_hooks[(pf)][(hook)]) \ - ? (okfn)(skb) \ - : nf_hook_slow((pf), (hook), (skb), (indev), (outdev), (okfn), INT_MIN)) -#define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh) \ -(list_empty(&nf_hooks[(pf)][(hook)]) \ - ? (okfn)(skb) \ - : nf_hook_slow((pf), (hook), (skb), (indev), (outdev), (okfn), (thresh))) +#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) \ +({int __ret = 0; \ +if (list_empty(&nf_hooks[pf][hook]) || \ + !nf_hook_slow(pf, hook, &(skb), indev, outdev, okfn, INT_MIN, &__ret)) \ + __ret = (okfn)(skb); \ +__ret;}) +#define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh) \ +({int __ret = 0; \ +if (list_empty(&nf_hooks[pf][hook]) || \ + !nf_hook_slow(pf, hook, &(skb), indev, outdev, okfn, thresh, &__ret)) \ + __ret = (okfn)(skb); \ +__ret;}) #endif -int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb, +int nf_hook_slow(int pf, unsigned int hook, struct sk_buff **pskb, struct net_device *indev, struct net_device *outdev, - int (*okfn)(struct sk_buff *), int thresh); + int (*okfn)(struct sk_buff *), int thresh, int *ret); /* Call setsockopt() */ int nf_setsockopt(struct sock *sk, int pf, int optval, char __user *opt, --- linux-2.6.1-rc1/net/core/netfilter.c.old 2005-01-20 21:38:59.000000000 +0100 +++ linux-2.6.1-rc1/net/core/netfilter.c 2005-01-22 22:08:41.000000000 +0100 @@ -349,6 +349,8 @@ static unsigned int nf_iterate(struct li int (*okfn)(struct sk_buff *), int hook_thresh) { + unsigned int verdict; + /* * The caller must not block between calls to this * function because of risk of continuing from deleted element. @@ -361,28 +363,18 @@ static unsigned int nf_iterate(struct li /* Optimization: we don't need to hold module reference here, since function can't sleep. --RR */ - switch (elem->hook(hook, skb, indev, outdev, okfn)) { - case NF_QUEUE: - return NF_QUEUE; - - case NF_STOLEN: - return NF_STOLEN; - - case NF_DROP: - return NF_DROP; - - case NF_REPEAT: - *i = (*i)->prev; - break; - + verdict = elem->hook(hook, skb, indev, outdev, okfn); + if (verdict != NF_ACCEPT) { #ifdef CONFIG_NETFILTER_DEBUG - case NF_ACCEPT: - break; - - default: - NFDEBUG("Evil return from %p(%u).\n", - elem->hook, hook); + if (verdict > NF_MAX_VERDICT) { + NFDEBUG("Evil return from %p(%u).\n", + elem->hook, hook); + continue; + } #endif + if (verdict != NF_REPEAT) + return verdict; + *i = (*i)->prev; } } return NF_ACCEPT; @@ -494,50 +486,47 @@ static int nf_queue(struct sk_buff *skb, return 1; } -int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb, +/* Returns 0 if okfn() needs to be executed by the caller, -EPERM otherwise. + * Assumes *ret==0 when called. On return, *ret!=0 when verdict==NF_DROP */ +int nf_hook_slow(int pf, unsigned int hook, struct sk_buff **pskb, struct net_device *indev, struct net_device *outdev, int (*okfn)(struct sk_buff *), - int hook_thresh) + int hook_thresh, int *ret) { struct list_head *elem; unsigned int verdict; - int ret = 0; + int ret2 = 0; /* We may already have this, but read-locks nest anyway */ rcu_read_lock(); #ifdef CONFIG_NETFILTER_DEBUG - if (skb->nf_debug & (1 << hook)) { + if ((*pskb)->nf_debug & (1 << hook)) { printk("nf_hook: hook %i already set.\n", hook); - nf_dump_skb(pf, skb); + nf_dump_skb(pf, *pskb); } skb->nf_debug |= (1 << hook); #endif elem = &nf_hooks[pf][hook]; next_hook: - verdict = nf_iterate(&nf_hooks[pf][hook], &skb, hook, indev, + verdict = nf_iterate(&nf_hooks[pf][hook], pskb, hook, indev, outdev, &elem, okfn, hook_thresh); - if (verdict == NF_QUEUE) { + if (verdict == NF_ACCEPT || verdict == NF_STOP) + goto unlock; + else if (verdict == NF_DROP) { + kfree_skb(*pskb); + *ret = -EPERM; + } else if (verdict == NF_QUEUE) { NFDEBUG("nf_hook: Verdict = QUEUE.\n"); - if (!nf_queue(skb, elem, pf, hook, indev, outdev, okfn)) + if (!nf_queue(*pskb, elem, pf, hook, indev, outdev, okfn)) goto next_hook; } - - switch (verdict) { - case NF_ACCEPT: - ret = okfn(skb); - break; - - case NF_DROP: - kfree_skb(skb); - ret = -EPERM; - break; - } - + ret2 = -EPERM; +unlock: rcu_read_unlock(); - return ret; + return ret2; } void nf_reinject(struct sk_buff *skb, struct nf_info *info, --- linux-2.6.1-rc1/net/bridge/br_netfilter.c.old 2005-01-20 21:43:08.000000000 +0100 +++ linux-2.6.1-rc1/net/bridge/br_netfilter.c 2005-01-22 21:20:06.000000000 +0100 @@ -829,8 +829,7 @@ static unsigned int ip_sabotage_in(unsig { if ((*pskb)->nf_bridge && !((*pskb)->nf_bridge->mask & BRNF_NF_BRIDGE_PREROUTING)) { - okfn(*pskb); - return NF_STOLEN; + return NF_STOP; } return NF_ACCEPT; @@ -888,8 +887,7 @@ static unsigned int ip_sabotage_out(unsi if (out->priv_flags & IFF_802_1Q_VLAN) nf_bridge->netoutdev = (struct net_device *)out; #endif - okfn(skb); - return NF_STOLEN; + return NF_STOP; } return NF_ACCEPT; From romieu@fr.zoreil.com Sat Jan 22 14:29:57 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Jan 2005 14:30:03 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0MMTued001250 for ; Sat, 22 Jan 2005 14:29:57 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.13.1/8.12.1) with ESMTP id j0MMQk7O025333; Sat, 22 Jan 2005 23:26:46 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.13.1/8.13.1/Submit) id j0MMQeb5025332; Sat, 22 Jan 2005 23:26:41 +0100 Date: Sat, 22 Jan 2005 23:26:40 +0100 From: Francois Romieu To: Daniele Venzano Cc: Jeff Garzik , NetDev Subject: Re: [PATCH 1/5] sis900 printk audit Message-ID: <20050122222640.GB24461@electric-eye.fr.zoreil.com> References: <20050122214657.18649.66345@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050122214657.18649.66345@localhost.localdomain> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 655 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Daniele Venzano : [...] > Index: sis900.c > =================================================================== > --- a/drivers/net/sis900.c (revision 83) > +++ b/drivers/net/sis900.c (revision 84) [...] > @@ -1906,8 +1918,22 @@ > strcpy (info->bus_info, pci_name(sis_priv->pci_dev)); > } > > +static u32 sis900_get_msglevel(struct net_device *net_dev) > +{ > + struct sis900_private *sis_priv = net_dev->priv; s/net_dev->priv/netdev_priv/ -- Ueimor From romieu@fr.zoreil.com Sat Jan 22 14:29:57 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Jan 2005 14:30:02 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0MMTuAN001249 for ; Sat, 22 Jan 2005 14:29:57 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.13.1/8.12.1) with ESMTP id j0MMQOM7025327; Sat, 22 Jan 2005 23:26:24 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.13.1/8.13.1/Submit) id j0MMQJD1025326; Sat, 22 Jan 2005 23:26:19 +0100 Date: Sat, 22 Jan 2005 23:26:18 +0100 From: Francois Romieu To: Daniele Venzano Cc: Jeff Garzik , NetDev Subject: Re: [PATCH 3/5] sis900 printk audit Message-ID: <20050122222618.GA24461@electric-eye.fr.zoreil.com> References: <20050122214657.18649.66345@localhost.localdomain> <20050122214659.18649.83119@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050122214659.18649.83119@localhost.localdomain> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 654 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Daniele Venzano : [...] > Index: sis900.c > =================================================================== > --- a/drivers/net/sis900.c (revision 85) > +++ b/drivers/net/sis900.c (revision 86) [...] > @@ -275,7 +275,7 @@ > if (!isa_bridge) > isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0018, isa_bridge); > if (!isa_bridge) { > - printk("%s: Can not find ISA bridge\n", net_dev->name); > + printk(KERN_WARNING "%s: Can not find ISA bridge\n", net_dev->name); > return 0; > } > pci_read_config_byte(isa_bridge, 0x48, ®); > @@ -567,7 +567,7 @@ > continue; > > if ((mii_phy = kmalloc(sizeof(struct mii_phy), GFP_KERNEL)) == NULL) { > - printk(KERN_INFO "Cannot allocate mem for struct mii_phy\n"); > + printk(KERN_WARNING "Cannot allocate mem for struct mii_phy\n"); -> printk(KERN_WARNING "%s: Cannot allocate mem for struct mii_phy\n", ...) ? Btw it may make sense to use pci_name() instead of the name associated with the struct net_device until it is known for sure that the net_device will not be removed due to a failure of the probe() method. -- Ueimor From romieu@fr.zoreil.com Sat Jan 22 15:05:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Jan 2005 15:06:00 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0MN5j3U003069 for ; Sat, 22 Jan 2005 15:05:46 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.13.1/8.12.1) with ESMTP id j0MN24sH025877; Sun, 23 Jan 2005 00:02:04 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.13.1/8.13.1/Submit) id j0MN1uiQ025876; Sun, 23 Jan 2005 00:01:56 +0100 Date: Sun, 23 Jan 2005 00:01:56 +0100 From: Francois Romieu To: Richard Dawe Cc: netdev@oss.sgi.com Subject: Re: Acer Aspire 1524WLMi and RealTek 8169 - very slow Message-ID: <20050122230156.GC24461@electric-eye.fr.zoreil.com> References: <41A09541.5040405@phekda.gotadsl.co.uk> <41A0F0D5.9050702@phekda.gotadsl.co.uk> <20041121205814.GA22460@electric-eye.fr.zoreil.com> <41A24F35.5080106@phekda.gotadsl.co.uk> <20041122213008.GA9618@electric-eye.fr.zoreil.com> <41D2844E.5070204@phekda.gotadsl.co.uk> <20041229235203.GA5465@electric-eye.fr.zoreil.com> <41F250D1.8000207@phekda.gotadsl.co.uk> <41F26FD1.2060407@phekda.gotadsl.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F26FD1.2060407@phekda.gotadsl.co.uk> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 656 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Richard Dawe : [...] > So I looked at the latest RealTek driver for Linux (version 220) and > that has some separate initialisation code for RTL_GIGA_MAC_VER_X > (MCFG_METHOD_4, they call it). I ported that over to r8169.c in > 2.6.11-rc1 and it appears to work. Nice. Have you checked that ethtool performs correctly when you try to set the link parameters with the new code (+ plug/unplug cable) ? > Attached is the patch against 2.6.11-rc1. I'm not sure if it caters to > your tastes. Maybe you'll want to rename RTL_GIGA_MAC_VER_X. I'll change the braces placement, the tab/spaces mix and push it. Please include something like the line below in your future patches: Signed-off-by: Richard Dawe Thanks. -- Ueimor From gandalf@wlug.westbo.se Sat Jan 22 15:22:41 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Jan 2005 15:22:47 -0800 (PST) Received: from null.rsn.bth.se (postfix@null.rsn.bth.se [194.47.142.3]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0MNMeqH003886 for ; Sat, 22 Jan 2005 15:22:41 -0800 Received: by null.rsn.bth.se (Postfix, from userid 65534) id 55CB02C007B; Sun, 23 Jan 2005 00:22:35 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by null.rsn.bth.se (Postfix) with ESMTP id CD83E2C005D; Sun, 23 Jan 2005 00:22:34 +0100 (CET) Received: from tux.rsn.bth.se (tux.rsn.bth.se [194.47.143.135]) by null.rsn.bth.se (Postfix) with ESMTP id 072012C007B; Sun, 23 Jan 2005 00:22:34 +0100 (CET) Received: by tux.rsn.bth.se (Postfix, from userid 501) id 244134045; Sun, 23 Jan 2005 00:22:34 +0100 (CET) Subject: Re: [PATCH/RFC] Reduce call chain length in netfilter (was: Re: do_IRQ: stack overflow: 872..) From: Martin Josefsson To: Bart De Schuymer Cc: "David S. Miller" , shemminger@osdl.org, dwmw2@infradead.org, ak@suse.de, snort2004@mail.ru, bridge@osdl.org, netdev@oss.sgi.com, Rusty Russell In-Reply-To: <1106433059.4486.11.camel@localhost.localdomain> References: <1131604877.20041218092730@mail.ru.suse.lists.linux.kernel> <1105117559.11753.34.camel@baythorne.infradead.org> <20050107100017.454ddadc@dxpl.pdx.osdl.net> <1105133241.3375.16.camel@localhost.localdomain> <20050118135735.4b77d38d.davem@davemloft.net> <1106433059.4486.11.camel@localhost.localdomain> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-JRxNfi+FN1JWlIJKUTiK" Date: Sun, 23 Jan 2005 00:22:33 +0100 Message-Id: <1106436153.20995.42.camel@tux.rsn.bth.se> Mime-Version: 1.0 X-Mailer: Evolution 2.0.3 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: by amavisd-new-20030616-p10 on null.rsn.bth.se X-Virus-Status: Clean X-archive-position: 657 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: gandalf@wlug.westbo.se Precedence: bulk X-list: netdev --=-JRxNfi+FN1JWlIJKUTiK Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Sat, 2005-01-22 at 23:30 +0100, Bart De Schuymer wrote: Hi Bart > @@ -138,23 +139,34 @@ void nf_log_packet(int pf, > /* This is gross, but inline doesn't cut it for avoiding the function > call in fast path: gcc doesn't inline (needs value tracking?). --RR *= / > #ifdef CONFIG_NETFILTER_DEBUG > -#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) \ > - nf_hook_slow((pf), (hook), (skb), (indev), (outdev), (okfn), INT_MIN) > -#define NF_HOOK_THRESH nf_hook_slow > +#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) \ > +({int __ret =3D 0; \ > +if (!nf_hook_slow(pf, hook, &(skb), indev, outdev, okfn, INT_MIN, &__ret= ); \ > + __ret =3D (okfn)(skb); \ > +__ret;}) > +#define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh) \ > +({int __ret =3D 0; \ > +if (!nf_hook_slow(pf, hook, &(skb), indev, outdev, okfn, thresh, &__ret)= ; \ > + __ret =3D (okfn)(skb); \ > +__ret;}) > #else I guess you never testcompiled with CONFIG_NETFILTER_DEBUG set :) The if-statements above needs to have ; replaced with ) > + if (verdict > NF_MAX_VERDICT) { > + NFDEBUG("Evil return from %p(%u).\n", > + elem->hook, hook); > + continue; > + } Maybe add unlikely() around the test? Otherwise the changes look sane. The reoganisation of things in nf_hook_slow() shouldn't cause any performance changes, I tried to benchmark various variations of that code some time ago but the result of the changes were more or less in the noise. --=20 /Martin --=-JRxNfi+FN1JWlIJKUTiK Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQBB8uA5Wm2vlfa207ERAtENAKC7lltDMufYxml4xtGpqJbU8f9xbwCeI5IR NYu/J4GXYnePqaOWQvzds3s= =pdyD -----END PGP SIGNATURE----- --=-JRxNfi+FN1JWlIJKUTiK-- From magnus@alum.mit.edu Sat Jan 22 16:36:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Jan 2005 16:37:00 -0800 (PST) Received: from mail26.sea5.speakeasy.net (mail26.sea5.speakeasy.net [69.17.117.28]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0N0aq7D009392 for ; Sat, 22 Jan 2005 16:36:53 -0800 Received: (qmail 29553 invoked from network); 23 Jan 2005 00:36:52 -0000 Received: from dsl092-162-116.wdc2.dsl.speakeasy.net (HELO m5.risacher.org) ([66.92.162.116]) (envelope-sender ) by mail26.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 23 Jan 2005 00:36:52 -0000 Received: from magnus by m5.risacher.org with local (Exim 3.36 #1 (Debian)) id 1CsVkJ-0004R5-00; Sat, 22 Jan 2005 19:36:51 -0500 From: Daniel Risacher To: bridge@osdl.org, netdev@oss.sgi.com Subject: Unexpected bridge behavior (Bug? You decide.) Reply-to: magnus@alum.mit.edu Message-Id: Date: Sat, 22 Jan 2005 19:36:51 -0500 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 658 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: magnus@alum.mit.edu Precedence: bulk X-list: netdev While using the linux bridge module in 2.6.10, the kernel seems to munge the source IP address of broadcast UDP packets if they come from "0.0.0.1", and sticks on an address of the linux host. I humbly submit that re-writing the source address of packets is not proper behavior for a bridge, even if those source addresses are not traditionally valid. Sure, 0.0.0.1 isn't a valid address, but it's used by the XBOX games for "System Link" play. See http://caia.swin.edu.au/genius/020802A/ for more details, but basically XBOXes talk to each other by sending UDP port 3074 packets with 0.0.0.1 as the source address. When searching for other XBOX systems, these are broadcast packets addressed to 255.255.255.255/ff:ff:ff:ff:ff:ff. So I was trying to get two XBOXes to talk to each other through a Linux machine configured as a bridge, (mostly so I could watch the traffic) and it didn't work. Here's what tcpdump saw: $ sudo brctl show br0 bridge name bridge id STP enabled interfaces br0 8000.00112f9de921 yes eth0 eth2 $ sudo tcpdump -n -e -i eth0 port 3074 tcpdump: WARNING: eth0: no IPv4 address assigned tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes 19:28:27.715755 00:50:f2:f1:fb:07 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 102: IP 0.0.0.1.3074 > 255.255.255.255.3074: UDP, length: 60 ### line above appears to be xbox 1 broadcasting to find other hosts 19:28:28.772223 00:50:f2:ba:39:89 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 102: IP 66.92.162.116.3074 > 255.255.255.255.3074: UDP, length: 60 ### line above is linux bridge forwarding packet from xbox 2, I think. Note IP address is of linux box, not 0.0.0.1 $ sudo tcpdump -n -e -i eth2 port 3074 tcpdump: WARNING: eth2: no IPv4 address assigned tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth2, link-type EN10MB (Ethernet), capture size 96 bytes 19:28:27.715816 00:50:f2:f1:fb:07 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 102: IP 66.92.162.116.3074 > 255.255.255.255.3074: UDP, length: 60 ### line above is linux bridge forwarding packet from xbox 1. Note IP address is of linux box, not 0.0.0.1 19:28:28.772135 00:50:f2:ba:39:89 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 102: IP 0.0.0.1.3074 > 255.255.255.255.3074: UDP, length: 60 ### line above is xbox 2 broadcasting to find other hosts From dcbw@redhat.com Sat Jan 22 18:28:39 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Jan 2005 18:28:45 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0N2Scuc012817 for ; Sat, 22 Jan 2005 18:28:39 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j0N2SVR2021634; Sat, 22 Jan 2005 21:28:31 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j0N2SVO28530; Sat, 22 Jan 2005 21:28:31 -0500 Received: from devserv.devel.redhat.com (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.11/8.12.10) with ESMTP id j0N2SVWA014441; Sat, 22 Jan 2005 21:28:31 -0500 Received: from localhost (dcbw@localhost) by devserv.devel.redhat.com (8.12.11/8.12.11/Submit) with ESMTP id j0N2SUZI014437; Sat, 22 Jan 2005 21:28:30 -0500 Date: Sat, 22 Jan 2005 21:28:30 -0500 (EST) From: Dan Williams To: netdev@oss.sgi.com cc: jgarzik@redhat.com, hermes@gibson.dropbear.id.au Subject: [PATCH 2.6.11rc2] wireless/orinoco: Update printk()s from upstream orinoco Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="279707962-1385008808-1106446908=:11940" Content-ID: X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 659 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dcbw@redhat.com Precedence: bulk X-list: netdev This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --279707962-1385008808-1106446908=:11940 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-ID: [PATCH 2.6.11rc2] wireless/orinoco: Update printk()s from upstream orinoco Update printk() statements to reduce meaningless diff between upstream orinoco and in-kernel orinoco drivers. Signed-off-by: Dan Williams --- a/drivers/net/wireless/orinoco_plx.c.printk 2005-01-22 16:00:34.743895448 -0500 +++ b/drivers/net/wireless/orinoco_plx.c 2005-01-22 16:02:19.104030296 -0500 @@ -233,7 +233,8 @@ /* Allocate network device */ dev = alloc_orinocodev(0, NULL); - if (! dev) { + if (!dev) { + printk(KERN_ERR PFX "Cannot allocate network device\n"); err = -ENOMEM; goto fail; } @@ -254,15 +255,17 @@ err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ, dev->name, dev); if (err) { - printk(KERN_ERR PFX "Error allocating IRQ %d.\n", pdev->irq); + printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq); err = -EBUSY; goto fail; } dev->irq = pdev->irq; err = register_netdev(dev); - if (err) + if (err) { + printk(KERN_ERR PFX "Cannot register network device\n"); goto fail; + } return 0; --- a/drivers/net/wireless/orinoco.c.printk 2005-01-22 15:38:27.019740200 -0500 +++ b/drivers/net/wireless/orinoco.c 2005-01-22 16:11:17.045250800 -0500 @@ -805,8 +805,9 @@ desc.tx_control = cpu_to_le16(HERMES_TXCTRL_TX_OK | HERMES_TXCTRL_TX_EX); err = hermes_bap_pwrite(hw, USER_BAP, &desc, sizeof(desc), txfid, 0); if (err) { - printk(KERN_ERR "%s: Error %d writing Tx descriptor to BAP\n", - dev->name, err); + if (net_ratelimit()) + printk(KERN_ERR "%s: Error %d writing Tx descriptor " + "to BAP\n", dev->name, err); stats->tx_errors++; goto fail; } @@ -836,8 +837,9 @@ err = hermes_bap_pwrite(hw, USER_BAP, &hdr, sizeof(hdr), txfid, HERMES_802_3_OFFSET); if (err) { - printk(KERN_ERR "%s: Error %d writing packet header to BAP\n", - dev->name, err); + if (net_ratelimit()) + printk(KERN_ERR "%s: Error %d writing packet " + "header to BAP\n", dev->name, err); stats->tx_errors++; goto fail; } @@ -1297,8 +1299,8 @@ } break; default: - printk(KERN_DEBUG "%s: Unknown information frame received " - "(type %04x).\n", dev->name, type); + printk(KERN_DEBUG "%s: Unknown information frame received: " + "type 0x%04x, length %d\n", dev->name, type, len); /* We don't actually do anything about it */ break; } @@ -1307,7 +1309,7 @@ static void __orinoco_ev_infdrop(struct net_device *dev, hermes_t *hw) { if (net_ratelimit()) - printk(KERN_WARNING "%s: Information frame lost.\n", dev->name); + printk(KERN_DEBUG "%s: Information frame lost.\n", dev->name); } /********************************************************************/ @@ -1785,7 +1787,8 @@ } if (p) - printk(KERN_WARNING "Multicast list is longer than mc_count\n"); + printk(KERN_WARNING "%s: Multicast list is " + "longer than mc_count\n", dev->name); err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFGROUPADDRESSES, HERMES_BYTES_TO_RECLEN(priv->mc_count * ETH_ALEN), @@ -1882,13 +1885,14 @@ orinoco_unlock(priv, &flags); - if (priv->hard_reset) + if (priv->hard_reset) { err = (*priv->hard_reset)(priv); - if (err) { - printk(KERN_ERR "%s: orinoco_reset: Error %d " - "performing hard reset\n", dev->name, err); - /* FIXME: shutdown of some sort */ - return; + if (err) { + printk(KERN_ERR "%s: orinoco_reset: Error %d " + "performing hard reset\n", dev->name, err); + /* FIXME: shutdown of some sort */ + return; + } } err = orinoco_reinit_firmware(dev); @@ -2044,7 +2048,7 @@ /* Get the firmware version */ err = HERMES_READ_RECORD(hw, USER_BAP, HERMES_RID_STAID, &sta_id); if (err) { - printk(KERN_WARNING "%s: Error %d reading firmware info. Wildly guessing capabilities...\n", + printk(KERN_ERR "%s: Cannot read station identity: error %d\n", dev->name, err); memset(&sta_id, 0, sizeof(sta_id)); } @@ -2053,7 +2057,7 @@ le16_to_cpus(&sta_id.variant); le16_to_cpus(&sta_id.major); le16_to_cpus(&sta_id.minor); - printk(KERN_DEBUG "%s: Station identity %04x:%04x:%04x:%04x\n", + printk(KERN_DEBUG "%s: Station identity %04x:%04x:%04x:%04x\n", dev->name, sta_id.id, sta_id.variant, sta_id.major, sta_id.minor); @@ -3045,8 +3049,9 @@ priv->mwo_robust = 0; else { if (frq->fixed) - printk(KERN_WARNING "%s: Fixed fragmentation not \ -supported on this firmware. Using MWO robust instead.\n", dev->name); + printk(KERN_WARNING "%s: Fixed fragmentation is " + "not supported on this firmware. " + "Using MWO robust instead.\n", dev->name); priv->mwo_robust = 1; } } else { --- a/drivers/net/wireless/hermes.c.printk 2005-01-22 15:30:50.156194016 -0500 +++ b/drivers/net/wireless/hermes.c 2005-01-22 15:37:31.151233504 -0500 @@ -67,8 +67,7 @@ * Debugging helpers */ -#define IO_TYPE(hw) ((hw)->io_space ? "IO " : "MEM ") -#define DMSG(stuff...) do {printk(KERN_DEBUG "hermes @ %s0x%x: " , IO_TYPE(hw), hw->iobase); \ +#define DMSG(stuff...) do {printk(KERN_DEBUG "hermes @ %p: " , hw->iobase); \ printk(stuff);} while (0) #undef HERMES_DEBUG @@ -200,9 +199,9 @@ } if (! (reg & HERMES_EV_CMD)) { - printk(KERN_ERR "hermes @ %s0x%lx: " + printk(KERN_ERR "hermes @ %p: " "Timeout waiting for card to reset (reg=0x%04x)!\n", - IO_TYPE(hw), hw->iobase, reg); + hw->iobase, reg); err = -ETIMEDOUT; goto out; } @@ -235,13 +234,16 @@ err = hermes_issue_cmd(hw, cmd, parm0); if (err) { if (! hermes_present(hw)) { - printk(KERN_WARNING "hermes @ %s0x%lx: " - "Card removed while issuing command.\n", - IO_TYPE(hw), hw->iobase); + if (net_ratelimit()) + printk(KERN_WARNING "hermes @ %p: " + "Card removed while issuing command " + "0x%04x.\n", hw->iobase, cmd); err = -ENODEV; } else - printk(KERN_ERR "hermes @ %s0x%lx: Error %d issuing command.\n", - IO_TYPE(hw), hw->iobase, err); + if (net_ratelimit()) + printk(KERN_ERR "hermes @ %p: " + "Error %d issuing command 0x%04x.\n", + hw->iobase, err, cmd); goto out; } @@ -254,17 +256,16 @@ } if (! hermes_present(hw)) { - printk(KERN_WARNING "hermes @ %s0x%lx: " - "Card removed while waiting for command completion.\n", - IO_TYPE(hw), hw->iobase); + printk(KERN_WARNING "hermes @ %p: Card removed " + "while waiting for command 0x%04x completion.\n", + hw->iobase, cmd); err = -ENODEV; goto out; } if (! (reg & HERMES_EV_CMD)) { - printk(KERN_ERR "hermes @ %s0x%lx: " - "Timeout waiting for command completion.\n", - IO_TYPE(hw), hw->iobase); + printk(KERN_ERR "hermes @ %p: Timeout waiting for " + "command 0x%04x completion.\n", hw->iobase, cmd); err = -ETIMEDOUT; goto out; } @@ -309,16 +310,16 @@ } if (! hermes_present(hw)) { - printk(KERN_WARNING "hermes @ %s0x%lx: " + printk(KERN_WARNING "hermes @ %p: " "Card removed waiting for frame allocation.\n", - IO_TYPE(hw), hw->iobase); + hw->iobase); return -ENODEV; } if (! (reg & HERMES_EV_ALLOC)) { - printk(KERN_ERR "hermes @ %s0x%lx: " + printk(KERN_ERR "hermes @ %p: " "Timeout waiting for frame allocation\n", - IO_TYPE(hw), hw->iobase); + hw->iobase); return -ETIMEDOUT; } @@ -383,12 +384,17 @@ reg = hermes_read_reg(hw, oreg); } - if (reg & HERMES_OFFSET_BUSY) { - return -ETIMEDOUT; - } + if (reg != offset) { + printk(KERN_ERR "hermes @ %p: BAP%d offset %s: " + "reg=0x%x id=0x%x offset=0x%x\n", hw->iobase, bap, + (reg & HERMES_OFFSET_BUSY) ? "timeout" : "error", + reg, id, offset); + + if (reg & HERMES_OFFSET_BUSY) { + return -ETIMEDOUT; + } - if (reg & HERMES_OFFSET_ERR) { - return -EIO; + return -EIO; /* error or wrong offset */ } return 0; @@ -484,14 +490,13 @@ *length = rlength; if (rtype != rid) - printk(KERN_WARNING "hermes @ %s0x%lx: " - "hermes_read_ltv(): rid (0x%04x) does not match type (0x%04x)\n", - IO_TYPE(hw), hw->iobase, rid, rtype); + printk(KERN_WARNING "hermes @ %p: %s(): " + "rid (0x%04x) does not match type (0x%04x)\n", + hw->iobase, __FUNCTION__, rid, rtype); if (HERMES_RECLEN_TO_BYTES(rlength) > bufsize) - printk(KERN_WARNING "hermes @ %s0x%lx: " + printk(KERN_WARNING "hermes @ %p: " "Truncating LTV record from %d to %d bytes. " - "(rid=0x%04x, len=0x%04x)\n", - IO_TYPE(hw), hw->iobase, + "(rid=0x%04x, len=0x%04x)\n", hw->iobase, HERMES_RECLEN_TO_BYTES(rlength), bufsize, rid, rlength); nwords = min((unsigned)rlength - 1, bufsize / 2); --- a/drivers/net/wireless/orinoco.h.printk 2005-01-22 15:55:00.374727288 -0500 +++ b/drivers/net/wireless/orinoco.h 2005-01-22 15:55:37.219126088 -0500 @@ -127,7 +127,7 @@ { spin_lock_irqsave(&priv->lock, *flags); if (priv->hw_unavailable) { - printk(KERN_DEBUG "orinoco_lock() called with hw_unavailable (dev=%p)\n", + DEBUG(1, "orinoco_lock() called with hw_unavailable (dev=%p)\n", priv->ndev); spin_unlock_irqrestore(&priv->lock, *flags); return -EBUSY; --- a/drivers/net/wireless/orinoco_cs.c.printk 2005-01-22 15:51:59.049292944 -0500 +++ b/drivers/net/wireless/orinoco_cs.c 2005-01-22 15:54:09.128517896 -0500 @@ -390,7 +390,7 @@ last_ret = pcmcia_get_next_tuple(handle, &tuple); if (last_ret == CS_NO_MORE_ITEMS) { printk(KERN_ERR PFX "GetNextTuple(): No matching " - "CIS configuration, maybe you need the " + "CIS configuration. Maybe you need the " "ignore_cis_vcc=1 parameter.\n"); goto cs_failed; } --- a/drivers/net/wireless/orinoco_tmd.c.printk 2005-01-22 16:02:48.677534440 -0500 +++ b/drivers/net/wireless/orinoco_tmd.c 2005-01-22 16:04:42.437240336 -0500 @@ -91,15 +91,16 @@ struct net_device *dev = NULL; err = pci_enable_device(pdev); - if (err) - return -EIO; + if (err) { + printk(KERN_ERR PFX "Cannot enable PCI device\n"); + return err; + } printk(KERN_DEBUG PFX "TMD setup\n"); pccard_ioaddr = pci_resource_start(pdev, 2); pccard_iolen = pci_resource_len(pdev, 2); if (! request_region(pccard_ioaddr, pccard_iolen, DRIVER_NAME)) { - printk(KERN_ERR PFX "I/O resource at 0x%lx len 0x%lx busy\n", - pccard_ioaddr, pccard_iolen); + printk(KERN_ERR PFX "Cannot obtain PCI resources\n"); pccard_ioaddr = 0; err = -EBUSY; goto fail; @@ -117,6 +118,7 @@ /* Allocate network device */ dev = alloc_orinocodev(0, NULL); if (! dev) { + printk(KERN_ERR PFX "Cannot allocate network device\n"); err = -ENOMEM; goto fail; } @@ -137,16 +139,17 @@ err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ, dev->name, dev); if (err) { - printk(KERN_ERR PFX "Error allocating IRQ %d.\n", - pdev->irq); + printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq); err = -EBUSY; goto fail; } dev->irq = pdev->irq; err = register_netdev(dev); - if (err) - goto fail; + if (err) { + printk(KERN_ERR PFX "Cannot register network device\n"); + goto fail; + } return 0; --- a/drivers/net/wireless/orinoco_pci.c.printk 2005-01-22 15:56:16.569143976 -0500 +++ b/drivers/net/wireless/orinoco_pci.c 2005-01-22 16:13:31.993735512 -0500 @@ -183,7 +183,6 @@ printk(KERN_ERR PFX "Busy timeout\n"); return -ETIMEDOUT; } - printk(KERN_NOTICE "pci_cor : reg = 0x%X - %lX - %lX\n", reg, timeout, jiffies); return 0; } @@ -202,15 +201,19 @@ struct net_device *dev = NULL; err = pci_enable_device(pdev); - if (err) - return -EIO; + if (err) { + printk(KERN_ERR PFX "Cannot enable PCI device\n"); + return err; + } /* Resource 0 is mapped to the hermes registers */ pci_iorange = pci_resource_start(pdev, 0); pci_iolen = pci_resource_len(pdev, 0); pci_ioaddr = ioremap(pci_iorange, pci_iolen); - if (! pci_iorange) + if (!pci_iorange) { + printk(KERN_ERR PFX "Cannot remap hardware registers\n"); goto fail; + } /* Allocate network device */ dev = alloc_orinocodev(0, NULL); @@ -237,8 +240,7 @@ err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ, dev->name, dev); if (err) { - printk(KERN_ERR PFX "Error allocating IRQ %d.\n", - pdev->irq); + printk(KERN_ERR PFX "Cannot allocate IRQ %d\n", pdev->irq); err = -EBUSY; goto fail; } @@ -246,7 +248,7 @@ /* Perform a COR reset to start the card */ if(orinoco_pci_cor_reset(priv) != 0) { - printk(KERN_ERR "%s: Failed to start the card\n", dev->name); + printk(KERN_ERR PFX "Initial reset failed\n"); err = -ETIMEDOUT; goto fail; } @@ -257,7 +259,7 @@ err = register_netdev(dev); if (err) { - printk(KERN_ERR "%s: Failed to register net device\n", dev->name); + printk(KERN_ERR PFX "Failed to register net device\n"); goto fail; } --- a/drivers/net/wireless/airport.c.printk 2005-01-22 15:26:54.221061608 -0500 +++ b/drivers/net/wireless/airport.c 2005-01-22 15:28:55.964553784 -0500 @@ -194,14 +194,14 @@ hermes_t *hw; if (macio_resource_count(mdev) < 1 || macio_irq_count(mdev) < 1) { - printk(KERN_ERR PFX "wrong interrupt/addresses in OF tree\n"); + printk(KERN_ERR PFX "Wrong interrupt/addresses in OF tree\n"); return -ENODEV; } /* Allocate space for private device-specific data */ dev = alloc_orinocodev(sizeof(*card), airport_hard_reset); if (! dev) { - printk(KERN_ERR PFX "can't allocate device datas\n"); + printk(KERN_ERR PFX "Cannot allocate network device\n"); return -ENODEV; } priv = netdev_priv(dev); @@ -224,11 +224,11 @@ /* Setup interrupts & base address */ dev->irq = macio_irq(mdev, 0); phys_addr = macio_resource_start(mdev, 0); /* Physical address */ - printk(KERN_DEBUG PFX "Airport at physical address %lx\n", phys_addr); + printk(KERN_DEBUG PFX "Physical address %lx\n", phys_addr); dev->base_addr = phys_addr; card->vaddr = ioremap(phys_addr, AIRPORT_IO_LEN); if (!card->vaddr) { - printk(PFX "ioremap() failed\n"); + printk(KERN_ERR PFX "ioremap() failed\n"); goto failed; } @@ -253,7 +253,7 @@ printk(KERN_ERR PFX "register_netdev() failed\n"); goto failed; } - printk(KERN_DEBUG PFX "card registered for interface %s\n", dev->name); + printk(KERN_DEBUG PFX "Card registered for interface %s\n", dev->name); card->ndev_registered = 1; return 0; failed: --279707962-1385008808-1106446908=:11940 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME="1.orinoco-merge-printk-fixes.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: ATTACHMENT; FILENAME="1.orinoco-merge-printk-fixes.patch" LS0tIGEvZHJpdmVycy9uZXQvd2lyZWxlc3Mvb3Jpbm9jb19wbHguYy5wcmlu dGsJMjAwNS0wMS0yMiAxNjowMDozNC43NDM4OTU0NDggLTA1MDANCisrKyBi L2RyaXZlcnMvbmV0L3dpcmVsZXNzL29yaW5vY29fcGx4LmMJMjAwNS0wMS0y MiAxNjowMjoxOS4xMDQwMzAyOTYgLTA1MDANCkBAIC0yMzMsNyArMjMzLDgg QEANCiANCiAJLyogQWxsb2NhdGUgbmV0d29yayBkZXZpY2UgKi8NCiAJZGV2 ID0gYWxsb2Nfb3Jpbm9jb2RldigwLCBOVUxMKTsNCi0JaWYgKCEgZGV2KSB7 DQorCWlmICghZGV2KSB7DQorCQlwcmludGsoS0VSTl9FUlIgUEZYICJDYW5u b3QgYWxsb2NhdGUgbmV0d29yayBkZXZpY2VcbiIpOw0KIAkJZXJyID0gLUVO T01FTTsNCiAJCWdvdG8gZmFpbDsNCiAJfQ0KQEAgLTI1NCwxNSArMjU1LDE3 IEBADQogCWVyciA9IHJlcXVlc3RfaXJxKHBkZXYtPmlycSwgb3Jpbm9jb19p bnRlcnJ1cHQsIFNBX1NISVJRLA0KIAkJCSAgZGV2LT5uYW1lLCBkZXYpOw0K IAlpZiAoZXJyKSB7DQotCQlwcmludGsoS0VSTl9FUlIgUEZYICJFcnJvciBh bGxvY2F0aW5nIElSUSAlZC5cbiIsIHBkZXYtPmlycSk7DQorCQlwcmludGso S0VSTl9FUlIgUEZYICJDYW5ub3QgYWxsb2NhdGUgSVJRICVkXG4iLCBwZGV2 LT5pcnEpOw0KIAkJZXJyID0gLUVCVVNZOw0KIAkJZ290byBmYWlsOw0KIAl9 DQogCWRldi0+aXJxID0gcGRldi0+aXJxOw0KIA0KIAllcnIgPSByZWdpc3Rl cl9uZXRkZXYoZGV2KTsNCi0JaWYgKGVycikNCisJaWYgKGVycikgew0KKwkJ cHJpbnRrKEtFUk5fRVJSIFBGWCAiQ2Fubm90IHJlZ2lzdGVyIG5ldHdvcmsg ZGV2aWNlXG4iKTsNCiAJCWdvdG8gZmFpbDsNCisJfQ0KIA0KIAlyZXR1cm4g MDsNCiANCi0tLSBhL2RyaXZlcnMvbmV0L3dpcmVsZXNzL29yaW5vY28uYy5w cmludGsJMjAwNS0wMS0yMiAxNTozODoyNy4wMTk3NDAyMDAgLTA1MDANCisr KyBiL2RyaXZlcnMvbmV0L3dpcmVsZXNzL29yaW5vY28uYwkyMDA1LTAxLTIy IDE2OjExOjE3LjA0NTI1MDgwMCAtMDUwMA0KQEAgLTgwNSw4ICs4MDUsOSBA QA0KICAJZGVzYy50eF9jb250cm9sID0gY3B1X3RvX2xlMTYoSEVSTUVTX1RY Q1RSTF9UWF9PSyB8IEhFUk1FU19UWENUUkxfVFhfRVgpOw0KIAllcnIgPSBo ZXJtZXNfYmFwX3B3cml0ZShodywgVVNFUl9CQVAsICZkZXNjLCBzaXplb2Yo ZGVzYyksIHR4ZmlkLCAwKTsNCiAJaWYgKGVycikgew0KLQkJcHJpbnRrKEtF Uk5fRVJSICIlczogRXJyb3IgJWQgd3JpdGluZyBUeCBkZXNjcmlwdG9yIHRv IEJBUFxuIiwNCi0JCSAgICAgICBkZXYtPm5hbWUsIGVycik7DQorCQlpZiAo bmV0X3JhdGVsaW1pdCgpKQ0KKwkJCXByaW50ayhLRVJOX0VSUiAiJXM6IEVy cm9yICVkIHdyaXRpbmcgVHggZGVzY3JpcHRvciAiDQorCQkJICAgICAgICJ0 byBCQVBcbiIsIGRldi0+bmFtZSwgZXJyKTsNCiAJCXN0YXRzLT50eF9lcnJv cnMrKzsNCiAJCWdvdG8gZmFpbDsNCiAJfQ0KQEAgLTgzNiw4ICs4MzcsOSBA QA0KIAkJZXJyICA9IGhlcm1lc19iYXBfcHdyaXRlKGh3LCBVU0VSX0JBUCwg Jmhkciwgc2l6ZW9mKGhkciksDQogCQkJCQkgdHhmaWQsIEhFUk1FU184MDJf M19PRkZTRVQpOw0KIAkJaWYgKGVycikgew0KLQkJCXByaW50ayhLRVJOX0VS UiAiJXM6IEVycm9yICVkIHdyaXRpbmcgcGFja2V0IGhlYWRlciB0byBCQVBc biIsDQotCQkJICAgICAgIGRldi0+bmFtZSwgZXJyKTsNCisJCQlpZiAobmV0 X3JhdGVsaW1pdCgpKQ0KKwkJCQlwcmludGsoS0VSTl9FUlIgIiVzOiBFcnJv ciAlZCB3cml0aW5nIHBhY2tldCAiDQorCQkJCSAgICAgICAiaGVhZGVyIHRv IEJBUFxuIiwgZGV2LT5uYW1lLCBlcnIpOw0KIAkJCXN0YXRzLT50eF9lcnJv cnMrKzsNCiAJCQlnb3RvIGZhaWw7DQogCQl9DQpAQCAtMTI5Nyw4ICsxMjk5 LDggQEANCiAJfQ0KIAlicmVhazsNCiAJZGVmYXVsdDoNCi0JCXByaW50ayhL RVJOX0RFQlVHICIlczogVW5rbm93biBpbmZvcm1hdGlvbiBmcmFtZSByZWNl aXZlZCAiDQotCQkgICAgICAgIih0eXBlICUwNHgpLlxuIiwgZGV2LT5uYW1l LCB0eXBlKTsNCisJCXByaW50ayhLRVJOX0RFQlVHICIlczogVW5rbm93biBp bmZvcm1hdGlvbiBmcmFtZSByZWNlaXZlZDogIg0KKwkJICAgICAgICJ0eXBl IDB4JTA0eCwgbGVuZ3RoICVkXG4iLCBkZXYtPm5hbWUsIHR5cGUsIGxlbik7 DQogCQkvKiBXZSBkb24ndCBhY3R1YWxseSBkbyBhbnl0aGluZyBhYm91dCBp dCAqLw0KIAkJYnJlYWs7DQogCX0NCkBAIC0xMzA3LDcgKzEzMDksNyBAQA0K IHN0YXRpYyB2b2lkIF9fb3Jpbm9jb19ldl9pbmZkcm9wKHN0cnVjdCBuZXRf ZGV2aWNlICpkZXYsIGhlcm1lc190ICpodykNCiB7DQogCWlmIChuZXRfcmF0 ZWxpbWl0KCkpDQotCQlwcmludGsoS0VSTl9XQVJOSU5HICIlczogSW5mb3Jt YXRpb24gZnJhbWUgbG9zdC5cbiIsIGRldi0+bmFtZSk7DQorCQlwcmludGso S0VSTl9ERUJVRyAiJXM6IEluZm9ybWF0aW9uIGZyYW1lIGxvc3QuXG4iLCBk ZXYtPm5hbWUpOw0KIH0NCiANCiAvKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiov DQpAQCAtMTc4NSw3ICsxNzg3LDggQEANCiAJCX0NCiAJCQ0KIAkJaWYgKHAp DQotCQkJcHJpbnRrKEtFUk5fV0FSTklORyAiTXVsdGljYXN0IGxpc3QgaXMg bG9uZ2VyIHRoYW4gbWNfY291bnRcbiIpOw0KKwkJCXByaW50ayhLRVJOX1dB Uk5JTkcgIiVzOiBNdWx0aWNhc3QgbGlzdCBpcyAiDQorCQkJICAgICAgICJs b25nZXIgdGhhbiBtY19jb3VudFxuIiwgZGV2LT5uYW1lKTsNCiANCiAJCWVy ciA9IGhlcm1lc193cml0ZV9sdHYoaHcsIFVTRVJfQkFQLCBIRVJNRVNfUklE X0NORkdST1VQQUREUkVTU0VTLA0KIAkJCQkgICAgICAgSEVSTUVTX0JZVEVT X1RPX1JFQ0xFTihwcml2LT5tY19jb3VudCAqIEVUSF9BTEVOKSwNCkBAIC0x ODgyLDEzICsxODg1LDE0IEBADQogDQogCW9yaW5vY29fdW5sb2NrKHByaXYs ICZmbGFncyk7DQogDQotCWlmIChwcml2LT5oYXJkX3Jlc2V0KQ0KKwlpZiAo cHJpdi0+aGFyZF9yZXNldCkgew0KIAkJZXJyID0gKCpwcml2LT5oYXJkX3Jl c2V0KShwcml2KTsNCi0JaWYgKGVycikgew0KLQkJcHJpbnRrKEtFUk5fRVJS ICIlczogb3Jpbm9jb19yZXNldDogRXJyb3IgJWQgIg0KLQkJICAgICAgICJw ZXJmb3JtaW5nICBoYXJkIHJlc2V0XG4iLCBkZXYtPm5hbWUsIGVycik7DQot CQkvKiBGSVhNRTogc2h1dGRvd24gb2Ygc29tZSBzb3J0ICovDQotCQlyZXR1 cm47DQorCQlpZiAoZXJyKSB7DQorCQkJcHJpbnRrKEtFUk5fRVJSICIlczog b3Jpbm9jb19yZXNldDogRXJyb3IgJWQgIg0KKwkJCSAgICAgICAicGVyZm9y bWluZyBoYXJkIHJlc2V0XG4iLCBkZXYtPm5hbWUsIGVycik7DQorCQkJLyog RklYTUU6IHNodXRkb3duIG9mIHNvbWUgc29ydCAqLw0KKwkJCXJldHVybjsN CisJCX0NCiAJfQ0KIA0KIAllcnIgPSBvcmlub2NvX3JlaW5pdF9maXJtd2Fy ZShkZXYpOw0KQEAgLTIwNDQsNyArMjA0OCw3IEBADQogCS8qIEdldCB0aGUg ZmlybXdhcmUgdmVyc2lvbiAqLw0KIAllcnIgPSBIRVJNRVNfUkVBRF9SRUNP UkQoaHcsIFVTRVJfQkFQLCBIRVJNRVNfUklEX1NUQUlELCAmc3RhX2lkKTsN CiAJaWYgKGVycikgew0KLQkJcHJpbnRrKEtFUk5fV0FSTklORyAiJXM6IEVy cm9yICVkIHJlYWRpbmcgZmlybXdhcmUgaW5mby4gV2lsZGx5IGd1ZXNzaW5n IGNhcGFiaWxpdGllcy4uLlxuIiwNCisJCXByaW50ayhLRVJOX0VSUiAiJXM6 IENhbm5vdCByZWFkIHN0YXRpb24gaWRlbnRpdHk6IGVycm9yICVkXG4iLA0K IAkJICAgICAgIGRldi0+bmFtZSwgZXJyKTsNCiAJCW1lbXNldCgmc3RhX2lk LCAwLCBzaXplb2Yoc3RhX2lkKSk7DQogCX0NCkBAIC0yMDUzLDcgKzIwNTcs NyBAQA0KIAlsZTE2X3RvX2NwdXMoJnN0YV9pZC52YXJpYW50KTsNCiAJbGUx Nl90b19jcHVzKCZzdGFfaWQubWFqb3IpOw0KIAlsZTE2X3RvX2NwdXMoJnN0 YV9pZC5taW5vcik7DQotCXByaW50ayhLRVJOX0RFQlVHICIlczogU3RhdGlv biBpZGVudGl0eSAlMDR4OiUwNHg6JTA0eDolMDR4XG4iLA0KKwlwcmludGso S0VSTl9ERUJVRyAiJXM6IFN0YXRpb24gaWRlbnRpdHkgICUwNHg6JTA0eDol MDR4OiUwNHhcbiIsDQogCSAgICAgICBkZXYtPm5hbWUsIHN0YV9pZC5pZCwg c3RhX2lkLnZhcmlhbnQsDQogCSAgICAgICBzdGFfaWQubWFqb3IsIHN0YV9p ZC5taW5vcik7DQogDQpAQCAtMzA0NSw4ICszMDQ5LDkgQEANCiAJCQlwcml2 LT5td29fcm9idXN0ID0gMDsNCiAJCWVsc2Ugew0KIAkJCWlmIChmcnEtPmZp eGVkKQ0KLQkJCQlwcmludGsoS0VSTl9XQVJOSU5HICIlczogRml4ZWQgZnJh Z21lbnRhdGlvbiBub3QgXA0KLXN1cHBvcnRlZCBvbiB0aGlzIGZpcm13YXJl LiBVc2luZyBNV08gcm9idXN0IGluc3RlYWQuXG4iLCBkZXYtPm5hbWUpOw0K KwkJCQlwcmludGsoS0VSTl9XQVJOSU5HICIlczogRml4ZWQgZnJhZ21lbnRh dGlvbiBpcyAiDQorCQkJCSAgICAgICAibm90IHN1cHBvcnRlZCBvbiB0aGlz IGZpcm13YXJlLiAiDQorCQkJCSAgICAgICAiVXNpbmcgTVdPIHJvYnVzdCBp bnN0ZWFkLlxuIiwgZGV2LT5uYW1lKTsNCiAJCQlwcml2LT5td29fcm9idXN0 ID0gMTsNCiAJCX0NCiAJfSBlbHNlIHsNCi0tLSBhL2RyaXZlcnMvbmV0L3dp cmVsZXNzL2hlcm1lcy5jLnByaW50awkyMDA1LTAxLTIyIDE1OjMwOjUwLjE1 NjE5NDAxNiAtMDUwMA0KKysrIGIvZHJpdmVycy9uZXQvd2lyZWxlc3MvaGVy bWVzLmMJMjAwNS0wMS0yMiAxNTozNzozMS4xNTEyMzM1MDQgLTA1MDANCkBA IC02Nyw4ICs2Nyw3IEBADQogICogRGVidWdnaW5nIGhlbHBlcnMNCiAgKi8N CiANCi0jZGVmaW5lIElPX1RZUEUoaHcpCSgoaHcpLT5pb19zcGFjZSA/ICJJ TyAiIDogIk1FTSAiKQ0KLSNkZWZpbmUgRE1TRyhzdHVmZi4uLikgZG8ge3By aW50ayhLRVJOX0RFQlVHICJoZXJtZXMgQCAlczB4JXg6ICIgLCBJT19UWVBF KGh3KSwgaHctPmlvYmFzZSk7IFwNCisjZGVmaW5lIERNU0coc3R1ZmYuLi4p IGRvIHtwcmludGsoS0VSTl9ERUJVRyAiaGVybWVzIEAgJXA6ICIgLCBody0+ aW9iYXNlKTsgXA0KIAkJCXByaW50ayhzdHVmZik7fSB3aGlsZSAoMCkNCiAN CiAjdW5kZWYgSEVSTUVTX0RFQlVHDQpAQCAtMjAwLDkgKzE5OSw5IEBADQog CX0NCiAJCQ0KIAlpZiAoISAocmVnICYgSEVSTUVTX0VWX0NNRCkpIHsNCi0J CXByaW50ayhLRVJOX0VSUiAiaGVybWVzIEAgJXMweCVseDogIiANCisJCXBy aW50ayhLRVJOX0VSUiAiaGVybWVzIEAgJXA6ICIgDQogCQkgICAgICAgIlRp bWVvdXQgd2FpdGluZyBmb3IgY2FyZCB0byByZXNldCAocmVnPTB4JTA0eCkh XG4iLA0KLQkJICAgICAgIElPX1RZUEUoaHcpLCBody0+aW9iYXNlLCByZWcp Ow0KKwkJICAgICAgIGh3LT5pb2Jhc2UsIHJlZyk7DQogCQllcnIgPSAtRVRJ TUVET1VUOw0KIAkJZ290byBvdXQ7DQogCX0NCkBAIC0yMzUsMTMgKzIzNCwx NiBAQA0KIAllcnIgPSBoZXJtZXNfaXNzdWVfY21kKGh3LCBjbWQsIHBhcm0w KTsNCiAJaWYgKGVycikgew0KIAkJaWYgKCEgaGVybWVzX3ByZXNlbnQoaHcp KSB7DQotCQkJcHJpbnRrKEtFUk5fV0FSTklORyAiaGVybWVzIEAgJXMweCVs eDogIg0KLQkJCSAgICAgICAiQ2FyZCByZW1vdmVkIHdoaWxlIGlzc3Vpbmcg Y29tbWFuZC5cbiIsDQotCQkJICAgICAgIElPX1RZUEUoaHcpLCBody0+aW9i YXNlKTsNCisJCQlpZiAobmV0X3JhdGVsaW1pdCgpKQ0KKwkJCQlwcmludGso S0VSTl9XQVJOSU5HICJoZXJtZXMgQCAlcDogIg0KKwkJCQkgICAgICAgIkNh cmQgcmVtb3ZlZCB3aGlsZSBpc3N1aW5nIGNvbW1hbmQgIg0KKwkJCQkgICAg ICAgIjB4JTA0eC5cbiIsIGh3LT5pb2Jhc2UsIGNtZCk7DQogCQkJZXJyID0g LUVOT0RFVjsNCiAJCX0gZWxzZSANCi0JCQlwcmludGsoS0VSTl9FUlIgImhl cm1lcyBAICVzMHglbHg6IEVycm9yICVkIGlzc3VpbmcgY29tbWFuZC5cbiIs DQotCQkJICAgICAgIElPX1RZUEUoaHcpLCBody0+aW9iYXNlLCBlcnIpOw0K KwkJCWlmIChuZXRfcmF0ZWxpbWl0KCkpDQorCQkJCXByaW50ayhLRVJOX0VS UiAiaGVybWVzIEAgJXA6ICINCisJCQkJICAgICAgICJFcnJvciAlZCBpc3N1 aW5nIGNvbW1hbmQgMHglMDR4LlxuIiwNCisJCQkJICAgICAgIGh3LT5pb2Jh c2UsIGVyciwgY21kKTsNCiAJCWdvdG8gb3V0Ow0KIAl9DQogDQpAQCAtMjU0 LDE3ICsyNTYsMTYgQEANCiAJfQ0KIA0KIAlpZiAoISBoZXJtZXNfcHJlc2Vu dChodykpIHsNCi0JCXByaW50ayhLRVJOX1dBUk5JTkcgImhlcm1lcyBAICVz MHglbHg6ICINCi0JCSAgICAgICAiQ2FyZCByZW1vdmVkIHdoaWxlIHdhaXRp bmcgZm9yIGNvbW1hbmQgY29tcGxldGlvbi5cbiIsDQotCQkgICAgICAgSU9f VFlQRShodyksIGh3LT5pb2Jhc2UpOw0KKwkJcHJpbnRrKEtFUk5fV0FSTklO RyAiaGVybWVzIEAgJXA6IENhcmQgcmVtb3ZlZCAiDQorCQkgICAgICAgIndo aWxlIHdhaXRpbmcgZm9yIGNvbW1hbmQgMHglMDR4IGNvbXBsZXRpb24uXG4i LA0KKwkJICAgICAgIGh3LT5pb2Jhc2UsIGNtZCk7DQogCQllcnIgPSAtRU5P REVWOw0KIAkJZ290byBvdXQ7DQogCX0NCiAJCQ0KIAlpZiAoISAocmVnICYg SEVSTUVTX0VWX0NNRCkpIHsNCi0JCXByaW50ayhLRVJOX0VSUiAiaGVybWVz IEAgJXMweCVseDogIg0KLQkJICAgICAgICJUaW1lb3V0IHdhaXRpbmcgZm9y IGNvbW1hbmQgY29tcGxldGlvbi5cbiIsDQotCQkgICAgICAgSU9fVFlQRSho dyksIGh3LT5pb2Jhc2UpOw0KKwkJcHJpbnRrKEtFUk5fRVJSICJoZXJtZXMg QCAlcDogVGltZW91dCB3YWl0aW5nIGZvciAiDQorCQkgICAgICAgImNvbW1h bmQgMHglMDR4IGNvbXBsZXRpb24uXG4iLCBody0+aW9iYXNlLCBjbWQpOw0K IAkJZXJyID0gLUVUSU1FRE9VVDsNCiAJCWdvdG8gb3V0Ow0KIAl9DQpAQCAt MzA5LDE2ICszMTAsMTYgQEANCiAJfQ0KIAkNCiAJaWYgKCEgaGVybWVzX3By ZXNlbnQoaHcpKSB7DQotCQlwcmludGsoS0VSTl9XQVJOSU5HICJoZXJtZXMg QCAlczB4JWx4OiAiDQorCQlwcmludGsoS0VSTl9XQVJOSU5HICJoZXJtZXMg QCAlcDogIg0KIAkJICAgICAgICJDYXJkIHJlbW92ZWQgd2FpdGluZyBmb3Ig ZnJhbWUgYWxsb2NhdGlvbi5cbiIsDQotCQkgICAgICAgSU9fVFlQRShodyks IGh3LT5pb2Jhc2UpOw0KKwkJICAgICAgIGh3LT5pb2Jhc2UpOw0KIAkJcmV0 dXJuIC1FTk9ERVY7DQogCX0NCiAJCQ0KIAlpZiAoISAocmVnICYgSEVSTUVT X0VWX0FMTE9DKSkgew0KLQkJcHJpbnRrKEtFUk5fRVJSICJoZXJtZXMgQCAl czB4JWx4OiAiDQorCQlwcmludGsoS0VSTl9FUlIgImhlcm1lcyBAICVwOiAi DQogCQkgICAgICAgIlRpbWVvdXQgd2FpdGluZyBmb3IgZnJhbWUgYWxsb2Nh dGlvblxuIiwNCi0JCSAgICAgICBJT19UWVBFKGh3KSwgaHctPmlvYmFzZSk7 DQorCQkgICAgICAgaHctPmlvYmFzZSk7DQogCQlyZXR1cm4gLUVUSU1FRE9V VDsNCiAJfQ0KIA0KQEAgLTM4MywxMiArMzg0LDE3IEBADQogCQlyZWcgPSBo ZXJtZXNfcmVhZF9yZWcoaHcsIG9yZWcpOw0KIAl9DQogDQotCWlmIChyZWcg JiBIRVJNRVNfT0ZGU0VUX0JVU1kpIHsNCi0JCXJldHVybiAtRVRJTUVET1VU Ow0KLQl9DQorCWlmIChyZWcgIT0gb2Zmc2V0KSB7DQorCQlwcmludGsoS0VS Tl9FUlIgImhlcm1lcyBAICVwOiBCQVAlZCBvZmZzZXQgJXM6ICINCisJCSAg ICAgICAicmVnPTB4JXggaWQ9MHgleCBvZmZzZXQ9MHgleFxuIiwgaHctPmlv YmFzZSwgYmFwLA0KKwkJICAgICAgIChyZWcgJiBIRVJNRVNfT0ZGU0VUX0JV U1kpID8gInRpbWVvdXQiIDogImVycm9yIiwNCisJCSAgICAgICByZWcsIGlk LCBvZmZzZXQpOw0KKw0KKwkJaWYgKHJlZyAmIEhFUk1FU19PRkZTRVRfQlVT WSkgew0KKwkJCXJldHVybiAtRVRJTUVET1VUOw0KKwkJfQ0KIA0KLQlpZiAo cmVnICYgSEVSTUVTX09GRlNFVF9FUlIpIHsNCi0JCXJldHVybiAtRUlPOw0K KwkJcmV0dXJuIC1FSU87CQkvKiBlcnJvciBvciB3cm9uZyBvZmZzZXQgKi8N CiAJfQ0KIA0KIAlyZXR1cm4gMDsNCkBAIC00ODQsMTQgKzQ5MCwxMyBAQA0K IAkJKmxlbmd0aCA9IHJsZW5ndGg7DQogDQogCWlmIChydHlwZSAhPSByaWQp DQotCQlwcmludGsoS0VSTl9XQVJOSU5HICJoZXJtZXMgQCAlczB4JWx4OiAi DQotCQkgICAgICAgImhlcm1lc19yZWFkX2x0digpOiByaWQgICgweCUwNHgp IGRvZXMgbm90IG1hdGNoIHR5cGUgKDB4JTA0eClcbiIsDQotCQkgICAgICAg SU9fVFlQRShodyksIGh3LT5pb2Jhc2UsIHJpZCwgcnR5cGUpOw0KKwkJcHJp bnRrKEtFUk5fV0FSTklORyAiaGVybWVzIEAgJXA6ICVzKCk6ICINCisJCSAg ICAgICAicmlkICgweCUwNHgpIGRvZXMgbm90IG1hdGNoIHR5cGUgKDB4JTA0 eClcbiIsDQorCQkgICAgICAgaHctPmlvYmFzZSwgX19GVU5DVElPTl9fLCBy aWQsIHJ0eXBlKTsNCiAJaWYgKEhFUk1FU19SRUNMRU5fVE9fQllURVMocmxl bmd0aCkgPiBidWZzaXplKQ0KLQkJcHJpbnRrKEtFUk5fV0FSTklORyAiaGVy bWVzIEAgJXMweCVseDogIg0KKwkJcHJpbnRrKEtFUk5fV0FSTklORyAiaGVy bWVzIEAgJXA6ICINCiAJCSAgICAgICAiVHJ1bmNhdGluZyBMVFYgcmVjb3Jk IGZyb20gJWQgdG8gJWQgYnl0ZXMuICINCi0JCSAgICAgICAiKHJpZD0weCUw NHgsIGxlbj0weCUwNHgpXG4iLA0KLQkJICAgICAgIElPX1RZUEUoaHcpLCBo dy0+aW9iYXNlLA0KKwkJICAgICAgICIocmlkPTB4JTA0eCwgbGVuPTB4JTA0 eClcbiIsIGh3LT5pb2Jhc2UsDQogCQkgICAgICAgSEVSTUVTX1JFQ0xFTl9U T19CWVRFUyhybGVuZ3RoKSwgYnVmc2l6ZSwgcmlkLCBybGVuZ3RoKTsNCiAN CiAJbndvcmRzID0gbWluKCh1bnNpZ25lZClybGVuZ3RoIC0gMSwgYnVmc2l6 ZSAvIDIpOw0KLS0tIGEvZHJpdmVycy9uZXQvd2lyZWxlc3Mvb3Jpbm9jby5o LnByaW50awkyMDA1LTAxLTIyIDE1OjU1OjAwLjM3NDcyNzI4OCAtMDUwMA0K KysrIGIvZHJpdmVycy9uZXQvd2lyZWxlc3Mvb3Jpbm9jby5oCTIwMDUtMDEt MjIgMTU6NTU6MzcuMjE5MTI2MDg4IC0wNTAwDQpAQCAtMTI3LDcgKzEyNyw3 IEBADQogew0KIAlzcGluX2xvY2tfaXJxc2F2ZSgmcHJpdi0+bG9jaywgKmZs YWdzKTsNCiAJaWYgKHByaXYtPmh3X3VuYXZhaWxhYmxlKSB7DQotCQlwcmlu dGsoS0VSTl9ERUJVRyAib3Jpbm9jb19sb2NrKCkgY2FsbGVkIHdpdGggaHdf dW5hdmFpbGFibGUgKGRldj0lcClcbiIsDQorCQlERUJVRygxLCAib3Jpbm9j b19sb2NrKCkgY2FsbGVkIHdpdGggaHdfdW5hdmFpbGFibGUgKGRldj0lcClc biIsDQogCQkgICAgICAgcHJpdi0+bmRldik7DQogCQlzcGluX3VubG9ja19p cnFyZXN0b3JlKCZwcml2LT5sb2NrLCAqZmxhZ3MpOw0KIAkJcmV0dXJuIC1F QlVTWTsNCi0tLSBhL2RyaXZlcnMvbmV0L3dpcmVsZXNzL29yaW5vY29fY3Mu Yy5wcmludGsJMjAwNS0wMS0yMiAxNTo1MTo1OS4wNDkyOTI5NDQgLTA1MDAN CisrKyBiL2RyaXZlcnMvbmV0L3dpcmVsZXNzL29yaW5vY29fY3MuYwkyMDA1 LTAxLTIyIDE1OjU0OjA5LjEyODUxNzg5NiAtMDUwMA0KQEAgLTM5MCw3ICsz OTAsNyBAQA0KIAkJbGFzdF9yZXQgPSBwY21jaWFfZ2V0X25leHRfdHVwbGUo aGFuZGxlLCAmdHVwbGUpOw0KIAkJaWYgKGxhc3RfcmV0ICA9PSBDU19OT19N T1JFX0lURU1TKSB7DQogCQkJcHJpbnRrKEtFUk5fRVJSIFBGWCAiR2V0TmV4 dFR1cGxlKCk6IE5vIG1hdGNoaW5nICINCi0JCQkgICAgICAgIkNJUyBjb25m aWd1cmF0aW9uLCBtYXliZSB5b3UgbmVlZCB0aGUgIg0KKwkJCSAgICAgICAi Q0lTIGNvbmZpZ3VyYXRpb24uICBNYXliZSB5b3UgbmVlZCB0aGUgIg0KIAkJ CSAgICAgICAiaWdub3JlX2Npc192Y2M9MSBwYXJhbWV0ZXIuXG4iKTsNCiAJ CQlnb3RvIGNzX2ZhaWxlZDsNCiAJCX0NCi0tLSBhL2RyaXZlcnMvbmV0L3dp cmVsZXNzL29yaW5vY29fdG1kLmMucHJpbnRrCTIwMDUtMDEtMjIgMTY6MDI6 NDguNjc3NTM0NDQwIC0wNTAwDQorKysgYi9kcml2ZXJzL25ldC93aXJlbGVz cy9vcmlub2NvX3RtZC5jCTIwMDUtMDEtMjIgMTY6MDQ6NDIuNDM3MjQwMzM2 IC0wNTAwDQpAQCAtOTEsMTUgKzkxLDE2IEBADQogCXN0cnVjdCBuZXRfZGV2 aWNlICpkZXYgPSBOVUxMOw0KIA0KIAllcnIgPSBwY2lfZW5hYmxlX2Rldmlj ZShwZGV2KTsNCi0JaWYgKGVycikNCi0JCXJldHVybiAtRUlPOw0KKwlpZiAo ZXJyKSB7DQorCQlwcmludGsoS0VSTl9FUlIgUEZYICJDYW5ub3QgZW5hYmxl IFBDSSBkZXZpY2VcbiIpOw0KKwkJcmV0dXJuIGVycjsNCisJfQ0KIA0KIAlw cmludGsoS0VSTl9ERUJVRyBQRlggIlRNRCBzZXR1cFxuIik7DQogCXBjY2Fy ZF9pb2FkZHIgPSBwY2lfcmVzb3VyY2Vfc3RhcnQocGRldiwgMik7DQogCXBj Y2FyZF9pb2xlbiA9IHBjaV9yZXNvdXJjZV9sZW4ocGRldiwgMik7DQogCWlm ICghIHJlcXVlc3RfcmVnaW9uKHBjY2FyZF9pb2FkZHIsIHBjY2FyZF9pb2xl biwgRFJJVkVSX05BTUUpKSB7DQotCQlwcmludGsoS0VSTl9FUlIgUEZYICJJ L08gcmVzb3VyY2UgYXQgMHglbHggbGVuIDB4JWx4IGJ1c3lcbiIsDQotCQkJ cGNjYXJkX2lvYWRkciwgcGNjYXJkX2lvbGVuKTsNCisJCXByaW50ayhLRVJO X0VSUiBQRlggIkNhbm5vdCBvYnRhaW4gUENJIHJlc291cmNlc1xuIik7DQog CQlwY2NhcmRfaW9hZGRyID0gMDsNCiAJCWVyciA9IC1FQlVTWTsNCiAJCWdv dG8gZmFpbDsNCkBAIC0xMTcsNiArMTE4LDcgQEANCiAJLyogQWxsb2NhdGUg bmV0d29yayBkZXZpY2UgKi8NCiAJZGV2ID0gYWxsb2Nfb3Jpbm9jb2Rldigw LCBOVUxMKTsNCiAJaWYgKCEgZGV2KSB7DQorCQlwcmludGsoS0VSTl9FUlIg UEZYICJDYW5ub3QgYWxsb2NhdGUgbmV0d29yayBkZXZpY2VcbiIpOw0KIAkJ ZXJyID0gLUVOT01FTTsNCiAJCWdvdG8gZmFpbDsNCiAJfQ0KQEAgLTEzNywx NiArMTM5LDE3IEBADQogCWVyciA9IHJlcXVlc3RfaXJxKHBkZXYtPmlycSwg b3Jpbm9jb19pbnRlcnJ1cHQsIFNBX1NISVJRLA0KIAkJCSAgZGV2LT5uYW1l LCBkZXYpOw0KIAlpZiAoZXJyKSB7DQotCQlwcmludGsoS0VSTl9FUlIgUEZY ICJFcnJvciBhbGxvY2F0aW5nIElSUSAlZC5cbiIsDQotCQkgICAgICAgcGRl di0+aXJxKTsNCisJCXByaW50ayhLRVJOX0VSUiBQRlggIkNhbm5vdCBhbGxv Y2F0ZSBJUlEgJWRcbiIsIHBkZXYtPmlycSk7DQogCQllcnIgPSAtRUJVU1k7 DQogCQlnb3RvIGZhaWw7DQogCX0NCiAJZGV2LT5pcnEgPSBwZGV2LT5pcnE7 DQogDQogCWVyciA9IHJlZ2lzdGVyX25ldGRldihkZXYpOw0KLQlpZiAoZXJy KQ0KLQkJZ290byBmYWlsOw0KKwlpZiAoZXJyKSB7DQorCQlwcmludGsoS0VS Tl9FUlIgUEZYICJDYW5ub3QgcmVnaXN0ZXIgbmV0d29yayBkZXZpY2VcbiIp Ow0KKyAJCWdvdG8gZmFpbDsNCisJfQ0KIA0KIAlyZXR1cm4gMDsNCiANCi0t LSBhL2RyaXZlcnMvbmV0L3dpcmVsZXNzL29yaW5vY29fcGNpLmMucHJpbnRr CTIwMDUtMDEtMjIgMTU6NTY6MTYuNTY5MTQzOTc2IC0wNTAwDQorKysgYi9k cml2ZXJzL25ldC93aXJlbGVzcy9vcmlub2NvX3BjaS5jCTIwMDUtMDEtMjIg MTY6MTM6MzEuOTkzNzM1NTEyIC0wNTAwDQpAQCAtMTgzLDcgKzE4Myw2IEBA DQogCQlwcmludGsoS0VSTl9FUlIgUEZYICJCdXN5IHRpbWVvdXRcbiIpOw0K IAkJcmV0dXJuIC1FVElNRURPVVQ7DQogCX0NCi0JcHJpbnRrKEtFUk5fTk9U SUNFICJwY2lfY29yIDogcmVnID0gMHglWCAtICVsWCAtICVsWFxuIiwgcmVn LCB0aW1lb3V0LCBqaWZmaWVzKTsNCiANCiAJcmV0dXJuIDA7DQogfQ0KQEAg LTIwMiwxNSArMjAxLDE5IEBADQogCXN0cnVjdCBuZXRfZGV2aWNlICpkZXYg PSBOVUxMOw0KIA0KIAllcnIgPSBwY2lfZW5hYmxlX2RldmljZShwZGV2KTsN Ci0JaWYgKGVycikNCi0JCXJldHVybiAtRUlPOw0KKwlpZiAoZXJyKSB7DQor CQlwcmludGsoS0VSTl9FUlIgUEZYICJDYW5ub3QgZW5hYmxlIFBDSSBkZXZp Y2VcbiIpOw0KKwkJcmV0dXJuIGVycjsNCisJfQ0KIA0KIAkvKiBSZXNvdXJj ZSAwIGlzIG1hcHBlZCB0byB0aGUgaGVybWVzIHJlZ2lzdGVycyAqLw0KIAlw Y2lfaW9yYW5nZSA9IHBjaV9yZXNvdXJjZV9zdGFydChwZGV2LCAwKTsNCiAJ cGNpX2lvbGVuID0gcGNpX3Jlc291cmNlX2xlbihwZGV2LCAwKTsNCiAJcGNp X2lvYWRkciA9IGlvcmVtYXAocGNpX2lvcmFuZ2UsIHBjaV9pb2xlbik7DQot CWlmICghIHBjaV9pb3JhbmdlKQ0KKwlpZiAoIXBjaV9pb3JhbmdlKSB7DQor CQlwcmludGsoS0VSTl9FUlIgUEZYICJDYW5ub3QgcmVtYXAgaGFyZHdhcmUg cmVnaXN0ZXJzXG4iKTsNCiAJCWdvdG8gZmFpbDsNCisJfQ0KIA0KIAkvKiBB bGxvY2F0ZSBuZXR3b3JrIGRldmljZSAqLw0KIAlkZXYgPSBhbGxvY19vcmlu b2NvZGV2KDAsIE5VTEwpOw0KQEAgLTIzNyw4ICsyNDAsNyBAQA0KIAllcnIg PSByZXF1ZXN0X2lycShwZGV2LT5pcnEsIG9yaW5vY29faW50ZXJydXB0LCBT QV9TSElSUSwNCiAJCQkgIGRldi0+bmFtZSwgZGV2KTsNCiAJaWYgKGVycikg ew0KLQkJcHJpbnRrKEtFUk5fRVJSIFBGWCAiRXJyb3IgYWxsb2NhdGluZyBJ UlEgJWQuXG4iLA0KLQkJICAgICAgIHBkZXYtPmlycSk7DQorCQlwcmludGso S0VSTl9FUlIgUEZYICJDYW5ub3QgYWxsb2NhdGUgSVJRICVkXG4iLCBwZGV2 LT5pcnEpOw0KIAkJZXJyID0gLUVCVVNZOw0KIAkJZ290byBmYWlsOw0KIAl9 DQpAQCAtMjQ2LDcgKzI0OCw3IEBADQogDQogCS8qIFBlcmZvcm0gYSBDT1Ig cmVzZXQgdG8gc3RhcnQgdGhlIGNhcmQgKi8NCiAJaWYob3Jpbm9jb19wY2lf Y29yX3Jlc2V0KHByaXYpICE9IDApIHsNCi0JCXByaW50ayhLRVJOX0VSUiAi JXM6IEZhaWxlZCB0byBzdGFydCB0aGUgY2FyZFxuIiwgZGV2LT5uYW1lKTsN CisJCXByaW50ayhLRVJOX0VSUiBQRlggIkluaXRpYWwgcmVzZXQgZmFpbGVk XG4iKTsNCiAJCWVyciA9IC1FVElNRURPVVQ7DQogCQlnb3RvIGZhaWw7DQog CX0NCkBAIC0yNTcsNyArMjU5LDcgQEANCiANCiAJZXJyID0gcmVnaXN0ZXJf bmV0ZGV2KGRldik7DQogCWlmIChlcnIpIHsNCi0JCXByaW50ayhLRVJOX0VS UiAiJXM6IEZhaWxlZCB0byByZWdpc3RlciBuZXQgZGV2aWNlXG4iLCBkZXYt Pm5hbWUpOw0KKwkJcHJpbnRrKEtFUk5fRVJSIFBGWCAiRmFpbGVkIHRvIHJl Z2lzdGVyIG5ldCBkZXZpY2VcbiIpOw0KIAkJZ290byBmYWlsOw0KIAl9DQog DQotLS0gYS9kcml2ZXJzL25ldC93aXJlbGVzcy9haXJwb3J0LmMucHJpbnRr CTIwMDUtMDEtMjIgMTU6MjY6NTQuMjIxMDYxNjA4IC0wNTAwDQorKysgYi9k cml2ZXJzL25ldC93aXJlbGVzcy9haXJwb3J0LmMJMjAwNS0wMS0yMiAxNToy ODo1NS45NjQ1NTM3ODQgLTA1MDANCkBAIC0xOTQsMTQgKzE5NCwxNCBAQA0K IAloZXJtZXNfdCAqaHc7DQogDQogCWlmIChtYWNpb19yZXNvdXJjZV9jb3Vu dChtZGV2KSA8IDEgfHwgbWFjaW9faXJxX2NvdW50KG1kZXYpIDwgMSkgew0K LQkJcHJpbnRrKEtFUk5fRVJSIFBGWCAid3JvbmcgaW50ZXJydXB0L2FkZHJl c3NlcyBpbiBPRiB0cmVlXG4iKTsNCisJCXByaW50ayhLRVJOX0VSUiBQRlgg Ildyb25nIGludGVycnVwdC9hZGRyZXNzZXMgaW4gT0YgdHJlZVxuIik7DQog CQlyZXR1cm4gLUVOT0RFVjsNCiAJfQ0KIA0KIAkvKiBBbGxvY2F0ZSBzcGFj ZSBmb3IgcHJpdmF0ZSBkZXZpY2Utc3BlY2lmaWMgZGF0YSAqLw0KIAlkZXYg PSBhbGxvY19vcmlub2NvZGV2KHNpemVvZigqY2FyZCksIGFpcnBvcnRfaGFy ZF9yZXNldCk7DQogCWlmICghIGRldikgew0KLQkJcHJpbnRrKEtFUk5fRVJS IFBGWCAiY2FuJ3QgYWxsb2NhdGUgZGV2aWNlIGRhdGFzXG4iKTsNCisJCXBy aW50ayhLRVJOX0VSUiBQRlggIkNhbm5vdCBhbGxvY2F0ZSBuZXR3b3JrIGRl dmljZVxuIik7DQogCQlyZXR1cm4gLUVOT0RFVjsNCiAJfQ0KIAlwcml2ID0g bmV0ZGV2X3ByaXYoZGV2KTsNCkBAIC0yMjQsMTEgKzIyNCwxMSBAQA0KIAkv KiBTZXR1cCBpbnRlcnJ1cHRzICYgYmFzZSBhZGRyZXNzICovDQogCWRldi0+ aXJxID0gbWFjaW9faXJxKG1kZXYsIDApOw0KIAlwaHlzX2FkZHIgPSBtYWNp b19yZXNvdXJjZV9zdGFydChtZGV2LCAwKTsgIC8qIFBoeXNpY2FsIGFkZHJl c3MgKi8NCi0JcHJpbnRrKEtFUk5fREVCVUcgUEZYICJBaXJwb3J0IGF0IHBo eXNpY2FsIGFkZHJlc3MgJWx4XG4iLCBwaHlzX2FkZHIpOw0KKwlwcmludGso S0VSTl9ERUJVRyBQRlggIlBoeXNpY2FsIGFkZHJlc3MgJWx4XG4iLCBwaHlz X2FkZHIpOw0KIAlkZXYtPmJhc2VfYWRkciA9IHBoeXNfYWRkcjsNCiAJY2Fy ZC0+dmFkZHIgPSBpb3JlbWFwKHBoeXNfYWRkciwgQUlSUE9SVF9JT19MRU4p Ow0KIAlpZiAoIWNhcmQtPnZhZGRyKSB7DQotCQlwcmludGsoUEZYICJpb3Jl bWFwKCkgZmFpbGVkXG4iKTsNCisJCXByaW50ayhLRVJOX0VSUiBQRlggImlv cmVtYXAoKSBmYWlsZWRcbiIpOw0KIAkJZ290byBmYWlsZWQ7DQogCX0NCiAN CkBAIC0yNTMsNyArMjUzLDcgQEANCiAJCXByaW50ayhLRVJOX0VSUiBQRlgg InJlZ2lzdGVyX25ldGRldigpIGZhaWxlZFxuIik7DQogCQlnb3RvIGZhaWxl ZDsNCiAJfQ0KLQlwcmludGsoS0VSTl9ERUJVRyBQRlggImNhcmQgcmVnaXN0 ZXJlZCBmb3IgaW50ZXJmYWNlICVzXG4iLCBkZXYtPm5hbWUpOw0KKwlwcmlu dGsoS0VSTl9ERUJVRyBQRlggIkNhcmQgcmVnaXN0ZXJlZCBmb3IgaW50ZXJm YWNlICVzXG4iLCBkZXYtPm5hbWUpOw0KIAljYXJkLT5uZGV2X3JlZ2lzdGVy ZWQgPSAxOw0KIAlyZXR1cm4gMDsNCiAgZmFpbGVkOg0K --279707962-1385008808-1106446908=:11940-- From linux_lover2004@yahoo.com Sat Jan 22 20:22:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Jan 2005 20:22:19 -0800 (PST) Received: from web52210.mail.yahoo.com (web52210.mail.yahoo.com [206.190.39.92]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0N4MEQP019910 for ; Sat, 22 Jan 2005 20:22:15 -0800 Received: (qmail 23827 invoked by uid 60001); 23 Jan 2005 04:22:09 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=X9CZGQV+/uReStiVWjgoDkimvrSvRMYMzzd8uO6KUTPn1kKHydLER3Jy+jnh6+s4sRZ+vEr/1cdJcm9/Zgg4pIrHkkWSBxJmd7sScUwt5howibtuS1E1aBVsERrWaVSBGtgFiPIJOI3RPc4isocyya6mcymsiAPBIll0ybMtKHI= ; Message-ID: <20050123042209.23825.qmail@web52210.mail.yahoo.com> Received: from [202.56.231.117] by web52210.mail.yahoo.com via HTTP; Sat, 22 Jan 2005 20:22:09 PST Date: Sat, 22 Jan 2005 20:22:09 -0800 (PST) From: linux lover Subject: which are these packet types?? To: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 660 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: linux_lover2004@yahoo.com Precedence: bulk X-list: netdev Hello all, I have added some debug statements in linux kernel 2.4.24 in /usr/src/linux/net/core/dev.c printk(KERN_DEBUG "in netif_receive_skb after skb->len = %d and address = %p\n",skb->len,skb->data); printk(KERN_DEBUG "In netif_receive_skb skb->nh.iph->ihl = %d && skb->nh.iph->version = %d\n",skb->nh.iph->ihl,skb->nh.iph->version); printk(KERN_DEBUG "packet type is =%d\n",type); where all these 3 statemets are placed in netif_receive_skb function of dev.c and type is defined as unsigned short type = skb->protocol; Then i rebuild kernel and check it on network and found following results. in netif_receive_skb after skb->len = 186 and address = c75ec620 In netif_receive_skb skb->nh.iph->ihl = 0 && skb->nh.iph->version = 14 packet type is =1024 in netif_receive_skb after skb->len = 46 and address = c74633a0 In netif_receive_skb skb->nh.iph->ihl = 0 && skb->nh.iph->version = 0 packet type is =1544 in netif_receive_skb after skb->len = 84 and address = c7463aa0 In netif_receive_skb skb->nh.iph->ihl = 0 && skb->nh.iph->version = 14 packet type is =1024 in netif_receive_skb after skb->len = 100 and address = c74639a0 In netif_receive_skb skb->nh.iph->ihl = 0 && skb->nh.iph->version = 14 packet type is =1024 in netif_receive_skb after skb->len = 78 and address = c7463aa0 In netif_receive_skb skb->nh.iph->ihl = 5 && skb->nh.iph->version = 4 packet type is =8 I want to know which are these packet types? I know only values 8 for IP and 2054 for ARP packets then which are these packets 1024,1544. regards, linux_lover __________________________________ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 From rddunlap@osdl.org Sat Jan 22 23:04:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 22 Jan 2005 23:04:33 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0N74Rrx025654 for ; Sat, 22 Jan 2005 23:04:27 -0800 Received: from midway.verizon.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id j0N74Ll01428; Sat, 22 Jan 2005 23:04:21 -0800 Date: Sat, 22 Jan 2005 22:53:35 -0800 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: jgarzik , prism54-private@prism54.org Subject: [PATCH] prism54: use NULL for pointer Message-Id: <20050122225335.225f8042.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; i386-vine-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 661 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Use NULL instead of 0 for pointer: drivers/net/wireless/prism54/isl_ioctl.c:1753:16: warning: Using plain integer as NULL pointer drivers/net/wireless/prism54/isl_ioctl.c:1753:26: warning: Using plain integer as NULL pointer Signed-off-by: Randy Dunlap diffstat:= drivers/net/wireless/prism54/isl_ioctl.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -Naurp ./drivers/net/wireless/prism54/isl_ioctl.c~prism54_isl_null ./drivers/net/wireless/prism54/isl_ioctl.c --- ./drivers/net/wireless/prism54/isl_ioctl.c~prism54_isl_null 2005-01-22 21:53:00.599920368 -0800 +++ ./drivers/net/wireless/prism54/isl_ioctl.c 2005-01-22 21:53:58.223160304 -0800 @@ -1750,7 +1750,7 @@ prism54_process_trap_helper(islpci_priva u8 wpa_ie[MAX_WPA_IE_LEN]; int wpa_ie_len; size_t len = 0; /* u16, better? */ - u8 *payload = 0, *pos = 0; + u8 *payload = NULL, *pos = NULL; int ret; /* I think all trapable objects are listed here. -- From webvenza@libero.it Sun Jan 23 00:52:32 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 00:52:37 -0800 (PST) Received: from gateway.milesteg.arr (venza@adsl-ull-189-134.44-151.net24.it [151.44.134.189]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0N8qVFT032547 for ; Sun, 23 Jan 2005 00:52:31 -0800 Date: Sun, 23 Jan 2005 09:52:29 +0100 From: Daniele Venzano To: Francois Romieu Cc: Jeff Garzik , NetDev Subject: Re: [PATCH 1/5] sis900 printk audit Message-ID: <20050123085229.GD31816@gateway.milesteg.arr> Mail-Followup-To: Francois Romieu , Jeff Garzik , NetDev References: <20050122214657.18649.66345@localhost.localdomain> <20050122222640.GB24461@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050122222640.GB24461@electric-eye.fr.zoreil.com> X-Operating-System: Debian GNU/Linux on kernel Linux 2.4.28-grsec X-Copyright: Forwarding or publishing without permission is prohibited. X-Truth: La vita e' una questione di culo, o ce l'hai o te lo fanno. X-GPG-Fingerprint: 642A A345 1CEF B6E3 925C 23CE DAB9 8764 25B3 57ED User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 663 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: webvenza@libero.it Precedence: bulk X-list: netdev Content-Length: 826 Lines: 27 On Sat, Jan 22, 2005 at 11:26:40PM +0100, Francois Romieu wrote: > Daniele Venzano : > [...] > > Index: sis900.c > > =================================================================== > > --- a/drivers/net/sis900.c (revision 83) > > +++ b/drivers/net/sis900.c (revision 84) > [...] > > @@ -1906,8 +1918,22 @@ > > strcpy (info->bus_info, pci_name(sis_priv->pci_dev)); > > } > > > > +static u32 sis900_get_msglevel(struct net_device *net_dev) > > +{ > > + struct sis900_private *sis_priv = net_dev->priv; > > s/net_dev->priv/netdev_priv/ I don't understand, what's wrong here ? Is that a suggestion that I make some global variable or macro to avoid repeating that declaration in almost every function of the driver ? -- ----------------------------- Daniele Venzano Web: http://teg.homeunix.org From webvenza@libero.it Sun Jan 23 01:10:52 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 01:10:57 -0800 (PST) Received: from gateway.milesteg.arr (venza@adsl-ull-189-134.44-151.net24.it [151.44.134.189]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0N9Aow1001080 for ; Sun, 23 Jan 2005 01:10:51 -0800 Date: Sun, 23 Jan 2005 10:10:49 +0100 From: Daniele Venzano To: Francois Romieu Cc: Jeff Garzik , NetDev Subject: [PATCH 6/5] sis900 printk audit Message-ID: <20050123091049.GE31816@gateway.milesteg.arr> Mail-Followup-To: Francois Romieu , Jeff Garzik , NetDev References: <20050122214657.18649.66345@localhost.localdomain> <20050122214659.18649.83119@localhost.localdomain> <20050122222618.GA24461@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="IS0zKkzwUGydFO0o" Content-Disposition: inline In-Reply-To: <20050122222618.GA24461@electric-eye.fr.zoreil.com> X-Operating-System: Debian GNU/Linux on kernel Linux 2.4.28-grsec X-Copyright: Forwarding or publishing without permission is prohibited. X-Truth: La vita e' una questione di culo, o ce l'hai o te lo fanno. X-GPG-Fingerprint: 642A A345 1CEF B6E3 925C 23CE DAB9 8764 25B3 57ED User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 664 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: webvenza@libero.it Precedence: bulk X-list: netdev Content-Length: 1657 Lines: 49 --IS0zKkzwUGydFO0o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Jan 22, 2005 at 11:26:18PM +0100, Francois Romieu wrote: > Daniele Venzano : > > - printk(KERN_INFO "Cannot allocate mem for struct mii_phy\n"); > > + printk(KERN_WARNING "Cannot allocate mem for struct mii_phy\n"); > > -> printk(KERN_WARNING "%s: Cannot allocate mem for struct mii_phy\n", ...) ? > > Btw it may make sense to use pci_name() instead of the name associated with > the struct net_device until it is known for sure that the net_device will not > be removed due to a failure of the probe() method. Attached a patch on top of the previous ones. It only fixes the missing prefix. I understand that pci_name could be a better choice here, but I want to see what other drivers are doing in their probe() before changing policy. Signed-off-by: Daniele Venzano -- ----------------------------- Daniele Venzano Web: http://teg.homeunix.org --IS0zKkzwUGydFO0o Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="sis900_c_89.diff" Index: sis900.c =================================================================== --- a/drivers/net/sis900.c (revision 88) +++ b/drivers/net/sis900.c (revision 89) @@ -576,7 +576,7 @@ } if ((mii_phy = kmalloc(sizeof(struct mii_phy), GFP_KERNEL)) == NULL) { - printk(KERN_WARNING "Cannot allocate mem for struct mii_phy\n"); + printk(KERN_WARNING "%s: Cannot allocate mem for struct mii_phy\n", net_dev->name); mii_phy = sis_priv->first_mii; while (mii_phy) { struct mii_phy *phy; --IS0zKkzwUGydFO0o-- From hirofumi@mail.parknet.co.jp Sun Jan 23 04:19:19 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 04:19:27 -0800 (PST) Received: from mail.parknet.co.jp (mail.parknet.co.jp [210.171.160.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0NCJIJw011381 for ; Sun, 23 Jan 2005 04:19:18 -0800 Received: from ibmpc.myhome.or.jp [210.171.164.65] by mail.parknet.co.jp with ESMTP (SMTPD32-4.10) id A5555ED00152; Sun, 23 Jan 2005 21:19:17 +0900 Received: from devron.myhome.or.jp (devron.myhome.or.jp [192.168.0.3]) by ibmpc.myhome.or.jp (8.13.2/8.13.2/Debian-1) with ESMTP id j0NCJ8l5022476 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 23 Jan 2005 21:19:11 +0900 Received: from devron.myhome.or.jp (localhost [127.0.0.1]) by devron.myhome.or.jp (8.13.2/8.13.2/Debian-1) with ESMTP id j0NCJ7vr022930 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 23 Jan 2005 21:19:07 +0900 Received: (from hirofumi@localhost) by devron.myhome.or.jp (8.13.2/8.13.2/Submit) id j0NCJ4dO022929; Sun, 23 Jan 2005 21:19:04 +0900 To: netdev@oss.sgi.com Subject: "Close NETIF_F_LLTX race conditions" problem From: OGAWA Hirofumi Date: Sun, 23 Jan 2005 21:19:04 +0900 Message-ID: <871xcc5oef.fsf@devron.myhome.or.jp> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 665 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hirofumi@mail.parknet.co.jp Precedence: bulk X-list: netdev Content-Length: 1513 Lines: 40 Hi, I got the following warning. The cause of this warning is the context of ->hard_start_xmit() was changed. Before that patch the IRQ was enableing, but now it was disabled. With this change, the assumption of some drivers was changed, so now some drivers need to change the ->hard_start_xmit(). (e.g, dev_kfree_skb() -> dev_kfree_skb_irq(), spin_lock_irq() -> spin_lock()). Umm.. Should we fix the all drivers? Any idea? Thanks. Badness in local_bh_enable at kernel/softirq.c:140 [] local_bh_enable+0x79/0x80 [] svc_write_space+0x2a/0xa0 [sunrpc] [] sock_wfree+0x4a/0x50 [] __kfree_skb+0x63/0x140 [] rtl8139_start_xmit+0x7c/0x160 [8139too] [] qdisc_restart+0x14d/0x1c0 [] dev_queue_xmit+0x1cf/0x270 [] ip_finish_output+0xcd/0x210 [] inet_sendmsg+0x4d/0x60 [] ip_push_pending_frames+0x2c4/0x460 [] udp_push_pending_frames+0x16c/0x2b0 [] udp_sendpage+0xdd/0x150 [] set_current_groups+0x78/0x80 [] inet_sendpage+0x9e/0xd0 [] svc_sendto+0xa9/0x2a0 [sunrpc] [] kfree_skbmem+0x24/0x30 [] svc_udp_sendto+0x1e/0x40 [sunrpc] [] svc_send+0xcb/0x110 [sunrpc] [] svc_process+0x220/0x6b0 [sunrpc] [] default_wake_function+0x0/0x20 [] nfsd+0x1cb/0x350 [nfsd] [] nfsd+0x0/0x350 [nfsd] [] kernel_thread_helper+0x5/0x10 -- OGAWA Hirofumi From bdschuym@pandora.be Sun Jan 23 04:34:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 04:34:53 -0800 (PST) Received: from asia.telenet-ops.be (asia.telenet-ops.be [195.130.132.59]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0NCYk6B017179 for ; Sun, 23 Jan 2005 04:34:47 -0800 Received: from localhost (localhost.localdomain [127.0.0.1]) by asia.telenet-ops.be (Postfix) with SMTP id 893F5224162; Sun, 23 Jan 2005 13:34:45 +0100 (MET) Received: from 192.168.0.138 (dD5763CA9.access.telenet.be [213.118.60.169]) by asia.telenet-ops.be (Postfix) with ESMTP id 88BC8224185; Sun, 23 Jan 2005 13:34:44 +0100 (MET) Subject: Re: [PATCH/RFC] Reduce call chain length in netfilter (was: Re: do_IRQ: stack overflow: 872..) From: Bart De Schuymer To: Martin Josefsson Cc: "David S. Miller" , shemminger@osdl.org, dwmw2@infradead.org, ak@suse.de, snort2004@mail.ru, bridge@osdl.org, netdev@oss.sgi.com, Rusty Russell In-Reply-To: <1106436153.20995.42.camel@tux.rsn.bth.se> References: <1131604877.20041218092730@mail.ru.suse.lists.linux.kernel> <1105117559.11753.34.camel@baythorne.infradead.org> <20050107100017.454ddadc@dxpl.pdx.osdl.net> <1105133241.3375.16.camel@localhost.localdomain> <20050118135735.4b77d38d.davem@davemloft.net> <1106433059.4486.11.camel@localhost.localdomain> <1106436153.20995.42.camel@tux.rsn.bth.se> Content-Type: text/plain Date: Sun, 23 Jan 2005 13:40:19 +0100 Message-Id: <1106484019.3376.5.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 666 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bdschuym@pandora.be Precedence: bulk X-list: netdev Content-Length: 7188 Lines: 230 Op zo, 23-01-2005 te 00:22 +0100, schreef Martin Josefsson: > On Sat, 2005-01-22 at 23:30 +0100, Bart De Schuymer wrote: > > Hi Bart Hi Martin, > I guess you never testcompiled with CONFIG_NETFILTER_DEBUG set :) Oops, no. I was imagining I could code that without error... There was another compile error with CONFIG_NETFILTER_DEBUG in the patch (skb that should have been (*pskb)) :( > > + if (verdict > NF_MAX_VERDICT) { > > + NFDEBUG("Evil return from %p(%u).\n", > > + elem->hook, hook); > > + continue; > > + } > > Maybe add unlikely() around the test? OK. I added another one around another debugging if-statement. cheers, Bart --- linux-2.6.11-rc1/include/linux/netfilter.h.old 2005-01-23 13:31:58.895886808 +0100 +++ linux-2.6.11-rc1/include/linux/netfilter.h 2005-01-23 13:32:02.853285192 +0100 @@ -18,7 +18,8 @@ #define NF_STOLEN 2 #define NF_QUEUE 3 #define NF_REPEAT 4 -#define NF_MAX_VERDICT NF_REPEAT +#define NF_STOP 5 +#define NF_MAX_VERDICT NF_STOP /* Generic cache responses from hook functions. <= 0x2000 is used for protocol-flags. */ @@ -138,23 +139,34 @@ void nf_log_packet(int pf, /* This is gross, but inline doesn't cut it for avoiding the function call in fast path: gcc doesn't inline (needs value tracking?). --RR */ #ifdef CONFIG_NETFILTER_DEBUG -#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) \ - nf_hook_slow((pf), (hook), (skb), (indev), (outdev), (okfn), INT_MIN) -#define NF_HOOK_THRESH nf_hook_slow +#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) \ +({int __ret = 0; \ +if (!nf_hook_slow(pf, hook, &(skb), indev, outdev, okfn, INT_MIN, &__ret)) \ + __ret = (okfn)(skb); \ +__ret;}) +#define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh) \ +({int __ret = 0; \ +if (!nf_hook_slow(pf, hook, &(skb), indev, outdev, okfn, thresh, &__ret)) \ + __ret = (okfn)(skb); \ +__ret;}) #else -#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) \ -(list_empty(&nf_hooks[(pf)][(hook)]) \ - ? (okfn)(skb) \ - : nf_hook_slow((pf), (hook), (skb), (indev), (outdev), (okfn), INT_MIN)) -#define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh) \ -(list_empty(&nf_hooks[(pf)][(hook)]) \ - ? (okfn)(skb) \ - : nf_hook_slow((pf), (hook), (skb), (indev), (outdev), (okfn), (thresh))) +#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) \ +({int __ret = 0; \ +if (list_empty(&nf_hooks[pf][hook]) || \ + !nf_hook_slow(pf, hook, &(skb), indev, outdev, okfn, INT_MIN, &__ret)) \ + __ret = (okfn)(skb); \ +__ret;}) +#define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh) \ +({int __ret = 0; \ +if (list_empty(&nf_hooks[pf][hook]) || \ + !nf_hook_slow(pf, hook, &(skb), indev, outdev, okfn, thresh, &__ret)) \ + __ret = (okfn)(skb); \ +__ret;}) #endif -int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb, +int nf_hook_slow(int pf, unsigned int hook, struct sk_buff **pskb, struct net_device *indev, struct net_device *outdev, - int (*okfn)(struct sk_buff *), int thresh); + int (*okfn)(struct sk_buff *), int thresh, int *ret); /* Call setsockopt() */ int nf_setsockopt(struct sock *sk, int pf, int optval, char __user *opt, --- linux-2.6.11-rc1/net/core/netfilter.c.old 2005-01-23 13:31:48.980394192 +0100 +++ linux-2.6.11-rc1/net/core/netfilter.c 2005-01-23 13:32:02.856284736 +0100 @@ -349,6 +349,8 @@ static unsigned int nf_iterate(struct li int (*okfn)(struct sk_buff *), int hook_thresh) { + unsigned int verdict; + /* * The caller must not block between calls to this * function because of risk of continuing from deleted element. @@ -361,28 +363,18 @@ static unsigned int nf_iterate(struct li /* Optimization: we don't need to hold module reference here, since function can't sleep. --RR */ - switch (elem->hook(hook, skb, indev, outdev, okfn)) { - case NF_QUEUE: - return NF_QUEUE; - - case NF_STOLEN: - return NF_STOLEN; - - case NF_DROP: - return NF_DROP; - - case NF_REPEAT: - *i = (*i)->prev; - break; - + verdict = elem->hook(hook, skb, indev, outdev, okfn); + if (verdict != NF_ACCEPT) { #ifdef CONFIG_NETFILTER_DEBUG - case NF_ACCEPT: - break; - - default: - NFDEBUG("Evil return from %p(%u).\n", - elem->hook, hook); + if (unlikely(verdict > NF_MAX_VERDICT)) { + NFDEBUG("Evil return from %p(%u).\n", + elem->hook, hook); + continue; + } #endif + if (verdict != NF_REPEAT) + return verdict; + *i = (*i)->prev; } } return NF_ACCEPT; @@ -494,50 +486,47 @@ static int nf_queue(struct sk_buff *skb, return 1; } -int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb, +/* Returns 0 if okfn() needs to be executed by the caller, -EPERM otherwise. + * Assumes *ret==0 when called. On return, *ret!=0 when verdict==NF_DROP */ +int nf_hook_slow(int pf, unsigned int hook, struct sk_buff **pskb, struct net_device *indev, struct net_device *outdev, int (*okfn)(struct sk_buff *), - int hook_thresh) + int hook_thresh, int *ret) { struct list_head *elem; unsigned int verdict; - int ret = 0; + int ret2 = 0; /* We may already have this, but read-locks nest anyway */ rcu_read_lock(); #ifdef CONFIG_NETFILTER_DEBUG - if (skb->nf_debug & (1 << hook)) { + if (unlikely((*pskb)->nf_debug & (1 << hook))) { printk("nf_hook: hook %i already set.\n", hook); - nf_dump_skb(pf, skb); + nf_dump_skb(pf, *pskb); } - skb->nf_debug |= (1 << hook); + (*pskb)->nf_debug |= (1 << hook); #endif elem = &nf_hooks[pf][hook]; next_hook: - verdict = nf_iterate(&nf_hooks[pf][hook], &skb, hook, indev, + verdict = nf_iterate(&nf_hooks[pf][hook], pskb, hook, indev, outdev, &elem, okfn, hook_thresh); - if (verdict == NF_QUEUE) { + if (verdict == NF_ACCEPT || verdict == NF_STOP) + goto unlock; + else if (verdict == NF_DROP) { + kfree_skb(*pskb); + *ret = -EPERM; + } else if (verdict == NF_QUEUE) { NFDEBUG("nf_hook: Verdict = QUEUE.\n"); - if (!nf_queue(skb, elem, pf, hook, indev, outdev, okfn)) + if (!nf_queue(*pskb, elem, pf, hook, indev, outdev, okfn)) goto next_hook; } - - switch (verdict) { - case NF_ACCEPT: - ret = okfn(skb); - break; - - case NF_DROP: - kfree_skb(skb); - ret = -EPERM; - break; - } - + ret2 = -EPERM; +unlock: rcu_read_unlock(); - return ret; + return ret2; } void nf_reinject(struct sk_buff *skb, struct nf_info *info, --- linux-2.6.11-rc1/net/bridge/br_netfilter.c.old 2005-01-23 13:31:39.080899144 +0100 +++ linux-2.6.11-rc1/net/bridge/br_netfilter.c 2005-01-23 13:32:02.861283976 +0100 @@ -829,8 +829,7 @@ static unsigned int ip_sabotage_in(unsig { if ((*pskb)->nf_bridge && !((*pskb)->nf_bridge->mask & BRNF_NF_BRIDGE_PREROUTING)) { - okfn(*pskb); - return NF_STOLEN; + return NF_STOP; } return NF_ACCEPT; @@ -888,8 +887,7 @@ static unsigned int ip_sabotage_out(unsi if (out->priv_flags & IFF_802_1Q_VLAN) nf_bridge->netoutdev = (struct net_device *)out; #endif - okfn(skb); - return NF_STOLEN; + return NF_STOP; } return NF_ACCEPT; From gandalf@wlug.westbo.se Sun Jan 23 08:08:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 08:08:42 -0800 (PST) Received: from null.rsn.bth.se (postfix@null.rsn.bth.se [194.47.142.3]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0NG8ZhR022564 for ; Sun, 23 Jan 2005 08:08:36 -0800 Received: by null.rsn.bth.se (Postfix, from userid 65534) id 9A12D2C00B1; Sun, 23 Jan 2005 17:08:30 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by null.rsn.bth.se (Postfix) with ESMTP id 3E1482C00B3; Sun, 23 Jan 2005 17:08:30 +0100 (CET) Received: from tux.rsn.bth.se (tux.rsn.bth.se [194.47.143.135]) by null.rsn.bth.se (Postfix) with ESMTP id 759D72C00B1; Sun, 23 Jan 2005 17:08:29 +0100 (CET) Received: by tux.rsn.bth.se (Postfix, from userid 501) id BE2143FB5; Sun, 23 Jan 2005 17:08:29 +0100 (CET) Subject: Re: [PATCH/RFC] Reduce call chain length in netfilter (was: Re: do_IRQ: stack overflow: 872..) From: Martin Josefsson To: Bart De Schuymer Cc: "David S. Miller" , shemminger@osdl.org, dwmw2@infradead.org, ak@suse.de, snort2004@mail.ru, bridge@osdl.org, netdev@oss.sgi.com, Rusty Russell In-Reply-To: <1106484019.3376.5.camel@localhost.localdomain> References: <1131604877.20041218092730@mail.ru.suse.lists.linux.kernel> <1105117559.11753.34.camel@baythorne.infradead.org> <20050107100017.454ddadc@dxpl.pdx.osdl.net> <1105133241.3375.16.camel@localhost.localdomain> <20050118135735.4b77d38d.davem@davemloft.net> <1106433059.4486.11.camel@localhost.localdomain> <1106436153.20995.42.camel@tux.rsn.bth.se> <1106484019.3376.5.camel@localhost.localdomain> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-fuimzzHstOWacJ6oQqa5" Date: Sun, 23 Jan 2005 17:08:29 +0100 Message-Id: <1106496509.1085.1.camel@tux.rsn.bth.se> Mime-Version: 1.0 X-Mailer: Evolution 2.0.3 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: by amavisd-new-20030616-p10 on null.rsn.bth.se X-Virus-Status: Clean X-archive-position: 667 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: gandalf@wlug.westbo.se Precedence: bulk X-list: netdev Content-Length: 1304 Lines: 51 --=-fuimzzHstOWacJ6oQqa5 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Sun, 2005-01-23 at 13:40 +0100, Bart De Schuymer wrote: > Hi Martin, Hi Bart > > I guess you never testcompiled with CONFIG_NETFILTER_DEBUG set :) >=20 > Oops, no. I was imagining I could code that without error... > There was another compile error with CONFIG_NETFILTER_DEBUG in the patch > (skb that should have been (*pskb)) :( :) > > > + if (verdict > NF_MAX_VERDICT) { > > > + NFDEBUG("Evil return from %p(%u).\n", > > > + elem->hook, hook); > > > + continue; > > > + } > >=20 > > Maybe add unlikely() around the test? >=20 > OK. I added another one around another debugging if-statement. I'm now running a kernel with this patch and everything seems to still be working. So unless someone else has something to comment I think this should be applied. The decrease in call-depth is important. --=20 /Martin --=-fuimzzHstOWacJ6oQqa5 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQBB88v8Wm2vlfa207ERAr8iAKCnEC6wtsFBsBXnNqjMy9u9gt/TjQCeM2BL qaJeTtbB5wOKFi7J9BfBX4E= =3U0/ -----END PGP SIGNATURE----- --=-fuimzzHstOWacJ6oQqa5-- From eric.lemoine@gmail.com Sun Jan 23 08:17:00 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 08:17:05 -0800 (PST) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.204]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0NGGx0j023206 for ; Sun, 23 Jan 2005 08:17:00 -0800 Received: by wproxy.gmail.com with SMTP id 57so84718wri for ; Sun, 23 Jan 2005 08:16:54 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=Xlf7GYR9aVpSB+vAK7J5/2x6Kuks5ZGoIPqQcFv06IlY+1kigBL3u04/6o+MD6HmABPY4uezGnYloEHqeCamgCpjxkjg5zUU6LKj33sunVo65XEUri54IqFgqNe6gnxdJd1ffqBzV21pCY8xhzmWjRxOS5oStaiiRJ7K0WGRh2w= Received: by 10.54.36.65 with SMTP id j65mr171720wrj; Sun, 23 Jan 2005 08:16:54 -0800 (PST) Received: by 10.54.30.77 with HTTP; Sun, 23 Jan 2005 08:16:53 -0800 (PST) Message-ID: <5cac192f05012308167a78efa6@mail.gmail.com> Date: Sun, 23 Jan 2005 17:16:53 +0100 From: Eric Lemoine Reply-To: Eric Lemoine To: OGAWA Hirofumi Subject: Re: "Close NETIF_F_LLTX race conditions" problem Cc: netdev@oss.sgi.com In-Reply-To: <871xcc5oef.fsf@devron.myhome.or.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <871xcc5oef.fsf@devron.myhome.or.jp> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 668 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: eric.lemoine@gmail.com Precedence: bulk X-list: netdev Content-Length: 602 Lines: 17 On Sun, 23 Jan 2005 21:19:04 +0900, OGAWA Hirofumi wrote: > Hi, > > I got the following warning. The cause of this warning is the context > of ->hard_start_xmit() was changed. Before that patch the IRQ was > enableing, but now it was disabled. > > With this change, the assumption of some drivers was changed, so now > some drivers need to change the ->hard_start_xmit(). > (e.g, dev_kfree_skb() -> dev_kfree_skb_irq(), spin_lock_irq() -> spin_lock()). This is a known issue (in 2.6.11-rc2). Linus' tree should certainly include the revert patch at this time. -- Eric From romieu@fr.zoreil.com Sun Jan 23 08:17:50 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 08:17:56 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0NGHmtf023532 for ; Sun, 23 Jan 2005 08:17:49 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.13.1/8.12.1) with ESMTP id j0NGGvYu001969; Sun, 23 Jan 2005 17:16:57 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.13.1/8.13.1/Submit) id j0NGGlbt001968; Sun, 23 Jan 2005 17:16:47 +0100 Date: Sun, 23 Jan 2005 17:16:47 +0100 From: Francois Romieu To: Jeff Garzik , NetDev Subject: Re: [PATCH 1/5] sis900 printk audit Message-ID: <20050123161647.GA1917@electric-eye.fr.zoreil.com> References: <20050122214657.18649.66345@localhost.localdomain> <20050122222640.GB24461@electric-eye.fr.zoreil.com> <20050123085229.GD31816@gateway.milesteg.arr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050123085229.GD31816@gateway.milesteg.arr> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 669 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Content-Length: 338 Lines: 15 Daniele Venzano : [...] > Is that a suggestion that I make some global variable or macro to avoid > repeating that declaration in almost every function of the driver ? It suggests turning: struct sis900_private *sis_priv = net_dev->priv; into: struct sis900_private *sis_priv = netdev_priv(net_dev); -- Ueimor From romieu@fr.zoreil.com Sun Jan 23 08:33:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 08:33:58 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0NGXpBn027806 for ; Sun, 23 Jan 2005 08:33:52 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.13.1/8.12.1) with ESMTP id j0NGXZDT002139; Sun, 23 Jan 2005 17:33:35 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.13.1/8.13.1/Submit) id j0NGXUD8002138; Sun, 23 Jan 2005 17:33:30 +0100 Date: Sun, 23 Jan 2005 17:33:30 +0100 From: Francois Romieu To: OGAWA Hirofumi Cc: netdev@oss.sgi.com Subject: Re: "Close NETIF_F_LLTX race conditions" problem Message-ID: <20050123163330.GB1917@electric-eye.fr.zoreil.com> References: <871xcc5oef.fsf@devron.myhome.or.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <871xcc5oef.fsf@devron.myhome.or.jp> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 670 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Content-Length: 352 Lines: 11 OGAWA Hirofumi : [context if hard_start_xmit changed] > Umm.. Should we fix the all drivers? Any idea? The bk-commit mailing-list shows that the culprit has been reverted. Actually it would probably make sense to audit/change the drivers to fulfill the requirements for Davem's patch before he resurrects it. -- Ueimor From webvenza@libero.it Sun Jan 23 10:31:58 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 10:32:03 -0800 (PST) Received: from gateway.milesteg.arr (venza@adsl-ull-189-134.44-151.net24.it [151.44.134.189]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0NIVvs7011283 for ; Sun, 23 Jan 2005 10:31:58 -0800 Date: Sun, 23 Jan 2005 19:31:55 +0100 From: Daniele Venzano To: Francois Romieu Cc: NetDev Subject: Re: [PATCH 1/5] sis900 printk audit Message-ID: <20050123183155.GF31816@picchio.gall.it> Mail-Followup-To: Francois Romieu , NetDev References: <20050122214657.18649.66345@localhost.localdomain> <20050122222640.GB24461@electric-eye.fr.zoreil.com> <20050123085229.GD31816@gateway.milesteg.arr> <20050123161647.GA1917@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050123161647.GA1917@electric-eye.fr.zoreil.com> X-Operating-System: Debian GNU/Linux on kernel Linux 2.4.28-grsec X-Copyright: Forwarding or publishing without permission is prohibited. X-Truth: La vita e' una questione di culo, o ce l'hai o te lo fanno. X-GPG-Fingerprint: 642A A345 1CEF B6E3 925C 23CE DAB9 8764 25B3 57ED X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 671 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: webvenza@libero.it Precedence: bulk X-list: netdev Content-Length: 467 Lines: 22 On Sun, Jan 23, 2005 at 05:16:47PM +0100, Francois Romieu wrote: > It suggests turning: > > struct sis900_private *sis_priv = net_dev->priv; > > into: > > struct sis900_private *sis_priv = netdev_priv(net_dev); Ah, that is indeed a good advice, I didn't even know that netdev_priv() existed. I'll put it on my todo list, all the driver should be converted to that form. Thanks. -- ----------------------------- Daniele Venzano Web: http://teg.homeunix.org From rich@phekda.gotadsl.co.uk Sun Jan 23 11:07:17 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 11:07:23 -0800 (PST) Received: from smtp.nildram.co.uk (smtp.nildram.co.uk [195.112.4.54]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0NJ7GOP012708 for ; Sun, 23 Jan 2005 11:07:17 -0800 Received: from katrina.int.phekda.gotadsl.co.uk (81-6-243-156.dyn.gotadsl.co.uk [81.6.243.156]) by smtp.nildram.co.uk (Postfix) with ESMTP id AE3522BFB52; Sun, 23 Jan 2005 19:07:11 +0000 (GMT) Received: from [192.168.1.4] (katrina.int.phekda.gotadsl.co.uk [192.168.1.4]) by katrina.int.phekda.gotadsl.co.uk (Postfix) with ESMTP id 7A6BD384C9; Sun, 23 Jan 2005 19:08:41 +0000 (GMT) Message-ID: <41F3F632.3060800@phekda.gotadsl.co.uk> Date: Sun, 23 Jan 2005 19:08:34 +0000 From: Richard Dawe User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020 X-Accept-Language: en, de, fr MIME-Version: 1.0 To: Francois Romieu Cc: netdev@oss.sgi.com, Me Subject: Re: Acer Aspire 1524WLMi and RealTek 8169 - very slow References: <41A09541.5040405@phekda.gotadsl.co.uk> <41A0F0D5.9050702@phekda.gotadsl.co.uk> <20041121205814.GA22460@electric-eye.fr.zoreil.com> <41A24F35.5080106@phekda.gotadsl.co.uk> <20041122213008.GA9618@electric-eye.fr.zoreil.com> <41D2844E.5070204@phekda.gotadsl.co.uk> <20041229235203.GA5465@electric-eye.fr.zoreil.com> <41F250D1.8000207@phekda.gotadsl.co.uk> <41F26FD1.2060407@phekda.gotadsl.co.uk> <20050122230156.GC24461@electric-eye.fr.zoreil.com> In-Reply-To: <20050122230156.GC24461@electric-eye.fr.zoreil.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 672 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rich@phekda.gotadsl.co.uk Precedence: bulk X-list: netdev Content-Length: 2025 Lines: 58 Hello. Francois Romieu wrote: > Richard Dawe : > [...] > >>So I looked at the latest RealTek driver for Linux (version 220) and >>that has some separate initialisation code for RTL_GIGA_MAC_VER_X >>(MCFG_METHOD_4, they call it). I ported that over to r8169.c in >>2.6.11-rc1 and it appears to work. > > > Nice. Have you checked that ethtool performs correctly when you try to > set the link parameters with the new code (+ plug/unplug cable) ? It detects the cable being removed and reinserted OK. I can set the link speed and duplex fine using the "media=..." parameter on insmod. My ADSL router doesn't have an interface (GUI or CLI) for setting the port speed and duplex. A Linksys WRT54GS wireless router is turning up tomorrow, so I may be able to set the port speed & duplex with that. But for now I can't test autodetection when the switch offers less than 100Mbps full-duplex. I also have no GigE equipment to test with. If I try setting the speed & duplex using something like this: ethtool -s eth0 speed 10 duplex half it fails. I get no errors, but the "ethtool eth0" shows the link speed & duplex to be 100Mbps full-duplex. I think I managed to get it into 100Mbps half-duplex once When I try to "ethtool -s eth0 speed 10", the link lights on my ADSL router change to orange, which indicates 10Mbps. Then the light goes out and comes back green, which indicates 100Mbps. So maybe the driver isn't waiting long enough for something. >>Attached is the patch against 2.6.11-rc1. I'm not sure if it caters to >>your tastes. Maybe you'll want to rename RTL_GIGA_MAC_VER_X. > > > I'll change the braces placement, the tab/spaces mix and push it. > > Please include something like the line below in your future patches: > Signed-off-by: Richard Dawe Thanks, will do. Bye, Rich =] -- Richard Dawe [ http://homepages.nildram.co.uk/~phekda/richdawe/ ] "You can't evaluate a man by logic alone." -- McCoy, "I, Mudd", Star Trek From rmk+netdev=oss.sgi.com@arm.linux.org.uk Sun Jan 23 12:03:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 12:03:44 -0800 (PST) Received: from caramon.arm.linux.org.uk (caramon.arm.linux.org.uk [212.18.232.186]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0NK3Wi8014261 for ; Sun, 23 Jan 2005 12:03:35 -0800 Received: from flint.arm.linux.org.uk ([2002:d412:e8ba:1:201:2ff:fe14:8fad]) by caramon.arm.linux.org.uk with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.41) id 1Csnx7-0004jF-2i; Sun, 23 Jan 2005 20:03:17 +0000 Received: from rmk by flint.arm.linux.org.uk with local (Exim 4.41) id 1Csnx5-0007zZ-Um; Sun, 23 Jan 2005 20:03:15 +0000 Date: Sun, 23 Jan 2005 20:03:15 +0000 From: Russell King To: Andrew Morton Cc: Jens Axboe , alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? Message-ID: <20050123200315.A25351@flint.arm.linux.org.uk> Mail-Followup-To: Andrew Morton , Jens Axboe , alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com References: <20050121161959.GO3922@fi.muni.cz> <1106360639.15804.1.camel@boxen> <20050123091154.GC16648@suse.de> <20050123011918.295db8e8.akpm@osdl.org> <20050123095608.GD16648@suse.de> <20050123023248.263daca9.akpm@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20050123023248.263daca9.akpm@osdl.org>; from akpm@osdl.org on Sun, Jan 23, 2005 at 02:32:48AM -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 673 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rmk+lkml@arm.linux.org.uk Precedence: bulk X-list: netdev Content-Length: 2783 Lines: 70 On Sun, Jan 23, 2005 at 02:32:48AM -0800, Andrew Morton wrote: > Jens Axboe wrote: > > > > But I'm still stuck with all of my ram gone after a > > 600MB fillmem, half of it is just in swap. > > Well. Half of it has gone so far ;) > > > > > Attaching meminfo and sysrq-m after fillmem. > > (I meant a really big fillmem: a couple of 2GB ones. Not to worry.) > > It's not in slab and the pagecache and anonymous memory stuff seems to be > working OK. So it has to be something else, which does a bare > __alloc_pages(). Low-level block stuff, networking, arch code, perhaps. > > I don't think I've ever really seen code to diagnose this. > > A simplistic approach would be to add eight or so ulongs into struct page, > populate them with builtin_return_address(0...7) at allocation time, then > modify sysrq-m to walk mem_map[] printing it all out for pages which have > page_count() > 0. That'd find the culprit. I think I may be seeing something odd here, maybe a possible memory leak. The only problem I have is wondering whether I'm actually comparing like with like. Maybe some networking people can provide a hint? Below is gathered from 2.6.11-rc1. bash-2.05a# head -n2 /proc/slabinfo slabinfo - version: 2.1 # name bash-2.05a# cat /proc/net/rt_cache | wc -l; grep ip_dst /proc/slabinfo 115 ip_dst_cache 759 885 256 15 1 bash-2.05a# cat /proc/net/rt_cache | wc -l; grep ip_dst /proc/slabinfo 117 ip_dst_cache 770 885 256 15 1 bash-2.05a# cat /proc/net/rt_cache | wc -l; grep ip_dst /proc/slabinfo 133 ip_dst_cache 775 885 256 15 1 bash-2.05a# cat /proc/net/rt_cache | wc -l; grep ip_dst /proc/slabinfo 18 ip_dst_cache 664 885 256 15 1 bash-2.05a# cat /proc/net/rt_cache | wc -l; grep ip_dst /proc/slabinfo 20 ip_dst_cache 664 885 256 15 1 bash-2.05a# cat /proc/net/rt_cache | wc -l; grep ip_dst /proc/slabinfo 22 ip_dst_cache 673 885 256 15 1 bash-2.05a# cat /proc/net/rt_cache | wc -l; grep ip_dst /proc/slabinfo 23 ip_dst_cache 670 885 256 15 1 bash-2.05a# cat /proc/net/rt_cache | wc -l; grep ip_dst /proc/slabinfo 24 ip_dst_cache 675 885 256 15 1 bash-2.05a# cat /proc/net/rt_cache | wc -l; grep ip_dst /proc/slabinfo 24 ip_dst_cache 669 885 256 15 1 I'm fairly positive when I rebooted the machine a couple of days ago, ip_dst_cache was significantly smaller for the same number of lines in /proc/net/rt_cache. -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/ 2.6 Serial core From tgraf@suug.ch Sun Jan 23 14:59:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 14:59:58 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0NMxrx3021417 for ; Sun, 23 Jan 2005 14:59:54 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 9373585; Sun, 23 Jan 2005 23:59:29 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id C09EC1C0EA; Mon, 24 Jan 2005 00:00:12 +0100 (CET) Date: Mon, 24 Jan 2005 00:00:12 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCHSET] Extended matches and basic classifier Message-ID: <20050123230012.GB23931@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 674 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 492 Lines: 16 This patchset adds the ematch API, the ematches cmp, nbyte, u32, meta, and the basic classifier. It doesn't touch any existing code. The following changes were made since the last review: - various typo and bug fixes - macro for meta data collectors (beautification) - some more comments The required changes for iproute2 can be pulled from: bk://tgr.bkbits.net/iproute2-tgr The iproute2 part still has quite some potential for improvements to ease usability though. Cheers, Thomas From tgraf@suug.ch Sun Jan 23 15:02:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 15:02:08 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0NN20Hv021789 for ; Sun, 23 Jan 2005 15:02:01 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 7281085; Mon, 24 Jan 2005 00:01:38 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id D7EF41C0EA; Mon, 24 Jan 2005 00:02:21 +0100 (CET) Date: Mon, 24 Jan 2005 00:02:21 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH 2/6] PKT_SCHED: Simple comparison ematch (cmp) Message-ID: <20050123230221.GD23931@postel.suug.ch> References: <20050123230012.GB23931@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050123230012.GB23931@postel.suug.ch> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 675 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 6349 Lines: 226 The cmp ematch compares a static value provided by userspace against a 8, 16, or 32bit chunk read from the packet. The reading offset is provided by userspace and based on one of the skb layers (mac|nh|h). The ematch provides functionality to transform the byte order of the chunk and/or apply a mask and understands the operands eq, lt, and gt. Basically, it is very similiar to the u32 (e)match but tries filling the gaps left behind. Signed-off-by: Thomas Graf diff -Nru linux-2.6.11-rc2-bk1.orig/include/linux/pkt_cls.h linux-2.6.11-rc2-bk1/include/linux/pkt_cls.h --- linux-2.6.11-rc2-bk1.orig/include/linux/pkt_cls.h 2005-01-23 17:29:35.000000000 +0100 +++ linux-2.6.11-rc2-bk1/include/linux/pkt_cls.h 2005-01-23 17:29:40.000000000 +0100 @@ -383,6 +383,7 @@ enum { TCF_EM_CONTAINER, + TCF_EM_CMP, __TCF_EM_MAX }; @@ -391,4 +392,11 @@ TCF_EM_PROG_TC }; +enum +{ + TCF_EM_OPND_EQ, + TCF_EM_OPND_GT, + TCF_EM_OPND_LT +}; + #endif diff -Nru linux-2.6.11-rc2-bk1.orig/include/linux/tc_ematch/tc_em_cmp.h linux-2.6.11-rc2-bk1/include/linux/tc_ematch/tc_em_cmp.h --- linux-2.6.11-rc2-bk1.orig/include/linux/tc_ematch/tc_em_cmp.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.11-rc2-bk1/include/linux/tc_ematch/tc_em_cmp.h 2005-01-23 17:29:40.000000000 +0100 @@ -0,0 +1,26 @@ +#ifndef __LINUX_TC_EM_CMP_H +#define __LINUX_TC_EM_CMP_H + +#include + +struct tcf_em_cmp +{ + __u32 val; + __u32 mask; + __u16 off; + __u8 align:4; + __u8 flags:4; + __u8 layer:4; + __u8 opnd:4; +}; + +enum +{ + TCF_EM_ALIGN_U8 = 1, + TCF_EM_ALIGN_U16 = 2, + TCF_EM_ALIGN_U32 = 4 +}; + +#define TCF_EM_CMP_TRANS 1 + +#endif diff -Nru linux-2.6.11-rc2-bk1.orig/include/net/pkt_cls.h linux-2.6.11-rc2-bk1/include/net/pkt_cls.h --- linux-2.6.11-rc2-bk1.orig/include/net/pkt_cls.h 2005-01-23 17:29:35.000000000 +0100 +++ linux-2.6.11-rc2-bk1/include/net/pkt_cls.h 2005-01-23 17:30:55.000000000 +0100 @@ -318,6 +318,26 @@ #endif /* CONFIG_NET_EMATCH */ +static inline unsigned char * tcf_get_base_ptr(struct sk_buff *skb, int layer) +{ + switch (layer) { + case TCF_LAYER_LINK: + return skb->data; + case TCF_LAYER_NETWORK: + return skb->nh.raw; + case TCF_LAYER_TRANSPORT: + return skb->h.raw; + } + + return NULL; +} + +static inline int tcf_valid_offset(struct sk_buff *skb, unsigned char *ptr, + int len) +{ + return unlikely((ptr + len) < skb->tail && ptr > skb->head); +} + #ifdef CONFIG_NET_CLS_IND static inline int tcf_change_indev(struct tcf_proto *tp, char *indev, struct rtattr *indev_tlv) diff -Nru linux-2.6.11-rc2-bk1.orig/net/sched/Kconfig linux-2.6.11-rc2-bk1/net/sched/Kconfig --- linux-2.6.11-rc2-bk1.orig/net/sched/Kconfig 2005-01-23 17:29:35.000000000 +0100 +++ linux-2.6.11-rc2-bk1/net/sched/Kconfig 2005-01-23 17:29:40.000000000 +0100 @@ -398,6 +398,16 @@ encapsulated precedences. Every level requires 4 bytes of addtional stack space. +config NET_EMATCH_CMP + tristate "Simple packet data comparison" + depends on NET_EMATCH + ---help--- + Say Y here if you want to be able to classify packets based on + simple packet data comparisons for 8, 16, and 32bit values. + + To compile this code as a module, choose M here: the + module will be called em_cmp. + config NET_CLS_ACT bool "Packet ACTION" depends on EXPERIMENTAL && NET_CLS && NET_QOS diff -Nru linux-2.6.11-rc2-bk1.orig/net/sched/Makefile linux-2.6.11-rc2-bk1/net/sched/Makefile --- linux-2.6.11-rc2-bk1.orig/net/sched/Makefile 2005-01-23 17:29:35.000000000 +0100 +++ linux-2.6.11-rc2-bk1/net/sched/Makefile 2005-01-23 17:29:40.000000000 +0100 @@ -34,3 +34,4 @@ obj-$(CONFIG_NET_CLS_TCINDEX) += cls_tcindex.o obj-$(CONFIG_NET_CLS_RSVP6) += cls_rsvp6.o obj-$(CONFIG_NET_EMATCH) += ematch.o +obj-$(CONFIG_NET_EMATCH_CMP) += em_cmp.o diff -Nru linux-2.6.11-rc2-bk1.orig/net/sched/em_cmp.c linux-2.6.11-rc2-bk1/net/sched/em_cmp.c --- linux-2.6.11-rc2-bk1.orig/net/sched/em_cmp.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.11-rc2-bk1/net/sched/em_cmp.c 2005-01-23 17:31:03.000000000 +0100 @@ -0,0 +1,101 @@ +/* + * net/sched/em_cmp.c Simple packet data comparison ematch + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: Thomas Graf + */ + +#include +#include +#include +#include +#include +#include +#include + +static inline int cmp_needs_transformation(struct tcf_em_cmp *cmp) +{ + return unlikely(cmp->flags & TCF_EM_CMP_TRANS); +} + +static int em_cmp_match(struct sk_buff *skb, struct tcf_ematch *em, + struct tcf_pkt_info *info) +{ + struct tcf_em_cmp *cmp = (struct tcf_em_cmp *) em->data; + unsigned char *ptr = tcf_get_base_ptr(skb, cmp->layer) + cmp->off; + u32 val = 0; + + if (!tcf_valid_offset(skb, ptr, cmp->align)) + return 0; + + switch (cmp->align) { + case TCF_EM_ALIGN_U8: + val = *ptr; + break; + + case TCF_EM_ALIGN_U16: + val = *ptr << 8; + val |= *(ptr+1); + + if (cmp_needs_transformation(cmp)) + val = be16_to_cpu(val); + break; + + case TCF_EM_ALIGN_U32: + /* Worth checking boundries? The branching seems + * to get worse. Visit again. */ + val = *ptr << 24; + val |= *(ptr+1) << 16; + val |= *(ptr+2) << 8; + val |= *(ptr+3); + + if (cmp_needs_transformation(cmp)) + val = be32_to_cpu(val); + break; + + default: + return 0; + } + + if (cmp->mask) + val &= cmp->mask; + + switch (cmp->opnd) { + case TCF_EM_OPND_EQ: + return val == cmp->val; + case TCF_EM_OPND_LT: + return val < cmp->val; + case TCF_EM_OPND_GT: + return val > cmp->val; + } + + return 0; +} + +static struct tcf_ematch_ops em_cmp_ops = { + .kind = TCF_EM_CMP, + .datalen = sizeof(struct tcf_em_cmp), + .match = em_cmp_match, + .owner = THIS_MODULE, + .link = LIST_HEAD_INIT(em_cmp_ops.link) +}; + +static int __init init_em_cmp(void) +{ + return tcf_em_register(&em_cmp_ops); +} + +static void __exit exit_em_cmp(void) +{ + tcf_em_unregister(&em_cmp_ops); +} + +MODULE_LICENSE("GPL"); + +module_init(init_em_cmp); +module_exit(exit_em_cmp); + From tgraf@suug.ch Sun Jan 23 15:01:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 15:02:39 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0NN1Cw5021633 for ; Sun, 23 Jan 2005 15:01:12 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 96E3D85; Mon, 24 Jan 2005 00:00:49 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 8ED4D1C0EA; Mon, 24 Jan 2005 00:01:32 +0100 (CET) Date: Mon, 24 Jan 2005 00:01:32 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH 1/6] PKT_SCHED: Extended Matches API Message-ID: <20050123230132.GC23931@postel.suug.ch> References: <20050123230012.GB23931@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050123230012.GB23931@postel.suug.ch> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 676 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 25526 Lines: 863 An extended match (ematch) is a small classifiction tool not worth writing a full classifier for. Ematches can be interconnected to form a logic expression and get attached to classifiers to extend their functionatlity. The userspace part transforms the logic expressions into an array consisting of multiple sequences of interconnected ematches separated by markers. Precedence is implemented by a special ematch kind referencing a sequence beyond the marker of the current sequence causing the current position in the sequence to be pushed onto a stack to allow the current position to be overwritten by the position referenced in the special ematch. Matching continues in the new sequence until a marker is reached causing the position to be restored from the stack. Signed-off-by: Thomas Graf diff -Nru linux-2.6.11-rc2-bk1.orig/include/linux/pkt_cls.h linux-2.6.11-rc2-bk1/include/linux/pkt_cls.h --- linux-2.6.11-rc2-bk1.orig/include/linux/pkt_cls.h 2005-01-23 19:08:31.000000000 +0100 +++ linux-2.6.11-rc2-bk1/include/linux/pkt_cls.h 2005-01-23 19:08:13.000000000 +0100 @@ -319,4 +319,76 @@ #define TCA_TCINDEX_MAX (__TCA_TCINDEX_MAX - 1) +/* Extended Matches */ + +struct tcf_ematch_tree_hdr +{ + __u16 nmatches; + __u16 progid; +}; + +enum +{ + TCA_EMATCH_TREE_UNSPEC, + TCA_EMATCH_TREE_HDR, + TCA_EMATCH_TREE_LIST, + __TCA_EMATCH_TREE_MAX +}; +#define TCA_EMATCH_TREE_MAX (__TCA_EMATCH_TREE_MAX - 1) + +struct tcf_ematch_hdr +{ + __u16 matchid; + __u16 kind; + __u16 flags; + __u16 pad; /* currently unused */ +}; + +/* 0 1 + * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 + * +-----------------------+-+-+---+ + * | Unused |S|I| R | + * +-----------------------+-+-+---+ + * + * R(2) ::= relation to next ematch + * where: 0 0 END (last ematch) + * 0 1 AND + * 1 0 OR + * 1 1 Unused (invalid) + * I(1) ::= invert result + * S(1) ::= simple payload + */ +#define TCF_EM_REL_END 0 +#define TCF_EM_REL_AND (1<<0) +#define TCF_EM_REL_OR (1<<1) +#define TCF_EM_INVERT (1<<2) +#define TCF_EM_SIMPLE (1<<3) + +#define TCF_EM_REL_MASK 3 +#define TCF_EM_REL_VALID(v) (((v) & TCF_EM_REL_MASK) != TCF_EM_REL_MASK) + +enum +{ + TCF_LAYER_LINK, + TCF_LAYER_NETWORK, + TCF_LAYER_TRANSPORT, + __TCF_LAYER_MAX +}; +#define TCF_LAYER_MAX (__TCF_LAYER_MAX - 1) + +/* Ematch type assignments + * 1..32767 Reserved for ematches inside kernel tree + * 32768..65535 Free to use, not reliable + */ +enum +{ + TCF_EM_CONTAINER, + __TCF_EM_MAX +}; + +enum +{ + TCF_EM_PROG_TC +}; + #endif diff -Nru linux-2.6.11-rc2-bk1.orig/include/linux/rtnetlink.h linux-2.6.11-rc2-bk1/include/linux/rtnetlink.h --- linux-2.6.11-rc2-bk1.orig/include/linux/rtnetlink.h 2005-01-23 19:08:31.000000000 +0100 +++ linux-2.6.11-rc2-bk1/include/linux/rtnetlink.h 2005-01-23 16:31:57.000000000 +0100 @@ -779,6 +779,11 @@ goto rtattr_failure; \ __rta_fill(skb, attrtype, attrlen, data); }) +#define RTA_PUT_NOHDR(skb, attrlen, data) \ +({ if (unlikely(skb_tailroom(skb) < (int)(attrlen))) \ + goto rtattr_failure; \ + memcpy(skb_put(skb, RTA_ALIGN(attrlen)), data, attrlen); }) + static inline struct rtattr * __rta_reserve(struct sk_buff *skb, int attrtype, int attrlen) { diff -Nru linux-2.6.11-rc2-bk1.orig/include/net/pkt_cls.h linux-2.6.11-rc2-bk1/include/net/pkt_cls.h --- linux-2.6.11-rc2-bk1.orig/include/net/pkt_cls.h 2005-01-23 19:08:31.000000000 +0100 +++ linux-2.6.11-rc2-bk1/include/net/pkt_cls.h 2005-01-23 19:08:44.000000000 +0100 @@ -148,6 +148,176 @@ extern int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts, struct tcf_ext_map *map); +/** + * struct tcf_pkt_info - packet information + */ +struct tcf_pkt_info +{ +}; + +#ifdef CONFIG_NET_EMATCH + +struct tcf_ematch_ops; + +/** + * struct tcf_ematch - extended match (ematch) + * + * @matchid: identifier to allow userspace to reidentify a match + * @flags: flags specifying attributes and the relation to other matches + * @ops: the operations lookup table of the corresponding ematch module + * @datalen: length of the ematch specific configuration data + * @data: ematch specific data + */ +struct tcf_ematch +{ + u16 matchid; + u16 flags; + struct tcf_ematch_ops * ops; + unsigned int datalen; + unsigned long data; +}; + +static inline int tcf_em_is_container(struct tcf_ematch *em) +{ + return !em->ops; +} + +static inline int tcf_em_is_simple(struct tcf_ematch *em) +{ + return em->flags & TCF_EM_SIMPLE; +} + +static inline int tcf_em_is_inverted(struct tcf_ematch *em) +{ + return em->flags & TCF_EM_INVERT; +} + +static inline int tcf_em_last_match(struct tcf_ematch *em) +{ + return (em->flags & TCF_EM_REL_MASK) == TCF_EM_REL_END; +} + +static inline int tcf_em_early_end(struct tcf_ematch *em, int result) +{ + if (tcf_em_last_match(em)) + return 1; + + if (result == 0 && em->flags & TCF_EM_REL_AND) + return 1; + + if (result != 0 && em->flags & TCF_EM_REL_OR) + return 1; + + return 0; +} + +/** + * struct tcf_ematch_tree - ematch tree handle + * + * @hdr: ematch tree header supplied by userspace + * @matches: array of ematches + */ +struct tcf_ematch_tree +{ + struct tcf_ematch_tree_hdr hdr; + struct tcf_ematch * matches; + +}; + +/** + * struct tcf_ematch_ops - ematch module operations + * + * @kind: identifier (kind) of this ematch module + * @datalen: length of expected configuration data (optional) + * @change: called during validation (optional) + * @match: called during ematch tree evaluation, must return 1/0 + * @destroy: called during destroyage (optional) + * @dump: called during dumping process (optional) + * @owner: owner, must be set to THIS_MODULE + * @link: link to previous/next ematch module (internal use) + */ +struct tcf_ematch_ops +{ + int kind; + int datalen; + int (*change)(struct tcf_proto *, void *, + int, struct tcf_ematch *); + int (*match)(struct sk_buff *, struct tcf_ematch *, + struct tcf_pkt_info *); + void (*destroy)(struct tcf_proto *, + struct tcf_ematch *); + int (*dump)(struct sk_buff *, struct tcf_ematch *); + struct module *owner; + struct list_head link; +}; + +extern int tcf_em_register(struct tcf_ematch_ops *); +extern int tcf_em_unregister(struct tcf_ematch_ops *); +extern int tcf_em_tree_validate(struct tcf_proto *, struct rtattr *, + struct tcf_ematch_tree *); +extern void tcf_em_tree_destroy(struct tcf_proto *, struct tcf_ematch_tree *); +extern int tcf_em_tree_dump(struct sk_buff *, struct tcf_ematch_tree *, int); +extern int __tcf_em_tree_match(struct sk_buff *, struct tcf_ematch_tree *, + struct tcf_pkt_info *); + +/** + * tcf_em_tree_change - replace ematch tree of a running classifier + * + * @tp: classifier kind handle + * @dst: destination ematch tree variable + * @src: source ematch tree (temporary tree from tcf_em_tree_validate) + * + * This functions replaces the ematch tree in @dst with the ematch + * tree in @src. The classifier in charge of the ematch tree may be + * running. + */ +static inline void tcf_em_tree_change(struct tcf_proto *tp, + struct tcf_ematch_tree *dst, + struct tcf_ematch_tree *src) +{ + tcf_tree_lock(tp); + memcpy(dst, src, sizeof(*dst)); + tcf_tree_unlock(tp); +} + +/** + * tcf_em_tree_match - evaulate an ematch tree + * + * @skb: socket buffer of the packet in question + * @tree: ematch tree to be used for evaluation + * @info: packet information examined by classifier + * + * This function matches @skb against the ematch tree in @tree by going + * through all ematches respecting their logic relations returning + * as soon as the result is obvious. + * + * Returns 1 if the ematch tree as-one matches, no ematches are configured + * or ematch is not enabled in the kernel, otherwise 0 is returned. + */ +static inline int tcf_em_tree_match(struct sk_buff *skb, + struct tcf_ematch_tree *tree, + struct tcf_pkt_info *info) +{ + if (tree->hdr.nmatches) + return __tcf_em_tree_match(skb, tree, info); + else + return 1; +} + +#else /* CONFIG_NET_EMATCH */ + +struct tcf_ematch_tree +{ +}; + +#define tcf_em_tree_validate(tp, tb, t) ((void)(t), 0) +#define tcf_em_tree_destroy(tp, t) do { (void)(t); } while(0) +#define tcf_em_tree_dump(skb, t, tlv) (0) +#define tcf_em_tree_change(tp, dst, src) do { } while(0) +#define tcf_em_tree_match(skb, t, info) ((void)(info), 1) + +#endif /* CONFIG_NET_EMATCH */ + #ifdef CONFIG_NET_CLS_IND static inline int tcf_change_indev(struct tcf_proto *tp, char *indev, struct rtattr *indev_tlv) diff -Nru linux-2.6.11-rc2-bk1.orig/net/sched/Kconfig linux-2.6.11-rc2-bk1/net/sched/Kconfig --- linux-2.6.11-rc2-bk1.orig/net/sched/Kconfig 2005-01-23 19:08:31.000000000 +0100 +++ linux-2.6.11-rc2-bk1/net/sched/Kconfig 2005-01-23 19:08:13.000000000 +0100 @@ -375,6 +375,29 @@ To compile this code as a module, choose M here: the module will be called cls_rsvp6. +config NET_EMATCH + bool "Extended Matches" + depends on NET_CLS + ---help--- + Say Y here if you want to use extended matches on top of classifiers + and select the extended matches below. + + Extended matches are small classification helpers not worth writing + a separate classifier. + + You must have a recent version of the iproute2 tools in order to use + extended matches. + +config NET_EMATCH_STACK + int "Stack size" + depends on NET_EMATCH + default "32" + ---help--- + Size of the local stack variable used while evaluating the tree of + ematches. Limits the depth of the tree, i.e. the number of + encapsulated precedences. Every level requires 4 bytes of addtional + stack space. + config NET_CLS_ACT bool "Packet ACTION" depends on EXPERIMENTAL && NET_CLS && NET_QOS diff -Nru linux-2.6.11-rc2-bk1.orig/net/sched/Makefile linux-2.6.11-rc2-bk1/net/sched/Makefile --- linux-2.6.11-rc2-bk1.orig/net/sched/Makefile 2005-01-23 19:08:31.000000000 +0100 +++ linux-2.6.11-rc2-bk1/net/sched/Makefile 2005-01-23 19:08:13.000000000 +0100 @@ -33,3 +33,4 @@ obj-$(CONFIG_NET_CLS_RSVP) += cls_rsvp.o obj-$(CONFIG_NET_CLS_TCINDEX) += cls_tcindex.o obj-$(CONFIG_NET_CLS_RSVP6) += cls_rsvp6.o +obj-$(CONFIG_NET_EMATCH) += ematch.o diff -Nru linux-2.6.11-rc2-bk1.orig/net/sched/ematch.c linux-2.6.11-rc2-bk1/net/sched/ematch.c --- linux-2.6.11-rc2-bk1.orig/net/sched/ematch.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.11-rc2-bk1/net/sched/ematch.c 2005-01-23 16:31:57.000000000 +0100 @@ -0,0 +1,526 @@ +/* + * net/sched/ematch.c Extended Match API + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: Thomas Graf + * + * ========================================================================== + * + * An extended match (ematch) is a small classification tool not worth + * writing a full classifier for. Ematches can be interconnected to form + * a logic expression and get attached to classifiers to extend their + * functionatlity. + * + * The userspace part transforms the logic expressions into an array + * consisting of multiple sequences of interconnected ematches separated + * by markers. Precedence is implemented by a special ematch kind + * referencing a sequence beyond the marker of the current sequence + * causing the current position in the sequence to be pushed onto a stack + * to allow the current position to be overwritten by the position referenced + * in the special ematch. Matching continues in the new sequence until a + * marker is reached causing the position to be restored from the stack. + * + * Example: + * A AND (B1 OR B2) AND C AND D + * + * ------->-PUSH------- + * -->-- / -->-- \ -->-- + * / \ / / \ \ / \ + * +-------+-------+-------+-------+-------+--------+ + * | A AND | B AND | C AND | D END | B1 OR | B2 END | + * +-------+-------+-------+-------+-------+--------+ + * \ / + * --------<-POP--------- + * + * where B is a virtual ematch referencing to sequence starting with B1. + * + * ========================================================================== + * + * How to write an ematch in 60 seconds + * ------------------------------------ + * + * 1) Provide a matcher function: + * static int my_match(struct sk_buff *skb, struct tcf_ematch *m, + * struct tcf_pkt_info *info) + * { + * struct mydata *d = (struct mydata *) m->data; + * + * if (...matching goes here...) + * return 1; + * else + * return 0; + * } + * + * 2) Fill out a struct tcf_ematch_ops: + * static struct tcf_ematch_ops my_ops = { + * .kind = unique id, + * .datalen = sizeof(struct mydata), + * .match = my_match, + * .owner = THIS_MODULE, + * }; + * + * 3) Register/Unregister your ematch: + * static int __init init_my_ematch(void) + * { + * return tcf_em_register(&my_ops); + * } + * + * static void __exit exit_my_ematch(void) + * { + * return tcf_em_unregister(&my_ops); + * } + * + * module_init(init_my_ematch); + * module_exit(exit_my_ematch); + * + * 4) By now you should have two more seconds left, barely enough to + * open up a beer to watch the compilation going. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static LIST_HEAD(ematch_ops); +static DEFINE_RWLOCK(ematch_mod_lock); + +static inline struct tcf_ematch_ops * tcf_em_lookup(u16 kind) +{ + struct tcf_ematch_ops *e = NULL; + + read_lock(&ematch_mod_lock); + list_for_each_entry(e, &ematch_ops, link) { + if (kind == e->kind) { + if (!try_module_get(e->owner)) + e = NULL; + break; + } + } + read_unlock(&ematch_mod_lock); + + return e; +} + +/** + * tcf_em_register - register an extended match + * + * @ops: ematch operations lookup table + * + * This function must be called by ematches to announce their presence. + * The given @ops must have kind set to a unique identifier and the + * callback match() must be implemented. All other callbacks are optional + * and a fallback implementation is used instead. + * + * Returns -EEXISTS if an ematch of the same kind has already registered. + */ +int tcf_em_register(struct tcf_ematch_ops *ops) +{ + int err = -EEXIST; + struct tcf_ematch_ops *e; + + write_lock(&ematch_mod_lock); + list_for_each_entry(e, &ematch_ops, link) + if (ops->kind == e->kind) + goto errout; + + list_add_tail(&ops->link, &ematch_ops); + err = 0; +errout: + write_unlock(&ematch_mod_lock); + return err; +} + +/** + * tcf_em_unregister - unregster and extended match + * + * @ops: ematch operations lookup table + * + * This function must be called by ematches to announce their disappearance + * for examples when the module gets unloaded. The @ops parameter must be + * the same as the one used for registration. + * + * Returns -ENOENT if no matching ematch was found. + */ +int tcf_em_unregister(struct tcf_ematch_ops *ops) +{ + int err = 0; + struct tcf_ematch_ops *e; + + write_lock(&ematch_mod_lock); + list_for_each_entry(e, &ematch_ops, link) { + if (e == ops) { + list_del(&e->link); + goto out; + } + } + + err = -ENOENT; +out: + write_unlock(&ematch_mod_lock); + return err; +} + +static inline struct tcf_ematch * tcf_em_get_match(struct tcf_ematch_tree *tree, + int index) +{ + return &tree->matches[index]; +} + + +static int tcf_em_validate(struct tcf_proto *tp, + struct tcf_ematch_tree_hdr *tree_hdr, + struct tcf_ematch *em, struct rtattr *rta, int idx) +{ + int err = -EINVAL; + struct tcf_ematch_hdr *em_hdr = RTA_DATA(rta); + int data_len = RTA_PAYLOAD(rta) - sizeof(*em_hdr); + void *data = (void *) em_hdr + sizeof(*em_hdr); + + if (!TCF_EM_REL_VALID(em_hdr->flags)) + goto errout; + + if (em_hdr->kind == TCF_EM_CONTAINER) { + /* Special ematch called "container", carries an index + * referencing an external ematch sequence. */ + u32 ref; + + if (data_len < sizeof(ref)) + goto errout; + ref = *(u32 *) data; + + if (ref >= tree_hdr->nmatches) + goto errout; + + /* We do not allow backward jumps to avoid loops and jumps + * to our own position are of course illegal. */ + if (ref <= idx) + goto errout; + + + em->data = ref; + } else { + /* Note: This lookup will increase the module refcnt + * of the ematch module referenced. In case of a failure, + * a destroy function is called by the underlying layer + * which automatically releases the reference again, therefore + * the module MUST not be given back under any circumstances + * here. Be aware, the destroy function assumes that the + * module is held if the ops field is non zero. */ + em->ops = tcf_em_lookup(em_hdr->kind); + + if (em->ops == NULL) { + err = -ENOENT; + goto errout; + } + + /* ematch module provides expected length of data, so we + * can do a basic sanity check. */ + if (em->ops->datalen && data_len < em->ops->datalen) + goto errout; + + if (em->ops->change) { + err = em->ops->change(tp, data, data_len, em); + if (err < 0) + goto errout; + } else if (data_len > 0) { + /* ematch module doesn't provide an own change + * procedure and expects us to allocate and copy + * the ematch data. + * + * TCF_EM_SIMPLE may be specified stating that the + * data only consists of a u32 integer and the module + * does not expected a memory reference but rather + * the value carried. */ + if (em_hdr->flags & TCF_EM_SIMPLE) { + if (data_len < sizeof(u32)) + goto errout; + em->data = *(u32 *) data; + } else { + void *v = kmalloc(data_len, GFP_KERNEL); + if (v == NULL) { + err = -ENOBUFS; + goto errout; + } + memcpy(v, data, data_len); + em->data = (unsigned long) v; + } + } + } + + em->matchid = em_hdr->matchid; + em->flags = em_hdr->flags; + em->datalen = data_len; + + err = 0; +errout: + return err; +} + +/** + * tcf_em_tree_validate - validate ematch config TLV and build ematch tree + * + * @tp: classifier kind handle + * @rta: ematch tree configuration TLV + * @tree: destination ematch tree variable to store the resulting + * ematch tree. + * + * This function validates the given configuration TLV @rta and builds an + * ematch tree in @tree. The resulting tree must later be copied into + * the private classifier data using tcf_em_tree_change(). You MUST NOT + * provide the ematch tree variable of the private classifier data directly, + * the changes would not be locked properly. + * + * Returns a negative error code if the configuration TLV contains errors. + */ +int tcf_em_tree_validate(struct tcf_proto *tp, struct rtattr *rta, + struct tcf_ematch_tree *tree) +{ + int idx, list_len, matches_len, err = -EINVAL; + struct rtattr *tb[TCA_EMATCH_TREE_MAX]; + struct rtattr *rt_match, *rt_hdr, *rt_list; + struct tcf_ematch_tree_hdr *tree_hdr; + struct tcf_ematch *em; + + if (rtattr_parse_nested(tb, TCA_EMATCH_TREE_MAX, rta) < 0) + goto errout; + + rt_hdr = tb[TCA_EMATCH_TREE_HDR-1]; + rt_list = tb[TCA_EMATCH_TREE_LIST-1]; + + if (rt_hdr == NULL || rt_list == NULL) + goto errout; + + if (RTA_PAYLOAD(rt_hdr) < sizeof(*tree_hdr) || + RTA_PAYLOAD(rt_list) < sizeof(*rt_match)) + goto errout; + + tree_hdr = RTA_DATA(rt_hdr); + memcpy(&tree->hdr, tree_hdr, sizeof(*tree_hdr)); + + rt_match = RTA_DATA(rt_list); + list_len = RTA_PAYLOAD(rt_list); + matches_len = tree_hdr->nmatches * sizeof(*em); + + tree->matches = kmalloc(matches_len, GFP_KERNEL); + if (tree->matches == NULL) + goto errout; + memset(tree->matches, 0, matches_len); + + /* We do not use rtattr_parse_nested here because the maximum + * number of attributes is unknown. This saves us the allocation + * for a tb buffer which would serve no purpose at all. + * + * The array of rt attributes is parsed in the order as they are + * provided, their type must be incremental from 1 to n. Even + * if it does not serve any real purpose, a failure of sticking + * to this policy will result in parsing failure. */ + for (idx = 0; RTA_OK(rt_match, list_len); idx++) { + err = -EINVAL; + + if (rt_match->rta_type != (idx + 1)) + goto errout_abort; + + if (idx >= tree_hdr->nmatches) + goto errout_abort; + + if (RTA_PAYLOAD(rt_match) < sizeof(struct tcf_ematch_hdr)) + goto errout_abort; + + em = tcf_em_get_match(tree, idx); + + err = tcf_em_validate(tp, tree_hdr, em, rt_match, idx); + if (err < 0) + goto errout_abort; + + rt_match = RTA_NEXT(rt_match, list_len); + } + + /* Check if the number of matches provided by userspace actually + * complies with the array of matches. The number was used for + * the validation of references and a mismatch could lead to + * undefined references during the matching process. */ + if (idx != tree_hdr->nmatches) { + err = -EINVAL; + goto errout_abort; + } + + err = 0; +errout: + return err; + +errout_abort: + tcf_em_tree_destroy(tp, tree); + return err; +} + +/** + * tcf_em_tree_destroy - destroy an ematch tree + * + * @tp: classifier kind handle + * @tree: ematch tree to be deleted + * + * This functions destroys an ematch tree previously created by + * tcf_em_tree_validate()/tcf_em_tree_change(). You must ensure that + * the ematch tree is not in use before calling this function. + */ +void tcf_em_tree_destroy(struct tcf_proto *tp, struct tcf_ematch_tree *tree) +{ + int i; + + if (tree->matches == NULL) + return; + + for (i = 0; i < tree->hdr.nmatches; i++) { + struct tcf_ematch *em = tcf_em_get_match(tree, i); + + if (em->ops) { + if (em->ops->destroy) + em->ops->destroy(tp, em); + else if (!tcf_em_is_simple(em) && em->data) + kfree((void *) em->data); + module_put(em->ops->owner); + } + } + + tree->hdr.nmatches = 0; + kfree(xchg(&tree->matches, NULL)); +} + +/** + * tcf_em_tree_dump - dump ematch tree into a rtnl message + * + * @skb: skb holding the rtnl message + * @t: ematch tree to be dumped + * @tlv: TLV type to be used to encapsulate the tree + * + * This function dumps a ematch tree into a rtnl message. It is valid to + * call this function while the ematch tree is in use. + * + * Returns -1 if the skb tailroom is insufficient. + */ +int tcf_em_tree_dump(struct sk_buff *skb, struct tcf_ematch_tree *tree, int tlv) +{ + int i; + struct rtattr * top_start = (struct rtattr*) skb->tail; + struct rtattr * list_start; + + RTA_PUT(skb, tlv, 0, NULL); + RTA_PUT(skb, TCA_EMATCH_TREE_HDR, sizeof(tree->hdr), &tree->hdr); + + list_start = (struct rtattr *) skb->tail; + RTA_PUT(skb, TCA_EMATCH_TREE_LIST, 0, NULL); + + for (i = 0; i < tree->hdr.nmatches; i++) { + struct rtattr *match_start = (struct rtattr*) skb->tail; + struct tcf_ematch *em = tcf_em_get_match(tree, i); + struct tcf_ematch_hdr em_hdr = { + .kind = em->ops ? em->ops->kind : TCF_EM_CONTAINER, + .matchid = em->matchid, + .flags = em->flags + }; + + RTA_PUT(skb, i+1, sizeof(em_hdr), &em_hdr); + + if (em->ops && em->ops->dump) { + if (em->ops->dump(skb, em) < 0) + goto rtattr_failure; + } else if (tcf_em_is_container(em) || tcf_em_is_simple(em)) { + u32 u = em->data; + RTA_PUT_NOHDR(skb, sizeof(u), &u); + } else if (em->datalen > 0) + RTA_PUT_NOHDR(skb, em->datalen, (void *) em->data); + + match_start->rta_len = skb->tail - (u8*) match_start; + } + + list_start->rta_len = skb->tail - (u8 *) list_start; + top_start->rta_len = skb->tail - (u8 *) top_start; + + return 0; + +rtattr_failure: + return -1; +} + +static inline int tcf_em_match(struct sk_buff *skb, struct tcf_ematch *em, + struct tcf_pkt_info *info) +{ + int r; + + if (likely(em->ops->match)) + r = em->ops->match(skb, em, info); + else + r = 0; + + return tcf_em_is_inverted(em) ? !r : r; +} + +/* Do not use this function directly, use tcf_em_tree_match instead */ +int __tcf_em_tree_match(struct sk_buff *skb, struct tcf_ematch_tree *tree, + struct tcf_pkt_info *info) +{ + int stackp = 0, match_idx = 0, res = 0; + struct tcf_ematch *cur_match; + int stack[CONFIG_NET_EMATCH_STACK]; + +proceed: + while (match_idx < tree->hdr.nmatches) { + cur_match = tcf_em_get_match(tree, match_idx); + + if (tcf_em_is_container(cur_match)) { + if (unlikely(stackp >= CONFIG_NET_EMATCH_STACK)) + goto stack_overflow; + + stack[stackp++] = match_idx; + match_idx = cur_match->data; + goto proceed; + } + + res = tcf_em_match(skb, cur_match, info); + + if (tcf_em_early_end(cur_match, res)) + break; + + match_idx++; + } + +pop_stack: + if (stackp > 0) { + match_idx = stack[--stackp]; + cur_match = tcf_em_get_match(tree, match_idx); + + if (tcf_em_early_end(cur_match, res)) + goto pop_stack; + else { + match_idx++; + goto proceed; + } + } + + return res; + +stack_overflow: + if (net_ratelimit()) + printk("Local stack overflow, increase NET_EMATCH_STACK\n"); + return -1; +} + +EXPORT_SYMBOL(tcf_em_register); +EXPORT_SYMBOL(tcf_em_unregister); +EXPORT_SYMBOL(tcf_em_tree_validate); +EXPORT_SYMBOL(tcf_em_tree_destroy); +EXPORT_SYMBOL(tcf_em_tree_dump); +EXPORT_SYMBOL(__tcf_em_tree_match); From tgraf@suug.ch Sun Jan 23 15:02:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 15:03:00 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0NN2ruN022365 for ; Sun, 23 Jan 2005 15:02:53 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id E4D6685; Mon, 24 Jan 2005 00:02:30 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 4EAF51C0EA; Mon, 24 Jan 2005 00:03:14 +0100 (CET) Date: Mon, 24 Jan 2005 00:03:14 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH 3/6] PKT_SCHED: Multi byte comparison ematch (nbyte) Message-ID: <20050123230314.GE23931@postel.suug.ch> References: <20050123230012.GB23931@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050123230012.GB23931@postel.suug.ch> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 677 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 4713 Lines: 148 The nbyte ematch allows comparing any number of bytes at an arbitary offset based on one of the skb layers. Its main usage is intended for IPv6 addresses but may be used for any kind of pattern. Signed-off-by: Thomas Graf diff -Nru linux-2.6.11-rc2-bk1.orig/include/linux/pkt_cls.h linux-2.6.11-rc2-bk1/include/linux/pkt_cls.h --- linux-2.6.11-rc2-bk1.orig/include/linux/pkt_cls.h 2005-01-23 17:33:14.000000000 +0100 +++ linux-2.6.11-rc2-bk1/include/linux/pkt_cls.h 2005-01-23 17:33:26.000000000 +0100 @@ -384,6 +384,7 @@ { TCF_EM_CONTAINER, TCF_EM_CMP, + TCF_EM_NBYTE, __TCF_EM_MAX }; diff -Nru linux-2.6.11-rc2-bk1.orig/include/linux/tc_ematch/tc_em_nbyte.h linux-2.6.11-rc2-bk1/include/linux/tc_ematch/tc_em_nbyte.h --- linux-2.6.11-rc2-bk1.orig/include/linux/tc_ematch/tc_em_nbyte.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.11-rc2-bk1/include/linux/tc_ematch/tc_em_nbyte.h 2005-01-23 17:33:26.000000000 +0100 @@ -0,0 +1,13 @@ +#ifndef __LINUX_TC_EM_NBYTE_H +#define __LINUX_TC_EM_NBYTE_H + +#include + +struct tcf_em_nbyte +{ + __u16 off; + __u16 len:12; + __u8 layer:4; +}; + +#endif diff -Nru linux-2.6.11-rc2-bk1.orig/net/sched/Kconfig linux-2.6.11-rc2-bk1/net/sched/Kconfig --- linux-2.6.11-rc2-bk1.orig/net/sched/Kconfig 2005-01-23 17:33:14.000000000 +0100 +++ linux-2.6.11-rc2-bk1/net/sched/Kconfig 2005-01-23 17:33:26.000000000 +0100 @@ -408,6 +408,16 @@ To compile this code as a module, choose M here: the module will be called em_cmp. +config NET_EMATCH_NBYTE + tristate "Multi byte comparison" + depends on NET_EMATCH + ---help--- + Say Y here if you want to be able to classify packets based on + multiple byte comparisons mainly useful for IPv6 address comparisons. + + To compile this code as a module, choose M here: the + module will be called em_nbyte. + config NET_CLS_ACT bool "Packet ACTION" depends on EXPERIMENTAL && NET_CLS && NET_QOS diff -Nru linux-2.6.11-rc2-bk1.orig/net/sched/Makefile linux-2.6.11-rc2-bk1/net/sched/Makefile --- linux-2.6.11-rc2-bk1.orig/net/sched/Makefile 2005-01-23 17:33:14.000000000 +0100 +++ linux-2.6.11-rc2-bk1/net/sched/Makefile 2005-01-23 17:33:26.000000000 +0100 @@ -35,3 +35,4 @@ obj-$(CONFIG_NET_CLS_RSVP6) += cls_rsvp6.o obj-$(CONFIG_NET_EMATCH) += ematch.o obj-$(CONFIG_NET_EMATCH_CMP) += em_cmp.o +obj-$(CONFIG_NET_EMATCH_NBYTE) += em_nbyte.o diff -Nru linux-2.6.11-rc2-bk1.orig/net/sched/em_nbyte.c linux-2.6.11-rc2-bk1/net/sched/em_nbyte.c --- linux-2.6.11-rc2-bk1.orig/net/sched/em_nbyte.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.11-rc2-bk1/net/sched/em_nbyte.c 2005-01-23 17:36:08.000000000 +0100 @@ -0,0 +1,82 @@ +/* + * net/sched/em_nbyte.c N-Byte ematch + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: Thomas Graf + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct nbyte_data +{ + struct tcf_em_nbyte hdr; + char pattern[0]; +}; + +static int em_nbyte_change(struct tcf_proto *tp, void *data, int data_len, + struct tcf_ematch *em) +{ + struct tcf_em_nbyte *nbyte = data; + + if (data_len < sizeof(*nbyte) || + data_len < (sizeof(*nbyte) + nbyte->len)) + return -EINVAL; + + em->datalen = sizeof(*nbyte) + nbyte->len; + em->data = (unsigned long) kmalloc(em->datalen, GFP_KERNEL); + if (em->data == 0UL) + return -ENOBUFS; + + memcpy((void *) em->data, data, em->datalen); + + return 0; +} + +static int em_nbyte_match(struct sk_buff *skb, struct tcf_ematch *em, + struct tcf_pkt_info *info) +{ + struct nbyte_data *nbyte = (struct nbyte_data *) em->data; + unsigned char *ptr = tcf_get_base_ptr(skb, nbyte->hdr.layer); + + ptr += nbyte->hdr.off; + + if (!tcf_valid_offset(skb, ptr, nbyte->hdr.len)) + return 0; + + return !memcmp(ptr + nbyte->hdr.off, nbyte->pattern, nbyte->hdr.len); +} + +static struct tcf_ematch_ops em_nbyte_ops = { + .kind = TCF_EM_NBYTE, + .change = em_nbyte_change, + .match = em_nbyte_match, + .owner = THIS_MODULE, + .link = LIST_HEAD_INIT(em_nbyte_ops.link) +}; + +static int __init init_em_nbyte(void) +{ + return tcf_em_register(&em_nbyte_ops); +} + +static void __exit exit_em_nbyte(void) +{ + tcf_em_unregister(&em_nbyte_ops); +} + +MODULE_LICENSE("GPL"); + +module_init(init_em_nbyte); +module_exit(exit_em_nbyte); From tgraf@suug.ch Sun Jan 23 15:03:34 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 15:03:41 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0NN3Yh0023169 for ; Sun, 23 Jan 2005 15:03:34 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 942C685; Mon, 24 Jan 2005 00:03:11 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 0647D1C0EA; Mon, 24 Jan 2005 00:03:55 +0100 (CET) Date: Mon, 24 Jan 2005 00:03:54 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH 4/6] PKT_SCHED: u32 ematch Message-ID: <20050123230354.GF23931@postel.suug.ch> References: <20050123230012.GB23931@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050123230012.GB23931@postel.suug.ch> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 678 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 3954 Lines: 119 The u32 ematch behaves exactly the same as a u32 match and will replace it in the long term. It allows the underlying classifiers to give hints about the position of the next protocol header (i.e. nexthdr+). Signed-off-by: Thomas Graf diff -Nru linux-2.6.11-rc1-bk9.orig/include/linux/pkt_cls.h linux-2.6.11-rc1-bk9/include/linux/pkt_cls.h --- linux-2.6.11-rc1-bk9.orig/include/linux/pkt_cls.h 2005-01-22 03:39:23.000000000 +0100 +++ linux-2.6.11-rc1-bk9/include/linux/pkt_cls.h 2005-01-22 12:19:56.000000000 +0100 @@ -385,6 +385,7 @@ TCF_EM_CONTAINER, TCF_EM_CMP, TCF_EM_NBYTE, + TCF_EM_U32, __TCF_EM_MAX }; diff -Nru linux-2.6.11-rc1-bk9.orig/include/net/pkt_cls.h linux-2.6.11-rc1-bk9/include/net/pkt_cls.h --- linux-2.6.11-rc1-bk9.orig/include/net/pkt_cls.h 2005-01-22 02:56:33.000000000 +0100 +++ linux-2.6.11-rc1-bk9/include/net/pkt_cls.h 2005-01-22 12:21:33.000000000 +0100 @@ -153,6 +153,8 @@ */ struct tcf_pkt_info { + unsigned char * ptr; + int nexthdr; }; #ifdef CONFIG_NET_EMATCH diff -Nru linux-2.6.11-rc1-bk9.orig/net/sched/Kconfig linux-2.6.11-rc1-bk9/net/sched/Kconfig --- linux-2.6.11-rc1-bk9.orig/net/sched/Kconfig 2005-01-22 03:39:23.000000000 +0100 +++ linux-2.6.11-rc1-bk9/net/sched/Kconfig 2005-01-22 12:19:56.000000000 +0100 @@ -418,6 +418,16 @@ To compile this code as a module, choose M here: the module will be called em_nbyte. +config NET_EMATCH_U32 + tristate "U32 hashing key" + depends on NET_EMATCH + ---help--- + Say Y here if you want to be able to classify packets using + the famous u32 key in combination with logic relations. + + To compile this code as a module, choose M here: the + module will be called em_u32. + config NET_CLS_ACT bool "Packet ACTION" depends on EXPERIMENTAL && NET_CLS && NET_QOS diff -Nru linux-2.6.11-rc1-bk9.orig/net/sched/Makefile linux-2.6.11-rc1-bk9/net/sched/Makefile --- linux-2.6.11-rc1-bk9.orig/net/sched/Makefile 2005-01-22 03:39:23.000000000 +0100 +++ linux-2.6.11-rc1-bk9/net/sched/Makefile 2005-01-22 12:19:56.000000000 +0100 @@ -36,3 +36,4 @@ obj-$(CONFIG_NET_EMATCH) += ematch.o obj-$(CONFIG_NET_EMATCH_CMP) += em_cmp.o obj-$(CONFIG_NET_EMATCH_NBYTE) += em_nbyte.o +obj-$(CONFIG_NET_EMATCH_U32) += em_u32.o diff -Nru linux-2.6.11-rc1-bk9.orig/net/sched/em_u32.c linux-2.6.11-rc1-bk9/net/sched/em_u32.c --- linux-2.6.11-rc1-bk9.orig/net/sched/em_u32.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.11-rc1-bk9/net/sched/em_u32.c 2005-01-22 12:37:28.000000000 +0100 @@ -0,0 +1,58 @@ +/* + * net/sched/em_u32.c U32 Ematch + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: Thomas Graf + * Alexey Kuznetsov, + * + * Based on net/sched/cls_u32.c + */ + +#include +#include +#include +#include +#include +#include + +static int em_u32_match(struct sk_buff *skb, struct tcf_ematch *em, + struct tcf_pkt_info *info) +{ + struct tc_u32_key *key = (struct tc_u32_key *) em->data; + unsigned char *ptr = skb->nh.raw; + + if (info) { + if (info->ptr) + ptr = info->ptr; + ptr += (info->nexthdr & key->offmask); + } + + return !((*(u32*) (ptr + key->off) ^ key->val) & key->mask); +} + +static struct tcf_ematch_ops em_u32_ops = { + .kind = TCF_EM_U32, + .datalen = sizeof(struct tc_u32_key), + .match = em_u32_match, + .owner = THIS_MODULE, + .link = LIST_HEAD_INIT(em_u32_ops.link) +}; + +static int __init init_em_u32(void) +{ + return tcf_em_register(&em_u32_ops); +} + +static void __exit exit_em_u32(void) +{ + tcf_em_unregister(&em_u32_ops); +} + +MODULE_LICENSE("GPL"); + +module_init(init_em_u32); +module_exit(exit_em_u32); From tgraf@suug.ch Sun Jan 23 15:04:23 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 15:04:29 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0NN4MaH023780 for ; Sun, 23 Jan 2005 15:04:22 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id C601485; Mon, 24 Jan 2005 00:03:59 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 2DF4C1C0EA; Mon, 24 Jan 2005 00:04:43 +0100 (CET) Date: Mon, 24 Jan 2005 00:04:43 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH 5/6]: PKT_SCHED: Metadata ematch (meta) Message-ID: <20050123230443.GG23931@postel.suug.ch> References: <20050123230012.GB23931@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050123230012.GB23931@postel.suug.ch> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 679 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 20587 Lines: 737 The meta ematch allows comparing various metadata values against static values from usersapce or other metadata values. It currently supports various numeric meta values such as netfilter mark, packet length, security level, interface indices, tc classid, load average, a random value but also variable length values such as interface names. Adding support for additional meta values is as easy as writing a data collector (usually 1-5 lines of code) and assign it to a id and type by putting it into the meta operations table. Signed-off-by: Thomas Graf diff -Nru linux-2.6.11-rc2-bk1.orig/include/linux/pkt_cls.h linux-2.6.11-rc2-bk1/include/linux/pkt_cls.h --- linux-2.6.11-rc2-bk1.orig/include/linux/pkt_cls.h 2005-01-23 17:38:12.000000000 +0100 +++ linux-2.6.11-rc2-bk1/include/linux/pkt_cls.h 2005-01-23 17:38:21.000000000 +0100 @@ -386,6 +386,7 @@ TCF_EM_CMP, TCF_EM_NBYTE, TCF_EM_U32, + TCF_EM_META, __TCF_EM_MAX }; diff -Nru linux-2.6.11-rc2-bk1.orig/include/linux/tc_ematch/tc_em_meta.h linux-2.6.11-rc2-bk1/include/linux/tc_ematch/tc_em_meta.h --- linux-2.6.11-rc2-bk1.orig/include/linux/tc_ematch/tc_em_meta.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.11-rc2-bk1/include/linux/tc_ematch/tc_em_meta.h 2005-01-23 17:38:21.000000000 +0100 @@ -0,0 +1,69 @@ +#ifndef __LINUX_TC_EM_META_H +#define __LINUX_TC_EM_META_H + +#include + +enum +{ + TCA_EM_META_UNSPEC, + TCA_EM_META_HDR, + TCA_EM_META_LVALUE, + TCA_EM_META_RVALUE, + __TCA_EM_META_MAX +}; +#define TCA_EM_META_MAX (__TCA_EM_META_MAX - 1) + +struct tcf_meta_val +{ + __u16 kind; + __u8 shift; + __u8 op; +}; + +#define TCF_META_TYPE_MASK (0xf << 12) +#define TCF_META_TYPE(kind) (((kind) & TCF_META_TYPE_MASK) >> 12) +#define TCF_META_ID_MASK 0x7ff +#define TCF_META_ID(kind) ((kind) & TCF_META_ID_MASK) + +enum +{ + TCF_META_TYPE_VAR, + TCF_META_TYPE_INT, + __TCF_META_TYPE_MAX +}; +#define TCF_META_TYPE_MAX (__TCF_META_TYPE_MAX - 1) + +enum +{ + TCF_META_ID_VALUE, + TCF_META_ID_RANDOM, + TCF_META_ID_LOADAVG_0, + TCF_META_ID_LOADAVG_1, + TCF_META_ID_LOADAVG_2, + TCF_META_ID_DEV, + TCF_META_ID_INDEV, + TCF_META_ID_REALDEV, + TCF_META_ID_PRIORITY, + TCF_META_ID_PROTOCOL, + TCF_META_ID_SECURITY, + TCF_META_ID_PKTTYPE, + TCF_META_ID_PKTLEN, + TCF_META_ID_DATALEN, + TCF_META_ID_MACLEN, + TCF_META_ID_NFMARK, + TCF_META_ID_TCINDEX, + TCF_META_ID_TCVERDICT, + TCF_META_ID_TCCLASSID, + TCF_META_ID_RTCLASSID, + TCF_META_ID_RTIIF, + __TCF_META_ID_MAX +}; +#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1) + +struct tcf_meta_hdr +{ + struct tcf_meta_val left; + struct tcf_meta_val right; +}; + +#endif diff -Nru linux-2.6.11-rc2-bk1.orig/net/sched/Kconfig linux-2.6.11-rc2-bk1/net/sched/Kconfig --- linux-2.6.11-rc2-bk1.orig/net/sched/Kconfig 2005-01-23 17:38:12.000000000 +0100 +++ linux-2.6.11-rc2-bk1/net/sched/Kconfig 2005-01-23 17:38:21.000000000 +0100 @@ -428,6 +428,17 @@ To compile this code as a module, choose M here: the module will be called em_u32. +config NET_EMATCH_META + tristate "Metadata" + depends on NET_EMATCH + ---help--- + Say Y here if you want to be ablt to classify packets based on + metadata such as load average, netfilter attributes, socket + attributes and routing decisions. + + To compile this code as a module, choose M here: the + module will be called em_meta. + config NET_CLS_ACT bool "Packet ACTION" depends on EXPERIMENTAL && NET_CLS && NET_QOS diff -Nru linux-2.6.11-rc2-bk1.orig/net/sched/Makefile linux-2.6.11-rc2-bk1/net/sched/Makefile --- linux-2.6.11-rc2-bk1.orig/net/sched/Makefile 2005-01-23 17:38:12.000000000 +0100 +++ linux-2.6.11-rc2-bk1/net/sched/Makefile 2005-01-23 17:38:21.000000000 +0100 @@ -37,3 +37,4 @@ obj-$(CONFIG_NET_EMATCH_CMP) += em_cmp.o obj-$(CONFIG_NET_EMATCH_NBYTE) += em_nbyte.o obj-$(CONFIG_NET_EMATCH_U32) += em_u32.o +obj-$(CONFIG_NET_EMATCH_META) += em_meta.o diff -Nru linux-2.6.11-rc2-bk1.orig/net/sched/em_meta.c linux-2.6.11-rc2-bk1/net/sched/em_meta.c --- linux-2.6.11-rc2-bk1.orig/net/sched/em_meta.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.11-rc2-bk1/net/sched/em_meta.c 2005-01-23 17:56:01.000000000 +0100 @@ -0,0 +1,609 @@ +/* + * net/sched/em_meta.c Metadata ematch + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: Thomas Graf + * + * ========================================================================== + * + * The metadata ematch compares two meta objects where each object + * represents either a meta value stored in the kernel or a static + * value provided by userspace. The objects are not provided by + * userspace itself but rather a definition providing the information + * to build them. Every object is of a certain type which must be + * equal to the object it is being compared to. + * + * The definition of a objects conists of the type (meta type), a + * identifier (meta id) and additional type specific information. + * The meta id is either TCF_META_TYPE_VALUE for values provided by + * userspace or a index to the meta operations table consisting of + * function pointers to type specific meta data collectors returning + * the value of the requested meta value. + * + * lvalue rvalue + * +-----------+ +-----------+ + * | type: INT | | type: INT | + * def | id: INDEV | | id: VALUE | + * | data: | | data: 3 | + * +-----------+ +-----------+ + * | | + * ---> meta_ops[INT][INDEV](...) | + * | | + * ----------- | + * V V + * +-----------+ +-----------+ + * | type: INT | | type: INT | + * obj | id: INDEV | | id: VALUE | + * | data: 2 |<--data got filled out | data: 3 | + * +-----------+ +-----------+ + * | | + * --------------> 2 equals 3 <-------------- + * + * This is a simplified schema, the complexity varies depending + * on the meta type. Obviously, the length of the data must also + * be provided for non-numeric types. + * + * Additionaly, type dependant modifiers such as shift operators + * or mask may be applied to extend the functionaliy. As of now, + * the variable length type supports shifting the byte string to + * the right, eating up any number of octets and thus supporting + * wildcard interface name comparisons such as "ppp%" matching + * ppp0..9. + * + * NOTE: Certain meta values depend on other subsystems and are + * only available if that subsytem is enabled in the kernel. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct meta_obj +{ + unsigned long value; + unsigned int len; +}; + +struct meta_value +{ + struct tcf_meta_val hdr; + unsigned long val; + unsigned int len; +}; + +struct meta_match +{ + struct meta_value lvalue; + struct meta_value rvalue; +}; + +static inline int meta_id(struct meta_value *v) +{ + return TCF_META_ID(v->hdr.kind); +} + +static inline int meta_type(struct meta_value *v) +{ + return TCF_META_TYPE(v->hdr.kind); +} + +#define META_COLLECTOR(FUNC) static void meta_##FUNC(struct sk_buff *skb, \ + struct tcf_pkt_info *info, struct meta_value *v, \ + struct meta_obj *dst, int *err) + +/************************************************************************** + * System status & misc + **************************************************************************/ + +META_COLLECTOR(int_random) +{ + get_random_bytes(&dst->value, sizeof(dst->value)); +} + +static inline unsigned long fixed_loadavg(int load) +{ + int rnd_load = load + (FIXED_1/200); + int rnd_frac = ((rnd_load & (FIXED_1-1)) * 100) >> FSHIFT; + + return ((rnd_load >> FSHIFT) * 100) + rnd_frac; +} + +META_COLLECTOR(int_loadavg_0) +{ + dst->value = fixed_loadavg(avenrun[0]); +} + +META_COLLECTOR(int_loadavg_1) +{ + dst->value = fixed_loadavg(avenrun[1]); +} + +META_COLLECTOR(int_loadavg_2) +{ + dst->value = fixed_loadavg(avenrun[2]); +} + +/************************************************************************** + * Device names & indices + **************************************************************************/ + +static inline int int_dev(struct net_device *dev, struct meta_obj *dst) +{ + if (unlikely(dev == NULL)) + return -1; + + dst->value = dev->ifindex; + return 0; +} + +static inline int var_dev(struct net_device *dev, struct meta_obj *dst) +{ + if (unlikely(dev == NULL)) + return -1; + + dst->value = (unsigned long) dev->name; + dst->len = strlen(dev->name); + return 0; +} + +META_COLLECTOR(int_dev) +{ + *err = int_dev(skb->dev, dst); +} + +META_COLLECTOR(var_dev) +{ + *err = var_dev(skb->dev, dst); +} + +META_COLLECTOR(int_indev) +{ + *err = int_dev(skb->input_dev, dst); +} + +META_COLLECTOR(var_indev) +{ + *err = var_dev(skb->input_dev, dst); +} + +META_COLLECTOR(int_realdev) +{ + *err = int_dev(skb->real_dev, dst); +} + +META_COLLECTOR(var_realdev) +{ + *err = var_dev(skb->real_dev, dst); +} + +/************************************************************************** + * skb attributes + **************************************************************************/ + +META_COLLECTOR(int_priority) +{ + dst->value = skb->priority; +} + +META_COLLECTOR(int_protocol) +{ + /* Let userspace take care of the byte ordering */ + dst->value = skb->protocol; +} + +META_COLLECTOR(int_security) +{ + dst->value = skb->security; +} + +META_COLLECTOR(int_pkttype) +{ + dst->value = skb->pkt_type; +} + +META_COLLECTOR(int_pktlen) +{ + dst->value = skb->len; +} + +META_COLLECTOR(int_datalen) +{ + dst->value = skb->data_len; +} + +META_COLLECTOR(int_maclen) +{ + dst->value = skb->mac_len; +} + +/************************************************************************** + * Netfilter + **************************************************************************/ + +#ifdef CONFIG_NETFILTER +META_COLLECTOR(int_nfmark) +{ + dst->value = skb->nfmark; +} +#endif + +/************************************************************************** + * Traffic Control + **************************************************************************/ + +META_COLLECTOR(int_tcindex) +{ + dst->value = skb->tc_index; +} + +#ifdef CONFIG_NET_CLS_ACT +META_COLLECTOR(int_tcverd) +{ + dst->value = skb->tc_verd; +} + +META_COLLECTOR(int_tcclassid) +{ + dst->value = skb->tc_classid; +} +#endif + +/************************************************************************** + * Routing + **************************************************************************/ + +#ifdef CONFIG_NET_CLS_ROUTE +META_COLLECTOR(int_rtclassid) +{ + if (unlikely(skb->dst == NULL)) + *err = -1; + else + dst->value = skb->dst->tclassid; +} +#endif + +META_COLLECTOR(int_rtiif) +{ + if (unlikely(skb->dst == NULL)) + *err = -1; + else + dst->value = ((struct rtable*) skb->dst)->fl.iif; +} + +/************************************************************************** + * Meta value collectors assignment table + **************************************************************************/ + +struct meta_ops +{ + void (*get)(struct sk_buff *, struct tcf_pkt_info *, + struct meta_value *, struct meta_obj *, int *); +}; + +/* Meta value operations table listing all meta value collectors and + * assigns them to a type and meta id. */ +static struct meta_ops __meta_ops[TCF_META_TYPE_MAX+1][TCF_META_ID_MAX+1] = { + [TCF_META_TYPE_VAR] = { + [TCF_META_ID_DEV] = { .get = meta_var_dev }, + [TCF_META_ID_INDEV] = { .get = meta_var_indev }, + [TCF_META_ID_REALDEV] = { .get = meta_var_realdev } + }, + [TCF_META_TYPE_INT] = { + [TCF_META_ID_RANDOM] = { .get = meta_int_random }, + [TCF_META_ID_LOADAVG_0] = { .get = meta_int_loadavg_0 }, + [TCF_META_ID_LOADAVG_1] = { .get = meta_int_loadavg_1 }, + [TCF_META_ID_LOADAVG_2] = { .get = meta_int_loadavg_2 }, + [TCF_META_ID_DEV] = { .get = meta_int_dev }, + [TCF_META_ID_INDEV] = { .get = meta_int_indev }, + [TCF_META_ID_REALDEV] = { .get = meta_int_realdev }, + [TCF_META_ID_PRIORITY] = { .get = meta_int_priority }, + [TCF_META_ID_PROTOCOL] = { .get = meta_int_protocol }, + [TCF_META_ID_SECURITY] = { .get = meta_int_security }, + [TCF_META_ID_PKTTYPE] = { .get = meta_int_pkttype }, + [TCF_META_ID_PKTLEN] = { .get = meta_int_pktlen }, + [TCF_META_ID_DATALEN] = { .get = meta_int_datalen }, + [TCF_META_ID_MACLEN] = { .get = meta_int_maclen }, +#ifdef CONFIG_NETFILTER + [TCF_META_ID_NFMARK] = { .get = meta_int_nfmark }, +#endif + [TCF_META_ID_TCINDEX] = { .get = meta_int_tcindex }, +#ifdef CONFIG_NET_CLS_ACT + [TCF_META_ID_TCVERDICT] = { .get = meta_int_tcverd }, + [TCF_META_ID_TCCLASSID] = { .get = meta_int_tcclassid }, +#endif +#ifdef CONFIG_NET_CLS_ROUTE + [TCF_META_ID_RTCLASSID] = { .get = meta_int_rtclassid }, +#endif + [TCF_META_ID_RTIIF] = { .get = meta_int_rtiif } + } +}; + +static inline struct meta_ops * meta_ops(struct meta_value *val) +{ + return &__meta_ops[meta_type(val)][meta_id(val)]; +} + +/************************************************************************** + * Type specific operations for TCF_META_TYPE_VAR + **************************************************************************/ + +static int meta_var_compare(struct meta_obj *a, struct meta_obj *b) +{ + int r = a->len - b->len; + + if (r == 0) + r = memcmp((void *) a->value, (void *) b->value, a->len); + + return r; +} + +static int meta_var_change(struct meta_value *dst, struct rtattr *rta) +{ + int len = RTA_PAYLOAD(rta); + + dst->val = (unsigned long) kmalloc(len, GFP_KERNEL); + if (dst->val == 0UL) + return -ENOMEM; + memcpy((void *) dst->val, RTA_DATA(rta), len); + dst->len = len; + return 0; +} + +static void meta_var_destroy(struct meta_value *v) +{ + if (v->val) + kfree((void *) v->val); +} + +static void meta_var_apply_extras(struct meta_value *v, + struct meta_obj *dst) +{ + int shift = v->hdr.shift; + + if (shift && shift < dst->len) + dst->len -= shift; +} + +/************************************************************************** + * Type specific operations for TCF_META_TYPE_INT + **************************************************************************/ + +static int meta_int_compare(struct meta_obj *a, struct meta_obj *b) +{ + /* Let gcc optimize it, the unlikely is not really based on + * some numbers but jump free code for mismatches seems + * more logical. */ + if (unlikely(a == b)) + return 0; + else if (a < b) + return -1; + else + return 1; +} + +static int meta_int_change(struct meta_value *dst, struct rtattr *rta) +{ + if (RTA_PAYLOAD(rta) >= sizeof(unsigned long)) { + dst->val = *(unsigned long *) RTA_DATA(rta); + dst->len = sizeof(unsigned long); + } else if (RTA_PAYLOAD(rta) == sizeof(u32)) { + dst->val = *(u32 *) RTA_DATA(rta); + dst->len = sizeof(u32); + } else + return -EINVAL; + + return 0; +} + +static void meta_int_apply_extras(struct meta_value *v, + struct meta_obj *dst) +{ + if (v->hdr.shift) + dst->value >>= v->hdr.shift; + + if (v->val) + dst->value &= v->val; +} + +/************************************************************************** + * Type specific operations table + **************************************************************************/ + +struct meta_type_ops +{ + void (*destroy)(struct meta_value *); + int (*compare)(struct meta_obj *, struct meta_obj *); + int (*change)(struct meta_value *, struct rtattr *); + void (*apply_extras)(struct meta_value *, struct meta_obj *); +}; + +static struct meta_type_ops __meta_type_ops[TCF_META_TYPE_MAX+1] = { + [TCF_META_TYPE_VAR] = { + .destroy = meta_var_destroy, + .compare = meta_var_compare, + .change = meta_var_change, + .apply_extras = meta_var_apply_extras + }, + [TCF_META_TYPE_INT] = { + .compare = meta_int_compare, + .change = meta_int_change, + .apply_extras = meta_int_apply_extras + } +}; + +static inline struct meta_type_ops * meta_type_ops(struct meta_value *v) +{ + return &__meta_type_ops[meta_type(v)]; +} + +/************************************************************************** + * Core + **************************************************************************/ + +static inline int meta_get(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + int err = 0; + + if (meta_id(v) == TCF_META_ID_VALUE) { + dst->value = v->val; + dst->len = v->len; + return 0; + } + + meta_ops(v)->get(skb, info, v, dst, &err); + if (err < 0) + return err; + + if (meta_type_ops(v)->apply_extras) + meta_type_ops(v)->apply_extras(v, dst); + + return 0; +} + +static int em_meta_match(struct sk_buff *skb, struct tcf_ematch *m, + struct tcf_pkt_info *info) +{ + int r; + struct meta_match *meta = (struct meta_match *) m->data; + struct meta_obj l_value, r_value; + + if (meta_get(skb, info, &meta->lvalue, &l_value) < 0 || + meta_get(skb, info, &meta->rvalue, &r_value) < 0) + return 0; + + r = meta_type_ops(&meta->lvalue)->compare(&l_value, &r_value); + + switch (meta->lvalue.hdr.op) { + case TCF_EM_OPND_EQ: + return !r; + case TCF_EM_OPND_LT: + return r < 0; + case TCF_EM_OPND_GT: + return r > 0; + } + + return 0; +} + +static inline void meta_delete(struct meta_match *meta) +{ + struct meta_type_ops *ops = meta_type_ops(&meta->lvalue); + + if (ops && ops->destroy) { + ops->destroy(&meta->lvalue); + ops->destroy(&meta->rvalue); + } + + kfree(meta); +} + +static inline int meta_change_data(struct meta_value *dst, struct rtattr *rta) +{ + if (rta) { + if (RTA_PAYLOAD(rta) == 0) + return -EINVAL; + + return meta_type_ops(dst)->change(dst, rta); + } + + return 0; +} + +static inline int meta_is_supported(struct meta_value *val) +{ + return (!meta_id(val) || meta_ops(val)->get); +} + +static int em_meta_change(struct tcf_proto *tp, void *data, int len, + struct tcf_ematch *m) +{ + int err = -EINVAL; + struct rtattr *tb[TCA_EM_META_MAX]; + struct tcf_meta_hdr *hdr; + struct meta_match *meta = NULL; + + if (rtattr_parse(tb, TCA_EM_META_MAX, data, len) < 0) + goto errout; + + if (tb[TCA_EM_META_HDR-1] == NULL || + RTA_PAYLOAD(tb[TCA_EM_META_HDR-1]) < sizeof(*hdr)) + goto errout; + hdr = RTA_DATA(tb[TCA_EM_META_HDR-1]); + + if (TCF_META_TYPE(hdr->left.kind) != TCF_META_TYPE(hdr->right.kind) || + TCF_META_TYPE(hdr->left.kind) > TCF_META_TYPE_MAX || + TCF_META_ID(hdr->left.kind) > TCF_META_ID_MAX || + TCF_META_ID(hdr->right.kind) > TCF_META_ID_MAX) + goto errout; + + meta = kmalloc(sizeof(*meta), GFP_KERNEL); + if (meta == NULL) + goto errout; + memset(meta, 0, sizeof(*meta)); + + memcpy(&meta->lvalue.hdr, &hdr->left, sizeof(hdr->left)); + memcpy(&meta->rvalue.hdr, &hdr->right, sizeof(hdr->right)); + + if (!meta_is_supported(&meta->lvalue) || + !meta_is_supported(&meta->rvalue)) { + err = -EOPNOTSUPP; + goto errout; + } + + if (meta_change_data(&meta->lvalue, tb[TCA_EM_META_LVALUE-1]) < 0 || + meta_change_data(&meta->rvalue, tb[TCA_EM_META_RVALUE-1]) < 0) + goto errout; + + m->datalen = sizeof(*meta); + m->data = (unsigned long) meta; + + err = 0; +errout: + if (err && meta) + meta_delete(meta); + return err; +} + +static void em_meta_destroy(struct tcf_proto *tp, struct tcf_ematch *m) +{ + if (m) + meta_delete((struct meta_match *) m->data); +} + +static struct tcf_ematch_ops em_meta_ops = { + .kind = TCF_EM_META, + .change = em_meta_change, + .match = em_meta_match, + .destroy = em_meta_destroy, + .owner = THIS_MODULE, + .link = LIST_HEAD_INIT(em_meta_ops.link) +}; + +static int __init init_em_meta(void) +{ + return tcf_em_register(&em_meta_ops); +} + +static void __exit exit_em_meta(void) +{ + tcf_em_unregister(&em_meta_ops); +} + +MODULE_LICENSE("GPL"); + +module_init(init_em_meta); +module_exit(exit_em_meta); From tgraf@suug.ch Sun Jan 23 15:05:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 15:05:13 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0NN577Z024140 for ; Sun, 23 Jan 2005 15:05:07 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 8B39485; Mon, 24 Jan 2005 00:04:44 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id EC69D1C0EA; Mon, 24 Jan 2005 00:05:27 +0100 (CET) Date: Mon, 24 Jan 2005 00:05:27 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH 6/6] PKT_SCHED: Basic classifier Message-ID: <20050123230527.GH23931@postel.suug.ch> References: <20050123230012.GB23931@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050123230012.GB23931@postel.suug.ch> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 680 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 9337 Lines: 369 The basic classifier is the most simple classifier one can think of, it doesn't do anything on its own but to support extended matches and actions. A basic classifier returns true if no ematches or actions are configured and thus can also be used as a catch-all classifier. Signed-off-by: Thomas Graf diff -Nru linux-2.6.11-rc1-bk9.orig/include/linux/pkt_cls.h linux-2.6.11-rc1-bk9/include/linux/pkt_cls.h --- linux-2.6.11-rc1-bk9.orig/include/linux/pkt_cls.h 2005-01-22 15:29:08.000000000 +0100 +++ linux-2.6.11-rc1-bk9/include/linux/pkt_cls.h 2005-01-22 15:55:17.000000000 +0100 @@ -319,6 +319,20 @@ #define TCA_TCINDEX_MAX (__TCA_TCINDEX_MAX - 1) +/* Basic filter */ + +enum +{ + TCA_BASIC_UNSPEC, + TCA_BASIC_CLASSID, + TCA_BASIC_EMATCHES, + TCA_BASIC_ACT, + TCA_BASIC_POLICE, + __TCA_BASIC_MAX +}; + +#define TCA_BASIC_MAX (__TCA_BASIC_MAX - 1) + /* Extended Matches */ struct tcf_ematch_tree_hdr diff -Nru linux-2.6.11-rc1-bk9.orig/net/sched/Kconfig linux-2.6.11-rc1-bk9/net/sched/Kconfig --- linux-2.6.11-rc1-bk9.orig/net/sched/Kconfig 2005-01-22 15:29:08.000000000 +0100 +++ linux-2.6.11-rc1-bk9/net/sched/Kconfig 2005-01-22 15:54:59.000000000 +0100 @@ -269,6 +269,16 @@ Documentation and software is at . +config NET_CLS_BASIC + tristate "Basic classifier" + depends on NET_CLS + ---help--- + Say Y here if you want to be able to classify packets using + only extended matches and actions. + + To compile this code as a module, choose M here: the + module will be called cls_basic. + config NET_CLS_TCINDEX tristate "TC index classifier" depends on NET_CLS diff -Nru linux-2.6.11-rc1-bk9.orig/net/sched/Makefile linux-2.6.11-rc1-bk9/net/sched/Makefile --- linux-2.6.11-rc1-bk9.orig/net/sched/Makefile 2005-01-22 15:29:08.000000000 +0100 +++ linux-2.6.11-rc1-bk9/net/sched/Makefile 2005-01-22 15:54:59.000000000 +0100 @@ -33,6 +33,7 @@ obj-$(CONFIG_NET_CLS_RSVP) += cls_rsvp.o obj-$(CONFIG_NET_CLS_TCINDEX) += cls_tcindex.o obj-$(CONFIG_NET_CLS_RSVP6) += cls_rsvp6.o +obj-$(CONFIG_NET_CLS_BASIC) += cls_basic.o obj-$(CONFIG_NET_EMATCH) += ematch.o obj-$(CONFIG_NET_EMATCH_CMP) += em_cmp.o obj-$(CONFIG_NET_EMATCH_NBYTE) += em_nbyte.o diff -Nru linux-2.6.11-rc1-bk9.orig/net/sched/cls_basic.c linux-2.6.11-rc1-bk9/net/sched/cls_basic.c --- linux-2.6.11-rc1-bk9.orig/net/sched/cls_basic.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.11-rc1-bk9/net/sched/cls_basic.c 2005-01-22 16:12:49.000000000 +0100 @@ -0,0 +1,303 @@ +/* + * net/sched/cls_basic.c Basic Packet Classifier. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: Thomas Graf + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct basic_head +{ + u32 hgenerator; + struct list_head flist; +}; + +struct basic_filter +{ + u32 handle; + struct tcf_exts exts; + struct tcf_ematch_tree ematches; + struct tcf_result res; + struct list_head link; +}; + +static struct tcf_ext_map basic_ext_map = { + .action = TCA_BASIC_ACT, + .police = TCA_BASIC_POLICE +}; + +static int basic_classify(struct sk_buff *skb, struct tcf_proto *tp, + struct tcf_result *res) +{ + int r; + struct basic_head *head = (struct basic_head *) tp->root; + struct basic_filter *f; + + list_for_each_entry(f, &head->flist, link) { + if (!tcf_em_tree_match(skb, &f->ematches, NULL)) + continue; + *res = f->res; + r = tcf_exts_exec(skb, &f->exts, res); + if (r < 0) + continue; + return r; + } + return -1; +} + +static unsigned long basic_get(struct tcf_proto *tp, u32 handle) +{ + unsigned long l = 0UL; + struct basic_head *head = (struct basic_head *) tp->root; + struct basic_filter *f; + + if (head == NULL) + return 0UL; + + list_for_each_entry(f, &head->flist, link) + if (f->handle == handle) + l = (unsigned long) f; + + return l; +} + +static void basic_put(struct tcf_proto *tp, unsigned long f) +{ +} + +static int basic_init(struct tcf_proto *tp) +{ + return 0; +} + +static inline void basic_delete_filter(struct tcf_proto *tp, + struct basic_filter *f) +{ + tcf_unbind_filter(tp, &f->res); + tcf_exts_destroy(tp, &f->exts); + tcf_em_tree_destroy(tp, &f->ematches); + kfree(f); +} + +static void basic_destroy(struct tcf_proto *tp) +{ + struct basic_head *head = (struct basic_head *) xchg(&tp->root, NULL); + struct basic_filter *f, *n; + + list_for_each_entry_safe(f, n, &head->flist, link) { + list_del(&f->link); + basic_delete_filter(tp, f); + } +} + +static int basic_delete(struct tcf_proto *tp, unsigned long arg) +{ + struct basic_head *head = (struct basic_head *) tp->root; + struct basic_filter *t, *f = (struct basic_filter *) arg; + + list_for_each_entry(t, &head->flist, link) + if (t == f) { + tcf_tree_lock(tp); + list_del(&t->link); + tcf_tree_unlock(tp); + basic_delete_filter(tp, t); + return 0; + } + + return -ENOENT; +} + +static inline int basic_set_parms(struct tcf_proto *tp, struct basic_filter *f, + unsigned long base, struct rtattr **tb, + struct rtattr *est) +{ + int err = -EINVAL; + struct tcf_exts e; + struct tcf_ematch_tree t; + + if (tb[TCA_BASIC_CLASSID-1]) + if (RTA_PAYLOAD(tb[TCA_BASIC_CLASSID-1]) < sizeof(u32)) + return err; + + err = tcf_exts_validate(tp, tb, est, &e, &basic_ext_map); + if (err < 0) + return err; + + err = tcf_em_tree_validate(tp, tb[TCA_BASIC_EMATCHES-1], &t); + if (err < 0) + goto errout; + + if (tb[TCA_BASIC_CLASSID-1]) { + f->res.classid = *(u32*)RTA_DATA(tb[TCA_BASIC_CLASSID-1]); + tcf_bind_filter(tp, &f->res, base); + } + + tcf_exts_change(tp, &f->exts, &e); + tcf_em_tree_change(tp, &f->ematches, &t); + + return 0; +errout: + tcf_exts_destroy(tp, &e); + return err; +} + +static int basic_change(struct tcf_proto *tp, unsigned long base, u32 handle, + struct rtattr **tca, unsigned long *arg) +{ + int err = -EINVAL; + struct basic_head *head = (struct basic_head *) tp->root; + struct rtattr *tb[TCA_BASIC_MAX]; + struct basic_filter *f = (struct basic_filter *) *arg; + + if (tca[TCA_OPTIONS-1] == NULL) + return -EINVAL; + + if (rtattr_parse_nested(tb, TCA_BASIC_MAX, tca[TCA_OPTIONS-1]) < 0) + return -EINVAL; + + if (f != NULL) { + if (handle && f->handle != handle) + return -EINVAL; + return basic_set_parms(tp, f, base, tb, tca[TCA_RATE-1]); + } + + err = -ENOBUFS; + if (head == NULL) { + head = kmalloc(sizeof(*head), GFP_KERNEL); + if (head == NULL) + goto errout; + + memset(head, 0, sizeof(*head)); + INIT_LIST_HEAD(&head->flist); + tp->root = head; + } + + f = kmalloc(sizeof(*f), GFP_KERNEL); + if (f == NULL) + goto errout; + memset(f, 0, sizeof(*f)); + + err = -EINVAL; + if (handle) + f->handle = handle; + else { + int i = 0x80000000; + do { + if (++head->hgenerator == 0x7FFFFFFF) + head->hgenerator = 1; + } while (--i > 0 && basic_get(tp, head->hgenerator)); + + if (i <= 0) { + printk(KERN_ERR "Insufficient number of handles\n"); + goto errout; + } + + f->handle = head->hgenerator; + } + + err = basic_set_parms(tp, f, base, tb, tca[TCA_RATE-1]); + if (err < 0) + goto errout; + + tcf_tree_lock(tp); + list_add(&f->link, &head->flist); + tcf_tree_unlock(tp); + *arg = (unsigned long) f; + + return 0; +errout: + if (*arg == 0UL && f) + kfree(f); + + return err; +} + +static void basic_walk(struct tcf_proto *tp, struct tcf_walker *arg) +{ + struct basic_head *head = (struct basic_head *) tp->root; + struct basic_filter *f; + + list_for_each_entry(f, &head->flist, link) { + if (arg->count < arg->skip) + goto skip; + + if (arg->fn(tp, (unsigned long) f, arg) < 0) { + arg->stop = 1; + break; + } +skip: + arg->count++; + } +} + +static int basic_dump(struct tcf_proto *tp, unsigned long fh, + struct sk_buff *skb, struct tcmsg *t) +{ + struct basic_filter *f = (struct basic_filter *) fh; + unsigned char *b = skb->tail; + struct rtattr *rta; + + if (f == NULL) + return skb->len; + + t->tcm_handle = f->handle; + + rta = (struct rtattr *) b; + RTA_PUT(skb, TCA_OPTIONS, 0, NULL); + + if (tcf_exts_dump(skb, &f->exts, &basic_ext_map) < 0 || + tcf_em_tree_dump(skb, &f->ematches, TCA_BASIC_EMATCHES) < 0) + goto rtattr_failure; + + rta->rta_len = (skb->tail - b); + return skb->len; + +rtattr_failure: + skb_trim(skb, b - skb->data); + return -1; +} + +static struct tcf_proto_ops cls_basic_ops = { + .kind = "basic", + .classify = basic_classify, + .init = basic_init, + .destroy = basic_destroy, + .get = basic_get, + .put = basic_put, + .change = basic_change, + .delete = basic_delete, + .walk = basic_walk, + .dump = basic_dump, + .owner = THIS_MODULE, +}; + +static int __init init_basic(void) +{ + return register_tcf_proto_ops(&cls_basic_ops); +} + +static void __exit exit_basic(void) +{ + unregister_tcf_proto_ops(&cls_basic_ops); +} + +module_init(init_basic) +module_exit(exit_basic) +MODULE_LICENSE("GPL"); + From tgraf@suug.ch Sun Jan 23 15:21:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 15:21:33 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0NNLR4O025068 for ; Sun, 23 Jan 2005 15:21:28 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id CB47185; Mon, 24 Jan 2005 00:21:04 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 917AD1C0EA; Mon, 24 Jan 2005 00:21:47 +0100 (CET) Date: Mon, 24 Jan 2005 00:21:47 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: [PATCHSET] Extended matches and basic classifier Message-ID: <20050123232147.GI23931@postel.suug.ch> References: <20050123230012.GB23931@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050123230012.GB23931@postel.suug.ch> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 681 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 1284 Lines: 30 * Thomas Graf <20050123230012.GB23931@postel.suug.ch> 2005-01-24 00:00 > > This patchset adds the ematch API, the ematches cmp, nbyte, u32, meta, > and the basic classifier. It doesn't touch any existing code. Summary about what is planned next regarding ematches: The u32 classifier will get transformed to use the u32 ematch instead of its own. It will extend the u32 classifer to support logic expressions and combines hashing with the classifiction algorithms in the ematches. This has been dicussed already about 1-2 weeks ago. It will also make the u32 nfmark obsolete. The indev match in cls_u32 and cls_fw is going to be removed, it is obsoleted by the meta ematch. cls_fw is likely to be obsoleted by the meta ematch as well, it still has the advantage of the hashing over the ematch though. A _very_ simple regular expression ematch. Some kind of text search ematch, it is yet unclear wheter to make it stateful and maybe use the recent text search code in netfilter or make it stateless and simpler. The meta ematch will be extended by the addition of more netfilter, socket, and routing attributes. A "state" ematch allowing to limit classification on the first few packets of a connection and mark all further packets the same. From kaber@trash.net Sun Jan 23 16:12:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 16:12:40 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0O0CXcR026438 for ; Sun, 23 Jan 2005 16:12:33 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.43) id 1CsrqI-0008TM-2r; Mon, 24 Jan 2005 01:12:30 +0100 Message-ID: <41F43D6D.30502@trash.net> Date: Mon, 24 Jan 2005 01:12:29 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050106 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: Thomas Graf CC: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH 1/6] PKT_SCHED: Extended Matches API References: <20050123230012.GB23931@postel.suug.ch> <20050123230132.GC23931@postel.suug.ch> In-Reply-To: <20050123230132.GC23931@postel.suug.ch> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 682 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 17613 Lines: 600 Thomas Graf wrote: >diff -Nru linux-2.6.11-rc2-bk1.orig/include/net/pkt_cls.h linux-2.6.11-rc2-bk1/include/net/pkt_cls.h >--- linux-2.6.11-rc2-bk1.orig/include/net/pkt_cls.h 2005-01-23 19:08:31.000000000 +0100 >+++ linux-2.6.11-rc2-bk1/include/net/pkt_cls.h 2005-01-23 19:08:44.000000000 +0100 >@@ -148,6 +148,176 @@ > extern int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts, > struct tcf_ext_map *map); > >+/** >+ * struct tcf_pkt_info - packet information >+ */ >+struct tcf_pkt_info >+{ >+}; >+ >+#ifdef CONFIG_NET_EMATCH >+ >+struct tcf_ematch_ops; >+ >+/** >+ * struct tcf_ematch - extended match (ematch) >+ * >+ * @matchid: identifier to allow userspace to reidentify a match >+ * @flags: flags specifying attributes and the relation to other matches >+ * @ops: the operations lookup table of the corresponding ematch module >+ * @datalen: length of the ematch specific configuration data >+ * @data: ematch specific data >+ */ >+struct tcf_ematch >+{ >+ u16 matchid; >+ u16 flags; >+ struct tcf_ematch_ops * ops; >+ unsigned int datalen; >+ unsigned long data; >+}; > This layout leaves two holes on 64 bit, how about: { struct tcf_ematch_ops *ops; unsigned long data; unsigned int datalen; u16 matchid; u16 flags; }; >diff -Nru linux-2.6.11-rc2-bk1.orig/net/sched/ematch.c linux-2.6.11-rc2-bk1/net/sched/ematch.c >--- linux-2.6.11-rc2-bk1.orig/net/sched/ematch.c 1970-01-01 01:00:00.000000000 +0100 >+++ linux-2.6.11-rc2-bk1/net/sched/ematch.c 2005-01-23 16:31:57.000000000 +0100 >@@ -0,0 +1,526 @@ >+/* >+ * net/sched/ematch.c Extended Match API >+ * >+ * This program is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU General Public License >+ * as published by the Free Software Foundation; either version >+ * 2 of the License, or (at your option) any later version. >+ * >+ * Authors: Thomas Graf >+ * >+ * ========================================================================== >+ * >+ * An extended match (ematch) is a small classification tool not worth >+ * writing a full classifier for. Ematches can be interconnected to form >+ * a logic expression and get attached to classifiers to extend their >+ * functionatlity. >+ * >+ * The userspace part transforms the logic expressions into an array >+ * consisting of multiple sequences of interconnected ematches separated >+ * by markers. Precedence is implemented by a special ematch kind >+ * referencing a sequence beyond the marker of the current sequence >+ * causing the current position in the sequence to be pushed onto a stack >+ * to allow the current position to be overwritten by the position referenced >+ * in the special ematch. Matching continues in the new sequence until a >+ * marker is reached causing the position to be restored from the stack. >+ * >+ * Example: >+ * A AND (B1 OR B2) AND C AND D >+ * >+ * ------->-PUSH------- >+ * -->-- / -->-- \ -->-- >+ * / \ / / \ \ / \ >+ * +-------+-------+-------+-------+-------+--------+ >+ * | A AND | B AND | C AND | D END | B1 OR | B2 END | >+ * +-------+-------+-------+-------+-------+--------+ >+ * \ / >+ * --------<-POP--------- >+ * >+ * where B is a virtual ematch referencing to sequence starting with B1. >+ * >+ * ========================================================================== >+ * >+ * How to write an ematch in 60 seconds >+ * ------------------------------------ >+ * >+ * 1) Provide a matcher function: >+ * static int my_match(struct sk_buff *skb, struct tcf_ematch *m, >+ * struct tcf_pkt_info *info) >+ * { >+ * struct mydata *d = (struct mydata *) m->data; >+ * >+ * if (...matching goes here...) >+ * return 1; >+ * else >+ * return 0; >+ * } >+ * >+ * 2) Fill out a struct tcf_ematch_ops: >+ * static struct tcf_ematch_ops my_ops = { >+ * .kind = unique id, >+ * .datalen = sizeof(struct mydata), >+ * .match = my_match, >+ * .owner = THIS_MODULE, >+ * }; >+ * >+ * 3) Register/Unregister your ematch: >+ * static int __init init_my_ematch(void) >+ * { >+ * return tcf_em_register(&my_ops); >+ * } >+ * >+ * static void __exit exit_my_ematch(void) >+ * { >+ * return tcf_em_unregister(&my_ops); >+ * } >+ * >+ * module_init(init_my_ematch); >+ * module_exit(exit_my_ematch); >+ * >+ * 4) By now you should have two more seconds left, barely enough to >+ * open up a beer to watch the compilation going. >+ */ >+ >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+ >+static LIST_HEAD(ematch_ops); >+static DEFINE_RWLOCK(ematch_mod_lock); >+ >+static inline struct tcf_ematch_ops * tcf_em_lookup(u16 kind) > >+{ >+ struct tcf_ematch_ops *e = NULL; >+ >+ read_lock(&ematch_mod_lock); >+ list_for_each_entry(e, &ematch_ops, link) { >+ if (kind == e->kind) { >+ if (!try_module_get(e->owner)) >+ e = NULL; >+ break; >+ } >+ } > e is the iterator, if nothing matched it will contain the last element now >+ read_unlock(&ematch_mod_lock); >+ >+ return e; >+} >+ >+/** >+ * tcf_em_register - register an extended match >+ * >+ * @ops: ematch operations lookup table >+ * >+ * This function must be called by ematches to announce their presence. >+ * The given @ops must have kind set to a unique identifier and the >+ * callback match() must be implemented. All other callbacks are optional >+ * and a fallback implementation is used instead. >+ * >+ * Returns -EEXISTS if an ematch of the same kind has already registered. >+ */ >+int tcf_em_register(struct tcf_ematch_ops *ops) >+{ >+ int err = -EEXIST; >+ struct tcf_ematch_ops *e; >+ >+ write_lock(&ematch_mod_lock); >+ list_for_each_entry(e, &ematch_ops, link) >+ if (ops->kind == e->kind) >+ goto errout; >+ >+ list_add_tail(&ops->link, &ematch_ops); >+ err = 0; >+errout: >+ write_unlock(&ematch_mod_lock); >+ return err; >+} >+ >+/** >+ * tcf_em_unregister - unregster and extended match >+ * >+ * @ops: ematch operations lookup table >+ * >+ * This function must be called by ematches to announce their disappearance >+ * for examples when the module gets unloaded. The @ops parameter must be >+ * the same as the one used for registration. >+ * >+ * Returns -ENOENT if no matching ematch was found. >+ */ >+int tcf_em_unregister(struct tcf_ematch_ops *ops) >+{ >+ int err = 0; >+ struct tcf_ematch_ops *e; >+ >+ write_lock(&ematch_mod_lock); >+ list_for_each_entry(e, &ematch_ops, link) { >+ if (e == ops) { >+ list_del(&e->link); >+ goto out; >+ } >+ } >+ >+ err = -ENOENT; >+out: >+ write_unlock(&ematch_mod_lock); >+ return err; >+} >+ >+static inline struct tcf_ematch * tcf_em_get_match(struct tcf_ematch_tree *tree, >+ int index) >+{ >+ return &tree->matches[index]; >+} >+ >+ >+static int tcf_em_validate(struct tcf_proto *tp, >+ struct tcf_ematch_tree_hdr *tree_hdr, >+ struct tcf_ematch *em, struct rtattr *rta, int idx) >+{ >+ int err = -EINVAL; >+ struct tcf_ematch_hdr *em_hdr = RTA_DATA(rta); >+ int data_len = RTA_PAYLOAD(rta) - sizeof(*em_hdr); >+ void *data = (void *) em_hdr + sizeof(*em_hdr); >+ >+ if (!TCF_EM_REL_VALID(em_hdr->flags)) >+ goto errout; >+ >+ if (em_hdr->kind == TCF_EM_CONTAINER) { >+ /* Special ematch called "container", carries an index >+ * referencing an external ematch sequence. */ >+ u32 ref; >+ >+ if (data_len < sizeof(ref)) >+ goto errout; >+ ref = *(u32 *) data; >+ >+ if (ref >= tree_hdr->nmatches) >+ goto errout; >+ >+ /* We do not allow backward jumps to avoid loops and jumps >+ * to our own position are of course illegal. */ >+ if (ref <= idx) >+ goto errout; >+ >+ >+ em->data = ref; >+ } else { >+ /* Note: This lookup will increase the module refcnt >+ * of the ematch module referenced. In case of a failure, >+ * a destroy function is called by the underlying layer >+ * which automatically releases the reference again, therefore >+ * the module MUST not be given back under any circumstances >+ * here. Be aware, the destroy function assumes that the >+ * module is held if the ops field is non zero. */ >+ em->ops = tcf_em_lookup(em_hdr->kind); >+ >+ if (em->ops == NULL) { >+ err = -ENOENT; >+ goto errout; >+ } >+ >+ /* ematch module provides expected length of data, so we >+ * can do a basic sanity check. */ >+ if (em->ops->datalen && data_len < em->ops->datalen) >+ goto errout; >+ >+ if (em->ops->change) { >+ err = em->ops->change(tp, data, data_len, em); >+ if (err < 0) >+ goto errout; >+ } else if (data_len > 0) { >+ /* ematch module doesn't provide an own change >+ * procedure and expects us to allocate and copy >+ * the ematch data. >+ * >+ * TCF_EM_SIMPLE may be specified stating that the >+ * data only consists of a u32 integer and the module >+ * does not expected a memory reference but rather >+ * the value carried. */ >+ if (em_hdr->flags & TCF_EM_SIMPLE) { >+ if (data_len < sizeof(u32)) >+ goto errout; >+ em->data = *(u32 *) data; >+ } else { >+ void *v = kmalloc(data_len, GFP_KERNEL); >+ if (v == NULL) { >+ err = -ENOBUFS; >+ goto errout; >+ } >+ memcpy(v, data, data_len); >+ em->data = (unsigned long) v; >+ } >+ } >+ } >+ >+ em->matchid = em_hdr->matchid; >+ em->flags = em_hdr->flags; >+ em->datalen = data_len; >+ >+ err = 0; >+errout: >+ return err; >+} >+ >+/** >+ * tcf_em_tree_validate - validate ematch config TLV and build ematch tree >+ * >+ * @tp: classifier kind handle >+ * @rta: ematch tree configuration TLV >+ * @tree: destination ematch tree variable to store the resulting >+ * ematch tree. >+ * >+ * This function validates the given configuration TLV @rta and builds an >+ * ematch tree in @tree. The resulting tree must later be copied into >+ * the private classifier data using tcf_em_tree_change(). You MUST NOT >+ * provide the ematch tree variable of the private classifier data directly, >+ * the changes would not be locked properly. >+ * >+ * Returns a negative error code if the configuration TLV contains errors. >+ */ >+int tcf_em_tree_validate(struct tcf_proto *tp, struct rtattr *rta, >+ struct tcf_ematch_tree *tree) >+{ >+ int idx, list_len, matches_len, err = -EINVAL; >+ struct rtattr *tb[TCA_EMATCH_TREE_MAX]; >+ struct rtattr *rt_match, *rt_hdr, *rt_list; >+ struct tcf_ematch_tree_hdr *tree_hdr; >+ struct tcf_ematch *em; >+ >+ if (rtattr_parse_nested(tb, TCA_EMATCH_TREE_MAX, rta) < 0) >+ goto errout; >+ >+ rt_hdr = tb[TCA_EMATCH_TREE_HDR-1]; >+ rt_list = tb[TCA_EMATCH_TREE_LIST-1]; >+ >+ if (rt_hdr == NULL || rt_list == NULL) >+ goto errout; >+ >+ if (RTA_PAYLOAD(rt_hdr) < sizeof(*tree_hdr) || >+ RTA_PAYLOAD(rt_list) < sizeof(*rt_match)) >+ goto errout; >+ >+ tree_hdr = RTA_DATA(rt_hdr); >+ memcpy(&tree->hdr, tree_hdr, sizeof(*tree_hdr)); >+ >+ rt_match = RTA_DATA(rt_list); >+ list_len = RTA_PAYLOAD(rt_list); >+ matches_len = tree_hdr->nmatches * sizeof(*em); >+ >+ tree->matches = kmalloc(matches_len, GFP_KERNEL); >+ if (tree->matches == NULL) >+ goto errout; >+ memset(tree->matches, 0, matches_len); >+ >+ /* We do not use rtattr_parse_nested here because the maximum >+ * number of attributes is unknown. This saves us the allocation >+ * for a tb buffer which would serve no purpose at all. >+ * >+ * The array of rt attributes is parsed in the order as they are >+ * provided, their type must be incremental from 1 to n. Even >+ * if it does not serve any real purpose, a failure of sticking >+ * to this policy will result in parsing failure. */ >+ for (idx = 0; RTA_OK(rt_match, list_len); idx++) { >+ err = -EINVAL; >+ >+ if (rt_match->rta_type != (idx + 1)) >+ goto errout_abort; >+ >+ if (idx >= tree_hdr->nmatches) >+ goto errout_abort; >+ >+ if (RTA_PAYLOAD(rt_match) < sizeof(struct tcf_ematch_hdr)) >+ goto errout_abort; >+ >+ em = tcf_em_get_match(tree, idx); >+ >+ err = tcf_em_validate(tp, tree_hdr, em, rt_match, idx); >+ if (err < 0) >+ goto errout_abort; >+ >+ rt_match = RTA_NEXT(rt_match, list_len); >+ } >+ >+ /* Check if the number of matches provided by userspace actually >+ * complies with the array of matches. The number was used for >+ * the validation of references and a mismatch could lead to >+ * undefined references during the matching process. */ >+ if (idx != tree_hdr->nmatches) { >+ err = -EINVAL; >+ goto errout_abort; >+ } >+ >+ err = 0; >+errout: >+ return err; >+ >+errout_abort: >+ tcf_em_tree_destroy(tp, tree); >+ return err; >+} >+ >+/** >+ * tcf_em_tree_destroy - destroy an ematch tree >+ * >+ * @tp: classifier kind handle >+ * @tree: ematch tree to be deleted >+ * >+ * This functions destroys an ematch tree previously created by >+ * tcf_em_tree_validate()/tcf_em_tree_change(). You must ensure that >+ * the ematch tree is not in use before calling this function. >+ */ >+void tcf_em_tree_destroy(struct tcf_proto *tp, struct tcf_ematch_tree *tree) >+{ >+ int i; >+ >+ if (tree->matches == NULL) >+ return; >+ >+ for (i = 0; i < tree->hdr.nmatches; i++) { >+ struct tcf_ematch *em = tcf_em_get_match(tree, i); >+ >+ if (em->ops) { >+ if (em->ops->destroy) >+ em->ops->destroy(tp, em); >+ else if (!tcf_em_is_simple(em) && em->data) >+ kfree((void *) em->data); >+ module_put(em->ops->owner); >+ } >+ } >+ >+ tree->hdr.nmatches = 0; >+ kfree(xchg(&tree->matches, NULL)); > > xchg is not necessary here. Setting tree->matches to NULL also doesn't look necessary. As the comment above indicates, the caller needs to ensure the tree is unsused, so it should be easy for him to ensure he won't destroy the same tree twice. >+} >+ >+/** >+ * tcf_em_tree_dump - dump ematch tree into a rtnl message >+ * >+ * @skb: skb holding the rtnl message >+ * @t: ematch tree to be dumped >+ * @tlv: TLV type to be used to encapsulate the tree >+ * >+ * This function dumps a ematch tree into a rtnl message. It is valid to >+ * call this function while the ematch tree is in use. >+ * >+ * Returns -1 if the skb tailroom is insufficient. >+ */ >+int tcf_em_tree_dump(struct sk_buff *skb, struct tcf_ematch_tree *tree, int tlv) >+{ >+ int i; >+ struct rtattr * top_start = (struct rtattr*) skb->tail; >+ struct rtattr * list_start; >+ >+ RTA_PUT(skb, tlv, 0, NULL); >+ RTA_PUT(skb, TCA_EMATCH_TREE_HDR, sizeof(tree->hdr), &tree->hdr); >+ >+ list_start = (struct rtattr *) skb->tail; >+ RTA_PUT(skb, TCA_EMATCH_TREE_LIST, 0, NULL); >+ >+ for (i = 0; i < tree->hdr.nmatches; i++) { >+ struct rtattr *match_start = (struct rtattr*) skb->tail; >+ struct tcf_ematch *em = tcf_em_get_match(tree, i); >+ struct tcf_ematch_hdr em_hdr = { >+ .kind = em->ops ? em->ops->kind : TCF_EM_CONTAINER, >+ .matchid = em->matchid, >+ .flags = em->flags >+ }; >+ >+ RTA_PUT(skb, i+1, sizeof(em_hdr), &em_hdr); >+ >+ if (em->ops && em->ops->dump) { >+ if (em->ops->dump(skb, em) < 0) >+ goto rtattr_failure; >+ } else if (tcf_em_is_container(em) || tcf_em_is_simple(em)) { >+ u32 u = em->data; >+ RTA_PUT_NOHDR(skb, sizeof(u), &u); >+ } else if (em->datalen > 0) >+ RTA_PUT_NOHDR(skb, em->datalen, (void *) em->data); >+ >+ match_start->rta_len = skb->tail - (u8*) match_start; >+ } >+ >+ list_start->rta_len = skb->tail - (u8 *) list_start; >+ top_start->rta_len = skb->tail - (u8 *) top_start; >+ >+ return 0; >+ >+rtattr_failure: >+ return -1; >+} >+ >+static inline int tcf_em_match(struct sk_buff *skb, struct tcf_ematch *em, >+ struct tcf_pkt_info *info) >+{ >+ int r; >+ >+ if (likely(em->ops->match)) > > gcc assumes likely for ptr != NULL by default. Is there a reason why a match wouldn't have a match function ? >+ r = em->ops->match(skb, em, info); >+ else >+ r = 0; >+ >+ return tcf_em_is_inverted(em) ? !r : r; >+} >+ >+/* Do not use this function directly, use tcf_em_tree_match instead */ >+int __tcf_em_tree_match(struct sk_buff *skb, struct tcf_ematch_tree *tree, >+ struct tcf_pkt_info *info) >+{ >+ int stackp = 0, match_idx = 0, res = 0; >+ struct tcf_ematch *cur_match; >+ int stack[CONFIG_NET_EMATCH_STACK]; > > >+ >+proceed: >+ while (match_idx < tree->hdr.nmatches) { >+ cur_match = tcf_em_get_match(tree, match_idx); >+ >+ if (tcf_em_is_container(cur_match)) { >+ if (unlikely(stackp >= CONFIG_NET_EMATCH_STACK)) >+ goto stack_overflow; >+ >+ stack[stackp++] = match_idx; >+ match_idx = cur_match->data; >+ goto proceed; >+ } >+ >+ res = tcf_em_match(skb, cur_match, info); >+ >+ if (tcf_em_early_end(cur_match, res)) >+ break; >+ >+ match_idx++; >+ } >+ >+pop_stack: >+ if (stackp > 0) { >+ match_idx = stack[--stackp]; >+ cur_match = tcf_em_get_match(tree, match_idx); >+ >+ if (tcf_em_early_end(cur_match, res)) >+ goto pop_stack; >+ else { >+ match_idx++; >+ goto proceed; >+ } >+ } >+ >+ return res; >+ >+stack_overflow: >+ if (net_ratelimit()) >+ printk("Local stack overflow, increase NET_EMATCH_STACK\n"); >+ return -1; >+} >+ >+EXPORT_SYMBOL(tcf_em_register); >+EXPORT_SYMBOL(tcf_em_unregister); >+EXPORT_SYMBOL(tcf_em_tree_validate); >+EXPORT_SYMBOL(tcf_em_tree_destroy); >+EXPORT_SYMBOL(tcf_em_tree_dump); >+EXPORT_SYMBOL(__tcf_em_tree_match); > > > From kaber@trash.net Sun Jan 23 16:14:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 16:14:19 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0O0EEDx026912 for ; Sun, 23 Jan 2005 16:14:15 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.43) id 1Csrrw-0008TS-TV; Mon, 24 Jan 2005 01:14:12 +0100 Message-ID: <41F43DD4.8070306@trash.net> Date: Mon, 24 Jan 2005 01:14:12 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050106 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: Thomas Graf CC: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH 2/6] PKT_SCHED: Simple comparison ematch (cmp) References: <20050123230012.GB23931@postel.suug.ch> <20050123230221.GD23931@postel.suug.ch> In-Reply-To: <20050123230221.GD23931@postel.suug.ch> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 683 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 2740 Lines: 115 Thomas Graf wrote: >diff -Nru linux-2.6.11-rc2-bk1.orig/net/sched/em_cmp.c linux-2.6.11-rc2-bk1/net/sched/em_cmp.c >--- linux-2.6.11-rc2-bk1.orig/net/sched/em_cmp.c 1970-01-01 01:00:00.000000000 +0100 >+++ linux-2.6.11-rc2-bk1/net/sched/em_cmp.c 2005-01-23 17:31:03.000000000 +0100 >@@ -0,0 +1,101 @@ >+/* >+ * net/sched/em_cmp.c Simple packet data comparison ematch >+ * >+ * This program is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU General Public License >+ * as published by the Free Software Foundation; either version >+ * 2 of the License, or (at your option) any later version. >+ * >+ * Authors: Thomas Graf >+ */ >+ >+#include >+#include >+#include >+#include >+#include >+#include >+#include >+ >+static inline int cmp_needs_transformation(struct tcf_em_cmp *cmp) >+{ >+ return unlikely(cmp->flags & TCF_EM_CMP_TRANS); >+} >+ >+static int em_cmp_match(struct sk_buff *skb, struct tcf_ematch *em, >+ struct tcf_pkt_info *info) >+{ >+ struct tcf_em_cmp *cmp = (struct tcf_em_cmp *) em->data; >+ unsigned char *ptr = tcf_get_base_ptr(skb, cmp->layer) + cmp->off; >+ u32 val = 0; >+ >+ if (!tcf_valid_offset(skb, ptr, cmp->align)) >+ return 0; >+ >+ switch (cmp->align) { >+ case TCF_EM_ALIGN_U8: >+ val = *ptr; >+ break; >+ >+ case TCF_EM_ALIGN_U16: >+ val = *ptr << 8; >+ val |= *(ptr+1); >+ >+ if (cmp_needs_transformation(cmp)) >+ val = be16_to_cpu(val); > > Why not simply convert cmp->val in userspace ? >+ break; >+ >+ case TCF_EM_ALIGN_U32: >+ /* Worth checking boundries? The branching seems >+ * to get worse. Visit again. */ >+ val = *ptr << 24; >+ val |= *(ptr+1) << 16; >+ val |= *(ptr+2) << 8; >+ val |= *(ptr+3); >+ >+ if (cmp_needs_transformation(cmp)) >+ val = be32_to_cpu(val); >+ break; >+ >+ default: >+ return 0; >+ } >+ >+ if (cmp->mask) >+ val &= cmp->mask; >+ >+ switch (cmp->opnd) { >+ case TCF_EM_OPND_EQ: >+ return val == cmp->val; >+ case TCF_EM_OPND_LT: >+ return val < cmp->val; >+ case TCF_EM_OPND_GT: >+ return val > cmp->val; >+ } >+ >+ return 0; >+} >+ >+static struct tcf_ematch_ops em_cmp_ops = { >+ .kind = TCF_EM_CMP, >+ .datalen = sizeof(struct tcf_em_cmp), >+ .match = em_cmp_match, >+ .owner = THIS_MODULE, >+ .link = LIST_HEAD_INIT(em_cmp_ops.link) >+}; >+ >+static int __init init_em_cmp(void) >+{ >+ return tcf_em_register(&em_cmp_ops); >+} >+ >+static void __exit exit_em_cmp(void) >+{ >+ tcf_em_unregister(&em_cmp_ops); >+} >+ >+MODULE_LICENSE("GPL"); >+ >+module_init(init_em_cmp); >+module_exit(exit_em_cmp); >+ > > > From kaber@trash.net Sun Jan 23 16:24:16 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 16:24:22 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0O0OFRC030973 for ; Sun, 23 Jan 2005 16:24:15 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.43) id 1Css1d-0008UN-Jc; Mon, 24 Jan 2005 01:24:13 +0100 Message-ID: <41F4402D.6040200@trash.net> Date: Mon, 24 Jan 2005 01:24:13 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050106 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: Thomas Graf CC: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH 4/6] PKT_SCHED: u32 ematch References: <20050123230012.GB23931@postel.suug.ch> <20050123230354.GF23931@postel.suug.ch> In-Reply-To: <20050123230354.GF23931@postel.suug.ch> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 684 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 1932 Lines: 73 Thomas Graf wrote: >diff -Nru linux-2.6.11-rc1-bk9.orig/net/sched/em_u32.c linux-2.6.11-rc1-bk9/net/sched/em_u32.c >--- linux-2.6.11-rc1-bk9.orig/net/sched/em_u32.c 1970-01-01 01:00:00.000000000 +0100 >+++ linux-2.6.11-rc1-bk9/net/sched/em_u32.c 2005-01-22 12:37:28.000000000 +0100 >@@ -0,0 +1,58 @@ >+/* >+ * net/sched/em_u32.c U32 Ematch >+ * >+ * This program is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU General Public License >+ * as published by the Free Software Foundation; either version >+ * 2 of the License, or (at your option) any later version. >+ * >+ * Authors: Thomas Graf >+ * Alexey Kuznetsov, >+ * >+ * Based on net/sched/cls_u32.c >+ */ >+ >+#include >+#include >+#include >+#include >+#include >+#include >+ >+static int em_u32_match(struct sk_buff *skb, struct tcf_ematch *em, >+ struct tcf_pkt_info *info) >+{ >+ struct tc_u32_key *key = (struct tc_u32_key *) em->data; >+ unsigned char *ptr = skb->nh.raw; >+ >+ if (info) { >+ if (info->ptr) >+ ptr = info->ptr; >+ ptr += (info->nexthdr & key->offmask); >+ } >+ >+ return !((*(u32*) (ptr + key->off) ^ key->val) & key->mask); > > This needs to make sure it stays inside the skb. I know cls_u32's checks are pretty weak, but having nothing doesn't seem right. >+} >+ >+static struct tcf_ematch_ops em_u32_ops = { >+ .kind = TCF_EM_U32, >+ .datalen = sizeof(struct tc_u32_key), >+ .match = em_u32_match, >+ .owner = THIS_MODULE, >+ .link = LIST_HEAD_INIT(em_u32_ops.link) >+}; >+ >+static int __init init_em_u32(void) >+{ >+ return tcf_em_register(&em_u32_ops); >+} >+ >+static void __exit exit_em_u32(void) >+{ >+ tcf_em_unregister(&em_u32_ops); >+} >+ >+MODULE_LICENSE("GPL"); >+ >+module_init(init_em_u32); >+module_exit(exit_em_u32); > > > From tgraf@suug.ch Sun Jan 23 16:32:23 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 16:32:30 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0O0WLIT032102 for ; Sun, 23 Jan 2005 16:32:22 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id DF32185; Mon, 24 Jan 2005 01:31:58 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id F24C81C0EA; Mon, 24 Jan 2005 01:32:41 +0100 (CET) Date: Mon, 24 Jan 2005 01:32:41 +0100 From: Thomas Graf To: David Coulson Cc: netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-ID: <20050124003241.GJ23931@postel.suug.ch> References: <41F432BD.3000300@davidcoulson.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F432BD.3000300@davidcoulson.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 685 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 6376 Lines: 191 * David Coulson <41F432BD.3000300@davidcoulson.net> 2005-01-23 18:26 > I got this out of one of my boxes today - I'm not 100% sure what the > output is prior to the TSC error, but I figure they're probably > associated. I forgot to compile in CONFIG_RTC on this box (It's SMP > using a HT P4 CPU), so I'll stick a fresh kernel on it. > > Anyway, hope the hex output makes sense to you :-) I CC'ed netdev, this seems more serious than I thought. Background: David noticed the assertion csum + 2 > offset being trigged in skb_checksum_help. I sent him a patch converting it into a warning printing offset, len, n.raw, tail, csum, features and the whole packet as hexdump. He uses the acenic driver which is actually capable of doing IP checksumming. (Patch enclosed at the end) > <4>Losing too many ticks! > TSC cannot be used as a timesource. > Possible reasons for this are: > You're running with Speedstep, > You don't have DMA enabled for your hard disk (see hdparm), > Incorrect TSC synchronization on an SMP system (see dmesg). > Falling back to a sane timesource now. Not related. > offset=345 len=379 n=e859c024 tail=e859c17d csum=0xf69c > features: 0 features == 0, this looks very wrong, also explains why it actually tries to do software checksumming even if your card can do it in hardware. > skb hdr corrupted! not good, this explains why the checksum is wrong. skb->h.raw is < skb->data. Let's enable the brain network parser for your hex dumps. > 00 d0 b7 a6 ba e3 00 02 e3 00 09 31 08 00 Ethernet header: From: 00:d0:b7:a6:ba:e3 To: 00:02:e3:00:09:31 Protocol: 0x0800 (IP) > 45 00 01 6d b9 8d 00 b9 31 11 7b 08 d3 20 75 0b 0a 01 01 05 Version: 4 IHL: 5 DSCP: 00 Length: 365 bytes, so len=379 above is correct (365+14 ether) ID: 0xb98d Flags: 0 Fragment Offset: 185 TTL: 49 [0] Protocol: 17 (UDP) Checksum: 0x7b08 Source: 211.32.117.11 (korean ip) Destination: 10.1.1.5 [0] The originator of this packet is likely a BSD based UNIX box. It is unlikely that it dropped to 49 from 128 which I think is the base TTL windows uses. Only guessing though. The payload doesn't look special at a first glance but align it correctly and you'll get: > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 6c c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 6d c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 68 c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 29 c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 0a c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 45 c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 50 c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 88 c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 84 c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 92 c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 9c c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 b6 c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 b7 c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 b8 c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 b9 c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 ba c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 7f c0 90 > 00 01 00 01 00 01 51 80 00 04 de e7 23 15 c0 90 > 00 01 00 01 00 01 51 80 00 04 de e7 23 17 c0 f2 > 00 01 00 01 00 01 51 80 00 04 d3 20 75 0a c1 08 > 00 01 00 01 00 01 51 80 00 04 d3 20 75 0b 00 00 > 29 10 00 00 00 00 00 00 00 It _could_ be nothing but still looks very suspicous. Next fragment: [ Same ethernet header ] [ Same IP header except: ] Length: 477 ID: 0xb525 Flags: 0 Fragment Offset: 185 Checksum: 0x7f01 Source: 211.32.117.12 Destination: 10.1.1.5 Same source incremented by 1. > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 b6 c0 7c > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 b7 c0 7c > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 b8 c0 7c > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 b9 c0 7c > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 ba c0 7c > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 7f c0 7c > 00 01 00 01 00 01 51 80 00 04 de e7 23 15 c0 7c > 00 01 00 01 00 01 51 80 00 04 de e7 23 17 c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 6e c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 2a c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 0b c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 46 c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 47 c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 48 c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 51 c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 89 c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 93 c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 9d c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 bb c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 bc c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 bd c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 be c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 bf c0 90 > 00 01 00 01 00 01 51 80 00 04 d3 2b c5 80 c0 90 > 00 01 00 01 00 01 51 80 00 04 de e7 23 18 c0 90 > 00 01 00 01 00 01 51 80 00 04 de e7 23 19 c0 f2 > 00 01 00 01 00 01 51 80 00 04 d3 20 75 0a c1 08 > 00 01 00 01 00 01 51 80 00 04 d3 20 75 0b 00 00 > 29 10 00 00 00 00 00 00 00 Very similiar again. Next fragment: Length: 477 ID: 0xb525 Flags: 0 Fragment Offset: 185 Checksum: 0x7f01 Source: 211.32.117.11 Destination: 10.1.15 Back to the first IP, same payload as first packet. Without further inspection I'd guess this is just junk traffic of some stupid tool trying to screw up ip stacks and it seems to be quite sucessful. I'll try to investigate some more later on, there must be some serious memory corruption happening. --- linux-2.6.10-bk14.orig/net/core/dev.c 2005-01-13 10:56:33.000000000 +0100 +++ linux-2.6.10-bk14/net/core/dev.c 2005-01-15 23:38:03.000000000 +0100 @@ -1096,8 +1096,27 @@ offset = skb->tail - skb->h.raw; if (offset <= 0) BUG(); - if (skb->csum + 2 > offset) - BUG(); + if (skb->csum + 2 > offset) { + int l = 0; + u8 *p; + + if (!skb_shinfo(skb)->nr_frags) { + for (p = skb->data; p < skb->tail; p++) { + printk("%02x ", *p); + if (++l == 20) { + printk("\n"); + l = 0; + } + } + } else + printk("paged skb, not printing\n"); + printk(KERN_CRIT "offset=%d len=%d n=%p tail=%p csum=0x%x\n", + offset, skb->len, skb->h.raw, skb->tail, skb->csum); + printk(KERN_CRIT "features: %x\n", skb->dev->features); + if (skb->h.raw < skb->data || skb->h.raw > skb->data) + printk(KERN_CRIT "skb hdr corrupted!\n"); + goto out; + } *(u16*)(skb->h.raw + skb->csum) = csum_fold(csum); skb->ip_summed = CHECKSUM_NONE; From tgraf@suug.ch Sun Jan 23 16:49:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 16:49:17 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0O0nAFb000563 for ; Sun, 23 Jan 2005 16:49:11 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 58EFE85; Mon, 24 Jan 2005 01:48:46 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 8E2D21C0EB; Mon, 24 Jan 2005 01:49:29 +0100 (CET) Date: Mon, 24 Jan 2005 01:49:29 +0100 From: Thomas Graf To: Patrick McHardy Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH 1/6] PKT_SCHED: Extended Matches API Message-ID: <20050124004929.GK23931@postel.suug.ch> References: <20050123230012.GB23931@postel.suug.ch> <20050123230132.GC23931@postel.suug.ch> <41F43D6D.30502@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F43D6D.30502@trash.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 686 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 1961 Lines: 66 * Patrick McHardy <41F43D6D.30502@trash.net> 2005-01-24 01:12 > Thomas Graf wrote: > >+struct tcf_ematch > >+{ > >+ u16 matchid; > >+ u16 flags; > >+ struct tcf_ematch_ops * ops; > >+ unsigned int datalen; > >+ unsigned long data; > >+}; > > > This layout leaves two holes on 64 bit, how about: > > { > struct tcf_ematch_ops *ops; > unsigned long data; > unsigned int datalen; > u16 matchid; > u16 flags; > }; Good point. > >+ read_lock(&ematch_mod_lock); > >+ list_for_each_entry(e, &ematch_ops, link) { > >+ if (kind == e->kind) { > >+ if (!try_module_get(e->owner)) > >+ e = NULL; > >+ break; > >+ } > >+ } > > > e is the iterator, if nothing matched it will contain the last element now Damn, yes. Still used to have the iterator being NULL in loops. Probably made this mistake in other spots too, will check this. > >+ tree->hdr.nmatches = 0; > >+ kfree(xchg(&tree->matches, NULL)); > > > > > xchg is not necessary here. Setting tree->matches to NULL also doesn't look > necessary. As the comment above indicates, the caller needs to ensure the > tree is unsused, so it should be easy for him to ensure he won't destroy the > same tree twice. It's not necessary but I do call tcf_em_tree_destroy internally and I want to provide a consistent interface to the outside world. It's argueable for sure. The xchg doesn't have any locking purposes and I can understand if it confuses readers so I'll remove it. > >+static inline int tcf_em_match(struct sk_buff *skb, struct tcf_ematch *em, > >+ struct tcf_pkt_info *info) > >+{ > >+ int r; > >+ > >+ if (likely(em->ops->match)) > > > > > gcc assumes likely for ptr != NULL by default. Is there a reason why a match > wouldn't have a match function ? There is no reason but ematches might get written by unexperienced people forgeting to register it. I know, the if partly hides the failure, it's one of theses case where I have the same arguments for both ways. From kaber@trash.net Sun Jan 23 16:49:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 16:49:18 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0O0nCKW000562 for ; Sun, 23 Jan 2005 16:49:13 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.43) id 1CssPl-00008x-7D; Mon, 24 Jan 2005 01:49:09 +0100 Message-ID: <41F44605.6050001@trash.net> Date: Mon, 24 Jan 2005 01:49:09 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050106 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: Thomas Graf CC: David Coulson , netdev@oss.sgi.com Subject: Re: skb_checksum_help References: <41F432BD.3000300@davidcoulson.net> <20050124003241.GJ23931@postel.suug.ch> In-Reply-To: <20050124003241.GJ23931@postel.suug.ch> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 687 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 641 Lines: 25 Thomas Graf wrote: >I CC'ed netdev, this seems more serious than I thought. > >Background: David noticed the assertion csum + 2 > offset being trigged >in skb_checksum_help. I sent him a patch converting it into a warning >printing offset, len, n.raw, tail, csum, features and the whole packet >as hexdump. He uses the acenic driver which is actually capable of doing >IP checksumming. (Patch enclosed at the end) > How does the backtrace look ? >>skb hdr corrupted! >> > The check looks bogus: >+ if (skb->h.raw < skb->data || skb->h.raw > skb->data) >+ printk(KERN_CRIT "skb hdr corrupted!\n"); >+ goto out; >+ } > Regards Patrick From tgraf@suug.ch Sun Jan 23 16:53:29 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 16:53:34 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0O0rSfx001629 for ; Sun, 23 Jan 2005 16:53:29 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id E284B85; Mon, 24 Jan 2005 01:53:05 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 053B01C0EA; Mon, 24 Jan 2005 01:53:48 +0100 (CET) Date: Mon, 24 Jan 2005 01:53:48 +0100 From: Thomas Graf To: Patrick McHardy Cc: David Coulson , netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-ID: <20050124005348.GL23931@postel.suug.ch> References: <41F432BD.3000300@davidcoulson.net> <20050124003241.GJ23931@postel.suug.ch> <41F44605.6050001@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F44605.6050001@trash.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 688 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 3671 Lines: 93 * Patrick McHardy <41F44605.6050001@trash.net> 2005-01-24 01:49 > Thomas Graf wrote: > > >I CC'ed netdev, this seems more serious than I thought. > > > >Background: David noticed the assertion csum + 2 > offset being trigged > >in skb_checksum_help. I sent him a patch converting it into a warning > >printing offset, len, n.raw, tail, csum, features and the whole packet > >as hexdump. He uses the acenic driver which is actually capable of doing > >IP checksumming. (Patch enclosed at the end) > > > How does the backtrace look ? It's a normal forwarded packet as it seems. ipq_kill doesn't show up in other occurances of this bug. kernel BUG at net/core/dev.c:1100! invalid operand: 0000 [#1] SMP CPU: 0 EIP: 0060:[] Not tainted VLI EFLAGS: 00010216 (2.6.10) EIP is at skb_checksum_help+0x9c/0xf0 eax: 00009ec4 ebx: 000001ce ecx: 00009ec2 edx: adc3f0fe esi: f6b58b80 edi: f693d824 ebp: 00000000 esp: c04c3c84 ds: 007b es: 007b ss: 0068 Process swapper (pid: 0, threadinfo=c04c2000 task=c0410b40) Stack: adc3f0fe f6b58b80 f7034000 00000000 fffffff4 c02b7c86 000073a6 02e0f250 00000282 f6de9ea4 f6b58b80 f6de9e80 0000000e c02bd354 f6de9ea8 00000000 000001e2 c02e5697 f589b680 f693d800 f693d824 f6b58b80 c02ea0de 00000000 Call Trace: [] dev_queue_xmit+0x246/0x290 [] neigh_resolve_output+0xc4/0x1b0 [] ipq_kill+0x67/0x80 [] ip_finish_output2+0xce/0x1a0 [] ip_fragment+0x638/0x750 [] ip_finish_output2+0x0/0x1a0 [] ip_finish_output2+0x0/0x1a0 [] ip_refrag+0x6f/0x80 [] ip_finish_output2+0x0/0x1a0 [] nf_iterate+0x72/0xb0 [] ip_finish_output2+0x0/0x1a0 [] ip_finish_output2+0x0/0x1a0 [] nf_hook_slow+0x68/0xf0 [] ip_finish_output2+0x0/0x1a0 [] ip_finish_output2+0x0/0x1a0 [] ip_finish_output+0x1e1/0x1f0 [] ip_finish_output2+0x0/0x1a0 [] ip_fragment+0x638/0x750 [] ipt_hook+0x28/0x30 [] nf_iterate+0x72/0xb0 [] ip_finish_output+0x0/0x1f0 [] ip_forward_finish+0x0/0x50 [] ip_forward_finish+0x29/0x50 [] nf_hook_slow+0xb2/0xf0 [] ip_forward_finish+0x0/0x50 [] ip_forward+0x1bc/0x280 [] ip_forward_finish+0x0/0x50 [] ip_rcv_finish+0x1f8/0x270 [] nf_iterate+0x72/0xb0 [] ip_rcv_finish+0x0/0x270 [] ip_rcv_finish+0x0/0x270 [] nf_hook_slow+0xb2/0xf0 [] ip_rcv_finish+0x0/0x270 [] ip_rcv+0x3ec/0x4b0 [] ip_rcv_finish+0x0/0x270 [] ace_rx_int+0x2f9/0x3d0 [] netif_receive_skb+0x20a/0x2b0 [] process_backlog+0x86/0x120 [] net_rx_action+0x7f/0x110 [] __do_softirq+0xb6/0xd0 [] do_softirq+0x2d/0x30 [] do_IRQ+0x1e/0x30 [] common_interrupt+0x1a/0x20 [] default_idle+0x0/0x40 [] default_idle+0x29/0x40 [] cpu_idle+0x3b/0x50 [] start_kernel+0x13b/0x160 [] unknown_bootoption+0x0/0x1c0 Code: 24 00 00 00 00 29 d9 89 da 89 f0 e8 df bb ff ff 8b 9e b0 00 00 00 89 c2 8b 7e 24 29 fb 85 db 7e 4e 8b 4e 6c 8d 41 02 39 d8 76 08 <0f> 0b 4c 04 73 ad 3f c0 89 d0 c1 e0 10 81 e2 00 00 ff ff 01 c2 <0>Kernel panic - not syncing: Fatal exception in interrupt > The check looks bogus: > > >+ if (skb->h.raw < skb->data || skb->h.raw > skb->data) > >+ printk(KERN_CRIT "skb hdr corrupted!\n"); Right, my fault, should have been skb->tail in the second check. From tgraf@suug.ch Sun Jan 23 16:55:23 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 16:55:27 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0O0tNfs002122 for ; Sun, 23 Jan 2005 16:55:23 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 61EEC85; Mon, 24 Jan 2005 01:55:00 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id C7EB61C0EA; Mon, 24 Jan 2005 01:55:43 +0100 (CET) Date: Mon, 24 Jan 2005 01:55:43 +0100 From: Thomas Graf To: Patrick McHardy Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH 2/6] PKT_SCHED: Simple comparison ematch (cmp) Message-ID: <20050124005543.GM23931@postel.suug.ch> References: <20050123230012.GB23931@postel.suug.ch> <20050123230221.GD23931@postel.suug.ch> <41F43DD4.8070306@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F43DD4.8070306@trash.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 689 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 838 Lines: 29 * Patrick McHardy <41F43DD4.8070306@trash.net> 2005-01-24 01:14 > Thomas Graf wrote: > >+static int em_cmp_match(struct sk_buff *skb, struct tcf_ematch *em, > >+ struct tcf_pkt_info *info) > >+{ > >+ struct tcf_em_cmp *cmp = (struct tcf_em_cmp *) em->data; > >+ unsigned char *ptr = tcf_get_base_ptr(skb, cmp->layer) + cmp->off; > >+ u32 val = 0; > >+ > >+ if (!tcf_valid_offset(skb, ptr, cmp->align)) > >+ return 0; > >+ > >+ switch (cmp->align) { > >+ case TCF_EM_ALIGN_U8: > >+ val = *ptr; > >+ break; > >+ > >+ case TCF_EM_ALIGN_U16: > >+ val = *ptr << 8; > >+ val |= *(ptr+1); > >+ > >+ if (cmp_needs_transformation(cmp)) > >+ val = be16_to_cpu(val); > > > > > Why not simply convert cmp->val in userspace ? To allow comparing with lt and gt. I favoured transforming over byte order specific comparison routines. From kaber@trash.net Sun Jan 23 16:56:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 16:56:52 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0O0uld4002613 for ; Sun, 23 Jan 2005 16:56:48 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.43) id 1CssX8-0000AQ-2I; Mon, 24 Jan 2005 01:56:46 +0100 Message-ID: <41F447CE.6030007@trash.net> Date: Mon, 24 Jan 2005 01:56:46 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050106 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: Thomas Graf CC: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH 1/6] PKT_SCHED: Extended Matches API References: <20050123230012.GB23931@postel.suug.ch> <20050123230132.GC23931@postel.suug.ch> <41F43D6D.30502@trash.net> <20050124004929.GK23931@postel.suug.ch> In-Reply-To: <20050124004929.GK23931@postel.suug.ch> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 690 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 616 Lines: 20 Thomas Graf wrote: >* Patrick McHardy <41F43D6D.30502@trash.net> 2005-01-24 01:12 > > >>gcc assumes likely for ptr != NULL by default. Is there a reason why a match >>wouldn't have a match function ? >> > >There is no reason but ematches might get written by unexperienced people >forgeting to register it. I know, the if partly hides the failure, it's >one of theses case where I have the same arguments for both ways. > I don't care much, but I guess people forgetting to add a match function to an ematch will find other ways to do stupid things :) How about catching it in tcf_em_register ? Regards Patrick From tgraf@suug.ch Sun Jan 23 16:58:33 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 16:58:37 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0O0wXlm003164 for ; Sun, 23 Jan 2005 16:58:33 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 6F83085; Mon, 24 Jan 2005 01:58:10 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 8A2FC1C0EA; Mon, 24 Jan 2005 01:58:53 +0100 (CET) Date: Mon, 24 Jan 2005 01:58:53 +0100 From: Thomas Graf To: Patrick McHardy Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH 4/6] PKT_SCHED: u32 ematch Message-ID: <20050124005853.GN23931@postel.suug.ch> References: <20050123230012.GB23931@postel.suug.ch> <20050123230354.GF23931@postel.suug.ch> <41F4402D.6040200@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F4402D.6040200@trash.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 691 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 807 Lines: 23 * Patrick McHardy <41F4402D.6040200@trash.net> 2005-01-24 01:24 > Thomas Graf wrote: > >+static int em_u32_match(struct sk_buff *skb, struct tcf_ematch *em, > >+ struct tcf_pkt_info *info) > >+{ > >+ struct tc_u32_key *key = (struct tc_u32_key *) em->data; > >+ unsigned char *ptr = skb->nh.raw; > >+ > >+ if (info) { > >+ if (info->ptr) > >+ ptr = info->ptr; > >+ ptr += (info->nexthdr & key->offmask); > >+ } > >+ > >+ return !((*(u32*) (ptr + key->off) ^ key->val) & key->mask); > > > > > This needs to make sure it stays inside the skb. I know cls_u32's checks > are pretty weak, but having nothing doesn't seem right. It's a exact copy with all the weaknesses inherited. I'll add a call to tcf_valid_offset, we'll lose the _feature_ to match areas in the page beyond the skb data though. ;-> From tgraf@suug.ch Sun Jan 23 16:59:30 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 16:59:34 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0O0xT4V003643 for ; Sun, 23 Jan 2005 16:59:30 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 3D45885; Mon, 24 Jan 2005 01:59:07 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id B34DA1C0EA; Mon, 24 Jan 2005 01:59:50 +0100 (CET) Date: Mon, 24 Jan 2005 01:59:50 +0100 From: Thomas Graf To: Patrick McHardy Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH 1/6] PKT_SCHED: Extended Matches API Message-ID: <20050124005950.GO23931@postel.suug.ch> References: <20050123230012.GB23931@postel.suug.ch> <20050123230132.GC23931@postel.suug.ch> <41F43D6D.30502@trash.net> <20050124004929.GK23931@postel.suug.ch> <41F447CE.6030007@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F447CE.6030007@trash.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 692 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 744 Lines: 20 * Patrick McHardy <41F447CE.6030007@trash.net> 2005-01-24 01:56 > Thomas Graf wrote: > > >* Patrick McHardy <41F43D6D.30502@trash.net> 2005-01-24 01:12 > > > > > >>gcc assumes likely for ptr != NULL by default. Is there a reason why a > >>match > >>wouldn't have a match function ? > >> > > > >There is no reason but ematches might get written by unexperienced people > >forgeting to register it. I know, the if partly hides the failure, it's > >one of theses case where I have the same arguments for both ways. > > > I don't care much, but I guess people forgetting to add a match > function to an ematch will find other ways to do stupid things :) > How about catching it in tcf_em_register ? Sounds like a good plan, will do so. Thanks. From david@davidcoulson.net Sun Jan 23 17:31:12 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 17:31:18 -0800 (PST) Received: from mail.mx.davidcoulson.net (ns1.openconsultancy.com [207.166.203.131]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0O1VBTd005657 for ; Sun, 23 Jan 2005 17:31:12 -0800 Received: (qmail 3907 invoked for bounce); 24 Jan 2005 01:31:05 +0000 Received: from unknown (HELO mx3.openconsultancy.com) (qmailr@10.2.0.36) by tailtiu.dmz.davidcoulson.net (qmail 1.03-djc-2) with SMTP; 24 Jan 2005 01:31:05 +0000 Received: (qmail 12949 invoked from network); 24 Jan 2005 01:31:04 -0000 Received: from unknown (HELO ?10.2.3.172?) (10.2.3.172) by vlan-102.core.davidcoulson.net with SMTP; 24 Jan 2005 01:31:04 -0000 Message-ID: <41F44FD6.4000205@davidcoulson.net> Date: Sun, 23 Jan 2005 20:31:02 -0500 From: David Coulson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Thomas Graf CC: netdev@oss.sgi.com Subject: Re: skb_checksum_help References: <41F432BD.3000300@davidcoulson.net> <20050124003241.GJ23931@postel.suug.ch> In-Reply-To: <20050124003241.GJ23931@postel.suug.ch> X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 693 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: david@davidcoulson.net Precedence: bulk X-list: netdev Content-Length: 632 Lines: 25 Thomas Graf wrote: > Protocol: 17 (UDP) > Checksum: 0x7b08 > Source: 211.32.117.11 (korean ip) > Destination: 10.1.1.5 > > [0] The originator of this packet is likely a BSD based > UNIX box. It is unlikely that it dropped to 49 from 128 > which I think is the base TTL windows uses. Only guessing > though. Looks like a DNS packet. AFAIK, 53 is the only UDP port I NAT through from the outside to 10.1.1.5. No idea if that really matters or not, with respect to the contents of the IP packet. David -- David J. Coulson email: david@davidcoulson.net web: http://www.davidcoulson.net/ phone: (216) 920-3100 / (216) 258-4942 From herbert@gondor.apana.org.au Sun Jan 23 17:33:45 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 17:33:52 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0O1Xhu5006184 for ; Sun, 23 Jan 2005 17:33:44 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1Cst6O-000595-00; Mon, 24 Jan 2005 12:33:12 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1Cst4o-0007bD-00; Mon, 24 Jan 2005 12:31:34 +1100 From: Herbert Xu To: tgraf@suug.ch (Thomas Graf) Subject: Re: skb_checksum_help Cc: kaber@trash.net, david@davidcoulson.net, netdev@oss.sgi.com Organization: Core In-Reply-To: <20050124005348.GL23931@postel.suug.ch> X-Newsgroups: apana.lists.os.linux.netdev User-Agent: tin/1.7.4-20040225 ("Benbecula") (UNIX) (Linux/2.4.27-hx-1-686-smp (i686)) Message-Id: Date: Mon, 24 Jan 2005 12:31:34 +1100 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 694 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 894 Lines: 27 Thomas Graf wrote: > > Call Trace: > [] dev_queue_xmit+0x246/0x290 ... > [] ip_finish_output+0x0/0x1f0 > [] ip_forward_finish+0x0/0x50 Something is screwed up here. If the packet really went through forwarding, then skb->ip_summed should be CHECKSUM_NONE. This is done as the first thing in ip_forward(). So if you're seeing CHECKSUM_HW at the end of the pipe, then somebody must've changed it. CHECKSUM_HW should only be seen in dev_queue_xmit for locally generated traffic. I suggest that you print out the value of skb->ip_summed at various points in and after ip_forward() to find out who is changing skb->ip_summed. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From davem@davemloft.net Sun Jan 23 20:31:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 20:31:09 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0O4V3SE015009 for ; Sun, 23 Jan 2005 20:31:04 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Csvoq-0001yH-00; Sun, 23 Jan 2005 20:27:16 -0800 Date: Sun, 23 Jan 2005 20:27:15 -0800 From: "David S. Miller" To: Herbert Xu Cc: tgraf@suug.ch, kaber@trash.net, david@davidcoulson.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-Id: <20050123202715.281ac87c.davem@davemloft.net> In-Reply-To: References: <20050124005348.GL23931@postel.suug.ch> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 695 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 1340 Lines: 32 On Mon, 24 Jan 2005 12:31:34 +1100 Herbert Xu wrote: > Something is screwed up here. If the packet really went > through forwarding, then skb->ip_summed should be CHECKSUM_NONE. > This is done as the first thing in ip_forward(). > > So if you're seeing CHECKSUM_HW at the end of the pipe, > then somebody must've changed it. CHECKSUM_HW should > only be seen in dev_queue_xmit for locally generated > traffic. Yes. This backtrace is very strange. Let me take this chance to get on my podium and re-express my distaste for x86's inaccurate backtraces. They make debugging so difficult. It's time for some dwarf2 unwind table support the kernel x86 backtracer and a way to enable it during the build. My current guess is that this is some successful exploit of some as-yet-unknown issue in netfilter's fragmentation handling. But that's just a guess. If some code underruns skb->data somehow while unfragging/refragging, that's a sure fire way to corrupt things such as the skb->ip_summed field. All the theoretical attack has to do is find some way to copy a "1" into the byte at skb->ip_summed, as that's the value of CHECKSUM_HW. It would be nice to just log a full tcpdump trace for that UDP port on the incoming interface on that machine. This will allow us to see the exact traffic pattern. From davem@davemloft.net Sun Jan 23 20:41:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 20:41:41 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0O4fZcu015693 for ; Sun, 23 Jan 2005 20:41:36 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CsvzL-00020I-00; Sun, 23 Jan 2005 20:38:07 -0800 Date: Sun, 23 Jan 2005 20:38:07 -0800 From: "David S. Miller" To: "David S. Miller" Cc: herbert@gondor.apana.org.au, tgraf@suug.ch, kaber@trash.net, david@davidcoulson.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-Id: <20050123203807.5e101123.davem@davemloft.net> In-Reply-To: <20050123202715.281ac87c.davem@davemloft.net> References: <20050124005348.GL23931@postel.suug.ch> <20050123202715.281ac87c.davem@davemloft.net> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 696 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 413 Lines: 12 On Sun, 23 Jan 2005 20:27:15 -0800 "David S. Miller" wrote: > If some code underruns > skb->data somehow while unfragging/refragging, that's a sure > fire way to corrupt things such as the skb->ip_summed field. Ignore this, I'm wrong. We allocate sk_buff and skb->data seperately, so this can't happen. I'm really showing my age, because many moons ago we did allocate them together :-) From kaber@trash.net Sun Jan 23 20:47:43 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 20:47:48 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0O4lgfu016338 for ; Sun, 23 Jan 2005 20:47:43 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.43) id 1Csw7b-0000he-OK; Mon, 24 Jan 2005 05:46:39 +0100 Message-ID: <41F47DAF.5050806@trash.net> Date: Mon, 24 Jan 2005 05:46:39 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050106 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: Herbert Xu , tgraf@suug.ch, david@davidcoulson.net, netdev@oss.sgi.com, Netfilter Development Mailinglist Subject: Re: skb_checksum_help References: <20050124005348.GL23931@postel.suug.ch> <20050123202715.281ac87c.davem@davemloft.net> In-Reply-To: <20050123202715.281ac87c.davem@davemloft.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 697 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 1098 Lines: 26 David S. Miller wrote: >Yes. This backtrace is very strange. Let me take this >chance to get on my podium and re-express my distaste >for x86's inaccurate backtraces. They make debugging so >difficult. It's time for some dwarf2 unwind table support >the kernel x86 backtracer and a way to enable it during the >build. > >My current guess is that this is some successful exploit >of some as-yet-unknown issue in netfilter's fragmentation >handling. But that's just a guess. If some code underruns >skb->data somehow while unfragging/refragging, that's a sure >fire way to corrupt things such as the skb->ip_summed field. > That's what I suspect too. There is still the possibility of skbs "jumping" through the stack between ip_defrag callers, the same problem that caused the crashes on conntrack module unload fixed by Olaf Kirch some time ago. This could theoretically cause skbs from PRE_ROUTING to show up in POST_ROUTING and continue from there on if NAT is used. Perhaps we should add a "user"-argument to ip_defrag and keep fragment queues private to a single user. Regards Patrick From herbert@gondor.apana.org.au Sun Jan 23 20:58:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 20:58:38 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0O4wTu9017063 for ; Sun, 23 Jan 2005 20:58:30 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CswIX-0005z7-00; Mon, 24 Jan 2005 15:57:57 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CswHD-0007v7-00; Mon, 24 Jan 2005 15:56:35 +1100 Date: Mon, 24 Jan 2005 15:56:35 +1100 To: "David S. Miller" Cc: tgraf@suug.ch, kaber@trash.net, david@davidcoulson.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-ID: <20050124045635.GA30372@gondor.apana.org.au> References: <20050124005348.GL23931@postel.suug.ch> <20050123202715.281ac87c.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050123202715.281ac87c.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 698 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 734 Lines: 16 On Sun, Jan 23, 2005 at 08:27:15PM -0800, David S. Miller wrote: > > My current guess is that this is some successful exploit > of some as-yet-unknown issue in netfilter's fragmentation > handling. But that's just a guess. If some code underruns > skb->data somehow while unfragging/refragging, that's a sure > fire way to corrupt things such as the skb->ip_summed field. Another possibility is some bogus netfilter module that the reporter is using. His backtrace was showing an ipq_kill which isn't in the main tree. -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From kaber@trash.net Sun Jan 23 21:08:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 23 Jan 2005 21:08:29 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0O58Ook017915 for ; Sun, 23 Jan 2005 21:08:25 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.43) id 1CswRn-0000jl-Gu; Mon, 24 Jan 2005 06:07:31 +0100 Message-ID: <41F48293.9050301@trash.net> Date: Mon, 24 Jan 2005 06:07:31 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050106 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: Herbert Xu CC: "David S. Miller" , tgraf@suug.ch, david@davidcoulson.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help References: <20050124005348.GL23931@postel.suug.ch> <20050123202715.281ac87c.davem@davemloft.net> <20050124045635.GA30372@gondor.apana.org.au> In-Reply-To: <20050124045635.GA30372@gondor.apana.org.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 699 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 287 Lines: 12 Herbert Xu wrote: >Another possibility is some bogus netfilter module that the >reporter is using. His backtrace was showing an ipq_kill which >isn't in the main tree. > I was fooled by the name too, ipq_kill doesn't belong to ip_queue but to net/ipv4/ip_fragment.c. Regards Patrick From hanemade@gmail.com Mon Jan 24 00:59:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 00:59:33 -0800 (PST) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.198]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0O8xS36030217 for ; Mon, 24 Jan 2005 00:59:28 -0800 Received: by rproxy.gmail.com with SMTP id a41so319992rng for ; Mon, 24 Jan 2005 00:59:27 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:mime-version:content-type:content-transfer-encoding; b=tM7B/qNRfmxGj/tlKCz24NSsjBPF9uGXy4ruVb6+/+RrCR927HqqD3Smm8b/ANAOG6VAoFwMI5xtXAPH7PSBiXeUCSifYgE7a2HrYyxSD8RS/jy73UnTR5JSrMteqbUfycv1SjFuCiP4VI/YskYss+mXqIAuyJ7P5JU6/vJFGYA= Received: by 10.38.151.68 with SMTP id y68mr35798rnd; Mon, 24 Jan 2005 00:59:27 -0800 (PST) Received: by 10.38.161.59 with HTTP; Mon, 24 Jan 2005 00:59:27 -0800 (PST) Message-ID: Date: Mon, 24 Jan 2005 14:29:27 +0530 From: Harsh Reply-To: Harsh To: linux-net@vger.kernel.org Subject: help in using eth_change_mtu Cc: netdev@oss.sgi.com Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 700 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hanemade@gmail.com Precedence: bulk X-list: netdev Content-Length: 575 Lines: 17 Hello, If some extra information is required to be sent with each packet then does that require to change Ethernet MTU 1500 to 1500-(Bytes in extra info) or its ok with 1500 value of MTU? While checking source code of net_init.c in drivers/net dir i found one function eth_change_mtu. I want to know does that helps? why its given there in source code? regards, Harsh. static int eth_change_mtu(struct net_device *dev, int new_mtu) { if ((new_mtu < 68) || (new_mtu > 1500)) return -EINVAL; dev->mtu = new_mtu; return 0; } From rmk+netdev=oss.sgi.com@arm.linux.org.uk Mon Jan 24 03:49:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 03:49:14 -0800 (PST) Received: from caramon.arm.linux.org.uk (caramon.arm.linux.org.uk [212.18.232.186]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0OBn7Vo005324 for ; Mon, 24 Jan 2005 03:49:08 -0800 Received: from flint.arm.linux.org.uk ([2002:d412:e8ba:1:201:2ff:fe14:8fad]) by caramon.arm.linux.org.uk with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.41) id 1Ct2iF-0005SD-8J; Mon, 24 Jan 2005 11:48:55 +0000 Received: from rmk by flint.arm.linux.org.uk with local (Exim 4.41) id 1Ct2iD-0004Xo-Qc; Mon, 24 Jan 2005 11:48:53 +0000 Date: Mon, 24 Jan 2005 11:48:53 +0000 From: Russell King To: Andrew Morton , Jens Axboe , alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? Message-ID: <20050124114853.A16971@flint.arm.linux.org.uk> Mail-Followup-To: Andrew Morton , Jens Axboe , alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com References: <20050121161959.GO3922@fi.muni.cz> <1106360639.15804.1.camel@boxen> <20050123091154.GC16648@suse.de> <20050123011918.295db8e8.akpm@osdl.org> <20050123095608.GD16648@suse.de> <20050123023248.263daca9.akpm@osdl.org> <20050123200315.A25351@flint.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20050123200315.A25351@flint.arm.linux.org.uk>; from rmk+lkml@arm.linux.org.uk on Sun, Jan 23, 2005 at 08:03:15PM +0000 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 701 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rmk+lkml@arm.linux.org.uk Precedence: bulk X-list: netdev Content-Length: 1866 Lines: 48 On Sun, Jan 23, 2005 at 08:03:15PM +0000, Russell King wrote: > I think I may be seeing something odd here, maybe a possible memory leak. > The only problem I have is wondering whether I'm actually comparing like > with like. Maybe some networking people can provide a hint? > > Below is gathered from 2.6.11-rc1. > > bash-2.05a# head -n2 /proc/slabinfo > slabinfo - version: 2.1 > # name > bash-2.05a# cat /proc/net/rt_cache | wc -l; grep ip_dst /proc/slabinfo > 115 > ip_dst_cache 759 885 256 15 1 > bash-2.05a# cat /proc/net/rt_cache | wc -l; grep ip_dst /proc/slabinfo > 117 > ip_dst_cache 770 885 256 15 1 > bash-2.05a# cat /proc/net/rt_cache | wc -l; grep ip_dst /proc/slabinfo > 133 > ip_dst_cache 775 885 256 15 1 > bash-2.05a# cat /proc/net/rt_cache | wc -l; grep ip_dst /proc/slabinfo > 18 > ip_dst_cache 664 885 256 15 1 >... > bash-2.05a# cat /proc/net/rt_cache | wc -l; grep ip_dst /proc/slabinfo > 24 > ip_dst_cache 675 885 256 15 1 > bash-2.05a# cat /proc/net/rt_cache | wc -l; grep ip_dst /proc/slabinfo > 24 > ip_dst_cache 669 885 256 15 1 > > I'm fairly positive when I rebooted the machine a couple of days ago, > ip_dst_cache was significantly smaller for the same number of lines in > /proc/net/rt_cache. FYI, today it looks like this: bash-2.05a# cat /proc/net/rt_cache | wc -l; grep ip_dst /proc/slabinfo 26 ip_dst_cache 820 1065 256 15 1 So the dst cache seems to have grown by 151 in 16 hours... I'll continue monitoring and providing updates. -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/ 2.6 Serial core From tgraf@suug.ch Mon Jan 24 04:15:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 04:16:08 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0OCFqjR006785 for ; Mon, 24 Jan 2005 04:15:53 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 1460085; Mon, 24 Jan 2005 13:15:27 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 82FA61C0EA; Mon, 24 Jan 2005 13:16:10 +0100 (CET) Date: Mon, 24 Jan 2005 13:16:10 +0100 From: Thomas Graf To: "David S. Miller" Cc: Herbert Xu , kaber@trash.net, david@davidcoulson.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-ID: <20050124121610.GP23931@postel.suug.ch> References: <20050124005348.GL23931@postel.suug.ch> <20050123202715.281ac87c.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050123202715.281ac87c.davem@davemloft.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 702 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 1490 Lines: 35 * David S. Miller <20050123202715.281ac87c.davem@davemloft.net> 2005-01-23 20:27 > My current guess is that this is some successful exploit > of some as-yet-unknown issue in netfilter's fragmentation > handling. But that's just a guess. If some code underruns > skb->data somehow while unfragging/refragging, that's a sure > fire way to corrupt things such as the skb->ip_summed field. > > All the theoretical attack has to do is find some way to > copy a "1" into the byte at skb->ip_summed, as that's the > value of CHECKSUM_HW. It's more than that, to make it work on all nics, features must be modified as well and it seems to happen. Besides of that, there must be more corruption to ensure the checksum gets calculated wrong, right? So why would one corrupt 3 places when it could be done a lot easier. What is suspicious in the packet? The payload does indeed make sense for DNS. The equal fragment offset for the two fragments originating from two different hosts can also be explained. It _does_ look like a bug in the fragmentation code but I'm not sure if it really is triggered by some exploit. > It would be nice to just log a full tcpdump trace for that > UDP port on the incoming interface on that machine. This > will allow us to see the exact traffic pattern. Yes, this might clear things up. David, can you do this? and fix my patch by changing if (skb->h.raw < skb->data || skb->h.raw > skb->data) into: if (skb->h.raw < skb->data || skb->h.raw > skb->tail) From tgraf@suug.ch Mon Jan 24 04:22:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 04:22:39 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0OCMRNC010781 for ; Mon, 24 Jan 2005 04:22:28 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id A5B6B85; Mon, 24 Jan 2005 13:22:04 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id DCF651C0EA; Mon, 24 Jan 2005 13:22:47 +0100 (CET) Date: Mon, 24 Jan 2005 13:22:47 +0100 From: Thomas Graf To: Patrick McHardy Cc: Herbert Xu , "David S. Miller" , david@davidcoulson.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-ID: <20050124122247.GQ23931@postel.suug.ch> References: <20050124005348.GL23931@postel.suug.ch> <20050123202715.281ac87c.davem@davemloft.net> <20050124045635.GA30372@gondor.apana.org.au> <41F48293.9050301@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F48293.9050301@trash.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 703 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 3222 Lines: 77 * Patrick McHardy <41F48293.9050301@trash.net> 2005-01-24 06:07 > Herbert Xu wrote: > > >Another possibility is some bogus netfilter module that the > >reporter is using. His backtrace was showing an ipq_kill which > >isn't in the main tree. > > > I was fooled by the name too, ipq_kill doesn't belong to ip_queue but > to net/ipv4/ip_fragment.c. I followed this one too because it is directly related to frag reasm but it is a regular occurance called by a timer, here's a backtrace without ipq_kill: kernel BUG at net/core/dev.c:1103! invalid operand: 0000 [#1] SMP CPU: 0 EIP: 0060:[] Not tainted VLI EFLAGS: 00010282 (2.6.10-ac8) EIP is at skb_checksum_help+0xcd/0x120 eax: 00000011 ebx: f665bb80 ecx: c04bfc84 edx: 00000296 esi: 0000011d edi: 1e97231e ebp: f4d76941 esp: c04bfc80 ds: 007b es: 007b ss: 0068 Process swapper (pid: 0, threadinfo=c04be000 task=c040db40) Stack: c03f84c8 00000008 00000000 f665bb80 f7e31c00 00000000 fffffff4 c02bb866 00000000 f691b520 00000286 f6ffe4a4 f665bb80 0000000e f6ffe480 c02c1095 f6ffe4a8 00000000 00000131 f4dc0b80 f4d76800 00000000 f665bb80 c02edb5e Call Trace: [] dev_queue_xmit+0x246/0x290 [] neigh_connected_output+0x85/0xd0 [] ip_finish_output2+0xce/0x1a0 [] ip_fragment+0x5e0/0x6f0 [] ip_finish_output2+0x0/0x1a0 [] ip_finish_output2+0x0/0x1a0 [] ip_refrag+0x6f/0x80 [] ip_finish_output2+0x0/0x1a0 [] nf_iterate+0x72/0xb0 [] ip_finish_output2+0x0/0x1a0 [] ip_finish_output2+0x0/0x1a0 [] nf_hook_slow+0x68/0xf0 [] ip_finish_output2+0x0/0x1a0 [] ip_finish_output2+0x0/0x1a0 [] ip_finish_output+0x1e1/0x1f0 [] ip_finish_output2+0x0/0x1a0 [] ip_fragment+0x5e0/0x6f0 [] ipt_hook+0x28/0x30 [] nf_iterate+0x72/0xb0 [] ip_finish_output+0x0/0x1f0 [] ip_forward_finish+0x0/0x50 [] ip_forward_finish+0x29/0x50 [] nf_hook_slow+0xb2/0xf0 [] ip_forward_finish+0x0/0x50 [] ip_forward+0x1bc/0x280 [] ip_forward_finish+0x0/0x50 [] ip_rcv_finish+0x1f8/0x270 [] nf_iterate+0x72/0xb0 [] ip_rcv_finish+0x0/0x270 [] ip_rcv_finish+0x0/0x270 [] nf_hook_slow+0xb2/0xf0 [] ip_rcv_finish+0x0/0x270 [] ip_rcv+0x3ec/0x4b0 [] ip_rcv_finish+0x0/0x270 [] netif_receive_skb+0x20a/0x2b0 [] process_backlog+0x86/0x120 [] net_rx_action+0x7f/0x110 [] __do_softirq+0xb6/0xd0 [] do_softirq+0x2d/0x30 [] do_IRQ+0x1e/0x30 [] common_interrupt+0x1a/0x20 [] default_idle+0x0/0x40 [] default_idle+0x29/0x40 [] cpu_idle+0x3b/0x50 [] start_kernel+0x13b/0x160 [] unknown_bootoption+0x0/0x1c0 Code: 83 a8 00 00 00 72 04 39 e8 76 0c c7 04 24 aa 84 3f c0 e8 47 cb e5 ff 0f b7 43 78 c7 04 24 c8 84 3f c0 89 44 24 04 e8 33 cb e5 ff <0f> 0b 4f 04 93 84 3f c0 8b 4b 24 8b 53 6c 89 f8 c1 e0 10 81 e7 <0>Kernel panic - not syncing: Fatal exception in interrupt From tgraf@suug.ch Mon Jan 24 04:30:59 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 04:31:05 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0OCUw2N011417 for ; Mon, 24 Jan 2005 04:30:59 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id B5C0E85; Mon, 24 Jan 2005 13:30:35 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 01D831C0EA; Mon, 24 Jan 2005 13:31:18 +0100 (CET) Date: Mon, 24 Jan 2005 13:31:18 +0100 From: Thomas Graf To: David Coulson Cc: netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-ID: <20050124123118.GR23931@postel.suug.ch> References: <41F432BD.3000300@davidcoulson.net> <20050124003241.GJ23931@postel.suug.ch> <41F44FD6.4000205@davidcoulson.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F44FD6.4000205@davidcoulson.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 704 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 680 Lines: 19 * David Coulson <41F44FD6.4000205@davidcoulson.net> 2005-01-23 20:31 > Thomas Graf wrote: > > >Protocol: 17 (UDP) > >Checksum: 0x7b08 > >Source: 211.32.117.11 (korean ip) > >Destination: 10.1.1.5 > > > >[0] The originator of this packet is likely a BSD based > >UNIX box. It is unlikely that it dropped to 49 from 128 > >which I think is the base TTL windows uses. Only guessing > >though. > > Looks like a DNS packet. AFAIK, 53 is the only UDP port I NAT through > from the outside to 10.1.1.5. No idea if that really matters or not, > with respect to the contents of the IP packet. Yes, this explains the repetive payload. Can you provide your complete netfilter rule set? From kaber@trash.net Mon Jan 24 05:10:22 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 05:10:27 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ODALJA012844 for ; Mon, 24 Jan 2005 05:10:22 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.43) id 1Ct3y4-0001CM-2t; Mon, 24 Jan 2005 14:09:20 +0100 Message-ID: <41F4F37F.3070000@trash.net> Date: Mon, 24 Jan 2005 14:09:19 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050106 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: Thomas Graf CC: Herbert Xu , "David S. Miller" , david@davidcoulson.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help References: <20050124005348.GL23931@postel.suug.ch> <20050123202715.281ac87c.davem@davemloft.net> <20050124045635.GA30372@gondor.apana.org.au> <41F48293.9050301@trash.net> <20050124122247.GQ23931@postel.suug.ch> In-Reply-To: <20050124122247.GQ23931@postel.suug.ch> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 705 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 233 Lines: 11 Thomas Graf wrote: >I followed this one too because it is directly related to frag reasm >but it is a regular occurance called by a timer, here's a backtrace >without ipq_kill: > What about modules, .config, ... ? Regards Patrick From hadi@cyberus.ca Mon Jan 24 05:29:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 05:29:07 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ODT1Eo013724 for ; Mon, 24 Jan 2005 05:29:02 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1Ct4H4-0003EU-FW for netdev@oss.sgi.com; Mon, 24 Jan 2005 08:28:58 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Ct4H0-00009I-0d; Mon, 24 Jan 2005 08:28:54 -0500 Subject: Re: path: module replay From: jamal Reply-To: hadi@cyberus.ca To: Patrick McHardy Cc: Thomas Graf , "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <41EDE15B.40300@trash.net> References: <1105900522.1090.798.camel@jzny.localdomain> <41EAB74F.6060507@trash.net> <20050116185630.GZ26856@postel.suug.ch> <1105903033.1097.829.camel@jzny.localdomain> <1105903960.1097.836.camel@jzny.localdomain> <41EDE15B.40300@trash.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1106573331.1637.1265.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 24 Jan 2005 08:28:51 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 706 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 1622 Lines: 46 On Tue, 2005-01-18 at 23:26, Patrick McHardy wrote: > jamal wrote: > > >Ok, here is the last patch. I think module replay should be done from > >that spot and to be consistent as well from cls_api.c for legacy stuff. > >I also fixed a module ref count leak. > >the act_api piece is dependent on what i sent earlier for namsiz. > >the cls_api change i believe conflicts with what Thomas sent yesterday. > > > +replay: > act = tcf_action_init_1(tb[i], est, name, ovr, bind, err); > - if (act == NULL) > - goto err; > + if (act == NULL) { > + if (*err == -EAGAIN) > + goto replay; > + goto err_out; > + } > > This part is wrong. We can replay single action requests in the act_api init > path, but not in tcf_exts_init. We are coming from a classifier > initialization > path and have dropped the RTNL, so we also have to replay the classifier > request. > > Please send a fixed patch without the bogus module refcnt change. > I just upgraded to rc2 + latest bk - compiling - and looking at that path again; i think what you have already is much cleaner. We may end up getting a shorter code path for the non-classifier path in what i suggested, but its not worth the cosmetic change. The one thing that would be valuable to change is that goto i.e --- -err: +err_out: --- since err is also a variable name. But i dont think this in itself warrants a patch; maybe another patch that comes along later for something else also takes care of this. cheers, jamal From hadi@cyberus.ca Mon Jan 24 06:13:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 06:13:42 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0OEDaQb015527 for ; Mon, 24 Jan 2005 06:13:36 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1Ct4yC-0006el-Or for netdev@oss.sgi.com; Mon, 24 Jan 2005 09:13:32 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Ct4y9-0007AA-6w; Mon, 24 Jan 2005 09:13:29 -0500 Subject: Re: [RFC] batched tc to improve change throughput From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com, Werner Almesberger In-Reply-To: <20050120153559.GG26856@postel.suug.ch> References: <20050117160539.GD26856@postel.suug.ch> <1105979807.1078.16.camel@jzny.localdomain> <20050117165626.GE26856@postel.suug.ch> <1106002197.1046.19.camel@jzny.localdomain> <20050118134406.GR26856@postel.suug.ch> <1106058592.1035.95.camel@jzny.localdomain> <20050118145830.GS26856@postel.suug.ch> <1106144009.1047.989.camel@jzny.localdomain> <20050119165421.GB26856@postel.suug.ch> <1106232168.1041.125.camel@jzny.localdomain> <20050120153559.GG26856@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1106576005.1652.1292.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 24 Jan 2005 09:13:26 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 707 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 3130 Lines: 78 On Thu, 2005-01-20 at 10:35, Thomas Graf wrote: > * jamal <1106232168.1041.125.camel@jzny.localdomain> 2005-01-20 09:42 > > I like it. Assuming we can have arbitrary hierachies; you just show one > > level - but that may be just the example at hand. Given that should be > > able to meet the layout requirements that Lennert alluded to earlier. > > It doesn't include any context code, the BNF: > > PARSER := TOPNODE* > TOPNODE := NODELIST DESC LONG_DESC > NODELIST := NODE* > NODE := DESC [ NODELIST ] [ ARGUMENT ] [ ATTRS ] [ END_POINT ] > END_POINT := possible end of command > ATTRS := ATTR* > ATTR := KEY [ VALUE ] > ARGUMENT := VALUE [ DESC ] > > Not sure if this helps, I attached a complete module below. Theres a few holes in the BNF, but i dont think that matters that much. When the time comes it can be cleaned up. Should be noted that all iproute2 apps already have a very concise BNF. > > This is the part i am a little uncomfortable with. If you can make that > > library maybe part of iproute2 it would ease maintanance. Extend > > libnetlink or have another layer on top of it. > > I know you have already put the effort, but consider this thought. > > We can move it into iproute2 but the code really differs from iproute2 > and code sharing is almost impossible. We can make iproute2 use it > at some point but that doesn't make much sense for me. > I am not sure which path would be better .. > > > > - Seq counter in netlink, increased evertime a netlink message > > > gets processed and returned in ack. A netlink request may contain > > > a flag and the expected sequence number and the request gets only > > > processed if they match, otherwise the request fails. (my favourite) > > Do you have any objections on this? A seq number in netlink is infact a transaction identifier (as opposed to a message identifier). We also have a window of 1 for a very good reason - simplicty. If what you are saying is we muck around seq numbers, i think its a bad idea. > Indeed, that would serve me well and we can avoid the userspace daemon. > It doesn't even have to be a proxy, a simple callback hook capable of > returning an action would be enough for my purpose. > Sorry did not get an iota of time to work more on this over the weekend (kid decided to own me over the weekend). One thing to note is if you cant have multuiple apps requesting for RTM_XXXACTION redirects i.e you can only have one. And if this one app disapears, it is a DOS. So a daemon may be necessary just so we can check from the kernel if the app is still alive (after some timeout) and if not we can cleanup state for other apps to reuse the redirect. > NOTE: Read bottom-up: Looks very good. My thoughts now are you need to build on top of libnetlink - another library. Example, to administratively bring up a netdevice, one would call something like admin_up("eth0"); This is not to say you cant build a competing library to libnetlink, i am just not sure it is worth the effort of having two competing libraries doing almost the same thing (that need maintanance). cheers, jamal From david@davidcoulson.net Mon Jan 24 06:25:34 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 06:25:45 -0800 (PST) Received: from mail.mx.davidcoulson.net (ns1.openconsultancy.com [207.166.203.131]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0OEPWh2016331 for ; Mon, 24 Jan 2005 06:25:33 -0800 Received: (qmail 13196 invoked for bounce); 24 Jan 2005 14:25:24 +0000 Received: from unknown (HELO mx3.openconsultancy.com) (qmailr@10.2.0.36) by tailtiu.dmz.davidcoulson.net (qmail 1.03-djc-2) with SMTP; 24 Jan 2005 14:25:24 +0000 Received: (qmail 30360 invoked from network); 24 Jan 2005 14:25:22 -0000 Received: from unknown (HELO ?10.6.1.3?) (10.6.1.3) by vlan-102.core.davidcoulson.net with SMTP; 24 Jan 2005 14:25:22 -0000 Message-ID: <41F50554.4080202@davidcoulson.net> Date: Mon, 24 Jan 2005 09:25:24 -0500 From: David Coulson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Thomas Graf CC: netdev@oss.sgi.com Subject: Re: skb_checksum_help References: <41F432BD.3000300@davidcoulson.net> <20050124003241.GJ23931@postel.suug.ch> <41F44FD6.4000205@davidcoulson.net> <20050124123118.GR23931@postel.suug.ch> In-Reply-To: <20050124123118.GR23931@postel.suug.ch> X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 708 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: david@davidcoulson.net Precedence: bulk X-list: netdev Content-Length: 59745 Lines: 2039 Thomas Graf wrote: > Yes, this explains the repetive payload. Can you provide your complete > netfilter rule set? iptables-save + .config + /var/log/dmesg output (in that order) # Generated by iptables-save v1.2.11 on Mon Jan 24 09:21:46 2005 *raw :PREROUTING ACCEPT [57093101:15158285462] :OUTPUT ACCEPT [12060512:2123455512] COMMIT # Completed on Mon Jan 24 09:21:46 2005 # Generated by iptables-save v1.2.11 on Mon Jan 24 09:21:46 2005 *nat :PREROUTING ACCEPT [131677:9174978] :POSTROUTING ACCEPT [4583564:374167230] :OUTPUT ACCEPT [6380:559033] :BOGONS - [0:0] :INGRESS - [0:0] -A PREROUTING -m mark --mark 0x16 -j ACCEPT -A PREROUTING -m state --state RELATED,ESTABLISHED -j ACCEPT -A PREROUTING -p icmp -m ttl --ttl-eq 1 -j ACCEPT -A PREROUTING -p udp -m udp --dport 33434:33542 -m ttl --ttl-eq 1 -j ACCEPT -A PREROUTING -d 207.166.198.0/255.255.255.224 -i vlan102 -p icmp -m ttl --ttl-eq 2 -j LOG -A PREROUTING -d 207.166.198.0/255.255.255.224 -i vlan102 -p icmp -m ttl --ttl-eq 2 -j DNAT --to-destination 10.1.1.1 -A PREROUTING -d 207.166.193.157 -p icmp -j ACCEPT -A PREROUTING -d 207.166.193.237 -p icmp -j ACCEPT -A PREROUTING -d 207.166.193.238 -p icmp -j ACCEPT -A PREROUTING -d 207.166.203.128/255.255.255.192 -p icmp -m ttl --ttl-eq 2 -j DNAT --to-destination 10.1.1.1 -A PREROUTING -d 207.166.203.128/255.255.255.192 -p icmp -m ttl --ttl-gt 2 -j DNAT --to-destination 10.1.1.1 -A PREROUTING -p udp -m udp --dport 33434:33542 -m ttl --ttl-eq 2 -j DNAT --to-destination 10.1.1.1 -A PREROUTING -i lo -j ACCEPT -A PREROUTING -s 10.0.0.0/255.0.0.0 -d 10.0.0.0/255.0.0.0 -j ACCEPT -A PREROUTING -s 10.0.0.0/255.0.0.0 -d 224.0.0.0/255.0.0.0 -j ACCEPT -A PREROUTING -m state --state INVALID -j DROP -A PREROUTING -i vlan102 -j BOGONS -A PREROUTING -i vlan102 -j INGRESS -A PREROUTING -d 207.166.198.0/255.255.255.224 -j ACCEPT -A PREROUTING -d 207.166.203.176/255.255.255.240 -j ACCEPT -A PREROUTING -d 207.166.218.128/255.255.255.224 -j ACCEPT -A PREROUTING -d 207.166.193.157 -p udp -m udp --dport 500 -j ACCEPT -A PREROUTING -d 207.166.193.237 -p udp -m udp --dport 500 -j ACCEPT -A PREROUTING -d 207.166.193.238 -p udp -m udp --dport 500 -j ACCEPT -A PREROUTING -d 207.166.193.157 -p udp -m udp --dport 4500 -j ACCEPT -A PREROUTING -d 207.166.193.237 -p udp -m udp --dport 4500 -j ACCEPT -A PREROUTING -d 207.166.193.238 -p udp -m udp --dport 4500 -j ACCEPT -A PREROUTING -d 207.166.193.157 -p ah -j ACCEPT -A PREROUTING -d 207.166.193.237 -p ah -j ACCEPT -A PREROUTING -d 207.166.193.238 -p ah -j ACCEPT -A PREROUTING -d 207.166.193.157 -p esp -j ACCEPT -A PREROUTING -d 207.166.193.237 -p esp -j ACCEPT -A PREROUTING -d 207.166.193.238 -p esp -j ACCEPT -A PREROUTING -d 207.166.193.157 -p tcp -m tcp --dport 1723 -j DNAT --to-destination 10.1.1.1 -A PREROUTING -d 207.166.193.237 -p tcp -m tcp --dport 1723 -j DNAT --to-destination 10.1.1.2 -A PREROUTING -d 207.166.193.238 -p tcp -m tcp --dport 1723 -j DNAT --to-destination 10.1.1.3 -A PREROUTING -d 207.166.193.157 -p gre -j ACCEPT -A PREROUTING -d 207.166.193.237 -p gre -j ACCEPT -A PREROUTING -d 207.166.193.238 -p gre -j ACCEPT -A PREROUTING -d 207.166.193.237 -p tcp -m tcp --dport 2525 -j DNAT --to-destination 10.1.1.3:25 -A PREROUTING -d 207.166.193.237 -p tcp -m tcp --dport 25 -j DNAT --to-destination 10.1.1.2 -A PREROUTING -d 207.166.193.237 -p tcp -m tcp --dport 53 -j DNAT --to-destination 10.1.1.2 -A PREROUTING -d 207.166.193.237 -p udp -m udp --dport 53 -j DNAT --to-destination 10.1.1.2 -A PREROUTING -d 207.166.193.238 -p tcp -m tcp --dport 25 -j DNAT --to-destination 10.1.1.3 -A PREROUTING -d 207.166.193.238 -p tcp -m tcp --dport 53 -j DNAT --to-destination 10.1.1.3 -A PREROUTING -d 207.166.193.238 -p udp -m udp --dport 53 -j DNAT --to-destination 10.1.1.3 -A PREROUTING -d 207.166.203.130 -p tcp -m tcp --dport 25 -j DNAT --to-destination 10.1.1.5 -A PREROUTING -d 207.166.203.130 -p tcp -m tcp --dport 80 -j DNAT --to-destination 10.1.1.5 -A PREROUTING -d 207.166.203.130 -p tcp -m tcp --dport 443 -j DNAT --to-destination 10.1.1.5 -A PREROUTING -d 207.166.203.130 -p tcp -m tcp --dport 993 -j DNAT --to-destination 10.1.1.5 -A PREROUTING -d 207.166.203.130 -p tcp -m tcp --dport 995 -j DNAT --to-destination 10.1.1.5 -A PREROUTING -d 207.166.203.131 -p tcp -m tcp --dport 53 -j DNAT --to-destination 10.1.1.5 -A PREROUTING -d 207.166.203.131 -p udp -m udp --dport 53 -j DNAT --to-destination 10.1.1.5 -A PREROUTING -d 207.166.203.131 -p tcp -m tcp --dport 80 -j DNAT --to-destination 10.1.1.5 -A PREROUTING -d 207.166.203.131 -p tcp -m tcp --dport 443 -j DNAT --to-destination 10.1.1.5 -A PREROUTING -d 207.166.203.139 -p tcp -m tcp --dport 80 -j DNAT --to-destination 10.1.7.5 -A PREROUTING -d 207.166.203.139 -p tcp -m tcp --dport 110 -j DNAT --to-destination 10.1.7.3 -A PREROUTING -d 207.166.203.139 -p tcp -m tcp --dport 443 -j DNAT --to-destination 10.1.7.5 -A PREROUTING -d 207.166.203.139 -p tcp -m tcp --dport 993 -j DNAT --to-destination 10.1.7.3 -A PREROUTING -d 207.166.203.139 -p tcp -m tcp --dport 995 -j DNAT --to-destination 10.1.7.3 -A PREROUTING -d 207.166.203.144 -p udp -m udp --dport 4569 -j DNAT --to-destination 10.1.1.8 -A PREROUTING -d 207.166.203.135 -p udp -m udp --dport 53 -j DNAT --to-destination 10.1.1.8 -A PREROUTING -d 207.166.203.145 -p udp -m udp --dport 53 -j DNAT --to-destination 10.1.2.2:8053 -A PREROUTING -d 207.166.203.146 -p udp -m udp --dport 53 -j DNAT --to-destination 10.1.2.3:8053 -A PREROUTING -d 207.166.203.139 -p tcp -m tcp --dport 22 -j DNAT --to-destination 10.1.1.130 -A PREROUTING -d 207.166.203.143 -j DNAT --to-destination 10.4.7.18 -A PREROUTING -d 207.166.203.148 -j DNAT --to-destination 10.1.7.6 -A PREROUTING -d 207.166.203.149 -j DNAT --to-destination 10.4.7.2 -A PREROUTING -d 207.166.203.150 -j DNAT --to-destination 10.4.7.20 -A PREROUTING -d 207.166.203.151 -j DNAT --to-destination 10.4.7.4 -A PREROUTING -d 207.166.203.153 -j DNAT --to-destination 10.4.7.6 -A PREROUTING -d 207.166.203.154 -j DNAT --to-destination 10.4.7.21 -A PREROUTING -d 207.166.203.155 -j DNAT --to-destination 10.4.7.8 -A PREROUTING -d 207.166.203.156 -j DNAT --to-destination 10.4.7.22 -A PREROUTING -d 207.166.203.157 -j DNAT --to-destination 10.4.7.10 -A PREROUTING -d 207.166.203.158 -j DNAT --to-destination 10.4.7.15 -A PREROUTING -d 207.166.203.159 -j DNAT --to-destination 10.4.7.17 -A PREROUTING -d 207.166.203.160 -j DNAT --to-destination 10.4.7.19 -A PREROUTING -d 207.166.203.161 -j DNAT --to-destination 10.4.7.23 -A PREROUTING -d 207.166.203.162 -j DNAT --to-destination 10.4.7.24 -A PREROUTING -d 207.166.193.157 -j DROP -A PREROUTING -d 207.166.193.237 -j DROP -A PREROUTING -d 207.166.193.238 -j DROP -A PREROUTING -d 207.166.203.128/255.255.255.192 -j DROP -A PREROUTING -d 207.166.218.128/255.255.255.224 -j DROP -A PREROUTING -d 207.166.198.0/255.255.255.224 -j DROP -A POSTROUTING -d 127.0.0.1 -j ACCEPT -A POSTROUTING -o lo -j ACCEPT -A POSTROUTING -s 10.0.0.0/255.0.0.0 -d 10.0.0.0/255.0.0.0 -m mark ! --mark 0x13 -j ACCEPT -A POSTROUTING -s 10.0.0.0/255.0.0.0 -d 224.0.0.0/255.0.0.0 -j ACCEPT -A POSTROUTING -m mark --mark 0x13 -j SNAT --to-source 207.166.193.157 -A POSTROUTING -s 10.1.1.8 -o vlan102 -p udp -m udp --dport 4569 -j SNAT --to-source 207.166.203.144 -A POSTROUTING -s 10.1.1.2 -o vlan102 -j SNAT --to-source 207.166.203.129 -A POSTROUTING -s 10.1.1.3 -o vlan102 -j SNAT --to-source 207.166.203.129 -A POSTROUTING -s 10.1.1.5 -o vlan102 -j SNAT --to-source 207.166.203.131 -A POSTROUTING -s 10.4.7.18 -o vlan102 -j SNAT --to-source 207.166.203.143 -A POSTROUTING -s 10.1.7.6 -o vlan102 -j SNAT --to-source 207.166.203.148 -A POSTROUTING -s 10.4.7.2 -o vlan102 -j SNAT --to-source 207.166.203.149 -A POSTROUTING -s 10.4.7.20 -o vlan102 -j SNAT --to-source 207.166.203.150 -A POSTROUTING -s 10.4.7.4 -o vlan102 -j SNAT --to-source 207.166.203.151 -A POSTROUTING -s 10.4.7.6 -o vlan102 -j SNAT --to-source 207.166.203.153 -A POSTROUTING -s 10.4.7.21 -o vlan102 -j SNAT --to-source 207.166.203.154 -A POSTROUTING -s 10.4.7.8 -o vlan102 -j SNAT --to-source 207.166.203.155 -A POSTROUTING -s 10.4.7.22 -o vlan102 -j SNAT --to-source 207.166.203.156 -A POSTROUTING -s 10.4.7.10 -o vlan102 -j SNAT --to-source 207.166.203.157 -A POSTROUTING -s 10.4.7.15 -o vlan102 -j SNAT --to-source 207.166.203.158 -A POSTROUTING -s 10.4.7.17 -o vlan102 -j SNAT --to-source 207.166.203.159 -A POSTROUTING -s 10.4.7.19 -o vlan102 -j SNAT --to-source 207.166.203.160 -A POSTROUTING -s 10.4.7.23 -o vlan102 -j SNAT --to-source 207.166.203.161 -A POSTROUTING -s 10.4.7.24 -o vlan102 -j SNAT --to-source 207.166.203.162 -A POSTROUTING -s 10.0.0.0/255.0.0.0 -o vlan102 -j SNAT --to-source 207.166.203.142 -A BOGONS -s 0.0.0.0/254.0.0.0 -j DROP -A BOGONS -s 2.0.0.0/255.0.0.0 -j DROP -A BOGONS -s 5.0.0.0/255.0.0.0 -j DROP -A BOGONS -s 7.0.0.0/255.0.0.0 -j DROP -A BOGONS -s 10.0.0.0/255.0.0.0 -j DROP -A BOGONS -s 23.0.0.0/255.0.0.0 -j DROP -A BOGONS -s 27.0.0.0/255.0.0.0 -j DROP -A BOGONS -s 31.0.0.0/255.0.0.0 -j DROP -A BOGONS -s 36.0.0.0/254.0.0.0 -j DROP -A BOGONS -s 39.0.0.0/255.0.0.0 -j DROP -A BOGONS -s 41.0.0.0/255.0.0.0 -j DROP -A BOGONS -s 42.0.0.0/255.0.0.0 -j DROP -A BOGONS -s 49.0.0.0/255.0.0.0 -j DROP -A BOGONS -s 50.0.0.0/255.0.0.0 -j DROP -A BOGONS -s 73.0.0.0/255.0.0.0 -j DROP -A BOGONS -s 74.0.0.0/254.0.0.0 -j DROP -A BOGONS -s 76.0.0.0/252.0.0.0 -j DROP -A BOGONS -s 89.0.0.0/255.0.0.0 -j DROP -A BOGONS -s 90.0.0.0/254.0.0.0 -j DROP -A BOGONS -s 92.0.0.0/252.0.0.0 -j DROP -A BOGONS -s 96.0.0.0/224.0.0.0 -j DROP -A BOGONS -s 169.254.0.0/255.255.0.0 -j DROP -A BOGONS -s 172.16.0.0/255.240.0.0 -j DROP -A BOGONS -s 173.0.0.0/255.0.0.0 -j DROP -A BOGONS -s 174.0.0.0/254.0.0.0 -j DROP -A BOGONS -s 176.0.0.0/248.0.0.0 -j DROP -A BOGONS -s 184.0.0.0/252.0.0.0 -j DROP -A BOGONS -s 189.0.0.0/255.0.0.0 -j DROP -A BOGONS -s 190.0.0.0/255.0.0.0 -j DROP -A BOGONS -s 192.0.2.0/255.255.255.0 -j DROP -A BOGONS -s 192.168.0.0/255.255.0.0 -j DROP -A BOGONS -s 197.0.0.0/255.0.0.0 -j DROP -A BOGONS -s 198.18.0.0/255.254.0.0 -j DROP -A BOGONS -s 223.0.0.0/255.0.0.0 -j DROP -A BOGONS -s 224.0.0.0/224.0.0.0 -j DROP -A INGRESS -d 207.166.198.0/255.255.255.224 -j RETURN -A INGRESS -d 207.166.203.128/255.255.255.192 -j RETURN -A INGRESS -d 207.166.218.128/255.255.255.224 -j RETURN -A INGRESS -d 207.166.193.157 -j RETURN -A INGRESS -d 207.166.193.237 -j RETURN -A INGRESS -d 207.166.193.238 -j RETURN -A INGRESS -j DROP COMMIT # Completed on Mon Jan 24 09:21:46 2005 # Generated by iptables-save v1.2.11 on Mon Jan 24 09:21:46 2005 *mangle :PREROUTING ACCEPT [9667679:816132796] :INPUT ACCEPT [13345820:1622723008] :FORWARD ACCEPT [43129597:13669963843] :OUTPUT ACCEPT [12060509:2123455184] :POSTROUTING ACCEPT [55164024:15853406259] -A PREROUTING -i vlan102 -p esp -j MARK --set-mark 0x16 -A PREROUTING -i vlan102 -p udp -m udp --dport 4500 -j MARK --set-mark 0x16 -A PREROUTING -m mark --mark 0x16 -j ACCEPT -A PREROUTING -s 10.0.0.0/255.0.0.0 -d 207.166.193.157 -j MARK --set-mark 0x13 -A PREROUTING -s 10.0.0.0/255.0.0.0 -d 207.166.193.237 -j MARK --set-mark 0x13 -A PREROUTING -s 10.0.0.0/255.0.0.0 -d 207.166.193.238 -j MARK --set-mark 0x13 -A PREROUTING -s 10.0.0.0/255.0.0.0 -d 207.166.198.0/255.255.255.224 -j MARK --set-mark 0x13 -A PREROUTING -s 10.0.0.0/255.0.0.0 -d 207.166.203.128/255.255.255.192 -j MARK --set-mark 0x13 -A PREROUTING -s 10.0.0.0/255.0.0.0 -d 207.166.218.128/255.255.255.224 -j MARK --set-mark 0x13 -A PREROUTING -s 10.0.0.0/255.0.0.0 -j ACCEPT -A PREROUTING -s 207.166.203.128/255.255.255.192 -j ACCEPT -A PREROUTING -s 207.166.198.0/255.255.255.224 -j ACCEPT -A PREROUTING -s 207.166.218.128/255.255.255.224 -j ACCEPT -A PREROUTING -j CONNMARK --restore-mark -A PREROUTING -m mark ! --mark 0x0 -j ACCEPT -A PREROUTING -i ! vlan102 -j MARK --set-mark 0x14 -A PREROUTING -i vlan102 -j MARK --set-mark 0x15 -A PREROUTING -j CONNMARK --save-mark -A OUTPUT -s 10.0.0.0/255.0.0.0 -j CONNMARK --restore-mark COMMIT # Completed on Mon Jan 24 09:21:46 2005 # Generated by iptables-save v1.2.11 on Mon Jan 24 09:21:46 2005 *filter :INPUT ACCEPT [13345820:1622723008] :FORWARD ACCEPT [43129597:13669963843] :OUTPUT ACCEPT [12034429:2183442456] COMMIT # Completed on Mon Jan 24 09:21:46 2005 # # Automatically generated make config: don't edit # Linux kernel version: 2.6.11-rc1-bk8 # Fri Jan 21 14:24:40 2005 # CONFIG_X86=y CONFIG_MMU=y CONFIG_UID16=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_IOMAP=y # # Code maturity level options # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y CONFIG_LOCK_KERNEL=y # # General setup # CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set CONFIG_BSD_PROCESS_ACCT=y # CONFIG_BSD_PROCESS_ACCT_V3 is not set CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=15 CONFIG_HOTPLUG=y CONFIG_KOBJECT_UEVENT=y # CONFIG_IKCONFIG is not set # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_ALL is not set # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SHMEM=y CONFIG_CC_ALIGN_FUNCTIONS=0 CONFIG_CC_ALIGN_LABELS=0 CONFIG_CC_ALIGN_LOOPS=0 CONFIG_CC_ALIGN_JUMPS=0 # CONFIG_TINY_SHMEM is not set # # Loadable module support # # CONFIG_MODULES is not set # # Processor type and features # CONFIG_X86_PC=y # CONFIG_X86_ELAN is not set # CONFIG_X86_VOYAGER is not set # CONFIG_X86_NUMAQ is not set # CONFIG_X86_SUMMIT is not set # CONFIG_X86_BIGSMP is not set # CONFIG_X86_VISWS is not set # CONFIG_X86_GENERICARCH is not set # CONFIG_X86_ES7000 is not set # CONFIG_M386 is not set # CONFIG_M486 is not set # CONFIG_M586 is not set # CONFIG_M586TSC is not set # CONFIG_M586MMX is not set # CONFIG_M686 is not set # CONFIG_MPENTIUMII is not set # CONFIG_MPENTIUMIII is not set # CONFIG_MPENTIUMM is not set CONFIG_MPENTIUM4=y # CONFIG_MK6 is not set # CONFIG_MK7 is not set # CONFIG_MK8 is not set # CONFIG_MCRUSOE is not set # CONFIG_MEFFICEON is not set # CONFIG_MWINCHIPC6 is not set # CONFIG_MWINCHIP2 is not set # CONFIG_MWINCHIP3D is not set # CONFIG_MCYRIXIII is not set # CONFIG_MVIAC3_2 is not set # CONFIG_X86_GENERIC is not set CONFIG_X86_CMPXCHG=y CONFIG_X86_XADD=y CONFIG_X86_L1_CACHE_SHIFT=7 CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_X86_WP_WORKS_OK=y CONFIG_X86_INVLPG=y CONFIG_X86_BSWAP=y CONFIG_X86_POPAD_OK=y CONFIG_X86_GOOD_APIC=y CONFIG_X86_INTEL_USERCOPY=y CONFIG_X86_USE_PPRO_CHECKSUM=y # CONFIG_HPET_TIMER is not set CONFIG_SMP=y CONFIG_NR_CPUS=8 CONFIG_SCHED_SMT=y # CONFIG_PREEMPT is not set CONFIG_X86_LOCAL_APIC=y CONFIG_X86_IO_APIC=y CONFIG_X86_TSC=y # CONFIG_X86_MCE is not set # CONFIG_TOSHIBA is not set # CONFIG_I8K is not set # CONFIG_MICROCODE is not set # CONFIG_X86_MSR is not set # CONFIG_X86_CPUID is not set # # Firmware Drivers # # CONFIG_EDD is not set # CONFIG_NOHIGHMEM is not set CONFIG_HIGHMEM4G=y # CONFIG_HIGHMEM64G is not set CONFIG_HIGHMEM=y # CONFIG_HIGHPTE is not set CONFIG_MATH_EMULATION=y # CONFIG_MTRR is not set # CONFIG_EFI is not set CONFIG_IRQBALANCE=y CONFIG_HAVE_DEC_LOCK=y CONFIG_REGPARM=y # # Power management options (ACPI, APM) # CONFIG_PM=y CONFIG_PM_DEBUG=y # CONFIG_SOFTWARE_SUSPEND is not set # # ACPI (Advanced Configuration and Power Interface) Support # CONFIG_ACPI=y CONFIG_ACPI_BOOT=y CONFIG_ACPI_INTERPRETER=y CONFIG_ACPI_SLEEP=y CONFIG_ACPI_SLEEP_PROC_FS=y CONFIG_ACPI_AC=y CONFIG_ACPI_BATTERY=y CONFIG_ACPI_BUTTON=y CONFIG_ACPI_VIDEO=y CONFIG_ACPI_FAN=y CONFIG_ACPI_PROCESSOR=y CONFIG_ACPI_THERMAL=y CONFIG_ACPI_ASUS=y CONFIG_ACPI_IBM=y CONFIG_ACPI_TOSHIBA=y CONFIG_ACPI_BLACKLIST_YEAR=0 # CONFIG_ACPI_DEBUG is not set CONFIG_ACPI_BUS=y CONFIG_ACPI_EC=y CONFIG_ACPI_POWER=y CONFIG_ACPI_PCI=y CONFIG_ACPI_SYSTEM=y # CONFIG_X86_PM_TIMER is not set # CONFIG_ACPI_CONTAINER is not set # # APM (Advanced Power Management) BIOS Support # # CONFIG_APM is not set # # CPU Frequency scaling # # CONFIG_CPU_FREQ is not set # # Bus options (PCI, PCMCIA, EISA, MCA, ISA) # CONFIG_PCI=y # CONFIG_PCI_GOBIOS is not set # CONFIG_PCI_GOMMCONFIG is not set # CONFIG_PCI_GODIRECT is not set CONFIG_PCI_GOANY=y CONFIG_PCI_BIOS=y CONFIG_PCI_DIRECT=y CONFIG_PCI_MMCONFIG=y # CONFIG_PCIEPORTBUS is not set # CONFIG_PCI_MSI is not set # CONFIG_PCI_LEGACY_PROC is not set CONFIG_PCI_NAMES=y # CONFIG_ISA is not set # CONFIG_MCA is not set # CONFIG_SCx200 is not set # # PCCARD (PCMCIA/CardBus) support # # CONFIG_PCCARD is not set # # PC-card bridges # # # PCI Hotplug Support # # CONFIG_HOTPLUG_PCI is not set # # Executable file formats # CONFIG_BINFMT_ELF=y CONFIG_BINFMT_AOUT=y CONFIG_BINFMT_MISC=y # # Device Drivers # # # Generic Driver Options # CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_FW_LOADER=y # CONFIG_DEBUG_DRIVER is not set # # Memory Technology Devices (MTD) # # CONFIG_MTD is not set # # Parallel port support # # CONFIG_PARPORT is not set # # Plug and Play support # # CONFIG_PNP is not set # # Block devices # # CONFIG_BLK_DEV_FD is not set # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set # CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set CONFIG_BLK_DEV_NBD=y # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_UB is not set # CONFIG_BLK_DEV_RAM is not set CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_INITRAMFS_SOURCE="" # CONFIG_LBD is not set # CONFIG_CDROM_PKTCDVD is not set # # IO Schedulers # CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y CONFIG_IOSCHED_CFQ=y # CONFIG_ATA_OVER_ETH is not set # # ATA/ATAPI/MFM/RLL support # CONFIG_IDE=y CONFIG_BLK_DEV_IDE=y # # Please see Documentation/ide.txt for help/info on IDE drives # # CONFIG_BLK_DEV_IDE_SATA is not set # CONFIG_BLK_DEV_HD_IDE is not set CONFIG_BLK_DEV_IDEDISK=y # CONFIG_IDEDISK_MULTI_MODE is not set # CONFIG_BLK_DEV_IDECD is not set # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_BLK_DEV_IDESCSI is not set # CONFIG_IDE_TASK_IOCTL is not set # # IDE chipset support/bugfixes # CONFIG_IDE_GENERIC=y # CONFIG_BLK_DEV_CMD640 is not set CONFIG_BLK_DEV_IDEPCI=y CONFIG_IDEPCI_SHARE_IRQ=y # CONFIG_BLK_DEV_OFFBOARD is not set CONFIG_BLK_DEV_GENERIC=y # CONFIG_BLK_DEV_OPTI621 is not set # CONFIG_BLK_DEV_RZ1000 is not set CONFIG_BLK_DEV_IDEDMA_PCI=y # CONFIG_BLK_DEV_IDEDMA_FORCED is not set CONFIG_IDEDMA_PCI_AUTO=y # CONFIG_IDEDMA_ONLYDISK is not set # CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_ALI15X3 is not set # CONFIG_BLK_DEV_AMD74XX is not set # CONFIG_BLK_DEV_ATIIXP is not set # CONFIG_BLK_DEV_CMD64X is not set # CONFIG_BLK_DEV_TRIFLEX is not set # CONFIG_BLK_DEV_CY82C693 is not set # CONFIG_BLK_DEV_CS5520 is not set # CONFIG_BLK_DEV_CS5530 is not set # CONFIG_BLK_DEV_HPT34X is not set # CONFIG_BLK_DEV_HPT366 is not set # CONFIG_BLK_DEV_SC1200 is not set # CONFIG_BLK_DEV_PIIX is not set # CONFIG_BLK_DEV_NS87415 is not set # CONFIG_BLK_DEV_PDC202XX_OLD is not set # CONFIG_BLK_DEV_PDC202XX_NEW is not set # CONFIG_BLK_DEV_SVWKS is not set # CONFIG_BLK_DEV_SIIMAGE is not set # CONFIG_BLK_DEV_SIS5513 is not set # CONFIG_BLK_DEV_SLC90E66 is not set # CONFIG_BLK_DEV_TRM290 is not set CONFIG_BLK_DEV_VIA82CXXX=y # CONFIG_IDE_ARM is not set CONFIG_BLK_DEV_IDEDMA=y # CONFIG_IDEDMA_IVB is not set CONFIG_IDEDMA_AUTO=y # CONFIG_BLK_DEV_HD is not set # # SCSI device support # CONFIG_SCSI=y # CONFIG_SCSI_PROC_FS is not set # # SCSI support type (disk, tape, CD-ROM) # # CONFIG_BLK_DEV_SD is not set # CONFIG_CHR_DEV_ST is not set # CONFIG_CHR_DEV_OSST is not set # CONFIG_BLK_DEV_SR is not set # CONFIG_CHR_DEV_SG is not set # # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # # CONFIG_SCSI_MULTI_LUN is not set # CONFIG_SCSI_CONSTANTS is not set # CONFIG_SCSI_LOGGING is not set # # SCSI Transport Attributes # # CONFIG_SCSI_SPI_ATTRS is not set # CONFIG_SCSI_FC_ATTRS is not set # CONFIG_SCSI_ISCSI_ATTRS is not set # # SCSI low-level drivers # # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_ACARD is not set # CONFIG_SCSI_AACRAID is not set # CONFIG_SCSI_AIC7XXX is not set # CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC79XX is not set # CONFIG_SCSI_DPT_I2O is not set # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_EATA_PIO is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_IPS is not set # CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_SYM53C8XX_2 is not set # CONFIG_SCSI_IPR is not set # CONFIG_SCSI_QLOGIC_ISP is not set # CONFIG_SCSI_QLOGIC_FC is not set # CONFIG_SCSI_QLOGIC_1280 is not set CONFIG_SCSI_QLA2XXX=y # CONFIG_SCSI_QLA21XX is not set # CONFIG_SCSI_QLA22XX is not set # CONFIG_SCSI_QLA2300 is not set # CONFIG_SCSI_QLA2322 is not set # CONFIG_SCSI_QLA6312 is not set # CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_NSP32 is not set # CONFIG_SCSI_DEBUG is not set # # Multi-device support (RAID and LVM) # CONFIG_MD=y CONFIG_BLK_DEV_MD=y CONFIG_MD_LINEAR=y CONFIG_MD_RAID0=y CONFIG_MD_RAID1=y # CONFIG_MD_RAID10 is not set CONFIG_MD_RAID5=y # CONFIG_MD_RAID6 is not set CONFIG_MD_MULTIPATH=y # CONFIG_MD_FAULTY is not set # CONFIG_BLK_DEV_DM is not set # # Fusion MPT device support # # CONFIG_FUSION is not set # # IEEE 1394 (FireWire) support # # CONFIG_IEEE1394 is not set # # I2O device support # # CONFIG_I2O is not set # # Networking support # CONFIG_NET=y # # Networking options # CONFIG_PACKET=y CONFIG_PACKET_MMAP=y CONFIG_NETLINK_DEV=y CONFIG_UNIX=y CONFIG_NET_KEY=y CONFIG_INET=y CONFIG_IP_MULTICAST=y CONFIG_IP_ADVANCED_ROUTER=y CONFIG_IP_MULTIPLE_TABLES=y CONFIG_IP_ROUTE_FWMARK=y CONFIG_IP_ROUTE_MULTIPATH=y # CONFIG_IP_ROUTE_VERBOSE is not set # CONFIG_IP_PNP is not set CONFIG_NET_IPIP=y CONFIG_NET_IPGRE=y # CONFIG_NET_IPGRE_BROADCAST is not set # CONFIG_IP_MROUTE is not set # CONFIG_ARPD is not set CONFIG_SYN_COOKIES=y CONFIG_INET_AH=y CONFIG_INET_ESP=y CONFIG_INET_IPCOMP=y CONFIG_INET_TUNNEL=y CONFIG_IP_TCPDIAG=y # CONFIG_IP_TCPDIAG_IPV6 is not set # # IP: Virtual Server Configuration # CONFIG_IP_VS=y # CONFIG_IP_VS_DEBUG is not set CONFIG_IP_VS_TAB_BITS=12 # # IPVS transport protocol load balancing support # CONFIG_IP_VS_PROTO_TCP=y CONFIG_IP_VS_PROTO_UDP=y CONFIG_IP_VS_PROTO_ESP=y CONFIG_IP_VS_PROTO_AH=y # # IPVS scheduler # CONFIG_IP_VS_RR=y CONFIG_IP_VS_WRR=y CONFIG_IP_VS_LC=y CONFIG_IP_VS_WLC=y CONFIG_IP_VS_LBLC=y CONFIG_IP_VS_LBLCR=y CONFIG_IP_VS_DH=y CONFIG_IP_VS_SH=y CONFIG_IP_VS_SED=y CONFIG_IP_VS_NQ=y # # IPVS application helper # CONFIG_IP_VS_FTP=y # CONFIG_IPV6 is not set CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set CONFIG_BRIDGE_NETFILTER=y # # IP: Netfilter Configuration # CONFIG_IP_NF_CONNTRACK=y # CONFIG_IP_NF_CT_ACCT is not set CONFIG_IP_NF_CONNTRACK_MARK=y CONFIG_IP_NF_CT_PROTO_SCTP=y CONFIG_IP_NF_FTP=y CONFIG_IP_NF_IRC=y CONFIG_IP_NF_TFTP=y CONFIG_IP_NF_AMANDA=y CONFIG_IP_NF_QUEUE=y CONFIG_IP_NF_IPTABLES=y CONFIG_IP_NF_MATCH_LIMIT=y CONFIG_IP_NF_MATCH_IPRANGE=y CONFIG_IP_NF_MATCH_MAC=y CONFIG_IP_NF_MATCH_PKTTYPE=y CONFIG_IP_NF_MATCH_MARK=y CONFIG_IP_NF_MATCH_MULTIPORT=y CONFIG_IP_NF_MATCH_TOS=y CONFIG_IP_NF_MATCH_RECENT=y CONFIG_IP_NF_MATCH_ECN=y CONFIG_IP_NF_MATCH_DSCP=y CONFIG_IP_NF_MATCH_AH_ESP=y CONFIG_IP_NF_MATCH_LENGTH=y CONFIG_IP_NF_MATCH_TTL=y CONFIG_IP_NF_MATCH_TCPMSS=y CONFIG_IP_NF_MATCH_HELPER=y CONFIG_IP_NF_MATCH_STATE=y CONFIG_IP_NF_MATCH_CONNTRACK=y CONFIG_IP_NF_MATCH_OWNER=y CONFIG_IP_NF_MATCH_PHYSDEV=y CONFIG_IP_NF_MATCH_ADDRTYPE=y CONFIG_IP_NF_MATCH_REALM=y CONFIG_IP_NF_MATCH_SCTP=y CONFIG_IP_NF_MATCH_COMMENT=y CONFIG_IP_NF_MATCH_CONNMARK=y CONFIG_IP_NF_MATCH_HASHLIMIT=y CONFIG_IP_NF_FILTER=y CONFIG_IP_NF_TARGET_REJECT=y CONFIG_IP_NF_TARGET_LOG=y CONFIG_IP_NF_TARGET_ULOG=y CONFIG_IP_NF_TARGET_TCPMSS=y CONFIG_IP_NF_NAT=y CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=y CONFIG_IP_NF_TARGET_REDIRECT=y CONFIG_IP_NF_TARGET_NETMAP=y CONFIG_IP_NF_TARGET_SAME=y CONFIG_IP_NF_NAT_SNMP_BASIC=y CONFIG_IP_NF_NAT_IRC=y CONFIG_IP_NF_NAT_FTP=y CONFIG_IP_NF_NAT_TFTP=y CONFIG_IP_NF_NAT_AMANDA=y CONFIG_IP_NF_MANGLE=y CONFIG_IP_NF_TARGET_TOS=y CONFIG_IP_NF_TARGET_ECN=y CONFIG_IP_NF_TARGET_DSCP=y CONFIG_IP_NF_TARGET_MARK=y CONFIG_IP_NF_TARGET_CLASSIFY=y CONFIG_IP_NF_TARGET_CONNMARK=y CONFIG_IP_NF_TARGET_CLUSTERIP=y CONFIG_IP_NF_RAW=y CONFIG_IP_NF_TARGET_NOTRACK=y CONFIG_IP_NF_ARPTABLES=y CONFIG_IP_NF_ARPFILTER=y CONFIG_IP_NF_ARP_MANGLE=y # # Bridge: Netfilter Configuration # CONFIG_BRIDGE_NF_EBTABLES=y CONFIG_BRIDGE_EBT_BROUTE=y CONFIG_BRIDGE_EBT_T_FILTER=y CONFIG_BRIDGE_EBT_T_NAT=y CONFIG_BRIDGE_EBT_802_3=y CONFIG_BRIDGE_EBT_AMONG=y CONFIG_BRIDGE_EBT_ARP=y CONFIG_BRIDGE_EBT_IP=y CONFIG_BRIDGE_EBT_LIMIT=y CONFIG_BRIDGE_EBT_MARK=y CONFIG_BRIDGE_EBT_PKTTYPE=y CONFIG_BRIDGE_EBT_STP=y CONFIG_BRIDGE_EBT_VLAN=y CONFIG_BRIDGE_EBT_ARPREPLY=y CONFIG_BRIDGE_EBT_DNAT=y CONFIG_BRIDGE_EBT_MARK_T=y CONFIG_BRIDGE_EBT_REDIRECT=y CONFIG_BRIDGE_EBT_SNAT=y CONFIG_BRIDGE_EBT_LOG=y CONFIG_BRIDGE_EBT_ULOG=y CONFIG_XFRM=y CONFIG_XFRM_USER=y # # SCTP Configuration (EXPERIMENTAL) # # CONFIG_IP_SCTP is not set # CONFIG_ATM is not set CONFIG_BRIDGE=y CONFIG_VLAN_8021Q=y # CONFIG_DECNET is not set # CONFIG_LLC2 is not set # CONFIG_IPX is not set # CONFIG_ATALK is not set # CONFIG_X25 is not set # CONFIG_LAPB is not set # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set # # QoS and/or fair queueing # CONFIG_NET_SCHED=y CONFIG_NET_SCH_CLK_JIFFIES=y # CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set # CONFIG_NET_SCH_CLK_CPU is not set CONFIG_NET_SCH_CBQ=y CONFIG_NET_SCH_HTB=y CONFIG_NET_SCH_HFSC=y CONFIG_NET_SCH_PRIO=y CONFIG_NET_SCH_RED=y CONFIG_NET_SCH_SFQ=y CONFIG_NET_SCH_TEQL=y CONFIG_NET_SCH_TBF=y CONFIG_NET_SCH_GRED=y CONFIG_NET_SCH_DSMARK=y CONFIG_NET_SCH_NETEM=y CONFIG_NET_SCH_INGRESS=y CONFIG_NET_QOS=y CONFIG_NET_ESTIMATOR=y CONFIG_NET_CLS=y CONFIG_NET_CLS_TCINDEX=y CONFIG_NET_CLS_ROUTE4=y CONFIG_NET_CLS_ROUTE=y CONFIG_NET_CLS_FW=y CONFIG_NET_CLS_U32=y # CONFIG_CLS_U32_PERF is not set # CONFIG_NET_CLS_IND is not set CONFIG_CLS_U32_MARK=y CONFIG_NET_CLS_RSVP=y CONFIG_NET_CLS_RSVP6=y CONFIG_NET_CLS_ACT=y CONFIG_NET_ACT_POLICE=y CONFIG_NET_ACT_GACT=y CONFIG_GACT_PROB=y CONFIG_NET_ACT_MIRRED=y CONFIG_NET_ACT_IPT=y CONFIG_NET_ACT_PEDIT=y # # Network testing # # CONFIG_NET_PKTGEN is not set # CONFIG_NETPOLL is not set # CONFIG_NET_POLL_CONTROLLER is not set # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set # CONFIG_BT is not set CONFIG_NETDEVICES=y # CONFIG_DUMMY is not set CONFIG_BONDING=y # CONFIG_EQUALIZER is not set CONFIG_TUN=y CONFIG_ETHERTAP=y # # ARCnet devices # # CONFIG_ARCNET is not set # # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y CONFIG_MII=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set # CONFIG_NET_VENDOR_3COM is not set # # Tulip family network device support # # CONFIG_NET_TULIP is not set # CONFIG_HP100 is not set CONFIG_NET_PCI=y # CONFIG_PCNET32 is not set # CONFIG_AMD8111_ETH is not set # CONFIG_ADAPTEC_STARFIRE is not set # CONFIG_B44 is not set # CONFIG_FORCEDETH is not set # CONFIG_DGRS is not set # CONFIG_EEPRO100 is not set # CONFIG_E100 is not set # CONFIG_FEALNX is not set # CONFIG_NATSEMI is not set # CONFIG_NE2K_PCI is not set # CONFIG_8139CP is not set # CONFIG_8139TOO is not set # CONFIG_SIS900 is not set # CONFIG_EPIC100 is not set # CONFIG_SUNDANCE is not set # CONFIG_TLAN is not set CONFIG_VIA_RHINE=y # CONFIG_VIA_RHINE_MMIO is not set # # Ethernet (1000 Mbit) # CONFIG_ACENIC=y # CONFIG_ACENIC_OMIT_TIGON_I is not set # CONFIG_DL2K is not set # CONFIG_E1000 is not set CONFIG_NS83820=y # CONFIG_HAMACHI is not set # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SK98LIN is not set # CONFIG_VIA_VELOCITY is not set # CONFIG_TIGON3 is not set # # Ethernet (10000 Mbit) # # CONFIG_IXGB is not set # CONFIG_S2IO is not set # # Token Ring devices # # CONFIG_TR is not set # # Wireless LAN (non-hamradio) # # CONFIG_NET_RADIO is not set # # Wan interfaces # # CONFIG_WAN is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set CONFIG_PPP=y # CONFIG_PPP_MULTILINK is not set # CONFIG_PPP_FILTER is not set CONFIG_PPP_ASYNC=y CONFIG_PPP_SYNC_TTY=y CONFIG_PPP_DEFLATE=y CONFIG_PPP_BSDCOMP=y CONFIG_PPP_MPPE_MPPC=y # CONFIG_PPPOE is not set # CONFIG_SLIP is not set # CONFIG_NET_FC is not set # CONFIG_SHAPER is not set # CONFIG_NETCONSOLE is not set # # ISDN subsystem # # CONFIG_ISDN is not set # # Telephony Support # # CONFIG_PHONE is not set # # Input device support # CONFIG_INPUT=y # # Userland interfaces # CONFIG_INPUT_MOUSEDEV=y # CONFIG_INPUT_MOUSEDEV_PSAUX is not set CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 # CONFIG_INPUT_JOYDEV is not set # CONFIG_INPUT_TSDEV is not set # CONFIG_INPUT_EVDEV is not set # CONFIG_INPUT_EVBUG is not set # # Input I/O drivers # # CONFIG_GAMEPORT is not set CONFIG_SOUND_GAMEPORT=y CONFIG_SERIO=y CONFIG_SERIO_I8042=y # CONFIG_SERIO_SERPORT is not set # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set CONFIG_SERIO_LIBPS2=y # CONFIG_SERIO_RAW is not set # # Input Device Drivers # CONFIG_INPUT_KEYBOARD=y CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_SUNKBD is not set # CONFIG_KEYBOARD_LKKBD is not set # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_NEWTON is not set # CONFIG_INPUT_MOUSE is not set # CONFIG_INPUT_JOYSTICK is not set # CONFIG_INPUT_TOUCHSCREEN is not set # CONFIG_INPUT_MISC is not set # # Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_HW_CONSOLE=y # CONFIG_SERIAL_NONSTANDARD is not set # # Serial drivers # CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y # CONFIG_SERIAL_8250_ACPI is not set CONFIG_SERIAL_8250_NR_UARTS=4 # CONFIG_SERIAL_8250_EXTENDED is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 # # IPMI # # CONFIG_IPMI_HANDLER is not set # # Watchdog Cards # # CONFIG_WATCHDOG is not set CONFIG_HW_RANDOM=y # CONFIG_NVRAM is not set # CONFIG_RTC is not set CONFIG_GEN_RTC=y CONFIG_GEN_RTC_X=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set # CONFIG_SONYPI is not set # # Ftape, the floppy tape device driver # # CONFIG_AGP is not set # CONFIG_DRM is not set # CONFIG_MWAVE is not set # CONFIG_RAW_DRIVER is not set # CONFIG_HPET is not set # CONFIG_HANGCHECK_TIMER is not set # # I2C support # CONFIG_I2C=y # CONFIG_I2C_CHARDEV is not set # # I2C Algorithms # CONFIG_I2C_ALGOBIT=y # CONFIG_I2C_ALGOPCF is not set # CONFIG_I2C_ALGOPCA is not set # # I2C Hardware Bus support # # CONFIG_I2C_ALI1535 is not set # CONFIG_I2C_ALI1563 is not set # CONFIG_I2C_ALI15X3 is not set # CONFIG_I2C_AMD756 is not set # CONFIG_I2C_AMD8111 is not set # CONFIG_I2C_I801 is not set # CONFIG_I2C_I810 is not set # CONFIG_I2C_ISA is not set # CONFIG_I2C_NFORCE2 is not set # CONFIG_I2C_PARPORT_LIGHT is not set # CONFIG_I2C_PIIX4 is not set # CONFIG_I2C_PROSAVAGE is not set # CONFIG_I2C_SAVAGE4 is not set # CONFIG_SCx200_ACB is not set # CONFIG_I2C_SIS5595 is not set # CONFIG_I2C_SIS630 is not set # CONFIG_I2C_SIS96X is not set # CONFIG_I2C_VIA is not set # CONFIG_I2C_VIAPRO is not set # CONFIG_I2C_VOODOO3 is not set # CONFIG_I2C_PCA_ISA is not set # # Hardware Sensors Chip support # # CONFIG_I2C_SENSOR is not set # CONFIG_SENSORS_ADM1021 is not set # CONFIG_SENSORS_ADM1025 is not set # CONFIG_SENSORS_ADM1026 is not set # CONFIG_SENSORS_ADM1031 is not set # CONFIG_SENSORS_ASB100 is not set # CONFIG_SENSORS_DS1621 is not set # CONFIG_SENSORS_FSCHER is not set # CONFIG_SENSORS_GL518SM is not set # CONFIG_SENSORS_IT87 is not set # CONFIG_SENSORS_LM63 is not set # CONFIG_SENSORS_LM75 is not set # CONFIG_SENSORS_LM77 is not set # CONFIG_SENSORS_LM78 is not set # CONFIG_SENSORS_LM80 is not set # CONFIG_SENSORS_LM83 is not set # CONFIG_SENSORS_LM85 is not set # CONFIG_SENSORS_LM87 is not set # CONFIG_SENSORS_LM90 is not set # CONFIG_SENSORS_MAX1619 is not set # CONFIG_SENSORS_PC87360 is not set # CONFIG_SENSORS_SMSC47B397 is not set # CONFIG_SENSORS_SMSC47M1 is not set # CONFIG_SENSORS_VIA686A is not set # CONFIG_SENSORS_W83781D is not set # CONFIG_SENSORS_W83L785TS is not set # CONFIG_SENSORS_W83627HF is not set # # Other I2C Chip support # # CONFIG_SENSORS_EEPROM is not set # CONFIG_SENSORS_PCF8574 is not set # CONFIG_SENSORS_PCF8591 is not set # CONFIG_SENSORS_RTC8564 is not set # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set # CONFIG_I2C_DEBUG_CHIP is not set # # Dallas's 1-wire bus # # CONFIG_W1 is not set # # Misc devices # # CONFIG_IBM_ASM is not set # # Multimedia devices # # CONFIG_VIDEO_DEV is not set # # Digital Video Broadcasting Devices # # CONFIG_DVB is not set # # Graphics support # # CONFIG_FB is not set # CONFIG_VIDEO_SELECT is not set # # Console display driver support # CONFIG_VGA_CONSOLE=y CONFIG_DUMMY_CONSOLE=y # CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound # # CONFIG_SOUND is not set # # USB support # CONFIG_USB=y # CONFIG_USB_DEBUG is not set # # Miscellaneous USB options # CONFIG_USB_DEVICEFS=y # CONFIG_USB_BANDWIDTH is not set # CONFIG_USB_DYNAMIC_MINORS is not set # CONFIG_USB_SUSPEND is not set # CONFIG_USB_OTG is not set CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y # # USB Host Controller Drivers # CONFIG_USB_EHCI_HCD=y # CONFIG_USB_EHCI_SPLIT_ISO is not set # CONFIG_USB_EHCI_ROOT_HUB_TT is not set # CONFIG_USB_OHCI_HCD is not set CONFIG_USB_UHCI_HCD=y # CONFIG_USB_SL811_HCD is not set # # USB Device Class drivers # # CONFIG_USB_BLUETOOTH_TTY is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set # # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information # CONFIG_USB_STORAGE=y # CONFIG_USB_STORAGE_DEBUG is not set # CONFIG_USB_STORAGE_RW_DETECT is not set # CONFIG_USB_STORAGE_DATAFAB is not set # CONFIG_USB_STORAGE_FREECOM is not set # CONFIG_USB_STORAGE_ISD200 is not set # CONFIG_USB_STORAGE_DPCM is not set # CONFIG_USB_STORAGE_HP8200e is not set # CONFIG_USB_STORAGE_SDDR09 is not set # CONFIG_USB_STORAGE_SDDR55 is not set # CONFIG_USB_STORAGE_JUMPSHOT is not set # # USB Input Devices # # CONFIG_USB_HID is not set # # USB HID Boot Protocol drivers # # CONFIG_USB_KBD is not set # CONFIG_USB_MOUSE is not set # CONFIG_USB_AIPTEK is not set # CONFIG_USB_WACOM is not set # CONFIG_USB_KBTAB is not set # CONFIG_USB_POWERMATE is not set # CONFIG_USB_MTOUCH is not set # CONFIG_USB_EGALAX is not set # CONFIG_USB_XPAD is not set # CONFIG_USB_ATI_REMOTE is not set # # USB Imaging devices # # CONFIG_USB_MDC800 is not set # CONFIG_USB_MICROTEK is not set # # USB Multimedia devices # # CONFIG_USB_DABUSB is not set # # Video4Linux support is needed for USB Multimedia device support # # # USB Network Adapters # # CONFIG_USB_CATC is not set # CONFIG_USB_KAWETH is not set # CONFIG_USB_PEGASUS is not set # CONFIG_USB_RTL8150 is not set # CONFIG_USB_USBNET is not set # # USB port drivers # # # USB Serial Converter support # CONFIG_USB_SERIAL=y # CONFIG_USB_SERIAL_CONSOLE is not set CONFIG_USB_SERIAL_GENERIC=y # CONFIG_USB_SERIAL_BELKIN is not set # CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set # CONFIG_USB_SERIAL_CYPRESS_M8 is not set # CONFIG_USB_SERIAL_EMPEG is not set # CONFIG_USB_SERIAL_FTDI_SIO is not set # CONFIG_USB_SERIAL_VISOR is not set # CONFIG_USB_SERIAL_IPAQ is not set # CONFIG_USB_SERIAL_IR is not set # CONFIG_USB_SERIAL_EDGEPORT is not set # CONFIG_USB_SERIAL_EDGEPORT_TI is not set # CONFIG_USB_SERIAL_GARMIN is not set # CONFIG_USB_SERIAL_IPW is not set # CONFIG_USB_SERIAL_KEYSPAN_PDA is not set # CONFIG_USB_SERIAL_KEYSPAN is not set # CONFIG_USB_SERIAL_KLSI is not set # CONFIG_USB_SERIAL_KOBIL_SCT is not set # CONFIG_USB_SERIAL_MCT_U232 is not set CONFIG_USB_SERIAL_PL2303=y # CONFIG_USB_SERIAL_SAFE is not set # CONFIG_USB_SERIAL_TI is not set # CONFIG_USB_SERIAL_CYBERJACK is not set # CONFIG_USB_SERIAL_XIRCOM is not set # CONFIG_USB_SERIAL_OMNINET is not set # # USB Miscellaneous drivers # # CONFIG_USB_EMI62 is not set # CONFIG_USB_EMI26 is not set # CONFIG_USB_AUERSWALD is not set # CONFIG_USB_RIO500 is not set # CONFIG_USB_LEGOTOWER is not set # CONFIG_USB_LCD is not set # CONFIG_USB_LED is not set # CONFIG_USB_CYTHERM is not set # CONFIG_USB_PHIDGETKIT is not set # CONFIG_USB_PHIDGETSERVO is not set # CONFIG_USB_IDMOUSE is not set # CONFIG_USB_TEST is not set # # USB ATM/DSL drivers # # # USB Gadget Support # # CONFIG_USB_GADGET is not set # # MMC/SD Card support # # CONFIG_MMC is not set # # InfiniBand support # # CONFIG_INFINIBAND is not set # # File systems # CONFIG_EXT2_FS=y CONFIG_EXT2_FS_XATTR=y CONFIG_EXT2_FS_POSIX_ACL=y # CONFIG_EXT2_FS_SECURITY is not set CONFIG_EXT3_FS=y CONFIG_EXT3_FS_XATTR=y CONFIG_EXT3_FS_POSIX_ACL=y # CONFIG_EXT3_FS_SECURITY is not set CONFIG_JBD=y # CONFIG_JBD_DEBUG is not set CONFIG_FS_MBCACHE=y # CONFIG_REISERFS_FS is not set # CONFIG_JFS_FS is not set CONFIG_FS_POSIX_ACL=y # CONFIG_XFS_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set CONFIG_DNOTIFY=y # CONFIG_AUTOFS_FS is not set # CONFIG_AUTOFS4_FS is not set # # CD-ROM/DVD Filesystems # # CONFIG_ISO9660_FS is not set # CONFIG_UDF_FS is not set # # DOS/FAT/NT Filesystems # # CONFIG_MSDOS_FS is not set # CONFIG_VFAT_FS is not set # CONFIG_NTFS_FS is not set # # Pseudo filesystems # CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y CONFIG_SYSFS=y CONFIG_DEVFS_FS=y # CONFIG_DEVFS_MOUNT is not set # CONFIG_DEVFS_DEBUG is not set # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y # CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLBFS is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y # # Miscellaneous filesystems # # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_HFSPLUS_FS is not set # CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set # CONFIG_CRAMFS is not set # CONFIG_VXFS_FS is not set # CONFIG_HPFS_FS is not set # CONFIG_QNX4FS_FS is not set # CONFIG_SYSV_FS is not set # CONFIG_UFS_FS is not set # # Network File Systems # CONFIG_NFS_FS=y CONFIG_NFS_V3=y # CONFIG_NFS_V4 is not set CONFIG_NFS_DIRECTIO=y CONFIG_NFSD=y CONFIG_NFSD_V3=y # CONFIG_NFSD_V4 is not set CONFIG_NFSD_TCP=y CONFIG_LOCKD=y CONFIG_LOCKD_V4=y CONFIG_EXPORTFS=y CONFIG_SUNRPC=y # CONFIG_RPCSEC_GSS_KRB5 is not set # CONFIG_RPCSEC_GSS_SPKM3 is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set # # Partition Types # # CONFIG_PARTITION_ADVANCED is not set CONFIG_MSDOS_PARTITION=y # # Native Language Support # # CONFIG_NLS is not set # # Profiling support # # CONFIG_PROFILING is not set # # Kernel hacking # CONFIG_DEBUG_KERNEL=y CONFIG_MAGIC_SYSRQ=y # CONFIG_SCHEDSTATS is not set # CONFIG_DEBUG_SLAB is not set # CONFIG_DEBUG_SPINLOCK is not set # CONFIG_DEBUG_SPINLOCK_SLEEP is not set # CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_HIGHMEM is not set CONFIG_DEBUG_BUGVERBOSE=y # CONFIG_DEBUG_INFO is not set # CONFIG_DEBUG_FS is not set # CONFIG_FRAME_POINTER is not set CONFIG_EARLY_PRINTK=y # CONFIG_DEBUG_STACKOVERFLOW is not set # CONFIG_KPROBES is not set # CONFIG_DEBUG_STACK_USAGE is not set # CONFIG_DEBUG_PAGEALLOC is not set # CONFIG_4KSTACKS is not set CONFIG_X86_FIND_SMP_CONFIG=y CONFIG_X86_MPPARSE=y # # Security options # # CONFIG_KEYS is not set # CONFIG_SECURITY is not set # # Cryptographic options # CONFIG_CRYPTO=y CONFIG_CRYPTO_HMAC=y CONFIG_CRYPTO_NULL=y CONFIG_CRYPTO_MD4=y CONFIG_CRYPTO_MD5=y CONFIG_CRYPTO_SHA1=y CONFIG_CRYPTO_SHA256=y CONFIG_CRYPTO_SHA512=y CONFIG_CRYPTO_WP512=y CONFIG_CRYPTO_DES=y CONFIG_CRYPTO_BLOWFISH=y CONFIG_CRYPTO_TWOFISH=y CONFIG_CRYPTO_SERPENT=y CONFIG_CRYPTO_AES_586=y CONFIG_CRYPTO_CAST5=y CONFIG_CRYPTO_CAST6=y CONFIG_CRYPTO_TEA=y CONFIG_CRYPTO_ARC4=y CONFIG_CRYPTO_KHAZAD=y CONFIG_CRYPTO_ANUBIS=y CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_MICHAEL_MIC=y CONFIG_CRYPTO_CRC32C=y # CONFIG_CRYPTO_TEST is not set # # Hardware crypto devices # # CONFIG_CRYPTO_DEV_PADLOCK is not set # # Library routines # CONFIG_CRC_CCITT=y CONFIG_CRC32=y CONFIG_LIBCRC32C=y CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y CONFIG_GENERIC_HARDIRQS=y CONFIG_GENERIC_IRQ_PROBE=y CONFIG_X86_SMP=y CONFIG_X86_HT=y CONFIG_X86_BIOS_REBOOT=y CONFIG_X86_TRAMPOLINE=y CONFIG_PC=y Linux version 2.6.11-rc1-bk8 (root@cr1) (gcc version 3.3.5 (Debian 1:3.3.5-5)) #2 SMP Fri Jan 21 14:39:25 EST 2005 BIOS-provided physical RAM map: BIOS-e820: 0000000000000000 - 000000000009f400 (usable) BIOS-e820: 000000000009f400 - 00000000000a0000 (reserved) BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved) BIOS-e820: 0000000000100000 - 000000003eff0000 (usable) BIOS-e820: 000000003eff0000 - 000000003eff3000 (ACPI NVS) BIOS-e820: 000000003eff3000 - 000000003f000000 (ACPI data) BIOS-e820: 00000000fec00000 - 0000000100000000 (reserved) 111MB HIGHMEM available. 896MB LOWMEM available. found SMP MP-table at 000f52a0 On node 0 totalpages: 258032 DMA zone: 4096 pages, LIFO batch:1 Normal zone: 225280 pages, LIFO batch:16 HighMem zone: 28656 pages, LIFO batch:6 DMI 2.3 present. ACPI: RSDP (v000 PM800 ) @ 0x000f8ab0 ACPI: RSDT (v001 PM800 AWRDACPI 0x42302e31 AWRD 0x00000000) @ 0x3eff3040 ACPI: FADT (v001 PM800 AWRDACPI 0x42302e31 AWRD 0x00000000) @ 0x3eff30c0 ACPI: MADT (v001 PM800 AWRDACPI 0x42302e31 AWRD 0x00000000) @ 0x3eff7f80 ACPI: DSDT (v001 PM800 AWRDACPI 0x00001000 MSFT 0x0100000e) @ 0x00000000 ACPI: Local APIC address 0xfee00000 ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled) Processor #0 15:2 APIC version 20 ACPI: LAPIC (acpi_id[0x01] lapic_id[0x01] enabled) Processor #1 15:2 APIC version 20 ACPI: LAPIC_NMI (acpi_id[0x00] high edge lint[0x1]) ACPI: LAPIC_NMI (acpi_id[0x01] high edge lint[0x1]) Using ACPI for processor (LAPIC) configuration information Intel MultiProcessor Specification v1.4 Virtual Wire compatibility mode. OEM ID: OEM00000 Product ID: PROD00000000 APIC at: 0xFEE00000 I/O APIC #2 Version 17 at 0xFEC00000. Enabling APIC mode: Flat. Using 1 I/O APICs Processors: 2 Built 1 zonelists Kernel command line: root=/dev/md1 ro pci=noacpi console=tty0 console=ttyS0,9600n8 mapped APIC to ffffd000 (fee00000) mapped IOAPIC to ffffc000 (fec00000) Initializing CPU#0 PID hash table entries: 4096 (order: 12, 65536 bytes) Detected 3055.467 MHz processor. Using tsc for high-res timesource Console: colour VGA+ 80x25 Dentry cache hash table entries: 131072 (order: 7, 524288 bytes) Inode-cache hash table entries: 65536 (order: 6, 262144 bytes) Memory: 1017832k/1032128k available (2694k kernel code, 13736k reserved, 1127k data, 332k init, 114624k highmem) Checking if this processor honours the WP bit even in supervisor mode... Ok. Calibrating delay loop... 5996.54 BogoMIPS (lpj=2998272) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) CPU: After generic identify, caps: bfebfbff 00000000 00000000 00000000 00004400 00000000 00000000 CPU: After vendor identify, caps: bfebfbff 00000000 00000000 00000000 00004400 00000000 00000000 CPU: Trace cache: 12K uops, L1 D cache: 8K CPU: L2 cache: 512K CPU: Physical Processor ID: 0 CPU: After all inits, caps: bfebfbff 00000000 00000000 00000080 00004400 00000000 00000000 Enabling fast FPU save and restore... done. Enabling unmasked SIMD FPU exception support... done. Checking 'hlt' instruction... OK. CPU0: Intel(R) Pentium(R) 4 CPU 3.06GHz stepping 09 per-CPU timeslice cutoff: 1462.66 usecs. task migration cache decay timeout: 2 msecs. Booting processor 1/1 eip 3000 Initializing CPU#1 Calibrating delay loop... 6094.84 BogoMIPS (lpj=3047424) CPU: After generic identify, caps: bfebfbff 00000000 00000000 00000000 00004400 00000000 00000000 CPU: After vendor identify, caps: bfebfbff 00000000 00000000 00000000 00004400 00000000 00000000 CPU: Trace cache: 12K uops, L1 D cache: 8K CPU: L2 cache: 512K CPU: Physical Processor ID: 0 CPU: After all inits, caps: bfebfbff 00000000 00000000 00000080 00004400 00000000 00000000 CPU1: Intel(R) Pentium(R) 4 CPU 3.06GHz stepping 09 Total of 2 processors activated (12091.39 BogoMIPS). ENABLING IO-APIC IRQs ..TIMER: vector=0x31 pin1=2 pin2=0 checking TSC synchronization across 2 CPUs: passed. Brought up 2 CPUs CPU0 attaching sched-domain: domain 0: span 03 groups: 01 02 domain 1: span 03 groups: 03 CPU1 attaching sched-domain: domain 0: span 03 groups: 02 01 domain 1: span 03 groups: 03 NET: Registered protocol family 16 PCI: PCI BIOS revision 2.10 entry at 0xfb020, last bus=1 PCI: Using configuration type 1 ACPI: Subsystem revision 20041210 ACPI-1138: *** Error: Method execution failed [\STRC] (Node c1904340), AE_AML_BUFFER_LIMIT ACPI-1138: *** Error: Method execution failed [\_SB_.PCI0._INI] (Node c190a980), AE_AML_BUFFER_LIMIT ACPI: Interpreter enabled ACPI: Using PIC for interrupt routing SCSI subsystem initialized usbcore: registered new driver usbfs usbcore: registered new driver hub PCI: Probing PCI hardware PCI: Probing PCI hardware (bus 00) PCI: Via IRQ fixup PCI: Via IRQ fixup PCI: Using IRQ router VIA [1106/3177] at 0000:00:11.0 PCI->APIC IRQ transform: 0000:00:09.0[A] -> IRQ 16 PCI->APIC IRQ transform: 0000:00:10.0[A] -> IRQ 21 PCI->APIC IRQ transform: 0000:00:10.1[B] -> IRQ 21 PCI->APIC IRQ transform: 0000:00:10.2[C] -> IRQ 21 PCI->APIC IRQ transform: 0000:00:10.3[D] -> IRQ 21 PCI->APIC IRQ transform: 0000:00:12.0[A] -> IRQ 23 PCI->APIC IRQ transform: 0000:01:00.0[A] -> IRQ 16 TC classifier action (bugs to netdev@oss.sgi.com cc hadi@cyberus.ca) highmem bounce pool size: 64 pages devfs: 2004-01-31 Richard Gooch (rgooch@atnf.csiro.au) devfs: boot_options: 0x0 Installing knfsd (copyright (C) 1996 okir@monad.swb.de). Initializing Cryptographic API ACPI: Power Button (FF) [PWRF] ACPI: Sleep Button (CM) [SLPB] ibm_acpi: ec object not found Generic RTC Driver v1.07 Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing disabled ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A io scheduler noop registered io scheduler anticipatory registered io scheduler deadline registered io scheduler cfq registered loop: loaded (max 8 devices) nbd: registered device at major 43 Ethernet Channel Bonding Driver: v2.6.1 (October 29, 2004) bonding: Warning: either miimon or arp_interval and arp_ip_target module parameters must be specified, otherwise bonding will not detect link failures! see bonding.txt for details. acenic.c: v0.92 08/05/2002 Jes Sorensen, linux-acenic@SunSITE.dk http://home.cern.ch/~jes/gige/acenic.html 0000:00:09.0: NetGear GA620 Gigabit Ethernet at 0xee000000, irq 16 Tigon II (Rev. 6), Firmware: 12.4.11, MAC: 00:02:e3:00:09:31 PCI cache line size set incorrectly (32 bytes) by BIOS/FW, correcting to 128 PCI bus width: 32 bits, speed: 33MHz, latency: 64 clks 0000:00:09.0: Firmware up and running ns83820.c: National Semiconductor DP83820 10/100/1000 driver. eth0: Optical link UP (Full Duplex, Flow Control: ) via-rhine.c:v1.10-LK1.2.0-2.6 June-10-2004 Written by Donald Becker eth1: VIA Rhine II at 0x1e400, 00:50:70:c8:57:92, IRQ 23. eth1: MII PHY found at address 1, status 0x786d advertising 05e1 Link 45e1. PPP generic driver version 2.4.2 PPP Deflate Compression module registered PPP BSD Compression module registered MPPE/MPPC encryption/compression module registered tun: Universal TUN/TAP device driver, 1.6 tun: (C) 1999-2004 Max Krasnyansky Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx VP_IDE: IDE controller at PCI slot 0000:00:11.1 VP_IDE: chipset revision 6 VP_IDE: not 100% native mode: will probe irqs later VP_IDE: VIA vt8235 (rev 00) IDE UDMA133 controller on pci0000:00:11.1 ide0: BM-DMA at 0xe300-0xe307, BIOS settings: hda:DMA, hdb:DMA ide1: BM-DMA at 0xe308-0xe30f, BIOS settings: hdc:DMA, hdd:pio Probing IDE interface ide0... hda: SAMSUNG SP1203N, ATA DISK drive hdb: SAMSUNG SP1203N, ATA DISK drive ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 Probing IDE interface ide1... hdc: SAMSUNG SP1203N, ATA DISK drive ide1 at 0x170-0x177,0x376 on irq 15 Probing IDE interface ide2... Probing IDE interface ide3... Probing IDE interface ide4... Probing IDE interface ide5... hda: max request size: 1024KiB hda: Host Protected Area detected. current capacity is 234490943 sectors (120059 MB) native capacity is 234493056 sectors (120060 MB) hda: Host Protected Area disabled. hda: 234493056 sectors (120060 MB) w/2048KiB Cache, CHS=16383/255/63, UDMA(100) hda: cache flushes supported /dev/ide/host0/bus0/target0/lun0: p1 p2 p3 hdb: max request size: 1024KiB hdb: 234493056 sectors (120060 MB) w/2048KiB Cache, CHS=16383/255/63, UDMA(100) hdb: cache flushes supported /dev/ide/host0/bus0/target1/lun0: p1 p2 p3 hdc: max request size: 1024KiB hdc: 234493056 sectors (120060 MB) w/2048KiB Cache, CHS=16383/255/63, UDMA(100) hdc: cache flushes supported /dev/ide/host0/bus1/target0/lun0: p1 p2 p3 ehci_hcd 0000:00:10.3: VIA Technologies, Inc. USB 2.0 ehci_hcd 0000:00:10.3: irq 21, pci mem 0xee004000 ehci_hcd 0000:00:10.3: new USB bus registered, assigned bus number 1 ehci_hcd 0000:00:10.3: USB 2.0 initialized, EHCI 1.00, driver 10 Dec 2004 hub 1-0:1.0: USB hub found hub 1-0:1.0: 6 ports detected USB Universal Host Controller Interface driver v2.2 uhci_hcd 0000:00:10.0: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller uhci_hcd 0000:00:10.0: irq 21, io base 0xe000 uhci_hcd 0000:00:10.0: new USB bus registered, assigned bus number 2 hub 2-0:1.0: USB hub found hub 2-0:1.0: 2 ports detected uhci_hcd 0000:00:10.1: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (#2) uhci_hcd 0000:00:10.1: irq 21, io base 0xe100 uhci_hcd 0000:00:10.1: new USB bus registered, assigned bus number 3 hub 3-0:1.0: USB hub found hub 3-0:1.0: 2 ports detected uhci_hcd 0000:00:10.2: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (#3) uhci_hcd 0000:00:10.2: irq 21, io base 0xe200 uhci_hcd 0000:00:10.2: new USB bus registered, assigned bus number 4 hub 4-0:1.0: USB hub found hub 4-0:1.0: 2 ports detected Initializing USB Mass Storage driver... usbcore: registered new driver usb-storage USB Mass Storage support registered. drivers/usb/serial/usb-serial.c: USB Serial support registered for Generic usbcore: registered new driver usbserial_generic usbcore: registered new driver usbserial drivers/usb/serial/usb-serial.c: USB Serial Driver core v2.0 drivers/usb/serial/usb-serial.c: USB Serial support registered for PL-2303 usbcore: registered new driver pl2303 drivers/usb/serial/pl2303.c: Prolific PL2303 USB to serial adaptor driver v0.12 mice: PS/2 mouse device common for all mice md: linear personality registered as nr 1 md: raid0 personality registered as nr 2 md: raid1 personality registered as nr 3 md: raid5 personality registered as nr 4 raid5: automatically using best checksumming function: pIII_sse pIII_sse : 3980.000 MB/sec raid5: using function: pIII_sse (3980.000 MB/sec) md: multipath personality registered as nr 7 md: md driver 0.90.1 MAX_MD_DEVS=256, MD_SB_DISKS=27 GACT probability on Mirror/redirect action on u32 classifier Actions configured NET: Registered protocol family 2 IP: routing cache hash table of 8192 buckets, 64Kbytes TCP established hash table entries: 131072 (order: 8, 1048576 bytes) TCP bind hash table entries: 65536 (order: 7, 524288 bytes) TCP: Hash tables configured (established 131072 bind 65536) IPv4 over IPv4 tunneling driver GRE over IPv4 tunneling driver ip_conntrack version 2.1 (8063 buckets, 64504 max) - 300 bytes per conntrack ip_tables: (C) 2000-2002 Netfilter core team ipt_recent v0.3.1: Stephen Frost . http://snowman.net/projects/ipt_recent/ ClusterIP Version 0.6 loaded successfully arp_tables: (C) 2002 David S. Miller IPVS: Registered protocols (TCP, UDP, AH, ESP) IPVS: Connection hash table configured (size=4096, memory=32Kbytes) IPVS: ipvs loaded. IPVS: [rr] scheduler registered. IPVS: [wrr] scheduler registered. IPVS: [lc] scheduler registered. IPVS: [wlc] scheduler registered. IPVS: [lblc] scheduler registered. IPVS: [lblcr] scheduler registered. IPVS: [dh] scheduler registered. IPVS: [sh] scheduler registered. IPVS: [sed] scheduler registered. IPVS: [nq] scheduler registered. Initializing IPsec netlink socket NET: Registered protocol family 1 NET: Registered protocol family 17 NET: Registered protocol family 15 Bridge firewalling registered Ebtables v2.0 registered 802.1Q VLAN Support v1.8 Ben Greear All bugs added by David S. Miller Starting balanced_irq ACPI wakeup devices: SLPB PCI0 USB3 USB4 USB5 USB6 LAN0 AC97 UAR1 ACPI: (supports S0 S1 S4 S5) md: Autodetecting RAID arrays. md: autorun ... md: considering hdc3 ... md: adding hdc3 ... md: hdc1 has different UUID to hdc3 md: adding hdb3 ... md: hdb1 has different UUID to hdc3 md: adding hda3 ... md: hda1 has different UUID to hdc3 md: created md1 md: bind md: bind md: bind md: running: raid5: device hdc3 operational as raid disk 2 raid5: device hdb3 operational as raid disk 1 raid5: device hda3 operational as raid disk 0 raid5: allocated 3155kB for md1 raid5: raid level 5 set md1 active with 3 out of 3 devices, algorithm 2 RAID5 conf printout: --- rd:3 wd:3 fd:0 disk 0, o:1, dev:hda3 disk 1, o:1, dev:hdb3 disk 2, o:1, dev:hdc3 md: considering hdc1 ... md: adding hdc1 ... md: adding hdb1 ... md: adding hda1 ... md: created md0 md: bind md: bind md: bind md: running: raid1: raid set md0 active with 3 out of 3 mirrors md: ... autorun DONE. EXT3-fs: INFO: recovery required on readonly filesystem. EXT3-fs: write access will be enabled during recovery. kjournald starting. Commit interval 5 seconds EXT3-fs: recovery complete. EXT3-fs: mounted filesystem with ordered data mode. VFS: Mounted root (ext3 filesystem) readonly. Freeing unused kernel memory: 332k freed Adding 979956k swap on /dev/hda2. Priority:1 extents:1 Adding 979956k swap on /dev/hdb2. Priority:1 extents:1 Adding 979956k swap on /dev/hdc2. Priority:1 extents:1 EXT3 FS on md1, internal journal kjournald starting. Commit interval 5 seconds EXT3 FS on md0, internal journal EXT3-fs: mounted filesystem with ordered data mode. device eth0.100 entered promiscuous mode eth0.100: dev_set_promiscuity(master, 1) device eth0 entered promiscuous mode eth0.100: add 01:00:5e:00:00:01 mcast address to master interface eth1: link up, 100Mbps, full-duplex, lpa 0x45E1 device eth1.100 entered promiscuous mode eth1.100: dev_set_promiscuity(master, 1) eth1: Promiscuous mode enabled. device eth1 entered promiscuous mode eth1: Promiscuous mode enabled. eth1.100: add 01:00:5e:00:00:01 mcast address to master interface vlan100: port 2(eth1.100) entering listening state vlan100: port 1(eth0.100) entering listening state vlan100: port 2(eth1.100) entering blocking state vlan100: port 1(eth0.100) entering learning state vlan100: topology change detected, propagating vlan100: port 1(eth0.100) entering forwarding state eth0.101: dev_set_promiscuity(master, 1) eth0.101: add 01:00:5e:00:00:01 mcast address to master interface eth1.101: dev_set_promiscuity(master, 1) eth1.101: add 01:00:5e:00:00:01 mcast address to master interface vlan101: port 2(eth1.101) entering listening state vlan101: port 1(eth0.101) entering listening state vlan101: port 2(eth1.101) entering blocking state vlan101: port 1(eth0.101) entering learning state vlan101: topology change detected, propagating vlan101: port 1(eth0.101) entering forwarding state eth0.102: dev_set_promiscuity(master, 1) eth0.102: add 01:00:5e:00:00:01 mcast address to master interface eth1.102: dev_set_promiscuity(master, 1) eth1.102: add 01:00:5e:00:00:01 mcast address to master interface vlan102: port 2(eth1.102) entering listening state vlan102: port 1(eth0.102) entering listening state vlan102: port 2(eth1.102) entering blocking state vlan102: port 1(eth0.102) entering learning state vlan102: topology change detected, propagating vlan102: port 1(eth0.102) entering forwarding state eth0.200: dev_set_promiscuity(master, 1) eth0.200: add 01:00:5e:00:00:01 mcast address to master interface eth1.200: dev_set_promiscuity(master, 1) eth1.200: add 01:00:5e:00:00:01 mcast address to master interface vlan200: port 2(eth1.200) entering listening state vlan200: port 1(eth0.200) entering listening state vlan200: port 2(eth1.200) entering blocking state vlan200: port 1(eth0.200) entering learning state vlan200: topology change detected, propagating vlan200: port 1(eth0.200) entering forwarding state eth0.201: dev_set_promiscuity(master, 1) eth0.201: add 01:00:5e:00:00:01 mcast address to master interface eth1.201: dev_set_promiscuity(master, 1) eth1.201: add 01:00:5e:00:00:01 mcast address to master interface vlan201: port 2(eth1.201) entering listening state vlan201: port 1(eth0.201) entering listening state vlan201: port 2(eth1.201) entering blocking state vlan201: port 1(eth0.201) entering learning state vlan201: topology change detected, propagating vlan201: port 1(eth0.201) entering forwarding state eth0.300: dev_set_promiscuity(master, 1) eth0.300: add 01:00:5e:00:00:01 mcast address to master interface eth1.300: dev_set_promiscuity(master, 1) eth1.300: add 01:00:5e:00:00:01 mcast address to master interface vlan300: port 2(eth1.300) entering listening state vlan300: port 1(eth0.300) entering listening state vlan300: port 2(eth1.300) entering blocking state vlan300: port 1(eth0.300) entering learning state vlan300: topology change detected, propagating vlan300: port 1(eth0.300) entering forwarding state eth0.301: dev_set_promiscuity(master, 1) eth0.301: add 01:00:5e:00:00:01 mcast address to master interface eth1.301: dev_set_promiscuity(master, 1) eth1.301: add 01:00:5e:00:00:01 mcast address to master interface vlan301: port 2(eth1.301) entering listening state vlan301: port 1(eth0.301) entering listening state vlan301: port 2(eth1.301) entering blocking state vlan301: port 1(eth0.301) entering learning state vlan301: topology change detected, propagating vlan301: port 1(eth0.301) entering forwarding state eth0.302: dev_set_promiscuity(master, 1) eth0.302: add 01:00:5e:00:00:01 mcast address to master interface eth1.302: dev_set_promiscuity(master, 1) eth1.302: add 01:00:5e:00:00:01 mcast address to master interface vlan302: port 2(eth1.302) entering listening state vlan302: port 1(eth0.302) entering listening state vlan302: port 2(eth1.302) entering blocking state vlan302: port 1(eth0.302) entering learning state vlan302: topology change detected, propagating vlan302: port 1(eth0.302) entering forwarding state eth0.303: dev_set_promiscuity(master, 1) eth0.303: add 01:00:5e:00:00:01 mcast address to master interface eth1.303: dev_set_promiscuity(master, 1) eth1.303: add 01:00:5e:00:00:01 mcast address to master interface vlan303: port 2(eth1.303) entering listening state vlan303: port 1(eth0.303) entering listening state vlan303: port 2(eth1.303) entering blocking state vlan303: port 1(eth0.303) entering learning state vlan303: topology change detected, propagating vlan303: port 1(eth0.303) entering forwarding state ttyS1: LSR safety check engaged! ttyS1: LSR safety check engaged! David -- David J. Coulson email: david@davidcoulson.net web: http://www.davidcoulson.net/ phone: (216) 920-3100 / (216) 258-4942 From david@davidcoulson.net Mon Jan 24 06:49:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 06:49:40 -0800 (PST) Received: from mail.mx.davidcoulson.net (ns1.openconsultancy.com [207.166.203.131]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0OEnG5k017413 for ; Mon, 24 Jan 2005 06:49:35 -0800 Received: (qmail 29778 invoked for bounce); 24 Jan 2005 14:49:11 +0000 Received: from unknown (HELO mx3.openconsultancy.com) (qmailr@10.2.0.36) by tailtiu.dmz.davidcoulson.net (qmail 1.03-djc-2) with SMTP; 24 Jan 2005 14:49:11 +0000 Received: (qmail 30901 invoked from network); 24 Jan 2005 14:49:10 -0000 Received: from unknown (HELO ?10.6.1.3?) (10.6.1.3) by vlan-102.core.davidcoulson.net with SMTP; 24 Jan 2005 14:49:10 -0000 Message-ID: <41F50AE8.1000800@davidcoulson.net> Date: Mon, 24 Jan 2005 09:49:12 -0500 From: David Coulson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Patrick McHardy CC: Thomas Graf , Herbert Xu , "David S. Miller" , netdev@oss.sgi.com Subject: Re: skb_checksum_help References: <20050124005348.GL23931@postel.suug.ch> <20050123202715.281ac87c.davem@davemloft.net> <20050124045635.GA30372@gondor.apana.org.au> <41F48293.9050301@trash.net> <20050124122247.GQ23931@postel.suug.ch> <41F4F37F.3070000@trash.net> In-Reply-To: <41F4F37F.3070000@trash.net> X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 709 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: david@davidcoulson.net Precedence: bulk X-list: netdev Content-Length: 408 Lines: 16 Patrick McHardy wrote: > What about modules, .config, ... ? No kernel module support on the box. Only non-standard patch, was the mppe/mppc patch which isn't being used right now (It's turned on in the kernel config however). I attached the .config to a previous e-mail. David -- David J. Coulson email: david@davidcoulson.net web: http://www.davidcoulson.net/ phone: (216) 920-3100 / (216) 258-4942 From david@davidcoulson.net Mon Jan 24 06:51:29 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 06:51:34 -0800 (PST) Received: from mail.mx.davidcoulson.net (ns1.openconsultancy.com [207.166.203.131]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0OEpSTj017874 for ; Mon, 24 Jan 2005 06:51:29 -0800 Received: (qmail 32456 invoked for bounce); 24 Jan 2005 14:51:22 +0000 Received: from unknown (HELO mx3.openconsultancy.com) (qmailr@10.2.0.36) by tailtiu.dmz.davidcoulson.net (qmail 1.03-djc-2) with SMTP; 24 Jan 2005 14:51:22 +0000 Received: (qmail 31026 invoked from network); 24 Jan 2005 14:51:22 -0000 Received: from unknown (HELO ?10.6.1.3?) (10.6.1.3) by vlan-102.core.davidcoulson.net with SMTP; 24 Jan 2005 14:51:22 -0000 Message-ID: <41F50B6C.6010107@davidcoulson.net> Date: Mon, 24 Jan 2005 09:51:24 -0500 From: David Coulson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Thomas Graf CC: "David S. Miller" , Herbert Xu , kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help References: <20050124005348.GL23931@postel.suug.ch> <20050123202715.281ac87c.davem@davemloft.net> <20050124121610.GP23931@postel.suug.ch> In-Reply-To: <20050124121610.GP23931@postel.suug.ch> X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 710 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: david@davidcoulson.net Precedence: bulk X-list: netdev Content-Length: 630 Lines: 25 Thomas Graf wrote: > Yes, this might clear things up. 10.1.1.5 is a production NS, so there is >500kbit/sec of DNS traffic to the box. Do you want me to restrict tcpdump to the /24 we were seeing traffic from which broke the kernel, or dump everything and send the part from around when the kernel fails? > David, can you do this? and fix my patch by changing > > if (skb->h.raw < skb->data || skb->h.raw > skb->data) > into: > if (skb->h.raw < skb->data || skb->h.raw > skb->tail) Done David -- David J. Coulson email: david@davidcoulson.net web: http://www.davidcoulson.net/ phone: (216) 920-3100 / (216) 258-4942 From MAILER-DAEMON Mon Jan 24 06:59:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 06:59:09 -0800 (PST) Received: from oceanite.ens-lyon.fr (oceanite.ens-lyon.fr [140.77.1.22]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0OEx27p018624 for ; Mon, 24 Jan 2005 06:59:02 -0800 Received: from localhost (oceanite.ens-lyon.fr [127.0.0.1]) by oceanite.ens-lyon.fr (Postfix) with ESMTP id EB2C0320300; Mon, 24 Jan 2005 15:51:47 +0100 (CET) Received: from oceanite.ens-lyon.fr ([127.0.0.1]) by localhost (oceanite [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 30795-03; Mon, 24 Jan 2005 15:51:47 +0100 (CET) Received: from arakou (arakou.residence.ens-lyon.fr [140.77.129.107]) by oceanite.ens-lyon.fr (Postfix) with ESMTP id B62E232022E; Mon, 24 Jan 2005 15:51:47 +0100 (CET) Date: Mon, 24 Jan 2005 15:58:40 +0100 From: Benoit Boissinot To: Andrew Morton Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: 2.6.11-rc2-mm1 Message-ID: <20050124145840.GA10211@ens-lyon.fr> References: <20050124021516.5d1ee686.akpm@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050124021516.5d1ee686.akpm@osdl.org> User-Agent: Mutt/1.5.6i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ens-lyon.fr X-Virus-Status: Clean X-archive-position: 711 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: benoit.boissinot@ens-lyon.org Precedence: bulk X-list: netdev Content-Length: 1795 Lines: 53 On Mon, Jan 24, 2005 at 02:15:16AM -0800, Andrew Morton wrote: > > ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.11-rc1/2.6.11-rc1-mm1/ > > > - Lots of updates and fixes all over the place. > > - On my test box there is no flashing cursor on the vga console. Known bug, > please don't report it. > > Binary searching shows that the bug was introduced by > cleanup-vc-array-access.patch but that patch is, unfortunately, huge. > > > > Changes since 2.6.11-rc1-mm2: > > > bk-netdev.patch Without the following patch, it doesn't compile with ip_conntrack and without ip_nat. In file included from net/ipv4/netfilter/ip_conntrack_standalone.c:34: include/linux/netfilter_ipv4/ip_conntrack.h:306: error: parameter `manip' has incomplete type include/linux/netfilter_ipv4/ip_conntrack.h: In function `ip_nat_initialized': include/linux/netfilter_ipv4/ip_conntrack.h:307: error: `IP_NAT_MANIP_SRC' undeclared (first use in this function) regards, Benoit Signed-off-by: Benoit Boissinot --- linux-clean/include/linux/netfilter_ipv4/ip_conntrack.h 2005-01-24 12:44:29.000000000 +0100 +++ linux/include/linux/netfilter_ipv4/ip_conntrack.h 2005-01-24 13:05:44.000000000 +0100 @@ -301,6 +301,7 @@ struct ip_conntrack_stat #define CONNTRACK_STAT_INC(count) (__get_cpu_var(ip_conntrack_stat).count++) +#ifdef CONFIG_IP_NF_NAT_NEEDED static inline int ip_nat_initialized(struct ip_conntrack *conntrack, enum ip_nat_manip_type manip) { @@ -308,5 +309,6 @@ static inline int ip_nat_initialized(str return test_bit(IPS_SRC_NAT_DONE_BIT, &conntrack->status); return test_bit(IPS_DST_NAT_DONE_BIT, &conntrack->status); } +#endif /* CONFIG_IP_NF_NAT_NEEDED */ #endif /* __KERNEL__ */ #endif /* _IP_CONNTRACK_H */ From tgraf@suug.ch Mon Jan 24 07:06:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 07:06:20 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0OF6EHH019294 for ; Mon, 24 Jan 2005 07:06:15 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 680C885; Mon, 24 Jan 2005 16:05:51 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 621911C0EA; Mon, 24 Jan 2005 16:06:34 +0100 (CET) Date: Mon, 24 Jan 2005 16:06:34 +0100 From: Thomas Graf To: jamal Cc: Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com, Werner Almesberger Subject: Re: [RFC] batched tc to improve change throughput Message-ID: <20050124150634.GT23931@postel.suug.ch> References: <20050117165626.GE26856@postel.suug.ch> <1106002197.1046.19.camel@jzny.localdomain> <20050118134406.GR26856@postel.suug.ch> <1106058592.1035.95.camel@jzny.localdomain> <20050118145830.GS26856@postel.suug.ch> <1106144009.1047.989.camel@jzny.localdomain> <20050119165421.GB26856@postel.suug.ch> <1106232168.1041.125.camel@jzny.localdomain> <20050120153559.GG26856@postel.suug.ch> <1106576005.1652.1292.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1106576005.1652.1292.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 712 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 2526 Lines: 65 * jamal <1106576005.1652.1292.camel@jzny.localdomain> 2005-01-24 09:13 > On Thu, 2005-01-20 at 10:35, Thomas Graf wrote: > > > > - Seq counter in netlink, increased evertime a netlink message > > > > gets processed and returned in ack. A netlink request may contain > > > > a flag and the expected sequence number and the request gets only > > > > processed if they match, otherwise the request fails. (my favourite) > > > > Do you have any objections on this? > > A seq number in netlink is infact a transaction identifier (as opposed > to a message identifier). We also have a window of 1 for a very good > reason - simplicty. > If what you are saying is we muck around seq numbers, i think its a bad > idea. I'm not talking of the nlmsg_seq but rather a a sequence number with global or nl_family scope. It gets increased whenever a netlink message of that family is processed and is returned with the ack. If a userspace application wants to enforce atomicy between two requests which cannot be batched because a answer is expected in between then it could provide the expected sequence number and the request is only fullfilled if this is true. Example: --> RTM_NEWLINK <-- answer <-- ACK (seq = 222) --> RTM_SETLINK (expect = 222) <-- ACK Now if another netlink app interfers: --> RTM_NEWLINK <-- answer <-- ACK (seq = 222) -- other app -- --> RTM_SETLINK <-- ACK (seq = 223) -- back to first app -- --> RTM_SETLINK (expect = 222) <-- ERROR The application can then retry it's operation a few times and finally give up. The main problem I see is to extend nlmsghdr in a way it stays compatible. > My thoughts now are you need to build on top of libnetlink - another > library. Example, to administratively bring up a netdevice, one would > call something like > > admin_up("eth0"); > > This is not to say you cant build a competing library to libnetlink, i > am just not sure it is worth the effort of having two competing > libraries doing almost the same thing (that need maintanance). I think it is, the feedback is overwhelming and people are already contributing to support more netlink users. As I said, 95% of the functionality is in iproute2 itself and not libnetlink. It is vital to have some kind of library to abstract the low level netlink functionality in a simple form to other applications. Currently it's quite hard to for example access the tc class tree, one can use libnetlink to do the request and parse the answer but everyone needs to write their own TLV parsing routines. From tgraf@suug.ch Mon Jan 24 07:14:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 07:14:58 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0OFEqmj020270 for ; Mon, 24 Jan 2005 07:14:52 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 4B72E85; Mon, 24 Jan 2005 16:14:29 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 2130C1C0EA; Mon, 24 Jan 2005 16:15:11 +0100 (CET) Date: Mon, 24 Jan 2005 16:15:10 +0100 From: Thomas Graf To: David Coulson Cc: "David S. Miller" , Herbert Xu , kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-ID: <20050124151510.GV23931@postel.suug.ch> References: <20050124005348.GL23931@postel.suug.ch> <20050123202715.281ac87c.davem@davemloft.net> <20050124121610.GP23931@postel.suug.ch> <41F50B6C.6010107@davidcoulson.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F50B6C.6010107@davidcoulson.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 713 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 838 Lines: 16 * David Coulson <41F50B6C.6010107@davidcoulson.net> 2005-01-24 09:51 > Thomas Graf wrote: > >Yes, this might clear things up. > > 10.1.1.5 is a production NS, so there is >500kbit/sec of DNS traffic to > the box. Do you want me to restrict tcpdump to the /24 we were seeing > traffic from which broke the kernel, or dump everything and send the > part from around when the kernel fails? After inspecting your iptables rule set I think it is a general UDP DNAT problem under some circumstances. Some defragmentation weirdness in prerouting might be invovled. It would definitely help to have a dump of a complete ip fragments sequence causing this bug but I can't tell what exactly is the cause just now so yes it might be a good idea to limit the dump to the above subnet and hope the dodgy traffic comes from the same subnet again. From david@davidcoulson.net Mon Jan 24 07:27:51 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 07:27:56 -0800 (PST) Received: from mail.mx.davidcoulson.net (ns1.openconsultancy.com [207.166.203.131]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0OFRpNn021220 for ; Mon, 24 Jan 2005 07:27:51 -0800 Received: (qmail 26467 invoked for bounce); 24 Jan 2005 15:27:45 +0000 Received: from unknown (HELO mx3.openconsultancy.com) (qmailr@10.2.0.36) by tailtiu.dmz.davidcoulson.net (qmail 1.03-djc-2) with SMTP; 24 Jan 2005 15:27:45 +0000 Received: (qmail 31803 invoked from network); 24 Jan 2005 15:27:44 -0000 Received: from unknown (HELO ?10.6.1.3?) (10.6.1.3) by vlan-102.core.davidcoulson.net with SMTP; 24 Jan 2005 15:27:44 -0000 Message-ID: <41F513F3.7000708@davidcoulson.net> Date: Mon, 24 Jan 2005 10:27:47 -0500 From: David Coulson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Thomas Graf CC: "David S. Miller" , Herbert Xu , kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help References: <20050124005348.GL23931@postel.suug.ch> <20050123202715.281ac87c.davem@davemloft.net> <20050124121610.GP23931@postel.suug.ch> <41F50B6C.6010107@davidcoulson.net> <20050124151510.GV23931@postel.suug.ch> In-Reply-To: <20050124151510.GV23931@postel.suug.ch> X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 714 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: david@davidcoulson.net Precedence: bulk X-list: netdev Content-Length: 776 Lines: 22 Thomas Graf wrote: > After inspecting your iptables rule set I think it is a general UDP DNAT > problem under some circumstances. Some defragmentation weirdness in > prerouting might be invovled. It would definitely help to have a dump > of a complete ip fragments sequence causing this bug but I can't tell > what exactly is the cause just now so yes it might be a good idea to > limit the dump to the above subnet and hope the dodgy traffic comes > from the same subnet again. cr1:~# tcpdump -nxxli vlan102 net 211.32.117.0/24 and port 53 > tcpdump.txt I assume that 'xx' is sufficient to dump all of the packet/link information we need? David -- David J. Coulson email: david@davidcoulson.net web: http://www.davidcoulson.net/ phone: (216) 920-3100 / (216) 258-4942 From bunk@stusta.de Mon Jan 24 11:36:34 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 11:36:39 -0800 (PST) Received: from mailout.stusta.mhn.de (emailhub.stusta.mhn.de [141.84.69.5]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0OJaWRH002484 for ; Mon, 24 Jan 2005 11:36:33 -0800 Received: (qmail 23130 invoked from network); 24 Jan 2005 19:36:26 -0000 Received: from r063144.stusta.swh.mhn.de (10.150.63.144) by mailout.stusta.mhn.de with SMTP; 24 Jan 2005 19:36:26 -0000 Received: by r063144.stusta.swh.mhn.de (Postfix, from userid 1000) id DF002BB543; Mon, 24 Jan 2005 20:36:24 +0100 (CET) Date: Mon, 24 Jan 2005 20:36:24 +0100 From: Adrian Bunk To: Andrew Morton Cc: Jesper Juhl , linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: [2.6 patch] kernel-api.sgml references removed file net_init.c Message-ID: <20050124193624.GS3515@stusta.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 715 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bunk@stusta.de Precedence: bulk X-list: netdev Content-Length: 1326 Lines: 34 This patch by Jesper Juhl is still required in 2.6.11-rc2-mm1. make mandocs fails with these errors in 2.6.10-bk2 : juhl@dragon:~/download/kernel/linux-2.6.10-bk2$ make mandocs DOCPROC Documentation/DocBook/kernel-api.sgml docproc: /home/juhl/download/kernel/linux-2.6.10-bk2/drivers/net/net_init.c: No such file or directory /bin/sh: line 1: 4845 Segmentation fault SRCTREE=/home/juhl/download/kernel/linux-2.6.10-bk2/ scripts/basic/docproc doc Documentation/DocBook/kernel-api.tmpl >Documentation/DocBook/kernel-api.sgml make[1]: *** [Documentation/DocBook/kernel-api.sgml] Error 139 make: *** [mandocs] Error 2 removing the reference to net_init.c makes it continue a bit further but it still ends up failing with these errors : make[1]: *** [Documentation/DocBook/kernel-api.sgml] Error 1 make: *** [mandocs] Error 2 Signed-off-by: Adrian Bunk --- linux-2.6.10-bk2-orig/Documentation/DocBook/kernel-api.tmpl 2004-12-24 22:33:48.000000000 +0100 +++ linux-2.6.10-bk2/Documentation/DocBook/kernel-api.tmpl 2004-12-31 01:33:53.000000000 +0100 @@ -143,7 +143,6 @@ Network device support Driver Support -!Edrivers/net/net_init.c !Enet/core/dev.c 8390 Based Network Cards From rick.jones2@hp.com Mon Jan 24 12:35:24 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 12:35:28 -0800 (PST) Received: from palrel11.hp.com (palrel11.hp.com [156.153.255.246]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0OKZNSp010091 for ; Mon, 24 Jan 2005 12:35:24 -0800 Received: from tardy.cup.hp.com (tardy.cup.hp.com [15.244.44.58]) by palrel11.hp.com (Postfix) with ESMTP id 8C2B91E016 for ; Mon, 24 Jan 2005 12:33:24 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by tardy.cup.hp.com (8.9.3 (PHNE_28810)/8.9.3 SMKit7.02) with ESMTP id MAA09959 for ; Mon, 24 Jan 2005 12:33:23 -0800 (PST) Message-ID: <41F55B93.6040603@hp.com> Date: Mon, 24 Jan 2005 12:33:23 -0800 From: Rick Jones User-Agent: Mozilla/5.0 (X11; U; HP-UX 9000/785; en-US; rv:1.7.3) Gecko/20041206 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: Re: on the wire behaviour of TSO on/off is supposed to be the same yes? References: <41F1516D.5010101@hp.com> <200501211358.53783.jdmason@us.ibm.com> <41F163AD.5070400@hp.com> <20050121124441.76cbbfb9.davem@davemloft.net> <41F17B7E.2020002@hp.com> <20050121141820.7d59a2d1.davem@davemloft.net> <41F186A8.9030805@hp.com> <20050121204948.034b2510.davem@davemloft.net> In-Reply-To: <20050121204948.034b2510.davem@davemloft.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 716 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rick.jones2@hp.com Precedence: bulk X-list: netdev Content-Length: 2324 Lines: 52 > The code can potentially get really messy and ugly if we start > preemptively building larger frames "hoping" the cwnd will be > large enough by the time we push it onto the wire. Segmenting > at send time is completely upside down to the way packets are > built currently for transmission. A bad guess also means that > we'll spend significant cycles chopping up TSO packets and > resegmenting the queue. Just some pseudo-random thoughts which may or may not hold true in the context of Linux TSO, and may or may not show my utter ignorance of current cwnd behaviour :) *) At present the code executed at time of user send knows about the cwnd at the time of user send. It then builds some number of TSO-sized segements and queues them *) "Classic" cwnd behaviour is either: a) Increasing rapidly to ssthresh b) Increasing slowly after ssthresh c) Restarting from initial values after timeout (IIRC there is other cwnd manipulation for fast rtxes and the like) *) If there is a timeout, any previously queued TSO-sized segments are going to have to be resegmented anyway no matter what their size was before the timeout. So conservative versus optimistic guesses there would not seem to matter. *) If there is a fast rtx and the like, any previously queued TSO-sized segments may very likely (not certain though) have to be resegmented, particularly if they were queued when cwnd was >= ssthresh *) If cwnd is < ssthresh, the next cwnd is going to be > current cwnd unless there is a retransmission of some sort. *) If cwnd is >= ssthresh, cwnd will remain cwnd for some time (compared to otherwise) It would seem that the segmentation code, if it knew ssthresh as well as cwnd _could_ make some reasonably optimistic guesses as to cwnd growth while doing its segmentation. Guesses that wouldn't seem to be any worse than they would be at present if there is a full RTO at least. And if the tcp_tso_win_divisor is > 1, it is possible that even the onesey-twosies of fast rtx may not require all _that_ much resegmentation? of have I just gone-off into the deep-end? rick jones BTW, speaking of tcp_tso_win_divisor, I've gone back through my traces and they do not support my recollection, so I must have been confused as to what I was looking-at when I got that impression. From davem@davemloft.net Mon Jan 24 12:47:16 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 12:47:21 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0OKlF3D010758 for ; Mon, 24 Jan 2005 12:47:16 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CtB3x-0005Pj-00; Mon, 24 Jan 2005 12:43:53 -0800 Date: Mon, 24 Jan 2005 12:43:53 -0800 From: "David S. Miller" To: Rick Jones Cc: netdev@oss.sgi.com Subject: Re: on the wire behaviour of TSO on/off is supposed to be the same yes? Message-Id: <20050124124353.2f760e1a.davem@davemloft.net> In-Reply-To: <41F55B93.6040603@hp.com> References: <41F1516D.5010101@hp.com> <200501211358.53783.jdmason@us.ibm.com> <41F163AD.5070400@hp.com> <20050121124441.76cbbfb9.davem@davemloft.net> <41F17B7E.2020002@hp.com> <20050121141820.7d59a2d1.davem@davemloft.net> <41F186A8.9030805@hp.com> <20050121204948.034b2510.davem@davemloft.net> <41F55B93.6040603@hp.com> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 717 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 580 Lines: 15 On Mon, 24 Jan 2005 12:33:23 -0800 Rick Jones wrote: > It would seem that the segmentation code, if it knew ssthresh as well as cwnd > _could_ make some reasonably optimistic guesses as to cwnd growth while doing > its segmentation. Becuase we disable TSO on any packet loss whatsoever, we can predict exactly what the CWND will be at the time a packet is sent. I've been quiet the past few days, but this is the kind of implementation I've been thinking of. When we take away that invariant, which we do want to do, we'll need to tweak how this works. From rick.jones2@hp.com Mon Jan 24 13:22:24 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 13:22:28 -0800 (PST) Received: from palrel13.hp.com (palrel13.hp.com [156.153.255.238]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0OLMNko012161 for ; Mon, 24 Jan 2005 13:22:23 -0800 Received: from tardy.cup.hp.com (tardy.cup.hp.com [15.244.44.58]) by palrel13.hp.com (Postfix) with ESMTP id 7B0F31C07EAA for ; Mon, 24 Jan 2005 13:22:23 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by tardy.cup.hp.com (8.9.3 (PHNE_28810)/8.9.3 SMKit7.02) with ESMTP id NAA10178 for ; Mon, 24 Jan 2005 13:22:23 -0800 (PST) Message-ID: <41F5670F.4000209@hp.com> Date: Mon, 24 Jan 2005 13:22:23 -0800 From: Rick Jones User-Agent: Mozilla/5.0 (X11; U; HP-UX 9000/785; en-US; rv:1.7.3) Gecko/20041206 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: Re: on the wire behaviour of TSO on/off is supposed to be the same yes? References: <41F1516D.5010101@hp.com> <200501211358.53783.jdmason@us.ibm.com> <41F163AD.5070400@hp.com> <20050121124441.76cbbfb9.davem@davemloft.net> <41F17B7E.2020002@hp.com> <20050121141820.7d59a2d1.davem@davemloft.net> <41F186A8.9030805@hp.com> <20050121204948.034b2510.davem@davemloft.net> <41F55B93.6040603@hp.com> <20050124124353.2f760e1a.davem@davemloft.net> In-Reply-To: <20050124124353.2f760e1a.davem@davemloft.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 718 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rick.jones2@hp.com Precedence: bulk X-list: netdev Content-Length: 603 Lines: 15 David S. Miller wrote: > Becuase we disable TSO on any packet loss whatsoever, we can predict > exactly what the CWND will be at the time a packet is sent. I'd heard someone else mention that, but wasn't sure. Now I know I guess. I can see how that would simplify things considerably, although it may have some non-technical implications... > When we take away that invariant, which we do want to do, we'll need > to tweak how this works. OK. BTW, how "hard" is it to reference chunks of a big buffer and send them? Particularly in a situation where there is TSO which implies SG and CKO. rick From mchan@broadcom.com Mon Jan 24 13:52:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 13:52:07 -0800 (PST) Received: from mms1.broadcom.com (mms-nat.broadcom.com [63.70.210.58]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0OLq02D013445 for ; Mon, 24 Jan 2005 13:52:01 -0800 Received: from 63.70.210.1 by mms1.broadcom.com with SMTP (Broadcom SMTP Relay (MMS v5.6.0)); Mon, 24 Jan 2005 13:51:45 -0800 X-Server-Uuid: 97B92932-364A-4474-92D6-5CFE9C59AD14 Received: from mail-irva-8.broadcom.com ([10.10.64.221]) by mail-irva-1.broadcom.com (Post.Office MTA v3.5.3 release 223 ID# 0-72233U7200L2200S0V35) with ESMTP id com; Mon, 24 Jan 2005 13:51:43 -0800 Received: from mon-irva-10.broadcom.com (mon-irva-10.broadcom.com [10.10.64.171]) by mail-irva-8.broadcom.com (MOS 3.5.6-GR) with ESMTP id AHY61074; Mon, 24 Jan 2005 13:51:37 -0800 (PST) Received: from nt-irva-0741.brcm.ad.broadcom.com ( nt-irva-0741.brcm.ad.broadcom.com [10.8.194.54]) by mon-irva-10.broadcom.com (8.9.1/8.9.1) with ESMTP id NAA20383; Mon, 24 Jan 2005 13:51:37 -0800 (PST) X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Subject: [PATCH 2.6.10] tg3: Fix TSO for 5750 Date: Mon, 24 Jan 2005 13:51:36 -0800 Message-ID: X-MS-Has-Attach: yes Thread-Topic: [PATCH 2.6.10] tg3: Fix TSO for 5750 Thread-Index: AcT/RNYoqhl8O7sZQByxO+YWIkWbhgAAiLIAAMWgbjA= From: "Michael Chan" To: "David S. Miller" cc: netdev@oss.sgi.com X-WSS-ID: 6DEBB27B1BW1597097-01-01 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C5025E.E0AE0639" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 719 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mchan@broadcom.com Precedence: bulk X-list: netdev Content-Length: 5173 Lines: 85 This is a multi-part message in MIME format. ------_=_NextPart_001_01C5025E.E0AE0639 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable - Fix TSO for 5750 chips by setting tcp checksum field to 0 for TSO = packets - Add TG3_FLG2_HW_TSO flag for 5750 and newer chips that use the same = TSO scheme Signed-off-by: Michael Chan ------_=_NextPart_001_01C5025E.E0AE0639 Content-Type: application/octet-stream; name=tg3_tso.patch Content-Transfer-Encoding: base64 Content-Description: tg3_tso.patch Content-Disposition: attachment; filename=tg3_tso.patch ZGlmZiAtTnJ1IDIvdGczLmMgMy90ZzMuYwotLS0gMi90ZzMuYwkyMDA1LTAxLTE5IDE1OjUxOjM1 LjAwMDAwMDAwMCAtMDgwMAorKysgMy90ZzMuYwkyMDA1LTAxLTIzIDEzOjM3OjE2LjAwMDAwMDAw MCAtMDgwMApAQCAtMzEwMywxMSArMzEwMywxOSBAQAogCiAJCXNrYi0+bmguaXBoLT5jaGVjayA9 IDA7CiAJCXNrYi0+bmguaXBoLT50b3RfbGVuID0gbnRvaHMobXNzICsgaXBfdGNwX2xlbiArIHRj cF9vcHRfbGVuKTsKLQkJc2tiLT5oLnRoLT5jaGVjayA9IH5jc3VtX3RjcHVkcF9tYWdpYyhza2It Pm5oLmlwaC0+c2FkZHIsCi0JCQkJCQkgICAgICBza2ItPm5oLmlwaC0+ZGFkZHIsCi0JCQkJCQkg ICAgICAwLCBJUFBST1RPX1RDUCwgMCk7CisJCWlmICh0cC0+dGczX2ZsYWdzMiAmIFRHM19GTEcy X0hXX1RTTykgeworCQkJc2tiLT5oLnRoLT5jaGVjayA9IDA7CisJCQliYXNlX2ZsYWdzICY9IH5U WERfRkxBR19UQ1BVRFBfQ1NVTTsKKwkJfQorCQllbHNlIHsKKwkJCXNrYi0+aC50aC0+Y2hlY2sg PQorCQkJCX5jc3VtX3RjcHVkcF9tYWdpYyhza2ItPm5oLmlwaC0+c2FkZHIsCisJCQkJCQkgICBz a2ItPm5oLmlwaC0+ZGFkZHIsCisJCQkJCQkgICAwLCBJUFBST1RPX1RDUCwgMCk7CisJCX0KIAot CQlpZiAoR0VUX0FTSUNfUkVWKHRwLT5wY2lfY2hpcF9yZXZfaWQpID09IEFTSUNfUkVWXzU3MDUp IHsKKwkJaWYgKCh0cC0+dGczX2ZsYWdzMiAmIFRHM19GTEcyX0hXX1RTTykgfHwKKwkJICAgIChH RVRfQVNJQ19SRVYodHAtPnBjaV9jaGlwX3Jldl9pZCkgPT0gQVNJQ19SRVZfNTcwNSkpIHsKIAkJ CWlmICh0Y3Bfb3B0X2xlbiB8fCBza2ItPm5oLmlwaC0+aWhsID4gNSkgewogCQkJCWludCB0c2Zs YWdzOwogCkBAIC0zMTc0LDcgKzMxODIsNyBAQAogCQkJCXdvdWxkX2hpdF9od2J1ZyA9IGVudHJ5 ICsgMTsKIAkJCX0KIAotCQkJaWYgKEdFVF9BU0lDX1JFVih0cC0+cGNpX2NoaXBfcmV2X2lkKSA9 PSBBU0lDX1JFVl81NzUwKQorCQkJaWYgKHRwLT50ZzNfZmxhZ3MyICYgVEczX0ZMRzJfSFdfVFNP KQogCQkJCXRnM19zZXRfdHhkKHRwLCBlbnRyeSwgbWFwcGluZywgbGVuLAogCQkJCQkgICAgYmFz ZV9mbGFncywgKGkgPT0gbGFzdCl8KG1zcyA8PCAxKSk7CiAJCQllbHNlCkBAIC00NzY2LDcgKzQ3 NzQsNyBAQAogCXVuc2lnbmVkIGxvbmcgY3B1X2Jhc2UsIGNwdV9zY3JhdGNoX2Jhc2UsIGNwdV9z Y3JhdGNoX3NpemU7CiAJaW50IGVyciwgaTsKIAotCWlmIChHRVRfQVNJQ19SRVYodHAtPnBjaV9j aGlwX3Jldl9pZCkgPT0gQVNJQ19SRVZfNTc1MCkKKwlpZiAodHAtPnRnM19mbGFnczIgJiBURzNf RkxHMl9IV19UU08pCiAJCXJldHVybiAwOwogCiAJaWYgKEdFVF9BU0lDX1JFVih0cC0+cGNpX2No aXBfcmV2X2lkKSA9PSBBU0lDX1JFVl81NzA1KSB7CkBAIC01MjAwLDcgKzUyMDgsNyBAQAogCX0K IAogI2lmIFRHM19UU09fU1VQUE9SVCAhPSAwCi0JaWYgKEdFVF9BU0lDX1JFVih0cC0+cGNpX2No aXBfcmV2X2lkKSA9PSBBU0lDX1JFVl81NzUwKQorCWlmICh0cC0+dGczX2ZsYWdzMiAmIFRHM19G TEcyX0hXX1RTTykKIAkJcmRtYWNfbW9kZSB8PSAoMSA8PCAyNyk7CiAjZW5kaWYKIApAQCAtNTM1 MCw3ICs1MzU4LDcgQEAKIAl0dzMyKFJDVkRCRElfTU9ERSwgUkNWREJESV9NT0RFX0VOQUJMRSB8 IFJDVkRCRElfTU9ERV9JTlZfUklOR19TWik7CiAJdHczMihTTkREQVRBSV9NT0RFLCBTTkREQVRB SV9NT0RFX0VOQUJMRSk7CiAjaWYgVEczX1RTT19TVVBQT1JUICE9IDAKLQlpZiAoR0VUX0FTSUNf UkVWKHRwLT5wY2lfY2hpcF9yZXZfaWQpID09IEFTSUNfUkVWXzU3NTApCisJaWYgKHRwLT50ZzNf ZmxhZ3MyICYgVEczX0ZMRzJfSFdfVFNPKQogCQl0dzMyKFNORERBVEFJX01PREUsIFNORERBVEFJ X01PREVfRU5BQkxFIHwgMHg4KTsKICNlbmRpZgogCXR3MzIoU05EQkRJX01PREUsIFNOREJESV9N T0RFX0VOQUJMRSB8IFNOREJESV9NT0RFX0FUVE5fRU5BQkxFKTsKQEAgLTc4NTksNiArNzg2Nyw5 IEBACiAJdHAtPnBjaV9oZHJfdHlwZSAgICAgPSAoY2FjaGVsaW5lX3N6X3JlZyA+PiAxNikgJiAw eGZmOwogCXRwLT5wY2lfYmlzdCAgICAgICAgID0gKGNhY2hlbGluZV9zel9yZWcgPj4gMjQpICYg MHhmZjsKIAorCWlmIChHRVRfQVNJQ19SRVYodHAtPnBjaV9jaGlwX3Jldl9pZCkgPT0gQVNJQ19S RVZfNTc1MCkKKwkJdHAtPnRnM19mbGFnczIgfD0gVEczX0ZMRzJfSFdfVFNPOworCiAJaWYgKHBj aV9maW5kX2NhcGFiaWxpdHkodHAtPnBkZXYsIFBDSV9DQVBfSURfRVhQKSAhPSAwKQogCQl0cC0+ dGczX2ZsYWdzMiB8PSBURzNfRkxHMl9QQ0lfRVhQUkVTUzsKIApAQCAtODc1NCwxMSArODc2NSwx MyBAQAogCX0KIAogI2lmIFRHM19UU09fU1VQUE9SVCAhPSAwCi0JaWYgKEdFVF9BU0lDX1JFVih0 cC0+cGNpX2NoaXBfcmV2X2lkKSA9PSBBU0lDX1JFVl81NzAwIHx8CisJaWYgKHRwLT50ZzNfZmxh Z3MyICYgVEczX0ZMRzJfSFdfVFNPKSB7CisJCXRwLT50ZzNfZmxhZ3MyIHw9IFRHM19GTEcyX1RT T19DQVBBQkxFOworCX0KKwllbHNlIGlmIChHRVRfQVNJQ19SRVYodHAtPnBjaV9jaGlwX3Jldl9p ZCkgPT0gQVNJQ19SRVZfNTcwMCB8fAogCSAgICBHRVRfQVNJQ19SRVYodHAtPnBjaV9jaGlwX3Jl dl9pZCkgPT0gQVNJQ19SRVZfNTcwMSB8fAogCSAgICB0cC0+cGNpX2NoaXBfcmV2X2lkID09IENI SVBSRVZfSURfNTcwNV9BMCB8fAotCSAgICAoKHRwLT50ZzNfZmxhZ3MgJiBURzNfRkxBR19FTkFC TEVfQVNGKSAhPSAwICYmCi0JICAgICBHRVRfQVNJQ19SRVYodHAtPnBjaV9jaGlwX3Jldl9pZCkg IT0gQVNJQ19SRVZfNTc1MCkpIHsKKwkgICAgKHRwLT50ZzNfZmxhZ3MgJiBURzNfRkxBR19FTkFC TEVfQVNGKSAhPSAwKSB7CiAJCXRwLT50ZzNfZmxhZ3MyICY9IH5URzNfRkxHMl9UU09fQ0FQQUJM RTsKIAl9IGVsc2UgewogCQl0cC0+dGczX2ZsYWdzMiB8PSBURzNfRkxHMl9UU09fQ0FQQUJMRTsK ZGlmZiAtTnJ1IDIvdGczLmggMy90ZzMuaAotLS0gMi90ZzMuaAkyMDA1LTAxLTE5IDE0OjI1OjIw LjAwMDAwMDAwMCAtMDgwMAorKysgMy90ZzMuaAkyMDA1LTAxLTIzIDEzOjM3OjIwLjAwMDAwMDAw MCAtMDgwMApAQCAtMjEwNSw2ICsyMTA1LDcgQEAKICNkZWZpbmUgVEczX0ZMRzJfUEhZX1NFUkRF UwkJMHgwMDAwMjAwMAogI2RlZmluZSBURzNfRkxHMl9DQVBBQ0lUSVZFX0NPVVBMSU5HCTB4MDAw MDQwMDAKICNkZWZpbmUgVEczX0ZMRzJfRkxBU0gJCQkweDAwMDA4MDAwCisjZGVmaW5lIFRHM19G TEcyX0hXX1RTTwkJCTB4MDAwMTAwMDAKIAogCXUzMgkJCQlzcGxpdF9tb2RlX21heF9yZXFzOwog I2RlZmluZSBTUExJVF9NT0RFXzU3MDRfTUFYX1JFUQkJMwo= ------_=_NextPart_001_01C5025E.E0AE0639-- From davem@davemloft.net Mon Jan 24 14:44:23 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 14:44:28 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0OMiMhF015870 for ; Mon, 24 Jan 2005 14:44:22 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CtCtI-000628-00; Mon, 24 Jan 2005 14:41:00 -0800 Date: Mon, 24 Jan 2005 14:41:00 -0800 From: "David S. Miller" To: "Michael Chan" Cc: netdev@oss.sgi.com Subject: Re: [PATCH 2.6.10] tg3: Fix TSO for 5750 Message-Id: <20050124144100.58a3fb54.davem@davemloft.net> In-Reply-To: References: X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 720 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 643 Lines: 17 On Mon, 24 Jan 2005 13:51:36 -0800 "Michael Chan" wrote: > - Fix TSO for 5750 chips by setting tcp checksum field to 0 for TSO packets > - Add TG3_FLG2_HW_TSO flag for 5750 and newer chips that use the same TSO > scheme If we've created this new TG3_FLG2_HW_TSO flag, we should eliminate all 5750 tests which are just checking for that. For example, this patch leaves the following test: - if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) { + if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO) || + (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705)) { Here, just checking the TG3_FLG3_HW_TSO flag would suffice. From herbert@gondor.apana.org.au Mon Jan 24 14:56:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 14:56:27 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0OMuIf1016821 for ; Mon, 24 Jan 2005 14:56:19 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CtD7Y-0006SV-00; Tue, 25 Jan 2005 09:55:44 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CtD6F-00040q-00; Tue, 25 Jan 2005 09:54:23 +1100 Date: Tue, 25 Jan 2005 09:54:23 +1100 To: Thomas Graf Cc: David Coulson , "David S. Miller" , kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-ID: <20050124225423.GA15405@gondor.apana.org.au> References: <20050124005348.GL23931@postel.suug.ch> <20050123202715.281ac87c.davem@davemloft.net> <20050124121610.GP23931@postel.suug.ch> <41F50B6C.6010107@davidcoulson.net> <20050124151510.GV23931@postel.suug.ch> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="RnlQjJ0d97Da+TV1" Content-Disposition: inline In-Reply-To: <20050124151510.GV23931@postel.suug.ch> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 721 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 2230 Lines: 59 --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jan 24, 2005 at 04:15:10PM +0100, Thomas Graf wrote: > > After inspecting your iptables rule set I think it is a general UDP DNAT > problem under some circumstances. Some defragmentation weirdness in > prerouting might be invovled. It would definitely help to have a dump > of a complete ip fragments sequence causing this bug but I can't tell > what exactly is the cause just now so yes it might be a good idea to > limit the dump to the above subnet and hope the dodgy traffic comes > from the same subnet again. OK, I think I've found the problem. It's a totally innocuous bug in ip_fragment/ip6_fragment. When we're in the fast path and use the pre-existing frag_list skb's, we forgot to clear ip_summed. Signed-off-by: Herbert Xu However, the problem that Patrick identified is very serious and we should fix that as a matter of urgency. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== net/ipv4/ip_output.c 1.73 vs edited ===== --- 1.73/net/ipv4/ip_output.c 2004-12-28 12:56:34 +11:00 +++ edited/net/ipv4/ip_output.c 2005-01-25 09:32:49 +11:00 @@ -504,6 +504,7 @@ /* Prepare header of the next frame, * before previous one went down. */ if (frag) { + frag->ip_summed = CHECKSUM_NONE; frag->h.raw = frag->data; frag->nh.raw = __skb_push(frag, hlen); memcpy(frag->nh.raw, iph, hlen); ===== net/ipv6/ip6_output.c 1.81 vs edited ===== --- 1.81/net/ipv6/ip6_output.c 2005-01-15 15:41:34 +11:00 +++ edited/net/ipv6/ip6_output.c 2005-01-25 09:48:25 +11:00 @@ -592,6 +592,7 @@ /* Prepare header of the next frame, * before previous one went down. */ if (frag) { + frag->ip_summed = CHECKSUM_NONE; frag->h.raw = frag->data; fh = (struct frag_hdr*)__skb_push(frag, sizeof(struct frag_hdr)); frag->nh.raw = __skb_push(frag, hlen); --RnlQjJ0d97Da+TV1-- From mchan@broadcom.com Mon Jan 24 15:00:12 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 15:00:16 -0800 (PST) Received: from mms2.broadcom.com (mms-nat.broadcom.com [63.70.210.58]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ON0C8N017376 for ; Mon, 24 Jan 2005 15:00:12 -0800 Received: from 63.70.210.1 by mms2.broadcom.com with SMTP (Broadcom SMTP Relay (MMS v5.6.0)); Mon, 24 Jan 2005 14:59:49 -0800 X-Server-Uuid: 011F2A72-58F1-4BCE-832F-B0D661E896E8 Received: from mail-irva-8.broadcom.com ([10.10.64.221]) by mail-irva-1.broadcom.com (Post.Office MTA v3.5.3 release 223 ID# 0-72233U7200L2200S0V35) with ESMTP id com; Mon, 24 Jan 2005 14:59:48 -0800 Received: from mon-irva-10.broadcom.com (mon-irva-10.broadcom.com [10.10.64.171]) by mail-irva-8.broadcom.com (MOS 3.5.6-GR) with ESMTP id AHZ02065; Mon, 24 Jan 2005 14:59:44 -0800 (PST) Received: from nt-irva-0741.brcm.ad.broadcom.com ( nt-irva-0741.brcm.ad.broadcom.com [10.8.194.54]) by mon-irva-10.broadcom.com (8.9.1/8.9.1) with ESMTP id OAA08787; Mon, 24 Jan 2005 14:59:43 -0800 (PST) X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Subject: RE: [PATCH 2.6.10] tg3: Fix TSO for 5750 Date: Mon, 24 Jan 2005 14:59:43 -0800 Message-ID: Thread-Topic: [PATCH 2.6.10] tg3: Fix TSO for 5750 Thread-Index: AcUCZk80D+kWSdMDT6OT6+gphQGyzAAAJM6Q From: "Michael Chan" To: "David S. Miller" cc: netdev@oss.sgi.com X-WSS-ID: 6DEBA26F1KS1860971-01-01 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j0ON0C8N017376 X-archive-position: 722 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mchan@broadcom.com Precedence: bulk X-list: netdev Content-Length: 712 Lines: 27 "David S. Miller" wrote: > If we've created this new TG3_FLG2_HW_TSO flag, we should > eliminate all 5750 tests which are just checking for that. > > For example, this patch leaves the following test: > > - if (GET_ASIC_REV(tp->pci_chip_rev_id) == > ASIC_REV_5705) { > + if ((tp->tg3_flags2 & TG3_FLG2_HW_TSO) || > + (GET_ASIC_REV(tp->pci_chip_rev_id) == > ASIC_REV_5705)) { > > Here, just checking the TG3_FLG3_HW_TSO flag would suffice. > > > This particular test is for 5705 or 5750. 5705 is a little different from 5750 in terms of TSO. But I plan to introduce another flag for 5705 and 5750 as these 2 chips have other things in common. This will be done in a different patch. Michael From tgraf@suug.ch Mon Jan 24 15:45:00 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 15:45:06 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ONiv4a018817 for ; Mon, 24 Jan 2005 15:45:00 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 3760E85; Tue, 25 Jan 2005 00:44:33 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 330E91C0EA; Tue, 25 Jan 2005 00:45:15 +0100 (CET) Date: Tue, 25 Jan 2005 00:45:15 +0100 From: Thomas Graf To: Herbert Xu Cc: David Coulson , "David S. Miller" , kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-ID: <20050124234515.GA31837@postel.suug.ch> References: <20050124005348.GL23931@postel.suug.ch> <20050123202715.281ac87c.davem@davemloft.net> <20050124121610.GP23931@postel.suug.ch> <41F50B6C.6010107@davidcoulson.net> <20050124151510.GV23931@postel.suug.ch> <20050124225423.GA15405@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050124225423.GA15405@gondor.apana.org.au> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 723 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 1121 Lines: 21 * Herbert Xu <20050124225423.GA15405@gondor.apana.org.au> 2005-01-25 09:54 > On Mon, Jan 24, 2005 at 04:15:10PM +0100, Thomas Graf wrote: > > > > After inspecting your iptables rule set I think it is a general UDP DNAT > > problem under some circumstances. Some defragmentation weirdness in > > prerouting might be invovled. It would definitely help to have a dump > > of a complete ip fragments sequence causing this bug but I can't tell > > what exactly is the cause just now so yes it might be a good idea to > > limit the dump to the above subnet and hope the dodgy traffic comes > > from the same subnet again. > > OK, I think I've found the problem. It's a totally innocuous bug > in ip_fragment/ip6_fragment. When we're in the fast path and use > the pre-existing frag_list skb's, we forgot to clear ip_summed. I don't quite understand how this solves the problem. How could ip_summed be non zero after ip_forward? The earliest possible call to ip_fragment is in postrouting. Please correct me if I'm wrong. The bug isn't triggered for every fragment only once in a while so I don't think it's that simple. From akpm@osdl.org Mon Jan 24 15:54:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 15:54:37 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ONsUYS019588 for ; Mon, 24 Jan 2005 15:54:31 -0800 Received: from akpm.pao.digeo.com (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id j0ONsOl20752; Mon, 24 Jan 2005 15:54:24 -0800 Date: Mon, 24 Jan 2005 15:59:12 -0800 From: Andrew Morton To: netdev@oss.sgi.com Cc: =?ISO-8859-1?Q?Aur=E9lien_G=C9R=D4ME?= Subject: Fw: ppp0 out of control Message-Id: <20050124155912.53e90409.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i586-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Mon__24_Jan_2005_15_59_12_-0800_KNED1cU+/MA4IIE+" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 724 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 1617 Lines: 55 This is a multi-part message in MIME format. --Multipart=_Mon__24_Jan_2005_15_59_12_-0800_KNED1cU+/MA4IIE+ Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Begin forwarded message: Date: Fri, 21 Jan 2005 15:44:44 +0100 From: Aur=E9lien G=C9R=D4ME To: linux-kernel@vger.kernel.org Subject: ppp0 out of control Hi there, I am running 2.6.10 from kernel.org on Debian Sid ppc/x86, the same issue occurs with 2.6.9. Though, 2.6.8.1 and previous are fine. When my ISP connection via PPPoE (kernel side) goes down, reconnection does not occur, and the kernel displays continuous: kernel: unregister_netdevice: waiting for ppp0 to become free. Usage count = =3D 1 This is that on both machine: x86 and ppc. The only solution is a reboot, because pppd is not killable, and the kernel keeps on with this message. Does anyone have a solution? I am completely clueless. :( I thought about stalled sockets, but how can I destroy them? What is blocking ppp0? What system outputs do you need to solve this? Cheers. --Multipart=_Mon__24_Jan_2005_15_59_12_-0800_KNED1cU+/MA4IIE+ Content-Type: application/pgp-signature; name="signature.asc" Content-Disposition: attachment; filename="signature.asc" Content-Transfer-Encoding: base64 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuMi41IChHTlUv TGludXgpCgppRDhEQlFGQjhSVmNJMnhneG1XMHNXSVJBZ3FzQUo5bDV1R2pxcjRpYjZZa1k5VmVv OXY0eWg5OTNnQ2dxeTJVCnhrc3NkaExlMGJuNWNqMWhiZ0lrSU04PQo9UGlUYgotLS0tLUVORCBQ R1AgU0lHTkFUVVJFLS0tLS0KCg== --Multipart=_Mon__24_Jan_2005_15_59_12_-0800_KNED1cU+/MA4IIE+-- From herbert@gondor.apana.org.au Mon Jan 24 16:09:00 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 16:09:07 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P08weg020420 for ; Mon, 24 Jan 2005 16:08:59 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CtEFx-00071I-00; Tue, 25 Jan 2005 11:08:29 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CtEFT-00048R-00; Tue, 25 Jan 2005 11:07:59 +1100 Date: Tue, 25 Jan 2005 11:07:59 +1100 To: Thomas Graf Cc: David Coulson , "David S. Miller" , kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-ID: <20050125000759.GA15883@gondor.apana.org.au> References: <20050124005348.GL23931@postel.suug.ch> <20050123202715.281ac87c.davem@davemloft.net> <20050124121610.GP23931@postel.suug.ch> <41F50B6C.6010107@davidcoulson.net> <20050124151510.GV23931@postel.suug.ch> <20050124225423.GA15405@gondor.apana.org.au> <20050124234515.GA31837@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050124234515.GA31837@postel.suug.ch> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 725 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 605 Lines: 15 On Tue, Jan 25, 2005 at 12:45:15AM +0100, Thomas Graf wrote: > > I don't quite understand how this solves the problem. How could > ip_summed be non zero after ip_forward? The earliest possible call > to ip_fragment is in postrouting. Please correct me if I'm wrong. ip_forward only sets ip_summed for the packet at the head. It does not clear ip_summed for the fragments themselves. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From shemminger@osdl.org Mon Jan 24 16:27:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 16:27:52 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P0RiKF024691 for ; Mon, 24 Jan 2005 16:27:47 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0P0Ral27489; Mon, 24 Jan 2005 16:27:36 -0800 Date: Mon, 24 Jan 2005 16:27:41 -0800 From: Stephen Hemminger To: linux-net@vger.kernel.org, lartc@mailman.ds9a.nl Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: [ANNOUNCE] iproute2 (050124) release Message-ID: <20050124162741.41606e3f@dxpl.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 726 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 484 Lines: 23 Thanks to the work of Jamal and Thomas; here is an update to iproute2. http://developer.osdl.org/dev/iproute2/download/iproute2-2.6.10-ss050124.tar.gz Changes since last version: [Yun Mao] fix typo in ss [Thomas Graf] tc pedit/action cleanups add addraw_l rtattr_parse cleanups [Jamal Hadi Salim] typo in m_mirred add support for pedit [Jim Gifford] Fix allocation size error in nomal and paretonormal generation programs. -- Stephen Hemminger From davem@davemloft.net Mon Jan 24 16:44:56 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 16:45:04 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P0it23025519 for ; Mon, 24 Jan 2005 16:44:56 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CtElG-0006bK-00; Mon, 24 Jan 2005 16:40:50 -0800 Date: Mon, 24 Jan 2005 16:40:49 -0800 From: "David S. Miller" To: Herbert Xu Cc: tgraf@suug.ch, david@davidcoulson.net, kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-Id: <20050124164049.3b939791.davem@davemloft.net> In-Reply-To: <20050125000759.GA15883@gondor.apana.org.au> References: <20050124005348.GL23931@postel.suug.ch> <20050123202715.281ac87c.davem@davemloft.net> <20050124121610.GP23931@postel.suug.ch> <41F50B6C.6010107@davidcoulson.net> <20050124151510.GV23931@postel.suug.ch> <20050124225423.GA15405@gondor.apana.org.au> <20050124234515.GA31837@postel.suug.ch> <20050125000759.GA15883@gondor.apana.org.au> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 727 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 2309 Lines: 57 On Tue, 25 Jan 2005 11:07:59 +1100 Herbert Xu wrote: > On Tue, Jan 25, 2005 at 12:45:15AM +0100, Thomas Graf wrote: > > > > I don't quite understand how this solves the problem. How could > > ip_summed be non zero after ip_forward? The earliest possible call > > to ip_fragment is in postrouting. Please correct me if I'm wrong. > > ip_forward only sets ip_summed for the packet at the head. It does > not clear ip_summed for the fragments themselves. Yes, there exists all of this weird logic in ip_fragment.c trying to preserve the checksumming done on RX by the hardware. When we reassemble an ipv4 set of frags, we do this in ip_frag_reasm() for (fp=head->next; fp; fp = fp->next) { head->data_len += fp->len; head->len += fp->len; if (head->ip_summed != fp->ip_summed) head->ip_summed = CHECKSUM_NONE; else if (head->ip_summed == CHECKSUM_HW) head->csum = csum_add(head->csum, fp->csum); head->truesize += fp->truesize; atomic_sub(fp->truesize, &ip_frag_mem); } Acenic uses the CHECKSUM_HW case, where the chip does a pretty much straight 16-bit two's complement checksum over the whole data area. Thus the head SKB csum field plus it's CHECKSUM_HW setting means that UDP et al. receive checksumming offloading works for this fraglist as it gets processed by IPv4 input protocol paths. However, if we forward this thing, only the head SKB in the fraglist has it's skb->ip_summed value reset. Then ip_output() sees that the head skb has a length greater than the dst_pmtu() and we get to ip_fragment() which is where Herbert's fix is located. Remember that skb->len is the sum of the lengths of all the SKBs on the fraglist. So it will likely exceed the PMTU of the outgoing route. ip_fragment() notices that we have a frag list, all the geometry and ownership tests pass, and we simply reuse the fraglist SKBs to produce the output fragments. And as Herbert discovered, we need to reset the frag->ip_summed values before we push the IP header onto such frags. We want to preserve local IP protocol input usage of CHECKSUM_HW information on such frag list SKBs, so the location to fix this is in fact ip_fragment() and not any of the code in ip_fragment.c Good catch Herbert, I'll integrate this fix. 2.4.x needs it too I'm pretty sure. From tgraf@suug.ch Mon Jan 24 17:45:27 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 17:45:34 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P1jQmN032120 for ; Mon, 24 Jan 2005 17:45:27 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id B46E785; Tue, 25 Jan 2005 02:44:58 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 6BF931C0EA; Tue, 25 Jan 2005 02:45:38 +0100 (CET) Date: Tue, 25 Jan 2005 02:45:38 +0100 From: Thomas Graf To: "David S. Miller" Cc: Herbert Xu , david@davidcoulson.net, kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-ID: <20050125014538.GB31837@postel.suug.ch> References: <20050124005348.GL23931@postel.suug.ch> <20050123202715.281ac87c.davem@davemloft.net> <20050124121610.GP23931@postel.suug.ch> <41F50B6C.6010107@davidcoulson.net> <20050124151510.GV23931@postel.suug.ch> <20050124225423.GA15405@gondor.apana.org.au> <20050124234515.GA31837@postel.suug.ch> <20050125000759.GA15883@gondor.apana.org.au> <20050124164049.3b939791.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050124164049.3b939791.davem@davemloft.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 728 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 2171 Lines: 45 * David S. Miller <20050124164049.3b939791.davem@davemloft.net> 2005-01-24 16:40 > On Tue, 25 Jan 2005 11:07:59 +1100 > Herbert Xu wrote: > > > On Tue, Jan 25, 2005 at 12:45:15AM +0100, Thomas Graf wrote: > > > > > > I don't quite understand how this solves the problem. How could > > > ip_summed be non zero after ip_forward? The earliest possible call > > > to ip_fragment is in postrouting. Please correct me if I'm wrong. > > > > ip_forward only sets ip_summed for the packet at the head. It does > > not clear ip_summed for the fragments themselves. You are indeed right, I actually thought it would be like this first but tricked myself into not believeing in this anymore because it would have meant that every fragmented sequence could crash a kernel with one of the drivers setting ip_summed to HW and the card not being able to do the checksummin itself, so I thought I'd have missed some magic. As it seems, it is really the case, a first peeks shows that the following drivers set ip_summed to HW under some circumstances: acenic, he, hamachi, starfire, sungem, happy meal > However, if we forward this thing, only the head SKB in the > fraglist has it's skb->ip_summed value reset. Then ip_output() > sees that the head skb has a length greater than the dst_pmtu() > and we get to ip_fragment() which is where Herbert's fix is > located. > We want to preserve local IP protocol input usage of CHECKSUM_HW > information on such frag list SKBs, so the location to fix this > is in fact ip_fragment() and not any of the code in ip_fragment.c Agreed. I've been talking to David on IRC and we have been able to reproduce the bug by sending a sequence of fragmented ip packets to a host behind the router. The only objection I had with this patch was, that I found it too unlikely that his box wouldn't receive fragmented packets more often, but as it seems it is really is this simple. Still, one problem remains, even if ip_summed was incorrect, skb_checksum_help should never be called in dev_queue_xmit for the acenic driver since it sets NETIF_F_IP_CSUM. For some reason, features is set to 0 while checking for it. From herbert@gondor.apana.org.au Mon Jan 24 17:49:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 17:49:50 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P1nean032678 for ; Mon, 24 Jan 2005 17:49:42 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CtFpK-0007nU-00; Tue, 25 Jan 2005 12:49:06 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CtFos-0004Ke-00; Tue, 25 Jan 2005 12:48:38 +1100 Date: Tue, 25 Jan 2005 12:48:38 +1100 To: Thomas Graf Cc: "David S. Miller" , david@davidcoulson.net, kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-ID: <20050125014838.GA16637@gondor.apana.org.au> References: <20050123202715.281ac87c.davem@davemloft.net> <20050124121610.GP23931@postel.suug.ch> <41F50B6C.6010107@davidcoulson.net> <20050124151510.GV23931@postel.suug.ch> <20050124225423.GA15405@gondor.apana.org.au> <20050124234515.GA31837@postel.suug.ch> <20050125000759.GA15883@gondor.apana.org.au> <20050124164049.3b939791.davem@davemloft.net> <20050125014538.GB31837@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050125014538.GB31837@postel.suug.ch> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 729 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 735 Lines: 18 On Tue, Jan 25, 2005 at 02:45:38AM +0100, Thomas Graf wrote: > > Still, one problem remains, even if ip_summed was incorrect, > skb_checksum_help should never be called in dev_queue_xmit for the > acenic driver since it sets NETIF_F_IP_CSUM. For some reason, features > is set to 0 while checking for it. Didn't he say that he cleared the features bits in the acenic driver? BTW, is he using acenic for both the LAN and the WAN? If he's only using it on the WAN side, then the LAN side might not be CSUM capable. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From david@davidcoulson.net Mon Jan 24 17:59:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 17:59:32 -0800 (PST) Received: from mail.mx.davidcoulson.net (ns1.openconsultancy.com [207.166.203.131]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P1xOR5000919 for ; Mon, 24 Jan 2005 17:59:26 -0800 Received: (qmail 29796 invoked for bounce); 25 Jan 2005 01:59:18 +0000 Received: from unknown (HELO mx3.openconsultancy.com) (qmailr@10.2.0.36) by tailtiu.dmz.davidcoulson.net (qmail 1.03-djc-2) with SMTP; 25 Jan 2005 01:59:18 +0000 Received: (qmail 17437 invoked from network); 25 Jan 2005 01:59:17 -0000 Received: from unknown (HELO ?10.2.3.172?) (10.2.3.172) by vlan-102.core.davidcoulson.net with SMTP; 25 Jan 2005 01:59:17 -0000 Message-ID: <41F5A7F8.6060706@davidcoulson.net> Date: Mon, 24 Jan 2005 20:59:20 -0500 From: David Coulson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Herbert Xu CC: Thomas Graf , "David S. Miller" , kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help References: <20050123202715.281ac87c.davem@davemloft.net> <20050124121610.GP23931@postel.suug.ch> <41F50B6C.6010107@davidcoulson.net> <20050124151510.GV23931@postel.suug.ch> <20050124225423.GA15405@gondor.apana.org.au> <20050124234515.GA31837@postel.suug.ch> <20050125000759.GA15883@gondor.apana.org.au> <20050124164049.3b939791.davem@davemloft.net> <20050125014538.GB31837@postel.suug.ch> <20050125014838.GA16637@gondor.apana.org.au> In-Reply-To: <20050125014838.GA16637@gondor.apana.org.au> X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 730 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: david@davidcoulson.net Precedence: bulk X-list: netdev Content-Length: 514 Lines: 20 Herbert Xu wrote: > Didn't he say that he cleared the features bits in the acenic driver? I'm using the original acenic.c driver right now. > BTW, is he using acenic for both the LAN and the WAN? If he's only > using it on the WAN side, then the LAN side might not be CSUM capable. I've got the NIC VLANed out in the kernel. It's the same physical NIC for inside and outside. David -- David J. Coulson email: david@davidcoulson.net web: http://www.davidcoulson.net/ phone: (216) 920-3100 / (216) 258-4942 From tgraf@suug.ch Mon Jan 24 18:01:00 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 18:01:05 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P20xvD001328 for ; Mon, 24 Jan 2005 18:00:59 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 5785385; Tue, 25 Jan 2005 03:00:36 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 669C11C0EA; Tue, 25 Jan 2005 03:01:18 +0100 (CET) Date: Tue, 25 Jan 2005 03:01:18 +0100 From: Thomas Graf To: Herbert Xu Cc: "David S. Miller" , david@davidcoulson.net, kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-ID: <20050125020118.GC31837@postel.suug.ch> References: <20050123202715.281ac87c.davem@davemloft.net> <20050124121610.GP23931@postel.suug.ch> <41F50B6C.6010107@davidcoulson.net> <20050124151510.GV23931@postel.suug.ch> <20050124225423.GA15405@gondor.apana.org.au> <20050124234515.GA31837@postel.suug.ch> <20050125000759.GA15883@gondor.apana.org.au> <20050124164049.3b939791.davem@davemloft.net> <20050125014538.GB31837@postel.suug.ch> <20050125014838.GA16637@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050125014838.GA16637@gondor.apana.org.au> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 731 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 744 Lines: 16 * Herbert Xu <20050125014838.GA16637@gondor.apana.org.au> 2005-01-25 12:48 > On Tue, Jan 25, 2005 at 02:45:38AM +0100, Thomas Graf wrote: > > > > Still, one problem remains, even if ip_summed was incorrect, > > skb_checksum_help should never be called in dev_queue_xmit for the > > acenic driver since it sets NETIF_F_IP_CSUM. For some reason, features > > is set to 0 while checking for it. > > Didn't he say that he cleared the features bits in the acenic driver? He changed it back to the original version, I just checked with him. > BTW, is he using acenic for both the LAN and the WAN? If he's only > using it on the WAN side, then the LAN side might not be CSUM capable. The packets get routed back over the same physical interface. From davem@davemloft.net Mon Jan 24 18:06:06 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 18:06:12 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P265sD002150 for ; Mon, 24 Jan 2005 18:06:05 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CtG1t-0006ut-00; Mon, 24 Jan 2005 18:02:05 -0800 Date: Mon, 24 Jan 2005 18:02:05 -0800 From: "David S. Miller" To: Thomas Graf Cc: herbert@gondor.apana.org.au, david@davidcoulson.net, kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-Id: <20050124180205.2f0590e5.davem@davemloft.net> In-Reply-To: <20050125014538.GB31837@postel.suug.ch> References: <20050124005348.GL23931@postel.suug.ch> <20050123202715.281ac87c.davem@davemloft.net> <20050124121610.GP23931@postel.suug.ch> <41F50B6C.6010107@davidcoulson.net> <20050124151510.GV23931@postel.suug.ch> <20050124225423.GA15405@gondor.apana.org.au> <20050124234515.GA31837@postel.suug.ch> <20050125000759.GA15883@gondor.apana.org.au> <20050124164049.3b939791.davem@davemloft.net> <20050125014538.GB31837@postel.suug.ch> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 732 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 354 Lines: 9 On Tue, 25 Jan 2005 02:45:38 +0100 Thomas Graf wrote: > As it seems, it is really the case, a first peeks shows that the > following drivers set ip_summed to HW under some circumstances: > acenic, he, hamachi, starfire, sungem, happy meal I looked this up too, and your list of drivers actually using CHECKSUM_HW on RX seems accurate. From davem@davemloft.net Mon Jan 24 18:07:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 18:07:39 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P27YTD002711 for ; Mon, 24 Jan 2005 18:07:35 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CtG3f-0006v8-00; Mon, 24 Jan 2005 18:03:55 -0800 Date: Mon, 24 Jan 2005 18:03:54 -0800 From: "David S. Miller" To: Thomas Graf Cc: herbert@gondor.apana.org.au, david@davidcoulson.net, kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-Id: <20050124180354.63ae600d.davem@davemloft.net> In-Reply-To: <20050125020118.GC31837@postel.suug.ch> References: <20050123202715.281ac87c.davem@davemloft.net> <20050124121610.GP23931@postel.suug.ch> <41F50B6C.6010107@davidcoulson.net> <20050124151510.GV23931@postel.suug.ch> <20050124225423.GA15405@gondor.apana.org.au> <20050124234515.GA31837@postel.suug.ch> <20050125000759.GA15883@gondor.apana.org.au> <20050124164049.3b939791.davem@davemloft.net> <20050125014538.GB31837@postel.suug.ch> <20050125014838.GA16637@gondor.apana.org.au> <20050125020118.GC31837@postel.suug.ch> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 733 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 979 Lines: 23 On Tue, 25 Jan 2005 03:01:18 +0100 Thomas Graf wrote: > * Herbert Xu <20050125014838.GA16637@gondor.apana.org.au> 2005-01-25 12:48 > > On Tue, Jan 25, 2005 at 02:45:38AM +0100, Thomas Graf wrote: > > > > > > Still, one problem remains, even if ip_summed was incorrect, > > > skb_checksum_help should never be called in dev_queue_xmit for the > > > acenic driver since it sets NETIF_F_IP_CSUM. For some reason, features > > > is set to 0 while checking for it. > > > > Didn't he say that he cleared the features bits in the acenic driver? > > He changed it back to the original version, I just checked with him. > > > BTW, is he using acenic for both the LAN and the WAN? If he's only > > using it on the WAN side, then the LAN side might not be CSUM capable. > > The packets get routed back over the same physical interface. I think I see what is happening, it's the virtual VLAN device which has dev->features set to zero not the acenic's netdev struct. From herbert@gondor.apana.org.au Mon Jan 24 18:08:24 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 18:08:31 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P28MvS003169 for ; Mon, 24 Jan 2005 18:08:23 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CtG7j-0007xp-00; Tue, 25 Jan 2005 13:08:07 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CtG7S-0004NS-00; Tue, 25 Jan 2005 13:07:50 +1100 Date: Tue, 25 Jan 2005 13:07:49 +1100 To: David Coulson Cc: Thomas Graf , "David S. Miller" , kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-ID: <20050125020749.GA16809@gondor.apana.org.au> References: <20050124121610.GP23931@postel.suug.ch> <41F50B6C.6010107@davidcoulson.net> <20050124151510.GV23931@postel.suug.ch> <20050124225423.GA15405@gondor.apana.org.au> <20050124234515.GA31837@postel.suug.ch> <20050125000759.GA15883@gondor.apana.org.au> <20050124164049.3b939791.davem@davemloft.net> <20050125014538.GB31837@postel.suug.ch> <20050125014838.GA16637@gondor.apana.org.au> <41F5A7F8.6060706@davidcoulson.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F5A7F8.6060706@davidcoulson.net> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 734 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 439 Lines: 11 On Mon, Jan 24, 2005 at 08:59:20PM -0500, David Coulson wrote: > > I've got the NIC VLANed out in the kernel. It's the same physical NIC > for inside and outside. I don't think the vlan code actually sets the features bits... -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From davem@davemloft.net Mon Jan 24 18:08:39 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 18:08:45 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P28dIL003316 for ; Mon, 24 Jan 2005 18:08:39 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CtG4y-0006vT-00; Mon, 24 Jan 2005 18:05:16 -0800 Date: Mon, 24 Jan 2005 18:05:15 -0800 From: "David S. Miller" To: "Michael Chan" Cc: netdev@oss.sgi.com Subject: Re: [PATCH 2.6.10] tg3: Fix TSO for 5750 Message-Id: <20050124180515.6f288742.davem@davemloft.net> In-Reply-To: References: X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 735 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 370 Lines: 11 On Mon, 24 Jan 2005 14:59:43 -0800 "Michael Chan" wrote: > > Here, just checking the TG3_FLG3_HW_TSO flag would suffice. > > This particular test is for 5705 or 5750. 5705 is a little different from > 5750 in terms of TSO. You are right, I transposed 5705 and 5750 while reading the diff. I'll apply your patch right away Michael, thanks a lot. From herbert@gondor.apana.org.au Mon Jan 24 18:15:39 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 18:15:47 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P2FciN004366 for ; Mon, 24 Jan 2005 18:15:39 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CtGEe-00080w-00; Tue, 25 Jan 2005 13:15:16 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CtGEO-0004PK-00; Tue, 25 Jan 2005 13:15:00 +1100 Date: Tue, 25 Jan 2005 13:14:59 +1100 To: Thomas Graf Cc: "David S. Miller" , david@davidcoulson.net, kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-ID: <20050125021459.GA16931@gondor.apana.org.au> References: <20050123202715.281ac87c.davem@davemloft.net> <20050124121610.GP23931@postel.suug.ch> <41F50B6C.6010107@davidcoulson.net> <20050124151510.GV23931@postel.suug.ch> <20050124225423.GA15405@gondor.apana.org.au> <20050124234515.GA31837@postel.suug.ch> <20050125000759.GA15883@gondor.apana.org.au> <20050124164049.3b939791.davem@davemloft.net> <20050125014538.GB31837@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050125014538.GB31837@postel.suug.ch> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 736 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 575 Lines: 13 On Tue, Jan 25, 2005 at 02:45:38AM +0100, Thomas Graf wrote: > > the router. The only objection I had with this patch was, that I found > it too unlikely that his box wouldn't receive fragmented packets more > often, but as it seems it is really is this simple. Well the BUG() only triggers if skb->csum + 2 > offset, which is not necessarily true for every skb. -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From kaber@trash.net Mon Jan 24 18:16:43 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 18:16:48 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P2GgIK004740 for ; Mon, 24 Jan 2005 18:16:43 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.43) id 1CtGF4-0001db-Um; Tue, 25 Jan 2005 03:15:42 +0100 Message-ID: <41F5ABCE.6070801@trash.net> Date: Tue, 25 Jan 2005 03:15:42 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050106 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: Herbert Xu CC: Thomas Graf , David Coulson , "David S. Miller" , netdev@oss.sgi.com Subject: Re: skb_checksum_help References: <20050124005348.GL23931@postel.suug.ch> <20050123202715.281ac87c.davem@davemloft.net> <20050124121610.GP23931@postel.suug.ch> <41F50B6C.6010107@davidcoulson.net> <20050124151510.GV23931@postel.suug.ch> <20050124225423.GA15405@gondor.apana.org.au> In-Reply-To: <20050124225423.GA15405@gondor.apana.org.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 737 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 182 Lines: 10 Herbert Xu wrote: >However, the problem that Patrick identified is very serious and >we should fix that as a matter of urgency. > I'll send a patch later tonight. Regards Patrick From tgraf@suug.ch Mon Jan 24 18:24:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 18:24:18 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P2OBCS005597 for ; Mon, 24 Jan 2005 18:24:12 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id B1B4E85; Tue, 25 Jan 2005 03:23:48 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id D79F01C0EA; Tue, 25 Jan 2005 03:24:31 +0100 (CET) Date: Tue, 25 Jan 2005 03:24:31 +0100 From: Thomas Graf To: "David S. Miller" Cc: herbert@gondor.apana.org.au, david@davidcoulson.net, kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-ID: <20050125022431.GD31837@postel.suug.ch> References: <41F50B6C.6010107@davidcoulson.net> <20050124151510.GV23931@postel.suug.ch> <20050124225423.GA15405@gondor.apana.org.au> <20050124234515.GA31837@postel.suug.ch> <20050125000759.GA15883@gondor.apana.org.au> <20050124164049.3b939791.davem@davemloft.net> <20050125014538.GB31837@postel.suug.ch> <20050125014838.GA16637@gondor.apana.org.au> <20050125020118.GC31837@postel.suug.ch> <20050124180354.63ae600d.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050124180354.63ae600d.davem@davemloft.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 738 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 535 Lines: 10 * David S. Miller <20050124180354.63ae600d.davem@davemloft.net> 2005-01-24 18:03 > > * Herbert Xu <20050125014838.GA16637@gondor.apana.org.au> 2005-01-25 12:48 > > > On Tue, Jan 25, 2005 at 02:45:38AM +0100, Thomas Graf wrote: > > The packets get routed back over the same physical interface. > > I think I see what is happening, it's the virtual VLAN device which > has dev->features set to zero not the acenic's netdev struct. This of course explains it, didn't think of that. I thought it would inherit the checksumming features. From akpm@osdl.org Mon Jan 24 18:57:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 18:57:52 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P2vj7N007275 for ; Mon, 24 Jan 2005 18:57:45 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0P2vcl20252; Mon, 24 Jan 2005 18:57:38 -0800 Message-Id: <200501250257.j0P2vcl20252@mail.osdl.org> Subject: [patch 03/10] Add OMAP support to smc91x Ethernet driver To: davem@davemloft.net Cc: jgarzik@pobox.com, netdev@oss.sgi.com, akpm@osdl.org, tony@atomide.com From: akpm@osdl.org Date: Mon, 24 Jan 2005 18:57:10 -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 741 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 1433 Lines: 43 From: Tony Lindgren Following patch adds support for various OMAP boards to smc91x. Signed-off-by: Tony Lindgren Signed-off-by: Andrew Morton --- 25-akpm/drivers/net/smc91x.h | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+) diff -puN drivers/net/smc91x.h~add-omap-support-to-smc91x-ethernet-driver drivers/net/smc91x.h --- 25/drivers/net/smc91x.h~add-omap-support-to-smc91x-ethernet-driver 2005-01-24 18:55:47.064142000 -0800 +++ 25-akpm/drivers/net/smc91x.h 2005-01-24 18:55:47.068141392 -0800 @@ -162,6 +162,26 @@ SMC_outw(u16 val, unsigned long ioaddr, } } +#elif defined(CONFIG_ARCH_OMAP) + +/* We can only do 16-bit reads and writes in the static memory space. */ +#define SMC_CAN_USE_8BIT 0 +#define SMC_CAN_USE_16BIT 1 +#define SMC_CAN_USE_32BIT 0 +#define SMC_IO_SHIFT 0 +#define SMC_NOWAIT 1 + +#define SMC_inb(a, r) readb((a) + (r)) +#define SMC_outb(v, a, r) writeb(v, (a) + (r)) +#define SMC_inw(a, r) readw((a) + (r)) +#define SMC_outw(v, a, r) writew(v, (a) + (r)) +#define SMC_insw(a, r, p, l) readsw((a) + (r), p, l) +#define SMC_outsw(a, r, p, l) writesw((a) + (r), p, l) +#define SMC_inl(a, r) readl((a) + (r)) +#define SMC_outl(v, a, r) writel(v, (a) + (r)) +#define SMC_insl(a, r, p, l) readsl((a) + (r), p, l) +#define SMC_outsl(a, r, p, l) writesl((a) + (r), p, l) + #elif defined(CONFIG_ISA) #define SMC_CAN_USE_8BIT 1 _ From akpm@osdl.org Mon Jan 24 18:57:27 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 18:57:31 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P2vNjg007206 for ; Mon, 24 Jan 2005 18:57:27 -0800 Received: from bix (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id j0P2vFl20214; Mon, 24 Jan 2005 18:57:15 -0800 Date: Mon, 24 Jan 2005 18:56:48 -0800 From: Andrew Morton To: "David S. Miller" , Jeff Garzik Cc: netdev@oss.sgi.com Subject: accumulated net patches Message-Id: <20050124185648.6d2433b1.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 739 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 30 Lines: 1 For you guys to fight over ;) From akpm@osdl.org Mon Jan 24 18:57:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 18:57:48 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P2vgsr007260 for ; Mon, 24 Jan 2005 18:57:42 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0P2vZl20241; Mon, 24 Jan 2005 18:57:35 -0800 Message-Id: <200501250257.j0P2vZl20241@mail.osdl.org> Subject: [patch 01/10] multiple definitions of ip_nat_tftp_hook To: davem@davemloft.net Cc: jgarzik@pobox.com, netdev@oss.sgi.com, akpm@osdl.org, benoit.boissinot@ens-lyon.org From: akpm@osdl.org Date: Mon, 24 Jan 2005 18:57:07 -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 740 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 1171 Lines: 28 From: Benoit Boissinot net/ipv4/netfilter/ip_nat_tftp.o(.bss+0x0):net/ipv4/netfilter/ip_nat_tftp.c:44: multiple definition of `ip_nat_tftp_hook' Signed-off-by: Benoit Boissinot Signed-off-by: Andrew Morton --- 25-akpm/include/linux/netfilter_ipv4/ip_conntrack_tftp.h | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff -puN include/linux/netfilter_ipv4/ip_conntrack_tftp.h~ip_nat_tftp_hook-scoping-fix include/linux/netfilter_ipv4/ip_conntrack_tftp.h --- 25/include/linux/netfilter_ipv4/ip_conntrack_tftp.h~ip_nat_tftp_hook-scoping-fix 2005-01-24 18:55:46.792183344 -0800 +++ 25-akpm/include/linux/netfilter_ipv4/ip_conntrack_tftp.h 2005-01-24 18:55:46.795182888 -0800 @@ -13,8 +13,8 @@ struct tftphdr { #define TFTP_OPCODE_ACK 4 #define TFTP_OPCODE_ERROR 5 -unsigned int (*ip_nat_tftp_hook)(struct sk_buff **pskb, - enum ip_conntrack_info ctinfo, - struct ip_conntrack_expect *exp); +extern unsigned int (*ip_nat_tftp_hook)(struct sk_buff **pskb, + enum ip_conntrack_info ctinfo, + struct ip_conntrack_expect *exp); #endif /* _IP_CT_TFTP */ _ From akpm@osdl.org Mon Jan 24 18:57:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 18:57:54 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P2vlDl007288 for ; Mon, 24 Jan 2005 18:57:47 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0P2vel20262; Mon, 24 Jan 2005 18:57:40 -0800 Message-Id: <200501250257.j0P2vel20262@mail.osdl.org> Subject: [patch 05/10] netpoll: fix NAPI polling race on SMP To: davem@davemloft.net Cc: jgarzik@pobox.com, netdev@oss.sgi.com, akpm@osdl.org, mpm@selenic.com From: akpm@osdl.org Date: Mon, 24 Jan 2005 18:57:12 -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 742 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 2710 Lines: 81 From: Matt Mackall This avoids a nasty NAPI race by checking that work was actually scheduled for the CPU netpoll is running on and pulls the NAPI-specific code out into a separate function. Original idea from Jeff Moyer Tested by Andrew Tridgell Signed-off-by: Matt Mackall Signed-off-by: Andrew Morton --- 25-akpm/net/core/netpoll.c | 41 +++++++++++++++++++++++++---------------- 1 files changed, 25 insertions(+), 16 deletions(-) diff -puN net/core/netpoll.c~netpoll-fix-napi-polling-race-on-smp net/core/netpoll.c --- 25/net/core/netpoll.c~netpoll-fix-napi-polling-race-on-smp 2005-01-24 18:55:47.325102328 -0800 +++ 25-akpm/net/core/netpoll.c 2005-01-24 18:55:47.329101720 -0800 @@ -65,27 +65,25 @@ static int checksum_udp(struct sk_buff * return csum_fold(skb_checksum(skb, 0, skb->len, skb->csum)); } -void netpoll_poll(struct netpoll *np) +/* + * Check whether delayed processing was scheduled for our current CPU, + * and then manually invoke NAPI polling to pump data off the card. + * + * In cases where there is bi-directional communications, reading only + * one message at a time can lead to packets being dropped by the + * network adapter, forcing superfluous retries and possibly timeouts. + * Thus, we set our budget to greater than 1. + */ +static void poll_napi(struct netpoll *np) { - /* - * In cases where there is bi-directional communications, reading - * only one message at a time can lead to packets being dropped by - * the network adapter, forcing superfluous retries and possibly - * timeouts. Thus, we set our budget to a more reasonable value. - */ int budget = 16; unsigned long flags; + struct softnet_data *queue; - if(!np->dev || !netif_running(np->dev) || !np->dev->poll_controller) - return; - - /* Process pending work on NIC */ - np->dev->poll_controller(np->dev); - - /* If scheduling is stopped, tickle NAPI bits */ spin_lock_irqsave(&netpoll_poll_lock, flags); - if (np->dev->poll && - test_bit(__LINK_STATE_RX_SCHED, &np->dev->state)) { + queue = &__get_cpu_var(softnet_data); + if (test_bit(__LINK_STATE_RX_SCHED, &np->dev->state) && + !list_empty(&queue->poll_list)) { np->dev->netpoll_rx |= NETPOLL_RX_DROP; atomic_inc(&trapped); @@ -95,6 +93,17 @@ void netpoll_poll(struct netpoll *np) np->dev->netpoll_rx &= ~NETPOLL_RX_DROP; } spin_unlock_irqrestore(&netpoll_poll_lock, flags); +} + +void netpoll_poll(struct netpoll *np) +{ + if(!np->dev || !netif_running(np->dev) || !np->dev->poll_controller) + return; + + /* Process pending work on NIC */ + np->dev->poll_controller(np->dev); + if (np->dev->poll) + poll_napi(np); zap_completion_queue(); } _ From akpm@osdl.org Mon Jan 24 18:57:45 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 18:57:58 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P2viUl007273 for ; Mon, 24 Jan 2005 18:57:45 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0P2val20247; Mon, 24 Jan 2005 18:57:36 -0800 Message-Id: <200501250257.j0P2val20247@mail.osdl.org> Subject: [patch 02/10] pcnet32: 79c976 with fiber optic fix To: davem@davemloft.net Cc: jgarzik@pobox.com, netdev@oss.sgi.com, akpm@osdl.org, agx@sigxcpu.org, lars@segv.dk, brazilnut@us.ibm.com From: akpm@osdl.org Date: Mon, 24 Jan 2005 18:57:08 -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 743 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 3591 Lines: 90 From: Guido Guenther , Lars Munch Skip PHY selection on Allied Telesyn 2701FX, it looses the link otherwise. Fix up the AT 2701 as well. Signed-Off-By: Guido Guenther Cc: Don Fry Signed-off-by: Andrew Morton --- 25-akpm/drivers/net/pcnet32.c | 47 ++++++++++++++++++++++++---------------- 25-akpm/include/linux/pci_ids.h | 5 ++++ 2 files changed, 34 insertions(+), 18 deletions(-) diff -puN drivers/net/pcnet32.c~pcnet32-79c976-with-fiber-optic drivers/net/pcnet32.c --- 25/drivers/net/pcnet32.c~pcnet32-79c976-with-fiber-optic 2005-01-24 18:55:46.918164192 -0800 +++ 25-akpm/drivers/net/pcnet32.c 2005-01-24 18:55:46.925163128 -0800 @@ -1429,25 +1429,36 @@ pcnet32_open(struct net_device *dev) val |= 0x10; lp->a.write_csr (ioaddr, 124, val); - /* 24 Jun 2004 according AMD, in order to change the PHY, - * DANAS (or DISPM for 79C976) must be set; then select the speed, - * duplex, and/or enable auto negotiation, and clear DANAS */ - if (lp->mii && !(lp->options & PCNET32_PORT_ASEL)) { - lp->a.write_bcr(ioaddr, 32, lp->a.read_bcr(ioaddr, 32) | 0x0080); - /* disable Auto Negotiation, set 10Mpbs, HD */ - val = lp->a.read_bcr(ioaddr, 32) & ~0xb8; - if (lp->options & PCNET32_PORT_FD) - val |= 0x10; - if (lp->options & PCNET32_PORT_100) - val |= 0x08; - lp->a.write_bcr (ioaddr, 32, val); + /* Allied Telesyn AT 2700/2701 FX looses the link, so skip that */ + if (lp->pci_dev->subsystem_vendor == PCI_VENDOR_ID_AT && + (lp->pci_dev->subsystem_device == PCI_SUBDEVICE_ID_AT_2700FX || + lp->pci_dev->subsystem_device == PCI_SUBDEVICE_ID_AT_2701FX)) { + printk(KERN_DEBUG "pcnet32: Skipping PHY selection.\n"); } else { - if (lp->options & PCNET32_PORT_ASEL) { - lp->a.write_bcr(ioaddr, 32, lp->a.read_bcr(ioaddr, 32) | 0x0080); - /* enable auto negotiate, setup, disable fd */ - val = lp->a.read_bcr(ioaddr, 32) & ~0x98; - val |= 0x20; - lp->a.write_bcr(ioaddr, 32, val); + /* + * 24 Jun 2004 according AMD, in order to change the PHY, + * DANAS (or DISPM for 79C976) must be set; then select the speed, + * duplex, and/or enable auto negotiation, and clear DANAS + */ + if (lp->mii && !(lp->options & PCNET32_PORT_ASEL)) { + lp->a.write_bcr(ioaddr, 32, + lp->a.read_bcr(ioaddr, 32) | 0x0080); + /* disable Auto Negotiation, set 10Mpbs, HD */ + val = lp->a.read_bcr(ioaddr, 32) & ~0xb8; + if (lp->options & PCNET32_PORT_FD) + val |= 0x10; + if (lp->options & PCNET32_PORT_100) + val |= 0x08; + lp->a.write_bcr (ioaddr, 32, val); + } else { + if (lp->options & PCNET32_PORT_ASEL) { + lp->a.write_bcr(ioaddr, 32, + lp->a.read_bcr(ioaddr, 32) | 0x0080); + /* enable auto negotiate, setup, disable fd */ + val = lp->a.read_bcr(ioaddr, 32) & ~0x98; + val |= 0x20; + lp->a.write_bcr(ioaddr, 32, val); + } } } diff -puN include/linux/pci_ids.h~pcnet32-79c976-with-fiber-optic include/linux/pci_ids.h --- 25/include/linux/pci_ids.h~pcnet32-79c976-with-fiber-optic 2005-01-24 18:55:46.920163888 -0800 +++ 25-akpm/include/linux/pci_ids.h 2005-01-24 18:55:46.937161304 -0800 @@ -1649,6 +1649,11 @@ #define PCI_DEVICE_ID_OPTIBASE_VPLEXCC 0x2120 #define PCI_DEVICE_ID_OPTIBASE_VQUEST 0x2130 +/* Allied Telesyn */ +#define PCI_VENDOR_ID_AT 0x1259 +#define PCI_SUBDEVICE_ID_AT_2700FX 0x2701 +#define PCI_SUBDEVICE_ID_AT_2701FX 0x2703 + #define PCI_VENDOR_ID_ESS 0x125d #define PCI_DEVICE_ID_ESS_ESS1968 0x1968 #define PCI_DEVICE_ID_ESS_AUDIOPCI 0x1969 _ From akpm@osdl.org Mon Jan 24 18:57:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 18:58:04 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P2vs4u007340 for ; Mon, 24 Jan 2005 18:57:54 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0P2vgl20272; Mon, 24 Jan 2005 18:57:42 -0800 Message-Id: <200501250257.j0P2vgl20272@mail.osdl.org> Subject: [patch 07/10] atmel_cs: Add support LG LW2100N WLAN PCMCIA card To: davem@davemloft.net Cc: jgarzik@pobox.com, netdev@oss.sgi.com, akpm@osdl.org, justman@e1.bmstu.ru From: akpm@osdl.org Date: Mon, 24 Jan 2005 18:57:14 -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 744 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 1245 Lines: 26 From: JustMan Add support for the LG LW2100N 11Mbps WLAN PCMCIA card Signed-Off-By: Serge A. Suchkov Signed-off-by: Andrew Morton --- 25-akpm/drivers/net/wireless/atmel_cs.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) diff -puN drivers/net/wireless/atmel_cs.c~atmel_cs-add-support-lg-lw2100n-wlan-pcmcia-card drivers/net/wireless/atmel_cs.c --- 25/drivers/net/wireless/atmel_cs.c~atmel_cs-add-support-lg-lw2100n-wlan-pcmcia-card 2005-01-24 18:55:47.575064328 -0800 +++ 25-akpm/drivers/net/wireless/atmel_cs.c 2005-01-24 18:55:47.578063872 -0800 @@ -328,7 +328,8 @@ static struct { { 0, 0, "CNet/CNWLC 11Mbps Wireless PC Card V-5", "atmel_at76c502e%s.bin", "CNet CNWLC-811ARL" }, { 0, 0, "Wireless/PC_CARD", "atmel_at76c502d%s.bin", "Planet WL-3552" }, { 0, 0, "OEM/11Mbps Wireless LAN PC Card V-3", "atmel_at76c502%s.bin", "OEM 11Mbps WLAN PCMCIA Card" }, - { 0, 0, "11WAVE/11WP611AL-E", "atmel_at76c502e%s.bin", "11WAVE WaveBuddy" } + { 0, 0, "11WAVE/11WP611AL-E", "atmel_at76c502e%s.bin", "11WAVE WaveBuddy" }, + { 0, 0, "LG/LW2100N", "atmel_at76c502e%s.bin", "LG LW2100N 11Mbps WLAN PCMCIA Card" }, }; static void atmel_config(dev_link_t *link) _ From akpm@osdl.org Mon Jan 24 18:57:56 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 18:58:07 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P2vuBT007357 for ; Mon, 24 Jan 2005 18:57:56 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0P2vdl20257; Mon, 24 Jan 2005 18:57:39 -0800 Message-Id: <200501250257.j0P2vdl20257@mail.osdl.org> Subject: [patch 04/10] b44 bounce buffering fix To: davem@davemloft.net Cc: jgarzik@pobox.com, netdev@oss.sgi.com, akpm@osdl.org, pp@ee.oulu.fi From: akpm@osdl.org Date: Mon, 24 Jan 2005 18:57:11 -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 745 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 4206 Lines: 121 From: Pekka Pietikainen b44 allocates a full TX ring worth of bounce buffers to work around a DMA addressing limitation. It should do a bunch of smaller consistent allocations instead of one huge one. Signed-off-by: Andrew Morton --- 25-akpm/drivers/net/b44.c | 29 ++++++++++++++++++----------- 25-akpm/drivers/net/b44.h | 7 +++++-- 2 files changed, 23 insertions(+), 13 deletions(-) diff -puN drivers/net/b44.c~b44-bounce-buffer-fix drivers/net/b44.c --- 25/drivers/net/b44.c~b44-bounce-buffer-fix 2005-01-24 18:55:47.191122696 -0800 +++ 25-akpm/drivers/net/b44.c 2005-01-24 18:55:47.197121784 -0800 @@ -68,6 +68,8 @@ (BP)->tx_cons - (BP)->tx_prod - TX_RING_GAP(BP)) #define NEXT_TX(N) (((N) + 1) & (B44_TX_RING_SIZE - 1)) +#define B44_BOUNCEBUF(ENTRY) (bp->tx_bufs[(ENTRY)&(B44_NUM_BOUNCEBUFS-1)]+((ENTRY)>>B44_BOUNCEBUF_SHIFT)*TX_PKT_BUF_SZ) + #define RX_PKT_BUF_SZ (1536 + bp->rx_offset + 64) #define TX_PKT_BUF_SZ (B44_MAX_MTU + ETH_HLEN + 8) @@ -927,8 +929,8 @@ static int b44_start_xmit(struct sk_buff if(mapping+len > B44_DMA_MASK) { /* Chip can't handle DMA to/from >1GB, use bounce buffer */ pci_unmap_single(bp->pdev, mapping, len,PCI_DMA_TODEVICE); - memcpy(bp->tx_bufs+entry*TX_PKT_BUF_SZ,skb->data,skb->len); - mapping = pci_map_single(bp->pdev, bp->tx_bufs+entry*TX_PKT_BUF_SZ, len, PCI_DMA_TODEVICE); + memcpy(B44_BOUNCEBUF(entry),skb->data,skb->len); + mapping = pci_map_single(bp->pdev, B44_BOUNCEBUF(entry), len, PCI_DMA_TODEVICE); } bp->tx_buffers[entry].skb = skb; @@ -1059,6 +1061,7 @@ static void b44_init_rings(struct b44 *b */ static void b44_free_consistent(struct b44 *bp) { + int i; if (bp->rx_buffers) { kfree(bp->rx_buffers); bp->rx_buffers = NULL; @@ -1077,10 +1080,12 @@ static void b44_free_consistent(struct b bp->tx_ring, bp->tx_ring_dma); bp->tx_ring = NULL; } - if (bp->tx_bufs) { - pci_free_consistent(bp->pdev, B44_TX_RING_SIZE * TX_PKT_BUF_SZ, - bp->tx_bufs, bp->tx_bufs_dma); - bp->tx_bufs = NULL; + for(i = 0; i < B44_NUM_BOUNCEBUFS; i++) { + if (bp->tx_bufs[i]) { + pci_free_consistent(bp->pdev, B44_TX_RING_SIZE * TX_PKT_BUF_SZ / B44_NUM_BOUNCEBUFS, + bp->tx_bufs[i], bp->tx_bufs_dma[i]); + bp->tx_bufs[i] = NULL; + } } } @@ -1090,7 +1095,7 @@ static void b44_free_consistent(struct b */ static int b44_alloc_consistent(struct b44 *bp) { - int size; + int i,size; size = B44_RX_RING_SIZE * sizeof(struct ring_info); bp->rx_buffers = kmalloc(size, GFP_KERNEL); @@ -1104,11 +1109,13 @@ static int b44_alloc_consistent(struct b goto out_err; memset(bp->tx_buffers, 0, size); - size = B44_TX_RING_SIZE * TX_PKT_BUF_SZ; - bp->tx_bufs = pci_alloc_consistent(bp->pdev, size, &bp->tx_bufs_dma); - if (!bp->tx_bufs) + size = (B44_TX_RING_SIZE * TX_PKT_BUF_SZ) / B44_NUM_BOUNCEBUFS; + for(i = 0; i < B44_NUM_BOUNCEBUFS; i++) { + bp->tx_bufs[i] = pci_alloc_consistent(bp->pdev, size, &bp->tx_bufs_dma[i]); + if (!bp->tx_bufs[i]) goto out_err; - memset(bp->tx_bufs, 0, size); + memset(bp->tx_bufs[i], 0, size); + } size = DMA_TABLE_BYTES; bp->rx_ring = pci_alloc_consistent(bp->pdev, size, &bp->rx_ring_dma); diff -puN drivers/net/b44.h~b44-bounce-buffer-fix drivers/net/b44.h --- 25/drivers/net/b44.h~b44-bounce-buffer-fix 2005-01-24 18:55:47.193122392 -0800 +++ 25-akpm/drivers/net/b44.h 2005-01-24 18:55:47.198121632 -0800 @@ -359,6 +359,8 @@ struct ring_info { }; #define B44_MCAST_TABLE_SIZE 32 +#define B44_BOUNCEBUF_SHIFT 3 +#define B44_NUM_BOUNCEBUFS (1 << B44_BOUNCEBUF_SHIFT) /* SW copy of device statistics, kept up to date by periodic timer * which probes HW values. Must have same relative layout as HW @@ -397,7 +399,7 @@ struct b44 { struct ring_info *rx_buffers; struct ring_info *tx_buffers; - unsigned char *tx_bufs; + unsigned char *tx_bufs[B44_NUM_BOUNCEBUFS]; u32 dma_offset; u32 flags; @@ -429,7 +431,8 @@ struct b44 { struct pci_dev *pdev; struct net_device *dev; - dma_addr_t rx_ring_dma, tx_ring_dma,tx_bufs_dma; + dma_addr_t rx_ring_dma, tx_ring_dma; + dma_addr_t tx_bufs_dma[B44_NUM_BOUNCEBUFS]; u32 rx_pending; u32 tx_pending; _ From akpm@osdl.org Mon Jan 24 18:58:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 18:58:10 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P2w1uo007481 for ; Mon, 24 Jan 2005 18:58:01 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0P2vpl20304; Mon, 24 Jan 2005 18:57:51 -0800 Message-Id: <200501250257.j0P2vpl20304@mail.osdl.org> Subject: [patch 10/10] ip_conntrack build fix To: davem@davemloft.net Cc: jgarzik@pobox.com, netdev@oss.sgi.com, akpm@osdl.org, benoit.boissinot@ens-lyon.org From: akpm@osdl.org Date: Mon, 24 Jan 2005 18:57:23 -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 746 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 1593 Lines: 37 From: Benoit Boissinot Without the following patch, it doesn't compile with ip_conntrack and without ip_nat. In file included from net/ipv4/netfilter/ip_conntrack_standalone.c:34: include/linux/netfilter_ipv4/ip_conntrack.h:306: error: parameter `manip' has incomplete type include/linux/netfilter_ipv4/ip_conntrack.h: In function `ip_nat_initialized': include/linux/netfilter_ipv4/ip_conntrack.h:307: error: `IP_NAT_MANIP_SRC' undeclared (first use in this function) Signed-off-by: Benoit Boissinot Signed-off-by: Andrew Morton --- 25-akpm/include/linux/netfilter_ipv4/ip_conntrack.h | 2 ++ 1 files changed, 2 insertions(+) diff -puN include/linux/netfilter_ipv4/ip_conntrack.h~ip_conntrack-build-fix include/linux/netfilter_ipv4/ip_conntrack.h --- 25/include/linux/netfilter_ipv4/ip_conntrack.h~ip_conntrack-build-fix 2005-01-24 18:55:47.956006416 -0800 +++ 25-akpm/include/linux/netfilter_ipv4/ip_conntrack.h 2005-01-24 18:55:47.960005808 -0800 @@ -301,6 +301,7 @@ struct ip_conntrack_stat #define CONNTRACK_STAT_INC(count) (__get_cpu_var(ip_conntrack_stat).count++) +#ifdef CONFIG_IP_NF_NAT_NEEDED static inline int ip_nat_initialized(struct ip_conntrack *conntrack, enum ip_nat_manip_type manip) { @@ -308,5 +309,6 @@ static inline int ip_nat_initialized(str return test_bit(IPS_SRC_NAT_DONE_BIT, &conntrack->status); return test_bit(IPS_DST_NAT_DONE_BIT, &conntrack->status); } +#endif /* CONFIG_IP_NF_NAT_NEEDED */ #endif /* __KERNEL__ */ #endif /* _IP_CONNTRACK_H */ _ From akpm@osdl.org Mon Jan 24 18:58:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 18:58:12 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P2w0kJ007465 for ; Mon, 24 Jan 2005 18:58:00 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0P2vnl20299; Mon, 24 Jan 2005 18:57:50 -0800 Message-Id: <200501250257.j0P2vnl20299@mail.osdl.org> Subject: [patch 09/10] e100 locking up netconsole. To: davem@davemloft.net Cc: jgarzik@pobox.com, netdev@oss.sgi.com, akpm@osdl.org, rostedt@goodmis.org, mingo@elte.hu From: akpm@osdl.org Date: Mon, 24 Jan 2005 18:57:22 -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 747 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 1072 Lines: 31 From: Steven Rostedt If the transmit buffer of the e100 overflowed, then the system would hang. This was caused because the e100 driver would stop the queue, and netpoll_send_pkt in netpoll.c would then loop forever. This is because the e100 net_poll would never start the queue again after the transmits have completed. For those that use the e100 and netconsole, all you need to do is a sysreq 't' to lock up the system. Acked-by: Ingo Molnar Signed-off-by: Andrew Morton --- 25-akpm/drivers/net/e100.c | 1 + 1 files changed, 1 insertion(+) diff -puN drivers/net/e100.c~e100-locking-up-netconsole drivers/net/e100.c --- 25/drivers/net/e100.c~e100-locking-up-netconsole 2005-01-24 18:55:47.829025720 -0800 +++ 25-akpm/drivers/net/e100.c 2005-01-24 18:55:47.834024960 -0800 @@ -1630,6 +1630,7 @@ static void e100_netpoll(struct net_devi struct nic *nic = netdev_priv(netdev); e100_disable_irq(nic); e100_intr(nic->pdev->irq, netdev, NULL); + e100_tx_clean(nic); e100_enable_irq(nic); } #endif _ From akpm@osdl.org Mon Jan 24 18:58:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 18:58:18 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P2wALq007744 for ; Mon, 24 Jan 2005 18:58:10 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0P2vfl20267; Mon, 24 Jan 2005 18:57:41 -0800 Message-Id: <200501250257.j0P2vfl20267@mail.osdl.org> Subject: [patch 06/10] tun/tap ARP monitor support To: davem@davemloft.net Cc: jgarzik@pobox.com, netdev@oss.sgi.com, akpm@osdl.org, tommy.christensen@tpack.net From: akpm@osdl.org Date: Mon, 24 Jan 2005 18:57:13 -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 748 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 1088 Lines: 35 From: Tommy Christensen But as stated in bonding.txt, the ARP monitor requires the underlying driver to update dev->trans_start and dev->last_rx. The patch below adds the required functionality to the TUN/TAP driver. Please test if this helps in your case. Signed-off-by: Andrew Morton --- 25-akpm/drivers/net/tun.c | 2 ++ 1 files changed, 2 insertions(+) diff -puN drivers/net/tun.c~tun-tan-arp-monitor-support drivers/net/tun.c --- 25/drivers/net/tun.c~tun-tan-arp-monitor-support 2005-01-24 18:55:47.450083328 -0800 +++ 25-akpm/drivers/net/tun.c 2005-01-24 18:55:47.454082720 -0800 @@ -113,6 +113,7 @@ static int tun_net_xmit(struct sk_buff * /* Queue packet */ skb_queue_tail(&tun->readq, skb); + dev->trans_start = jiffies; /* Notify and wake up reader process */ if (tun->flags & TUN_FASYNC) @@ -259,6 +260,7 @@ static __inline__ ssize_t tun_get_user(s skb->ip_summed = CHECKSUM_UNNECESSARY; netif_rx_ni(skb); + tun->dev->last_rx = jiffies; tun->stats.rx_packets++; tun->stats.rx_bytes += len; _ From akpm@osdl.org Mon Jan 24 18:58:18 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 18:58:25 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P2wHwt007921 for ; Mon, 24 Jan 2005 18:58:17 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0P2vml20294; Mon, 24 Jan 2005 18:57:48 -0800 Message-Id: <200501250257.j0P2vml20294@mail.osdl.org> Subject: [patch 08/10] smc91x: power down PHY on suspend To: davem@davemloft.net Cc: jgarzik@pobox.com, netdev@oss.sgi.com, akpm@osdl.org, icampbell@arcom.com, nico@cam.org From: akpm@osdl.org Date: Mon, 24 Jan 2005 18:57:20 -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 749 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 2623 Lines: 82 From: Ian Campbell Powering down the PHY saves something like 100mA at 5V on my platform. Currently it is only done when the interface is brought down but it makes sense to do it on suspend as well. Signed-off-by: Ian Campbell Signed-off-by: Nicolas Pitre Signed-off-by: Andrew Morton --- 25-akpm/drivers/net/smc91x.c | 37 ++++++++++++++++++++----------------- 1 files changed, 20 insertions(+), 17 deletions(-) diff -puN drivers/net/smc91x.c~smc91x-power-down-phy-on-suspend drivers/net/smc91x.c --- 25/drivers/net/smc91x.c~smc91x-power-down-phy-on-suspend 2005-01-24 18:55:47.702045024 -0800 +++ 25-akpm/drivers/net/smc91x.c 2005-01-24 18:55:47.707044264 -0800 @@ -1017,13 +1017,29 @@ static int smc_phy_reset(struct net_devi /* * smc_phy_powerdown - powerdown phy * @dev: net device - * @phy: phy address * * Power down the specified PHY */ -static void smc_phy_powerdown(struct net_device *dev, int phy) +static void smc_phy_powerdown(struct net_device *dev) { + struct smc_local *lp = netdev_priv(dev); unsigned int bmcr; + int phy = lp->mii.phy_id; + + if (lp->phy_type == 0) + return; + + /* We need to ensure that no calls to smc_phy_configure are + pending. + + flush_scheduled_work() cannot be called because we are + running with the netlink semaphore held (from + devinet_ioctl()) and the pending work queue contains + linkwatch_event() (scheduled by netif_carrier_off() + above). linkwatch_event() also wants the netlink semaphore. + */ + while(lp->work_pending) + schedule(); bmcr = smc_phy_read(dev, phy, MII_BMCR); smc_phy_write(dev, phy, MII_BMCR, bmcr | BMCR_PDOWN); @@ -1561,21 +1577,7 @@ static int smc_close(struct net_device * /* clear everything */ smc_shutdown(dev); - if (lp->phy_type != 0) { - /* We need to ensure that no calls to - smc_phy_configure are pending. - - flush_scheduled_work() cannot be called because we - are running with the netlink semaphore held (from - devinet_ioctl()) and the pending work queue - contains linkwatch_event() (scheduled by - netif_carrier_off() above). linkwatch_event() also - wants the netlink semaphore. - */ - while(lp->work_pending) - schedule(); - smc_phy_powerdown(dev, lp->mii.phy_id); - } + smc_phy_powerdown(dev); if (lp->pending_tx_skb) { dev_kfree_skb(lp->pending_tx_skb); @@ -2196,6 +2198,7 @@ static int smc_drv_suspend(struct device if (netif_running(ndev)) { netif_device_detach(ndev); smc_shutdown(ndev); + smc_phy_powerdown(ndev); } } return 0; _ From akpm@osdl.org Mon Jan 24 19:07:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 19:07:49 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P37bG3012763 for ; Mon, 24 Jan 2005 19:07:41 -0800 Received: from bix (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id j0P37Tl21627; Mon, 24 Jan 2005 19:07:30 -0800 Date: Mon, 24 Jan 2005 19:07:02 -0800 From: Andrew Morton To: davem@davemloft.net, jgarzik@pobox.com, netdev@oss.sgi.com, pp@ee.oulu.fi Subject: Re: [patch 04/10] b44 bounce buffering fix Message-Id: <20050124190702.62d84861.akpm@osdl.org> In-Reply-To: <200501250257.j0P2vdl20257@mail.osdl.org> References: <200501250257.j0P2vdl20257@mail.osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 750 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 332 Lines: 9 akpm@osdl.org wrote: > > From: Pekka Pietikainen > > b44 allocates a full TX ring worth of bounce buffers to work around a DMA > addressing limitation. It should do a bunch of smaller consistent > allocations instead of one huge one. err, this one was a leak. Please ignore. I think. Driver remains fscked. From neema.network@gmail.com Mon Jan 24 19:46:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 19:46:53 -0800 (PST) Received: from GW3.webcontrolcenter.com (gw3.webcontrolcenter.com [216.119.106.223]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P3kkiI014361 for ; Mon, 24 Jan 2005 19:46:47 -0800 Received: from mail7.webcontrolcenter.com [216.119.106.105] by GW3.webcontrolcenter.com with SMTP; Mon, 24 Jan 2005 20:45:55 -0700 Received: from static75-46.dsl-chn.eth.net [61.11.75.46] by mail7.webcontrolcenter.com with SMTP; Mon, 24 Jan 2005 20:45:34 -0700 Message-ID: <41F5C109.7060801@gmail.com> Date: Tue, 25 Jan 2005 09:16:17 +0530 From: Neema User-Agent: Mozilla Thunderbird 0.7.1 (X11/20040626) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Harsh CC: linux-net@vger.kernel.org, netdev@oss.sgi.com Subject: Re: help in using eth_change_mtu References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 751 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: neema.network@gmail.com Precedence: bulk X-list: netdev Content-Length: 1145 Lines: 47 Hi, What ever u may send,the maximum size of the packet in ethernet should be 1514bytes, that includes ethernet header (And also minimum is 82bytes). I think u are using old libnet version. That function sets the MTU with the given value if neither exceeded max and nor minimum. HTH, Neema Harsh wrote: >Hello, > If some extra information is required to be sent with each >packet then does that require to change Ethernet MTU 1500 to >1500-(Bytes in extra info) or its ok with 1500 value of MTU? While >checking source code of net_init.c in drivers/net dir i found one >function eth_change_mtu. I want to know does that helps? why its given >there in source code? >regards, >Harsh. > >static int eth_change_mtu(struct net_device *dev, int new_mtu) > { > if ((new_mtu < 68) || (new_mtu > 1500)) > return -EINVAL; > dev->mtu = new_mtu; > return 0; > } >- >To unsubscribe from this list: send the line "unsubscribe linux-net" in >the body of a message to majordomo@vger.kernel.org >More majordomo info at http://vger.kernel.org/majordomo-info.html > > > -- Thanks & Regards, Neema From davem@davemloft.net Mon Jan 24 19:47:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 19:47:42 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P3lans014571 for ; Mon, 24 Jan 2005 19:47:36 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CtHc1-0007ID-00; Mon, 24 Jan 2005 19:43:29 -0800 Date: Mon, 24 Jan 2005 19:43:28 -0800 From: "David S. Miller" To: Thomas Graf Cc: herbert@gondor.apana.org.au, david@davidcoulson.net, kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-Id: <20050124194328.20a106de.davem@davemloft.net> In-Reply-To: <20050125022431.GD31837@postel.suug.ch> References: <41F50B6C.6010107@davidcoulson.net> <20050124151510.GV23931@postel.suug.ch> <20050124225423.GA15405@gondor.apana.org.au> <20050124234515.GA31837@postel.suug.ch> <20050125000759.GA15883@gondor.apana.org.au> <20050124164049.3b939791.davem@davemloft.net> <20050125014538.GB31837@postel.suug.ch> <20050125014838.GA16637@gondor.apana.org.au> <20050125020118.GC31837@postel.suug.ch> <20050124180354.63ae600d.davem@davemloft.net> <20050125022431.GD31837@postel.suug.ch> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 752 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 616 Lines: 17 On Tue, 25 Jan 2005 03:24:31 +0100 Thomas Graf wrote: > This of course explains it, didn't think of that. I thought it would > inherit the checksumming features. It should, but only in very limited cases. For example, it probably only works properly when HW vlan assist is being used on TX. It's likely that the chips which don't support VLAN assist also can't handle VLAN headers in their TX checksumming engine. Because it is very chip dependant whether this works or not in any case, we should probably create a special features flag for this. Something like NETIF_F_VLAN_INHERIT_FEATURES. From kaber@trash.net Mon Jan 24 20:57:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 20:57:54 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P4vk8d020375 for ; Mon, 24 Jan 2005 20:57:47 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.43) id 1CtIlv-0003Pc-6O; Tue, 25 Jan 2005 05:57:47 +0100 Message-ID: <41F5D1CB.9050804@trash.net> Date: Tue, 25 Jan 2005 05:57:47 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050106 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: Maillist netdev Subject: [PATCH 2.6]: keep fragment queues private to each user Content-Type: multipart/mixed; boundary="------------090606000205080907070103" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 753 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 12204 Lines: 418 This is a multi-part message in MIME format. --------------090606000205080907070103 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi Dave, This patch keeps fragment queues private to each ip_defrag user to avoid skbs jumping between different callers. It shouldn't change any wanted behaviour, the only questionable one was ip_call_ra_chain, but the RA option is included in each fragment. If you're fine with the patch I'm going to send a 2.4 version later. Regards Patrick PS: The patch should apply in any order with the netfilter patches I just sent. --------------090606000205080907070103 Content-Type: text/plain; name="x" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="x" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/25 05:35:12+01:00 kaber@coreworks.de # [IPV4]: keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # # net/ipv4/netfilter/ip_nat_standalone.c # 2005/01/25 05:35:04+01:00 kaber@coreworks.de +1 -1 # [IPV4]: keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # # net/ipv4/netfilter/ip_conntrack_standalone.c # 2005/01/25 05:35:04+01:00 kaber@coreworks.de +4 -7 # [IPV4]: keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # # net/ipv4/netfilter/ip_conntrack_core.c # 2005/01/25 05:35:04+01:00 kaber@coreworks.de +2 -9 # [IPV4]: keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # # net/ipv4/ipvs/ip_vs_core.c # 2005/01/25 05:35:04+01:00 kaber@coreworks.de +11 -8 # [IPV4]: keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # # net/ipv4/ip_input.c # 2005/01/25 05:35:04+01:00 kaber@coreworks.de +2 -2 # [IPV4]: keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # # net/ipv4/ip_fragment.c # 2005/01/25 05:35:04+01:00 kaber@coreworks.de +13 -20 # [IPV4]: keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # # include/net/ip.h # 2005/01/25 05:35:04+01:00 kaber@coreworks.de +14 -3 # [IPV4]: keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # # include/linux/netfilter_ipv4/ip_conntrack.h # 2005/01/25 05:35:04+01:00 kaber@coreworks.de +1 -2 # [IPV4]: keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # diff -Nru a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h --- a/include/linux/netfilter_ipv4/ip_conntrack.h 2005-01-25 05:35:30 +01:00 +++ b/include/linux/netfilter_ipv4/ip_conntrack.h 2005-01-25 05:35:30 +01:00 @@ -262,10 +262,9 @@ /* Fake conntrack entry for untracked connections */ extern struct ip_conntrack ip_conntrack_untracked; -extern int ip_ct_no_defrag; /* Returns new sk_buff, or NULL */ struct sk_buff * -ip_ct_gather_frags(struct sk_buff *skb); +ip_ct_gather_frags(struct sk_buff *skb, u_int32_t user); /* Iterate over all conntracks: if iter returns true, it's deleted. */ extern void diff -Nru a/include/net/ip.h b/include/net/ip.h --- a/include/net/ip.h 2005-01-25 05:35:30 +01:00 +++ b/include/net/ip.h 2005-01-25 05:35:30 +01:00 @@ -286,9 +286,20 @@ /* * Functions provided by ip_fragment.o */ - -struct sk_buff *ip_defrag(struct sk_buff *skb); -extern void ipfrag_flush(void); + +enum ip_defrag_users +{ + IP_DEFRAG_LOCAL_DELIVER, + IP_DEFRAG_CALL_RA_CHAIN, + IP_DEFRAG_CONNTRACK_IN, + IP_DEFRAG_CONNTRACK_OUT, + IP_DEFRAG_NAT_OUT, + IP_DEFRAG_VS_IN, + IP_DEFRAG_VS_OUT, + IP_DEFRAG_VS_FWD +}; + +struct sk_buff *ip_defrag(struct sk_buff *skb, u32 user); extern int ip_frag_nqueues; extern atomic_t ip_frag_mem; diff -Nru a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c --- a/net/ipv4/ip_fragment.c 2005-01-25 05:35:30 +01:00 +++ b/net/ipv4/ip_fragment.c 2005-01-25 05:35:30 +01:00 @@ -73,6 +73,7 @@ struct ipq { struct ipq *next; /* linked list pointers */ struct list_head lru_list; /* lru list member */ + u32 user; u32 saddr; u32 daddr; u16 id; @@ -243,13 +244,13 @@ /* Memory limiting on fragments. Evictor trashes the oldest * fragment queue until we are back under the threshold. */ -static void __ip_evictor(int threshold) +static void ip_evictor(void) { struct ipq *qp; struct list_head *tmp; int work; - work = atomic_read(&ip_frag_mem) - threshold; + work = atomic_read(&ip_frag_mem) - sysctl_ipfrag_low_thresh; if (work <= 0) return; @@ -274,11 +275,6 @@ } } -static inline void ip_evictor(void) -{ - __ip_evictor(sysctl_ipfrag_low_thresh); -} - /* * Oops, a fragment queue timed out. Kill it and send an ICMP reply. */ @@ -325,7 +321,8 @@ if(qp->id == qp_in->id && qp->saddr == qp_in->saddr && qp->daddr == qp_in->daddr && - qp->protocol == qp_in->protocol) { + qp->protocol == qp_in->protocol && + qp->user == user) { atomic_inc(&qp->refcnt); write_unlock(&ipfrag_lock); qp_in->last_in |= COMPLETE; @@ -352,7 +349,7 @@ } /* Add an entry to the 'ipq' queue for a newly received IP datagram. */ -static struct ipq *ip_frag_create(unsigned hash, struct iphdr *iph) +static struct ipq *ip_frag_create(unsigned hash, struct iphdr *iph, u32 user) { struct ipq *qp; @@ -364,6 +361,7 @@ qp->id = iph->id; qp->saddr = iph->saddr; qp->daddr = iph->daddr; + qp->user = user; qp->len = 0; qp->meat = 0; qp->fragments = NULL; @@ -386,7 +384,7 @@ /* Find the correct entry in the "incomplete datagrams" queue for * this IP datagram, and create new one, if nothing is found. */ -static inline struct ipq *ip_find(struct iphdr *iph) +static inline struct ipq *ip_find(struct iphdr *iph, u32 user) { __u16 id = iph->id; __u32 saddr = iph->saddr; @@ -400,7 +398,8 @@ if(qp->id == id && qp->saddr == saddr && qp->daddr == daddr && - qp->protocol == protocol) { + qp->protocol == protocol && + qp->user == user) { atomic_inc(&qp->refcnt); read_unlock(&ipfrag_lock); return qp; @@ -408,7 +407,7 @@ } read_unlock(&ipfrag_lock); - return ip_frag_create(hash, iph); + return ip_frag_create(hash, iph, user); } /* Add new segment to existing queue. */ @@ -642,7 +641,7 @@ } /* Process an incoming IP datagram fragment. */ -struct sk_buff *ip_defrag(struct sk_buff *skb) +struct sk_buff *ip_defrag(struct sk_buff *skb, u32 user) { struct iphdr *iph = skb->nh.iph; struct ipq *qp; @@ -657,7 +656,7 @@ dev = skb->dev; /* Lookup (or create) queue header */ - if ((qp = ip_find(iph)) != NULL) { + if ((qp = ip_find(iph, user)) != NULL) { struct sk_buff *ret = NULL; spin_lock(&qp->lock); @@ -689,10 +688,4 @@ add_timer(&ipfrag_secret_timer); } -void ipfrag_flush(void) -{ - __ip_evictor(0); -} - EXPORT_SYMBOL(ip_defrag); -EXPORT_SYMBOL(ipfrag_flush); diff -Nru a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c --- a/net/ipv4/ip_input.c 2005-01-25 05:35:30 +01:00 +++ b/net/ipv4/ip_input.c 2005-01-25 05:35:30 +01:00 @@ -172,7 +172,7 @@ (!sk->sk_bound_dev_if || sk->sk_bound_dev_if == skb->dev->ifindex)) { if (skb->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) { - skb = ip_defrag(skb); + skb = ip_defrag(skb, IP_DEFRAG_CALL_RA_CHAIN); if (skb == NULL) { read_unlock(&ip_ra_lock); return 1; @@ -273,7 +273,7 @@ */ if (skb->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) { - skb = ip_defrag(skb); + skb = ip_defrag(skb, IP_DEFRAG_LOCAL_DELIVER); if (!skb) return 0; } diff -Nru a/net/ipv4/ipvs/ip_vs_core.c b/net/ipv4/ipvs/ip_vs_core.c --- a/net/ipv4/ipvs/ip_vs_core.c 2005-01-25 05:35:30 +01:00 +++ b/net/ipv4/ipvs/ip_vs_core.c 2005-01-25 05:35:30 +01:00 @@ -544,9 +544,9 @@ } static inline struct sk_buff * -ip_vs_gather_frags(struct sk_buff *skb) +ip_vs_gather_frags(struct sk_buff *skb, u_int32_t user) { - skb = ip_defrag(skb); + skb = ip_defrag(skb, user); if (skb) ip_send_check(skb->nh.iph); return skb; @@ -620,7 +620,7 @@ /* reassemble IP fragments */ if (skb->nh.iph->frag_off & __constant_htons(IP_MF|IP_OFFSET)) { - skb = ip_vs_gather_frags(skb); + skb = ip_vs_gather_frags(skb, IP_DEFRAG_VS_OUT); if (!skb) return NF_STOLEN; *pskb = skb; @@ -759,7 +759,7 @@ /* reassemble IP fragments */ if (unlikely(iph->frag_off & __constant_htons(IP_MF|IP_OFFSET) && !pp->dont_defrag)) { - skb = ip_vs_gather_frags(skb); + skb = ip_vs_gather_frags(skb, IP_DEFRAG_VS_OUT); if (!skb) return NF_STOLEN; iph = skb->nh.iph; @@ -839,7 +839,8 @@ * forward to the right destination host if relevant. * Currently handles error types - unreachable, quench, ttl exceeded. */ -static int ip_vs_in_icmp(struct sk_buff **pskb, int *related) +static int +ip_vs_in_icmp(struct sk_buff **pskb, int *related, unsigned int hooknum) { struct sk_buff *skb = *pskb; struct iphdr *iph; @@ -853,7 +854,9 @@ /* reassemble IP fragments */ if (skb->nh.iph->frag_off & __constant_htons(IP_MF|IP_OFFSET)) { - skb = ip_vs_gather_frags(skb); + skb = ip_vs_gather_frags(skb, + hooknum == NF_IP_LOCAL_IN ? + IP_DEFRAG_VS_IN : IP_DEFRAG_VS_FWD); if (!skb) return NF_STOLEN; *pskb = skb; @@ -962,7 +965,7 @@ iph = skb->nh.iph; if (unlikely(iph->protocol == IPPROTO_ICMP)) { - int related, verdict = ip_vs_in_icmp(pskb, &related); + int related, verdict = ip_vs_in_icmp(pskb, &related, hooknum); if (related) return verdict; @@ -1057,7 +1060,7 @@ if ((*pskb)->nh.iph->protocol != IPPROTO_ICMP) return NF_ACCEPT; - return ip_vs_in_icmp(pskb, &r); + return ip_vs_in_icmp(pskb, &r, hooknum); } diff -Nru a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c --- a/net/ipv4/netfilter/ip_conntrack_core.c 2005-01-25 05:35:30 +01:00 +++ b/net/ipv4/netfilter/ip_conntrack_core.c 2005-01-25 05:35:30 +01:00 @@ -936,29 +936,22 @@ } } -int ip_ct_no_defrag; - /* Returns new sk_buff, or NULL */ struct sk_buff * -ip_ct_gather_frags(struct sk_buff *skb) +ip_ct_gather_frags(struct sk_buff *skb, u_int32_t user) { struct sock *sk = skb->sk; #ifdef CONFIG_NETFILTER_DEBUG unsigned int olddebug = skb->nf_debug; #endif - if (unlikely(ip_ct_no_defrag)) { - kfree_skb(skb); - return NULL; - } - if (sk) { sock_hold(sk); skb_orphan(skb); } local_bh_disable(); - skb = ip_defrag(skb); + skb = ip_defrag(skb, user); local_bh_enable(); if (!skb) { diff -Nru a/net/ipv4/netfilter/ip_conntrack_standalone.c b/net/ipv4/netfilter/ip_conntrack_standalone.c --- a/net/ipv4/netfilter/ip_conntrack_standalone.c 2005-01-25 05:35:30 +01:00 +++ b/net/ipv4/netfilter/ip_conntrack_standalone.c 2005-01-25 05:35:30 +01:00 @@ -391,7 +391,10 @@ /* Gather fragments. */ if ((*pskb)->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) { - *pskb = ip_ct_gather_frags(*pskb); + *pskb = ip_ct_gather_frags(*pskb, + hooknum == NF_IP_PRE_ROUTING ? + IP_DEFRAG_CONNTRACK_IN : + IP_DEFRAG_CONNTRACK_OUT); if (!*pskb) return NF_STOLEN; } @@ -823,12 +826,6 @@ cleanup_defraglocalops: nf_unregister_hook(&ip_conntrack_defrag_local_out_ops); cleanup_defragops: - /* Frag queues may hold fragments with skb->dst == NULL */ - ip_ct_no_defrag = 1; - synchronize_net(); - local_bh_disable(); - ipfrag_flush(); - local_bh_enable(); nf_unregister_hook(&ip_conntrack_defrag_ops); cleanup_proc_stat: #ifdef CONFIG_PROC_FS diff -Nru a/net/ipv4/netfilter/ip_nat_standalone.c b/net/ipv4/netfilter/ip_nat_standalone.c --- a/net/ipv4/netfilter/ip_nat_standalone.c 2005-01-25 05:35:30 +01:00 +++ b/net/ipv4/netfilter/ip_nat_standalone.c 2005-01-25 05:35:30 +01:00 @@ -195,7 +195,7 @@ I'm starting to have nightmares about fragments. */ if ((*pskb)->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) { - *pskb = ip_ct_gather_frags(*pskb); + *pskb = ip_ct_gather_frags(*pskb, IP_DEFRAG_NAT_OUT); if (!*pskb) return NF_STOLEN; --------------090606000205080907070103-- From rddunlap@osdl.org Mon Jan 24 21:51:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 21:51:32 -0800 (PST) Received: from fire-1.osdl.org (fire.osdl.org [65.172.181.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P5pLV8022387 for ; Mon, 24 Jan 2005 21:51:26 -0800 Received: from [192.168.1.103] (wbar2.sea1-4-5-049-023.sea1.dsl-verizon.net [4.5.49.23]) (authenticated bits=0) by fire-1.osdl.org (8.12.8/8.12.8) with ESMTP id j0P5pETV003171 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Mon, 24 Jan 2005 21:51:15 -0800 Message-ID: <41F5DC6E.8070203@osdl.org> Date: Mon, 24 Jan 2005 21:43:10 -0800 From: "Randy.Dunlap" User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev , davem@davemloft.net Subject: [PATCH] vlan: eliminate gcc warnings with PROC_FS=n Content-Type: multipart/mixed; boundary="------------010209060609010907080707" X-MIMEDefang-Filter: osdl$Revision: 1.100 $ X-Scanned-By: MIMEDefang 2.36 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 754 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 1256 Lines: 40 This is a multi-part message in MIME format. --------------010209060609010907080707 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Eliminate gcc warnings when PROC_FS=n: net/8021q/vlan.c:232: warning: statement with no effect net/appletalk/ddp.c:1893: warning: statement with no effect Signed-off-by: Randy Dunlap diffstat:= net/8021q/vlanproc.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) --------------010209060609010907080707 Content-Type: text/x-patch; name="vlan_procfs.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="vlan_procfs.patch" diff -Naurp ./net/8021q/vlanproc.h~vlan_procfs ./net/8021q/vlanproc.h --- ./net/8021q/vlanproc.h~vlan_procfs 2004-12-24 13:35:40.000000000 -0800 +++ ./net/8021q/vlanproc.h 2005-01-24 21:30:23.216681008 -0800 @@ -11,8 +11,8 @@ void vlan_proc_cleanup (void); #define vlan_proc_init() (0) #define vlan_proc_cleanup() do {} while(0) -#define vlan_proc_add_dev(dev) ((void)(dev), 0) -#define vlan_proc_rem_dev(dev) ((void)(dev), 0) +#define vlan_proc_add_dev(dev) ({(void)(dev), 0;}) +#define vlan_proc_rem_dev(dev) ({(void)(dev), 0;}) #endif --------------010209060609010907080707-- From hanemade@gmail.com Mon Jan 24 22:20:10 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 24 Jan 2005 22:20:15 -0800 (PST) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.206]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0P6K7Bf023525 for ; Mon, 24 Jan 2005 22:20:09 -0800 Received: by rproxy.gmail.com with SMTP id b11so61076rne for ; Mon, 24 Jan 2005 22:20:06 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=HDnQtS9kC/BXP3XpcdqjIfgB7L1uWhWMLM8TFZQ/ZU/HmnlasEyCvjeOg64s2xVa4vBJEV/itUnlvDmUwnBg0/FZ+7mJ/m8NAN7xbaFh0iY80nQYHD6kwgzf4FdghXF3ULBLQMU794NucwVBs1dc6Ay/eHQdIqmmgHkXcmAa3f4= Received: by 10.38.149.55 with SMTP id w55mr289217rnd; Mon, 24 Jan 2005 22:20:06 -0800 (PST) Received: by 10.38.161.59 with HTTP; Mon, 24 Jan 2005 22:20:06 -0800 (PST) Message-ID: Date: Tue, 25 Jan 2005 11:50:06 +0530 From: Harsh Reply-To: Harsh To: Neema Subject: Re: help in using eth_change_mtu Cc: linux-net@vger.kernel.org, netdev@oss.sgi.com In-Reply-To: <41F5C109.7060801@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <41F5C109.7060801@gmail.com> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 755 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hanemade@gmail.com Precedence: bulk X-list: netdev Content-Length: 1588 Lines: 54 Hello , Extra info mean IPSEC headers. How can they sent in 2.4.24 kernel? where can i find Packets being using IPSEC headers and is that require to reduce MTU by AH/ESP header bytes??? Also can you tellme in which condition eth_change_mtu used? reagards, Harsh. On Tue, 25 Jan 2005 09:16:17 +0530, Neema wrote: > Hi, > > What ever u may send,the maximum size of the packet in ethernet > should be 1514bytes, that includes ethernet header (And also minimum is > 82bytes). > I think u are using old libnet version. That function sets the MTU with > the given value if neither exceeded max and nor minimum. > > HTH, > Neema > > Harsh wrote: > > >Hello, > > If some extra information is required to be sent with each > >packet then does that require to change Ethernet MTU 1500 to > >1500-(Bytes in extra info) or its ok with 1500 value of MTU? While > >checking source code of net_init.c in drivers/net dir i found one > >function eth_change_mtu. I want to know does that helps? why its given > >there in source code? > >regards, > >Harsh. > > > >static int eth_change_mtu(struct net_device *dev, int new_mtu) > > { > > if ((new_mtu < 68) || (new_mtu > 1500)) > > return -EINVAL; > > dev->mtu = new_mtu; > > return 0; > > } > >- > >To unsubscribe from this list: send the line "unsubscribe linux-net" in > >the body of a message to majordomo@vger.kernel.org > >More majordomo info at http://vger.kernel.org/majordomo-info.html > > > > > > > > -- > > Thanks & Regards, > Neema > > From herbert@gondor.apana.org.au Tue Jan 25 03:25:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 03:25:56 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0PBPlox005046 for ; Tue, 25 Jan 2005 03:25:48 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CtOop-0002qs-00; Tue, 25 Jan 2005 22:25:11 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CtOnT-0005O9-00; Tue, 25 Jan 2005 22:23:47 +1100 Date: Tue, 25 Jan 2005 22:23:46 +1100 To: "David S. Miller" Cc: tgraf@suug.ch, david@davidcoulson.net, kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-ID: <20050125112346.GA20704@gondor.apana.org.au> References: <20050124005348.GL23931@postel.suug.ch> <20050123202715.281ac87c.davem@davemloft.net> <20050124121610.GP23931@postel.suug.ch> <41F50B6C.6010107@davidcoulson.net> <20050124151510.GV23931@postel.suug.ch> <20050124225423.GA15405@gondor.apana.org.au> <20050124234515.GA31837@postel.suug.ch> <20050125000759.GA15883@gondor.apana.org.au> <20050124164049.3b939791.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050124164049.3b939791.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 756 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 457 Lines: 14 On Mon, Jan 24, 2005 at 04:40:49PM -0800, David S. Miller wrote: > > Good catch Herbert, I'll integrate this fix. 2.4.x needs it too > I'm pretty sure. Well I just had a look there and no, this clever frag reuse code was added in 2.5. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From herbert@gondor.apana.org.au Tue Jan 25 03:57:51 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 03:57:58 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0PBvn5U006117 for ; Tue, 25 Jan 2005 03:57:50 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CtPK7-0003Ig-00; Tue, 25 Jan 2005 22:57:31 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CtPJf-0005RG-00; Tue, 25 Jan 2005 22:57:03 +1100 From: Herbert Xu To: kaber@trash.net (Patrick McHardy) Subject: Re: [PATCH 2.6]: keep fragment queues private to each user Cc: davem@davemloft.net, netdev@oss.sgi.com Organization: Core In-Reply-To: <41F5D1CB.9050804@trash.net> X-Newsgroups: apana.lists.os.linux.netdev User-Agent: tin/1.7.4-20040225 ("Benbecula") (UNIX) (Linux/2.4.27-hx-1-686-smp (i686)) Message-Id: Date: Tue, 25 Jan 2005 22:57:03 +1100 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 757 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 756 Lines: 20 Patrick McHardy wrote: > > This patch keeps fragment queues private to each ip_defrag user to avoid > skbs jumping between different callers. It shouldn't change any wanted > behaviour, the only questionable one was ip_call_ra_chain, but the RA > option is included in each fragment. If you're fine with the patch I'm going > to send a 2.4 version later. Patch looks good. However, I think this is still not enough. What about fragments that come from different interfaces? Fragments with different security paths? Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From david@davidcoulson.net Tue Jan 25 04:05:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 04:06:02 -0800 (PST) Received: from mail.mx.davidcoulson.net (ns1.openconsultancy.com [207.166.203.131]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0PC5kCK007116 for ; Tue, 25 Jan 2005 04:05:46 -0800 Received: (qmail 30421 invoked for bounce); 25 Jan 2005 12:05:40 +0000 Received: from unknown (HELO mx3.openconsultancy.com) (qmailr@10.2.0.36) by tailtiu.dmz.davidcoulson.net (qmail 1.03-djc-2) with SMTP; 25 Jan 2005 12:05:40 +0000 Received: (qmail 31380 invoked from network); 25 Jan 2005 12:05:39 -0000 Received: from unknown (HELO ?10.2.3.172?) (10.2.3.172) by vlan-102.core.davidcoulson.net with SMTP; 25 Jan 2005 12:05:39 -0000 Message-ID: <41F63617.8090307@davidcoulson.net> Date: Tue, 25 Jan 2005 07:05:43 -0500 From: David Coulson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: Thomas Graf , herbert@gondor.apana.org.au, kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help References: <41F50B6C.6010107@davidcoulson.net> <20050124151510.GV23931@postel.suug.ch> <20050124225423.GA15405@gondor.apana.org.au> <20050124234515.GA31837@postel.suug.ch> <20050125000759.GA15883@gondor.apana.org.au> <20050124164049.3b939791.davem@davemloft.net> <20050125014538.GB31837@postel.suug.ch> <20050125014838.GA16637@gondor.apana.org.au> <20050125020118.GC31837@postel.suug.ch> <20050124180354.63ae600d.davem@davemloft.net> <20050125022431.GD31837@postel.suug.ch> <20050124194328.20a106de.davem@davemloft.net> In-Reply-To: <20050124194328.20a106de.davem@davemloft.net> X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 758 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: david@davidcoulson.net Precedence: bulk X-list: netdev Content-Length: 697 Lines: 22 David S. Miller wrote: > For example, it probably only works properly when HW vlan assist > is being used on TX. It's likely that the chips which don't support > VLAN assist also can't handle VLAN headers in their TX checksumming > engine. This is in acenic.c - ACENIC_DO_VLAN is a check to see if 8021q is compiled into the kernel or available as a module. #if ACENIC_DO_VLAN dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; dev->vlan_rx_register = ace_vlan_rx_register; dev->vlan_rx_kill_vid = ace_vlan_rx_kill_vid; #endif David -- David J. Coulson email: david@davidcoulson.net web: http://www.davidcoulson.net/ phone: (216) 920-3100 / (216) 258-4942 From david@davidcoulson.net Tue Jan 25 06:16:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 06:16:48 -0800 (PST) Received: from mail.mx.davidcoulson.net (ns1.openconsultancy.com [207.166.203.131]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0PEGfvB014179 for ; Tue, 25 Jan 2005 06:16:42 -0800 Received: (qmail 14342 invoked for bounce); 25 Jan 2005 14:16:35 +0000 Received: from unknown (HELO mx3.openconsultancy.com) (qmailr@10.2.0.36) by tailtiu.dmz.davidcoulson.net (qmail 1.03-djc-2) with SMTP; 25 Jan 2005 14:16:35 +0000 Received: (qmail 6539 invoked from network); 25 Jan 2005 14:16:34 -0000 Received: from unknown (HELO ?10.6.1.3?) (10.6.1.3) by vlan-102.core.davidcoulson.net with SMTP; 25 Jan 2005 14:16:34 -0000 Message-ID: <41F654C5.5080108@davidcoulson.net> Date: Tue, 25 Jan 2005 09:16:37 -0500 From: David Coulson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Herbert Xu CC: Thomas Graf , "David S. Miller" , kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help References: <20050124005348.GL23931@postel.suug.ch> <20050123202715.281ac87c.davem@davemloft.net> <20050124121610.GP23931@postel.suug.ch> <41F50B6C.6010107@davidcoulson.net> <20050124151510.GV23931@postel.suug.ch> <20050124225423.GA15405@gondor.apana.org.au> In-Reply-To: <20050124225423.GA15405@gondor.apana.org.au> X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 759 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: david@davidcoulson.net Precedence: bulk X-list: netdev Content-Length: 818 Lines: 26 Herbert Xu wrote: > OK, I think I've found the problem. It's a totally innocuous bug > in ip_fragment/ip6_fragment. When we're in the fast path and use > the pre-existing frag_list skb's, we forgot to clear ip_summed. Okay - I applied Herbert's patch to my kernels and it all looks good now. Thomas showed me how to generate fragged packets using hping2 (handy tool!) and replicate the kernel failure. I slammed it with hping2 for a while, and didn't experience any kernel errors or see any debug information from previous patches. Everything is working as it should be, and I verified I saw the fragged packets in tcpdump to make sure they were being routed properly. :-) David -- David J. Coulson email: david@davidcoulson.net web: http://www.davidcoulson.net/ phone: (216) 920-3100 / (216) 258-4942 From tgraf@suug.ch Tue Jan 25 06:33:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 06:33:08 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0PEX1cT014939 for ; Tue, 25 Jan 2005 06:33:01 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id D679185; Tue, 25 Jan 2005 15:32:37 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 15A051C0EA; Tue, 25 Jan 2005 15:33:19 +0100 (CET) Date: Tue, 25 Jan 2005 15:33:19 +0100 From: Thomas Graf To: "David S. Miller" Cc: herbert@gondor.apana.org.au, david@davidcoulson.net, kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-ID: <20050125143319.GF31837@postel.suug.ch> References: <20050124225423.GA15405@gondor.apana.org.au> <20050124234515.GA31837@postel.suug.ch> <20050125000759.GA15883@gondor.apana.org.au> <20050124164049.3b939791.davem@davemloft.net> <20050125014538.GB31837@postel.suug.ch> <20050125014838.GA16637@gondor.apana.org.au> <20050125020118.GC31837@postel.suug.ch> <20050124180354.63ae600d.davem@davemloft.net> <20050125022431.GD31837@postel.suug.ch> <20050124194328.20a106de.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050124194328.20a106de.davem@davemloft.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 760 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 965 Lines: 24 * David S. Miller <20050124194328.20a106de.davem@davemloft.net> 2005-01-24 19:43 > On Tue, 25 Jan 2005 03:24:31 +0100 > Thomas Graf wrote: > > > This of course explains it, didn't think of that. I thought it would > > inherit the checksumming features. > > It should, but only in very limited cases. > > For example, it probably only works properly when HW vlan assist > is being used on TX. It's likely that the chips which don't support > VLAN assist also can't handle VLAN headers in their TX checksumming > engine. I agreed, but those who have vlan accel are likely to be able to also do the checksumming. > Because it is very chip dependant whether this works or not in > any case, we should probably create a special features flag for > this. Something like NETIF_F_VLAN_INHERIT_FEATURES. Can't we just use NETIF_F_HW_VLAN_TX for this and inherit NETIF_F_HW_CSUM | NETIF_F_IP_CSUM if it is set? I don't have any specs at hand though. From kaber@trash.net Tue Jan 25 06:41:38 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 06:41:42 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0PEfbcE015571 for ; Tue, 25 Jan 2005 06:41:38 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.43) id 1CtRsP-0006Kg-2C; Tue, 25 Jan 2005 15:41:05 +0100 Message-ID: <41F65A80.70808@trash.net> Date: Tue, 25 Jan 2005 15:41:04 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050106 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: Herbert Xu CC: davem@davemloft.net, netdev@oss.sgi.com Subject: Re: [PATCH 2.6]: keep fragment queues private to each user References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 761 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 586 Lines: 16 Herbert Xu wrote: >However, I think this is still not enough. What about fragments >that come from different interfaces? Fragments with different >security paths? > Fragments with different security paths are indeed a problem, I already tried fixing them by keeping the secpaths of all fragments on a list in the head secpath and changing __xfrm_policy_check to deal with them, but it is pretty tricky to get right. For different interfaces: I'm not exactly sure where this is a problem, except that any classification will only look at the head fragment interface. Regards Patrick From ahaas@airmail.net Tue Jan 25 07:05:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 07:05:29 -0800 (PST) Received: from covert.brown-ring.iadfw.net (covert.brown-ring.iadfw.net [209.196.123.143]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0PF5IE5016675 for ; Tue, 25 Jan 2005 07:05:25 -0800 Received: from pppte04-253.ght.iadfw.net ([66.94.134.253] helo=pcdebian) by covert.iadfw.net with esmtp (Exim 4.24) id 1CtSHo-0002po-OY for netdev@oss.sgi.com; Tue, 25 Jan 2005 09:07:21 -0600 Received: (qmail 2611 invoked by uid 1000); 25 Jan 2005 15:05:15 -0000 From: "Art Haas" Date: Tue, 25 Jan 2005 09:05:14 -0600 To: netdev@oss.sgi.com Subject: Current kernel and cvs/rsync problems Message-ID: <20050125150514.GA2262@artsapartment.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 762 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ahaas@airmail.net Precedence: bulk X-list: netdev Content-Length: 872 Lines: 22 Hi. I'm running the current BK kernel on my machine. As the subject stated both cvs and rsync are not working correctly under this kernel, while they work fine under a kernel built from BK sources several days prior to the release of the -rc2 kernel. Watching cvs with strace I can observe that the various file tests run without problems, but once cvs starts the network activity with write() or read() calls things just hang. While both cvs and rsync fail under the -rc2+ kernels, other programs like subversion and BitKeeper still work, and I can view web things with Mozilla without problem. Is anyone seeing similar behavior with the current BK kernel? Art Haas -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 From rmk+netdev=oss.sgi.com@arm.linux.org.uk Tue Jan 25 11:32:23 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 11:32:30 -0800 (PST) Received: from caramon.arm.linux.org.uk (caramon.arm.linux.org.uk [212.18.232.186]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0PJWLlW026273 for ; Tue, 25 Jan 2005 11:32:22 -0800 Received: from flint.arm.linux.org.uk ([2002:d412:e8ba:1:201:2ff:fe14:8fad]) by caramon.arm.linux.org.uk with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.41) id 1CtWQ5-0006yW-9X; Tue, 25 Jan 2005 19:32:09 +0000 Received: from rmk by flint.arm.linux.org.uk with local (Exim 4.41) id 1CtWQ4-0008JE-1H; Tue, 25 Jan 2005 19:32:08 +0000 Date: Tue, 25 Jan 2005 19:32:07 +0000 From: Russell King To: Andrew Morton , Jens Axboe , alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? Message-ID: <20050125193207.B30094@flint.arm.linux.org.uk> Mail-Followup-To: Andrew Morton , Jens Axboe , alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com References: <20050121161959.GO3922@fi.muni.cz> <1106360639.15804.1.camel@boxen> <20050123091154.GC16648@suse.de> <20050123011918.295db8e8.akpm@osdl.org> <20050123095608.GD16648@suse.de> <20050123023248.263daca9.akpm@osdl.org> <20050123200315.A25351@flint.arm.linux.org.uk> <20050124114853.A16971@flint.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20050124114853.A16971@flint.arm.linux.org.uk>; from rmk+lkml@arm.linux.org.uk on Mon, Jan 24, 2005 at 11:48:53AM +0000 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 763 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rmk+lkml@arm.linux.org.uk Precedence: bulk X-list: netdev Content-Length: 3309 Lines: 113 On Mon, Jan 24, 2005 at 11:48:53AM +0000, Russell King wrote: > On Sun, Jan 23, 2005 at 08:03:15PM +0000, Russell King wrote: > > I think I may be seeing something odd here, maybe a possible memory leak. > > The only problem I have is wondering whether I'm actually comparing like > > with like. Maybe some networking people can provide a hint? > > > > Below is gathered from 2.6.11-rc1. > > > > bash-2.05a# cat /proc/net/rt_cache | wc -l; grep ip_dst /proc/slabinfo > > 24 > > ip_dst_cache 669 885 256 15 1 > > > > I'm fairly positive when I rebooted the machine a couple of days ago, > > ip_dst_cache was significantly smaller for the same number of lines in > > /proc/net/rt_cache. > > FYI, today it looks like this: > > bash-2.05a# cat /proc/net/rt_cache | wc -l; grep ip_dst /proc/slabinfo > 26 > ip_dst_cache 820 1065 256 15 1 > > So the dst cache seems to have grown by 151 in 16 hours... I'll continue > monitoring and providing updates. Tonights update: 50 ip_dst_cache 1024 1245 256 15 1 As you can see, the dst cache is consistently growing by about 200 entries per day. Given this, I predict that the box will fall over due to "dst cache overflow" in roughly 35 days. kernel network configuration: CONFIG_INET=y CONFIG_IP_MULTICAST=y CONFIG_IP_ADVANCED_ROUTER=y CONFIG_IP_MULTIPLE_TABLES=y CONFIG_IP_ROUTE_FWMARK=y CONFIG_IP_ROUTE_VERBOSE=y CONFIG_IP_PNP=y CONFIG_IP_PNP_BOOTP=y CONFIG_SYN_COOKIES=y CONFIG_IPV6=y CONFIG_NETFILTER=y CONFIG_IP_NF_CONNTRACK=y CONFIG_IP_NF_CONNTRACK_MARK=y CONFIG_IP_NF_FTP=y CONFIG_IP_NF_IRC=y CONFIG_IP_NF_IPTABLES=y CONFIG_IP_NF_MATCH_LIMIT=y CONFIG_IP_NF_MATCH_IPRANGE=y CONFIG_IP_NF_MATCH_MAC=m CONFIG_IP_NF_MATCH_PKTTYPE=m CONFIG_IP_NF_MATCH_MARK=y CONFIG_IP_NF_MATCH_MULTIPORT=m CONFIG_IP_NF_MATCH_TOS=m CONFIG_IP_NF_MATCH_RECENT=y CONFIG_IP_NF_MATCH_ECN=m CONFIG_IP_NF_MATCH_DSCP=m CONFIG_IP_NF_MATCH_AH_ESP=m CONFIG_IP_NF_MATCH_LENGTH=m CONFIG_IP_NF_MATCH_TTL=m CONFIG_IP_NF_MATCH_TCPMSS=m CONFIG_IP_NF_MATCH_HELPER=y CONFIG_IP_NF_MATCH_STATE=y CONFIG_IP_NF_MATCH_CONNTRACK=y CONFIG_IP_NF_MATCH_ADDRTYPE=m CONFIG_IP_NF_MATCH_REALM=m CONFIG_IP_NF_MATCH_CONNMARK=m CONFIG_IP_NF_MATCH_HASHLIMIT=m CONFIG_IP_NF_FILTER=y CONFIG_IP_NF_TARGET_REJECT=y CONFIG_IP_NF_TARGET_LOG=m CONFIG_IP_NF_TARGET_TCPMSS=m CONFIG_IP_NF_NAT=y CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=y CONFIG_IP_NF_TARGET_REDIRECT=y CONFIG_IP_NF_TARGET_NETMAP=y CONFIG_IP_NF_TARGET_SAME=y CONFIG_IP_NF_NAT_IRC=y CONFIG_IP_NF_NAT_FTP=y CONFIG_IP_NF_MANGLE=y CONFIG_IP_NF_TARGET_TOS=m CONFIG_IP_NF_TARGET_ECN=m CONFIG_IP_NF_TARGET_DSCP=m CONFIG_IP_NF_TARGET_MARK=y CONFIG_IP_NF_TARGET_CLASSIFY=m CONFIG_IP_NF_TARGET_CONNMARK=m CONFIG_IP_NF_TARGET_CLUSTERIP=m CONFIG_IP6_NF_IPTABLES=y CONFIG_IP6_NF_MATCH_LIMIT=y CONFIG_IP6_NF_MATCH_MAC=y CONFIG_IP6_NF_MATCH_RT=y CONFIG_IP6_NF_MATCH_OPTS=y CONFIG_IP6_NF_MATCH_FRAG=y CONFIG_IP6_NF_MATCH_HL=y CONFIG_IP6_NF_MATCH_MULTIPORT=y CONFIG_IP6_NF_MATCH_MARK=y CONFIG_IP6_NF_MATCH_AHESP=y CONFIG_IP6_NF_MATCH_LENGTH=y CONFIG_IP6_NF_FILTER=y CONFIG_IP6_NF_MANGLE=y CONFIG_IP6_NF_TARGET_MARK=y -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/ 2.6 Serial core From tgraf@suug.ch Tue Jan 25 12:35:51 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 12:35:58 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0PKZons018108 for ; Tue, 25 Jan 2005 12:35:50 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 645D3F; Tue, 25 Jan 2005 21:35:26 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 1412F1C0EA; Tue, 25 Jan 2005 21:36:08 +0100 (CET) Date: Tue, 25 Jan 2005 21:36:07 +0100 From: Thomas Graf To: "David S. Miller" Cc: herbert@gondor.apana.org.au, david@davidcoulson.net, kaber@trash.net, greearb@candelatech.com, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-ID: <20050125203607.GG31837@postel.suug.ch> References: <20050124234515.GA31837@postel.suug.ch> <20050125000759.GA15883@gondor.apana.org.au> <20050124164049.3b939791.davem@davemloft.net> <20050125014538.GB31837@postel.suug.ch> <20050125014838.GA16637@gondor.apana.org.au> <20050125020118.GC31837@postel.suug.ch> <20050124180354.63ae600d.davem@davemloft.net> <20050125022431.GD31837@postel.suug.ch> <20050124194328.20a106de.davem@davemloft.net> <20050125143319.GF31837@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050125143319.GF31837@postel.suug.ch> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 764 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 3150 Lines: 79 * Thomas Graf <20050125143319.GF31837@postel.suug.ch> 2005-01-25 15:33 > * David S. Miller <20050124194328.20a106de.davem@davemloft.net> 2005-01-24 19:43 > > On Tue, 25 Jan 2005 03:24:31 +0100 > > Thomas Graf wrote: > > > > > This of course explains it, didn't think of that. I thought it would > > > inherit the checksumming features. > > > > It should, but only in very limited cases. > > > > Because it is very chip dependant whether this works or not in > > any case, we should probably create a special features flag for > > this. Something like NETIF_F_VLAN_INHERIT_FEATURES. > > Can't we just use NETIF_F_HW_VLAN_TX for this and inherit > NETIF_F_HW_CSUM | NETIF_F_IP_CSUM if it is set? I don't have any > specs at hand though. Vlan devices don't inherit any features at the moment but it would make sense to do so. NETIF_F_SG|NETIF_F_TSO: The normal vlan code seems to handle pskbs correctly, we don't gain that much though. The big gain would be in the driver specific accel code. I assume that the driver specific accel code is aware of pskbs if the card can handle it but I haven't checked this yet. NETIF_F_NO_CSUM: Avoid checksumming for vlan devices on loopback interfaces. NETIF_F_HIGHDMA|NETIF_F_FRAGLIST: Didn't find a reason why this would cause problems. NETIF_F_LLTX: vlan code accesses statistic counters so I think we can't inherit. It might be worth to make it clean though. NETIF_F_IP_CSUM|NETIF_F_HW_CSUM: Assuming that the vlan accel code can always do the checksumming if the card can do it. Otherwise we need a mask describing which features can be inherited. Thoughts? diff -Nru linux-2.6.11-rc2-bk2.orig/include/linux/if_vlan.h linux-2.6.11-rc2-bk2/include/linux/if_vlan.h --- linux-2.6.11-rc2-bk2.orig/include/linux/if_vlan.h 2005-01-25 00:49:27.000000000 +0100 +++ linux-2.6.11-rc2-bk2/include/linux/if_vlan.h 2005-01-25 18:51:11.000000000 +0100 @@ -61,6 +61,9 @@ #define VLAN_VID_MASK 0xfff +#define VLAN_COMP_FEATURES(f) ((f) & (NETIF_F_SG|NETIF_F_NO_CSUM| \ + NETIF_F_HIGHDMA|NETIF_F_FRAGLIST|NETIF_F_TSO)) + /* found in socket.c */ extern void vlan_ioctl_set(int (*hook)(void __user *)); diff -Nru linux-2.6.11-rc2-bk2.orig/net/8021q/vlan.c linux-2.6.11-rc2-bk2/net/8021q/vlan.c --- linux-2.6.11-rc2-bk2.orig/net/8021q/vlan.c 2005-01-25 00:50:01.000000000 +0100 +++ linux-2.6.11-rc2-bk2/net/8021q/vlan.c 2005-01-25 18:54:45.000000000 +0100 @@ -459,6 +459,8 @@ /* TODO: maybe just assign it to be ETHERNET? */ new_dev->type = real_dev->type; + new_dev->features = VLAN_COMP_FEATURES(real_dev->features); + new_dev->hard_header_len = real_dev->hard_header_len; if (!(real_dev->features & NETIF_F_HW_VLAN_TX)) { /* Regular ethernet + 4 bytes (18 total). */ @@ -477,6 +479,7 @@ new_dev->hard_header = real_dev->hard_header; new_dev->hard_start_xmit = vlan_dev_hwaccel_hard_start_xmit; new_dev->rebuild_header = real_dev->rebuild_header; + new_dev->features = real_dev->features & (NETIF_F_IP_CSUM | NETIF_F_HW_CSUM); } else { new_dev->hard_header = vlan_dev_hard_header; new_dev->hard_start_xmit = vlan_dev_hard_start_xmit; From herbert@gondor.apana.org.au Tue Jan 25 12:48:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 12:48:29 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0PKmKVX018698 for ; Tue, 25 Jan 2005 12:48:21 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CtXbP-0008Iw-00; Wed, 26 Jan 2005 07:47:55 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CtXay-0006EM-00; Wed, 26 Jan 2005 07:47:28 +1100 Date: Wed, 26 Jan 2005 07:47:28 +1100 To: Patrick McHardy Cc: davem@davemloft.net, netdev@oss.sgi.com Subject: Re: [PATCH 2.6]: keep fragment queues private to each user Message-ID: <20050125204728.GA23939@gondor.apana.org.au> References: <41F65A80.70808@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F65A80.70808@trash.net> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 765 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 552 Lines: 12 On Tue, Jan 25, 2005 at 03:41:04PM +0100, Patrick McHardy wrote: > > deal with them, but it is pretty tricky to get right. For different > interfaces: I'm not exactly sure where this is a problem, except > that any classification will only look at the head fragment interface. Well consider an IPIP interface over a transport mode ESP SA... -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From greearb@candelatech.com Tue Jan 25 12:49:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 12:49:14 -0800 (PST) Received: from www.lanforge.com (ns1.lanforge.com [66.165.47.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0PKn7GO018947 for ; Tue, 25 Jan 2005 12:49:08 -0800 Received: from [4.33.45.22] (evrtwa1-ar2-4-33-045-022.evrtwa1.dsl-verizon.net [4.33.45.22]) (authenticated bits=0) by www.lanforge.com (8.12.8/8.12.8) with ESMTP id j0PL6OLH021406; Tue, 25 Jan 2005 13:06:24 -0800 Message-ID: <41F6B090.6020602@candelatech.com> Date: Tue, 25 Jan 2005 12:48:16 -0800 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041020 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Thomas Graf CC: "David S. Miller" , herbert@gondor.apana.org.au, david@davidcoulson.net, kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help References: <20050124234515.GA31837@postel.suug.ch> <20050125000759.GA15883@gondor.apana.org.au> <20050124164049.3b939791.davem@davemloft.net> <20050125014538.GB31837@postel.suug.ch> <20050125014838.GA16637@gondor.apana.org.au> <20050125020118.GC31837@postel.suug.ch> <20050124180354.63ae600d.davem@davemloft.net> <20050125022431.GD31837@postel.suug.ch> <20050124194328.20a106de.davem@davemloft.net> <20050125143319.GF31837@postel.suug.ch> <20050125203607.GG31837@postel.suug.ch> In-Reply-To: <20050125203607.GG31837@postel.suug.ch> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 766 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Content-Length: 2177 Lines: 60 Thomas Graf wrote: > * Thomas Graf <20050125143319.GF31837@postel.suug.ch> 2005-01-25 15:33 > >>* David S. Miller <20050124194328.20a106de.davem@davemloft.net> 2005-01-24 19:43 >> >>>On Tue, 25 Jan 2005 03:24:31 +0100 >>>Thomas Graf wrote: >>> >>> >>>>This of course explains it, didn't think of that. I thought it would >>>>inherit the checksumming features. >>> >>>It should, but only in very limited cases. >>> >>>Because it is very chip dependant whether this works or not in >>>any case, we should probably create a special features flag for >>>this. Something like NETIF_F_VLAN_INHERIT_FEATURES. >> >>Can't we just use NETIF_F_HW_VLAN_TX for this and inherit >>NETIF_F_HW_CSUM | NETIF_F_IP_CSUM if it is set? I don't have any >>specs at hand though. > > > Vlan devices don't inherit any features at the moment but it would make > sense to do so. > > NETIF_F_SG|NETIF_F_TSO: > The normal vlan code seems to handle pskbs correctly, we don't gain > that much though. The big gain would be in the driver specific accel > code. I assume that the driver specific accel code is aware of > pskbs if the card can handle it but I haven't checked this yet. > > NETIF_F_NO_CSUM: > Avoid checksumming for vlan devices on loopback interfaces. > > NETIF_F_HIGHDMA|NETIF_F_FRAGLIST: > Didn't find a reason why this would cause problems. > > NETIF_F_LLTX: > vlan code accesses statistic counters so I think we can't > inherit. It might be worth to make it clean though. > > NETIF_F_IP_CSUM|NETIF_F_HW_CSUM: > Assuming that the vlan accel code can always do the checksumming > if the card can do it. I am leery of assuming these things for all drivers and all chipsets. Maybe the driver itself could tell vlan code what sorts of flags it can set? That takes the guess-work out, and each driver can add the features support as it is verified to work. If any particular hacks need to be used (ie, maybe chipset foo.rev-1a can't handle one particular thing), then the VLAN code doesn't have to care. new_dev->features = real_dev->vlan_features; -- Ben Greear Candela Technologies Inc http://www.candelatech.com From davem@davemloft.net Tue Jan 25 12:50:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 12:50:59 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0PKotn3019701 for ; Tue, 25 Jan 2005 12:50:55 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CtXa6-0002P2-00; Tue, 25 Jan 2005 12:46:34 -0800 Date: Tue, 25 Jan 2005 12:46:34 -0800 From: "David S. Miller" To: Herbert Xu Cc: tgraf@suug.ch, david@davidcoulson.net, kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-Id: <20050125124634.4b749ca9.davem@davemloft.net> In-Reply-To: <20050125112346.GA20704@gondor.apana.org.au> References: <20050124005348.GL23931@postel.suug.ch> <20050123202715.281ac87c.davem@davemloft.net> <20050124121610.GP23931@postel.suug.ch> <41F50B6C.6010107@davidcoulson.net> <20050124151510.GV23931@postel.suug.ch> <20050124225423.GA15405@gondor.apana.org.au> <20050124234515.GA31837@postel.suug.ch> <20050125000759.GA15883@gondor.apana.org.au> <20050124164049.3b939791.davem@davemloft.net> <20050125112346.GA20704@gondor.apana.org.au> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 767 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 410 Lines: 13 On Tue, 25 Jan 2005 22:23:46 +1100 Herbert Xu wrote: > On Mon, Jan 24, 2005 at 04:40:49PM -0800, David S. Miller wrote: > > > > Good catch Herbert, I'll integrate this fix. 2.4.x needs it too > > I'm pretty sure. > > Well I just had a look there and no, this clever frag reuse code > was added in 2.5. Right, I noticed this too when I tried to "backport" the 2.6.x patch :-) From davem@davemloft.net Tue Jan 25 12:54:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 12:54:26 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0PKsKgD020307 for ; Tue, 25 Jan 2005 12:54:20 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CtXdj-0002Pz-00; Tue, 25 Jan 2005 12:50:19 -0800 Date: Tue, 25 Jan 2005 12:50:19 -0800 From: "David S. Miller" To: Thomas Graf Cc: herbert@gondor.apana.org.au, david@davidcoulson.net, kaber@trash.net, greearb@candelatech.com, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-Id: <20050125125019.5ca32de1.davem@davemloft.net> In-Reply-To: <20050125203607.GG31837@postel.suug.ch> References: <20050124234515.GA31837@postel.suug.ch> <20050125000759.GA15883@gondor.apana.org.au> <20050124164049.3b939791.davem@davemloft.net> <20050125014538.GB31837@postel.suug.ch> <20050125014838.GA16637@gondor.apana.org.au> <20050125020118.GC31837@postel.suug.ch> <20050124180354.63ae600d.davem@davemloft.net> <20050125022431.GD31837@postel.suug.ch> <20050124194328.20a106de.davem@davemloft.net> <20050125143319.GF31837@postel.suug.ch> <20050125203607.GG31837@postel.suug.ch> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 768 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 681 Lines: 21 On Tue, 25 Jan 2005 21:36:07 +0100 Thomas Graf wrote: > NETIF_F_IP_CSUM|NETIF_F_HW_CSUM: > Assuming that the vlan accel code can always do the checksumming > if the card can do it. I bet there are cards that don't have VLAN hw assist yet can properly checksum such packets. One example I am counting on to fit this property is the 3c59x. This is why I'm suggesting some kind of inheritance indication explicitly from the real_dev driver. Perhaps even something like: unsigned int vlan_inherited_features; in the netdev struct. Basically, I don't want to preclude inheritance of checksumming capability just because the device doesn't have VLAN assist. From tgraf@suug.ch Tue Jan 25 13:15:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 13:15:13 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0PLF6ku021362 for ; Tue, 25 Jan 2005 13:15:06 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 29B29F; Tue, 25 Jan 2005 22:14:43 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id B54C91C0EA; Tue, 25 Jan 2005 22:15:24 +0100 (CET) Date: Tue, 25 Jan 2005 22:15:24 +0100 From: Thomas Graf To: Ben Greear , "David S. Miller" Cc: herbert@gondor.apana.org.au, david@davidcoulson.net, kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-ID: <20050125211524.GH31837@postel.suug.ch> References: <20050124164049.3b939791.davem@davemloft.net> <20050125014538.GB31837@postel.suug.ch> <20050125014838.GA16637@gondor.apana.org.au> <20050125020118.GC31837@postel.suug.ch> <20050124180354.63ae600d.davem@davemloft.net> <20050125022431.GD31837@postel.suug.ch> <20050124194328.20a106de.davem@davemloft.net> <20050125143319.GF31837@postel.suug.ch> <20050125203607.GG31837@postel.suug.ch> <41F6B090.6020602@candelatech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050125125019.5ca32de1.davem@davemloft.net> <41F6B090.6020602@candelatech.com> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 769 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 1572 Lines: 37 * Ben Greear <41F6B090.6020602@candelatech.com> 2005-01-25 12:48 > Thomas Graf wrote: > >NETIF_F_IP_CSUM|NETIF_F_HW_CSUM: > > Assuming that the vlan accel code can always do the checksumming > > if the card can do it. > > I am leery of assuming these things for all drivers and all chipsets. > > Maybe the driver itself could tell vlan code what sorts of flags it > can set? That takes the guess-work out, and each driver can add > the features support as it is verified to work. If any particular > hacks need to be used (ie, maybe chipset foo.rev-1a can't handle one > particular thing), then the VLAN code doesn't have to care. > > new_dev->features = real_dev->vlan_features; > * David S. Miller <20050125125019.5ca32de1.davem@davemloft.net> 2005-01-25 12:50 > I bet there are cards that don't have VLAN hw assist yet > can properly checksum such packets. One example I am counting > on to fit this property is the 3c59x. > > This is why I'm suggesting some kind of inheritance indication > explicitly from the real_dev driver. Perhaps even something > like: > > unsigned int vlan_inherited_features; > > in the netdev struct. I thought about this too and actually implemented it but it means to change all relevant drivers and the only feature that might be driver specific is checksumming, given I didn't make any mistakes while checking the drivers for pskb compatibility. Therefore I tried to avoid it but it seems we can't get around it. Any objections in inheriting SG|NO_CSUM|HIGH_DMA|FRAGLIST|TSO by default or leave it to the driver as well? From dcbw@redhat.com Tue Jan 25 13:47:52 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 13:47:59 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0PLlpja022448 for ; Tue, 25 Jan 2005 13:47:52 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j0PLlo5K012082; Tue, 25 Jan 2005 16:47:50 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j0PLloO20136; Tue, 25 Jan 2005 16:47:50 -0500 Received: from devserv.devel.redhat.com (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.11/8.12.10) with ESMTP id j0PLloLE013524; Tue, 25 Jan 2005 16:47:50 -0500 Received: from localhost (dcbw@localhost) by devserv.devel.redhat.com (8.12.11/8.12.11/Submit) with ESMTP id j0PLloob013520; Tue, 25 Jan 2005 16:47:50 -0500 Date: Tue, 25 Jan 2005 16:47:50 -0500 (EST) From: Dan Williams To: linux-kernel@vger.kernel.org, netdev@oss.sgi.com cc: jgarzik@pobox.com Subject: Where Linux 802.11x support needs work Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="279707962-1485467196-1106689670=:30850" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 770 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dcbw@redhat.com Precedence: bulk X-list: netdev Content-Length: 15835 Lines: 294 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --279707962-1485467196-1106689670=:30850 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi, This list of stuff that should get fixed in Linux wireless grew out of my attempt to put a GUI on top of Linux wireless with NetworkManager (http://people.redhat.com/dcbw/NetworkManager). This isn't, of course, a demand or anything, and I've been personally slowly fixing stuff up as I come to it (orinoco merge, fixing linux-wlan-ng, small kernel wireless driver patches), but I don't think anyone has posted a comprehensive list of where Linux wireless currently falls a bit short. I think the biggest issue here is that the Wireless Extensions API has stagnated a bit, and driver writers have gone off and done their own thing (for example, WPA support) because the WEAPI hasn't shown leadership in this area. That's fixable, and at this point doesn't seem to be a large amount of work since the main offender here is only WPA. Second, there are, for historical reasons most likely, areas where the WEAPI has multiple methods of encoding data to/from user space. For example, WE Quality values and WE Frequency/Channel values. Quality is either signed or unsigned 8-bit number, which (I believe) is either a raw dBm/rssi value or a percentage value, respectively. Frequency uses exponent & mantissa notation, OR a channel # stuffed into the exponent/mantissa structure. Things like that. Comments appreciated, and hopefully this may spark some wider effort to get a few things fixed. So without further ado, here's the list: ------------------------------------------------------------------------- o Quality values vary wildly or are absent 1) atmel doesn't return any quality data from scanned APs 2) ipw_2100 doesn't return _any_ quality data (as of v1.02) 3) Different quality methods for almost every driver - Prism54 does a quality as a percentage - airo mixes use of absolute and relative values in dBm - Average and max quality levels for almost all drivers are artificial and don't come from the the card in any way Work Item: normalize quality values. Wireless extensions supports two different types of quality data, either percentage or dBm. PICK ONE. I would recommend reporting only a Percentage value to user space with the SIOCGIWSTATS call, and having separate ioctl() calls for getting specific dBm/noise values if user-space applications _and_ the driver supports it. We cannot have user-space applications guessing which of 3 different quality algorithms the driver is reporting. o Frequency values vary wildly from iw_get_range 1) prism54 uses completely different exponent values than airo 2) airo, atmel, orinoco are the same Work Item: Normalize frequency values between wireless cards. Use actual frequencies in MHz rather than using Exponent & Mantissa format as now. Force user-space applications to convert channels->frequencies, based on what frequencies the driver says it supports. Or, fix drivers to report Frequency<->Channel pairs when they report their supported frequencies, but the point again is to PICK ONE and make all drivers do that. Remove the guessing-game from user-space and pick one API for drivers to use. o airo/prism54 seem to have problems with ip6 and cause panic 1) Some drivers don't NULL out their data after they are done with it, causing kernel panics later on down the line. See Red Hat bugzilla #135432 for details, Dave Jones has a patch for the airo driver that seems to work better, which is in Red Hat 2.6.10 kernels. Work Item: Make sure all drivers dispose of and NULL out their data when they close, or fix kernel areas that might depend on that stale data. Or whatever the problem is. o Not all drivers have correct netlink support, if they even have it 1) orinoco is too twitchy, sends too many events (shouldn't send them during a scan for example) 2) atmel, airo, and others don't seem to have any netlink support Work Item: fix all drivers to ensure that when the card successfully associates with an access point, that it signals the kernel that its network link is "up". o Not all drivers support wirless scanning 1) orinoco driver mainly, support is upstream and is being slowly merged into the kernel driver Work Item: Speed up merge of upstream Orinoco into kernel orinoco o Firmware issues 1) Cisco aironet firmware upload is quite inconsistent, fails with 5.21 for example. Firmware <= 5.02 seems to be required for using WEP with most access points. Latest Cisco-provided driver is quite different than latest in-kernel driver Work Item: Figure out licensing issues between Cisco-provided driver for 2.4 kernel (which is MPL) and in-kernel airo driver (which is GPL). Then, figure out what changes were made to the Cisco-provided driver to support firmware up to 5.30.17, and make those changes in the in-kernel airo driver. o Ethtool support for all drivers 1) viro has done a lot of them, not sure if this is complete. o Ad-Hoc mode support is quite flaky or absent from most drivers 1) prism54 "mgmt tx queue full" errors on otherwise-working cards 2) madwifi resets bitrate to 0 when switching to ad-hoc mode Work Item: Fix drivers to support Ad-Hoc mode, attempt to get specs on their hardware & registers from manufacturers if we don't have that information yet for all "modern" cards. o WPA support is lacking or just in-progress, needs much help 1) The point here is that Wireless Extensions API has severely lagged behind the capabilities of current chipsets. There should be support _in_ Wireless Extensions for WPA and its associated technologies, instead of what all the drivers do now, which is separate, non-standard, private ioctl() calls for WPA settings. Work Item: standardize on an interface for WPA and its associated technologies, and implement that interface in Wireless Extensions API. Fix all drivers to use that API rather than private ioctl() calls. Some drivers that support WPA: atmel, madwifi, prism54, ipw2200. It would also be beneficial in this effort to support the calls that 802.1x stacks need (like wpa_supplicant and Open 802.1x) so that they don't have to patch the drivers (Open 802.1x) or create special per-driver hook modules (wpa_supplicant) to be able to capture the necessary authentication packets or set up the card's WPA settings. o Drivers deal with hidden ESSIDs differently 1) ipw2x00 traps " " and runs of \0 and changes it to "" in the driver, while other drivers just pass the blank string through Work Item: Standardize all drivers to simply pass an empty string through to user-space when the base station does not broadcast its ESSID. Drivers should _not_ be clever about this. Levels of Importance (my opinion): 1) All drivers _MUST_ support wireless scanning (*cough* orinoco *cough*) 2) WPA support needs to be standardized in Wireless Extensions 3) Consistent (and present) quality data among drivers, both for currently connected AP and for scanned APs 4) rtnetlink link notification for all drivers when they associate with an AP 5) Ad-Hoc mode support 6) Ethtool support 7) Cisco firmware issues --279707962-1485467196-1106689670=:30850 Content-Type: TEXT/plain; charset=US-ASCII; name="linux-wireless-problems.txt" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="linux-wireless-problems.txt" V2hhdCBuZWVkcyB0byBiZSBmaXhlZCBpbiBMaW51eCA4MDIuMTF4IFdpcmVs ZXNzOg0KDQpvICBRdWFsaXR5IHZhbHVlcyB2YXJ5IHdpbGRseSBvciBhcmUg YWJzZW50DQogICAxKSBhdG1lbCBkb2Vzbid0IHJldHVybiBhbnkgcXVhbGl0 eSBkYXRhIGZyb20gc2Nhbm5lZCBBUHMNCiAgIDIpIGlwd18yMTAwIGRvZXNu J3QgcmV0dXJuIF9hbnlfIHF1YWxpdHkgZGF0YSAoYXMgb2YgdjEuMDIpDQog ICAzKSBEaWZmZXJlbnQgcXVhbGl0eSBtZXRob2RzIGZvciBhbG1vc3QgZXZl cnkgZHJpdmVyDQogICAgICAtIFByaXNtNTQgZG9lcyBhIHF1YWxpdHkgYXMg YSBwZXJjZW50YWdlDQogICAgICAtIGFpcm8gbWl4ZXMgdXNlIG9mIGFic29s dXRlIGFuZCByZWxhdGl2ZSB2YWx1ZXMgaW4gZEJtDQogICAgICAtIEF2ZXJh Z2UgYW5kIG1heCBxdWFsaXR5IGxldmVscyBmb3IgYWxtb3N0IGFsbCBkcml2 ZXJzIGFyZQ0KICAgICAgICAgYXJ0aWZpY2lhbCBhbmQgZG9uJ3QgY29tZSBm cm9tIHRoZSB0aGUgY2FyZCBpbiBhbnkgd2F5DQoNCldvcmsgSXRlbTogbm9y bWFsaXplIHF1YWxpdHkgdmFsdWVzLiAgV2lyZWxlc3MgZXh0ZW5zaW9ucyBz dXBwb3J0cyB0d28NCmRpZmZlcmVudCB0eXBlcyBvZiBxdWFsaXR5IGRhdGEs IGVpdGhlciBwZXJjZW50YWdlIG9yIGRCbS4gIFBJQ0sgT05FLiAgSSANCndv dWxkIHJlY29tbWVuZCByZXBvcnRpbmcgb25seSBhIFBlcmNlbnRhZ2UgdmFs dWUgdG8gdXNlciBzcGFjZSB3aXRoIHRoZSANClNJT0NHSVdTVEFUUyBjYWxs LCBhbmQgaGF2aW5nIHNlcGFyYXRlIGlvY3RsKCkgY2FsbHMgZm9yIGdldHRp bmcgDQpzcGVjaWZpYyBkQm0vbm9pc2UgdmFsdWVzIGlmIHVzZXItc3BhY2Ug YXBwbGljYXRpb25zIF9hbmRfIHRoZSBkcml2ZXIgDQpzdXBwb3J0cyBpdC4g IFdlIGNhbm5vdCBoYXZlIHVzZXItc3BhY2UgYXBwbGljYXRpb25zIGd1ZXNz aW5nIHdoaWNoIG9mIDMgDQpkaWZmZXJlbnQgcXVhbGl0eSBhbGdvcml0aG1z IHRoZSBkcml2ZXIgaXMgcmVwb3J0aW5nLg0KDQpvICBGcmVxdWVuY3kgdmFs dWVzIHZhcnkgd2lsZGx5IGZyb20gaXdfZ2V0X3JhbmdlDQogICAxKSBwcmlz bTU0IHVzZXMgY29tcGxldGVseSBkaWZmZXJlbnQgZXhwb25lbnQgdmFsdWVz IHRoYW4gYWlybw0KICAgMikgYWlybywgYXRtZWwsIG9yaW5vY28gYXJlIHRo ZSBzYW1lDQoNCldvcmsgSXRlbTogTm9ybWFsaXplIGZyZXF1ZW5jeSB2YWx1 ZXMgYmV0d2VlbiB3aXJlbGVzcyBjYXJkcy4gIFVzZSANCmFjdHVhbCBmcmVx dWVuY2llcyBpbiBNSHogcmF0aGVyIHRoYW4gdXNpbmcgRXhwb25lbnQgJiBN YW50aXNzYSBmb3JtYXQgDQphcyBub3cuICBGb3JjZSB1c2VyLXNwYWNlIGFw cGxpY2F0aW9ucyB0byBjb252ZXJ0IGNoYW5uZWxzLT5mcmVxdWVuY2llcywg DQpiYXNlZCBvbiB3aGF0IGZyZXF1ZW5jaWVzIHRoZSBkcml2ZXIgc2F5cyBp dCBzdXBwb3J0cy4gT3IsIGZpeCBkcml2ZXJzIA0KdG8gcmVwb3J0IEZyZXF1 ZW5jeTwtPkNoYW5uZWwgcGFpcnMgd2hlbiB0aGV5IHJlcG9ydCB0aGVpciBz dXBwb3J0ZWQgDQpmcmVxdWVuY2llcywgYnV0IHRoZSBwb2ludCBhZ2FpbiBp cyB0byBQSUNLIE9ORSBhbmQgbWFrZSBhbGwgZHJpdmVycyBkbyANCnRoYXQu ICBSZW1vdmUgdGhlIGd1ZXNzaW5nLWdhbWUgZnJvbSB1c2VyLXNwYWNlIGFu ZCBwaWNrIG9uZSBBUEkgZm9yIA0KZHJpdmVycyB0byB1c2UuDQoNCm8gIGFp cm8vcHJpc201NCBzZWVtIHRvIGhhdmUgcHJvYmxlbXMgd2l0aCBpcDYgYW5k IGNhdXNlIHBhbmljDQogICAxKSBTb21lIGRyaXZlcnMgZG9uJ3QgTlVMTCBv dXQgdGhlaXIgZGF0YSBhZnRlciB0aGV5IGFyZSBkb25lIHdpdGgNCiAgICAg IGl0LCBjYXVzaW5nIGtlcm5lbCBwYW5pY3MgbGF0ZXIgb24gZG93biB0aGUg bGluZS4gIFNlZSBSZWQgSGF0DQogICAgICBidWd6aWxsYSAjMTM1NDMyIGZv ciBkZXRhaWxzLCBEYXZlIEpvbmVzIGhhcyBhIHBhdGNoIGZvciB0aGUgYWly bw0KICAgICAgZHJpdmVyIHRoYXQgc2VlbXMgdG8gd29yayBiZXR0ZXIsIHdo aWNoIGlzIGluIFJlZCBIYXQgMi42LjEwDQogICAgICBrZXJuZWxzLg0KDQpX b3JrIEl0ZW06IE1ha2Ugc3VyZSBhbGwgZHJpdmVycyBkaXNwb3NlIG9mIGFu ZCBOVUxMIG91dCB0aGVpciBkYXRhIHdoZW4gDQp0aGV5IGNsb3NlLCBvciBm aXgga2VybmVsIGFyZWFzIHRoYXQgbWlnaHQgZGVwZW5kIG9uIHRoYXQgc3Rh bGUgZGF0YS4gIA0KT3Igd2hhdGV2ZXIgdGhlIHByb2JsZW0gaXMuDQoNCm8g IE5vdCBhbGwgZHJpdmVycyBoYXZlIGNvcnJlY3QgbmV0bGluayBzdXBwb3J0 LCBpZiB0aGV5IGV2ZW4gaGF2ZSBpdA0KICAgMSkgb3Jpbm9jbyBpcyB0b28g dHdpdGNoeSwgc2VuZHMgdG9vIG1hbnkgZXZlbnRzIChzaG91bGRuJ3Qgc2Vu ZCB0aGVtDQoJCWR1cmluZyBhIHNjYW4gZm9yIGV4YW1wbGUpDQogICAyKSBh dG1lbCwgYWlybywgYW5kIG90aGVycyBkb24ndCBzZWVtIHRvIGhhdmUgYW55 IG5ldGxpbmsgc3VwcG9ydA0KDQpXb3JrIEl0ZW06IGZpeCBhbGwgZHJpdmVy cyB0byBlbnN1cmUgdGhhdCB3aGVuIHRoZSBjYXJkIHN1Y2Nlc3NmdWxseSAN CmFzc29jaWF0ZXMgd2l0aCBhbiBhY2Nlc3MgcG9pbnQsIHRoYXQgaXQgc2ln bmFscyB0aGUga2VybmVsIHRoYXQgaXRzIA0KbmV0d29yayBsaW5rIGlzICJ1 cCIuDQoNCm8gIE5vdCBhbGwgZHJpdmVycyBzdXBwb3J0IHdpcmxlc3Mgc2Nh bm5pbmcNCiAgIDEpIG9yaW5vY28gZHJpdmVyIG1haW5seSwgc3VwcG9ydCBp cyB1cHN0cmVhbSBhbmQgaXMgYmVpbmcgc2xvd2x5DQogICAgICBtZXJnZWQg aW50byB0aGUga2VybmVsIGRyaXZlcg0KDQpXb3JrIEl0ZW06IFNwZWVkIHVw IG1lcmdlIG9mIHVwc3RyZWFtIE9yaW5vY28gaW50byBrZXJuZWwgb3Jpbm9j bw0KDQpvICBGaXJtd2FyZSBpc3N1ZXMNCiAgIDEpIENpc2NvIGFpcm9uZXQg ZmlybXdhcmUgdXBsb2FkIGlzIHF1aXRlIGluY29uc2lzdGVudCwgZmFpbHMg d2l0aA0KICAgICAgNS4yMSBmb3IgZXhhbXBsZS4gIEZpcm13YXJlIDw9IDUu MDIgc2VlbXMgdG8gYmUgcmVxdWlyZWQgZm9yIHVzaW5nDQogICAgICBXRVAg d2l0aCBtb3N0IGFjY2VzcyBwb2ludHMuICBMYXRlc3QgQ2lzY28tcHJvdmlk ZWQgZHJpdmVyIGlzIHF1aXRlDQogICAgICBkaWZmZXJlbnQgdGhhbiBsYXRl c3QgaW4ta2VybmVsIGRyaXZlcg0KDQpXb3JrIEl0ZW06IEZpZ3VyZSBvdXQg bGljZW5zaW5nIGlzc3VlcyBiZXR3ZWVuIENpc2NvLXByb3ZpZGVkIGRyaXZl ciBmb3IgDQoyLjQga2VybmVsICh3aGljaCBpcyBNUEwpIGFuZCBpbi1rZXJu ZWwgYWlybyBkcml2ZXIgKHdoaWNoIGlzIEdQTCkuICANClRoZW4sIGZpZ3Vy ZSBvdXQgd2hhdCBjaGFuZ2VzIHdlcmUgbWFkZSB0byB0aGUgQ2lzY28tcHJv dmlkZWQgZHJpdmVyIHRvIA0Kc3VwcG9ydCBmaXJtd2FyZSB1cCB0byA1LjMw LjE3LCBhbmQgbWFrZSB0aG9zZSBjaGFuZ2VzIGluIHRoZSBpbi1rZXJuZWwg DQphaXJvIGRyaXZlci4NCg0KbyAgRXRodG9vbCBzdXBwb3J0IGZvciBhbGwg ZHJpdmVycw0KICAgMSkgdmlybyBoYXMgZG9uZSBhIGxvdCBvZiB0aGVtLCBu b3Qgc3VyZSBpZiB0aGlzIGlzIGNvbXBsZXRlLg0KDQpvICBBZC1Ib2MgbW9k ZSBzdXBwb3J0IGlzIHF1aXRlIGZsYWt5IG9yIGFic2VudCBmcm9tIG1vc3Qg ZHJpdmVycw0KICAgMSkgcHJpc201NCAibWdtdCB0eCBxdWV1ZSBmdWxsIiBl cnJvcnMgb24gb3RoZXJ3aXNlLXdvcmtpbmcgY2FyZHMNCiAgIDIpIG1hZHdp ZmkgcmVzZXRzIGJpdHJhdGUgdG8gMCB3aGVuIHN3aXRjaGluZyB0byBhZC1o b2MgbW9kZQ0KDQpXb3JrIEl0ZW06IEZpeCBkcml2ZXJzIHRvIHN1cHBvcnQg QWQtSG9jIG1vZGUsIGF0dGVtcHQgdG8gZ2V0IHNwZWNzIG9uIA0KdGhlaXIg aGFyZHdhcmUgJiByZWdpc3RlcnMgZnJvbSBtYW51ZmFjdHVyZXJzIGlmIHdl IGRvbid0IGhhdmUgdGhhdCANCmluZm9ybWF0aW9uIHlldCBmb3IgYWxsICJt b2Rlcm4iIGNhcmRzLg0KDQpvICBXUEEgc3VwcG9ydCBpcyBsYWNraW5nIG9y IGp1c3QgaW4tcHJvZ3Jlc3MsIG5lZWRzIG11Y2ggaGVscA0KICAgMSkgVGhl IHBvaW50IGhlcmUgaXMgdGhhdCBXaXJlbGVzcyBFeHRlbnNpb25zIEFQSSBo YXMgc2V2ZXJlbHkgbGFnZ2VkDQogICAgICBiZWhpbmQgdGhlIGNhcGFiaWxp dGllcyBvZiBjdXJyZW50IGNoaXBzZXRzLiAgVGhlcmUgc2hvdWxkIGJlDQog ICAgICBzdXBwb3J0IF9pbl8gV2lyZWxlc3MgRXh0ZW5zaW9ucyBmb3IgV1BB IGFuZCBpdHMgYXNzb2NpYXRlZA0KICAgICAgdGVjaG5vbG9naWVzLCBpbnN0 ZWFkIG9mIHdoYXQgYWxsIHRoZSBkcml2ZXJzIGRvIG5vdywgd2hpY2ggaXMN CiAgICAgIHNlcGFyYXRlLCBub24tc3RhbmRhcmQsIHByaXZhdGUgaW9jdGwo KSBjYWxscyBmb3IgV1BBIHNldHRpbmdzLg0KDQpXb3JrIEl0ZW06IHN0YW5k YXJkaXplIG9uIGFuIGludGVyZmFjZSBmb3IgV1BBIGFuZCBpdHMgYXNzb2Np YXRlZCANCnRlY2hub2xvZ2llcywgYW5kIGltcGxlbWVudCB0aGF0IGludGVy ZmFjZSBpbiBXaXJlbGVzcyBFeHRlbnNpb25zIEFQSS4gIA0KRml4IGFsbCBk cml2ZXJzIHRvIHVzZSB0aGF0IEFQSSByYXRoZXIgdGhhbiBwcml2YXRlIGlv Y3RsKCkgY2FsbHMuICBTb21lIA0KZHJpdmVycyB0aGF0IHN1cHBvcnQgV1BB OiAgYXRtZWwsIG1hZHdpZmksIHByaXNtNTQsIGlwdzIyMDAuICBJdCB3b3Vs ZCANCmFsc28gYmUgYmVuZWZpY2lhbCBpbiB0aGlzIGVmZm9ydCB0byBzdXBw b3J0IHRoZSBjYWxscyB0aGF0IDgwMi4xeCANCnN0YWNrcyBuZWVkIChsaWtl IHdwYV9zdXBwbGljYW50IGFuZCBPcGVuIDgwMi4xeCkgc28gdGhhdCB0aGV5 IGRvbid0IA0KaGF2ZSB0byBwYXRjaCB0aGUgZHJpdmVycyAoT3BlbiA4MDIu MXgpIG9yIGNyZWF0ZSBzcGVjaWFsIHBlci1kcml2ZXIgDQpob29rIG1vZHVs ZXMgKHdwYV9zdXBwbGljYW50KSB0byBiZSBhYmxlIHRvIGNhcHR1cmUgdGhl IG5lY2Vzc2FyeSANCmF1dGhlbnRpY2F0aW9uIHBhY2tldHMgb3Igc2V0IHVw IHRoZSBjYXJkJ3MgV1BBIHNldHRpbmdzLg0KDQpvICBEcml2ZXJzIGRlYWwg d2l0aCBoaWRkZW4gRVNTSURzIGRpZmZlcmVudGx5DQogICAxKSBpcHcyeDAw IHRyYXBzICIgIiBhbmQgcnVucyBvZiBcMCBhbmQgY2hhbmdlcyBpdCB0byAi PGhpZGRlbj4iIGluDQogICAgICB0aGUgZHJpdmVyLCB3aGlsZSBvdGhlciBk cml2ZXJzIGp1c3QgcGFzcyB0aGUgYmxhbmsgc3RyaW5nIHRocm91Z2gNCg0K V29yayBJdGVtOiBTdGFuZGFyZGl6ZSBhbGwgZHJpdmVycyB0byBzaW1wbHkg cGFzcyBhbiBlbXB0eSBzdHJpbmcgDQp0aHJvdWdoIHRvIHVzZXItc3BhY2Ug d2hlbiB0aGUgYmFzZSBzdGF0aW9uIGRvZXMgbm90IGJyb2FkY2FzdCBpdHMg DQpFU1NJRC4gIERyaXZlcnMgc2hvdWxkIF9ub3RfIGJlIGNsZXZlciBhYm91 dCB0aGlzLg0KDQoNCkxldmVscyBvZiBJbXBvcnRhbmNlIChteSBvcGluaW9u KToNCjEpIEFsbCBkcml2ZXJzIF9NVVNUXyBzdXBwb3J0IHdpcmVsZXNzIHNj YW5uaW5nICgqY291Z2gqIG9yaW5vY28gKmNvdWdoKikNCjIpIFdQQSBzdXBw b3J0IG5lZWRzIHRvIGJlIHN0YW5kYXJkaXplZCBpbiBXaXJlbGVzcyBFeHRl bnNpb25zDQozKSBDb25zaXN0ZW50IChhbmQgcHJlc2VudCkgcXVhbGl0eSBk YXRhIGFtb25nIGRyaXZlcnMsIGJvdGggZm9yDQogICAgY3VycmVudGx5IGNv bm5lY3RlZCBBUCBhbmQgZm9yIHNjYW5uZWQgQVBzDQo0KSBydG5ldGxpbmsg bGluayBub3RpZmljYXRpb24gZm9yIGFsbCBkcml2ZXJzIHdoZW4gdGhleSBh c3NvY2lhdGUgd2l0aA0KICAgIGFuIEFQDQo1KSBBZC1Ib2MgbW9kZSBzdXBw b3J0DQo2KSBFdGh0b29sIHN1cHBvcnQNCjcpIENpc2NvIGZpcm13YXJlIGlz c3Vlcw0KDQo= --279707962-1485467196-1106689670=:30850-- From romieu@fr.zoreil.com Tue Jan 25 13:50:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 13:50:12 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0PLo03C022801 for ; Tue, 25 Jan 2005 13:50:01 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.13.1/8.12.1) with ESMTP id j0PLlUla008832; Tue, 25 Jan 2005 22:47:30 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.13.1/8.13.1/Submit) id j0PLlPO2008831; Tue, 25 Jan 2005 22:47:25 +0100 Date: Tue, 25 Jan 2005 22:47:25 +0100 From: Francois Romieu To: Richard Dawe Cc: netdev@oss.sgi.com Subject: Re: Acer Aspire 1524WLMi and RealTek 8169 - very slow Message-ID: <20050125214725.GA6093@electric-eye.fr.zoreil.com> References: <41A0F0D5.9050702@phekda.gotadsl.co.uk> <20041121205814.GA22460@electric-eye.fr.zoreil.com> <41A24F35.5080106@phekda.gotadsl.co.uk> <20041122213008.GA9618@electric-eye.fr.zoreil.com> <41D2844E.5070204@phekda.gotadsl.co.uk> <20041229235203.GA5465@electric-eye.fr.zoreil.com> <41F250D1.8000207@phekda.gotadsl.co.uk> <41F26FD1.2060407@phekda.gotadsl.co.uk> <20050122230156.GC24461@electric-eye.fr.zoreil.com> <41F3F632.3060800@phekda.gotadsl.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F3F632.3060800@phekda.gotadsl.co.uk> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 771 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Content-Length: 5123 Lines: 158 Hi, could you give the patch below some testing ? Any post-LLTX-revert 2.6.11-rc2-bk should do. Merge of Realtek's code - code dedicated to a new phy (spotted by Richard Dawe); - C+ register fiddling seems required for both RTL_GIGA_MAC_VER_{D/E}; - apart from being reserved, register at address 0xe2 is named 'IntrMitigate'; - bump version number. A bunch of people do not use the vanilla kernel module simply because Realtek's driver has a higher revision number. This is not an issue per se but their driver is buggy due to some partial merge of in-kernel code. Signed-off-by: Francois Romieu Signed-off-by: Richard Dawe diff -puN drivers/net/r8169.c~r8169-360 drivers/net/r8169.c --- linux-2.6.11-rc1-bk8/drivers/net/r8169.c~r8169-360 2005-01-25 21:31:58.299916327 +0100 +++ linux-2.6.11-rc1-bk8-fr/drivers/net/r8169.c 2005-01-25 22:25:56.106368294 +0100 @@ -41,6 +41,13 @@ VERSION 1.6LK <2004/04/14> - Suspend/resume - Endianness - Misc Rx/Tx bugs + +VERSION 2.2LK <2005/01/25> + + - RX csum, TX csum/SG, TSO + - VLAN + - baby (< 7200) Jumbo frames support + - Merge of Realtek's version 2.2 (new phy) */ #include @@ -61,7 +68,7 @@ VERSION 1.6LK <2004/04/14> #include -#define RTL8169_VERSION "1.6LK" +#define RTL8169_VERSION "2.2LK" #define MODULENAME "r8169" #define PFX MODULENAME ": " @@ -148,6 +155,7 @@ enum phy_version { RTL_GIGA_PHY_VER_E = 0x05, /* PHY Reg 0x03 bit0-3 == 0x0000 */ RTL_GIGA_PHY_VER_F = 0x06, /* PHY Reg 0x03 bit0-3 == 0x0001 */ RTL_GIGA_PHY_VER_G = 0x07, /* PHY Reg 0x03 bit0-3 == 0x0002 */ + RTL_GIGA_PHY_VER_H = 0x08, /* PHY Reg 0x03 bit0-3 == 0x0003 */ }; @@ -161,7 +169,8 @@ const static struct { } rtl_chip_info[] = { _R("RTL8169", RTL_GIGA_MAC_VER_B, 0xff7e1880), _R("RTL8169s/8110s", RTL_GIGA_MAC_VER_D, 0xff7e1880), - _R("RTL8169s/8110s", RTL_GIGA_MAC_VER_E, 0xff7e1880) + _R("RTL8169s/8110s", RTL_GIGA_MAC_VER_E, 0xff7e1880), + _R("RTL8169s/8110s", RTL_GIGA_MAC_VER_X, 0xff7e1880), }; #undef _R @@ -207,6 +216,7 @@ enum RTL8169_registers { PHYstatus = 0x6C, RxMaxSize = 0xDA, CPlusCmd = 0xE0, + IntrMitigate = 0xE2, RxDescAddrLow = 0xE4, RxDescAddrHigh = 0xE8, EarlyTxThres = 0xEC, @@ -406,7 +416,7 @@ struct rtl8169_private { struct work_struct task; }; -MODULE_AUTHOR("Realtek"); +MODULE_AUTHOR("Realtek and the Linux r8169 crew "); MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver"); module_param_array(media, int, &num_media, 0); module_param(rx_copybreak, int, 0); @@ -1001,7 +1011,7 @@ static void rtl8169_hw_phy_config(struct if (tp->mac_version <= RTL_GIGA_MAC_VER_B) return; - if (tp->phy_version >= RTL_GIGA_PHY_VER_F) + if (tp->phy_version >= RTL_GIGA_PHY_VER_H) return; dprintk("MAC version != 0 && PHY version == 0 or 1\n"); @@ -1009,6 +1019,18 @@ static void rtl8169_hw_phy_config(struct /* Shazam ! */ + if (tp->mac_version == RTL_GIGA_MAC_VER_X) { + mdio_write(ioaddr, 31, 0x0001); + mdio_write(ioaddr, 9, 0x273a); + mdio_write(ioaddr, 14, 0x7bfb); + mdio_write(ioaddr, 27, 0x841e); + + mdio_write(ioaddr, 31, 0x0002); + mdio_write(ioaddr, 1, 0x90d0); + mdio_write(ioaddr, 31, 0x0000); + return; + } + // phy config for RTL8169s mac_version C chip mdio_write(ioaddr, 31, 0x0001); //w 31 2 0 1 mdio_write(ioaddr, 21, 0x1000); //w 21 15 0 1000 @@ -1037,7 +1059,7 @@ static void rtl8169_phy_timer(unsigned l unsigned long timeout = RTL8169_PHY_TIMEOUT; assert(tp->mac_version > RTL_GIGA_MAC_VER_B); - assert(tp->phy_version < RTL_GIGA_PHY_VER_G); + assert(tp->phy_version < RTL_GIGA_PHY_VER_H); if (!(tp->phy_1000_ctrl_reg & PHY_Cap_1000_Full)) return; @@ -1072,7 +1094,7 @@ static inline void rtl8169_delete_timer( struct timer_list *timer = &tp->timer; if ((tp->mac_version <= RTL_GIGA_MAC_VER_B) || - (tp->phy_version >= RTL_GIGA_PHY_VER_G)) + (tp->phy_version >= RTL_GIGA_PHY_VER_H)) return; del_timer_sync(timer); @@ -1084,7 +1106,7 @@ static inline void rtl8169_request_timer struct timer_list *timer = &tp->timer; if ((tp->mac_version <= RTL_GIGA_MAC_VER_B) || - (tp->phy_version >= RTL_GIGA_PHY_VER_G)) + (tp->phy_version >= RTL_GIGA_PHY_VER_H)) return; init_timer(timer); @@ -1562,13 +1584,20 @@ rtl8169_hw_start(struct net_device *dev) tp->cp_cmd |= RTL_R16(CPlusCmd); RTL_W16(CPlusCmd, tp->cp_cmd); - if (tp->mac_version == RTL_GIGA_MAC_VER_D) { + if ((tp->mac_version == RTL_GIGA_MAC_VER_D) || + (tp->mac_version == RTL_GIGA_MAC_VER_E)) { dprintk(KERN_INFO PFX "Set MAC Reg C+CR Offset 0xE0. " "Bit-3 and bit-14 MUST be 1\n"); tp->cp_cmd |= (1 << 14) | PCIMulRW; RTL_W16(CPlusCmd, tp->cp_cmd); } + /* + * Undocumented corner. Supposedly: + * (TxTimer << 12) | (TxPackets << 8) | (RxTimer << 4) | RxPackets + */ + RTL_W16(IntrMitigate, 0x0000); + RTL_W32(TxDescStartAddrLow, ((u64) tp->TxPhyAddr & DMA_32BIT_MASK)); RTL_W32(TxDescStartAddrHigh, ((u64) tp->TxPhyAddr >> 32)); RTL_W32(RxDescAddrLow, ((u64) tp->RxPhyAddr & DMA_32BIT_MASK)); _ From greearb@candelatech.com Tue Jan 25 14:14:39 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 14:14:45 -0800 (PST) Received: from www.lanforge.com (ns1.lanforge.com [66.165.47.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0PMEd4m023877 for ; Tue, 25 Jan 2005 14:14:39 -0800 Received: from [4.33.45.22] (evrtwa1-ar2-4-33-045-022.evrtwa1.dsl-verizon.net [4.33.45.22]) (authenticated bits=0) by www.lanforge.com (8.12.8/8.12.8) with ESMTP id j0PMWNLH022692; Tue, 25 Jan 2005 14:32:23 -0800 Message-ID: <41F6C4B6.20800@candelatech.com> Date: Tue, 25 Jan 2005 14:14:14 -0800 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041020 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Thomas Graf CC: "David S. Miller" , herbert@gondor.apana.org.au, david@davidcoulson.net, kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help References: <20050124164049.3b939791.davem@davemloft.net> <20050125014538.GB31837@postel.suug.ch> <20050125014838.GA16637@gondor.apana.org.au> <20050125020118.GC31837@postel.suug.ch> <20050124180354.63ae600d.davem@davemloft.net> <20050125022431.GD31837@postel.suug.ch> <20050124194328.20a106de.davem@davemloft.net> <20050125143319.GF31837@postel.suug.ch> <20050125203607.GG31837@postel.suug.ch> <41F6B090.6020602@candelatech.com> <20050125211524.GH31837@postel.suug.ch> In-Reply-To: <20050125211524.GH31837@postel.suug.ch> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 772 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Content-Length: 1911 Lines: 53 Thomas Graf wrote: > * Ben Greear <41F6B090.6020602@candelatech.com> 2005-01-25 12:48 > >>Thomas Graf wrote: >> >>>NETIF_F_IP_CSUM|NETIF_F_HW_CSUM: >>> Assuming that the vlan accel code can always do the checksumming >>> if the card can do it. >> >>I am leery of assuming these things for all drivers and all chipsets. >> >>Maybe the driver itself could tell vlan code what sorts of flags it >>can set? That takes the guess-work out, and each driver can add >>the features support as it is verified to work. If any particular >>hacks need to be used (ie, maybe chipset foo.rev-1a can't handle one >>particular thing), then the VLAN code doesn't have to care. >> >> new_dev->features = real_dev->vlan_features; >> > > * David S. Miller <20050125125019.5ca32de1.davem@davemloft.net> 2005-01-25 12:50 > >>I bet there are cards that don't have VLAN hw assist yet >>can properly checksum such packets. One example I am counting >>on to fit this property is the 3c59x. >> >>This is why I'm suggesting some kind of inheritance indication >>explicitly from the real_dev driver. Perhaps even something >>like: >> >> unsigned int vlan_inherited_features; >> >>in the netdev struct. > > > I thought about this too and actually implemented it but it means to > change all relevant drivers and the only feature that might be > driver specific is checksumming, given I didn't make any mistakes > while checking the drivers for pskb compatibility. Therefore I tried > to avoid it but it seems we can't get around it. > > Any objections in inheriting SG|NO_CSUM|HIGH_DMA|FRAGLIST|TSO by > default or leave it to the driver as well? I'd leave everything to the driver. Once we add the new flags field (vlan_inherited_features), then it's trivial to just set the flags and not have to worry about automatic inheritance. -- Ben Greear Candela Technologies Inc http://www.candelatech.com From shemminger@osdl.org Tue Jan 25 15:15:45 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 15:16:19 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0PNFTtq025899 for ; Tue, 25 Jan 2005 15:15:32 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0PNF1l18734; Tue, 25 Jan 2005 15:15:02 -0800 Date: Tue, 25 Jan 2005 15:15:07 -0800 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org, linux-net@vger.kernel.org Subject: [PATCH] skge driver (0.5) Message-ID: <20050125151507.414e7f4f@dxpl.pdx.osdl.net> In-Reply-To: <20050119135217.38fe5f05@dxpl.pdx.osdl.net> References: <20050119135217.38fe5f05@dxpl.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 773 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 218098 Lines: 6404 Version 0.5 of the rewrite of syskonnect gigabit ethernet driver. This version 0.5 has: * Build fixes for alpha and big endian * Power management, and wake on lan support * Better hardware error handling for flaky hw. Still not tested/debugged: * Genesis chip support -- does anyone still have one of these? May just drop it. * Suspend/resume Still not implemented: * Marvell Yukon2 88E8050 * VLAN assist The patch should work on 2.6.8 or later, I am testing with 2.6.11-rc1. Also available as download from http://developer.osdl.org/shemminger/skge Jeff would you consider this version for the netdev patch set to go into next -mm. It probably isn't ready for 2.6.11 but may be for 2.6.12 diff -Nru a/drivers/net/Kconfig b/drivers/net/Kconfig --- a/drivers/net/Kconfig 2005-01-25 13:51:57 -08:00 +++ b/drivers/net/Kconfig 2005-01-25 13:51:57 -08:00 @@ -1980,6 +1980,18 @@ If in doubt, say Y. +config SKGE + tristate "New SysKonnect GigaEthernet support (EXPERIMENTAL)" + depends on PCI && EXPERIMENTAL + select CRC32 + ---help--- + This driver support the Marvell Yukon or SysKonnect SK-98xx/SK-95xx + and related Gigabit Ethernet adapters. It is a new smaller driver + driver with better performance and more complete ethtool support. + + It does not support the link failover and network management + features that "portable" vendor supplied sk98lin driver does. + config SK98LIN tristate "Marvell Yukon Chipset / SysKonnect SK-98xx Support" depends on PCI diff -Nru a/drivers/net/Makefile b/drivers/net/Makefile --- a/drivers/net/Makefile 2005-01-25 13:51:57 -08:00 +++ b/drivers/net/Makefile 2005-01-25 13:51:57 -08:00 @@ -52,6 +52,7 @@ obj-$(CONFIG_FEALNX) += fealnx.o obj-$(CONFIG_TIGON3) += tg3.o obj-$(CONFIG_TC35815) += tc35815.o +obj-$(CONFIG_SKGE) += skge.o obj-$(CONFIG_SK98LIN) += sk98lin/ obj-$(CONFIG_SKFP) += skfp/ obj-$(CONFIG_VIA_RHINE) += via-rhine.o diff -Nru a/drivers/net/skge.c b/drivers/net/skge.c --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/net/skge.c 2005-01-25 13:51:57 -08:00 @@ -0,0 +1,3334 @@ +/* + * New driver for Marvell Yukon chipsent and SysKonnect Gigabit + * Ethernet adapters. Based on earlier sk98lin, e100 and + * Freebsd if_sk drivers. + * + * This driver intentionally does not support all the features + * of the original driver such as link failover and link management because + * those should be done at higher levels. + * + * Copyright (C) 2004, Stephen Hemminger + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "skge.h" + +#define DRV_NAME "skge" +#define DRV_VERSION "0.5" +#define PFX DRV_NAME " " + +#define DEFAULT_TX_RING_SIZE 128 +#define DEFAULT_RX_RING_SIZE 512 +#define MAX_TX_RING_SIZE 1024 +#define MAX_RX_RING_SIZE 4096 +#define PHY_RETRIES 1000 +#define ETH_JUMBO_MTU 9000 +#define TX_WATCHDOG (5 * HZ) +#define NAPI_WEIGHT 64 +#define BLINK_HZ (HZ/4) +#define LINK_POLL_HZ (HZ/10) + +MODULE_DESCRIPTION("SysKonnect Gigabit Ethernet driver"); +MODULE_AUTHOR("Stephen Hemminger "); +MODULE_LICENSE("GPL"); +MODULE_VERSION(DRV_VERSION); + +static const u32 default_msg + = NETIF_MSG_DRV| NETIF_MSG_PROBE| NETIF_MSG_LINK + | NETIF_MSG_IFUP| NETIF_MSG_IFDOWN; + +static int debug = -1; /* defaults above */ +module_param(debug, int, 0); +MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); + +static const struct pci_device_id skge_id_table[] = { + { PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C940, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_3COM, PCI_DEVICE_ID_3COM_3C940B, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_GE, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_YU, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_SYSKONNECT, 0x9E00, /* SK-9Exx */ + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_DLINK, PCI_DEVICE_ID_DLINK_DGE510T, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_MARVELL, 0x4320, /* Gigabit Ethernet Controller */ + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_MARVELL, 0x5005, /* Marvell (11ab), Belkin */ + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_CNET, PCI_DEVICE_ID_CNET_GIGACARD, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_LINKSYS, PCI_DEVICE_ID_LINKSYS_EG1032, + PCI_ANY_ID, PCI_ANY_ID }, + { PCI_VENDOR_ID_LINKSYS, PCI_DEVICE_ID_LINKSYS_EG1064, + PCI_ANY_ID, PCI_ANY_ID }, + { 0 } +}; +MODULE_DEVICE_TABLE(pci, skge_id_table); + +static int skge_up(struct net_device *dev); +static int skge_down(struct net_device *dev); +static void skge_tx_clean(struct skge_port *skge); +static void skge_xm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val); +static void skge_gm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val); +static void genesis_get_stats(struct skge_port *skge, u64 *data); +static void yukon_get_stats(struct skge_port *skge, u64 *data); +static void yukon_init(struct skge_hw *hw, int port); +static void yukon_reset(struct skge_hw *hw, int port); +static void genesis_mac_init(struct skge_hw *hw, int port); +static void genesis_reset(struct skge_hw *hw, int port); + +static const int txq[] = { Q_XA1, Q_XA2 }; +static const int rxq[] = { Q_R1, Q_R2 }; + +/* Don't need to look at whole 16K. + * last interesting register is descriptor poll timer. + */ +#define SKGE_REGS_LEN (29*128) + +static int skge_get_regs_len(struct net_device *dev) +{ + return SKGE_REGS_LEN; +} + +/* + * Returns copy of control register region + * I/O region is divided into banks and certain regions + * are unreadable + */ +static void skge_get_regs(struct net_device *dev, struct ethtool_regs *regs, + void *p) +{ + const struct skge_port *skge = netdev_priv(dev); + unsigned long offs; + const void __iomem *io = skge->hw->regs; + static const unsigned long bankmap + = (1<<0) | (1<<2) | (1<<8) | (1<<9) + | (1<<12) | (1<<13) | (1<<14) | (1<<15) | (1<<16) + | (1<<17) | (1<<20) | (1<<21) | (1<<22) | (1<<23) + | (1<<24) | (1<<25) | (1<<26) | (1<<27) | (1<<28); + + regs->version = 1; + for (offs = 0; offs < regs->len; offs += 128) { + u32 len = min_t(u32, 128, regs->len - offs); + + if (bankmap & (1<<(offs/128))) + memcpy_fromio(p + offs, io + offs, len); + else + memset(p + offs, 0, len); + } +} + + +static void skge_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + + if (hw->chip_id == CHIP_ID_GENESIS || + (hw->chip_id == CHIP_ID_YUKON && chip_rev(hw) == 0)) + wol->supported = 0; + else + wol->supported = WAKE_MAGIC; + wol->wolopts = skge->wol ? WAKE_MAGIC : 0; +} + +static int skge_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + + if(wol->wolopts != WAKE_MAGIC && wol->wolopts != 0) + return -EOPNOTSUPP; + + if (wol->wolopts == WAKE_MAGIC && + ((hw->chip_id == CHIP_ID_GENESIS || + (hw->chip_id == CHIP_ID_YUKON && chip_rev(hw) == 0)))) + return -EOPNOTSUPP; + + skge->wol = wol->wolopts == WAKE_MAGIC; + + if (skge->wol) { + memcpy_toio(hw->regs + WOL_MAC_ADDR, dev->dev_addr, ETH_ALEN); + + skge_write16(hw, WOL_CTRL_STAT, + WOL_CTL_ENA_PME_ON_MAGIC_PKT | + WOL_CTL_ENA_MAGIC_PKT_UNIT); + } else + skge_write16(hw, WOL_CTRL_STAT, WOL_CTL_DEFAULT); + + return 0; +} + + +static int skge_get_settings(struct net_device *dev, + struct ethtool_cmd *ecmd) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + + ecmd->transceiver = XCVR_INTERNAL; + + if (iscopper(hw)) { + if (hw->chip_id == CHIP_ID_GENESIS) + ecmd->supported = SUPPORTED_1000baseT_Full + | SUPPORTED_1000baseT_Half + | SUPPORTED_Autoneg | SUPPORTED_TP; + else { + ecmd->supported = SUPPORTED_10baseT_Half + | SUPPORTED_10baseT_Full + | SUPPORTED_100baseT_Half + | SUPPORTED_100baseT_Full + | SUPPORTED_1000baseT_Half + | SUPPORTED_1000baseT_Full + | SUPPORTED_Autoneg| SUPPORTED_TP; + + if (hw->chip_id == CHIP_ID_YUKON) + ecmd->supported &= ~SUPPORTED_1000baseT_Half; + + else if (hw->chip_id == CHIP_ID_YUKON_FE) + ecmd->supported &= ~(SUPPORTED_1000baseT_Half + | SUPPORTED_1000baseT_Full); + } + + ecmd->port = PORT_TP; + ecmd->phy_address = hw->phy_addr; + } else { + ecmd->supported = SUPPORTED_1000baseT_Full + | SUPPORTED_FIBRE + | SUPPORTED_Autoneg; + + ecmd->port = PORT_FIBRE; + } + + ecmd->advertising = skge->advertising; + ecmd->autoneg = skge->autoneg; + ecmd->speed = skge->speed; + ecmd->duplex = skge->duplex; + return 0; +} + +static u32 skge_modes(const struct skge_hw *hw) +{ + u32 modes = ADVERTISED_Autoneg + | ADVERTISED_1000baseT_Full | ADVERTISED_1000baseT_Half + | ADVERTISED_100baseT_Full | ADVERTISED_100baseT_Half + | ADVERTISED_10baseT_Full | ADVERTISED_10baseT_Half; + + if (iscopper(hw)) { + modes |= ADVERTISED_TP; + switch(hw->chip_id) { + case CHIP_ID_GENESIS: + modes &= ~(ADVERTISED_100baseT_Full + | ADVERTISED_100baseT_Half + | ADVERTISED_10baseT_Full + | ADVERTISED_10baseT_Half); + break; + + case CHIP_ID_YUKON: + modes &= ~ADVERTISED_1000baseT_Half; + break; + + case CHIP_ID_YUKON_FE: + modes &= ~(ADVERTISED_1000baseT_Half|ADVERTISED_1000baseT_Full); + break; + } + } else { + modes |= ADVERTISED_FIBRE; + modes &= ~ADVERTISED_1000baseT_Half; + } + return modes; +} + +static int skge_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) +{ + struct skge_port *skge = netdev_priv(dev); + const struct skge_hw *hw = skge->hw; + + if (ecmd->autoneg == AUTONEG_ENABLE) { + if (ecmd->advertising & skge_modes(hw)) + return -EINVAL; + } else { + switch(ecmd->speed) { + case SPEED_1000: + if (hw->chip_id == CHIP_ID_YUKON_FE) + return -EINVAL; + break; + case SPEED_100: + case SPEED_10: + if (iscopper(hw) || hw->chip_id == CHIP_ID_GENESIS) + return -EINVAL; + break; + default: + return -EINVAL; + } + } + + skge->autoneg = ecmd->autoneg; + skge->speed = ecmd->speed; + skge->duplex = ecmd->duplex; + skge->advertising = ecmd->advertising; + + if (netif_running(dev)) { + skge_down(dev); + skge_up(dev); + } + return (0); +} + +static void skge_get_drvinfo(struct net_device *dev, + struct ethtool_drvinfo *info) +{ + struct skge_port *skge = netdev_priv(dev); + + strcpy(info->driver, DRV_NAME); + strcpy(info->version, DRV_VERSION); + strcpy(info->fw_version, "N/A"); + strcpy(info->bus_info, pci_name(skge->hw->pdev)); +} + +static const struct skge_stat { + char name[ETH_GSTRING_LEN]; + u16 xmac_offset; + u16 gma_offset; +} skge_stats[] = { + { "tx_bytes", XM_TXO_OK_HI, GM_TXO_OK_HI }, + { "rx_bytes", XM_RXO_OK_HI, GM_RXO_OK_HI }, + + { "tx_broadcast", XM_TXF_BC_OK, GM_TXF_BC_OK }, + { "rx_broadcast", XM_RXF_BC_OK, GM_RXF_BC_OK }, + { "tx_multicast", XM_TXF_MC_OK, GM_TXF_MC_OK }, + { "rx_multicast", XM_RXF_MC_OK, GM_RXF_MC_OK }, + { "tx_unicast", XM_TXF_UC_OK, GM_TXF_UC_OK }, + { "rx_unicast", XM_RXF_UC_OK, GM_RXF_UC_OK }, + { "tx_mac_pause", XM_TXF_MPAUSE, GM_TXF_MPAUSE }, + { "rx_mac_pause", XM_RXF_MPAUSE, GM_RXF_MPAUSE }, + + { "collisions", XM_TXF_SNG_COL, GM_TXF_SNG_COL }, + { "multi_collisions", XM_TXF_MUL_COL, GM_TXF_MUL_COL }, + { "aborted", XM_TXF_ABO_COL, GM_TXF_ABO_COL}, + { "late_collision", XM_TXF_LAT_COL, GM_TXF_LAT_COL }, + { "fifo_underrun", XM_TXE_FIFO_UR, GM_TXE_FIFO_UR }, + { "fifo_overflow", XM_RXE_FIFO_OV, GM_RXE_FIFO_OV }, + + { "rx_toolong", XM_RXF_LNG_ERR, GM_RXF_LNG_ERR }, + { "rx_jabber", XM_RXF_JAB_PKT, GM_RXF_JAB_PKT }, + { "rx_runt", XM_RXE_RUNT, GM_RXE_FRAG }, + { "rx_too_long", XM_RXF_LNG_ERR, GM_RXF_LNG_ERR }, + { "rx_fcs_error", XM_RXF_FCS_ERR, GM_RXF_FCS_ERR }, +}; + +static int skge_get_stats_count(struct net_device *dev) +{ + return ARRAY_SIZE(skge_stats); +} + +static void skge_get_ethtool_stats(struct net_device *dev, + struct ethtool_stats *stats, u64 *data) +{ + struct skge_port *skge = netdev_priv(dev); + + if (skge->hw->chip_id == CHIP_ID_GENESIS) + genesis_get_stats(skge, data); + else + yukon_get_stats(skge, data); +} + +static void skge_get_strings(struct net_device *dev, u32 stringset, u8 *data) +{ + int i; + + switch(stringset) { + case ETH_SS_STATS: + for (i = 0; i < ARRAY_SIZE(skge_stats); i++) + memcpy(data + i * ETH_GSTRING_LEN, + skge_stats[i].name, ETH_GSTRING_LEN); + break; + } +} + +static void skge_get_ring_param(struct net_device *dev, + struct ethtool_ringparam *p) +{ + struct skge_port *skge = netdev_priv(dev); + + p->rx_max_pending = MAX_RX_RING_SIZE; + p->tx_max_pending = MAX_TX_RING_SIZE; + p->rx_mini_max_pending = 0; + p->rx_jumbo_max_pending = 0; + + p->rx_pending = skge->rx_ring.count; + p->tx_pending = skge->tx_ring.count; + p->rx_mini_pending = 0; + p->rx_jumbo_pending = 0; +} + +static int skge_set_ring_param(struct net_device *dev, + struct ethtool_ringparam *p) +{ + struct skge_port *skge = netdev_priv(dev); + + if (p->rx_pending == 0 || p->rx_pending > MAX_RX_RING_SIZE || + p->tx_pending == 0 || p->tx_pending > MAX_TX_RING_SIZE) + return -EINVAL; + + skge->rx_ring.count = p->rx_pending; + skge->tx_ring.count = p->tx_pending; + + if (netif_running(dev)) { + skge_down(dev); + skge_up(dev); + } + + return 0; +} + +static u32 skge_get_msglevel(struct net_device *netdev) +{ + struct skge_port *skge = netdev_priv(netdev); + return skge->msg_enable; +} + +static void skge_set_msglevel(struct net_device *netdev, u32 value) +{ + struct skge_port *skge = netdev_priv(netdev); + skge->msg_enable = value; +} + +static int skge_nway_reset(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + int port = skge->port; + + if (skge->autoneg != AUTONEG_ENABLE || !netif_running(dev)) + return -EINVAL; + + spin_lock_bh(&hw->phy_lock); + if (hw->chip_id == CHIP_ID_GENESIS) { + genesis_reset(hw, port); + genesis_mac_init(hw, port); + } else { + yukon_reset(hw, port); + yukon_init(hw, port); + } + spin_unlock_bh(&hw->phy_lock); + return 0; +} + +static int skge_set_sg(struct net_device *dev, u32 data) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + + if (hw->chip_id == CHIP_ID_GENESIS && data) + return -EOPNOTSUPP; + return ethtool_op_set_sg(dev, data); +} + +static u32 skge_get_rx_csum(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + + return skge->rx_csum; +} + +static int skge_set_rx_csum(struct net_device *dev, u32 data) +{ + struct skge_port *skge = netdev_priv(dev); + + if (skge->hw->chip_id == CHIP_ID_GENESIS && data) + return -EOPNOTSUPP; + + skge->rx_csum = data; + return 0; +} + +static int skge_set_tso(struct net_device *dev, u32 data) +{ + if (data) + return -EOPNOTSUPP; + return 0; +} + +static void skge_get_pauseparam(struct net_device *dev, + struct ethtool_pauseparam *ecmd) +{ + struct skge_port *skge = netdev_priv(dev); + + ecmd->tx_pause = (skge->flow_control == FLOW_MODE_LOC_SEND) + || (skge->flow_control == FLOW_MODE_SYMMETRIC); + ecmd->rx_pause = (skge->flow_control == FLOW_MODE_REM_SEND) + || (skge->flow_control == FLOW_MODE_SYMMETRIC); + + ecmd->autoneg = skge->autoneg; +} + +static int skge_set_pauseparam(struct net_device *dev, + struct ethtool_pauseparam *ecmd) +{ + struct skge_port *skge = netdev_priv(dev); + + skge->autoneg = ecmd->autoneg; + if (ecmd->rx_pause && ecmd->tx_pause) + skge->flow_control = FLOW_MODE_SYMMETRIC; + else if(ecmd->rx_pause && !ecmd->tx_pause) + skge->flow_control = FLOW_MODE_REM_SEND; + else if(!ecmd->rx_pause && ecmd->tx_pause) + skge->flow_control = FLOW_MODE_LOC_SEND; + else + skge->flow_control = FLOW_MODE_NONE; + + if (netif_running(dev)) { + skge_down(dev); + skge_up(dev); + } + return 0; +} + +static inline u32 skge_freq(const struct skge_hw *hw) +{ + if (hw->chip_id == CHIP_ID_GENESIS) + return 53215000; /* or: 53.125 MHz */ + else if (hw->chip_id == CHIP_ID_YUKON_EC) + return 125000000; /* or: 125.000 MHz */ + else + return 78215000; /* or: 78.125 MHz */ +} + +static int skge_get_coalesce(struct net_device *dev, + struct ethtool_coalesce *ecmd) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + int port = skge->port; + + ecmd->rx_coalesce_usecs = 0; + ecmd->tx_coalesce_usecs = 0; + + if (skge_read32(hw, B2_IRQM_CTRL) & TIM_START) { + u32 msk; + u64 delay = skge_read32(hw, B2_IRQM_INI); + + pr_debug("irqm = %lld\n", delay); + delay *= USEC_PER_SEC; + + do_div(delay, skge_freq(hw)); + msk = skge_read32(hw, B2_IRQM_MSK); + + if (((port == 0) && (msk & IS_R1_F)) || + ((port == 1) && (msk & IS_R2_F))) + ecmd->rx_coalesce_usecs = delay; + if (((port == 0) && (msk & IS_XA1_F)) || + ((port == 1) && (msk & IS_XA1_F))) + ecmd->tx_coalesce_usecs = delay; + } + + return 0; +} + +/* Note: interrupt timer is per board, but can turn on/off per port */ +static int skge_set_coalesce(struct net_device *dev, + struct ethtool_coalesce *ecmd) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + int port = skge->port; + u32 msk = skge_read32(hw, B2_IRQM_MSK); + u32 delay = 25; + + if (ecmd->rx_coalesce_usecs == 0) + msk &= ~(port == 0 ? IS_R1_F : IS_R2_F); + else if (ecmd->rx_coalesce_usecs < 25 || + ecmd->rx_coalesce_usecs > 33333) + return -EINVAL; + else { + msk |= port == 0 ? IS_R1_F : IS_R2_F; + delay = ecmd->rx_coalesce_usecs; + } + + if (ecmd->tx_coalesce_usecs == 0) + msk &= ~((port == 0) ? IS_XA1_F : IS_XA2_F); + else if (ecmd->tx_coalesce_usecs < 25 || + ecmd->tx_coalesce_usecs > 33333) + return -EINVAL; + else { + msk |= (port == 0) ? IS_XA1_F : IS_XA2_F; + delay = min(delay, ecmd->rx_coalesce_usecs); + } + + skge_write32(hw, B2_IRQM_MSK, msk); + if (msk == 0) + skge_write32(hw, B2_IRQM_CTRL, TIM_STOP); + else { + u64 ticks = (u64) delay * skge_freq(hw); + pr_debug("ticks * 10^6=%lld\n", ticks); + do_div(ticks, USEC_PER_SEC); + skge_write32(hw, B2_IRQM_INI, ticks); + skge_write32(hw, B2_IRQM_CTRL, TIM_START); + } + return 0; +} + +static void skge_led_on(struct skge_hw *hw, int port) +{ + if (hw->chip_id == CHIP_ID_GENESIS) { + skge_write8(hw, SKGEMAC_REG(port, LNK_LED_REG), LINKLED_ON); + skge_write8(hw, B0_LED, LED_STAT_ON); + + skge_write8(hw, SKGEMAC_REG(port, RX_LED_TST), LED_T_ON); + skge_write32(hw, SKGEMAC_REG(port, RX_LED_VAL), 100); + skge_write8(hw, SKGEMAC_REG(port, RX_LED_CTRL), LED_START); + + switch (hw->phy_type) { + case SK_PHY_BCOM: + skge_xm_phy_write(hw, port, PHY_BCOM_P_EXT_CTRL, + PHY_B_PEC_LED_ON); + break; + case SK_PHY_LONE: + skge_xm_phy_write(hw, port, PHY_LONE_LED_CFG, + 0x0800); + break; + default: + skge_write8(hw, SKGEMAC_REG(port, TX_LED_TST), LED_T_ON); + skge_write32(hw, SKGEMAC_REG(port, TX_LED_VAL), 100); + skge_write8(hw, SKGEMAC_REG(port, TX_LED_CTRL), LED_START); + } + } else { + skge_gm_phy_write(hw, port, PHY_MARV_LED_CTRL, 0); + skge_gm_phy_write(hw, port, PHY_MARV_LED_OVER, + PHY_M_LED_MO_DUP(MO_LED_ON) | + PHY_M_LED_MO_10(MO_LED_ON) | + PHY_M_LED_MO_100(MO_LED_ON) | + PHY_M_LED_MO_1000(MO_LED_ON) | + PHY_M_LED_MO_RX(MO_LED_ON)); + } +} + +static void skge_led_off(struct skge_hw *hw, int port) +{ + if (hw->chip_id == CHIP_ID_GENESIS) { + skge_write8(hw, SKGEMAC_REG(port, LNK_LED_REG), LINKLED_OFF); + skge_write8(hw, B0_LED, LED_STAT_OFF); + + skge_write32(hw, SKGEMAC_REG(port, RX_LED_VAL), 0); + skge_write8(hw, SKGEMAC_REG(port, RX_LED_CTRL), LED_T_OFF); + + switch (hw->phy_type) { + case SK_PHY_BCOM: + skge_xm_phy_write(hw, port, PHY_BCOM_P_EXT_CTRL, + PHY_B_PEC_LED_OFF); + break; + case SK_PHY_LONE: + skge_xm_phy_write(hw, port, PHY_LONE_LED_CFG, + PHY_L_LC_LEDT); + break; + default: + skge_write32(hw, SKGEMAC_REG(port, TX_LED_VAL), 0); + skge_write8(hw, SKGEMAC_REG(port, TX_LED_CTRL), LED_T_OFF); + } + } else { + skge_gm_phy_write(hw, port, PHY_MARV_LED_CTRL, 0); + skge_gm_phy_write(hw, port, PHY_MARV_LED_OVER, + PHY_M_LED_MO_DUP(MO_LED_OFF) | + PHY_M_LED_MO_10(MO_LED_OFF) | + PHY_M_LED_MO_100(MO_LED_OFF) | + PHY_M_LED_MO_1000(MO_LED_OFF) | + PHY_M_LED_MO_RX(MO_LED_OFF)); + } +} + +static void skge_blink_timer(unsigned long data) +{ + struct skge_port *skge = (struct skge_port *) data; + struct skge_hw *hw = skge->hw; + unsigned long flags; + + spin_lock_irqsave(&hw->phy_lock, flags); + if (skge->blink_on) + skge_led_on(hw, skge->port); + else + skge_led_off(hw, skge->port); + spin_unlock_irqrestore(&hw->phy_lock, flags); + + skge->blink_on = !skge->blink_on; + mod_timer(&skge->led_blink, jiffies + BLINK_HZ); +} + +/* blink LED's for finding board */ +static int skge_phys_id(struct net_device *dev, u32 data) +{ + struct skge_port *skge = netdev_priv(dev); + + if(!data || data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ)) + data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ); + + /* start blinking */ + skge->blink_on = 1; + mod_timer(&skge->led_blink, jiffies+1); + + msleep_interruptible(data * 1000); + del_timer_sync(&skge->led_blink); + + skge_led_off(skge->hw, skge->port); + + return 0; +} + +static struct ethtool_ops skge_ethtool_ops = { + .get_settings = skge_get_settings, + .set_settings = skge_set_settings, + .get_drvinfo = skge_get_drvinfo, + .get_regs_len = skge_get_regs_len, + .get_regs = skge_get_regs, + .get_wol = skge_get_wol, + .set_wol = skge_set_wol, + .get_msglevel = skge_get_msglevel, + .set_msglevel = skge_set_msglevel, + .nway_reset = skge_nway_reset, + .get_link = ethtool_op_get_link, + .get_ringparam = skge_get_ring_param, + .set_ringparam = skge_set_ring_param, + .get_pauseparam = skge_get_pauseparam, + .set_pauseparam = skge_set_pauseparam, + .get_coalesce = skge_get_coalesce, + .set_coalesce = skge_set_coalesce, + .get_tso = ethtool_op_get_tso, + .set_tso = skge_set_tso, + .get_sg = ethtool_op_get_sg, + .set_sg = skge_set_sg, + .get_tx_csum = ethtool_op_get_tx_csum, + .set_tx_csum = ethtool_op_set_tx_csum, + .get_rx_csum = skge_get_rx_csum, + .set_rx_csum = skge_set_rx_csum, + .get_strings = skge_get_strings, + .phys_id = skge_phys_id, + .get_stats_count = skge_get_stats_count, + .get_ethtool_stats = skge_get_ethtool_stats, +}; + +/* + * Allocate ring elements and chain them together + * One-to-one association of board descriptors with ring elements + */ +static int skge_ring_alloc(struct skge_ring *ring, void *vaddr, u64 base) +{ + struct skge_tx_desc *d; + struct skge_element *e; + int i; + + ring->start = kmalloc(sizeof(*e)*ring->count, GFP_KERNEL); + if (!ring->start) + return -ENOMEM; + + for (i = 0, e = ring->start, d = vaddr; i < ring->count; i++, e++, d++) { + e->desc = d; + if (i == ring->count - 1) { + e->next = ring->start; + d->next_offset = base; + } else { + e->next = e + 1; + d->next_offset = base + (i+1) * sizeof(*d); + } + } + ring->to_use = ring->to_clean = ring->start; + + return 0; +} + +/* Setup buffer for receiving */ +static inline int skge_rx_alloc(struct skge_port *skge, + struct skge_element *e) +{ + unsigned long bufsize = skge->netdev->mtu + ETH_HLEN; /* VLAN? */ + struct skge_rx_desc *rd = e->desc; + struct sk_buff *skb; + u64 map; + + skb = dev_alloc_skb(bufsize + NET_IP_ALIGN); + if (unlikely(!skb)) { + printk(KERN_DEBUG PFX "%s: out of memory for receive\n", + skge->netdev->name); + return -ENOMEM; + } + + skb->dev = skge->netdev; + skb_reserve(skb, NET_IP_ALIGN); + + map = pci_map_single(skge->hw->pdev, skb->data, bufsize, + PCI_DMA_FROMDEVICE); + + rd->dma_lo = map; + rd->dma_hi = map >> 32; + e->skb = skb; + rd->csum1_start = ETH_HLEN; + rd->csum2_start = ETH_HLEN; + rd->csum1 = 0; + rd->csum2 = 0; + + wmb(); + + rd->control = BMU_OWN | BMU_STF | BMU_IRQ_EOF | BMU_TCP_CHECK | bufsize; + pci_unmap_addr_set(e, mapaddr, map); + pci_unmap_len_set(e, maplen, bufsize); + return 0; +} + +/* Free all unused buffers in receive ring, assumes receiver stopped */ +static void skge_rx_clean(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + struct skge_ring *ring = &skge->rx_ring; + struct skge_element *e; + + for (e = ring->to_clean; e != ring->to_use; e = e->next) { + struct skge_rx_desc *rd = e->desc; + rd->control = 0; + + pci_unmap_single(hw->pdev, + pci_unmap_addr(e, mapaddr), + pci_unmap_len(e, maplen), + PCI_DMA_FROMDEVICE); + dev_kfree_skb(e->skb); + e->skb = NULL; + } + ring->to_clean = e; +} + +/* Allocate buffers for receive ring + * For receive: to_use is refill location + * to_clean is next received frame. + * + * if (to_use == to_clean) + * then ring all frames in ring need buffers + * if (to_use->next == to_clean) + * then ring all frames in ring have buffers + */ +static int skge_rx_fill(struct skge_port *skge) +{ + struct skge_ring *ring = &skge->rx_ring; + struct skge_element *e; + int ret = 0; + + for (e = ring->to_use; e->next != ring->to_clean; e = e->next) { + if (skge_rx_alloc(skge, e)) { + ret = 1; + break; + } + + } + ring->to_use = e; + + return ret; +} + +static void skge_link_up(struct skge_port *skge) +{ + netif_carrier_on(skge->netdev); + if (skge->tx_avail > MAX_SKB_FRAGS + 1) + netif_wake_queue(skge->netdev); + + if (netif_msg_link(skge)) + printk(KERN_INFO PFX + "%s: Link is up at %d Mbps, %s duplex, flow control %s\n", + skge->netdev->name, skge->speed, + skge->duplex == DUPLEX_FULL ? "full" : "half", + (skge->flow_control == FLOW_MODE_NONE) ? "none" : + (skge->flow_control == FLOW_MODE_LOC_SEND) ? "tx only" : + (skge->flow_control == FLOW_MODE_REM_SEND) ? "rx only" : + (skge->flow_control == FLOW_MODE_SYMMETRIC) ? "tx and rx" : + "unknown"); +} + +static void skge_link_down(struct skge_port *skge) +{ + netif_carrier_off(skge->netdev); + netif_stop_queue(skge->netdev); + + if (netif_msg_link(skge)) + printk(KERN_INFO PFX "%s: Link is down.\n", skge->netdev->name); +} + +static u16 skge_xm_phy_read(struct skge_hw *hw, int port, u16 reg) +{ + int i; + u16 v; + + skge_xm_write16(hw, port, XM_PHY_ADDR, reg | hw->phy_addr); + v = skge_xm_read16(hw, port, XM_PHY_DATA); + if (hw->phy_type != SK_PHY_XMAC) { + for (i = 0; i < PHY_RETRIES; i++) { + udelay(1); + if (skge_xm_read16(hw, port, XM_MMU_CMD) + & XM_MMU_PHY_RDY) + goto ready; + } + + printk(KERN_WARNING PFX "%s: phy read timed out\n", + hw->dev[port]->name); + return 0; + ready: + v = skge_xm_read16(hw, port, XM_PHY_DATA); + } + + return v; +} + +static void skge_xm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val) +{ + int i; + + skge_xm_write16(hw, port, XM_PHY_ADDR, reg | hw->phy_addr); + for (i = 0; i < PHY_RETRIES; i++) { + if (!(skge_xm_read16(hw, port, XM_MMU_CMD) & XM_MMU_PHY_BUSY)) + goto ready; + cpu_relax(); + } + printk(KERN_WARNING PFX "%s: phy write failed to come ready\n", + hw->dev[port]->name); + + + ready: + skge_xm_write16(hw, port, XM_PHY_DATA, val); + for (i = 0; i < PHY_RETRIES; i++) { + udelay(1); + if (!(skge_xm_read16(hw, port, XM_MMU_CMD) & XM_MMU_PHY_BUSY)) + return; + } + printk(KERN_WARNING PFX "%s: phy write timed out\n", + hw->dev[port]->name); +} + +static void genesis_init(struct skge_hw *hw) +{ + /* set blink source counter */ + skge_write32(hw, B2_BSC_INI, (SK_BLK_DUR * SK_FACT_53) / 100); + skge_write8(hw, B2_BSC_CTRL, BSC_START); + + /* configure mac arbiter */ + skge_write16(hw, B3_MA_TO_CTRL, MA_RST_CLR); + + /* configure mac arbiter timeout values */ + skge_write8(hw, B3_MA_TOINI_RX1, SK_MAC_TO_53); + skge_write8(hw, B3_MA_TOINI_RX2, SK_MAC_TO_53); + skge_write8(hw, B3_MA_TOINI_TX1, SK_MAC_TO_53); + skge_write8(hw, B3_MA_TOINI_TX2, SK_MAC_TO_53); + + skge_write8(hw, B3_MA_RCINI_RX1, 0); + skge_write8(hw, B3_MA_RCINI_RX2, 0); + skge_write8(hw, B3_MA_RCINI_TX1, 0); + skge_write8(hw, B3_MA_RCINI_TX2, 0); + + /* configure packet arbiter timeout */ + skge_write16(hw, B3_PA_CTRL, PA_RST_CLR); + skge_write16(hw, B3_PA_TOINI_RX1, SK_PKT_TO_MAX); + skge_write16(hw, B3_PA_TOINI_TX1, SK_PKT_TO_MAX); + skge_write16(hw, B3_PA_TOINI_RX2, SK_PKT_TO_MAX); + skge_write16(hw, B3_PA_TOINI_TX2, SK_PKT_TO_MAX); +} + +static void genesis_reset(struct skge_hw *hw, int port) +{ + int i; + u64 zero = 0; + + /* reset the statistics module */ + skge_xm_write32(hw, port, XM_GP_PORT, XM_GP_RES_STAT); + skge_xm_write16(hw, port, XM_IMSK, 0xffff); /* disable XMAC IRQs */ + skge_xm_write32(hw, port, XM_MODE, 0); /* clear Mode Reg */ + skge_xm_write16(hw, port, XM_TX_CMD, 0); /* reset TX CMD Reg */ + skge_xm_write16(hw, port, XM_RX_CMD, 0); /* reset RX CMD Reg */ + + /* disable all PHY IRQs */ + if (hw->phy_type == SK_PHY_BCOM) + skge_xm_write16(hw, port, PHY_BCOM_INT_MASK, 0xffff); + + skge_xm_outhash(hw, port, XM_HSM, (u8 *) &zero); + for (i = 0; i < 15; i++) + skge_xm_outaddr(hw, port, XM_EXM(i), (u8 *) &zero); + skge_xm_outhash(hw, port, XM_SRC_CHK, (u8 *) &zero); +} + + +static void genesis_mac_init(struct skge_hw *hw, int port) +{ + struct skge_port *skge = netdev_priv(hw->dev[port]); + int i; + u32 r; + u16 id1; + u16 ctrl1, ctrl2, ctrl3, ctrl4, ctrl5; + + /* magic workaround patterns for Broadcom */ + static const struct { + u16 reg; + u16 val; + } A1hack[] = { + { 0x18, 0x0c20 }, { 0x17, 0x0012 }, { 0x15, 0x1104 }, + { 0x17, 0x0013 }, { 0x15, 0x0404 }, { 0x17, 0x8006 }, + { 0x15, 0x0132 }, { 0x17, 0x8006 }, { 0x15, 0x0232 }, + { 0x17, 0x800D }, { 0x15, 0x000F }, { 0x18, 0x0420 }, + }, C0hack[] = { + { 0x18, 0x0c20 }, { 0x17, 0x0012 }, { 0x15, 0x1204 }, + { 0x17, 0x0013 }, { 0x15, 0x0A04 }, { 0x18, 0x0420 }, + }; + + + /* initialize Rx, Tx and Link LED */ + skge_write8(hw, SKGEMAC_REG(port, LNK_LED_REG), LINKLED_ON); + skge_write8(hw, SKGEMAC_REG(port, LNK_LED_REG), LINKLED_LINKSYNC_ON); + + skge_write8(hw, SKGEMAC_REG(port, RX_LED_CTRL), LED_START); + skge_write8(hw, SKGEMAC_REG(port, TX_LED_CTRL), LED_START); + + /* Unreset the XMAC. */ + skge_write16(hw, SKGEMAC_REG(port, TX_MFF_CTRL1), MFF_CLR_MAC_RST); + + /* + * Perform additional initialization for external PHYs, + * namely for the 1000baseTX cards that use the XMAC's + * GMII mode. + */ + spin_lock_bh(&hw->phy_lock); + if (hw->phy_type != SK_PHY_XMAC) { + /* Take PHY out of reset. */ + r = skge_read32(hw, B2_GP_IO); + if (port == 0) + r |= GP_DIR_0|GP_IO_0; + else + r |= GP_DIR_2|GP_IO_2; + + skge_write32(hw, B2_GP_IO, r); + skge_read32(hw, B2_GP_IO); + + /* Enable GMII mode on the XMAC. */ + skge_xm_write16(hw, port, XM_HW_CFG, XM_HW_GMII_MD); + + id1 = skge_xm_phy_read(hw, port, PHY_XMAC_ID1); + + /* Optimize MDIO transfer by suppressing preamble. */ + skge_xm_write16(hw, port, XM_MMU_CMD, + skge_xm_read16(hw, port, XM_MMU_CMD) + | XM_MMU_NO_PRE); + + if (id1 == PHY_BCOM_ID1_C0) { + /* + * Workaround BCOM Errata for the C0 type. + * Write magic patterns to reserved registers. + */ + for (i = 0; i < ARRAY_SIZE(C0hack); i++) + skge_xm_phy_write(hw, port, + C0hack[i].reg, C0hack[i].val); + + } else if (id1 == PHY_BCOM_ID1_A1) { + /* + * Workaround BCOM Errata for the A1 type. + * Write magic patterns to reserved registers. + */ + for (i = 0; i < ARRAY_SIZE(A1hack); i++) + skge_xm_phy_write(hw, port, + A1hack[i].reg, A1hack[i].val); + } + + /* + * Workaround BCOM Errata (#10523) for all BCom PHYs. + * Disable Power Management after reset. + */ + r = skge_xm_phy_read(hw, port, PHY_BCOM_AUX_CTRL); + skge_xm_phy_write(hw, port, PHY_BCOM_AUX_CTRL, r | PHY_B_AC_DIS_PM); + } + + /* Dummy read */ + skge_xm_read16(hw, port, XM_ISRC); + + r = skge_xm_read32(hw, port, XM_MODE); + skge_xm_write32(hw, port, XM_MODE, r|XM_MD_CSA); + + /* We don't need the FCS appended to the packet. */ + r = skge_xm_read16(hw, port, XM_RX_CMD); + skge_xm_write16(hw, port, XM_RX_CMD, r | XM_RX_STRIP_FCS); + + /* We want short frames padded to 60 bytes. */ + r = skge_xm_read16(hw, port, XM_TX_CMD); + skge_xm_write16(hw, port, XM_TX_CMD, r | XM_TX_AUTO_PAD); + + /* + * Enable the reception of all error frames. This is is + * a necessary evil due to the design of the XMAC. The + * XMAC's receive FIFO is only 8K in size, however jumbo + * frames can be up to 9000 bytes in length. When bad + * frame filtering is enabled, the XMAC's RX FIFO operates + * in 'store and forward' mode. For this to work, the + * entire frame has to fit into the FIFO, but that means + * that jumbo frames larger than 8192 bytes will be + * truncated. Disabling all bad frame filtering causes + * the RX FIFO to operate in streaming mode, in which + * case the XMAC will start transfering frames out of the + * RX FIFO as soon as the FIFO threshold is reached. + */ + r = skge_xm_read32(hw, port, XM_MODE); + skge_xm_write32(hw, port, XM_MODE, + XM_MD_RX_CRCE|XM_MD_RX_LONG|XM_MD_RX_RUNT| + XM_MD_RX_ERR|XM_MD_RX_IRLE); + + skge_xm_outaddr(hw, port, XM_SA, hw->dev[port]->dev_addr); + skge_xm_outaddr(hw, port, XM_EXM(0), hw->dev[port]->dev_addr); + + /* + * Bump up the transmit threshold. This helps hold off transmit + * underruns when we're blasting traffic from both ports at once. + */ + skge_xm_write16(hw, port, XM_TX_THR, 512); + + /* Configure MAC arbiter */ + skge_write16(hw, B3_MA_TO_CTRL, MA_RST_CLR); + + /* configure timeout values */ + skge_write8(hw, B3_MA_TOINI_RX1, 72); + skge_write8(hw, B3_MA_TOINI_RX2, 72); + skge_write8(hw, B3_MA_TOINI_TX1, 72); + skge_write8(hw, B3_MA_TOINI_TX2, 72); + + skge_write8(hw, B3_MA_RCINI_RX1, 0); + skge_write8(hw, B3_MA_RCINI_RX2, 0); + skge_write8(hw, B3_MA_RCINI_TX1, 0); + skge_write8(hw, B3_MA_RCINI_TX2, 0); + + /* Configure Rx MAC FIFO */ + skge_write8(hw, SKGEMAC_REG(port, RX_MFF_CTRL2), MFF_RST_CLR); + skge_write16(hw, SKGEMAC_REG(port, RX_MFF_CTRL1), MFF_ENA_TIM_PAT); + skge_write8(hw, SKGEMAC_REG(port, RX_MFF_CTRL2), MFF_ENA_OP_MD); + + /* Configure Tx MAC FIFO */ + skge_write8(hw, SKGEMAC_REG(port, TX_MFF_CTRL2), MFF_RST_CLR); + skge_write16(hw, SKGEMAC_REG(port, TX_MFF_CTRL1), MFF_TX_CTRL_DEF); + skge_write8(hw, SKGEMAC_REG(port, TX_MFF_CTRL2), MFF_ENA_OP_MD); + + if (hw->dev[port]->mtu > ETH_DATA_LEN) { + /* Enable frame flushing if jumbo frames used */ + skge_write16(hw, SKGEMAC_REG(port,RX_MFF_CTRL1), MFF_ENA_FLUSH); + } else { + /* enable timeout timers if normal frames */ + skge_write16(hw, B3_PA_CTRL, + port == 0 ? PA_ENA_TO_TX1 : PA_ENA_TO_TX2); + } + + + r = skge_xm_read16(hw, port, XM_RX_CMD); + if (hw->dev[port]->mtu > ETH_DATA_LEN) + skge_xm_write16(hw, port, XM_RX_CMD, r | XM_RX_BIG_PK_OK); + else + skge_xm_write16(hw, port, XM_RX_CMD, r & ~(XM_RX_BIG_PK_OK)); + + switch (hw->phy_type) { + case SK_PHY_XMAC: + if (skge->autoneg == AUTONEG_ENABLE) { + ctrl1 = PHY_X_AN_FD | PHY_X_AN_HD; + + switch (skge->flow_control) { + case FLOW_MODE_NONE: + ctrl1 |= PHY_X_P_NO_PAUSE; + break; + case FLOW_MODE_LOC_SEND: + ctrl1 |= PHY_X_P_ASYM_MD; + break; + case FLOW_MODE_SYMMETRIC: + ctrl1 |= PHY_X_P_SYM_MD; + break; + case FLOW_MODE_REM_SEND: + ctrl1 |= PHY_X_P_BOTH_MD; + break; + } + + skge_xm_phy_write(hw, port, PHY_XMAC_AUNE_ADV, ctrl1); + ctrl2 = PHY_CT_ANE | PHY_CT_RE_CFG; + } else { + ctrl2 = 0; + if (skge->duplex == DUPLEX_FULL) + ctrl2 |= PHY_CT_DUP_MD; + } + + skge_xm_phy_write(hw, port, PHY_XMAC_CTRL, ctrl2); + break; + + case SK_PHY_BCOM: + ctrl1 = PHY_CT_SP1000; + ctrl2 = 0; + ctrl3 = PHY_SEL_TYPE; + ctrl4 = PHY_B_PEC_EN_LTR; + ctrl5 = PHY_B_AC_TX_TST; + + if (skge->autoneg == AUTONEG_ENABLE) { + /* + * Workaround BCOM Errata #1 for the C5 type. + * 1000Base-T Link Acquisition Failure in Slave Mode + * Set Repeater/DTE bit 10 of the 1000Base-T Control Register + */ + ctrl2 |= PHY_B_1000C_RD; + if (skge->advertising & ADVERTISED_1000baseT_Half) + ctrl2 |= PHY_B_1000C_AHD; + if (skge->advertising & ADVERTISED_1000baseT_Full) + ctrl2 |= PHY_B_1000C_AFD; + + /* Set Flow-control capabilities */ + switch (skge->flow_control) { + case FLOW_MODE_NONE: + ctrl3 |= PHY_B_P_NO_PAUSE; + break; + case FLOW_MODE_LOC_SEND: + ctrl3 |= PHY_B_P_ASYM_MD; + break; + case FLOW_MODE_SYMMETRIC: + ctrl3 |= PHY_B_P_SYM_MD; + break; + case FLOW_MODE_REM_SEND: + ctrl3 |= PHY_B_P_BOTH_MD; + break; + } + + /* Restart Auto-negotiation */ + ctrl1 |= PHY_CT_ANE | PHY_CT_RE_CFG; + } else { + if (skge->duplex == DUPLEX_FULL) + ctrl1 |= PHY_CT_DUP_MD; + + ctrl2 |= PHY_B_1000C_MSE; /* set it to Slave */ + } + + skge_xm_phy_write(hw, port, PHY_BCOM_1000T_CTRL, ctrl2); + skge_xm_phy_write(hw, port, PHY_BCOM_AUNE_ADV, ctrl3); + + if (skge->netdev->mtu > ETH_DATA_LEN) { + ctrl4 |= PHY_B_PEC_HIGH_LA; + ctrl5 |= PHY_B_AC_LONG_PACK; + + skge_xm_phy_write(hw, port,PHY_BCOM_AUX_CTRL, ctrl5); + } + + skge_xm_phy_write(hw, port, PHY_BCOM_P_EXT_CTRL, ctrl4); + skge_xm_phy_write(hw, port, PHY_BCOM_CTRL, ctrl1); + break; + } + spin_unlock_bh(&hw->phy_lock); + + /* Clear MIB counters */ + skge_xm_write16(hw, port, XM_STAT_CMD, + XM_SC_CLR_RXC | XM_SC_CLR_TXC); + /* Clear two times according to Errata #3 */ + skge_xm_write16(hw, port, XM_STAT_CMD, + XM_SC_CLR_RXC | XM_SC_CLR_TXC); + + /* Start polling for link status */ + mod_timer(&skge->link_check, jiffies + LINK_POLL_HZ); +} + +static void genesis_stop(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + + /* Clear Tx packet arbiter timeout IRQ */ + skge_write16(hw, B3_PA_CTRL, + port == 0 ? PA_CLR_TO_TX1 : PA_CLR_TO_TX2); + + /* + * If the transfer stucks at the MAC the STOP command will not + * terminate if we don't flush the XMAC's transmit FIFO ! + */ + skge_xm_write32(hw, port, XM_MODE, + skge_xm_read32(hw, port, XM_MODE)|XM_MD_FTF); + + + /* Reset the MAC */ + skge_write16(hw, SKGEMAC_REG(port, TX_MFF_CTRL1), MFF_SET_MAC_RST); + + /* For external PHYs there must be special handling */ + if (hw->phy_type != SK_PHY_XMAC) { + u32 reg = skge_read32(hw, B2_GP_IO); + + if (port == 0) { + reg |= GP_DIR_0; + reg &= ~GP_IO_0; + } else { + reg |= GP_DIR_2; + reg &= ~GP_IO_2; + } + skge_write32(hw, B2_GP_IO, reg); + skge_read32(hw, B2_GP_IO); + } + + skge_xm_write16(hw, port, XM_MMU_CMD, + skge_xm_read16(hw, port, XM_MMU_CMD) + & ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX)); + + skge_xm_read16(hw, port, XM_MMU_CMD); +} + + +static void genesis_get_stats(struct skge_port *skge, u64 *data) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + int i; + unsigned long timeout = jiffies + HZ; + + skge_xm_write16(hw, port, + XM_STAT_CMD, XM_SC_SNP_TXC | XM_SC_SNP_RXC); + + /* wait for update to complete */ + while (skge_xm_read16(hw, port, XM_STAT_CMD) + & (XM_SC_SNP_TXC | XM_SC_SNP_RXC)) { + if (time_after(jiffies, timeout)) + break; + udelay(10); + } + + /* special case for 64 bit octet counter */ + data[0] = (u64) skge_xm_read32(hw, port, XM_TXO_OK_HI) << 32 + | skge_xm_read32(hw, port, XM_TXO_OK_LO); + data[1] = (u64) skge_xm_read32(hw, port, XM_RXO_OK_HI) << 32 + | skge_xm_read32(hw, port, XM_RXO_OK_LO); + + for (i = 2; i < ARRAY_SIZE(skge_stats); i++) + data[i] = skge_xm_read32(hw, port, skge_stats[i].xmac_offset); +} + +static void genesis_mac_intr(struct skge_hw *hw, int port) +{ + struct skge_port *skge = netdev_priv(hw->dev[port]); + u16 status = skge_xm_read16(hw, port, XM_ISRC); + + pr_debug("genesis_intr status %x\n", status); + if (hw->phy_type == SK_PHY_XMAC) { + /* LInk down, start polling for state change */ + if (status & XM_IS_INP_ASS) { + skge_xm_write16(hw, port, XM_IMSK, + skge_xm_read16(hw, port, XM_IMSK) | XM_IS_INP_ASS); + mod_timer(&skge->link_check, jiffies + LINK_POLL_HZ); + } + else if (status & XM_IS_AND) + mod_timer(&skge->link_check, jiffies + LINK_POLL_HZ); + } + + if (status & XM_IS_TXF_UR) { + skge_xm_write32(hw, port, XM_MODE, XM_MD_FTF); + ++skge->net_stats.tx_fifo_errors; + } + if (status & XM_IS_RXF_OV) { + skge_xm_write32(hw, port, XM_MODE, XM_MD_FRF); + ++skge->net_stats.rx_fifo_errors; + } +} + +static void skge_gm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val) +{ + int i; + + skge_gma_write16(hw, port, GM_SMI_DATA, val); + skge_gma_write16(hw, port, GM_SMI_CTRL, + GM_SMI_CT_PHY_AD(hw->phy_addr) | GM_SMI_CT_REG_AD(reg)); + for (i = 0; i < PHY_RETRIES; i++) { + udelay(1); + + if (!(skge_gma_read16(hw, port, GM_SMI_CTRL) & GM_SMI_CT_BUSY)) + break; + } +} + +static u16 skge_gm_phy_read(struct skge_hw *hw, int port, u16 reg) +{ + int i; + + skge_gma_write16(hw, port, GM_SMI_CTRL, + GM_SMI_CT_PHY_AD(hw->phy_addr) + | GM_SMI_CT_REG_AD(reg) | GM_SMI_CT_OP_RD); + + for (i = 0; i < PHY_RETRIES; i++) { + udelay(1); + if (skge_gma_read16(hw, port, GM_SMI_CTRL) & GM_SMI_CT_RD_VAL) + goto ready; + } + + printk(KERN_WARNING PFX "%s: phy read timeout\n", + hw->dev[port]->name); + return 0; + ready: + return skge_gma_read16(hw, port, GM_SMI_DATA); +} + +static void genesis_link_down(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + + pr_debug("genesis_link_down\n"); + + skge_xm_write16(hw, port, XM_MMU_CMD, + skge_xm_read16(hw, port, XM_MMU_CMD) + & ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX)); + + /* dummy read to ensure writing */ + (void) skge_xm_read16(hw, port, XM_MMU_CMD); + + skge_link_down(skge); +} + +static void genesis_link_up(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + u16 cmd; + u32 mode, msk; + + pr_debug("genesis_link_up\n"); + cmd = skge_xm_read16(hw, port, XM_MMU_CMD); + + /* + * enabling pause frame reception is required for 1000BT + * because the XMAC is not reset if the link is going down + */ + if (skge->flow_control == FLOW_MODE_NONE || + skge->flow_control == FLOW_MODE_LOC_SEND) + cmd |= XM_MMU_IGN_PF; + else + /* Enable Pause Frame Reception */ + cmd &= ~XM_MMU_IGN_PF; + + skge_xm_write16(hw, port, XM_MMU_CMD, cmd); + + mode = skge_xm_read32(hw, port, XM_MODE); + if (skge->flow_control == FLOW_MODE_SYMMETRIC || + skge->flow_control == FLOW_MODE_LOC_SEND) { + /* + * Configure Pause Frame Generation + * Use internal and external Pause Frame Generation. + * Sending pause frames is edge triggered. + * Send a Pause frame with the maximum pause time if + * internal oder external FIFO full condition occurs. + * Send a zero pause time frame to re-start transmission. + */ + /* XM_PAUSE_DA = '010000C28001' (default) */ + /* XM_MAC_PTIME = 0xffff (maximum) */ + /* remember this value is defined in big endian (!) */ + skge_xm_write16(hw, port, XM_MAC_PTIME, 0xffff); + + mode |= XM_PAUSE_MODE; + skge_write16(hw, SKGEMAC_REG(port, RX_MFF_CTRL1), MFF_ENA_PAUSE); + } else { + /* + * disable pause frame generation is required for 1000BT + * because the XMAC is not reset if the link is going down + */ + /* Disable Pause Mode in Mode Register */ + mode &= ~XM_PAUSE_MODE; + + skge_write16(hw, SKGEMAC_REG(port, RX_MFF_CTRL1), MFF_DIS_PAUSE); + } + + skge_xm_write32(hw, port, XM_MODE, mode); + + msk = XM_DEF_MSK; + if (hw->phy_type != SK_PHY_XMAC) + msk |= XM_IS_INP_ASS; /* disable GP0 interrupt bit */ + + skge_xm_write16(hw, port, XM_IMSK, msk); + skge_xm_read16(hw, port, XM_ISRC); + + /* get MMU Command Reg. */ + cmd = skge_xm_read16(hw, port, XM_MMU_CMD); + if (hw->phy_type != SK_PHY_XMAC && skge->duplex == DUPLEX_FULL) + cmd |= XM_MMU_GMII_FD; + + if (hw->phy_type == SK_PHY_BCOM) { + /* + * Workaround BCOM Errata (#10523) for all BCom Phys + * Enable Power Management after link up + */ + skge_xm_phy_write(hw, port, PHY_BCOM_AUX_CTRL, + skge_xm_phy_read(hw, port, PHY_BCOM_AUX_CTRL) + & ~PHY_B_AC_DIS_PM); + skge_xm_phy_write(hw, port, PHY_BCOM_INT_MASK, + PHY_B_DEF_MSK); + } + + /* enable Rx/Tx */ + skge_xm_write16(hw, port, XM_MMU_CMD, + cmd | XM_MMU_ENA_RX | XM_MMU_ENA_TX); + skge_link_up(skge); +} + + +static void genesis_bcom_intr(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + u16 stat = skge_xm_phy_read(hw, port, PHY_BCOM_INT_STAT); + + pr_debug("genesis_bcom intr stat=%x\n", stat); + + /* Workaround BCom Errata: + * enable and disable loopback mode if "NO HCD" occurs. + */ + if (stat & PHY_B_IS_NO_HDCL) { + u16 ctrl = skge_xm_phy_read(hw, port, PHY_BCOM_CTRL); + skge_xm_phy_write(hw, port, PHY_BCOM_CTRL, + ctrl | PHY_CT_LOOP); + skge_xm_phy_write(hw, port, PHY_BCOM_CTRL, + ctrl & ~PHY_CT_LOOP); + } + + stat = skge_xm_phy_read(hw, port, PHY_BCOM_STAT); + if (stat & (PHY_B_IS_AN_PR | PHY_B_IS_LST_CHANGE)) { + u16 aux = skge_xm_phy_read(hw, port, PHY_BCOM_AUX_STAT); + if ( !(aux & PHY_B_AS_LS) && netif_carrier_ok(skge->netdev)) + genesis_link_down(skge); + + else if (stat & PHY_B_IS_LST_CHANGE) { + if (aux & PHY_B_AS_AN_C) { + switch (aux & PHY_B_AS_AN_RES_MSK) { + case PHY_B_RES_1000FD: + skge->duplex = DUPLEX_FULL; + break; + case PHY_B_RES_1000HD: + skge->duplex = DUPLEX_HALF; + break; + } + + switch (aux & PHY_B_AS_PAUSE_MSK) { + case PHY_B_AS_PAUSE_MSK: + skge->flow_control = FLOW_MODE_SYMMETRIC; + break; + case PHY_B_AS_PRR: + skge->flow_control = FLOW_MODE_REM_SEND; + break; + case PHY_B_AS_PRT: + skge->flow_control = FLOW_MODE_LOC_SEND; + break; + default: + skge->flow_control = FLOW_MODE_NONE; + } + skge->speed = SPEED_1000; + } + genesis_link_up(skge); + } + else + mod_timer(&skge->link_check, jiffies + LINK_POLL_HZ); + } +} + +/* Perodic poll of phy status to check for link transistion */ +static void skge_link_timer(unsigned long __arg) +{ + struct skge_port *skge = (struct skge_port *) __arg; + struct skge_hw *hw = skge->hw; + int port = skge->port; + + if (hw->chip_id != CHIP_ID_GENESIS || !netif_running(skge->netdev)) + return; + + spin_lock_bh(&hw->phy_lock); + if (hw->phy_type == SK_PHY_BCOM) + genesis_bcom_intr(skge); + else { + int i; + for (i = 0; i < 3; i++) + if (skge_xm_read16(hw, port, XM_ISRC) & XM_IS_INP_ASS) + break; + + if (i == 3) + mod_timer(&skge->link_check, jiffies + LINK_POLL_HZ); + else + genesis_link_up(skge); + } + spin_unlock_bh(&hw->phy_lock); +} + +/* Marvell Phy Initailization */ +static void yukon_init(struct skge_hw *hw, int port) +{ + struct skge_port *skge = netdev_priv(hw->dev[port]); + u16 ctrl, ct1000, adv; + u16 ledctrl, ledover; + + pr_debug("yukon_init\n"); + if (skge->autoneg == AUTONEG_ENABLE) { + u16 ectrl = skge_gm_phy_read(hw, port, PHY_MARV_EXT_CTRL); + + ectrl &= ~(PHY_M_EC_M_DSC_MSK | PHY_M_EC_S_DSC_MSK | + PHY_M_EC_MAC_S_MSK); + ectrl |= PHY_M_EC_MAC_S(MAC_TX_CLK_25_MHZ); + + /* on PHY 88E1111 there is a change for downshift control */ + if (hw->chip_id == CHIP_ID_YUKON_EC) + ectrl |= PHY_M_EC_M_DSC_2(0) | PHY_M_EC_DOWN_S_ENA; + else + ectrl |= PHY_M_EC_M_DSC(0) | PHY_M_EC_S_DSC(1); + + skge_gm_phy_write(hw, port, PHY_MARV_EXT_CTRL, ectrl); + } + + ctrl = skge_gm_phy_read(hw, port, PHY_MARV_CTRL); + if (skge->autoneg == AUTONEG_DISABLE) + ctrl &= ~PHY_CT_ANE; + + ctrl |= PHY_CT_RESET; + skge_gm_phy_write(hw, port, PHY_MARV_CTRL, ctrl); + + ctrl = 0; + ct1000 = 0; + adv = PHY_SEL_TYPE; + + if (skge->autoneg == AUTONEG_ENABLE) { + if (iscopper(hw)) { + if (skge->advertising & ADVERTISED_1000baseT_Full) + ct1000 |= PHY_M_1000C_AFD; + if (skge->advertising & ADVERTISED_1000baseT_Half) + ct1000 |= PHY_M_1000C_AHD; + if (skge->advertising & ADVERTISED_100baseT_Full) + adv |= PHY_M_AN_100_FD; + if (skge->advertising & ADVERTISED_100baseT_Half) + adv |= PHY_M_AN_100_HD; + if (skge->advertising & ADVERTISED_10baseT_Full) + adv |= PHY_M_AN_10_FD; + if (skge->advertising & ADVERTISED_10baseT_Half) + adv |= PHY_M_AN_10_HD; + + /* Set Flow-control capabilities */ + switch (skge->flow_control) { + case FLOW_MODE_NONE: + adv |= PHY_B_P_NO_PAUSE; + break; + case FLOW_MODE_LOC_SEND: + adv |= PHY_B_P_ASYM_MD; + break; + case FLOW_MODE_SYMMETRIC: + adv |= PHY_B_P_SYM_MD; + break; + case FLOW_MODE_REM_SEND: + adv |= PHY_B_P_BOTH_MD; + break; + } + } else { /* special defines for FIBER (88E1011S only) */ + adv |= PHY_M_AN_1000X_AHD | PHY_M_AN_1000X_AFD; + + /* Set Flow-control capabilities */ + switch (skge->flow_control) { + case FLOW_MODE_NONE: + adv |= PHY_M_P_NO_PAUSE_X; + break; + case FLOW_MODE_LOC_SEND: + adv |= PHY_M_P_ASYM_MD_X; + break; + case FLOW_MODE_SYMMETRIC: + adv |= PHY_M_P_SYM_MD_X; + break; + case FLOW_MODE_REM_SEND: + adv |= PHY_M_P_BOTH_MD_X; + break; + } + } + /* Restart Auto-negotiation */ + ctrl |= PHY_CT_ANE | PHY_CT_RE_CFG; + } else { + /* forced speed/duplex settings */ + ct1000 = PHY_M_1000C_MSE; + + if (skge->duplex == DUPLEX_FULL) + ctrl |= PHY_CT_DUP_MD; + + switch (skge->speed) { + case SPEED_1000: + ctrl |= PHY_CT_SP1000; + break; + case SPEED_100: + ctrl |= PHY_CT_SP100; + break; + } + + ctrl |= PHY_CT_RESET; + } + + if (hw->chip_id != CHIP_ID_YUKON_FE) + skge_gm_phy_write(hw, port, PHY_MARV_1000T_CTRL, ct1000); + + skge_gm_phy_write(hw, port, PHY_MARV_AUNE_ADV, adv); + skge_gm_phy_write(hw, port, PHY_MARV_CTRL, ctrl); + + /* Setup Phy LED's */ + ledctrl = PHY_M_LED_PULS_DUR(PULS_170MS); + ledover = 0; + + if (hw->chip_id == CHIP_ID_YUKON_FE) { + /* on 88E3082 these bits are at 11..9 (shifted left) */ + ledctrl |= PHY_M_LED_BLINK_RT(BLINK_84MS) << 1; + + skge_gm_phy_write(hw, port, PHY_MARV_FE_LED_PAR, + ((skge_gm_phy_read(hw, port, PHY_MARV_FE_LED_PAR) + + & ~PHY_M_FELP_LED1_MSK) + | PHY_M_FELP_LED1_CTRL(LED_PAR_CTRL_ACT_BL))); + } else { + /* set Tx LED (LED_TX) to blink mode on Rx OR Tx activity */ + ledctrl |= PHY_M_LED_BLINK_RT(BLINK_84MS) | PHY_M_LEDC_TX_CTRL; + + /* turn off the Rx LED (LED_RX) */ + ledover |= PHY_M_LED_MO_RX(MO_LED_OFF); + } + + /* disable blink mode (LED_DUPLEX) on collisions */ + ctrl |= PHY_M_LEDC_DP_CTRL; + skge_gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl); + + if (skge->autoneg == AUTONEG_DISABLE || skge->speed == SPEED_100) { + /* turn on 100 Mbps LED (LED_LINK100) */ + ledover |= PHY_M_LED_MO_100(MO_LED_ON); + } + + if (ledover) + skge_gm_phy_write(hw, port, PHY_MARV_LED_OVER, ledover); + + /* Enable phy interrupt on autonegotiation complete (or link up) */ + if (skge->autoneg == AUTONEG_ENABLE) + skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_IS_AN_COMPL); + else + skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_DEF_MSK); +} + +static void yukon_reset(struct skge_hw *hw, int port) +{ + skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, 0);/* disable PHY IRQs */ + skge_gma_write16(hw, port, GM_MC_ADDR_H1, 0); /* clear MC hash */ + skge_gma_write16(hw, port, GM_MC_ADDR_H2, 0); + skge_gma_write16(hw, port, GM_MC_ADDR_H3, 0); + skge_gma_write16(hw, port, GM_MC_ADDR_H4, 0); + + skge_gma_write16(hw, port, GM_RX_CTRL, + skge_gma_read16(hw, port, GM_RX_CTRL) + | GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA); +} + +static void yukon_mac_init(struct skge_hw *hw, int port) +{ + struct skge_port *skge = netdev_priv(hw->dev[port]); + int i; + u32 reg; + const u8 *addr = hw->dev[port]->dev_addr; + + /* WA code for COMA mode -- set PHY reset */ + if (hw->chip_id == CHIP_ID_YUKON_LITE && + chip_rev(hw) == CHIP_REV_YU_LITE_A3) + skge_write32(hw, B2_GP_IO, + (skge_read32(hw, B2_GP_IO) | GP_DIR_9 | GP_IO_9)); + + /* hard reset */ + skge_write32(hw, SKGEMAC_REG(port, GPHY_CTRL), GPC_RST_SET); + skge_write32(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_RST_SET); + + /* WA code for COMA mode -- clear PHY reset */ + if (hw->chip_id == CHIP_ID_YUKON_LITE && + chip_rev(hw) == CHIP_REV_YU_LITE_A3) + skge_write32(hw, B2_GP_IO, + (skge_read32(hw, B2_GP_IO) | GP_DIR_9) + & ~GP_IO_9); + + /* Set hardware config mode */ + reg = GPC_INT_POL_HI | GPC_DIS_FC | GPC_DIS_SLEEP | + GPC_ENA_XC | GPC_ANEG_ADV_ALL_M | GPC_ENA_PAUSE; + reg |= iscopper(hw) ? GPC_HWCFG_GMII_COP : GPC_HWCFG_GMII_FIB; + + /* Clear GMC reset */ + skge_write32(hw, SKGEMAC_REG(port, GPHY_CTRL), reg | GPC_RST_SET); + skge_write32(hw, SKGEMAC_REG(port, GPHY_CTRL), reg | GPC_RST_CLR); + skge_write32(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_PAUSE_ON | GMC_RST_CLR); + if (skge->autoneg == AUTONEG_DISABLE) { + reg = GM_GPCR_AU_ALL_DIS; + skge_gma_write16(hw, port, GM_GP_CTRL, + skge_gma_read16(hw, port, GM_GP_CTRL) | reg); + + switch (skge->speed) { + case SPEED_1000: + reg |= GM_GPCR_SPEED_1000; + /* fallthru */ + case SPEED_100: + reg |= GM_GPCR_SPEED_100; + } + + if (skge->duplex == DUPLEX_FULL) + reg |= GM_GPCR_DUP_FULL; + } else + reg = GM_GPCR_SPEED_1000 | GM_GPCR_SPEED_100 | GM_GPCR_DUP_FULL; + switch (skge->flow_control) { + case FLOW_MODE_NONE: + skge_write32(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_PAUSE_OFF); + reg |= GM_GPCR_FC_TX_DIS | GM_GPCR_FC_RX_DIS | GM_GPCR_AU_FCT_DIS; + break; + case FLOW_MODE_LOC_SEND: + /* disable Rx flow-control */ + reg |= GM_GPCR_FC_RX_DIS | GM_GPCR_AU_FCT_DIS; + } + + skge_gma_write16(hw, port, GM_GP_CTRL, reg); + skge_read16(hw, GMAC_IRQ_SRC); + + spin_lock_bh(&hw->phy_lock); + yukon_init(hw, port); + spin_unlock_bh(&hw->phy_lock); + + /* MIB clear */ + reg = skge_gma_read16(hw, port, GM_PHY_ADDR); + skge_gma_write16(hw, port, GM_PHY_ADDR, reg | GM_PAR_MIB_CLR); + + for (i = 0; i < GM_MIB_CNT_SIZE; i++) + skge_gma_read16(hw, port, GM_MIB_CNT_BASE + 8*i); + skge_gma_write16(hw, port, GM_PHY_ADDR, reg); + + /* transmit control */ + skge_gma_write16(hw, port, GM_TX_CTRL, TX_COL_THR(TX_COL_DEF)); + + /* receive control reg: unicast + multicast + no FCS */ + skge_gma_write16(hw, port, GM_RX_CTRL, + GM_RXCR_UCF_ENA | GM_RXCR_CRC_DIS | GM_RXCR_MCF_ENA); + + /* transmit flow control */ + skge_gma_write16(hw, port, GM_TX_FLOW_CTRL, 0xffff); + + /* transmit parameter */ + skge_gma_write16(hw, port, GM_TX_PARAM, + TX_JAM_LEN_VAL(TX_JAM_LEN_DEF) | + TX_JAM_IPG_VAL(TX_JAM_IPG_DEF) | + TX_IPG_JAM_DATA(TX_IPG_JAM_DEF)); + + /* serial mode register */ + reg = GM_SMOD_VLAN_ENA | IPG_DATA_VAL(IPG_DATA_DEF); + if (hw->dev[port]->mtu > 1500) + reg |= GM_SMOD_JUMBO_ENA; + + skge_gma_write16(hw, port, GM_SERIAL_MODE, reg); + + /* physical address: used for pause frames */ + skge_gm_set_addr(hw, port, GM_SRC_ADDR_1L, addr); + /* virtual address for data */ + skge_gm_set_addr(hw, port, GM_SRC_ADDR_2L, addr); + + /* enable interrupt mask for counter overflows */ + skge_gma_write16(hw, port, GM_TX_IRQ_MSK, 0); + skge_gma_write16(hw, port, GM_RX_IRQ_MSK, 0); + skge_gma_write16(hw, port, GM_TR_IRQ_MSK, 0); + + /* Initialize Mac Fifo */ + + /* Configure Rx MAC FIFO */ + skge_write16(hw, SKGEMAC_REG(port, RX_GMF_FL_MSK), RX_FF_FL_DEF_MSK); + reg = GMF_OPER_ON | GMF_RX_F_FL_ON; + if (hw->chip_id == CHIP_ID_YUKON_LITE && + chip_rev(hw) == CHIP_REV_YU_LITE_A3) + reg &= ~GMF_RX_F_FL_ON; + skge_write8(hw, SKGEMAC_REG(port, RX_GMF_CTRL_T), GMF_RST_CLR); + skge_write16(hw, SKGEMAC_REG(port, RX_GMF_CTRL_T), reg); + skge_write16(hw, SKGEMAC_REG(port, RX_GMF_FL_THR), RX_GMF_FL_THR_DEF); + + /* Configure Tx MAC FIFO */ + skge_write8(hw, SKGEMAC_REG(port, TX_GMF_CTRL_T), GMF_RST_CLR); + skge_write16(hw, SKGEMAC_REG(port, TX_GMF_CTRL_T), GMF_OPER_ON); +} + +static void yukon_stop(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + + if (hw->chip_id == CHIP_ID_YUKON_LITE && + chip_rev(hw) == CHIP_REV_YU_LITE_A3) { + skge_write32(hw, B2_GP_IO, + skge_read32(hw, B2_GP_IO) | GP_DIR_9 | GP_IO_9); + } + + skge_gma_write16(hw, port, GM_GP_CTRL, + skge_gma_read16(hw, port, GM_GP_CTRL) + & ~(GM_GPCR_RX_ENA|GM_GPCR_RX_ENA)); + skge_gma_read16(hw, port, GM_GP_CTRL); + + /* set GPHY Control reset */ + skge_gma_write32(hw, port, GPHY_CTRL, GPC_RST_SET); + skge_gma_write32(hw, port, GMAC_CTRL, GMC_RST_SET); +} + +static void yukon_get_stats(struct skge_port *skge, u64 *data) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + int i; + + data[0] = (u64) skge_gma_read32(hw, port, GM_TXO_OK_HI) << 32 + | skge_gma_read32(hw, port, GM_TXO_OK_LO); + data[1] = (u64) skge_gma_read32(hw, port, GM_RXO_OK_HI) << 32 + | skge_gma_read32(hw, port, GM_RXO_OK_LO); + + for (i = 2; i < ARRAY_SIZE(skge_stats); i++) + data[i] = skge_gma_read32(hw, port, + skge_stats[i].gma_offset); +} + +static void yukon_mac_intr(struct skge_hw *hw, int port) +{ + struct skge_port *skge = netdev_priv(hw->dev[port]); + u8 status = skge_read8(hw, SKGEMAC_REG(port, GMAC_IRQ_SRC)); + + pr_debug("yukon_intr status %x\n", status); + if (status & GM_IS_RX_FF_OR) { + ++skge->net_stats.rx_fifo_errors; + skge_gma_write8(hw, port, RX_GMF_CTRL_T, GMF_CLI_RX_FO); + } + if (status & GM_IS_TX_FF_UR) { + ++skge->net_stats.tx_fifo_errors; + skge_gma_write8(hw, port, TX_GMF_CTRL_T, GMF_CLI_TX_FU); + } + +} + +static u16 yukon_speed(const struct skge_hw *hw, u16 aux) +{ + if (hw->chip_id == CHIP_ID_YUKON_FE) + return (aux & PHY_M_PS_SPEED_100) ? SPEED_100 : SPEED_10; + + switch(aux & PHY_M_PS_SPEED_MSK) { + case PHY_M_PS_SPEED_1000: + return SPEED_1000; + case PHY_M_PS_SPEED_100: + return SPEED_100; + default: + return SPEED_10; + } +} + +static void yukon_link_up(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + u16 reg; + + pr_debug("yukon_link_up\n"); + + /* Enable Transmit FIFO Underrun */ + skge_write8(hw, GMAC_IRQ_MSK, GMAC_DEF_MSK); + + reg = skge_gma_read16(hw, port, GM_GP_CTRL); + if (skge->duplex == DUPLEX_FULL || skge->autoneg == AUTONEG_ENABLE) + reg |= GM_GPCR_DUP_FULL; + + /* enable Rx/Tx */ + reg |= GM_GPCR_RX_ENA | GM_GPCR_TX_ENA; + skge_gma_write16(hw, port, GM_GP_CTRL, reg); + + skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, PHY_M_DEF_MSK); + skge_link_up(skge); +} + +static void yukon_link_down(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + + pr_debug("yukon_link_down\n"); + skge_gm_phy_write(hw, port, PHY_MARV_INT_MASK, 0); + skge_gm_phy_write(hw, port, GM_GP_CTRL, + skge_gm_phy_read(hw, port, GM_GP_CTRL) + & ~(GM_GPCR_RX_ENA | GM_GPCR_TX_ENA)); + + if (hw->chip_id != CHIP_ID_YUKON_FE && + skge->flow_control == FLOW_MODE_REM_SEND) { + /* restore Asymmetric Pause bit */ + skge_gm_phy_write(hw, port, PHY_MARV_AUNE_ADV, + skge_gm_phy_read(hw, port, + PHY_MARV_AUNE_ADV) + | PHY_M_AN_ASP); + + } + + yukon_reset(hw, port); + skge_link_down(skge); + + yukon_init(hw, port); +} + +static void yukon_phy_intr(struct skge_port *skge) +{ + struct skge_hw *hw = skge->hw; + int port = skge->port; + const char *reason = NULL; + u16 istatus, phystat; + + istatus = skge_gm_phy_read(hw, port, PHY_MARV_INT_STAT); + phystat = skge_gm_phy_read(hw, port, PHY_MARV_PHY_STAT); + pr_debug("yukon phy intr istat=%x phy_stat=%x\n", istatus, phystat); + + if (istatus & PHY_M_IS_AN_COMPL) { + if (skge_gm_phy_read(hw, port, PHY_MARV_AUNE_LP) + & PHY_M_AN_RF) { + reason = "remote fault"; + goto failed; + } + + if (!(hw->chip_id == CHIP_ID_YUKON_FE || hw->chip_id == CHIP_ID_YUKON_EC) + && (skge_gm_phy_read(hw, port, PHY_MARV_1000T_STAT) + & PHY_B_1000S_MSF)) { + reason = "master/slave fault"; + goto failed; + } + + if (!(phystat & PHY_M_PS_SPDUP_RES)) { + reason = "speed/duplex"; + goto failed; + } + + skge->duplex = (phystat & PHY_M_PS_FULL_DUP) + ? DUPLEX_FULL : DUPLEX_HALF; + skge->speed = yukon_speed(hw, phystat); + + /* Tx & Rx Pause Enabled bits are at 9..8 */ + if (hw->chip_id == CHIP_ID_YUKON_XL) + phystat >>= 6; + + /* We are using IEEE 802.3z/D5.0 Table 37-4 */ + switch (phystat & PHY_M_PS_PAUSE_MSK) { + case PHY_M_PS_PAUSE_MSK: + skge->flow_control = FLOW_MODE_SYMMETRIC; + break; + case PHY_M_PS_RX_P_EN: + skge->flow_control = FLOW_MODE_REM_SEND; + break; + case PHY_M_PS_TX_P_EN: + skge->flow_control = FLOW_MODE_LOC_SEND; + break; + default: + skge->flow_control = FLOW_MODE_NONE; + } + + if (skge->flow_control == FLOW_MODE_NONE || + (skge->speed < SPEED_1000 && skge->duplex == DUPLEX_HALF)) + skge_write8(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_PAUSE_OFF); + else + skge_write8(hw, SKGEMAC_REG(port, GMAC_CTRL), GMC_PAUSE_ON); + yukon_link_up(skge); + return; + } + + if (istatus & PHY_M_IS_LSP_CHANGE) + skge->speed = yukon_speed(hw, phystat); + + if (istatus & PHY_M_IS_DUP_CHANGE) + skge->duplex = (phystat & PHY_M_PS_FULL_DUP) ? DUPLEX_FULL : DUPLEX_HALF; + if (istatus & PHY_M_IS_LST_CHANGE) { + if (phystat & PHY_M_PS_LINK_UP) + yukon_link_up(skge); + else + yukon_link_down(skge); + } + return; + failed: + printk(KERN_ERR PFX "%s: autonegotiation failed (%s)\n", + skge->netdev->name, reason); + + /* XXX restart autonegotiation? */ +} + +static void skge_ramset(struct skge_hw *hw, u16 q, u32 start, size_t len) +{ + u32 end; + + start /= 8; + len /= 8; + end = start + len - 1; + + skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_RST_CLR); + skge_write32(hw, RB_ADDR(q, RB_START), start); + skge_write32(hw, RB_ADDR(q, RB_WP), start); + skge_write32(hw, RB_ADDR(q, RB_RP), start); + skge_write32(hw, RB_ADDR(q, RB_END), end); + + if (q == Q_R1 || q == Q_R2) { + /* Set thresholds on receive queue's */ + skge_write32(hw, RB_ADDR(q, RB_RX_UTPP), + start + (2*len)/3); + skge_write32(hw, RB_ADDR(q, RB_RX_LTPP), + start + (len/3)); + } else { + /* Enable store & forward on Tx queue's because + * Tx FIFO is only 4K on Genesis and 1K on Yukon + */ + skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_ENA_STFWD); + } + + skge_write8(hw, RB_ADDR(q, RB_CTRL), RB_ENA_OP_MD); +} + +/* Setup Bus Memory Interface */ +static void skge_qset(struct skge_port *skge, u16 q, + const struct skge_element *e) +{ + struct skge_hw *hw = skge->hw; + u32 watermark = 0x600; + u64 base = skge->dma + (e->desc - skge->mem); + + /* optimization to reduce window on 32bit/33mhz */ + if ((skge_read16(hw, B0_CTST) & (CS_BUS_CLOCK | CS_BUS_SLOT_SZ)) == 0) + watermark /= 2; + + skge_write32(hw, Q_ADDR(q, Q_CSR), CSR_CLR_RESET); + skge_write32(hw, Q_ADDR(q, Q_F), watermark); + skge_write32(hw, Q_ADDR(q, Q_DA_H), (u32)(base >> 32)); + skge_write32(hw, Q_ADDR(q, Q_DA_L), (u32)base); +} + +static int skge_up(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + int port = skge->port; + u32 chunk, ram_addr; + size_t rx_size, tx_size; + int err; + + if (netif_msg_ifup(skge)) + printk(KERN_INFO PFX "%s: enabling interface\n", dev->name); + + rx_size = skge->rx_ring.count * sizeof(struct skge_rx_desc); + tx_size = skge->tx_ring.count * sizeof(struct skge_tx_desc); + skge->mem_size = tx_size + rx_size; + skge->mem = pci_alloc_consistent(hw->pdev, skge->mem_size, &skge->dma); + if (!skge->mem) + return -ENOMEM; + + memset(skge->mem, 0, skge->mem_size); + + if ((err = skge_ring_alloc(&skge->rx_ring, skge->mem, skge->dma))) + goto free_pci_mem; + + if (skge_rx_fill(skge)) + goto free_rx_ring; + + if ((err = skge_ring_alloc(&skge->tx_ring, skge->mem + rx_size, + skge->dma + rx_size))) + goto free_rx_ring; + + skge->tx_avail = skge->tx_ring.count - 1; + + /* Initialze MAC */ + if (hw->chip_id == CHIP_ID_GENESIS) + genesis_mac_init(hw, port); + else + yukon_mac_init(hw, port); + + /* Configure RAMbuffers */ + chunk = hw->ram_size / (isdualport(hw) ? 4 : 2); + ram_addr = hw->ram_offset + 2 * chunk * port; + + skge_ramset(hw, rxq[port], ram_addr, chunk); + skge_qset(skge, rxq[port], skge->rx_ring.to_clean); + + BUG_ON(skge->tx_ring.to_use != skge->tx_ring.to_clean); + skge_ramset(hw, txq[port], ram_addr+chunk, chunk); + skge_qset(skge, txq[port], skge->tx_ring.to_use); + + /* Start receiver BMU */ + wmb(); + skge_write8(hw, Q_ADDR(rxq[port], Q_CSR), CSR_START | CSR_IRQ_CL_F); + + pr_debug("skge_up completed\n"); + return 0; + + free_rx_ring: + skge_rx_clean(skge); + kfree(skge->rx_ring.start); + free_pci_mem: + pci_free_consistent(hw->pdev, skge->mem_size, skge->mem, skge->dma); + + return err; +} + +static int skge_down(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + int port = skge->port; + + if (netif_msg_ifdown(skge)) + printk(KERN_INFO PFX "%s: disabling interface\n", dev->name); + + netif_stop_queue(dev); + + del_timer_sync(&skge->led_blink); + del_timer_sync(&skge->link_check); + + /* Stop transmitter */ + skge_write8(hw, Q_ADDR(txq[port], Q_CSR), CSR_STOP); + skge_write32(hw, RB_ADDR(txq[port], RB_CTRL), + RB_RST_SET|RB_DIS_OP_MD); + + if (hw->chip_id == CHIP_ID_GENESIS) + genesis_stop(skge); + else + yukon_stop(skge); + + /* Disable Force Sync bit and Enable Alloc bit */ + skge_write8(hw, SKGEMAC_REG(port, TXA_CTRL), + TXA_DIS_FSYNC | TXA_DIS_ALLOC | TXA_STOP_RC); + + /* Stop Interval Timer and Limit Counter of Tx Arbiter */ + skge_write32(hw, SKGEMAC_REG(port, TXA_ITI_INI), 0L); + skge_write32(hw, SKGEMAC_REG(port, TXA_LIM_INI), 0L); + + /* Reset PCI FIFO */ + skge_write32(hw, Q_ADDR(txq[port], Q_CSR), CSR_SET_RESET); + skge_write32(hw, RB_ADDR(txq[port], RB_CTRL), RB_RST_SET); + + /* Reset the RAM Buffer async Tx queue */ + skge_write8(hw, RB_ADDR(port == 0 ? Q_XA1 : Q_XA2, RB_CTRL), RB_RST_SET); + /* stop receiver */ + skge_write8(hw, Q_ADDR(rxq[port], Q_CSR), CSR_STOP); + skge_write32(hw, RB_ADDR(port ? Q_R2 : Q_R1, RB_CTRL), + RB_RST_SET|RB_DIS_OP_MD); + skge_write32(hw, Q_ADDR(rxq[port], Q_CSR), CSR_SET_RESET); + + if (hw->chip_id == CHIP_ID_GENESIS) { + skge_write8(hw, SKGEMAC_REG(port, TX_MFF_CTRL2), MFF_RST_SET); + skge_write8(hw, SKGEMAC_REG(port, RX_MFF_CTRL2), MFF_RST_SET); + skge_write8(hw, SKGEMAC_REG(port, TX_LED_CTRL), LED_STOP); + skge_write8(hw, SKGEMAC_REG(port, RX_LED_CTRL), LED_STOP); + } else { + skge_write8(hw, SKGEMAC_REG(port, RX_GMF_CTRL_T), GMF_RST_SET); + skge_write8(hw, SKGEMAC_REG(port, TX_GMF_CTRL_T), GMF_RST_SET); + } + + /* turn off led's */ + skge_write16(hw, B0_LED, LED_STAT_OFF); + + skge_tx_clean(skge); + skge_rx_clean(skge); + + kfree(skge->rx_ring.start); + kfree(skge->tx_ring.start); + pci_free_consistent(hw->pdev, skge->mem_size, skge->mem, skge->dma); + return 0; +} + +static int skge_xmit_frame(struct sk_buff *skb, struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + struct skge_ring *ring = &skge->tx_ring; + struct skge_element *e; + struct skge_tx_desc *td; + int i; + u32 control, len; + u64 map; unsigned long flags; + + skb = skb_padto(skb, ETH_ZLEN); + if (!skb) + return NETDEV_TX_OK; + + spin_lock_irqsave(&skge->tx_lock, flags); + if (unlikely(skge->tx_avail < skb_shinfo(skb)->nr_frags +1)) { + netif_stop_queue(dev); + spin_unlock_irqrestore(&skge->tx_lock, flags); + + printk(KERN_WARNING PFX "%s: ring full when queue awake!\n", + dev->name); + return NETDEV_TX_BUSY; + } + + e = ring->to_use; + td = e->desc; + e->skb = skb; + len = skb_headlen(skb); + map = pci_map_single(hw->pdev, skb->data, len, PCI_DMA_TODEVICE); + pci_unmap_addr_set(e, mapaddr, map); + pci_unmap_len_set(e, maplen, len); + + td->dma_lo = map; + td->dma_hi = map >> 32; + + if (skb->ip_summed == CHECKSUM_HW) { + const struct iphdr *ip + = (const struct iphdr *) (skb->data + ETH_HLEN); + int offset = skb->h.raw - skb->data; + + /* This seems backwards, but it is what the sk98lin + * does. Looks like hardware is wrong? + */ + if (ip->protocol == IPPROTO_UDP + && chip_rev(hw) == 0 && hw->chip_id == CHIP_ID_YUKON) + control = BMU_TCP_CHECK; + else + control = BMU_UDP_CHECK; + + td->csum_offs = 0; + td->csum_start = offset; + td->csum_write = offset + skb->csum; + } else + control = BMU_CHECK; + + if (!skb_shinfo(skb)->nr_frags) /* single buffer i.e. no fragments */ + control |= BMU_EOF| BMU_IRQ_EOF; + else { + struct skge_tx_desc *tf = td; + + control |= BMU_STFWD; + for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { + skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; + + map = pci_map_page(hw->pdev, frag->page, frag->page_offset, + frag->size, PCI_DMA_TODEVICE); + + e = e->next; + e->skb = NULL; + tf = e->desc; + tf->dma_lo = map; + tf->dma_hi = (u64) map >> 32; + pci_unmap_addr_set(e, mapaddr, map); + pci_unmap_len_set(e, maplen, frag->size); + + tf->control = BMU_OWN | BMU_SW | control | frag->size; + } + tf->control |= BMU_EOF | BMU_IRQ_EOF; + } + /* Make sure all the descriptors written */ + wmb(); + td->control = BMU_OWN | BMU_SW | BMU_STF | control | len; + wmb(); + + skge_write8(hw, Q_ADDR(txq[skge->port], Q_CSR), CSR_START); + + if (netif_msg_tx_queued(skge)) + printk(KERN_DEBUG "%s: tx queued, slot %d, len %d\n", + dev->name, e - ring->start, skb->len); + + ring->to_use = e->next; + skge->tx_avail -= skb_shinfo(skb)->nr_frags + 1; + if (skge->tx_avail <= MAX_SKB_FRAGS + 1) { + pr_debug("%s: transmit queue full\n", dev->name); + netif_stop_queue(dev); + } + + skge->net_stats.tx_packets++; + skge->net_stats.tx_bytes += skb->len; + + dev->trans_start = jiffies; + spin_unlock_irqrestore(&skge->tx_lock, flags); + + return NETDEV_TX_OK; +} + +static inline void skge_tx_free(struct skge_hw *hw, struct skge_element *e) +{ + if (e->skb) { + pci_unmap_single(hw->pdev, + pci_unmap_addr(e, mapaddr), + pci_unmap_len(e, maplen), + PCI_DMA_TODEVICE); + dev_kfree_skb_any(e->skb); + e->skb = NULL; + } else { + pci_unmap_page(hw->pdev, + pci_unmap_addr(e, mapaddr), + pci_unmap_len(e, maplen), + PCI_DMA_TODEVICE); + } +} + +static void skge_tx_clean(struct skge_port *skge) +{ + struct skge_ring *ring = &skge->tx_ring; + struct skge_element *e; + unsigned long flags; + + spin_lock_irqsave(&skge->tx_lock, flags); + for (e = ring->to_clean; e != ring->to_use; e = e->next) { + ++skge->tx_avail; + skge_tx_free(skge->hw, e); + } + ring->to_clean = e; + spin_unlock_irqrestore(&skge->tx_lock, flags); +} + +static void skge_tx_timeout(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + + if (netif_msg_timer(skge)) + printk(KERN_DEBUG PFX "%s: tx timeout\n", dev->name); + + skge_write8(skge->hw, Q_ADDR(txq[skge->port], Q_CSR), CSR_STOP); + skge_tx_clean(skge); +} + +static int skge_change_mtu(struct net_device *dev, int new_mtu) +{ + int err = 0; + + if(new_mtu < ETH_ZLEN || new_mtu > ETH_JUMBO_MTU) + return -EINVAL; + + dev->mtu = new_mtu; + + if (netif_running(dev)) { + skge_down(dev); + skge_up(dev); + } + + return err; +} + +static void genesis_set_multicast(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + int port = skge->port; + int i, count = dev->mc_count; + struct dev_mc_list *list = dev->mc_list; + u32 mode; + u8 filter[8]; + + mode = skge_xm_read32(hw, port, XM_MODE); + mode |= XM_MD_ENA_HASH; + if (dev->flags & IFF_PROMISC) + mode |= XM_MD_ENA_PROM; + else + mode &= ~XM_MD_ENA_PROM; + + if (dev->flags & IFF_ALLMULTI) + memset(filter, 0xff, sizeof(filter)); + else { + memset(filter, 0, sizeof(filter)); + for(i = 0; list && i < count; i++, list = list->next) { + u32 crc = crc32_le(~0, list->dmi_addr, ETH_ALEN); + u8 bit = 63 - (crc & 63); + + filter[bit/8] |= 1 << (bit%8); + } + } + + skge_xm_outhash(hw, port, XM_HSM, filter); + + skge_xm_write32(hw, port, XM_MODE, mode); +} + +static void yukon_set_multicast(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + int port = skge->port; + struct dev_mc_list *list = dev->mc_list; + u16 reg; + u8 filter[8]; + + memset(filter, 0, sizeof(filter)); + + reg = skge_gma_read16(hw, port, GM_RX_CTRL); + reg |= GM_RXCR_UCF_ENA; + + if (dev->flags & IFF_PROMISC) /* promiscious */ + reg &= ~(GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA); + else if (dev->flags & IFF_ALLMULTI) /* all multicast */ + memset(filter, 0xff, sizeof(filter)); + else if (dev->mc_count == 0) /* no multicast */ + reg &= ~GM_RXCR_MCF_ENA; + else { + int i; + reg |= GM_RXCR_MCF_ENA; + + for(i = 0; list && i < dev->mc_count; i++, list = list->next) { + u32 bit = ether_crc(ETH_ALEN, list->dmi_addr) & 0x3f; + filter[bit/8] |= 1 << (bit%8); + } + } + + + skge_gma_write16(hw, port, GM_MC_ADDR_H1, + (u16)filter[0] | ((u16)filter[1] << 8)); + skge_gma_write16(hw, port, GM_MC_ADDR_H2, + (u16)filter[2] | ((u16)filter[3] << 8)); + skge_gma_write16(hw, port, GM_MC_ADDR_H3, + (u16)filter[4] | ((u16)filter[5] << 8)); + skge_gma_write16(hw, port, GM_MC_ADDR_H4, + (u16)filter[6] | ((u16)filter[7] << 8)); + + skge_gma_write16(hw, port, GM_RX_CTRL, reg); +} + +static inline int bad_phy_status(const struct skge_hw *hw, u32 status) +{ + if (hw->chip_id == CHIP_ID_GENESIS) + return (status & (XMR_FS_ERR | XMR_FS_2L_VLAN)) != 0; + else + return (status & GMR_FS_ANY_ERR) || + (status & GMR_FS_RX_OK) == 0; +} + +static void skge_rx_error(struct skge_port *skge, int slot, + u32 control, u32 status) +{ + if (netif_msg_rx_err(skge)) + printk(KERN_DEBUG PFX "%s: rx err, slot %d control 0x%x status 0x%x\n", + skge->netdev->name, slot, control, status); + + if ((control & (BMU_EOF|BMU_STF)) != (BMU_STF|BMU_EOF) + || (control & BMU_BBC) > skge->netdev->mtu + VLAN_ETH_HLEN) + skge->net_stats.rx_length_errors++; + else { + if (skge->hw->chip_id == CHIP_ID_GENESIS) { + if (status & (XMR_FS_RUNT|XMR_FS_LNG_ERR)) + skge->net_stats.rx_length_errors++; + if (status & XMR_FS_FRA_ERR) + skge->net_stats.rx_frame_errors++; + if (status & XMR_FS_FCS_ERR) + skge->net_stats.rx_crc_errors++; + } else { + if (status & (GMR_FS_LONG_ERR|GMR_FS_UN_SIZE)) + skge->net_stats.rx_length_errors++; + if (status & GMR_FS_FRAGMENT) + skge->net_stats.rx_frame_errors++; + if (status & GMR_FS_CRC_ERR) + skge->net_stats.rx_crc_errors++; + } + } +} + +static int skge_poll(struct net_device *dev, int *budget) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + struct skge_ring *ring = &skge->rx_ring; + struct skge_element *e; + unsigned int to_do = min(dev->quota, *budget); + unsigned int work_done = 0; + int done; + static const u32 irqmask[] = { IS_PORT_1, IS_PORT_2 }; + + for (e = ring->to_clean; e != ring->to_use && work_done < to_do; + e = e->next) { + struct skge_rx_desc *rd = e->desc; + struct sk_buff *skb = e->skb; + u32 control, len, status; + + rmb(); + control = rd->control; + if (control & BMU_OWN) + break; + + len = control & BMU_BBC; + e->skb = NULL; + + pci_unmap_single(hw->pdev, + pci_unmap_addr(e, mapaddr), + pci_unmap_len(e, maplen), + PCI_DMA_FROMDEVICE); + + status = rd->status; + if ((control & (BMU_EOF|BMU_STF)) != (BMU_STF|BMU_EOF) + || len > dev->mtu + VLAN_ETH_HLEN + || bad_phy_status(hw, status)) { + skge_rx_error(skge, e - ring->start, control, status); + dev_kfree_skb(skb); + continue; + } + + if (netif_msg_rx_status(skge)) + printk(KERN_DEBUG PFX "%s: rx slot %d status 0x%x len %d\n", + dev->name, e - ring->start, rd->status, len); + + skb_put(skb, len); + skb->protocol = eth_type_trans(skb, dev); + + if (skge->rx_csum) { + skb->csum = le16_to_cpu(rd->csum2); + skb->ip_summed = CHECKSUM_HW; + } + + dev->last_rx = jiffies; + skge->net_stats.rx_packets++; + skge->net_stats.rx_bytes += skb->len; + netif_receive_skb(skb); + + ++work_done; + } + ring->to_clean = e; + + *budget -= work_done; + dev->quota -= work_done; + done = work_done < to_do; + + if (skge_rx_fill(skge)) + done = 0; + + /* restart receiver */ + wmb(); + skge_write8(hw, Q_ADDR(rxq[skge->port], Q_CSR), + CSR_START | CSR_IRQ_CL_F); + + if (done) { + local_irq_disable(); + hw->intr_mask |= irqmask[skge->port]; + /* Order is important since data can get interrupted */ + skge_write32(hw, B0_IMSK, hw->intr_mask); + __netif_rx_complete(dev); + local_irq_enable(); + } + + return !done; +} + +static inline void skge_tx_intr(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + struct skge_hw *hw = skge->hw; + struct skge_ring *ring = &skge->tx_ring; + struct skge_element *e; + + spin_lock(&skge->tx_lock); + for(e = ring->to_clean; e != ring->to_use; e = e->next) { + struct skge_tx_desc *td = e->desc; + u32 control; + + rmb(); + control = td->control; + if (control & BMU_OWN) + break; + + if (unlikely(netif_msg_tx_done(skge))) + printk(KERN_DEBUG PFX "%s: tx done slot %d status 0x%x\n", + dev->name, e - ring->start, td->status); + + skge_tx_free(hw, e); + e->skb = NULL; + ++skge->tx_avail; + } + ring->to_clean = e; + skge_write8(hw, Q_ADDR(txq[skge->port], Q_CSR), CSR_IRQ_CL_F); + + if (skge->tx_avail > MAX_SKB_FRAGS + 1) + netif_wake_queue(dev); + + spin_unlock(&skge->tx_lock); +} + +static void skge_mac_parity(struct skge_hw *hw, int port) +{ + printk(KERN_ERR PFX "%s: mac data parity error\n", + hw->dev[port] ? hw->dev[port]->name + : (port == 0 ? "(port A)": "(port B")); + + if (hw->chip_id == CHIP_ID_GENESIS) + skge_write16(hw, SKGEMAC_REG(port, TX_MFF_CTRL1), + MFF_CLR_PERR); + else + /* HW-Bug #8: cleared by GMF_CLI_TX_FC instead of GMF_CLI_TX_PE */ + skge_write8(hw, SKGEMAC_REG(port, TX_GMF_CTRL_T), + (hw->chip_id == CHIP_ID_YUKON && chip_rev(hw) == 0) + ? GMF_CLI_TX_FC : GMF_CLI_TX_PE); +} + +static void skge_pci_clear(struct skge_hw *hw) +{ + u16 status; + + status = skge_read16(hw, SKGEPCI_REG(PCI_STATUS)); + skge_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON); + skge_write16(hw, SKGEPCI_REG(PCI_STATUS), + status | PCI_STATUS_ERROR_BITS); + skge_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_OFF); +} + +/* Handle device specific framing and timeout interrupts */ +static void skge_error_irq(struct skge_hw *hw) +{ + u32 hwstatus = skge_read32(hw, B0_HWE_ISRC); + + if (hw->chip_id == CHIP_ID_GENESIS) { + /* clear xmac errors */ + if (hwstatus & (IS_NO_STAT_M1|IS_NO_TIST_M1)) + skge_write16(hw, SKGEMAC_REG(0, RX_MFF_CTRL1), MFF_CLR_INSTAT); + if (hwstatus & (IS_NO_STAT_M2|IS_NO_TIST_M2)) + skge_write16(hw, SKGEMAC_REG(0, RX_MFF_CTRL2), MFF_CLR_INSTAT); + } else { + /* Timestamp (unused) overflow */ + if (hwstatus & IS_IRQ_TIST_OV) + skge_write8(hw, GMAC_TI_ST_CTRL, GMT_ST_CLR_IRQ); + + if (hwstatus & IS_IRQ_SENSOR) { + /* no sensors on 32-bit Yukon */ + if (!(skge_read16(hw, B0_CTST) & CS_BUS_SLOT_SZ)) { + printk(KERN_ERR PFX "ignoring bogus sensor interrups\n"); + skge_write32(hw, B0_HWE_IMSK, + IS_ERR_MSK & ~IS_IRQ_SENSOR); + } else + printk(KERN_WARNING PFX "sensor interrupt\n"); + } + + + } + + if (hwstatus & IS_RAM_RD_PAR) { + printk(KERN_ERR PFX "Ram read data parity error\n"); + skge_write16(hw, B3_RI_CTRL, RI_CLR_RD_PERR); + } + + if (hwstatus & IS_RAM_WR_PAR) { + printk(KERN_ERR PFX "Ram write data parity error\n"); + skge_write16(hw, B3_RI_CTRL, RI_CLR_WR_PERR); + } + + if (hwstatus & IS_M1_PAR_ERR) + skge_mac_parity(hw, 0); + + if (hwstatus & IS_M2_PAR_ERR) + skge_mac_parity(hw, 1); + + if (hwstatus & IS_R1_PAR_ERR) + skge_write32(hw, B0_R1_CSR, CSR_IRQ_CL_P); + + if (hwstatus & IS_R2_PAR_ERR) + skge_write32(hw, B0_R2_CSR, CSR_IRQ_CL_P); + + if (hwstatus & (IS_IRQ_MST_ERR|IS_IRQ_STAT)) { + printk(KERN_ERR PFX "hardware error detected (status 0x%x)\n", + hwstatus); + + skge_pci_clear(hw); + + hwstatus = skge_read32(hw, B0_HWE_ISRC); + if (hwstatus & IS_IRQ_STAT) { + printk(KERN_WARNING PFX "IRQ status %x: still set ignoring hardware errors\n", + hwstatus); + hw->intr_mask &= ~IS_HW_ERR; + } + } +} + +/* + * Interrrupt from PHY are handled in tasklet (soft irq) + * because accessing phy registers requires spin wait which might + * cause excess interrupt latency. + */ +static void skge_extirq(unsigned long data) +{ + struct skge_hw *hw = (struct skge_hw *) data; + int port; + + spin_lock(&hw->phy_lock); + for (port = 0; port < 2; port++) { + struct net_device *dev = hw->dev[port]; + + if (dev && netif_running(dev)) { + struct skge_port *skge = netdev_priv(dev); + + if (hw->chip_id != CHIP_ID_GENESIS) + yukon_phy_intr(skge); + else if (hw->phy_type == SK_PHY_BCOM) + genesis_bcom_intr(skge); + } + } + spin_unlock(&hw->phy_lock); + + local_irq_disable(); + hw->intr_mask |= IS_EXT_REG; + skge_write32(hw, B0_IMSK, hw->intr_mask); + local_irq_enable(); +} + +static irqreturn_t skge_intr(int irq, void *dev_id, struct pt_regs *regs) +{ + struct skge_hw *hw = dev_id; + u32 status = skge_read32(hw, B0_SP_ISRC); + + if (status == 0 || status == ~0) /* hotplug or shared irq */ + return IRQ_NONE; + + status &= hw->intr_mask; + + if (status & IS_R1_F) { + hw->intr_mask &= ~IS_R1_F; + netif_rx_schedule(hw->dev[0]); + } + + if (status & IS_R2_F) { + hw->intr_mask &= ~IS_R2_F; + netif_rx_schedule(hw->dev[1]); + } + + if (status & IS_XA1_F) + skge_tx_intr(hw->dev[0]); + + if (status & IS_XA2_F) + skge_tx_intr(hw->dev[1]); + + if (hw->chip_id == CHIP_ID_GENESIS) { + if (status & IS_MAC1) + genesis_mac_intr(hw, 0); + + if (status & IS_MAC2) + genesis_mac_intr(hw, 1); + } else { + if (status & IS_MAC1) + yukon_mac_intr(hw, 0); + + if (status & IS_MAC2) + yukon_mac_intr(hw, 1); + } + + if (status & IS_HW_ERR) + skge_error_irq(hw); + + if (status & IS_EXT_REG) { + hw->intr_mask &= ~IS_EXT_REG; + tasklet_schedule(&hw->ext_tasklet); + } + skge_write32(hw, B0_IMSK, hw->intr_mask); + + return IRQ_HANDLED; +} + +#ifdef CONFIG_NET_POLL_CONTROLLER +static void skge_netpoll(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + + disable_irq(dev->irq); + skge_intr(dev->irq, skge->hw, NULL); + enable_irq(dev->irq); +} +#endif + +/* TODO: use MIB counters instead?? */ +static struct net_device_stats *skge_get_stats(struct net_device *dev) +{ + struct skge_port *skge = netdev_priv(dev); + + return &skge->net_stats; +} + + +static int skge_set_mac_address(struct net_device *dev, void *p) +{ + struct skge_port *skge = netdev_priv(dev); + struct sockaddr *addr = p; + int err = 0; + + if (!is_valid_ether_addr(addr->sa_data)) + return -EADDRNOTAVAIL; + + skge_down(dev); + memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); + memcpy_toio(skge->hw->regs + B2_MAC_1 + skge->port*8, + dev->dev_addr, ETH_ALEN); + memcpy_toio(skge->hw->regs + B2_MAC_2 + skge->port*8, + dev->dev_addr, ETH_ALEN); + if (dev->flags & IFF_UP) + err = skge_up(dev); + return err; +} + +static const struct { + u8 id; + const char *name; +} skge_chips[] = { + { CHIP_ID_GENESIS, "Genesis" }, + { CHIP_ID_YUKON, "Yukon" }, + { CHIP_ID_YUKON_LITE, "Yukon-Lite"}, + { CHIP_ID_YUKON_LP, "Yukon-LP"}, + { CHIP_ID_YUKON_XL, "Yukon-2 XL"}, + { CHIP_ID_YUKON_EC, "YUKON-2 EC"}, + { CHIP_ID_YUKON_FE, "YUKON-2 FE"}, +}; + +static const char *skge_board_name(const struct skge_hw *hw) +{ + int i; + static char buf[16]; + + for (i = 0; i < ARRAY_SIZE(skge_chips); i++) + if (skge_chips[i].id == hw->chip_id) + return skge_chips[i].name; + + snprintf(buf, sizeof buf, "chipid 0x%x", hw->chip_id); + return buf; +} + + +/* + * Setup the board data structure, but don't bring up + * the port(s) + */ +static int skge_reset(struct skge_hw *hw) +{ + u16 ctst; + u8 t8; + int i, ports; + + ctst = skge_read16(hw, B0_CTST); + + /* do a SW reset */ + skge_write8(hw, B0_CTST, CS_RST_SET); + skge_write8(hw, B0_CTST, CS_RST_CLR); + + /* clear PCI errors, if any */ + skge_pci_clear(hw); + + skge_write8(hw, B0_CTST, CS_MRST_CLR); + + /* restore CLK_RUN bits (for Yukon-Lite) */ + skge_write16(hw, B0_CTST, + ctst & (CS_CLK_RUN_HOT|CS_CLK_RUN_RST|CS_CLK_RUN_ENA)); + + hw->chip_id = skge_read8(hw, B2_CHIP_ID); + hw->phy_type = skge_read8(hw, B2_E_1) & 0xf; + hw->pmd_type = skge_read8(hw, B2_PMD_TYP); + + switch(hw->chip_id) { + case CHIP_ID_GENESIS: + switch (hw->phy_type) { + case SK_PHY_XMAC: + hw->phy_addr = PHY_ADDR_XMAC; + break; + case SK_PHY_BCOM: + hw->phy_addr = PHY_ADDR_BCOM; + break; + default: + printk(KERN_ERR PFX "%s: unsupported phy type 0x%x\n", + pci_name(hw->pdev), hw->phy_type); + return -EOPNOTSUPP; + } + break; + + case CHIP_ID_YUKON: + case CHIP_ID_YUKON_LITE: + case CHIP_ID_YUKON_LP: + if (hw->phy_type < SK_PHY_MARV_COPPER && hw->pmd_type != 'S') + hw->phy_type = SK_PHY_MARV_COPPER; + + hw->phy_addr = PHY_ADDR_MARV; + if (!iscopper(hw)) + hw->phy_type = SK_PHY_MARV_FIBER; + + break; + + default: + printk(KERN_ERR PFX "%s: unsupported chip type 0x%x\n", + pci_name(hw->pdev), hw->chip_id); + return -EOPNOTSUPP; + } + + hw->mac_cfg = skge_read8(hw, B2_MAC_CFG); + ports = isdualport(hw) ? 2 : 1; + + /* read the adapters RAM size */ + t8 = skge_read8(hw, B2_E_0); + if (hw->chip_id == CHIP_ID_GENESIS) { + if (t8 == 3) { + /* special case: 4 x 64k x 36, offset = 0x80000 */ + hw->ram_size = 0x100000; + hw->ram_offset = 0x80000; + } else + hw->ram_size = t8 * 512; + } + else if (t8 == 0) + hw->ram_size = 0x20000; + else + hw->ram_size = t8 * 4096; + + if (hw->chip_id == CHIP_ID_GENESIS) + genesis_init(hw); + else { + /* switch power to VCC (WA for VAUX problem) */ + skge_write8(hw, B0_POWER_CTRL, + PC_VAUX_ENA | PC_VCC_ENA | PC_VAUX_OFF | PC_VCC_ON); + for (i = 0; i < ports; i++) { + skge_write16(hw, SKGEMAC_REG(i, GMAC_LINK_CTRL), GMLC_RST_SET); + skge_write16(hw, SKGEMAC_REG(i, GMAC_LINK_CTRL), GMLC_RST_CLR); + } + } + + /* turn off hardware timer (unused) */ + skge_write8(hw, B2_TI_CTRL, TIM_STOP); + skge_write8(hw, B2_TI_CTRL, TIM_CLR_IRQ); + skge_write8(hw, B0_LED, LED_STAT_ON); + + /* enable the Tx Arbiters */ + for (i = 0; i < ports; i++) + skge_write8(hw, SKGEMAC_REG(i, TXA_CTRL), TXA_ENA_ARB); + + /* Initialize ram interface */ + skge_write16(hw, B3_RI_CTRL, RI_RST_CLR); + + skge_write8(hw, B3_RI_WTO_R1, SK_RI_TO_53); + skge_write8(hw, B3_RI_WTO_XA1, SK_RI_TO_53); + skge_write8(hw, B3_RI_WTO_XS1, SK_RI_TO_53); + skge_write8(hw, B3_RI_RTO_R1, SK_RI_TO_53); + skge_write8(hw, B3_RI_RTO_XA1, SK_RI_TO_53); + skge_write8(hw, B3_RI_RTO_XS1, SK_RI_TO_53); + skge_write8(hw, B3_RI_WTO_R2, SK_RI_TO_53); + skge_write8(hw, B3_RI_WTO_XA2, SK_RI_TO_53); + skge_write8(hw, B3_RI_WTO_XS2, SK_RI_TO_53); + skge_write8(hw, B3_RI_RTO_R2, SK_RI_TO_53); + skge_write8(hw, B3_RI_RTO_XA2, SK_RI_TO_53); + skge_write8(hw, B3_RI_RTO_XS2, SK_RI_TO_53); + + skge_write32(hw, B0_HWE_IMSK, IS_ERR_MSK); + + hw->intr_mask = IS_HW_ERR | IS_EXT_REG | IS_PORT_1; + if (isdualport(hw)) + hw->intr_mask |= IS_PORT_2; + skge_write32(hw, B0_IMSK, hw->intr_mask); + + if (hw->chip_id != CHIP_ID_GENESIS) + skge_write8(hw, GMAC_IRQ_MSK, 0); + + spin_lock_bh(&hw->phy_lock); + for (i = 0; i < ports; i++) { + if (hw->chip_id == CHIP_ID_GENESIS) + genesis_reset(hw, i); + else + yukon_reset(hw, i); + } + spin_unlock_bh(&hw->phy_lock); + + return 0; +} + +/* Initialize network device */ +static struct net_device *skge_devinit(struct skge_hw *hw, int port) +{ + struct skge_port *skge; + struct net_device *dev = alloc_etherdev(sizeof(*skge)); + + if (!dev) { + printk(KERN_ERR "skge etherdev alloc failed"); + return NULL; + } + + SET_MODULE_OWNER(dev); + SET_NETDEV_DEV(dev, &hw->pdev->dev); + dev->open = skge_up; + dev->stop = skge_down; + dev->hard_start_xmit = skge_xmit_frame; + dev->get_stats = skge_get_stats; + if (hw->chip_id == CHIP_ID_GENESIS) + dev->set_multicast_list = genesis_set_multicast; + else + dev->set_multicast_list = yukon_set_multicast; + + dev->set_mac_address = skge_set_mac_address; + dev->change_mtu = skge_change_mtu; + SET_ETHTOOL_OPS(dev, &skge_ethtool_ops); + dev->tx_timeout = skge_tx_timeout; + dev->watchdog_timeo = TX_WATCHDOG; + dev->poll = skge_poll; + dev->weight = NAPI_WEIGHT; +#ifdef CONFIG_NET_POLL_CONTROLLER + dev->poll_controller = skge_netpoll; +#endif + dev->irq = hw->pdev->irq; + if (hw->chip_id != CHIP_ID_GENESIS) + dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; + + skge = netdev_priv(dev); + skge->netdev = dev; + skge->hw = hw; + skge->msg_enable = netif_msg_init(debug, default_msg); + skge->rx_csum = 1; + skge->tx_ring.count = DEFAULT_TX_RING_SIZE; + skge->rx_ring.count = DEFAULT_RX_RING_SIZE; + + /* Auto speed and flow control */ + skge->autoneg = AUTONEG_ENABLE; + skge->flow_control = FLOW_MODE_SYMMETRIC; + skge->duplex = -1; + skge->speed = -1; + skge->advertising = skge_modes(hw); + + hw->dev[port] = dev; + + skge->port = port; + + spin_lock_init(&skge->tx_lock); + + init_timer(&skge->link_check); + skge->link_check.function = skge_link_timer; + skge->link_check.data = (unsigned long) skge; + + init_timer(&skge->led_blink); + skge->led_blink.function = skge_blink_timer; + skge->led_blink.data = (unsigned long) skge; + + /* read the mac address */ + memcpy_fromio(dev->dev_addr, hw->regs + B2_MAC_1 + port*8, ETH_ALEN); + + /* device is off until link detection */ + netif_carrier_off(dev); + netif_stop_queue(dev); + + return dev; +} + +static void __devinit skge_show_addr(struct net_device *dev) +{ + const struct skge_port *skge = netdev_priv(dev); + + if (netif_msg_probe(skge)) + printk(KERN_INFO PFX "%s: addr %02x:%02x:%02x:%02x:%02x:%02x\n", + dev->name, + dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], + dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]); +} + +static int __devinit skge_probe(struct pci_dev *pdev, + const struct pci_device_id *ent) +{ + struct net_device *dev, *dev1; + struct skge_hw *hw; + int err, using_dac = 0; + + if ((err = pci_enable_device(pdev))) { + printk(KERN_ERR "%s cannot enable PCI device\n", + pci_name(pdev)); + goto err_out; + } + + if ((err = pci_request_regions(pdev, DRV_NAME))) { + printk(KERN_ERR "%s cannot obtain PCI resources\n", + pci_name(pdev)); + goto err_out_disable_pdev; + } + + pci_set_master(pdev); + + if (!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK))) + using_dac = 1; + else if (!(err = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) { + printk(KERN_ERR "%s no usable DMA configuration\n", + pci_name(pdev)); + goto err_out_free_regions; + } + +#ifdef __BIG_ENDIAN + /* byte swap decriptors in hardware */ + { + u32 reg; + + pci_read_config_dword(pdev, PCI_DEV_REG2, ®); + reg |= PCI_REV_DESC; + pci_write_config_dword(pdev, PCI_DEV_REG2, reg); + } +#endif + + err = -ENOMEM; + hw = kmalloc(sizeof(*hw), GFP_KERNEL); + if (!hw) { + printk(KERN_ERR "skge %s: cannot allocate hardware struct\n", + pci_name(pdev)); + goto err_out_free_regions; + } + + memset(hw, 0, sizeof(*hw)); + hw->pdev = pdev; + spin_lock_init(&hw->phy_lock); + tasklet_init(&hw->ext_tasklet, skge_extirq, (unsigned long) hw); + + hw->regs = ioremap_nocache(pci_resource_start(pdev, 0), 0x4000); + if (!hw->regs) { + printk(KERN_ERR "skge %s: cannot map device registers\n", + pci_name(pdev)); + goto err_out_free_hw; + } + + if ((err = request_irq(pdev->irq, skge_intr, SA_SHIRQ, DRV_NAME, hw))) { + printk(KERN_ERR "%s: cannot assign irq %d\n", + pci_name(pdev), pdev->irq); + goto err_out_iounmap; + } + pci_set_drvdata(pdev, hw); + + err = skge_reset(hw); + if (err) + goto err_out_free_irq; + + printk(KERN_INFO PFX "addr 0x%lx irq %d chip %s rev %d\n", + pci_resource_start(pdev, 0), pdev->irq, + skge_board_name(hw), chip_rev(hw)); + + if ((dev = skge_devinit(hw, 0)) == NULL) + goto err_out_led_off; + + if (using_dac) + dev->features |= NETIF_F_HIGHDMA; + + if ((err = register_netdev(dev))) { + printk(KERN_ERR "%s: cannot register net device\n", + pci_name(pdev)); + goto err_out_free_netdev; + } + + skge_show_addr(dev); + + if (isdualport(hw) && (dev1 = skge_devinit(hw, 1))) { + if (using_dac) + dev1->features |= NETIF_F_HIGHDMA; + + if (register_netdev(dev1) == 0) + skge_show_addr(dev1); + else { + /* Failure to register second port need not be fatal */ + printk(KERN_WARNING PFX "register of second port failed\n"); + hw->dev[1] = NULL; + free_netdev(dev1); + } + } + + return 0; + +err_out_free_netdev: + free_netdev(dev); +err_out_led_off: + skge_write16(hw, B0_LED, LED_STAT_OFF); +err_out_free_irq: + free_irq(pdev->irq, hw); +err_out_iounmap: + iounmap(hw->regs); +err_out_free_hw: + kfree(hw); +err_out_free_regions: + pci_release_regions(pdev); +err_out_disable_pdev: + pci_disable_device(pdev); + pci_set_drvdata(pdev, NULL); +err_out: + return err; +} + +static void __devexit skge_remove(struct pci_dev *pdev) +{ + struct skge_hw *hw = pci_get_drvdata(pdev); + struct net_device *dev0, *dev1; + + if(!hw) + return; + + if ((dev1 = hw->dev[1])) + unregister_netdev(dev1); + dev0 = hw->dev[0]; + unregister_netdev(dev0); + + tasklet_kill(&hw->ext_tasklet); + + free_irq(pdev->irq, hw); + pci_release_regions(pdev); + pci_disable_device(pdev); + if (dev1) + free_netdev(dev1); + free_netdev(dev0); + skge_write16(hw, B0_LED, LED_STAT_OFF); + iounmap(hw->regs); + kfree(hw); + pci_set_drvdata(pdev, NULL); +} + +#ifdef CONFIG_PM +static int skge_suspend(struct pci_dev *pdev, u32 state) +{ + struct skge_hw *hw = pci_get_drvdata(pdev); + int i, wol = 0; + + for(i = 0; i < 2; i++) { + struct net_device *dev = hw->dev[i]; + + if (dev && netif_running(dev)) { + struct skge_port *skge = netdev_priv(dev); + + netif_carrier_off(dev); + skge_down(dev); + netif_device_detach(dev); + wol |= skge->wol; + } + } + + pci_save_state(pdev); + pci_enable_wake(pdev, state, wol); + pci_disable_device(pdev); + pci_set_power_state(pdev, pci_choose_state(pdev, state)); + + return 0; +} + +static int skge_resume(struct pci_dev *pdev) +{ + struct skge_hw *hw = pci_get_drvdata(pdev); + int i; + + pci_set_power_state(pdev, PCI_D0); + pci_restore_state(pdev); + + skge_reset(hw); + + for(i = 0; i < 2; i++) { + struct net_device *dev = hw->dev[i]; + if (dev && netif_running(dev)) + skge_up(dev); + } + return 0; +} +#endif + +static struct pci_driver skge_driver = { + .name = DRV_NAME, + .id_table = skge_id_table, + .probe = skge_probe, + .remove = __devexit_p(skge_remove), +#ifdef CONFIG_PM + .suspend = skge_suspend, + .resume = skge_resume, +#endif +}; + +static int __init skge_init_module(void) +{ + return pci_module_init(&skge_driver); +} + +static void __exit skge_cleanup_module(void) +{ + pci_unregister_driver(&skge_driver); +} + +module_init(skge_init_module); +module_exit(skge_cleanup_module); diff -Nru a/drivers/net/skge.h b/drivers/net/skge.h --- /dev/null Wed Dec 31 16:00:00 196900 +++ b/drivers/net/skge.h 2005-01-25 13:51:57 -08:00 @@ -0,0 +1,3005 @@ +/* + * Definitions for the new Marvell Yukon / SysKonenct driver. + */ +#ifndef _SKGE_H +#define _SKGE_H + +/* PCI config registers */ +#define PCI_DEV_REG1 0x40 +#define PCI_DEV_REG2 0x44 +#ifndef PCI_VPD +#define PCI_VPD 0x50 +#endif + +/* PCI_OUR_REG_2 32 bit Our Register 2 */ +enum { + PCI_VPD_WR_THR = 0xff<<24, /* Bit 31..24: VPD Write Threshold */ + PCI_DEV_SEL = 0x7f<<17, /* Bit 23..17: EEPROM Device Select */ + PCI_VPD_ROM_SZ = 7 <<14, /* Bit 16..14: VPD ROM Size */ + /* Bit 13..12: reserved */ + PCI_EN_DUMMY_RD = 1<<3, /* Enable Dummy Read */ + PCI_REV_DESC = 1<<2, /* Reverse Desc. Bytes */ + PCI_USEDATA64 = 1<<0, /* Use 64Bit Data bus ext */ +}; + +/* PCI_VPD_ADR_REG 16 bit VPD Address Register */ +enum { + PCI_VPD_FLAG = 1<<15, /* starts VPD rd/wr cycle */ + PCI_VPD_ADR_MSK =0x7fffL, /* Bit 14.. 0: VPD Address Mask */ + VPD_RES_ID = 0x82, + VPD_RES_READ = 0x90, + VPD_RES_WRITE = 0x81, + VPD_RES_END = 0x78, +}; + + +#define PCI_STATUS_ERROR_BITS (PCI_STATUS_DETECTED_PARITY | \ + PCI_STATUS_SIG_SYSTEM_ERROR | \ + PCI_STATUS_REC_MASTER_ABORT | \ + PCI_STATUS_REC_TARGET_ABORT | \ + PCI_STATUS_PARITY) + + +enum csr_regs { + B0_RAP = 0x0000, + B0_CTST = 0x0004, + B0_LED = 0x0006, + B0_POWER_CTRL = 0x0007, + B0_ISRC = 0x0008, + B0_IMSK = 0x000c, + B0_HWE_ISRC = 0x0010, + B0_HWE_IMSK = 0x0014, + B0_SP_ISRC = 0x0018, + B0_XM1_IMSK = 0x0020, + B0_XM1_ISRC = 0x0028, + B0_XM1_PHY_ADDR = 0x0030, + B0_XM1_PHY_DATA = 0x0034, + B0_XM2_IMSK = 0x0040, + B0_XM2_ISRC = 0x0048, + B0_XM2_PHY_ADDR = 0x0050, + B0_XM2_PHY_DATA = 0x0054, + B0_R1_CSR = 0x0060, + B0_R2_CSR = 0x0064, + B0_XS1_CSR = 0x0068, + B0_XA1_CSR = 0x006c, + B0_XS2_CSR = 0x0070, + B0_XA2_CSR = 0x0074, + + B2_MAC_1 = 0x0100, + B2_MAC_2 = 0x0108, + B2_MAC_3 = 0x0110, + B2_CONN_TYP = 0x0118, + B2_PMD_TYP = 0x0119, + B2_MAC_CFG = 0x011a, + B2_CHIP_ID = 0x011b, + B2_E_0 = 0x011c, + B2_E_1 = 0x011d, + B2_E_2 = 0x011e, + B2_E_3 = 0x011f, + B2_FAR = 0x0120, + B2_FDP = 0x0124, + B2_LD_CTRL = 0x0128, + B2_LD_TEST = 0x0129, + B2_TI_INI = 0x0130, + B2_TI_VAL = 0x0134, + B2_TI_CTRL = 0x0138, + B2_TI_TEST = 0x0139, + B2_IRQM_INI = 0x0140, + B2_IRQM_VAL = 0x0144, + B2_IRQM_CTRL = 0x0148, + B2_IRQM_TEST = 0x0149, + B2_IRQM_MSK = 0x014c, + B2_IRQM_HWE_MSK = 0x0150, + B2_TST_CTRL1 = 0x0158, + B2_TST_CTRL2 = 0x0159, + B2_GP_IO = 0x015c, + B2_I2C_CTRL = 0x0160, + B2_I2C_DATA = 0x0164, + B2_I2C_IRQ = 0x0168, + B2_I2C_SW = 0x016c, + B2_BSC_INI = 0x0170, + B2_BSC_VAL = 0x0174, + B2_BSC_CTRL = 0x0178, + B2_BSC_STAT = 0x0179, + B2_BSC_TST = 0x017a, + + B3_RAM_ADDR = 0x0180, + B3_RAM_DATA_LO = 0x0184, + B3_RAM_DATA_HI = 0x0188, + B3_RI_WTO_R1 = 0x0190, + B3_RI_WTO_XA1 = 0x0191, + B3_RI_WTO_XS1 = 0x0192, + B3_RI_RTO_R1 = 0x0193, + B3_RI_RTO_XA1 = 0x0194, + B3_RI_RTO_XS1 = 0x0195, + B3_RI_WTO_R2 = 0x0196, + B3_RI_WTO_XA2 = 0x0197, + B3_RI_WTO_XS2 = 0x0198, + B3_RI_RTO_R2 = 0x0199, + B3_RI_RTO_XA2 = 0x019a, + B3_RI_RTO_XS2 = 0x019b, + B3_RI_TO_VAL = 0x019c, + B3_RI_CTRL = 0x01a0, + B3_RI_TEST = 0x01a2, + B3_MA_TOINI_RX1 = 0x01b0, + B3_MA_TOINI_RX2 = 0x01b1, + B3_MA_TOINI_TX1 = 0x01b2, + B3_MA_TOINI_TX2 = 0x01b3, + B3_MA_TOVAL_RX1 = 0x01b4, + B3_MA_TOVAL_RX2 = 0x01b5, + B3_MA_TOVAL_TX1 = 0x01b6, + B3_MA_TOVAL_TX2 = 0x01b7, + B3_MA_TO_CTRL = 0x01b8, + B3_MA_TO_TEST = 0x01ba, + B3_MA_RCINI_RX1 = 0x01c0, + B3_MA_RCINI_RX2 = 0x01c1, + B3_MA_RCINI_TX1 = 0x01c2, + B3_MA_RCINI_TX2 = 0x01c3, + B3_MA_RCVAL_RX1 = 0x01c4, + B3_MA_RCVAL_RX2 = 0x01c5, + B3_MA_RCVAL_TX1 = 0x01c6, + B3_MA_RCVAL_TX2 = 0x01c7, + B3_MA_RC_CTRL = 0x01c8, + B3_MA_RC_TEST = 0x01ca, + B3_PA_TOINI_RX1 = 0x01d0, + B3_PA_TOINI_RX2 = 0x01d4, + B3_PA_TOINI_TX1 = 0x01d8, + B3_PA_TOINI_TX2 = 0x01dc, + B3_PA_TOVAL_RX1 = 0x01e0, + B3_PA_TOVAL_RX2 = 0x01e4, + B3_PA_TOVAL_TX1 = 0x01e8, + B3_PA_TOVAL_TX2 = 0x01ec, + B3_PA_CTRL = 0x01f0, + B3_PA_TEST = 0x01f2, +}; + +/* B0_CTST 16 bit Control/Status register */ +enum { + CS_CLK_RUN_HOT = 1<<13,/* CLK_RUN hot m. (YUKON-Lite only) */ + CS_CLK_RUN_RST = 1<<12,/* CLK_RUN reset (YUKON-Lite only) */ + CS_CLK_RUN_ENA = 1<<11,/* CLK_RUN enable (YUKON-Lite only) */ + CS_VAUX_AVAIL = 1<<10,/* VAUX available (YUKON only) */ + CS_BUS_CLOCK = 1<<9, /* Bus Clock 0/1 = 33/66 MHz */ + CS_BUS_SLOT_SZ = 1<<8, /* Slot Size 0/1 = 32/64 bit slot */ + CS_ST_SW_IRQ = 1<<7, /* Set IRQ SW Request */ + CS_CL_SW_IRQ = 1<<6, /* Clear IRQ SW Request */ + CS_STOP_DONE = 1<<5, /* Stop Master is finished */ + CS_STOP_MAST = 1<<4, /* Command Bit to stop the master */ + CS_MRST_CLR = 1<<3, /* Clear Master reset */ + CS_MRST_SET = 1<<2, /* Set Master reset */ + CS_RST_CLR = 1<<1, /* Clear Software reset */ + CS_RST_SET = 1, /* Set Software reset */ + +/* B0_LED 8 Bit LED register */ +/* Bit 7.. 2: reserved */ + LED_STAT_ON = 1<<1, /* Status LED on */ + LED_STAT_OFF = 1, /* Status LED off */ + +/* B0_POWER_CTRL 8 Bit Power Control reg (YUKON only) */ + PC_VAUX_ENA = 1<<7, /* Switch VAUX Enable */ + PC_VAUX_DIS = 1<<6, /* Switch VAUX Disable */ + PC_VCC_ENA = 1<<5, /* Switch VCC Enable */ + PC_VCC_DIS = 1<<4, /* Switch VCC Disable */ + PC_VAUX_ON = 1<<3, /* Switch VAUX On */ + PC_VAUX_OFF = 1<<2, /* Switch VAUX Off */ + PC_VCC_ON = 1<<1, /* Switch VCC On */ + PC_VCC_OFF = 1<<0, /* Switch VCC Off */ +}; + +/* B2_IRQM_MSK 32 bit IRQ Moderation Mask */ +enum { + IS_ALL_MSK = 0xbffffffful, /* All Interrupt bits */ + IS_HW_ERR = 1<<31, /* Interrupt HW Error */ + /* Bit 30: reserved */ + IS_PA_TO_RX1 = 1<<29, /* Packet Arb Timeout Rx1 */ + IS_PA_TO_RX2 = 1<<28, /* Packet Arb Timeout Rx2 */ + IS_PA_TO_TX1 = 1<<27, /* Packet Arb Timeout Tx1 */ + IS_PA_TO_TX2 = 1<<26, /* Packet Arb Timeout Tx2 */ + IS_I2C_READY = 1<<25, /* IRQ on end of I2C Tx */ + IS_IRQ_SW = 1<<24, /* SW forced IRQ */ + IS_EXT_REG = 1<<23, /* IRQ from LM80 or PHY (GENESIS only) */ + /* IRQ from PHY (YUKON only) */ + IS_TIMINT = 1<<22, /* IRQ from Timer */ + IS_MAC1 = 1<<21, /* IRQ from MAC 1 */ + IS_LNK_SYNC_M1 = 1<<20, /* Link Sync Cnt wrap MAC 1 */ + IS_MAC2 = 1<<19, /* IRQ from MAC 2 */ + IS_LNK_SYNC_M2 = 1<<18, /* Link Sync Cnt wrap MAC 2 */ +/* Receive Queue 1 */ + IS_R1_B = 1<<17, /* Q_R1 End of Buffer */ + IS_R1_F = 1<<16, /* Q_R1 End of Frame */ + IS_R1_C = 1<<15, /* Q_R1 Encoding Error */ +/* Receive Queue 2 */ + IS_R2_B = 1<<14, /* Q_R2 End of Buffer */ + IS_R2_F = 1<<13, /* Q_R2 End of Frame */ + IS_R2_C = 1<<12, /* Q_R2 Encoding Error */ +/* Synchronous Transmit Queue 1 */ + IS_XS1_B = 1<<11, /* Q_XS1 End of Buffer */ + IS_XS1_F = 1<<10, /* Q_XS1 End of Frame */ + IS_XS1_C = 1<<9, /* Q_XS1 Encoding Error */ +/* Asynchronous Transmit Queue 1 */ + IS_XA1_B = 1<<8, /* Q_XA1 End of Buffer */ + IS_XA1_F = 1<<7, /* Q_XA1 End of Frame */ + IS_XA1_C = 1<<6, /* Q_XA1 Encoding Error */ +/* Synchronous Transmit Queue 2 */ + IS_XS2_B = 1<<5, /* Q_XS2 End of Buffer */ + IS_XS2_F = 1<<4, /* Q_XS2 End of Frame */ + IS_XS2_C = 1<<3, /* Q_XS2 Encoding Error */ +/* Asynchronous Transmit Queue 2 */ + IS_XA2_B = 1<<2, /* Q_XA2 End of Buffer */ + IS_XA2_F = 1<<1, /* Q_XA2 End of Frame */ + IS_XA2_C = 1<<0, /* Q_XA2 Encoding Error */ + + IS_PORT_1 = IS_XA1_F| IS_R1_F| IS_MAC1, + IS_PORT_2 = IS_XA2_F| IS_R2_F| IS_MAC2, +}; + + +/* B2_IRQM_HWE_MSK 32 bit IRQ Moderation HW Error Mask */ +enum { + IS_ERR_MSK = 0x00003fff,/* All Error bits */ + + IS_IRQ_TIST_OV = 1<<13, /* Time Stamp Timer Overflow (YUKON only) */ + IS_IRQ_SENSOR = 1<<12, /* IRQ from Sensor (YUKON only) */ + IS_IRQ_MST_ERR = 1<<11, /* IRQ master error detected */ + IS_IRQ_STAT = 1<<10, /* IRQ status exception */ + IS_NO_STAT_M1 = 1<<9, /* No Rx Status from MAC 1 */ + IS_NO_STAT_M2 = 1<<8, /* No Rx Status from MAC 2 */ + IS_NO_TIST_M1 = 1<<7, /* No Time Stamp from MAC 1 */ + IS_NO_TIST_M2 = 1<<6, /* No Time Stamp from MAC 2 */ + IS_RAM_RD_PAR = 1<<5, /* RAM Read Parity Error */ + IS_RAM_WR_PAR = 1<<4, /* RAM Write Parity Error */ + IS_M1_PAR_ERR = 1<<3, /* MAC 1 Parity Error */ + IS_M2_PAR_ERR = 1<<2, /* MAC 2 Parity Error */ + IS_R1_PAR_ERR = 1<<1, /* Queue R1 Parity Error */ + IS_R2_PAR_ERR = 1<<0, /* Queue R2 Parity Error */ +}; + +/* B2_TST_CTRL1 8 bit Test Control Register 1 */ +enum { + TST_FRC_DPERR_MR = 1<<7, /* force DATAPERR on MST RD */ + TST_FRC_DPERR_MW = 1<<6, /* force DATAPERR on MST WR */ + TST_FRC_DPERR_TR = 1<<5, /* force DATAPERR on TRG RD */ + TST_FRC_DPERR_TW = 1<<4, /* force DATAPERR on TRG WR */ + TST_FRC_APERR_M = 1<<3, /* force ADDRPERR on MST */ + TST_FRC_APERR_T = 1<<2, /* force ADDRPERR on TRG */ + TST_CFG_WRITE_ON = 1<<1, /* Enable Config Reg WR */ + TST_CFG_WRITE_OFF= 1<<0, /* Disable Config Reg WR */ +}; + +/* B2_MAC_CFG 8 bit MAC Configuration / Chip Revision */ +enum { + CFG_CHIP_R_MSK = 0xf<<4, /* Bit 7.. 4: Chip Revision */ + /* Bit 3.. 2: reserved */ + CFG_DIS_M2_CLK = 1<<1, /* Disable Clock for 2nd MAC */ + CFG_SNG_MAC = 1<<0, /* MAC Config: 0=2 MACs / 1=1 MAC*/ +}; + +/* B2_CHIP_ID 8 bit Chip Identification Number */ +enum { + CHIP_ID_GENESIS = 0x0a, /* Chip ID for GENESIS */ + CHIP_ID_YUKON = 0xb0, /* Chip ID for YUKON */ + CHIP_ID_YUKON_LITE = 0xb1, /* Chip ID for YUKON-Lite (Rev. A1-A3) */ + CHIP_ID_YUKON_LP = 0xb2, /* Chip ID for YUKON-LP */ + CHIP_ID_YUKON_XL = 0xb3, /* Chip ID for YUKON-2 XL */ + CHIP_ID_YUKON_EC = 0xb6, /* Chip ID for YUKON-2 EC */ + CHIP_ID_YUKON_FE = 0xb7, /* Chip ID for YUKON-2 FE */ + + CHIP_REV_YU_LITE_A1 = 3, /* Chip Rev. for YUKON-Lite A1,A2 */ + CHIP_REV_YU_LITE_A3 = 7, /* Chip Rev. for YUKON-Lite A3 */ +}; + +/* B2_LD_TEST 8 bit EPROM loader test register */ +enum { + LD_T_ON = 1<<3, /* Loader Test mode on */ + LD_T_OFF = 1<<2, /* Loader Test mode off */ + LD_T_STEP = 1<<1, /* Decrement FPROM addr. Counter */ + LD_START = 1<<0, /* Start loading FPROM */ +}; + +/* B2_TI_CTRL 8 bit Timer control */ +/* B2_IRQM_CTRL 8 bit IRQ Moderation Timer Control */ +enum { + TIM_START = 1<<2, /* Start Timer */ + TIM_STOP = 1<<1, /* Stop Timer */ + TIM_CLR_IRQ = 1<<0, /* Clear Timer IRQ (!IRQM) */ +}; + +/* B2_TI_TEST 8 Bit Timer Test */ +/* B2_IRQM_TEST 8 bit IRQ Moderation Timer Test */ +/* B28_DPT_TST 8 bit Descriptor Poll Timer Test Reg */ +enum { + TIM_T_ON = 1<<2, /* Test mode on */ + TIM_T_OFF = 1<<1, /* Test mode off */ + TIM_T_STEP = 1<<0, /* Test step */ +}; + +/* B28_DPT_INI 32 bit Descriptor Poll Timer Init Val */ +/* B28_DPT_VAL 32 bit Descriptor Poll Timer Curr Val */ +/* B28_DPT_CTRL 8 bit Descriptor Poll Timer Ctrl Reg */ +enum { + DPT_MSK = 0x00ffffffL, /* Bit 23.. 0: Desc Poll Timer Bits */ + + DPT_START = 1<<1, /* Start Descriptor Poll Timer */ + DPT_STOP = 1<<0, /* Stop Descriptor Poll Timer */ +}; + +/* B2_GP_IO 32 bit General Purpose I/O Register */ +enum { + GP_DIR_9 = 1<<25, /* IO_9 direct, 0=In/1=Out */ + GP_DIR_8 = 1<<24, /* IO_8 direct, 0=In/1=Out */ + GP_DIR_7 = 1<<23, /* IO_7 direct, 0=In/1=Out */ + GP_DIR_6 = 1<<22, /* IO_6 direct, 0=In/1=Out */ + GP_DIR_5 = 1<<21, /* IO_5 direct, 0=In/1=Out */ + GP_DIR_4 = 1<<20, /* IO_4 direct, 0=In/1=Out */ + GP_DIR_3 = 1<<19, /* IO_3 direct, 0=In/1=Out */ + GP_DIR_2 = 1<<18, /* IO_2 direct, 0=In/1=Out */ + GP_DIR_1 = 1<<17, /* IO_1 direct, 0=In/1=Out */ + GP_DIR_0 = 1<<16, /* IO_0 direct, 0=In/1=Out */ + + GP_IO_9 = 1<<9, /* IO_9 pin */ + GP_IO_8 = 1<<8, /* IO_8 pin */ + GP_IO_7 = 1<<7, /* IO_7 pin */ + GP_IO_6 = 1<<6, /* IO_6 pin */ + GP_IO_5 = 1<<5, /* IO_5 pin */ + GP_IO_4 = 1<<4, /* IO_4 pin */ + GP_IO_3 = 1<<3, /* IO_3 pin */ + GP_IO_2 = 1<<2, /* IO_2 pin */ + GP_IO_1 = 1<<1, /* IO_1 pin */ + GP_IO_0 = 1<<0, /* IO_0 pin */ +}; + +/* Rx/Tx Path related Arbiter Test Registers */ +/* B3_MA_TO_TEST 16 bit MAC Arbiter Timeout Test Reg */ +/* B3_MA_RC_TEST 16 bit MAC Arbiter Recovery Test Reg */ +/* B3_PA_TEST 16 bit Packet Arbiter Test Register */ +/* Bit 15, 11, 7, and 3 are reserved in B3_PA_TEST */ +enum { + TX2_T_EV = 1<<15,/* TX2 Timeout/Recv Event occured */ + TX2_T_ON = 1<<14,/* TX2 Timeout/Recv Timer Test On */ + TX2_T_OFF = 1<<13,/* TX2 Timeout/Recv Timer Tst Off */ + TX2_T_STEP = 1<<12,/* TX2 Timeout/Recv Timer Step */ + TX1_T_EV = 1<<11,/* TX1 Timeout/Recv Event occured */ + TX1_T_ON = 1<<10,/* TX1 Timeout/Recv Timer Test On */ + TX1_T_OFF = 1<<9, /* TX1 Timeout/Recv Timer Tst Off */ + TX1_T_STEP = 1<<8, /* TX1 Timeout/Recv Timer Step */ + RX2_T_EV = 1<<7, /* RX2 Timeout/Recv Event occured */ + RX2_T_ON = 1<<6, /* RX2 Timeout/Recv Timer Test On */ + RX2_T_OFF = 1<<5, /* RX2 Timeout/Recv Timer Tst Off */ + RX2_T_STEP = 1<<4, /* RX2 Timeout/Recv Timer Step */ + RX1_T_EV = 1<<3, /* RX1 Timeout/Recv Event occured */ + RX1_T_ON = 1<<2, /* RX1 Timeout/Recv Timer Test On */ + RX1_T_OFF = 1<<1, /* RX1 Timeout/Recv Timer Tst Off */ + RX1_T_STEP = 1<<0, /* RX1 Timeout/Recv Timer Step */ +}; + +/* Descriptor Bit Definition */ +/* TxCtrl Transmit Buffer Control Field */ +/* RxCtrl Receive Buffer Control Field */ +enum { + BMU_OWN = 1<<31, /* OWN bit: 0=host/1=BMU */ + BMU_STF = 1<<30, /* Start of Frame */ + BMU_EOF = 1<<29, /* End of Frame */ + BMU_IRQ_EOB = 1<<28, /* Req "End of Buffer" IRQ */ + BMU_IRQ_EOF = 1<<27, /* Req "End of Frame" IRQ */ + /* TxCtrl specific bits */ + BMU_STFWD = 1<<26, /* (Tx) Store & Forward Frame */ + BMU_NO_FCS = 1<<25, /* (Tx) Disable MAC FCS (CRC) generation */ + BMU_SW = 1<<24, /* (Tx) 1 bit res. for SW use */ + /* RxCtrl specific bits */ + BMU_DEV_0 = 1<<26, /* (Rx) Transfer data to Dev0 */ + BMU_STAT_VAL = 1<<25, /* (Rx) Rx Status Valid */ + BMU_TIST_VAL = 1<<24, /* (Rx) Rx TimeStamp Valid */ + /* Bit 23..16: BMU Check Opcodes */ + BMU_CHECK = 0x55<<16, /* Default BMU check */ + BMU_TCP_CHECK = 0x56<<16, /* Descr with TCP ext */ + BMU_UDP_CHECK = 0x57<<16, /* Descr with UDP ext (YUKON only) */ + BMU_BBC = 0xffffL, /* Bit 15.. 0: Buffer Byte Counter */ +}; + +/* B2_BSC_CTRL 8 bit Blink Source Counter Control */ +enum { + BSC_START = 1<<1, /* Start Blink Source Counter */ + BSC_STOP = 1<<0, /* Stop Blink Source Counter */ +}; + +/* B2_BSC_STAT 8 bit Blink Source Counter Status */ +enum { + BSC_SRC = 1<<0, /* Blink Source, 0=Off / 1=On */ +}; + +/* B2_BSC_TST 16 bit Blink Source Counter Test Reg */ +enum { + BSC_T_ON = 1<<2, /* Test mode on */ + BSC_T_OFF = 1<<1, /* Test mode off */ + BSC_T_STEP = 1<<0, /* Test step */ +}; + +/* B3_RAM_ADDR 32 bit RAM Address, to read or write */ + /* Bit 31..19: reserved */ +#define RAM_ADR_RAN 0x0007ffffL /* Bit 18.. 0: RAM Address Range */ +/* RAM Interface Registers */ + +/* B3_RI_CTRL 16 bit RAM Iface Control Register */ +enum { + RI_CLR_RD_PERR = 1<<9, /* Clear IRQ RAM Read Parity Err */ + RI_CLR_WR_PERR = 1<<8, /* Clear IRQ RAM Write Parity Err*/ + + RI_RST_CLR = 1<<1, /* Clear RAM Interface Reset */ + RI_RST_SET = 1<<0, /* Set RAM Interface Reset */ +}; + +/* B3_RI_TEST 8 bit RAM Iface Test Register */ +enum { + RI_T_EV = 1<<3, /* Timeout Event occured */ + RI_T_ON = 1<<2, /* Timeout Timer Test On */ + RI_T_OFF = 1<<1, /* Timeout Timer Test Off */ + RI_T_STEP = 1<<0, /* Timeout Timer Step */ +}; + +/* MAC Arbiter Registers */ +/* B3_MA_TO_CTRL 16 bit MAC Arbiter Timeout Ctrl Reg */ +enum { + MA_FOE_ON = 1<<3, /* XMAC Fast Output Enable ON */ + MA_FOE_OFF = 1<<2, /* XMAC Fast Output Enable OFF */ + MA_RST_CLR = 1<<1, /* Clear MAC Arbiter Reset */ + MA_RST_SET = 1<<0, /* Set MAC Arbiter Reset */ + +}; + +/* Timeout values */ +#define SK_MAC_TO_53 72 /* MAC arbiter timeout */ +#define SK_PKT_TO_53 0x2000 /* Packet arbiter timeout */ +#define SK_PKT_TO_MAX 0xffff /* Maximum value */ +#define SK_RI_TO_53 36 /* RAM interface timeout */ + + +/* B3_MA_RC_CTRL 16 bit MAC Arbiter Recovery Ctrl Reg */ +enum { + MA_ENA_REC_TX2 = 1<<7, /* Enable Recovery Timer TX2 */ + MA_DIS_REC_TX2 = 1<<6, /* Disable Recovery Timer TX2 */ + MA_ENA_REC_TX1 = 1<<5, /* Enable Recovery Timer TX1 */ + MA_DIS_REC_TX1 = 1<<4, /* Disable Recovery Timer TX1 */ + MA_ENA_REC_RX2 = 1<<3, /* Enable Recovery Timer RX2 */ + MA_DIS_REC_RX2 = 1<<2, /* Disable Recovery Timer RX2 */ + MA_ENA_REC_RX1 = 1<<1, /* Enable Recovery Timer RX1 */ + MA_DIS_REC_RX1 = 1<<0, /* Disable Recovery Timer RX1 */ +}; + +/* Packet Arbiter Registers */ +/* B3_PA_CTRL 16 bit Packet Arbiter Ctrl Register */ +enum { + PA_CLR_TO_TX2 = 1<<13, /* Clear IRQ Packet Timeout TX2 */ + PA_CLR_TO_TX1 = 1<<12, /* Clear IRQ Packet Timeout TX1 */ + PA_CLR_TO_RX2 = 1<<11, /* Clear IRQ Packet Timeout RX2 */ + PA_CLR_TO_RX1 = 1<<10, /* Clear IRQ Packet Timeout RX1 */ + PA_ENA_TO_TX2 = 1<<9, /* Enable Timeout Timer TX2 */ + PA_DIS_TO_TX2 = 1<<8, /* Disable Timeout Timer TX2 */ + PA_ENA_TO_TX1 = 1<<7, /* Enable Timeout Timer TX1 */ + PA_DIS_TO_TX1 = 1<<6, /* Disable Timeout Timer TX1 */ + PA_ENA_TO_RX2 = 1<<5, /* Enable Timeout Timer RX2 */ + PA_DIS_TO_RX2 = 1<<4, /* Disable Timeout Timer RX2 */ + PA_ENA_TO_RX1 = 1<<3, /* Enable Timeout Timer RX1 */ + PA_DIS_TO_RX1 = 1<<2, /* Disable Timeout Timer RX1 */ + PA_RST_CLR = 1<<1, /* Clear MAC Arbiter Reset */ + PA_RST_SET = 1<<0, /* Set MAC Arbiter Reset */ +}; + +#define PA_ENA_TO_ALL (PA_ENA_TO_RX1 | PA_ENA_TO_RX2 |\ + PA_ENA_TO_TX1 | PA_ENA_TO_TX2) + + +/* Transmit Arbiter Registers MAC 1 and 2, use MR_ADDR() to access */ +/* TXA_ITI_INI 32 bit Tx Arb Interval Timer Init Val */ +/* TXA_ITI_VAL 32 bit Tx Arb Interval Timer Value */ +/* TXA_LIM_INI 32 bit Tx Arb Limit Counter Init Val */ +/* TXA_LIM_VAL 32 bit Tx Arb Limit Counter Value */ + +#define TXA_MAX_VAL 0x00ffffffUL /* Bit 23.. 0: Max TXA Timer/Cnt Val */ + +/* TXA_CTRL 8 bit Tx Arbiter Control Register */ +enum { + TXA_ENA_FSYNC = 1<<7, /* Enable force of sync Tx queue */ + TXA_DIS_FSYNC = 1<<6, /* Disable force of sync Tx queue */ + TXA_ENA_ALLOC = 1<<5, /* Enable alloc of free bandwidth */ + TXA_DIS_ALLOC = 1<<4, /* Disable alloc of free bandwidth */ + TXA_START_RC = 1<<3, /* Start sync Rate Control */ + TXA_STOP_RC = 1<<2, /* Stop sync Rate Control */ + TXA_ENA_ARB = 1<<1, /* Enable Tx Arbiter */ + TXA_DIS_ARB = 1<<0, /* Disable Tx Arbiter */ +}; + +/* + * Bank 4 - 5 + */ +/* Transmit Arbiter Registers MAC 1 and 2, use MR_ADDR() to access */ +enum { + TXA_ITI_INI = 0x0200,/* 32 bit Tx Arb Interval Timer Init Val*/ + TXA_ITI_VAL = 0x0204,/* 32 bit Tx Arb Interval Timer Value */ + TXA_LIM_INI = 0x0208,/* 32 bit Tx Arb Limit Counter Init Val */ + TXA_LIM_VAL = 0x020c,/* 32 bit Tx Arb Limit Counter Value */ + TXA_CTRL = 0x0210,/* 8 bit Tx Arbiter Control Register */ + TXA_TEST = 0x0211,/* 8 bit Tx Arbiter Test Register */ + TXA_STAT = 0x0212,/* 8 bit Tx Arbiter Status Register */ +}; + + +enum { + B6_EXT_REG = 0x0300,/* External registers (GENESIS only) */ + B7_CFG_SPC = 0x0380,/* copy of the Configuration register */ + B8_RQ1_REGS = 0x0400,/* Receive Queue 1 */ + B8_RQ2_REGS = 0x0480,/* Receive Queue 2 */ + B8_TS1_REGS = 0x0600,/* Transmit sync queue 1 */ + B8_TA1_REGS = 0x0680,/* Transmit async queue 1 */ + B8_TS2_REGS = 0x0700,/* Transmit sync queue 2 */ + B8_TA2_REGS = 0x0780,/* Transmit sync queue 2 */ + B16_RAM_REGS = 0x0800,/* RAM Buffer Registers */ +}; + +/* Queue Register Offsets, use Q_ADDR() to access */ +enum { + B8_Q_REGS = 0x0400, /* base of Queue registers */ + Q_D = 0x00, /* 8*32 bit Current Descriptor */ + Q_DA_L = 0x20, /* 32 bit Current Descriptor Address Low dWord */ + Q_DA_H = 0x24, /* 32 bit Current Descriptor Address High dWord */ + Q_AC_L = 0x28, /* 32 bit Current Address Counter Low dWord */ + Q_AC_H = 0x2c, /* 32 bit Current Address Counter High dWord */ + Q_BC = 0x30, /* 32 bit Current Byte Counter */ + Q_CSR = 0x34, /* 32 bit BMU Control/Status Register */ + Q_F = 0x38, /* 32 bit Flag Register */ + Q_T1 = 0x3c, /* 32 bit Test Register 1 */ + Q_T1_TR = 0x3c, /* 8 bit Test Register 1 Transfer SM */ + Q_T1_WR = 0x3d, /* 8 bit Test Register 1 Write Descriptor SM */ + Q_T1_RD = 0x3e, /* 8 bit Test Register 1 Read Descriptor SM */ + Q_T1_SV = 0x3f, /* 8 bit Test Register 1 Supervisor SM */ + Q_T2 = 0x40, /* 32 bit Test Register 2 */ + Q_T3 = 0x44, /* 32 bit Test Register 3 */ + +/* Yukon-2 */ + Q_DONE = 0x24, /* 16 bit Done Index (Yukon-2 only) */ + Q_WM = 0x40, /* 16 bit FIFO Watermark */ + Q_AL = 0x42, /* 8 bit FIFO Alignment */ + Q_RSP = 0x44, /* 16 bit FIFO Read Shadow Pointer */ + Q_RSL = 0x46, /* 8 bit FIFO Read Shadow Level */ + Q_RP = 0x48, /* 8 bit FIFO Read Pointer */ + Q_RL = 0x4a, /* 8 bit FIFO Read Level */ + Q_WP = 0x4c, /* 8 bit FIFO Write Pointer */ + Q_WSP = 0x4d, /* 8 bit FIFO Write Shadow Pointer */ + Q_WL = 0x4e, /* 8 bit FIFO Write Level */ + Q_WSL = 0x4f, /* 8 bit FIFO Write Shadow Level */ +}; +#define Q_ADDR(reg, offs) (B8_Q_REGS + (reg) + (offs)) + +/* RAM Buffer Register Offsets */ +enum { + + RB_START = 0x00,/* 32 bit RAM Buffer Start Address */ + RB_END = 0x04,/* 32 bit RAM Buffer End Address */ + RB_WP = 0x08,/* 32 bit RAM Buffer Write Pointer */ + RB_RP = 0x0c,/* 32 bit RAM Buffer Read Pointer */ + RB_RX_UTPP = 0x10,/* 32 bit Rx Upper Threshold, Pause Packet */ + RB_RX_LTPP = 0x14,/* 32 bit Rx Lower Threshold, Pause Packet */ + RB_RX_UTHP = 0x18,/* 32 bit Rx Upper Threshold, High Prio */ + RB_RX_LTHP = 0x1c,/* 32 bit Rx Lower Threshold, High Prio */ + /* 0x10 - 0x1f: reserved at Tx RAM Buffer Registers */ + RB_PC = 0x20,/* 32 bit RAM Buffer Packet Counter */ + RB_LEV = 0x24,/* 32 bit RAM Buffer Level Register */ + RB_CTRL = 0x28,/* 32 bit RAM Buffer Control Register */ + RB_TST1 = 0x29,/* 8 bit RAM Buffer Test Register 1 */ + RB_TST2 = 0x2a,/* 8 bit RAM Buffer Test Register 2 */ +}; + +/* Receive and Transmit Queues */ +enum { + Q_R1 = 0x0000, /* Receive Queue 1 */ + Q_R2 = 0x0080, /* Receive Queue 2 */ + Q_XS1 = 0x0200, /* Synchronous Transmit Queue 1 */ + Q_XA1 = 0x0280, /* Asynchronous Transmit Queue 1 */ + Q_XS2 = 0x0300, /* Synchronous Transmit Queue 2 */ + Q_XA2 = 0x0380, /* Asynchronous Transmit Queue 2 */ +}; + +/* Different MAC Types */ +enum { + SK_MAC_XMAC = 0, /* Xaqti XMAC II */ + SK_MAC_GMAC = 1, /* Marvell GMAC */ +}; + +/* Different PHY Types */ +enum { + SK_PHY_XMAC = 0,/* integrated in XMAC II */ + SK_PHY_BCOM = 1,/* Broadcom BCM5400 */ + SK_PHY_LONE = 2,/* Level One LXT1000 [not supported]*/ + SK_PHY_NAT = 3,/* National DP83891 [not supported] */ + SK_PHY_MARV_COPPER= 4,/* Marvell 88E1011S */ + SK_PHY_MARV_FIBER = 5,/* Marvell 88E1011S working on fiber */ +}; + +/* PHY addresses (bits 12..8 of PHY address reg) */ +enum { + PHY_ADDR_XMAC = 0<<8, + PHY_ADDR_BCOM = 1<<8, + PHY_ADDR_LONE = 3<<8, + PHY_ADDR_NAT = 0<<8, +/* GPHY address (bits 15..11 of SMI control reg) */ + PHY_ADDR_MARV = 0, +}; + +#define RB_ADDR(offs, queue) (B16_RAM_REGS + (queue) + (offs)) + +/* Receive MAC FIFO, Receive LED, and Link_Sync regs (GENESIS only) */ +enum { + RX_MFF_EA = 0x0c00,/* 32 bit Receive MAC FIFO End Address */ + RX_MFF_WP = 0x0c04,/* 32 bit Receive MAC FIFO Write Pointer */ + + RX_MFF_RP = 0x0c0c,/* 32 bit Receive MAC FIFO Read Pointer */ + RX_MFF_PC = 0x0c10,/* 32 bit Receive MAC FIFO Packet Cnt */ + RX_MFF_LEV = 0x0c14,/* 32 bit Receive MAC FIFO Level */ + RX_MFF_CTRL1 = 0x0c18,/* 16 bit Receive MAC FIFO Control Reg 1*/ + RX_MFF_STAT_TO = 0x0c1a,/* 8 bit Receive MAC Status Timeout */ + RX_MFF_TIST_TO = 0x0c1b,/* 8 bit Receive MAC Time Stamp Timeout */ + RX_MFF_CTRL2 = 0x0c1c,/* 8 bit Receive MAC FIFO Control Reg 2*/ + RX_MFF_TST1 = 0x0c1d,/* 8 bit Receive MAC FIFO Test Reg 1 */ + RX_MFF_TST2 = 0x0c1e,/* 8 bit Receive MAC FIFO Test Reg 2 */ + + RX_LED_INI = 0x0c20,/* 32 bit Receive LED Cnt Init Value */ + RX_LED_VAL = 0x0c24,/* 32 bit Receive LED Cnt Current Value */ + RX_LED_CTRL = 0x0c28,/* 8 bit Receive LED Cnt Control Reg */ + RX_LED_TST = 0x0c29,/* 8 bit Receive LED Cnt Test Register */ + + LNK_SYNC_INI = 0x0c30,/* 32 bit Link Sync Cnt Init Value */ + LNK_SYNC_VAL = 0x0c34,/* 32 bit Link Sync Cnt Current Value */ + LNK_SYNC_CTRL = 0x0c38,/* 8 bit Link Sync Cnt Control Register */ + LNK_SYNC_TST = 0x0c39,/* 8 bit Link Sync Cnt Test Register */ + LNK_LED_REG = 0x0c3c,/* 8 bit Link LED Register */ +}; + +/* Receive and Transmit MAC FIFO Registers (GENESIS only) */ +/* RX_MFF_CTRL1 16 bit Receive MAC FIFO Control Reg 1 */ +enum { + MFF_ENA_RDY_PAT = 1<<13, /* Enable Ready Patch */ + MFF_DIS_RDY_PAT = 1<<12, /* Disable Ready Patch */ + MFF_ENA_TIM_PAT = 1<<11, /* Enable Timing Patch */ + MFF_DIS_TIM_PAT = 1<<10, /* Disable Timing Patch */ + MFF_ENA_ALM_FUL = 1<<9, /* Enable AlmostFull Sign */ + MFF_DIS_ALM_FUL = 1<<8, /* Disable AlmostFull Sign */ + MFF_ENA_PAUSE = 1<<7, /* Enable Pause Signaling */ + MFF_DIS_PAUSE = 1<<6, /* Disable Pause Signaling */ + MFF_ENA_FLUSH = 1<<5, /* Enable Frame Flushing */ + MFF_DIS_FLUSH = 1<<4, /* Disable Frame Flushing */ + MFF_ENA_TIST = 1<<3, /* Enable Time Stamp Gener */ + MFF_DIS_TIST = 1<<2, /* Disable Time Stamp Gener */ + MFF_CLR_INTIST = 1<<1, /* Clear IRQ No Time Stamp */ + MFF_CLR_INSTAT = 1<<0, /* Clear IRQ No Status */ +#define MFF_RX_CTRL_DEF MFF_ENA_TIM_PAT +}; + +/* TX_MFF_CTRL1 16 bit Transmit MAC FIFO Control Reg 1 */ +enum { + MFF_CLR_PERR = 1<<15, /* Clear Parity Error IRQ */ + /* Bit 14: reserved */ + MFF_ENA_PKT_REC = 1<<13, /* Enable Packet Recovery */ + MFF_DIS_PKT_REC = 1<<12, /* Disable Packet Recovery */ + + MFF_ENA_W4E = 1<<7, /* Enable Wait for Empty */ + MFF_DIS_W4E = 1<<6, /* Disable Wait for Empty */ + + MFF_ENA_LOOPB = 1<<3, /* Enable Loopback */ + MFF_DIS_LOOPB = 1<<2, /* Disable Loopback */ + MFF_CLR_MAC_RST = 1<<1, /* Clear XMAC Reset */ + MFF_SET_MAC_RST = 1<<0, /* Set XMAC Reset */ +}; + +#define MFF_TX_CTRL_DEF (MFF_ENA_PKT_REC | MFF_ENA_TIM_PAT | MFF_ENA_FLUSH) + +/* RX_MFF_TST2 8 bit Receive MAC FIFO Test Register 2 */ +/* TX_MFF_TST2 8 bit Transmit MAC FIFO Test Register 2 */ +enum { + MFF_WSP_T_ON = 1<<6, /* Tx: Write Shadow Ptr TestOn */ + MFF_WSP_T_OFF = 1<<5, /* Tx: Write Shadow Ptr TstOff */ + MFF_WSP_INC = 1<<4, /* Tx: Write Shadow Ptr Increment */ + MFF_PC_DEC = 1<<3, /* Packet Counter Decrement */ + MFF_PC_T_ON = 1<<2, /* Packet Counter Test On */ + MFF_PC_T_OFF = 1<<1, /* Packet Counter Test Off */ + MFF_PC_INC = 1<<0, /* Packet Counter Increment */ +}; + +/* RX_MFF_TST1 8 bit Receive MAC FIFO Test Register 1 */ +/* TX_MFF_TST1 8 bit Transmit MAC FIFO Test Register 1 */ +enum { + MFF_WP_T_ON = 1<<6, /* Write Pointer Test On */ + MFF_WP_T_OFF = 1<<5, /* Write Pointer Test Off */ + MFF_WP_INC = 1<<4, /* Write Pointer Increm */ + + MFF_RP_T_ON = 1<<2, /* Read Pointer Test On */ + MFF_RP_T_OFF = 1<<1, /* Read Pointer Test Off */ + MFF_RP_DEC = 1<<0, /* Read Pointer Decrement */ +}; + +/* RX_MFF_CTRL2 8 bit Receive MAC FIFO Control Reg 2 */ +/* TX_MFF_CTRL2 8 bit Transmit MAC FIFO Control Reg 2 */ +enum { + MFF_ENA_OP_MD = 1<<3, /* Enable Operation Mode */ + MFF_DIS_OP_MD = 1<<2, /* Disable Operation Mode */ + MFF_RST_CLR = 1<<1, /* Clear MAC FIFO Reset */ + MFF_RST_SET = 1<<0, /* Set MAC FIFO Reset */ +}; + + +/* Link LED Counter Registers (GENESIS only) */ + +/* RX_LED_CTRL 8 bit Receive LED Cnt Control Reg */ +/* TX_LED_CTRL 8 bit Transmit LED Cnt Control Reg */ +/* LNK_SYNC_CTRL 8 bit Link Sync Cnt Control Register */ +enum { + LED_START = 1<<2, /* Start Timer */ + LED_STOP = 1<<1, /* Stop Timer */ + LED_STATE = 1<<0, /* Rx/Tx: LED State, 1=LED on */ +}; + +/* RX_LED_TST 8 bit Receive LED Cnt Test Register */ +/* TX_LED_TST 8 bit Transmit LED Cnt Test Register */ +/* LNK_SYNC_TST 8 bit Link Sync Cnt Test Register */ +enum { + LED_T_ON = 1<<2, /* LED Counter Test mode On */ + LED_T_OFF = 1<<1, /* LED Counter Test mode Off */ + LED_T_STEP = 1<<0, /* LED Counter Step */ +}; + +/* LNK_LED_REG 8 bit Link LED Register */ +enum { + LED_BLK_ON = 1<<5, /* Link LED Blinking On */ + LED_BLK_OFF = 1<<4, /* Link LED Blinking Off */ + LED_SYNC_ON = 1<<3, /* Use Sync Wire to switch LED */ + LED_SYNC_OFF = 1<<2, /* Disable Sync Wire Input */ + LED_ON = 1<<1, /* switch LED on */ + LED_OFF = 1<<0, /* switch LED off */ +}; + +/* Receive GMAC FIFO (YUKON and Yukon-2) */ +enum { + RX_GMF_EA = 0x0c40,/* 32 bit Rx GMAC FIFO End Address */ + RX_GMF_AF_THR = 0x0c44,/* 32 bit Rx GMAC FIFO Almost Full Thresh. */ + RX_GMF_CTRL_T = 0x0c48,/* 32 bit Rx GMAC FIFO Control/Test */ + RX_GMF_FL_MSK = 0x0c4c,/* 32 bit Rx GMAC FIFO Flush Mask */ + RX_GMF_FL_THR = 0x0c50,/* 32 bit Rx GMAC FIFO Flush Threshold */ + RX_GMF_TR_THR = 0x0c54,/* 32 bit Rx Truncation Threshold (Yukon-2) */ + + RX_GMF_VLAN = 0x0c5c,/* 32 bit Rx VLAN Type Register (Yukon-2) */ + RX_GMF_WP = 0x0c60,/* 32 bit Rx GMAC FIFO Write Pointer */ + + RX_GMF_WLEV = 0x0c68,/* 32 bit Rx GMAC FIFO Write Level */ + + RX_GMF_RP = 0x0c70,/* 32 bit Rx GMAC FIFO Read Pointer */ + + RX_GMF_RLEV = 0x0c78,/* 32 bit Rx GMAC FIFO Read Level */ +}; + + +/* TXA_TEST 8 bit Tx Arbiter Test Register */ +enum { + TXA_INT_T_ON = 1<<5, /* Tx Arb Interval Timer Test On */ + TXA_INT_T_OFF = 1<<4, /* Tx Arb Interval Timer Test Off */ + TXA_INT_T_STEP = 1<<3, /* Tx Arb Interval Timer Step */ + TXA_LIM_T_ON = 1<<2, /* Tx Arb Limit Timer Test On */ + TXA_LIM_T_OFF = 1<<1, /* Tx Arb Limit Timer Test Off */ + TXA_LIM_T_STEP = 1<<0, /* Tx Arb Limit Timer Step */ +}; + +/* TXA_STAT 8 bit Tx Arbiter Status Register */ +enum { + TXA_PRIO_XS = 1<<0, /* sync queue has prio to send */ +}; + + +/* Q_BC 32 bit Current Byte Counter */ + +/* BMU Control Status Registers */ +/* B0_R1_CSR 32 bit BMU Ctrl/Stat Rx Queue 1 */ +/* B0_R2_CSR 32 bit BMU Ctrl/Stat Rx Queue 2 */ +/* B0_XA1_CSR 32 bit BMU Ctrl/Stat Sync Tx Queue 1 */ +/* B0_XS1_CSR 32 bit BMU Ctrl/Stat Async Tx Queue 1 */ +/* B0_XA2_CSR 32 bit BMU Ctrl/Stat Sync Tx Queue 2 */ +/* B0_XS2_CSR 32 bit BMU Ctrl/Stat Async Tx Queue 2 */ +/* Q_CSR 32 bit BMU Control/Status Register */ + +enum { + CSR_SV_IDLE = 1<<24, /* BMU SM Idle */ + + CSR_DESC_CLR = 1<<21, /* Clear Reset for Descr */ + CSR_DESC_SET = 1<<20, /* Set Reset for Descr */ + CSR_FIFO_CLR = 1<<19, /* Clear Reset for FIFO */ + CSR_FIFO_SET = 1<<18, /* Set Reset for FIFO */ + CSR_HPI_RUN = 1<<17, /* Release HPI SM */ + CSR_HPI_RST = 1<<16, /* Reset HPI SM to Idle */ + CSR_SV_RUN = 1<<15, /* Release Supervisor SM */ + CSR_SV_RST = 1<<14, /* Reset Supervisor SM */ + CSR_DREAD_RUN = 1<<13, /* Release Descr Read SM */ + CSR_DREAD_RST = 1<<12, /* Reset Descr Read SM */ + CSR_DWRITE_RUN = 1<<11, /* Release Descr Write SM */ + CSR_DWRITE_RST = 1<<10, /* Reset Descr Write SM */ + CSR_TRANS_RUN = 1<<9, /* Release Transfer SM */ + CSR_TRANS_RST = 1<<8, /* Reset Transfer SM */ + CSR_ENA_POL = 1<<7, /* Enable Descr Polling */ + CSR_DIS_POL = 1<<6, /* Disable Descr Polling */ + CSR_STOP = 1<<5, /* Stop Rx/Tx Queue */ + CSR_START = 1<<4, /* Start Rx/Tx Queue */ + CSR_IRQ_CL_P = 1<<3, /* (Rx) Clear Parity IRQ */ + CSR_IRQ_CL_B = 1<<2, /* Clear EOB IRQ */ + CSR_IRQ_CL_F = 1<<1, /* Clear EOF IRQ */ + CSR_IRQ_CL_C = 1<<0, /* Clear ERR IRQ */ +}; + +#define CSR_SET_RESET (CSR_DESC_SET | CSR_FIFO_SET | CSR_HPI_RST |\ + CSR_SV_RST | CSR_DREAD_RST | CSR_DWRITE_RST |\ + CSR_TRANS_RST) +#define CSR_CLR_RESET (CSR_DESC_CLR | CSR_FIFO_CLR | CSR_HPI_RUN |\ + CSR_SV_RUN | CSR_DREAD_RUN | CSR_DWRITE_RUN |\ + CSR_TRANS_RUN) + +/* Q_F 32 bit Flag Register */ +enum { + F_ALM_FULL = 1<<27, /* Rx FIFO: almost full */ + F_EMPTY = 1<<27, /* Tx FIFO: empty flag */ + F_FIFO_EOF = 1<<26, /* Tag (EOF Flag) bit in FIFO */ + F_WM_REACHED = 1<<25, /* Watermark reached */ + + F_FIFO_LEVEL = 0x1fL<<16, /* Bit 23..16: # of Qwords in FIFO */ + F_WATER_MARK = 0x0007ffL, /* Bit 10.. 0: Watermark */ +}; + +/* RAM Buffer Register Offsets, use RB_ADDR(Queue, Offs) to access */ +/* RB_START 32 bit RAM Buffer Start Address */ +/* RB_END 32 bit RAM Buffer End Address */ +/* RB_WP 32 bit RAM Buffer Write Pointer */ +/* RB_RP 32 bit RAM Buffer Read Pointer */ +/* RB_RX_UTPP 32 bit Rx Upper Threshold, Pause Pack */ +/* RB_RX_LTPP 32 bit Rx Lower Threshold, Pause Pack */ +/* RB_RX_UTHP 32 bit Rx Upper Threshold, High Prio */ +/* RB_RX_LTHP 32 bit Rx Lower Threshold, High Prio */ +/* RB_PC 32 bit RAM Buffer Packet Counter */ +/* RB_LEV 32 bit RAM Buffer Level Register */ + +#define RB_MSK 0x0007ffff /* Bit 18.. 0: RAM Buffer Pointer Bits */ +/* RB_TST2 8 bit RAM Buffer Test Register 2 */ +/* RB_TST1 8 bit RAM Buffer Test Register 1 */ + +/* RB_CTRL 8 bit RAM Buffer Control Register */ +enum { + RB_ENA_STFWD = 1<<5, /* Enable Store & Forward */ + RB_DIS_STFWD = 1<<4, /* Disable Store & Forward */ + RB_ENA_OP_MD = 1<<3, /* Enable Operation Mode */ + RB_DIS_OP_MD = 1<<2, /* Disable Operation Mode */ + RB_RST_CLR = 1<<1, /* Clear RAM Buf STM Reset */ + RB_RST_SET = 1<<0, /* Set RAM Buf STM Reset */ +}; + +/* Transmit MAC FIFO and Transmit LED Registers (GENESIS only), */ +enum { + TX_MFF_EA = 0x0d00,/* 32 bit Transmit MAC FIFO End Address */ + TX_MFF_WP = 0x0d04,/* 32 bit Transmit MAC FIFO WR Pointer */ + TX_MFF_WSP = 0x0d08,/* 32 bit Transmit MAC FIFO WR Shadow Ptr */ + TX_MFF_RP = 0x0d0c,/* 32 bit Transmit MAC FIFO RD Pointer */ + TX_MFF_PC = 0x0d10,/* 32 bit Transmit MAC FIFO Packet Cnt */ + TX_MFF_LEV = 0x0d14,/* 32 bit Transmit MAC FIFO Level */ + TX_MFF_CTRL1 = 0x0d18,/* 16 bit Transmit MAC FIFO Ctrl Reg 1 */ + TX_MFF_WAF = 0x0d1a,/* 8 bit Transmit MAC Wait after flush */ + + TX_MFF_CTRL2 = 0x0d1c,/* 8 bit Transmit MAC FIFO Ctrl Reg 2 */ + TX_MFF_TST1 = 0x0d1d,/* 8 bit Transmit MAC FIFO Test Reg 1 */ + TX_MFF_TST2 = 0x0d1e,/* 8 bit Transmit MAC FIFO Test Reg 2 */ + + TX_LED_INI = 0x0d20,/* 32 bit Transmit LED Cnt Init Value */ + TX_LED_VAL = 0x0d24,/* 32 bit Transmit LED Cnt Current Val */ + TX_LED_CTRL = 0x0d28,/* 8 bit Transmit LED Cnt Control Reg */ + TX_LED_TST = 0x0d29,/* 8 bit Transmit LED Cnt Test Reg */ +}; + +/* Counter and Timer constants, for a host clock of 62.5 MHz */ +#define SK_XMIT_DUR 0x002faf08UL /* 50 ms */ +#define SK_BLK_DUR 0x01dcd650UL /* 500 ms */ + +#define SK_DPOLL_DEF 0x00ee6b28UL /* 250 ms at 62.5 MHz */ + +#define SK_DPOLL_MAX 0x00ffffffUL /* 268 ms at 62.5 MHz */ + /* 215 ms at 78.12 MHz */ + +#define SK_FACT_62 100 /* is given in percent */ +#define SK_FACT_53 85 /* on GENESIS: 53.12 MHz */ +#define SK_FACT_78 125 /* on YUKON: 78.12 MHz */ + + +/* Transmit GMAC FIFO (YUKON only) */ +enum { + TX_GMF_EA = 0x0d40,/* 32 bit Tx GMAC FIFO End Address */ + TX_GMF_AE_THR = 0x0d44,/* 32 bit Tx GMAC FIFO Almost Empty Thresh.*/ + TX_GMF_CTRL_T = 0x0d48,/* 32 bit Tx GMAC FIFO Control/Test */ + + TX_GMF_WP = 0x0d60,/* 32 bit Tx GMAC FIFO Write Pointer */ + TX_GMF_WSP = 0x0d64,/* 32 bit Tx GMAC FIFO Write Shadow Ptr. */ + TX_GMF_WLEV = 0x0d68,/* 32 bit Tx GMAC FIFO Write Level */ + + TX_GMF_RP = 0x0d70,/* 32 bit Tx GMAC FIFO Read Pointer */ + TX_GMF_RSTP = 0x0d74,/* 32 bit Tx GMAC FIFO Restart Pointer */ + TX_GMF_RLEV = 0x0d78,/* 32 bit Tx GMAC FIFO Read Level */ + + /* Descriptor Poll Timer Registers */ + B28_DPT_INI = 0x0e00,/* 24 bit Descriptor Poll Timer Init Val */ + B28_DPT_VAL = 0x0e04,/* 24 bit Descriptor Poll Timer Curr Val */ + B28_DPT_CTRL = 0x0e08,/* 8 bit Descriptor Poll Timer Ctrl Reg */ + + B28_DPT_TST = 0x0e0a,/* 8 bit Descriptor Poll Timer Test Reg */ + + /* Time Stamp Timer Registers (YUKON only) */ + GMAC_TI_ST_VAL = 0x0e14,/* 32 bit Time Stamp Timer Curr Val */ + GMAC_TI_ST_CTRL = 0x0e18,/* 8 bit Time Stamp Timer Ctrl Reg */ + GMAC_TI_ST_TST = 0x0e1a,/* 8 bit Time Stamp Timer Test Reg */ +}; + +/* Status BMU Registers (Yukon-2 only)*/ +enum { + STAT_CTRL = 0x0e80,/* 32 bit Status BMU Control Reg */ + STAT_LAST_IDX = 0x0e84,/* 16 bit Status BMU Last Index */ + /* 0x0e85 - 0x0e86: reserved */ + STAT_LIST_ADDR_LO = 0x0e88,/* 32 bit Status List Start Addr (low) */ + STAT_LIST_ADDR_HI = 0x0e8c,/* 32 bit Status List Start Addr (high) */ + STAT_TXA1_RIDX = 0x0e90,/* 16 bit Status TxA1 Report Index Reg */ + STAT_TXS1_RIDX = 0x0e92,/* 16 bit Status TxS1 Report Index Reg */ + STAT_TXA2_RIDX = 0x0e94,/* 16 bit Status TxA2 Report Index Reg */ + STAT_TXS2_RIDX = 0x0e96,/* 16 bit Status TxS2 Report Index Reg */ + STAT_TX_IDX_TH = 0x0e98,/* 16 bit Status Tx Index Threshold Reg */ + STAT_PUT_IDX = 0x0e9c,/* 16 bit Status Put Index Reg */ + +/* FIFO Control/Status Registers (Yukon-2 only)*/ + STAT_FIFO_WP = 0x0ea0,/* 8 bit Status FIFO Write Pointer Reg */ + STAT_FIFO_RP = 0x0ea4,/* 8 bit Status FIFO Read Pointer Reg */ + STAT_FIFO_RSP = 0x0ea6,/* 8 bit Status FIFO Read Shadow Ptr */ + STAT_FIFO_LEVEL = 0x0ea8,/* 8 bit Status FIFO Level Reg */ + STAT_FIFO_SHLVL = 0x0eaa,/* 8 bit Status FIFO Shadow Level Reg */ + STAT_FIFO_WM = 0x0eac,/* 8 bit Status FIFO Watermark Reg */ + STAT_FIFO_ISR_WM = 0x0ead,/* 8 bit Status FIFO ISR Watermark Reg */ + +/* Level and ISR Timer Registers (Yukon-2 only)*/ + STAT_LEV_TIMER_INI = 0x0eb0,/* 32 bit Level Timer Init. Value Reg */ + STAT_LEV_TIMER_CNT = 0x0eb4,/* 32 bit Level Timer Counter Reg */ + STAT_LEV_TIMER_CTRL = 0x0eb8,/* 8 bit Level Timer Control Reg */ + STAT_LEV_TIMER_TEST = 0x0eb9,/* 8 bit Level Timer Test Reg */ + STAT_TX_TIMER_INI = 0x0ec0,/* 32 bit Tx Timer Init. Value Reg */ + STAT_TX_TIMER_CNT = 0x0ec4,/* 32 bit Tx Timer Counter Reg */ + STAT_TX_TIMER_CTRL = 0x0ec8,/* 8 bit Tx Timer Control Reg */ + STAT_TX_TIMER_TEST = 0x0ec9,/* 8 bit Tx Timer Test Reg */ + STAT_ISR_TIMER_INI = 0x0ed0,/* 32 bit ISR Timer Init. Value Reg */ + STAT_ISR_TIMER_CNT = 0x0ed4,/* 32 bit ISR Timer Counter Reg */ + STAT_ISR_TIMER_CTRL = 0x0ed8,/* 8 bit ISR Timer Control Reg */ + STAT_ISR_TIMER_TEST = 0x0ed9,/* 8 bit ISR Timer Test Reg */ + + ST_LAST_IDX_MASK = 0x007f,/* Last Index Mask */ + ST_TXRP_IDX_MASK = 0x0fff,/* Tx Report Index Mask */ + ST_TXTH_IDX_MASK = 0x0fff,/* Tx Threshold Index Mask */ + ST_WM_IDX_MASK = 0x3f,/* FIFO Watermark Index Mask */ +}; + +enum { + LINKLED_OFF = 0x01, + LINKLED_ON = 0x02, + LINKLED_LINKSYNC_OFF = 0x04, + LINKLED_LINKSYNC_ON = 0x08, + LINKLED_BLINK_OFF = 0x10, + LINKLED_BLINK_ON = 0x20, +}; + +/* GMAC and GPHY Control Registers (YUKON only) */ +enum { + GMAC_CTRL = 0x0f00,/* 32 bit GMAC Control Reg */ + GPHY_CTRL = 0x0f04,/* 32 bit GPHY Control Reg */ + GMAC_IRQ_SRC = 0x0f08,/* 8 bit GMAC Interrupt Source Reg */ + GMAC_IRQ_MSK = 0x0f0c,/* 8 bit GMAC Interrupt Mask Reg */ + GMAC_LINK_CTRL = 0x0f10,/* 16 bit Link Control Reg */ + +/* Wake-up Frame Pattern Match Control Registers (YUKON only) */ + + WOL_REG_OFFS = 0x20,/* HW-Bug: Address is + 0x20 against spec. */ + + WOL_CTRL_STAT = 0x0f20,/* 16 bit WOL Control/Status Reg */ + WOL_MATCH_CTL = 0x0f22,/* 8 bit WOL Match Control Reg */ + WOL_MATCH_RES = 0x0f23,/* 8 bit WOL Match Result Reg */ + WOL_MAC_ADDR = 0x0f24,/* 32 bit WOL MAC Address */ + WOL_PATT_PME = 0x0f2a,/* 8 bit WOL PME Match Enable (Yukon-2) */ + WOL_PATT_ASFM = 0x0f2b,/* 8 bit WOL ASF Match Enable (Yukon-2) */ + WOL_PATT_RPTR = 0x0f2c,/* 8 bit WOL Pattern Read Pointer */ + +/* WOL Pattern Length Registers (YUKON only) */ + + WOL_PATT_LEN_LO = 0x0f30,/* 32 bit WOL Pattern Length 3..0 */ + WOL_PATT_LEN_HI = 0x0f34,/* 24 bit WOL Pattern Length 6..4 */ + +/* WOL Pattern Counter Registers (YUKON only) */ + + WOL_PATT_CNT_0 = 0x0f38,/* 32 bit WOL Pattern Counter 3..0 */ + WOL_PATT_CNT_4 = 0x0f3c,/* 24 bit WOL Pattern Counter 6..4 */ +}; + +enum { + WOL_PATT_RAM_1 = 0x1000,/* WOL Pattern RAM Link 1 */ + WOL_PATT_RAM_2 = 0x1400,/* WOL Pattern RAM Link 2 */ +}; + +enum { + BASE_XMAC_1 = 0x2000,/* XMAC 1 registers */ + BASE_GMAC_1 = 0x2800,/* GMAC 1 registers */ + BASE_XMAC_2 = 0x3000,/* XMAC 2 registers */ + BASE_GMAC_2 = 0x3800,/* GMAC 2 registers */ +}; + +/* + * Receive Frame Status Encoding + */ +enum { + XMR_FS_LEN = 0x3fff<<18, /* Bit 31..18: Rx Frame Length */ + XMR_FS_2L_VLAN = 1<<17, /* Bit 17: tagged wh 2Lev VLAN ID*/ + XMR_FS_1_VLAN = 1<<16, /* Bit 16: tagged wh 1ev VLAN ID*/ + XMR_FS_BC = 1<<15, /* Bit 15: Broadcast Frame */ + XMR_FS_MC = 1<<14, /* Bit 14: Multicast Frame */ + XMR_FS_UC = 1<<13, /* Bit 13: Unicast Frame */ + + XMR_FS_BURST = 1<<11, /* Bit 11: Burst Mode */ + XMR_FS_CEX_ERR = 1<<10, /* Bit 10: Carrier Ext. Error */ + XMR_FS_802_3 = 1<<9, /* Bit 9: 802.3 Frame */ + XMR_FS_COL_ERR = 1<<8, /* Bit 8: Collision Error */ + XMR_FS_CAR_ERR = 1<<7, /* Bit 7: Carrier Event Error */ + XMR_FS_LEN_ERR = 1<<6, /* Bit 6: In-Range Length Error */ + XMR_FS_FRA_ERR = 1<<5, /* Bit 5: Framing Error */ + XMR_FS_RUNT = 1<<4, /* Bit 4: Runt Frame */ + XMR_FS_LNG_ERR = 1<<3, /* Bit 3: Giant (Jumbo) Frame */ + XMR_FS_FCS_ERR = 1<<2, /* Bit 2: Frame Check Sequ Err */ + XMR_FS_ERR = 1<<1, /* Bit 1: Frame Error */ + XMR_FS_MCTRL = 1<<0, /* Bit 0: MAC Control Packet */ + +/* + * XMR_FS_ERR will be set if + * XMR_FS_FCS_ERR, XMR_FS_LNG_ERR, XMR_FS_RUNT, + * XMR_FS_FRA_ERR, XMR_FS_LEN_ERR, or XMR_FS_CEX_ERR + * is set. XMR_FS_LNG_ERR and XMR_FS_LEN_ERR will issue + * XMR_FS_ERR unless the corresponding bit in the Receive Command + * Register is set. + */ +}; + +/* +,* XMAC-PHY Registers, indirect addressed over the XMAC + */ +enum { + PHY_XMAC_CTRL = 0x00,/* 16 bit r/w PHY Control Register */ + PHY_XMAC_STAT = 0x01,/* 16 bit r/w PHY Status Register */ + PHY_XMAC_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */ + PHY_XMAC_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */ + PHY_XMAC_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */ + PHY_XMAC_AUNE_LP = 0x05,/* 16 bit r/o Link Partner Abi Reg */ + PHY_XMAC_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */ + PHY_XMAC_NEPG = 0x07,/* 16 bit r/w Next Page Register */ + PHY_XMAC_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner */ + + PHY_XMAC_EXT_STAT = 0x0f,/* 16 bit r/o Ext Status Register */ + PHY_XMAC_RES_ABI = 0x10,/* 16 bit r/o PHY Resolved Ability */ +}; +/* + * Broadcom-PHY Registers, indirect addressed over XMAC + */ +enum { + PHY_BCOM_CTRL = 0x00,/* 16 bit r/w PHY Control Register */ + PHY_BCOM_STAT = 0x01,/* 16 bit r/o PHY Status Register */ + PHY_BCOM_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */ + PHY_BCOM_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */ + PHY_BCOM_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */ + PHY_BCOM_AUNE_LP = 0x05,/* 16 bit r/o Link Part Ability Reg */ + PHY_BCOM_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */ + PHY_BCOM_NEPG = 0x07,/* 16 bit r/w Next Page Register */ + PHY_BCOM_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner */ + /* Broadcom-specific registers */ + PHY_BCOM_1000T_CTRL = 0x09,/* 16 bit r/w 1000Base-T Control Reg */ + PHY_BCOM_1000T_STAT = 0x0a,/* 16 bit r/o 1000Base-T Status Reg */ + PHY_BCOM_EXT_STAT = 0x0f,/* 16 bit r/o Extended Status Reg */ + PHY_BCOM_P_EXT_CTRL = 0x10,/* 16 bit r/w PHY Extended Ctrl Reg */ + PHY_BCOM_P_EXT_STAT = 0x11,/* 16 bit r/o PHY Extended Stat Reg */ + PHY_BCOM_RE_CTR = 0x12,/* 16 bit r/w Receive Error Counter */ + PHY_BCOM_FC_CTR = 0x13,/* 16 bit r/w False Carrier Sense Cnt */ + PHY_BCOM_RNO_CTR = 0x14,/* 16 bit r/w Receiver NOT_OK Cnt */ + + PHY_BCOM_AUX_CTRL = 0x18,/* 16 bit r/w Auxiliary Control Reg */ + PHY_BCOM_AUX_STAT = 0x19,/* 16 bit r/o Auxiliary Stat Summary */ + PHY_BCOM_INT_STAT = 0x1a,/* 16 bit r/o Interrupt Status Reg */ + PHY_BCOM_INT_MASK = 0x1b,/* 16 bit r/w Interrupt Mask Reg */ +}; + +/* + * Marvel-PHY Registers, indirect addressed over GMAC + */ +enum { + PHY_MARV_CTRL = 0x00,/* 16 bit r/w PHY Control Register */ + PHY_MARV_STAT = 0x01,/* 16 bit r/o PHY Status Register */ + PHY_MARV_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */ + PHY_MARV_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */ + PHY_MARV_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */ + PHY_MARV_AUNE_LP = 0x05,/* 16 bit r/o Link Part Ability Reg */ + PHY_MARV_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */ + PHY_MARV_NEPG = 0x07,/* 16 bit r/w Next Page Register */ + PHY_MARV_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner */ + /* Marvel-specific registers */ + PHY_MARV_1000T_CTRL = 0x09,/* 16 bit r/w 1000Base-T Control Reg */ + PHY_MARV_1000T_STAT = 0x0a,/* 16 bit r/o 1000Base-T Status Reg */ + PHY_MARV_EXT_STAT = 0x0f,/* 16 bit r/o Extended Status Reg */ + PHY_MARV_PHY_CTRL = 0x10,/* 16 bit r/w PHY Specific Ctrl Reg */ + PHY_MARV_PHY_STAT = 0x11,/* 16 bit r/o PHY Specific Stat Reg */ + PHY_MARV_INT_MASK = 0x12,/* 16 bit r/w Interrupt Mask Reg */ + PHY_MARV_INT_STAT = 0x13,/* 16 bit r/o Interrupt Status Reg */ + PHY_MARV_EXT_CTRL = 0x14,/* 16 bit r/w Ext. PHY Specific Ctrl */ + PHY_MARV_RXE_CNT = 0x15,/* 16 bit r/w Receive Error Counter */ + PHY_MARV_EXT_ADR = 0x16,/* 16 bit r/w Ext. Ad. for Cable Diag. */ + PHY_MARV_PORT_IRQ = 0x17,/* 16 bit r/o Port 0 IRQ (88E1111 only) */ + PHY_MARV_LED_CTRL = 0x18,/* 16 bit r/w LED Control Reg */ + PHY_MARV_LED_OVER = 0x19,/* 16 bit r/w Manual LED Override Reg */ + PHY_MARV_EXT_CTRL_2 = 0x1a,/* 16 bit r/w Ext. PHY Specific Ctrl 2 */ + PHY_MARV_EXT_P_STAT = 0x1b,/* 16 bit r/w Ext. PHY Spec. Stat Reg */ + PHY_MARV_CABLE_DIAG = 0x1c,/* 16 bit r/o Cable Diagnostic Reg */ + PHY_MARV_PAGE_ADDR = 0x1d,/* 16 bit r/w Extended Page Address Reg */ + PHY_MARV_PAGE_DATA = 0x1e,/* 16 bit r/w Extended Page Data Reg */ + +/* for 10/100 Fast Ethernet PHY (88E3082 only) */ + PHY_MARV_FE_LED_PAR = 0x16,/* 16 bit r/w LED Parallel Select Reg. */ + PHY_MARV_FE_LED_SER = 0x17,/* 16 bit r/w LED Stream Select S. LED */ + PHY_MARV_FE_VCT_TX = 0x1a,/* 16 bit r/w VCT Reg. for TXP/N Pins */ + PHY_MARV_FE_VCT_RX = 0x1b,/* 16 bit r/o VCT Reg. for RXP/N Pins */ + PHY_MARV_FE_SPEC_2 = 0x1c,/* 16 bit r/w Specific Control Reg. 2 */ +}; + +/* Level One-PHY Registers, indirect addressed over XMAC */ +enum { + PHY_LONE_CTRL = 0x00,/* 16 bit r/w PHY Control Register */ + PHY_LONE_STAT = 0x01,/* 16 bit r/o PHY Status Register */ + PHY_LONE_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */ + PHY_LONE_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */ + PHY_LONE_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */ + PHY_LONE_AUNE_LP = 0x05,/* 16 bit r/o Link Part Ability Reg */ + PHY_LONE_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */ + PHY_LONE_NEPG = 0x07,/* 16 bit r/w Next Page Register */ + PHY_LONE_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner */ + /* Level One-specific registers */ + PHY_LONE_1000T_CTRL = 0x09,/* 16 bit r/w 1000Base-T Control Reg */ + PHY_LONE_1000T_STAT = 0x0a,/* 16 bit r/o 1000Base-T Status Reg */ + PHY_LONE_EXT_STAT = 0x0f,/* 16 bit r/o Extended Status Reg */ + PHY_LONE_PORT_CFG = 0x10,/* 16 bit r/w Port Configuration Reg*/ + PHY_LONE_Q_STAT = 0x11,/* 16 bit r/o Quick Status Reg */ + PHY_LONE_INT_ENAB = 0x12,/* 16 bit r/w Interrupt Enable Reg */ + PHY_LONE_INT_STAT = 0x13,/* 16 bit r/o Interrupt Status Reg */ + PHY_LONE_LED_CFG = 0x14,/* 16 bit r/w LED Configuration Reg */ + PHY_LONE_PORT_CTRL = 0x15,/* 16 bit r/w Port Control Reg */ + PHY_LONE_CIM = 0x16,/* 16 bit r/o CIM Reg */ +}; + +/* National-PHY Registers, indirect addressed over XMAC */ +enum { + PHY_NAT_CTRL = 0x00,/* 16 bit r/w PHY Control Register */ + PHY_NAT_STAT = 0x01,/* 16 bit r/w PHY Status Register */ + PHY_NAT_ID0 = 0x02,/* 16 bit r/o PHY ID0 Register */ + PHY_NAT_ID1 = 0x03,/* 16 bit r/o PHY ID1 Register */ + PHY_NAT_AUNE_ADV = 0x04,/* 16 bit r/w Auto-Neg. Advertisement */ + PHY_NAT_AUNE_LP = 0x05,/* 16 bit r/o Link Partner Ability Reg */ + PHY_NAT_AUNE_EXP = 0x06,/* 16 bit r/o Auto-Neg. Expansion Reg */ + PHY_NAT_NEPG = 0x07,/* 16 bit r/w Next Page Register */ + PHY_NAT_NEPG_LP = 0x08,/* 16 bit r/o Next Page Link Partner Reg */ + /* National-specific registers */ + PHY_NAT_1000T_CTRL = 0x09,/* 16 bit r/w 1000Base-T Control Reg */ + PHY_NAT_1000T_STAT = 0x0a,/* 16 bit r/o 1000Base-T Status Reg */ + PHY_NAT_EXT_STAT = 0x0f,/* 16 bit r/o Extended Status Register */ + PHY_NAT_EXT_CTRL1 = 0x10,/* 16 bit r/o Extended Control Reg1 */ + PHY_NAT_Q_STAT1 = 0x11,/* 16 bit r/o Quick Status Reg1 */ + PHY_NAT_10B_OP = 0x12,/* 16 bit r/o 10Base-T Operations Reg */ + PHY_NAT_EXT_CTRL2 = 0x13,/* 16 bit r/o Extended Control Reg1 */ + PHY_NAT_Q_STAT2 = 0x14,/* 16 bit r/o Quick Status Reg2 */ + + PHY_NAT_PHY_ADDR = 0x19,/* 16 bit r/o PHY Address Register */ +}; + +enum { + PHY_CT_RESET = 1<<15, /* Bit 15: (sc) clear all PHY related regs */ + PHY_CT_LOOP = 1<<14, /* Bit 14: enable Loopback over PHY */ + PHY_CT_SPS_LSB = 1<<13, /* Bit 13: Speed select, lower bit */ + PHY_CT_ANE = 1<<12, /* Bit 12: Auto-Negotiation Enabled */ + PHY_CT_PDOWN = 1<<11, /* Bit 11: Power Down Mode */ + PHY_CT_ISOL = 1<<10, /* Bit 10: Isolate Mode */ + PHY_CT_RE_CFG = 1<<9, /* Bit 9: (sc) Restart Auto-Negotiation */ + PHY_CT_DUP_MD = 1<<8, /* Bit 8: Duplex Mode */ + PHY_CT_COL_TST = 1<<7, /* Bit 7: Collision Test enabled */ + PHY_CT_SPS_MSB = 1<<6, /* Bit 6: Speed select, upper bit */ +}; + +enum { + PHY_CT_SP1000 = PHY_CT_SPS_MSB, /* enable speed of 1000 Mbps */ + PHY_CT_SP100 = PHY_CT_SPS_LSB, /* enable speed of 100 Mbps */ + PHY_CT_SP10 = 0, /* enable speed of 10 Mbps */ +}; + +enum { + PHY_ST_EXT_ST = 1<<8, /* Bit 8: Extended Status Present */ + + PHY_ST_PRE_SUP = 1<<6, /* Bit 6: Preamble Suppression */ + PHY_ST_AN_OVER = 1<<5, /* Bit 5: Auto-Negotiation Over */ + PHY_ST_REM_FLT = 1<<4, /* Bit 4: Remote Fault Condition Occured */ + PHY_ST_AN_CAP = 1<<3, /* Bit 3: Auto-Negotiation Capability */ + PHY_ST_LSYNC = 1<<2, /* Bit 2: Link Synchronized */ + PHY_ST_JAB_DET = 1<<1, /* Bit 1: Jabber Detected */ + PHY_ST_EXT_REG = 1<<0, /* Bit 0: Extended Register available */ +}; + +enum { + PHY_I1_OUI_MSK = 0x3f<<10, /* Bit 15..10: Organization Unique ID */ + PHY_I1_MOD_NUM = 0x3f<<4, /* Bit 9.. 4: Model Number */ + PHY_I1_REV_MSK = 0xf, /* Bit 3.. 0: Revision Number */ +}; + +/* different Broadcom PHY Ids */ +enum { + PHY_BCOM_ID1_A1 = 0x6041, + PHY_BCOM_ID1_B2 = 0x6043, + PHY_BCOM_ID1_C0 = 0x6044, + PHY_BCOM_ID1_C5 = 0x6047, +}; + +/* different Marvell PHY Ids */ +enum { + PHY_MARV_ID0_VAL= 0x0141, /* Marvell Unique Identifier */ + PHY_MARV_ID1_B0 = 0x0C23, /* Yukon (PHY 88E1011) */ + PHY_MARV_ID1_B2 = 0x0C25, /* Yukon-Plus (PHY 88E1011) */ + PHY_MARV_ID1_C2 = 0x0CC2, /* Yukon-EC (PHY 88E1111) */ + PHY_MARV_ID1_Y2 = 0x0C91, /* Yukon-2 (PHY 88E1112) */ +}; + +enum { + PHY_AN_NXT_PG = 1<<15, /* Bit 15: Request Next Page */ + PHY_X_AN_ACK = 1<<14, /* Bit 14: (ro) Acknowledge Received */ + PHY_X_AN_RFB = 3<<12,/* Bit 13..12: Remote Fault Bits */ + + PHY_X_AN_PAUSE = 3<<7,/* Bit 8.. 7: Pause Bits */ + PHY_X_AN_HD = 1<<6, /* Bit 6: Half Duplex */ + PHY_X_AN_FD = 1<<5, /* Bit 5: Full Duplex */ +}; + +enum { + PHY_B_AN_RF = 1<<13, /* Bit 13: Remote Fault */ + + PHY_B_AN_ASP = 1<<11, /* Bit 11: Asymmetric Pause */ + PHY_B_AN_PC = 1<<10, /* Bit 10: Pause Capable */ + PHY_B_AN_SEL = 0x1f, /* Bit 4..0: Selector Field, 00001=Ethernet*/ +}; + +enum { + PHY_L_AN_RF = 1<<13, /* Bit 13: Remote Fault */ + /* Bit 12: reserved */ + PHY_L_AN_ASP = 1<<11, /* Bit 11: Asymmetric Pause */ + PHY_L_AN_PC = 1<<10, /* Bit 10: Pause Capable */ + + PHY_L_AN_SEL = 0x1f, /* Bit 4..0: Selector Field, 00001=Ethernet*/ +}; + +/* PHY_NAT_AUNE_ADV 16 bit r/w Auto-Negotiation Advertisement */ +/* PHY_NAT_AUNE_LP 16 bit r/o Link Partner Ability Reg *****/ +/* PHY_AN_NXT_PG (see XMAC) Bit 15: Request Next Page */ +enum { + PHY_N_AN_RF = 1<<13, /* Bit 13: Remote Fault */ + + PHY_N_AN_100F = 1<<11, /* Bit 11: 100Base-T2 FD Support */ + PHY_N_AN_100H = 1<<10, /* Bit 10: 100Base-T2 HD Support */ + + PHY_N_AN_SEL = 0x1f, /* Bit 4..0: Selector Field, 00001=Ethernet*/ +}; + +/* field type definition for PHY_x_AN_SEL */ +enum { + PHY_SEL_TYPE = 1, /* 00001 = Ethernet */ +}; + +enum { + PHY_ANE_LP_NP = 1<<3, /* Bit 3: Link Partner can Next Page */ + PHY_ANE_LOC_NP = 1<<2, /* Bit 2: Local PHY can Next Page */ + PHY_ANE_RX_PG = 1<<1, /* Bit 1: Page Received */ +}; + +enum { + PHY_ANE_PAR_DF = 1<<4, /* Bit 4: Parallel Detection Fault */ + + PHY_ANE_LP_CAP = 1<<0, /* Bit 0: Link Partner Auto-Neg. Cap. */ +}; + +enum { + PHY_NP_MORE = 1<<15, /* Bit 15: More, Next Pages to follow */ + PHY_NP_ACK1 = 1<<14, /* Bit 14: (ro) Ack1, for receiving a message */ + PHY_NP_MSG_VAL = 1<<13, /* Bit 13: Message Page valid */ + PHY_NP_ACK2 = 1<<12, /* Bit 12: Ack2, comply with msg content */ + PHY_NP_TOG = 1<<11, /* Bit 11: Toggle Bit, ensure sync */ + PHY_NP_MSG = 0x07ff, /* Bit 10..0: Message from/to Link Partner */ +}; + +enum { + PHY_X_EX_FD = 1<<15, /* Bit 15: Device Supports Full Duplex */ + PHY_X_EX_HD = 1<<14, /* Bit 14: Device Supports Half Duplex */ +}; + +enum { + PHY_X_RS_PAUSE = 3<<7,/* Bit 8..7: selected Pause Mode */ + PHY_X_RS_HD = 1<<6, /* Bit 6: Half Duplex Mode selected */ + PHY_X_RS_FD = 1<<5, /* Bit 5: Full Duplex Mode selected */ + PHY_X_RS_ABLMIS = 1<<4, /* Bit 4: duplex or pause cap mismatch */ + PHY_X_RS_PAUMIS = 1<<3, /* Bit 3: pause capability mismatch */ +}; + +/** Remote Fault Bits (PHY_X_AN_RFB) encoding */ +enum { + X_RFB_OK = 0<<12,/* Bit 13..12 No errors, Link OK */ + X_RFB_LF = 1<<12, /* Bit 13..12 Link Failure */ + X_RFB_OFF = 2<<12,/* Bit 13..12 Offline */ + X_RFB_AN_ERR = 3<<12,/* Bit 13..12 Auto-Negotiation Error */ +}; + +/* Pause Bits (PHY_X_AN_PAUSE and PHY_X_RS_PAUSE) encoding */ +enum { + PHY_X_P_NO_PAUSE = 0<<7,/* Bit 8..7: no Pause Mode */ + PHY_X_P_SYM_MD = 1<<7, /* Bit 8..7: symmetric Pause Mode */ + PHY_X_P_ASYM_MD = 2<<7,/* Bit 8..7: asymmetric Pause Mode */ + PHY_X_P_BOTH_MD = 3<<7,/* Bit 8..7: both Pause Mode */ +}; + + +/* Broadcom-Specific */ +/***** PHY_BCOM_1000T_CTRL 16 bit r/w 1000Base-T Control Reg *****/ +enum { + PHY_B_1000C_TEST = 7<<13,/* Bit 15..13: Test Modes */ + PHY_B_1000C_MSE = 1<<12, /* Bit 12: Master/Slave Enable */ + PHY_B_1000C_MSC = 1<<11, /* Bit 11: M/S Configuration */ + PHY_B_1000C_RD = 1<<10, /* Bit 10: Repeater/DTE */ + PHY_B_1000C_AFD = 1<<9, /* Bit 9: Advertise Full Duplex */ + PHY_B_1000C_AHD = 1<<8, /* Bit 8: Advertise Half Duplex */ +}; + +/***** PHY_BCOM_1000T_STAT 16 bit r/o 1000Base-T Status Reg *****/ +/***** PHY_MARV_1000T_STAT 16 bit r/o 1000Base-T Status Reg *****/ +enum { + PHY_B_1000S_MSF = 1<<15, /* Bit 15: Master/Slave Fault */ + PHY_B_1000S_MSR = 1<<14, /* Bit 14: Master/Slave Result */ + PHY_B_1000S_LRS = 1<<13, /* Bit 13: Local Receiver Status */ + PHY_B_1000S_RRS = 1<<12, /* Bit 12: Remote Receiver Status */ + PHY_B_1000S_LP_FD = 1<<11, /* Bit 11: Link Partner can FD */ + PHY_B_1000S_LP_HD = 1<<10, /* Bit 10: Link Partner can HD */ + /* Bit 9..8: reserved */ + PHY_B_1000S_IEC = 0xff, /* Bit 7..0: Idle Error Count */ +}; + +/***** PHY_BCOM_EXT_STAT 16 bit r/o Extended Status Register *****/ +enum { + PHY_B_ES_X_FD_CAP = 1<<15, /* Bit 15: 1000Base-X FD capable */ + PHY_B_ES_X_HD_CAP = 1<<14, /* Bit 14: 1000Base-X HD capable */ + PHY_B_ES_T_FD_CAP = 1<<13, /* Bit 13: 1000Base-T FD capable */ + PHY_B_ES_T_HD_CAP = 1<<12, /* Bit 12: 1000Base-T HD capable */ +}; + +/***** PHY_BCOM_P_EXT_CTRL 16 bit r/w PHY Extended Control Reg *****/ +enum { + PHY_B_PEC_MAC_PHY = 1<<15, /* Bit 15: 10BIT/GMI-Interface */ + PHY_B_PEC_DIS_CROSS = 1<<14, /* Bit 14: Disable MDI Crossover */ + PHY_B_PEC_TX_DIS = 1<<13, /* Bit 13: Tx output Disabled */ + PHY_B_PEC_INT_DIS = 1<<12, /* Bit 12: Interrupts Disabled */ + PHY_B_PEC_F_INT = 1<<11, /* Bit 11: Force Interrupt */ + PHY_B_PEC_BY_45 = 1<<10, /* Bit 10: Bypass 4B5B-Decoder */ + PHY_B_PEC_BY_SCR = 1<<9, /* Bit 9: Bypass Scrambler */ + PHY_B_PEC_BY_MLT3 = 1<<8, /* Bit 8: Bypass MLT3 Encoder */ + PHY_B_PEC_BY_RXA = 1<<7, /* Bit 7: Bypass Rx Alignm. */ + PHY_B_PEC_RES_SCR = 1<<6, /* Bit 6: Reset Scrambler */ + PHY_B_PEC_EN_LTR = 1<<5, /* Bit 5: Ena LED Traffic Mode */ + PHY_B_PEC_LED_ON = 1<<4, /* Bit 4: Force LED's on */ + PHY_B_PEC_LED_OFF = 1<<3, /* Bit 3: Force LED's off */ + PHY_B_PEC_EX_IPG = 1<<2, /* Bit 2: Extend Tx IPG Mode */ + PHY_B_PEC_3_LED = 1<<1, /* Bit 1: Three Link LED mode */ + PHY_B_PEC_HIGH_LA = 1<<0, /* Bit 0: GMII FIFO Elasticy */ +}; + +/***** PHY_BCOM_P_EXT_STAT 16 bit r/o PHY Extended Status Reg *****/ +enum { + PHY_B_PES_CROSS_STAT = 1<<13, /* Bit 13: MDI Crossover Status */ + PHY_B_PES_INT_STAT = 1<<12, /* Bit 12: Interrupt Status */ + PHY_B_PES_RRS = 1<<11, /* Bit 11: Remote Receiver Stat. */ + PHY_B_PES_LRS = 1<<10, /* Bit 10: Local Receiver Stat. */ + PHY_B_PES_LOCKED = 1<<9, /* Bit 9: Locked */ + PHY_B_PES_LS = 1<<8, /* Bit 8: Link Status */ + PHY_B_PES_RF = 1<<7, /* Bit 7: Remote Fault */ + PHY_B_PES_CE_ER = 1<<6, /* Bit 6: Carrier Ext Error */ + PHY_B_PES_BAD_SSD = 1<<5, /* Bit 5: Bad SSD */ + PHY_B_PES_BAD_ESD = 1<<4, /* Bit 4: Bad ESD */ + PHY_B_PES_RX_ER = 1<<3, /* Bit 3: Receive Error */ + PHY_B_PES_TX_ER = 1<<2, /* Bit 2: Transmit Error */ + PHY_B_PES_LOCK_ER = 1<<1, /* Bit 1: Lock Error */ + PHY_B_PES_MLT3_ER = 1<<0, /* Bit 0: MLT3 code Error */ +}; + +/***** PHY_BCOM_FC_CTR 16 bit r/w False Carrier Counter *****/ +enum { + PHY_B_FC_CTR = 0xff, /* Bit 7..0: False Carrier Counter */ + +/***** PHY_BCOM_RNO_CTR 16 bit r/w Receive NOT_OK Counter *****/ + PHY_B_RC_LOC_MSK = 0xff00, /* Bit 15..8: Local Rx NOT_OK cnt */ + PHY_B_RC_REM_MSK = 0x00ff, /* Bit 7..0: Remote Rx NOT_OK cnt */ + +/***** PHY_BCOM_AUX_CTRL 16 bit r/w Auxiliary Control Reg *****/ + PHY_B_AC_L_SQE = 1<<15, /* Bit 15: Low Squelch */ + PHY_B_AC_LONG_PACK = 1<<14, /* Bit 14: Rx Long Packets */ + PHY_B_AC_ER_CTRL = 3<<12,/* Bit 13..12: Edgerate Control */ + /* Bit 11: reserved */ + PHY_B_AC_TX_TST = 1<<10, /* Bit 10: Tx test bit, always 1 */ + /* Bit 9.. 8: reserved */ + PHY_B_AC_DIS_PRF = 1<<7, /* Bit 7: dis part resp filter */ + /* Bit 6: reserved */ + PHY_B_AC_DIS_PM = 1<<5, /* Bit 5: dis power management */ + /* Bit 4: reserved */ + PHY_B_AC_DIAG = 1<<3, /* Bit 3: Diagnostic Mode */ +}; + +/***** PHY_BCOM_AUX_STAT 16 bit r/o Auxiliary Status Reg *****/ +enum { + PHY_B_AS_AN_C = 1<<15, /* Bit 15: AutoNeg complete */ + PHY_B_AS_AN_CA = 1<<14, /* Bit 14: AN Complete Ack */ + PHY_B_AS_ANACK_D = 1<<13, /* Bit 13: AN Ack Detect */ + PHY_B_AS_ANAB_D = 1<<12, /* Bit 12: AN Ability Detect */ + PHY_B_AS_NPW = 1<<11, /* Bit 11: AN Next Page Wait */ + PHY_B_AS_AN_RES_MSK = 7<<8,/* Bit 10..8: AN HDC */ + PHY_B_AS_PDF = 1<<7, /* Bit 7: Parallel Detect. Fault */ + PHY_B_AS_RF = 1<<6, /* Bit 6: Remote Fault */ + PHY_B_AS_ANP_R = 1<<5, /* Bit 5: AN Page Received */ + PHY_B_AS_LP_ANAB = 1<<4, /* Bit 4: LP AN Ability */ + PHY_B_AS_LP_NPAB = 1<<3, /* Bit 3: LP Next Page Ability */ + PHY_B_AS_LS = 1<<2, /* Bit 2: Link Status */ + PHY_B_AS_PRR = 1<<1, /* Bit 1: Pause Resolution-Rx */ + PHY_B_AS_PRT = 1<<0, /* Bit 0: Pause Resolution-Tx */ +}; +#define PHY_B_AS_PAUSE_MSK (PHY_B_AS_PRR | PHY_B_AS_PRT) + +/***** PHY_BCOM_INT_STAT 16 bit r/o Interrupt Status Reg *****/ +/***** PHY_BCOM_INT_MASK 16 bit r/w Interrupt Mask Reg *****/ +enum { + PHY_B_IS_PSE = 1<<14, /* Bit 14: Pair Swap Error */ + PHY_B_IS_MDXI_SC = 1<<13, /* Bit 13: MDIX Status Change */ + PHY_B_IS_HCT = 1<<12, /* Bit 12: counter above 32k */ + PHY_B_IS_LCT = 1<<11, /* Bit 11: counter above 128 */ + PHY_B_IS_AN_PR = 1<<10, /* Bit 10: Page Received */ + PHY_B_IS_NO_HDCL = 1<<9, /* Bit 9: No HCD Link */ + PHY_B_IS_NO_HDC = 1<<8, /* Bit 8: No HCD */ + PHY_B_IS_NEG_USHDC = 1<<7, /* Bit 7: Negotiated Unsup. HCD */ + PHY_B_IS_SCR_S_ER = 1<<6, /* Bit 6: Scrambler Sync Error */ + PHY_B_IS_RRS_CHANGE = 1<<5, /* Bit 5: Remote Rx Stat Change */ + PHY_B_IS_LRS_CHANGE = 1<<4, /* Bit 4: Local Rx Stat Change */ + PHY_B_IS_DUP_CHANGE = 1<<3, /* Bit 3: Duplex Mode Change */ + PHY_B_IS_LSP_CHANGE = 1<<2, /* Bit 2: Link Speed Change */ + PHY_B_IS_LST_CHANGE = 1<<1, /* Bit 1: Link Status Changed */ + PHY_B_IS_CRC_ER = 1<<0, /* Bit 0: CRC Error */ +}; +#define PHY_B_DEF_MSK (~(PHY_B_IS_AN_PR | PHY_B_IS_LST_CHANGE)) + +/* Pause Bits (PHY_B_AN_ASP and PHY_B_AN_PC) encoding */ +enum { + PHY_B_P_NO_PAUSE = 0<<10,/* Bit 11..10: no Pause Mode */ + PHY_B_P_SYM_MD = 1<<10, /* Bit 11..10: symmetric Pause Mode */ + PHY_B_P_ASYM_MD = 2<<10,/* Bit 11..10: asymmetric Pause Mode */ + PHY_B_P_BOTH_MD = 3<<10,/* Bit 11..10: both Pause Mode */ +}; +/* + * Resolved Duplex mode and Capabilities (Aux Status Summary Reg) + */ +enum { + PHY_B_RES_1000FD = 7<<8,/* Bit 10..8: 1000Base-T Full Dup. */ + PHY_B_RES_1000HD = 6<<8,/* Bit 10..8: 1000Base-T Half Dup. */ +}; + +/* + * Level One-Specific + */ +/***** PHY_LONE_1000T_CTRL 16 bit r/w 1000Base-T Control Reg *****/ +enum { + PHY_L_1000C_TEST = 7<<13,/* Bit 15..13: Test Modes */ + PHY_L_1000C_MSE = 1<<12, /* Bit 12: Master/Slave Enable */ + PHY_L_1000C_MSC = 1<<11, /* Bit 11: M/S Configuration */ + PHY_L_1000C_RD = 1<<10, /* Bit 10: Repeater/DTE */ + PHY_L_1000C_AFD = 1<<9, /* Bit 9: Advertise Full Duplex */ + PHY_L_1000C_AHD = 1<<8, /* Bit 8: Advertise Half Duplex */ +}; + +/***** PHY_LONE_1000T_STAT 16 bit r/o 1000Base-T Status Reg *****/ +enum { + PHY_L_1000S_MSF = 1<<15, /* Bit 15: Master/Slave Fault */ + PHY_L_1000S_MSR = 1<<14, /* Bit 14: Master/Slave Result */ + PHY_L_1000S_LRS = 1<<13, /* Bit 13: Local Receiver Status */ + PHY_L_1000S_RRS = 1<<12, /* Bit 12: Remote Receiver Status */ + PHY_L_1000S_LP_FD = 1<<11, /* Bit 11: Link Partner can FD */ + PHY_L_1000S_LP_HD = 1<<10, /* Bit 10: Link Partner can HD */ + + PHY_L_1000S_IEC = 0xff, /* Bit 7..0: Idle Error Count */ + +/***** PHY_LONE_EXT_STAT 16 bit r/o Extended Status Register *****/ + PHY_L_ES_X_FD_CAP = 1<<15, /* Bit 15: 1000Base-X FD capable */ + PHY_L_ES_X_HD_CAP = 1<<14, /* Bit 14: 1000Base-X HD capable */ + PHY_L_ES_T_FD_CAP = 1<<13, /* Bit 13: 1000Base-T FD capable */ + PHY_L_ES_T_HD_CAP = 1<<12, /* Bit 12: 1000Base-T HD capable */ +}; + +/***** PHY_LONE_PORT_CFG 16 bit r/w Port Configuration Reg *****/ +enum { + PHY_L_PC_REP_MODE = 1<<15, /* Bit 15: Repeater Mode */ + + PHY_L_PC_TX_DIS = 1<<13, /* Bit 13: Tx output Disabled */ + PHY_L_PC_BY_SCR = 1<<12, /* Bit 12: Bypass Scrambler */ + PHY_L_PC_BY_45 = 1<<11, /* Bit 11: Bypass 4B5B-Decoder */ + PHY_L_PC_JAB_DIS = 1<<10, /* Bit 10: Jabber Disabled */ + PHY_L_PC_SQE = 1<<9, /* Bit 9: Enable Heartbeat */ + PHY_L_PC_TP_LOOP = 1<<8, /* Bit 8: TP Loopback */ + PHY_L_PC_SSS = 1<<7, /* Bit 7: Smart Speed Selection */ + PHY_L_PC_FIFO_SIZE = 1<<6, /* Bit 6: FIFO Size */ + PHY_L_PC_PRE_EN = 1<<5, /* Bit 5: Preamble Enable */ + PHY_L_PC_CIM = 1<<4, /* Bit 4: Carrier Integrity Mon */ + PHY_L_PC_10_SER = 1<<3, /* Bit 3: Use Serial Output */ + PHY_L_PC_ANISOL = 1<<2, /* Bit 2: Unisolate Port */ + PHY_L_PC_TEN_BIT = 1<<1, /* Bit 1: 10bit iface mode on */ + PHY_L_PC_ALTCLOCK = 1<<0, /* Bit 0: (ro) ALTCLOCK Mode on */ +}; + +/***** PHY_LONE_Q_STAT 16 bit r/o Quick Status Reg *****/ +enum { + PHY_L_QS_D_RATE = 3<<14,/* Bit 15..14: Data Rate */ + PHY_L_QS_TX_STAT = 1<<13, /* Bit 13: Transmitting */ + PHY_L_QS_RX_STAT = 1<<12, /* Bit 12: Receiving */ + PHY_L_QS_COL_STAT = 1<<11, /* Bit 11: Collision */ + PHY_L_QS_L_STAT = 1<<10, /* Bit 10: Link is up */ + PHY_L_QS_DUP_MOD = 1<<9, /* Bit 9: Full/Half Duplex */ + PHY_L_QS_AN = 1<<8, /* Bit 8: AutoNeg is On */ + PHY_L_QS_AN_C = 1<<7, /* Bit 7: AN is Complete */ + PHY_L_QS_LLE = 7<<4,/* Bit 6..4: Line Length Estim. */ + PHY_L_QS_PAUSE = 1<<3, /* Bit 3: LP advertised Pause */ + PHY_L_QS_AS_PAUSE = 1<<2, /* Bit 2: LP adv. asym. Pause */ + PHY_L_QS_ISOLATE = 1<<1, /* Bit 1: CIM Isolated */ + PHY_L_QS_EVENT = 1<<0, /* Bit 0: Event has occurred */ +}; + +/***** PHY_LONE_INT_ENAB 16 bit r/w Interrupt Enable Reg *****/ +/***** PHY_LONE_INT_STAT 16 bit r/o Interrupt Status Reg *****/ +enum { + PHY_L_IS_AN_F = 1<<13, /* Bit 13: Auto-Negotiation fault */ + PHY_L_IS_CROSS = 1<<11, /* Bit 11: Crossover used */ + PHY_L_IS_POL = 1<<10, /* Bit 10: Polarity correct. used */ + PHY_L_IS_SS = 1<<9, /* Bit 9: Smart Speed Downgrade */ + PHY_L_IS_CFULL = 1<<8, /* Bit 8: Counter Full */ + PHY_L_IS_AN_C = 1<<7, /* Bit 7: AutoNeg Complete */ + PHY_L_IS_SPEED = 1<<6, /* Bit 6: Speed Changed */ + PHY_L_IS_DUP = 1<<5, /* Bit 5: Duplex Changed */ + PHY_L_IS_LS = 1<<4, /* Bit 4: Link Status Changed */ + PHY_L_IS_ISOL = 1<<3, /* Bit 3: Isolate Occured */ + PHY_L_IS_MDINT = 1<<2, /* Bit 2: (ro) STAT: MII Int Pending */ + PHY_L_IS_INTEN = 1<<1, /* Bit 1: ENAB: Enable IRQs */ + PHY_L_IS_FORCE = 1<<0, /* Bit 0: ENAB: Force Interrupt */ +}; + +/* int. mask */ +#define PHY_L_DEF_MSK (PHY_L_IS_LS | PHY_L_IS_ISOL | PHY_L_IS_INTEN) + +/***** PHY_LONE_LED_CFG 16 bit r/w LED Configuration Reg *****/ +enum { + PHY_L_LC_LEDC = 3<<14,/* Bit 15..14: Col/Blink/On/Off */ + PHY_L_LC_LEDR = 3<<12,/* Bit 13..12: Rx/Blink/On/Off */ + PHY_L_LC_LEDT = 3<<10,/* Bit 11..10: Tx/Blink/On/Off */ + PHY_L_LC_LEDG = 3<<8,/* Bit 9..8: Giga/Blink/On/Off */ + PHY_L_LC_LEDS = 3<<6,/* Bit 7..6: 10-100/Blink/On/Off */ + PHY_L_LC_LEDL = 3<<4,/* Bit 5..4: Link/Blink/On/Off */ + PHY_L_LC_LEDF = 3<<2,/* Bit 3..2: Duplex/Blink/On/Off */ + PHY_L_LC_PSTRECH= 1<<1, /* Bit 1: Strech LED Pulses */ + PHY_L_LC_FREQ = 1<<0, /* Bit 0: 30/100 ms */ +}; + +/***** PHY_LONE_PORT_CTRL 16 bit r/w Port Control Reg *****/ +enum { + PHY_L_PC_TX_TCLK = 1<<15, /* Bit 15: Enable TX_TCLK */ + PHY_L_PC_ALT_NP = 1<<13, /* Bit 14: Alternate Next Page */ + PHY_L_PC_GMII_ALT= 1<<12, /* Bit 13: Alternate GMII driver */ + PHY_L_PC_TEN_CRS = 1<<10, /* Bit 10: Extend CRS*/ +}; + +/***** PHY_LONE_CIM 16 bit r/o CIM Reg *****/ +enum { + PHY_L_CIM_ISOL = 0xff<<8,/* Bit 15..8: Isolate Count */ + PHY_L_CIM_FALSE_CAR = 0xff, /* Bit 7..0: False Carrier Count */ +}; + +/* + * Pause Bits (PHY_L_AN_ASP and PHY_L_AN_PC) encoding + */ +enum { + PHY_L_P_NO_PAUSE= 0<<10,/* Bit 11..10: no Pause Mode */ + PHY_L_P_SYM_MD = 1<<10, /* Bit 11..10: symmetric Pause Mode */ + PHY_L_P_ASYM_MD = 2<<10,/* Bit 11..10: asymmetric Pause Mode */ + PHY_L_P_BOTH_MD = 3<<10,/* Bit 11..10: both Pause Mode */ +}; + +/* + * National-Specific + */ +/***** PHY_NAT_1000T_CTRL 16 bit r/w 1000Base-T Control Reg *****/ +enum { + PHY_N_1000C_TEST= 7<<13,/* Bit 15..13: Test Modes */ + PHY_N_1000C_MSE = 1<<12, /* Bit 12: Master/Slave Enable */ + PHY_N_1000C_MSC = 1<<11, /* Bit 11: M/S Configuration */ + PHY_N_1000C_RD = 1<<10, /* Bit 10: Repeater/DTE */ + PHY_N_1000C_AFD = 1<<9, /* Bit 9: Advertise Full Duplex */ + PHY_N_1000C_AHD = 1<<8, /* Bit 8: Advertise Half Duplex */ + PHY_N_1000C_APC = 1<<7, /* Bit 7: Asymmetric Pause Cap. */}; + + +/***** PHY_NAT_1000T_STAT 16 bit r/o 1000Base-T Status Reg *****/ +enum { + PHY_N_1000S_MSF = 1<<15, /* Bit 15: Master/Slave Fault */ + PHY_N_1000S_MSR = 1<<14, /* Bit 14: Master/Slave Result */ + PHY_N_1000S_LRS = 1<<13, /* Bit 13: Local Receiver Status */ + PHY_N_1000S_RRS = 1<<12, /* Bit 12: Remote Receiver Status*/ + PHY_N_1000S_LP_FD= 1<<11, /* Bit 11: Link Partner can FD */ + PHY_N_1000S_LP_HD= 1<<10, /* Bit 10: Link Partner can HD */ + PHY_N_1000C_LP_APC= 1<<9, /* Bit 9: LP Asym. Pause Cap. */ + PHY_N_1000S_IEC = 0xff, /* Bit 7..0: Idle Error Count */ +}; + +/***** PHY_NAT_EXT_STAT 16 bit r/o Extended Status Register *****/ +enum { + PHY_N_ES_X_FD_CAP= 1<<15, /* Bit 15: 1000Base-X FD capable */ + PHY_N_ES_X_HD_CAP= 1<<14, /* Bit 14: 1000Base-X HD capable */ + PHY_N_ES_T_FD_CAP= 1<<13, /* Bit 13: 1000Base-T FD capable */ + PHY_N_ES_T_HD_CAP= 1<<12, /* Bit 12: 1000Base-T HD capable */ +}; + +/** Marvell-Specific */ +enum { + PHY_M_AN_NXT_PG = 1<<15, /* Request Next Page */ + PHY_M_AN_ACK = 1<<14, /* (ro) Acknowledge Received */ + PHY_M_AN_RF = 1<<13, /* Remote Fault */ + + PHY_M_AN_ASP = 1<<11, /* Asymmetric Pause */ + PHY_M_AN_PC = 1<<10, /* MAC Pause implemented */ + PHY_M_AN_100_T4 = 1<<9, /* Not cap. 100Base-T4 (always 0) */ + PHY_M_AN_100_FD = 1<<8, /* Advertise 100Base-TX Full Duplex */ + PHY_M_AN_100_HD = 1<<7, /* Advertise 100Base-TX Half Duplex */ + PHY_M_AN_10_FD = 1<<6, /* Advertise 10Base-TX Full Duplex */ + PHY_M_AN_10_HD = 1<<5, /* Advertise 10Base-TX Half Duplex */ + PHY_M_AN_SEL_MSK =0x1f<<4, /* Bit 4.. 0: Selector Field Mask */ +}; + +/* special defines for FIBER (88E1011S only) */ +enum { + PHY_M_AN_ASP_X = 1<<8, /* Asymmetric Pause */ + PHY_M_AN_PC_X = 1<<7, /* MAC Pause implemented */ + PHY_M_AN_1000X_AHD = 1<<6, /* Advertise 10000Base-X Half Duplex */ + PHY_M_AN_1000X_AFD = 1<<5, /* Advertise 10000Base-X Full Duplex */ +}; + +/* Pause Bits (PHY_M_AN_ASP_X and PHY_M_AN_PC_X) encoding */ +enum { + PHY_M_P_NO_PAUSE_X = 0<<7,/* Bit 8.. 7: no Pause Mode */ + PHY_M_P_SYM_MD_X = 1<<7, /* Bit 8.. 7: symmetric Pause Mode */ + PHY_M_P_ASYM_MD_X = 2<<7,/* Bit 8.. 7: asymmetric Pause Mode */ + PHY_M_P_BOTH_MD_X = 3<<7,/* Bit 8.. 7: both Pause Mode */ +}; + +/***** PHY_MARV_1000T_CTRL 16 bit r/w 1000Base-T Control Reg *****/ +enum { + PHY_M_1000C_TEST = 7<<13,/* Bit 15..13: Test Modes */ + PHY_M_1000C_MSE = 1<<12, /* Manual Master/Slave Enable */ + PHY_M_1000C_MSC = 1<<11, /* M/S Configuration (1=Master) */ + PHY_M_1000C_MPD = 1<<10, /* Multi-Port Device */ + PHY_M_1000C_AFD = 1<<9, /* Advertise Full Duplex */ + PHY_M_1000C_AHD = 1<<8, /* Advertise Half Duplex */ +}; + +/***** PHY_MARV_PHY_CTRL 16 bit r/w PHY Specific Ctrl Reg *****/ +enum { + PHY_M_PC_TX_FFD_MSK = 3<<14,/* Bit 15..14: Tx FIFO Depth Mask */ + PHY_M_PC_RX_FFD_MSK = 3<<12,/* Bit 13..12: Rx FIFO Depth Mask */ + PHY_M_PC_ASS_CRS_TX = 1<<11, /* Assert CRS on Transmit */ + PHY_M_PC_FL_GOOD = 1<<10, /* Force Link Good */ + PHY_M_PC_EN_DET_MSK = 3<<8,/* Bit 9.. 8: Energy Detect Mask */ + PHY_M_PC_ENA_EXT_D = 1<<7, /* Enable Ext. Distance (10BT) */ + PHY_M_PC_MDIX_MSK = 3<<5,/* Bit 6.. 5: MDI/MDIX Config. Mask */ + PHY_M_PC_DIS_125CLK = 1<<4, /* Disable 125 CLK */ + PHY_M_PC_MAC_POW_UP = 1<<3, /* MAC Power up */ + PHY_M_PC_SQE_T_ENA = 1<<2, /* SQE Test Enabled */ + PHY_M_PC_POL_R_DIS = 1<<1, /* Polarity Reversal Disabled */ + PHY_M_PC_DIS_JABBER = 1<<0, /* Disable Jabber */ +}; + +enum { + PHY_M_PC_EN_DET = 2<<8, /* Energy Detect (Mode 1) */ + PHY_M_PC_EN_DET_PLUS = 3<<8, /* Energy Detect Plus (Mode 2) */ +}; + +#define PHY_M_PC_MDI_XMODE(x) (((x)<<5) & PHY_M_PC_MDIX_MSK) + +enum { + PHY_M_PC_MAN_MDI = 0, /* 00 = Manual MDI configuration */ + PHY_M_PC_MAN_MDIX = 1, /* 01 = Manual MDIX configuration */ + PHY_M_PC_ENA_AUTO = 3, /* 11 = Enable Automatic Crossover */ +}; + +/* for 10/100 Fast Ethernet PHY (88E3082 only) */ +enum { + PHY_M_PC_ENA_DTE_DT = 1<<15, /* Enable Data Terminal Equ. (DTE) Detect */ + PHY_M_PC_ENA_ENE_DT = 1<<14, /* Enable Energy Detect (sense & pulse) */ + PHY_M_PC_DIS_NLP_CK = 1<<13, /* Disable Normal Link Puls (NLP) Check */ + PHY_M_PC_ENA_LIP_NP = 1<<12, /* Enable Link Partner Next Page Reg. */ + PHY_M_PC_DIS_NLP_GN = 1<<11, /* Disable Normal Link Puls Generation */ + + PHY_M_PC_DIS_SCRAMB = 1<<9, /* Disable Scrambler */ + PHY_M_PC_DIS_FEFI = 1<<8, /* Disable Far End Fault Indic. (FEFI) */ + + PHY_M_PC_SH_TP_SEL = 1<<6, /* Shielded Twisted Pair Select */ + PHY_M_PC_RX_FD_MSK = 3<<2,/* Bit 3.. 2: Rx FIFO Depth Mask */ +}; + +/***** PHY_MARV_PHY_STAT 16 bit r/o PHY Specific Status Reg *****/ +enum { + PHY_M_PS_SPEED_MSK = 3<<14, /* Bit 15..14: Speed Mask */ + PHY_M_PS_SPEED_1000 = 1<<15, /* 10 = 1000 Mbps */ + PHY_M_PS_SPEED_100 = 1<<14, /* 01 = 100 Mbps */ + PHY_M_PS_SPEED_10 = 0, /* 00 = 10 Mbps */ + PHY_M_PS_FULL_DUP = 1<<13, /* Full Duplex */ + PHY_M_PS_PAGE_REC = 1<<12, /* Page Received */ + PHY_M_PS_SPDUP_RES = 1<<11, /* Speed & Duplex Resolved */ + PHY_M_PS_LINK_UP = 1<<10, /* Link Up */ + PHY_M_PS_CABLE_MSK = 7<<7, /* Bit 9.. 7: Cable Length Mask */ + PHY_M_PS_MDI_X_STAT = 1<<6, /* MDI Crossover Stat (1=MDIX) */ + PHY_M_PS_DOWNS_STAT = 1<<5, /* Downshift Status (1=downsh.) */ + PHY_M_PS_ENDET_STAT = 1<<4, /* Energy Detect Status (1=act) */ + PHY_M_PS_TX_P_EN = 1<<3, /* Tx Pause Enabled */ + PHY_M_PS_RX_P_EN = 1<<2, /* Rx Pause Enabled */ + PHY_M_PS_POL_REV = 1<<1, /* Polarity Reversed */ + PHY_M_PS_JABBER = 1<<0, /* Jabber */ +}; + +#define PHY_M_PS_PAUSE_MSK (PHY_M_PS_TX_P_EN | PHY_M_PS_RX_P_EN) + +/* for 10/100 Fast Ethernet PHY (88E3082 only) */ +enum { + PHY_M_PS_DTE_DETECT = 1<<15, /* Data Terminal Equipment (DTE) Detected */ + PHY_M_PS_RES_SPEED = 1<<14, /* Resolved Speed (1=100 Mbps, 0=10 Mbps */ +}; + +enum { + PHY_M_IS_AN_ERROR = 1<<15, /* Auto-Negotiation Error */ + PHY_M_IS_LSP_CHANGE = 1<<14, /* Link Speed Changed */ + PHY_M_IS_DUP_CHANGE = 1<<13, /* Duplex Mode Changed */ + PHY_M_IS_AN_PR = 1<<12, /* Page Received */ + PHY_M_IS_AN_COMPL = 1<<11, /* Auto-Negotiation Completed */ + PHY_M_IS_LST_CHANGE = 1<<10, /* Link Status Changed */ + PHY_M_IS_SYMB_ERROR = 1<<9, /* Symbol Error */ + PHY_M_IS_FALSE_CARR = 1<<8, /* False Carrier */ + PHY_M_IS_FIFO_ERROR = 1<<7, /* FIFO Overflow/Underrun Error */ + PHY_M_IS_MDI_CHANGE = 1<<6, /* MDI Crossover Changed */ + PHY_M_IS_DOWNSH_DET = 1<<5, /* Downshift Detected */ + PHY_M_IS_END_CHANGE = 1<<4, /* Energy Detect Changed */ + + PHY_M_IS_DTE_CHANGE = 1<<2, /* DTE Power Det. Status Changed */ + PHY_M_IS_POL_CHANGE = 1<<1, /* Polarity Changed */ + PHY_M_IS_JABBER = 1<<0, /* Jabber */ +}; + +#define PHY_M_DEF_MSK ( PHY_M_IS_AN_ERROR | PHY_M_IS_LSP_CHANGE | \ + PHY_M_IS_LST_CHANGE | PHY_M_IS_FIFO_ERROR) + +/***** PHY_MARV_EXT_CTRL 16 bit r/w Ext. PHY Specific Ctrl *****/ +enum { + PHY_M_EC_ENA_BC_EXT = 1<<15, /* Enable Block Carr. Ext. (88E1111 only) */ + PHY_M_EC_ENA_LIN_LB = 1<<14, /* Enable Line Loopback (88E1111 only) */ + + PHY_M_EC_DIS_LINK_P = 1<<12, /* Disable Link Pulses (88E1111 only) */ + PHY_M_EC_M_DSC_MSK = 3<<10, /* Bit 11..10: Master Downshift Counter */ + /* (88E1011 only) */ + PHY_M_EC_S_DSC_MSK = 3<<8,/* Bit 9.. 8: Slave Downshift Counter */ + /* (88E1011 only) */ + PHY_M_EC_M_DSC_MSK2 = 7<<9,/* Bit 11.. 9: Master Downshift Counter */ + /* (88E1111 only) */ + PHY_M_EC_DOWN_S_ENA = 1<<8, /* Downshift Enable (88E1111 only) */ + /* !!! Errata in spec. (1 = disable) */ + PHY_M_EC_RX_TIM_CT = 1<<7, /* RGMII Rx Timing Control*/ + PHY_M_EC_MAC_S_MSK = 7<<4,/* Bit 6.. 4: Def. MAC interface speed */ + PHY_M_EC_FIB_AN_ENA = 1<<3, /* Fiber Auto-Neg. Enable (88E1011S only) */ + PHY_M_EC_DTE_D_ENA = 1<<2, /* DTE Detect Enable (88E1111 only) */ + PHY_M_EC_TX_TIM_CT = 1<<1, /* RGMII Tx Timing Control */ + PHY_M_EC_TRANS_DIS = 1<<0, /* Transmitter Disable (88E1111 only) */}; + +#define PHY_M_EC_M_DSC(x) ((x)<<10) /* 00=1x; 01=2x; 10=3x; 11=4x */ +#define PHY_M_EC_S_DSC(x) ((x)<<8) /* 00=dis; 01=1x; 10=2x; 11=3x */ +#define PHY_M_EC_MAC_S(x) ((x)<<4) /* 01X=0; 110=2.5; 111=25 (MHz) */ + +#define PHY_M_EC_M_DSC_2(x) ((x)<<9) /* 000=1x; 001=2x; 010=3x; 011=4x */ + /* 100=5x; 101=6x; 110=7x; 111=8x */ +enum { + MAC_TX_CLK_0_MHZ = 2, + MAC_TX_CLK_2_5_MHZ = 6, + MAC_TX_CLK_25_MHZ = 7, +}; + +/***** PHY_MARV_LED_CTRL 16 bit r/w LED Control Reg *****/ +enum { + PHY_M_LEDC_DIS_LED = 1<<15, /* Disable LED */ + PHY_M_LEDC_PULS_MSK = 7<<12,/* Bit 14..12: Pulse Stretch Mask */ + PHY_M_LEDC_F_INT = 1<<11, /* Force Interrupt */ + PHY_M_LEDC_BL_R_MSK = 7<<8,/* Bit 10.. 8: Blink Rate Mask */ + PHY_M_LEDC_DP_C_LSB = 1<<7, /* Duplex Control (LSB, 88E1111 only) */ + PHY_M_LEDC_TX_C_LSB = 1<<6, /* Tx Control (LSB, 88E1111 only) */ + PHY_M_LEDC_LK_C_MSK = 7<<3,/* Bit 5.. 3: Link Control Mask */ + /* (88E1111 only) */ +}; + +enum { + PHY_M_LEDC_LINK_MSK = 3<<3,/* Bit 4.. 3: Link Control Mask */ + /* (88E1011 only) */ + PHY_M_LEDC_DP_CTRL = 1<<2, /* Duplex Control */ + PHY_M_LEDC_DP_C_MSB = 1<<2, /* Duplex Control (MSB, 88E1111 only) */ + PHY_M_LEDC_RX_CTRL = 1<<1, /* Rx Activity / Link */ + PHY_M_LEDC_TX_CTRL = 1<<0, /* Tx Activity / Link */ + PHY_M_LEDC_TX_C_MSB = 1<<0, /* Tx Control (MSB, 88E1111 only) */ +}; + +#define PHY_M_LED_PULS_DUR(x) ( ((x)<<12) & PHY_M_LEDC_PULS_MSK) + +enum { + PULS_NO_STR = 0,/* no pulse stretching */ + PULS_21MS = 1,/* 21 ms to 42 ms */ + PULS_42MS = 2,/* 42 ms to 84 ms */ + PULS_84MS = 3,/* 84 ms to 170 ms */ + PULS_170MS = 4,/* 170 ms to 340 ms */ + PULS_340MS = 5,/* 340 ms to 670 ms */ + PULS_670MS = 6,/* 670 ms to 1.3 s */ + PULS_1300MS = 7,/* 1.3 s to 2.7 s */ +}; + +#define PHY_M_LED_BLINK_RT(x) ( ((x)<<8) & PHY_M_LEDC_BL_R_MSK) + +enum { + BLINK_42MS = 0,/* 42 ms */ + BLINK_84MS = 1,/* 84 ms */ + BLINK_170MS = 2,/* 170 ms */ + BLINK_340MS = 3,/* 340 ms */ + BLINK_670MS = 4,/* 670 ms */ +}; + +/***** PHY_MARV_LED_OVER 16 bit r/w Manual LED Override Reg *****/ +#define PHY_M_LED_MO_SGMII(x) ((x)<<14) /* Bit 15..14: SGMII AN Timer */ + /* Bit 13..12: reserved */ +#define PHY_M_LED_MO_DUP(x) ((x)<<10) /* Bit 11..10: Duplex */ +#define PHY_M_LED_MO_10(x) ((x)<<8) /* Bit 9.. 8: Link 10 */ +#define PHY_M_LED_MO_100(x) ((x)<<6) /* Bit 7.. 6: Link 100 */ +#define PHY_M_LED_MO_1000(x) ((x)<<4) /* Bit 5.. 4: Link 1000 */ +#define PHY_M_LED_MO_RX(x) ((x)<<2) /* Bit 3.. 2: Rx */ +#define PHY_M_LED_MO_TX(x) ((x)<<0) /* Bit 1.. 0: Tx */ + +enum { + MO_LED_NORM = 0, + MO_LED_BLINK = 1, + MO_LED_OFF = 2, + MO_LED_ON = 3, +}; + +/***** PHY_MARV_EXT_CTRL_2 16 bit r/w Ext. PHY Specific Ctrl 2 *****/ +enum { + PHY_M_EC2_FI_IMPED = 1<<6, /* Fiber Input Impedance */ + PHY_M_EC2_FO_IMPED = 1<<5, /* Fiber Output Impedance */ + PHY_M_EC2_FO_M_CLK = 1<<4, /* Fiber Mode Clock Enable */ + PHY_M_EC2_FO_BOOST = 1<<3, /* Fiber Output Boost */ + PHY_M_EC2_FO_AM_MSK = 7,/* Bit 2.. 0: Fiber Output Amplitude */ +}; + +/***** PHY_MARV_EXT_P_STAT 16 bit r/w Ext. PHY Specific Status *****/ +enum { + PHY_M_FC_AUTO_SEL = 1<<15, /* Fiber/Copper Auto Sel. Dis. */ + PHY_M_FC_AN_REG_ACC = 1<<14, /* Fiber/Copper AN Reg. Access */ + PHY_M_FC_RESOLUTION = 1<<13, /* Fiber/Copper Resolution */ + PHY_M_SER_IF_AN_BP = 1<<12, /* Ser. IF AN Bypass Enable */ + PHY_M_SER_IF_BP_ST = 1<<11, /* Ser. IF AN Bypass Status */ + PHY_M_IRQ_POLARITY = 1<<10, /* IRQ polarity */ + PHY_M_DIS_AUT_MED = 1<<9, /* Disable Aut. Medium Reg. Selection */ + /* (88E1111 only) */ + /* Bit 9.. 4: reserved (88E1011 only) */ + PHY_M_UNDOC1 = 1<<7, /* undocumented bit !! */ + PHY_M_DTE_POW_STAT = 1<<4, /* DTE Power Status (88E1111 only) */ + PHY_M_MODE_MASK = 0xf, /* Bit 3.. 0: copy of HWCFG MODE[3:0] */ +}; + +/***** PHY_MARV_CABLE_DIAG 16 bit r/o Cable Diagnostic Reg *****/ +enum { + PHY_M_CABD_ENA_TEST = 1<<15, /* Enable Test (Page 0) */ + PHY_M_CABD_DIS_WAIT = 1<<15, /* Disable Waiting Period (Page 1) */ + /* (88E1111 only) */ + PHY_M_CABD_STAT_MSK = 3<<13, /* Bit 14..13: Status Mask */ + PHY_M_CABD_AMPL_MSK = 0x1f<<8,/* Bit 12.. 8: Amplitude Mask */ + /* (88E1111 only) */ + PHY_M_CABD_DIST_MSK = 0xff, /* Bit 7.. 0: Distance Mask */ +}; + +/* values for Cable Diagnostic Status (11=fail; 00=OK; 10=open; 01=short) */ +enum { + CABD_STAT_NORMAL= 0, + CABD_STAT_SHORT = 1, + CABD_STAT_OPEN = 2, + CABD_STAT_FAIL = 3, +}; + +/* for 10/100 Fast Ethernet PHY (88E3082 only) */ +/***** PHY_MARV_FE_LED_PAR 16 bit r/w LED Parallel Select Reg. *****/ + /* Bit 15..12: reserved (used internally) */ +enum { + PHY_M_FELP_LED2_MSK = 0xf<<8, /* Bit 11.. 8: LED2 Mask (LINK) */ + PHY_M_FELP_LED1_MSK = 0xf<<4, /* Bit 7.. 4: LED1 Mask (ACT) */ + PHY_M_FELP_LED0_MSK = 0xf, /* Bit 3.. 0: LED0 Mask (SPEED) */ +}; + +#define PHY_M_FELP_LED2_CTRL(x) ( ((x)<<8) & PHY_M_FELP_LED2_MSK) +#define PHY_M_FELP_LED1_CTRL(x) ( ((x)<<4) & PHY_M_FELP_LED1_MSK) +#define PHY_M_FELP_LED0_CTRL(x) ( ((x)<<0) & PHY_M_FELP_LED0_MSK) + +enum { + LED_PAR_CTRL_COLX = 0x00, + LED_PAR_CTRL_ERROR = 0x01, + LED_PAR_CTRL_DUPLEX = 0x02, + LED_PAR_CTRL_DP_COL = 0x03, + LED_PAR_CTRL_SPEED = 0x04, + LED_PAR_CTRL_LINK = 0x05, + LED_PAR_CTRL_TX = 0x06, + LED_PAR_CTRL_RX = 0x07, + LED_PAR_CTRL_ACT = 0x08, + LED_PAR_CTRL_LNK_RX = 0x09, + LED_PAR_CTRL_LNK_AC = 0x0a, + LED_PAR_CTRL_ACT_BL = 0x0b, + LED_PAR_CTRL_TX_BL = 0x0c, + LED_PAR_CTRL_RX_BL = 0x0d, + LED_PAR_CTRL_COL_BL = 0x0e, + LED_PAR_CTRL_INACT = 0x0f +}; + +/*****,PHY_MARV_FE_SPEC_2 16 bit r/w Specific Control Reg. 2 *****/ +enum { + PHY_M_FESC_DIS_WAIT = 1<<2, /* Disable TDR Waiting Period */ + PHY_M_FESC_ENA_MCLK = 1<<1, /* Enable MAC Rx Clock in sleep mode */ + PHY_M_FESC_SEL_CL_A = 1<<0, /* Select Class A driver (100B-TX) */ +}; + +/* for Yukon-2 Gigabit Ethernet PHY (88E1112 only) */ +/***** PHY_MARV_PHY_CTRL (page 2) 16 bit r/w MAC Specific Ctrl *****/ +enum { + PHY_M_MAC_MD_MSK = 7<<7, /* Bit 9.. 7: Mode Select Mask */ + PHY_M_MAC_MD_AUTO = 3,/* Auto Copper/1000Base-X */ + PHY_M_MAC_MD_COPPER = 5,/* Copper only */ + PHY_M_MAC_MD_1000BX = 7,/* 1000Base-X only */ +}; +#define PHY_M_MAC_MODE_SEL(x) ( ((x)<<7) & PHY_M_MAC_MD_MSK) + +/***** PHY_MARV_PHY_CTRL (page 3) 16 bit r/w LED Control Reg. *****/ +enum { + PHY_M_LEDC_LOS_MSK = 0xf<<12,/* Bit 15..12: LOS LED Ctrl. Mask */ + PHY_M_LEDC_INIT_MSK = 0xf<<8, /* Bit 11.. 8: INIT LED Ctrl. Mask */ + PHY_M_LEDC_STA1_MSK = 0xf<<4,/* Bit 7.. 4: STAT1 LED Ctrl. Mask */ + PHY_M_LEDC_STA0_MSK = 0xf, /* Bit 3.. 0: STAT0 LED Ctrl. Mask */ +}; + +#define PHY_M_LEDC_LOS_CTRL(x) ( ((x)<<12) & PHY_M_LEDC_LOS_MSK) +#define PHY_M_LEDC_INIT_CTRL(x) ( ((x)<<8) & PHY_M_LEDC_INIT_MSK) +#define PHY_M_LEDC_STA1_CTRL(x) ( ((x)<<4) & PHY_M_LEDC_STA1_MSK) +#define PHY_M_LEDC_STA0_CTRL(x) ( ((x)<<0) & PHY_M_LEDC_STA0_MSK) + +/* GMAC registers */ +/* Port Registers */ +enum { + GM_GP_STAT = 0x0000, /* 16 bit r/o General Purpose Status */ + GM_GP_CTRL = 0x0004, /* 16 bit r/w General Purpose Control */ + GM_TX_CTRL = 0x0008, /* 16 bit r/w Transmit Control Reg. */ + GM_RX_CTRL = 0x000c, /* 16 bit r/w Receive Control Reg. */ + GM_TX_FLOW_CTRL = 0x0010, /* 16 bit r/w Transmit Flow-Control */ + GM_TX_PARAM = 0x0014, /* 16 bit r/w Transmit Parameter Reg. */ + GM_SERIAL_MODE = 0x0018, /* 16 bit r/w Serial Mode Register */ +/* Source Address Registers */ + GM_SRC_ADDR_1L = 0x001c, /* 16 bit r/w Source Address 1 (low) */ + GM_SRC_ADDR_1M = 0x0020, /* 16 bit r/w Source Address 1 (middle) */ + GM_SRC_ADDR_1H = 0x0024, /* 16 bit r/w Source Address 1 (high) */ + GM_SRC_ADDR_2L = 0x0028, /* 16 bit r/w Source Address 2 (low) */ + GM_SRC_ADDR_2M = 0x002c, /* 16 bit r/w Source Address 2 (middle) */ + GM_SRC_ADDR_2H = 0x0030, /* 16 bit r/w Source Address 2 (high) */ + +/* Multicast Address Hash Registers */ + GM_MC_ADDR_H1 = 0x0034, /* 16 bit r/w Multicast Address Hash 1 */ + GM_MC_ADDR_H2 = 0x0038, /* 16 bit r/w Multicast Address Hash 2 */ + GM_MC_ADDR_H3 = 0x003c, /* 16 bit r/w Multicast Address Hash 3 */ + GM_MC_ADDR_H4 = 0x0040, /* 16 bit r/w Multicast Address Hash 4 */ + +/* Interrupt Source Registers */ + GM_TX_IRQ_SRC = 0x0044, /* 16 bit r/o Tx Overflow IRQ Source */ + GM_RX_IRQ_SRC = 0x0048, /* 16 bit r/o Rx Overflow IRQ Source */ + GM_TR_IRQ_SRC = 0x004c, /* 16 bit r/o Tx/Rx Over. IRQ Source */ + +/* Interrupt Mask Registers */ + GM_TX_IRQ_MSK = 0x0050, /* 16 bit r/w Tx Overflow IRQ Mask */ + GM_RX_IRQ_MSK = 0x0054, /* 16 bit r/w Rx Overflow IRQ Mask */ + GM_TR_IRQ_MSK = 0x0058, /* 16 bit r/w Tx/Rx Over. IRQ Mask */ + +/* Serial Management Interface (SMI) Registers */ + GM_SMI_CTRL = 0x0080, /* 16 bit r/w SMI Control Register */ + GM_SMI_DATA = 0x0084, /* 16 bit r/w SMI Data Register */ + GM_PHY_ADDR = 0x0088, /* 16 bit r/w GPHY Address Register */ +}; + +/* MIB Counters */ +#define GM_MIB_CNT_BASE 0x0100 /* Base Address of MIB Counters */ +#define GM_MIB_CNT_SIZE 44 /* Number of MIB Counters */ + +/* + * MIB Counters base address definitions (low word) - + * use offset 4 for access to high word (32 bit r/o) + */ +enum { + GM_RXF_UC_OK = GM_MIB_CNT_BASE + 0, /* Unicast Frames Received OK */ + GM_RXF_BC_OK = GM_MIB_CNT_BASE + 8, /* Broadcast Frames Received OK */ + GM_RXF_MPAUSE = GM_MIB_CNT_BASE + 16, /* Pause MAC Ctrl Frames Received */ + GM_RXF_MC_OK = GM_MIB_CNT_BASE + 24, /* Multicast Frames Received OK */ + GM_RXF_FCS_ERR = GM_MIB_CNT_BASE + 32, /* Rx Frame Check Seq. Error */ + /* GM_MIB_CNT_BASE + 40: reserved */ + GM_RXO_OK_LO = GM_MIB_CNT_BASE + 48, /* Octets Received OK Low */ + GM_RXO_OK_HI = GM_MIB_CNT_BASE + 56, /* Octets Received OK High */ + GM_RXO_ERR_LO = GM_MIB_CNT_BASE + 64, /* Octets Received Invalid Low */ + GM_RXO_ERR_HI = GM_MIB_CNT_BASE + 72, /* Octets Received Invalid High */ + GM_RXF_SHT = GM_MIB_CNT_BASE + 80, /* Frames <64 Byte Received OK */ + GM_RXE_FRAG = GM_MIB_CNT_BASE + 88, /* Frames <64 Byte Received with FCS Err */ + GM_RXF_64B = GM_MIB_CNT_BASE + 96, /* 64 Byte Rx Frame */ + GM_RXF_127B = GM_MIB_CNT_BASE + 104, /* 65-127 Byte Rx Frame */ + GM_RXF_255B = GM_MIB_CNT_BASE + 112, /* 128-255 Byte Rx Frame */ + GM_RXF_511B = GM_MIB_CNT_BASE + 120, /* 256-511 Byte Rx Frame */ + GM_RXF_1023B = GM_MIB_CNT_BASE + 128, /* 512-1023 Byte Rx Frame */ + GM_RXF_1518B = GM_MIB_CNT_BASE + 136, /* 1024-1518 Byte Rx Frame */ + GM_RXF_MAX_SZ = GM_MIB_CNT_BASE + 144, /* 1519-MaxSize Byte Rx Frame */ + GM_RXF_LNG_ERR = GM_MIB_CNT_BASE + 152, /* Rx Frame too Long Error */ + GM_RXF_JAB_PKT = GM_MIB_CNT_BASE + 160, /* Rx Jabber Packet Frame */ + /* GM_MIB_CNT_BASE + 168: reserved */ + GM_RXE_FIFO_OV = GM_MIB_CNT_BASE + 176, /* Rx FIFO overflow Event */ + /* GM_MIB_CNT_BASE + 184: reserved */ + GM_TXF_UC_OK = GM_MIB_CNT_BASE + 192, /* Unicast Frames Xmitted OK */ + GM_TXF_BC_OK = GM_MIB_CNT_BASE + 200, /* Broadcast Frames Xmitted OK */ + GM_TXF_MPAUSE = GM_MIB_CNT_BASE + 208, /* Pause MAC Ctrl Frames Xmitted */ + GM_TXF_MC_OK = GM_MIB_CNT_BASE + 216, /* Multicast Frames Xmitted OK */ + GM_TXO_OK_LO = GM_MIB_CNT_BASE + 224, /* Octets Transmitted OK Low */ + GM_TXO_OK_HI = GM_MIB_CNT_BASE + 232, /* Octets Transmitted OK High */ + GM_TXF_64B = GM_MIB_CNT_BASE + 240, /* 64 Byte Tx Frame */ + GM_TXF_127B = GM_MIB_CNT_BASE + 248, /* 65-127 Byte Tx Frame */ + GM_TXF_255B = GM_MIB_CNT_BASE + 256, /* 128-255 Byte Tx Frame */ + GM_TXF_511B = GM_MIB_CNT_BASE + 264, /* 256-511 Byte Tx Frame */ + GM_TXF_1023B = GM_MIB_CNT_BASE + 272, /* 512-1023 Byte Tx Frame */ + GM_TXF_1518B = GM_MIB_CNT_BASE + 280, /* 1024-1518 Byte Tx Frame */ + GM_TXF_MAX_SZ = GM_MIB_CNT_BASE + 288, /* 1519-MaxSize Byte Tx Frame */ + + GM_TXF_COL = GM_MIB_CNT_BASE + 304, /* Tx Collision */ + GM_TXF_LAT_COL = GM_MIB_CNT_BASE + 312, /* Tx Late Collision */ + GM_TXF_ABO_COL = GM_MIB_CNT_BASE + 320, /* Tx aborted due to Exces. Col. */ + GM_TXF_MUL_COL = GM_MIB_CNT_BASE + 328, /* Tx Multiple Collision */ + GM_TXF_SNG_COL = GM_MIB_CNT_BASE + 336, /* Tx Single Collision */ + GM_TXE_FIFO_UR = GM_MIB_CNT_BASE + 344, /* Tx FIFO Underrun Event */ +}; + +/* GMAC Bit Definitions */ +/* GM_GP_STAT 16 bit r/o General Purpose Status Register */ +enum { + GM_GPSR_SPEED = 1<<15, /* Bit 15: Port Speed (1 = 100 Mbps) */ + GM_GPSR_DUPLEX = 1<<14, /* Bit 14: Duplex Mode (1 = Full) */ + GM_GPSR_FC_TX_DIS = 1<<13, /* Bit 13: Tx Flow-Control Mode Disabled */ + GM_GPSR_LINK_UP = 1<<12, /* Bit 12: Link Up Status */ + GM_GPSR_PAUSE = 1<<11, /* Bit 11: Pause State */ + GM_GPSR_TX_ACTIVE = 1<<10, /* Bit 10: Tx in Progress */ + GM_GPSR_EXC_COL = 1<<9, /* Bit 9: Excessive Collisions Occured */ + GM_GPSR_LAT_COL = 1<<8, /* Bit 8: Late Collisions Occured */ + + GM_GPSR_PHY_ST_CH = 1<<5, /* Bit 5: PHY Status Change */ + GM_GPSR_GIG_SPEED = 1<<4, /* Bit 4: Gigabit Speed (1 = 1000 Mbps) */ + GM_GPSR_PART_MODE = 1<<3, /* Bit 3: Partition mode */ + GM_GPSR_FC_RX_DIS = 1<<2, /* Bit 2: Rx Flow-Control Mode Disabled */ + GM_GPSR_PROM_EN = 1<<1, /* Bit 1: Promiscuous Mode Enabled */ +}; + +/* GM_GP_CTRL 16 bit r/w General Purpose Control Register */ +enum { + GM_GPCR_PROM_ENA = 1<<14, /* Bit 14: Enable Promiscuous Mode */ + GM_GPCR_FC_TX_DIS = 1<<13, /* Bit 13: Disable Tx Flow-Control Mode */ + GM_GPCR_TX_ENA = 1<<12, /* Bit 12: Enable Transmit */ + GM_GPCR_RX_ENA = 1<<11, /* Bit 11: Enable Receive */ + GM_GPCR_BURST_ENA = 1<<10, /* Bit 10: Enable Burst Mode */ + GM_GPCR_LOOP_ENA = 1<<9, /* Bit 9: Enable MAC Loopback Mode */ + GM_GPCR_PART_ENA = 1<<8, /* Bit 8: Enable Partition Mode */ + GM_GPCR_GIGS_ENA = 1<<7, /* Bit 7: Gigabit Speed (1000 Mbps) */ + GM_GPCR_FL_PASS = 1<<6, /* Bit 6: Force Link Pass */ + GM_GPCR_DUP_FULL = 1<<5, /* Bit 5: Full Duplex Mode */ + GM_GPCR_FC_RX_DIS = 1<<4, /* Bit 4: Disable Rx Flow-Control Mode */ + GM_GPCR_SPEED_100 = 1<<3, /* Bit 3: Port Speed 100 Mbps */ + GM_GPCR_AU_DUP_DIS = 1<<2, /* Bit 2: Disable Auto-Update Duplex */ + GM_GPCR_AU_FCT_DIS = 1<<1, /* Bit 1: Disable Auto-Update Flow-C. */ + GM_GPCR_AU_SPD_DIS = 1<<0, /* Bit 0: Disable Auto-Update Speed */ +}; + +#define GM_GPCR_SPEED_1000 (GM_GPCR_GIGS_ENA | GM_GPCR_SPEED_100) +#define GM_GPCR_AU_ALL_DIS (GM_GPCR_AU_DUP_DIS | GM_GPCR_AU_FCT_DIS|GM_GPCR_AU_SPD_DIS) + +/* GM_TX_CTRL 16 bit r/w Transmit Control Register */ +enum { + GM_TXCR_FORCE_JAM = 1<<15, /* Bit 15: Force Jam / Flow-Control */ + GM_TXCR_CRC_DIS = 1<<14, /* Bit 14: Disable insertion of CRC */ + GM_TXCR_PAD_DIS = 1<<13, /* Bit 13: Disable padding of packets */ + GM_TXCR_COL_THR_MSK = 1<<10, /* Bit 12..10: Collision Threshold */ +}; + +#define TX_COL_THR(x) (((x)<<10) & GM_TXCR_COL_THR_MSK) +#define TX_COL_DEF 0x04 + +/* GM_RX_CTRL 16 bit r/w Receive Control Register */ +enum { + GM_RXCR_UCF_ENA = 1<<15, /* Bit 15: Enable Unicast filtering */ + GM_RXCR_MCF_ENA = 1<<14, /* Bit 14: Enable Multicast filtering */ + GM_RXCR_CRC_DIS = 1<<13, /* Bit 13: Remove 4-byte CRC */ + GM_RXCR_PASS_FC = 1<<12, /* Bit 12: Pass FC packets to FIFO */ +}; + +/* GM_TX_PARAM 16 bit r/w Transmit Parameter Register */ +enum { + GM_TXPA_JAMLEN_MSK = 0x03<<14, /* Bit 15..14: Jam Length */ + GM_TXPA_JAMIPG_MSK = 0x1f<<9, /* Bit 13..9: Jam IPG */ + GM_TXPA_JAMDAT_MSK = 0x1f<<4, /* Bit 8..4: IPG Jam to Data */ + + TX_JAM_LEN_DEF = 0x03, + TX_JAM_IPG_DEF = 0x0b, + TX_IPG_JAM_DEF = 0x1c, +}; + +#define TX_JAM_LEN_VAL(x) (((x)<<14) & GM_TXPA_JAMLEN_MSK) +#define TX_JAM_IPG_VAL(x) (((x)<<9) & GM_TXPA_JAMIPG_MSK) +#define TX_IPG_JAM_DATA(x) (((x)<<4) & GM_TXPA_JAMDAT_MSK) + + +/* GM_SERIAL_MODE 16 bit r/w Serial Mode Register */ +enum { + GM_SMOD_DATABL_MSK = 0x1f<<11, /* Bit 15..11: Data Blinder (r/o) */ + GM_SMOD_LIMIT_4 = 1<<10, /* Bit 10: 4 consecutive Tx trials */ + GM_SMOD_VLAN_ENA = 1<<9, /* Bit 9: Enable VLAN (Max. Frame Len) */ + GM_SMOD_JUMBO_ENA = 1<<8, /* Bit 8: Enable Jumbo (Max. Frame Len) */ + GM_SMOD_IPG_MSK = 0x1f /* Bit 4..0: Inter-Packet Gap (IPG) */ +}; + +#define DATA_BLIND_VAL(x) (((x)<<11) & GM_SMOD_DATABL_MSK) +#define DATA_BLIND_DEF 0x04 + +#define IPG_DATA_VAL(x) (x & GM_SMOD_IPG_MSK) +#define IPG_DATA_DEF 0x1e + +/* GM_SMI_CTRL 16 bit r/w SMI Control Register */ +enum { + GM_SMI_CT_PHY_A_MSK = 0x1f<<11,/* Bit 15..11: PHY Device Address */ + GM_SMI_CT_REG_A_MSK = 0x1f<<6,/* Bit 10.. 6: PHY Register Address */ + GM_SMI_CT_OP_RD = 1<<5, /* Bit 5: OpCode Read (0=Write)*/ + GM_SMI_CT_RD_VAL = 1<<4, /* Bit 4: Read Valid (Read completed) */ + GM_SMI_CT_BUSY = 1<<3, /* Bit 3: Busy (Operation in progress) */ +}; + +#define GM_SMI_CT_PHY_AD(x) (((x)<<11) & GM_SMI_CT_PHY_A_MSK) +#define GM_SMI_CT_REG_AD(x) (((x)<<6) & GM_SMI_CT_REG_A_MSK) + +/* GM_PHY_ADDR 16 bit r/w GPHY Address Register */ +enum { + GM_PAR_MIB_CLR = 1<<5, /* Bit 5: Set MIB Clear Counter Mode */ + GM_PAR_MIB_TST = 1<<4, /* Bit 4: MIB Load Counter (Test Mode) */ +}; + +/* Receive Frame Status Encoding */ +enum { + GMR_FS_LEN = 0xffff<<16, /* Bit 31..16: Rx Frame Length */ + GMR_FS_VLAN = 1<<13, /* Bit 13: VLAN Packet */ + GMR_FS_JABBER = 1<<12, /* Bit 12: Jabber Packet */ + GMR_FS_UN_SIZE = 1<<11, /* Bit 11: Undersize Packet */ + GMR_FS_MC = 1<<10, /* Bit 10: Multicast Packet */ + GMR_FS_BC = 1<<9, /* Bit 9: Broadcast Packet */ + GMR_FS_RX_OK = 1<<8, /* Bit 8: Receive OK (Good Packet) */ + GMR_FS_GOOD_FC = 1<<7, /* Bit 7: Good Flow-Control Packet */ + GMR_FS_BAD_FC = 1<<6, /* Bit 6: Bad Flow-Control Packet */ + GMR_FS_MII_ERR = 1<<5, /* Bit 5: MII Error */ + GMR_FS_LONG_ERR = 1<<4, /* Bit 4: Too Long Packet */ + GMR_FS_FRAGMENT = 1<<3, /* Bit 3: Fragment */ + + GMR_FS_CRC_ERR = 1<<1, /* Bit 1: CRC Error */ + GMR_FS_RX_FF_OV = 1<<0, /* Bit 0: Rx FIFO Overflow */ + +/* + * GMR_FS_ANY_ERR (analogous to XMR_FS_ANY_ERR) + */ + GMR_FS_ANY_ERR = GMR_FS_CRC_ERR | GMR_FS_LONG_ERR | + GMR_FS_MII_ERR | GMR_FS_BAD_FC | GMR_FS_GOOD_FC | + GMR_FS_JABBER, +/* Rx GMAC FIFO Flush Mask (default) */ + RX_FF_FL_DEF_MSK = GMR_FS_CRC_ERR | GMR_FS_RX_FF_OV |GMR_FS_MII_ERR | + GMR_FS_BAD_FC | GMR_FS_GOOD_FC | GMR_FS_UN_SIZE | + GMR_FS_JABBER, +}; + +/* RX_GMF_CTRL_T 32 bit Rx GMAC FIFO Control/Test */ +enum { + GMF_WP_TST_ON = 1<<14, /* Write Pointer Test On */ + GMF_WP_TST_OFF = 1<<13, /* Write Pointer Test Off */ + GMF_WP_STEP = 1<<12, /* Write Pointer Step/Increment */ + + GMF_RP_TST_ON = 1<<10, /* Read Pointer Test On */ + GMF_RP_TST_OFF = 1<<9, /* Read Pointer Test Off */ + GMF_RP_STEP = 1<<8, /* Read Pointer Step/Increment */ + GMF_RX_F_FL_ON = 1<<7, /* Rx FIFO Flush Mode On */ + GMF_RX_F_FL_OFF = 1<<6, /* Rx FIFO Flush Mode Off */ + GMF_CLI_RX_FO = 1<<5, /* Clear IRQ Rx FIFO Overrun */ + GMF_CLI_RX_FC = 1<<4, /* Clear IRQ Rx Frame Complete */ + GMF_OPER_ON = 1<<3, /* Operational Mode On */ + GMF_OPER_OFF = 1<<2, /* Operational Mode Off */ + GMF_RST_CLR = 1<<1, /* Clear GMAC FIFO Reset */ + GMF_RST_SET = 1<<0, /* Set GMAC FIFO Reset */ + + RX_GMF_FL_THR_DEF = 0xa, /* flush threshold (default) */ +}; + + +/* TX_GMF_CTRL_T 32 bit Tx GMAC FIFO Control/Test */ +enum { + GMF_WSP_TST_ON = 1<<18,/* Write Shadow Pointer Test On */ + GMF_WSP_TST_OFF = 1<<17,/* Write Shadow Pointer Test Off */ + GMF_WSP_STEP = 1<<16,/* Write Shadow Pointer Step/Increment */ + + GMF_CLI_TX_FU = 1<<6, /* Clear IRQ Tx FIFO Underrun */ + GMF_CLI_TX_FC = 1<<5, /* Clear IRQ Tx Frame Complete */ + GMF_CLI_TX_PE = 1<<4, /* Clear IRQ Tx Parity Error */ +}; + +/* GMAC_TI_ST_CTRL 8 bit Time Stamp Timer Ctrl Reg (YUKON only) */ +enum { + GMT_ST_START = 1<<2, /* Start Time Stamp Timer */ + GMT_ST_STOP = 1<<1, /* Stop Time Stamp Timer */ + GMT_ST_CLR_IRQ = 1<<0, /* Clear Time Stamp Timer IRQ */ +}; + +/* GMAC_CTRL 32 bit GMAC Control Reg (YUKON only) */ +enum { + GMC_H_BURST_ON = 1<<7, /* Half Duplex Burst Mode On */ + GMC_H_BURST_OFF = 1<<6, /* Half Duplex Burst Mode Off */ + GMC_F_LOOPB_ON = 1<<5, /* FIFO Loopback On */ + GMC_F_LOOPB_OFF = 1<<4, /* FIFO Loopback Off */ + GMC_PAUSE_ON = 1<<3, /* Pause On */ + GMC_PAUSE_OFF = 1<<2, /* Pause Off */ + GMC_RST_CLR = 1<<1, /* Clear GMAC Reset */ + GMC_RST_SET = 1<<0, /* Set GMAC Reset */ +}; + +/* GPHY_CTRL 32 bit GPHY Control Reg (YUKON only) */ +enum { + GPC_SEL_BDT = 1<<28, /* Select Bi-Dir. Transfer for MDC/MDIO */ + GPC_INT_POL_HI = 1<<27, /* IRQ Polarity is Active HIGH */ + GPC_75_OHM = 1<<26, /* Use 75 Ohm Termination instead of 50 */ + GPC_DIS_FC = 1<<25, /* Disable Automatic Fiber/Copper Detection */ + GPC_DIS_SLEEP = 1<<24, /* Disable Energy Detect */ + GPC_HWCFG_M_3 = 1<<23, /* HWCFG_MODE[3] */ + GPC_HWCFG_M_2 = 1<<22, /* HWCFG_MODE[2] */ + GPC_HWCFG_M_1 = 1<<21, /* HWCFG_MODE[1] */ + GPC_HWCFG_M_0 = 1<<20, /* HWCFG_MODE[0] */ + GPC_ANEG_0 = 1<<19, /* ANEG[0] */ + GPC_ENA_XC = 1<<18, /* Enable MDI crossover */ + GPC_DIS_125 = 1<<17, /* Disable 125 MHz clock */ + GPC_ANEG_3 = 1<<16, /* ANEG[3] */ + GPC_ANEG_2 = 1<<15, /* ANEG[2] */ + GPC_ANEG_1 = 1<<14, /* ANEG[1] */ + GPC_ENA_PAUSE = 1<<13, /* Enable Pause (SYM_OR_REM) */ + GPC_PHYADDR_4 = 1<<12, /* Bit 4 of Phy Addr */ + GPC_PHYADDR_3 = 1<<11, /* Bit 3 of Phy Addr */ + GPC_PHYADDR_2 = 1<<10, /* Bit 2 of Phy Addr */ + GPC_PHYADDR_1 = 1<<9, /* Bit 1 of Phy Addr */ + GPC_PHYADDR_0 = 1<<8, /* Bit 0 of Phy Addr */ + /* Bits 7..2: reserved */ + GPC_RST_CLR = 1<<1, /* Clear GPHY Reset */ + GPC_RST_SET = 1<<0, /* Set GPHY Reset */ +}; + +#define GPC_HWCFG_GMII_COP (GPC_HWCFG_M_3|GPC_HWCFG_M_2 | GPC_HWCFG_M_1 | GPC_HWCFG_M_0) +#define GPC_HWCFG_GMII_FIB (GPC_HWCFG_M_2 | GPC_HWCFG_M_1 | GPC_HWCFG_M_0) +#define GPC_ANEG_ADV_ALL_M (GPC_ANEG_3 | GPC_ANEG_2 | GPC_ANEG_1 | GPC_ANEG_0) + +/* forced speed and duplex mode (don't mix with other ANEG bits) */ +#define GPC_FRC10MBIT_HALF 0 +#define GPC_FRC10MBIT_FULL GPC_ANEG_0 +#define GPC_FRC100MBIT_HALF GPC_ANEG_1 +#define GPC_FRC100MBIT_FULL (GPC_ANEG_0 | GPC_ANEG_1) + +/* auto-negotiation with limited advertised speeds */ +/* mix only with master/slave settings (for copper) */ +#define GPC_ADV_1000_HALF GPC_ANEG_2 +#define GPC_ADV_1000_FULL GPC_ANEG_3 +#define GPC_ADV_ALL (GPC_ANEG_2 | GPC_ANEG_3) + +/* master/slave settings */ +/* only for copper with 1000 Mbps */ +#define GPC_FORCE_MASTER 0 +#define GPC_FORCE_SLAVE GPC_ANEG_0 +#define GPC_PREF_MASTER GPC_ANEG_1 +#define GPC_PREF_SLAVE (GPC_ANEG_1 | GPC_ANEG_0) + +/* GMAC_IRQ_SRC 8 bit GMAC Interrupt Source Reg (YUKON only) */ +/* GMAC_IRQ_MSK 8 bit GMAC Interrupt Mask Reg (YUKON only) */ +enum { + GM_IS_TX_CO_OV = 1<<5, /* Transmit Counter Overflow IRQ */ + GM_IS_RX_CO_OV = 1<<4, /* Receive Counter Overflow IRQ */ + GM_IS_TX_FF_UR = 1<<3, /* Transmit FIFO Underrun */ + GM_IS_TX_COMPL = 1<<2, /* Frame Transmission Complete */ + GM_IS_RX_FF_OR = 1<<1, /* Receive FIFO Overrun */ + GM_IS_RX_COMPL = 1<<0, /* Frame Reception Complete */ + +#define GMAC_DEF_MSK (GM_IS_TX_CO_OV | GM_IS_RX_CO_OV | GM_IS_TX_FF_UR) + +/* GMAC_LINK_CTRL 16 bit GMAC Link Control Reg (YUKON only) */ + /* Bits 15.. 2: reserved */ + GMLC_RST_CLR = 1<<1, /* Clear GMAC Link Reset */ + GMLC_RST_SET = 1<<0, /* Set GMAC Link Reset */ + + +/* WOL_CTRL_STAT 16 bit WOL Control/Status Reg */ + WOL_CTL_LINK_CHG_OCC = 1<<15, + WOL_CTL_MAGIC_PKT_OCC = 1<<14, + WOL_CTL_PATTERN_OCC = 1<<13, + WOL_CTL_CLEAR_RESULT = 1<<12, + WOL_CTL_ENA_PME_ON_LINK_CHG = 1<<11, + WOL_CTL_DIS_PME_ON_LINK_CHG = 1<<10, + WOL_CTL_ENA_PME_ON_MAGIC_PKT = 1<<9, + WOL_CTL_DIS_PME_ON_MAGIC_PKT = 1<<8, + WOL_CTL_ENA_PME_ON_PATTERN = 1<<7, + WOL_CTL_DIS_PME_ON_PATTERN = 1<<6, + WOL_CTL_ENA_LINK_CHG_UNIT = 1<<5, + WOL_CTL_DIS_LINK_CHG_UNIT = 1<<4, + WOL_CTL_ENA_MAGIC_PKT_UNIT = 1<<3, + WOL_CTL_DIS_MAGIC_PKT_UNIT = 1<<2, + WOL_CTL_ENA_PATTERN_UNIT = 1<<1, + WOL_CTL_DIS_PATTERN_UNIT = 1<<0, +}; + +#define WOL_CTL_DEFAULT \ + (WOL_CTL_DIS_PME_ON_LINK_CHG | \ + WOL_CTL_DIS_PME_ON_PATTERN | \ + WOL_CTL_DIS_PME_ON_MAGIC_PKT | \ + WOL_CTL_DIS_LINK_CHG_UNIT | \ + WOL_CTL_DIS_PATTERN_UNIT | \ + WOL_CTL_DIS_MAGIC_PKT_UNIT) + +/* WOL_MATCH_CTL 8 bit WOL Match Control Reg */ +#define WOL_CTL_PATT_ENA(x) (1 << (x)) + + +/* XMAC II registers */ +enum { + XM_MMU_CMD = 0x0000, /* 16 bit r/w MMU Command Register */ + XM_POFF = 0x0008, /* 32 bit r/w Packet Offset Register */ + XM_BURST = 0x000c, /* 32 bit r/w Burst Register for half duplex*/ + XM_1L_VLAN_TAG = 0x0010, /* 16 bit r/w One Level VLAN Tag ID */ + XM_2L_VLAN_TAG = 0x0014, /* 16 bit r/w Two Level VLAN Tag ID */ + XM_TX_CMD = 0x0020, /* 16 bit r/w Transmit Command Register */ + XM_TX_RT_LIM = 0x0024, /* 16 bit r/w Transmit Retry Limit Register */ + XM_TX_STIME = 0x0028, /* 16 bit r/w Transmit Slottime Register */ + XM_TX_IPG = 0x002c, /* 16 bit r/w Transmit Inter Packet Gap */ + XM_RX_CMD = 0x0030, /* 16 bit r/w Receive Command Register */ + XM_PHY_ADDR = 0x0034, /* 16 bit r/w PHY Address Register */ + XM_PHY_DATA = 0x0038, /* 16 bit r/w PHY Data Register */ + XM_GP_PORT = 0x0040, /* 32 bit r/w General Purpose Port Register */ + XM_IMSK = 0x0044, /* 16 bit r/w Interrupt Mask Register */ + XM_ISRC = 0x0048, /* 16 bit r/o Interrupt Status Register */ + XM_HW_CFG = 0x004c, /* 16 bit r/w Hardware Config Register */ + XM_TX_LO_WM = 0x0060, /* 16 bit r/w Tx FIFO Low Water Mark */ + XM_TX_HI_WM = 0x0062, /* 16 bit r/w Tx FIFO High Water Mark */ + XM_TX_THR = 0x0064, /* 16 bit r/w Tx Request Threshold */ + XM_HT_THR = 0x0066, /* 16 bit r/w Host Request Threshold */ + XM_PAUSE_DA = 0x0068, /* NA reg r/w Pause Destination Address */ + XM_CTL_PARA = 0x0070, /* 32 bit r/w Control Parameter Register */ + XM_MAC_OPCODE = 0x0074, /* 16 bit r/w Opcode for MAC control frames */ + XM_MAC_PTIME = 0x0076, /* 16 bit r/w Pause time for MAC ctrl frames*/ + XM_TX_STAT = 0x0078, /* 32 bit r/o Tx Status LIFO Register */ + + XM_EXM_START = 0x0080, /* r/w Start Address of the EXM Regs */ +#define XM_EXM(reg) (XM_EXM_START + ((reg) << 3)) +}; + +enum { + XM_SRC_CHK = 0x0100, /* NA reg r/w Source Check Address Register */ + XM_SA = 0x0108, /* NA reg r/w Station Address Register */ + XM_HSM = 0x0110, /* 64 bit r/w Hash Match Address Registers */ + XM_RX_LO_WM = 0x0118, /* 16 bit r/w Receive Low Water Mark */ + XM_RX_HI_WM = 0x011a, /* 16 bit r/w Receive High Water Mark */ + XM_RX_THR = 0x011c, /* 32 bit r/w Receive Request Threshold */ + XM_DEV_ID = 0x0120, /* 32 bit r/o Device ID Register */ + XM_MODE = 0x0124, /* 32 bit r/w Mode Register */ + XM_LSA = 0x0128, /* NA reg r/o Last Source Register */ + XM_TS_READ = 0x0130, /* 32 bit r/o Time Stamp Read Register */ + XM_TS_LOAD = 0x0134, /* 32 bit r/o Time Stamp Load Value */ + XM_STAT_CMD = 0x0200, /* 16 bit r/w Statistics Command Register */ + XM_RX_CNT_EV = 0x0204, /* 32 bit r/o Rx Counter Event Register */ + XM_TX_CNT_EV = 0x0208, /* 32 bit r/o Tx Counter Event Register */ + XM_RX_EV_MSK = 0x020c, /* 32 bit r/w Rx Counter Event Mask */ + XM_TX_EV_MSK = 0x0210, /* 32 bit r/w Tx Counter Event Mask */ + XM_TXF_OK = 0x0280, /* 32 bit r/o Frames Transmitted OK Conuter */ + XM_TXO_OK_HI = 0x0284, /* 32 bit r/o Octets Transmitted OK High Cnt*/ + XM_TXO_OK_LO = 0x0288, /* 32 bit r/o Octets Transmitted OK Low Cnt */ + XM_TXF_BC_OK = 0x028c, /* 32 bit r/o Broadcast Frames Xmitted OK */ + XM_TXF_MC_OK = 0x0290, /* 32 bit r/o Multicast Frames Xmitted OK */ + XM_TXF_UC_OK = 0x0294, /* 32 bit r/o Unicast Frames Xmitted OK */ + XM_TXF_LONG = 0x0298, /* 32 bit r/o Tx Long Frame Counter */ + XM_TXE_BURST = 0x029c, /* 32 bit r/o Tx Burst Event Counter */ + XM_TXF_MPAUSE = 0x02a0, /* 32 bit r/o Tx Pause MAC Ctrl Frame Cnt */ + XM_TXF_MCTRL = 0x02a4, /* 32 bit r/o Tx MAC Ctrl Frame Counter */ + XM_TXF_SNG_COL = 0x02a8, /* 32 bit r/o Tx Single Collision Counter */ + XM_TXF_MUL_COL = 0x02ac, /* 32 bit r/o Tx Multiple Collision Counter */ + XM_TXF_ABO_COL = 0x02b0, /* 32 bit r/o Tx aborted due to Exces. Col. */ + XM_TXF_LAT_COL = 0x02b4, /* 32 bit r/o Tx Late Collision Counter */ + XM_TXF_DEF = 0x02b8, /* 32 bit r/o Tx Deferred Frame Counter */ + XM_TXF_EX_DEF = 0x02bc, /* 32 bit r/o Tx Excessive Deferall Counter */ + XM_TXE_FIFO_UR = 0x02c0, /* 32 bit r/o Tx FIFO Underrun Event Cnt */ + XM_TXE_CS_ERR = 0x02c4, /* 32 bit r/o Tx Carrier Sense Error Cnt */ + XM_TXP_UTIL = 0x02c8, /* 32 bit r/o Tx Utilization in % */ + XM_TXF_64B = 0x02d0, /* 32 bit r/o 64 Byte Tx Frame Counter */ + XM_TXF_127B = 0x02d4, /* 32 bit r/o 65-127 Byte Tx Frame Counter */ + XM_TXF_255B = 0x02d8, /* 32 bit r/o 128-255 Byte Tx Frame Counter */ + XM_TXF_511B = 0x02dc, /* 32 bit r/o 256-511 Byte Tx Frame Counter */ + XM_TXF_1023B = 0x02e0, /* 32 bit r/o 512-1023 Byte Tx Frame Counter*/ + XM_TXF_MAX_SZ = 0x02e4, /* 32 bit r/o 1024-MaxSize Byte Tx Frame Cnt*/ + XM_RXF_OK = 0x0300, /* 32 bit r/o Frames Received OK */ + XM_RXO_OK_HI = 0x0304, /* 32 bit r/o Octets Received OK High Cnt */ + XM_RXO_OK_LO = 0x0308, /* 32 bit r/o Octets Received OK Low Counter*/ + XM_RXF_BC_OK = 0x030c, /* 32 bit r/o Broadcast Frames Received OK */ + XM_RXF_MC_OK = 0x0310, /* 32 bit r/o Multicast Frames Received OK */ + XM_RXF_UC_OK = 0x0314, /* 32 bit r/o Unicast Frames Received OK */ + XM_RXF_MPAUSE = 0x0318, /* 32 bit r/o Rx Pause MAC Ctrl Frame Cnt */ + XM_RXF_MCTRL = 0x031c, /* 32 bit r/o Rx MAC Ctrl Frame Counter */ + XM_RXF_INV_MP = 0x0320, /* 32 bit r/o Rx invalid Pause Frame Cnt */ + XM_RXF_INV_MOC = 0x0324, /* 32 bit r/o Rx Frames with inv. MAC Opcode*/ + XM_RXE_BURST = 0x0328, /* 32 bit r/o Rx Burst Event Counter */ + XM_RXE_FMISS = 0x032c, /* 32 bit r/o Rx Missed Frames Event Cnt */ + XM_RXF_FRA_ERR = 0x0330, /* 32 bit r/o Rx Framing Error Counter */ + XM_RXE_FIFO_OV = 0x0334, /* 32 bit r/o Rx FIFO overflow Event Cnt */ + XM_RXF_JAB_PKT = 0x0338, /* 32 bit r/o Rx Jabber Packet Frame Cnt */ + XM_RXE_CAR_ERR = 0x033c, /* 32 bit r/o Rx Carrier Event Error Cnt */ + XM_RXF_LEN_ERR = 0x0340, /* 32 bit r/o Rx in Range Length Error */ + XM_RXE_SYM_ERR = 0x0344, /* 32 bit r/o Rx Symbol Error Counter */ + XM_RXE_SHT_ERR = 0x0348, /* 32 bit r/o Rx Short Event Error Cnt */ + XM_RXE_RUNT = 0x034c, /* 32 bit r/o Rx Runt Event Counter */ + XM_RXF_LNG_ERR = 0x0350, /* 32 bit r/o Rx Frame too Long Error Cnt */ + XM_RXF_FCS_ERR = 0x0354, /* 32 bit r/o Rx Frame Check Seq. Error Cnt */ + XM_RXF_CEX_ERR = 0x035c, /* 32 bit r/o Rx Carrier Ext Error Frame Cnt*/ + XM_RXP_UTIL = 0x0360, /* 32 bit r/o Rx Utilization in % */ + XM_RXF_64B = 0x0368, /* 32 bit r/o 64 Byte Rx Frame Counter */ + XM_RXF_127B = 0x036c, /* 32 bit r/o 65-127 Byte Rx Frame Counter */ + XM_RXF_255B = 0x0370, /* 32 bit r/o 128-255 Byte Rx Frame Counter */ + XM_RXF_511B = 0x0374, /* 32 bit r/o 256-511 Byte Rx Frame Counter */ + XM_RXF_1023B = 0x0378, /* 32 bit r/o 512-1023 Byte Rx Frame Counter*/ + XM_RXF_MAX_SZ = 0x037c, /* 32 bit r/o 1024-MaxSize Byte Rx Frame Cnt*/ +}; + +/* XM_MMU_CMD 16 bit r/w MMU Command Register */ +enum { + XM_MMU_PHY_RDY = 1<<12,/* Bit 12: PHY Read Ready */ + XM_MMU_PHY_BUSY = 1<<11,/* Bit 11: PHY Busy */ + XM_MMU_IGN_PF = 1<<10,/* Bit 10: Ignore Pause Frame */ + XM_MMU_MAC_LB = 1<<9, /* Bit 9: Enable MAC Loopback */ + XM_MMU_FRC_COL = 1<<7, /* Bit 7: Force Collision */ + XM_MMU_SIM_COL = 1<<6, /* Bit 6: Simulate Collision */ + XM_MMU_NO_PRE = 1<<5, /* Bit 5: No MDIO Preamble */ + XM_MMU_GMII_FD = 1<<4, /* Bit 4: GMII uses Full Duplex */ + XM_MMU_RAT_CTRL = 1<<3, /* Bit 3: Enable Rate Control */ + XM_MMU_GMII_LOOP= 1<<2, /* Bit 2: PHY is in Loopback Mode */ + XM_MMU_ENA_RX = 1<<1, /* Bit 1: Enable Receiver */ + XM_MMU_ENA_TX = 1<<0, /* Bit 0: Enable Transmitter */ +}; + + +/* XM_TX_CMD 16 bit r/w Transmit Command Register */ +enum { + XM_TX_BK2BK = 1<<6, /* Bit 6: Ignor Carrier Sense (Tx Bk2Bk)*/ + XM_TX_ENC_BYP = 1<<5, /* Bit 5: Set Encoder in Bypass Mode */ + XM_TX_SAM_LINE = 1<<4, /* Bit 4: (sc) Start utilization calculation */ + XM_TX_NO_GIG_MD = 1<<3, /* Bit 3: Disable Carrier Extension */ + XM_TX_NO_PRE = 1<<2, /* Bit 2: Disable Preamble Generation */ + XM_TX_NO_CRC = 1<<1, /* Bit 1: Disable CRC Generation */ + XM_TX_AUTO_PAD = 1<<0, /* Bit 0: Enable Automatic Padding */ +}; + +/* XM_TX_RT_LIM 16 bit r/w Transmit Retry Limit Register */ +#define XM_RT_LIM_MSK 0x1f /* Bit 4..0: Tx Retry Limit */ + + +/* XM_TX_STIME 16 bit r/w Transmit Slottime Register */ +#define XM_STIME_MSK 0x7f /* Bit 6..0: Tx Slottime bits */ + + +/* XM_TX_IPG 16 bit r/w Transmit Inter Packet Gap */ +#define XM_IPG_MSK 0xff /* Bit 7..0: IPG value bits */ + + +/* XM_RX_CMD 16 bit r/w Receive Command Register */ +enum { + XM_RX_LENERR_OK = 1<<8, /* Bit 8 don't set Rx Err bit for */ + /* inrange error packets */ + XM_RX_BIG_PK_OK = 1<<7, /* Bit 7 don't set Rx Err bit for */ + /* jumbo packets */ + XM_RX_IPG_CAP = 1<<6, /* Bit 6 repl. type field with IPG */ + XM_RX_TP_MD = 1<<5, /* Bit 5: Enable transparent Mode */ + XM_RX_STRIP_FCS = 1<<4, /* Bit 4: Enable FCS Stripping */ + XM_RX_SELF_RX = 1<<3, /* Bit 3: Enable Rx of own packets */ + XM_RX_SAM_LINE = 1<<2, /* Bit 2: (sc) Start utilization calculation */ + XM_RX_STRIP_PAD = 1<<1, /* Bit 1: Strip pad bytes of Rx frames */ + XM_RX_DIS_CEXT = 1<<0, /* Bit 0: Disable carrier ext. check */ +}; + + +/* XM_PHY_ADDR 16 bit r/w PHY Address Register */ +#define XM_PHY_ADDR_SZ 0x1f /* Bit 4..0: PHY Address bits */ + + +/* XM_GP_PORT 32 bit r/w General Purpose Port Register */ +enum { + XM_GP_ANIP = 1<<6, /* Bit 6: (ro) Auto-Neg. in progress */ + XM_GP_FRC_INT = 1<<5, /* Bit 5: (sc) Force Interrupt */ + XM_GP_RES_MAC = 1<<3, /* Bit 3: (sc) Reset MAC and FIFOs */ + XM_GP_RES_STAT = 1<<2, /* Bit 2: (sc) Reset the statistics module */ + XM_GP_INP_ASS = 1<<0, /* Bit 0: (ro) GP Input Pin asserted */ +}; + + +/* XM_IMSK 16 bit r/w Interrupt Mask Register */ +/* XM_ISRC 16 bit r/o Interrupt Status Register */ +enum { + XM_IS_LNK_AE = 1<<14, /* Bit 14: Link Asynchronous Event */ + XM_IS_TX_ABORT = 1<<13, /* Bit 13: Transmit Abort, late Col. etc */ + XM_IS_FRC_INT = 1<<12, /* Bit 12: Force INT bit set in GP */ + XM_IS_INP_ASS = 1<<11, /* Bit 11: Input Asserted, GP bit 0 set */ + XM_IS_LIPA_RC = 1<<10, /* Bit 10: Link Partner requests config */ + XM_IS_RX_PAGE = 1<<9, /* Bit 9: Page Received */ + XM_IS_TX_PAGE = 1<<8, /* Bit 8: Next Page Loaded for Transmit */ + XM_IS_AND = 1<<7, /* Bit 7: Auto-Negotiation Done */ + XM_IS_TSC_OV = 1<<6, /* Bit 6: Time Stamp Counter Overflow */ + XM_IS_RXC_OV = 1<<5, /* Bit 5: Rx Counter Event Overflow */ + XM_IS_TXC_OV = 1<<4, /* Bit 4: Tx Counter Event Overflow */ + XM_IS_RXF_OV = 1<<3, /* Bit 3: Receive FIFO Overflow */ + XM_IS_TXF_UR = 1<<2, /* Bit 2: Transmit FIFO Underrun */ + XM_IS_TX_COMP = 1<<1, /* Bit 1: Frame Tx Complete */ + XM_IS_RX_COMP = 1<<0, /* Bit 0: Frame Rx Complete */ +}; + +#define XM_DEF_MSK (~(XM_IS_INP_ASS | XM_IS_LIPA_RC | XM_IS_RX_PAGE | \ + XM_IS_AND | XM_IS_RXC_OV | XM_IS_TXC_OV | \ + XM_IS_RXF_OV | XM_IS_TXF_UR)) + + +/* XM_HW_CFG 16 bit r/w Hardware Config Register */ +enum { + XM_HW_GEN_EOP = 1<<3, /* Bit 3: generate End of Packet pulse */ + XM_HW_COM4SIG = 1<<2, /* Bit 2: use Comma Detect for Sig. Det.*/ + XM_HW_GMII_MD = 1<<0, /* Bit 0: GMII Interface selected */ +}; + + +/* XM_TX_LO_WM 16 bit r/w Tx FIFO Low Water Mark */ +/* XM_TX_HI_WM 16 bit r/w Tx FIFO High Water Mark */ +#define XM_TX_WM_MSK 0x01ff /* Bit 9.. 0 Tx FIFO Watermark bits */ + +/* XM_TX_THR 16 bit r/w Tx Request Threshold */ +/* XM_HT_THR 16 bit r/w Host Request Threshold */ +/* XM_RX_THR 16 bit r/w Rx Request Threshold */ +#define XM_THR_MSK 0x03ff /* Bit 10.. 0 Rx/Tx Request Threshold bits */ + + +/* XM_TX_STAT 32 bit r/o Tx Status LIFO Register */ +enum { + XM_ST_VALID = (1UL<<31), /* Bit 31: Status Valid */ + XM_ST_BYTE_CNT = (0x3fffL<<17), /* Bit 30..17: Tx frame Length */ + XM_ST_RETRY_CNT = (0x1fL<<12), /* Bit 16..12: Retry Count */ + XM_ST_EX_COL = 1<<11, /* Bit 11: Excessive Collisions */ + XM_ST_EX_DEF = 1<<10, /* Bit 10: Excessive Deferral */ + XM_ST_BURST = 1<<9, /* Bit 9: p. xmitted in burst md*/ + XM_ST_DEFER = 1<<8, /* Bit 8: packet was defered */ + XM_ST_BC = 1<<7, /* Bit 7: Broadcast packet */ + XM_ST_MC = 1<<6, /* Bit 6: Multicast packet */ + XM_ST_UC = 1<<5, /* Bit 5: Unicast packet */ + XM_ST_TX_UR = 1<<4, /* Bit 4: FIFO Underrun occured */ + XM_ST_CS_ERR = 1<<3, /* Bit 3: Carrier Sense Error */ + XM_ST_LAT_COL = 1<<2, /* Bit 2: Late Collision Error */ + XM_ST_MUL_COL = 1<<1, /* Bit 1: Multiple Collisions */ + XM_ST_SGN_COL = 1<<0, /* Bit 0: Single Collision */ +}; + +/* XM_RX_LO_WM 16 bit r/w Receive Low Water Mark */ +/* XM_RX_HI_WM 16 bit r/w Receive High Water Mark */ +#define XM_RX_WM_MSK 0x03ff /* Bit 11.. 0: Rx FIFO Watermark bits */ + + +/* XM_DEV_ID 32 bit r/o Device ID Register */ +#define XM_DEV_OUI (0x00ffffffUL<<8) /* Bit 31..8: Device OUI */ +#define XM_DEV_REV (0x07L << 5) /* Bit 7..5: Chip Rev Num */ + + +/* XM_MODE 32 bit r/w Mode Register */ +enum { + XM_MD_ENA_REJ = 1<<26, /* Bit 26: Enable Frame Reject */ + XM_MD_SPOE_E = 1<<25, /* Bit 25: Send Pause on Edge */ + /* extern generated */ + XM_MD_TX_REP = 1<<24, /* Bit 24: Transmit Repeater Mode */ + XM_MD_SPOFF_I = 1<<23, /* Bit 23: Send Pause on FIFO full */ + /* intern generated */ + XM_MD_LE_STW = 1<<22, /* Bit 22: Rx Stat Word in Little Endian */ + XM_MD_TX_CONT = 1<<21, /* Bit 21: Send Continuous */ + XM_MD_TX_PAUSE = 1<<20, /* Bit 20: (sc) Send Pause Frame */ + XM_MD_ATS = 1<<19, /* Bit 19: Append Time Stamp */ + XM_MD_SPOL_I = 1<<18, /* Bit 18: Send Pause on Low */ + /* intern generated */ + XM_MD_SPOH_I = 1<<17, /* Bit 17: Send Pause on High */ + /* intern generated */ + XM_MD_CAP = 1<<16, /* Bit 16: Check Address Pair */ + XM_MD_ENA_HASH = 1<<15, /* Bit 15: Enable Hashing */ + XM_MD_CSA = 1<<14, /* Bit 14: Check Station Address */ + XM_MD_CAA = 1<<13, /* Bit 13: Check Address Array */ + XM_MD_RX_MCTRL = 1<<12, /* Bit 12: Rx MAC Control Frame */ + XM_MD_RX_RUNT = 1<<11, /* Bit 11: Rx Runt Frames */ + XM_MD_RX_IRLE = 1<<10, /* Bit 10: Rx in Range Len Err Frame */ + XM_MD_RX_LONG = 1<<9, /* Bit 9: Rx Long Frame */ + XM_MD_RX_CRCE = 1<<8, /* Bit 8: Rx CRC Error Frame */ + XM_MD_RX_ERR = 1<<7, /* Bit 7: Rx Error Frame */ + XM_MD_DIS_UC = 1<<6, /* Bit 6: Disable Rx Unicast */ + XM_MD_DIS_MC = 1<<5, /* Bit 5: Disable Rx Multicast */ + XM_MD_DIS_BC = 1<<4, /* Bit 4: Disable Rx Broadcast */ + XM_MD_ENA_PROM = 1<<3, /* Bit 3: Enable Promiscuous */ + XM_MD_ENA_BE = 1<<2, /* Bit 2: Enable Big Endian */ + XM_MD_FTF = 1<<1, /* Bit 1: (sc) Flush Tx FIFO */ + XM_MD_FRF = 1<<0, /* Bit 0: (sc) Flush Rx FIFO */ +}; + +#define XM_PAUSE_MODE (XM_MD_SPOE_E | XM_MD_SPOL_I | XM_MD_SPOH_I) +#define XM_DEF_MODE (XM_MD_RX_RUNT | XM_MD_RX_IRLE | XM_MD_RX_LONG |\ + XM_MD_RX_CRCE | XM_MD_RX_ERR | XM_MD_CSA | XM_MD_CAA) + +/* XM_STAT_CMD 16 bit r/w Statistics Command Register */ +enum { + XM_SC_SNP_RXC = 1<<5, /* Bit 5: (sc) Snap Rx Counters */ + XM_SC_SNP_TXC = 1<<4, /* Bit 4: (sc) Snap Tx Counters */ + XM_SC_CP_RXC = 1<<3, /* Bit 3: Copy Rx Counters Continuously */ + XM_SC_CP_TXC = 1<<2, /* Bit 2: Copy Tx Counters Continuously */ + XM_SC_CLR_RXC = 1<<1, /* Bit 1: (sc) Clear Rx Counters */ + XM_SC_CLR_TXC = 1<<0, /* Bit 0: (sc) Clear Tx Counters */ +}; + + +/* XM_RX_CNT_EV 32 bit r/o Rx Counter Event Register */ +/* XM_RX_EV_MSK 32 bit r/w Rx Counter Event Mask */ +enum { + XMR_MAX_SZ_OV = 1<<31, /* Bit 31: 1024-MaxSize Rx Cnt Ov*/ + XMR_1023B_OV = 1<<30, /* Bit 30: 512-1023Byte Rx Cnt Ov*/ + XMR_511B_OV = 1<<29, /* Bit 29: 256-511 Byte Rx Cnt Ov*/ + XMR_255B_OV = 1<<28, /* Bit 28: 128-255 Byte Rx Cnt Ov*/ + XMR_127B_OV = 1<<27, /* Bit 27: 65-127 Byte Rx Cnt Ov */ + XMR_64B_OV = 1<<26, /* Bit 26: 64 Byte Rx Cnt Ov */ + XMR_UTIL_OV = 1<<25, /* Bit 25: Rx Util Cnt Overflow */ + XMR_UTIL_UR = 1<<24, /* Bit 24: Rx Util Cnt Underrun */ + XMR_CEX_ERR_OV = 1<<23, /* Bit 23: CEXT Err Cnt Ov */ + XMR_FCS_ERR_OV = 1<<21, /* Bit 21: Rx FCS Error Cnt Ov */ + XMR_LNG_ERR_OV = 1<<20, /* Bit 20: Rx too Long Err Cnt Ov*/ + XMR_RUNT_OV = 1<<19, /* Bit 19: Runt Event Cnt Ov */ + XMR_SHT_ERR_OV = 1<<18, /* Bit 18: Rx Short Ev Err Cnt Ov*/ + XMR_SYM_ERR_OV = 1<<17, /* Bit 17: Rx Sym Err Cnt Ov */ + XMR_CAR_ERR_OV = 1<<15, /* Bit 15: Rx Carr Ev Err Cnt Ov */ + XMR_JAB_PKT_OV = 1<<14, /* Bit 14: Rx Jabb Packet Cnt Ov */ + XMR_FIFO_OV = 1<<13, /* Bit 13: Rx FIFO Ov Ev Cnt Ov */ + XMR_FRA_ERR_OV = 1<<12, /* Bit 12: Rx Framing Err Cnt Ov */ + XMR_FMISS_OV = 1<<11, /* Bit 11: Rx Missed Ev Cnt Ov */ + XMR_BURST = 1<<10, /* Bit 10: Rx Burst Event Cnt Ov */ + XMR_INV_MOC = 1<<9, /* Bit 9: Rx with inv. MAC OC Ov*/ + XMR_INV_MP = 1<<8, /* Bit 8: Rx inv Pause Frame Ov */ + XMR_MCTRL_OV = 1<<7, /* Bit 7: Rx MAC Ctrl-F Cnt Ov */ + XMR_MPAUSE_OV = 1<<6, /* Bit 6: Rx Pause MAC Ctrl-F Ov*/ + XMR_UC_OK_OV = 1<<5, /* Bit 5: Rx Unicast Frame CntOv*/ + XMR_MC_OK_OV = 1<<4, /* Bit 4: Rx Multicast Cnt Ov */ + XMR_BC_OK_OV = 1<<3, /* Bit 3: Rx Broadcast Cnt Ov */ + XMR_OK_LO_OV = 1<<2, /* Bit 2: Octets Rx OK Low CntOv*/ + XMR_OK_HI_OV = 1<<1, /* Bit 1: Octets Rx OK Hi Cnt Ov*/ + XMR_OK_OV = 1<<0, /* Bit 0: Frames Received Ok Ov */ +}; + +#define XMR_DEF_MSK (XMR_OK_LO_OV | XMR_OK_HI_OV) + +/* XM_TX_CNT_EV 32 bit r/o Tx Counter Event Register */ +/* XM_TX_EV_MSK 32 bit r/w Tx Counter Event Mask */ +enum { + XMT_MAX_SZ_OV = 1<<25, /* Bit 25: 1024-MaxSize Tx Cnt Ov*/ + XMT_1023B_OV = 1<<24, /* Bit 24: 512-1023Byte Tx Cnt Ov*/ + XMT_511B_OV = 1<<23, /* Bit 23: 256-511 Byte Tx Cnt Ov*/ + XMT_255B_OV = 1<<22, /* Bit 22: 128-255 Byte Tx Cnt Ov*/ + XMT_127B_OV = 1<<21, /* Bit 21: 65-127 Byte Tx Cnt Ov */ + XMT_64B_OV = 1<<20, /* Bit 20: 64 Byte Tx Cnt Ov */ + XMT_UTIL_OV = 1<<19, /* Bit 19: Tx Util Cnt Overflow */ + XMT_UTIL_UR = 1<<18, /* Bit 18: Tx Util Cnt Underrun */ + XMT_CS_ERR_OV = 1<<17, /* Bit 17: Tx Carr Sen Err Cnt Ov*/ + XMT_FIFO_UR_OV = 1<<16, /* Bit 16: Tx FIFO Ur Ev Cnt Ov */ + XMT_EX_DEF_OV = 1<<15, /* Bit 15: Tx Ex Deferall Cnt Ov */ + XMT_DEF = 1<<14, /* Bit 14: Tx Deferred Cnt Ov */ + XMT_LAT_COL_OV = 1<<13, /* Bit 13: Tx Late Col Cnt Ov */ + XMT_ABO_COL_OV = 1<<12, /* Bit 12: Tx abo dueto Ex Col Ov*/ + XMT_MUL_COL_OV = 1<<11, /* Bit 11: Tx Mult Col Cnt Ov */ + XMT_SNG_COL = 1<<10, /* Bit 10: Tx Single Col Cnt Ov */ + XMT_MCTRL_OV = 1<<9, /* Bit 9: Tx MAC Ctrl Counter Ov*/ + XMT_MPAUSE = 1<<8, /* Bit 8: Tx Pause MAC Ctrl-F Ov*/ + XMT_BURST = 1<<7, /* Bit 7: Tx Burst Event Cnt Ov */ + XMT_LONG = 1<<6, /* Bit 6: Tx Long Frame Cnt Ov */ + XMT_UC_OK_OV = 1<<5, /* Bit 5: Tx Unicast Cnt Ov */ + XMT_MC_OK_OV = 1<<4, /* Bit 4: Tx Multicast Cnt Ov */ + XMT_BC_OK_OV = 1<<3, /* Bit 3: Tx Broadcast Cnt Ov */ + XMT_OK_LO_OV = 1<<2, /* Bit 2: Octets Tx OK Low CntOv*/ + XMT_OK_HI_OV = 1<<1, /* Bit 1: Octets Tx OK Hi Cnt Ov*/ + XMT_OK_OV = 1<<0, /* Bit 0: Frames Tx Ok Ov */ +}; + +#define XMT_DEF_MSK (XMT_OK_LO_OV | XMT_OK_HI_OV) + +struct skge_rx_desc { + u32 control; + u32 next_offset; + u32 dma_lo; + u32 dma_hi; + u32 status; + u32 timestamp; + u16 csum2; + u16 csum1; + u16 csum2_start; + u16 csum1_start; +}; + +struct skge_tx_desc { + u32 control; + u32 next_offset; + u32 dma_lo; + u32 dma_hi; + u32 status; + u32 csum_offs; + u16 csum_write; + u16 csum_start; + u32 rsvd; +}; + +struct skge_element { + struct skge_element *next; + void *desc; + struct sk_buff *skb; + DECLARE_PCI_UNMAP_ADDR(mapaddr); + DECLARE_PCI_UNMAP_LEN(maplen); +}; + +struct skge_ring { + struct skge_element *to_clean; + struct skge_element *to_use; + struct skge_element *start; + unsigned long count; +}; + + +struct skge_hw { + void __iomem *regs; + struct pci_dev *pdev; + u32 intr_mask; + struct net_device *dev[2]; + + u8 mac_cfg; + u8 chip_id; + u8 phy_type; + u8 pmd_type; + u16 phy_addr; + + u32 ram_size; + u32 ram_offset; + + struct tasklet_struct ext_tasklet; + spinlock_t phy_lock; +}; + +static inline int isdualport(const struct skge_hw *hw) +{ + return !(hw->mac_cfg & CFG_SNG_MAC); +} + +static inline u8 chip_rev(const struct skge_hw *hw) +{ + return (hw->mac_cfg & CFG_CHIP_R_MSK) >> 4; +} + +static inline int iscopper(const struct skge_hw *hw) +{ + return (hw->pmd_type == 'T'); +} + +enum { + FLOW_MODE_NONE = 0, /* No Flow-Control */ + FLOW_MODE_LOC_SEND = 1, /* Local station sends PAUSE */ + FLOW_MODE_REM_SEND = 2, /* Symmetric or just remote */ + FLOW_MODE_SYMMETRIC = 3, /* Both stations may send PAUSE */ +}; + +struct skge_port { + u32 msg_enable; + struct skge_hw *hw; + struct net_device *netdev; + int port; + + spinlock_t tx_lock; + u32 tx_avail; + struct skge_ring tx_ring; + struct skge_ring rx_ring; + + struct net_device_stats net_stats; + + u8 rx_csum; + u8 blink_on; + u8 flow_control; + u8 wol; + u8 autoneg; /* AUTONEG_ENABLE, AUTONEG_DISABLE */ + u8 duplex; /* DUPLEX_HALF, DUPLEX_FULL */ + u16 speed; /* SPEED_1000, SPEED_100, ... */ + u32 advertising; + + void *mem; /* PCI memory for rings */ + dma_addr_t dma; + unsigned long mem_size; + + struct timer_list link_check; + struct timer_list led_blink; +}; + + +/* Register accessor for memory mapped device */ +static inline u32 skge_read32(const struct skge_hw *hw, int reg) +{ + return readl(hw->regs + reg); + +} + +static inline u16 skge_read16(const struct skge_hw *hw, int reg) +{ + return readw(hw->regs + reg); +} + +static inline u8 skge_read8(const struct skge_hw *hw, int reg) +{ + return readb(hw->regs + reg); +} + +static inline void skge_write32(const struct skge_hw *hw, int reg, u32 val) +{ + writel(val, hw->regs + reg); +} + +static inline void skge_write16(const struct skge_hw *hw, int reg, u16 val) +{ + writew(val, hw->regs + reg); +} + +static inline void skge_write8(const struct skge_hw *hw, int reg, u8 val) +{ + writeb(val, hw->regs + reg); +} + +/* MAC Related Registers inside the device. */ +#define SKGEMAC_REG(port,reg) (((port)<<7)+(reg)) + +/* PCI config space can be accessed via memory mapped space */ +#define SKGEPCI_REG(reg) ((reg)+ 0x380) + +#define SKGEXM_REG(port, reg) \ + ((BASE_XMAC_1 + (port) * (BASE_XMAC_2 - BASE_XMAC_1)) | (reg) << 1) + +static inline u32 skge_xm_read32(const struct skge_hw *hw, int port, int reg) +{ + return skge_read32(hw, SKGEXM_REG(port,reg)); +} + +static inline u16 skge_xm_read16(const struct skge_hw *hw, int port, int reg) +{ + return skge_read16(hw, SKGEXM_REG(port,reg)); +} + +static inline u8 skge_xm_read8(const struct skge_hw *hw, int port, int reg) +{ + return skge_read8(hw, SKGEXM_REG(port,reg)); +} + +static inline void skge_xm_write32(const struct skge_hw *hw, int port, int r, u32 v) +{ + skge_write32(hw, SKGEXM_REG(port,r), v); +} + +static inline void skge_xm_write16(const struct skge_hw *hw, int port, int r, u16 v) +{ + skge_write16(hw, SKGEXM_REG(port,r), v); +} + +static inline void skge_xm_write8(const struct skge_hw *hw, int port, int r, u8 v) +{ + skge_write8(hw, SKGEXM_REG(port,r), v); +} + +static inline void skge_xm_outhash(const struct skge_hw *hw, int port, int reg, + const u8 *hash) +{ + skge_xm_write16(hw, port, reg, + (u16)hash[0] | ((u16)hash[1] << 8)); + skge_xm_write16(hw, port, reg+2, + (u16)hash[2] | ((u16)hash[3] << 8)); + skge_xm_write16(hw, port, reg+4, + (u16)hash[4] | ((u16)hash[5] << 8)); + skge_xm_write16(hw, port, reg+6, + (u16)hash[6] | ((u16)hash[7] << 8)); +} + +static inline void skge_xm_outaddr(const struct skge_hw *hw, int port, int reg, + const u8 *addr) +{ + skge_xm_write16(hw, port, reg, + (u16)addr[0] | ((u16)addr[1] << 8)); + skge_xm_write16(hw, port, reg, + (u16)addr[2] | ((u16)addr[3] << 8)); + skge_xm_write16(hw, port, reg, + (u16)addr[4] | ((u16)addr[5] << 8)); +} + + +#define SKGEGMA_REG(port,reg) \ + ((reg) + BASE_GMAC_1 + \ + (port) * (BASE_GMAC_2-BASE_GMAC_1)) + +static inline u16 skge_gma_read16(const struct skge_hw *hw, int port, int reg) +{ + return skge_read16(hw, SKGEGMA_REG(port,reg)); +} + +static inline u32 skge_gma_read32(const struct skge_hw *hw, int port, int reg) +{ + return (u32) skge_read16(hw, SKGEGMA_REG(port,reg)) + | ((u32)skge_read16(hw, SKGEGMA_REG(port,reg+4)) << 16); +} + +static inline u8 skge_gma_read8(const struct skge_hw *hw, int port, int reg) +{ + return skge_read8(hw, SKGEGMA_REG(port,reg)); +} + +static inline void skge_gma_write16(const struct skge_hw *hw, int port, int r, u16 v) +{ + skge_write16(hw, SKGEGMA_REG(port,r), v); +} + +static inline void skge_gma_write32(const struct skge_hw *hw, int port, int r, u32 v) +{ + skge_write16(hw, SKGEGMA_REG(port, r), (u16) v); + skge_write32(hw, SKGEGMA_REG(port, r+4), (u16)(v >> 16)); +} + +static inline void skge_gma_write8(const struct skge_hw *hw, int port, int r, u8 v) +{ + skge_write8(hw, SKGEGMA_REG(port,r), v); +} + +static inline void skge_gm_set_addr(struct skge_hw *hw, int port, int reg, + const u8 *addr) +{ + skge_gma_write16(hw, port, reg, + (u16) addr[0] | ((u16) addr[1] << 8)); + skge_gma_write16(hw, port, reg+4, + (u16) addr[2] | ((u16) addr[3] << 8)); + skge_gma_write16(hw, port, reg+8, + (u16) addr[4] | ((u16) addr[5] << 8)); +} + +#endif From tgraf@suug.ch Tue Jan 25 15:22:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 15:22:44 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0PNMYC2026640 for ; Tue, 25 Jan 2005 15:22:34 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id D32B6F; Wed, 26 Jan 2005 00:22:10 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 0DF531C0EA; Wed, 26 Jan 2005 00:22:54 +0100 (CET) Date: Wed, 26 Jan 2005 00:22:53 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [RESEND 1/6] PKT_SCHED: Extended Matches API Message-ID: <20050125232253.GI31837@postel.suug.ch> References: <20050123230012.GB23931@postel.suug.ch> <20050123230132.GC23931@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050123230132.GC23931@postel.suug.ch> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 774 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 25588 Lines: 864 Resend with Patrick's comments addressed. An extended match (ematch) is a small classifiction tool not worth writing a full classifier for. Ematches can be interconnected to form a logic expression and get attached to classifiers to extend their functionatlity. The userspace part transforms the logic expressions into an array consisting of multiple sequences of interconnected ematches separated by markers. Precedence is implemented by a special ematch kind referencing a sequence beyond the marker of the current sequence causing the current position in the sequence to be pushed onto a stack to allow the current position to be overwritten by the position referenced in the special ematch. Matching continues in the new sequence until a marker is reached causing the position to be restored from the stack. Signed-off-by: Thomas Graf diff -Nru linux-2.6.11-rc2-bk3.orig/include/linux/pkt_cls.h linux-2.6.11-rc2-bk3/include/linux/pkt_cls.h --- linux-2.6.11-rc2-bk3.orig/include/linux/pkt_cls.h 2005-01-25 23:02:54.000000000 +0100 +++ linux-2.6.11-rc2-bk3/include/linux/pkt_cls.h 2005-01-25 23:19:02.000000000 +0100 @@ -319,4 +319,76 @@ #define TCA_TCINDEX_MAX (__TCA_TCINDEX_MAX - 1) +/* Extended Matches */ + +struct tcf_ematch_tree_hdr +{ + __u16 nmatches; + __u16 progid; +}; + +enum +{ + TCA_EMATCH_TREE_UNSPEC, + TCA_EMATCH_TREE_HDR, + TCA_EMATCH_TREE_LIST, + __TCA_EMATCH_TREE_MAX +}; +#define TCA_EMATCH_TREE_MAX (__TCA_EMATCH_TREE_MAX - 1) + +struct tcf_ematch_hdr +{ + __u16 matchid; + __u16 kind; + __u16 flags; + __u16 pad; /* currently unused */ +}; + +/* 0 1 + * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 + * +-----------------------+-+-+---+ + * | Unused |S|I| R | + * +-----------------------+-+-+---+ + * + * R(2) ::= relation to next ematch + * where: 0 0 END (last ematch) + * 0 1 AND + * 1 0 OR + * 1 1 Unused (invalid) + * I(1) ::= invert result + * S(1) ::= simple payload + */ +#define TCF_EM_REL_END 0 +#define TCF_EM_REL_AND (1<<0) +#define TCF_EM_REL_OR (1<<1) +#define TCF_EM_INVERT (1<<2) +#define TCF_EM_SIMPLE (1<<3) + +#define TCF_EM_REL_MASK 3 +#define TCF_EM_REL_VALID(v) (((v) & TCF_EM_REL_MASK) != TCF_EM_REL_MASK) + +enum +{ + TCF_LAYER_LINK, + TCF_LAYER_NETWORK, + TCF_LAYER_TRANSPORT, + __TCF_LAYER_MAX +}; +#define TCF_LAYER_MAX (__TCF_LAYER_MAX - 1) + +/* Ematch type assignments + * 1..32767 Reserved for ematches inside kernel tree + * 32768..65535 Free to use, not reliable + */ +enum +{ + TCF_EM_CONTAINER, + __TCF_EM_MAX +}; + +enum +{ + TCF_EM_PROG_TC +}; + #endif diff -Nru linux-2.6.11-rc2-bk3.orig/include/linux/rtnetlink.h linux-2.6.11-rc2-bk3/include/linux/rtnetlink.h --- linux-2.6.11-rc2-bk3.orig/include/linux/rtnetlink.h 2005-01-25 23:02:54.000000000 +0100 +++ linux-2.6.11-rc2-bk3/include/linux/rtnetlink.h 2005-01-25 23:19:02.000000000 +0100 @@ -779,6 +779,11 @@ goto rtattr_failure; \ __rta_fill(skb, attrtype, attrlen, data); }) +#define RTA_PUT_NOHDR(skb, attrlen, data) \ +({ if (unlikely(skb_tailroom(skb) < (int)(attrlen))) \ + goto rtattr_failure; \ + memcpy(skb_put(skb, RTA_ALIGN(attrlen)), data, attrlen); }) + static inline struct rtattr * __rta_reserve(struct sk_buff *skb, int attrtype, int attrlen) { diff -Nru linux-2.6.11-rc2-bk3.orig/include/net/pkt_cls.h linux-2.6.11-rc2-bk3/include/net/pkt_cls.h --- linux-2.6.11-rc2-bk3.orig/include/net/pkt_cls.h 2005-01-25 23:02:54.000000000 +0100 +++ linux-2.6.11-rc2-bk3/include/net/pkt_cls.h 2005-01-25 23:23:24.000000000 +0100 @@ -148,6 +148,176 @@ extern int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts, struct tcf_ext_map *map); +/** + * struct tcf_pkt_info - packet information + */ +struct tcf_pkt_info +{ +}; + +#ifdef CONFIG_NET_EMATCH + +struct tcf_ematch_ops; + +/** + * struct tcf_ematch - extended match (ematch) + * + * @matchid: identifier to allow userspace to reidentify a match + * @flags: flags specifying attributes and the relation to other matches + * @ops: the operations lookup table of the corresponding ematch module + * @datalen: length of the ematch specific configuration data + * @data: ematch specific data + */ +struct tcf_ematch +{ + struct tcf_ematch_ops * ops; + unsigned long data; + unsigned int datalen; + u16 matchid; + u16 flags; +}; + +static inline int tcf_em_is_container(struct tcf_ematch *em) +{ + return !em->ops; +} + +static inline int tcf_em_is_simple(struct tcf_ematch *em) +{ + return em->flags & TCF_EM_SIMPLE; +} + +static inline int tcf_em_is_inverted(struct tcf_ematch *em) +{ + return em->flags & TCF_EM_INVERT; +} + +static inline int tcf_em_last_match(struct tcf_ematch *em) +{ + return (em->flags & TCF_EM_REL_MASK) == TCF_EM_REL_END; +} + +static inline int tcf_em_early_end(struct tcf_ematch *em, int result) +{ + if (tcf_em_last_match(em)) + return 1; + + if (result == 0 && em->flags & TCF_EM_REL_AND) + return 1; + + if (result != 0 && em->flags & TCF_EM_REL_OR) + return 1; + + return 0; +} + +/** + * struct tcf_ematch_tree - ematch tree handle + * + * @hdr: ematch tree header supplied by userspace + * @matches: array of ematches + */ +struct tcf_ematch_tree +{ + struct tcf_ematch_tree_hdr hdr; + struct tcf_ematch * matches; + +}; + +/** + * struct tcf_ematch_ops - ematch module operations + * + * @kind: identifier (kind) of this ematch module + * @datalen: length of expected configuration data (optional) + * @change: called during validation (optional) + * @match: called during ematch tree evaluation, must return 1/0 + * @destroy: called during destroyage (optional) + * @dump: called during dumping process (optional) + * @owner: owner, must be set to THIS_MODULE + * @link: link to previous/next ematch module (internal use) + */ +struct tcf_ematch_ops +{ + int kind; + int datalen; + int (*change)(struct tcf_proto *, void *, + int, struct tcf_ematch *); + int (*match)(struct sk_buff *, struct tcf_ematch *, + struct tcf_pkt_info *); + void (*destroy)(struct tcf_proto *, + struct tcf_ematch *); + int (*dump)(struct sk_buff *, struct tcf_ematch *); + struct module *owner; + struct list_head link; +}; + +extern int tcf_em_register(struct tcf_ematch_ops *); +extern int tcf_em_unregister(struct tcf_ematch_ops *); +extern int tcf_em_tree_validate(struct tcf_proto *, struct rtattr *, + struct tcf_ematch_tree *); +extern void tcf_em_tree_destroy(struct tcf_proto *, struct tcf_ematch_tree *); +extern int tcf_em_tree_dump(struct sk_buff *, struct tcf_ematch_tree *, int); +extern int __tcf_em_tree_match(struct sk_buff *, struct tcf_ematch_tree *, + struct tcf_pkt_info *); + +/** + * tcf_em_tree_change - replace ematch tree of a running classifier + * + * @tp: classifier kind handle + * @dst: destination ematch tree variable + * @src: source ematch tree (temporary tree from tcf_em_tree_validate) + * + * This functions replaces the ematch tree in @dst with the ematch + * tree in @src. The classifier in charge of the ematch tree may be + * running. + */ +static inline void tcf_em_tree_change(struct tcf_proto *tp, + struct tcf_ematch_tree *dst, + struct tcf_ematch_tree *src) +{ + tcf_tree_lock(tp); + memcpy(dst, src, sizeof(*dst)); + tcf_tree_unlock(tp); +} + +/** + * tcf_em_tree_match - evaulate an ematch tree + * + * @skb: socket buffer of the packet in question + * @tree: ematch tree to be used for evaluation + * @info: packet information examined by classifier + * + * This function matches @skb against the ematch tree in @tree by going + * through all ematches respecting their logic relations returning + * as soon as the result is obvious. + * + * Returns 1 if the ematch tree as-one matches, no ematches are configured + * or ematch is not enabled in the kernel, otherwise 0 is returned. + */ +static inline int tcf_em_tree_match(struct sk_buff *skb, + struct tcf_ematch_tree *tree, + struct tcf_pkt_info *info) +{ + if (tree->hdr.nmatches) + return __tcf_em_tree_match(skb, tree, info); + else + return 1; +} + +#else /* CONFIG_NET_EMATCH */ + +struct tcf_ematch_tree +{ +}; + +#define tcf_em_tree_validate(tp, tb, t) ((void)(t), 0) +#define tcf_em_tree_destroy(tp, t) do { (void)(t); } while(0) +#define tcf_em_tree_dump(skb, t, tlv) (0) +#define tcf_em_tree_change(tp, dst, src) do { } while(0) +#define tcf_em_tree_match(skb, t, info) ((void)(info), 1) + +#endif /* CONFIG_NET_EMATCH */ + #ifdef CONFIG_NET_CLS_IND static inline int tcf_change_indev(struct tcf_proto *tp, char *indev, struct rtattr *indev_tlv) diff -Nru linux-2.6.11-rc2-bk3.orig/net/sched/Kconfig linux-2.6.11-rc2-bk3/net/sched/Kconfig --- linux-2.6.11-rc2-bk3.orig/net/sched/Kconfig 2005-01-25 23:03:36.000000000 +0100 +++ linux-2.6.11-rc2-bk3/net/sched/Kconfig 2005-01-25 23:19:02.000000000 +0100 @@ -375,6 +375,29 @@ To compile this code as a module, choose M here: the module will be called cls_rsvp6. +config NET_EMATCH + bool "Extended Matches" + depends on NET_CLS + ---help--- + Say Y here if you want to use extended matches on top of classifiers + and select the extended matches below. + + Extended matches are small classification helpers not worth writing + a separate classifier. + + You must have a recent version of the iproute2 tools in order to use + extended matches. + +config NET_EMATCH_STACK + int "Stack size" + depends on NET_EMATCH + default "32" + ---help--- + Size of the local stack variable used while evaluating the tree of + ematches. Limits the depth of the tree, i.e. the number of + encapsulated precedences. Every level requires 4 bytes of addtional + stack space. + config NET_CLS_ACT bool "Packet ACTION" depends on EXPERIMENTAL && NET_CLS && NET_QOS diff -Nru linux-2.6.11-rc2-bk3.orig/net/sched/Makefile linux-2.6.11-rc2-bk3/net/sched/Makefile --- linux-2.6.11-rc2-bk3.orig/net/sched/Makefile 2005-01-25 23:03:36.000000000 +0100 +++ linux-2.6.11-rc2-bk3/net/sched/Makefile 2005-01-25 23:19:02.000000000 +0100 @@ -33,3 +33,4 @@ obj-$(CONFIG_NET_CLS_RSVP) += cls_rsvp.o obj-$(CONFIG_NET_CLS_TCINDEX) += cls_tcindex.o obj-$(CONFIG_NET_CLS_RSVP6) += cls_rsvp6.o +obj-$(CONFIG_NET_EMATCH) += ematch.o diff -Nru linux-2.6.11-rc2-bk3.orig/net/sched/ematch.c linux-2.6.11-rc2-bk3/net/sched/ematch.c --- linux-2.6.11-rc2-bk3.orig/net/sched/ematch.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.11-rc2-bk3/net/sched/ematch.c 2005-01-25 23:40:54.000000000 +0100 @@ -0,0 +1,524 @@ +/* + * net/sched/ematch.c Extended Match API + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: Thomas Graf + * + * ========================================================================== + * + * An extended match (ematch) is a small classification tool not worth + * writing a full classifier for. Ematches can be interconnected to form + * a logic expression and get attached to classifiers to extend their + * functionatlity. + * + * The userspace part transforms the logic expressions into an array + * consisting of multiple sequences of interconnected ematches separated + * by markers. Precedence is implemented by a special ematch kind + * referencing a sequence beyond the marker of the current sequence + * causing the current position in the sequence to be pushed onto a stack + * to allow the current position to be overwritten by the position referenced + * in the special ematch. Matching continues in the new sequence until a + * marker is reached causing the position to be restored from the stack. + * + * Example: + * A AND (B1 OR B2) AND C AND D + * + * ------->-PUSH------- + * -->-- / -->-- \ -->-- + * / \ / / \ \ / \ + * +-------+-------+-------+-------+-------+--------+ + * | A AND | B AND | C AND | D END | B1 OR | B2 END | + * +-------+-------+-------+-------+-------+--------+ + * \ / + * --------<-POP--------- + * + * where B is a virtual ematch referencing to sequence starting with B1. + * + * ========================================================================== + * + * How to write an ematch in 60 seconds + * ------------------------------------ + * + * 1) Provide a matcher function: + * static int my_match(struct sk_buff *skb, struct tcf_ematch *m, + * struct tcf_pkt_info *info) + * { + * struct mydata *d = (struct mydata *) m->data; + * + * if (...matching goes here...) + * return 1; + * else + * return 0; + * } + * + * 2) Fill out a struct tcf_ematch_ops: + * static struct tcf_ematch_ops my_ops = { + * .kind = unique id, + * .datalen = sizeof(struct mydata), + * .match = my_match, + * .owner = THIS_MODULE, + * }; + * + * 3) Register/Unregister your ematch: + * static int __init init_my_ematch(void) + * { + * return tcf_em_register(&my_ops); + * } + * + * static void __exit exit_my_ematch(void) + * { + * return tcf_em_unregister(&my_ops); + * } + * + * module_init(init_my_ematch); + * module_exit(exit_my_ematch); + * + * 4) By now you should have two more seconds left, barely enough to + * open up a beer to watch the compilation going. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static LIST_HEAD(ematch_ops); +static DEFINE_RWLOCK(ematch_mod_lock); + +static inline struct tcf_ematch_ops * tcf_em_lookup(u16 kind) +{ + struct tcf_ematch_ops *e = NULL; + + read_lock(&ematch_mod_lock); + list_for_each_entry(e, &ematch_ops, link) { + if (kind == e->kind) { + if (!try_module_get(e->owner)) + e = NULL; + read_unlock(&ematch_mod_lock); + return e; + } + } + read_unlock(&ematch_mod_lock); + + return NULL; +} + +/** + * tcf_em_register - register an extended match + * + * @ops: ematch operations lookup table + * + * This function must be called by ematches to announce their presence. + * The given @ops must have kind set to a unique identifier and the + * callback match() must be implemented. All other callbacks are optional + * and a fallback implementation is used instead. + * + * Returns -EEXISTS if an ematch of the same kind has already registered. + */ +int tcf_em_register(struct tcf_ematch_ops *ops) +{ + int err = -EEXIST; + struct tcf_ematch_ops *e; + + if (ops->match == NULL) + return -EINVAL; + + write_lock(&ematch_mod_lock); + list_for_each_entry(e, &ematch_ops, link) + if (ops->kind == e->kind) + goto errout; + + list_add_tail(&ops->link, &ematch_ops); + err = 0; +errout: + write_unlock(&ematch_mod_lock); + return err; +} + +/** + * tcf_em_unregister - unregster and extended match + * + * @ops: ematch operations lookup table + * + * This function must be called by ematches to announce their disappearance + * for examples when the module gets unloaded. The @ops parameter must be + * the same as the one used for registration. + * + * Returns -ENOENT if no matching ematch was found. + */ +int tcf_em_unregister(struct tcf_ematch_ops *ops) +{ + int err = 0; + struct tcf_ematch_ops *e; + + write_lock(&ematch_mod_lock); + list_for_each_entry(e, &ematch_ops, link) { + if (e == ops) { + list_del(&e->link); + goto out; + } + } + + err = -ENOENT; +out: + write_unlock(&ematch_mod_lock); + return err; +} + +static inline struct tcf_ematch * tcf_em_get_match(struct tcf_ematch_tree *tree, + int index) +{ + return &tree->matches[index]; +} + + +static int tcf_em_validate(struct tcf_proto *tp, + struct tcf_ematch_tree_hdr *tree_hdr, + struct tcf_ematch *em, struct rtattr *rta, int idx) +{ + int err = -EINVAL; + struct tcf_ematch_hdr *em_hdr = RTA_DATA(rta); + int data_len = RTA_PAYLOAD(rta) - sizeof(*em_hdr); + void *data = (void *) em_hdr + sizeof(*em_hdr); + + if (!TCF_EM_REL_VALID(em_hdr->flags)) + goto errout; + + if (em_hdr->kind == TCF_EM_CONTAINER) { + /* Special ematch called "container", carries an index + * referencing an external ematch sequence. */ + u32 ref; + + if (data_len < sizeof(ref)) + goto errout; + ref = *(u32 *) data; + + if (ref >= tree_hdr->nmatches) + goto errout; + + /* We do not allow backward jumps to avoid loops and jumps + * to our own position are of course illegal. */ + if (ref <= idx) + goto errout; + + + em->data = ref; + } else { + /* Note: This lookup will increase the module refcnt + * of the ematch module referenced. In case of a failure, + * a destroy function is called by the underlying layer + * which automatically releases the reference again, therefore + * the module MUST not be given back under any circumstances + * here. Be aware, the destroy function assumes that the + * module is held if the ops field is non zero. */ + em->ops = tcf_em_lookup(em_hdr->kind); + + if (em->ops == NULL) { + err = -ENOENT; + goto errout; + } + + /* ematch module provides expected length of data, so we + * can do a basic sanity check. */ + if (em->ops->datalen && data_len < em->ops->datalen) + goto errout; + + if (em->ops->change) { + err = em->ops->change(tp, data, data_len, em); + if (err < 0) + goto errout; + } else if (data_len > 0) { + /* ematch module doesn't provide an own change + * procedure and expects us to allocate and copy + * the ematch data. + * + * TCF_EM_SIMPLE may be specified stating that the + * data only consists of a u32 integer and the module + * does not expected a memory reference but rather + * the value carried. */ + if (em_hdr->flags & TCF_EM_SIMPLE) { + if (data_len < sizeof(u32)) + goto errout; + em->data = *(u32 *) data; + } else { + void *v = kmalloc(data_len, GFP_KERNEL); + if (v == NULL) { + err = -ENOBUFS; + goto errout; + } + memcpy(v, data, data_len); + em->data = (unsigned long) v; + } + } + } + + em->matchid = em_hdr->matchid; + em->flags = em_hdr->flags; + em->datalen = data_len; + + err = 0; +errout: + return err; +} + +/** + * tcf_em_tree_validate - validate ematch config TLV and build ematch tree + * + * @tp: classifier kind handle + * @rta: ematch tree configuration TLV + * @tree: destination ematch tree variable to store the resulting + * ematch tree. + * + * This function validates the given configuration TLV @rta and builds an + * ematch tree in @tree. The resulting tree must later be copied into + * the private classifier data using tcf_em_tree_change(). You MUST NOT + * provide the ematch tree variable of the private classifier data directly, + * the changes would not be locked properly. + * + * Returns a negative error code if the configuration TLV contains errors. + */ +int tcf_em_tree_validate(struct tcf_proto *tp, struct rtattr *rta, + struct tcf_ematch_tree *tree) +{ + int idx, list_len, matches_len, err = -EINVAL; + struct rtattr *tb[TCA_EMATCH_TREE_MAX]; + struct rtattr *rt_match, *rt_hdr, *rt_list; + struct tcf_ematch_tree_hdr *tree_hdr; + struct tcf_ematch *em; + + if (rtattr_parse_nested(tb, TCA_EMATCH_TREE_MAX, rta) < 0) + goto errout; + + rt_hdr = tb[TCA_EMATCH_TREE_HDR-1]; + rt_list = tb[TCA_EMATCH_TREE_LIST-1]; + + if (rt_hdr == NULL || rt_list == NULL) + goto errout; + + if (RTA_PAYLOAD(rt_hdr) < sizeof(*tree_hdr) || + RTA_PAYLOAD(rt_list) < sizeof(*rt_match)) + goto errout; + + tree_hdr = RTA_DATA(rt_hdr); + memcpy(&tree->hdr, tree_hdr, sizeof(*tree_hdr)); + + rt_match = RTA_DATA(rt_list); + list_len = RTA_PAYLOAD(rt_list); + matches_len = tree_hdr->nmatches * sizeof(*em); + + tree->matches = kmalloc(matches_len, GFP_KERNEL); + if (tree->matches == NULL) + goto errout; + memset(tree->matches, 0, matches_len); + + /* We do not use rtattr_parse_nested here because the maximum + * number of attributes is unknown. This saves us the allocation + * for a tb buffer which would serve no purpose at all. + * + * The array of rt attributes is parsed in the order as they are + * provided, their type must be incremental from 1 to n. Even + * if it does not serve any real purpose, a failure of sticking + * to this policy will result in parsing failure. */ + for (idx = 0; RTA_OK(rt_match, list_len); idx++) { + err = -EINVAL; + + if (rt_match->rta_type != (idx + 1)) + goto errout_abort; + + if (idx >= tree_hdr->nmatches) + goto errout_abort; + + if (RTA_PAYLOAD(rt_match) < sizeof(struct tcf_ematch_hdr)) + goto errout_abort; + + em = tcf_em_get_match(tree, idx); + + err = tcf_em_validate(tp, tree_hdr, em, rt_match, idx); + if (err < 0) + goto errout_abort; + + rt_match = RTA_NEXT(rt_match, list_len); + } + + /* Check if the number of matches provided by userspace actually + * complies with the array of matches. The number was used for + * the validation of references and a mismatch could lead to + * undefined references during the matching process. */ + if (idx != tree_hdr->nmatches) { + err = -EINVAL; + goto errout_abort; + } + + err = 0; +errout: + return err; + +errout_abort: + tcf_em_tree_destroy(tp, tree); + return err; +} + +/** + * tcf_em_tree_destroy - destroy an ematch tree + * + * @tp: classifier kind handle + * @tree: ematch tree to be deleted + * + * This functions destroys an ematch tree previously created by + * tcf_em_tree_validate()/tcf_em_tree_change(). You must ensure that + * the ematch tree is not in use before calling this function. + */ +void tcf_em_tree_destroy(struct tcf_proto *tp, struct tcf_ematch_tree *tree) +{ + int i; + + if (tree->matches == NULL) + return; + + for (i = 0; i < tree->hdr.nmatches; i++) { + struct tcf_ematch *em = tcf_em_get_match(tree, i); + + if (em->ops) { + if (em->ops->destroy) + em->ops->destroy(tp, em); + else if (!tcf_em_is_simple(em) && em->data) + kfree((void *) em->data); + module_put(em->ops->owner); + } + } + + tree->hdr.nmatches = 0; + kfree(tree->matches); +} + +/** + * tcf_em_tree_dump - dump ematch tree into a rtnl message + * + * @skb: skb holding the rtnl message + * @t: ematch tree to be dumped + * @tlv: TLV type to be used to encapsulate the tree + * + * This function dumps a ematch tree into a rtnl message. It is valid to + * call this function while the ematch tree is in use. + * + * Returns -1 if the skb tailroom is insufficient. + */ +int tcf_em_tree_dump(struct sk_buff *skb, struct tcf_ematch_tree *tree, int tlv) +{ + int i; + struct rtattr * top_start = (struct rtattr*) skb->tail; + struct rtattr * list_start; + + RTA_PUT(skb, tlv, 0, NULL); + RTA_PUT(skb, TCA_EMATCH_TREE_HDR, sizeof(tree->hdr), &tree->hdr); + + list_start = (struct rtattr *) skb->tail; + RTA_PUT(skb, TCA_EMATCH_TREE_LIST, 0, NULL); + + for (i = 0; i < tree->hdr.nmatches; i++) { + struct rtattr *match_start = (struct rtattr*) skb->tail; + struct tcf_ematch *em = tcf_em_get_match(tree, i); + struct tcf_ematch_hdr em_hdr = { + .kind = em->ops ? em->ops->kind : TCF_EM_CONTAINER, + .matchid = em->matchid, + .flags = em->flags + }; + + RTA_PUT(skb, i+1, sizeof(em_hdr), &em_hdr); + + if (em->ops && em->ops->dump) { + if (em->ops->dump(skb, em) < 0) + goto rtattr_failure; + } else if (tcf_em_is_container(em) || tcf_em_is_simple(em)) { + u32 u = em->data; + RTA_PUT_NOHDR(skb, sizeof(u), &u); + } else if (em->datalen > 0) + RTA_PUT_NOHDR(skb, em->datalen, (void *) em->data); + + match_start->rta_len = skb->tail - (u8*) match_start; + } + + list_start->rta_len = skb->tail - (u8 *) list_start; + top_start->rta_len = skb->tail - (u8 *) top_start; + + return 0; + +rtattr_failure: + return -1; +} + +static inline int tcf_em_match(struct sk_buff *skb, struct tcf_ematch *em, + struct tcf_pkt_info *info) +{ + int r = em->ops->match(skb, em, info); + return tcf_em_is_inverted(em) ? !r : r; +} + +/* Do not use this function directly, use tcf_em_tree_match instead */ +int __tcf_em_tree_match(struct sk_buff *skb, struct tcf_ematch_tree *tree, + struct tcf_pkt_info *info) +{ + int stackp = 0, match_idx = 0, res = 0; + struct tcf_ematch *cur_match; + int stack[CONFIG_NET_EMATCH_STACK]; + +proceed: + while (match_idx < tree->hdr.nmatches) { + cur_match = tcf_em_get_match(tree, match_idx); + + if (tcf_em_is_container(cur_match)) { + if (unlikely(stackp >= CONFIG_NET_EMATCH_STACK)) + goto stack_overflow; + + stack[stackp++] = match_idx; + match_idx = cur_match->data; + goto proceed; + } + + res = tcf_em_match(skb, cur_match, info); + + if (tcf_em_early_end(cur_match, res)) + break; + + match_idx++; + } + +pop_stack: + if (stackp > 0) { + match_idx = stack[--stackp]; + cur_match = tcf_em_get_match(tree, match_idx); + + if (tcf_em_early_end(cur_match, res)) + goto pop_stack; + else { + match_idx++; + goto proceed; + } + } + + return res; + +stack_overflow: + if (net_ratelimit()) + printk("Local stack overflow, increase NET_EMATCH_STACK\n"); + return -1; +} + +EXPORT_SYMBOL(tcf_em_register); +EXPORT_SYMBOL(tcf_em_unregister); +EXPORT_SYMBOL(tcf_em_tree_validate); +EXPORT_SYMBOL(tcf_em_tree_destroy); +EXPORT_SYMBOL(tcf_em_tree_dump); +EXPORT_SYMBOL(__tcf_em_tree_match); From tgraf@suug.ch Tue Jan 25 15:24:10 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 15:24:18 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0PNO9hr027067 for ; Tue, 25 Jan 2005 15:24:10 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 07753F; Wed, 26 Jan 2005 00:23:47 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 860491C0EA; Wed, 26 Jan 2005 00:24:30 +0100 (CET) Date: Wed, 26 Jan 2005 00:24:30 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [RESEND 4/6] PKT_SCHED: u32 ematch Message-ID: <20050125232430.GJ31837@postel.suug.ch> References: <20050123230012.GB23931@postel.suug.ch> <20050123230354.GF23931@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050123230354.GF23931@postel.suug.ch> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 775 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 4081 Lines: 126 Resend with offset validation as Patrick suggested. The u32 ematch behaves exactly the same as a u32 match and will replace it in the long term. It allows the underlying classifiers to give hints about the position of the next protocol header (i.e. nexthdr+). Signed-off-by: Thomas Graf diff -Nru linux-2.6.11-rc2-bk3.orig/include/linux/pkt_cls.h linux-2.6.11-rc2-bk3/include/linux/pkt_cls.h --- linux-2.6.11-rc2-bk3.orig/include/linux/pkt_cls.h 2005-01-25 23:58:04.000000000 +0100 +++ linux-2.6.11-rc2-bk3/include/linux/pkt_cls.h 2005-01-25 23:58:20.000000000 +0100 @@ -385,6 +385,7 @@ TCF_EM_CONTAINER, TCF_EM_CMP, TCF_EM_NBYTE, + TCF_EM_U32, __TCF_EM_MAX }; diff -Nru linux-2.6.11-rc2-bk3.orig/include/net/pkt_cls.h linux-2.6.11-rc2-bk3/include/net/pkt_cls.h --- linux-2.6.11-rc2-bk3.orig/include/net/pkt_cls.h 2005-01-25 23:57:30.000000000 +0100 +++ linux-2.6.11-rc2-bk3/include/net/pkt_cls.h 2005-01-25 23:58:20.000000000 +0100 @@ -153,6 +153,8 @@ */ struct tcf_pkt_info { + unsigned char * ptr; + int nexthdr; }; #ifdef CONFIG_NET_EMATCH diff -Nru linux-2.6.11-rc2-bk3.orig/net/sched/Kconfig linux-2.6.11-rc2-bk3/net/sched/Kconfig --- linux-2.6.11-rc2-bk3.orig/net/sched/Kconfig 2005-01-25 23:58:04.000000000 +0100 +++ linux-2.6.11-rc2-bk3/net/sched/Kconfig 2005-01-25 23:58:20.000000000 +0100 @@ -418,6 +418,16 @@ To compile this code as a module, choose M here: the module will be called em_nbyte. +config NET_EMATCH_U32 + tristate "U32 hashing key" + depends on NET_EMATCH + ---help--- + Say Y here if you want to be able to classify packets using + the famous u32 key in combination with logic relations. + + To compile this code as a module, choose M here: the + module will be called em_u32. + config NET_CLS_ACT bool "Packet ACTION" depends on EXPERIMENTAL && NET_CLS && NET_QOS diff -Nru linux-2.6.11-rc2-bk3.orig/net/sched/Makefile linux-2.6.11-rc2-bk3/net/sched/Makefile --- linux-2.6.11-rc2-bk3.orig/net/sched/Makefile 2005-01-25 23:58:04.000000000 +0100 +++ linux-2.6.11-rc2-bk3/net/sched/Makefile 2005-01-25 23:58:20.000000000 +0100 @@ -36,3 +36,4 @@ obj-$(CONFIG_NET_EMATCH) += ematch.o obj-$(CONFIG_NET_EMATCH_CMP) += em_cmp.o obj-$(CONFIG_NET_EMATCH_NBYTE) += em_nbyte.o +obj-$(CONFIG_NET_EMATCH_U32) += em_u32.o diff -Nru linux-2.6.11-rc2-bk3.orig/net/sched/em_u32.c linux-2.6.11-rc2-bk3/net/sched/em_u32.c --- linux-2.6.11-rc2-bk3.orig/net/sched/em_u32.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.11-rc2-bk3/net/sched/em_u32.c 2005-01-26 00:06:03.000000000 +0100 @@ -0,0 +1,63 @@ +/* + * net/sched/em_u32.c U32 Ematch + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: Thomas Graf + * Alexey Kuznetsov, + * + * Based on net/sched/cls_u32.c + */ + +#include +#include +#include +#include +#include +#include + +static int em_u32_match(struct sk_buff *skb, struct tcf_ematch *em, + struct tcf_pkt_info *info) +{ + struct tc_u32_key *key = (struct tc_u32_key *) em->data; + unsigned char *ptr = skb->nh.raw; + + if (info) { + if (info->ptr) + ptr = info->ptr; + ptr += (info->nexthdr & key->offmask); + } + + ptr += key->off; + + if (!tcf_valid_offset(skb, ptr, sizeof(u32))) + return 0; + + return !(((*(u32*) ptr) ^ key->val) & key->mask); +} + +static struct tcf_ematch_ops em_u32_ops = { + .kind = TCF_EM_U32, + .datalen = sizeof(struct tc_u32_key), + .match = em_u32_match, + .owner = THIS_MODULE, + .link = LIST_HEAD_INIT(em_u32_ops.link) +}; + +static int __init init_em_u32(void) +{ + return tcf_em_register(&em_u32_ops); +} + +static void __exit exit_em_u32(void) +{ + tcf_em_unregister(&em_u32_ops); +} + +MODULE_LICENSE("GPL"); + +module_init(init_em_u32); +module_exit(exit_em_u32); From davem@davemloft.net Tue Jan 25 15:34:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 15:34:54 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0PNYmYm027711 for ; Tue, 25 Jan 2005 15:34:48 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cta8a-00033K-00; Tue, 25 Jan 2005 15:30:20 -0800 Date: Tue, 25 Jan 2005 15:30:20 -0800 From: "David S. Miller" To: Thomas Graf Cc: greearb@candelatech.com, herbert@gondor.apana.org.au, david@davidcoulson.net, kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-Id: <20050125153020.3f3256fb.davem@davemloft.net> In-Reply-To: <20050125211524.GH31837@postel.suug.ch> References: <20050124164049.3b939791.davem@davemloft.net> <20050125014538.GB31837@postel.suug.ch> <20050125014838.GA16637@gondor.apana.org.au> <20050125020118.GC31837@postel.suug.ch> <20050124180354.63ae600d.davem@davemloft.net> <20050125022431.GD31837@postel.suug.ch> <20050124194328.20a106de.davem@davemloft.net> <20050125143319.GF31837@postel.suug.ch> <20050125203607.GG31837@postel.suug.ch> <41F6B090.6020602@candelatech.com> <20050125211524.GH31837@postel.suug.ch> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 776 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 640 Lines: 13 On Tue, 25 Jan 2005 22:15:24 +0100 Thomas Graf wrote: > I thought about this too and actually implemented it but it means to > change all relevant drivers and the only feature that might be > driver specific is checksumming, given I didn't make any mistakes > while checking the drivers for pskb compatibility. It is not only checksumming, but also TSO. TSO, like checksumming, is a feature where the chip must parse the packet to figure out where to do it's work. In fact, TSO is a prime suspect for VLAN problems as the card must duplicate the VLAN headers properly as it chops up the TSO frame into MSS sized pieces. From davem@davemloft.net Tue Jan 25 15:35:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 15:35:26 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0PNZLbh027883 for ; Tue, 25 Jan 2005 15:35:21 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cta9U-00033S-00; Tue, 25 Jan 2005 15:31:16 -0800 Date: Tue, 25 Jan 2005 15:31:16 -0800 From: "David S. Miller" To: Ben Greear Cc: tgraf@suug.ch, herbert@gondor.apana.org.au, david@davidcoulson.net, kaber@trash.net, netdev@oss.sgi.com Subject: Re: skb_checksum_help Message-Id: <20050125153116.3caa2745.davem@davemloft.net> In-Reply-To: <41F6C4B6.20800@candelatech.com> References: <20050124164049.3b939791.davem@davemloft.net> <20050125014538.GB31837@postel.suug.ch> <20050125014838.GA16637@gondor.apana.org.au> <20050125020118.GC31837@postel.suug.ch> <20050124180354.63ae600d.davem@davemloft.net> <20050125022431.GD31837@postel.suug.ch> <20050124194328.20a106de.davem@davemloft.net> <20050125143319.GF31837@postel.suug.ch> <20050125203607.GG31837@postel.suug.ch> <41F6B090.6020602@candelatech.com> <20050125211524.GH31837@postel.suug.ch> <41F6C4B6.20800@candelatech.com> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 777 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 315 Lines: 9 On Tue, 25 Jan 2005 14:14:14 -0800 Ben Greear wrote: > I'd leave everything to the driver. I agree with Ben. We've learned often in the past, especially with VLAN, that it is often better to let the driver explicitly say it can do something rather then assuming anything in particular. From nacc@us.ibm.com Tue Jan 25 16:37:41 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 16:37:45 -0800 (PST) Received: from e4.ny.us.ibm.com (e4.ny.us.ibm.com [32.97.182.144]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q0beFU000992 for ; Tue, 25 Jan 2005 16:37:41 -0800 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e4.ny.us.ibm.com (8.12.10/8.12.10) with ESMTP id j0Q0bYua026135 for ; Tue, 25 Jan 2005 19:37:35 -0500 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j0Q0bY5X285020 for ; Tue, 25 Jan 2005 19:37:34 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j0Q0bYET012343 for ; Tue, 25 Jan 2005 19:37:34 -0500 Received: from joust (DYN317993BLD.beaverton.ibm.com [9.47.17.65]) by d01av02.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j0Q0bXtE012323; Tue, 25 Jan 2005 19:37:34 -0500 Received: by joust (Postfix, from userid 1000) id C9FEB4F99A; Tue, 25 Jan 2005 16:37:32 -0800 (PST) Date: Tue, 25 Jan 2005 16:37:32 -0800 From: Nishanth Aravamudan To: alan@redhat.com Cc: netdev@oss.sgi.com, kernel-janitors@lists.osdl.org Subject: [PATCH 29/34] net/shaper: replace sleep_on() with wait_event() Message-ID: <20050126003732.GU12649@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 779 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nacc@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 986 Lines: 39 Hi, Please consider applying. Description: Use wait_event() instead of the deprecated sleep_on(). Move the in_interrupt() check outside loop, as I do not believe the process context should change once execution has begun. Patch is compile-tested. Signed-off-by: Nishanth Aravamudan --- 2.6.11-rc2-kj-v/drivers/net/shaper.c 2005-01-24 09:34:10.000000000 -0800 +++ 2.6.11-rc2-kj/drivers/net/shaper.c 2005-01-25 11:44:13.000000000 -0800 @@ -83,6 +83,7 @@ #include #include #include +#include #include #include @@ -109,14 +110,9 @@ static int shaper_lock(struct shaper *sh /* * Lock in an interrupt must fail */ - while (test_and_set_bit(0, &sh->locked)) - { - if (!in_interrupt()) - sleep_on(&sh->wait_queue); - else - return 0; - - } + if (in_interrupt()) + return 0; + wait_event(sh->wait_queue, !test_and_set_bit(0, &sh->locked)); return 1; } From nacc@us.ibm.com Tue Jan 25 16:35:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 16:35:41 -0800 (PST) Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.129]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q0ZSRp000599 for ; Tue, 25 Jan 2005 16:35:35 -0800 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e31.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j0Q0ZMm4431610 for ; Tue, 25 Jan 2005 19:35:22 -0500 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j0Q0ZMbk432788 for ; Tue, 25 Jan 2005 17:35:22 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j0Q0ZL2X026362 for ; Tue, 25 Jan 2005 17:35:22 -0700 Received: from joust (DYN317993BLD.beaverton.ibm.com [9.47.17.65]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j0Q0ZL8Y026351; Tue, 25 Jan 2005 17:35:21 -0700 Received: by joust (Postfix, from userid 1000) id 666DB4F99A; Tue, 25 Jan 2005 16:35:20 -0800 (PST) Date: Tue, 25 Jan 2005 16:35:20 -0800 From: Nishanth Aravamudan To: robert.olsson@its.uu.se Cc: netdev@oss.sgi.com, kernel-janitors@lists.osdl.org Subject: [PATCH 28/34] net/pktgen: replace interruptible_sleep_on_timeout() with wait_event_timeout() Message-ID: <20050126003520.GT12649@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 778 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nacc@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 1057 Lines: 30 Hi, Please consider applying. Description: Use wait_event_timeout() instead of the deprecated interruptible_sleep_on_timeout(). Current code does not check for signals, so interruptible seems unnecessary. Patch is compile-tested. Signed-off-by: Nishanth Aravamudan --- 2.6.11-rc2-kj-v/net/core/pktgen.c 2005-01-24 09:34:21.000000000 -0800 +++ 2.6.11-rc2-kj/net/core/pktgen.c 2005-01-24 17:18:52.000000000 -0800 @@ -135,6 +135,7 @@ #include #include #include +#include #include #include #include @@ -3118,8 +3119,7 @@ static void __exit pg_cleanup(void) struct pktgen_thread *t = pktgen_threads; pktgen_threads->control |= (T_TERMINATE); - while( t == pktgen_threads) - interruptible_sleep_on_timeout(&queue, HZ); + wait_event_timeout(queue, (t != pktgen_threads), HZ); } /* Un-register us from receiving netdevice events */ From jt@hpl.hp.com Tue Jan 25 18:40:44 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 18:40:50 -0800 (PST) Received: from palrel13.hp.com (palrel13.hp.com [156.153.255.238]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q2ehJp004287 for ; Tue, 25 Jan 2005 18:40:44 -0800 Received: from tomil.hpl.hp.com (tomil.hpl.hp.com [15.0.152.100]) by palrel13.hp.com (Postfix) with ESMTP id 340EB1C16130; Tue, 25 Jan 2005 18:40:43 -0800 (PST) Received: from bougret.hpl.hp.com (bougret.hpl.hp.com [15.4.92.227]) by tomil.hpl.hp.com (8.9.3 (PHNE_29774)/8.9.3 HPLabs Timeshare Server) with ESMTP id SAA28582; Tue, 25 Jan 2005 18:42:35 -0800 (PST) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 1Ctd6l-0006ae-00; Tue, 25 Jan 2005 18:40:39 -0800 Date: Tue, 25 Jan 2005 18:40:39 -0800 To: netdev@oss.sgi.com, Dan Williams Subject: Re: Where Linux 802.11x support needs work Message-ID: <20050126024039.GA25326@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i Organisation: HP Labs Palo Alto Address: HP Labs, 1U-17, 1501 Page Mill road, Palo Alto, CA 94304, USA. E-mail: jt@hpl.hp.com From: Jean Tourrilhes X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 780 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jt@hpl.hp.com Precedence: bulk X-list: netdev Content-Length: 4530 Lines: 100 Dan Williams wrote : > > This list of stuff that should get fixed in Linux wireless grew out of my > attempt to put a GUI on top of Linux wireless with NetworkManager > (http://people.redhat.com/dcbw/NetworkManager). This isn't, of course, a > demand or anything, and I've been personally slowly fixing stuff up as I > come to it (orinoco merge, fixing linux-wlan-ng, small kernel wireless > driver patches) Yes, I've seen your various contributions for the various drivers. I'm glad that someone is doing all these little fixes, because they are needed, and such a job is not gratifying and not well recognised. I used to do more of that, in the past, when I had more time, and Pavel did some, but it's not our full time job to work on Linux. I also want to thank you for your work on the NetworkManager, it's a great piece of work and goes beyond what I had in mind when I created the API. > I think the biggest issue here is that the Wireless Extensions API has > stagnated a bit, and driver writers have gone off and done their own thing > (for example, WPA support) because the WEAPI hasn't shown leadership in > this area. That's fixable, and at this point doesn't seem to be a large > amount of work since the main offender here is only WPA. You know already that in Linux things happen by pushing patches around, not by "showing leadership" (whatever that means). Driver authors will always do their own thing, nobody can prevent them, and it's actually a good thing as it creates inovation and the best ideas can then be folded back into the official API. Yes, I believe in the bottom up approach (cheers). Note that API doesn't happen in isolation, you need to make things happen on both sides of it, and the API feed on the experience of both sides. Because NetworkManager is both useful and standard, it will show leadership and force driver authors to conform to its requirements. If a driver is broken with NetworkManager, users will bug the author until it's fixed. I've seen that happening with various other tools (unfortunately, my wtools are too permissive). > o Quality values vary wildly or are absent > - Average and max quality levels for almost all drivers are > artificial and don't come from the the card in any way Those can't come from the hardware, they may only come from the spec, when available. The idea with "average" and "max" would be that application authors would feed back driver authors as to what to use. Unfortunately, it did not happen, especially that apps decided to ignore them. > o Frequency values vary wildly from iw_get_range > 1) prism54 uses completely different exponent values than airo > 2) airo, atmel, orinoco are the same Nobody in their right mind would use iwfreq for anything, it's just used to go across the kernel interface. Once in userspace, just use the iw_freq2float() and iw_float2freq() to convert to double, and then it's all normalised. If you need it, I can donate you those two functions under LGPL. > o Not all drivers have correct netlink support, if they even have it Note that netlink make only sense in Managed mode, it does not make sense in Ad-Hoc or Master mode. That make things a bit more messy to implement. In the interim, for driver that don't support netlink you can check the value of the AP address. > o Not all drivers support wirless scanning > 1) orinoco driver mainly, support is upstream and is being slowly > merged into the kernel driver Just for your info, I was the one who originally authored the Scanning patch for the Orinoco driver (based on other patches). After that many people improved on it. > o Ad-Hoc mode support is quite flaky or absent from most drivers Low priority for most vendors, firwmares are only lightly tested. > o WPA support is lacking or just in-progress, needs much help Preliminary patch is on my web page : http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html#wext Jouni is the main author, as he is doing the supplicant. He told me that he want to make a few additional changes. WPA is quite complex and therefore I would prefer to make sure it's right. Note that various other people have their own todo list. Jeff also has things he has in minds. I have (few) patches on my web pages. Driver authors also have their wishes. One of the big item not mentionned by you is the in-kernel 802.11 stack (native frames and management). If done right, I guess it would mostly be transparent to you... Have fun... Jean From dcbw@redhat.com Tue Jan 25 20:05:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 20:06:00 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q45rrd007197 for ; Tue, 25 Jan 2005 20:05:54 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j0Q43pdJ000961; Tue, 25 Jan 2005 23:03:51 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j0Q43pO05587; Tue, 25 Jan 2005 23:03:51 -0500 Received: from devserv.devel.redhat.com (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.11/8.12.10) with ESMTP id j0Q43pYP014451; Tue, 25 Jan 2005 23:03:51 -0500 Received: from localhost (dcbw@localhost) by devserv.devel.redhat.com (8.12.11/8.12.11/Submit) with ESMTP id j0Q43pjC014447; Tue, 25 Jan 2005 23:03:51 -0500 Date: Tue, 25 Jan 2005 23:03:51 -0500 (EST) From: Dan Williams To: Jean Tourrilhes cc: netdev@oss.sgi.com, Dan Williams Subject: Re: Where Linux 802.11x support needs work In-Reply-To: <20050126024039.GA25326@bougret.hpl.hp.com> Message-ID: References: <20050126024039.GA25326@bougret.hpl.hp.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 781 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dcbw@redhat.com Precedence: bulk X-list: netdev Content-Length: 9983 Lines: 189 On Tue, 25 Jan 2005, Jean Tourrilhes wrote: > You know already that in Linux things happen by pushing > patches around, not by "showing leadership" (whatever that > means). Driver authors will always do their own thing, nobody can > prevent them, and it's actually a good thing as it creates inovation > and the best ideas can then be folded back into the official API. Yes, > I believe in the bottom up approach (cheers). Quite true, and I don't think that's a bad approach, I just think that adding general WPA support to WEAPI a bit earlier might have saved some trouble. Since most driver writers have their drivers in the kernel, and since the kernel can enforce usage of the WEAPI on the driver, it seems like the WEAPI would be a good place to standardize new stuff like WPA that's been around for a while and is supported by a fair # of chipsets. Furthermore, if an API were in place, then driver writers could write to that API and not have to invent one themselves. Of course, the API would need to change and evolve as driver writers ran into limitations and whatnot. So I guess its a toss-up, either way (waiting till later, or starting sooner) both driver writers and user-applications have to change code around. But I completely agree that flexibility is of great importance here. > > o Quality values vary wildly or are absent > > - Average and max quality levels for almost all drivers are > > artificial and don't come from the the card in any way > > Those can't come from the hardware, they may only come from > the spec, when available. > The idea with "average" and "max" would be that application > authors would feed back driver authors as to what to > use. Unfortunately, it did not happen, especially that apps decided to > ignore them. My frustration here (and why I've pretty much stopped trying to fix it) is basically twofold: 1) If the card only reports dBm, I cannot try to calculate the signal-to-noise ratio without getting the correct noise level. Only the card can provide that, and quite a few do not. 2) The API here is a bit confusing and lacks some documentation. Since we have the 8-bit value for the quality, the driver has the choice of either 0 - 255 (which seems to be what Airo uses) or -128 - +128 (which others use). I could not really deduce what the values that various drivers return is, and how to convert that to a percentage value. For quality data, we have qual.qual, qual.level, and qual.noise. Its not completely clear what each of those values is (though if I had to guess, I'd assume qual.qual = %-age value, qual.level = dBm of current signal, qual.noise = dBm of current noise threshold). The breakdown: ipw2200: fairly sane ipw2100: fairly sane, but no scan quality data airo: only qual.level on scans (qual.qual/qual.noise = 0), for normal quality uses a lot of magic numbers. No way to get a percentage value out of this driver. atmel: magic numbers tied to one hardware version. No scan quality data. orinoco: magic numbers madwifi: doesn't seem to implement SIOCGIWSTATS As far as I understand the comments in iwlib.c, all drivers do something different for the qual.qual/qual.level/qual.noise fields, WRT the signed/unsigned debate. Airo seems to use 0 - 255, others seem to use -128 - +128, etc. We need to standardize signal strength and quality data among the drivers. > > o Frequency values vary wildly from iw_get_range > > 1) prism54 uses completely different exponent values than airo > > 2) airo, atmel, orinoco are the same > > Nobody in their right mind would use iwfreq for anything, it's > just used to go across the kernel interface. Once in userspace, just > use the iw_freq2float() and iw_float2freq() to convert to double, and > then it's all normalised. > If you need it, I can donate you those two functions under LGPL. AFAIK, those functions are exposed in iwlib, no? I think I'm already using them in NetworkManager. I was using get/set frequency calls (which only madwifi actually seems to support) to ensure that the card jumps to the correct frequency in Ad-Hoc mode, which it didn't always seem to do. > > o Not all drivers have correct netlink support, if they even have it > > Note that netlink make only sense in Managed mode, it does not > make sense in Ad-Hoc or Master mode. That make things a bit more messy > to implement. > In the interim, for driver that don't support netlink you can > check the value of the AP address. True, but some tools like wpa_supplicant seem to use the netlink sockets stuff to trigger auth/encryption capability checks since certain auth algorithms send challenge packets to you when you auth/assoc to the AP. In any case, I'm not actually using any netlink sockets support in NM since its just to flaky between drivers. Checking the AP MAC address isn't really good enough, since cards have different semantics here. Some cards seem to update the MAC address only when you've successfully authed/assoced to the AP, while others don't really care as long as you've pointed your card at the ESSID. For example, airo driver won't set a valid ESSID on the card until the auth mode is correct (ie OpenSystem/SharedKey), while others (madwifi, atmel) will happily show a valid MAC address even if your WEP key is wrong (airo will still show invalid in this instance). The only way that I've found to guarantee a link to an access point is to set the ESSID, and then check over a period of 10 seconds or so for a valid AP MAC address on the card for at least 6 seconds, and then try to DHCP. If you're in Open System and DHCP fails, then you fall back to Shared Key and get a link, try DHCP again, etc. What would work better is if all cards supported netlink, so that I could at least tell when the _card_ thought it was connected and then stop the whole "wait for 10s until card has link" type of deal. Furthermore, some cards re-load their firmware when you set the ESSID on them, which means you have to wait at least 2 or 3 seconds before any value on the card is actually valid. There are liberal usleep (x) sprinkled throughout places in NetworkManager where I have to wait for cards to bring themselves back up before I can do anything with them. Even a netlink message of "I'm the firmware, I'm ready for business" would be an improvement for this problem. > > o Not all drivers support wirless scanning > > 1) orinoco driver mainly, support is upstream and is being slowly > > merged into the kernel driver > > Just for your info, I was the one who originally authored the > Scanning patch for the Orinoco driver (based on other patches). After > that many people improved on it. Yep, I see your stamp all over the code :) In any case, I think Dave Gibson was busy for a while and just never quite got around to getting the scanning support merged. He seems to be doing that now though. I tried to help at one point, but was using the wrong orinoco branch. I haven't taken the time to extract the scanning code again however and repost that, because it depends on most every other change in the upstream orinoco drivers (better firmware capability detection, iwspy support, etc). > > o Ad-Hoc mode support is quite flaky or absent from most drivers > > Low priority for most vendors, firwmares are only lightly tested. Yeah, I don't expect much to happen here but it would be nice. FWIW, at least madwifi and atmel seem to work OK here. > > o WPA support is lacking or just in-progress, needs much help > > Preliminary patch is on my web page : > http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html#wext > Jouni is the main author, as he is doing the supplicant. He > told me that he want to make a few additional changes. WPA is quite > complex and therefore I would prefer to make sure it's right. I plan to make NetworkManager talk to wpa_supplicant at some near-future point, I've had some long emails with Jouni about the wpa_supplicant interface and how to work with it. I was a bit horrified to discover that the Open 802.1x project actually patches drivers (ok, I'm not 100% sure, but there are patches against kernel drivers in their CVS at least). However, if they have to patch kernel drivers, that probably means there's some capability that they need that should be in the drivers anyway, so it might be useful to look into those patches and see what can be cherry-picked to improve driver quality. > Note that various other people have their own todo list. Jeff > also has things he has in minds. I have (few) patches on my web > pages. Driver authors also have their wishes. True, but I'm not sure how many of those wishes/todo lists are actually well-known or public. I don't really see any great momentum in the Linux 802.11x world, but more a hodge-podge of improvements. I was hoping that the post today could help direct a bit more attention and effort at Linux 802.11x stuff so we could try to clean it up and improve it. I don't think enough people focus on this right now, and as Linux moves more towards mainstream we need to be as foolproof as possible. Furthermore, we need to develop a clear API for driver writers so that hardware companies have fewer excuses to develop open-source drivers. Obviously they all have tons of experience writing to NDIS/WDM, and that's fairly understood. But I believe that Linux wireless driver APIs are much less understood and documented. > One of the big item not mentionned by you is the in-kernel > 802.11 stack (native frames and management). If done right, I guess it > would mostly be transparent to you... You know, I was thinking of it and I just forgot to put it on the list. If you're including madwifi and ipw2x00, we have a grand total of what, 3 or 4 802.11 stacks in the kernel at the same time? (madwifi, orinoco/hermes, ipw2x00, linux-wlan-ng) Cheers, Dan From flamingice@sourmilk.net Tue Jan 25 20:41:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 20:41:53 -0800 (PST) Received: from server8.totalchoicehosting.com (server8.totalchoicehosting.com [216.180.241.250]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q4fmjS011429 for ; Tue, 25 Jan 2005 20:41:49 -0800 Received: from host-24-225-148-91.patmedia.net ([24.225.148.91] helo=[192.168.0.100]) by server8.totalchoicehosting.com with esmtpsa (TLSv1:RC4-MD5:128) (Exim 4.43) id 1Ctezv-0003Cf-V7 for netdev@oss.sgi.com; Tue, 25 Jan 2005 23:41:44 -0500 From: Michael Wu To: netdev@oss.sgi.com Subject: Re: Where Linux 802.11x support needs work Date: Tue, 25 Jan 2005 23:41:20 -0500 User-Agent: KMail/1.7.1 References: <20050126024039.GA25326@bougret.hpl.hp.com> In-Reply-To: MIME-Version: 1.0 Message-Id: <200501252341.27041.flamingice@sourmilk.net> Content-Type: multipart/signed; boundary="nextPart3045895.NHPOaLhEQL"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server8.totalchoicehosting.com X-AntiAbuse: Original Domain - oss.sgi.com X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - sourmilk.net X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 782 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: flamingice@sourmilk.net Precedence: bulk X-list: netdev Content-Length: 1210 Lines: 38 --nextPart3045895.NHPOaLhEQL Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Tuesday 25 January 2005 11:03 pm, Dan Williams wrote: > > One of the big item not mentionned by you is the in-kernel > > 802.11 stack (native frames and management). If done right, I guess it > > would mostly be transparent to you... > > You know, I was thinking of it and I just forgot to put it on the list. > If you're including madwifi and ipw2x00, we have a grand total of what, 3 > or 4 802.11 stacks in the kernel at the same time? (madwifi, > orinoco/hermes, ipw2x00, linux-wlan-ng) > Only orinoco/hermes is in the kernel, and that doesn't really have much of = an=20 802.11 stack, since most things are done in hardware. Madwifi has a fairly= =20 complete 802.11 stack (ported from netbsd), and so does adm8211. Dunno abou= t=20 ipw2x00. =2DMichael Wu --nextPart3045895.NHPOaLhEQL Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQBB9x93yWWBbDEe0UIRAvAfAKCEqvmMfjxGKcwFuEB30h7iozt4vQCggMhY ThcRwvN4ggQ0sNNt/OzdFD8= =JW0D -----END PGP SIGNATURE----- --nextPart3045895.NHPOaLhEQL-- From davem@davemloft.net Tue Jan 25 21:45:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 21:45:54 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q5jkVd012780 for ; Tue, 25 Jan 2005 21:45:47 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CtfwE-0004My-00; Tue, 25 Jan 2005 21:41:58 -0800 Date: Tue, 25 Jan 2005 21:41:58 -0800 From: "David S. Miller" To: Patrick McHardy Cc: netdev@oss.sgi.com Subject: Re: [PATCH 2.6]: keep fragment queues private to each user Message-Id: <20050125214158.4be3798c.davem@davemloft.net> In-Reply-To: <41F5D1CB.9050804@trash.net> References: <41F5D1CB.9050804@trash.net> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 783 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 672 Lines: 15 On Tue, 25 Jan 2005 05:57:47 +0100 Patrick McHardy wrote: > This patch keeps fragment queues private to each ip_defrag user to avoid > skbs jumping between different callers. It shouldn't change any wanted > behaviour, the only questionable one was ip_call_ra_chain, but the RA > option is included in each fragment. If you're fine with the patch I'm going > to send a 2.4 version later. Please fix the CONFIG_SMP build. You use some variable "user" in ip_frag_intern(), yet don't add this as an argument or anything like that. The "user" use you added is protected by CONFIG_SMP, so my guess is that you compile and tested this without SMP enabled. From davem@davemloft.net Tue Jan 25 21:47:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 21:47:07 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q5l1Ep012963 for ; Tue, 25 Jan 2005 21:47:01 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CtfxR-0004NF-00; Tue, 25 Jan 2005 21:43:13 -0800 Date: Tue, 25 Jan 2005 21:43:13 -0800 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com Subject: Re: [PATCH] vlan: eliminate gcc warnings with PROC_FS=n Message-Id: <20050125214313.05a34248.davem@davemloft.net> In-Reply-To: <41F5DC6E.8070203@osdl.org> References: <41F5DC6E.8070203@osdl.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 784 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 319 Lines: 11 On Mon, 24 Jan 2005 21:43:10 -0800 "Randy.Dunlap" wrote: > > Eliminate gcc warnings when PROC_FS=n: > net/8021q/vlan.c:232: warning: statement with no effect > net/appletalk/ddp.c:1893: warning: statement with no effect > > Signed-off-by: Randy Dunlap Applied, thanks Randy. From davem@davemloft.net Tue Jan 25 21:56:45 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 21:56:51 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q5udd9013910 for ; Tue, 25 Jan 2005 21:56:45 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Ctg6j-0004Pi-00; Tue, 25 Jan 2005 21:52:49 -0800 Date: Tue, 25 Jan 2005 21:52:49 -0800 From: "David S. Miller" To: Thomas Graf Cc: netdev@oss.sgi.com Subject: Re: [PATCHSET] Extended matches and basic classifier Message-Id: <20050125215249.2aec06d7.davem@davemloft.net> In-Reply-To: <20050123230012.GB23931@postel.suug.ch> References: <20050123230012.GB23931@postel.suug.ch> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 785 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 373 Lines: 10 On Mon, 24 Jan 2005 00:00:12 +0100 Thomas Graf wrote: > This patchset adds the ematch API, the ematches cmp, nbyte, u32, meta, > and the basic classifier. It doesn't touch any existing code. I'm busy merging pure bug fixes, so I'll try to review this one soon. Likely it will go into 2.6.12, although I may try to sneak it into the pending 2.6.11 tree. From davem@davemloft.net Tue Jan 25 22:10:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 22:10:09 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q6A2uK014879 for ; Tue, 25 Jan 2005 22:10:02 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CtgJS-0004TL-00; Tue, 25 Jan 2005 22:05:58 -0800 Date: Tue, 25 Jan 2005 22:05:58 -0800 From: "David S. Miller" To: Martin Josefsson Cc: bdschuym@pandora.be, shemminger@osdl.org, dwmw2@infradead.org, ak@suse.de, snort2004@mail.ru, bridge@osdl.org, netdev@oss.sgi.com, rusty@rustcorp.com.au Subject: Re: [PATCH/RFC] Reduce call chain length in netfilter (was: Re: do_IRQ: stack overflow: 872..) Message-Id: <20050125220558.6e824f8a.davem@davemloft.net> In-Reply-To: <1106496509.1085.1.camel@tux.rsn.bth.se> References: <1131604877.20041218092730@mail.ru.suse.lists.linux.kernel> <1105117559.11753.34.camel@baythorne.infradead.org> <20050107100017.454ddadc@dxpl.pdx.osdl.net> <1105133241.3375.16.camel@localhost.localdomain> <20050118135735.4b77d38d.davem@davemloft.net> <1106433059.4486.11.camel@localhost.localdomain> <1106436153.20995.42.camel@tux.rsn.bth.se> <1106484019.3376.5.camel@localhost.localdomain> <1106496509.1085.1.camel@tux.rsn.bth.se> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 786 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 757 Lines: 19 On Sun, 23 Jan 2005 17:08:29 +0100 Martin Josefsson wrote: > I'm now running a kernel with this patch and everything seems to still > be working. > So unless someone else has something to comment I think this should be > applied. > The decrease in call-depth is important. I would like to see at least one ACK from the netfilter folks. Bart or Rusty, could you forward to patch to netfilter-devel for review? I have some other ideas about how bridging might be able to save some call chain depth... but I need to think about it some more before proposing or even trying to implement. (basically something akin to how we do route level packet output, via dst_output(), but instead we're doing this at ->hard_start_xmit() time) From davem@davemloft.net Tue Jan 25 22:14:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 22:15:02 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q6Es5w015453 for ; Tue, 25 Jan 2005 22:14:54 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CtgOQ-0004V9-00; Tue, 25 Jan 2005 22:11:06 -0800 Date: Tue, 25 Jan 2005 22:11:06 -0800 From: "David S. Miller" To: David Dillow Cc: netdev@oss.sgi.com Subject: Re: [RFC 2.6.10 7/22] xfrm: Allow device drivers to force recalculation of offloads Message-Id: <20050125221106.1d87e070.davem@davemloft.net> In-Reply-To: <1106373216.3691.43.camel@ori.thedillows.org> References: <20041230035000.15@ori.thedillows.org> <20041230035000.16@ori.thedillows.org> <20050121152358.5c60d0db.davem@davemloft.net> <1106373216.3691.43.camel@ori.thedillows.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 787 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 261 Lines: 8 On Sat, 22 Jan 2005 00:53:36 -0500 David Dillow wrote: > In patch 3 of the series, xfrm_offload_add() grabs a reference to the > device, and xfrm_offload_release() releases it when the offload's own > reference count hits zero. Perfect. From davem@davemloft.net Tue Jan 25 22:15:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 22:15:47 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q6FgjF015853 for ; Tue, 25 Jan 2005 22:15:42 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CtgPC-0004VK-00; Tue, 25 Jan 2005 22:11:54 -0800 Date: Tue, 25 Jan 2005 22:11:54 -0800 From: "David S. Miller" To: David Dillow Cc: netdev@oss.sgi.com Subject: Re: [RFC 2.6.10 5/22] xfrm: Attempt to offload bundled xfrm_states for outbound xfrms Message-Id: <20050125221154.7ee3691d.davem@davemloft.net> In-Reply-To: <1106373181.3691.41.camel@ori.thedillows.org> References: <20041230035000.13@ori.thedillows.org> <20041230035000.14@ori.thedillows.org> <20050121152045.5c92ee05.davem@davemloft.net> <1106373181.3691.41.camel@ori.thedillows.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 788 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 595 Lines: 15 On Sat, 22 Jan 2005 00:53:01 -0500 David Dillow wrote: > I've been reworking this area already to add the ability for the user to > control which devices/states combinations can be offloaded, so this code > will change. What do you think about just having the driver be > responsible for ignoring offload requests when they don't make sense, > like when the device is down, or in sleep mode? That would be fine. > BTW, xfrm_lookup() also calls stale_bundle(), which also relies on > netif_running(), among other tests. Good catch, hmmm... let me think about this case. From davem@davemloft.net Tue Jan 25 22:17:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 22:17:17 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q6HCDu016409 for ; Tue, 25 Jan 2005 22:17:13 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CtgQf-0004VS-00; Tue, 25 Jan 2005 22:13:25 -0800 Date: Tue, 25 Jan 2005 22:13:25 -0800 From: "David S. Miller" To: David Dillow Cc: netdev@oss.sgi.com Subject: Re: [RFC 2.6.10 4/22] xfrm: Try to offload inbound xfrm_states Message-Id: <20050125221325.0394417a.davem@davemloft.net> In-Reply-To: <1106373133.3691.40.camel@ori.thedillows.org> References: <20041230035000.12@ori.thedillows.org> <20041230035000.13@ori.thedillows.org> <20050121145608.65ad2d48.davem@davemloft.net> <1106373133.3691.40.camel@ori.thedillows.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 789 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 468 Lines: 12 On Sat, 22 Jan 2005 00:52:13 -0500 David Dillow wrote: > > Hmmm, this seems to deadlock. xfrm_state_add() is invoked > > with the RTNL semaphore already acquired. For example, via > > xfrm_user.c:xfrm_add_sa() > > Are you sure? It worked just fine during testing, and I don't see where > in the call chain from xfrm_netlink_rcv() to xfrm_state_add() the RTNL > sema is taken. Perhaps you were thinking of xfrm_cfg_sem? My bad, you're right. From davem@davemloft.net Tue Jan 25 22:21:14 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 22:21:19 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q6LE2E016949 for ; Tue, 25 Jan 2005 22:21:14 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CtgUY-0004Vv-00; Tue, 25 Jan 2005 22:17:26 -0800 Date: Tue, 25 Jan 2005 22:17:26 -0800 From: "David S. Miller" To: David Dillow Cc: netdev@oss.sgi.com Subject: Re: [RFC 2.6.10 1/22] xfrm: Add direction information to xfrm_state Message-Id: <20050125221726.73d4b7ab.davem@davemloft.net> In-Reply-To: <1106373022.3691.36.camel@ori.thedillows.org> References: <20041230035000.01@ori.thedillows.org> <20041230035000.10@ori.thedillows.org> <20050121143857.69282605.davem@davemloft.net> <1106373022.3691.36.camel@ori.thedillows.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 790 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 664 Lines: 19 On Sat, 22 Jan 2005 00:50:22 -0500 David Dillow wrote: > Hmm, I can see having netdev->xfrm_bundle_add() assume a outbound state, > since it's only called for Tx. > > Rx offloading could be interesting, but it looks like I could hook into > net/xfrm/xfrm_policy.c:__xfrm_policy_check(), and add the xfrm_states > seen there to a work queue for offloading. netdev->xfrm_state_add() > would then only see inbound states. > > Sound sane? You really can't get at the policies at these places somehow? Even by passing down the xfrm_policy pointer into these call chains? If you could get at the xfrm_policy, then you could get the direction. From davem@davemloft.net Tue Jan 25 22:22:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 22:22:53 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q6MnqR017327 for ; Tue, 25 Jan 2005 22:22:49 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CtgVp-0004X3-00; Tue, 25 Jan 2005 22:18:45 -0800 Date: Tue, 25 Jan 2005 22:18:44 -0800 From: "David S. Miller" To: David Dillow Cc: herbert@gondor.apana.org.au, netdev@oss.sgi.com Subject: Re: [IPSEC] Stop using dst->xfrm Message-Id: <20050125221844.1f92d008.davem@davemloft.net> In-Reply-To: <1106373513.3691.49.camel@ori.thedillows.org> References: <20050121102319.GA3160@gondor.apana.org.au> <1106373513.3691.49.camel@ori.thedillows.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 791 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 380 Lines: 11 On Sat, 22 Jan 2005 00:58:33 -0500 David Dillow wrote: > Can you tell me more about this? A quick search of google and the netdev > archives didn't turn up anything that looked relevant. Herbert has discussed his plans with some of us in private over the past few months, off and on. I guess he should post a brief rundown of what he plans to do overall. From davem@davemloft.net Tue Jan 25 22:26:24 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 22:26:30 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q6QNuA017948 for ; Tue, 25 Jan 2005 22:26:24 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CtgZG-0004XZ-00; Tue, 25 Jan 2005 22:22:18 -0800 Date: Tue, 25 Jan 2005 22:22:18 -0800 From: "David S. Miller" To: Herbert Xu Cc: jmorris@redhat.com, netdev@oss.sgi.com Subject: Re: [XFRM] Probe selected algorithm only Message-Id: <20050125222218.2d516e90.davem@davemloft.net> In-Reply-To: <20050121224546.GA8654@gondor.apana.org.au> References: <20050121101938.GA1133@gondor.apana.org.au> <20050121224546.GA8654@gondor.apana.org.au> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 792 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 554 Lines: 17 On Sat, 22 Jan 2005 09:45:46 +1100 Herbert Xu wrote: > > > Since we know the type of algorithm required when we're adding a new > > > SA, we can get away with only probing the selected algorithms. This > > > is what the following patch does for xfrm_user. > > > > > > Signed-off-by: Herbert Xu > > > > Looks good to me. > > > > Signed-off-by: James Morris > > Sorry, I forgot to update the calls in af_key. Here is the corrected > version. Applied, thanks Herbert. From davem@davemloft.net Tue Jan 25 22:27:00 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 22:27:06 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q6Qxts018216 for ; Tue, 25 Jan 2005 22:27:00 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CtgZx-0004Xk-00; Tue, 25 Jan 2005 22:23:01 -0800 Date: Tue, 25 Jan 2005 22:23:01 -0800 From: "David S. Miller" To: Herbert Xu Cc: netdev@oss.sgi.com Subject: Re: [IPSEC] Stop using dst->xfrm Message-Id: <20050125222301.5fb62202.davem@davemloft.net> In-Reply-To: <20050121102319.GA3160@gondor.apana.org.au> References: <20050121102319.GA3160@gondor.apana.org.au> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 793 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 481 Lines: 13 On Fri, 21 Jan 2005 21:23:19 +1100 Herbert Xu wrote: > Here is a precursor to the xfrm dst consolidation that I talked about. > In order to be able to store multiple SAs in one dst, we need to stop > using dst->xfrm directly. > > The following patch does that for the ->output() functions. > > Signed-off-by: Herbert Xu I'm going to create a 2.6.12 pending queue and put this and any forthcoming xfrm dst work there. From davem@davemloft.net Tue Jan 25 22:28:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 22:28:27 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q6SLhF018901 for ; Tue, 25 Jan 2005 22:28:21 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CtgbM-0004YD-00; Tue, 25 Jan 2005 22:24:28 -0800 Date: Tue, 25 Jan 2005 22:24:28 -0800 From: "David S. Miller" To: Arnaldo Carvalho de Melo Cc: netdev@oss.sgi.com Subject: Re: [PATCH 0/12] remove sk_protinfo series Message-Id: <20050125222428.6b076cb1.davem@davemloft.net> In-Reply-To: <41F07497.4020109@conectiva.com.br> References: <41F07497.4020109@conectiva.com.br> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 794 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 666 Lines: 17 On Fri, 21 Jan 2005 01:18:47 -0200 Arnaldo Carvalho de Melo wrote: > This series addresses Christoph and Jean concerns about the overhead > caused by private slab caches in every family, by making sk_alloc use kmalloc > if no slab cache is used, and as a transitional mechanism the zero_it > semantic is maintained, that is, if slab is NULL and zero_it is 1, use the > generic "slab" (sk_cachep) cache. I think we'll need to defer this to 2.6.12 When I setup my 2.6.12 net pending queue tomorrow I'll pull from your tree. I'll probably set this up tomorrow and it will be at: bk://kernel.bkbits.net/davem/net-2.6.12 I'll announce it. From davem@davemloft.net Tue Jan 25 22:29:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 22:29:09 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q6T3Va019266 for ; Tue, 25 Jan 2005 22:29:03 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Ctgc0-0004YL-00; Tue, 25 Jan 2005 22:25:08 -0800 Date: Tue, 25 Jan 2005 22:25:08 -0800 From: "David S. Miller" To: Stephen Hemminger Cc: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH] Tcp port selection for IPV6. Message-Id: <20050125222508.09f49c72.davem@davemloft.net> In-Reply-To: <20050120164529.6d6a5f0b@dxpl.pdx.osdl.net> References: <20050120164529.6d6a5f0b@dxpl.pdx.osdl.net> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 795 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 814 Lines: 19 On Thu, 20 Jan 2005 16:45:29 -0800 Stephen Hemminger wrote: > This patch makes TCP over IPV6 select ports the same way the current > TCPv4 code does. It uses a hash function to provide a starting offset > and a free running counter to provide seed. > > This changes the port selection semantics to match TCPv4 as well. > If the port is in use but to a different remote address, it will get > reused. It looks like the TCPv6 code was not updated when the TCPv4 > code changed. Now the code in ipv4/tcp_ipv4.c and ipv6/tcp_ipv6.c are > almost identical for tcp_hash_connect. > > Signed-off-by: Stephen Hemminger Looks good, sorry for taking so long to review. I think I'll push this into my 2.6.12 pending queue since 2.6.11 is very much in a bug-fix-only type mode. From rddunlap@osdl.org Tue Jan 25 22:29:50 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 22:29:54 -0800 (PST) Received: from fire-1.osdl.org (fire.osdl.org [65.172.181.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q6Tn8M019710 for ; Tue, 25 Jan 2005 22:29:49 -0800 Received: from [192.168.1.103] (wbar2.sea1-4-5-049-023.sea1.dsl-verizon.net [4.5.49.23]) (authenticated bits=0) by fire-1.osdl.org (8.12.8/8.12.8) with ESMTP id j0Q6TZTV019339 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Tue, 25 Jan 2005 22:29:36 -0800 Message-ID: <41F736E6.6000901@osdl.org> Date: Tue, 25 Jan 2005 22:21:26 -0800 From: "Randy.Dunlap" User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: acme@conectiva.com.br, davem@davemloft.net, netdev Subject: [PATCH] atalk: remove gcc warning when PROC_FS=n Content-Type: multipart/mixed; boundary="------------030706060002050505060002" X-MIMEDefang-Filter: osdl$Revision: 1.101 $ X-Scanned-By: MIMEDefang 2.36 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 796 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 1172 Lines: 39 This is a multi-part message in MIME format. --------------030706060002050505060002 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit appletalk: Fix gcc warning. with CONFIG_PROC_FS=n, gcc complains: net/appletalk/ddp.c:1893: warning: statement with no effect Signed-off-by: Randy Dunlap diffstat:= include/linux/atalk.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) --------------030706060002050505060002 Content-Type: text/x-patch; name="atalk_procfs.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="atalk_procfs.patch" diff -Naurp ./include/linux/atalk.h~atalk_procfs ./include/linux/atalk.h --- ./include/linux/atalk.h~atalk_procfs 2005-01-24 13:00:23.000000000 -0800 +++ ./include/linux/atalk.h 2005-01-25 19:43:22.647935760 -0800 @@ -229,7 +229,7 @@ extern void atalk_unregister_sysctl(void extern int atalk_proc_init(void); extern void atalk_proc_exit(void); #else -#define atalk_proc_init() 0 +#define atalk_proc_init() ({ 0; }) #define atalk_proc_exit() do { } while(0) #endif /* CONFIG_PROC_FS */ --------------030706060002050505060002-- From davem@davemloft.net Tue Jan 25 22:31:23 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 22:31:30 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q6VNc0020343 for ; Tue, 25 Jan 2005 22:31:23 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Ctgdu-0004ZO-00; Tue, 25 Jan 2005 22:27:06 -0800 Date: Tue, 25 Jan 2005 22:27:05 -0800 From: "David S. Miller" To: Lennert Buytenhek Cc: shemminger@osdl.org, roland@topspin.com, hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [PATCH]: was Re: LLTX and netif_stop_queue Message-Id: <20050125222705.1ee878fd.davem@davemloft.net> In-Reply-To: <20050121105452.GA12988@xi.wantstofly.org> References: <527jmu8nbw.fsf@topspin.com> <5cac192f0501030907c755135@mail.gmail.com> <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119164640.6c67bdfa.davem@davemloft.net> <52r7kgu5n5.fsf@topspin.com> <20050119230526.393a5184.davem@davemloft.net> <20050120085611.33f9485e@dxpl.pdx.osdl.net> <20050121105452.GA12988@xi.wantstofly.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 797 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 426 Lines: 10 On Fri, 21 Jan 2005 11:54:52 +0100 Lennert Buytenhek wrote: > If multiple CPUs can call into the tunneling drivers without taking > any locks, we'd need some extra locking in there, or just do what > Alexey describes and keep track of recursion in the skb. Another idea is that, just like how loopback made it's statistics per-cpu for LLTX support, this recursion variable could be per-cpu as well. From rddunlap@osdl.org Tue Jan 25 22:34:50 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 22:34:55 -0800 (PST) Received: from fire-1.osdl.org (fire.osdl.org [65.172.181.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q6YoTR020873 for ; Tue, 25 Jan 2005 22:34:50 -0800 Received: from [192.168.1.103] (wbar2.sea1-4-5-049-023.sea1.dsl-verizon.net [4.5.49.23]) (authenticated bits=0) by fire-1.osdl.org (8.12.8/8.12.8) with ESMTP id j0Q6SOTV019220 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Tue, 25 Jan 2005 22:28:24 -0800 Message-ID: <41F7369E.8070704@osdl.org> Date: Tue, 25 Jan 2005 22:20:14 -0800 From: "Randy.Dunlap" User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: jgarzik@pobox.com, jt@hpl.hp.com, netdev@oss.sgi.com Subject: [PATCH] arlan: remove gcc warning with CONFIG_PROC_FS=n Content-Type: multipart/mixed; boundary="------------070204060100070609080209" X-MIMEDefang-Filter: osdl$Revision: 1.101 $ X-Scanned-By: MIMEDefang 2.36 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 798 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 1450 Lines: 50 This is a multi-part message in MIME format. --------------070204060100070609080209 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit arlan: Fix gcc warning. With CONFIG_PROC_FS=n, gcc complains: drivers/net/wireless/arlan-main.c:1858: warning: statement with no effect Signed-off-by: Randy Dunlap diffstat:= drivers/net/wireless/arlan.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) --------------070204060100070609080209 Content-Type: text/x-patch; name="arlan_procfs.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="arlan_procfs.patch" arlan: Fix gcc warning. With CONFIG_PROC_FS=n, gcc complains: drivers/net/wireless/arlan-main.c:1858: warning: statement with no effect Signed-off-by: Randy Dunlap diffstat:= drivers/net/wireless/arlan.h | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -Naurp ./drivers/net/wireless/arlan.h~arlan_procfs ./drivers/net/wireless/arlan.h --- ./drivers/net/wireless/arlan.h~arlan_procfs 2005-01-24 13:00:20.000000000 -0800 +++ ./drivers/net/wireless/arlan.h 2005-01-25 21:09:01.963641016 -0800 @@ -43,7 +43,7 @@ extern int init_arlan_proc(void); extern void cleanup_arlan_proc(void); #else -#define init_arlan_proc() (0) +#define init_arlan_proc() ({ 0; }) #define cleanup_arlan_proc() do { } while (0); #endif --------------070204060100070609080209-- From davem@davemloft.net Tue Jan 25 22:34:52 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 22:34:58 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q6Yq0h020879 for ; Tue, 25 Jan 2005 22:34:52 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Ctghk-0004Zo-00; Tue, 25 Jan 2005 22:31:04 -0800 Date: Tue, 25 Jan 2005 22:31:04 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: netdev@oss.sgi.com Subject: Re: [BK PATCH] Ndisc updates Message-Id: <20050125223104.27b193f7.davem@davemloft.net> In-Reply-To: <20050121.015326.41280602.yoshfuji@linux-ipv6.org> References: <20050121.015326.41280602.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j0Q6Yq0h020879 X-archive-position: 799 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 549 Lines: 17 On Fri, 21 Jan 2005 01:53:26 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > Please pull following changesets available at > . > > Note: Roland already reviewd ipoib changeset. I put in Roland's original ipoib ndisc change at nearly the same time you put together these changes. So your tree will need to be updated to be against that. The changes look perfectly fine to me, so please resolve this conflict and I'll pull in your tree. Arigato gozaimasu. From sfeldma@pobox.com Tue Jan 25 22:35:33 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 22:35:37 -0800 (PST) Received: from orb.pobox.com (orb.pobox.com [207.8.226.5]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q6ZWtT021527 for ; Tue, 25 Jan 2005 22:35:33 -0800 Received: from orb (localhost [127.0.0.1]) by orb.pobox.com (Postfix) with ESMTP id 18C82D8; Wed, 26 Jan 2005 01:35:32 -0500 (EST) Received: from [192.168.0.3] (wbar2.sea1-4-5-062-153.sea1.dsl-verizon.net [4.5.62.153]) by orb.sasl.smtp.pobox.com (Postfix) with ESMTP id 88A028D; Wed, 26 Jan 2005 01:35:30 -0500 (EST) Subject: Re: [PATCH] skge driver (0.5) From: Scott Feldman Reply-To: sfeldma@pobox.com To: Stephen Hemminger Cc: netdev@oss.sgi.com In-Reply-To: <20050125151507.414e7f4f@dxpl.pdx.osdl.net> References: <20050119135217.38fe5f05@dxpl.pdx.osdl.net> <20050125151507.414e7f4f@dxpl.pdx.osdl.net> Content-Type: text/plain Message-Id: <1106721439.3458.449.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Tue, 25 Jan 2005 22:37:19 -0800 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 800 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sfeldma@pobox.com Precedence: bulk X-list: netdev Content-Length: 1408 Lines: 55 Nice looking driver Stephen. :) Some minor comments. > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include Seems like dma-mapping.h, udp.h, tcp.h, irq.h don't need to be included for a clean compile. Ditch 'em? > + > + memset(hw, 0, sizeof(*hw)); > + hw->pdev = pdev; > + spin_lock_init(&hw->phy_lock); > + tasklet_init(&hw->ext_tasklet, skge_extirq, (unsigned long) hw); > + > + hw->regs = ioremap_nocache(pci_resource_start(pdev, 0), 0x4000); > + if (!hw->regs) { > + printk(KERN_ERR "skge %s: cannot map device registers\n", PFX instead of skge. There are a couple of these with hardcoded "skge" or none at all. > +static int skge_resume(struct pci_dev *pdev) > +{ > + struct skge_hw *hw = pci_get_drvdata(pdev); > + int i; > + > + pci_set_power_state(pdev, PCI_D0); > + pci_restore_state(pdev); > + > + skge_reset(hw); > + > + for(i = 0; i < 2; i++) { > + struct net_device *dev = hw->dev[i]; Is a netif_device_attach needed to match the netif_device_detach in suspend? -scott From davem@davemloft.net Tue Jan 25 22:37:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 22:37:32 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q6bSBr022295 for ; Tue, 25 Jan 2005 22:37:28 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CtgkG-0004aK-00; Tue, 25 Jan 2005 22:33:40 -0800 Date: Tue, 25 Jan 2005 22:33:39 -0800 From: "David S. Miller" To: Thomas Graf Cc: netdev@oss.sgi.com Subject: Re: [PATCH] NET: Set NLM_F_MULTI for neighbour rtnetlink messages to userspace Message-Id: <20050125223339.665dea43.davem@davemloft.net> In-Reply-To: <20050120143135.GE26856@postel.suug.ch> References: <20050120143135.GE26856@postel.suug.ch> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 801 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 60 Lines: 4 Good catch Thomas. Both 2.4.x and 2.6.x variants applied. From mrenzmann@web.de Tue Jan 25 23:20:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 23:20:47 -0800 (PST) Received: from smtp07.web.de (smtp07.web.de [217.72.192.225]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q7KfQW023902 for ; Tue, 25 Jan 2005 23:20:42 -0800 Received: from [213.196.197.13] (helo=[192.168.2.42]) by smtp07.web.de with asmtp (TLSv1:RC4-MD5:128) (WEB.DE 4.103 #192) id 1CthQO-00049l-00; Wed, 26 Jan 2005 08:17:12 +0100 Message-ID: <41F743F6.2020008@web.de> Date: Wed, 26 Jan 2005 08:17:10 +0100 From: Michael Renzmann User-Agent: Mozilla Thunderbird 0.8 (X11/20040916) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Dan Williams CC: Jean Tourrilhes , netdev@oss.sgi.com Subject: Re: Where Linux 802.11x support needs work References: <20050126024039.GA25326@bougret.hpl.hp.com> In-Reply-To: X-Enigmail-Version: 0.86.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Sender: mrenzmann@web.de X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 802 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mrenzmann@web.de Precedence: bulk X-list: netdev Content-Length: 1523 Lines: 35 Hi. Dan Williams wrote: > madwifi: doesn't seem to implement SIOCGIWSTATS It does. The SIOCGIWSTATS is used in tools/athstats.c (line 195 in current CVS) for example to get the rssi (via qual.qual). >>>o Ad-Hoc mode support is quite flaky or absent from most drivers >> Low priority for most vendors, firwmares are only lightly tested. > Yeah, I don't expect much to happen here but it would be nice. FWIW, at > least madwifi and atmel seem to work OK here. Madwifi unfortunately has some known problems in Ad-hoc implementation. Someone worked on that, but the patches have not been sent in as far as I can tell. >> Note that various other people have their own todo list. Jeff >>also has things he has in minds. I have (few) patches on my web >>pages. Driver authors also have their wishes. > True, but I'm not sure how many of those wishes/todo lists are actually > well-known or public. I don't really see any great momentum in the Linux > 802.11x world, but more a hodge-podge of improvements. I was hoping that > the post today could help direct a bit more attention and effort at Linux > 802.11x stuff so we could try to clean it up and improve it. How about setting up a project that cares of finding, defining and implementing such quasi-standards in the Linux 802.11 world? Most things are very WLAN specific, so I think netdev isn't the best place to discuss them. Of course this only works IMO when many (if not all) of the wlan driver authors join in and help out. Comments? Bye, Mike From herbert@gondor.apana.org.au Tue Jan 25 23:22:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 23:22:35 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q7MQfP024260 for ; Tue, 25 Jan 2005 23:22:27 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CthUv-0003iw-00; Wed, 26 Jan 2005 18:21:53 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CthU8-0001Uo-00; Wed, 26 Jan 2005 18:21:04 +1100 From: Herbert Xu To: dave@thedillows.org (David Dillow) Subject: Re: [IPSEC] Stop using dst->xfrm Cc: herbert@gondor.apana.org.au, davem@davemloft.net, netdev@oss.sgi.com Organization: Core In-Reply-To: <1106373513.3691.49.camel@ori.thedillows.org> X-Newsgroups: apana.lists.os.linux.netdev User-Agent: tin/1.7.4-20040225 ("Benbecula") (UNIX) (Linux/2.4.27-hx-1-686-smp (i686)) Message-Id: Date: Wed, 26 Jan 2005 18:21:04 +1100 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 803 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 1249 Lines: 32 David Dillow wrote: > >> Here is a precursor to the xfrm dst consolidation that I talked about. >> In order to be able to store multiple SAs in one dst, we need to stop >> using dst->xfrm directly. > > Can you tell me more about this? A quick search of google and the netdev > archives didn't turn up anything that looked relevant. My immediate goal is to store PMTU values for xfrm dst entries. I was toying with the idea of consolidating the xfrm dst's of a bundle into a single dst. The rationale is that the current list of xfrm dst's doesn't provide any more info than what we would have in a single xfrm dst. However, this is not central to my plans so I won't pursue it straight away. > I'd like to see where you're going, so I can meet you there. The xfrm > offload patches currently add dst->xfrm_offload to cache the info needed > to offload the crypto operations. It'll be slower, but I could lookup > that up each time if need be. I'll take a look at your work first and get back to you. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From roarbr@tihlde.org Tue Jan 25 23:35:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Tue, 25 Jan 2005 23:35:11 -0800 (PST) Received: from mail.thales-communications.no (mail.thales-communications.no [80.239.27.10]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q7Z6T6025211 for ; Tue, 25 Jan 2005 23:35:07 -0800 Received: by tcnosr02.tcno.thales (Postfix, from userid 10) id DB3936FC82; Wed, 26 Jan 2005 08:35:04 +0100 (CET) Received: from [10.1.3.57] (unknown [80.239.6.50]) by outpost.thales-communications.no (Postfix) with ESMTP id 7F2D86FC82; Wed, 26 Jan 2005 08:31:36 +0100 (CET) Message-ID: <41F74757.3090104@tihlde.org> Date: Wed, 26 Jan 2005 08:31:35 +0100 From: =?ISO-8859-1?Q?Roar_Bj=F8rgum_Rotvik?= User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: Re: Where Linux 802.11x support needs work References: <20050126024039.GA25326@bougret.hpl.hp.com> <200501252341.27041.flamingice@sourmilk.net> In-Reply-To: <200501252341.27041.flamingice@sourmilk.net> X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 804 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: roarbr@tihlde.org Precedence: bulk X-list: netdev Content-Length: 1724 Lines: 39 Michael Wu wrote: > On Tuesday 25 January 2005 11:03 pm, Dan Williams wrote: > >>> One of the big item not mentionned by you is the in-kernel >>>802.11 stack (native frames and management). If done right, I guess it >>>would mostly be transparent to you... >> >>You know, I was thinking of it and I just forgot to put it on the list. >>If you're including madwifi and ipw2x00, we have a grand total of what, 3 >>or 4 802.11 stacks in the kernel at the same time? (madwifi, >>orinoco/hermes, ipw2x00, linux-wlan-ng) >> > > Only orinoco/hermes is in the kernel, and that doesn't really have much of an > 802.11 stack, since most things are done in hardware. Madwifi has a fairly > complete 802.11 stack (ported from netbsd), and so does adm8211. Dunno about > ipw2x00. Do any of these 80.11 stacks (or the upstream linux network stack) have a solution for WLAN cards with 802.11e (QoS extension) with more than one HW/firmware transmit queues? As you may or may not know WLAN cards implementing 802.11e may have more than one HW/firmware transmit queue (I know of an 802.11a chip with 802.11e extension that have 4 transmit queues in hardware/firmware with different priority). As far as I know the linux network stack today only have one qdisc queue pr. device (struct netdev), so the driver may only stop/start (netif_stop_queue()/netif_wake_queue()) one queue at a time. This is a problem for drivers with more than one HW/firmware transmit queues, as you can not let a full low priority HW queue block the netdev queue. Is there an existing solution for this problem, or is an multiqueue-pr-device solution being planned as part of introducing a common 802.11 stack in the kernel? -- Roar B. Rotvik From bdschuym@pandora.be Wed Jan 26 01:02:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 01:02:56 -0800 (PST) Received: from astra.telenet-ops.be (astra.telenet-ops.be [195.130.132.58]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0Q92lvH032081 for ; Wed, 26 Jan 2005 01:02:47 -0800 Received: from localhost (localhost.localdomain [127.0.0.1]) by astra.telenet-ops.be (Postfix) with SMTP id 2E2CD3281AA; Wed, 26 Jan 2005 10:02:46 +0100 (MET) Received: from 192.168.0.138 (dD5763CA9.access.telenet.be [213.118.60.169]) by astra.telenet-ops.be (Postfix) with ESMTP id 564BC328068; Wed, 26 Jan 2005 10:02:45 +0100 (MET) Subject: Re: [PATCH/RFC] Reduce call chain length in netfilter (was: Re: do_IRQ: stack overflow: 872..) From: Bart De Schuymer To: "David S. Miller" Cc: Martin Josefsson , shemminger@osdl.org, dwmw2@infradead.org, ak@suse.de, snort2004@mail.ru, bridge@osdl.org, netdev@oss.sgi.com, rusty@rustcorp.com.au, netfilter-devel@lists.netfilter.org In-Reply-To: <20050125220558.6e824f8a.davem@davemloft.net> References: <1131604877.20041218092730@mail.ru.suse.lists.linux.kernel> <1105117559.11753.34.camel@baythorne.infradead.org> <20050107100017.454ddadc@dxpl.pdx.osdl.net> <1105133241.3375.16.camel@localhost.localdomain> <20050118135735.4b77d38d.davem@davemloft.net> <1106433059.4486.11.camel@localhost.localdomain> <1106436153.20995.42.camel@tux.rsn.bth.se> <1106484019.3376.5.camel@localhost.localdomain> <1106496509.1085.1.camel@tux.rsn.bth.se> <20050125220558.6e824f8a.davem@davemloft.net> Content-Type: text/plain Date: Wed, 26 Jan 2005 10:08:29 +0100 Message-Id: <1106730510.4041.4.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 805 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bdschuym@pandora.be Precedence: bulk X-list: netdev Content-Length: 7574 Lines: 235 Op di, 25-01-2005 te 22:05 -0800, schreef David S. Miller: > On Sun, 23 Jan 2005 17:08:29 +0100 > Martin Josefsson wrote: > > > I'm now running a kernel with this patch and everything seems to still > > be working. > > So unless someone else has something to comment I think this should be > > applied. > > The decrease in call-depth is important. > > I would like to see at least one ACK from the netfilter > folks. Bart or Rusty, could you forward to patch to > netfilter-devel for review? AFAIK Martin is in the netfilter core team. Anyway, I just included netfilter-devel. Does anyone have objections to this patch, which reduces the netfilter call chain length? > I have some other ideas about how bridging might be able > to save some call chain depth... but I need to think about > it some more before proposing or even trying to implement. > (basically something akin to how we do route level packet > output, via dst_output(), but instead we're doing this > at ->hard_start_xmit() time) I'm all ears :) --- linux-2.6.11-rc1/include/linux/netfilter.h.old 2005-01-23 13:31:58.895886808 +0100 +++ linux-2.6.11-rc1/include/linux/netfilter.h 2005-01-23 13:32:02.853285192 +0100 @@ -18,7 +18,8 @@ #define NF_STOLEN 2 #define NF_QUEUE 3 #define NF_REPEAT 4 -#define NF_MAX_VERDICT NF_REPEAT +#define NF_STOP 5 +#define NF_MAX_VERDICT NF_STOP /* Generic cache responses from hook functions. <= 0x2000 is used for protocol-flags. */ @@ -138,23 +139,34 @@ void nf_log_packet(int pf, /* This is gross, but inline doesn't cut it for avoiding the function call in fast path: gcc doesn't inline (needs value tracking?). --RR */ #ifdef CONFIG_NETFILTER_DEBUG -#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) \ - nf_hook_slow((pf), (hook), (skb), (indev), (outdev), (okfn), INT_MIN) -#define NF_HOOK_THRESH nf_hook_slow +#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) \ +({int __ret = 0; \ +if (!nf_hook_slow(pf, hook, &(skb), indev, outdev, okfn, INT_MIN, &__ret)) \ + __ret = (okfn)(skb); \ +__ret;}) +#define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh) \ +({int __ret = 0; \ +if (!nf_hook_slow(pf, hook, &(skb), indev, outdev, okfn, thresh, &__ret)) \ + __ret = (okfn)(skb); \ +__ret;}) #else -#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) \ -(list_empty(&nf_hooks[(pf)][(hook)]) \ - ? (okfn)(skb) \ - : nf_hook_slow((pf), (hook), (skb), (indev), (outdev), (okfn), INT_MIN)) -#define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh) \ -(list_empty(&nf_hooks[(pf)][(hook)]) \ - ? (okfn)(skb) \ - : nf_hook_slow((pf), (hook), (skb), (indev), (outdev), (okfn), (thresh))) +#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) \ +({int __ret = 0; \ +if (list_empty(&nf_hooks[pf][hook]) || \ + !nf_hook_slow(pf, hook, &(skb), indev, outdev, okfn, INT_MIN, &__ret)) \ + __ret = (okfn)(skb); \ +__ret;}) +#define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh) \ +({int __ret = 0; \ +if (list_empty(&nf_hooks[pf][hook]) || \ + !nf_hook_slow(pf, hook, &(skb), indev, outdev, okfn, thresh, &__ret)) \ + __ret = (okfn)(skb); \ +__ret;}) #endif -int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb, +int nf_hook_slow(int pf, unsigned int hook, struct sk_buff **pskb, struct net_device *indev, struct net_device *outdev, - int (*okfn)(struct sk_buff *), int thresh); + int (*okfn)(struct sk_buff *), int thresh, int *ret); /* Call setsockopt() */ int nf_setsockopt(struct sock *sk, int pf, int optval, char __user *opt, --- linux-2.6.11-rc1/net/core/netfilter.c.old 2005-01-23 13:31:48.980394192 +0100 +++ linux-2.6.11-rc1/net/core/netfilter.c 2005-01-23 13:32:02.856284736 +0100 @@ -349,6 +349,8 @@ static unsigned int nf_iterate(struct li int (*okfn)(struct sk_buff *), int hook_thresh) { + unsigned int verdict; + /* * The caller must not block between calls to this * function because of risk of continuing from deleted element. @@ -361,28 +363,18 @@ static unsigned int nf_iterate(struct li /* Optimization: we don't need to hold module reference here, since function can't sleep. --RR */ - switch (elem->hook(hook, skb, indev, outdev, okfn)) { - case NF_QUEUE: - return NF_QUEUE; - - case NF_STOLEN: - return NF_STOLEN; - - case NF_DROP: - return NF_DROP; - - case NF_REPEAT: - *i = (*i)->prev; - break; - + verdict = elem->hook(hook, skb, indev, outdev, okfn); + if (verdict != NF_ACCEPT) { #ifdef CONFIG_NETFILTER_DEBUG - case NF_ACCEPT: - break; - - default: - NFDEBUG("Evil return from %p(%u).\n", - elem->hook, hook); + if (unlikely(verdict > NF_MAX_VERDICT)) { + NFDEBUG("Evil return from %p(%u).\n", + elem->hook, hook); + continue; + } #endif + if (verdict != NF_REPEAT) + return verdict; + *i = (*i)->prev; } } return NF_ACCEPT; @@ -494,50 +486,47 @@ static int nf_queue(struct sk_buff *skb, return 1; } -int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb, +/* Returns 0 if okfn() needs to be executed by the caller, -EPERM otherwise. + * Assumes *ret==0 when called. On return, *ret!=0 when verdict==NF_DROP */ +int nf_hook_slow(int pf, unsigned int hook, struct sk_buff **pskb, struct net_device *indev, struct net_device *outdev, int (*okfn)(struct sk_buff *), - int hook_thresh) + int hook_thresh, int *ret) { struct list_head *elem; unsigned int verdict; - int ret = 0; + int ret2 = 0; /* We may already have this, but read-locks nest anyway */ rcu_read_lock(); #ifdef CONFIG_NETFILTER_DEBUG - if (skb->nf_debug & (1 << hook)) { + if (unlikely((*pskb)->nf_debug & (1 << hook))) { printk("nf_hook: hook %i already set.\n", hook); - nf_dump_skb(pf, skb); + nf_dump_skb(pf, *pskb); } - skb->nf_debug |= (1 << hook); + (*pskb)->nf_debug |= (1 << hook); #endif elem = &nf_hooks[pf][hook]; next_hook: - verdict = nf_iterate(&nf_hooks[pf][hook], &skb, hook, indev, + verdict = nf_iterate(&nf_hooks[pf][hook], pskb, hook, indev, outdev, &elem, okfn, hook_thresh); - if (verdict == NF_QUEUE) { + if (verdict == NF_ACCEPT || verdict == NF_STOP) + goto unlock; + else if (verdict == NF_DROP) { + kfree_skb(*pskb); + *ret = -EPERM; + } else if (verdict == NF_QUEUE) { NFDEBUG("nf_hook: Verdict = QUEUE.\n"); - if (!nf_queue(skb, elem, pf, hook, indev, outdev, okfn)) + if (!nf_queue(*pskb, elem, pf, hook, indev, outdev, okfn)) goto next_hook; } - - switch (verdict) { - case NF_ACCEPT: - ret = okfn(skb); - break; - - case NF_DROP: - kfree_skb(skb); - ret = -EPERM; - break; - } - + ret2 = -EPERM; +unlock: rcu_read_unlock(); - return ret; + return ret2; } void nf_reinject(struct sk_buff *skb, struct nf_info *info, --- linux-2.6.11-rc1/net/bridge/br_netfilter.c.old 2005-01-23 13:31:39.080899144 +0100 +++ linux-2.6.11-rc1/net/bridge/br_netfilter.c 2005-01-23 13:32:02.861283976 +0100 @@ -829,8 +829,7 @@ static unsigned int ip_sabotage_in(unsig { if ((*pskb)->nf_bridge && !((*pskb)->nf_bridge->mask & BRNF_NF_BRIDGE_PREROUTING)) { - okfn(*pskb); - return NF_STOLEN; + return NF_STOP; } return NF_ACCEPT; @@ -888,8 +887,7 @@ static unsigned int ip_sabotage_out(unsi if (out->priv_flags & IFF_802_1Q_VLAN) nf_bridge->netoutdev = (struct net_device *)out; #endif - okfn(skb); - return NF_STOLEN; + return NF_STOP; } return NF_ACCEPT; From jf-ml-k1-1087813225@lk8rp.mail.xeon.eu.org Wed Jan 26 01:44:24 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 01:44:30 -0800 (PST) Received: from www.acomp.hu (acomp.externet.hu [212.40.96.68]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0Q9iM2V001074 for ; Wed, 26 Jan 2005 01:44:24 -0800 Received: (qmail 1938 invoked from network); 26 Jan 2005 09:44:20 -0000 Received: from smail.acomp.hu ([undisclosed]) by www.acomp.hu ([127.0.0.1]) with ESMTP via TCP; 26 Jan 2005 09:44:20 -0000 Date: Wed, 26 Jan 2005 10:44:22 +0100 From: Janos Farkas To: linux-kernel@vger.kernel.org Cc: netdev@oss.sgi.com Subject: waiting for ppp0 to become free (Re: ppp0 out of control) Message-ID: <20050126094422.GA31040@lk8rp.mail.xeon.eu.org> Mail-Followup-To: Janos Farkas , linux-kernel@vger.kernel.org, netdev@oss.sgi.com References: <20050121144444.GA2100@roxor.be> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20050121144444.GA2100@roxor.be> User-Agent: Mutt/1.5.6i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 806 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jf-ml-k1-1087813225@lk8rp.mail.xeon.eu.org Precedence: bulk X-list: netdev Content-Length: 1209 Lines: 26 On 2005-01-21 at 15:44:44, Aurélien GÉRÔME wrote: > I am running 2.6.10 from kernel.org on Debian Sid ppc/x86, the same > issue occurs with 2.6.9. Though, 2.6.8.1 and previous are fine. > > When my ISP connection via PPPoE (kernel side) goes down, reconnection > does not occur, and the kernel displays continuous: > > kernel: unregister_netdevice: waiting for ppp0 to become free. Usage count = 1 BTW, I have seen many cases when this symptom annoyed me too, the last one is that my shutdown scripts tried unloading the network driver modules. Is your setup doing this by any chance? In my case, apparently there were conntrack entries keeping the device in use, which is almost useless when preparing to shutdown :) OTOH, I couldn't find a way to flush those conntracks, so I worked around it by not rmmoding ethernet drivers. In your case, it's probably conntrack too, I'd presume you are using that PPPoE machine as a masquerading gateway, which by definition needs connection tracking... I'm not sure either if this is a "real" change, I only vaguely recollect as some moons earlier this wasn't a problem in 2.6. -- Janos | romfs is at http://romfs.sourceforge.net/ | Don't talk about silence. From andre@tomt.net Wed Jan 26 02:02:58 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 02:03:03 -0800 (PST) Received: from mx1.skjellin.no (mail1.skjellin.no [80.239.42.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QA2vkD002159 for ; Wed, 26 Jan 2005 02:02:58 -0800 Received: from localhost (localhost [127.0.0.1]) by mx1.skjellin.no (Postfix) with ESMTP id 70AD38850E; Wed, 26 Jan 2005 11:02:56 +0100 (CET) Received: from puppen.pasop.tomt.net (gw-fe-1.pasop.tomt.net [10.255.1.1]) by mail1.skjellin.no (Postfix) with ESMTP id 8AD5288502; Wed, 26 Jan 2005 11:02:54 +0100 (CET) Received: from [10.255.1.10] (slurv.pasop.tomt.net [10.255.1.10]) by puppen.pasop.tomt.net (Postfix) with ESMTP id 68CB8227FB; Wed, 26 Jan 2005 11:02:54 +0100 (CET) Message-ID: <41F76ACE.3070405@tomt.net> Date: Wed, 26 Jan 2005 11:02:54 +0100 From: Andre Tomt User-Agent: Debian Thunderbird 1.0 (X11/20050122) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Janos Farkas Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: waiting for ppp0 to become free (Re: ppp0 out of control) References: <20050121144444.GA2100@roxor.be> <20050126094422.GA31040@lk8rp.mail.xeon.eu.org> In-Reply-To: <20050126094422.GA31040@lk8rp.mail.xeon.eu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at skjellin.no X-Virus-Status: Clean X-archive-position: 807 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: andre@tomt.net Precedence: bulk X-list: netdev Content-Length: 1831 Lines: 42 Janos Farkas wrote: > On 2005-01-21 at 15:44:44, Aurélien GÉRÔME wrote: > >>I am running 2.6.10 from kernel.org on Debian Sid ppc/x86, the same >>issue occurs with 2.6.9. Though, 2.6.8.1 and previous are fine. >> >>When my ISP connection via PPPoE (kernel side) goes down, reconnection >>does not occur, and the kernel displays continuous: >> >>kernel: unregister_netdevice: waiting for ppp0 to become free. Usage count = 1 > > > BTW, I have seen many cases when this symptom annoyed me too, the last > one is that my shutdown scripts tried unloading the network driver > modules. Is your setup doing this by any chance? In my case, > apparently there were conntrack entries keeping the device in use, > which is almost useless when preparing to shutdown :) > > OTOH, I couldn't find a way to flush those conntracks, so I worked > around it by not rmmoding ethernet drivers. > > In your case, it's probably conntrack too, I'd presume you are using > that PPPoE machine as a masquerading gateway, which by definition needs > connection tracking... I'm not sure either if this is a "real" change, > I only vaguely recollect as some moons earlier this wasn't a problem in > 2.6. > Here's some data I've collected on a possible related or identical one. So far it seems related to interface removal. I've seen this recently on vlan interfaces, since ifupdown on my systems kill vlan devices on ifdown. In my cases I've not been able to reproduce without ipv6 loaded in the kernel, and it only seems to happen when lo/loopback is taken offline first (ifdown -a here does it in that order..) A shutdown rrmod-type takedown of a NIC would probably be run after "ifdown -a", hence after lo is down, thats why I suspect it to be the same problem. I still have a binary search to do for pinpointing what broke it, though. From kazunori@miyazawa.org Wed Jan 26 02:10:33 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 02:10:37 -0800 (PST) Received: from miyazawa.org (usen-221x116x13x66.ap-US01.usen.ad.jp [221.116.13.66]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QAAWWc002880 for ; Wed, 26 Jan 2005 02:10:32 -0800 Received: from [2001:200:182:2000:205:4eff:fe42:f9b3] ([2001:200:182:2000:205:4eff:fe42:f9b3]) (AUTH: LOGIN kazunori, SSL: TLSv1/SSLv3,128bits,RC4-MD5) by miyazawa.org with esmtp; Wed, 26 Jan 2005 19:10:20 +0900 id 00007DAB.41F76C8C.00003083 From: MIYAZAWA Kazunori To: "David S. Miller" Subject: [PATCH][IPsec] fix process of error from crypto module Date: Wed, 26 Jan 2005 19:10:20 +0900 User-Agent: KMail/1.7.1 Cc: netdev@oss.sgi.com, usagi-core@linux-ipv6.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501261910.20867.kazunori@miyazawa.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 808 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kazunori@miyazawa.org Precedence: bulk X-list: netdev Content-Length: 1267 Lines: 36 Hello, This patch fixes the process under the case that the crypto module returns error because of its weak keys or etc. diff -ur a/net/ipv4/esp4.c b/net/ipv4/esp4.c --- a/net/ipv4/esp4.c 2004-12-25 06:34:58.000000000 +0900 +++ b/net/ipv4/esp4.c 2005-01-26 18:57:18.000000000 +0900 @@ -427,7 +427,8 @@ goto error; get_random_bytes(esp->conf.ivec, esp->conf.ivlen); } - crypto_cipher_setkey(esp->conf.tfm, esp->conf.key, esp->conf.key_len); + if (crypto_cipher_setkey(esp->conf.tfm, esp->conf.key, esp->conf.key_len)) + goto error; x->props.header_len = sizeof(struct ip_esp_hdr) + esp->conf.ivlen; if (x->props.mode) x->props.header_len += sizeof(struct iphdr); diff -ur a/net/ipv6/esp6.c b/net/ipv6/esp6.c --- a/net/ipv6/esp6.c 2004-12-25 06:35:01.000000000 +0900 +++ b/net/ipv6/esp6.c 2005-01-26 18:57:04.000000000 +0900 @@ -364,7 +364,8 @@ goto error; get_random_bytes(esp->conf.ivec, esp->conf.ivlen); } - crypto_cipher_setkey(esp->conf.tfm, esp->conf.key, esp->conf.key_len); + if (crypto_cipher_setkey(esp->conf.tfm, esp->conf.key, esp->conf.key_len)) + goto error; x->props.header_len = sizeof(struct ipv6_esp_hdr) + esp->conf.ivlen; if (x->props.mode) x->props.header_len += sizeof(struct ipv6hdr); -- Kazunori Miyazawa From herbert@gondor.apana.org.au Wed Jan 26 02:22:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 02:22:11 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QAM2iJ003644 for ; Wed, 26 Jan 2005 02:22:03 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CtkIy-0004qb-00; Wed, 26 Jan 2005 21:21:44 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CtkIW-0004Xo-00; Wed, 26 Jan 2005 21:21:16 +1100 Date: Wed, 26 Jan 2005 21:21:16 +1100 To: David Dillow Cc: davem@davemloft.net, netdev@oss.sgi.com Subject: Re: [IPSEC] Stop using dst->xfrm Message-ID: <20050126102116.GA17413@gondor.apana.org.au> References: <1106373513.3691.49.camel@ori.thedillows.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 809 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 918 Lines: 23 On Wed, Jan 26, 2005 at 06:21:04PM +1100, Herbert Xu wrote: > > > I'd like to see where you're going, so I can meet you there. The xfrm > > offload patches currently add dst->xfrm_offload to cache the info needed > > to offload the crypto operations. It'll be slower, but I could lookup > > that up each time if need be. > > I'll take a look at your work first and get back to you. I've had a look at some of your patches with the xfrm dst stuff in mind. It seems that you have nothing to worry about as far as dst consolidation goes. In fact, your current implementation of xfrm_accel_bundle() would benefit from such a move as it would have access to all the transforms in a single dst entry. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From buytenh@wantstofly.org Wed Jan 26 05:25:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 05:25:19 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QDPDVd014000 for ; Wed, 26 Jan 2005 05:25:14 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id CE0952B0EC; Wed, 26 Jan 2005 14:25:12 +0100 (MET) Date: Wed, 26 Jan 2005 14:25:12 +0100 From: Lennert Buytenhek To: "David S. Miller" Cc: shemminger@osdl.org, roland@topspin.com, hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [PATCH]: was Re: LLTX and netif_stop_queue Message-ID: <20050126132512.GA18220@xi.wantstofly.org> References: <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119164640.6c67bdfa.davem@davemloft.net> <52r7kgu5n5.fsf@topspin.com> <20050119230526.393a5184.davem@davemloft.net> <20050120085611.33f9485e@dxpl.pdx.osdl.net> <20050121105452.GA12988@xi.wantstofly.org> <20050125222705.1ee878fd.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050125222705.1ee878fd.davem@davemloft.net> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 810 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev Content-Length: 960 Lines: 22 On Tue, Jan 25, 2005 at 10:27:05PM -0800, David S. Miller wrote: > > If multiple CPUs can call into the tunneling drivers without taking > > any locks, we'd need some extra locking in there, or just do what > > Alexey describes and keep track of recursion in the skb. > > Another idea is that, just like how loopback made it's statistics > per-cpu for LLTX support, this recursion variable could be per-cpu > as well. I've thought about this a bit, and the only sane way of doing recursion detection that doesn't involve 'struct net_device' would be to keep track of the recursion depth (perhaps per-CPU as you suggest) and tossing the packet when it exceeds some random value, right? To reproduce the current behaviour more closely you'd have to keep a small per-CPU array of 'struct net_device *' pointers as a kind of recursion stack, and toss the packet when you hit a net_device that's already on the list. But that seems like slight overkill. --L From Robert.Olsson@data.slu.se Wed Jan 26 05:27:39 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 05:27:46 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QDRcpM014314 for ; Wed, 26 Jan 2005 05:27:39 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0QDRA0O023925; Wed, 26 Jan 2005 14:27:11 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id B321AEE1D1; Wed, 26 Jan 2005 14:27:10 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16887.39598.648724.421160@robur.slu.se> Date: Wed, 26 Jan 2005 14:27:10 +0100 To: netdev@oss.sgi.com Cc: hadi@cyberus.ca, davem@davemloft.net, Robert.Olsson@data.slu.se Subject: Linux Routing Performance Update X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 811 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Content-Length: 2699 Lines: 71 Hello! Finally time for some more testing with a somewhat upgraded equipment. Linux: Vanilla 2.6.10 plus e1000 patch brewed from input from Scott feldman, Lennert Buytenhek and others. ftp://robur.slu.se/pub/Linux/net-development/tmp/e1000-new-tx-4.pat System: Dual Opteron 250 (2.4 GHz) all boards dual e1000 w 82546GB. ------------------------------------------------------------------------------- Experiment 1: Single flow on UP Input rate 1.488 Mpps Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flags eth0 1500 0 7132981 4056792 4056792 2867019 5 0 0 0 BRU eth1 1500 0 1 0 0 0 7131234 0 0 0 BRU eth2 1500 0 0 0 0 0 5 0 0 0 BRU eth3 1500 0 0 0 0 0 5 0 0 0 BRU CPU0 24: 108 IO-APIC-level eth1 27: 107 IO-APIC-level eth0 28: 109 IO-APIC-level eth2 29: 109 IO-APIC-level eth3 006cd736 00000000 00005ce0 00000000 00000000 00000000 00000000 00000000 00000000 Full DoS of 10 Mpackets now at 1.488 Mpps. We route 71.3%. Routing t-put 1061 kpps. So we passed 1 Mpps... Note there are no RX interrupts (NAPI) Also as the e1000 cleans the skb's at hard_xmit so we see no TX interrupts either. ------------------------------------------------------------------------------- Experiment 2: SMP/(NUMA) Even more exciting. Same as above but input 2 * 1.430 Mpps (max from the pktgen box it's a DUAL XEON 2.67 GHz) Note! Routing is setup so pkts on eth0->eth1 on CPU0. and irq's for eth0/eth1 goes to CPU0. The other flow on eth2/eth3 on CPU1 is handled similar. Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flags eth0 1500 0 7231782 4282705 4282705 2768218 5 0 0 0 BRU eth1 1500 0 4 0 0 0 7230466 0 0 0 BRU eth2 1500 0 7671898 4723762 4723762 2328102 5 0 0 0 BRU eth3 1500 0 1 0 0 0 7670181 0 0 0 BRU CPU0 CPU1 24: 143 1 IO-APIC-level eth1 27: 138 1 IO-APIC-level eth0 28: 19 121 IO-APIC-level eth2 29: 19 121 IO-APIC-level eth3 006e592a 00000000 00005e29 00000000 00000000 00000000 00000000 00000000 00000000 0075105b 00000000 000063e4 00000000 00000000 00000000 00000000 00000000 00000000 Few interrupts and balanced as it was setup. /proc/net/softnet_stat show both CPU were involved forwarding. An aggregated routing performance of 2.1 Mpps. Enjoy. --ro From hadi@cyberus.ca Wed Jan 26 05:48:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 05:48:52 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QDmlD6015758 for ; Wed, 26 Jan 2005 05:48:47 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CtnXE-0007Uk-1b for netdev@oss.sgi.com; Wed, 26 Jan 2005 08:48:40 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CtnXA-0001pa-6R; Wed, 26 Jan 2005 08:48:36 -0500 Subject: Re: [RFC] batched tc to improve change throughput From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com, Werner Almesberger In-Reply-To: <20050124150634.GT23931@postel.suug.ch> References: <20050117165626.GE26856@postel.suug.ch> <1106002197.1046.19.camel@jzny.localdomain> <20050118134406.GR26856@postel.suug.ch> <1106058592.1035.95.camel@jzny.localdomain> <20050118145830.GS26856@postel.suug.ch> <1106144009.1047.989.camel@jzny.localdomain> <20050119165421.GB26856@postel.suug.ch> <1106232168.1041.125.camel@jzny.localdomain> <20050120153559.GG26856@postel.suug.ch> <1106576005.1652.1292.camel@jzny.localdomain> <20050124150634.GT23931@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1106747313.1107.7.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 26 Jan 2005 08:48:33 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 812 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 2636 Lines: 68 On Mon, 2005-01-24 at 10:06, Thomas Graf wrote: > I'm not talking of the nlmsg_seq but rather a a sequence number with > global or nl_family scope. It gets increased whenever a netlink > message of that family is processed and is returned with the ack. If > a userspace application wants to enforce atomicy between two requests > which cannot be batched because a answer is expected in between then > it could provide the expected sequence number and the request is only > fullfilled if this is true. Example: > > --> RTM_NEWLINK > <-- answer > <-- ACK (seq = 222) > --> RTM_SETLINK (expect = 222) > <-- ACK > > Now if another netlink app interfers: > > --> RTM_NEWLINK > <-- answer > <-- ACK (seq = 222) > > -- other app -- > --> RTM_SETLINK > <-- ACK (seq = 223) > > -- back to first app -- > --> RTM_SETLINK (expect = 222) > <-- ERROR > > The application can then retry it's operation a few times and > finally give up. The main problem I see is to extend nlmsghdr > in a way it stays compatible. The best thing you could get out of this is a warning that something changed under you i.e doesnt really solve the synchronization issue. [And a lot more complexity is introduced - if you say you want to change the netlink header and maintain state in the kernel]. > > My thoughts now are you need to build on top of libnetlink - another > > library. Example, to administratively bring up a netdevice, one would > > call something like > > > > admin_up("eth0"); > > > > This is not to say you cant build a competing library to libnetlink, i > > am just not sure it is worth the effort of having two competing > > libraries doing almost the same thing (that need maintanance). > > I think it is, the feedback is overwhelming and people are already > contributing to support more netlink users. As I said, 95% of the > functionality is in iproute2 itself and not libnetlink. It is vital > to have some kind of library to abstract the low level netlink > functionality in a simple form to other applications. Currently it's > quite hard to for example access the tc class tree, one can use > libnetlink to do the request and parse the answer but everyone needs > to write their own TLV parsing routines. Your call really - you are the one who is going to maintain it;-> As for ease of use and avoiding users from knowing details of how tlvs are put together etc - i think it doesnt matter how thats done underneath the hood; it is still doable on top of current libnetlink. In other words whats required, IMO, is something that hides netlink totaly so that the programmer/user doesnt even get to see TLVs. cheers, jamal From tgraf@suug.ch Wed Jan 26 06:35:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 06:35:39 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QEZXsv017671 for ; Wed, 26 Jan 2005 06:35:34 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 788C7F; Wed, 26 Jan 2005 15:35:05 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 572521C0EA; Wed, 26 Jan 2005 15:35:45 +0100 (CET) Date: Wed, 26 Jan 2005 15:35:45 +0100 From: Thomas Graf To: jamal Cc: Patrick McHardy , Stephen Hemminger , netdev@oss.sgi.com, Werner Almesberger Subject: Re: [RFC] batched tc to improve change throughput Message-ID: <20050126143545.GK31837@postel.suug.ch> References: <20050118134406.GR26856@postel.suug.ch> <1106058592.1035.95.camel@jzny.localdomain> <20050118145830.GS26856@postel.suug.ch> <1106144009.1047.989.camel@jzny.localdomain> <20050119165421.GB26856@postel.suug.ch> <1106232168.1041.125.camel@jzny.localdomain> <20050120153559.GG26856@postel.suug.ch> <1106576005.1652.1292.camel@jzny.localdomain> <20050124150634.GT23931@postel.suug.ch> <1106747313.1107.7.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1106747313.1107.7.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 813 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 3678 Lines: 109 * jamal <1106747313.1107.7.camel@jzny.localdomain> 2005-01-26 08:48 > On Mon, 2005-01-24 at 10:06, Thomas Graf wrote: > > > I'm not talking of the nlmsg_seq but rather a a sequence number with > > global or nl_family scope. It gets increased whenever a netlink > > message of that family is processed and is returned with the ack. If > > a userspace application wants to enforce atomicy between two requests > > which cannot be batched because a answer is expected in between then > > it could provide the expected sequence number and the request is only > > fullfilled if this is true. Example: > > > > --> RTM_NEWLINK > > <-- answer > > <-- ACK (seq = 222) > > --> RTM_SETLINK (expect = 222) > > <-- ACK > > > > Now if another netlink app interfers: > > > > --> RTM_NEWLINK > > <-- answer > > <-- ACK (seq = 222) > > > > -- other app -- > > --> RTM_SETLINK > > <-- ACK (seq = 223) > > > > -- back to first app -- > > --> RTM_SETLINK (expect = 222) > > <-- ERROR > > > > The application can then retry it's operation a few times and > > finally give up. The main problem I see is to extend nlmsghdr > > in a way it stays compatible. > > The best thing you could get out of this is a warning that something > changed under you i.e doesnt really solve the synchronization issue. Why? If we do the check with regard to the rtnl sem we can guarantee atomicity. The comparison of the expected seq and the current seq must be done before any action and within the rtnl semaphore. It is very unlikely that someone interfers so strict locking is pretty inefficient. rtnl_send_atomic(msg, expect_seq) retries := 10; retry: res := send_msg(msg, expect_seq); if res = -ERETRY and --retries then goto retry; endif if retries = 0 then err "Timeout while trying to achieve atomic operation" endif and in the kernel: rtnl_lock(); if expect_seq != seq then rtnl_unlock() return -ERETRY; endif ... atomic action can take place here ... Of course this only works if netlink requests itself are synchronized in the relevant netlink family. > [And a lot more complexity is introduced - if you say you want to change > the netlink header and maintain state in the kernel]. This is the big problem, there is no padding gap common to all rtnl users. What we can do is to set a flag in nlmsghdr stating that a u32 block of data follows the nlmsg header before the netlink user specific header, i.e. +---------------------------------+ | nlmsghdr flags |= NLM_F_EXP_SEQ | +---------------------------------+ | expected_seq (u32) | +---------------------------------+ | netlink user specific data | +---------------------------------+ I'd even go one step further and define a header options chain like in IPv6 so we can add more header attributes later on, like: +--------------------------------+ | nlmsghdr flags |= NLM_F_OPTS | +--------------------------------+ | size=4, type=expt_seq, next=0 | +- - - - - - - - - - - - - - - -+ | expected sequence | +--------------------------------+ | netlink user specific data | +--------------------------------+ Thoughts? > Your call really - you are the one who is going to maintain it;-> > As for ease of use and avoiding users from knowing details of how > tlvs are put together etc - i think it doesnt matter how thats done > underneath the hood; it is still doable on top of current libnetlink. In > other words whats required, IMO, is something that hides netlink totaly > so that the programmer/user doesnt even get to see TLVs. Agreed, I even hide the structs exported to usersapce to avoid breakage, i.e. i don't export tc_stats directly for example. From tgraf@suug.ch Wed Jan 26 07:06:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 07:07:01 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QF6sIW018827 for ; Wed, 26 Jan 2005 07:06:54 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 363A5F; Wed, 26 Jan 2005 16:06:31 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 6F4FD1C0EA; Wed, 26 Jan 2005 16:07:14 +0100 (CET) Date: Wed, 26 Jan 2005 16:07:14 +0100 From: Thomas Graf To: Jamal Hadi Salim , Patrick McHardy Cc: netdev@oss.sgi.com Subject: [RFC] string matching ematch Message-ID: <20050126150714.GL31837@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 814 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 8689 Lines: 284 I'd like to discuss the string matching ematch, I don't care about the algorithm used but rather whether to make it stateful, match over fragments, etc. I attached a simple stateless string matching ematch using the Knuth-Morris-Pratt algorithm as a starting point. KMP ::= pattern [ BEGIN ] [ END ] BEGIN ::= from OFFSET [ layer LAYER ] END ::= to OFFSET [ layer LAYER ] where: default value for BEGIN: skb->h.raw default value for END: skb->tail The prefix table used by the KMP algorithm is calculated in userspace. The layering schema used is the one I introduced in the ematch patchset which is likely to be extended by another layer dynamically calculated from the packet payload. The limitation is pretty obvious, it relies on linear skbs and is not quite limited in matching the payload of a stream based protocol. Making it aware of non-linear skbs isn't that hard, the matcher gets a bit more complicated but shouldn't slow down too much so this is probably worth doing. Making it aware of a state gets much more complicated and if we don't queue packets we can only classify on the packet holding the last part of the pattern. So we need to either tell the underlying qdisc to hold the packet for some time or accept this limitation. The state of the matcher could be stored in the conntrack entry so the match can be resumed when the relevent packet arrives. We're moving more and more towards netfilter and application level filtering and I think this should be covered by netfilter itself. If we do this, we should at least share the code with netfilter. Thoughts? diff -Nru linux-2.6.11-rc2-bk3.orig/include/linux/pkt_cls.h linux-2.6.11-rc2-bk3/include/linux/pkt_cls.h --- linux-2.6.11-rc2-bk3.orig/include/linux/pkt_cls.h 2005-01-26 13:28:25.000000000 +0100 +++ linux-2.6.11-rc2-bk3/include/linux/pkt_cls.h 2005-01-26 14:03:42.000000000 +0100 @@ -401,6 +401,7 @@ TCF_EM_NBYTE, TCF_EM_U32, TCF_EM_META, + TCF_EM_KMP, __TCF_EM_MAX }; diff -Nru linux-2.6.11-rc2-bk3.orig/include/linux/tc_ematch/tc_em_kmp.h linux-2.6.11-rc2-bk3/include/linux/tc_ematch/tc_em_kmp.h --- linux-2.6.11-rc2-bk3.orig/include/linux/tc_ematch/tc_em_kmp.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.11-rc2-bk3/include/linux/tc_ematch/tc_em_kmp.h 2005-01-26 13:42:49.000000000 +0100 @@ -0,0 +1,24 @@ +#ifndef __LINUX_TC_EM_KMP_H +#define __LINUX_TC_EM_KMP_H + +#include + +enum +{ + TCA_EM_KMP_UNSPEC, + TCA_EM_KMP_FROM, /* struct tcf_kmp_offset */ + TCA_EM_KMP_TO, /* struct tcf_kmp_offset */ + TCA_EM_KMP_LENGTH, /* u32 */ + TCA_EM_KMP_PATTERN, /* unsigned char[] */ + TCA_EM_KMP_PREFIX_TBL, /* u32[] */ + __TCA_EM_KMP_MAX +}; +#define TCA_EM_KMP_MAX (__TCA_EM_KMP_MAX - 1) + +struct tcf_kmp_offset +{ + __u16 off; + __u16 layer; +}; + +#endif diff -Nru linux-2.6.11-rc2-bk3.orig/net/sched/Kconfig linux-2.6.11-rc2-bk3/net/sched/Kconfig --- linux-2.6.11-rc2-bk3.orig/net/sched/Kconfig 2005-01-26 13:28:25.000000000 +0100 +++ linux-2.6.11-rc2-bk3/net/sched/Kconfig 2005-01-26 14:19:59.000000000 +0100 @@ -449,6 +449,16 @@ To compile this code as a module, choose M here: the module will be called em_meta. +config NET_EMATCH_KMP + tristate "Knuth-Morris-Pratt string matching" + depends on NET_EMATCH + ---help--- + Say Y here if you want to be able to classify packets by + matching strings using the KMP string matching algorithm. + + To compile this code as a module, choose M here: the + module will be called em_kmp. + config NET_CLS_ACT bool "Packet ACTION" depends on EXPERIMENTAL && NET_CLS && NET_QOS diff -Nru linux-2.6.11-rc2-bk3.orig/net/sched/Makefile linux-2.6.11-rc2-bk3/net/sched/Makefile --- linux-2.6.11-rc2-bk3.orig/net/sched/Makefile 2005-01-26 13:28:25.000000000 +0100 +++ linux-2.6.11-rc2-bk3/net/sched/Makefile 2005-01-26 14:22:54.000000000 +0100 @@ -39,3 +39,4 @@ obj-$(CONFIG_NET_EMATCH_NBYTE) += em_nbyte.o obj-$(CONFIG_NET_EMATCH_U32) += em_u32.o obj-$(CONFIG_NET_EMATCH_META) += em_meta.o +obj-$(CONFIG_NET_EMATCH_KMP) += em_kmp.o diff -Nru linux-2.6.11-rc2-bk3.orig/net/sched/em_kmp.c linux-2.6.11-rc2-bk3/net/sched/em_kmp.c --- linux-2.6.11-rc2-bk3.orig/net/sched/em_kmp.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.11-rc2-bk3/net/sched/em_kmp.c 2005-01-26 14:25:18.000000000 +0100 @@ -0,0 +1,175 @@ +/* + * net/sched/em_kmp.c Knuth-Morris-Pratt string matching + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: Thomas Graf + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct kmp_data +{ + struct tcf_kmp_offset from; + struct tcf_kmp_offset to; + u32 len; + u32 prefix_tbl[0]; +}; + +#define KMP_PATTERN(kmp) \ + ((void*) (kmp) + sizeof(struct kmp_data) + ((kmp)->len * sizeof(u32))) + +static int em_kmp_change(struct tcf_proto *tp, void *data, int data_len, + struct tcf_ematch *em) +{ + int kmp_size, err = -EINVAL; + struct rtattr *tb[TCA_EM_KMP_MAX]; + struct tcf_kmp_offset *koff; + struct kmp_data *kmp; + u32 len; + + if (rtattr_parse(tb, TCA_EM_KMP_MAX, data, data_len) < 0) + goto errout; + + if (tb[TCA_EM_KMP_LENGTH-1] == NULL || + tb[TCA_EM_KMP_PATTERN-1] == NULL || + tb[TCA_EM_KMP_PREFIX_TBL-1] == NULL) + goto errout; + + if (RTA_PAYLOAD(tb[TCA_EM_KMP_LENGTH-1]) < sizeof(len)) + goto errout; + len = *(u32 *) RTA_DATA(tb[TCA_EM_KMP_LENGTH-1]); + + if (RTA_PAYLOAD(tb[TCA_EM_KMP_PATTERN-1]) < len || + RTA_PAYLOAD(tb[TCA_EM_KMP_PREFIX_TBL-1]) < (len * sizeof(u32))) + goto errout; + + if (tb[TCA_EM_KMP_FROM-1]) + if (RTA_PAYLOAD(tb[TCA_EM_KMP_FROM-1]) < sizeof(*koff)) + goto errout; + + if (tb[TCA_EM_KMP_TO-1]) + if (RTA_PAYLOAD(tb[TCA_EM_KMP_TO-1]) < sizeof(*koff)) + goto errout; + + kmp_size = sizeof(*kmp) + (len * sizeof(u32)) + len; + kmp = kmalloc(kmp_size, GFP_KERNEL); + if (kmp == NULL) { + err = -ENOMEM; + goto errout; + } + memset(kmp, 0, kmp_size); + + kmp->len = len; + + if (tb[TCA_EM_KMP_FROM-1]) { + koff = RTA_DATA(tb[TCA_EM_KMP_FROM-1]); + memcpy(&kmp->from, koff, sizeof(*koff)); + } else + kmp->from.layer = TCF_LAYER_TRANSPORT; + + if (tb[TCA_EM_KMP_TO-1]) { + koff = RTA_DATA(tb[TCA_EM_KMP_TO-1]); + memcpy(&kmp->to, koff, sizeof(*koff)); + } + + memcpy(kmp->prefix_tbl, RTA_DATA(tb[TCA_EM_KMP_PREFIX_TBL-1]), + len * sizeof(u32)); + + memcpy(KMP_PATTERN(kmp), RTA_DATA(tb[TCA_EM_KMP_PATTERN-1]), len); + + em->datalen = kmp_size; + em->data = (unsigned long) kmp; + + err = 0; +errout: + return err; +} + +static int em_kmp_match(struct sk_buff *skb, struct tcf_ematch *em, + struct tcf_pkt_info *info) +{ + struct kmp_data *kmp = (struct kmp_data *) em->data; + unsigned char *begin, *end; + unsigned char *pattern = KMP_PATTERN(kmp); + int q; + + begin = tcf_get_base_ptr(skb, kmp->from.layer); + begin += kmp->from.off; + + if (kmp->to.off || kmp->to.layer) { + end = tcf_get_base_ptr(skb, kmp->to.layer); + end += kmp->to.off; + } else + end = skb->tail; + + if (!tcf_valid_offset(skb, begin, kmp->len) || + !tcf_valid_offset(skb, end, 0) || + (end - kmp->len) < begin) + return 0; + + for (q = 0; begin < end; begin++) { + while (q > 0 && pattern[q] != *begin) + q = kmp->prefix_tbl[q - 1]; + if (pattern[q] == *begin) + q++; + if (q == kmp->len) + return 1; + } + + return 0; +} + +static int em_kmp_dump(struct sk_buff *skb, struct tcf_ematch *em) +{ + struct kmp_data *kmp = (struct kmp_data *) em->data; + + RTA_PUT(skb, TCA_EM_KMP_FROM, sizeof(kmp->from), &kmp->from); + + if (kmp->to.off || kmp->to.layer) + RTA_PUT(skb, TCA_EM_KMP_TO, sizeof(kmp->to), &kmp->to); + + RTA_PUT(skb, TCA_EM_KMP_LENGTH, sizeof(kmp->len), &kmp->len); + RTA_PUT(skb, TCA_EM_KMP_PATTERN, kmp->len, KMP_PATTERN(kmp)); + RTA_PUT(skb, TCA_EM_KMP_PREFIX_TBL, kmp->len * sizeof(u32), + kmp->prefix_tbl); + + return 0; +rtattr_failure: + return -1; +} + +static struct tcf_ematch_ops em_kmp_ops = { + .kind = TCF_EM_KMP, + .change = em_kmp_change, + .match = em_kmp_match, + .dump = em_kmp_dump, + .owner = THIS_MODULE, + .link = LIST_HEAD_INIT(em_kmp_ops.link) +}; + +static int __init init_em_kmp(void) +{ + return tcf_em_register(&em_kmp_ops); +} + +static void __exit exit_em_kmp(void) +{ + tcf_em_unregister(&em_kmp_ops); +} + +MODULE_LICENSE("GPL"); + +module_init(init_em_kmp); +module_exit(exit_em_kmp); From Robert.Olsson@data.slu.se Wed Jan 26 07:20:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 07:20:50 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QFKjk7019507 for ; Wed, 26 Jan 2005 07:20:46 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0QFKgCF019037; Wed, 26 Jan 2005 16:20:43 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id DE9C2EE1D2; Wed, 26 Jan 2005 16:20:42 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16887.46410.873506.298630@robur.slu.se> Date: Wed, 26 Jan 2005 16:20:42 +0100 To: "David S. Miller" Cc: netdev@oss.sgi.com, Robert.Olsson@data.slu.se Subject: [PATCH] gc_min_interval in milleseconds via /proc X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 815 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Content-Length: 626 Lines: 27 Hello! The second resolution is very inconvenient. Milleseconds would be nicer. cat /proc/sys/net/ipv4/route/gc_min_interval 500 --- net/ipv4/route.c.orig 2005-01-25 13:58:29.210846472 +0100 +++ net/ipv4/route.c 2005-01-25 14:25:52.116086912 +0100 @@ -2532,9 +2532,9 @@ .ctl_name = NET_IPV4_ROUTE_GC_MIN_INTERVAL, .procname = "gc_min_interval", .data = &ip_rt_gc_min_interval, - .maxlen = sizeof(int), + .maxlen = sizeof(unsigned long), .mode = 0644, - .proc_handler = &proc_dointvec_jiffies, + .proc_handler = &proc_doulongvec_ms_jiffies_minmax, .strategy = &sysctl_jiffies, }, --ro From chas@cmf.nrl.navy.mil Wed Jan 26 08:57:59 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 08:58:04 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QGvxPP026119 for ; Wed, 26 Jan 2005 08:57:59 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.11/8.12.11) with ESMTP id j0QGvqll018872; Wed, 26 Jan 2005 11:57:52 -0500 (EST) Message-Id: <200501261657.j0QGvqll018872@ginger.cmf.nrl.navy.mil> To: netdev@oss.sgi.com Cc: davem@redhat.com Subject: [PATCH 4 of 5][ATM]: get accounting right when we remove skb Date: Wed, 26 Jan 2005 11:57:53 -0500 From: "chas williams - CONTRACTOR" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-Virus-Status: Clean X-archive-position: 819 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 939 Lines: 29 please apply to 2.6 thanks! # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/24 13:25:27-05:00 chas@relax.cmf.nrl.navy.mil # [ATM]: get accounting right when we remove skb # # Signed-off-by: Chas Williams # # net/atm/svc.c # 2005/01/24 13:25:10-05:00 chas@relax.cmf.nrl.navy.mil +1 -0 # [ATM]: get accounting right when we remove skb # # Signed-off-by: Chas Williams # diff -Nru a/net/atm/svc.c b/net/atm/svc.c --- a/net/atm/svc.c 2005-01-25 09:36:57 -05:00 +++ b/net/atm/svc.c 2005-01-25 09:36:57 -05:00 @@ -67,6 +67,7 @@ /* beware - socket is still in use by atmsigd until the last as_indicate has been answered */ while ((skb = skb_dequeue(&vcc->sk->sk_receive_queue)) != NULL) { + atm_return(vcc, skb->truesize); DPRINTK("LISTEN REL\n"); sigd_enq2(NULL,as_reject,vcc,NULL,NULL,&vcc->qos,0); dev_kfree_skb(skb); From chas@cmf.nrl.navy.mil Wed Jan 26 08:58:17 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 08:58:25 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QGwGC8026434 for ; Wed, 26 Jan 2005 08:58:17 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.11/8.12.11) with ESMTP id j0QGwAaO018882; Wed, 26 Jan 2005 11:58:10 -0500 (EST) Message-Id: <200501261658.j0QGwAaO018882@ginger.cmf.nrl.navy.mil> To: netdev@oss.sgi.com Cc: davem@redhat.com Subject: [PATCH 5 of 5][ATM]: replace schedule_timeout() with msleep() Date: Wed, 26 Jan 2005 11:58:11 -0500 From: "chas williams - CONTRACTOR" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-Virus-Status: Clean X-archive-position: 820 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 1418 Lines: 41 please apply to 2.6 thanks! # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/24 13:38:44-05:00 chas@relax.cmf.nrl.navy.mil # [ATM]: replace schedule_timeout() with msleep() # # Signed-off-by: Nishanth Aravamudan # Signed-off-by: Chas Williams # # net/atm/resources.c # 2005/01/24 13:38:27-05:00 chas@relax.cmf.nrl.navy.mil +2 -2 # [ATM]: replace schedule_timeout() with msleep() # # Signed-off-by: Nishanth Aravamudan # Signed-off-by: Chas Williams # diff -Nru a/net/atm/resources.c b/net/atm/resources.c --- a/net/atm/resources.c 2005-01-25 09:37:57 -05:00 +++ b/net/atm/resources.c 2005-01-25 09:37:57 -05:00 @@ -16,6 +16,7 @@ #include /* for barrier */ #include #include +#include #include /* for struct sock */ #include "common.h" @@ -139,8 +140,7 @@ warning_time = jiffies; while (atomic_read(&dev->refcnt) != 1) { - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(HZ / 4); + msleep(250); if ((jiffies - warning_time) > 10 * HZ) { printk(KERN_EMERG "atm_dev_deregister: waiting for " "dev %d to become free. Usage count = %d\n", From chas@cmf.nrl.navy.mil Wed Jan 26 08:57:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 08:57:41 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QGvYiT025859 for ; Wed, 26 Jan 2005 08:57:34 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.11/8.12.11) with ESMTP id j0QGvSuw018864; Wed, 26 Jan 2005 11:57:28 -0500 (EST) Message-Id: <200501261657.j0QGvSuw018864@ginger.cmf.nrl.navy.mil> To: netdev@oss.sgi.com Cc: davem@redhat.com Subject: [PATCH 3 of 5][ATM]: [nicstar] small cleanup for some globals Date: Wed, 26 Jan 2005 11:57:29 -0500 From: "chas williams - CONTRACTOR" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-Virus-Status: Clean X-archive-position: 818 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 2548 Lines: 89 please apply to 2.6 thanks! # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/25 09:29:05-05:00 chas@relax.cmf.nrl.navy.mil # [ATM]: [nicstar] small cleanup for some globals # # Signed-off-by: Adrian Bunk # Signed-off-by: Chas Williams # # drivers/atm/nicstarmac.c # 2005/01/25 09:28:46-05:00 chas@relax.cmf.nrl.navy.mil +4 -2 # [ATM]: [nicstar] small cleanup for some globals # # Signed-off-by: Adrian Bunk # Signed-off-by: Chas Williams # # drivers/atm/nicstar.c # 2005/01/25 09:28:46-05:00 chas@relax.cmf.nrl.navy.mil +0 -1 # [ATM]: [nicstar] small cleanup for some globals # # Signed-off-by: Adrian Bunk # Signed-off-by: Chas Williams # # BitKeeper/deleted/.del-nicstarmac.h~194ffda535e62654 # 2005/01/25 09:27:38-05:00 chas@relax.cmf.nrl.navy.mil +0 -0 # Delete: drivers/atm/nicstarmac.h # diff -Nru a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c --- a/drivers/atm/nicstar.c 2005-01-25 09:38:21 -05:00 +++ b/drivers/atm/nicstar.c 2005-01-25 09:38:21 -05:00 @@ -54,7 +54,6 @@ #include #include #include "nicstar.h" -#include "nicstarmac.h" #ifdef CONFIG_ATM_NICSTAR_USE_SUNI #include "suni.h" #endif /* CONFIG_ATM_NICSTAR_USE_SUNI */ diff -Nru a/drivers/atm/nicstarmac.c b/drivers/atm/nicstarmac.c --- a/drivers/atm/nicstarmac.c 2005-01-25 09:38:21 -05:00 +++ b/drivers/atm/nicstarmac.c 2005-01-25 09:38:21 -05:00 @@ -7,6 +7,8 @@ * Read this ForeRunner's MAC address from eprom/eeprom */ +typedef void __iomem *virt_addr_t; + #define CYCLE_DELAY 5 /* This was the original definition @@ -213,7 +215,7 @@ } -void +static void nicstar_init_eprom( virt_addr_t base ) { u_int32_t val; @@ -246,7 +248,7 @@ * above. */ -void +static void nicstar_read_eprom( virt_addr_t base, u_int8_t prom_offset, diff -Nru a/drivers/atm/nicstarmac.h b/drivers/atm/nicstarmac.h --- a/drivers/atm/nicstarmac.h 2005-01-25 09:38:21 -05:00 +++ /dev/null Wed Dec 31 16:00:00 196900 @@ -1,13 +0,0 @@ -/****************************************************************************** - * - * nicstarmac.h - * - * Header file for nicstarmac.c - * - ******************************************************************************/ - - -typedef void __iomem *virt_addr_t; - -void nicstar_init_eprom( virt_addr_t base ); -void nicstar_read_eprom( virt_addr_t, u_int8_t, u_int8_t *, u_int32_t); From chas@cmf.nrl.navy.mil Wed Jan 26 08:56:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 08:57:00 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QGur6A025599 for ; Wed, 26 Jan 2005 08:56:54 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.11/8.12.11) with ESMTP id j0QGujlu018849; Wed, 26 Jan 2005 11:56:45 -0500 (EST) Message-Id: <200501261656.j0QGujlu018849@ginger.cmf.nrl.navy.mil> To: netdev@oss.sgi.com Cc: davem@redhat.com Subject: [PATCH 1 of 5][ATM]: [fore200e] can't sleep in transmit routine Date: Wed, 26 Jan 2005 11:56:46 -0500 From: "chas williams - CONTRACTOR" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-Virus-Status: Clean X-archive-position: 816 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 800 Lines: 30 please apply to 2.6 thanks! # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/24 13:21:28-05:00 chas@relax.cmf.nrl.navy.mil # [ATM]: [fore200e] can't sleep in transmit routine # # Signed-off-by: Chas Williams # # drivers/atm/fore200e.c # 2005/01/24 13:21:10-05:00 chas@relax.cmf.nrl.navy.mil +1 -1 # [ATM]: [fore200e] can't sleep in transmit routine # # Signed-off-by: Chas Williams # diff -Nru a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c --- a/drivers/atm/fore200e.c 2005-01-25 09:36:27 -05:00 +++ b/drivers/atm/fore200e.c 2005-01-25 09:36:27 -05:00 @@ -1779,7 +1779,7 @@ /* retry once again? */ if (--retry > 0) { - schedule(); + udelay(50); goto retry_here; } From chas@cmf.nrl.navy.mil Wed Jan 26 08:57:17 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 08:57:22 -0800 (PST) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QGvHTQ025691 for ; Wed, 26 Jan 2005 08:57:17 -0800 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.11/8.12.11) with ESMTP id j0QGv9tT018855; Wed, 26 Jan 2005 11:57:09 -0500 (EST) Message-Id: <200501261657.j0QGv9tT018855@ginger.cmf.nrl.navy.mil> To: netdev@oss.sgi.com Cc: davem@redhat.com Subject: [PATCH 2 of 5][ATM]: [he] reorder add_wait_queue() and set_current_state() Date: Wed, 26 Jan 2005 11:57:10 -0500 From: "chas williams - CONTRACTOR" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-Virus-Status: Clean X-archive-position: 817 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 1348 Lines: 43 please apply to 2.6 thanks! # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/24 13:27:20-05:00 chas@relax.cmf.nrl.navy.mil # [ATM]: [he] reorder add_wait_queue() and set_current_state() # # Signed-off-by: Nishanth Aravamudan # Signed-off-by: Chas Williams # # drivers/atm/he.c # 2005/01/24 13:27:02-05:00 chas@relax.cmf.nrl.navy.mil +2 -2 # [ATM]: [he] reorder add_wait_queue() and set_current_state() # # Signed-off-by: Nishanth Aravamudan # Signed-off-by: Chas Williams # diff -Nru a/drivers/atm/he.c b/drivers/atm/he.c --- a/drivers/atm/he.c 2005-01-25 09:37:30 -05:00 +++ b/drivers/atm/he.c 2005-01-25 09:37:30 -05:00 @@ -2575,8 +2575,8 @@ udelay(250); } - add_wait_queue(&he_vcc->rx_waitq, &wait); set_current_state(TASK_UNINTERRUPTIBLE); + add_wait_queue(&he_vcc->rx_waitq, &wait); he_writel_rsr0(he_dev, RSR0_CLOSE_CONN, cid); (void) he_readl_rsr0(he_dev, cid); /* flush posted writes */ @@ -2650,8 +2650,8 @@ tpd->vcc = vcc; wmb(); - add_wait_queue(&he_vcc->tx_waitq, &wait); set_current_state(TASK_UNINTERRUPTIBLE); + add_wait_queue(&he_vcc->tx_waitq, &wait); __enqueue_tpd(he_dev, tpd, cid); spin_unlock_irqrestore(&he_dev->global_lock, flags); From mchan@broadcom.com Wed Jan 26 10:02:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 10:02:25 -0800 (PST) Received: from mms3.broadcom.com (mms-nat.broadcom.com [63.70.210.58]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QI2JuM030300 for ; Wed, 26 Jan 2005 10:02:20 -0800 Received: from 63.70.210.1 by mms3.broadcom.com with SMTP (Broadcom SMTP Relay (MMS v5.6.0)); Wed, 26 Jan 2005 10:01:58 -0800 X-Server-Uuid: 062D48FB-9769-4139-967C-478C67B5F9C9 Received: from mail-irva-8.broadcom.com ([10.10.64.221]) by mail-irva-1.broadcom.com (Post.Office MTA v3.5.3 release 223 ID# 0-72233U7200L2200S0V35) with ESMTP id com; Wed, 26 Jan 2005 10:01:54 -0800 Received: from mon-irva-10.broadcom.com (mon-irva-10.broadcom.com [10.10.64.171]) by mail-irva-8.broadcom.com (MOS 3.5.6-GR) with ESMTP id AIH31860; Wed, 26 Jan 2005 10:01:52 -0800 (PST) Received: from nt-irva-0741.brcm.ad.broadcom.com ( nt-irva-0741.brcm.ad.broadcom.com [10.8.194.54]) by mon-irva-10.broadcom.com (8.9.1/8.9.1) with ESMTP id KAA08058; Wed, 26 Jan 2005 10:01:51 -0800 (PST) X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Subject: [PATCH 2.6.10] tg3: 5750 fixes Date: Wed, 26 Jan 2005 10:01:42 -0800 Message-ID: X-MS-Has-Attach: yes Thread-Topic: [PATCH 2.6.10] tg3: 5750 fixes Thread-Index: AcT/RNYoqhl8O7sZQByxO+YWIkWbhgAAiLIAAMWgbjAAXHbEkA== From: "Michael Chan" To: "David S. Miller" cc: netdev@oss.sgi.com X-WSS-ID: 6DE9049C1W41904375-01-01 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C503D1.17A18391" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 821 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mchan@broadcom.com Precedence: bulk X-list: netdev Content-Length: 2816 Lines: 55 This is a multi-part message in MIME format. ------_=_NextPart_001_01C503D1.17A18391 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Some misc. fixes for 5750. The first 2 fixes below are for correctness. - Do not set extended MAC addresses for 5750 - Do not set NIC ring addresses in send ring and receive return ring = RCBs for 5750 - Check eeprom write protect bit for 5750 Signed-off-by: Michael Chan ------_=_NextPart_001_01C503D1.17A18391 Content-Type: application/octet-stream; name=tg3_5750.patch Content-Transfer-Encoding: base64 Content-Description: tg3_5750.patch Content-Disposition: attachment; filename=tg3_5750.patch ZGlmZiAtTnJ1IDMvdGczLmMgNC90ZzMuYwotLS0gMy90ZzMuYwkyMDA1LTAxLTIzIDEzOjM3OjE2 LjAwMDAwMDAwMCAtMDgwMAorKysgNC90ZzMuYwkyMDA1LTAxLTI1IDA5OjE2OjM0LjAwMDAwMDAw MCAtMDgwMApAQCAtNDg1OCw5ICs0ODU4LDggQEAKIAkJdHczMihNQUNfQUREUl8wX0xPVyArIChp ICogOCksIGFkZHJfbG93KTsKIAl9CiAKLQlpZiAoR0VUX0FTSUNfUkVWKHRwLT5wY2lfY2hpcF9y ZXZfaWQpICE9IEFTSUNfUkVWXzU3MDAgJiYKLQkgICAgR0VUX0FTSUNfUkVWKHRwLT5wY2lfY2hp cF9yZXZfaWQpICE9IEFTSUNfUkVWXzU3MDEgJiYKLQkgICAgR0VUX0FTSUNfUkVWKHRwLT5wY2lf Y2hpcF9yZXZfaWQpICE9IEFTSUNfUkVWXzU3MDUpIHsKKwlpZiAoR0VUX0FTSUNfUkVWKHRwLT5w Y2lfY2hpcF9yZXZfaWQpID09IEFTSUNfUkVWXzU3MDMgfHwKKwkgICAgR0VUX0FTSUNfUkVWKHRw LT5wY2lfY2hpcF9yZXZfaWQpID09IEFTSUNfUkVWXzU3MDQpIHsKIAkJZm9yIChpID0gMDsgaSA8 IDEyOyBpKyspIHsKIAkJCXR3MzIoTUFDX0VYVEFERFJfMF9ISUdIICsgKGkgKiA4KSwgYWRkcl9o aWdoKTsKIAkJCXR3MzIoTUFDX0VYVEFERFJfMF9MT1cgKyAoaSAqIDgpLCBhZGRyX2xvdyk7CkBA IC00OTA2LDcgKzQ5MDUsOCBAQAogCQkgICAgICAoYmRpbmZvX2FkZHIgKyBURzNfQkRJTkZPX01B WExFTl9GTEFHUyksCiAJCSAgICAgICBtYXhsZW5fZmxhZ3MpOwogCi0JaWYgKEdFVF9BU0lDX1JF Vih0cC0+cGNpX2NoaXBfcmV2X2lkKSAhPSBBU0lDX1JFVl81NzA1KQorCWlmICgoR0VUX0FTSUNf UkVWKHRwLT5wY2lfY2hpcF9yZXZfaWQpICE9IEFTSUNfUkVWXzU3MDUpICYmCisJICAgIChHRVRf QVNJQ19SRVYodHAtPnBjaV9jaGlwX3Jldl9pZCkgIT0gQVNJQ19SRVZfNTc1MCkpCiAJCXRnM193 cml0ZV9tZW0odHAsCiAJCQkgICAgICAoYmRpbmZvX2FkZHIgKyBURzNfQkRJTkZPX05JQ19BRERS KSwKIAkJCSAgICAgIG5pY19hZGRyKTsKQEAgLTc1NjksOSArNzU2OSw4IEBACiAJCSAgICB0cC0+ cGRldi0+c3Vic3lzdGVtX3ZlbmRvciA9PSBQQ0lfVkVORE9SX0lEX0RFTEwpCiAJCQl0cC0+bGVk X2N0cmwgPSBMRURfQ1RSTF9NT0RFX1BIWV8yOwogCi0JCWlmICgoKEdFVF9BU0lDX1JFVih0cC0+ cGNpX2NoaXBfcmV2X2lkKSA9PSBBU0lDX1JFVl81NzAzKSB8fAotCQkgICAgIChHRVRfQVNJQ19S RVYodHAtPnBjaV9jaGlwX3Jldl9pZCkgPT0gQVNJQ19SRVZfNTcwNCkgfHwKLQkJICAgICAoR0VU X0FTSUNfUkVWKHRwLT5wY2lfY2hpcF9yZXZfaWQpID09IEFTSUNfUkVWXzU3MDUpKSAmJgorCQlp ZiAoKEdFVF9BU0lDX1JFVih0cC0+cGNpX2NoaXBfcmV2X2lkKSAhPSBBU0lDX1JFVl81NzAwKSAm JgorCQkgICAgKEdFVF9BU0lDX1JFVih0cC0+cGNpX2NoaXBfcmV2X2lkKSAhPSBBU0lDX1JFVl81 NzAxKSAmJgogCQkgICAgKG5pY19jZmcgJiBOSUNfU1JBTV9EQVRBX0NGR19FRVBST01fV1ApKQog CQkJdHAtPnRnM19mbGFncyB8PSBURzNfRkxBR19FRVBST01fV1JJVEVfUFJPVDsKIAo= ------_=_NextPart_001_01C503D1.17A18391-- From dcbw@redhat.com Wed Jan 26 10:05:34 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 10:05:39 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QI5Xe9030846 for ; Wed, 26 Jan 2005 10:05:34 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j0QI3VJV009244; Wed, 26 Jan 2005 13:03:31 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j0QI3VO30486; Wed, 26 Jan 2005 13:03:31 -0500 Received: from devserv.devel.redhat.com (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.11/8.12.10) with ESMTP id j0QI3VCd013520; Wed, 26 Jan 2005 13:03:31 -0500 Received: from localhost (dcbw@localhost) by devserv.devel.redhat.com (8.12.11/8.12.11/Submit) with ESMTP id j0QI3Vq0013516; Wed, 26 Jan 2005 13:03:31 -0500 Date: Wed, 26 Jan 2005 13:03:31 -0500 (EST) From: Dan Williams To: Michael Renzmann cc: Dan Williams , Jean Tourrilhes , netdev@oss.sgi.com Subject: Re: Where Linux 802.11x support needs work In-Reply-To: <41F743F6.2020008@web.de> Message-ID: References: <20050126024039.GA25326@bougret.hpl.hp.com> <41F743F6.2020008@web.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 822 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dcbw@redhat.com Precedence: bulk X-list: netdev Content-Length: 2712 Lines: 55 On Wed, 26 Jan 2005, Michael Renzmann wrote: > > Dan Williams wrote: > > madwifi: doesn't seem to implement SIOCGIWSTATS > > It does. The SIOCGIWSTATS is used in tools/athstats.c (line 195 in > current CVS) for example to get the rssi (via qual.qual). Except then there's no handler for it in the ath_handlers[] array: /Users/dan/Desktop/madwifi> grep -r "SIOCGIWSTATS" * ath/if_ath.c: (iw_handler) NULL /* kernel code */, /* SIOCGIWSTATS */ tools/athstats.c: if (ioctl(s, SIOCGIWSTATS, &wrq) < 0) That makes it essentially useless for using with the Linux Wireless Extensions API (unless the ioctl() somehow redirets calls to SIOCGIWSTATS to the dev->get_wireless_stats function?). In any case, it should be as simple as adding the ath_iw_getstats() function to that line in ath/if_ath.c in the ath_handlers[] array. So I guess no fundamental problems there, should be a 20 second fix. > >>>o Ad-Hoc mode support is quite flaky or absent from most drivers > >> Low priority for most vendors, firwmares are only lightly tested. > > Yeah, I don't expect much to happen here but it would be nice. FWIW, at > > least madwifi and atmel seem to work OK here. > > Madwifi unfortunately has some known problems in Ad-hoc implementation. > Someone worked on that, but the patches have not been sent in as far as > I can tell. It actually seems to perform fairly well already. The only problems I noticed were that whne you set the card into Ad-hoc mode and set the ESSID on the card, it dropts to a bitrate of 0 and performance is terrible. When you explicitly set a bitrate of 11Mbps or some other value on the card the it works fine. I think the card just gets a bit confused as to what bitrate to use when doing Ad-hoc mode. > >> Note that various other people have their own todo list. Jeff > >>also has things he has in minds. I have (few) patches on my web > >>pages. Driver authors also have their wishes. > > True, but I'm not sure how many of those wishes/todo lists are actually > > well-known or public. I don't really see any great momentum in the Linux > > 802.11x world, but more a hodge-podge of improvements. I was hoping that > > the post today could help direct a bit more attention and effort at Linux > > 802.11x stuff so we could try to clean it up and improve it. > > How about setting up a project that cares of finding, defining and > implementing such quasi-standards in the Linux 802.11 world? Most things > are very WLAN specific, so I think netdev isn't the best place to > discuss them. Of course this only works IMO when many (if not all) of > the wlan driver authors join in and help out. This would probably be a very good thing :) Dan From tgraf@suug.ch Wed Jan 26 12:05:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 12:05:23 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QK5DIS002635 for ; Wed, 26 Jan 2005 12:05:14 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 6EF75F; Wed, 26 Jan 2005 21:04:50 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 818101C0EA; Wed, 26 Jan 2005 21:05:32 +0100 (CET) Date: Wed, 26 Jan 2005 21:05:32 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [RESEND 5/6]: PKT_SCHED: Metadata ematch (meta) Message-ID: <20050126200532.GO31837@postel.suug.ch> References: <20050123230012.GB23931@postel.suug.ch> <20050123230443.GG23931@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050123230443.GG23931@postel.suug.ch> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 823 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 22027 Lines: 792 RESEND: I gave up on trying to dump the meta configuration without TLVs, it gets too complicated and error prone. Added dumping via TLVs. The meta ematch allows comparing various metadata values against static values from usersapce or other metadata values. It currently supports various numeric meta values such as netfilter mark, packet length, security level, interface indices, tc classid, load average, a random value but also variable length values such as interface names. Adding support for additional meta values is as easy as writing a data collector (usually 1-5 lines of code) and assign it to a id and type by putting it into the meta operations table. Signed-off-by: Thomas Graf diff -Nru linux-2.6.11-rc2-bk4.orig/include/linux/pkt_cls.h linux-2.6.11-rc2-bk4/include/linux/pkt_cls.h --- linux-2.6.11-rc2-bk4.orig/include/linux/pkt_cls.h 2005-01-26 18:52:30.000000000 +0100 +++ linux-2.6.11-rc2-bk4/include/linux/pkt_cls.h 2005-01-26 18:52:40.000000000 +0100 @@ -386,6 +386,7 @@ TCF_EM_CMP, TCF_EM_NBYTE, TCF_EM_U32, + TCF_EM_META, __TCF_EM_MAX }; diff -Nru linux-2.6.11-rc2-bk4.orig/include/linux/tc_ematch/tc_em_meta.h linux-2.6.11-rc2-bk4/include/linux/tc_ematch/tc_em_meta.h --- linux-2.6.11-rc2-bk4.orig/include/linux/tc_ematch/tc_em_meta.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.11-rc2-bk4/include/linux/tc_ematch/tc_em_meta.h 2005-01-26 18:21:12.000000000 +0100 @@ -0,0 +1,69 @@ +#ifndef __LINUX_TC_EM_META_H +#define __LINUX_TC_EM_META_H + +#include + +enum +{ + TCA_EM_META_UNSPEC, + TCA_EM_META_HDR, + TCA_EM_META_LVALUE, + TCA_EM_META_RVALUE, + __TCA_EM_META_MAX +}; +#define TCA_EM_META_MAX (__TCA_EM_META_MAX - 1) + +struct tcf_meta_val +{ + __u16 kind; + __u8 shift; + __u8 op; +}; + +#define TCF_META_TYPE_MASK (0xf << 12) +#define TCF_META_TYPE(kind) (((kind) & TCF_META_TYPE_MASK) >> 12) +#define TCF_META_ID_MASK 0x7ff +#define TCF_META_ID(kind) ((kind) & TCF_META_ID_MASK) + +enum +{ + TCF_META_TYPE_VAR, + TCF_META_TYPE_INT, + __TCF_META_TYPE_MAX +}; +#define TCF_META_TYPE_MAX (__TCF_META_TYPE_MAX - 1) + +enum +{ + TCF_META_ID_VALUE, + TCF_META_ID_RANDOM, + TCF_META_ID_LOADAVG_0, + TCF_META_ID_LOADAVG_1, + TCF_META_ID_LOADAVG_2, + TCF_META_ID_DEV, + TCF_META_ID_INDEV, + TCF_META_ID_REALDEV, + TCF_META_ID_PRIORITY, + TCF_META_ID_PROTOCOL, + TCF_META_ID_SECURITY, + TCF_META_ID_PKTTYPE, + TCF_META_ID_PKTLEN, + TCF_META_ID_DATALEN, + TCF_META_ID_MACLEN, + TCF_META_ID_NFMARK, + TCF_META_ID_TCINDEX, + TCF_META_ID_TCVERDICT, + TCF_META_ID_TCCLASSID, + TCF_META_ID_RTCLASSID, + TCF_META_ID_RTIIF, + __TCF_META_ID_MAX +}; +#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1) + +struct tcf_meta_hdr +{ + struct tcf_meta_val left; + struct tcf_meta_val right; +}; + +#endif diff -Nru linux-2.6.11-rc2-bk4.orig/net/sched/Kconfig linux-2.6.11-rc2-bk4/net/sched/Kconfig --- linux-2.6.11-rc2-bk4.orig/net/sched/Kconfig 2005-01-26 18:52:30.000000000 +0100 +++ linux-2.6.11-rc2-bk4/net/sched/Kconfig 2005-01-26 18:52:40.000000000 +0100 @@ -428,6 +428,17 @@ To compile this code as a module, choose M here: the module will be called em_u32. +config NET_EMATCH_META + tristate "Metadata" + depends on NET_EMATCH + ---help--- + Say Y here if you want to be ablt to classify packets based on + metadata such as load average, netfilter attributes, socket + attributes and routing decisions. + + To compile this code as a module, choose M here: the + module will be called em_meta. + config NET_CLS_ACT bool "Packet ACTION" depends on EXPERIMENTAL && NET_CLS && NET_QOS diff -Nru linux-2.6.11-rc2-bk4.orig/net/sched/Makefile linux-2.6.11-rc2-bk4/net/sched/Makefile --- linux-2.6.11-rc2-bk4.orig/net/sched/Makefile 2005-01-26 18:52:30.000000000 +0100 +++ linux-2.6.11-rc2-bk4/net/sched/Makefile 2005-01-26 18:52:40.000000000 +0100 @@ -37,3 +37,4 @@ obj-$(CONFIG_NET_EMATCH_CMP) += em_cmp.o obj-$(CONFIG_NET_EMATCH_NBYTE) += em_nbyte.o obj-$(CONFIG_NET_EMATCH_U32) += em_u32.o +obj-$(CONFIG_NET_EMATCH_META) += em_meta.o diff -Nru linux-2.6.11-rc2-bk4.orig/net/sched/em_meta.c linux-2.6.11-rc2-bk4/net/sched/em_meta.c --- linux-2.6.11-rc2-bk4.orig/net/sched/em_meta.c 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.11-rc2-bk4/net/sched/em_meta.c 2005-01-26 20:20:06.000000000 +0100 @@ -0,0 +1,661 @@ +/* + * net/sched/em_meta.c Metadata ematch + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: Thomas Graf + * + * ========================================================================== + * + * The metadata ematch compares two meta objects where each object + * represents either a meta value stored in the kernel or a static + * value provided by userspace. The objects are not provided by + * userspace itself but rather a definition providing the information + * to build them. Every object is of a certain type which must be + * equal to the object it is being compared to. + * + * The definition of a objects conists of the type (meta type), a + * identifier (meta id) and additional type specific information. + * The meta id is either TCF_META_TYPE_VALUE for values provided by + * userspace or a index to the meta operations table consisting of + * function pointers to type specific meta data collectors returning + * the value of the requested meta value. + * + * lvalue rvalue + * +-----------+ +-----------+ + * | type: INT | | type: INT | + * def | id: INDEV | | id: VALUE | + * | data: | | data: 3 | + * +-----------+ +-----------+ + * | | + * ---> meta_ops[INT][INDEV](...) | + * | | + * ----------- | + * V V + * +-----------+ +-----------+ + * | type: INT | | type: INT | + * obj | id: INDEV | | id: VALUE | + * | data: 2 |<--data got filled out | data: 3 | + * +-----------+ +-----------+ + * | | + * --------------> 2 equals 3 <-------------- + * + * This is a simplified schema, the complexity varies depending + * on the meta type. Obviously, the length of the data must also + * be provided for non-numeric types. + * + * Additionaly, type dependant modifiers such as shift operators + * or mask may be applied to extend the functionaliy. As of now, + * the variable length type supports shifting the byte string to + * the right, eating up any number of octets and thus supporting + * wildcard interface name comparisons such as "ppp%" matching + * ppp0..9. + * + * NOTE: Certain meta values depend on other subsystems and are + * only available if that subsytem is enabled in the kernel. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct meta_obj +{ + unsigned long value; + unsigned int len; +}; + +struct meta_value +{ + struct tcf_meta_val hdr; + unsigned long val; + unsigned int len; +}; + +struct meta_match +{ + struct meta_value lvalue; + struct meta_value rvalue; +}; + +static inline int meta_id(struct meta_value *v) +{ + return TCF_META_ID(v->hdr.kind); +} + +static inline int meta_type(struct meta_value *v) +{ + return TCF_META_TYPE(v->hdr.kind); +} + +#define META_COLLECTOR(FUNC) static void meta_##FUNC(struct sk_buff *skb, \ + struct tcf_pkt_info *info, struct meta_value *v, \ + struct meta_obj *dst, int *err) + +/************************************************************************** + * System status & misc + **************************************************************************/ + +META_COLLECTOR(int_random) +{ + get_random_bytes(&dst->value, sizeof(dst->value)); +} + +static inline unsigned long fixed_loadavg(int load) +{ + int rnd_load = load + (FIXED_1/200); + int rnd_frac = ((rnd_load & (FIXED_1-1)) * 100) >> FSHIFT; + + return ((rnd_load >> FSHIFT) * 100) + rnd_frac; +} + +META_COLLECTOR(int_loadavg_0) +{ + dst->value = fixed_loadavg(avenrun[0]); +} + +META_COLLECTOR(int_loadavg_1) +{ + dst->value = fixed_loadavg(avenrun[1]); +} + +META_COLLECTOR(int_loadavg_2) +{ + dst->value = fixed_loadavg(avenrun[2]); +} + +/************************************************************************** + * Device names & indices + **************************************************************************/ + +static inline int int_dev(struct net_device *dev, struct meta_obj *dst) +{ + if (unlikely(dev == NULL)) + return -1; + + dst->value = dev->ifindex; + return 0; +} + +static inline int var_dev(struct net_device *dev, struct meta_obj *dst) +{ + if (unlikely(dev == NULL)) + return -1; + + dst->value = (unsigned long) dev->name; + dst->len = strlen(dev->name); + return 0; +} + +META_COLLECTOR(int_dev) +{ + *err = int_dev(skb->dev, dst); +} + +META_COLLECTOR(var_dev) +{ + *err = var_dev(skb->dev, dst); +} + +META_COLLECTOR(int_indev) +{ + *err = int_dev(skb->input_dev, dst); +} + +META_COLLECTOR(var_indev) +{ + *err = var_dev(skb->input_dev, dst); +} + +META_COLLECTOR(int_realdev) +{ + *err = int_dev(skb->real_dev, dst); +} + +META_COLLECTOR(var_realdev) +{ + *err = var_dev(skb->real_dev, dst); +} + +/************************************************************************** + * skb attributes + **************************************************************************/ + +META_COLLECTOR(int_priority) +{ + dst->value = skb->priority; +} + +META_COLLECTOR(int_protocol) +{ + /* Let userspace take care of the byte ordering */ + dst->value = skb->protocol; +} + +META_COLLECTOR(int_security) +{ + dst->value = skb->security; +} + +META_COLLECTOR(int_pkttype) +{ + dst->value = skb->pkt_type; +} + +META_COLLECTOR(int_pktlen) +{ + dst->value = skb->len; +} + +META_COLLECTOR(int_datalen) +{ + dst->value = skb->data_len; +} + +META_COLLECTOR(int_maclen) +{ + dst->value = skb->mac_len; +} + +/************************************************************************** + * Netfilter + **************************************************************************/ + +#ifdef CONFIG_NETFILTER +META_COLLECTOR(int_nfmark) +{ + dst->value = skb->nfmark; +} +#endif + +/************************************************************************** + * Traffic Control + **************************************************************************/ + +META_COLLECTOR(int_tcindex) +{ + dst->value = skb->tc_index; +} + +#ifdef CONFIG_NET_CLS_ACT +META_COLLECTOR(int_tcverd) +{ + dst->value = skb->tc_verd; +} + +META_COLLECTOR(int_tcclassid) +{ + dst->value = skb->tc_classid; +} +#endif + +/************************************************************************** + * Routing + **************************************************************************/ + +#ifdef CONFIG_NET_CLS_ROUTE +META_COLLECTOR(int_rtclassid) +{ + if (unlikely(skb->dst == NULL)) + *err = -1; + else + dst->value = skb->dst->tclassid; +} +#endif + +META_COLLECTOR(int_rtiif) +{ + if (unlikely(skb->dst == NULL)) + *err = -1; + else + dst->value = ((struct rtable*) skb->dst)->fl.iif; +} + +/************************************************************************** + * Meta value collectors assignment table + **************************************************************************/ + +struct meta_ops +{ + void (*get)(struct sk_buff *, struct tcf_pkt_info *, + struct meta_value *, struct meta_obj *, int *); +}; + +/* Meta value operations table listing all meta value collectors and + * assigns them to a type and meta id. */ +static struct meta_ops __meta_ops[TCF_META_TYPE_MAX+1][TCF_META_ID_MAX+1] = { + [TCF_META_TYPE_VAR] = { + [TCF_META_ID_DEV] = { .get = meta_var_dev }, + [TCF_META_ID_INDEV] = { .get = meta_var_indev }, + [TCF_META_ID_REALDEV] = { .get = meta_var_realdev } + }, + [TCF_META_TYPE_INT] = { + [TCF_META_ID_RANDOM] = { .get = meta_int_random }, + [TCF_META_ID_LOADAVG_0] = { .get = meta_int_loadavg_0 }, + [TCF_META_ID_LOADAVG_1] = { .get = meta_int_loadavg_1 }, + [TCF_META_ID_LOADAVG_2] = { .get = meta_int_loadavg_2 }, + [TCF_META_ID_DEV] = { .get = meta_int_dev }, + [TCF_META_ID_INDEV] = { .get = meta_int_indev }, + [TCF_META_ID_REALDEV] = { .get = meta_int_realdev }, + [TCF_META_ID_PRIORITY] = { .get = meta_int_priority }, + [TCF_META_ID_PROTOCOL] = { .get = meta_int_protocol }, + [TCF_META_ID_SECURITY] = { .get = meta_int_security }, + [TCF_META_ID_PKTTYPE] = { .get = meta_int_pkttype }, + [TCF_META_ID_PKTLEN] = { .get = meta_int_pktlen }, + [TCF_META_ID_DATALEN] = { .get = meta_int_datalen }, + [TCF_META_ID_MACLEN] = { .get = meta_int_maclen }, +#ifdef CONFIG_NETFILTER + [TCF_META_ID_NFMARK] = { .get = meta_int_nfmark }, +#endif + [TCF_META_ID_TCINDEX] = { .get = meta_int_tcindex }, +#ifdef CONFIG_NET_CLS_ACT + [TCF_META_ID_TCVERDICT] = { .get = meta_int_tcverd }, + [TCF_META_ID_TCCLASSID] = { .get = meta_int_tcclassid }, +#endif +#ifdef CONFIG_NET_CLS_ROUTE + [TCF_META_ID_RTCLASSID] = { .get = meta_int_rtclassid }, +#endif + [TCF_META_ID_RTIIF] = { .get = meta_int_rtiif } + } +}; + +static inline struct meta_ops * meta_ops(struct meta_value *val) +{ + return &__meta_ops[meta_type(val)][meta_id(val)]; +} + +/************************************************************************** + * Type specific operations for TCF_META_TYPE_VAR + **************************************************************************/ + +static int meta_var_compare(struct meta_obj *a, struct meta_obj *b) +{ + int r = a->len - b->len; + + if (r == 0) + r = memcmp((void *) a->value, (void *) b->value, a->len); + + return r; +} + +static int meta_var_change(struct meta_value *dst, struct rtattr *rta) +{ + int len = RTA_PAYLOAD(rta); + + dst->val = (unsigned long) kmalloc(len, GFP_KERNEL); + if (dst->val == 0UL) + return -ENOMEM; + memcpy((void *) dst->val, RTA_DATA(rta), len); + dst->len = len; + return 0; +} + +static void meta_var_destroy(struct meta_value *v) +{ + if (v->val) + kfree((void *) v->val); +} + +static void meta_var_apply_extras(struct meta_value *v, + struct meta_obj *dst) +{ + int shift = v->hdr.shift; + + if (shift && shift < dst->len) + dst->len -= shift; +} + +static int meta_var_dump(struct sk_buff *skb, struct meta_value *v, int tlv) +{ + if (v->val && v->len) + RTA_PUT(skb, tlv, v->len, (void *) v->val); + return 0; + +rtattr_failure: + return -1; +} + +/************************************************************************** + * Type specific operations for TCF_META_TYPE_INT + **************************************************************************/ + +static int meta_int_compare(struct meta_obj *a, struct meta_obj *b) +{ + /* Let gcc optimize it, the unlikely is not really based on + * some numbers but jump free code for mismatches seems + * more logical. */ + if (unlikely(a == b)) + return 0; + else if (a < b) + return -1; + else + return 1; +} + +static int meta_int_change(struct meta_value *dst, struct rtattr *rta) +{ + if (RTA_PAYLOAD(rta) >= sizeof(unsigned long)) { + dst->val = *(unsigned long *) RTA_DATA(rta); + dst->len = sizeof(unsigned long); + } else if (RTA_PAYLOAD(rta) == sizeof(u32)) { + dst->val = *(u32 *) RTA_DATA(rta); + dst->len = sizeof(u32); + } else + return -EINVAL; + + return 0; +} + +static void meta_int_apply_extras(struct meta_value *v, + struct meta_obj *dst) +{ + if (v->hdr.shift) + dst->value >>= v->hdr.shift; + + if (v->val) + dst->value &= v->val; +} + +static int meta_int_dump(struct sk_buff *skb, struct meta_value *v, int tlv) +{ + if (v->len == sizeof(unsigned long)) + RTA_PUT(skb, tlv, sizeof(unsigned long), &v->val); + else if (v->len == sizeof(u32)) { + u32 d = v->val; + RTA_PUT(skb, tlv, sizeof(d), &d); + } + + return 0; + +rtattr_failure: + return -1; +} + +/************************************************************************** + * Type specific operations table + **************************************************************************/ + +struct meta_type_ops +{ + void (*destroy)(struct meta_value *); + int (*compare)(struct meta_obj *, struct meta_obj *); + int (*change)(struct meta_value *, struct rtattr *); + void (*apply_extras)(struct meta_value *, struct meta_obj *); + int (*dump)(struct sk_buff *, struct meta_value *, int); +}; + +static struct meta_type_ops __meta_type_ops[TCF_META_TYPE_MAX+1] = { + [TCF_META_TYPE_VAR] = { + .destroy = meta_var_destroy, + .compare = meta_var_compare, + .change = meta_var_change, + .apply_extras = meta_var_apply_extras, + .dump = meta_var_dump + }, + [TCF_META_TYPE_INT] = { + .compare = meta_int_compare, + .change = meta_int_change, + .apply_extras = meta_int_apply_extras, + .dump = meta_int_dump + } +}; + +static inline struct meta_type_ops * meta_type_ops(struct meta_value *v) +{ + return &__meta_type_ops[meta_type(v)]; +} + +/************************************************************************** + * Core + **************************************************************************/ + +static inline int meta_get(struct sk_buff *skb, struct tcf_pkt_info *info, + struct meta_value *v, struct meta_obj *dst) +{ + int err = 0; + + if (meta_id(v) == TCF_META_ID_VALUE) { + dst->value = v->val; + dst->len = v->len; + return 0; + } + + meta_ops(v)->get(skb, info, v, dst, &err); + if (err < 0) + return err; + + if (meta_type_ops(v)->apply_extras) + meta_type_ops(v)->apply_extras(v, dst); + + return 0; +} + +static int em_meta_match(struct sk_buff *skb, struct tcf_ematch *m, + struct tcf_pkt_info *info) +{ + int r; + struct meta_match *meta = (struct meta_match *) m->data; + struct meta_obj l_value, r_value; + + if (meta_get(skb, info, &meta->lvalue, &l_value) < 0 || + meta_get(skb, info, &meta->rvalue, &r_value) < 0) + return 0; + + r = meta_type_ops(&meta->lvalue)->compare(&l_value, &r_value); + + switch (meta->lvalue.hdr.op) { + case TCF_EM_OPND_EQ: + return !r; + case TCF_EM_OPND_LT: + return r < 0; + case TCF_EM_OPND_GT: + return r > 0; + } + + return 0; +} + +static inline void meta_delete(struct meta_match *meta) +{ + struct meta_type_ops *ops = meta_type_ops(&meta->lvalue); + + if (ops && ops->destroy) { + ops->destroy(&meta->lvalue); + ops->destroy(&meta->rvalue); + } + + kfree(meta); +} + +static inline int meta_change_data(struct meta_value *dst, struct rtattr *rta) +{ + if (rta) { + if (RTA_PAYLOAD(rta) == 0) + return -EINVAL; + + return meta_type_ops(dst)->change(dst, rta); + } + + return 0; +} + +static inline int meta_is_supported(struct meta_value *val) +{ + return (!meta_id(val) || meta_ops(val)->get); +} + +static int em_meta_change(struct tcf_proto *tp, void *data, int len, + struct tcf_ematch *m) +{ + int err = -EINVAL; + struct rtattr *tb[TCA_EM_META_MAX]; + struct tcf_meta_hdr *hdr; + struct meta_match *meta = NULL; + + if (rtattr_parse(tb, TCA_EM_META_MAX, data, len) < 0) + goto errout; + + if (tb[TCA_EM_META_HDR-1] == NULL || + RTA_PAYLOAD(tb[TCA_EM_META_HDR-1]) < sizeof(*hdr)) + goto errout; + hdr = RTA_DATA(tb[TCA_EM_META_HDR-1]); + + if (TCF_META_TYPE(hdr->left.kind) != TCF_META_TYPE(hdr->right.kind) || + TCF_META_TYPE(hdr->left.kind) > TCF_META_TYPE_MAX || + TCF_META_ID(hdr->left.kind) > TCF_META_ID_MAX || + TCF_META_ID(hdr->right.kind) > TCF_META_ID_MAX) + goto errout; + + meta = kmalloc(sizeof(*meta), GFP_KERNEL); + if (meta == NULL) + goto errout; + memset(meta, 0, sizeof(*meta)); + + memcpy(&meta->lvalue.hdr, &hdr->left, sizeof(hdr->left)); + memcpy(&meta->rvalue.hdr, &hdr->right, sizeof(hdr->right)); + + if (!meta_is_supported(&meta->lvalue) || + !meta_is_supported(&meta->rvalue)) { + err = -EOPNOTSUPP; + goto errout; + } + + if (meta_change_data(&meta->lvalue, tb[TCA_EM_META_LVALUE-1]) < 0 || + meta_change_data(&meta->rvalue, tb[TCA_EM_META_RVALUE-1]) < 0) + goto errout; + + m->datalen = sizeof(*meta); + m->data = (unsigned long) meta; + + err = 0; +errout: + if (err && meta) + meta_delete(meta); + return err; +} + +static void em_meta_destroy(struct tcf_proto *tp, struct tcf_ematch *m) +{ + if (m) + meta_delete((struct meta_match *) m->data); +} + +static int em_meta_dump(struct sk_buff *skb, struct tcf_ematch *em) +{ + struct meta_match *meta = (struct meta_match *) em->data; + struct tcf_meta_hdr hdr; + struct meta_type_ops *ops; + + memset(&hdr, 0, sizeof(hdr)); + memcpy(&hdr.left, &meta->lvalue.hdr, sizeof(hdr.left)); + memcpy(&hdr.right, &meta->rvalue.hdr, sizeof(hdr.right)); + + RTA_PUT(skb, TCA_EM_META_HDR, sizeof(hdr), &hdr); + + ops = meta_type_ops(&meta->lvalue); + if (ops->dump(skb, &meta->lvalue, TCA_EM_META_LVALUE) < 0 || + ops->dump(skb, &meta->rvalue, TCA_EM_META_RVALUE) < 0) + goto rtattr_failure; + + return 0; + +rtattr_failure: + return -1; +} + +static struct tcf_ematch_ops em_meta_ops = { + .kind = TCF_EM_META, + .change = em_meta_change, + .match = em_meta_match, + .destroy = em_meta_destroy, + .dump = em_meta_dump, + .owner = THIS_MODULE, + .link = LIST_HEAD_INIT(em_meta_ops.link) +}; + +static int __init init_em_meta(void) +{ + return tcf_em_register(&em_meta_ops); +} + +static void __exit exit_em_meta(void) +{ + tcf_em_unregister(&em_meta_ops); +} + +MODULE_LICENSE("GPL"); + +module_init(init_em_meta); +module_exit(exit_em_meta); From ag@roxor.be Wed Jan 26 12:31:24 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 12:31:30 -0800 (PST) Received: from mallaury.noc.nerim.net (smtp-103-wednesday.noc.nerim.net [62.4.17.103]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QKVMNv007108 for ; Wed, 26 Jan 2005 12:31:24 -0800 Received: from caladan.roxor.be (caladan.roxor.be [2001:7a8:35a7::1]) by mallaury.noc.nerim.net (Postfix) with ESMTP id 34CB962D71; Wed, 26 Jan 2005 21:31:18 +0100 (CET) Received: by caladan.roxor.be (Postfix, from userid 1000) id D10DB408E0BB; Wed, 26 Jan 2005 21:31:18 +0100 (CET) Date: Wed, 26 Jan 2005 21:31:18 +0100 From: =?iso-8859-1?B?QXVy6WxpZW4gR8lS1E1F?= To: linux-kernel@vger.kernel.org Cc: Janos Farkas , netdev@oss.sgi.com Subject: Re: waiting for ppp0 to become free (Re: ppp0 out of control) Message-ID: <20050126203118.GB3705@roxor.be> Reply-To: =?iso-8859-1?B?QXVy6WxpZW4gR8lS1E1F?= Mail-Followup-To: linux-kernel@vger.kernel.org, Janos Farkas , netdev@oss.sgi.com References: <20050121144444.GA2100@roxor.be> <20050126094422.GA31040@lk8rp.mail.xeon.eu.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cWoXeonUoKmBZSoM" Content-Disposition: inline In-Reply-To: <20050126094422.GA31040@lk8rp.mail.xeon.eu.org> User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 824 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ag@roxor.be Precedence: bulk X-list: netdev Content-Length: 2397 Lines: 62 --cWoXeonUoKmBZSoM Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 26, 2005 at 10:44:22AM +0100, Janos Farkas wrote: > On 2005-01-21 at 15:44:44, Aur=E9lien G=C9R=D4ME wrote: > > I am running 2.6.10 from kernel.org on Debian Sid ppc/x86, the same > > issue occurs with 2.6.9. Though, 2.6.8.1 and previous are fine. > >=20 > > When my ISP connection via PPPoE (kernel side) goes down, reconnection > > does not occur, and the kernel displays continuous: > >=20 > > kernel: unregister_netdevice: waiting for ppp0 to become free. Usage co= unt =3D 1 >=20 > BTW, I have seen many cases when this symptom annoyed me too, the last > one is that my shutdown scripts tried unloading the network driver > modules. Is your setup doing this by any chance? In my case, > apparently there were conntrack entries keeping the device in use, > which is almost useless when preparing to shutdown :) Actually, it happens after my ISP's LCP echos are not coming anymore, and then when pppd try to reconnect. > OTOH, I couldn't find a way to flush those conntracks, so I worked > around it by not rmmoding ethernet drivers. I have conntrack modules loaded too. I will try removing 8139too (on x86) and sungem (on ppc) if the issue occurs again. By the way, I also have IPv6 loaded, since I use a dual-stacked connection with native IPv6. How lucky I am! :) > In your case, it's probably conntrack too, I'd presume you are using > that PPPoE machine as a masquerading gateway, which by definition needs > connection tracking... I'm not sure either if this is a "real" change, > I only vaguely recollect as some moons earlier this wasn't a problem in > 2.6. Yep, 2.6.8.1 works fine, this issue appears on 2.6.9 and 2.6.10. I switched to a Debian 2.6.10 kernel for security reasons, and the issue has not come yet. I had a glance at the changelog and saw some network related patches. This is the -as patchset, see about it. Cheers. --cWoXeonUoKmBZSoM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFB9/4WI2xgxmW0sWIRAgcfAKDAfTExqnEouPtAnjH9XZpGc0kANwCfcdSU XZvwJNjym00EPqzyod6JU5o= =0MKM -----END PGP SIGNATURE----- --cWoXeonUoKmBZSoM-- From herbert@gondor.apana.org.au Wed Jan 26 12:35:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 12:35:08 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QKYv9V007617 for ; Wed, 26 Jan 2005 12:35:00 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1Cttrg-0001be-00; Thu, 27 Jan 2005 07:34:12 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1Cttr8-0005S6-00; Thu, 27 Jan 2005 07:33:38 +1100 From: Herbert Xu To: kazunori@miyazawa.org (MIYAZAWA Kazunori) Subject: Re: [PATCH][IPsec] fix process of error from crypto module Cc: davem@davemloft.net, netdev@oss.sgi.com, usagi-core@linux-ipv6.org Organization: Core In-Reply-To: <200501261910.20867.kazunori@miyazawa.org> X-Newsgroups: apana.lists.os.linux.netdev User-Agent: tin/1.7.4-20040225 ("Benbecula") (UNIX) (Linux/2.4.27-hx-1-686-smp (i686)) Message-Id: Date: Thu, 27 Jan 2005 07:33:38 +1100 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 825 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 1024 Lines: 29 MIYAZAWA Kazunori wrote: > > This patch fixes the process under the case that the crypto module > returns error because of its weak keys or etc. Good catch. > diff -ur a/net/ipv6/esp6.c b/net/ipv6/esp6.c > --- a/net/ipv6/esp6.c 2004-12-25 06:35:01.000000000 +0900 > +++ b/net/ipv6/esp6.c 2005-01-26 18:57:04.000000000 +0900 > @@ -364,7 +364,8 @@ > goto error; > get_random_bytes(esp->conf.ivec, esp->conf.ivlen); > } > - crypto_cipher_setkey(esp->conf.tfm, esp->conf.key, esp->conf.key_len); > + if (crypto_cipher_setkey(esp->conf.tfm, esp->conf.key, esp->conf.key_len)) > + goto error; > x->props.header_len = sizeof(struct ipv6_esp_hdr) + esp->conf.ivlen; > if (x->props.mode) > x->props.header_len += sizeof(struct ipv6hdr); You need to free esp->conf.ivec here. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From davem@davemloft.net Wed Jan 26 13:07:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 13:07:43 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QL7a8G008617 for ; Wed, 26 Jan 2005 13:07:36 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CtuJv-0007UC-00; Wed, 26 Jan 2005 13:03:23 -0800 Date: Wed, 26 Jan 2005 13:03:23 -0800 From: "David S. Miller" To: Thomas Graf Cc: hadi@cyberus.ca, kaber@trash.net, netdev@oss.sgi.com Subject: Re: [RFC] string matching ematch Message-Id: <20050126130323.2dc10187.davem@davemloft.net> In-Reply-To: <20050126150714.GL31837@postel.suug.ch> References: <20050126150714.GL31837@postel.suug.ch> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 826 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 591 Lines: 15 On Wed, 26 Jan 2005 16:07:14 +0100 Thomas Graf wrote: > I'd like to discuss the string matching ematch, I don't care about the > algorithm used but rather whether to make it stateful, match over > fragments, etc. I think you'll need to make it stateful. I assume this is meant to be used for things like catching references to "Falun Gong" in SMTP sessions and stuff like that. Not that I know any entity interested in such applications :-) Anyways, if the string goes across the TCP data portion of multiple packets, statefulness becomes necessary to catch it. Right? From dave@thedillows.org Wed Jan 26 13:14:45 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 13:14:53 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0QLEjg4009320 for ; Wed, 26 Jan 2005 13:14:45 -0800 Received: (qmail 26935 invoked by uid 0); 26 Jan 2005 21:14:44 -0000 Received: from unknown (HELO ori.thedillows.org) (69.73.92.110) by smtp1.knology.net with SMTP; 26 Jan 2005 21:14:44 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0QLErG8010843; Wed, 26 Jan 2005 16:14:53 -0500 Received: (from il1@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0QLErkX010842; Wed, 26 Jan 2005 16:14:53 -0500 X-Authentication-Warning: ori.thedillows.org: il1 set sender to dave@thedillows.org using -f Subject: Re: [RFC 2.6.10 1/22] xfrm: Add direction information to xfrm_state From: David Dillow To: "David S. Miller" Cc: Netdev In-Reply-To: <20050125221726.73d4b7ab.davem@davemloft.net> References: <20041230035000.01@ori.thedillows.org> <20041230035000.10@ori.thedillows.org> <20050121143857.69282605.davem@davemloft.net> <1106373022.3691.36.camel@ori.thedillows.org> <20050125221726.73d4b7ab.davem@davemloft.net> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Wed, 26 Jan 2005 16:14:52 -0500 Message-Id: <1106774092.9845.16.camel@ori.thedillows.org> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 827 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev Content-Length: 2227 Lines: 50 On Tue, 2005-01-25 at 22:17 -0800, David S. Miller wrote: > On Sat, 22 Jan 2005 00:50:22 -0500 > David Dillow wrote: > > > Hmm, I can see having netdev->xfrm_bundle_add() assume a outbound state, > > since it's only called for Tx. > > > > Rx offloading could be interesting, but it looks like I could hook into > > net/xfrm/xfrm_policy.c:__xfrm_policy_check(), and add the xfrm_states > > seen there to a work queue for offloading. netdev->xfrm_state_add() > > would then only see inbound states. > > > > Sound sane? > > You really can't get at the policies at these places somehow? > Even by passing down the xfrm_policy pointer into these > call chains? By these places, you mean xfrm_lookup() and __xfrm_policy_check()? There I absolutely have access to the policy, but even better, I only get to those places for one purpose -- xfrm_lookup() on output, __xfrm_policy_check() on input. Even in the first versions of the offload code, netdev->xfrm_state_add() and netdev->xfrm_bundle_add() were solely called for inbound and outbound xfrm_states, respectively. The problem was that I had no access to the policy at xfrm_state.c::xfrm_state_add(), since it wouldn't be called in the context of a policy. By moving the offload calls/queuing to __xfrm_policy_check(), I have the policy available, and I *know* it is inbound. If I offload SAs there, I can use that knowledge, and I get the benefit of lazy offload -- I'll only be offloading inbound SAs to netdev's that they've actually been received on, rather than to all capable devices, as the first version did. And, by making the decision to offload at the policy check means I get more info to use in that decision -- I'll probably change netdev- >xfrm_state_add() into netdev->xfrm_secpath_add(), and have it take the inbound secpath as an argument. This will let the driver see a more complete picture of the inbound xfrms, and allow it to not offload problematic combinations (the typhoon firmware has issues with certain combinations.) Now I'm working on a nice cheap way to decide if the inbound packet is a candidate for offloading, and avoid trying the same SA stack over and over and over... -- David Dillow From dave@thedillows.org Wed Jan 26 13:30:32 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 13:30:38 -0800 (PST) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0QLUW6W010146 for ; Wed, 26 Jan 2005 13:30:32 -0800 Received: (qmail 29787 invoked by uid 0); 26 Jan 2005 21:30:31 -0000 Received: from unknown (HELO ori.thedillows.org) (69.73.92.110) by smtp1.knology.net with SMTP; 26 Jan 2005 21:30:31 -0000 Received: from ori.thedillows.org (localhost [127.0.0.1]) by ori.thedillows.org (8.13.1/8.13.1) with ESMTP id j0QLUeTl010853; Wed, 26 Jan 2005 16:30:40 -0500 Received: (from il1@localhost) by ori.thedillows.org (8.13.1/8.13.1/Submit) id j0QLUeEr010852; Wed, 26 Jan 2005 16:30:40 -0500 X-Authentication-Warning: ori.thedillows.org: il1 set sender to dave@thedillows.org using -f Subject: Re: [RFC 2.6.10 3/22] xfrm: Add offload management routines From: David Dillow To: "David S. Miller" Cc: Netdev In-Reply-To: <20050125221608.0cb067b2.davem@davemloft.net> References: <20041230035000.11@ori.thedillows.org> <20041230035000.12@ori.thedillows.org> <20050121144738.7155893e.davem@davemloft.net> <1106373038.3691.39.camel@ori.thedillows.org> <20050125221608.0cb067b2.davem@davemloft.net> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Wed, 26 Jan 2005 16:30:39 -0500 Message-Id: <1106775040.9845.31.camel@ori.thedillows.org> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 828 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dave@thedillows.org Precedence: bulk X-list: netdev Content-Length: 1966 Lines: 47 On Tue, 2005-01-25 at 22:16 -0800, David S. Miller wrote: > On Sat, 22 Jan 2005 00:50:38 -0500 > David Dillow wrote: > > > Note that kmalloc() and SLAB do guarentee whatever alignment is > necessary to access the largest aligned C data type on a platform. > So on sparc32 this is 8 bytes, on some it is 4 bytes. I must be missing something, since I only need to ensure the items in struct xfrm_offload are aligned correctly -- the pointers in the first list_head need to be aligned for the platform. I'm assuming the compiler will align them on a proper offset from the beginning of the struct, and as long as kmalloc() gives me the proper alignment for a pointer, then I don't see the problem. The hardware will never DMA the base xfrm_offload struct, and only possibly it's private area -- which I agree would need proper alignment. Just for reference, here's xfrm_offload: struct xfrm_offload { struct list_head bydev; struct net_device * dev; atomic_t refcnt; }; I'm making the assumption that kmalloc() will give me back a pointer that will have an acceptable alignment for the platform for all of the pointers, as well as the refcnt. > > I copied part of that code to xfrm_offload_alloc(), removing the part > > that aligned the base xfrm_offload struct. 32 byte alignment seemed a > > bit much, do you think it is needed? I'll be happy to add that if you > > want. > > Depends upon what you really need the alignment for. If you need it > due to some hardware restriction or whatever, that would be determined > per device I guess. Per above, it seems like I only need kmalloc()'s alignment for struct xfrm_offload. I don't know what the user will put in his private area, but I wanted to try to align it such that it had the same guarantee that kmalloc() had. That was the purpose of doing the alignment math only in xfrm_offload_priv(). -- David Dillow From tgraf@suug.ch Wed Jan 26 13:41:00 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 13:41:06 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QLexrg010812 for ; Wed, 26 Jan 2005 13:41:00 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 8685184; Wed, 26 Jan 2005 22:40:36 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 78C3B1C0EA; Wed, 26 Jan 2005 22:41:19 +0100 (CET) Date: Wed, 26 Jan 2005 22:41:19 +0100 From: Thomas Graf To: "David S. Miller" Cc: hadi@cyberus.ca, kaber@trash.net, netdev@oss.sgi.com Subject: Re: [RFC] string matching ematch Message-ID: <20050126214119.GP31837@postel.suug.ch> References: <20050126150714.GL31837@postel.suug.ch> <20050126130323.2dc10187.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050126130323.2dc10187.davem@davemloft.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 829 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 2189 Lines: 49 * David S. Miller <20050126130323.2dc10187.davem@davemloft.net> 2005-01-26 13:03 > On Wed, 26 Jan 2005 16:07:14 +0100 > Thomas Graf wrote: > > > I'd like to discuss the string matching ematch, I don't care about the > > algorithm used but rather whether to make it stateful, match over > > fragments, etc. > > I think you'll need to make it stateful. > > I assume this is meant to be used for things like catching references > to "Falun Gong" in SMTP sessions and stuff like that. Not that I know > any entity interested in such applications :-) Hehe, it's main purpose is to catch mail from your sweetie and redirect them through a low latency link but of course you can also use it to match on text based protocols without strict header ordering. ;-> > Anyways, if the string goes across the TCP data portion of multiple > packets, statefulness becomes necessary to catch it. Right? Yes and no, it is of course necessary if one wants to match any string at any position without limitation. OTOH, it gets quite complex. We'd have to store the state of every configured kmp ematch to just be able to tell the result. On top of that, the whole classification process is stateless and should be kept like this. Assuming one configures three ematches like this: u32(ip dport 333 0xff) and ( kmp("Falun Gong" from 20 layer transport) and nbyte("SMTP" at 0 layer application) ) assuming the u32 and nbyte ematch matches in the first packet, the string matches only partially. We can't regard regard the ematch tree as matched so we must return false. The next packet in the flow completes the string but the nbyte match doesn't match anymore so no match either. In fact a stateless filter can't do any better but it doesn't consume as much resources. There are cases where a statefull string matching would be of use, one of them is when it doesn't matter which packet you actually classify, e.g. dropping connections such as to protect your web server from stilly requests. I'm not sure if mixing stateful with stateless stuff is such of a good idea. I think it should be separated and have stateful filters only be executed when the flow matters, not packets. From jesse.brandeburg@intel.com Wed Jan 26 14:00:44 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 14:00:48 -0800 (PST) Received: from orsfmr002.jf.intel.com (fmr17.intel.com [134.134.136.16]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QM0f8l012945 for ; Wed, 26 Jan 2005 14:00:44 -0800 Received: from orsfmr101.jf.intel.com (orsfmr101.jf.intel.com [10.7.209.17]) by orsfmr002.jf.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j0QM0Npn001748; Wed, 26 Jan 2005 22:00:23 GMT Received: from orsmsxvs041.jf.intel.com (orsmsxvs041.jf.intel.com [192.168.65.54]) by orsfmr101.jf.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j0QM0Cne003450; Wed, 26 Jan 2005 22:00:23 GMT Received: from orsmsx332.amr.corp.intel.com ([192.168.65.60]) by orsmsxvs041.jf.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005012614002020326 ; Wed, 26 Jan 2005 14:00:20 -0800 Received: from orsmsx408.amr.corp.intel.com ([192.168.65.52]) by orsmsx332.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 26 Jan 2005 14:00:20 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: Acer Aspire 1524WLMi and RealTek 8169 - very slow Date: Wed, 26 Jan 2005 14:00:22 -0800 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Acer Aspire 1524WLMi and RealTek 8169 - very slow Thread-Index: AcUBftUGFgeNxxy+TWGZtbEfPd9p7QCc2USg From: "Brandeburg, Jesse" To: "Richard Dawe" , "Francois Romieu" Cc: X-OriginalArrivalTime: 26 Jan 2005 22:00:20.0602 (UTC) FILETIME=[6D9ECDA0:01C503F2] X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j0QM0f8l012945 X-archive-position: 830 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jesse.brandeburg@intel.com Precedence: bulk X-list: netdev Content-Length: 951 Lines: 29 > If I try setting the speed & duplex using something like this: > > ethtool -s eth0 speed 10 duplex half > > it fails. I get no errors, but the "ethtool eth0" shows the link speed & > duplex to be 100Mbps full-duplex. I think I managed to get it into > 100Mbps half-duplex once > > When I try to "ethtool -s eth0 speed 10", the link lights on my ADSL > router change to orange, which indicates 10Mbps. Then the light goes out > and comes back green, which indicates 100Mbps. > > So maybe the driver isn't waiting long enough for something. You're running into the (in)famous ethtool vs autonegotiation issue. If you do ethtool -s eth0 autoneg off speed 10 duplex half I think it will probably work. The behavior you're describing applies to most drivers I think. I actually vote that we get ethtool to automatically turn autoneg off when someone forces speed _and_ duplex, as its always the right thing to do. Anyway, good luck. Jesse From davem@davemloft.net Wed Jan 26 15:30:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 15:30:26 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QNUJBd021390 for ; Wed, 26 Jan 2005 15:30:19 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CtwY6-0007wf-00; Wed, 26 Jan 2005 15:26:10 -0800 Date: Wed, 26 Jan 2005 15:26:09 -0800 From: "David S. Miller" To: Thomas Graf Cc: hadi@cyberus.ca, kaber@trash.net, netdev@oss.sgi.com Subject: Re: [RFC] string matching ematch Message-Id: <20050126152609.59e1a15e.davem@davemloft.net> In-Reply-To: <20050126214119.GP31837@postel.suug.ch> References: <20050126150714.GL31837@postel.suug.ch> <20050126130323.2dc10187.davem@davemloft.net> <20050126214119.GP31837@postel.suug.ch> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 832 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 331 Lines: 10 On Wed, 26 Jan 2005 22:41:19 +0100 Thomas Graf wrote: > I'm not sure if mixing stateful with stateless stuff is such of a good > idea. I think it should be separated and have stateful filters only be > executed when the flow matters, not packets. I think keeping things totally stateless would be the best idea. From kaber@trash.net Wed Jan 26 15:31:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 15:31:11 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QNV2iu021411 for ; Wed, 26 Jan 2005 15:31:03 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.43) id 1Ctwcj-0002TH-13; Thu, 27 Jan 2005 00:30:57 +0100 Message-ID: <41F82830.9010009@trash.net> Date: Thu, 27 Jan 2005 00:30:56 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050106 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com Subject: Re: [PATCH 2.6]: keep fragment queues private to each user References: <41F5D1CB.9050804@trash.net> <20050125214158.4be3798c.davem@davemloft.net> In-Reply-To: <20050125214158.4be3798c.davem@davemloft.net> Content-Type: multipart/mixed; boundary="------------030007000609080802020601" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 833 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 12450 Lines: 425 This is a multi-part message in MIME format. --------------030007000609080802020601 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit David S. Miller wrote: >On Tue, 25 Jan 2005 05:57:47 +0100 >Patrick McHardy wrote: > >>This patch keeps fragment queues private to each ip_defrag user to avoid >>skbs jumping between different callers. It shouldn't change any wanted >>behaviour, the only questionable one was ip_call_ra_chain, but the RA >>option is included in each fragment. If you're fine with the patch I'm going >>to send a 2.4 version later. >> > >Please fix the CONFIG_SMP build. You use some variable "user" >in ip_frag_intern(), yet don't add this as an argument or >anything like that. > Sorry, new patch attached. I'll send the 2.4 patch later tonight. Regards Patrick --------------030007000609080802020601 Content-Type: text/plain; name="x" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="x" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/27 00:20:54+01:00 kaber@coreworks.de # [IPV4]: Keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # # net/ipv4/netfilter/ip_nat_standalone.c # 2005/01/27 00:20:46+01:00 kaber@coreworks.de +1 -1 # [IPV4]: Keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # # net/ipv4/netfilter/ip_conntrack_standalone.c # 2005/01/27 00:20:46+01:00 kaber@coreworks.de +4 -7 # [IPV4]: Keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # # net/ipv4/netfilter/ip_conntrack_core.c # 2005/01/27 00:20:46+01:00 kaber@coreworks.de +2 -9 # [IPV4]: Keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # # net/ipv4/ipvs/ip_vs_core.c # 2005/01/27 00:20:46+01:00 kaber@coreworks.de +11 -8 # [IPV4]: Keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # # net/ipv4/ip_input.c # 2005/01/27 00:20:46+01:00 kaber@coreworks.de +2 -2 # [IPV4]: Keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # # net/ipv4/ip_fragment.c # 2005/01/27 00:20:46+01:00 kaber@coreworks.de +13 -20 # [IPV4]: Keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # # include/net/ip.h # 2005/01/27 00:20:46+01:00 kaber@coreworks.de +14 -3 # [IPV4]: Keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # # include/linux/netfilter_ipv4/ip_conntrack.h # 2005/01/27 00:20:46+01:00 kaber@coreworks.de +1 -2 # [IPV4]: Keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # diff -Nru a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h --- a/include/linux/netfilter_ipv4/ip_conntrack.h 2005-01-27 00:22:21 +01:00 +++ b/include/linux/netfilter_ipv4/ip_conntrack.h 2005-01-27 00:22:21 +01:00 @@ -262,10 +262,9 @@ /* Fake conntrack entry for untracked connections */ extern struct ip_conntrack ip_conntrack_untracked; -extern int ip_ct_no_defrag; /* Returns new sk_buff, or NULL */ struct sk_buff * -ip_ct_gather_frags(struct sk_buff *skb); +ip_ct_gather_frags(struct sk_buff *skb, u_int32_t user); /* Iterate over all conntracks: if iter returns true, it's deleted. */ extern void diff -Nru a/include/net/ip.h b/include/net/ip.h --- a/include/net/ip.h 2005-01-27 00:22:21 +01:00 +++ b/include/net/ip.h 2005-01-27 00:22:21 +01:00 @@ -286,9 +286,20 @@ /* * Functions provided by ip_fragment.o */ - -struct sk_buff *ip_defrag(struct sk_buff *skb); -extern void ipfrag_flush(void); + +enum ip_defrag_users +{ + IP_DEFRAG_LOCAL_DELIVER, + IP_DEFRAG_CALL_RA_CHAIN, + IP_DEFRAG_CONNTRACK_IN, + IP_DEFRAG_CONNTRACK_OUT, + IP_DEFRAG_NAT_OUT, + IP_DEFRAG_VS_IN, + IP_DEFRAG_VS_OUT, + IP_DEFRAG_VS_FWD +}; + +struct sk_buff *ip_defrag(struct sk_buff *skb, u32 user); extern int ip_frag_nqueues; extern atomic_t ip_frag_mem; diff -Nru a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c --- a/net/ipv4/ip_fragment.c 2005-01-27 00:22:21 +01:00 +++ b/net/ipv4/ip_fragment.c 2005-01-27 00:22:21 +01:00 @@ -73,6 +73,7 @@ struct ipq { struct ipq *next; /* linked list pointers */ struct list_head lru_list; /* lru list member */ + u32 user; u32 saddr; u32 daddr; u16 id; @@ -243,13 +244,13 @@ /* Memory limiting on fragments. Evictor trashes the oldest * fragment queue until we are back under the threshold. */ -static void __ip_evictor(int threshold) +static void ip_evictor(void) { struct ipq *qp; struct list_head *tmp; int work; - work = atomic_read(&ip_frag_mem) - threshold; + work = atomic_read(&ip_frag_mem) - sysctl_ipfrag_low_thresh; if (work <= 0) return; @@ -274,11 +275,6 @@ } } -static inline void ip_evictor(void) -{ - __ip_evictor(sysctl_ipfrag_low_thresh); -} - /* * Oops, a fragment queue timed out. Kill it and send an ICMP reply. */ @@ -325,7 +321,8 @@ if(qp->id == qp_in->id && qp->saddr == qp_in->saddr && qp->daddr == qp_in->daddr && - qp->protocol == qp_in->protocol) { + qp->protocol == qp_in->protocol && + qp->user == qp_in->user) { atomic_inc(&qp->refcnt); write_unlock(&ipfrag_lock); qp_in->last_in |= COMPLETE; @@ -352,7 +349,7 @@ } /* Add an entry to the 'ipq' queue for a newly received IP datagram. */ -static struct ipq *ip_frag_create(unsigned hash, struct iphdr *iph) +static struct ipq *ip_frag_create(unsigned hash, struct iphdr *iph, u32 user) { struct ipq *qp; @@ -364,6 +361,7 @@ qp->id = iph->id; qp->saddr = iph->saddr; qp->daddr = iph->daddr; + qp->user = user; qp->len = 0; qp->meat = 0; qp->fragments = NULL; @@ -386,7 +384,7 @@ /* Find the correct entry in the "incomplete datagrams" queue for * this IP datagram, and create new one, if nothing is found. */ -static inline struct ipq *ip_find(struct iphdr *iph) +static inline struct ipq *ip_find(struct iphdr *iph, u32 user) { __u16 id = iph->id; __u32 saddr = iph->saddr; @@ -400,7 +398,8 @@ if(qp->id == id && qp->saddr == saddr && qp->daddr == daddr && - qp->protocol == protocol) { + qp->protocol == protocol && + qp->user == user) { atomic_inc(&qp->refcnt); read_unlock(&ipfrag_lock); return qp; @@ -408,7 +407,7 @@ } read_unlock(&ipfrag_lock); - return ip_frag_create(hash, iph); + return ip_frag_create(hash, iph, user); } /* Add new segment to existing queue. */ @@ -642,7 +641,7 @@ } /* Process an incoming IP datagram fragment. */ -struct sk_buff *ip_defrag(struct sk_buff *skb) +struct sk_buff *ip_defrag(struct sk_buff *skb, u32 user) { struct iphdr *iph = skb->nh.iph; struct ipq *qp; @@ -657,7 +656,7 @@ dev = skb->dev; /* Lookup (or create) queue header */ - if ((qp = ip_find(iph)) != NULL) { + if ((qp = ip_find(iph, user)) != NULL) { struct sk_buff *ret = NULL; spin_lock(&qp->lock); @@ -689,10 +688,4 @@ add_timer(&ipfrag_secret_timer); } -void ipfrag_flush(void) -{ - __ip_evictor(0); -} - EXPORT_SYMBOL(ip_defrag); -EXPORT_SYMBOL(ipfrag_flush); diff -Nru a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c --- a/net/ipv4/ip_input.c 2005-01-27 00:22:21 +01:00 +++ b/net/ipv4/ip_input.c 2005-01-27 00:22:21 +01:00 @@ -172,7 +172,7 @@ (!sk->sk_bound_dev_if || sk->sk_bound_dev_if == skb->dev->ifindex)) { if (skb->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) { - skb = ip_defrag(skb); + skb = ip_defrag(skb, IP_DEFRAG_CALL_RA_CHAIN); if (skb == NULL) { read_unlock(&ip_ra_lock); return 1; @@ -273,7 +273,7 @@ */ if (skb->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) { - skb = ip_defrag(skb); + skb = ip_defrag(skb, IP_DEFRAG_LOCAL_DELIVER); if (!skb) return 0; } diff -Nru a/net/ipv4/ipvs/ip_vs_core.c b/net/ipv4/ipvs/ip_vs_core.c --- a/net/ipv4/ipvs/ip_vs_core.c 2005-01-27 00:22:21 +01:00 +++ b/net/ipv4/ipvs/ip_vs_core.c 2005-01-27 00:22:21 +01:00 @@ -544,9 +544,9 @@ } static inline struct sk_buff * -ip_vs_gather_frags(struct sk_buff *skb) +ip_vs_gather_frags(struct sk_buff *skb, u_int32_t user) { - skb = ip_defrag(skb); + skb = ip_defrag(skb, user); if (skb) ip_send_check(skb->nh.iph); return skb; @@ -620,7 +620,7 @@ /* reassemble IP fragments */ if (skb->nh.iph->frag_off & __constant_htons(IP_MF|IP_OFFSET)) { - skb = ip_vs_gather_frags(skb); + skb = ip_vs_gather_frags(skb, IP_DEFRAG_VS_OUT); if (!skb) return NF_STOLEN; *pskb = skb; @@ -759,7 +759,7 @@ /* reassemble IP fragments */ if (unlikely(iph->frag_off & __constant_htons(IP_MF|IP_OFFSET) && !pp->dont_defrag)) { - skb = ip_vs_gather_frags(skb); + skb = ip_vs_gather_frags(skb, IP_DEFRAG_VS_OUT); if (!skb) return NF_STOLEN; iph = skb->nh.iph; @@ -839,7 +839,8 @@ * forward to the right destination host if relevant. * Currently handles error types - unreachable, quench, ttl exceeded. */ -static int ip_vs_in_icmp(struct sk_buff **pskb, int *related) +static int +ip_vs_in_icmp(struct sk_buff **pskb, int *related, unsigned int hooknum) { struct sk_buff *skb = *pskb; struct iphdr *iph; @@ -853,7 +854,9 @@ /* reassemble IP fragments */ if (skb->nh.iph->frag_off & __constant_htons(IP_MF|IP_OFFSET)) { - skb = ip_vs_gather_frags(skb); + skb = ip_vs_gather_frags(skb, + hooknum == NF_IP_LOCAL_IN ? + IP_DEFRAG_VS_IN : IP_DEFRAG_VS_FWD); if (!skb) return NF_STOLEN; *pskb = skb; @@ -962,7 +965,7 @@ iph = skb->nh.iph; if (unlikely(iph->protocol == IPPROTO_ICMP)) { - int related, verdict = ip_vs_in_icmp(pskb, &related); + int related, verdict = ip_vs_in_icmp(pskb, &related, hooknum); if (related) return verdict; @@ -1057,7 +1060,7 @@ if ((*pskb)->nh.iph->protocol != IPPROTO_ICMP) return NF_ACCEPT; - return ip_vs_in_icmp(pskb, &r); + return ip_vs_in_icmp(pskb, &r, hooknum); } diff -Nru a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c --- a/net/ipv4/netfilter/ip_conntrack_core.c 2005-01-27 00:22:21 +01:00 +++ b/net/ipv4/netfilter/ip_conntrack_core.c 2005-01-27 00:22:21 +01:00 @@ -936,29 +936,22 @@ } } -int ip_ct_no_defrag; - /* Returns new sk_buff, or NULL */ struct sk_buff * -ip_ct_gather_frags(struct sk_buff *skb) +ip_ct_gather_frags(struct sk_buff *skb, u_int32_t user) { struct sock *sk = skb->sk; #ifdef CONFIG_NETFILTER_DEBUG unsigned int olddebug = skb->nf_debug; #endif - if (unlikely(ip_ct_no_defrag)) { - kfree_skb(skb); - return NULL; - } - if (sk) { sock_hold(sk); skb_orphan(skb); } local_bh_disable(); - skb = ip_defrag(skb); + skb = ip_defrag(skb, user); local_bh_enable(); if (!skb) { diff -Nru a/net/ipv4/netfilter/ip_conntrack_standalone.c b/net/ipv4/netfilter/ip_conntrack_standalone.c --- a/net/ipv4/netfilter/ip_conntrack_standalone.c 2005-01-27 00:22:21 +01:00 +++ b/net/ipv4/netfilter/ip_conntrack_standalone.c 2005-01-27 00:22:21 +01:00 @@ -391,7 +391,10 @@ /* Gather fragments. */ if ((*pskb)->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) { - *pskb = ip_ct_gather_frags(*pskb); + *pskb = ip_ct_gather_frags(*pskb, + hooknum == NF_IP_PRE_ROUTING ? + IP_DEFRAG_CONNTRACK_IN : + IP_DEFRAG_CONNTRACK_OUT); if (!*pskb) return NF_STOLEN; } @@ -823,12 +826,6 @@ cleanup_defraglocalops: nf_unregister_hook(&ip_conntrack_defrag_local_out_ops); cleanup_defragops: - /* Frag queues may hold fragments with skb->dst == NULL */ - ip_ct_no_defrag = 1; - synchronize_net(); - local_bh_disable(); - ipfrag_flush(); - local_bh_enable(); nf_unregister_hook(&ip_conntrack_defrag_ops); cleanup_proc_stat: #ifdef CONFIG_PROC_FS diff -Nru a/net/ipv4/netfilter/ip_nat_standalone.c b/net/ipv4/netfilter/ip_nat_standalone.c --- a/net/ipv4/netfilter/ip_nat_standalone.c 2005-01-27 00:22:21 +01:00 +++ b/net/ipv4/netfilter/ip_nat_standalone.c 2005-01-27 00:22:21 +01:00 @@ -195,7 +195,7 @@ I'm starting to have nightmares about fragments. */ if ((*pskb)->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) { - *pskb = ip_ct_gather_frags(*pskb); + *pskb = ip_ct_gather_frags(*pskb, IP_DEFRAG_NAT_OUT); if (!*pskb) return NF_STOLEN; --------------030007000609080802020601-- From davem@davemloft.net Wed Jan 26 15:34:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 15:34:09 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QNY2rW022343 for ; Wed, 26 Jan 2005 15:34:03 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Ctwbo-0007yW-00; Wed, 26 Jan 2005 15:30:00 -0800 Date: Wed, 26 Jan 2005 15:29:59 -0800 From: "David S. Miller" To: "Michael Chan" Cc: netdev@oss.sgi.com Subject: Re: [PATCH 2.6.10] tg3: 5750 fixes Message-Id: <20050126152959.305919f4.davem@davemloft.net> In-Reply-To: References: X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 834 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 198 Lines: 6 On Wed, 26 Jan 2005 10:01:42 -0800 "Michael Chan" wrote: > Some misc. fixes for 5750. The first 2 fixes below are for correctness. Looks great, patch applied, thanks Michael. From herbert@gondor.apana.org.au Wed Jan 26 15:39:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 15:39:37 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QNdRAG023382 for ; Wed, 26 Jan 2005 15:39:28 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CtwkU-0004OX-00; Thu, 27 Jan 2005 10:38:58 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1Ctwjs-0006MJ-00; Thu, 27 Jan 2005 10:38:20 +1100 Date: Thu, 27 Jan 2005 10:38:20 +1100 To: "David S. Miller" Cc: Chas Williams , netdev@oss.sgi.com Subject: [ATM] Fix flags type in lec_arp_expire_vcc Message-ID: <20050126233820.GA24422@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Q68bSM7Ycu6FN28Q" Content-Disposition: inline User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 835 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 1080 Lines: 38 --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi: The variable flags in lec_arp_expire_vcc should be of type unsigned long and not unsigned. The following patch fixes that typo. Signed-off-by: Herbert Xu Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=q ===== net/atm/lec.c 1.45 vs edited ===== --- 1.45/net/atm/lec.c 2005-01-19 07:59:15 +11:00 +++ edited/net/atm/lec.c 2005-01-27 10:33:29 +11:00 @@ -1818,7 +1818,7 @@ static void lec_arp_expire_vcc(unsigned long data) { - unsigned flags; + unsigned long flags; struct lec_arp_table *to_remove = (struct lec_arp_table*)data; struct lec_priv *priv = (struct lec_priv *)to_remove->priv; struct lec_arp_table *entry = NULL; --Q68bSM7Ycu6FN28Q-- From davem@davemloft.net Wed Jan 26 15:42:58 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 15:43:11 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QNgvRn023906 for ; Wed, 26 Jan 2005 15:42:58 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CtwkQ-00081n-00; Wed, 26 Jan 2005 15:38:54 -0800 Date: Wed, 26 Jan 2005 15:38:54 -0800 From: "David S. Miller" To: Robert Olsson Cc: netdev@oss.sgi.com, Robert.Olsson@data.slu.se Subject: Re: [PATCH] gc_min_interval in milleseconds via /proc Message-Id: <20050126153854.3351b203.davem@davemloft.net> In-Reply-To: <16887.46410.873506.298630@robur.slu.se> References: <16887.46410.873506.298630@robur.slu.se> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 836 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 413 Lines: 11 On Wed, 26 Jan 2005 16:20:42 +0100 Robert Olsson wrote: > The second resolution is very inconvenient. Milleseconds would be nicer. It would, but since this is a user visible API we really can't change it. We could instead make another sysctl (perhaps name it something like "gc_min_interval_ms") to do what you propose, and then we'd keep the existing one around for compatibility. From kaber@trash.net Wed Jan 26 15:49:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 15:49:14 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0QNn8u9024930 for ; Wed, 26 Jan 2005 15:49:08 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.43) id 1CtwuD-0002WR-At; Thu, 27 Jan 2005 00:49:01 +0100 Message-ID: <41F82C6D.7020006@trash.net> Date: Thu, 27 Jan 2005 00:49:01 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050106 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: Bart De Schuymer CC: "David S. Miller" , netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org, snort2004@mail.ru, rusty@rustcorp.com.au, ak@suse.de, bridge@osdl.org, Martin Josefsson , dwmw2@infradead.org, shemminger@osdl.org Subject: Re: [PATCH/RFC] Reduce call chain length in netfilter References: <1131604877.20041218092730@mail.ru.suse.lists.linux.kernel> <1105117559.11753.34.camel@baythorne.infradead.org> <20050107100017.454ddadc@dxpl.pdx.osdl.net> <1105133241.3375.16.camel@localhost.localdomain> <20050118135735.4b77d38d.davem@davemloft.net> <1106433059.4486.11.camel@localhost.localdomain> <1106436153.20995.42.camel@tux.rsn.bth.se> <1106484019.3376.5.camel@localhost.localdomain> <1106496509.1085.1.camel@tux.rsn.bth.se> <20050125220558.6e824f8a.davem@davemloft.net> <1106730510.4041.4.camel@localhost.localdomain> In-Reply-To: <1106730510.4041.4.camel@localhost.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 837 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 205 Lines: 12 Bart De Schuymer wrote: >Does anyone have objections to this patch, which reduces the netfilter >call chain length? > Looks fine to me. Signed-off-by: Patrick McHardy Regards Patrick From akpm@osdl.org Wed Jan 26 16:19:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 16:19:10 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0R0J3D9025986 for ; Wed, 26 Jan 2005 16:19:04 -0800 Received: from bix (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id j0R0Iwl06590 for ; Wed, 26 Jan 2005 16:18:58 -0800 Date: Wed, 26 Jan 2005 16:19:04 -0800 From: Andrew Morton To: netdev@oss.sgi.com Subject: Fw: [Bugme-new] [Bug 4111] New: invalid operand: 0000 at include/linux/netdevice.h:879 Message-Id: <20050126161904.0d64626b.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 838 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 9101 Lines: 210 Looks like e1000 in 2.6.9 went splat here: static inline void netif_rx_complete(struct net_device *dev) { unsigned long flags; local_irq_save(flags); BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state)); Begin forwarded message: Date: Wed, 26 Jan 2005 16:15:42 -0800 From: bugme-daemon@osdl.org To: bugme-new@lists.osdl.org Subject: [Bugme-new] [Bug 4111] New: invalid operand: 0000 at include/linux/netdevice.h:879 http://bugme.osdl.org/show_bug.cgi?id=4111 Summary: invalid operand: 0000 at include/linux/netdevice.h:879 Kernel Version: 2.6.9 Status: NEW Severity: normal Owner: acme@conectiva.com.br Submitter: powerman-asdf@yandex.ru Distribution: Gentoo Hardware Environment: Software Environment: see detailed both H&S env in http://bugzilla.kernel.org/show_bug.cgi?id=4085 Problem Description: This happens again. I'll stop creating new bugreports here because I don't think new logs will contain any important information which you can't found in my previous reports: 1) first server (this bugreport also about this server): http://bugme.osdl.org/show_bug.cgi?id=4085 http://bugme.osdl.org/show_bug.cgi?id=4086 http://bugme.osdl.org/show_bug.cgi?id=4088 http://bugme.osdl.org/show_bug.cgi?id=4096 2) second server http://bugme.osdl.org/show_bug.cgi?id=4101 2005-01-26_23:29:41.76943 69.93.246.50: IN=eth0 OUT= 2005-01-26_23:29:41.76949 69.93.246.50: MAC= 2005-01-26_23:29:41.76956 69.93.246.50: 00: 2005-01-26_23:29:41.76963 69.93.246.50: 30: 2005-01-26_23:29:41.76970 69.93.246.50: 48: 2005-01-26_23:29:41.76976 69.93.246.50: 42: 2005-01-26_23:29:41.76983 69.93.246.50: 63: 2005-01-26_23:29:41.76990 69.93.246.50: fc: 2005-01-26_23:29:41.76996 69.93.246.50: 00: 2005-01-26_23:29:41.77003 69.93.246.50: d0: 2005-01-26_23:29:41.77010 69.93.246.50: 02: 2005-01-26_23:29:41.77017 69.93.246.50: 49: 2005-01-26_23:29:41.77023 69.93.246.50: 64: 2005-01-26_23:29:41.77030 69.93.246.50: 00: 2005-01-26_23:29:41.77037 69.93.246.50: 08: 2005-01-26_23:29:41.77043 69.93.246.50: 00 2005-01-26_23:29:41.77052 69.93.246.50: SRC=202.12.150.245 DST=69.93.246.50 2005-01-26_23:29:41.77060 69.93.246.50: LEN=40 TOS=0x00 PREC=0x00 TTL=115 ID=20990 2005-01-26_23:29:41.77067 69.93.246.50: PROTO=TCP 2005-01-26_23:29:41.77074 69.93.246.50: SPT=80 DPT=10896 2005-01-26_23:29:41.77080 69.93.246.50: WINDOW=0 2005-01-26_23:29:41.77087 69.93.246.50: RES=0x00 2005-01-26_23:29:41.77094 69.93.246.50: RST 2005-01-26_23:29:41.77101 69.93.246.50: URGP=0 2005-01-26_23:29:41.77107 69.93.246.50: 2005-01-26_23:29:41.77116 69.93.246.50: ------------[ cut here ]------------ 2005-01-26_23:29:41.77124 69.93.246.50: kernel BUG at include/linux/netdevice.h: 879! 2005-01-26_23:29:41.77132 69.93.246.50: invalid operand: 0000 [#2] 2005-01-26_23:29:41.77138 69.93.246.50: CPU: 0 2005-01-26_23:29:41.77148 69.93.246.50: EIP: 0060:[] Not tainted VLI 2005-01-26_23:29:41.77155 69.93.246.50: EFLAGS: 00010002 (2.6.9) 2005-01-26_23:29:41.77163 69.93.246.50: EIP is at e1000_clean+0xc2/0xcc 2005-01-26_23:29:41.77173 69.93.246.50: eax: 0000002e ebx: 00000287 ecx: 00000000 edx: 07f33012 2005-01-26_23:29:41.77183 69.93.246.50: esi: 00000001 edi: 00000040 ebp: c19b2800 esp: cbd73f44 2005-01-26_23:29:41.77191 69.93.246.50: ds: 007b es: 007b ss: 0068 2005-01-26_23:29:41.77202 69.93.246.50: Process CalcArbs (pid: 26432, threadinfo=cbd72000 task=f695c020) 2005-01-26_23:29:41.77208 69.93.246.50: 2005-01-26_23:29:41.77215 69.93.246.50: Stack: 2005-01-26_23:29:41.77222 69.93.246.50: c19b2a20 2005-01-26_23:29:41.77228 69.93.246.50: cbd73f54 2005-01-26_23:29:41.77235 69.93.246.50: 00000040 2005-01-26_23:29:41.77242 69.93.246.50: c19b2a20 2005-01-26_23:29:41.77248 69.93.246.50: 0000000c 2005-01-26_23:29:41.77255 69.93.246.50: c19b28f8 2005-01-26_23:29:41.77262 69.93.246.50: c19b2800 2005-01-26_23:29:41.77269 69.93.246.50: 0582bf12 2005-01-26_23:29:41.77275 69.93.246.50: 2005-01-26_23:29:41.77282 69.93.246.50: 2005-01-26_23:29:41.77289 69.93.246.50: f7ca8ec0 2005-01-26_23:29:41.77296 69.93.246.50: c024f35a 2005-01-26_23:29:41.77302 69.93.246.50: c19b2800 2005-01-26_23:29:41.77309 69.93.246.50: cbd73f74 2005-01-26_23:29:41.77316 69.93.246.50: 00000120 2005-01-26_23:29:41.77322 69.93.246.50: 00000001 2005-01-26_23:29:41.77329 69.93.246.50: c0386598 2005-01-26_23:29:41.77336 69.93.246.50: 0000000a 2005-01-26_23:29:41.77343 69.93.246.50: 2005-01-26_23:29:41.77349 69.93.246.50: 2005-01-26_23:29:41.77356 69.93.246.50: c0116dda 2005-01-26_23:29:41.77363 69.93.246.50: c0386598 2005-01-26_23:29:41.77370 69.93.246.50: 00000046 2005-01-26_23:29:41.77376 69.93.246.50: 00000580 2005-01-26_23:29:41.77383 69.93.246.50: c031fd80 2005-01-26_23:29:41.77390 69.93.246.50: c0116e09 2005-01-26_23:29:41.77396 69.93.246.50: 0000000b 2005-01-26_23:29:41.77403 69.93.246.50: c0105b8b 2005-01-26_23:29:41.77410 69.93.246.50: 2005-01-26_23:29:41.77417 69.93.246.50: Call Trace: 2005-01-26_23:29:41.77423 69.93.246.50: [] 2005-01-26_23:29:41.77430 69.93.246.50: net_rx_action+0x6a/0xe2 2005-01-26_23:29:41.77437 69.93.246.50: 2005-01-26_23:29:41.77444 69.93.246.50: [] 2005-01-26_23:29:41.77451 69.93.246.50: __do_softirq+0x7e/0x87 2005-01-26_23:29:41.77458 69.93.246.50: 2005-01-26_23:29:41.77465 69.93.246.50: [] 2005-01-26_23:29:41.77471 69.93.246.50: do_softirq+0x26/0x28 2005-01-26_23:29:41.77478 69.93.246.50: 2005-01-26_23:29:41.77485 69.93.246.50: [] 2005-01-26_23:29:41.77492 69.93.246.50: do_IRQ+0xc4/0xdf 2005-01-26_23:29:41.77498 69.93.246.50: 2005-01-26_23:29:41.77505 69.93.246.50: [] 2005-01-26_23:29:41.77513 69.93.246.50: common_interrupt+0x18/0x20 2005-01-26_23:29:41.77519 69.93.246.50: 2005-01-26_23:29:41.77526 69.93.246.50: Code: 2005-01-26_23:29:41.77533 69.93.246.50: 20 2005-01-26_23:29:41.77540 69.93.246.50: 00 2005-01-26_23:29:41.77546 69.93.246.50: c7 2005-01-26_23:29:41.77553 69.93.246.50: 85 2005-01-26_23:29:41.77560 69.93.246.50: f8 2005-01-26_23:29:41.77567 69.93.246.50: 00 2005-01-26_23:29:41.77573 69.93.246.50: 00 2005-01-26_23:29:41.77580 69.93.246.50: 00 2005-01-26_23:29:41.77586 69.93.246.50: 00 2005-01-26_23:29:41.77593 69.93.246.50: 01 2005-01-26_23:29:41.77600 69.93.246.50: 10 2005-01-26_23:29:41.77607 69.93.246.50: 00 2005-01-26_23:29:41.77613 69.93.246.50: 0f 2005-01-26_23:29:41.77620 69.93.246.50: ba 2005-01-26_23:29:41.77627 69.93.246.50: 75 2005-01-26_23:29:41.77633 69.93.246.50: 24 2005-01-26_23:29:41.77640 69.93.246.50: 05 2005-01-26_23:29:41.77647 69.93.246.50: 53 2005-01-26_23:29:41.77654 69.93.246.50: 9d 2005-01-26_23:29:41.77660 69.93.246.50: 8b 2005-01-26_23:29:41.77667 69.93.246.50: 44 2005-01-26_23:29:41.77674 69.93.246.50: 24 2005-01-26_23:29:41.77680 69.93.246.50: 0c 2005-01-26_23:29:41.77687 69.93.246.50: 89 2005-01-26_23:29:41.77694 69.93.246.50: 04 2005-01-26_23:29:41.77701 69.93.246.50: 24 2005-01-26_23:29:41.77707 69.93.246.50: e8 2005-01-26_23:29:41.77714 69.93.246.50: 42 2005-01-26_23:29:41.77721 69.93.246.50: fe 2005-01-26_23:29:41.77727 69.93.246.50: ff 2005-01-26_23:29:41.77734 69.93.246.50: ff 2005-01-26_23:29:41.77741 69.93.246.50: 31 2005-01-26_23:29:41.77748 69.93.246.50: d2 2005-01-26_23:29:41.77754 69.93.246.50: 83 2005-01-26_23:29:41.77761 69.93.246.50: c4 2005-01-26_23:29:41.77768 69.93.246.50: 14 2005-01-26_23:29:41.77774 69.93.246.50: 89 2005-01-26_23:29:41.77781 69.93.246.50: d0 2005-01-26_23:29:41.77788 69.93.246.50: 5b 2005-01-26_23:29:41.77795 69.93.246.50: 5e 2005-01-26_23:29:41.77801 69.93.246.50: 5f 2005-01-26_23:29:41.77808 69.93.246.50: 5d 2005-01-26_23:29:41.77815 69.93.246.50: c3 2005-01-26_23:29:41.77822 69.93.246.50: <0f> 2005-01-26_23:29:41.77828 69.93.246.50: 0b 2005-01-26_23:29:41.77835 69.93.246.50: 6f 2005-01-26_23:29:41.77842 69.93.246.50: 03 2005-01-26_23:29:41.77848 69.93.246.50: a9 2005-01-26_23:29:41.77855 69.93.246.50: f3 2005-01-26_23:29:41.77862 69.93.246.50: 2b 2005-01-26_23:29:41.77869 69.93.246.50: c0 2005-01-26_23:29:41.77875 69.93.246.50: eb 2005-01-26_23:29:41.77882 69.93.246.50: b2 2005-01-26_23:29:41.77889 69.93.246.50: 55 2005-01-26_23:29:41.77895 69.93.246.50: 57 2005-01-26_23:29:41.77902 69.93.246.50: 31 2005-01-26_23:29:41.77909 69.93.246.50: ff 2005-01-26_23:29:41.77916 69.93.246.50: 56 2005-01-26_23:29:41.77922 69.93.246.50: 53 2005-01-26_23:29:41.77929 69.93.246.50: 83 2005-01-26_23:29:41.77936 69.93.246.50: ec 2005-01-26_23:29:41.77943 69.93.246.50: 14 2005-01-26_23:29:41.77949 69.93.246.50: 8b 2005-01-26_23:29:41.77956 69.93.246.50: 44 2005-01-26_23:29:41.77963 69.93.246.50: 2005-01-26_23:29:41.77970 69.93.246.50: 2005-01-26_23:29:41.77980 69.93.246.50: <0>Kernel panic - not syncing: Fatal exception in interrupt 2005-01-26_23:29:41.77986 69.93.246.50: 2005-01-26_23:29:41.77994 69.93.246.50: <0>Rebooting in 60 seconds.. ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. From rddunlap@osdl.org Wed Jan 26 17:55:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 17:55:59 -0800 (PST) Received: from fire-1.osdl.org (fire.osdl.org [65.172.181.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0R1tsU8000790 for ; Wed, 26 Jan 2005 17:55:54 -0800 Received: from [172.20.1.49] (fw.osdl.org [65.172.181.6]) (authenticated bits=0) by fire-1.osdl.org (8.12.8/8.12.8) with ESMTP id j0R1nSTW003888 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Wed, 26 Jan 2005 17:49:29 -0800 Message-ID: <41F84605.5060501@osdl.org> Date: Wed, 26 Jan 2005 17:38:13 -0800 From: "Randy.Dunlap" Organization: OSDL User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 CC: jgarzik@pobox.com, jt@hpl.hp.com, netdev@oss.sgi.com Subject: [PATCH] (v2) arlan: remove gcc warning with CONFIG_PROC_FS=n References: <41F7369E.8070704@osdl.org> In-Reply-To: <41F7369E.8070704@osdl.org> Content-Type: multipart/mixed; boundary="------------060609060002030406070208" X-MIMEDefang-Filter: osdl$Revision: 1.101 $ X-Scanned-By: MIMEDefang 2.36 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 839 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 1414 Lines: 46 This is a multi-part message in MIME format. --------------060609060002030406070208 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Here's an update (as pointed out off-list). Please replace the first one if that works for you. arlan: Fix gcc warning. With CONFIG_PROC_FS=n, gcc complains: drivers/net/wireless/arlan-main.c:1858: warning: statement with no effect Also remove a useless semi-colon on a #define. Signed-off-by: Randy Dunlap diffstat:= drivers/net/wireless/arlan.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) --------------060609060002030406070208 Content-Type: text/x-patch; name="arlan_procfs2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="arlan_procfs2.patch" diff -Naurp ./drivers/net/wireless/arlan.h~arlan_procfs ./drivers/net/wireless/arlan.h --- ./drivers/net/wireless/arlan.h~arlan_procfs 2005-01-24 13:00:20.000000000 -0800 +++ ./drivers/net/wireless/arlan.h 2005-01-26 13:58:02.797111176 -0800 @@ -43,8 +43,8 @@ extern int init_arlan_proc(void); extern void cleanup_arlan_proc(void); #else -#define init_arlan_proc() (0) -#define cleanup_arlan_proc() do { } while (0); +#define init_arlan_proc() ({ 0; }) +#define cleanup_arlan_proc() do { } while (0) #endif extern struct net_device *arlan_device[MAX_ARLANS]; --------------060609060002030406070208-- From kaber@trash.net Wed Jan 26 18:44:23 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 18:44:30 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0R2iM5F006675 for ; Wed, 26 Jan 2005 18:44:22 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.43) id 1Ctzdn-000368-Ii; Thu, 27 Jan 2005 03:44:15 +0100 Message-ID: <41F8557F.90305@trash.net> Date: Thu, 27 Jan 2005 03:44:15 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050106 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com Subject: [PATCH 2.4]: keep fragment queues private to each user References: <41F5D1CB.9050804@trash.net> <20050125214158.4be3798c.davem@davemloft.net> <41F82830.9010009@trash.net> In-Reply-To: <41F82830.9010009@trash.net> Content-Type: multipart/mixed; boundary="------------040607000208010700090105" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 840 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 11295 Lines: 381 This is a multi-part message in MIME format. --------------040607000208010700090105 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 2.4 backport of the ip_defrag fix. --------------040607000208010700090105 Content-Type: text/plain; name="x" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="x" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/27 03:42:30+01:00 kaber@coreworks.de # [IPV4]: Keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # # net/netsyms.c # 2005/01/27 03:42:28+01:00 kaber@coreworks.de +0 -1 # [IPV4]: Keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # # net/ipv4/netfilter/ip_nat_standalone.c # 2005/01/27 03:42:28+01:00 kaber@coreworks.de +1 -1 # [IPV4]: Keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # # net/ipv4/netfilter/ip_conntrack_standalone.c # 2005/01/27 03:42:28+01:00 kaber@coreworks.de +0 -7 # [IPV4]: Keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # # net/ipv4/netfilter/ip_conntrack_core.c # 2005/01/27 03:42:28+01:00 kaber@coreworks.de +6 -10 # [IPV4]: Keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # # net/ipv4/ipvs/ip_vs_core.c # 2005/01/27 03:42:28+01:00 kaber@coreworks.de +3 -3 # [IPV4]: Keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # # net/ipv4/ip_input.c # 2005/01/27 03:42:28+01:00 kaber@coreworks.de +2 -2 # [IPV4]: Keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # # net/ipv4/ip_fragment.c # 2005/01/27 03:42:28+01:00 kaber@coreworks.de +13 -19 # [IPV4]: Keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # # include/net/ip.h # 2005/01/27 03:42:28+01:00 kaber@coreworks.de +13 -3 # [IPV4]: Keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # # include/linux/netfilter_ipv4/ip_conntrack.h # 2005/01/27 03:42:28+01:00 kaber@coreworks.de +1 -2 # [IPV4]: Keep fragment queues private to each user # # Signed-off-by: Patrick McHardy # diff -Nru a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h --- a/include/linux/netfilter_ipv4/ip_conntrack.h 2005-01-27 03:42:45 +01:00 +++ b/include/linux/netfilter_ipv4/ip_conntrack.h 2005-01-27 03:42:45 +01:00 @@ -249,10 +249,9 @@ /* Call me when a conntrack is destroyed. */ extern void (*ip_conntrack_destroyed)(struct ip_conntrack *conntrack); -extern int ip_ct_no_defrag; /* Returns new sk_buff, or NULL */ struct sk_buff * -ip_ct_gather_frags(struct sk_buff *skb); +ip_ct_gather_frags(struct sk_buff *skb, u_int32_t user); /* Delete all conntracks which match. */ extern void diff -Nru a/include/net/ip.h b/include/net/ip.h --- a/include/net/ip.h 2005-01-27 03:42:45 +01:00 +++ b/include/net/ip.h 2005-01-27 03:42:45 +01:00 @@ -227,9 +227,19 @@ /* * Functions provided by ip_fragment.o */ - -struct sk_buff *ip_defrag(struct sk_buff *skb); -extern void ipfrag_flush(void); + +enum ip_defrag_users +{ + IP_DEFRAG_LOCAL_DELIVER, + IP_DEFRAG_CALL_RA_CHAIN, + IP_DEFRAG_CONNTRACK_IN, + IP_DEFRAG_CONNTRACK_OUT, + IP_DEFRAG_NAT_OUT, + IP_DEFRAG_VS_OUT, + IP_DEFRAG_VS_FWD +}; + +struct sk_buff *ip_defrag(struct sk_buff *skb, u32 user); extern int ip_frag_nqueues; extern atomic_t ip_frag_mem; diff -Nru a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c --- a/net/ipv4/ip_fragment.c 2005-01-27 03:42:45 +01:00 +++ b/net/ipv4/ip_fragment.c 2005-01-27 03:42:45 +01:00 @@ -72,6 +72,7 @@ struct ipq { struct ipq *next; /* linked list pointers */ struct list_head lru_list; /* lru list member */ + u32 user; u32 saddr; u32 daddr; u16 id; @@ -242,13 +243,13 @@ /* Memory limiting on fragments. Evictor trashes the oldest * fragment queue until we are back under the threshold. */ -static void __ip_evictor(int threshold) +static void ip_evictor(void) { struct ipq *qp; struct list_head *tmp; int work; - work = atomic_read(&ip_frag_mem) - threshold; + work = atomic_read(&ip_frag_mem) - sysctl_ipfrag_low_thresh; if (work <= 0) return; @@ -273,11 +274,6 @@ } } -static inline void ip_evictor(void) -{ - __ip_evictor(sysctl_ipfrag_low_thresh); -} - /* * Oops, a fragment queue timed out. Kill it and send an ICMP reply. */ @@ -324,7 +320,8 @@ if(qp->id == qp_in->id && qp->saddr == qp_in->saddr && qp->daddr == qp_in->daddr && - qp->protocol == qp_in->protocol) { + qp->protocol == qp_in->protocol && + qp->user == qp_in->user) { atomic_inc(&qp->refcnt); write_unlock(&ipfrag_lock); qp_in->last_in |= COMPLETE; @@ -351,7 +348,7 @@ } /* Add an entry to the 'ipq' queue for a newly received IP datagram. */ -static struct ipq *ip_frag_create(unsigned hash, struct iphdr *iph) +static struct ipq *ip_frag_create(unsigned hash, struct iphdr *iph, u32 user) { struct ipq *qp; @@ -363,6 +360,7 @@ qp->id = iph->id; qp->saddr = iph->saddr; qp->daddr = iph->daddr; + qp->user = user; qp->len = 0; qp->meat = 0; qp->fragments = NULL; @@ -385,7 +383,7 @@ /* Find the correct entry in the "incomplete datagrams" queue for * this IP datagram, and create new one, if nothing is found. */ -static inline struct ipq *ip_find(struct iphdr *iph) +static inline struct ipq *ip_find(struct iphdr *iph, u32 user) { __u16 id = iph->id; __u32 saddr = iph->saddr; @@ -399,7 +397,8 @@ if(qp->id == id && qp->saddr == saddr && qp->daddr == daddr && - qp->protocol == protocol) { + qp->protocol == protocol && + qp->user == user) { atomic_inc(&qp->refcnt); read_unlock(&ipfrag_lock); return qp; @@ -407,7 +406,7 @@ } read_unlock(&ipfrag_lock); - return ip_frag_create(hash, iph); + return ip_frag_create(hash, iph, user); } /* Add new segment to existing queue. */ @@ -641,7 +640,7 @@ } /* Process an incoming IP datagram fragment. */ -struct sk_buff *ip_defrag(struct sk_buff *skb) +struct sk_buff *ip_defrag(struct sk_buff *skb, u32 user) { struct iphdr *iph = skb->nh.iph; struct ipq *qp; @@ -656,7 +655,7 @@ dev = skb->dev; /* Lookup (or create) queue header */ - if ((qp = ip_find(iph)) != NULL) { + if ((qp = ip_find(iph, user)) != NULL) { struct sk_buff *ret = NULL; spin_lock(&qp->lock); @@ -686,9 +685,4 @@ ipfrag_secret_timer.function = ipfrag_secret_rebuild; ipfrag_secret_timer.expires = jiffies + sysctl_ipfrag_secret_interval; add_timer(&ipfrag_secret_timer); -} - -void ipfrag_flush(void) -{ - __ip_evictor(0); } diff -Nru a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c --- a/net/ipv4/ip_input.c 2005-01-27 03:42:44 +01:00 +++ b/net/ipv4/ip_input.c 2005-01-27 03:42:44 +01:00 @@ -170,7 +170,7 @@ && ((sk->bound_dev_if == 0) || (sk->bound_dev_if == skb->dev->ifindex))) { if (skb->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) { - skb = ip_defrag(skb); + skb = ip_defrag(skb, IP_DEFRAG_CALL_RA_CHAIN); if (skb == NULL) { read_unlock(&ip_ra_lock); return 1; @@ -291,7 +291,7 @@ */ if (skb->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) { - skb = ip_defrag(skb); + skb = ip_defrag(skb, IP_DEFRAG_LOCAL_DELIVER); if (!skb) return 0; } diff -Nru a/net/ipv4/ipvs/ip_vs_core.c b/net/ipv4/ipvs/ip_vs_core.c --- a/net/ipv4/ipvs/ip_vs_core.c 2005-01-27 03:42:44 +01:00 +++ b/net/ipv4/ipvs/ip_vs_core.c 2005-01-27 03:42:44 +01:00 @@ -506,7 +506,7 @@ /* reassemble IP fragments, but will it happen in ICMP packets?? */ if (skb->nh.iph->frag_off & __constant_htons(IP_MF|IP_OFFSET)) { - skb = ip_defrag(skb); + skb = ip_defrag(skb, IP_DEFRAG_VS_OUT); if (!skb) return NF_STOLEN; *skb_p = skb; @@ -658,7 +658,7 @@ /* reassemble IP fragments */ if (iph->frag_off & __constant_htons(IP_MF|IP_OFFSET)) { - skb = ip_defrag(skb); + skb = ip_defrag(skb, IP_DEFRAG_VS_OUT); if (!skb) return NF_STOLEN; iph = skb->nh.iph; @@ -1164,7 +1164,7 @@ return NF_ACCEPT; if (iph->frag_off & __constant_htons(IP_MF|IP_OFFSET)) { - skb = ip_defrag(skb); + skb = ip_defrag(skb, IP_DEFRAG_VS_FWD); if (!skb) return NF_STOLEN; *skb_p = skb; diff -Nru a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c --- a/net/ipv4/netfilter/ip_conntrack_core.c 2005-01-27 03:42:44 +01:00 +++ b/net/ipv4/netfilter/ip_conntrack_core.c 2005-01-27 03:42:44 +01:00 @@ -834,7 +834,10 @@ /* Gather fragments. */ if ((*pskb)->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) { - *pskb = ip_ct_gather_frags(*pskb); + *pskb = ip_ct_gather_frags(*pskb, + hooknum == NF_IP_PRE_ROUTING ? + IP_DEFRAG_CONNTRACK_IN : + IP_DEFRAG_CONNTRACK_OUT); if (!*pskb) return NF_STOLEN; } @@ -1183,29 +1186,22 @@ WRITE_UNLOCK(&ip_conntrack_lock); } -int ip_ct_no_defrag; - /* Returns new sk_buff, or NULL */ struct sk_buff * -ip_ct_gather_frags(struct sk_buff *skb) +ip_ct_gather_frags(struct sk_buff *skb, u_int32_t user) { struct sock *sk = skb->sk; #ifdef CONFIG_NETFILTER_DEBUG unsigned int olddebug = skb->nf_debug; #endif - if (unlikely(ip_ct_no_defrag)) { - kfree_skb(skb); - return NULL; - } - if (sk) { sock_hold(sk); skb_orphan(skb); } local_bh_disable(); - skb = ip_defrag(skb); + skb = ip_defrag(skb, user); local_bh_enable(); if (!skb) { diff -Nru a/net/ipv4/netfilter/ip_conntrack_standalone.c b/net/ipv4/netfilter/ip_conntrack_standalone.c --- a/net/ipv4/netfilter/ip_conntrack_standalone.c 2005-01-27 03:42:45 +01:00 +++ b/net/ipv4/netfilter/ip_conntrack_standalone.c 2005-01-27 03:42:45 +01:00 @@ -393,13 +393,6 @@ cleanup_inandlocalops: nf_unregister_hook(&ip_conntrack_local_out_ops); cleanup_inops: - /* Frag queues may hold fragments with skb->dst == NULL */ - ip_ct_no_defrag = 1; - local_bh_disable(); - br_write_lock(BR_NETPROTO_LOCK); - br_write_unlock(BR_NETPROTO_LOCK); - ipfrag_flush(); - local_bh_enable(); nf_unregister_hook(&ip_conntrack_in_ops); cleanup_proc: proc_net_remove("ip_conntrack"); diff -Nru a/net/ipv4/netfilter/ip_nat_standalone.c b/net/ipv4/netfilter/ip_nat_standalone.c --- a/net/ipv4/netfilter/ip_nat_standalone.c 2005-01-27 03:42:45 +01:00 +++ b/net/ipv4/netfilter/ip_nat_standalone.c 2005-01-27 03:42:45 +01:00 @@ -201,7 +201,7 @@ I'm starting to have nightmares about fragments. */ if ((*pskb)->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) { - *pskb = ip_ct_gather_frags(*pskb); + *pskb = ip_ct_gather_frags(*pskb, IP_DEFRAG_NAT_OUT); if (!*pskb) return NF_STOLEN; diff -Nru a/net/netsyms.c b/net/netsyms.c --- a/net/netsyms.c 2005-01-27 03:42:45 +01:00 +++ b/net/netsyms.c 2005-01-27 03:42:45 +01:00 @@ -287,7 +287,6 @@ EXPORT_SYMBOL(inetdev_by_index); EXPORT_SYMBOL(in_dev_finish_destroy); EXPORT_SYMBOL(ip_defrag); -EXPORT_SYMBOL(ipfrag_flush); /* Route manipulation */ EXPORT_SYMBOL(ip_rt_ioctl); --------------040607000208010700090105-- From david@davidcoulson.net Wed Jan 26 19:01:41 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 19:01:46 -0800 (PST) Received: from mail.mx.davidcoulson.net (ns1.openconsultancy.com [207.166.203.131]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0R31eC7007788 for ; Wed, 26 Jan 2005 19:01:41 -0800 Received: (qmail 13050 invoked for bounce); 27 Jan 2005 03:01:34 +0000 Received: from unknown (HELO mx3.openconsultancy.com) (qmailr@10.2.0.36) by tailtiu.dmz.davidcoulson.net (qmail 1.03-djc-2) with SMTP; 27 Jan 2005 03:01:34 +0000 Received: (qmail 16229 invoked from network); 27 Jan 2005 03:01:33 -0000 Received: from unknown (HELO ?10.2.3.172?) (10.2.3.172) by vlan-102.core.davidcoulson.net with SMTP; 27 Jan 2005 03:01:33 -0000 Message-ID: <41F8598D.4070400@davidcoulson.net> Date: Wed, 26 Jan 2005 22:01:33 -0500 From: David Coulson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: EIP is at find_busiest_group+0xc9/0x310 (2.6.11-rc1-bk8) X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 841 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: david@davidcoulson.net Precedence: bulk X-list: netdev Content-Length: 2686 Lines: 70 Same kernel I've been working with for the last week, with Herbert's checksum patch (Thanks for that, BTW :). Not sure if this is a network issue, since the problem is in apic.c, but since it was all network functions prior, I figured something kicked it off. I found an apparent patch for find_busiest_group, but it didn't make it into the mainline in six months, so I assume it's either wrong, broke, or the implementation is whacked. stack segment: 0000 [#1] SMP CPU: 0 EIP: 0060:[] Not tainted VLI EFLAGS: 00010246 (2.6.11-rc1-bk8) EIP is at find_busiest_group+0xc9/0x310 eax: c8000980 ebx: c8000980 ecx: ded227ff edx: c89c3680 esi: dd89d000 edi: c0314b40 ebp: 00000002 esp: c04bddbc ds: 007b es: 007b ss: 0068 Process swapper (pid: 0, threadinfo=c04bc000 task=c0408b60) Stack: c0314b69 c8000980 c038800a ded22800 c047e5e0 c04bde20 c0542650 80000000 c02f0512 dd89d000 c0314b40 00000002 c04bde1c c79e4810 00000002 00000002 c0314b40 c02f0818 ded22800 dd89d000 c04bde20 c0314b40 80000000 00000000 Call Trace: [] ip_forward_finish+0x29/0x50 [] ip_sabotage_out+0x10a/0x180 [] nf_iterate+0x72/0xb0 [] ip_forward_finish+0x0/0x50 [] ip_forward_finish+0x0/0x50 [] nf_hook_slow+0x68/0xf0 [] ip_forward_finish+0x0/0x50 [] ip_forward+0x1bc/0x280 [] ip_forward_finish+0x0/0x50 [] ip_rcv_finish+0x1f8/0x270 [] br_nf_pre_routing_finish+0x0/0x290 [] br_nf_pre_routing+0x24b/0x3f0 [] br_nf_pre_routing_finish+0x0/0x290 [] ip_sabotage_in+0x1c/0x30 [] nf_iterate+0x72/0xb0 [] ip_rcv_finish+0x0/0x270 [] ip_rcv_finish+0x0/0x270 [] nf_hook_slow+0x68/0xf0 [] ip_rcv_finish+0x0/0x270 [] ip_rcv+0x3ec/0x4b0 [] ip_rcv_finish+0x0/0x270 [] br_handle_frame_finish+0x0/0xf0 [] netif_receive_skb+0x20d/0x2b0 [] process_backlog+0x86/0x120 [] net_rx_action+0x7f/0x110 [] __do_softirq+0xb6/0xd0 [] do_softirq+0x2d/0x30 [] do_IRQ+0x1e/0x30 [] common_interrupt+0x1a/0x20 [] default_idle+0x23/0x30 [] cpu_idle+0x5f/0x70 [] start_kernel+0x13f/0x160 [] unknown_bootoption+0x0/0x1c0 Code: 26 00 8b 45 c4 85 c0 0f 84 35 02 00 00 8b 3c 8d 20 30 51 c0 b8 c0 e0 50 c0 01 f8 8b 50 04 8b 40 08 c1 e2 07 39 c2 0f 43 c2 ff 45 41 01 c6 ba 08 00 00 00 89 d8 e8 27 51 0e 00 83 f8 09 ba 08 <0>Kernel panic - not syncing: Fatal exception in interrupt David From kazunori@miyazawa.org Wed Jan 26 20:52:41 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 20:52:50 -0800 (PST) Received: from miyazawa.org (usen-221x116x13x66.ap-US01.usen.ad.jp [221.116.13.66]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0R4qcHf015896 for ; Wed, 26 Jan 2005 20:52:39 -0800 Received: from [IPv6:2001:200:182:2000:f85f:fbd:dadc:86c4] ([2001:200:182:2000:f85f:fbd:dadc:86c4]) (AUTH: LOGIN kazunori, SSL: TLSv1/SSLv3,256bits,AES256-SHA) by miyazawa.org with esmtp; Thu, 27 Jan 2005 13:52:23 +0900 id 00007DA8.41F87387.000040F7 Message-ID: <41F87368.7060909@miyazawa.org> Date: Thu, 27 Jan 2005 13:51:52 +0900 From: Kazunori Miyazawa User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: ja, en-us, en MIME-Version: 1.0 To: Herbert Xu CC: davem@davemloft.net, netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: Re: [PATCH][IPsec] fix process of error from crypto module References: In-Reply-To: Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 842 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kazunori@miyazawa.org Precedence: bulk X-list: netdev Content-Length: 2533 Lines: 83 Herbert Xu wrote: > MIYAZAWA Kazunori wrote: > >>This patch fixes the process under the case that the crypto module >>returns error because of its weak keys or etc. > > > Good catch. > > >>diff -ur a/net/ipv6/esp6.c b/net/ipv6/esp6.c >>--- a/net/ipv6/esp6.c 2004-12-25 06:35:01.000000000 +0900 >>+++ b/net/ipv6/esp6.c 2005-01-26 18:57:04.000000000 +0900 >>@@ -364,7 +364,8 @@ >> goto error; >> get_random_bytes(esp->conf.ivec, esp->conf.ivlen); >> } >>- crypto_cipher_setkey(esp->conf.tfm, esp->conf.key, esp->conf.key_len); >>+ if (crypto_cipher_setkey(esp->conf.tfm, esp->conf.key, esp->conf.key_len)) >>+ goto error; >> x->props.header_len = sizeof(struct ipv6_esp_hdr) + esp->conf.ivlen; >> if (x->props.mode) >> x->props.header_len += sizeof(struct ipv6hdr); > > > You need to free esp->conf.ivec here. > > Cheers, Thank you for your check, Herbert. I send the fixed patch. BTW, esp6_destroy seem to be similar to esp_destroy. Should we export esp_destroy and IPv4 and IPv6 use it? Do we have any reason to define the functions separately? diff -ruN a/net/ipv4/esp4.c b/net/ipv4/esp4.c --- a/net/ipv4/esp4.c 2004-12-25 06:34:58.000000000 +0900 +++ b/net/ipv4/esp4.c 2005-01-26 18:57:18.000000000 +0900 @@ -427,7 +427,8 @@ goto error; get_random_bytes(esp->conf.ivec, esp->conf.ivlen); } - crypto_cipher_setkey(esp->conf.tfm, esp->conf.key, esp->conf.key_len); + if (crypto_cipher_setkey(esp->conf.tfm, esp->conf.key, esp->conf.key_len)) + goto error; x->props.header_len = sizeof(struct ip_esp_hdr) + esp->conf.ivlen; if (x->props.mode) x->props.header_len += sizeof(struct iphdr); diff -ruN a/net/ipv6/esp6.c b/net/ipv6/esp6.c --- a/net/ipv6/esp6.c 2004-12-25 06:35:01.000000000 +0900 +++ b/net/ipv6/esp6.c 2005-01-27 00:55:34.000000000 +0900 @@ -364,7 +364,8 @@ goto error; get_random_bytes(esp->conf.ivec, esp->conf.ivlen); } - crypto_cipher_setkey(esp->conf.tfm, esp->conf.key, esp->conf.key_len); + if (crypto_cipher_setkey(esp->conf.tfm, esp->conf.key, esp->conf.key_len)) + goto error; x->props.header_len = sizeof(struct ipv6_esp_hdr) + esp->conf.ivlen; if (x->props.mode) x->props.header_len += sizeof(struct ipv6hdr); @@ -372,15 +373,9 @@ return 0; error: - if (esp) { - if (esp->auth.tfm) - crypto_free_tfm(esp->auth.tfm); - if (esp->auth.work_icv) - kfree(esp->auth.work_icv); - if (esp->conf.tfm) - crypto_free_tfm(esp->conf.tfm); - kfree(esp); - } + x->data = esp; + esp6_destroy(x); + x->data = NULL; return -EINVAL; } From herbert@gondor.apana.org.au Wed Jan 26 21:21:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 21:21:57 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0R5LlJq017428 for ; Wed, 26 Jan 2005 21:21:48 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1Cu25u-0006Jt-00; Thu, 27 Jan 2005 16:21:26 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1Cu25S-0000as-00; Thu, 27 Jan 2005 16:20:58 +1100 Date: Thu, 27 Jan 2005 16:20:58 +1100 To: Kazunori Miyazawa Cc: davem@davemloft.net, netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: Re: [PATCH][IPsec] fix process of error from crypto module Message-ID: <20050127052058.GB2060@gondor.apana.org.au> References: <41F87368.7060909@miyazawa.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F87368.7060909@miyazawa.org> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 843 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 662 Lines: 18 On Thu, Jan 27, 2005 at 01:51:52PM +0900, Kazunori Miyazawa wrote: > > BTW, esp6_destroy seem to be similar to esp_destroy. > Should we export esp_destroy and IPv4 and IPv6 use it? > Do we have any reason to define the functions separately? esp_destroy is certainly not the only function that can be merged. One of my dreams is to abstract out the family-dependent code from ah/esp/ipcomp so that we can have a family-independent code base. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From davem@davemloft.net Wed Jan 26 22:25:29 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 22:25:35 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0R6PSXV019543 for ; Wed, 26 Jan 2005 22:25:28 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cu31A-0000wZ-00; Wed, 26 Jan 2005 22:20:36 -0800 Date: Wed, 26 Jan 2005 22:20:35 -0800 From: "David S. Miller" To: Herbert Xu Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [ATM] Fix flags type in lec_arp_expire_vcc Message-Id: <20050126222035.715ec67e.davem@davemloft.net> In-Reply-To: <20050126233820.GA24422@gondor.apana.org.au> References: <20050126233820.GA24422@gondor.apana.org.au> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 844 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 306 Lines: 10 On Thu, 27 Jan 2005 10:38:20 +1100 Herbert Xu wrote: > The variable flags in lec_arp_expire_vcc should be of type > unsigned long and not unsigned. The following patch fixes > that typo. > > Signed-off-by: Herbert Xu Applied, thanks Herbert. From davem@davemloft.net Wed Jan 26 22:34:05 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 22:34:11 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0R6Y5G7020244 for ; Wed, 26 Jan 2005 22:34:05 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cu3AC-0000zQ-00; Wed, 26 Jan 2005 22:29:56 -0800 Date: Wed, 26 Jan 2005 22:29:55 -0800 From: "David S. Miller" To: Patrick McHardy Cc: netdev@oss.sgi.com Subject: Re: [PATCH 2.6]: keep fragment queues private to each user Message-Id: <20050126222955.729c390b.davem@davemloft.net> In-Reply-To: <41F82830.9010009@trash.net> References: <41F5D1CB.9050804@trash.net> <20050125214158.4be3798c.davem@davemloft.net> <41F82830.9010009@trash.net> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 845 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 379 Lines: 10 On Thu, 27 Jan 2005 00:30:56 +0100 Patrick McHardy wrote: > Sorry, new patch attached. I'll send the 2.4 patch later tonight. Thanks. I'll apply this and the 2.4.x variant. Although I have a theoretical objection to this thing. It is extending a namespace we have no such control over. The namespace is saddr/daddr/ID. But perhaps I'm being overly anal. From davem@davemloft.net Wed Jan 26 22:37:06 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 22:37:13 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0R6b585020755 for ; Wed, 26 Jan 2005 22:37:05 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cu3Cx-0000zi-00; Wed, 26 Jan 2005 22:32:47 -0800 Date: Wed, 26 Jan 2005 22:32:47 -0800 From: "David S. Miller" To: Lennert Buytenhek Cc: shemminger@osdl.org, roland@topspin.com, hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [PATCH]: was Re: LLTX and netif_stop_queue Message-Id: <20050126223247.3e4643cc.davem@davemloft.net> In-Reply-To: <20050126132512.GA18220@xi.wantstofly.org> References: <20050103171227.GD7370@esmail.cup.hp.com> <1104812294.1085.53.camel@jzny.localdomain> <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119164640.6c67bdfa.davem@davemloft.net> <52r7kgu5n5.fsf@topspin.com> <20050119230526.393a5184.davem@davemloft.net> <20050120085611.33f9485e@dxpl.pdx.osdl.net> <20050121105452.GA12988@xi.wantstofly.org> <20050125222705.1ee878fd.davem@davemloft.net> <20050126132512.GA18220@xi.wantstofly.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 846 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 667 Lines: 16 On Wed, 26 Jan 2005 14:25:12 +0100 Lennert Buytenhek wrote: > I've thought about this a bit, and the only sane way of doing recursion > detection that doesn't involve 'struct net_device' would be to keep track > of the recursion depth (perhaps per-CPU as you suggest) and tossing the > packet when it exceeds some random value, right? Yes, that's the idea. > To reproduce the current behaviour more closely you'd have to keep a > small per-CPU array of 'struct net_device *' pointers as a kind of > recursion stack, and toss the packet when you hit a net_device that's > already on the list. But that seems like slight overkill. Indeed. From davem@davemloft.net Wed Jan 26 22:47:59 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 22:48:04 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0R6lxee021509 for ; Wed, 26 Jan 2005 22:47:59 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cu3ND-00012b-00; Wed, 26 Jan 2005 22:43:23 -0800 Date: Wed, 26 Jan 2005 22:43:22 -0800 From: "David S. Miller" To: Kazunori Miyazawa Cc: herbert@gondor.apana.org.au, netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: Re: [PATCH][IPsec] fix process of error from crypto module Message-Id: <20050126224322.1feda79b.davem@davemloft.net> In-Reply-To: <41F87368.7060909@miyazawa.org> References: <41F87368.7060909@miyazawa.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 847 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 188 Lines: 7 On Thu, 27 Jan 2005 13:51:52 +0900 Kazunori Miyazawa wrote: > Thank you for your check, Herbert. > I send the fixed patch. Patch applied, thank you Miyazawa-san. From ak@suse.de Wed Jan 26 23:17:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 23:17:10 -0800 (PST) Received: from Cantor.suse.de (news.suse.de [195.135.220.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0R7H3x0023060 for ; Wed, 26 Jan 2005 23:17:04 -0800 Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id E7F4A13B69B3; Thu, 27 Jan 2005 08:16:57 +0100 (CET) Date: Thu, 27 Jan 2005 08:16:45 +0100 From: Andi Kleen To: "David S. Miller" Cc: Lennert Buytenhek , shemminger@osdl.org, roland@topspin.com, hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [PATCH]: was Re: LLTX and netif_stop_queue Message-ID: <20050127071645.GA2731@wotan.suse.de> References: <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119164640.6c67bdfa.davem@davemloft.net> <52r7kgu5n5.fsf@topspin.com> <20050119230526.393a5184.davem@davemloft.net> <20050120085611.33f9485e@dxpl.pdx.osdl.net> <20050121105452.GA12988@xi.wantstofly.org> <20050125222705.1ee878fd.davem@davemloft.net> <20050126132512.GA18220@xi.wantstofly.org> <20050126223247.3e4643cc.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050126223247.3e4643cc.davem@davemloft.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 848 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@suse.de Precedence: bulk X-list: netdev Content-Length: 595 Lines: 17 On Wed, Jan 26, 2005 at 10:32:47PM -0800, David S. Miller wrote: > On Wed, 26 Jan 2005 14:25:12 +0100 > Lennert Buytenhek wrote: > > > I've thought about this a bit, and the only sane way of doing recursion > > detection that doesn't involve 'struct net_device' would be to keep track > > of the recursion depth (perhaps per-CPU as you suggest) and tossing the > > packet when it exceeds some random value, right? > > Yes, that's the idea. per CPU only works in preemptive kernel if you have preemption disabled all the time. Do you? Seems not likely to me. -Andi From davem@davemloft.net Wed Jan 26 23:22:17 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 23:22:21 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0R7MGcq023665 for ; Wed, 26 Jan 2005 23:22:17 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cu3uj-00019A-00; Wed, 26 Jan 2005 23:18:01 -0800 Date: Wed, 26 Jan 2005 23:18:01 -0800 From: "David S. Miller" To: Patrick McHardy Cc: bdschuym@pandora.be, netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org, snort2004@mail.ru, rusty@rustcorp.com.au, ak@suse.de, bridge@osdl.org, gandalf@wlug.westbo.se, dwmw2@infradead.org, shemminger@osdl.org Subject: Re: [PATCH/RFC] Reduce call chain length in netfilter Message-Id: <20050126231801.7bf90338.davem@davemloft.net> In-Reply-To: <41F82C6D.7020006@trash.net> References: <1131604877.20041218092730@mail.ru.suse.lists.linux.kernel> <1105117559.11753.34.camel@baythorne.infradead.org> <20050107100017.454ddadc@dxpl.pdx.osdl.net> <1105133241.3375.16.camel@localhost.localdomain> <20050118135735.4b77d38d.davem@davemloft.net> <1106433059.4486.11.camel@localhost.localdomain> <1106436153.20995.42.camel@tux.rsn.bth.se> <1106484019.3376.5.camel@localhost.localdomain> <1106496509.1085.1.camel@tux.rsn.bth.se> <20050125220558.6e824f8a.davem@davemloft.net> <1106730510.4041.4.camel@localhost.localdomain> <41F82C6D.7020006@trash.net> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 849 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 1594 Lines: 51 On Thu, 27 Jan 2005 00:49:01 +0100 Patrick McHardy wrote: > Bart De Schuymer wrote: > > >Does anyone have objections to this patch, which reduces the netfilter > >call chain length? > > > Looks fine to me. > > Signed-off-by: Patrick McHardy Ok, I applied this. While reviewing I thought it may be an issue that the new macros potentially change skb. It really isn't an issue because NF_HOOK() calls pass ownership of the SKB over from the caller. Although technically, someone could go: skb_get(skb); err = NF_HOOK(... skb ...); ... do stuff with skb ... kfree_skb(skb); but that would cause other problems and I audited the entire tree and nobody attempts anything like this currently. 'skb' always dies at the NF_HOOK() call site. I guess if we wanted to preserve NF_HOOK*() semantics even in such a case we could use a local "__skb" var in the macro's basic block. Another huge downside to this change I was worried about was from a code generation point of view. Since we now take the address of "skb", gcc cannot generate tail-calls for the common case of: return NF_HOOK(...); when netfilter is enabled. Ho hum... Wait... This is actually an important point! Since gcc is generating a tail- call for NF_HOOK() today, there is no stack savings for NF_HOOK() created by this patch. The only real gain is the NF_STOP stuff for bridge netfilter. I'm backing this out of my tree, let's think about this some more. Perhaps it's only worth adding the NF_STOP thing and just making nf_hook_slow() do the okfn(skb); call in that case? From davem@davemloft.net Wed Jan 26 23:26:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 23:26:52 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0R7Qkd2024192 for ; Wed, 26 Jan 2005 23:26:46 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cu3z2-0001An-00; Wed, 26 Jan 2005 23:22:28 -0800 Date: Wed, 26 Jan 2005 23:22:27 -0800 From: "David S. Miller" To: Andi Kleen Cc: buytenh@wantstofly.org, shemminger@osdl.org, roland@topspin.com, hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, netdev@oss.sgi.com, ak@suse.de, openib-general@openib.org, kaber@trash.net Subject: Re: [PATCH]: was Re: LLTX and netif_stop_queue Message-Id: <20050126232227.3ce4decb.davem@davemloft.net> In-Reply-To: <20050127071645.GA2731@wotan.suse.de> References: <20050119144711.3fdd3d93.davem@davemloft.net> <20050119151853.259de49a@dxpl.pdx.osdl.net> <20050119164640.6c67bdfa.davem@davemloft.net> <52r7kgu5n5.fsf@topspin.com> <20050119230526.393a5184.davem@davemloft.net> <20050120085611.33f9485e@dxpl.pdx.osdl.net> <20050121105452.GA12988@xi.wantstofly.org> <20050125222705.1ee878fd.davem@davemloft.net> <20050126132512.GA18220@xi.wantstofly.org> <20050126223247.3e4643cc.davem@davemloft.net> <20050127071645.GA2731@wotan.suse.de> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 850 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 436 Lines: 16 On Thu, 27 Jan 2005 08:16:45 +0100 Andi Kleen wrote: > > Yes, that's the idea. > > per CPU only works in preemptive kernel if you have preemption > disabled all the time. Do you? > > Seems not likely to me. BH is disabled in these code paths (specifically we're talking about ->hard_start_xmit()), as that is where the recursion check goes. Otherwise, loopback's LLTX is broken as it relies on this property as well. From davem@davemloft.net Wed Jan 26 23:35:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 23:36:01 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0R7ZsJm024938 for ; Wed, 26 Jan 2005 23:35:54 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cu47v-0001D2-00; Wed, 26 Jan 2005 23:31:39 -0800 Date: Wed, 26 Jan 2005 23:31:39 -0800 From: "David S. Miller" To: chas@cmf.nrl.navy.mil Cc: netdev@oss.sgi.com Subject: Re: [PATCH 5 of 5][ATM]: replace schedule_timeout() with msleep() Message-Id: <20050126233139.23aa972f.davem@davemloft.net> In-Reply-To: <200501261658.j0QGwAaO018882@ginger.cmf.nrl.navy.mil> References: <200501261658.j0QGwAaO018882@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 851 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 155 Lines: 6 On Wed, 26 Jan 2005 11:58:11 -0500 "chas williams - CONTRACTOR" wrote: > please apply to 2.6 All 5 patches applied, thanks Chas. From davem@davemloft.net Wed Jan 26 23:38:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 23:38:54 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0R7cn88025465 for ; Wed, 26 Jan 2005 23:38:49 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cu4Aj-0001EZ-00; Wed, 26 Jan 2005 23:34:33 -0800 Date: Wed, 26 Jan 2005 23:34:32 -0800 From: "David S. Miller" To: Adrian Bunk Cc: akpm@osdl.org, juhl-lkml@dif.dk, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [2.6 patch] kernel-api.sgml references removed file net_init.c Message-Id: <20050126233432.10402e50.davem@davemloft.net> In-Reply-To: <20050124193624.GS3515@stusta.de> References: <20050124193624.GS3515@stusta.de> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 852 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 176 Lines: 6 On Mon, 24 Jan 2005 20:36:24 +0100 Adrian Bunk wrote: > This patch by Jesper Juhl is still required in 2.6.11-rc2-mm1. Applied, thanks for reposting Adrian. From davem@davemloft.net Wed Jan 26 23:41:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 23:41:58 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0R7frpI025979 for ; Wed, 26 Jan 2005 23:41:53 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cu4Dj-0001FH-00; Wed, 26 Jan 2005 23:37:39 -0800 Date: Wed, 26 Jan 2005 23:37:39 -0800 From: "David S. Miller" To: "Randy.Dunlap" Cc: acme@conectiva.com.br, netdev@oss.sgi.com Subject: Re: [PATCH] atalk: remove gcc warning when PROC_FS=n Message-Id: <20050126233739.6d51b0b5.davem@davemloft.net> In-Reply-To: <41F736E6.6000901@osdl.org> References: <41F736E6.6000901@osdl.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 853 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 237 Lines: 9 On Tue, 25 Jan 2005 22:21:26 -0800 "Randy.Dunlap" wrote: > appletalk: Fix gcc warning. > > with CONFIG_PROC_FS=n, gcc complains: > net/appletalk/ddp.c:1893: warning: statement with no effect Applied, thanks Randy. From davem@davemloft.net Wed Jan 26 23:46:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Wed, 26 Jan 2005 23:46:08 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0R7k28f026512 for ; Wed, 26 Jan 2005 23:46:02 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cu4Hq-0001Gp-00 for ; Wed, 26 Jan 2005 23:41:54 -0800 Date: Wed, 26 Jan 2005 23:41:54 -0800 From: "David S. Miller" To: netdev@oss.sgi.com Subject: net-2.6.12 tree Message-Id: <20050126234154.4b0b17e7.davem@davemloft.net> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 854 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 616 Lines: 19 I didn't build it yet, sorry, will try again tomorrow. Today's bug fix reviewing took all my time. What's not helping is that Linus is offline or concentrating on something else, so he isn't sucking my net-2.6 tree in at this time. As mentioned I will push the non-bugfixers into there, more specifically: 1) Thomas's EMATCH code 2) Arnaldo's sock allocation cleanups 3) Stephen's ipv6 TCP random port allocation patch And I'll try to get to Einer's routing cache cleanups which have been sitting in my backlog for far too long. There's also the TCP md5 tree merge that never seems to happen, fun fun fun. :-) From ak@suse.de Thu Jan 27 00:26:32 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 00:26:38 -0800 (PST) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0R8QVoq031600 for ; Thu, 27 Jan 2005 00:26:32 -0800 Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 465F113B6FAF; Thu, 27 Jan 2005 09:26:26 +0100 (CET) Date: Thu, 27 Jan 2005 09:26:18 +0100 From: Andi Kleen To: "David S. Miller" Cc: Andi Kleen , buytenh@wantstofly.org, shemminger@osdl.org, roland@topspin.com, hadi@cyberus.ca, iod00d@hp.com, eric.lemoine@gmail.com, netdev@oss.sgi.com, openib-general@openib.org, kaber@trash.net Subject: Re: [PATCH]: was Re: LLTX and netif_stop_queue Message-ID: <20050127082618.GE2731@wotan.suse.de> References: <20050119164640.6c67bdfa.davem@davemloft.net> <52r7kgu5n5.fsf@topspin.com> <20050119230526.393a5184.davem@davemloft.net> <20050120085611.33f9485e@dxpl.pdx.osdl.net> <20050121105452.GA12988@xi.wantstofly.org> <20050125222705.1ee878fd.davem@davemloft.net> <20050126132512.GA18220@xi.wantstofly.org> <20050126223247.3e4643cc.davem@davemloft.net> <20050127071645.GA2731@wotan.suse.de> <20050126232227.3ce4decb.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050126232227.3ce4decb.davem@davemloft.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 855 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@suse.de Precedence: bulk X-list: netdev Content-Length: 620 Lines: 21 On Wed, Jan 26, 2005 at 11:22:27PM -0800, David S. Miller wrote: > On Thu, 27 Jan 2005 08:16:45 +0100 > Andi Kleen wrote: > > > > Yes, that's the idea. > > > > per CPU only works in preemptive kernel if you have preemption > > disabled all the time. Do you? > > > > Seems not likely to me. > > BH is disabled in these code paths (specifically we're talking > about ->hard_start_xmit()), as that is where the recursion > check goes. Hmm, but hard_start_xmit is allowed to enable preemption again, isn't it? An safer alternative may be to change the cpu mask of the current process temporarily. -Andi From rmk+netdev=oss.sgi.com@arm.linux.org.uk Thu Jan 27 00:28:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 00:28:39 -0800 (PST) Received: from caramon.arm.linux.org.uk (caramon.arm.linux.org.uk [212.18.232.186]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0R8STrw032013 for ; Thu, 27 Jan 2005 00:28:30 -0800 Received: from flint.arm.linux.org.uk ([2002:d412:e8ba:1:201:2ff:fe14:8fad]) by caramon.arm.linux.org.uk with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.41) id 1Cu50j-0000A0-Gs; Thu, 27 Jan 2005 08:28:18 +0000 Received: from rmk by flint.arm.linux.org.uk with local (Exim 4.41) id 1Cu50c-0005O9-G5; Thu, 27 Jan 2005 08:28:11 +0000 Date: Thu, 27 Jan 2005 08:28:09 +0000 From: Russell King To: Andrew Morton , Linus Torvalds , alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? Message-ID: <20050127082809.A20510@flint.arm.linux.org.uk> Mail-Followup-To: Andrew Morton , Linus Torvalds , alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com References: <20050121161959.GO3922@fi.muni.cz> <1106360639.15804.1.camel@boxen> <20050123091154.GC16648@suse.de> <20050123011918.295db8e8.akpm@osdl.org> <20050123095608.GD16648@suse.de> <20050123023248.263daca9.akpm@osdl.org> <20050123200315.A25351@flint.arm.linux.org.uk> <20050124114853.A16971@flint.arm.linux.org.uk> <20050125193207.B30094@flint.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20050125193207.B30094@flint.arm.linux.org.uk>; from rmk+lkml@arm.linux.org.uk on Tue, Jan 25, 2005 at 07:32:07PM +0000 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 856 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rmk+lkml@arm.linux.org.uk Precedence: bulk X-list: netdev Content-Length: 1797 Lines: 48 On Tue, Jan 25, 2005 at 07:32:07PM +0000, Russell King wrote: > On Mon, Jan 24, 2005 at 11:48:53AM +0000, Russell King wrote: > > On Sun, Jan 23, 2005 at 08:03:15PM +0000, Russell King wrote: > > > I think I may be seeing something odd here, maybe a possible memory leak. > > > The only problem I have is wondering whether I'm actually comparing like > > > with like. Maybe some networking people can provide a hint? > > > > > > Below is gathered from 2.6.11-rc1. > > > > > > bash-2.05a# cat /proc/net/rt_cache | wc -l; grep ip_dst /proc/slabinfo > > > 24 > > > ip_dst_cache 669 885 256 15 1 > > > > > > I'm fairly positive when I rebooted the machine a couple of days ago, > > > ip_dst_cache was significantly smaller for the same number of lines in > > > /proc/net/rt_cache. > > > > FYI, today it looks like this: > > > > bash-2.05a# cat /proc/net/rt_cache | wc -l; grep ip_dst /proc/slabinfo > > 26 > > ip_dst_cache 820 1065 256 15 1 > > > > So the dst cache seems to have grown by 151 in 16 hours... I'll continue > > monitoring and providing updates. > > Tonights update: > 50 > ip_dst_cache 1024 1245 256 15 1 > > As you can see, the dst cache is consistently growing by about 200 > entries per day. Given this, I predict that the box will fall over > due to "dst cache overflow" in roughly 35 days. This mornings magic numbers are: 3 ip_dst_cache 1292 1485 256 15 1 Is no one interested in the fact that the DST cache is leaking and eventually takes out machines? I've had virtually zero interest in this problem so far. -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/ 2.6 Serial core From akpm@osdl.org Thu Jan 27 00:47:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 00:47:54 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0R8lneA000641 for ; Thu, 27 Jan 2005 00:47:49 -0800 Received: from bix (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id j0R8lQl16734; Thu, 27 Jan 2005 00:47:26 -0800 Date: Thu, 27 Jan 2005 00:47:32 -0800 From: Andrew Morton To: Russell King Cc: torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? Message-Id: <20050127004732.5d8e3f62.akpm@osdl.org> In-Reply-To: <20050127082809.A20510@flint.arm.linux.org.uk> References: <20050121161959.GO3922@fi.muni.cz> <1106360639.15804.1.camel@boxen> <20050123091154.GC16648@suse.de> <20050123011918.295db8e8.akpm@osdl.org> <20050123095608.GD16648@suse.de> <20050123023248.263daca9.akpm@osdl.org> <20050123200315.A25351@flint.arm.linux.org.uk> <20050124114853.A16971@flint.arm.linux.org.uk> <20050125193207.B30094@flint.arm.linux.org.uk> <20050127082809.A20510@flint.arm.linux.org.uk> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 857 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 585 Lines: 17 Russell King wrote: > > This mornings magic numbers are: > > 3 > ip_dst_cache 1292 1485 256 15 1 I just did a q-n-d test here: send one UDP frame to 1.1.1.1 up to 1.1.255.255. The ip_dst_cache grew to ~15k entries and grew no further. It's now gradually shrinking. So there doesn't appear to be a trivial bug.. > Is no one interested in the fact that the DST cache is leaking and > eventually takes out machines? I've had virtually zero interest in > this problem so far. I guess we should find a way to make it happen faster. From jf-ml-k1-1087813225@lk8rp.mail.xeon.eu.org Thu Jan 27 01:03:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 01:03:16 -0800 (PST) Received: from www.acomp.hu (acomp.externet.hu [212.40.96.68]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0R939Xc001555 for ; Thu, 27 Jan 2005 01:03:10 -0800 Received: (qmail 7495 invoked from network); 27 Jan 2005 09:03:01 -0000 Received: from smail.acomp.hu ([undisclosed]) by www.acomp.hu ([127.0.0.1]) with ESMTP via TCP; 27 Jan 2005 09:03:01 -0000 Date: Thu, 27 Jan 2005 10:02:58 +0100 From: Janos Farkas To: David Brownell Cc: David Ford , linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: 2.6.11-rc2 TCP ignores PMTU ICMP (Re: Linux 2.6.11-rc2) Message-ID: Mail-Followup-To: Janos Farkas , David Brownell , David Ford , linux-kernel@vger.kernel.org, netdev@oss.sgi.com References: <200501232251.42394.david-b@pacbell.net> <41F6916F.7060000@blue-labs.org> <200501251054.37053.david-b@pacbell.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200501251054.37053.david-b@pacbell.net> User-Agent: Mutt/1.5.6i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 858 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jf-ml-k1-1087813225@lk8rp.mail.xeon.eu.org Precedence: bulk X-list: netdev Content-Length: 6196 Lines: 70 On 2005-01-25 at 10:54:36, David Brownell wrote: > On Tuesday 25 January 2005 10:35 am, David Ford wrote: > > PMTU bug -- or better said, bad firewall admin who blocks all ICMP. > > PMTU bug, sure -- but one that came late in RC2. Remember: same firewall > in both cases, but only RC2 breaks. The ICMP packet has landed in > the RC2 system, which ignores it. 2.6.10 handled it correctly... I > suspect one of the TCP cleanups borked this. > > My current workaround is "ifconfig eth0 mtu 1492" but that's not > something I'd expect to keep. Indeed, I had to shuffle my machines around a bit to get a proof that something is broken, but now I can confirm the above with a connection to cvs.sourceforge.net: 192.168.59.10 is the 2.6.11-rc2 host, 192.168.59.1 is the (now pre-rc2) gateway with a PPPoE 1492 mtu/pmtu host. 59.10 does not run any firewall/packet filter. (almost full-fledged perfect three-way handshake) 08:05:43.046546 IP (tos 0x0, ttl 64, id 21526, offset 0, flags [DF], length: 60) 192.168.59.10.29612 > 66.35.250.207.2401: SWE [tcp sum ok] 933042757:933042757(0) win 5840 08:05:43.249819 IP (tos 0x0, ttl 45, id 0, offset 0, flags [DF], length: 60) 66.35.250.207.2401 > 192.168.59.10.29612: S [tcp sum ok] 2956308271:2956308271(0) ack 933042758 win 5792 08:05:43.249881 IP (tos 0x0, ttl 64, id 21528, offset 0, flags [DF], length: 52) 192.168.59.10.29612 > 66.35.250.207.2401: . [tcp sum ok] ack 1 win 1460 (CVS protocol starts) 08:05:43.363697 IP (tos 0x0, ttl 64, id 21530, offset 0, flags [DF], length: 116) 192.168.59.10.29612 > 66.35.250.207.2401: P [tcp sum ok] 1:65(64) ack 1 win 1460 08:05:43.568504 IP (tos 0x0, ttl 45, id 14633, offset 0, flags [DF], length: 52) 66.35.250.207.2401 > 192.168.59.10.29612: . [tcp sum ok] ack 65 win 5792 08:05:43.964094 IP (tos 0x0, ttl 45, id 14634, offset 0, flags [DF], length: 63) 66.35.250.207.2401 > 192.168.59.10.29612: P [tcp sum ok] 1:12(11) ack 65 win 5792 08:05:43.964121 IP (tos 0x0, ttl 64, id 21532, offset 0, flags [DF], length: 52) 192.168.59.10.29612 > 66.35.250.207.2401: . [tcp sum ok] ack 12 win 1460 08:05:43.964258 IP (tos 0x0, ttl 64, id 21534, offset 0, flags [DF], length: 440) 192.168.59.10.29612 > 66.35.250.207.2401: P [tcp sum ok] 65:453(388) ack 12 win 1460 08:05:44.184893 IP (tos 0x0, ttl 45, id 14635, offset 0, flags [DF], length: 52) 66.35.250.207.2401 > 192.168.59.10.29612: . [tcp sum ok] ack 453 win 6432 08:05:44.192050 IP (tos 0x0, ttl 45, id 14636, offset 0, flags [DF], length: 566) 66.35.250.207.2401 > 192.168.59.10.29612: P [tcp sum ok] 12:526(514) ack 453 win 6432 08:05:44.192274 IP (tos 0x0, ttl 64, id 21536, offset 0, flags [DF], length: 65) 192.168.59.10.29612 > 66.35.250.207.2401: P [tcp sum ok] 453:466(13) ack 526 win 1728 08:05:44.432709 IP (tos 0x0, ttl 45, id 14637, offset 0, flags [DF], length: 52) 66.35.250.207.2401 > 192.168.59.10.29612: . [tcp sum ok] ack 466 win 6432 08:05:44.893674 IP (tos 0x0, ttl 64, id 21538, offset 0, flags [DF], length: 85) 192.168.59.10.29612 > 66.35.250.207.2401: P [tcp sum ok] 466:499(33) ack 526 win 1728 08:05:45.094985 IP (tos 0x0, ttl 45, id 14638, offset 0, flags [DF], length: 52) 66.35.250.207.2401 > 192.168.59.10.29612: . [tcp sum ok] ack 499 win 6432 (first ethernet frame-sized segment is about to be sent) 08:05:45.264633 IP (tos 0x0, ttl 64, id 21540, offset 0, flags [DF], length: 1500) 192.168.59.10.29612 > 66.35.250.207.2401: . [tcp sum ok] 499:1947(1448) ack 526 win 1728 08:05:45.264694 IP (tos 0x0, ttl 64, id 21542, offset 0, flags [DF], length: 1500) 192.168.59.10.29612 > 66.35.250.207.2401: . [tcp sum ok] 1947:3395(1448) ack 526 win 1728 (the PPPoE gateway notifies the host about the PMTU issue, one for each segment) 08:05:45.265330 IP (tos 0xc0, ttl 128, id 17970, offset 0, flags [none], length: 576) 192.168.59.1 > 192.168.59.10: icmp 556: 66.35.250.207 unreachable - need to frag (mtu 1492) 08:05:45.265453 IP (tos 0xc0, ttl 128, id 17971, offset 0, flags [none], length: 576) 192.168.59.1 > 192.168.59.10: icmp 556: 66.35.250.207 unreachable - need to frag (mtu 1492) (the source host sends the full frame again...?) 08:05:45.770331 IP (tos 0x0, ttl 64, id 21544, offset 0, flags [DF], length: 1500) 192.168.59.10.29612 > 66.35.250.207.2401: . [tcp sum ok] 499:1947(1448) ack 526 win 1728 08:05:45.770900 IP (tos 0xc0, ttl 128, id 17972, offset 0, flags [none], length: 576) 192.168.59.1 > 192.168.59.10: icmp 556: 66.35.250.207 unreachable - need to frag (mtu 1492) (and looping goes on..) 08:05:46.783148 IP (tos 0x0, ttl 64, id 21546, offset 0, flags [DF], length: 1500) 192.168.59.10.29612 > 66.35.250.207.2401: . [tcp sum ok] 499:1947(1448) ack 526 win 1728 08:05:46.783752 IP (tos 0xc0, ttl 128, id 17973, offset 0, flags [none], length: 576) 192.168.59.1 > 192.168.59.10: icmp 556: 66.35.250.207 unreachable - need to frag (mtu 1492) 08:05:48.808861 IP (tos 0x0, ttl 64, id 21548, offset 0, flags [DF], length: 1500) 192.168.59.10.29612 > 66.35.250.207.2401: . [tcp sum ok] 499:1947(1448) ack 526 win 1728 08:05:48.809882 IP (tos 0xc0, ttl 128, id 17974, offset 0, flags [none], length: 576) 192.168.59.1 > 192.168.59.10: icmp 556: 66.35.250.207 unreachable - need to frag (mtu 1492) ... I don't have now a pre-rc2 host to try this on, but I regularly use sourceforge anoncvs to at least confess honestly that it did work :) -- Janos | romfs is at http://romfs.sourceforge.net/ | Don't talk about silence. From jgarzik@pobox.com Thu Jan 27 01:56:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 01:56:56 -0800 (PST) Received: from parcelfarce.linux.theplanet.co.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0R9ulQP003587 for ; Thu, 27 Jan 2005 01:56:48 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by parcelfarce.linux.theplanet.co.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1Cu6OK-0003UT-Jx; Thu, 27 Jan 2005 09:56:44 +0000 Message-ID: <41F8BACA.1020302@pobox.com> Date: Thu, 27 Jan 2005 04:56:26 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Dale Farnsworth CC: netdev@oss.sgi.com, Ralf Baechle , Manish Lachwani , Brian Waite , "Steven J. Hill" Subject: Re: MV643xx Ethernet 2.6 driver update References: <20050117184019.GA24655@xyzzy> In-Reply-To: <20050117184019.GA24655@xyzzy> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 859 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 1870 Lines: 52 Dale Farnsworth wrote: > While porting the mv643xx ethernet driver to 2.6 and for use on PPC, I > modified it to use the device driver model, fixed the hardware checksum > support, and did some miscellaneous bug fixes and cleanups. > > The following changes are included: > > A. Remove redundant or unneeded code. > B. Replace fixed count spins with udelay/msleep waits on hardware status bits > C. Fix code to enable hardware checksum generation for TX packets > D. Convert from pci_map_* to dma_map_* interface > E. Add device driver model support. > F. Add support for several configurable parameters via platform_device > G. Make use of MV64340_RX_QUEUE_FILL_ON_TASK macro consistent. > H. Simplify mv64340_eth_set_rx_mode() > I. Clean up receive buffer sizing > J. Call netif_carrier_off/netif_carrier_on on a link down/up condition > K. Add support for PHYs/boards that don't support autonegotiation. > > Change E is the only one that modifies the driver interface. > > Change G was sent to me by Steven J Hill . > Change K was sent to me by Brian Waite . > > The first 6 changes were submitted to LKLM on Dec. 13 2004. Comments > were received only from Christoph Hellwig and have > been addressed. Changes G-K have been added since then. > > I have some additional (mostly cosmetic, but still significant) cleanups, > but I'd like to get these in the queue first. > > Thanks, > Dale Farnsworth > > Please do a > > bk pull bk://dfarnsworth.bkbits.net/netdev-2.6-mv643xx-enet Ouch: When using BitKeeper, you need to make sure your changes are the only ones in the tree. It doesn't work for me to pull: mv643xx-enet -> jgarzik-mv643xx-enet -> net-drivers-2.6 -> linus because that would require pulling the entire netdev-2.6 tree up through that chain. Jeff From alessandro.suardi@gmail.com Thu Jan 27 02:46:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 02:46:07 -0800 (PST) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.193]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RAk15C007930 for ; Thu, 27 Jan 2005 02:46:01 -0800 Received: by rproxy.gmail.com with SMTP id b11so214489rne for ; Thu, 27 Jan 2005 02:46:00 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=XxtsXyn2hZ64fU+rtVtBR20OmItGRtYabXx5vIXDukwC0kr55QW131ekUY14XIr9gkx9JgRTto0KjksuM1B2yYd95adlWYIetRx0v5x2hFCWPL6NCycKl2/8XNwix+7hJEJ7ONmckrii8SiJ7dvSk8yb8uCsslFmTEX6QBK7j4E= Received: by 10.38.74.21 with SMTP id w21mr67567rna; Thu, 27 Jan 2005 02:19:20 -0800 (PST) Received: by 10.38.13.49 with HTTP; Thu, 27 Jan 2005 02:19:20 -0800 (PST) Message-ID: <5a4c581d0501270219173ee10d@mail.gmail.com> Date: Thu, 27 Jan 2005 11:19:20 +0100 From: Alessandro Suardi Reply-To: Alessandro Suardi To: Andrew Morton Subject: Re: Memory leak in 2.6.11-rc1? Cc: Russell King , torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com In-Reply-To: <20050127004732.5d8e3f62.akpm@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <20050121161959.GO3922@fi.muni.cz> <20050123091154.GC16648@suse.de> <20050123011918.295db8e8.akpm@osdl.org> <20050123095608.GD16648@suse.de> <20050123023248.263daca9.akpm@osdl.org> <20050123200315.A25351@flint.arm.linux.org.uk> <20050124114853.A16971@flint.arm.linux.org.uk> <20050125193207.B30094@flint.arm.linux.org.uk> <20050127082809.A20510@flint.arm.linux.org.uk> <20050127004732.5d8e3f62.akpm@osdl.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 860 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: alessandro.suardi@gmail.com Precedence: bulk X-list: netdev Content-Length: 2104 Lines: 61 On Thu, 27 Jan 2005 00:47:32 -0800, Andrew Morton wrote: > Russell King wrote: > > > > This mornings magic numbers are: > > > > 3 > > ip_dst_cache 1292 1485 256 15 1 > > I just did a q-n-d test here: send one UDP frame to 1.1.1.1 up to > 1.1.255.255. The ip_dst_cache grew to ~15k entries and grew no further. > It's now gradually shrinking. So there doesn't appear to be a trivial > bug.. > > > Is no one interested in the fact that the DST cache is leaking and > > eventually takes out machines? I've had virtually zero interest in > > this problem so far. > > I guess we should find a way to make it happen faster. > - > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ > Data point... on my box, used as ed2k/bittorrent machine, the ip_dst_cache grows and shrinks quite fast; these two samples were ~3 minutes apart: [root@donkey ~]# grep ip_dst /proc/slabinfo ip_dst_cache 998 1005 256 15 1 : tunables 120 60 0 : slabdata 67 67 0 [root@donkey ~]# wc -l /proc/net/rt_cache 926 /proc/net/rt_cache [root@donkey ~]# grep ip_dst /proc/slabinfo ip_dst_cache 466 795 256 15 1 : tunables 120 60 0 : slabdata 53 53 0 [root@donkey ~]# wc -l /proc/net/rt_cache 443 /proc/net/rt_cache and these were 2 seconds apart [root@donkey ~]# wc -l /proc/net/rt_cache 737 /proc/net/rt_cache [root@donkey ~]# grep ip_dst /proc/slabinfo ip_dst_cache 795 795 256 15 1 : tunables 120 60 0 : slabdata 53 53 0 [root@donkey ~]# wc -l /proc/net/rt_cache 1023 /proc/net/rt_cache [root@donkey ~]# grep ip_dst /proc/slabinfo ip_dst_cache 1035 1035 256 15 1 : tunables 120 60 0 : slabdata 69 69 0 --alessandro "And every dream, every, is just a dream after all" (Heather Nova, "Paper Cup") From herbert@gondor.apana.org.au Thu Jan 27 03:10:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 03:11:02 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RBAqrv009406 for ; Thu, 27 Jan 2005 03:10:53 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1Cu7XS-0008GU-00; Thu, 27 Jan 2005 22:10:14 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1Cu7X0-0005RX-00; Thu, 27 Jan 2005 22:09:46 +1100 Date: Thu, 27 Jan 2005 22:09:46 +1100 To: Alexey Kuznetsov Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: the TSO packet mangling issue Message-ID: <20050127110946.GA20494@gondor.apana.org.au> References: <20050121204024.6f94fc26.davem@davemloft.net> <20050122054346.GA1635@gondor.apana.org.au> <20050122170533.GB11499@yakov.inr.ac.ru> <20050123071027.GA20296@gondor.apana.org.au> <20050126110043.GA29950@yakov.inr.ac.ru> <20050126222522.GA21670@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="GvXjxJ+pjyke8COw" Content-Disposition: inline In-Reply-To: <20050126222522.GA21670@gondor.apana.org.au> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 861 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 4525 Lines: 154 --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi: OK, here are the patches to COW TSO packets before the TCP/TCP header gets written over. This one defines a new bit of dataref. It's set just before a packet joins the TCP write queue. It's cleared after the packet is taken off the queue and just before it's freed. Signed-off-by: Herbert Xu Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=tso-mangle-1 ===== include/linux/skbuff.h 1.59 vs edited ===== --- 1.59/include/linux/skbuff.h 2005-01-11 07:23:55 +11:00 +++ edited/include/linux/skbuff.h 2005-01-27 21:18:04 +11:00 @@ -134,6 +134,9 @@ __u16 size; }; +#define SKB_DATAREF_TCP 0x40000000 +#define SKB_DATAREF_MASK 0x3fffffff + /* This data is invariant across clones and lives at * the end of the header data, ie. at skb->end. */ @@ -374,7 +377,8 @@ */ static inline int skb_cloned(const struct sk_buff *skb) { - return skb->cloned && atomic_read(&skb_shinfo(skb)->dataref) != 1; + return skb->cloned && + (atomic_read(&skb_shinfo(skb)->dataref) & SKB_DATAREF_MASK) != 1; } /** ===== include/net/tcp.h 1.103 vs edited ===== --- 1.103/include/net/tcp.h 2005-01-18 09:09:33 +11:00 +++ edited/include/net/tcp.h 2005-01-27 21:37:57 +11:00 @@ -1222,6 +1222,27 @@ return (tp->packets_out - tp->left_out + tp->retrans_out); } +/* This marks the skb as owned by the TCP stack. The TCP stack + * isn't fussy about others modifying the skb's content as long + * as they do so within the TCP/IP headers and leave the TCP + * payload alone. + */ +static inline void tcp_skb_hold(struct sk_buff *skb) +{ + atomic_add(SKB_DATAREF_TCP, &skb_shinfo(skb)->dataref); +} + +static inline void tcp_skb_release(struct sk_buff *skb) +{ + atomic_sub(SKB_DATAREF_TCP, &skb_shinfo(skb)->dataref); +} + +static inline void tcp_sk_stream_free_skb(struct sock *sk, struct sk_buff *skb) +{ + tcp_skb_release(skb); + sk_stream_free_skb(sk, skb); +} + /* * Which congestion algorithim is in use on the connection. */ ===== net/ipv4/tcp.c 1.91 vs edited ===== --- 1.91/net/ipv4/tcp.c 2005-01-18 09:09:33 +11:00 +++ edited/net/ipv4/tcp.c 2005-01-27 21:28:57 +11:00 @@ -598,6 +598,7 @@ TCP_SKB_CB(skb)->end_seq = tp->write_seq; TCP_SKB_CB(skb)->flags = TCPCB_FLAG_ACK; TCP_SKB_CB(skb)->sacked = 0; + tcp_skb_hold(skb); __skb_queue_tail(&sk->sk_write_queue, skb); sk_charge_skb(sk, skb); if (!sk->sk_send_head) @@ -990,7 +991,7 @@ if (sk->sk_send_head == skb) sk->sk_send_head = NULL; __skb_unlink(skb, skb->list); - sk_stream_free_skb(sk, skb); + tcp_sk_stream_free_skb(sk, skb); } do_error: ===== net/ipv4/tcp_input.c 1.89 vs edited ===== --- 1.89/net/ipv4/tcp_input.c 2005-01-18 09:09:33 +11:00 +++ edited/net/ipv4/tcp_input.c 2005-01-27 21:29:37 +11:00 @@ -2470,7 +2470,7 @@ tcp_dec_pcount_approx(&tp->fackets_out, skb); tcp_packets_out_dec(tp, skb); __skb_unlink(skb, skb->list); - sk_stream_free_skb(sk, skb); + tcp_sk_stream_free_skb(sk, skb); } if (acked&FLAG_ACKED) { ===== net/ipv4/tcp_output.c 1.77 vs edited ===== --- 1.77/net/ipv4/tcp_output.c 2005-01-19 07:23:36 +11:00 +++ edited/net/ipv4/tcp_output.c 2005-01-27 21:29:18 +11:00 @@ -400,6 +400,7 @@ /* Advance write_seq and place onto the write_queue. */ tp->write_seq = TCP_SKB_CB(skb)->end_seq; + tcp_skb_hold(skb); __skb_queue_tail(&sk->sk_write_queue, skb); sk_charge_skb(sk, skb); @@ -960,7 +961,7 @@ */ tcp_dec_pcount_approx(&tp->fackets_out, next_skb); tcp_packets_out_dec(tp, next_skb); - sk_stream_free_skb(sk, next_skb); + tcp_sk_stream_free_skb(sk, next_skb); } } @@ -1327,8 +1328,9 @@ if (nskb == NULL) return -ENOMEM; __skb_unlink(skb, &sk->sk_write_queue); + tcp_skb_hold(nskb); __skb_queue_head(&sk->sk_write_queue, nskb); - sk_stream_free_skb(sk, skb); + tcp_sk_stream_free_skb(sk, skb); sk_charge_skb(sk, nskb); skb = nskb; } @@ -1493,6 +1495,7 @@ /* Send it off. */ TCP_SKB_CB(buff)->when = tcp_time_stamp; tp->retrans_stamp = TCP_SKB_CB(buff)->when; + tcp_skb_hold(buff); __skb_queue_tail(&sk->sk_write_queue, buff); sk_charge_skb(sk, buff); tp->packets_out += tcp_skb_pcount(buff); --GvXjxJ+pjyke8COw-- From herbert@gondor.apana.org.au Thu Jan 27 03:13:06 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 03:13:12 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RBD4hF009831 for ; Thu, 27 Jan 2005 03:13:05 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1Cu7ZH-0008Go-00; Thu, 27 Jan 2005 22:12:07 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1Cu7ZB-0005S6-00; Thu, 27 Jan 2005 22:12:01 +1100 Date: Thu, 27 Jan 2005 22:12:01 +1100 To: Alexey Kuznetsov Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: the TSO packet mangling issue Message-ID: <20050127111201.GB20494@gondor.apana.org.au> References: <20050121204024.6f94fc26.davem@davemloft.net> <20050122054346.GA1635@gondor.apana.org.au> <20050122170533.GB11499@yakov.inr.ac.ru> <20050123071027.GA20296@gondor.apana.org.au> <20050126110043.GA29950@yakov.inr.ac.ru> <20050126222522.GA21670@gondor.apana.org.au> <20050127110946.GA20494@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="8P1HSweYDcXXzwPJ" Content-Disposition: inline In-Reply-To: <20050127110946.GA20494@gondor.apana.org.au> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 862 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 3735 Lines: 146 --8P1HSweYDcXXzwPJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline This patch adds tcp_skb_cow() and uses it in e1000/tg3. Signed-off-by: Herbert Xu Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --8P1HSweYDcXXzwPJ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=tso-mangle-2 ===== drivers/net/tg3.c 1.231 vs edited ===== --- 1.231/drivers/net/tg3.c 2005-01-23 14:41:32 +11:00 +++ edited/drivers/net/tg3.c 2005-01-27 21:57:09 +11:00 @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -3102,6 +3103,9 @@ if (skb->len > (tp->dev->mtu + ETH_HLEN) && (mss = skb_shinfo(skb)->tso_size) != 0) { int tcp_opt_len, ip_tcp_len; + + if (tcp_skb_cow(skb)) + goto out_unlock; tcp_opt_len = ((skb->h.th->doff - 5) * 4); ip_tcp_len = (skb->nh.iph->ihl * 4) + sizeof(struct tcphdr); ===== drivers/net/e1000/e1000.h 1.60 vs edited ===== --- 1.60/drivers/net/e1000/e1000.h 2005-01-21 08:24:31 +11:00 +++ edited/drivers/net/e1000/e1000.h 2005-01-27 21:57:09 +11:00 @@ -67,6 +67,7 @@ #include #ifdef NETIF_F_TSO #include +#include #endif #include #include ===== drivers/net/e1000/e1000_main.c 1.147 vs edited ===== --- 1.147/drivers/net/e1000/e1000_main.c 2005-01-21 08:24:31 +11:00 +++ edited/drivers/net/e1000/e1000_main.c 2005-01-27 21:57:09 +11:00 @@ -1522,7 +1522,7 @@ #define E1000_TX_FLAGS_VLAN_MASK 0xffff0000 #define E1000_TX_FLAGS_VLAN_SHIFT 16 -static inline boolean_t +static inline int e1000_tso(struct e1000_adapter *adapter, struct sk_buff *skb) { #ifdef NETIF_F_TSO @@ -1531,8 +1531,13 @@ uint32_t cmd_length = 0; uint16_t ipcse, tucse, mss; uint8_t ipcss, ipcso, tucss, tucso, hdr_len; + int err; if(skb_shinfo(skb)->tso_size) { + err = tcp_skb_cow(skb); + if (err) + return err; + hdr_len = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2)); mss = skb_shinfo(skb)->tso_size; skb->nh.iph->tot_len = 0; @@ -1569,11 +1574,11 @@ if(++i == adapter->tx_ring.count) i = 0; adapter->tx_ring.next_to_use = i; - return TRUE; + return 1; } #endif - return FALSE; + return 0; } static inline boolean_t @@ -1798,6 +1803,7 @@ unsigned int nr_frags = 0; unsigned int mss = 0; int count = 0; + int tso; unsigned int f; len -= skb->data_len; @@ -1869,7 +1875,13 @@ first = adapter->tx_ring.next_to_use; - if(likely(e1000_tso(adapter, skb))) + tso = e1000_tso(adapter, skb); + if (tso < 0) { + dev_kfree_skb_any(skb); + return NETDEV_TX_OK; + } + + if (likely(tso)) tx_flags |= E1000_TX_FLAGS_TSO; else if(likely(e1000_tx_csum(adapter, skb))) tx_flags |= E1000_TX_FLAGS_CSUM; ===== include/net/tcp.h 1.104 vs edited ===== --- 1.104/include/net/tcp.h 2005-01-27 21:43:07 +11:00 +++ edited/include/net/tcp.h 2005-01-27 21:57:19 +11:00 @@ -1243,6 +1243,25 @@ sk_stream_free_skb(sk, skb); } +/* Return an skb which is writeable up to the point where the + * TCP payload starts. + */ +static inline int tcp_skb_cow(struct sk_buff *skb) +{ + int dataref; + + if (!skb->cloned) + return 0; + + dataref = atomic_read(&skb_shinfo(skb)->dataref); + dataref -= !!(dataref & SKB_DATAREF_TCP); + dataref &= SKB_DATAREF_MASK; + if (dataref == 1) + return 0; + + return pskb_expand_head(skb, 0, 0, GFP_ATOMIC); +} + /* * Which congestion algorithim is in use on the connection. */ --8P1HSweYDcXXzwPJ-- From hch@lst.de Thu Jan 27 03:22:23 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 03:22:28 -0800 (PST) Received: from mail.lst.de (verein.lst.de [213.95.11.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RBMLWU010640 for ; Thu, 27 Jan 2005 03:22:22 -0800 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id j0RBMJ6t011806 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 27 Jan 2005 12:22:19 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id j0RBMJp4011804; Thu, 27 Jan 2005 12:22:19 +0100 Date: Thu, 27 Jan 2005 12:22:19 +0100 From: Christoph Hellwig To: paulus@samba.org Cc: netdev@oss.sgi.com Subject: Re: [PATCH] remove bogus exports in ppp Message-ID: <20050127112219.GA11790@lst.de> References: <20041024132504.GC19927@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041024132504.GC19927@lst.de> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 863 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: netdev Content-Length: 674 Lines: 19 On Sun, Oct 24, 2004 at 03:25:04PM +0200, Christoph Hellwig wrote: > even if they are usefull for debugging they're just bad namespace > pollution for mainline ping? Signed-off-by: Christoph Hellwig --- 1.50/drivers/net/ppp_generic.c 2004-08-29 07:49:19 +02:00 +++ edited/drivers/net/ppp_generic.c 2004-10-23 14:08:17 +02:00 @@ -2721,8 +2721,6 @@ EXPORT_SYMBOL(ppp_output_wakeup); EXPORT_SYMBOL(ppp_register_compressor); EXPORT_SYMBOL(ppp_unregister_compressor); -EXPORT_SYMBOL(all_ppp_units); /* for debugging */ -EXPORT_SYMBOL(all_channels); /* for debugging */ MODULE_LICENSE("GPL"); MODULE_ALIAS_CHARDEV_MAJOR(PPP_MAJOR); MODULE_ALIAS("/dev/ppp"); From Robert.Olsson@data.slu.se Thu Jan 27 04:13:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 04:13:18 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RCD7v7012978 for ; Thu, 27 Jan 2005 04:13:08 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0RCD4qM024861; Thu, 27 Jan 2005 13:13:05 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id B2390EE1D1; Thu, 27 Jan 2005 13:13:04 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16888.56016.608929.340640@robur.slu.se> Date: Thu, 27 Jan 2005 13:13:04 +0100 To: "David S.Miller" Cc: Robert.Olsson@data.slu.se, netdev@oss.sgi.com Subject: Re: [PATCH] gc_min_interval in milleseconds via /proc (fwd) X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 864 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Content-Length: 2015 Lines: 65 > David S. Miller wrote: > It would, but since this is a user visible API we really can't > change it. Ok! But I haven't heard of any successful use of this paticaul API. :-) > We could instead make another sysctl (perhaps name it something > like "gc_min_interval_ms") to do what you propose, and then > we'd keep the existing one around for compatibility. All-right a new patch below. --ro --- net/ipv4/route.c.orig 2005-01-27 11:19:37.551668112 +0100 +++ net/ipv4/route.c 2005-01-27 12:34:14.089130976 +0100 @@ -2529,6 +2529,8 @@ .proc_handler = &proc_dointvec, }, { + /* Deprecated. Use gc_min_interval_ms */ + .ctl_name = NET_IPV4_ROUTE_GC_MIN_INTERVAL, .procname = "gc_min_interval", .data = &ip_rt_gc_min_interval, @@ -2538,6 +2540,15 @@ .strategy = &sysctl_jiffies, }, { + .ctl_name = NET_IPV4_ROUTE_GC_MIN_INTERVAL, + .procname = "gc_min_interval_ms", + .data = &ip_rt_gc_min_interval, + .maxlen = sizeof(unsigned long), + .mode = 0644, + .proc_handler = &proc_doulongvec_ms_jiffies_minmax, + .strategy = &sysctl_jiffies, + }, + { .ctl_name = NET_IPV4_ROUTE_GC_TIMEOUT, .procname = "gc_timeout", .data = &ip_rt_gc_timeout, --- Documentation/filesystems/proc.txt.orig 2005-01-27 12:35:02.460777368 +0100 +++ Documentation/filesystems/proc.txt 2005-01-27 12:46:30.981106368 +0100 @@ -1709,12 +1709,13 @@ Writing to this file results in a flush of the routing cache. -gc_elasticity, gc_interval, gc_min_interval, gc_tresh, gc_timeout, -gc_thresh, gc_thresh1, gc_thresh2, gc_thresh3 --------------------------------------------------------------- +gc_elasticity, gc_interval, gc_min_interval_ms, gc_timeout, gc_thresh +--------------------------------------------------------------------- Values to control the frequency and behavior of the garbage collection -algorithm for the routing cache. +algorithm for the routing cache. gc_min_interval is deprecated and replaced +by gc_min_interval_ms. + max_size -------- From gandalf@wlug.westbo.se Thu Jan 27 04:17:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 04:17:42 -0800 (PST) Received: from null.rsn.bth.se (postfix@null.rsn.bth.se [194.47.142.3]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RCHYbf013613 for ; Thu, 27 Jan 2005 04:17:35 -0800 Received: by null.rsn.bth.se (Postfix, from userid 65534) id 8F47C2C0027; Thu, 27 Jan 2005 13:17:29 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by null.rsn.bth.se (Postfix) with ESMTP id 330B32C0029; Thu, 27 Jan 2005 13:17:29 +0100 (CET) Received: from tux.rsn.bth.se (tux.rsn.bth.se [194.47.143.135]) by null.rsn.bth.se (Postfix) with ESMTP id 74BEE2C0027; Thu, 27 Jan 2005 13:17:28 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by tux.rsn.bth.se (Postfix) with ESMTP id CA9B43FB5; Thu, 27 Jan 2005 13:17:28 +0100 (CET) Date: Thu, 27 Jan 2005 13:17:28 +0100 (CET) From: Martin Josefsson X-X-Sender: gandalf@tux.rsn.bth.se To: Andrew Morton Cc: Russell King , torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? In-Reply-To: <20050127004732.5d8e3f62.akpm@osdl.org> Message-ID: References: <20050121161959.GO3922@fi.muni.cz> <1106360639.15804.1.camel@boxen> <20050123091154.GC16648@suse.de> <20050123011918.295db8e8.akpm@osdl.org> <20050123095608.GD16648@suse.de> <20050123023248.263daca9.akpm@osdl.org> <20050123200315.A25351@flint.arm.linux.org.uk> <20050124114853.A16971@flint.arm.linux.org.uk> <20050125193207.B30094@flint.arm.linux.org.uk> <20050127082809.A20510@flint.arm.linux.org.uk> <20050127004732.5d8e3f62.akpm@osdl.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Scanned: by amavisd-new-20030616-p10 on null.rsn.bth.se X-Virus-Status: Clean X-archive-position: 865 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: gandalf@wlug.westbo.se Precedence: bulk X-list: netdev Content-Length: 849 Lines: 25 On Thu, 27 Jan 2005, Andrew Morton wrote: > Russell King wrote: > > > > This mornings magic numbers are: > > > > 3 > > ip_dst_cache 1292 1485 256 15 1 > > I just did a q-n-d test here: send one UDP frame to 1.1.1.1 up to > 1.1.255.255. The ip_dst_cache grew to ~15k entries and grew no further. > It's now gradually shrinking. So there doesn't appear to be a trivial > bug.. > > > Is no one interested in the fact that the DST cache is leaking and > > eventually takes out machines? I've had virtually zero interest in > > this problem so far. > > I guess we should find a way to make it happen faster. I could be a refcount problem. I think Russell is using NAT, it could be the MASQUERADE target if that is in use. A simple test would be to switch to SNAT and try again if possible. /Martin From Robert.Olsson@data.slu.se Thu Jan 27 04:56:34 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 04:56:40 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RCuXsl018588 for ; Thu, 27 Jan 2005 04:56:34 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0RCuU9J000842; Thu, 27 Jan 2005 13:56:31 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 6B071EE2A4; Thu, 27 Jan 2005 13:56:30 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16888.58622.376497.380197@robur.slu.se> Date: Thu, 27 Jan 2005 13:56:30 +0100 To: Andrew Morton Cc: Russell King , torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? In-Reply-To: <20050127004732.5d8e3f62.akpm@osdl.org> References: <20050121161959.GO3922@fi.muni.cz> <1106360639.15804.1.camel@boxen> <20050123091154.GC16648@suse.de> <20050123011918.295db8e8.akpm@osdl.org> <20050123095608.GD16648@suse.de> <20050123023248.263daca9.akpm@osdl.org> <20050123200315.A25351@flint.arm.linux.org.uk> <20050124114853.A16971@flint.arm.linux.org.uk> <20050125193207.B30094@flint.arm.linux.org.uk> <20050127082809.A20510@flint.arm.linux.org.uk> <20050127004732.5d8e3f62.akpm@osdl.org> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 866 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Content-Length: 708 Lines: 25 Andrew Morton writes: > Russell King wrote: > > ip_dst_cache 1292 1485 256 15 1 > I guess we should find a way to make it happen faster. Here is route DoS attack. Pure routing no NAT no filter. Start ===== ip_dst_cache 5 30 256 15 1 : tunables 120 60 8 : slabdata 2 2 0 After DoS ========= ip_dst_cache 66045 76125 256 15 1 : tunables 120 60 8 : slabdata 5075 5075 480 After some GC runs. ================== ip_dst_cache 2 15 256 15 1 : tunables 120 60 8 : slabdata 1 1 0 No problems here. I saw Martin talked about NAT... --ro From Robert.Olsson@data.slu.se Thu Jan 27 05:04:00 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 05:04:04 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RD3x4E019305 for ; Thu, 27 Jan 2005 05:03:59 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0RD3aXm002385; Thu, 27 Jan 2005 14:03:36 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id F27C8EE2A5; Thu, 27 Jan 2005 14:03:35 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16888.59047.957865.592152@robur.slu.se> Date: Thu, 27 Jan 2005 14:03:35 +0100 To: Robert Olsson Cc: Andrew Morton , Russell King , torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? In-Reply-To: <16888.58622.376497.380197@robur.slu.se> References: <20050121161959.GO3922@fi.muni.cz> <1106360639.15804.1.camel@boxen> <20050123091154.GC16648@suse.de> <20050123011918.295db8e8.akpm@osdl.org> <20050123095608.GD16648@suse.de> <20050123023248.263daca9.akpm@osdl.org> <20050123200315.A25351@flint.arm.linux.org.uk> <20050124114853.A16971@flint.arm.linux.org.uk> <20050125193207.B30094@flint.arm.linux.org.uk> <20050127082809.A20510@flint.arm.linux.org.uk> <20050127004732.5d8e3f62.akpm@osdl.org> <16888.58622.376497.380197@robur.slu.se> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 867 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Content-Length: 846 Lines: 29 Oh. Linux version 2.6.11-rc2 was used. Robert Olsson writes: > > Andrew Morton writes: > > Russell King wrote: > > > > ip_dst_cache 1292 1485 256 15 1 > > > I guess we should find a way to make it happen faster. > > Here is route DoS attack. Pure routing no NAT no filter. > > Start > ===== > ip_dst_cache 5 30 256 15 1 : tunables 120 60 8 : slabdata 2 2 0 > > After DoS > ========= > ip_dst_cache 66045 76125 256 15 1 : tunables 120 60 8 : slabdata 5075 5075 480 > > After some GC runs. > ================== > ip_dst_cache 2 15 256 15 1 : tunables 120 60 8 : slabdata 1 1 0 > > No problems here. I saw Martin talked about NAT... > > --ro From tgraf@suug.ch Thu Jan 27 06:20:14 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 06:20:22 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0REKBaZ022810 for ; Thu, 27 Jan 2005 06:20:14 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 3E254F; Thu, 27 Jan 2005 15:19:48 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 7F5261C0EA; Thu, 27 Jan 2005 15:20:29 +0100 (CET) Date: Thu, 27 Jan 2005 15:20:29 +0100 From: Thomas Graf To: "David S. Miller" Cc: hadi@cyberus.ca, kaber@trash.net, netdev@oss.sgi.com Subject: Re: [RFC] string matching ematch Message-ID: <20050127142029.GR31837@postel.suug.ch> References: <20050126150714.GL31837@postel.suug.ch> <20050126130323.2dc10187.davem@davemloft.net> <20050126214119.GP31837@postel.suug.ch> <20050126152609.59e1a15e.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050126152609.59e1a15e.davem@davemloft.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 868 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 1648 Lines: 36 * David S. Miller <20050126152609.59e1a15e.davem@davemloft.net> 2005-01-26 15:26 > On Wed, 26 Jan 2005 22:41:19 +0100 > Thomas Graf wrote: > > > I'm not sure if mixing stateful with stateless stuff is such of a good > > idea. I think it should be separated and have stateful filters only be > > executed when the flow matters, not packets. > > I think keeping things totally stateless would be the best > idea. Yes, I think so too. I'm still thinking about pskbs in the background and the problem gets more serious with this. So far, even with the multi byte ematch, all filters were focusing on header content even if they were able to read from any offset. Our goal must of course be to to avoid lineraization for as many cases as possible, therefore I think it would be worth making all matchers aware of pskbs without linearization. In case the packet goes though the pedit or ipt action later on then we definitely need to take further actions but these should be special cases. For the string matching it is fairly easy, we can check for partial matches at the end and begin of every fragment. The multi byte ematch could be splitted into two paths, a fast path using memcmp directly on the skb data for linear skbs and a "slow" path for non-linear skbs fetching the needed byte sequence from the relevant fragments first. The cmp ematch and u32 ematch and classifier could fetch the needed bucket via a function tcf_read_at_offset taking an offset and the length of the bucket {8|16|32} which iterates over the fragments as needed. I know, for most cases it is not needed but it shouldn't cost us too much. Thoughts? From bcrl@kvack.org Thu Jan 27 07:28:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 07:28:50 -0800 (PST) Received: from kanga.kvack.org (kanga.kvack.org [66.96.29.28]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RFShbA025448 for ; Thu, 27 Jan 2005 07:28:46 -0800 Received: (from localhost user: 'bcrl' uid#63042 fake: STDIN (bcrl@kanga.kvack.org)) by kvack.org id ; Thu, 27 Jan 2005 10:28:23 -0500 Date: Thu, 27 Jan 2005 10:28:23 -0500 From: Benjamin LaHaise To: davem@davemloft.net Cc: netdev@oss.sgi.com Subject: remove excess initializer Message-ID: <20050127152823.GA6420@kvack.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 869 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bcrl@kvack.org Precedence: bulk X-list: netdev Content-Length: 643 Lines: 27 Hello, The patch below removes some useless code bloat that is left over from who knows when. -ben -- "Time is what keeps everything from happening all at once." -- John Wheeler diff -purN linux-2.6.11-rc2/net/socket.c linux-2.6.11-rc2.bcrl/net/socket.c --- linux-2.6.11-rc2/net/socket.c 2005-01-24 10:19:24.000000000 -0500 +++ linux-2.6.11-rc2.bcrl/net/socket.c 2005-01-27 10:25:18.296037875 -0500 @@ -2029,13 +2029,6 @@ void __init sock_init(void) int i; /* - * Initialize all address (protocol) families. - */ - - for (i = 0; i < NPROTO; i++) - net_families[i] = NULL; - - /* * Initialize sock SLAB cache. */ From flamingice@sourmilk.net Thu Jan 27 08:24:40 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 08:24:49 -0800 (PST) Received: from server8.totalchoicehosting.com (server8.totalchoicehosting.com [216.180.241.250]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RGOeTS032282 for ; Thu, 27 Jan 2005 08:24:40 -0800 Received: from host-24-225-148-91.patmedia.net ([24.225.148.91] helo=[192.168.0.100]) by server8.totalchoicehosting.com with esmtpsa (TLSv1:RC4-MD5:128) (Exim 4.44) id 1CuCRd-00038L-N3 for netdev@oss.sgi.com; Thu, 27 Jan 2005 11:24:33 -0500 From: Michael Wu To: netdev@oss.sgi.com Subject: Re: Where Linux 802.11x support needs work Date: Thu, 27 Jan 2005 11:24:13 -0500 User-Agent: KMail/1.7.1 References: <20050126024039.GA25326@bougret.hpl.hp.com> <200501252341.27041.flamingice@sourmilk.net> <41F74757.3090104@tihlde.org> In-Reply-To: <41F74757.3090104@tihlde.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart5833706.pRRU4JzTVu"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501271124.19740.flamingice@sourmilk.net> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server8.totalchoicehosting.com X-AntiAbuse: Original Domain - oss.sgi.com X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - sourmilk.net X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 870 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: flamingice@sourmilk.net Precedence: bulk X-list: netdev Content-Length: 1629 Lines: 47 --nextPart5833706.pRRU4JzTVu Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wednesday 26 January 2005 2:31 am, Roar Bj=F8rgum Rotvik wrote: > Michael Wu wrote: > > On Tuesday 25 January 2005 11:03 pm, Dan Williams wrote: > >>> One of the big item not mentionned by you is the in-kernel > >>>802.11 stack (native frames and management). If done right, I guess it > >>>would mostly be transparent to you... > >> > >>You know, I was thinking of it and I just forgot to put it on the list. > >>If you're including madwifi and ipw2x00, we have a grand total of what,= 3 > >>or 4 802.11 stacks in the kernel at the same time? (madwifi, > >>orinoco/hermes, ipw2x00, linux-wlan-ng) > > > > Only orinoco/hermes is in the kernel, and that doesn't really have much > > of an 802.11 stack, since most things are done in hardware. Madwifi has= a > > fairly complete 802.11 stack (ported from netbsd), and so does adm8211. > > Dunno about ipw2x00. > > Do any of these 80.11 stacks (or the upstream linux network stack) have > a solution for WLAN cards with 802.11e (QoS extension) with more than > one HW/firmware transmit queues? > I'm not aware of any. The latest revision of the adm8211 chip supports more= =20 than one tx queue, but only one is used. =2DMichael Wu --nextPart5833706.pRRU4JzTVu Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iD8DBQBB+RWzyWWBbDEe0UIRAsvQAKC2Hohfpza8M4mWicwC+l0LuuBQMACcCPe2 qDh28cG5ClFTufEqSurfcAY= =zs4Z -----END PGP SIGNATURE----- --nextPart5833706.pRRU4JzTVu-- From jt@hpl.hp.com Thu Jan 27 08:47:34 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 08:47:39 -0800 (PST) Received: from palrel13.hp.com (palrel13.hp.com [156.153.255.238]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RGlXRw001611 for ; Thu, 27 Jan 2005 08:47:33 -0800 Received: from tomil.hpl.hp.com (tomil.hpl.hp.com [15.0.152.100]) by palrel13.hp.com (Postfix) with ESMTP id BAE831C07E82; Thu, 27 Jan 2005 08:47:06 -0800 (PST) Received: from bougret.hpl.hp.com (bougret.hpl.hp.com [15.4.92.227]) by tomil.hpl.hp.com (8.9.3 (PHNE_29774)/8.9.3 HPLabs Timeshare Server) with ESMTP id IAA27805; Thu, 27 Jan 2005 08:49:04 -0800 (PST) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 1CuCnR-0000Cl-00; Thu, 27 Jan 2005 08:47:05 -0800 Date: Thu, 27 Jan 2005 08:47:05 -0800 To: "Randy.Dunlap" Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH] (v2) arlan: remove gcc warning with CONFIG_PROC_FS=n Message-ID: <20050127164705.GC747@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com References: <41F7369E.8070704@osdl.org> <41F84605.5060501@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F84605.5060501@osdl.org> User-Agent: Mutt/1.3.28i Organisation: HP Labs Palo Alto Address: HP Labs, 1U-17, 1501 Page Mill road, Palo Alto, CA 94304, USA. E-mail: jt@hpl.hp.com From: Jean Tourrilhes X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 871 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jt@hpl.hp.com Precedence: bulk X-list: netdev Content-Length: 624 Lines: 23 On Wed, Jan 26, 2005 at 05:38:13PM -0800, Randy.Dunlap wrote: > Here's an update (as pointed out off-list). > Please replace the first one if that works for you. > > > arlan: Fix gcc warning. > > With CONFIG_PROC_FS=n, gcc complains: > drivers/net/wireless/arlan-main.c:1858: warning: statement with no effect > > Also remove a useless semi-colon on a #define. > > Signed-off-by: Randy Dunlap > > diffstat:= > drivers/net/wireless/arlan.h | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) I've never touched that driver, but it looks ok to me. I hope Jeff will pick it up. Jean From rmk+netdev=oss.sgi.com@arm.linux.org.uk Thu Jan 27 08:49:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 08:49:43 -0800 (PST) Received: from caramon.arm.linux.org.uk (caramon.arm.linux.org.uk [212.18.232.186]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RGnZPt002072 for ; Thu, 27 Jan 2005 08:49:36 -0800 Received: from flint.arm.linux.org.uk ([2002:d412:e8ba:1:201:2ff:fe14:8fad]) by caramon.arm.linux.org.uk with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.41) id 1CuCpb-0001Yn-MC; Thu, 27 Jan 2005 16:49:20 +0000 Received: from rmk by flint.arm.linux.org.uk with local (Exim 4.41) id 1CuCpa-0001ud-IB; Thu, 27 Jan 2005 16:49:18 +0000 Date: Thu, 27 Jan 2005 16:49:18 +0000 From: Russell King To: Robert Olsson Cc: Andrew Morton , torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? Message-ID: <20050127164918.C3036@flint.arm.linux.org.uk> Mail-Followup-To: Robert Olsson , Andrew Morton , torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com References: <20050123091154.GC16648@suse.de> <20050123011918.295db8e8.akpm@osdl.org> <20050123095608.GD16648@suse.de> <20050123023248.263daca9.akpm@osdl.org> <20050123200315.A25351@flint.arm.linux.org.uk> <20050124114853.A16971@flint.arm.linux.org.uk> <20050125193207.B30094@flint.arm.linux.org.uk> <20050127082809.A20510@flint.arm.linux.org.uk> <20050127004732.5d8e3f62.akpm@osdl.org> <16888.58622.376497.380197@robur.slu.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <16888.58622.376497.380197@robur.slu.se>; from Robert.Olsson@data.slu.se on Thu, Jan 27, 2005 at 01:56:30PM +0100 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 872 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rmk+lkml@arm.linux.org.uk Precedence: bulk X-list: netdev Content-Length: 4780 Lines: 101 On Thu, Jan 27, 2005 at 01:56:30PM +0100, Robert Olsson wrote: > > Andrew Morton writes: > > Russell King wrote: > > > > ip_dst_cache 1292 1485 256 15 1 > > > I guess we should find a way to make it happen faster. > > Here is route DoS attack. Pure routing no NAT no filter. > > Start > ===== > ip_dst_cache 5 30 256 15 1 : tunables 120 60 8 : slabdata 2 2 0 > > After DoS > ========= > ip_dst_cache 66045 76125 256 15 1 : tunables 120 60 8 : slabdata 5075 5075 480 > > After some GC runs. > ================== > ip_dst_cache 2 15 256 15 1 : tunables 120 60 8 : slabdata 1 1 0 > > No problems here. I saw Martin talked about NAT... Yes, I can reproduce that same behaviour, where I can artificially inflate the DST cache and the GC does run and trims it back down to something reasonable. BUT, over time, my DST cache just increases in size and won't trim back down. Not even by writing to the /proc/sys/net/ipv4/route/flush sysctl (which, if I'm reading the code correctly - and would be nice to know from those who actually know this stuff - should force an immediate flush of the DST cache.) For instance, I have (in sequence): # cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo 581 ip_dst_cache 1860 1860 256 15 1 : tunables 120 60 0 : slabdata 124 124 0 # cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo 717 ip_dst_cache 1995 1995 256 15 1 : tunables 120 60 0 : slabdata 133 133 0 # cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo 690 ip_dst_cache 1995 1995 256 15 1 : tunables 120 60 0 : slabdata 133 133 0 # cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo 696 ip_dst_cache 1995 1995 256 15 1 : tunables 120 60 0 : slabdata 133 133 0 # cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo 700 ip_dst_cache 1995 1995 256 15 1 : tunables 120 60 0 : slabdata 133 133 0 # cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo 718 ip_dst_cache 1993 1995 256 15 1 : tunables 120 60 0 : slabdata 133 133 0 # cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo 653 ip_dst_cache 1993 1995 256 15 1 : tunables 120 60 0 : slabdata 133 133 0 # cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo 667 ip_dst_cache 1956 1995 256 15 1 : tunables 120 60 0 : slabdata 133 133 0 # cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo 620 ip_dst_cache 1944 1995 256 15 1 : tunables 120 60 0 : slabdata 133 133 0 # cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo 623 ip_dst_cache 1920 1995 256 15 1 : tunables 120 60 0 : slabdata 133 133 0 # cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo 8 ip_dst_cache 1380 1980 256 15 1 : tunables 120 60 0 : slabdata 132 132 0 # cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo 86 ip_dst_cache 1375 1875 256 15 1 : tunables 120 60 0 : slabdata 125 125 0 so obviously the GC does appear to be working - as can be seen from the number of entries in /proc/net/rt_cache. However, the number of objects in the slab cache does grow day on day. About 4 days ago, it was only about 600 active objects. Now it's more than twice that, and it'll continue increasing until it hits 8192, where upon it's game over. And, here's the above with /proc/net/stat/rt_cache included: # cat /proc/net/rt_cache|wc -l;grep ip_dst /proc/slabinfo; cat /proc/net/stat/rt_cache 61 ip_dst_cache 1340 1680 256 15 1 : tunables 120 60 0 : slabdata 112 112 0 entries in_hit in_slow_tot in_no_route in_brd in_martian_dst in_martian_src out_hit out_slow_tot out_slow_mc gc_total gc_ignored gc_goal_miss gc_dst_overflow in_hlist_search out_hlist_search 00000538 005c9f10 0005e163 00000000 00000013 000002e2 00000000 00000005 003102e3 00038f6d 00000000 0007887a 0005286d 00001142 00000000 00138855 0010848d notice how /proc/net/stat/rt_cache says there's 1336 entries in the route cache. _Where_ are they? They're not there according to /proc/net/rt_cache. (PS, the formatting of the headings in /proc/net/stat/rt_cache doesn't appear to tie up with the formatting of the data which is _really_ confusing.) -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/ 2.6 Serial core From kaber@trash.net Thu Jan 27 09:50:58 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 09:51:03 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RHovZm005184 for ; Thu, 27 Jan 2005 09:50:58 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.43) id 1CuDn8-0004XF-S6; Thu, 27 Jan 2005 18:50:50 +0100 Message-ID: <41F929FA.3050800@trash.net> Date: Thu, 27 Jan 2005 18:50:50 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050106 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: bdschuym@pandora.be, netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org, snort2004@mail.ru, rusty@rustcorp.com.au, ak@suse.de, bridge@osdl.org, gandalf@wlug.westbo.se, dwmw2@infradead.org, shemminger@osdl.org Subject: Re: [PATCH/RFC] Reduce call chain length in netfilter References: <1131604877.20041218092730@mail.ru.suse.lists.linux.kernel> <1105117559.11753.34.camel@baythorne.infradead.org> <20050107100017.454ddadc@dxpl.pdx.osdl.net> <1105133241.3375.16.camel@localhost.localdomain> <20050118135735.4b77d38d.davem@davemloft.net> <1106433059.4486.11.camel@localhost.localdomain> <1106436153.20995.42.camel@tux.rsn.bth.se> <1106484019.3376.5.camel@localhost.localdomain> <1106496509.1085.1.camel@tux.rsn.bth.se> <20050125220558.6e824f8a.davem@davemloft.net> <1106730510.4041.4.camel@localhost.localdomain> <41F82C6D.7020006@trash.net> <20050126231801.7bf90338.davem@davemloft.net> In-Reply-To: <20050126231801.7bf90338.davem@davemloft.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 873 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 1904 Lines: 53 David S. Miller wrote: >While reviewing I thought it may be an issue that the new macros >potentially change skb. It really isn't an issue because NF_HOOK() >calls pass ownership of the SKB over from the caller. > >Although technically, someone could go: > > skb_get(skb); > err = NF_HOOK(... skb ...); > ... do stuff with skb ... > kfree_skb(skb); > >but that would cause other problems and I audited the entire tree >and nobody attempts anything like this currently. 'skb' always >dies at the NF_HOOK() call site. > Yes, it has always been illegal to use the skb after NF_HOOK. >Another huge downside to this change I was worried about >was from a code generation point of view. Since we now take the >address of "skb", gcc cannot generate tail-calls for the common >case of: > > return NF_HOOK(...); > >when netfilter is enabled. Ho hum... > From what I can see it doesn't generate tail-calls currently: 34c: 45 31 c0 xor %r8d,%r8d 34f: 4c 89 e2 mov %r12,%rdx 352: be 01 00 00 00 mov $0x1,%esi 357: bf 02 00 00 00 mov $0x2,%edi 35c: c7 04 24 00 00 00 80 movl $0x80000000,(%rsp) 363: e8 00 00 00 00 callq 368 364: R_X86_64_PC32 nf_hook_slow+0xfffffffffffffffc 368: 48 83 c4 10 add $0x10,%rsp 36c: 5b pop %rbx 36d: 5d pop %rbp 36e: 41 5c pop %r12 370: c3 retq According to something I found on the internet, gcc only optimizes tail-calls if some conditions are met, in this case most importantly the space required for the arguments to the function called at the tail must not exceed the space required for the arguments of the function itself. nf_hook_slow takes 6 arguments, probably more than any caller. Regards Patrick From mrenzmann@web.de Thu Jan 27 10:09:32 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 10:09:36 -0800 (PST) Received: from smtp05.web.de (smtp05.web.de [217.72.192.209]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RI9VrU006433 for ; Thu, 27 Jan 2005 10:09:32 -0800 Received: from [195.14.201.115] (helo=[192.168.2.42]) by smtp05.web.de with asmtp (TLSv1:RC4-MD5:128) (WEB.DE 4.103 #192) id 1CuE58-0008K6-00 for netdev@oss.sgi.com; Thu, 27 Jan 2005 19:09:26 +0100 Message-ID: <41F92E54.7020908@web.de> Date: Thu, 27 Jan 2005 19:09:24 +0100 From: Michael Renzmann User-Agent: Mozilla Thunderbird 0.8 (X11/20040916) X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: Re: Where Linux 802.11x support needs work References: <20050126024039.GA25326@bougret.hpl.hp.com> <200501252341.27041.flamingice@sourmilk.net> <41F74757.3090104@tihlde.org> In-Reply-To: <41F74757.3090104@tihlde.org> X-Enigmail-Version: 0.86.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Sender: mrenzmann@web.de X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 874 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mrenzmann@web.de Precedence: bulk X-list: netdev Content-Length: 474 Lines: 13 Hi. Roar Bjørgum Rotvik wrote: > Is there an existing solution for this problem, or is an > multiqueue-pr-device solution being planned as part of introducing a > common 802.11 stack in the kernel? Some (most or all?) Atheros chipsets have several priority queues. As far as I can tell Madwifi is prepared for supporting them, as well as the underlying 802.11 stack that has been ported from BSD. But I may be wrong, as I'm by no means a madwifi-wizard :) Bye, Mike From kernel@linuxace.com Thu Jan 27 10:37:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 10:37:59 -0800 (PST) Received: from linuxace.com (adsl-67-120-171-161.dsl.lsan03.pacbell.net [67.120.171.161]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0RIbrHi007764 for ; Thu, 27 Jan 2005 10:37:54 -0800 Received: (qmail 14034 invoked by uid 0); 27 Jan 2005 18:37:45 -0000 Date: Thu, 27 Jan 2005 10:37:45 -0800 From: Phil Oester To: Robert Olsson , Andrew Morton , torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? Message-ID: <20050127183745.GA13365@linuxace.com> References: <20050123011918.295db8e8.akpm@osdl.org> <20050123095608.GD16648@suse.de> <20050123023248.263daca9.akpm@osdl.org> <20050123200315.A25351@flint.arm.linux.org.uk> <20050124114853.A16971@flint.arm.linux.org.uk> <20050125193207.B30094@flint.arm.linux.org.uk> <20050127082809.A20510@flint.arm.linux.org.uk> <20050127004732.5d8e3f62.akpm@osdl.org> <16888.58622.376497.380197@robur.slu.se> <20050127164918.C3036@flint.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050127164918.C3036@flint.arm.linux.org.uk> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 875 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kernel@linuxace.com Precedence: bulk X-list: netdev Content-Length: 749 Lines: 17 On Thu, Jan 27, 2005 at 04:49:18PM +0000, Russell King wrote: > so obviously the GC does appear to be working - as can be seen from the > number of entries in /proc/net/rt_cache. However, the number of objects > in the slab cache does grow day on day. About 4 days ago, it was only > about 600 active objects. Now it's more than twice that, and it'll > continue increasing until it hits 8192, where upon it's game over. I can confirm the behavior you are seeing -- does seem to be a leak somewhere. Below from a heavily used gateway with 26 days uptime: # wc -l /proc/net/rt_cache ; grep ip_dst /proc/slabinfo 12870 /proc/net/rt_cache ip_dst_cache 53327 57855 Eventually I get the dst_cache overflow errors and have to reboot. Phil From rmk+netdev=oss.sgi.com@arm.linux.org.uk Thu Jan 27 11:25:19 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 11:25:25 -0800 (PST) Received: from caramon.arm.linux.org.uk (caramon.arm.linux.org.uk [212.18.232.186]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RJPIci010185 for ; Thu, 27 Jan 2005 11:25:19 -0800 Received: from flint.arm.linux.org.uk ([2002:d412:e8ba:1:201:2ff:fe14:8fad]) by caramon.arm.linux.org.uk with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.41) id 1CuFGM-0001hB-FG; Thu, 27 Jan 2005 19:25:07 +0000 Received: from rmk by flint.arm.linux.org.uk with local (Exim 4.41) id 1CuFGL-0003PZ-2K; Thu, 27 Jan 2005 19:25:05 +0000 Date: Thu, 27 Jan 2005 19:25:04 +0000 From: Russell King To: Phil Oester Cc: Robert Olsson , Andrew Morton , torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? Message-ID: <20050127192504.D3036@flint.arm.linux.org.uk> Mail-Followup-To: Phil Oester , Robert Olsson , Andrew Morton , torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com References: <20050123095608.GD16648@suse.de> <20050123023248.263daca9.akpm@osdl.org> <20050123200315.A25351@flint.arm.linux.org.uk> <20050124114853.A16971@flint.arm.linux.org.uk> <20050125193207.B30094@flint.arm.linux.org.uk> <20050127082809.A20510@flint.arm.linux.org.uk> <20050127004732.5d8e3f62.akpm@osdl.org> <16888.58622.376497.380197@robur.slu.se> <20050127164918.C3036@flint.arm.linux.org.uk> <20050127183745.GA13365@linuxace.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20050127183745.GA13365@linuxace.com>; from kernel@linuxace.com on Thu, Jan 27, 2005 at 10:37:45AM -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 876 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rmk+lkml@arm.linux.org.uk Precedence: bulk X-list: netdev Content-Length: 1208 Lines: 27 On Thu, Jan 27, 2005 at 10:37:45AM -0800, Phil Oester wrote: > On Thu, Jan 27, 2005 at 04:49:18PM +0000, Russell King wrote: > > so obviously the GC does appear to be working - as can be seen from the > > number of entries in /proc/net/rt_cache. However, the number of objects > > in the slab cache does grow day on day. About 4 days ago, it was only > > about 600 active objects. Now it's more than twice that, and it'll > > continue increasing until it hits 8192, where upon it's game over. > > I can confirm the behavior you are seeing -- does seem to be a leak > somewhere. Below from a heavily used gateway with 26 days uptime: > > # wc -l /proc/net/rt_cache ; grep ip_dst /proc/slabinfo > 12870 /proc/net/rt_cache > ip_dst_cache 53327 57855 > > Eventually I get the dst_cache overflow errors and have to reboot. Can you provide some details, eg kernel configuration, loaded modules and a brief overview of any netfilter modules you may be using. Maybe we can work out what's common between our setups. -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/ 2.6 Serial core From david-b@pacbell.net Thu Jan 27 11:28:58 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 11:29:03 -0800 (PST) Received: from ylpvm43.prodigy.net (ylpvm43-ext.prodigy.net [207.115.57.74]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RJSuGE010712 for ; Thu, 27 Jan 2005 11:28:57 -0800 Received: from ascent (adsl-69-107-48-231.dsl.pltn13.pacbell.net [69.107.48.231]) by ylpvm43.prodigy.net (8.12.10 outbound/8.12.10) with ESMTP id j0RJT22Y017347; Thu, 27 Jan 2005 14:29:03 -0500 From: David Brownell To: Janos Farkas Subject: Re: 2.6.11-rc2 TCP ignores PMTU ICMP (Re: Linux 2.6.11-rc2) Date: Thu, 27 Jan 2005 11:28:48 -0800 User-Agent: KMail/1.7.1 Cc: David Ford , linux-kernel@vger.kernel.org, netdev@oss.sgi.com References: <200501232251.42394.david-b@pacbell.net> <200501251054.37053.david-b@pacbell.net> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501271128.48411.david-b@pacbell.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 877 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: david-b@pacbell.net Precedence: bulk X-list: netdev Content-Length: 3250 Lines: 58 On Thursday 27 January 2005 1:02 am, Janos Farkas wrote: > On 2005-01-25 at 10:54:36, David Brownell wrote: > > On Tuesday 25 January 2005 10:35 am, David Ford wrote: > > > PMTU bug -- or better said, bad firewall admin who blocks all ICMP. > > > > PMTU bug, sure -- but one that came late in RC2. Remember: same firewall > > in both cases, but only RC2 breaks. The ICMP packet has landed in > > the RC2 system, which ignores it. 2.6.10 handled it correctly... I > > suspect one of the TCP cleanups borked this. And in fact, I'm pretty sure RC1 handled it fine too. This failure appeared in a BK pull I did a couple days before RC2, and installing it clobbered a "more virgin" RC1 install; so it's hard to verify. It took a while to track the failure mode down to being PMTU related, but the only TCP-related changes I noticed in what I pulled sure seemed like cleanups (removing some "duplicated" state). > > My current workaround is "ifconfig eth0 mtu 1492" but that's not > > something I'd expect to keep. > > Indeed, I had to shuffle my machines around a bit to get a proof that > something is broken, but now I can confirm the above with a connection > to cvs.sourceforge.net: Thanks for confirming it wasn't just me ... I confess I'm a bit surprised more folk haven't reported this yet! Your symptoms are exactly like those I saw, just with a different mission-critical application: CVS, not SMTP. Did you happen to notice whether CVS pulls worked, when pushes (like this) failed? - Dave > ... > > (the PPPoE gateway notifies the host about the PMTU issue, one for each > segment) > > 08:05:45.265330 IP (tos 0xc0, ttl 128, id 17970, offset 0, flags [none], length: 576) 192.168.59.1 > 192.168.59.10: icmp 556: 66.35.250.207 unreachable - need to frag (mtu 1492) > 08:05:45.265453 IP (tos 0xc0, ttl 128, id 17971, offset 0, flags [none], length: 576) 192.168.59.1 > 192.168.59.10: icmp 556: 66.35.250.207 unreachable - need to frag (mtu 1492) > > (the source host sends the full frame again...?) > > 08:05:45.770331 IP (tos 0x0, ttl 64, id 21544, offset 0, flags [DF], length: 1500) 192.168.59.10.29612 > 66.35.250.207.2401: . [tcp sum ok] 499:1947(1448) ack 526 win 1728 > 08:05:45.770900 IP (tos 0xc0, ttl 128, id 17972, offset 0, flags [none], length: 576) 192.168.59.1 > 192.168.59.10: icmp 556: 66.35.250.207 unreachable - need to frag (mtu 1492) > > (and looping goes on..) > > 08:05:46.783148 IP (tos 0x0, ttl 64, id 21546, offset 0, flags [DF], length: 1500) 192.168.59.10.29612 > 66.35.250.207.2401: . [tcp sum ok] 499:1947(1448) ack 526 win 1728 > 08:05:46.783752 IP (tos 0xc0, ttl 128, id 17973, offset 0, flags [none], length: 576) 192.168.59.1 > 192.168.59.10: icmp 556: 66.35.250.207 unreachable - need to frag (mtu 1492) > 08:05:48.808861 IP (tos 0x0, ttl 64, id 21548, offset 0, flags [DF], length: 1500) 192.168.59.10.29612 > 66.35.250.207.2401: . [tcp sum ok] 499:1947(1448) ack 526 win 1728 > 08:05:48.809882 IP (tos 0xc0, ttl 128, id 17974, offset 0, flags [none], length: 576) 192.168.59.1 > 192.168.59.10: icmp 556: 66.35.250.207 unreachable - need to frag (mtu 1492) > > ... > From davem@davemloft.net Thu Jan 27 11:51:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 11:52:01 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RJpsX0011776 for ; Thu, 27 Jan 2005 11:51:54 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CuFby-0003zV-00; Thu, 27 Jan 2005 11:47:26 -0800 Date: Thu, 27 Jan 2005 11:47:26 -0800 From: "David S. Miller" To: Patrick McHardy Cc: bdschuym@pandora.be, netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org, snort2004@mail.ru, rusty@rustcorp.com.au, ak@suse.de, bridge@osdl.org, gandalf@wlug.westbo.se, dwmw2@infradead.org, shemminger@osdl.org Subject: Re: [PATCH/RFC] Reduce call chain length in netfilter Message-Id: <20050127114726.2205b4ed.davem@davemloft.net> In-Reply-To: <41F929FA.3050800@trash.net> References: <1131604877.20041218092730@mail.ru.suse.lists.linux.kernel> <1105117559.11753.34.camel@baythorne.infradead.org> <20050107100017.454ddadc@dxpl.pdx.osdl.net> <1105133241.3375.16.camel@localhost.localdomain> <20050118135735.4b77d38d.davem@davemloft.net> <1106433059.4486.11.camel@localhost.localdomain> <1106436153.20995.42.camel@tux.rsn.bth.se> <1106484019.3376.5.camel@localhost.localdomain> <1106496509.1085.1.camel@tux.rsn.bth.se> <20050125220558.6e824f8a.davem@davemloft.net> <1106730510.4041.4.camel@localhost.localdomain> <41F82C6D.7020006@trash.net> <20050126231801.7bf90338.davem@davemloft.net> <41F929FA.3050800@trash.net> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 878 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 669 Lines: 29 On Thu, 27 Jan 2005 18:50:50 +0100 Patrick McHardy wrote: > From what I can see it doesn't generate tail-calls currently: Indeed... It even doesn't do this on Sparc64 either, even for the okfn(skb) call which I was sure it would. It won't tail-call for function pointers for some strance reason as exhibited by this simple test: struct sk_buff { int foo; }; int invoke(struct sk_buff *skb, int (*okfn)(struct sk_buff *)) { return okfn(skb); } extern int test_func(struct sk_buff *); int invoke2(struct sk_buff *skb) { return test_func(skb); } In the generated asm on sparc64, invoke2() gets a tail-call whereas invoke() does not. Hmmm... From davem@davemloft.net Thu Jan 27 11:53:17 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 11:53:24 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RJrHtA012125 for ; Thu, 27 Jan 2005 11:53:17 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CuFdK-00040e-00; Thu, 27 Jan 2005 11:48:50 -0800 Date: Thu, 27 Jan 2005 11:48:50 -0800 From: "David S. Miller" To: Benjamin LaHaise Cc: netdev@oss.sgi.com Subject: Re: remove excess initializer Message-Id: <20050127114850.386a6fea.davem@davemloft.net> In-Reply-To: <20050127152823.GA6420@kvack.org> References: <20050127152823.GA6420@kvack.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 879 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 241 Lines: 9 On Thu, 27 Jan 2005 10:28:23 -0500 Benjamin LaHaise wrote: > The patch below removes some useless code bloat that is left over from > who knows when. That thing is older than the dinosaurs :-) Patch applied, thanks Ben. From jf-ml-k1-1087813225@lk8rp.mail.xeon.eu.org Thu Jan 27 12:01:06 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 12:01:10 -0800 (PST) Received: from www.acomp.hu (acomp.externet.hu [212.40.96.68]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0RK14SG012884 for ; Thu, 27 Jan 2005 12:01:05 -0800 Received: (qmail 26778 invoked from network); 27 Jan 2005 20:00:59 -0000 Received: from smail.acomp.hu ([undisclosed]) by www.acomp.hu ([127.0.0.1]) with ESMTP via TCP; 27 Jan 2005 20:00:59 -0000 Date: Thu, 27 Jan 2005 21:00:56 +0100 From: Janos Farkas To: David Brownell Cc: David Ford , linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: 2.6.11-rc2 TCP ignores PMTU ICMP (Re: Linux 2.6.11-rc2) Message-ID: Mail-Followup-To: David Brownell , David Ford , linux-kernel@vger.kernel.org, netdev@oss.sgi.com References: <200501232251.42394.david-b@pacbell.net> <200501251054.37053.david-b@pacbell.net> <200501271128.48411.david-b@pacbell.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200501271128.48411.david-b@pacbell.net> User-Agent: Mutt/1.5.6i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 880 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jf-ml-k1-1087813225@lk8rp.mail.xeon.eu.org Precedence: bulk X-list: netdev Content-Length: 1076 Lines: 22 On 2005-01-27 at 11:28:48, David Brownell wrote: > > Indeed, I had to shuffle my machines around a bit to get a proof that > > something is broken, but now I can confirm the above with a connection > > to cvs.sourceforge.net: > > Thanks for confirming it wasn't just me ... I confess I'm a bit > surprised more folk haven't reported this yet! > > Your symptoms are exactly like those I saw, just with a different > mission-critical application: CVS, not SMTP. Did you happen to > notice whether CVS pulls worked, when pushes (like this) failed? I'm familiar with symptoms arising from various stochastic/assymetric networking problems with larger frames, I had cable :) This was a pull (update), BTW, CVS can send more data in this situation too. But it turned painfully obvious when trying to send mail to LK via SMTP. Oh, but while plain rc2 may have this problem, this particular endpoint had rc2-bk3 running. I also chose to set the ethernet MTU to 1492 as an easy workaround... -- Janos | romfs is at http://romfs.sourceforge.net/ | Don't talk about silence. From pablo@eurodev.net Thu Jan 27 12:17:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 12:17:55 -0800 (PST) Received: from smtp07.retemail.es (smtp07.auna.com [62.81.186.17]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RKHlDx014785 for ; Thu, 27 Jan 2005 12:17:48 -0800 Received: from eurodev.net ([85.136.124.194]) by smtp07.retemail.es (InterMail vM.6.01.03.05 201-2131-111-107-20040910) with ESMTP id <20050127201741.JUEH24485.smtp07.retemail.es@eurodev.net>; Thu, 27 Jan 2005 21:17:41 +0100 Message-ID: <41F94C63.7010800@eurodev.net> Date: Thu, 27 Jan 2005 21:17:39 +0100 From: Pablo Neira User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5 X-Accept-Language: en MIME-Version: 1.0 To: Thomas Graf CC: Jamal Hadi Salim , Patrick McHardy , netdev@oss.sgi.com Subject: Re: [RFC] string matching ematch References: <20050126150714.GL31837@postel.suug.ch> In-Reply-To: <20050126150714.GL31837@postel.suug.ch> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 881 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pablo@eurodev.net Precedence: bulk X-list: netdev Content-Length: 1014 Lines: 28 Hi Thomas, Thomas Graf wrote: >I'd like to discuss the string matching ematch, I don't care about the >algorithm used but rather whether to make it stateful, match over >fragments, etc. I attached a simple stateless string matching ematch >using the Knuth-Morris-Pratt algorithm as a starting point. > > I've posted something similar after christmas in netfilter-devel[1]. It's fragment aware, actually my implementation uses boyer-moore to look for matches in the payload, and it uses brute force together with Rusty's skb_iter stuff to look for matches on the edges. The worst case is not that bad for small patterns. Anyway I'm still looking for alternatives solutions. BTW, Harald Welte is also interested in this stuff. I'll give it more spins these days since I've got some spare time. I'll also have a look at your work. I think that we could join efforts and push something good, thoughts? References: https://lists.netfilter.org/pipermail/netfilter-devel/2005-January/018034.html -- Pablo From dale@farnsworth.org Thu Jan 27 12:19:57 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 12:20:04 -0800 (PST) Received: from xyzzy.farnsworth.org (qmailr@h142-az.mvista.com [65.200.49.142] (may be forged)) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0RKJuJ1018714 for ; Thu, 27 Jan 2005 12:19:56 -0800 Received: (qmail 6945 invoked by uid 1000); 27 Jan 2005 20:19:55 -0000 From: "Dale Farnsworth" Date: Thu, 27 Jan 2005 13:19:55 -0700 To: Jeff Garzik , netdev@oss.sgi.com Cc: Ralf Baechle , Manish Lachwani , Brian Waite , "Steven J. Hill" , Benjamin Herrenschmidt Subject: Re: MV643xx Ethernet 2.6 driver update Message-ID: <20050127201955.GC1452@xyzzy> References: <20050117184019.GA24655@xyzzy> <41F8BACA.1020302@pobox.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="FkmkrVfFsRoUs1wW" Content-Disposition: inline In-Reply-To: <41F8BACA.1020302@pobox.com> User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 882 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dale@farnsworth.org Precedence: bulk X-list: netdev Content-Length: 10688 Lines: 301 --FkmkrVfFsRoUs1wW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jan 27, 2005 at 09:56:26AM +0000, Jeff Garzik wrote: > Ouch: I'm sorry for the pain I caused you. :) > When using BitKeeper, you need to make sure your changes are the only > ones in the tree. It doesn't work for me to pull: > > mv643xx-enet -> jgarzik-mv643xx-enet -> net-drivers-2.6 -> linus > > because that would require pulling the entire netdev-2.6 tree up through > that chain. Oops. Yes, I had cloned the netdev-2.6 tree and I see why that doesn't work. I've now put the changes into a tree cloned from linux-2.5. I sure hope this works better Jeff. In addition to these changesets previously submitted: A. Remove redundant or unneeded code. B. Replace fixed count spins with udelay/msleep waits on hardware status bits C. Fix code to enable hardware checksum generation for TX packets D. Convert from pci_map_* to dma_map_* interface E. Add device driver model support. F. Add support for several configurable parameters via platform_device G. Make use of MV64340_RX_QUEUE_FILL_ON_TASK macro consistent. H. Simplify mv64340_eth_set_rx_mode() I. Clean up receive buffer sizing J. Call netif_carrier_off/netif_carrier_on on a link down/up condition K. Add support for PHYs/boards that don't support autonegotiation. I've added the following changesets: L. Remove a spurious left paren causing an obvious syntax error in the #ifndef MV64340_NAPI case M. Add a function to detect at runtime whether a PHY is attached to the specified port. N. Run mv643xx_eth.[ch] through scripts/Lindent O. Additional whitespace cleanups, mostly changing spaces to tabs in comments P. Rename MV_READ => mv_read and MV_WRITE => mv_write Q. Rename MV64340 => MV643XX and mv64340 => mv643xx I've attached patches for L and M below, but omitted N-Q since they are large and only cosmetic. Thanks, -Dale Please do a bk pull bk://dfarnsworth.bkbits.net/linux-2.5-mv643xx-enet This will update the following files: drivers/net/mv643xx_eth.c | 2398 ++++++++++++++++++++++++---------------------- drivers/net/mv643xx_eth.h | 603 +++-------- include/linux/mv643xx.h | 434 ++++++-- 3 files changed, 1776 insertions(+), 1659 deletions(-) through these ChangeSets: (05/01/27 1.1975.53.17) Big rename. Change MV64340 => MV643XX and mv64340 => mv643xx Signed-off-by: Dale Farnsworth (05/01/27 1.1975.53.16) Rename MV_READ => mv_read and MV_WRITE => mv_write Signed-off-by: Dale Farnsworth (05/01/27 1.1975.53.15) Additional whitespace cleanups, mostly changing spaces to tabs in comments (05/01/27 1.1975.53.14) Run mv643xx_eth.[ch] through scripts/Lindent Signed-off-by: Dale Farnsworth (05/01/27 1.1975.53.13) Add a function to detect at runtime whether a PHY is attached to the specified port, and use it to cause the probe routine to fail when there is no PHY. Signed-off-by: Dale Farnsworth (05/01/27 1.1975.53.12) This one liner removes a spurious left paren fixing an obvious syntax error in the #ifndef MV64340_NAPI case (05/01/27 1.1975.53.11) Add support for PHYs/boards that don't support autonegotiation. Signed-off-by: Brian Waite Signed-off-by: Dale Farnsworth (05/01/27 1.1975.53.10) With this patch, the driver now calls netif_carrier_off/netif_carrier_on on a link down/up condition. Signed-off-by: Dale Farnsworth (05/01/27 1.1975.53.9) This patch cleans up the handling of receive skb sizing. Signed-off-by: Dale Farnsworth (05/01/14 1.1975.53.8) This patch simplifies the mv64340_eth_set_rx_mode function without changing its behavior. Signed-off-by: Dale Farnsworth (05/01/14 1.1975.53.7) This patch makes the use of the MV64340_RX_QUEUE_FILL_ON_TASK config macro more consistent, though the macro remains undefined, since the feature still does not work properly. Signed-off-by: Steven J. Hill Signed-off-by: Dale Farnsworth (05/01/14 1.1975.53.6) This patch adds support for passing additional parameters via the platform_device interface. These additional parameters are: size of RX and TX descriptor rings port_config value port_config_extend value port_sdma_config value port_serial_control value PHY address Signed-off-by: Dale Farnsworth (05/01/14 1.1975.53.5) This patch adds device driver model support to the mv643xx_eth driver. This is a change to the driver's programming interface. Platform code must now pass in the address of the MV643xx ethernet registers and IRQ. If firmware doesn't set the MAC address, platform code must also pass in the MAC address. Also, note that local MV_READ/MV_WRITE macros are used rather than using global macros. Keeping the macro names minimizes the patch size. The names will be changed to mv_read/mv_write in a later cosmetic cleanup patch. Signed-off-by: Dale Farnsworth (05/01/14 1.1975.53.4) This patch replaces the use of the pci_map_* functions with the corresponding dma_map_* functions. Signed-off-by: Dale Farnsworth (05/01/14 1.1975.53.3) This patch fixes the code that enables hardware checksum generation. The previous code has so many problems that it appears to never have worked 2.6. Signed-off-by: Dale Farnsworth (05/01/14 1.1975.53.2) This patch removes spin delays (count to 1000000, ugh) and instead waits with udelay or msleep for hardware flags to change. It also adds a spinlock to protect access to the MV64340_ETH_SMI_REG, which is shared across ports. Signed-off-by: Dale Farnsworth (05/01/14 1.1975.53.1) This patch removes code that is redundant or useless. The biggest area is in pre-initializing the RX and TX descriptor rings, which only obfuscates the driver since the ring data is overwritten without being used. Signed-off-by: Dale Farnsworth --FkmkrVfFsRoUs1wW Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="mp.1" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/27 12:16:27-07:00 dfarnsworth@mvista.com # This one liner removes a spurious left paren fixing an obvious syntax error # in the #ifndef MV64340_NAPI case # # drivers/net/mv643xx_eth.c # 2005/01/27 12:16:18-07:00 dfarnsworth@mvista.com +0 -1 # This one liner removes a spurious left paren fixing an obvious syntax error # in the #ifndef MV64340_NAPI case # diff -Nru a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c --- a/drivers/net/mv643xx_eth.c 2005-01-27 13:12:12 -07:00 +++ b/drivers/net/mv643xx_eth.c 2005-01-27 13:12:12 -07:00 @@ -510,7 +510,6 @@ __netif_rx_schedule(dev); } #else - { if (eth_int_cause & (BIT2 | BIT11)) mv64340_eth_receive_queue(dev, 0); --FkmkrVfFsRoUs1wW Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="mp.2" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/27 12:26:38-07:00 dfarnsworth@mvista.com # Add a function to detect at runtime whether a PHY is attached to # the specified port, and use it to cause the probe routine to fail # when there is no PHY. # # Signed-off-by: Dale Farnsworth # # drivers/net/mv643xx_eth.c # 2005/01/27 12:26:27-07:00 dfarnsworth@mvista.com +47 -0 # Add a function to detect at runtime whether a PHY is attached to # the specified port, and use it to cause the probe routine to fail # when there is no PHY. # # Signed-off-by: Dale Farnsworth # diff -Nru a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c --- a/drivers/net/mv643xx_eth.c 2005-01-27 13:12:37 -07:00 +++ b/drivers/net/mv643xx_eth.c 2005-01-27 13:12:37 -07:00 @@ -81,6 +81,7 @@ static int mv64340_poll(struct net_device *dev, int *budget); #endif static void ethernet_phy_set(unsigned int eth_port_num, int phy_addr); +static int ethernet_phy_detect(unsigned int eth_port_num); static void __iomem *mv64x60_eth_shared_base; @@ -1441,6 +1442,14 @@ } } + err = ethernet_phy_detect(port_num); + if (err) { + pr_debug("MV643xx ethernet port %d: " + "No PHY detected at addr %d\n", + port_num, ethernet_phy_get(port_num)); + return err; + } + err = register_netdev(dev); if (err) goto out; @@ -2040,6 +2049,44 @@ /* Perform dummy reads from MIB counters */ for (i = ETH_MIB_GOOD_OCTETS_RECEIVED_LOW; i < ETH_MIB_LATE_COLLISION; i += 4) MV_READ(MV64340_ETH_MIB_COUNTERS_BASE(eth_port_num) + i); +} + + +/* + * ethernet_phy_detect - Detect whether a phy is present + * + * DESCRIPTION: + * This function tests whether there is a PHY present on + * the specified port. + * + * INPUT: + * unsigned int eth_port_num Ethernet Port number. + * + * OUTPUT: + * None + * + * RETURN: + * 0 on success + * -ENODEV on failure + * + */ +static int ethernet_phy_detect(unsigned int port_num) +{ + unsigned int phy_reg_data0; + int auto_neg; + + eth_port_read_smi_reg(port_num, 0, &phy_reg_data0); + auto_neg = phy_reg_data0 & 0x1000; + phy_reg_data0 ^= 0x1000; /* invert auto_neg */ + eth_port_write_smi_reg(port_num, 0, phy_reg_data0); + + eth_port_read_smi_reg(port_num, 0, &phy_reg_data0); + if ((phy_reg_data0 & 0x1000) == auto_neg) + return -ENODEV; /* change didn't take */ + + phy_reg_data0 ^= 0x1000; + eth_port_write_smi_reg(port_num, 0, phy_reg_data0); + return 0; } --FkmkrVfFsRoUs1wW-- From davem@davemloft.net Thu Jan 27 12:28:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 12:28:26 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RKSKmb019542 for ; Thu, 27 Jan 2005 12:28:21 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CuGBJ-00049T-00; Thu, 27 Jan 2005 12:23:57 -0800 Date: Thu, 27 Jan 2005 12:23:57 -0800 From: "David S. Miller" To: Christoph Hellwig Cc: paulus@samba.org, netdev@oss.sgi.com Subject: Re: [PATCH] remove bogus exports in ppp Message-Id: <20050127122357.71ad4179.davem@davemloft.net> In-Reply-To: <20050127112219.GA11790@lst.de> References: <20041024132504.GC19927@lst.de> <20050127112219.GA11790@lst.de> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 884 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 424 Lines: 14 On Thu, 27 Jan 2005 12:22:19 +0100 Christoph Hellwig wrote: > On Sun, Oct 24, 2004 at 03:25:04PM +0200, Christoph Hellwig wrote: > > even if they are usefull for debugging they're just bad namespace > > pollution for mainline > > ping? > > Signed-off-by: Christoph Hellwig I've already gotten a light slap on the hand for removing module exports in 2.6.x, so we might want to skip on this one. From jgarzik@pobox.com Thu Jan 27 12:27:51 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 12:27:59 -0800 (PST) Received: from parcelfarce.linux.theplanet.co.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RKRoph019397 for ; Thu, 27 Jan 2005 12:27:50 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by parcelfarce.linux.theplanet.co.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CuGF1-0000dc-UQ; Thu, 27 Jan 2005 20:27:48 +0000 Message-ID: <41F94EB5.8090304@pobox.com> Date: Thu, 27 Jan 2005 15:27:33 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Francois Romieu CC: Richard Dawe , netdev@oss.sgi.com, davem@davemloft.net Subject: Re: [patch] ethtool (was Re: Acer Aspire 1524WLMi and RealTek 8169 - very slow) References: <41A09541.5040405@phekda.gotadsl.co.uk> <20041121232850.GB22460@electric-eye.fr.zoreil.com> In-Reply-To: <20041121232850.GB22460@electric-eye.fr.zoreil.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 883 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 1795 Lines: 49 Francois Romieu wrote: > Richard Dawe : > >>diff -pur ethtool-2/ethtool.c ethtool-2.dev/ethtool.c >>--- ethtool-2/ethtool.c 2004-07-02 16:28:48.000000000 +0100 >>+++ ethtool-2.dev/ethtool.c 2004-11-21 10:09:13.000000000 +0000 >>@@ -996,6 +996,7 @@ static struct { >> } driver_list[] = { >> { "8139cp", realtek_dump_regs }, >> { "8139too", realtek_dump_regs }, >>+ { "r8169", realtek_dump_regs }, >> { "de2104x", de2104x_dump_regs }, >> { "e1000", e1000_dump_regs }, >> { "natsemi", natsemi_dump_regs }, >>diff -pur ethtool-2/realtek.c ethtool-2.dev/realtek.c >>--- ethtool-2/realtek.c 2004-04-09 19:44:55.000000000 +0100 >>+++ ethtool-2.dev/realtek.c 2004-11-21 11:31:29.015997736 +0000 >>@@ -43,7 +43,7 @@ static struct chip_info { >> { "RTL-8100B/8139D", HW_REVID(1, 1, 1, 0, 1, 0, 1) }, >> { "RTL-8139C+", HW_REVID(1, 1, 1, 0, 1, 1, 0) }, >> { "RTL-8101", HW_REVID(1, 1, 1, 0, 1, 1, 1) }, >>- { "RTL-8169", HW_REVID(0, 0, 0, 0, 0, 0, 0) }, >>+ { "RTL-8169", HW_REVID(0, 0, 1, 0, 0, 0, 0) }, > > > The initial value can be found in the datasheet and my Netgear adapter > announces HW_REVID(0, 0, 0, 0, 1, 0, 0). Joy. > > Dave, Jeff, any remark about the patch below ? > > Index: ethtool.c > =================================================================== > RCS file: /cvsroot/gkernel/ethtool/ethtool.c,v > retrieving revision 1.50 > diff -u -p -r1.50 ethtool.c > --- ethtool.c 2 Jul 2004 15:35:09 -0000 1.50 > +++ ethtool.c 21 Nov 2004 23:22:54 -0000 > @@ -996,6 +996,7 @@ static struct { > } driver_list[] = { > { "8139cp", realtek_dump_regs }, > { "8139too", realtek_dump_regs }, > + { "r8169", realtek_dump_regs }, > { "de2104x", de2104x_dump_regs }, > { "e1000", e1000_dump_regs }, > { "natsemi", natsemi_dump_regs }, applied From jgarzik@pobox.com Thu Jan 27 12:32:18 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 12:32:23 -0800 (PST) Received: from parcelfarce.linux.theplanet.co.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RKWHmD020466 for ; Thu, 27 Jan 2005 12:32:18 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by parcelfarce.linux.theplanet.co.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CuGJL-0000mi-7O; Thu, 27 Jan 2005 20:32:15 +0000 Message-ID: <41F94FBD.7000208@pobox.com> Date: Thu, 27 Jan 2005 15:31:57 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Dale Farnsworth CC: netdev@oss.sgi.com, Ralf Baechle , Manish Lachwani , Brian Waite , "Steven J. Hill" , Benjamin Herrenschmidt Subject: Re: MV643xx Ethernet 2.6 driver update References: <20050117184019.GA24655@xyzzy> <41F8BACA.1020302@pobox.com> <20050127201955.GC1452@xyzzy> In-Reply-To: <20050127201955.GC1452@xyzzy> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 885 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 203 Lines: 9 Thanks, pulled. It will sit in netdev-2.6 queue (and thus -mm) for a while, while I and others review it. I admit I only gave it a quick overview. After a little while we'll push upstream. Jeff From hch@lst.de Thu Jan 27 12:32:51 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 12:32:56 -0800 (PST) Received: from mail.lst.de (verein.lst.de [213.95.11.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RKWoTh020717 for ; Thu, 27 Jan 2005 12:32:51 -0800 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id j0RKWl6t020362 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 27 Jan 2005 21:32:47 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id j0RKWljM020360; Thu, 27 Jan 2005 21:32:47 +0100 Date: Thu, 27 Jan 2005 21:32:46 +0100 From: Christoph Hellwig To: "David S. Miller" Cc: paulus@samba.org, netdev@oss.sgi.com Subject: Re: [PATCH] remove bogus exports in ppp Message-ID: <20050127203246.GA20350@lst.de> References: <20041024132504.GC19927@lst.de> <20050127112219.GA11790@lst.de> <20050127122357.71ad4179.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050127122357.71ad4179.davem@davemloft.net> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 886 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: netdev Content-Length: 530 Lines: 18 On Thu, Jan 27, 2005 at 12:23:57PM -0800, David S. Miller wrote: > On Thu, 27 Jan 2005 12:22:19 +0100 > Christoph Hellwig wrote: > > > On Sun, Oct 24, 2004 at 03:25:04PM +0200, Christoph Hellwig wrote: > > > even if they are usefull for debugging they're just bad namespace > > > pollution for mainline > > > > ping? > > > > Signed-off-by: Christoph Hellwig > > I've already gotten a light slap on the hand for removing > module exports in 2.6.x, so we might want to skip on this > one. From whom? From davem@davemloft.net Thu Jan 27 12:38:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 12:38:13 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RKc7B3021741 for ; Thu, 27 Jan 2005 12:38:07 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CuGKU-0004B2-00; Thu, 27 Jan 2005 12:33:26 -0800 Date: Thu, 27 Jan 2005 12:33:26 -0800 From: "David S. Miller" To: Russell King Cc: Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? Message-Id: <20050127123326.2eafab35.davem@davemloft.net> In-Reply-To: <20050127164918.C3036@flint.arm.linux.org.uk> References: <20050123091154.GC16648@suse.de> <20050123011918.295db8e8.akpm@osdl.org> <20050123095608.GD16648@suse.de> <20050123023248.263daca9.akpm@osdl.org> <20050123200315.A25351@flint.arm.linux.org.uk> <20050124114853.A16971@flint.arm.linux.org.uk> <20050125193207.B30094@flint.arm.linux.org.uk> <20050127082809.A20510@flint.arm.linux.org.uk> <20050127004732.5d8e3f62.akpm@osdl.org> <16888.58622.376497.380197@robur.slu.se> <20050127164918.C3036@flint.arm.linux.org.uk> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 887 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 811 Lines: 18 On Thu, 27 Jan 2005 16:49:18 +0000 Russell King wrote: > notice how /proc/net/stat/rt_cache says there's 1336 entries in the > route cache. _Where_ are they? They're not there according to > /proc/net/rt_cache. When the route cache is flushed, that kills a reference to each entry in the routing cache. If for some reason, other references remain (route connected to socket, some leak in the stack somewhere) the route cache entry can't be immediately completely freed up. So they won't be listed in /proc/net/rt_cache (since they've been removed from the lookup table) but they will be accounted for in /proc/net/stat/rt_cache until the final release is done on the routing cache object and it can be completely freed up. Do you happen to be using IPV6 in any way by chance? From davem@davemloft.net Thu Jan 27 12:39:43 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 12:39:47 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RKdgMr022315 for ; Thu, 27 Jan 2005 12:39:43 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CuGML-0004CF-00; Thu, 27 Jan 2005 12:35:21 -0800 Date: Thu, 27 Jan 2005 12:35:21 -0800 From: "David S. Miller" To: Christoph Hellwig Cc: paulus@samba.org, netdev@oss.sgi.com Subject: Re: [PATCH] remove bogus exports in ppp Message-Id: <20050127123521.13ca039c.davem@davemloft.net> In-Reply-To: <20050127203246.GA20350@lst.de> References: <20041024132504.GC19927@lst.de> <20050127112219.GA11790@lst.de> <20050127122357.71ad4179.davem@davemloft.net> <20050127203246.GA20350@lst.de> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 888 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 106 Lines: 6 On Thu, 27 Jan 2005 21:32:46 +0100 Christoph Hellwig wrote: > From whom? Linus and Andrew. From kernel@linuxace.com Thu Jan 27 12:40:19 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 12:40:24 -0800 (PST) Received: from linuxace.com (adsl-67-120-171-161.dsl.lsan03.pacbell.net [67.120.171.161]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0RKeIbw022600 for ; Thu, 27 Jan 2005 12:40:19 -0800 Received: (qmail 14639 invoked by uid 0); 27 Jan 2005 20:40:12 -0000 Date: Thu, 27 Jan 2005 12:40:12 -0800 From: Phil Oester To: Robert Olsson , Andrew Morton , torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? Message-ID: <20050127204012.GA14518@linuxace.com> References: <20050123023248.263daca9.akpm@osdl.org> <20050123200315.A25351@flint.arm.linux.org.uk> <20050124114853.A16971@flint.arm.linux.org.uk> <20050125193207.B30094@flint.arm.linux.org.uk> <20050127082809.A20510@flint.arm.linux.org.uk> <20050127004732.5d8e3f62.akpm@osdl.org> <16888.58622.376497.380197@robur.slu.se> <20050127164918.C3036@flint.arm.linux.org.uk> <20050127183745.GA13365@linuxace.com> <20050127192504.D3036@flint.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050127192504.D3036@flint.arm.linux.org.uk> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 889 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kernel@linuxace.com Precedence: bulk X-list: netdev Content-Length: 786 Lines: 21 On Thu, Jan 27, 2005 at 07:25:04PM +0000, Russell King wrote: > Can you provide some details, eg kernel configuration, loaded modules > and a brief overview of any netfilter modules you may be using. > > Maybe we can work out what's common between our setups. Vanilla 2.6.10, though I've been seeing these problems since 2.6.8 or earlier. Netfilter running on all boxes, some utilizing SNAT, others not -- none using MASQ. This is from a box running no NAT at all, although has some other filter rules: # wc -l /proc/net/rt_cache ; grep dst_cache /proc/slabinfo 50 /proc/net/rt_cache ip_dst_cache 84285 84285 Also with uptime of 26 days. These boxes are all running the quagga OSPF daemon, but those that are lightly loaded are not exhibiting these problems. Phil From jgarzik@pobox.com Thu Jan 27 12:45:57 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 12:46:02 -0800 (PST) Received: from parcelfarce.linux.theplanet.co.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RKjuFL023686 for ; Thu, 27 Jan 2005 12:45:57 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by parcelfarce.linux.theplanet.co.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CuGWY-0001MA-Rw; Thu, 27 Jan 2005 20:45:55 +0000 Message-ID: <41F952F4.7040804@pobox.com> Date: Thu, 27 Jan 2005 15:45:40 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Linux Kernel , Netdev CC: Greg KH , Andrew Morton Subject: [ANN] removal of certain net drivers coming soon: eepro100, xircom_tulip_cb, iph5526 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 890 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 734 Lines: 29 (GregKH cc'd for his deprecated list) Though this has already been mentioned, I thought I would send out a reminder. The following net drivers are slated for removal "soon", in the next kernel version or so: 1) iphase (iph5526 a.k.a. drivers/net/fc/*) Been broken since 2.3 or 2.4. Only janitors have kept it compiling. 2) xircom_tulip_cb Unmaintained, and does not work for all xircom 32bit cards. xircom_cb, on the other hand, works for ALL xircom 32bit cards. 3) eepro100 Unmaintained; users should use e100. When I last mentioned eepro100 was going away, I got a few private emails saying complaining about issues not yet taken care of in e100. eepro100 will not be removed until these issues are resolved. From tgraf@suug.ch Thu Jan 27 12:51:32 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 12:51:38 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RKpVtd024567 for ; Thu, 27 Jan 2005 12:51:31 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 55671F; Thu, 27 Jan 2005 21:51:06 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 144991C0EA; Thu, 27 Jan 2005 21:51:48 +0100 (CET) Date: Thu, 27 Jan 2005 21:51:47 +0100 From: Thomas Graf To: Pablo Neira Cc: Jamal Hadi Salim , Patrick McHardy , netdev@oss.sgi.com Subject: Re: [RFC] string matching ematch Message-ID: <20050127205147.GS31837@postel.suug.ch> References: <20050126150714.GL31837@postel.suug.ch> <41F94C63.7010800@eurodev.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F94C63.7010800@eurodev.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 891 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 2004 Lines: 43 * Pablo Neira <41F94C63.7010800@eurodev.net> 2005-01-27 21:17 > Thomas Graf wrote: > > >I'd like to discuss the string matching ematch, I don't care about the > >algorithm used but rather whether to make it stateful, match over > >fragments, etc. I attached a simple stateless string matching ematch > >using the Knuth-Morris-Pratt algorithm as a starting point. > > > > I've posted something similar after christmas in netfilter-devel[1]. > It's fragment aware, actually my implementation uses boyer-moore to look > for matches in the payload, and it uses brute force together with > Rusty's skb_iter stuff to look for matches on the edges. I've seen it but sticked to KMP because it uses less memory. Their searching phase time complexity is nearly equal around O(nm) for n being the length of T[] and m being the length of P[]. BM definitely has a better performance for highly periodic P[]'s in a periodic T[] though. I'm missing a few things in your string matching API, namely the ability to define a upper limit of the searching range which can give much better performance gains than the best optimization can do. A naive searching method around the borders of fragments is definiltey easier but even there you could benefit from ruling out invalid shifts. > The worst case is not that bad for small patterns. I don't think that any of the algorithms really make a difference, theoretically yes but what we're basically should be looking for is one with good average performance by detecting unnecessary shifts. Our T[] is limited by the skb as long as we're not going into statefull searches and thus other resources matter more to me than a few more cycles. > I'll give it more spins these days since I've got some spare time. I'll > also have a look at your work. I think that we could join efforts and > push something good, thoughts? Definitely, being able to specify the upper limit is a must for me though. Another difference is that I compute the prefix table in userspace. From jgarzik@pobox.com Thu Jan 27 12:59:44 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 12:59:49 -0800 (PST) Received: from parcelfarce.linux.theplanet.co.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RKxhes025550 for ; Thu, 27 Jan 2005 12:59:44 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by parcelfarce.linux.theplanet.co.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CuGju-0001zF-Ps; Thu, 27 Jan 2005 20:59:42 +0000 Message-ID: <41F95630.7000302@pobox.com> Date: Thu, 27 Jan 2005 15:59:28 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Francois Romieu CC: netdev@oss.sgi.com Subject: Re: [patch 2.6.10-rc1 1/5] dscc4: use of uncompletely initialized struct References: <20050114000732.GA28864@electric-eye.fr.zoreil.com> <20050114000941.GA2219@electric-eye.fr.zoreil.com> In-Reply-To: <20050114000941.GA2219@electric-eye.fr.zoreil.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 892 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 15 Lines: 2 applied all 5 From SRS0+f6902864cd3c0da9404b+522+infradead.org+hch@pentafluge.srs.infradead.org Thu Jan 27 13:07:39 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 13:07:43 -0800 (PST) Received: from pentafluge.infradead.org (pentafluge.infradead.org [213.146.154.40]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RL7ZIR026539 for ; Thu, 27 Jan 2005 13:07:39 -0800 Received: from hch by pentafluge.infradead.org with local (Exim 4.43 #1 (Red Hat Linux)) id 1CuGrU-0000mA-1E; Thu, 27 Jan 2005 21:07:32 +0000 Date: Thu, 27 Jan 2005 21:07:31 +0000 From: Christoph Hellwig To: Jeff Garzik Cc: Linux Kernel , Netdev , Greg KH , Andrew Morton Subject: Re: [ANN] removal of certain net drivers coming soon: eepro100, xircom_tulip_cb, iph5526 Message-ID: <20050127210731.GA2953@infradead.org> Mail-Followup-To: Christoph Hellwig , Jeff Garzik , Linux Kernel , Netdev , Greg KH , Andrew Morton References: <41F952F4.7040804@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F952F4.7040804@pobox.com> User-Agent: Mutt/1.4.1i X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 893 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: netdev Content-Length: 251 Lines: 7 On Thu, Jan 27, 2005 at 03:45:40PM -0500, Jeff Garzik wrote: > 1) iphase (iph5526 a.k.a. drivers/net/fc/*) > > Been broken since 2.3 or 2.4. Only janitors have kept it compiling. No, it doesn't even compile, and didn't so for more than two years. From bdschuym@pandora.be Thu Jan 27 13:10:19 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 13:10:24 -0800 (PST) Received: from astra.telenet-ops.be (astra.telenet-ops.be [195.130.132.58]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RLAHqP027259 for ; Thu, 27 Jan 2005 13:10:18 -0800 Received: from localhost (localhost.localdomain [127.0.0.1]) by astra.telenet-ops.be (Postfix) with SMTP id E547F32845D; Thu, 27 Jan 2005 22:10:16 +0100 (MET) Received: from 192.168.0.138 (dD5763CA9.access.telenet.be [213.118.60.169]) by astra.telenet-ops.be (Postfix) with ESMTP id E53A13283A7; Thu, 27 Jan 2005 22:10:15 +0100 (MET) Subject: Re: [PATCH/RFC] Reduce call chain length in netfilter From: Bart De Schuymer To: "David S. Miller" Cc: Patrick McHardy , netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org, snort2004@mail.ru, rusty@rustcorp.com.au, ak@suse.de, bridge@osdl.org, gandalf@wlug.westbo.se, dwmw2@infradead.org, shemminger@osdl.org In-Reply-To: <20050127114726.2205b4ed.davem@davemloft.net> References: <1131604877.20041218092730@mail.ru.suse.lists.linux.kernel> <1105117559.11753.34.camel@baythorne.infradead.org> <20050107100017.454ddadc@dxpl.pdx.osdl.net> <1105133241.3375.16.camel@localhost.localdomain> <20050118135735.4b77d38d.davem@davemloft.net> <1106433059.4486.11.camel@localhost.localdomain> <1106436153.20995.42.camel@tux.rsn.bth.se> <1106484019.3376.5.camel@localhost.localdomain> <1106496509.1085.1.camel@tux.rsn.bth.se> <20050125220558.6e824f8a.davem@davemloft.net> <1106730510.4041.4.camel@localhost.localdomain> <41F82C6D.7020006@trash.net> <20050126231801.7bf90338.davem@davemloft.net> <41F929FA.3050800@trash.net> <20050127114726.2205b4ed.davem@davemloft.net> Content-Type: text/plain Date: Thu, 27 Jan 2005 22:16:04 +0100 Message-Id: <1106860564.3389.4.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 894 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bdschuym@pandora.be Precedence: bulk X-list: netdev Content-Length: 1036 Lines: 40 Op do, 27-01-2005 te 11:47 -0800, schreef David S. Miller: > On Thu, 27 Jan 2005 18:50:50 +0100 > Patrick McHardy wrote: > > > From what I can see it doesn't generate tail-calls currently: > > Indeed... It even doesn't do this on Sparc64 either, even for > the okfn(skb) call which I was sure it would. > > It won't tail-call for function pointers for some strance reason > as exhibited by this simple test: > > struct sk_buff { > int foo; > }; > > int invoke(struct sk_buff *skb, int (*okfn)(struct sk_buff *)) > { > return okfn(skb); > } > > extern int test_func(struct sk_buff *); > > int invoke2(struct sk_buff *skb) > { > return test_func(skb); > } > > In the generated asm on sparc64, invoke2() gets a tail-call > whereas invoke() does not. Hmmm... Pasha () is currently using a bridge-nf patch vs 2.4.29 with the changes I sent to you. After two days he sent me (yesterday) a message that all is well. Without the patch he was getting the stack overflow oopses. cheers, Bart From jgarzik@pobox.com Thu Jan 27 14:11:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 14:11:08 -0800 (PST) Received: from parcelfarce.linux.theplanet.co.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RMB3DW030059 for ; Thu, 27 Jan 2005 14:11:03 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by parcelfarce.linux.theplanet.co.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CuHqw-0004FZ-8U; Thu, 27 Jan 2005 22:11:02 +0000 Message-ID: <41F966E7.4030208@pobox.com> Date: Thu, 27 Jan 2005 17:10:47 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: netdev@oss.sgi.com, linux-kernel@vger.kernel.org, linux-net@vger.kernel.org Subject: Re: [PATCH] skge driver (0.5) References: <20050119135217.38fe5f05@dxpl.pdx.osdl.net> <20050125151507.414e7f4f@dxpl.pdx.osdl.net> In-Reply-To: <20050125151507.414e7f4f@dxpl.pdx.osdl.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 895 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 19 Lines: 2 applied to netdev From jgarzik@pobox.com Thu Jan 27 14:12:41 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 14:12:46 -0800 (PST) Received: from parcelfarce.linux.theplanet.co.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RMCew6030438 for ; Thu, 27 Jan 2005 14:12:41 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by parcelfarce.linux.theplanet.co.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CuHsV-0004IH-SR; Thu, 27 Jan 2005 22:12:40 +0000 Message-ID: <41F9674A.6090104@pobox.com> Date: Thu, 27 Jan 2005 17:12:26 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Randy.Dunlap" CC: netdev@oss.sgi.com, prism54-private@prism54.org Subject: Re: [PATCH] prism54: use NULL for pointer References: <20050122225335.225f8042.rddunlap@osdl.org> In-Reply-To: <20050122225335.225f8042.rddunlap@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 896 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 9 Lines: 2 applied From jgarzik@pobox.com Thu Jan 27 14:13:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 14:13:54 -0800 (PST) Received: from parcelfarce.linux.theplanet.co.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RMDmek031015 for ; Thu, 27 Jan 2005 14:13:49 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by parcelfarce.linux.theplanet.co.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CuHtb-0004JF-LL; Thu, 27 Jan 2005 22:13:47 +0000 Message-ID: <41F9678E.50505@pobox.com> Date: Thu, 27 Jan 2005 17:13:34 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: netdev@oss.sgi.com Subject: Re: [PATCH] (1/2) skfddi: initialization References: <20050111111917.52988b75@dxpl.pdx.osdl.net> In-Reply-To: <20050111111917.52988b75@dxpl.pdx.osdl.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 897 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 14 Lines: 2 applied both From jgarzik@pobox.com Thu Jan 27 14:17:44 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 14:17:48 -0800 (PST) Received: from parcelfarce.linux.theplanet.co.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RMHhkR031575 for ; Thu, 27 Jan 2005 14:17:43 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by parcelfarce.linux.theplanet.co.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CuHxO-0004OV-6y; Thu, 27 Jan 2005 22:17:42 +0000 Message-ID: <41F96877.5090600@pobox.com> Date: Thu, 27 Jan 2005 17:17:27 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Hollis CC: Netdev Subject: Re: [PATCH] tg3.h & b44.h ifndef ADVERTISE_PAUSE typo References: <1105454553.4264.4.camel@dhollis-lnx.centricconsulting.com> <41E421A8.60203@pobox.com> <1105472929.6599.3.camel@dhollis-lnx.centricconsulting.com> In-Reply-To: <1105472929.6599.3.camel@dhollis-lnx.centricconsulting.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 898 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 154 Lines: 6 applied. please send patches that apply with "patch -sp1 < patch" in the future. your patch, as sent, broke scripts and had to be applied manually. From mcgrof@studorgs.rutgers.edu Thu Jan 27 14:21:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 14:21:12 -0800 (PST) Received: from ruslug.rutgers.edu (studorgs.rutgers.edu [128.6.24.131]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RML69k032140 for ; Thu, 27 Jan 2005 14:21:06 -0800 Received: by ruslug.rutgers.edu (Postfix, from userid 503) id C3415F98AA; Thu, 27 Jan 2005 17:21:05 -0500 (EST) Date: Thu, 27 Jan 2005 17:21:05 -0500 To: Jeff Garzik Cc: "Randy.Dunlap" , netdev@oss.sgi.com, prism54-private@prism54.org Subject: Re: [PATCH] prism54: use NULL for pointer Message-ID: <20050127222105.GJ5159@ruslug.rutgers.edu> Mail-Followup-To: Jeff Garzik , "Randy.Dunlap" , netdev@oss.sgi.com, prism54-private@prism54.org References: <20050122225335.225f8042.rddunlap@osdl.org> <41F9674A.6090104@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F9674A.6090104@pobox.com> User-Agent: Mutt/1.3.28i X-Operating-System: 2.4.18-1-686 Organization: Rutgers University Student Linux Users Group From: mcgrof@studorgs.rutgers.edu (Luis R. Rodriguez) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 899 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mcgrof@studorgs.rutgers.edu Precedence: bulk X-list: netdev Content-Length: 224 Lines: 9 On Thu, Jan 27, 2005 at 05:12:26PM -0500, Jeff Garzik wrote: > applied Sorry for the delay here too, patched into prism54 tree as well. Luis -- GnuPG Key fingerprint = 113F B290 C6D2 0251 4D84 A34A 6ADD 4937 E20A 525E From mchan@broadcom.com Thu Jan 27 14:44:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 14:44:14 -0800 (PST) Received: from mms3.broadcom.com (mms-nat.broadcom.com [63.70.210.58]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RMi633000454 for ; Thu, 27 Jan 2005 14:44:07 -0800 Received: from 63.70.210.1 by mms3.broadcom.com with SMTP (Broadcom SMTP Relay (MMS v5.6.0)); Thu, 27 Jan 2005 14:43:43 -0800 X-Server-Uuid: 062D48FB-9769-4139-967C-478C67B5F9C9 Received: from mail-irva-8.broadcom.com ([10.10.64.221]) by mail-irva-1.broadcom.com (Post.Office MTA v3.5.3 release 223 ID# 0-72233U7200L2200S0V35) with ESMTP id com; Thu, 27 Jan 2005 14:43:41 -0800 Received: from mon-irva-10.broadcom.com (mon-irva-10.broadcom.com [10.10.64.171]) by mail-irva-8.broadcom.com (MOS 3.5.6-GR) with ESMTP id AIN19174; Thu, 27 Jan 2005 14:43:33 -0800 (PST) Received: from nt-irva-0741.brcm.ad.broadcom.com ( nt-irva-0741.brcm.ad.broadcom.com [10.8.194.54]) by mon-irva-10.broadcom.com (8.9.1/8.9.1) with ESMTP id OAA24028; Thu, 27 Jan 2005 14:43:33 -0800 (PST) X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Subject: [PATCH 2.6.10] tg3: 5704 serdes fixes Date: Thu, 27 Jan 2005 14:43:34 -0800 Message-ID: X-MS-Has-Attach: yes Thread-Topic: [PATCH 2.6.10] tg3: 5704 serdes fixes Thread-Index: AcT/RNYoqhl8O7sZQByxO+YWIkWbhgAAiLIAAMWgbjAAXHbEkAA8AFXQ From: "Michael Chan" To: "David S. Miller" cc: netdev@oss.sgi.com X-WSS-ID: 6DE7B1151W42230239-01-01 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C504C1.A1F676E4" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 900 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mchan@broadcom.com Precedence: bulk X-list: netdev Content-Length: 5904 Lines: 99 This is a multi-part message in MIME format. ------_=_NextPart_001_01C504C1.A1F676E4 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Some 5704S and related fixes: - Fix capacitive coupling detection by reading the correct offset in = sram - Add support for different signal pre-emphasis on 5704S (used in some = blade servers) - Improve 5704S link parallel detection. When autonegotiation fails, we = only detect link-up if we have PCS_SYNC and we are not receiving config code words. This will prevent false link-up when only the rx cable is = attached. Signed-off-by: Michael Chan ------_=_NextPart_001_01C504C1.A1F676E4 Content-Type: application/octet-stream; name=tg3_5704s.patch Content-Transfer-Encoding: base64 Content-Description: tg3_5704s.patch Content-Disposition: attachment; filename=tg3_5704s.patch ZGlmZiAtTnJ1IDQvdGczLmMgNS90ZzMuYwotLS0gNC90ZzMuYwkyMDA1LTAxLTI1IDA5OjE2OjM0 LjAwMDAwMDAwMCAtMDgwMAorKysgNS90ZzMuYwkyMDA1LTAxLTI2IDE0OjIwOjA3LjAwMDAwMDAw MCAtMDgwMApAQCAtMjE0Miw4ICsyMTQyLDkgQEAKIAkJaWYgKHRyMzIoVEczUENJX0RVQUxfTUFD X0NUUkwpICYgRFVBTF9NQUNfQ1RSTF9JRCkKIAkJCXBvcnRfYSA9IDA7CiAKLQkJc2VyZGVzX2Nm ZyA9IHRyMzIoTUFDX1NFUkRFU19DRkcpICYKLQkJCSgoMSA8PCAyMykgfCAoMSA8PCAyMikgfCAo MSA8PCAyMSkgfCAoMSA8PCAyMCkpOworCQkvKiBwcmVzZXJ2ZSBiaXRzIDAtMTEsMTMsMTQgZm9y IHNpZ25hbCBwcmUtZW1waGFzaXMgKi8KKwkJLyogcHJlc2VydmUgYml0cyAyMC0yMyBmb3Igdm9s dGFnZSByZWd1bGF0b3IgKi8KKwkJc2VyZGVzX2NmZyA9IHRyMzIoTUFDX1NFUkRFU19DRkcpICYg MHgwMGYwNmZmZjsKIAl9CiAKIAlzZ19kaWdfY3RybCA9IHRyMzIoU0dfRElHX0NUUkwpOwpAQCAt MjE1NCw5ICsyMTU1LDkgQEAKIAkJCQl1MzIgdmFsID0gc2VyZGVzX2NmZzsKIAogCQkJCWlmIChw b3J0X2EpCi0JCQkJCXZhbCB8PSAweGMwMTA4ODA7CisJCQkJCXZhbCB8PSAweGMwMTAwMDA7CiAJ CQkJZWxzZQotCQkJCQl2YWwgfD0gMHg0MDEwODgwOworCQkJCQl2YWwgfD0gMHg0MDEwMDAwOwog CQkJCXR3MzJfZihNQUNfU0VSREVTX0NGRywgdmFsKTsKIAkJCX0KIAkJCXR3MzJfZihTR19ESUdf Q1RSTCwgMHgwMTM4ODQwMCk7CkBAIC0yMTc5LDcgKzIxODAsNyBAQAogCiAJaWYgKHNnX2RpZ19j dHJsICE9IGV4cGVjdGVkX3NnX2RpZ19jdHJsKSB7CiAJCWlmICh3b3JrYXJvdW5kKQotCQkJdHcz Ml9mKE1BQ19TRVJERVNfQ0ZHLCBzZXJkZXNfY2ZnIHwgMHhjMDExODgwKTsKKwkJCXR3MzJfZihN QUNfU0VSREVTX0NGRywgc2VyZGVzX2NmZyB8IDB4YzAxMTAwMCk7CiAJCXR3MzJfZihTR19ESUdf Q1RSTCwgZXhwZWN0ZWRfc2dfZGlnX2N0cmwgfCAoMSA8PCAzMCkpOwogCQl1ZGVsYXkoNSk7CiAJ CXR3MzJfZihTR19ESUdfQ1RSTCwgZXhwZWN0ZWRfc2dfZGlnX2N0cmwpOwpAQCAtMjIyMCw5ICsy MjIxLDkgQEAKIAkJCQkJdTMyIHZhbCA9IHNlcmRlc19jZmc7CiAKIAkJCQkJaWYgKHBvcnRfYSkK LQkJCQkJCXZhbCB8PSAweGMwMTA4ODA7CisJCQkJCQl2YWwgfD0gMHhjMDEwMDAwOwogCQkJCQll bHNlCi0JCQkJCQl2YWwgfD0gMHg0MDEwODgwOworCQkJCQkJdmFsIHw9IDB4NDAxMDAwMDsKIAog CQkJCQl0dzMyX2YoTUFDX1NFUkRFU19DRkcsIHZhbCk7CiAJCQkJfQpAQCAtMjIzMCw4ICsyMjMx LDEyIEBACiAJCQkJdHczMl9mKFNHX0RJR19DVFJMLCAweDAxMzg4NDAwKTsKIAkJCQl1ZGVsYXko NDApOwogCisJCQkJLyogTGluayBwYXJhbGxlbCBkZXRlY3Rpb24gLSBsaW5rIGlzIHVwICovCisJ CQkJLyogb25seSBpZiB3ZSBoYXZlIFBDU19TWU5DIGFuZCBub3QgKi8KKwkJCQkvKiByZWNlaXZp bmcgY29uZmlnIGNvZGUgd29yZHMgKi8KIAkJCQltYWNfc3RhdHVzID0gdHIzMihNQUNfU1RBVFVT KTsKLQkJCQlpZiAobWFjX3N0YXR1cyAmIE1BQ19TVEFUVVNfUENTX1NZTkNFRCkgeworCQkJCWlm ICgobWFjX3N0YXR1cyAmIE1BQ19TVEFUVVNfUENTX1NZTkNFRCkgJiYKKwkJCQkgICAgIShtYWNf c3RhdHVzICYgTUFDX1NUQVRVU19SQ1ZEX0NGRykpIHsKIAkJCQkJdGczX3NldHVwX2Zsb3dfY29u dHJvbCh0cCwgMCwgMCk7CiAJCQkJCWN1cnJlbnRfbGlua191cCA9IDE7CiAJCQkJfQpAQCAtNTQw OCw4ICs1NDEzLDEwIEBACiAJdWRlbGF5KDEwKTsKIAogCWlmICh0cC0+dGczX2ZsYWdzMiAmIFRH M19GTEcyX1BIWV9TRVJERVMpIHsKLQkJaWYgKEdFVF9BU0lDX1JFVih0cC0+cGNpX2NoaXBfcmV2 X2lkKSA9PSBBU0lDX1JFVl81NzA0KSB7CisJCWlmICgoR0VUX0FTSUNfUkVWKHRwLT5wY2lfY2hp cF9yZXZfaWQpID09IEFTSUNfUkVWXzU3MDQpICYmCisJCQkhKHRwLT50ZzNfZmxhZ3MyICYgVEcz X0ZMRzJfU0VSREVTX1BSRUVNUEhBU0lTKSkgewogCQkJLyogU2V0IGRyaXZlIHRyYW5zbWlzc2lv biBsZXZlbCB0byAxLjJWICAqLworCQkJLyogb25seSBpZiB0aGUgc2lnbmFsIHByZS1lbXBoYXNp cyBiaXQgaXMgbm90IHNldCAgKi8KIAkJCXZhbCA9IHRyMzIoTUFDX1NFUkRFU19DRkcpOwogCQkJ dmFsICY9IDB4ZmZmZmYwMDA7CiAJCQl2YWwgfD0gMHg4ODA7CkBAIC03NTA1LDYgKzc1MTIsOCBA QAogCQl0ZzNfcmVhZF9tZW0odHAsIE5JQ19TUkFNX0RBVEFfQ0ZHLCAmbmljX2NmZyk7CiAJCXRw LT5uaWNfc3JhbV9kYXRhX2NmZyA9IG5pY19jZmc7CiAKKwkJdGczX3JlYWRfbWVtKHRwLCBOSUNf U1JBTV9EQVRBX0NGR18yLCAmY2ZnMik7CisKIAkJZWVwcm9tX3NpZ25hdHVyZV9mb3VuZCA9IDE7 CiAKIAkJaWYgKChuaWNfY2ZnICYgTklDX1NSQU1fREFUQV9DRkdfUEhZX1RZUEVfTUFTSykgPT0K QEAgLTc1MjMsOCArNzUzMiw3IEBACiAJCQllZXByb21fcGh5X2lkID0gMDsKIAogCQlpZiAoR0VU X0FTSUNfUkVWKHRwLT5wY2lfY2hpcF9yZXZfaWQpID09IEFTSUNfUkVWXzU3NTApIHsKLQkJCXRn M19yZWFkX21lbSh0cCwgTklDX1NSQU1fREFUQV9DRkdfMiwgJmxlZF9jZmcpOwotCQkJbGVkX2Nm ZyAmPSAoTklDX1NSQU1fREFUQV9DRkdfTEVEX01PREVfTUFTSyB8CisJCQlsZWRfY2ZnID0gY2Zn MiAmIChOSUNfU1JBTV9EQVRBX0NGR19MRURfTU9ERV9NQVNLIHwKIAkJCQkgICAgU0hBU1RBX0VY VF9MRURfTU9ERV9NQVNLKTsKIAkJfSBlbHNlCiAJCQlsZWRfY2ZnID0gbmljX2NmZyAmIE5JQ19T UkFNX0RBVEFfQ0ZHX0xFRF9NT0RFX01BU0s7CkBAIC03NTgyLDkgKzc1OTAsMTMgQEAKIAkJaWYg KG5pY19jZmcgJiBOSUNfU1JBTV9EQVRBX0NGR19GSUJFUl9XT0wpCiAJCQl0cC0+dGczX2ZsYWdz IHw9IFRHM19GTEFHX1NFUkRFU19XT0xfQ0FQOwogCi0JCXRnM19yZWFkX21lbSh0cCwgTklDX1NS QU1fREFUQV9QSFlfSUQsICZjZmcyKTsKIAkJaWYgKGNmZzIgJiAoMSA8PCAxNykpCiAJCQl0cC0+ dGczX2ZsYWdzMiB8PSBURzNfRkxHMl9DQVBBQ0lUSVZFX0NPVVBMSU5HOworCisJCS8qIHNlcmRl cyBzaWduYWwgcHJlLWVtcGhhc2lzIGluIHJlZ2lzdGVyIDB4NTkwIHNldCBieSAqLworCQkvKiBi b290Y29kZSBpZiBiaXQgMTggaXMgc2V0ICovCisJCWlmIChjZmcyICYgKDEgPDwgMTgpKQorCQkJ dHAtPnRnM19mbGFnczIgfD0gVEczX0ZMRzJfU0VSREVTX1BSRUVNUEhBU0lTOwogCX0KIAogCS8q IFJlYWRpbmcgdGhlIFBIWSBJRCByZWdpc3RlciBjYW4gY29uZmxpY3Qgd2l0aCBBU0YKZGlmZiAt TnJ1IDQvdGczLmggNS90ZzMuaAotLS0gNC90ZzMuaAkyMDA1LTAxLTI0IDIyOjQxOjM4LjAwMDAw MDAwMCAtMDgwMAorKysgNS90ZzMuaAkyMDA1LTAxLTI2IDE0OjIwOjEwLjAwMDAwMDAwMCAtMDgw MApAQCAtMjEwNiw2ICsyMTA2LDcgQEAKICNkZWZpbmUgVEczX0ZMRzJfQ0FQQUNJVElWRV9DT1VQ TElORwkweDAwMDA0MDAwCiAjZGVmaW5lIFRHM19GTEcyX0ZMQVNICQkJMHgwMDAwODAwMAogI2Rl ZmluZSBURzNfRkxHMl9IV19UU08JCQkweDAwMDEwMDAwCisjZGVmaW5lIFRHM19GTEcyX1NFUkRF U19QUkVFTVBIQVNJUwkweDAwMDIwMDAwCiAKIAl1MzIJCQkJc3BsaXRfbW9kZV9tYXhfcmVxczsK ICNkZWZpbmUgU1BMSVRfTU9ERV81NzA0X01BWF9SRVEJCTMK ------_=_NextPart_001_01C504C1.A1F676E4-- From kaber@trash.net Thu Jan 27 14:48:12 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 14:48:16 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RMmBcp001017 for ; Thu, 27 Jan 2005 14:48:11 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.43) id 1CuIQm-0005Bv-V5; Thu, 27 Jan 2005 23:48:04 +0100 Message-ID: <41F96FA4.4000105@trash.net> Date: Thu, 27 Jan 2005 23:48:04 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050106 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: bdschuym@pandora.be, netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org, snort2004@mail.ru, rusty@rustcorp.com.au, ak@suse.de, bridge@osdl.org, gandalf@wlug.westbo.se, dwmw2@infradead.org, shemminger@osdl.org Subject: Re: [PATCH/RFC] Reduce call chain length in netfilter References: <1131604877.20041218092730@mail.ru.suse.lists.linux.kernel> <1105117559.11753.34.camel@baythorne.infradead.org> <20050107100017.454ddadc@dxpl.pdx.osdl.net> <1105133241.3375.16.camel@localhost.localdomain> <20050118135735.4b77d38d.davem@davemloft.net> <1106433059.4486.11.camel@localhost.localdomain> <1106436153.20995.42.camel@tux.rsn.bth.se> <1106484019.3376.5.camel@localhost.localdomain> <1106496509.1085.1.camel@tux.rsn.bth.se> <20050125220558.6e824f8a.davem@davemloft.net> <1106730510.4041.4.camel@localhost.localdomain> <41F82C6D.7020006@trash.net> <20050126231801.7bf90338.davem@davemloft.net> <41F929FA.3050800@trash.net> <20050127114726.2205b4ed.davem@davemloft.net> In-Reply-To: <20050127114726.2205b4ed.davem@davemloft.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 901 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 510 Lines: 21 David S. Miller wrote: >In the generated asm on sparc64, invoke2() gets a tail-call >whereas invoke() does not. Hmmm... > > Apparently support for indirect tail-calls was added to gcc 3.4. gcc-3.3.5: 0x0000000000000000 : sub $0x8,%rsp 0x0000000000000004 : callq *%esi 0x0000000000000006 : add $0x8,%rsp 0x000000000000000a : retq gcc-3.4.4: 0x0000000000000000 : mov %rsi,%r11 0x0000000000000003 : jmpq *%r11d Regards Patrick From rmk+netdev=oss.sgi.com@arm.linux.org.uk Thu Jan 27 14:57:39 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 14:57:44 -0800 (PST) Received: from caramon.arm.linux.org.uk (caramon.arm.linux.org.uk [212.18.232.186]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RMvbjq001904 for ; Thu, 27 Jan 2005 14:57:38 -0800 Received: from flint.arm.linux.org.uk ([2002:d412:e8ba:1:201:2ff:fe14:8fad]) by caramon.arm.linux.org.uk with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.41) id 1CuIZq-0007os-Rd; Thu, 27 Jan 2005 22:57:27 +0000 Received: from rmk by flint.arm.linux.org.uk with local (Exim 4.41) id 1CuIZp-0005R6-Nm; Thu, 27 Jan 2005 22:57:25 +0000 Date: Thu, 27 Jan 2005 22:57:25 +0000 From: Russell King To: Jeff Garzik Cc: Linux Kernel , Netdev , Greg KH , Andrew Morton Subject: Re: [ANN] removal of certain net drivers coming soon: eepro100, xircom_tulip_cb, iph5526 Message-ID: <20050127225725.F3036@flint.arm.linux.org.uk> Mail-Followup-To: Jeff Garzik , Linux Kernel , Netdev , Greg KH , Andrew Morton References: <41F952F4.7040804@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <41F952F4.7040804@pobox.com>; from jgarzik@pobox.com on Thu, Jan 27, 2005 at 03:45:40PM -0500 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 902 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rmk+lkml@arm.linux.org.uk Precedence: bulk X-list: netdev Content-Length: 1557 Lines: 44 On Thu, Jan 27, 2005 at 03:45:40PM -0500, Jeff Garzik wrote: > 3) eepro100 > > Unmaintained; users should use e100. > > When I last mentioned eepro100 was going away, I got a few private > emails saying complaining about issues not yet taken care of in e100. > eepro100 will not be removed until these issues are resolved. Has e100 actually been fixed to use the PCI DMA API correctly yet? Looking at it, it doesn't look like it, so until it does, eepro100 is the far better bet for platforms needing working DMA API. What I'm talking about is e100's apparant belief that it can modify rfd's in the receive ring on a non-cache coherent architecture and expect the data around it to remain unaffected (see e100_rx_alloc_skb): struct rfd { u16 status; u16 command; u32 link; u32 rbd; u16 actual_size; u16 size; }; it touches command and link. This means that the whole rfd plus maybe the following or preceding 16 bytes get loaded into a cache line (assuming cache lines of 32 bytes), and that data written out again at sync. However, it does this on what seems to be an active receive chain. So, both the CPU _and_ the device own the same data. Which is a violation of the DMA API. So, eepro100 works. e100 is a dead loss for non-cache coherent architectures. Therefore, I say eepro100 stays until e100 is fixed. -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/ 2.6 Serial core From benh@kernel.crashing.org Thu Jan 27 15:08:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 15:08:33 -0800 (PST) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RN884J002746 for ; Thu, 27 Jan 2005 15:08:09 -0800 Received: from gaston (localhost [127.0.0.1]) by gate.crashing.org (8.12.8/8.12.8) with ESMTP id j0RMxvgJ018168; Thu, 27 Jan 2005 16:59:58 -0600 Subject: Re: MV643xx Ethernet 2.6 driver update From: Benjamin Herrenschmidt To: Jeff Garzik Cc: Dale Farnsworth , netdev@oss.sgi.com, Ralf Baechle , Manish Lachwani , Brian Waite , "Steven J. Hill" In-Reply-To: <41F94FBD.7000208@pobox.com> References: <20050117184019.GA24655@xyzzy> <41F8BACA.1020302@pobox.com> <20050127201955.GC1452@xyzzy> <41F94FBD.7000208@pobox.com> Content-Type: text/plain Date: Fri, 28 Jan 2005 10:06:22 +1100 Message-Id: <1106867182.6250.102.camel@gaston> Mime-Version: 1.0 X-Mailer: Evolution 2.0.3 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 903 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: benh@kernel.crashing.org Precedence: bulk X-list: netdev Content-Length: 481 Lines: 15 On Thu, 2005-01-27 at 15:31 -0500, Jeff Garzik wrote: > Thanks, pulled. It will sit in netdev-2.6 queue (and thus -mm) for a > while, while I and others review it. I admit I only gave it a quick > overview. > > After a little while we'll push upstream. Excellent ! I'll do some tests on pegasos here, it's a ppc machine using this chipset as well. The previous driver was unuseable, and some patches were floating around but it was still not really working properly. Ben. From david-b@pacbell.net Thu Jan 27 15:12:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 15:12:54 -0800 (PST) Received: from ylpvm01.prodigy.net (ylpvm01-ext.prodigy.net [207.115.57.32]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RNCfBK003337 for ; Thu, 27 Jan 2005 15:12:41 -0800 Received: from ascent (adsl-69-107-48-231.dsl.pltn13.pacbell.net [69.107.48.231]) by ylpvm01.prodigy.net (8.12.10 outbound/8.12.10) with ESMTP id j0RNC2vE027692; Thu, 27 Jan 2005 18:12:05 -0500 From: David Brownell To: Janos Farkas Subject: Re: 2.6.11-rc2 TCP ignores PMTU ICMP (Re: Linux 2.6.11-rc2) Date: Thu, 27 Jan 2005 15:11:57 -0800 User-Agent: KMail/1.7.1 Cc: David Ford , linux-kernel@vger.kernel.org, netdev@oss.sgi.com, Art Haas References: <200501232251.42394.david-b@pacbell.net> <200501271128.48411.david-b@pacbell.net> In-Reply-To: <200501271128.48411.david-b@pacbell.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501271511.58086.david-b@pacbell.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 904 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: david-b@pacbell.net Precedence: bulk X-list: netdev Content-Length: 681 Lines: 15 I just got an interesting "I see these problems too" report. It may provide a useful clue. According to "Art Haas" : > I'm running the current BK kernel now, and I'm not seeing the problems > right now because, I found, I do not have some of the IP masquerading > modules installed on my machine. When these modules get installed then > the cvs/rsync problems appear. I do have CONFIG_IP_NF_TARGET_MASQUERADE=y on the system where I'm seeing this, though it's not doing anything just now. Haven't yet made time to see if disabling it improves things ... but if that's a factor, it could explain why more people aren't suffering with this problem. - Dave From mlachwani@mvista.com Thu Jan 27 15:13:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 15:13:25 -0800 (PST) Received: from hermes.mvista.com (gateway-1237.mvista.com [12.44.186.158]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RNDKG8003523 for ; Thu, 27 Jan 2005 15:13:21 -0800 Received: from mvista.com (prometheus.mvista.com [10.0.0.139]) by hermes.mvista.com (Postfix) with ESMTP id 4D4B318901; Thu, 27 Jan 2005 15:13:15 -0800 (PST) Message-ID: <41F9758B.3010209@mvista.com> Date: Thu, 27 Jan 2005 15:13:15 -0800 From: Manish Lachwani User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.2) Gecko/20040308 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Benjamin Herrenschmidt Cc: Jeff Garzik , Dale Farnsworth , netdev@oss.sgi.com, Ralf Baechle , Brian Waite , "Steven J. Hill" Subject: Re: MV643xx Ethernet 2.6 driver update References: <20050117184019.GA24655@xyzzy> <41F8BACA.1020302@pobox.com> <20050127201955.GC1452@xyzzy> <41F94FBD.7000208@pobox.com> <1106867182.6250.102.camel@gaston> In-Reply-To: <1106867182.6250.102.camel@gaston> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 905 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mlachwani@mvista.com Precedence: bulk X-list: netdev Content-Length: 656 Lines: 31 Benjamin Herrenschmidt wrote: >On Thu, 2005-01-27 at 15:31 -0500, Jeff Garzik wrote: > > >>Thanks, pulled. It will sit in netdev-2.6 queue (and thus -mm) for a >>while, while I and others review it. I admit I only gave it a quick >>overview. >> >>After a little while we'll push upstream. >> >> > >Excellent ! I'll do some tests on pegasos here, it's a ppc machine using >this chipset as well. The previous driver was unuseable, and some >patches were floating around but it was still not really working >properly. > >Ben. > > > > Hello ! I plan to test this on an Ocelot-3 board that has the Discovery III chipset. Thanks Manish Lachwani From davem@davemloft.net Thu Jan 27 15:29:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 15:29:27 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RNTJP5004611 for ; Thu, 27 Jan 2005 15:29:20 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CuJ0M-0004oI-00; Thu, 27 Jan 2005 15:24:50 -0800 Date: Thu, 27 Jan 2005 15:24:50 -0800 From: "David S. Miller" To: Patrick McHardy Cc: bdschuym@pandora.be, netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org, snort2004@mail.ru, rusty@rustcorp.com.au, ak@suse.de, bridge@osdl.org, gandalf@wlug.westbo.se, dwmw2@infradead.org, shemminger@osdl.org Subject: Re: [PATCH/RFC] Reduce call chain length in netfilter Message-Id: <20050127152450.6daba4fa.davem@davemloft.net> In-Reply-To: <41F96FA4.4000105@trash.net> References: <1131604877.20041218092730@mail.ru.suse.lists.linux.kernel> <1105117559.11753.34.camel@baythorne.infradead.org> <20050107100017.454ddadc@dxpl.pdx.osdl.net> <1105133241.3375.16.camel@localhost.localdomain> <20050118135735.4b77d38d.davem@davemloft.net> <1106433059.4486.11.camel@localhost.localdomain> <1106436153.20995.42.camel@tux.rsn.bth.se> <1106484019.3376.5.camel@localhost.localdomain> <1106496509.1085.1.camel@tux.rsn.bth.se> <20050125220558.6e824f8a.davem@davemloft.net> <1106730510.4041.4.camel@localhost.localdomain> <41F82C6D.7020006@trash.net> <20050126231801.7bf90338.davem@davemloft.net> <41F929FA.3050800@trash.net> <20050127114726.2205b4ed.davem@davemloft.net> <41F96FA4.4000105@trash.net> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 906 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 2714 Lines: 106 On Thu, 27 Jan 2005 23:48:04 +0100 Patrick McHardy wrote: > David S. Miller wrote: > > >In the generated asm on sparc64, invoke2() gets a tail-call > >whereas invoke() does not. Hmmm... > > Apparently support for indirect tail-calls was added to gcc 3.4. Good data point. I've been trying to figure out ways to decrease the number of args that get sent to nf_hook_slow but this would require some API changes unfortunately. One idea goes like this, we create little descriptors of the form: struct nf_hook_desc { int (*okfn)(struct sk_buff *); int pf; int hook; }; Then NF_HOOK*() callsites do something like this: static const struct nf_hook_desc nf_ip_local_out = { .okfn = dst_output, .pf = PF_INET, .hook = NF_IP_LOCAL_OUT, }; ... /* Send it out. */ return NF_HOOK(&nf_ip_local_out, skb, NULL, rt->u.dst.dev); This gets us down to 4 arguments from 6. I think we can kill one more. It is never the case that both indev and outdev are both set, so we can use some nf_hook_desc piece of state to indicate which (in or out) the passed device pointer is. Oh yes, we can nicely add the thresh thing in here too while we're at it. So the final nf_hook_desc might look something something like: struct nf_hook_desc { int (*okfn)(struct sk_buff *); int hook; int thresh; u8 pf; /* AF_MAX is 32 */ u8 is_output; }; Hook could possibly use a smaller type as well to condense the size of this thing even further. I don't know if there are any nice assumptions we can make about the hook numbers. Now, back to the compatability issue. We could create a new macro, NF_HOOK_DESC() and keep the existing ones around via some nf_hook_slow() that basically does: int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb, struct net_device *indev, struct net_device *outdev, int (*okfn)(struct sk_buff *), int thresh) { struct nf_hook_desc desc; desc.okfn = okfn; desc.hook = hook; desc.thresh = thresh; desc.pf = pf; desc.is_output = (outdev != NULL); return nf_hook_desc(&desc, skb, (outdev ? outdev : indev)); } So the final new stuff looks something like: #ifdef CONFIG_NETFILTER struct nf_hook_desc { int (*okfn)(struct sk_buff *); int hook; int thresh; u8 pf; /* AF_MAX is 32 */ u8 is_output; }; #define NF_DESC_DECLARE(_name, _okfn, _hook, _thresh, _pf, _is_output) \ static const struct nf_hook_desc _name = { \ .okfn = _okfn, \ .hook = _hook, \ .thresh = _thresh, \ .pf = _pf, \ .is_output = _is_output, \ }; extern int nf_hook_desc(struct nf_hook_desc *desc, struct sk_buff *skb, struct net_device *dev); #define NF_HOOK_DESC(_desc, _skb, _dev) \ nf_hook_desc(_desc, _skb, _dev) #endif Just throwing around ideas... comments? From paulus@ozlabs.org Thu Jan 27 15:30:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 15:30:32 -0800 (PST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RNUOgj004913 for ; Thu, 27 Jan 2005 15:30:25 -0800 Received: by ozlabs.org (Postfix, from userid 1003) id AAE4667AA2; Fri, 28 Jan 2005 10:30:18 +1100 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16889.31219.724098.168789@cargo.ozlabs.ibm.com> Date: Fri, 28 Jan 2005 10:32:03 +1100 From: Paul Mackerras To: akpm@osdl.org, hch@lst.de Cc: netdev@oss.sgi.com Subject: [PATCH] remove bogus exports in ppp X-Mailer: VM 7.19 under Emacs 21.3.1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 907 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: paulus@samba.org Precedence: bulk X-list: netdev Content-Length: 701 Lines: 17 Remove unnecessary exports from ppp_generic.c. Signed-off-by: Christoph Hellwig Signed-off-by: Paul Mackerras diff -urN linux-2.5/drivers/net/ppp_generic.c test/drivers/net/ppp_generic.c --- linux-2.5/drivers/net/ppp_generic.c 2005-01-27 11:01:23.000000000 +1100 +++ test/drivers/net/ppp_generic.c 2005-01-28 10:23:54.539929344 +1100 @@ -2741,8 +2741,6 @@ EXPORT_SYMBOL(ppp_output_wakeup); EXPORT_SYMBOL(ppp_register_compressor); EXPORT_SYMBOL(ppp_unregister_compressor); -EXPORT_SYMBOL(all_ppp_units); /* for debugging */ -EXPORT_SYMBOL(all_channels); /* for debugging */ MODULE_LICENSE("GPL"); MODULE_ALIAS_CHARDEV_MAJOR(PPP_MAJOR); MODULE_ALIAS("/dev/ppp"); From davem@davemloft.net Thu Jan 27 15:35:44 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 15:35:50 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RNZiE6005661 for ; Thu, 27 Jan 2005 15:35:44 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CuJ6Y-0004ov-00; Thu, 27 Jan 2005 15:31:14 -0800 Date: Thu, 27 Jan 2005 15:31:14 -0800 From: "David S. Miller" To: Russell King Cc: jgarzik@pobox.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, greg@kroah.com, akpm@osdl.org Subject: Re: [ANN] removal of certain net drivers coming soon: eepro100, xircom_tulip_cb, iph5526 Message-Id: <20050127153114.72be03e2.davem@davemloft.net> In-Reply-To: <20050127225725.F3036@flint.arm.linux.org.uk> References: <41F952F4.7040804@pobox.com> <20050127225725.F3036@flint.arm.linux.org.uk> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 908 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 960 Lines: 21 On Thu, 27 Jan 2005 22:57:25 +0000 Russell King wrote: > Has e100 actually been fixed to use the PCI DMA API correctly yet? It seems to be doing the right thing. I see the DMA sync calls (properly using cpu vs. device syncing variants) at the right spots, and the only thing the chip really relies upon is ordering of visibility and this is achieved via a combination of cpu memory barriers and the correct DMA sync calls. For example, a pci_dma_sync_single_for_cpu() is always performed before peeking at the descriptors at RX interrupt time (see e100_rx_indicate). When new descriptors are written to, then linked into the chain it memory barriers the cpu writes then DMA syncs the previous descriptor to the device. This is occuring in e100_alloc_skb(). Therefore the only missing sync would be of the new RX descriptor when linking things in like that, ie. at the end of e100_rx_alloc_skb() if rx->prev->skb is non-NULL. From jgarzik@pobox.com Thu Jan 27 15:45:59 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 15:46:04 -0800 (PST) Received: from parcelfarce.linux.theplanet.co.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RNjwUt006369 for ; Thu, 27 Jan 2005 15:45:58 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by parcelfarce.linux.theplanet.co.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CuJKm-0007Nt-MU; Thu, 27 Jan 2005 23:45:57 +0000 Message-ID: <41F97D26.9090903@pobox.com> Date: Thu, 27 Jan 2005 18:45:42 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrew Morton , Linus Torvalds CC: Netdev Subject: [BK PATCHES] 2.6.x net driver fixes Content-Type: multipart/mixed; boundary="------------070209020702030303060700" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 909 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 11815 Lines: 446 This is a multi-part message in MIME format. --------------070209020702030303060700 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit --------------070209020702030303060700 Content-Type: text/plain; name="changelog.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="changelog.txt" Please do a bk pull bk://gkernel.bkbits.net/net-drivers-2.6 This will update the following files: drivers/net/e100.c | 1 drivers/net/gianfar.c | 8 +-- drivers/net/skfp/skfddi.c | 116 ++++++++++++++++++-------------------------- drivers/net/tulip/de2104x.c | 1 4 files changed, 56 insertions(+), 70 deletions(-) through these ChangeSets: : o netdrv gianfar: Fix usage of gfar_read in debug code Alexander Viro: o de2104x: Fixes breakage in getting MAC address Stephen Hemminger: o (2/2) skfddi: netdev_priv and cast cleanup o (1/2) skfddi: initialization Steven Rostedt: o e100 locking up netconsole --------------070209020702030303060700 Content-Type: text/plain; name="patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch" diff -Nru a/drivers/net/e100.c b/drivers/net/e100.c --- a/drivers/net/e100.c 2005-01-27 18:44:48 -05:00 +++ b/drivers/net/e100.c 2005-01-27 18:44:48 -05:00 @@ -1630,6 +1630,7 @@ struct nic *nic = netdev_priv(netdev); e100_disable_irq(nic); e100_intr(nic->pdev->irq, netdev, NULL); + e100_tx_clean(nic); e100_enable_irq(nic); } #endif diff -Nru a/drivers/net/gianfar.c b/drivers/net/gianfar.c --- a/drivers/net/gianfar.c 2005-01-27 18:44:48 -05:00 +++ b/drivers/net/gianfar.c 2005-01-27 18:44:48 -05:00 @@ -1190,8 +1190,8 @@ } else { #ifdef VERBOSE_GFAR_ERRORS printk(KERN_DEBUG "%s: receive called twice (%x)[%x]\n", - dev->name, gfar_read(priv->regs->ievent), - gfar_read(priv->regs->imask)); + dev->name, gfar_read(&priv->regs->ievent), + gfar_read(&priv->regs->imask)); #endif } #else @@ -1415,7 +1415,7 @@ #ifdef VERBOSE_GFAR_ERRORS printk(KERN_DEBUG "%s: busy error (rhalt: %x)\n", dev->name, - gfar_read(priv->regs->rstat)); + gfar_read(&priv->regs->rstat)); #endif } if (events & IEVENT_BABR) { @@ -1793,7 +1793,7 @@ #ifdef VERBOSE_GFAR_ERRORS printk(KERN_DEBUG "%s: busy error (rhalt: %x)\n", dev->name, - gfar_read(priv->regs->rstat)); + gfar_read(&priv->regs->rstat)); #endif } if (events & IEVENT_BABR) { diff -Nru a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c --- a/drivers/net/skfp/skfddi.c 2005-01-27 18:44:48 -05:00 +++ b/drivers/net/skfp/skfddi.c 2005-01-27 18:44:48 -05:00 @@ -169,8 +169,6 @@ #define PRINTK(s, args...) #endif // DRIVERDEBUG -#define PRIV(dev) (&(((struct s_smc *)dev->priv)->os)) - /* * ================= * = skfp_init_one = @@ -205,7 +203,6 @@ { struct net_device *dev; struct s_smc *smc; /* board pointer */ - unsigned long port, len; void __iomem *mem; int err; @@ -216,62 +213,43 @@ err = pci_enable_device(pdev); if (err) + return err; + + err = pci_request_regions(pdev, "skfddi"); + if (err) goto err_out1; + pci_set_master(pdev); #ifdef MEM_MAPPED_IO if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) { printk(KERN_ERR "skfp: region is not an MMIO resource\n"); err = -EIO; - goto err_out1; + goto err_out2; } - port = pci_resource_start(pdev, 0); - len = pci_resource_len(pdev, 0); - if (len < 0x4000) { - printk(KERN_ERR "skfp: Invalid PCI region size: %lu\n", len); - err = -EIO; - goto err_out1; - } + mem = ioremap(pci_resource_start(pdev, 0), 0x4000); #else if (!(pci_resource_flags(pdev, 1) & IO_RESOURCE_IO)) { printk(KERN_ERR "skfp: region is not PIO resource\n"); err = -EIO; - goto err_out1; + goto err_out2; } - port = pci_resource_start(pdev, 1); - len = pci_resource_len(pdev, 1); - if (len < FP_IO_LEN) { - printk(KERN_ERR "skfp: Invalid PCI region size: %d\n", - io_len); + mem = ioport_map(pci_resource_start(pdev, 1), FP_IO_LEN); +#endif + if (!mem) { + printk(KERN_ERR "skfp: Unable to map register, " + "FDDI adapter will be disabled.\n"); err = -EIO; - goto err_out1; + goto err_out2; } -#endif - err = pci_request_regions(pdev, "skfddi"); - if (err) - goto err_out1; - - pci_set_master(pdev); dev = alloc_fddidev(sizeof(struct s_smc)); if (!dev) { printk(KERN_ERR "skfp: Unable to allocate fddi device, " "FDDI adapter will be disabled.\n"); err = -ENOMEM; - goto err_out2; - } - -#ifdef MEM_MAPPED_IO - mem = ioremap(port, len); -#else - mem =ioport_map(port, len); -#endif - if (!mem) { - printk(KERN_ERR "skfp: Unable to map register, " - "FDDI adapter will be disabled.\n"); - err = -EIO; goto err_out3; } @@ -289,7 +267,7 @@ SET_NETDEV_DEV(dev, &pdev->dev); /* Initialize board structure with bus-specific info */ - smc = (struct s_smc *) dev->priv; + smc = netdev_priv(dev); smc->os.dev = dev; smc->os.bus_type = SK_BUS_TYPE_PCI; smc->os.pdev = *pdev; @@ -331,16 +309,17 @@ pci_free_consistent(pdev, MAX_FRAME_SIZE, smc->os.LocalRxBuffer, smc->os.LocalRxBufferDMA); err_out4: + free_netdev(dev); +err_out3: #ifdef MEM_MAPPED_IO - iounmap(smc->hw.iop); + iounmap(mem); #else - ioport_unmap(smc->hw.iop); + ioport_unmap(mem); #endif -err_out3: - free_netdev(dev); err_out2: pci_release_regions(pdev); err_out1: + pci_disable_device(pdev); return err; } @@ -350,7 +329,7 @@ static void __devexit skfp_remove_one(struct pci_dev *pdev) { struct net_device *p = pci_get_drvdata(pdev); - struct s_smc *lp = p->priv; + struct s_smc *lp = netdev_priv(p); unregister_netdev(p); @@ -376,6 +355,7 @@ pci_release_regions(pdev); free_netdev(p); + pci_disable_device(pdev); pci_set_drvdata(pdev, NULL); } @@ -406,8 +386,8 @@ */ static int skfp_driver_init(struct net_device *dev) { - struct s_smc *smc = (struct s_smc *) dev->priv; - skfddi_priv *bp = PRIV(dev); + struct s_smc *smc = netdev_priv(dev); + skfddi_priv *bp = &smc->os; int err = -EIO; PRINTK(KERN_INFO "entering skfp_driver_init\n"); @@ -513,7 +493,7 @@ */ static int skfp_open(struct net_device *dev) { - struct s_smc *smc = (struct s_smc *) dev->priv; + struct s_smc *smc = netdev_priv(dev); int err; PRINTK(KERN_INFO "entering skfp_open\n"); @@ -580,8 +560,8 @@ */ static int skfp_close(struct net_device *dev) { - struct s_smc *smc = (struct s_smc *) dev->priv; - skfddi_priv *bp = PRIV(dev); + struct s_smc *smc = netdev_priv(dev); + skfddi_priv *bp = &smc->os; CLI_FBI(); smt_reset_defaults(smc, 1); @@ -640,15 +620,15 @@ { struct net_device *dev = (struct net_device *) dev_id; struct s_smc *smc; /* private board structure pointer */ - skfddi_priv *bp = PRIV(dev); - + skfddi_priv *bp; if (dev == NULL) { printk("%s: irq %d for unknown device\n", dev->name, irq); return IRQ_NONE; } - smc = (struct s_smc *) dev->priv; + smc = netdev_priv(dev); + bp = &smc->os; // IRQs enabled or disabled ? if (inpd(ADDR(B0_IMSK)) == 0) { @@ -710,7 +690,7 @@ */ struct net_device_stats *skfp_ctl_get_stats(struct net_device *dev) { - struct s_smc *bp = (struct s_smc *) dev->priv; + struct s_smc *bp = netdev_priv(dev); /* Fill the bp->stats structure with driver-maintained counters */ @@ -874,7 +854,8 @@ */ static void skfp_ctl_set_multicast_list(struct net_device *dev) { - skfddi_priv *bp = PRIV(dev); + struct s_smc *smc = netdev_priv(dev); + skfddi_priv *bp = &smc->os; unsigned long Flags; spin_lock_irqsave(&bp->DriverLock, Flags); @@ -887,7 +868,7 @@ static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev) { - struct s_smc *smc = (struct s_smc *) dev->priv; + struct s_smc *smc = netdev_priv(dev); struct dev_mc_list *dmi; /* ptr to multicast addr entry */ int i; @@ -970,9 +951,9 @@ */ static int skfp_ctl_set_mac_address(struct net_device *dev, void *addr) { - struct s_smc *smc = (struct s_smc *) dev->priv; + struct s_smc *smc = netdev_priv(dev); struct sockaddr *p_sockaddr = (struct sockaddr *) addr; - skfddi_priv *bp = (skfddi_priv *) & smc->os; + skfddi_priv *bp = &smc->os; unsigned long Flags; @@ -1010,12 +991,14 @@ static int skfp_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { - skfddi_priv *lp = PRIV(dev); + struct s_smc *smc = netdev_priv(dev); + skfddi_priv *lp = &smc->os; struct s_skfp_ioctl ioc; int status = 0; if (copy_from_user(&ioc, rq->ifr_data, sizeof(struct s_skfp_ioctl))) return -EFAULT; + switch (ioc.cmd) { case SKFP_GET_STATS: /* Get the driver statistics */ ioc.len = sizeof(lp->MacStat); @@ -1088,7 +1071,8 @@ */ static int skfp_send_pkt(struct sk_buff *skb, struct net_device *dev) { - skfddi_priv *bp = PRIV(dev); + struct s_smc *smc = netdev_priv(dev); + skfddi_priv *bp = &smc->os; PRINTK(KERN_INFO "skfp_send_pkt\n"); @@ -1115,7 +1099,7 @@ } bp->QueueSkb--; skb_queue_tail(&bp->SendSkbQueue, skb); - send_queued_packets((struct s_smc *) dev->priv); + send_queued_packets(netdev_priv(dev)); if (bp->QueueSkb == 0) { netif_stop_queue(dev); } @@ -1150,7 +1134,7 @@ */ static void send_queued_packets(struct s_smc *smc) { - skfddi_priv *bp = (skfddi_priv *) & smc->os; + skfddi_priv *bp = &smc->os; struct sk_buff *skb; unsigned char fc; int queue; @@ -1322,7 +1306,7 @@ ************************/ void llc_restart_tx(struct s_smc *smc) { - skfddi_priv *bp = (skfddi_priv *) & smc->os; + skfddi_priv *bp = &smc->os; PRINTK(KERN_INFO "[llc_restart_tx]\n"); @@ -1506,7 +1490,7 @@ * unmap first, the hardware module could read inconsistent data. */ if (flag & DMA_WR) { - skfddi_priv *bp = (skfddi_priv *) & smc->os; + skfddi_priv *bp = &smc->os; volatile struct s_smt_fp_rxd *r = &descr->r; /* If SKB is NULL, we used the local buffer. */ @@ -1620,7 +1604,7 @@ void mac_drv_rx_complete(struct s_smc *smc, volatile struct s_smt_fp_rxd *rxd, int frag_count, int len) { - skfddi_priv *bp = (skfddi_priv *) & smc->os; + skfddi_priv *bp = &smc->os; struct sk_buff *skb; unsigned char *virt, *cp; unsigned short ri; @@ -1752,7 +1736,7 @@ printk("fddi: Multi-fragment requeue!\n"); - MaxFrameSize = ((skfddi_priv *) & smc->os)->MaxFrameSize; + MaxFrameSize = smc->os.MaxFrameSize; src_rxd = rxd; for (; frag_count > 0; frag_count--) { next_rxd = src_rxd->rxd_next; @@ -1828,7 +1812,7 @@ // Walk through the list of free receive buffers, passing receive // buffers to the HWM as long as RXDs are available. - MaxFrameSize = ((skfddi_priv *) & smc->os)->MaxFrameSize; + MaxFrameSize = smc->os.MaxFrameSize; // Check if there is any RXD left. while (HWM_GET_RX_FREE(smc) > 0) { PRINTK(KERN_INFO ".\n"); @@ -1897,7 +1881,7 @@ for (; frag_count > 0; frag_count--) { skb = rxd->rxd_os.skb; if (skb != NULL) { - skfddi_priv *bp = (skfddi_priv *) & smc->os; + skfddi_priv *bp = &smc->os; int MaxFrameSize = bp->MaxFrameSize; pci_unmap_single(&bp->pdev, rxd->rxd_os.dma_addr, @@ -1964,7 +1948,7 @@ memcpy(skb->data, look_ahead, len); // deliver frame to system - skb->protocol = fddi_type_trans(skb, ((skfddi_priv *) & smc->os)->dev); + skb->protocol = fddi_type_trans(skb, smc->os.dev); skb->dev->last_rx = jiffies; netif_rx(skb); diff -Nru a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c --- a/drivers/net/tulip/de2104x.c 2005-01-27 18:44:48 -05:00 +++ b/drivers/net/tulip/de2104x.c 2005-01-27 18:44:48 -05:00 @@ -1703,6 +1703,7 @@ value = dr32(ROMCmd); while (value < 0 && --boguscnt > 0); de->dev->dev_addr[i] = value; + udelay(1); if (boguscnt <= 0) printk(KERN_WARNING PFX "timeout reading 21040 MAC address byte %u\n", i); } --------------070209020702030303060700-- From davem@davemloft.net Thu Jan 27 15:46:27 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 15:46:32 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RNkM6c006470 for ; Thu, 27 Jan 2005 15:46:27 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CuJGo-0004sB-00; Thu, 27 Jan 2005 15:41:50 -0800 Date: Thu, 27 Jan 2005 15:41:50 -0800 From: "David S. Miller" To: David Brownell Cc: jf-ml-k1-1087813225@lk8rp.mail.xeon.eu.org, david+challenge-response@blue-labs.org, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, ahaas@airmail.net Subject: Re: 2.6.11-rc2 TCP ignores PMTU ICMP (Re: Linux 2.6.11-rc2) Message-Id: <20050127154150.360f95e2.davem@davemloft.net> In-Reply-To: <200501271511.58086.david-b@pacbell.net> References: <200501232251.42394.david-b@pacbell.net> <200501271128.48411.david-b@pacbell.net> <200501271511.58086.david-b@pacbell.net> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 910 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 107 Lines: 3 I've forwarded this to netfilter-devel for inspection. Thanks for collecting all the data points so well. From davem@davemloft.net Thu Jan 27 15:47:14 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 15:47:20 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RNlEBJ007051 for ; Thu, 27 Jan 2005 15:47:14 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CuJHi-0004sR-00; Thu, 27 Jan 2005 15:42:46 -0800 Date: Thu, 27 Jan 2005 15:42:46 -0800 From: "David S. Miller" To: Paul Mackerras Cc: akpm@osdl.org, hch@lst.de, netdev@oss.sgi.com Subject: Re: [PATCH] remove bogus exports in ppp Message-Id: <20050127154246.3e4c26e6.davem@davemloft.net> In-Reply-To: <16889.31219.724098.168789@cargo.ozlabs.ibm.com> References: <16889.31219.724098.168789@cargo.ozlabs.ibm.com> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 911 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 335 Lines: 10 On Fri, 28 Jan 2005 10:32:03 +1100 Paul Mackerras wrote: > Remove unnecessary exports from ppp_generic.c. > > Signed-off-by: Christoph Hellwig > Signed-off-by: Paul Mackerras How likely is it that anything in the world makes any reference to this thing outside of the kernel tree? From paulus@ozlabs.org Thu Jan 27 15:58:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 15:58:24 -0800 (PST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0RNwJdj007977 for ; Thu, 27 Jan 2005 15:58:20 -0800 Received: by ozlabs.org (Postfix, from userid 1003) id ED0C967AAA; Fri, 28 Jan 2005 10:58:13 +1100 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16889.32898.640799.219272@cargo.ozlabs.ibm.com> Date: Fri, 28 Jan 2005 11:00:02 +1100 From: Paul Mackerras To: "David S. Miller" Cc: akpm@osdl.org, hch@lst.de, netdev@oss.sgi.com Subject: Re: [PATCH] remove bogus exports in ppp In-Reply-To: <20050127154246.3e4c26e6.davem@davemloft.net> References: <16889.31219.724098.168789@cargo.ozlabs.ibm.com> <20050127154246.3e4c26e6.davem@davemloft.net> X-Mailer: VM 7.19 under Emacs 21.3.1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 912 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: paulus@samba.org Precedence: bulk X-list: netdev Content-Length: 335 Lines: 11 David S. Miller writes: > How likely is it that anything in the world makes any > reference to this thing outside of the kernel tree? Extremely unlikely. The structures that they refer to are defined in ppp_generic.c, not a header file, and aren't part of the generic PPP API. They should never have been exported in fact. Paul. From jgarzik@pobox.com Thu Jan 27 16:00:52 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 16:00:57 -0800 (PST) Received: from parcelfarce.linux.theplanet.co.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S00o7k008489 for ; Thu, 27 Jan 2005 16:00:51 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by parcelfarce.linux.theplanet.co.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CuJZ9-0007nR-99; Fri, 28 Jan 2005 00:00:47 +0000 Message-ID: <41F980A0.8020905@pobox.com> Date: Thu, 27 Jan 2005 19:00:32 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Netdev CC: Linux Kernel , Andrew Morton , Jouni Malinen Subject: netdev-2.6 queue updated Content-Type: multipart/mixed; boundary="------------040707010005060807000400" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 913 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 13025 Lines: 293 This is a multi-part message in MIME format. --------------040707010005060807000400 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit The attached changelog describes what I just pushed out to BitKeeper (and what should be appearing in the next -mm release from Andrew). Note to BK users: please re-clone netdev-2.6, don't just 'bk pull'. Most of this is simply stuff that is "hanging out for a while" in netdev-2.6 while it -- hopefully -- gets testing and review. All of these changes are bound for upstream eventually. Note on wireless: HostAP and Vladmir's effort to make 802.11 a "real" Linux network protocol both seem to have stagnated a bit. I'm still hoping that * Intel will appear with a patch that merges their drivers * some magical engineering force will start using the HostAP code as common library code in other drivers (notably Intel) * Vladmir or someone will continue Vladmir's work to integrate wireless more closely with the Linux network stack Jeff --------------040707010005060807000400 Content-Type: text/plain; name="changelog.txt" Content-Transfer-Encoding: 8bit Content-Disposition: inline; filename="changelog.txt" BK users: bk pull bk://gkernel.bkbits.net/netdev-2.6 This will update the following files: Documentation/networking/ixgb.txt | 9 MAINTAINERS | 7 drivers/net/3c503.c | 67 drivers/net/3c515.c | 32 drivers/net/8139cp.c | 100 drivers/net/8139too.c | 291 - drivers/net/Kconfig | 12 drivers/net/Makefile | 1 drivers/net/arcnet/arc-rawmode.c | 4 drivers/net/arcnet/arc-rimi.c | 14 drivers/net/arcnet/arcnet.c | 30 drivers/net/arcnet/com20020.c | 6 drivers/net/arcnet/com90io.c | 4 drivers/net/arcnet/com90xx.c | 8 drivers/net/arcnet/rfc1051.c | 8 drivers/net/arcnet/rfc1201.c | 12 drivers/net/b44.h | 14 drivers/net/cs89x0.c | 4 drivers/net/es3210.c | 32 drivers/net/ewrk3.c | 87 drivers/net/fealnx.c | 275 - drivers/net/ibmlana.c | 99 drivers/net/ibmlana.h | 1 drivers/net/irda/act200l-sir.c | 3 drivers/net/irda/irtty-sir.c | 4 drivers/net/irda/ma600-sir.c | 12 drivers/net/irda/sir_dev.c | 4 drivers/net/irda/tekram-sir.c | 3 drivers/net/mv643xx_eth.c | 2398 +++++----- drivers/net/mv643xx_eth.h | 603 -- drivers/net/ni65.c | 3 drivers/net/ns83820.c | 3 drivers/net/pcmcia/ibmtr_cs.c | 7 drivers/net/pcmcia/xirc2ps_cs.c | 23 drivers/net/pcnet32.c | 47 drivers/net/sis900.c | 195 drivers/net/sk_mca.c | 126 drivers/net/sk_mca.h | 19 drivers/net/skge.c | 3334 ++++++++++++++ drivers/net/skge.h | 3005 ++++++++++++ drivers/net/smc-mca.c | 37 drivers/net/smc-ultra.c | 34 drivers/net/smc-ultra32.c | 30 drivers/net/smc91x.c | 37 drivers/net/smc91x.h | 20 drivers/net/tg3.h | 14 drivers/net/tokenring/ibmtr.c | 158 drivers/net/typhoon-firmware.h | 5568 ++++++++++-------------- drivers/net/typhoon.c | 244 - drivers/net/wan/cosa.c | 7 drivers/net/wan/dscc4.c | 117 drivers/net/wd.c | 36 drivers/net/wireless/Kconfig | 2 drivers/net/wireless/Makefile | 2 drivers/net/wireless/airo.c | 25 drivers/net/wireless/airport.c | 5 drivers/net/wireless/arlan.h | 4 drivers/net/wireless/atmel_cs.c | 3 drivers/net/wireless/hermes.c | 43 drivers/net/wireless/hermes.h | 62 drivers/net/wireless/hostap/Kconfig | 104 drivers/net/wireless/hostap/Makefile | 8 drivers/net/wireless/hostap/hostap.c | 1205 +++++ drivers/net/wireless/hostap/hostap.h | 57 drivers/net/wireless/hostap/hostap_80211.h | 107 drivers/net/wireless/hostap/hostap_80211_rx.c | 1080 ++++ drivers/net/wireless/hostap/hostap_80211_tx.c | 522 ++ drivers/net/wireless/hostap/hostap_ap.c | 3259 ++++++++++++++ drivers/net/wireless/hostap/hostap_ap.h | 272 + drivers/net/wireless/hostap/hostap_common.h | 556 ++ drivers/net/wireless/hostap/hostap_config.h | 86 drivers/net/wireless/hostap/hostap_crypt.c | 167 drivers/net/wireless/hostap/hostap_crypt.h | 50 drivers/net/wireless/hostap/hostap_crypt_ccmp.c | 486 ++ drivers/net/wireless/hostap/hostap_crypt_tkip.c | 696 +++ drivers/net/wireless/hostap/hostap_crypt_wep.c | 281 + drivers/net/wireless/hostap/hostap_cs.c | 785 +++ drivers/net/wireless/hostap/hostap_download.c | 761 +++ drivers/net/wireless/hostap/hostap_hw.c | 3607 +++++++++++++++ drivers/net/wireless/hostap/hostap_info.c | 469 ++ drivers/net/wireless/hostap/hostap_ioctl.c | 3624 +++++++++++++++ drivers/net/wireless/hostap/hostap_pci.c | 452 + drivers/net/wireless/hostap/hostap_plx.c | 611 ++ drivers/net/wireless/hostap/hostap_proc.c | 466 ++ drivers/net/wireless/hostap/hostap_wlan.h | 1071 ++++ drivers/net/wireless/orinoco_cs.c | 10 drivers/net/wireless/orinoco_pci.c | 7 drivers/net/wireless/orinoco_plx.c | 82 drivers/net/wireless/orinoco_tmd.c | 51 drivers/net/wireless/prism54/isl_ioctl.c | 2 include/linux/ibmtr.h | 15 include/linux/mii.h | 4 include/linux/mv643xx.h | 434 + include/linux/pci_ids.h | 8 94 files changed, 32802 insertions(+), 5947 deletions(-) through these ChangeSets: : o Big rename o Rename MV_READ => mv_read and MV_WRITE => mv_write o Additional whitespace cleanups, mostly changing spaces to tabs in comments o Run mv643xx_eth.[ch] through scripts/Lindent o Add a function to detect at runtime whether a PHY is attached to the specified port, and use it to cause the probe routine to fail when there is no PHY. o This one liner removes a spurious left paren fixing an obvious syntax error in the #ifndef MV64340_NAPI case o Add support for PHYs/boards that don't support autonegotiation o With this patch, the driver now calls netif_carrier_off/netif_carrier_on o This patch cleans up the handling of receive skb sizing : o [netdrvr 8139cp] add PCI ID Alexander Viro: o 3c503 (iomem + isa-ectomy) o ibmlana part 2 (iomem annotations and isa-ectomy) o ibmlana part 1 (netdev_priv()) o sk_mca - iomem and isa-ectomy o sk_mca - netdev_priv() o ibmtr 2/2: ibmtr annotations - the rest o ibmtr 1/2: iomem annotations - trivial part o es3210 iomem annotions and isa-ectomy o ewrk3 iomem annotations + isa-ectomy o wd iomem annotations + isa-ectomy o smc-ultra32 iomem annotations + isa-ectomy o smc-ultra iomem annotations + isa-ectomy o smc-mca iomem annotations and isa-ectomy o fealnx iomem annotations, switch to io{read,write} o wireless iomem annotations and fixes, switch to io{read,write} Dale Farnsworth: o This patch simplifies the mv64340_eth_set_rx_mode function without changing its behavior. o This patch makes the use of the MV64340_RX_QUEUE_FILL_ON_TASK config macro more consistent, though the macro remains undefined, since the feature still does not work properly. o This patch adds support for passing additional parameters via the platform_device interface. These additional parameters are: o This patch adds device driver model support to the mv643xx_eth driver o This patch replaces the use of the pci_map_* functions with the corresponding dma_map_* functions. o This patch fixes the code that enables hardware checksum generation o This patch removes spin delays (count to 1000000, ugh) and instead waits with udelay or msleep for hardware flags to change. o This patch removes code that is redundant or useless Daniele Venzano: o sis900: chiprev i/o cleanups o sis900: debugging output update o sis900 printk audit o sis900: version bump; remove broken URL o sis900: add infrastructure needed for standard netif messages David Dillow: o Bump version and release date o Version 03.001.008 of the Typhoon firmware, courtesy of 3Com o Fixup the version reporting to match 3Com o Use module_param() and add descriptions o Teach typhoon to use port IO on machines that need it. It will attempt to use MMIO, but if that fails (or the user asks), it will fallback to port IO. o Enable bus mastering before saving our state, or we'll only be able to load the modules one time. David T. Hollis: o Move MII-related constants from b44/tg3 drivers to linux/mii.h Domen Puncer: o net/ewrk3: replace schedule_timeout() with msleep_interruptible() o net/tekram-sir: replace schedule_timeout() with msleep() o net/ns83820: replace schedule_timeout() with msleep() o net/ni65: replace schedule_timeout() with msleep() o net/sir_dev: replace schedule_timeout() with msleep() o net/xirc2ps_cs: replace Wait() with msleep() o net/ma600-sir: replace schedule_timeout() with msleep() o net/irtty-sir: replace schedule_timeout() with msleep() o net/act2001-sir: replace schedule_timeout() with msleep() o arcnet: remove casts Don Fry: o pcnet32: 79c976 with fiber optic fix Felipe Damasio: o 8139cp net driver: add MODULE_VERSION François Romieu: o dscc4: removal of unneeded variable o dscc4: removal of unneeded casts o dscc4: error status checking and pci janitoring o dscc4: code factorisation o dscc4: use of uncompletely initialized struct o 8139cp: SG support fixes Ganesh Venkatesan: o ixgb: Documentation/networking/ixgb.txt Ian Campbell: o smc91x: power down PHY on suspend Jeff Garzik: o [wireless hostap] update for new pci_save_state() o [netdrvr 8139cp] TSO support Joshua Kwan: o hostap: fix Kconfig typos and missing select CRYPTO Jouni Malinen: o Host AP: Replaced MODULE_PARM with module_param* o Host AP: Replaced direct dev->priv references with netdev_priv(dev) o Host AP: Updated to use Linux wireless extensions v17 o Host AP: pci_register_driver() return value changes o Host AP: Fix netif_carrier_off() in non-client modes o Host AP: Fix PRISM2_IO_DEBUG o Host AP: Use void __iomem * with {read,write}{b,w} o Host AP: Fix card enabling after firmware download o Host AP: Do not bridge packets to unauthorized ports o Host AP: Fix compilation with PRISM2_NO_STATION_MODES defined o Host AP: Prevent STAs from associating using AP address o Host AP: Fix hw address changing for wifi# interface o Host AP: Remove ioctl debug messages o Host AP: Ignore (Re)AssocResp messages silently o Host AP: Fix interface packet counters o Host AP: Disable EAPOL TX/RX debug messages o fix hostap crypto bugs o Add HostAP wireless driver JustMan: o atmel_cs: Add support LG LW2100N WLAN PCMCIA card Nishanth Aravamudan: o net/cosa: replace schedule_timeout() with msleep() o net/airo: replace schedule_timeout() with msleep()/ssleep() o net/cs89x0: replace schedule_timeout() with msleep() Pekka Enberg: o 8139too: use iomap for pio/mmio Randy Dunlap: o prism54: use NULL for pointer o (v2) arlan: remove gcc warning with CONFIG_PROC_FS=n Rene Herman: o 8139too Interframe Gap Time Steffen Klassert: o Add MODULE_VERSION to the 3c515 driver o Use netdev_priv in the 3c515 driver o 8139cp - add netpoll support Stephen Hemminger: o skge driver (0.5) o 8139too: use netdev_priv o 8139cp - module_param Thomas Gleixner: o rtl8139too.c: Fix missing pci_disable_dev o rtl8139too.c: Fix missing pci_disable_dev Tony Lindgren: o Add OMAP support to smc91x Ethernet driver --------------040707010005060807000400-- From kaber@trash.net Thu Jan 27 16:09:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 16:09:05 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S0901Q009217 for ; Thu, 27 Jan 2005 16:09:01 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.43) id 1CuJh1-0005Qg-3R; Fri, 28 Jan 2005 01:08:55 +0100 Message-ID: <41F98296.9040804@trash.net> Date: Fri, 28 Jan 2005 01:08:54 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050106 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: bdschuym@pandora.be, netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org, snort2004@mail.ru, rusty@rustcorp.com.au, ak@suse.de, bridge@osdl.org, gandalf@wlug.westbo.se, dwmw2@infradead.org, shemminger@osdl.org Subject: Re: [PATCH/RFC] Reduce call chain length in netfilter References: <1131604877.20041218092730@mail.ru.suse.lists.linux.kernel> <1105117559.11753.34.camel@baythorne.infradead.org> <20050107100017.454ddadc@dxpl.pdx.osdl.net> <1105133241.3375.16.camel@localhost.localdomain> <20050118135735.4b77d38d.davem@davemloft.net> <1106433059.4486.11.camel@localhost.localdomain> <1106436153.20995.42.camel@tux.rsn.bth.se> <1106484019.3376.5.camel@localhost.localdomain> <1106496509.1085.1.camel@tux.rsn.bth.se> <20050125220558.6e824f8a.davem@davemloft.net> <1106730510.4041.4.camel@localhost.localdomain> <41F82C6D.7020006@trash.net> <20050126231801.7bf90338.davem@davemloft.net> <41F929FA.3050800@trash.net> <20050127114726.2205b4ed.davem@davemloft.net> <41F96FA4.4000105@trash.net> <20050127152450.6daba4fa.davem@davemloft.net> In-Reply-To: <20050127152450.6daba4fa.davem@davemloft.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 914 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 2878 Lines: 112 David S. Miller wrote: >I've been trying to figure out ways to decrease the number of >args that get sent to nf_hook_slow but this would require >some API changes unfortunately. > >One idea goes like this, we create little descriptors of the form: > >struct nf_hook_desc { > int (*okfn)(struct sk_buff *); > int pf; > int hook; >}; > >Then NF_HOOK*() callsites do something like this: > >static const struct nf_hook_desc nf_ip_local_out = { > .okfn = dst_output, > .pf = PF_INET, > .hook = NF_IP_LOCAL_OUT, >}; > >... > > /* Send it out. */ > return NF_HOOK(&nf_ip_local_out, skb, NULL, rt->u.dst.dev); > >This gets us down to 4 arguments from 6. I think we can kill >one more. > >It is never the case that both indev and outdev are both >set, so we can use some nf_hook_desc piece of state to >indicate which (in or out) the passed device pointer is. > > indev and outdev are both set in the forward hook. >Oh yes, we can nicely add the thresh thing in here too >while we're at it. > >So the final nf_hook_desc might look something something like: > >struct nf_hook_desc { > int (*okfn)(struct sk_buff *); > int hook; > int thresh; > u8 pf; /* AF_MAX is 32 */ > u8 is_output; >}; > >Hook could possibly use a smaller type as well to condense >the size of this thing even further. I don't know if there >are any nice assumptions we can make about the hook numbers. > > There are currently five hooks. I really hope we'll never reach 256, so u8 should be big enough. >Now, back to the compatability issue. We could create a >new macro, NF_HOOK_DESC() and keep the existing ones around >via some nf_hook_slow() that basically does: > >int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb, > struct net_device *indev, struct net_device *outdev, > int (*okfn)(struct sk_buff *), int thresh) >{ > struct nf_hook_desc desc; > > desc.okfn = okfn; > desc.hook = hook; > desc.thresh = thresh; > desc.pf = pf; > desc.is_output = (outdev != NULL); > return nf_hook_desc(&desc, skb, (outdev ? outdev : indev)); >} > >So the final new stuff looks something like: > >#ifdef CONFIG_NETFILTER >struct nf_hook_desc { > int (*okfn)(struct sk_buff *); > int hook; > int thresh; > u8 pf; /* AF_MAX is 32 */ > u8 is_output; >}; >#define NF_DESC_DECLARE(_name, _okfn, _hook, _thresh, _pf, _is_output) \ >static const struct nf_hook_desc _name = { \ > .okfn = _okfn, \ > .hook = _hook, \ > .thresh = _thresh, \ > .pf = _pf, \ > .is_output = _is_output, \ >}; > >extern int nf_hook_desc(struct nf_hook_desc *desc, struct sk_buff *skb, > struct net_device *dev); > >#define NF_HOOK_DESC(_desc, _skb, _dev) \ > nf_hook_desc(_desc, _skb, _dev) >#endif > >Just throwing around ideas... comments? > > Sounds like a good idea to get rid of the static arguments to nf_hook_slow. Keeping both devices we are still down from 7 to 4 arguments with your suggestion. Regards Patrick From rick.jones2@hp.com Thu Jan 27 16:10:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 16:10:52 -0800 (PST) Received: from palrel11.hp.com (palrel11.hp.com [156.153.255.246]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S0AlHo009699 for ; Thu, 27 Jan 2005 16:10:48 -0800 Received: from tardy.cup.hp.com (tardy.cup.hp.com [15.244.44.58]) by palrel11.hp.com (Postfix) with ESMTP id 77A5D20636 for ; Thu, 27 Jan 2005 16:10:47 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by tardy.cup.hp.com (8.9.3 (PHNE_28810)/8.9.3 SMKit7.02) with ESMTP id QAA10090 for ; Thu, 27 Jan 2005 16:10:46 -0800 (PST) Message-ID: <41F98306.6070804@hp.com> Date: Thu, 27 Jan 2005 16:10:46 -0800 From: Rick Jones User-Agent: Mozilla/5.0 (X11; U; HP-UX 9000/785; en-US; rv:1.7.3) Gecko/20041206 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: Re: on the wire behaviour of TSO on/off is supposed to be the same yes? References: <41F1516D.5010101@hp.com> <200501211358.53783.jdmason@us.ibm.com> <41F163AD.5070400@hp.com> <20050121124441.76cbbfb9.davem@davemloft.net> <41F17B7E.2020002@hp.com> <20050121141820.7d59a2d1.davem@davemloft.net> <41F186A8.9030805@hp.com> <20050121204948.034b2510.davem@davemloft.net> <41F55B93.6040603@hp.com> <20050124124353.2f760e1a.davem@davemloft.net> In-Reply-To: <20050124124353.2f760e1a.davem@davemloft.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 915 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rick.jones2@hp.com Precedence: bulk X-list: netdev Content-Length: 1388 Lines: 30 David S. Miller wrote: > Becuase we disable TSO on any packet loss whatsoever, we can predict > exactly what the CWND will be at the time a packet is sent. > > I've been quiet the past few days, but this is the kind of implementation > I've been thinking of. > > When we take away that invariant, which we do want to do, we'll need > to tweak how this works. Having thought about the topic a bit, it now seems that there were two benchmark run-rule compliance problems with TSO in 2.6. One is the slow-start stuff that has been worked-on and may get a couple additional tweaks (hopefully). The other relates to the business of disabling TSO on a connection upon packet loss. While the benchmark(s) that spring to mind are run over generally lossless LANs, the intent is that the solution be suitable for an Internet connected system (yes, someone could probably punch big gaping holes there...). Internet connected systems experience non-trivial packet loss rates and so if TSO disabled upon packet loss it means a given benchmark result using TSO deviates even more from reality than one without TSO. I suspect it would be found to be a benchmark special and disallowed. I do not know what other stacks do with their TSO implementation to know if they are in a similar state. It would be good to know if anyone out there knows and would be willing to say. rick jones From rmk+netdev=oss.sgi.com@arm.linux.org.uk Thu Jan 27 16:14:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 16:14:54 -0800 (PST) Received: from caramon.arm.linux.org.uk (caramon.arm.linux.org.uk [212.18.232.186]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S0El00010210 for ; Thu, 27 Jan 2005 16:14:48 -0800 Received: from flint.arm.linux.org.uk ([2002:d412:e8ba:1:201:2ff:fe14:8fad]) by caramon.arm.linux.org.uk with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.41) id 1CuJmS-0001f1-TM; Fri, 28 Jan 2005 00:14:34 +0000 Received: from rmk by flint.arm.linux.org.uk with local (Exim 4.41) id 1CuJmQ-0006Ko-OQ; Fri, 28 Jan 2005 00:14:30 +0000 Date: Fri, 28 Jan 2005 00:14:30 +0000 From: Russell King To: "David S. Miller" Cc: jgarzik@pobox.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, greg@kroah.com, akpm@osdl.org Subject: Re: [ANN] removal of certain net drivers coming soon: eepro100, xircom_tulip_cb, iph5526 Message-ID: <20050128001430.C22695@flint.arm.linux.org.uk> Mail-Followup-To: "David S. Miller" , jgarzik@pobox.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, greg@kroah.com, akpm@osdl.org References: <41F952F4.7040804@pobox.com> <20050127225725.F3036@flint.arm.linux.org.uk> <20050127153114.72be03e2.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20050127153114.72be03e2.davem@davemloft.net>; from davem@davemloft.net on Thu, Jan 27, 2005 at 03:31:14PM -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 916 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rmk+lkml@arm.linux.org.uk Precedence: bulk X-list: netdev Content-Length: 948 Lines: 20 On Thu, Jan 27, 2005 at 03:31:14PM -0800, David S. Miller wrote: > Therefore the only missing sync would be of the new RX descriptor > when linking things in like that, ie. at the end of e100_rx_alloc_skb() > if rx->prev->skb is non-NULL. And that is inherently unsafe, since the chip may be modifying the RFD while the CPU is accessing it. Adding extra sync calls does not fix it because as far as I can see, there's nothing to tell the chip "don't write to this RFD because any changes the CPU is making right now will overwrite the chips own changes." The fact of the matter is that eepro100.c works on ARM, e100.c doesn't. There's a message from me back on 30th June 2004 at about 10:30 BST on this very list which generated almost no interest from anyone... -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/ 2.6 Serial core From rmk+netdev=oss.sgi.com@arm.linux.org.uk Thu Jan 27 16:17:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 16:17:30 -0800 (PST) Received: from caramon.arm.linux.org.uk (caramon.arm.linux.org.uk [212.18.232.186]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S0HOpw010754 for ; Thu, 27 Jan 2005 16:17:25 -0800 Received: from flint.arm.linux.org.uk ([2002:d412:e8ba:1:201:2ff:fe14:8fad]) by caramon.arm.linux.org.uk with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.41) id 1CuJoy-0001jd-I8; Fri, 28 Jan 2005 00:17:11 +0000 Received: from rmk by flint.arm.linux.org.uk with local (Exim 4.41) id 1CuJot-0006NX-6h; Fri, 28 Jan 2005 00:17:03 +0000 Date: Fri, 28 Jan 2005 00:17:01 +0000 From: Russell King To: "David S. Miller" Cc: Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? Message-ID: <20050128001701.D22695@flint.arm.linux.org.uk> Mail-Followup-To: "David S. Miller" , Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com References: <20050123095608.GD16648@suse.de> <20050123023248.263daca9.akpm@osdl.org> <20050123200315.A25351@flint.arm.linux.org.uk> <20050124114853.A16971@flint.arm.linux.org.uk> <20050125193207.B30094@flint.arm.linux.org.uk> <20050127082809.A20510@flint.arm.linux.org.uk> <20050127004732.5d8e3f62.akpm@osdl.org> <16888.58622.376497.380197@robur.slu.se> <20050127164918.C3036@flint.arm.linux.org.uk> <20050127123326.2eafab35.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20050127123326.2eafab35.davem@davemloft.net>; from davem@davemloft.net on Thu, Jan 27, 2005 at 12:33:26PM -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 917 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rmk+lkml@arm.linux.org.uk Precedence: bulk X-list: netdev Content-Length: 747 Lines: 17 On Thu, Jan 27, 2005 at 12:33:26PM -0800, David S. Miller wrote: > So they won't be listed in /proc/net/rt_cache (since they've been > removed from the lookup table) but they will be accounted for in > /proc/net/stat/rt_cache until the final release is done on the > routing cache object and it can be completely freed up. > > Do you happen to be using IPV6 in any way by chance? Yes. Someone suggested this evening that there may have been a recent change to do with some IPv6 refcounting which may have caused this problem. Is that something you can confirm? -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/ 2.6 Serial core From davem@davemloft.net Thu Jan 27 16:36:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 16:36:12 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S0a85q015055 for ; Thu, 27 Jan 2005 16:36:08 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CuK38-00053p-00 for ; Thu, 27 Jan 2005 16:31:46 -0800 Date: Thu, 27 Jan 2005 16:31:46 -0800 From: "David S. Miller" To: netdev@oss.sgi.com Subject: design for TSO performance fix Message-Id: <20050127163146.33b01e95.davem@davemloft.net> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 918 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 3414 Lines: 132 Ok, here is the best idea I've been able to come up with so far. The basic idea is that we stop trying to build TSO frames in the actual transmit queue. Instead, TSO packets are built impromptu when we actually output packets on the transmit queue. Advantages: 1) No knowledge of TSO frames need exist anywhere besides tcp_write_xmit(), tcp_transmit_skb(), and tcp_xmit_retransmit_queue() 2) As a result of #1, all the pcount crap goes away. The need for two MSS state variables (mss_cache, and mss_cache_std) and assosciated complexity is eliminated as well. 3) Keeping TSO enabled after packet loss "just works". 4) CWND sampled at the correct moment when deciding the TSO packet arity. The one disadvantage is that it might be a tiny bit more expensive to build TSO frames. But I am sure we can find ways to optimize that quite well. The main element of the TSO output logic is a function that is schemed as follows: static inline int tcp_skb_data_all_paged(struct sk_buff *skb) { return (skb->len == skb->data_len); } /* If possible, append paged data of SRC_SKB onto the * tail of DST_SKB. */ static int skb_append_pages(struct sk_buff *dst_skb, struct sk_buff *src_skb) { int i; if (!tcp_skb_data_all_paged(src_skb)) return -EINVAL; for (i = 0; i < skb_shinfo(src_skb)->nr_frags; i++) { skb_frag_t *src_frag = &skb_shinfo(src_skb)->frags[i]; skb_frag_t *dst_frag; int dst_frag_idx; dst_frag_idx = skb_shinfo(dst_skb)->nr_frags; if (skb_can_coalesce(dst_skb, dst_frag_idx, src_frag->page, src_frag->page_offset)) { dst_frag = &skb_shinfo(dst_skb)->frags[dst_frag_idx-1]; dst_frag->size += src_frag->size; } else { if (dst_frag_idx >= MAX_SKB_FRAGS) return -EMSGSIZE; dst_frag = &skb_shinfo(dst_skb)->frags[dst_frag_idx]; skb_shinfo(dst_skb)->nr_frags = dst_frag_idx + 1; dst_frag->page = src_frag->page; get_page(src_frag->page); dst_frag->page_offset = src_frag->page_offset; dst_frag->size = src_frag->size; } skb->data_len += src_frag->size; } return 0; } static struct sk_buff *tcp_tso_build(struct sk_buff *head, int mss, int num) { struct sk_buff *skb; struct sock *sk; int err; sk = head->sk; skb = alloc_skb(sk->sk_prot->max_header, GFP_ATOMIC); err = -ENOMEM; if (!skb) goto fail; err = 0; skb_shinfo(skb)->tso_size = mss; skb_shinfo(skb)->tso_segs = num; while (num--) { err = skb_append_pages(skb, head, &dst_frag_idx); if (err) goto fail; head = head->next; } return skb; fail: if (skb) { int i; for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; put_page(frag->page); } kfree_skb(skb); } return NULL; } If tcp_tso_build() fails, the caller just falls back to the normal path of sending the frames non-TSO one-by-one. The logic is simple because if TSO is being done we know that all of the SKB data is paged (since SG+CSUM is a requirement for TSO). The one case where that invariant might fail is due to a routing change (previous device cannot do SG+CSUM, new device has full TSO capability) and that is handled via the tcp_skb_data_all_paged() checks. My thinking is that whatever added expensive this new scheme has, is offset by the simplifications the rest of the TCP stack will have since it will no longer need to know anything about multiple MSS values and packet counts. Comments? From davem@davemloft.net Thu Jan 27 16:39:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 16:39:39 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S0dUQL015571 for ; Thu, 27 Jan 2005 16:39:30 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CuK60-00055K-00; Thu, 27 Jan 2005 16:34:44 -0800 Date: Thu, 27 Jan 2005 16:34:44 -0800 From: "David S. Miller" To: Russell King Cc: Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? Message-Id: <20050127163444.1bfb673b.davem@davemloft.net> In-Reply-To: <20050128001701.D22695@flint.arm.linux.org.uk> References: <20050123095608.GD16648@suse.de> <20050123023248.263daca9.akpm@osdl.org> <20050123200315.A25351@flint.arm.linux.org.uk> <20050124114853.A16971@flint.arm.linux.org.uk> <20050125193207.B30094@flint.arm.linux.org.uk> <20050127082809.A20510@flint.arm.linux.org.uk> <20050127004732.5d8e3f62.akpm@osdl.org> <16888.58622.376497.380197@robur.slu.se> <20050127164918.C3036@flint.arm.linux.org.uk> <20050127123326.2eafab35.davem@davemloft.net> <20050128001701.D22695@flint.arm.linux.org.uk> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 919 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 1932 Lines: 58 On Fri, 28 Jan 2005 00:17:01 +0000 Russell King wrote: > Yes. Someone suggested this evening that there may have been a recent > change to do with some IPv6 refcounting which may have caused this > problem. Is that something you can confirm? Yep, it would be this change below. Try backing it out and see if that makes your leak go away. # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/14 20:41:55-08:00 herbert@gondor.apana.org.au # [IPV6]: Fix locking in ip6_dst_lookup(). # # The caller does not necessarily have the socket locked # (udpv6sendmsg() is one such case) so we have to use # sk_dst_check() instead of __sk_dst_check(). # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # net/ipv6/ip6_output.c # 2005/01/14 20:41:34-08:00 herbert@gondor.apana.org.au +3 -3 # [IPV6]: Fix locking in ip6_dst_lookup(). # # The caller does not necessarily have the socket locked # (udpv6sendmsg() is one such case) so we have to use # sk_dst_check() instead of __sk_dst_check(). # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # diff -Nru a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c --- a/net/ipv6/ip6_output.c 2005-01-27 16:07:21 -08:00 +++ b/net/ipv6/ip6_output.c 2005-01-27 16:07:21 -08:00 @@ -745,7 +745,7 @@ if (sk) { struct ipv6_pinfo *np = inet6_sk(sk); - *dst = __sk_dst_check(sk, np->dst_cookie); + *dst = sk_dst_check(sk, np->dst_cookie); if (*dst) { struct rt6_info *rt = (struct rt6_info*)*dst; @@ -772,9 +772,9 @@ && (np->daddr_cache == NULL || !ipv6_addr_equal(&fl->fl6_dst, np->daddr_cache))) || (fl->oif && fl->oif != (*dst)->dev->ifindex)) { + dst_release(*dst); *dst = NULL; - } else - dst_hold(*dst); + } } } From buytenh@wantstofly.org Thu Jan 27 16:48:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 16:48:32 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S0mQin016135 for ; Thu, 27 Jan 2005 16:48:27 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id 721722B0EC; Fri, 28 Jan 2005 01:48:25 +0100 (MET) Date: Fri, 28 Jan 2005 01:48:25 +0100 From: Lennert Buytenhek To: "David S. Miller" , jgarzik@pobox.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, greg@kroah.com, akpm@osdl.org Subject: Re: [ANN] removal of certain net drivers coming soon: eepro100, xircom_tulip_cb, iph5526 Message-ID: <20050128004825.GA5359@xi.wantstofly.org> References: <41F952F4.7040804@pobox.com> <20050127225725.F3036@flint.arm.linux.org.uk> <20050127153114.72be03e2.davem@davemloft.net> <20050128001430.C22695@flint.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050128001430.C22695@flint.arm.linux.org.uk> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 920 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev Content-Length: 513 Lines: 14 On Fri, Jan 28, 2005 at 12:14:30AM +0000, Russell King wrote: > The fact of the matter is that eepro100.c works on ARM, e100.c doesn't. Hmmm, I recall e100 working fine on a Radisys ENP-2611, which has a IXP2400 (xscale) in big-endian mode, running 2.6. This particular board had its root fs NFS-mounted and pumped several hundreds of gigabytes through the NIC during a period of at least a few months, and I never saw any problems. Something tells me that the next time I try it, it won't work at all. --L From rick.jones2@hp.com Thu Jan 27 16:51:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 16:51:50 -0800 (PST) Received: from palrel10.hp.com (palrel10.hp.com [156.153.255.245]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S0pksJ016667 for ; Thu, 27 Jan 2005 16:51:46 -0800 Received: from tardy.cup.hp.com (tardy.cup.hp.com [15.244.44.58]) by palrel10.hp.com (Postfix) with ESMTP id 2A4EE2521E for ; Thu, 27 Jan 2005 16:51:32 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by tardy.cup.hp.com (8.9.3 (PHNE_28810)/8.9.3 SMKit7.02) with ESMTP id QAA10460 for ; Thu, 27 Jan 2005 16:51:31 -0800 (PST) Message-ID: <41F98C93.9040005@hp.com> Date: Thu, 27 Jan 2005 16:51:31 -0800 From: Rick Jones User-Agent: Mozilla/5.0 (X11; U; HP-UX 9000/785; en-US; rv:1.7.3) Gecko/20041206 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: Re: design for TSO performance fix References: <20050127163146.33b01e95.davem@davemloft.net> In-Reply-To: <20050127163146.33b01e95.davem@davemloft.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 921 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rick.jones2@hp.com Precedence: bulk X-list: netdev Content-Length: 1895 Lines: 58 David S. Miller wrote: > Ok, here is the best idea I've been able to come up with > so far. > > The basic idea is that we stop trying to build TSO frames > in the actual transmit queue. Instead, TSO packets are > built impromptu when we actually output packets on the > transmit queue. > > Advantages: > > 1) No knowledge of TSO frames need exist anywhere besides > tcp_write_xmit(), tcp_transmit_skb(), and > tcp_xmit_retransmit_queue() > > 2) As a result of #1, all the pcount crap goes away. > The need for two MSS state variables (mss_cache, > and mss_cache_std) and assosciated complexity is > eliminated as well. > > 3) Keeping TSO enabled after packet loss "just works". Doubleplusgood. > > 4) CWND sampled at the correct moment when deciding > the TSO packet arity. > > The one disadvantage is that it might be a tiny bit more > expensive to build TSO frames. But I am sure we can find > ways to optimize that quite well. > > The main element of the TSO output logic is a function > that is schemed as follows: > > ... > > If tcp_tso_build() fails, the caller just falls back to the > normal path of sending the frames non-TSO one-by-one. > > The logic is simple because if TSO is being done we know > that all of the SKB data is paged (since SG+CSUM is a > requirement for TSO). The one case where that > invariant might fail is due to a routing change (previous > device cannot do SG+CSUM, new device has full TSO capability) > and that is handled via the tcp_skb_data_all_paged() checks. > > My thinking is that whatever added expensive this new scheme > has, is offset by the simplifications the rest of the TCP > stack will have since it will no longer need to know anything > about multiple MSS values and packet counts. > > Comments? Does anything (need to) change wrt getting the size of the TSO's to increase as cwnd increases? rick jones From davem@davemloft.net Thu Jan 27 16:53:14 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 16:53:18 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S0rE0Z017176 for ; Thu, 27 Jan 2005 16:53:14 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CuKJX-00059I-00; Thu, 27 Jan 2005 16:48:43 -0800 Date: Thu, 27 Jan 2005 16:48:43 -0800 From: "David S. Miller" To: Russell King Cc: jgarzik@pobox.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, greg@kroah.com, akpm@osdl.org Subject: Re: [ANN] removal of certain net drivers coming soon: eepro100, xircom_tulip_cb, iph5526 Message-Id: <20050127164843.08bdb307.davem@davemloft.net> In-Reply-To: <20050128001430.C22695@flint.arm.linux.org.uk> References: <41F952F4.7040804@pobox.com> <20050127225725.F3036@flint.arm.linux.org.uk> <20050127153114.72be03e2.davem@davemloft.net> <20050128001430.C22695@flint.arm.linux.org.uk> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 922 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 778 Lines: 17 On Fri, 28 Jan 2005 00:14:30 +0000 Russell King wrote: > The fact of the matter is that eepro100.c works on ARM, e100.c doesn't. > There's a message from me back on 30th June 2004 at about 10:30 BST on > this very list which generated almost no interest from anyone... I see. Since eepro100 just uses a fixed set of RX buffers in the ring (ie. the DMA links are never changed) it works. This adapter was definitely developed for a system that has to have PCI device DMA and CPU cached data accesses in the same coherency space in order to use their weird RX chaining thing. So essentially, e100 needs to have it's RX logic rewritten so that it uses a static RX descriptor set of buffers and skb_copy()'s them to push the packets into the stack. From davem@davemloft.net Thu Jan 27 17:01:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 17:01:40 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S11Zql017848 for ; Thu, 27 Jan 2005 17:01:35 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CuKRf-0005CV-00; Thu, 27 Jan 2005 16:57:07 -0800 Date: Thu, 27 Jan 2005 16:57:07 -0800 From: "David S. Miller" To: Rick Jones Cc: netdev@oss.sgi.com Subject: Re: on the wire behaviour of TSO on/off is supposed to be the same yes? Message-Id: <20050127165707.250ee514.davem@davemloft.net> In-Reply-To: <41F98306.6070804@hp.com> References: <41F1516D.5010101@hp.com> <200501211358.53783.jdmason@us.ibm.com> <41F163AD.5070400@hp.com> <20050121124441.76cbbfb9.davem@davemloft.net> <41F17B7E.2020002@hp.com> <20050121141820.7d59a2d1.davem@davemloft.net> <41F186A8.9030805@hp.com> <20050121204948.034b2510.davem@davemloft.net> <41F55B93.6040603@hp.com> <20050124124353.2f760e1a.davem@davemloft.net> <41F98306.6070804@hp.com> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 923 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 1272 Lines: 30 On Thu, 27 Jan 2005 16:10:46 -0800 Rick Jones wrote: > The other relates to the business of disabling TSO on a connection upon packet loss. There cannot possibly any compliance issues resulting from turning off an optimization in the face of packet loss. > Internet connected systems experience non-trivial packet loss rates and so if TSO > disabled upon packet loss it means a given benchmark result using TSO deviates > even more from reality than one without TSO. And running the benchmark over a local gigabit subnet doesn't deviate from what Internet connected systems can expect to achieve how-so? Oh you mean I really can get 60,000 web or database connections a second when the users are over modems half-way across the planet? Give me a break... Furthermore, all the tuning people do in each run is to optimize specifically for a local high-speed interconnect subnet, no limits on TCP or filesystem memory use, and large cache sizes. Nobody configures their machines this way, unless they want remote users to be able to consume %90 or so of their system memory with TCP socket memory. Anyways, see my other posting, we'll be able to keep TSO enabled in the face of packet loss, but that is an optimization not a correctness fix. From davem@davemloft.net Thu Jan 27 17:02:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 17:02:52 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S12l0B018198 for ; Thu, 27 Jan 2005 17:02:47 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CuKSs-0005Cf-00; Thu, 27 Jan 2005 16:58:22 -0800 Date: Thu, 27 Jan 2005 16:58:22 -0800 From: "David S. Miller" To: Rick Jones Cc: netdev@oss.sgi.com Subject: Re: design for TSO performance fix Message-Id: <20050127165822.0e97a046.davem@davemloft.net> In-Reply-To: <41F98C93.9040005@hp.com> References: <20050127163146.33b01e95.davem@davemloft.net> <41F98C93.9040005@hp.com> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 924 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 313 Lines: 9 On Thu, 27 Jan 2005 16:51:31 -0800 Rick Jones wrote: > Does anything (need to) change wrt getting the size of the TSO's to increase as > cwnd increases? Nope, we use the same algorithm we use currently to determine the "TSO mss", except that we compute and apply it at the correct moment. From rusty@rustcorp.com.au Thu Jan 27 17:12:34 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 17:12:39 -0800 (PST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S1CXpB019041 for ; Thu, 27 Jan 2005 17:12:34 -0800 Received: from localhost.localdomain (localhost [127.0.0.1]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTP id 987C167AAA; Fri, 28 Jan 2005 12:12:27 +1100 (EST) Subject: Re: [PATCH/RFC] Reduce call chain length in netfilter From: Rusty Russell To: "David S. Miller" Cc: Patrick McHardy , bdschuym@pandora.be, netdev@oss.sgi.com, Netfilter development mailing list , snort2004@mail.ru, ak@suse.de, bridge@osdl.org, gandalf@wlug.westbo.se, dwmw2@infradead.org, shemminger@osdl.org In-Reply-To: <20050127152450.6daba4fa.davem@davemloft.net> References: <1131604877.20041218092730@mail.ru.suse.lists.linux.kernel> <1105117559.11753.34.camel@baythorne.infradead.org> <20050107100017.454ddadc@dxpl.pdx.osdl.net> <1105133241.3375.16.camel@localhost.localdomain> <20050118135735.4b77d38d.davem@davemloft.net> <1106433059.4486.11.camel@localhost.localdomain> <1106436153.20995.42.camel@tux.rsn.bth.se> <1106484019.3376.5.camel@localhost.localdomain> <1106496509.1085.1.camel@tux.rsn.bth.se> <20050125220558.6e824f8a.davem@davemloft.net> <1106730510.4041.4.camel@localhost.localdomain> <41F82C6D.7020006@trash.net> <20050126231801.7bf90338.davem@davemloft.net> <41F929FA.3050800@trash.net> <20050127114726.2205b4ed.davem@davemloft.net> <41F96FA4.4000105@trash.net> <20050127152450.6daba4fa.davem@davemloft.net> Content-Type: text/plain Date: Fri, 28 Jan 2005 11:29:29 +1100 Message-Id: <1106872169.18360.6.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.3 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 925 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rusty@rustcorp.com.au Precedence: bulk X-list: netdev Content-Length: 1144 Lines: 28 On Thu, 2005-01-27 at 15:24 -0800, David S. Miller wrote: > It is never the case that both indev and outdev are both > set, so we can use some nf_hook_desc piece of state to > indicate which (in or out) the passed device pointer is. NF_IP_FORWARD... it's really *really* useful for filtering forwarded packets. However, is it ever the case that indev != skb->dev? If not, we can simply drop that arg and use skb->dev. > Now, back to the compatability issue. We could create a > new macro, NF_HOOK_DESC() and keep the existing ones around > via some nf_hook_slow() that basically does: No, let's just fix them all. Also, gcc 3.4 will discard unused static variables, so I prefer the kernel start just declaring structs as normal, and have them "used" in the !CONFIG case by an inline function which allows gcc to realize that it can be eliminated, but suppresses unused warnings. This also means you get type checking etc without the config option. BTW, someone should go through and start ripping out #ifdef CONFIG_PROC_FS around those structs, too... Cheers, Rusty. -- A bad analogy is like a leaky screwdriver -- Richard Braakman From davem@davemloft.net Thu Jan 27 17:14:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 17:15:01 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S1Es7i019533 for ; Thu, 27 Jan 2005 17:14:54 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CuKeV-0005Fh-00; Thu, 27 Jan 2005 17:10:23 -0800 Date: Thu, 27 Jan 2005 17:10:23 -0800 From: "David S. Miller" To: Rusty Russell Cc: kaber@trash.net, bdschuym@pandora.be, netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org, snort2004@mail.ru, ak@suse.de, bridge@osdl.org, gandalf@wlug.westbo.se, dwmw2@infradead.org, shemminger@osdl.org Subject: Re: [PATCH/RFC] Reduce call chain length in netfilter Message-Id: <20050127171023.2e8547e1.davem@davemloft.net> In-Reply-To: <1106872169.18360.6.camel@localhost.localdomain> References: <1131604877.20041218092730@mail.ru.suse.lists.linux.kernel> <1105117559.11753.34.camel@baythorne.infradead.org> <20050107100017.454ddadc@dxpl.pdx.osdl.net> <1105133241.3375.16.camel@localhost.localdomain> <20050118135735.4b77d38d.davem@davemloft.net> <1106433059.4486.11.camel@localhost.localdomain> <1106436153.20995.42.camel@tux.rsn.bth.se> <1106484019.3376.5.camel@localhost.localdomain> <1106496509.1085.1.camel@tux.rsn.bth.se> <20050125220558.6e824f8a.davem@davemloft.net> <1106730510.4041.4.camel@localhost.localdomain> <41F82C6D.7020006@trash.net> <20050126231801.7bf90338.davem@davemloft.net> <41F929FA.3050800@trash.net> <20050127114726.2205b4ed.davem@davemloft.net> <41F96FA4.4000105@trash.net> <20050127152450.6daba4fa.davem@davemloft.net> <1106872169.18360.6.camel@localhost.localdomain> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 926 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 264 Lines: 8 On Fri, 28 Jan 2005 11:29:29 +1100 Rusty Russell wrote: > No, let's just fix them all. In tree, yes. But leaving the NF_HOOK()/NF_HOOK_THRESH() compat macros in there for out-of-tree modules I feel is mandatory, it's a major API change. From rusty@rustcorp.com.au Thu Jan 27 17:32:29 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 17:32:34 -0800 (PST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S1WRIM020361 for ; Thu, 27 Jan 2005 17:32:29 -0800 Received: from localhost.localdomain (localhost [127.0.0.1]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTP id 9209067AB7; Fri, 28 Jan 2005 12:32:21 +1100 (EST) Subject: Re: [PATCH/RFC] Reduce call chain length in netfilter From: Rusty Russell To: "David S. Miller" Cc: Patrick McHardy , bdschuym@pandora.be, netdev@oss.sgi.com, Netfilter development mailing list , snort2004@mail.ru, ak@suse.de, bridge@osdl.org, gandalf@wlug.westbo.se, dwmw2@infradead.org, shemminger@osdl.org In-Reply-To: <20050127171023.2e8547e1.davem@davemloft.net> References: <1131604877.20041218092730@mail.ru.suse.lists.linux.kernel> <1105117559.11753.34.camel@baythorne.infradead.org> <20050107100017.454ddadc@dxpl.pdx.osdl.net> <1105133241.3375.16.camel@localhost.localdomain> <20050118135735.4b77d38d.davem@davemloft.net> <1106433059.4486.11.camel@localhost.localdomain> <1106436153.20995.42.camel@tux.rsn.bth.se> <1106484019.3376.5.camel@localhost.localdomain> <1106496509.1085.1.camel@tux.rsn.bth.se> <20050125220558.6e824f8a.davem@davemloft.net> <1106730510.4041.4.camel@localhost.localdomain> <41F82C6D.7020006@trash.net> <20050126231801.7bf90338.davem@davemloft.net> <41F929FA.3050800@trash.net> <20050127114726.2205b4ed.davem@davemloft.net> <41F96FA4.4000105@trash.net> <20050127152450.6daba4fa.davem@davemloft.net> <1106872169.18360.6.camel@localhost.localdomain> <20050127171023.2e8547e1.davem@davemloft.net> Content-Type: text/plain Date: Fri, 28 Jan 2005 12:32:25 +1100 Message-Id: <1106875946.18360.29.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.3 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 927 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rusty@rustcorp.com.au Precedence: bulk X-list: netdev Content-Length: 676 Lines: 19 On Thu, 2005-01-27 at 17:10 -0800, David S. Miller wrote: > On Fri, 28 Jan 2005 11:29:29 +1100 > Rusty Russell wrote: > > > No, let's just fix them all. > > In tree, yes. But leaving the NF_HOOK()/NF_HOOK_THRESH() compat > macros in there for out-of-tree modules I feel is mandatory, it's > a major API change. I'm not so sure. The hook functions which are registered, sure (ie. keep the calling convention the same). But do any external modules use NF_HOOK()? That implies they're writing their own network stack for some protocol, which I would expect to be uncommon. Rusty. -- A bad analogy is like a leaky screwdriver -- Richard Braakman From herbert@gondor.apana.org.au Thu Jan 27 17:33:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 17:33:23 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S1XDgV020610 for ; Thu, 27 Jan 2005 17:33:14 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CuL0M-0006es-00; Fri, 28 Jan 2005 12:32:58 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CuKzJ-0001mY-00; Fri, 28 Jan 2005 12:31:53 +1100 From: Herbert Xu To: davem@davemloft.net (David S. Miller) Subject: Re: design for TSO performance fix Cc: netdev@oss.sgi.com Organization: Core In-Reply-To: <20050127163146.33b01e95.davem@davemloft.net> X-Newsgroups: apana.lists.os.linux.netdev User-Agent: tin/1.7.4-20040225 ("Benbecula") (UNIX) (Linux/2.4.27-hx-1-686-smp (i686)) Message-Id: Date: Fri, 28 Jan 2005 12:31:53 +1100 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 928 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 1148 Lines: 38 David S. Miller wrote: > > Ok, here is the best idea I've been able to come up with > so far. It sounds great! > 2) As a result of #1, all the pcount crap goes away. > The need for two MSS state variables (mss_cache, > and mss_cache_std) and assosciated complexity is > eliminated as well. Does this mean that we'll start counting bytes instead of packets? If not then please let me know on how you plan to do the packet counting. > static struct sk_buff *tcp_tso_build(struct sk_buff *head, int mss, int num) > { > struct sk_buff *skb; > struct sock *sk; > int err; > > sk = head->sk; > skb = alloc_skb(sk->sk_prot->max_header, GFP_ATOMIC); The other good thing about this is that if we do this for all packets including non-TSO ones, then the TCP stack doesn't have to own the TCP/IP headers at all. Then we can stop worrying about the TSO/COW mangling. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From kaber@trash.net Thu Jan 27 17:33:43 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 17:33:49 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S1XgmO020904 for ; Thu, 27 Jan 2005 17:33:43 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.43) id 1CuL0Y-0003TO-29; Fri, 28 Jan 2005 02:33:10 +0100 Message-ID: <41F99656.5040304@trash.net> Date: Fri, 28 Jan 2005 02:33:10 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050106 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: David Brownell , jf-ml-k1-1087813225@lk8rp.mail.xeon.eu.org, david+challenge-response@blue-labs.org, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, ahaas@airmail.net Subject: Re: 2.6.11-rc2 TCP ignores PMTU ICMP (Re: Linux 2.6.11-rc2) References: <200501232251.42394.david-b@pacbell.net> <200501271128.48411.david-b@pacbell.net> <200501271511.58086.david-b@pacbell.net> <20050127154150.360f95e2.davem@davemloft.net> In-Reply-To: <20050127154150.360f95e2.davem@davemloft.net> Content-Type: multipart/mixed; boundary="------------070303040201060207090705" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 929 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 1082 Lines: 36 This is a multi-part message in MIME format. --------------070303040201060207090705 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit David S. Miller wrote: >I've forwarded this to netfilter-devel for inspection. >Thanks for collecting all the data points so well. > Here is the fix for everyone. Please report back if it doesn't solve the problem. Thanks. --------------070303040201060207090705 Content-Type: text/plain; name="x" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="x" ===== net/ipv4/netfilter/ip_nat_proto_tcp.c 1.10 vs edited ===== --- 1.10/net/ipv4/netfilter/ip_nat_proto_tcp.c 2005-01-17 23:00:55 +01:00 +++ edited/net/ipv4/netfilter/ip_nat_proto_tcp.c 2005-01-28 02:13:06 +01:00 @@ -105,7 +105,7 @@ return 0; iph = (struct iphdr *)((*pskb)->data + iphdroff); - hdr = (struct tcphdr *)((*pskb)->data + iph->ihl*4); + hdr = (struct tcphdr *)((*pskb)->data + hdroff); if (maniptype == IP_NAT_MANIP_SRC) { /* Get rid of src ip and src pt */ --------------070303040201060207090705-- From kaber@trash.net Thu Jan 27 17:35:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 17:35:58 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S1Zr07021907 for ; Thu, 27 Jan 2005 17:35:54 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.43) id 1CuL30-0003Tu-Um; Fri, 28 Jan 2005 02:35:43 +0100 Message-ID: <41F996EE.2030409@trash.net> Date: Fri, 28 Jan 2005 02:35:42 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050106 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: Rusty Russell CC: "David S. Miller" , bdschuym@pandora.be, netdev@oss.sgi.com, Netfilter development mailing list , snort2004@mail.ru, ak@suse.de, bridge@osdl.org, gandalf@wlug.westbo.se, dwmw2@infradead.org, shemminger@osdl.org Subject: Re: [PATCH/RFC] Reduce call chain length in netfilter References: <1131604877.20041218092730@mail.ru.suse.lists.linux.kernel> <1105117559.11753.34.camel@baythorne.infradead.org> <20050107100017.454ddadc@dxpl.pdx.osdl.net> <1105133241.3375.16.camel@localhost.localdomain> <20050118135735.4b77d38d.davem@davemloft.net> <1106433059.4486.11.camel@localhost.localdomain> <1106436153.20995.42.camel@tux.rsn.bth.se> <1106484019.3376.5.camel@localhost.localdomain> <1106496509.1085.1.camel@tux.rsn.bth.se> <20050125220558.6e824f8a.davem@davemloft.net> <1106730510.4041.4.camel@localhost.localdomain> <41F82C6D.7020006@trash.net> <20050126231801.7bf90338.davem@davemloft.net> <41F929FA.3050800@trash.net> <20050127114726.2205b4ed.davem@davemloft.net> <41F96FA4.4000105@trash.net> <20050127152450.6daba4fa.davem@davemloft.net> <1106872169.18360.6.camel@localhost.localdomain> <20050127171023.2e8547e1.davem@davemloft.net> <1106875946.18360.29.camel@localhost.localdomain> In-Reply-To: <1106875946.18360.29.camel@localhost.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 930 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 597 Lines: 19 Rusty Russell wrote: >On Thu, 2005-01-27 at 17:10 -0800, David S. Miller wrote: > >>In tree, yes. But leaving the NF_HOOK()/NF_HOOK_THRESH() compat >>macros in there for out-of-tree modules I feel is mandatory, it's >>a major API change. >> > >I'm not so sure. The hook functions which are registered, sure (ie. >keep the calling convention the same). But do any external modules use >NF_HOOK()? That implies they're writing their own network stack for >some protocol, which I would expect to be uncommon. > Freeswan comes to mind. But I guess one more #ifdef can't hurt :) Regards Patrick From rick.jones2@hp.com Thu Jan 27 17:36:19 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 17:36:26 -0800 (PST) Received: from palrel10.hp.com (palrel10.hp.com [156.153.255.245]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S1aJTF022118 for ; Thu, 27 Jan 2005 17:36:19 -0800 Received: from tardy.cup.hp.com (tardy.cup.hp.com [15.244.44.58]) by palrel10.hp.com (Postfix) with ESMTP id 2BAEB1A3B for ; Thu, 27 Jan 2005 17:36:19 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by tardy.cup.hp.com (8.9.3 (PHNE_28810)/8.9.3 SMKit7.02) with ESMTP id RAA10943 for ; Thu, 27 Jan 2005 17:36:18 -0800 (PST) Message-ID: <41F99712.2030201@hp.com> Date: Thu, 27 Jan 2005 17:36:18 -0800 From: Rick Jones User-Agent: Mozilla/5.0 (X11; U; HP-UX 9000/785; en-US; rv:1.7.3) Gecko/20041206 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: Re: on the wire behaviour of TSO on/off is supposed to be the same yes? References: <41F1516D.5010101@hp.com> <200501211358.53783.jdmason@us.ibm.com> <41F163AD.5070400@hp.com> <20050121124441.76cbbfb9.davem@davemloft.net> <41F17B7E.2020002@hp.com> <20050121141820.7d59a2d1.davem@davemloft.net> <41F186A8.9030805@hp.com> <20050121204948.034b2510.davem@davemloft.net> <41F55B93.6040603@hp.com> <20050124124353.2f760e1a.davem@davemloft.net> <41F98306.6070804@hp.com> <20050127165707.250ee514.davem@davemloft.net> In-Reply-To: <20050127165707.250ee514.davem@davemloft.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 931 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rick.jones2@hp.com Precedence: bulk X-list: netdev Content-Length: 1163 Lines: 40 David S. Miller wrote: > On Thu, 27 Jan 2005 16:10:46 -0800 > Rick Jones wrote: > > > >>The other relates to the business of disabling TSO on a connection upon packet loss. > > > There cannot possibly any compliance issues resulting from turning > off an optimization in the face of packet loss. I was a bit vague - compliance with the benchmark run and report rules, not with RFC's. >>Internet connected systems experience non-trivial packet loss rates and so if TSO >>disabled upon packet loss it means a given benchmark result using TSO deviates >>even more from reality than one without TSO. > > > And running the benchmark over a local gigabit subnet doesn't deviate > from what Internet connected systems can expect to achieve how-so? Benchmarking, not logic... > Oh you mean I really can get 60,000 web or database connections a second > when the users are over modems half-way across the planet? Give me a > break... If there are enough users :) > Anyways, see my other posting, we'll be able to keep TSO enabled in > the face of packet loss, but that is an optimization not a correctness > fix. Cool. rick jones From kernel@linuxace.com Thu Jan 27 17:41:45 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 17:41:50 -0800 (PST) Received: from linuxace.com (adsl-67-120-171-161.dsl.lsan03.pacbell.net [67.120.171.161]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0S1filh023048 for ; Thu, 27 Jan 2005 17:41:45 -0800 Received: (qmail 16378 invoked by uid 0); 28 Jan 2005 01:41:39 -0000 Date: Thu, 27 Jan 2005 17:41:39 -0800 From: Phil Oester To: "David S. Miller" , Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? Message-ID: <20050128014139.GA16371@linuxace.com> References: <20050123023248.263daca9.akpm@osdl.org> <20050123200315.A25351@flint.arm.linux.org.uk> <20050124114853.A16971@flint.arm.linux.org.uk> <20050125193207.B30094@flint.arm.linux.org.uk> <20050127082809.A20510@flint.arm.linux.org.uk> <20050127004732.5d8e3f62.akpm@osdl.org> <16888.58622.376497.380197@robur.slu.se> <20050127164918.C3036@flint.arm.linux.org.uk> <20050127123326.2eafab35.davem@davemloft.net> <20050128001701.D22695@flint.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050128001701.D22695@flint.arm.linux.org.uk> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 932 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kernel@linuxace.com Precedence: bulk X-list: netdev Content-Length: 721 Lines: 16 On Fri, Jan 28, 2005 at 12:17:01AM +0000, Russell King wrote: > On Thu, Jan 27, 2005 at 12:33:26PM -0800, David S. Miller wrote: > > So they won't be listed in /proc/net/rt_cache (since they've been > > removed from the lookup table) but they will be accounted for in > > /proc/net/stat/rt_cache until the final release is done on the > > routing cache object and it can be completely freed up. > > > > Do you happen to be using IPV6 in any way by chance? > > Yes. Someone suggested this evening that there may have been a recent > change to do with some IPv6 refcounting which may have caused this > problem. Is that something you can confirm? FWIW, I do not use IPv6, and it is not compiled into the kernel. Phil From tgraf@suug.ch Thu Jan 27 17:57:34 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 17:57:41 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S1vXEf023894 for ; Thu, 27 Jan 2005 17:57:33 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id C6888F; Fri, 28 Jan 2005 02:57:09 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 6479E1C0EA; Fri, 28 Jan 2005 02:57:51 +0100 (CET) Date: Fri, 28 Jan 2005 02:57:51 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: design for TSO performance fix Message-ID: <20050128015751.GT31837@postel.suug.ch> References: <20050127163146.33b01e95.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050127163146.33b01e95.davem@davemloft.net> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 934 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 1283 Lines: 33 * David S. Miller <20050127163146.33b01e95.davem@davemloft.net> 2005-01-27 16:31 > The basic idea is that we stop trying to build TSO frames > in the actual transmit queue. Instead, TSO packets are > built impromptu when we actually output packets on the > transmit queue. Sound great. > static inline int tcp_skb_data_all_paged(struct sk_buff *skb) > { > return (skb->len == skb->data_len); > } You could also define this as (skb_headlen(skb) == 0) > The logic is simple because if TSO is being done we know > that all of the SKB data is paged (since SG+CSUM is a > requirement for TSO). The one case where that > invariant might fail is due to a routing change (previous > device cannot do SG+CSUM, new device has full TSO capability) > and that is handled via the tcp_skb_data_all_paged() checks. I assume the case when reroute changes oif to a device no longer capable of SG+CSUM stays the same and the skb remains paged until dev_queue_xmit? > My thinking is that whatever added expensive this new scheme > has, is offset by the simplifications the rest of the TCP > stack will have since it will no longer need to know anything > about multiple MSS values and packet counts. I think the overhead is really worth the complexity that can be removed with these changes. From sfeldma@pobox.com Thu Jan 27 17:57:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 17:57:08 -0800 (PST) Received: from orb.pobox.com (orb.pobox.com [207.8.226.5]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S1v250023843 for ; Thu, 27 Jan 2005 17:57:03 -0800 Received: from orb (localhost [127.0.0.1]) by orb.pobox.com (Postfix) with ESMTP id A1E2B95; Thu, 27 Jan 2005 20:57:01 -0500 (EST) Received: from [192.168.0.3] (wbar2.sea1-4-5-062-153.sea1.dsl-verizon.net [4.5.62.153]) by orb.sasl.smtp.pobox.com (Postfix) with ESMTP id 3FE2387; Thu, 27 Jan 2005 20:56:54 -0500 (EST) Subject: Re: [ANN] removal of certain net drivers coming soon: eepro100, xircom_tulip_cb, iph5526 From: Scott Feldman Reply-To: sfeldma@pobox.com To: "David S. Miller" Cc: Russell King , jgarzik@pobox.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, greg@kroah.com, akpm@osdl.org In-Reply-To: <20050127164843.08bdb307.davem@davemloft.net> References: <41F952F4.7040804@pobox.com> <20050127225725.F3036@flint.arm.linux.org.uk> <20050127153114.72be03e2.davem@davemloft.net> <20050128001430.C22695@flint.arm.linux.org.uk> <20050127164843.08bdb307.davem@davemloft.net> Content-Type: text/plain Message-Id: <1106877517.18167.311.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Thu, 27 Jan 2005 17:58:37 -0800 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 933 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sfeldma@pobox.com Precedence: bulk X-list: netdev Content-Length: 860 Lines: 23 On Thu, 2005-01-27 at 16:48, David S. Miller wrote: > On Fri, 28 Jan 2005 00:14:30 +0000 > Russell King wrote: > > > The fact of the matter is that eepro100.c works on ARM, e100.c doesn't. > > There's a message from me back on 30th June 2004 at about 10:30 BST on > > this very list which generated almost no interest from anyone... > > I see. Since eepro100 just uses a fixed set of RX buffers in the > ring (ie. the DMA links are never changed) it works. eepro100 does a copy if pkt_len < rx_copybreak, otherwise it send up the skb and allocates and links a new one in it's place (see speedo_rx_link). So I would say e100 and eepro100 are the same for >= rx_copybreak. Why does one work and not the other? Is it because the RFD is aligned in eepro100? Russell, what happens with modprobe eepro100 rx_copybreak=0? -scott From adi@hexapodia.org Thu Jan 27 18:15:38 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 18:15:42 -0800 (PST) Received: from pirx.hexapodia.org (_postfix@pirx.hexapodia.org [199.199.212.25]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S2FbYm025479 for ; Thu, 27 Jan 2005 18:15:38 -0800 Received: by pirx.hexapodia.org (Postfix, from userid 22448) id 214B954F; Thu, 27 Jan 2005 18:15:30 -0800 (PST) Date: Thu, 27 Jan 2005 18:15:30 -0800 From: Andy Isaacson To: Jeff Garzik Cc: Netdev , Linux Kernel , Andrew Morton , Jouni Malinen Subject: Re: netdev-2.6 queue updated Message-ID: <20050128021530.GB19150@hexapodia.org> References: <41F980A0.8020905@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F980A0.8020905@pobox.com> User-Agent: Mutt/1.4.1i X-PGP-Fingerprint: 48 01 21 E2 D4 E4 68 D1 B8 DF 39 B2 AF A3 16 B9 X-PGP-Key-URL: http://web.hexapodia.org/~adi/pgp.txt X-Domestic-Surveillance: money launder bomb tax evasion X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 935 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: adi@hexapodia.org Precedence: bulk X-list: netdev Content-Length: 788 Lines: 20 On Thu, Jan 27, 2005 at 07:00:32PM -0500, Jeff Garzik wrote: > The attached changelog describes what I just pushed out to BitKeeper > (and what should be appearing in the next -mm release from Andrew). > > Note to BK users: please re-clone netdev-2.6, don't just 'bk pull'. It's much more efficient to do % bk undo -a`bk repogca` (which deletes everything in the local repo that's not in the parent) rather than pulling the entire repo over the wire again. [1] You can check what would be deleted by this command with "bk changes -L" similar to how you can "bk changes -R" to figure out what would be pulled. [1] Well, actually, it isn't *quite* that simple; in certain cases, repogca will delete more than it needs to. But it's still more efficient than a re-pull. -andy From dcbw@redhat.com Thu Jan 27 18:29:59 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 18:30:02 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S2Twj9026453 for ; Thu, 27 Jan 2005 18:29:59 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j0S2RuDj011714; Thu, 27 Jan 2005 21:27:56 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j0S2RuO09879; Thu, 27 Jan 2005 21:27:56 -0500 Received: from devserv.devel.redhat.com (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.11/8.12.10) with ESMTP id j0S2RuCZ007269; Thu, 27 Jan 2005 21:27:56 -0500 Received: from localhost (dcbw@localhost) by devserv.devel.redhat.com (8.12.11/8.12.11/Submit) with ESMTP id j0S2RtWk007264; Thu, 27 Jan 2005 21:27:55 -0500 Date: Thu, 27 Jan 2005 21:27:55 -0500 (EST) From: Dan Williams To: netdev@oss.sgi.com cc: jt@hpl.hp.com Subject: Adding an IW_QUAL_ALL_UPDATED macro Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 936 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dcbw@redhat.com Precedence: bulk X-list: netdev Content-Length: 868 Lines: 26 Jean, Can we add something like: #define IW_QUAL_ALL_UPDATED (IW_QUAL_QUAL_UPDATED | IW_QUAL_LEVEL_UPDATED | IW_QUAL_NOISE_UPDATED) #define IW_QUAL_ALL_INVALID (IW_QUAL_QUAL_INVALID | IW_QUAL_LEVEL_INVALID | IW_QUAL_NOISE_INVALID) these macros to wireless.h? This would be helpful for drivers, many of which seem to have "qual.updated = 7; /* all updated */" type statements in them. I'm also attempting to normalize some of the quality values in the drivers, and to develop an understanding of the spreads of the quality values in all of them. I hope to post the data from this evaluation at some point. I'm fixing up the in-kernel drivers (and ipw2200 driver) to correctly set the "qual.updated" field since most of them don't. Dan From jgarzik@pobox.com Thu Jan 27 18:31:23 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 18:31:27 -0800 (PST) Received: from parcelfarce.linux.theplanet.co.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S2VMvI026868 for ; Thu, 27 Jan 2005 18:31:22 -0800 Received: from [69.134.152.124] (helo=[10.10.10.88]) by parcelfarce.linux.theplanet.co.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CuLup-0002tq-Jw; Fri, 28 Jan 2005 02:31:19 +0000 Message-ID: <41F9A3E7.5060607@pobox.com> Date: Thu, 27 Jan 2005 21:31:03 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andy Isaacson CC: Netdev , Linux Kernel , Andrew Morton , Jouni Malinen Subject: Re: netdev-2.6 queue updated References: <41F980A0.8020905@pobox.com> <20050128021530.GB19150@hexapodia.org> In-Reply-To: <20050128021530.GB19150@hexapodia.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 937 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 557 Lines: 21 Andy Isaacson wrote: > On Thu, Jan 27, 2005 at 07:00:32PM -0500, Jeff Garzik wrote: > >>The attached changelog describes what I just pushed out to BitKeeper >>(and what should be appearing in the next -mm release from Andrew). >> >>Note to BK users: please re-clone netdev-2.6, don't just 'bk pull'. > > > It's much more efficient to do > % bk undo -a`bk repogca` Well, by "re-clone" I mean recreate. It's probably better to do what I do, clone the latest linux-2.5 repo and the pull netdev-2.6 into that. Far less messy than 'bk undo'. Jeff From rusty@rustcorp.com.au Thu Jan 27 19:00:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 19:00:58 -0800 (PST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S30rGK028025 for ; Thu, 27 Jan 2005 19:00:54 -0800 Received: from localhost.localdomain (localhost [127.0.0.1]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTP id 469AE67AAF; Fri, 28 Jan 2005 14:00:47 +1100 (EST) Subject: Re: 2.6.11-rc2 TCP ignores PMTU ICMP (Re: Linux 2.6.11-rc2) From: Rusty Russell To: Patrick McHardy Cc: "David S. Miller" , David Brownell , jf-ml-k1-1087813225@lk8rp.mail.xeon.eu.org, david+challenge-response@blue-labs.org, lkml - Kernel Mailing List , netdev@oss.sgi.com, ahaas@airmail.net In-Reply-To: <41F99656.5040304@trash.net> References: <200501232251.42394.david-b@pacbell.net> <200501271128.48411.david-b@pacbell.net> <200501271511.58086.david-b@pacbell.net> <20050127154150.360f95e2.davem@davemloft.net> <41F99656.5040304@trash.net> Content-Type: text/plain Date: Fri, 28 Jan 2005 14:00:50 +1100 Message-Id: <1106881251.18360.54.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.3 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 938 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rusty@rustcorp.com.au Precedence: bulk X-list: netdev Content-Length: 473 Lines: 17 On Fri, 2005-01-28 at 02:33 +0100, Patrick McHardy wrote: > David S. Miller wrote: > > >I've forwarded this to netfilter-devel for inspection. > >Thanks for collecting all the data points so well. > > > Here is the fix for everyone. Please report back if it doesn't > solve the problem. Thanks. Verified by nfsim (the ICMP tests used UDP, I've just added TCP and ICMP, and will do SCTP). Thanks, Rusty. -- A bad analogy is like a leaky screwdriver -- Richard Braakman From davem@davemloft.net Thu Jan 27 21:24:40 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 21:24:48 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S5Odq8002816 for ; Thu, 27 Jan 2005 21:24:40 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CuOXk-00063x-00; Thu, 27 Jan 2005 21:19:40 -0800 Date: Thu, 27 Jan 2005 21:19:40 -0800 From: "David S. Miller" To: Herbert Xu Cc: netdev@oss.sgi.com Subject: Re: design for TSO performance fix Message-Id: <20050127211940.31f97ed3.davem@davemloft.net> In-Reply-To: References: <20050127163146.33b01e95.davem@davemloft.net> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 939 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 812 Lines: 23 On Fri, 28 Jan 2005 12:31:53 +1100 Herbert Xu wrote: > > 2) As a result of #1, all the pcount crap goes away. > > The need for two MSS state variables (mss_cache, > > and mss_cache_std) and assosciated complexity is > > eliminated as well. > > Does this mean that we'll start counting bytes instead > of packets? > > If not then please let me know on how you plan to do the > packet counting. Things will be same as what we have now, except multi-packet SKBs will no longer exist in the retransmit queue. > The other good thing about this is that if we do this for all > packets including non-TSO ones, then the TCP stack doesn't have > to own the TCP/IP headers at all. Then we can stop worrying > about the TSO/COW mangling. Hmmm, have to think about that some more. From davem@davemloft.net Thu Jan 27 21:26:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 21:26:56 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S5Qnc3003175 for ; Thu, 27 Jan 2005 21:26:49 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CuOaF-00064Q-00; Thu, 27 Jan 2005 21:22:15 -0800 Date: Thu, 27 Jan 2005 21:22:14 -0800 From: "David S. Miller" To: sfeldma@pobox.com Cc: rmk+lkml@arm.linux.org.uk, jgarzik@pobox.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, greg@kroah.com, akpm@osdl.org Subject: Re: [ANN] removal of certain net drivers coming soon: eepro100, xircom_tulip_cb, iph5526 Message-Id: <20050127212214.58678bef.davem@davemloft.net> In-Reply-To: <1106877517.18167.311.camel@localhost.localdomain> References: <41F952F4.7040804@pobox.com> <20050127225725.F3036@flint.arm.linux.org.uk> <20050127153114.72be03e2.davem@davemloft.net> <20050128001430.C22695@flint.arm.linux.org.uk> <20050127164843.08bdb307.davem@davemloft.net> <1106877517.18167.311.camel@localhost.localdomain> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 940 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 326 Lines: 9 On Thu, 27 Jan 2005 17:58:37 -0800 Scott Feldman wrote: > eepro100 does a copy if pkt_len < rx_copybreak, otherwise it send up the > skb and allocates and links a new one in it's place (see > speedo_rx_link). My bad, you're right. So I wonder too what the difference is that makes it work on ARM et al. From herbert@gondor.apana.org.au Thu Jan 27 21:45:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 21:45:33 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S5jNVO004078 for ; Thu, 27 Jan 2005 21:45:24 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CuOwO-0007X5-00; Fri, 28 Jan 2005 16:45:08 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CuOvx-00029Z-00; Fri, 28 Jan 2005 16:44:41 +1100 Date: Fri, 28 Jan 2005 16:44:41 +1100 To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: design for TSO performance fix Message-ID: <20050128054441.GA8260@gondor.apana.org.au> References: <20050127163146.33b01e95.davem@davemloft.net> <20050127211940.31f97ed3.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050127211940.31f97ed3.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 941 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 715 Lines: 19 On Thu, Jan 27, 2005 at 09:19:40PM -0800, David S. Miller wrote: > > > Does this mean that we'll start counting bytes instead > > of packets? > > > > If not then please let me know on how you plan to do the > > packet counting. > > Things will be same as what we have now, except multi-packet > SKBs will no longer exist in the retransmit queue. Colour me confused then. How are you going to remember the packet boundaries which we need to do if we're going to keep counting packets instead of bytes? -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From rddunlap@osdl.org Thu Jan 27 21:58:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 21:58:20 -0800 (PST) Received: from fire-1.osdl.org (fire.osdl.org [65.172.181.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S5wFR8004965 for ; Thu, 27 Jan 2005 21:58:15 -0800 Received: from [192.168.1.103] (wbar2.sea1-4-5-049-023.sea1.dsl-verizon.net [4.5.49.23]) (authenticated bits=0) by fire-1.osdl.org (8.12.8/8.12.8) with ESMTP id j0S5w7TV027662 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Thu, 27 Jan 2005 21:58:08 -0800 Message-ID: <41F9D27A.8090204@osdl.org> Date: Thu, 27 Jan 2005 21:49:46 -0800 From: "Randy.Dunlap" User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com, jgarzik , corey@world.std.com Subject: [PATCH] ray_cs: reduce stack usage Content-Type: multipart/mixed; boundary="------------090109010602020104060907" X-MIMEDefang-Filter: osdl$Revision: 1.101 $ X-Scanned-By: MIMEDefang 2.36 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 942 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 3281 Lines: 92 This is a multi-part message in MIME format. --------------090109010602020104060907 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit ray_cs: reduce local stack usage in ray_dev_ioctl from 1048 to 468 (on i386) by making 'range' kmalloc-ed instead of an automatic stack variable. struct iw_range range; // 564 bytes Signed-off-by: Randy Dunlap diffstat:= drivers/net/wireless/ray_cs.c | 35 +++++++++++++++++++++-------------- 1 files changed, 21 insertions(+), 14 deletions(-) --------------090109010602020104060907 Content-Type: text/x-patch; name="raycs_stack1.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="raycs_stack1.patch" diff -Naurp ./drivers/net/wireless/ray_cs.c~raycs_stack ./drivers/net/wireless/ray_cs.c --- ./drivers/net/wireless/ray_cs.c~raycs_stack 2005-01-27 20:38:05.678592648 -0800 +++ ./drivers/net/wireless/ray_cs.c 2005-01-27 21:05:51.637328424 -0800 @@ -1467,33 +1467,39 @@ static int ray_dev_ioctl(struct net_devi /* Basic checking... */ if(wrq->u.data.pointer != (caddr_t) 0) { - struct iw_range range; - memset((char *) &range, 0, sizeof(struct iw_range)); + struct iw_range *range; + range = kmalloc(sizeof(struct iw_range), GFP_KERNEL); + if (!range) { + err = -ENOMEM; + goto ioc_out; + } + memset((char *) range, 0, sizeof(struct iw_range)); /* Set the length (very important for backward compatibility) */ wrq->u.data.length = sizeof(struct iw_range); #if WIRELESS_EXT > 10 /* Set the Wireless Extension versions */ - range.we_version_compiled = WIRELESS_EXT; - range.we_version_source = 9; + range->we_version_compiled = WIRELESS_EXT; + range->we_version_source = 9; #endif /* WIRELESS_EXT > 10 */ /* Set information in the range struct */ - range.throughput = 1.1 * 1000 * 1000; /* Put the right number here */ - range.num_channels = hop_pattern_length[(int)country]; - range.num_frequency = 0; - range.max_qual.qual = 0; - range.max_qual.level = 255; /* What's the correct value ? */ - range.max_qual.noise = 255; /* Idem */ - range.num_bitrates = 2; - range.bitrate[0] = 1000000; /* 1 Mb/s */ - range.bitrate[1] = 2000000; /* 2 Mb/s */ + range->throughput = 1.1 * 1000 * 1000; /* Put the right number here */ + range->num_channels = hop_pattern_length[(int)country]; + range->num_frequency = 0; + range->max_qual.qual = 0; + range->max_qual.level = 255; /* What's the correct value ? */ + range->max_qual.noise = 255; /* Idem */ + range->num_bitrates = 2; + range->bitrate[0] = 1000000; /* 1 Mb/s */ + range->bitrate[1] = 2000000; /* 2 Mb/s */ /* Copy structure to the user buffer */ - if(copy_to_user(wrq->u.data.pointer, &range, + if(copy_to_user(wrq->u.data.pointer, range, sizeof(struct iw_range))) err = -EFAULT; + kfree(range); } break; @@ -1632,6 +1638,7 @@ static int ray_dev_ioctl(struct net_devi DEBUG(0,"ray_dev_ioctl cmd = 0x%x\n", cmd); err = -EOPNOTSUPP; } +ioc_out: return err; } /* end ray_dev_ioctl */ /*===========================================================================*/ --------------090109010602020104060907-- From ak@muc.de Thu Jan 27 22:25:58 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 22:26:06 -0800 (PST) Received: from one.firstfloor.org (one.firstfloor.org [213.235.205.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S6PvKh006361 for ; Thu, 27 Jan 2005 22:25:58 -0800 Received: by one.firstfloor.org (Postfix, from userid 502) id 008EBD033F; Fri, 28 Jan 2005 07:25:54 +0100 (CET) To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: design for TSO performance fix References: <20050127163146.33b01e95.davem@davemloft.net> From: Andi Kleen Date: Fri, 28 Jan 2005 07:25:54 +0100 In-Reply-To: <20050127163146.33b01e95.davem@davemloft.net> (David S. Miller's message of "Thu, 27 Jan 2005 16:31:46 -0800") Message-ID: User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 943 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@muc.de Precedence: bulk X-list: netdev Content-Length: 1968 Lines: 54 "David S. Miller" writes: > Ok, here is the best idea I've been able to come up with > so far. > > The basic idea is that we stop trying to build TSO frames > in the actual transmit queue. Instead, TSO packets are > built impromptu when we actually output packets on the > transmit queue. I don't quite get how it should work. Currently tcp_sendmsg will always push the first packet when the send_head is empty way down to hard_queue_xmit, and then queue up some others and then finally push them out. You would always miss the first one with that right? (assuming MTU sized packets) I looked at this some time ago to pass lists of packets to qdisc and hard_queue_xmit, because that would allow less locking overhead and allow some drivers to send stuff more efficiently to the hardware registers (It was one of the items in my "how to speed up the stack" list ;-) I never ended up implementing it because TSO gave most of the advantages anyways. > Advantages: > > 1) No knowledge of TSO frames need exist anywhere besides > tcp_write_xmit(), tcp_transmit_skb(), and > tcp_xmit_retransmit_queue() > > 2) As a result of #1, all the pcount crap goes away. > The need for two MSS state variables (mss_cache, > and mss_cache_std) and assosciated complexity is > eliminated as well. > > 3) Keeping TSO enabled after packet loss "just works". > > 4) CWND sampled at the correct moment when deciding > the TSO packet arity. > > The one disadvantage is that it might be a tiny bit more > expensive to build TSO frames. But I am sure we can find > ways to optimize that quite well. Without lists of packets through qdiscs etc. it will likely need a lot more spin locking than it used to be (and spinlocks tend to be quite expensive). Luckily the high level queuing you need for this could be used to implement the list of packets too (and then finally pass them to hard_queue_xmit to allow drivers more optimizations) -Andi From niv@us.ibm.com Thu Jan 27 22:44:39 2005 Received: with ECARTIS (v1.0.0; list netdev); Thu, 27 Jan 2005 22:44:43 -0800 (PST) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S6iV2P007919 for ; Thu, 27 Jan 2005 22:44:38 -0800 Received: from [192.168.1.3] (c-67-171-167-143.client.comcast.net[67.171.167.143]) by comcast.net (sccrmhc12) with ESMTP id <2005012806442501200fvamfe>; Fri, 28 Jan 2005 06:44:25 +0000 Message-ID: <41F9DF5B.6050305@us.ibm.com> Date: Thu, 27 Jan 2005 22:44:43 -0800 From: Nivedita Singhvi User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.1) Gecko/20040707 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andi Kleen CC: "David S. Miller" , netdev@oss.sgi.com Subject: Re: design for TSO performance fix References: <20050127163146.33b01e95.davem@davemloft.net> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 944 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: niv@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 906 Lines: 27 Andi Kleen wrote: > I looked at this some time ago to pass lists of packets > to qdisc and hard_queue_xmit, because that would allow less locking > overhead and allow some drivers to send stuff more efficiently > to the hardware registers > (It was one of the items in my "how to speed up the stack" list ;-) > > I never ended up implementing it because TSO gave most of the advantages > anyways. I admit that it's been several months since I last looked at this - and was just handwaving, had no code. But I had thought the converse then - that it might be better to abandon TSO and just have the stack pass down the list of skbs in one pass. Had been mentioned by Andi as well as Anton. We'd get much of the gain, avoid a lot of the complexity, and the code would be simpler. And I'm not positive about this but it seemed it would handle memory fragmentation better, too. Bogus? thanks, Nivedita From rmk+netdev=oss.sgi.com@arm.linux.org.uk Fri Jan 28 00:59:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 00:59:29 -0800 (PST) Received: from caramon.arm.linux.org.uk (caramon.arm.linux.org.uk [212.18.232.186]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S8xI7h018738 for ; Fri, 28 Jan 2005 00:59:21 -0800 Received: from flint.arm.linux.org.uk ([2002:d412:e8ba:1:201:2ff:fe14:8fad]) by caramon.arm.linux.org.uk with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.41) id 1CuRy3-0008SN-SJ; Fri, 28 Jan 2005 08:59:04 +0000 Received: from rmk by flint.arm.linux.org.uk with local (Exim 4.41) id 1CuRy0-0002o9-I6; Fri, 28 Jan 2005 08:59:00 +0000 Date: Fri, 28 Jan 2005 08:58:59 +0000 From: Russell King To: "David S. Miller" Cc: Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? Message-ID: <20050128085858.B9486@flint.arm.linux.org.uk> Mail-Followup-To: "David S. Miller" , Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com References: <20050123200315.A25351@flint.arm.linux.org.uk> <20050124114853.A16971@flint.arm.linux.org.uk> <20050125193207.B30094@flint.arm.linux.org.uk> <20050127082809.A20510@flint.arm.linux.org.uk> <20050127004732.5d8e3f62.akpm@osdl.org> <16888.58622.376497.380197@robur.slu.se> <20050127164918.C3036@flint.arm.linux.org.uk> <20050127123326.2eafab35.davem@davemloft.net> <20050128001701.D22695@flint.arm.linux.org.uk> <20050127163444.1bfb673b.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20050127163444.1bfb673b.davem@davemloft.net>; from davem@davemloft.net on Thu, Jan 27, 2005 at 04:34:44PM -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 945 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rmk+lkml@arm.linux.org.uk Precedence: bulk X-list: netdev Content-Length: 929 Lines: 22 On Thu, Jan 27, 2005 at 04:34:44PM -0800, David S. Miller wrote: > On Fri, 28 Jan 2005 00:17:01 +0000 > Russell King wrote: > > Yes. Someone suggested this evening that there may have been a recent > > change to do with some IPv6 refcounting which may have caused this > > problem. Is that something you can confirm? > > Yep, it would be this change below. Try backing it out and see > if that makes your leak go away. Thanks. I'll try it, but: 1. Looking at the date of the change it seems unlikely. The recent death occurred with 2.6.10-rc2, booted on 29th November and dying on 19th January, which obviously predates this cset. 2. It'll take a couple of days to confirm the behaviour of the dst cache. -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/ 2.6 Serial core From rmk+netdev=oss.sgi.com@arm.linux.org.uk Fri Jan 28 01:32:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 01:32:31 -0800 (PST) Received: from caramon.arm.linux.org.uk (caramon.arm.linux.org.uk [212.18.232.186]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0S9WNs4019758 for ; Fri, 28 Jan 2005 01:32:24 -0800 Received: from flint.arm.linux.org.uk ([2002:d412:e8ba:1:201:2ff:fe14:8fad]) by caramon.arm.linux.org.uk with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.41) id 1CuSU8-0008Ut-Lu; Fri, 28 Jan 2005 09:32:13 +0000 Received: from rmk by flint.arm.linux.org.uk with local (Exim 4.41) id 1CuSU3-000398-HN; Fri, 28 Jan 2005 09:32:07 +0000 Date: Fri, 28 Jan 2005 09:32:06 +0000 From: Russell King To: Phil Oester Cc: Robert Olsson , Andrew Morton , torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? Message-ID: <20050128093206.C9486@flint.arm.linux.org.uk> Mail-Followup-To: Phil Oester , Robert Olsson , Andrew Morton , torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com References: <20050123200315.A25351@flint.arm.linux.org.uk> <20050124114853.A16971@flint.arm.linux.org.uk> <20050125193207.B30094@flint.arm.linux.org.uk> <20050127082809.A20510@flint.arm.linux.org.uk> <20050127004732.5d8e3f62.akpm@osdl.org> <16888.58622.376497.380197@robur.slu.se> <20050127164918.C3036@flint.arm.linux.org.uk> <20050127183745.GA13365@linuxace.com> <20050127192504.D3036@flint.arm.linux.org.uk> <20050127204012.GA14518@linuxace.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20050127204012.GA14518@linuxace.com>; from kernel@linuxace.com on Thu, Jan 27, 2005 at 12:40:12PM -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 946 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rmk+lkml@arm.linux.org.uk Precedence: bulk X-list: netdev Content-Length: 2047 Lines: 63 On Thu, Jan 27, 2005 at 12:40:12PM -0800, Phil Oester wrote: > Vanilla 2.6.10, though I've been seeing these problems since 2.6.8 or > earlier. Right. For me: - 2.6.9-rc3 (installed 8th Oct) died with dst cache overflow on 29th November - 2.6.10-rc2 (booted 29th Nov) died with the same on 19th January - 2.6.11-rc1 (booted 19th Jan) appears to have the same problem, but it hasn't died yet. > Netfilter running on all boxes, some utilizing SNAT, others > not -- none using MASQ. IPv4 filter targets: ACCEPT, DROP, REJECT, LOG using: state, limit & protocol IPv4 nat targets: DNAT, MASQ using: protocol IPv4 mangle targets: ACCEPT, MARK using: protocol IPv6 filter targets: ACCEPT, DROP using: protocol IPv6 mangle targets: none (protocol == at least one rule matching tcp, icmp or udp packets) IPv6 configured native on internal interface, tun6to4 for external IPv6 communication. IPv4 and IPv6 forwarding enabled. IPv4 rpfilter, proxyarp, syncookies enabled. IPv4 proxy delay on internal interface set to '1'. > These boxes are all running the quagga OSPF daemon, but those that > are lightly loaded are not exhibiting these problems. Running zebra (for ipv6 route advertisment on the local network only.) Network traffic-wise, 2.6.11-rc1 has this on its public facing interface(s) in 8.5 days. 4: eth1: mtu 1500 qdisc pfifo_fast qlen 1000 RX: bytes packets errors dropped overrun mcast 667468541 2603373 0 0 0 0 TX: bytes packets errors dropped carrier collsns 1245774764 2777605 0 0 1 2252 5: tun6to4@NONE: mtu 1480 qdisc noqueue RX: bytes packets errors dropped overrun mcast 19130536 84034 0 0 0 0 TX: bytes packets errors dropped carrier collsns 10436749 91589 0 0 0 0 -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/ 2.6 Serial core From glen.turner@aarnet.edu.au Fri Jan 28 05:56:59 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 05:57:04 -0800 (PST) Received: from clix.aarnet.edu.au (clix.aarnet.edu.au [192.94.63.10]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SDuwx8002063 for ; Fri, 28 Jan 2005 05:56:59 -0800 Received: from [150.101.246.229] (eth8934.sa.adsl.internode.on.net [150.101.246.229]) (authenticated bits=0) by clix.aarnet.edu.au (8.12.8/8.12.8) with ESMTP id j0SDuf7C007442; Sat, 29 Jan 2005 00:56:42 +1100 Message-ID: <41FA4498.6020202@aarnet.edu.au> Date: Sat, 29 Jan 2005 00:26:40 +1030 From: Glen Turner Organization: Australia's Academic & Research Network User-Agent: Mozilla Thunderbird 0.9 (X11/20041127) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Robert Olsson CC: netdev@oss.sgi.com Subject: Re: Linux Routing Performance Update References: <16887.39598.648724.421160@robur.slu.se> In-Reply-To: <16887.39598.648724.421160@robur.slu.se> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-MDSA: Yes X-Scanned-By: MIMEDefang 2.39 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 947 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: glen.turner@aarnet.edu.au Precedence: bulk X-list: netdev Content-Length: 668 Lines: 17 > Finally time for some more testing with a somewhat upgraded equipment. Thanks very much for the interesting results. I'm sure other network engineers have experienced software routers where the pps has dramatically slowed down upon reasonable ACLs and queuing (Cisco 7500, etc), so some results with netfilter and tc running would be appreciated, as would tests for any packet re-ordering in output flows. [ For a reasonable ACL, Team Crymu's list of aggregated Bogon addresses is a representative choice. For a basic QoS, consider three queues: control, VoIP, data. With an approximation to fair queuing + RED on the data queue. ] Best wishes, Glen From ahaas@airmail.net Fri Jan 28 06:05:34 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 06:05:39 -0800 (PST) Received: from covert.brown-ring.iadfw.net (covert.brown-ring.iadfw.net [209.196.123.143]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SE5XgT002878 for ; Fri, 28 Jan 2005 06:05:33 -0800 Received: from pppte02-084.ght.iadfw.net ([66.94.128.84] helo=pcdebian) by covert.iadfw.net with esmtp (Exim 4.24) id 1CuWme-0004HN-1o for netdev@oss.sgi.com; Fri, 28 Jan 2005 08:07:36 -0600 Received: (qmail 16452 invoked by uid 1000); 28 Jan 2005 14:04:26 -0000 From: "Art Haas" Date: Fri, 28 Jan 2005 08:04:26 -0600 To: Patrick McHardy Cc: "David S. Miller" , David Brownell , jf-ml-k1-1087813225@lk8rp.mail.xeon.eu.org, david+challenge-response@blue-labs.org, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: 2.6.11-rc2 TCP ignores PMTU ICMP (Re: Linux 2.6.11-rc2) Message-ID: <20050128140426.GF2490@artsapartment.org> References: <200501232251.42394.david-b@pacbell.net> <200501271128.48411.david-b@pacbell.net> <200501271511.58086.david-b@pacbell.net> <20050127154150.360f95e2.davem@davemloft.net> <41F99656.5040304@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F99656.5040304@trash.net> User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 948 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ahaas@airmail.net Precedence: bulk X-list: netdev Content-Length: 404 Lines: 14 On Fri, Jan 28, 2005 at 02:33:10AM +0100, Patrick McHardy wrote: > Here is the fix for everyone. Please report back if it doesn't > solve the problem. Thanks. > > [ ... snip ... ] Success!!! Art Haas -- Man once surrendering his reason, has no remaining guard against absurdities the most monstrous, and like a ship without rudder, is the sport of every wind. -Thomas Jefferson to James Smith, 1822 From md@Linux.IT Fri Jan 28 06:11:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 06:11:12 -0800 (PST) Received: from attila.bofh.it (postfix@attila.bofh.it [213.92.8.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SEB623003466 for ; Fri, 28 Jan 2005 06:11:07 -0800 Received: by attila.bofh.it (Postfix, from userid 10) id DB2A05F78E; Fri, 28 Jan 2005 15:11:03 +0100 (CET) Received: by wonderland.linux.it (Postfix, from userid 1001) id 16A221CBEA; Fri, 28 Jan 2005 15:08:36 +0100 (CET) Date: Fri, 28 Jan 2005 15:08:36 +0100 To: linuxppc-dev@ozlabs.org Cc: netdev@oss.sgi.com Subject: networking-related oopses on 2.6.9 Message-ID: <20050128140836.GA10777@wonderland.linux.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i From: md@Linux.IT (Marco d'Itri) X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 949 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: md@Linux.IT Precedence: bulk X-list: netdev Content-Length: 2921 Lines: 67 [Please Cc me, I'm not subscribed to either list.] In the last few days, after about two months it was running, one of my servers (an IBM B50) running 2.6.9 vanilla started oopsing. A twin server running the same kernel had no problems, but it's less loaded. Now I switched it back to 2.6.6, which never showed problems (but I need something newer, because SSM multicast is broken in this release). I have been able to capture the latest two oopses from the serial console, is this a known problem? KERNEL: assertion (!skb_queue_empty(&sk->sk_write_queue)) failed at net/ipv4/tc Oops: kernel access of bad area, sig: 11 [#1] NIP: C01B3BBC LR: C01B3B8C SP: D01D7DF0 REGS: d01d7d40 TRAP: 0300 Not tainted MSR: 00009032 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11 DAR: 00000048, DSISR: 40000000 TASK = cf5439d0[9999] 'bryar.cgi' THREAD: d01d6000Last syscall: 6 GPR00: 00000000 D01D7DF0 CF5439D0 000004B8 00000500 00000308 00000000 C034A250 GPR08: 000004B8 FFFFFFF5 00000000 00000000 34D0744B 1001B8D4 00000000 00000000 GPR16: 00000000 00000080 102E1FE8 00000000 102E1FDC 102E1FF0 00000000 10003078 GPR24: C0360000 C0340000 C0360000 000004B8 C0310000 CC4371E0 CC4373B4 00000000 NIP [c01b3bbc] tcp_retransmit_skb+0x54/0x39c LR [c01b3b8c] tcp_retransmit_skb+0x24/0x39c Call trace: [c01b61f0] tcp_retransmit_timer+0x134/0x47c [c01b65fc] tcp_write_timer+0xc4/0xec [c002396c] run_timer_softirq+0xf8/0x1ac [c001f004] __do_softirq+0xdc/0xec [c001f06c] do_softirq+0x58/0x5c [c00083bc] timer_interrupt+0x1fc/0x22c [c0006660] ret_from_except+0x0/0x14 Kernel panic - not syncing: Aiee, killing interrupt handler! Oops: kernel access of bad area, sig: 11 [#1] NIP: C01AB880 LR: C01AC6D0 SP: C030FBE0 REGS: c030fb30 TRAP: 0300 Not tainted MSR: 00009032 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 11 DAR: 00000050, DSISR: 40000000 TASK = c02973e0[0] 'swapper' THREAD: c030e000Last syscall: 120 GPR00: 00000000 C030FBE0 C02973E0 00000001 D21EEB34 00000003 00000001 0000021D GPR08: 00000000 00000000 001AA19A 00000000 2401C088 00000000 00000000 00000000 GPR16: 00000000 00000000 00000000 00000000 C0340000 00000004 DFD37648 00000006 GPR24: C0310000 00000003 00000000 00000000 7ABF8951 D21EE960 D21EE960 D21EEB34 NIP [c01ab880] tcp_time_to_recover+0x84/0x1f4 LR [c01ac6d0] tcp_fastretrans_alert+0x1a4/0x7ac Call trace: [c01ac6d0] tcp_fastretrans_alert+0x1a4/0x7ac [c01adc90] tcp_ack+0x178/0x560 [c01b0a34] tcp_rcv_established+0x410/0x824 [c020cf18] tcp_v6_do_rcv+0x2a0/0x320 [c020d5d0] tcp_v6_rcv+0x638/0x854 [c01ec188] ip6_input+0x1dc/0x384 [c01ebe98] ipv6_rcv+0x1a8/0x2bc [c01882cc] netif_receive_skb+0x178/0x250 [c018844c] process_backlog+0xa8/0x188 [c01885c4] net_rx_action+0x98/0x178 [c001f004] __do_softirq+0xdc/0xec [c001f06c] do_softirq+0x58/0x5c [c0007e70] do_IRQ+0xc8/0xcc [c0006660] ret_from_except+0x0/0x14 [c0008140] default_idle+0x14/0x5c Kernel panic - not syncing: Aiee, killing interrupt handler! -- ciao, Marco From jt@hpl.hp.com Fri Jan 28 08:36:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 08:36:51 -0800 (PST) Received: from palrel10.hp.com (palrel10.hp.com [156.153.255.245]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SGaklp011137 for ; Fri, 28 Jan 2005 08:36:47 -0800 Received: from tomil.hpl.hp.com (tomil.hpl.hp.com [15.0.152.100]) by palrel10.hp.com (Postfix) with ESMTP id 5D8FA2BE8; Fri, 28 Jan 2005 08:36:16 -0800 (PST) Received: from bougret.hpl.hp.com (bougret.hpl.hp.com [15.4.92.227]) by tomil.hpl.hp.com (8.9.3 (PHNE_29774)/8.9.3 HPLabs Timeshare Server) with ESMTP id IAA05014; Fri, 28 Jan 2005 08:38:17 -0800 (PST) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 1CuZ6V-0003fC-00; Fri, 28 Jan 2005 08:36:15 -0800 Date: Fri, 28 Jan 2005 08:36:15 -0800 To: Dan Williams Cc: netdev@oss.sgi.com Subject: Re: Adding an IW_QUAL_ALL_UPDATED macro Message-ID: <20050128163615.GA14063@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i Organisation: HP Labs Palo Alto Address: HP Labs, 1U-17, 1501 Page Mill road, Palo Alto, CA 94304, USA. E-mail: jt@hpl.hp.com From: Jean Tourrilhes X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 950 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jt@hpl.hp.com Precedence: bulk X-list: netdev Content-Length: 1265 Lines: 35 On Thu, Jan 27, 2005 at 09:27:55PM -0500, Dan Williams wrote: > Jean, > > Can we add something like: > > #define IW_QUAL_ALL_UPDATED (IW_QUAL_QUAL_UPDATED > | IW_QUAL_LEVEL_UPDATED > | IW_QUAL_NOISE_UPDATED) > > #define IW_QUAL_ALL_INVALID (IW_QUAL_QUAL_INVALID > | IW_QUAL_LEVEL_INVALID > | IW_QUAL_NOISE_INVALID) > > these macros to wireless.h? This would be helpful for drivers, many > of which seem to have "qual.updated = 7; /* all updated */" type > statements in them. Ok, I'll push that in WE-18. Meanwhile, you can have local defs protected by #ifdef. > I'm also attempting to normalize some of the quality values in the > drivers, and to develop an understanding of the spreads of the quality > values in all of them. I hope to post the data from this evaluation at > some point. I'm fixing up the in-kernel drivers (and ipw2200 driver) to > correctly set the "qual.updated" field since most of them don't. Be aware that those defines, IW_QUAL_XXX, were only introduced in WE-17, which means 2.6.10 and later. For driver outside the kernel, you need to have local definition is WIRELESS_EXT < 17. > Dan Thanks, Jean From sudeep.list@gmail.com Fri Jan 28 09:59:33 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 09:59:38 -0800 (PST) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.194]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SHxWpk014039 for ; Fri, 28 Jan 2005 09:59:33 -0800 Received: by rproxy.gmail.com with SMTP id b11so452561rne for ; Fri, 28 Jan 2005 09:59:32 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=DhNj+K2ktVZm3CjmWNJGFD8skx11txTLnRJcxIDKwF1LV3w9hJUBG6cShAJurM4C2I6K2PVTu0mCglcZPzWM4CoGW4v9vIMY/8eBbm8UAB5JWwG3ef+zxGUf43Ls39QdQBYPKBkEqNJMMg6x0fyIPWtUrvAisi68ilAuQIneskA= Received: by 10.38.74.51 with SMTP id w51mr80867rna; Fri, 28 Jan 2005 09:59:31 -0800 (PST) Received: by 10.38.72.22 with HTTP; Fri, 28 Jan 2005 09:59:31 -0800 (PST) Message-ID: Date: Fri, 28 Jan 2005 10:59:31 -0700 From: sudeep list Reply-To: sudeep list To: netdev@oss.sgi.com Subject: turning off tcp checksums. Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 951 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sudeep.list@gmail.com Precedence: bulk X-list: netdev Content-Length: 1859 Lines: 51 hello, I am trying to conduct some throughput experiments using a modified TcP/IP stack. One of the things that I would like to do is to turn off the TcP checksum. The idea is that the application computes its own checksum, and having tcp duplicate the effort with a weaker checksum doesnt make sense. This still leaves the tcp header without any checksum, but since this is a lab environment, I hope to get away with it for now :-) I guess this means, modifying the tcp egress path, tcp ingress, and turning off the hardware checksum capability on the two ends. I think I have figured out how to change the egress path, but have no clue about the ingress path. egress path ------------------ Modify the tcp_ioctl function in net/ipv4/tcp.c to add a command that sets the value of sk->sk_route_caps = NETIF_F_NO_CSUM This shall result in the following code path being executed in the tcp_sendmsg function. . . 841 if (sk->sk_route_caps & 843 (NETIF_F_IP_CSUM | NETIF_F_NO_CSUM | 844 NETIF_F_HW_CSUM)) 845 skb->ip_summed = CHECKSUM_HW; .. which (I hope) shall result in turning off the checksum calculation in downstream code. Ingress Path ------------------- On this path, I saw that its the driver routines that set the value of skb->ip_summed. I guess I could also change my driver routine to set the ip_summed value to CHECKSUM_HW but that appears too rash. 1) I suspect it will also turn off the ip header checksum 2) Its only for *some* sockets in my stack that I want to turn off the checksum, not all. may be I can find out the socket that the skb is destined for, and if its for "my" socket I could set the value appropriately, but that appears too ugly (and inefficient ?). How do I go about doing this ? Does my tcp_sendmsg modification make sense or are there better ways of doing this ? regards Sudeep From shemminger@osdl.org Fri Jan 28 10:10:40 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 10:10:45 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SIAdVf014792 for ; Fri, 28 Jan 2005 10:10:40 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0SIAWl16013; Fri, 28 Jan 2005 10:10:32 -0800 Date: Fri, 28 Jan 2005 10:10:39 -0800 From: Stephen Hemminger To: sudeep list Cc: netdev@oss.sgi.com Subject: Re: turning off tcp checksums. Message-ID: <20050128101039.654abf2a@dxpl.pdx.osdl.net> In-Reply-To: References: Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 952 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 769 Lines: 19 On Fri, 28 Jan 2005 10:59:31 -0700 sudeep list wrote: > hello, > > I am trying to conduct some throughput experiments using a modified > TcP/IP stack. One of the things that I would like to do is to turn off > the TcP checksum. The idea is that the application computes its own > checksum, and having tcp duplicate the effort with a weaker checksum > doesnt make sense. This still leaves the tcp header without any > checksum, but since this is a lab environment, I hope to get away with > it for now :-) Not allowed per RFC's and "forget about it", since the copy path does checksumming at almost no cost. If you still think it is a real issue then get a NIC that supports hardware checksumming. -- Stephen Hemminger From shemminger@osdl.org Fri Jan 28 10:18:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 10:18:31 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SIIOfq015503 for ; Fri, 28 Jan 2005 10:18:24 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0SIIHl17504; Fri, 28 Jan 2005 10:18:17 -0800 Date: Fri, 28 Jan 2005 10:18:25 -0800 From: Stephen Hemminger To: Lorenzo =?ISO-8859-1?B?SGVybuFuZGV6IEdhcmPtYS1IaWVycm8=?= Newsgroups: linux.dev.kernel Cc: netdev@oss.sgi.com Subject: Re: [PATCH] OpenBSD Networking-related randomization port Message-ID: <20050128101825.388990a0@dxpl.pdx.osdl.net> In-Reply-To: <1106934475.3778.98.camel@localhost.localdomain> References: <1106932637.3778.92.camel@localhost.localdomain> <20050128174046.GR28047@stusta.de> <1106934475.3778.98.camel@localhost.localdomain> Organization: Open Source Development Lab X-Newsreader: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j0SIIOfq015503 X-archive-position: 953 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 1711 Lines: 41 On Fri, 28 Jan 2005 18:47:55 +0100 Lorenzo Hernández García-Hierro wrote: > El vie, 28-01-2005 a las 18:40 +0100, Adrian Bunk escribió: > > On Fri, Jan 28, 2005 at 06:17:17PM +0100, Lorenzo Hernández García-Hierro wrote: > > >... > > > As it's impact is minimal (in performance and development/maintenance > > > terms), I recommend to merge it, as it gives a basic prevention for the > > > so-called system fingerprinting (which is used most by "kids" to know > > > how old and insecure could be a target system, many time used as the > > > first, even only-one, data to decide if attack or not the target host) > > > among other things. > > >... > > > > "basic prevention"? > > I hardly see how this patch makes OS fingerprinting by e.g. Nmap > > impossible. > > That's an example, as you can find at the grsecurity handbook [1]: > > "The default Linux TCP/IP-stack has some properties that make it more > vulnerable to prediction-based hacks. By randomizing several items, > predicting the behaviour will be a lot more difficult." No it just changes the fingerprint table. "Hmm, this looks like a newer generation system, must be OpenBSD or Linux". > "Randomized IP IDs hinders OS fingerprinting and will keep your machine > from being a bounce for an untraceable portscan." > > References: > [1]: http://www.gentoo.org/proj/en/hardened/grsecurity.xml This is a very transitory effect, it works only because your machine is then different from the typical Linux machine; therefore the scanner will go on to the next obvious ones. But if this gets incorporated widely then the rarity factor goes away and this defense becomes useless. -- Stephen Hemminger From lorenzo@gnu.org Fri Jan 28 10:32:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 10:32:52 -0800 (PST) Received: from vds-320151.amen-pro.com (vds-320151.amen-pro.com [62.193.204.86] (may be forged)) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SIWinm016248 for ; Fri, 28 Jan 2005 10:32:45 -0800 Received: (qmail 2899 invoked from network); 28 Jan 2005 18:32:27 -0000 Received: from 67.red-80-25-56.pooles.rima-tde.net (HELO estila) (80.25.56.67) by vds-320151.amen-pro.com with RC4-MD5 encrypted SMTP; 28 Jan 2005 18:32:27 -0000 Subject: Re: [PATCH] OpenBSD Networking-related randomization port From: Lorenzo =?ISO-8859-1?Q?Hern=E1ndez_?= =?ISO-8859-1?Q?Garc=EDa-Hierro?= To: Stephen Hemminger Cc: netdev@oss.sgi.co, "linux-kernel@vger.kernel.org" , Chris Wright , netdev@oss.sgi.com In-Reply-To: <20050128100229.5c0e4ea1@dxpl.pdx.osdl.net> References: <1106932637.3778.92.camel@localhost.localdomain> <20050128100229.5c0e4ea1@dxpl.pdx.osdl.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-Y21AUM5I1YFNeKUSUniW" Date: Fri, 28 Jan 2005 19:31:50 +0100 Message-Id: <1106937110.3864.5.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 954 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: lorenzo@gnu.org Precedence: bulk X-list: netdev Content-Length: 3551 Lines: 90 --=-Y21AUM5I1YFNeKUSUniW Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable El vie, 28-01-2005 a las 10:02 -0800, Stephen Hemminger escribi=F3: > > Attached you can find a split up patch ported from grSecurity [1], as > > Linus commented that he wouldn't get a whole-sale patch, I was working > > on it and also studying what features of grSecurity can be implemented > > without a development or maintenance overhead, aka less-invasive > > implementations. > >=20 > > It adds support for advanced networking-related randomization, in > > concrete it adds support for TCP ISNs randomization, RPC XIDs > > randomization, IP IDs randomization and finally a sub-key under the > > Cryptographic options menu for Linux PRNG [2] enhancements (useful now > > and also for future patch submissions), which currently has an only-one > > option for poll sizes increasing (x2). > >=20 > > As it's impact is minimal (in performance and development/maintenance > > terms), I recommend to merge it, as it gives a basic prevention for the > > so-called system fingerprinting (which is used most by "kids" to know > > how old and insecure could be a target system, many time used as the > > first, even only-one, data to decide if attack or not the target host) > > among other things. > >=20 > > There's only a missing feature that is present on grSecurity, the > > sources ports randomization which seems achieved now by some changes > > that can be checked out in the Linux BKBits repository: > > http://linux.bkbits.net:8080/linux-2.6/diffs/net/ipv4/tcp_ipv4.c@1.105?= nav=3Dindex.html|src/|src/net|src/net/ipv4|hist/net/ipv4/tcp_ipv4.c > > (net/ipv4/tcp_ipv4.c@1.105) > >=20 > > I'm not sure of the effectiveness of that changes, but I just prefer to > > keep it as most simple as possible.If there are thoughts on reverting t= o > > the old schema, and using obsd_rand.c code instead, just drop me a line > > and I will modify the patch. >=20 > Okay, but: > * Need to give better explanation of why this is required,=20 > existing randomization code in network is compromise between > performance and security. So you need to quantify the performance > impact of this, and the security threat reduction. Performance impact is none AFAIK. I've explained them in an early reply to Adrian [1]. > * Why are the OpenBSD random functions better? because they have more > security coolness factor? I'm not an OpenBSD user, and no intention to being a one. I just recognize that the functions do the same job better, as explained in the Kconfig diffs. > * It is hard to have two levels of security based on config options. > Think of a distro vendor, do they ship the fast or the secure system?? >=20 > As always: > * Send networking stuff to netdev@oss.sgi.com Added to CC list. > * Please split up patches. If you talk about removing the pool sizes increasing, then i will do it, but i would like to know if this has any chances to get merged. [1]: http://lkml.org/lkml/2005/1/28/139 Cheers, --=20 Lorenzo Hern=E1ndez Garc=EDa-Hierro =20 [1024D/6F2B2DEC] & [2048g/9AE91A22][http://tuxedo-es.org] --=-Y21AUM5I1YFNeKUSUniW Content-Type: application/pgp-signature; name=signature.asc Content-Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB+oUWDcEopW8rLewRAv0sAKCzfxCJAD/tbDg4V+mAYIaFn3UYSgCfXsXH BiBdnJqOOEnVcsLqhHApLw0= =SOGW -----END PGP SIGNATURE----- --=-Y21AUM5I1YFNeKUSUniW-- From lorenzo@gnu.org Fri Jan 28 10:36:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 10:36:54 -0800 (PST) Received: from vds-320151.amen-pro.com (vds-320151.amen-pro.com [62.193.204.86] (may be forged)) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SIalmx016792 for ; Fri, 28 Jan 2005 10:36:47 -0800 Received: (qmail 16836 invoked from network); 28 Jan 2005 18:36:50 -0000 Received: from 67.red-80-25-56.pooles.rima-tde.net (HELO estila) (80.25.56.67) by vds-320151.amen-pro.com with RC4-MD5 encrypted SMTP; 28 Jan 2005 18:36:50 -0000 Subject: Re: [PATCH] OpenBSD Networking-related randomization port From: Lorenzo =?ISO-8859-1?Q?Hern=E1ndez_?= =?ISO-8859-1?Q?Garc=EDa-Hierro?= To: Arjan van de Ven Cc: "linux-kernel@vger.kernel.org" , torvalds@osdl.org, netdev@oss.sgi.com, Chris Wright In-Reply-To: <1106935677.7776.29.camel@laptopd505.fenrus.org> References: <1106932637.3778.92.camel@localhost.localdomain> <1106935677.7776.29.camel@laptopd505.fenrus.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-DiYfYfHaSOb0nEIQMp5W" Date: Fri, 28 Jan 2005 19:36:13 +0100 Message-Id: <1106937373.3864.10.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 955 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: lorenzo@gnu.org Precedence: bulk X-list: netdev Content-Length: 2071 Lines: 58 --=-DiYfYfHaSOb0nEIQMp5W Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable El vie, 28-01-2005 a las 19:07 +0100, Arjan van de Ven escribi=F3: > On Fri, 2005-01-28 at 18:17 +0100, Lorenzo Hern=E1ndez Garc=EDa-Hierro > wrote: > > Hi, > >=20 > > Attached you can find a split up patch ported from grSecurity [1], as > > Linus commented that he wouldn't get a whole-sale patch, I was working > > on it and also studying what features of grSecurity can be implemented > > without a development or maintenance overhead, aka less-invasive > > implementations. >=20 >=20 > why did you make it a config option? This is the kind of thing that is > either good or isn't... at which point you can get rid of a lot of, if > not all the ugly ifdefs the patch adds. I will remove the ifdef's, I've made it just from the usability POV, users may want the standard "randomization" schema, dunno. Anyway, I will remove those ifdef's and make it enabled-by-default. > Also, why does it need to enhance the random driver this much, the > random driver already has a facility to provide pseudorandom numbers > good enough for networking use (eg the PRNG rekeys often enough with > real entropy that brute forcing it shouldn't be possible). I will also remove the pool sizes increasing diffs from the patch. > If you can fix those 2 things the patch will look a lot cleaner and has > a lot higher chance to be merged. Sure, many thanks for pointing out that clearly. It will take a few minutes and then re-send the patch. Cheers, --=20 Lorenzo Hern=E1ndez Garc=EDa-Hierro =20 [1024D/6F2B2DEC] & [2048g/9AE91A22][http://tuxedo-es.org] --=-DiYfYfHaSOb0nEIQMp5W Content-Type: application/pgp-signature; name=signature.asc Content-Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB+oYdDcEopW8rLewRAgDjAJ9fLotSjAya06xCoxQqjfgEFS1ErACg1OI3 fTIcghUC06DTIb10Tyg3YZ0= =vmpI -----END PGP SIGNATURE----- --=-DiYfYfHaSOb0nEIQMp5W-- From shemminger@osdl.org Fri Jan 28 10:52:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 10:52:25 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SIqK87017622 for ; Fri, 28 Jan 2005 10:52:20 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0SIq9l24846; Fri, 28 Jan 2005 10:52:09 -0800 Date: Fri, 28 Jan 2005 10:52:17 -0800 From: Stephen Hemminger To: Lorenzo =?ISO-8859-1?B?SGVybuFuZGV6IEdhcmPtYS1IaWVycm8=?= Cc: netdev@oss.sgi.co, "linux-kernel@vger.kernel.org" , Chris Wright , netdev@oss.sgi.com Subject: Re: [PATCH] OpenBSD Networking-related randomization port Message-ID: <20050128105217.1dc5ef42@dxpl.pdx.osdl.net> In-Reply-To: <1106937110.3864.5.camel@localhost.localdomain> References: <1106932637.3778.92.camel@localhost.localdomain> <20050128100229.5c0e4ea1@dxpl.pdx.osdl.net> <1106937110.3864.5.camel@localhost.localdomain> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 956 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 987 Lines: 27 On Fri, 28 Jan 2005 19:31:50 +0100 L > > Okay, but: > > * Need to give better explanation of why this is required, > > existing randomization code in network is compromise between > > performance and security. So you need to quantify the performance > > impact of this, and the security threat reduction. > > Performance impact is none AFAIK. > I've explained them in an early reply to Adrian [1]. When I did the port randomization patch the benchmark that was most impacted was LMBENCH. The biggest change was in the communications latency results. If you want, you can sign up for a free access to OSDL test machines and use STP to run lmbench and easily get before/after results. 1. Go to osdl.org and get associate account http://osdl.org/join_form 2. Submit patch to Patch Lifecycle Manager http://osdl.org/plm-cgi/plm 3. Choose test to run Scalable Test Platform (STP) http://osdl.org/lab_activities/kernel_testing/stp/ -- Stephen Hemminger From lorenzo@gnu.org Fri Jan 28 10:55:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 10:55:15 -0800 (PST) Received: from vds-320151.amen-pro.com (vds-320151.amen-pro.com [62.193.204.86]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SIt9xn018292 for ; Fri, 28 Jan 2005 10:55:10 -0800 Received: (qmail 19083 invoked from network); 28 Jan 2005 18:55:13 -0000 Received: from 67.red-80-25-56.pooles.rima-tde.net (HELO estila) (80.25.56.67) by vds-320151.amen-pro.com with RC4-MD5 encrypted SMTP; 28 Jan 2005 18:55:13 -0000 Subject: Re: [PATCH] OpenBSD Networking-related randomization port From: Lorenzo =?ISO-8859-1?Q?Hern=E1ndez_?= =?ISO-8859-1?Q?Garc=EDa-Hierro?= To: Stephen Hemminger Cc: netdev@oss.sgi.com, "linux-kernel@vger.kernel.org" In-Reply-To: <20050128101825.388990a0@dxpl.pdx.osdl.net> References: <1106932637.3778.92.camel@localhost.localdomain> <20050128174046.GR28047@stusta.de> <1106934475.3778.98.camel@localhost.localdomain> <20050128101825.388990a0@dxpl.pdx.osdl.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-f3UObqIKh2Ao37zlI3Kx" Date: Fri, 28 Jan 2005 19:54:36 +0100 Message-Id: <1106938476.3864.15.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 957 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: lorenzo@gnu.org Precedence: bulk X-list: netdev Content-Length: 1524 Lines: 43 --=-f3UObqIKh2Ao37zlI3Kx Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable El vie, 28-01-2005 a las 10:18 -0800, Stephen Hemminger escribi=F3: > This is a very transitory effect, it works only because your machine > is then different from the typical Linux machine; therefore the scanner > will go on to the next obvious ones. But if this gets incorporated widely > then the rarity factor goes away and this defense becomes useless. I would prefer to say that such "rarity factor" comes directly from the "rarity factor" given by the PRNG. So, we should take "rarity factor" as the PRNG seed entropy and not as a predictable value (not in a reasonable time manner, which is the goal of most crypto-related developments, to make as much difficult as possible to cause an information leak, and if such leak happens, ensure that the information is no longer needed, private, confidential, critical, whateverelse) (AFAIK). So, there's no point at that claim. Cheers, --=20 Lorenzo Hern=E1ndez Garc=EDa-Hierro =20 [1024D/6F2B2DEC] & [2048g/9AE91A22][http://tuxedo-es.org] --=-f3UObqIKh2Ao37zlI3Kx Content-Type: application/pgp-signature; name=signature.asc Content-Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB+opsDcEopW8rLewRApOoAKCpQhJNui44vkW94QMoM5y6LaSXnQCffFEg DNEiog8zbrgel/5QNd7FK5M= =VLlc -----END PGP SIGNATURE----- --=-f3UObqIKh2Ao37zlI3Kx-- From lorenzo@gnu.org Fri Jan 28 10:59:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 10:59:15 -0800 (PST) Received: from vds-320151.amen-pro.com (vds-320151.amen-pro.com [62.193.204.86]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SIxAFY018905 for ; Fri, 28 Jan 2005 10:59:11 -0800 Received: (qmail 25007 invoked from network); 28 Jan 2005 18:59:14 -0000 Received: from 67.red-80-25-56.pooles.rima-tde.net (HELO estila) (80.25.56.67) by vds-320151.amen-pro.com with RC4-MD5 encrypted SMTP; 28 Jan 2005 18:59:14 -0000 Subject: Re: [PATCH] OpenBSD Networking-related randomization port From: Lorenzo =?ISO-8859-1?Q?Hern=E1ndez_?= =?ISO-8859-1?Q?Garc=EDa-Hierro?= To: Stephen Hemminger Cc: netdev@oss.sgi.com, "linux-kernel@vger.kernel.org" , Chris Wright , netdev@oss.sgi.com In-Reply-To: <20050128105217.1dc5ef42@dxpl.pdx.osdl.net> References: <1106932637.3778.92.camel@localhost.localdomain> <20050128100229.5c0e4ea1@dxpl.pdx.osdl.net> <1106937110.3864.5.camel@localhost.localdomain> <20050128105217.1dc5ef42@dxpl.pdx.osdl.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-BcuLv7mz/04R3Q0MGGaK" Date: Fri, 28 Jan 2005 19:58:37 +0100 Message-Id: <1106938717.3864.18.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 958 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: lorenzo@gnu.org Precedence: bulk X-list: netdev Content-Length: 1441 Lines: 47 --=-BcuLv7mz/04R3Q0MGGaK Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable El vie, 28-01-2005 a las 10:52 -0800, Stephen Hemminger escribi=F3: > On Fri, 28 Jan 2005 19:31:50 +0100 > When I did the port randomization patch the benchmark that was most impac= ted > was LMBENCH. The biggest change was in the communications latency result= s. >=20 > If you want, you can sign up for a free access to OSDL test machines > and use STP to run lmbench and easily get before/after results. >=20 > 1. Go to osdl.org and get associate account http://osdl.org/join_form >=20 > 2. Submit patch to Patch Lifecycle Manager http://osdl.org/plm-cgi/plm >=20 > 3. Choose test to run Scalable Test Platform (STP)=20 > http://osdl.org/lab_activities/kernel_testing/stp/ OK, many thanks. Haven't noticed that (maybe 'cos I'm new in kernel hacking ;) ) I will submit there the new patch ASAP. Cheers, --=20 Lorenzo Hern=E1ndez Garc=EDa-Hierro =20 [1024D/6F2B2DEC] & [2048g/9AE91A22][http://tuxedo-es.org] --=-BcuLv7mz/04R3Q0MGGaK Content-Type: application/pgp-signature; name=signature.asc Content-Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB+otdDcEopW8rLewRAjBzAJ0d1Y8YNgM6bdc9CMipUhB/XoZmugCeOLNW Z/bRa/Fe6nIowhi53+4o2mQ= =qoMI -----END PGP SIGNATURE----- --=-BcuLv7mz/04R3Q0MGGaK-- From webmaster@rapidforum.com Fri Jan 28 11:28:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 11:28:07 -0800 (PST) Received: from rapidforum.com (www.rapidforum.com [80.237.244.2]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0SJS1XN020002 for ; Fri, 28 Jan 2005 11:28:02 -0800 Received: (qmail 26968 invoked by uid 1004); 28 Jan 2005 19:28:00 -0000 Received: from p3ee051a7.dip0.t-ipconnect.de (HELO ?62.224.81.167?) (62.224.81.167) by www.rapidforum.com with SMTP; 28 Jan 2005 19:28:00 -0000 Message-ID: <41FA9239.4010401@rapidforum.com> Date: Fri, 28 Jan 2005 20:27:53 +0100 From: Christian Schmid User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a3) Gecko/20040817 X-Accept-Language: de, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: Bug in 2.6.10 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 959 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: webmaster@rapidforum.com Precedence: bulk X-list: netdev Content-Length: 732 Lines: 12 Hello. In 2.6.10 there has been a "bug" introduced. You may also call it a feature, but its a crappy feature for big servers. It seems the kernel is dynamically adjusting the buffer-space available for sockets. Even if send-buffer has been set to 1024 KB, the kernel blocks at less if there are enough sockets in use. If you have 10 sockets with 1024 KB each, they do not block at all, using full 1024 KB. If you have 4000 sockets, they only use 200 KB. So it seems its blocking at 800 MB. This is good, if you have a 1/3 system, because else the kernel would run out of low mem. But I have a 2/2 system and I need them for buffers. So what can I do? Where can I adjust the "pool"? Best regards, Christian Schmid - RapidTec From davem@davemloft.net Fri Jan 28 11:33:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 11:33:59 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SJXqHi020604 for ; Fri, 28 Jan 2005 11:33:52 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CubnK-0000bH-00; Fri, 28 Jan 2005 11:28:38 -0800 Date: Fri, 28 Jan 2005 11:28:38 -0800 From: "David S. Miller" To: Herbert Xu Cc: netdev@oss.sgi.com Subject: Re: design for TSO performance fix Message-Id: <20050128112838.21e53b6c.davem@davemloft.net> In-Reply-To: <20050128054441.GA8260@gondor.apana.org.au> References: <20050127163146.33b01e95.davem@davemloft.net> <20050127211940.31f97ed3.davem@davemloft.net> <20050128054441.GA8260@gondor.apana.org.au> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 960 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 795 Lines: 23 On Fri, 28 Jan 2005 16:44:41 +1100 Herbert Xu wrote: > Colour me confused then. How are you going to remember the > packet boundaries which we need to do if we're going to keep > counting packets instead of bytes? It's just like how the code was before I added all of that tcp_pcount_t code. The retransmit queue only ever contains normal MSS sized frames. When we decide to send something off the queue, we try to build them up into TSO frames. Congestion control etc. decisions are still made by packet counting. When we get ACKs and SACKs back, we can just trim and mark the retransmit queue in the simplest way since we don't have TSO packets in there anymore. TSO packets only exist in the tcp_transmit_skb() path, nothing else in the stack sees them. From davem@davemloft.net Fri Jan 28 11:35:24 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 11:35:30 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SJZN2g021001 for ; Fri, 28 Jan 2005 11:35:23 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cubp6-0000bS-00; Fri, 28 Jan 2005 11:30:28 -0800 Date: Fri, 28 Jan 2005 11:30:28 -0800 From: "David S. Miller" To: Andi Kleen Cc: netdev@oss.sgi.com Subject: Re: design for TSO performance fix Message-Id: <20050128113028.55a41603.davem@davemloft.net> In-Reply-To: References: <20050127163146.33b01e95.davem@davemloft.net> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 961 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 607 Lines: 14 On Fri, 28 Jan 2005 07:25:54 +0100 Andi Kleen wrote: > Currently tcp_sendmsg will always push the first packet when the send_head > is empty way down to hard_queue_xmit, and then queue up some others > and then finally push them out. You would always miss the first > one with that right? (assuming MTU sized packets) We could make push_pending_frames defer if we're doing TSO and might potentially be building suck frames. It's just a detail, the main idea is what counts which is to keep all the TSO packets out of the view of most of the stack which is where all the complexity came from. From shemminger@osdl.org Fri Jan 28 11:42:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 11:43:02 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SJgtc7021783 for ; Fri, 28 Jan 2005 11:42:55 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0SJgil03549; Fri, 28 Jan 2005 11:42:44 -0800 Date: Fri, 28 Jan 2005 11:42:51 -0800 From: Stephen Hemminger To: Christian Schmid Cc: netdev@oss.sgi.com Subject: Re: Bug in 2.6.10 Message-ID: <20050128114251.64e0fff4@dxpl.pdx.osdl.net> In-Reply-To: <41FA9239.4010401@rapidforum.com> References: <41FA9239.4010401@rapidforum.com> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 962 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 1738 Lines: 36 On Fri, 28 Jan 2005 20:27:53 +0100 Christian Schmid wrote: > Hello. > > In 2.6.10 there has been a "bug" introduced. You may also call it a feature, but its a crappy > feature for big servers. It seems the kernel is dynamically adjusting the buffer-space available for > sockets. Even if send-buffer has been set to 1024 KB, the kernel blocks at less if there are enough > sockets in use. If you have 10 sockets with 1024 KB each, they do not block at all, using full 1024 > KB. If you have 4000 sockets, they only use 200 KB. So it seems its blocking at 800 MB. This is > good, if you have a 1/3 system, because else the kernel would run out of low mem. But I have a 2/2 > system and I need them for buffers. So what can I do? Where can I adjust the "pool"? You can set the upper bound by setting tcp_wmem. There are three values all documented in Documentation/networking/ip-sysctl.txt tcp_wmem - vector of 3 INTEGERs: min, default, max min: Amount of memory reserved for send buffers for TCP socket. Each TCP socket has rights to use it due to fact of its birth. Default: 4K default: Amount of memory allowed for send buffers for TCP socket by default. This value overrides net.core.wmem_default used by other protocols, it is usually lower than net.core.wmem_default. Default: 16K max: Maximal amount of memory allowed for automatically selected send buffers for TCP socket. This value does not override net.core.wmem_max, "static" selection via SO_SNDBUF does not use this. Default: 128K If you want performance on big servers you are going to need lots of memory, this is just a fact of bandwidth delay product * number of connections. -- Stephen Hemminger From davem@davemloft.net Fri Jan 28 11:50:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 11:50:47 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SJogam022481 for ; Fri, 28 Jan 2005 11:50:42 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cuc49-0000ge-00; Fri, 28 Jan 2005 11:46:01 -0800 Date: Fri, 28 Jan 2005 11:46:00 -0800 From: "David S. Miller" To: Stephen Hemminger Cc: webmaster@rapidforum.com, netdev@oss.sgi.com Subject: Re: Bug in 2.6.10 Message-Id: <20050128114600.46f3a70a.davem@davemloft.net> In-Reply-To: <20050128114251.64e0fff4@dxpl.pdx.osdl.net> References: <41FA9239.4010401@rapidforum.com> <20050128114251.64e0fff4@dxpl.pdx.osdl.net> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 963 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 1309 Lines: 25 On Fri, 28 Jan 2005 11:42:51 -0800 Stephen Hemminger wrote: > On Fri, 28 Jan 2005 20:27:53 +0100 > Christian Schmid wrote: > > > Hello. > > > > In 2.6.10 there has been a "bug" introduced. You may also call it a feature, but its a crappy > > feature for big servers. It seems the kernel is dynamically adjusting the buffer-space available for > > sockets. Even if send-buffer has been set to 1024 KB, the kernel blocks at less if there are enough > > sockets in use. If you have 10 sockets with 1024 KB each, they do not block at all, using full 1024 > > KB. If you have 4000 sockets, they only use 200 KB. So it seems its blocking at 800 MB. This is > > good, if you have a 1/3 system, because else the kernel would run out of low mem. But I have a 2/2 > > system and I need them for buffers. So what can I do? Where can I adjust the "pool"? > > You can set the upper bound by setting tcp_wmem. There are three values > all documented in Documentation/networking/ip-sysctl.txt This feature is meant also to prevent remote denial of service attacks. It limits the amount of system memory TCP can consume on your system. Before this feature went in, it's really easy to remotely make a system consume %90 of system memory just with socket buffers. From webmaster@rapidforum.com Fri Jan 28 12:03:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 12:03:53 -0800 (PST) Received: from rapidforum.com (www.rapidforum.com [80.237.244.2]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0SK3lFf024085 for ; Fri, 28 Jan 2005 12:03:48 -0800 Received: (qmail 28706 invoked by uid 1004); 28 Jan 2005 20:03:47 -0000 Received: from p3ee051a7.dip0.t-ipconnect.de (HELO ?62.224.81.167?) (62.224.81.167) by www.rapidforum.com with SMTP; 28 Jan 2005 20:03:47 -0000 Message-ID: <41FA9A9B.2000601@rapidforum.com> Date: Fri, 28 Jan 2005 21:03:39 +0100 From: Christian Schmid User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a3) Gecko/20040817 X-Accept-Language: de, en MIME-Version: 1.0 To: "David S. Miller" CC: Stephen Hemminger , netdev@oss.sgi.com Subject: Re: Bug in 2.6.10 References: <41FA9239.4010401@rapidforum.com> <20050128114251.64e0fff4@dxpl.pdx.osdl.net> <20050128114600.46f3a70a.davem@davemloft.net> In-Reply-To: <20050128114600.46f3a70a.davem@davemloft.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 964 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: webmaster@rapidforum.com Precedence: bulk X-list: netdev Content-Length: 1677 Lines: 35 >>>Hello. >>> >>>In 2.6.10 there has been a "bug" introduced. You may also call it a feature, but its a crappy >>>feature for big servers. It seems the kernel is dynamically adjusting the buffer-space available for >>>sockets. Even if send-buffer has been set to 1024 KB, the kernel blocks at less if there are enough >>>sockets in use. If you have 10 sockets with 1024 KB each, they do not block at all, using full 1024 >>>KB. If you have 4000 sockets, they only use 200 KB. So it seems its blocking at 800 MB. This is >>>good, if you have a 1/3 system, because else the kernel would run out of low mem. But I have a 2/2 >>>system and I need them for buffers. So what can I do? Where can I adjust the "pool"? >> >>You can set the upper bound by setting tcp_wmem. There are three values >>all documented in Documentation/networking/ip-sysctl.txt > > > This feature is meant also to prevent remote denial of service > attacks. It limits the amount of system memory TCP can > consume on your system. > > Before this feature went in, it's really easy to remotely make a system > consume %90 of system memory just with socket buffers. Thank you for your reply. Yes this is possible for most situations. Isn't there a way to disable it or at least adjust the level? As said, I have a 2/2 system and I would like to set it to 1500 MB. this is important for my big server. Oh and for that DOS-thingy, my two cents: It would be better if buffer-sockets are dynamically adjusted. So that memory is only allocated if the queue is really needed. Most of the allocated memory is mostly unused because queues are mostly empty. Please help me. Thank you in advance, Chris From greearb@candelatech.com Fri Jan 28 12:04:27 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 12:04:34 -0800 (PST) Received: from www.lanforge.com (ns1.lanforge.com [66.165.47.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SK4QjG024268 for ; Fri, 28 Jan 2005 12:04:27 -0800 Received: from [4.33.45.22] (evrtwa1-ar2-4-33-045-022.evrtwa1.dsl-verizon.net [4.33.45.22]) (authenticated bits=0) by www.lanforge.com (8.12.8/8.12.8) with ESMTP id j0SKMqLH012508; Fri, 28 Jan 2005 12:22:53 -0800 Message-ID: <41FA9AC7.5080007@candelatech.com> Date: Fri, 28 Jan 2005 12:04:23 -0800 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041020 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: Stephen Hemminger , webmaster@rapidforum.com, netdev@oss.sgi.com Subject: Re: Bug in 2.6.10 References: <41FA9239.4010401@rapidforum.com> <20050128114251.64e0fff4@dxpl.pdx.osdl.net> <20050128114600.46f3a70a.davem@davemloft.net> In-Reply-To: <20050128114600.46f3a70a.davem@davemloft.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 965 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Content-Length: 2216 Lines: 50 David S. Miller wrote: > On Fri, 28 Jan 2005 11:42:51 -0800 > Stephen Hemminger wrote: > > >>On Fri, 28 Jan 2005 20:27:53 +0100 >>Christian Schmid wrote: >> >> >>>Hello. >>> >>>In 2.6.10 there has been a "bug" introduced. You may also call it a feature, but its a crappy >>>feature for big servers. It seems the kernel is dynamically adjusting the buffer-space available for >>>sockets. Even if send-buffer has been set to 1024 KB, the kernel blocks at less if there are enough >>>sockets in use. If you have 10 sockets with 1024 KB each, they do not block at all, using full 1024 >>>KB. If you have 4000 sockets, they only use 200 KB. So it seems its blocking at 800 MB. This is >>>good, if you have a 1/3 system, because else the kernel would run out of low mem. But I have a 2/2 >>>system and I need them for buffers. So what can I do? Where can I adjust the "pool"? >> >>You can set the upper bound by setting tcp_wmem. There are three values >>all documented in Documentation/networking/ip-sysctl.txt > > > This feature is meant also to prevent remote denial of service > attacks. It limits the amount of system memory TCP can > consume on your system. > > Before this feature went in, it's really easy to remotely make a system > consume %90 of system memory just with socket buffers. Could you cause this attack without having the local machine explicitly set it's local wmem buffers higher? With the latest code, if you set the tcp_[rw]mem MAX to some really large thing, as it appears Mr Schmid was doing, does the kernel just ignore the larger value after 800MB? I agree that by default the system should protect itself from OOM attacks, but at the same time, if a user really wants to use up to 2GB of RAM for buffers, I don't think we should stop them. In addition to Mr Hemminger's suggestion, I think the more important knob would be the /proc/sys/net/core/netdev_max_backlog which bounds the total number of receive packets in the system, correct? Is there a similar knob for the total maximum number of buffers waiting in tx queues? Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From kuznet@yakov.inr.ac.ru Fri Jan 28 12:26:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 12:26:51 -0800 (PST) Received: from yakov.inr.ac.ru (yakov.inr.ac.ru [194.67.69.111]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0SKQiRH029444 for ; Fri, 28 Jan 2005 12:26:45 -0800 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=ms2.inr.ac.ru; b=JDtZ0qf9NQjQR0FDWqEdpuXSMCshpoiEWYRJDEtwsuGYcO1UbUGsS5DHyLHxXq7Z6i8jJZvuKfTFd5I42iNhKgrZYqn+oBnrOis910Cy7p+yyduedLOD8826gQgWWL2etw5dcAaQ+iZVygRri/RX74zDV4KEK/8lK5k8lILNJro=; Received: (from kuznet@localhost) envelope-from=kuznet by yakov.inr.ac.ru (8.6.13/ANK) id XAA23803; Fri, 28 Jan 2005 23:25:42 +0300 Date: Fri, 28 Jan 2005 23:25:42 +0300 From: Alexey Kuznetsov To: Herbert Xu Cc: Alexey Kuznetsov , "David S. Miller" , netdev@oss.sgi.com Subject: Re: the TSO packet mangling issue Message-ID: <20050128202542.GA23670@yakov.inr.ac.ru> References: <20050121204024.6f94fc26.davem@davemloft.net> <20050122054346.GA1635@gondor.apana.org.au> <20050122170533.GB11499@yakov.inr.ac.ru> <20050123071027.GA20296@gondor.apana.org.au> <20050126110043.GA29950@yakov.inr.ac.ru> <20050126222522.GA21670@gondor.apana.org.au> <20050127110946.GA20494@gondor.apana.org.au> <20050127111201.GB20494@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050127111201.GB20494@gondor.apana.org.au> User-Agent: Mutt/1.5.6i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 966 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kuznet@ms2.inr.ac.ru Precedence: bulk X-list: netdev Content-Length: 1580 Lines: 49 Hello! > This patch adds tcp_skb_cow() and uses it in e1000/tg3. Looks almost nice to me. Actually, I would prefer to unbind this from tcp, it can be used for something else, sctp or anything else who sends clones of skbs and wants to protect only data part. Also, tcp_skb_cow() is not good. F.e. the first thing, which I thought of, was WLAN drivers which rewrite ethernet header and either screw up tcpdumps (and break net/bridge) or have to copy each tcp skb. I used to patch it with: diff -ru ../madwifi-cvs.current/madwifi/driver/if_ath.c madwifi/driver/if_ath.c --- ../madwifi-cvs.current/madwifi/driver/if_ath.c 2004-06-08 17:38:20.587760856 +0400 +++ madwifi/driver/if_ath.c 2004-06-04 11:06:43.000000000 +0400 @@ -759,7 +759,9 @@ if (ic->ic_flags & IEEE80211_F_WEPON) len += IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN; - if ((skb_headroom(skb) < len) && + + if (len < skb_headroom(skb)) len=skb_headroom(skb); + if ((skb_cloned(skb) || (skb_headroom(skb) < len)) && pskb_expand_head(skb, len - skb_headroom(skb), 0, GFP_ATOMIC)) { dev_kfree_skb(skb); return -ENOMEM; I think it would be good to make a function sort of: static inline int skb_header_cloned(struct sk_buff *skb) { int dataref; if (!skb->cloned) return 0; dataref = atomic_read(&skb_shinfo(skb)->dataref); dataref -= !!(dataref & SKB_DATAREF_TCP); dataref &= SKB_DATAREF_MASK; return (dataref != 1); } In this case many of skb_cloned() could be just replaced with skb_header_cloned(). Alexey From Robert.Olsson@data.slu.se Fri Jan 28 12:31:24 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 12:31:35 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SKVLgN030004 for ; Fri, 28 Jan 2005 12:31:24 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0SKVHJa012146; Fri, 28 Jan 2005 21:31:18 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id A6074EE2A4; Fri, 28 Jan 2005 21:31:17 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Message-ID: <16890.41237.608094.933695@robur.slu.se> Date: Fri, 28 Jan 2005 21:31:17 +0100 To: "David S. Miller" Cc: netdev@oss.sgi.com, Jens.Laas@data.slu.se, Robert.Olsson@data.slu.se Subject: Some pktgen fixes for 2.6.11-rc2 X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j0SKVLgN030004 X-archive-position: 967 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Content-Length: 3167 Lines: 121 Hello! Some fixes pointed out by Grant Grundler and Jens Låås but Grant still see problems. --ro --- net/core/pktgen.c.foo 2005-01-28 13:16:50.965630000 +0100 +++ net/core/pktgen.c 2005-01-28 16:51:32.932273576 +0100 @@ -148,7 +148,7 @@ #include -#define VERSION "pktgen v2.54: Packet Generator for packet performance testing.\n" +#define VERSION "pktgen v2.56: Packet Generator for packet performance testing.\n" /* #define PG_DEBUG(a) a */ #define PG_DEBUG(a) @@ -167,9 +167,6 @@ #define F_TXSIZE_RND (1<<6) /* Transmit size is random */ #define F_IPV6 (1<<7) /* Interface in IPV6 Mode */ -#define L_PUSH(t, i) {i->next = t; t=i;} -#define L_POP(t, i) {i=t; if(i) t = i->next;} - /* Thread control flag bits */ #define T_TERMINATE (1<<0) #define T_STOP (1<<1) /* Stop run */ @@ -1366,19 +1363,15 @@ p += sprintf(p, "Running: "); if_lock(t); - pkt_dev = t->if_list; - while (pkt_dev && pkt_dev->running) { - p += sprintf(p, "%s ", pkt_dev->ifname); - pkt_dev = pkt_dev->next; - } + for(pkt_dev = t->if_list;pkt_dev; pkt_dev = pkt_dev->next) + if(pkt_dev->running) + p += sprintf(p, "%s ", pkt_dev->ifname); + p += sprintf(p, "\nStopped: "); - pkt_dev = t->if_list; - while (pkt_dev && !pkt_dev->running) { - p += sprintf(p, "%s ", pkt_dev->ifname); - pkt_dev = pkt_dev->next; - } - + for(pkt_dev = t->if_list;pkt_dev; pkt_dev = pkt_dev->next) + if(!pkt_dev->running) + p += sprintf(p, "%s ", pkt_dev->ifname); if (t->result[0]) p += sprintf(p, "\nResult: %s\n", t->result); @@ -2393,7 +2386,7 @@ thread_unlock(); } -static int running(struct pktgen_thread *t ) +static int thread_is_running(struct pktgen_thread *t ) { struct pktgen_dev *next; int res = 0; @@ -2415,7 +2408,7 @@ if_lock(t); - while(running(t)) { + while(thread_is_running(t)) { if_unlock(t); interruptible_sleep_on_timeout(&queue, HZ/10); @@ -2520,13 +2513,15 @@ return -EINVAL; } - if (pkt_dev->skb) - kfree_skb(pkt_dev->skb); - pkt_dev->stopped_at = getCurUs(); pkt_dev->running = 0; show_results(pkt_dev, skb_shinfo(pkt_dev->skb)->nr_frags); + + if (pkt_dev->skb) + kfree_skb(pkt_dev->skb); + + pkt_dev->skb = NULL; return 0; } @@ -2855,10 +2850,10 @@ for(pkt_dev=t->if_list; pkt_dev; pkt_dev = pkt_dev->next ) { if (strcmp(pkt_dev->ifname, ifname) == 0) { - goto out; + break; } } - out: + if_unlock(t); PG_DEBUG(printk("pktgen: find_dev(%s) returning %p\n", ifname,pkt_dev)); return pkt_dev; @@ -2879,8 +2874,7 @@ rv = -EBUSY; goto out; } - - L_PUSH(t->if_list, pkt_dev); + pkt_dev->next =t->if_list; t->if_list=pkt_dev; pkt_dev->pg_thread = t; pkt_dev->running = 0; From lorenzo@gnu.org Fri Jan 28 12:35:34 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 12:35:40 -0800 (PST) Received: from vds-320151.amen-pro.com (vds-320151.amen-pro.com [62.193.204.86]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SKZWU8030986 for ; Fri, 28 Jan 2005 12:35:33 -0800 Received: (qmail 29512 invoked from network); 28 Jan 2005 20:35:34 -0000 Received: from 67.red-80-25-56.pooles.rima-tde.net (HELO estila) (80.25.56.67) by vds-320151.amen-pro.com with RC4-MD5 encrypted SMTP; 28 Jan 2005 20:35:34 -0000 Subject: Re: [PATCH] OpenBSD Networking-related randomization port From: Lorenzo =?ISO-8859-1?Q?Hern=E1ndez_?= =?ISO-8859-1?Q?Garc=EDa-Hierro?= To: Stephen Hemminger Cc: "linux-kernel@vger.kernel.org" , Chris Wright , netdev@oss.sgi.com, Arjan van de Ven , Hank Leininger In-Reply-To: <20050128105217.1dc5ef42@dxpl.pdx.osdl.net> References: <1106932637.3778.92.camel@localhost.localdomain> <20050128100229.5c0e4ea1@dxpl.pdx.osdl.net> <1106937110.3864.5.camel@localhost.localdomain> <20050128105217.1dc5ef42@dxpl.pdx.osdl.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-yqfT7eT9Hzdva1H/QBsh" Date: Fri, 28 Jan 2005 21:34:52 +0100 Message-Id: <1106944492.3864.30.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 968 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: lorenzo@gnu.org Precedence: bulk X-list: netdev Content-Length: 16450 Lines: 246 --=-yqfT7eT9Hzdva1H/QBsh Content-Type: multipart/mixed; boundary="=-K8JTrSaJSvJCV+fubSQJ" --=-K8JTrSaJSvJCV+fubSQJ Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, Attached the new patch following Arjan's recommendations. I'm sorry about not making it "inlined", but my mail agent messes up the diffs if I do so. Still waiting for the OSDL STP tests results, they will take a while to finish. Cheers, --=20 Lorenzo Hern=E1ndez Garc=EDa-Hierro =20 [1024D/6F2B2DEC] & [2048g/9AE91A22][http://tuxedo-es.org] --=-K8JTrSaJSvJCV+fubSQJ Content-Disposition: attachment; filename=openbsd-netrand-2.6.11-rc2.patch Content-Type: text/x-patch; name=openbsd-netrand-2.6.11-rc2.patch; charset=ISO-8859-1 Content-Transfer-Encoding: base64 ZGlmZiAtTnVyIGxpbnV4LTIuNi4xMS1yYzIvaW5jbHVkZS9saW51eC9yYW5kb20uaCBsaW51eC0y LjYuMTEtcmMyLnR4MS9pbmNsdWRlL2xpbnV4L3JhbmRvbS5oDQotLS0gbGludXgtMi42LjExLXJj Mi9pbmNsdWRlL2xpbnV4L3JhbmRvbS5oCTIwMDUtMDEtMjYgMTk6NTQ6MTcuMDAwMDAwMDAwICsw MTAwDQorKysgbGludXgtMi42LjExLXJjMi50eDEvaW5jbHVkZS9saW51eC9yYW5kb20uaAkyMDA1 LTAxLTI4IDE5OjQ1OjMxLjM1OTkyMzM5MiArMDEwMA0KQEAgLTQyLDYgKzQyLDEyIEBADQogDQog I2lmZGVmIF9fS0VSTkVMX18NCiANCisvKiBPcGVuQlNEIE5ldHdvcmtpbmctcmVsYXRlZCByYW5k b21pemF0aW9uIGZ1bmN0aW9ucyAtIGxvcmVuem9AZ251Lm9yZyAqLw0KK2V4dGVybiB1bnNpZ25l ZCBsb25nIG9ic2RfZ2V0X3JhbmRvbV9sb25nKHZvaWQpOw0KK2V4dGVybiBfX3UxNiBpcF9yYW5k b21pZCh2b2lkKTsNCitleHRlcm4gX191MzIgaXBfcmFuZG9taXNuKHZvaWQpOw0KKw0KKw0KIGV4 dGVybiB2b2lkIHJhbmRfaW5pdGlhbGl6ZV9pcnEoaW50IGlycSk7DQogDQogZXh0ZXJuIHZvaWQg YWRkX2lucHV0X3JhbmRvbW5lc3ModW5zaWduZWQgaW50IHR5cGUsIHVuc2lnbmVkIGludCBjb2Rl LA0KZGlmZiAtTnVyIGxpbnV4LTIuNi4xMS1yYzIvbmV0L2lwdjQvdGNwX2lwdjQuYyBsaW51eC0y LjYuMTEtcmMyLnR4MS9uZXQvaXB2NC90Y3BfaXB2NC5jDQotLS0gbGludXgtMi42LjExLXJjMi9u ZXQvaXB2NC90Y3BfaXB2NC5jCTIwMDUtMDEtMjYgMTk6NTQ6MTkuMDAwMDAwMDAwICswMTAwDQor KysgbGludXgtMi42LjExLXJjMi50eDEvbmV0L2lwdjQvdGNwX2lwdjQuYwkyMDA1LTAxLTI4IDE5 OjM5OjQ4LjAwMDAwMDAwMCArMDEwMA0KQEAgLTUzOSwxMCArNTM5LDggQEANCiANCiBzdGF0aWMg aW5saW5lIF9fdTMyIHRjcF92NF9pbml0X3NlcXVlbmNlKHN0cnVjdCBzb2NrICpzaywgc3RydWN0 IHNrX2J1ZmYgKnNrYikNCiB7DQotCXJldHVybiBzZWN1cmVfdGNwX3NlcXVlbmNlX251bWJlcihz a2ItPm5oLmlwaC0+ZGFkZHIsDQotCQkJCQkgIHNrYi0+bmguaXBoLT5zYWRkciwNCi0JCQkJCSAg c2tiLT5oLnRoLT5kZXN0LA0KLQkJCQkJICBza2ItPmgudGgtPnNvdXJjZSk7DQorDQorCQlyZXR1 cm4gaXBfcmFuZG9taXNuKCk7DQogfQ0KIA0KIC8qIGNhbGxlZCB3aXRoIGxvY2FsIGJoIGRpc2Fi bGVkICovDQpAQCAtODMzLDE0ICs4MzEsMTEgQEANCiAJdGNwX3Y0X3NldHVwX2NhcHMoc2ssICZy dC0+dS5kc3QpOw0KIAl0cC0+ZXh0Ml9oZWFkZXJfbGVuID0gcnQtPnUuZHN0LmhlYWRlcl9sZW47 DQogDQotCWlmICghdHAtPndyaXRlX3NlcSkNCi0JCXRwLT53cml0ZV9zZXEgPSBzZWN1cmVfdGNw X3NlcXVlbmNlX251bWJlcihpbmV0LT5zYWRkciwNCi0JCQkJCQkJICAgaW5ldC0+ZGFkZHIsDQot CQkJCQkJCSAgIGluZXQtPnNwb3J0LA0KLQkJCQkJCQkgICB1c2luLT5zaW5fcG9ydCk7DQotDQot CWluZXQtPmlkID0gdHAtPndyaXRlX3NlcSBeIGppZmZpZXM7DQotDQorCWlmICghdHAtPndyaXRl X3NlcSkgew0KKwkJCXRwLT53cml0ZV9zZXEgPSBpcF9yYW5kb21pc24oKTsNCisJfQ0KKwkNCisJ aW5ldC0+aWQgPSBodG9ucyhpcF9yYW5kb21pZCgpKTsNCiAJZXJyID0gdGNwX2Nvbm5lY3Qoc2sp Ow0KIAlydCA9IE5VTEw7DQogCWlmIChlcnIpDQpAQCAtMTU3OSw4ICsxNTc0LDggQEANCiAJaWYg KG5ld2luZXQtPm9wdCkNCiAJCW5ld3RwLT5leHRfaGVhZGVyX2xlbiA9IG5ld2luZXQtPm9wdC0+ b3B0bGVuOw0KIAluZXd0cC0+ZXh0Ml9oZWFkZXJfbGVuID0gZHN0LT5oZWFkZXJfbGVuOw0KLQlu ZXdpbmV0LT5pZCA9IG5ld3RwLT53cml0ZV9zZXEgXiBqaWZmaWVzOw0KLQ0KKwluZXdpbmV0LT5p ZCA9IGh0b25zKGlwX3JhbmRvbWlkKCkpOw0KKwkNCiAJdGNwX3N5bmNfbXNzKG5ld3NrLCBkc3Rf cG10dShkc3QpKTsNCiAJbmV3dHAtPmFkdm1zcyA9IGRzdF9tZXRyaWMoZHN0LCBSVEFYX0FEVk1T Uyk7DQogCXRjcF9pbml0aWFsaXplX3Jjdl9tc3MobmV3c2spOw0KZGlmZiAtTnVyIGxpbnV4LTIu Ni4xMS1yYzIvbmV0L01ha2VmaWxlIGxpbnV4LTIuNi4xMS1yYzIudHgxL25ldC9NYWtlZmlsZQ0K LS0tIGxpbnV4LTIuNi4xMS1yYzIvbmV0L01ha2VmaWxlCTIwMDUtMDEtMjYgMTk6NTA6NDkuMDAw MDAwMDAwICswMTAwDQorKysgbGludXgtMi42LjExLXJjMi50eDEvbmV0L01ha2VmaWxlCTIwMDUt MDEtMjggMjE6MDE6MjEuODcwMTQwNjg4ICswMTAwDQpAQCAtMTEsNiArMTEsNyBAQA0KIA0KIHRt cC0kKENPTkZJR19DT01QQVQpIAkJOj0gY29tcGF0Lm8NCiBvYmotJChDT05GSUdfTkVUKQkJKz0g JCh0bXAteSkNCitvYmoteQkJCQkrPSBvYnNkX3JhbmQubw0KIA0KICMgTExDIGhhcyB0byBiZSBs aW5rZWQgYmVmb3JlIHRoZSBmaWxlcyBpbiBuZXQvODAyLw0KIG9iai0kKENPTkZJR19MTEMpCQkr PSBsbGMvDQpkaWZmIC1OdXIgbGludXgtMi42LjExLXJjMi9uZXQvb2JzZF9yYW5kLmMgbGludXgt Mi42LjExLXJjMi50eDEvbmV0L29ic2RfcmFuZC5jDQotLS0gbGludXgtMi42LjExLXJjMi9uZXQv b2JzZF9yYW5kLmMJMTk3MC0wMS0wMSAwMTowMDowMC4wMDAwMDAwMDAgKzAxMDANCisrKyBsaW51 eC0yLjYuMTEtcmMyLnR4MS9uZXQvb2JzZF9yYW5kLmMJMjAwNS0wMS0yOCAxNzo0Mzo1MC4wMDAw MDAwMDAgKzAxMDANCkBAIC0wLDAgKzEsMjY5IEBADQorLyogJElkOiBvcGVuYnNkLW5ldHJhbmQt Mi42LjExLXJjMi5wYXRjaCx2IDEuNSAyMDA1LzAxLzI4IDIwOjE2OjIxIGxvcmVuem8gRXhwICQN CisgKiBDb3B5cmlnaHQgKGMpIDIwMDUgTG9yZW56byBIZXJuYW5kZXogR2FyY2lhLUhpZXJybyA8 bG9yZW56b0BnbnUub3JnPi4NCisgKiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqDQorICogQWRk ZWQgc29tZSBtYWNyb3MgYW5kIHN0b2xlbiBjb2RlIGZyb20gcmFuZG9tLmMsIGZvciBpbmRpdmlk dWFsIGFuZCBsZXNzDQorICogImludmFzaXZlIiBpbXBsZW1lbnRhdGlvbi5BbHNvIHJlbW92ZWQg dGhlIGdldF9yYW5kb21fbG9uZygpIG1hY3JvIGRlZmluaXRpb24sDQorICogd2hpY2ggaXMgbm90 IGdvb2QgaWYgd2UgY2FuIHNpbXBseSBjYWxsIGJhY2sgb2JzZF9nZXRfcmFuZG9tX2xvbmcoKS4N CisgKg0KKyAqIENvcHlyaWdodCAoYykgMTk5NiwgMTk5NywgMjAwMC0yMDAyIE1pY2hhZWwgU2hh bGF5ZWZmLg0KKyAqIA0KKyAqIFZlcnNpb24gMS45MCwgbGFzdCBtb2RpZmllZCAyOC1KYW4tMDUN CisgKiAgICANCisgKiBDb3B5cmlnaHQgVGhlb2RvcmUgVHMnbywgMTk5NCwgMTk5NSwgMTk5Niwg MTk5NywgMTk5OCwgMTk5OS4NCisgKiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KKyAqDQorICogQ29w eXJpZ2h0IDE5OTggTmllbHMgUHJvdm9zIDxwcm92b3NAY2l0aS51bWljaC5lZHU+DQorICogQWxs IHJpZ2h0cyByZXNlcnZlZC4NCisgKiBUaGVvIGRlIFJhYWR0IDxkZXJhYWR0QG9wZW5ic2Qub3Jn PiBjYW1lIHVwIHdpdGggdGhlIGlkZWEgb2YgdXNpbmcNCisgKiBzdWNoIGEgbWF0aGVtYXRpY2Fs IHN5c3RlbSB0byBnZW5lcmF0ZSBtb3JlIHJhbmRvbSAoeWV0IG5vbi1yZXBlYXRpbmcpDQorICog aWRzIHRvIHNvbHZlIHRoZSByZXNvbHZlci9uYW1lZCBwcm9ibGVtLiAgQnV0IE5pZWxzIGRlc2ln bmVkIHRoZQ0KKyAqIGFjdHVhbCBzeXN0ZW0gYmFzZWQgb24gdGhlIGNvbnN0cmFpbnRzLg0KKyAq DQorICogUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywg d2l0aCBvciB3aXRob3V0DQorICogbW9kaWZpY2F0aW9uLCBhcmUgcGVybWl0dGVkIHByb3ZpZGVk IHRoYXQgdGhlIGZvbGxvd2luZyBjb25kaXRpb25zDQorICogYXJlIG1ldDoNCisgKiAxLiBSZWRp c3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdo dA0KKyAqICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dp bmcgZGlzY2xhaW1lciwNCisgKiAyLiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVz dCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodA0KKyAqICAgIG5vdGljZSwgdGhpcyBsaXN0 IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0aGUNCisgKiAg ICBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0aGUg ZGlzdHJpYnV0aW9uLg0KKyAqDQorICogVEhJUyBTT0ZUV0FSRSBJUyBQUk9WSURFRCBCWSBUSEUg QVVUSE9SIGBgQVMgSVMnJyBBTkQgQU5ZIEVYUFJFU1MgT1INCisgKiBJTVBMSUVEIFdBUlJBTlRJ RVMsIElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBUSEUgSU1QTElFRCBXQVJSQU5USUVT DQorICogT0YgTUVSQ0hBTlRBQklMSVRZIEFORCBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVS UE9TRSBBUkUgRElTQ0xBSU1FRC4NCisgKiBJTiBOTyBFVkVOVCBTSEFMTCBUSEUgQVVUSE9SIEJF IExJQUJMRSBGT1IgQU5ZIERJUkVDVCwgSU5ESVJFQ1QsDQorICogSU5DSURFTlRBTCwgU1BFQ0lB TCwgRVhFTVBMQVJZLCBPUiBDT05TRVFVRU5USUFMIERBTUFHRVMgKElOQ0xVRElORywgQlVUDQor ICogTk9UIExJTUlURUQgVE8sIFBST0NVUkVNRU5UIE9GIFNVQlNUSVRVVEUgR09PRFMgT1IgU0VS VklDRVM7IExPU1MgT0YgVVNFLA0KKyAqIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTIElO VEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EIE9OIEFOWQ0KKyAqIFRIRU9SWSBPRiBMSUFC SUxJVFksIFdIRVRIRVIgSU4gQ09OVFJBQ1QsIFNUUklDVCBMSUFCSUxJVFksIE9SIFRPUlQNCisg KiAoSU5DTFVESU5HIE5FR0xJR0VOQ0UgT1IgT1RIRVJXSVNFKSBBUklTSU5HIElOIEFOWSBXQVkg T1VUIE9GIFRIRSBVU0UgT0YNCisgKiBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0Yg VEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLg0KKyAqLw0KKw0KKyNpbmNsdWRlIDxsaW51 eC9rZXJuZWwuaD4NCisjaW5jbHVkZSA8bGludXgvc2NoZWQuaD4NCisjaW5jbHVkZSA8bGludXgv dGltZS5oPg0KKyNpbmNsdWRlIDxsaW51eC90aW1lci5oPg0KKyNpbmNsdWRlIDxsaW51eC9zbXBf bG9jay5oPg0KKyNpbmNsdWRlIDxsaW51eC9yYW5kb20uaD4NCisNCisjZGVmaW5lIFJVX09VVCAx ODANCisjZGVmaW5lIFJVX01BWCAzMDAwMA0KKyNkZWZpbmUgUlVfR0VOIDINCisjZGVmaW5lIFJV X04gMzI3NDkNCisjZGVmaW5lIFJVX0FHRU4gNw0KKyNkZWZpbmUgUlVfTSAzMTEwNA0KKyNkZWZp bmUgUEZBQ19OIDMNCisNCisvKg0KKyAqIFN0b2xlbiBmcm9tIC4vZHJpdmVycy9jaGFyL3JhbmRv bS5jDQorICovDQorDQorLyogRk9PLCBHRUVLIGFuZCBIRUNLIGFyZSBiYXNpYyBnZWVraXNoIE1E NCBmdW5jdGlvbnM6IGZvbyBzZWxlY3Rpb24sIGdlZWsgbWFqb3JpdHksIGhlY2sgcGFyaXR5ICov DQorI2RlZmluZSBGT08oeCwgeSwgeikgKCh6KSBeICgoeCkgJiAoKHkpIF4gKHopKSkpDQorI2Rl ZmluZSBHRUVLKHgsIHksIHopICgoKHgpICYgKHkpKSArICgoKHgpIF4gKHkpKSAmICh6KSkpDQor I2RlZmluZSBIRUNLKHgsIHksIHopICgoeCkgXiAoeSkgXiAoeikpDQorI2RlZmluZSBPQlJPVU5E KGYsIGEsIGIsIGMsIGQsIHgsIHMpCVwNCisJKGEgKz0gZihiLCBjLCBkKSArIHgsIGEgPSAoYSA8 PCBzKSB8IChhID4+ICgzMiAtIHMpKSkNCisjZGVmaW5lIG9iSzEgMA0KKyNkZWZpbmUgb2JLMiAw MTMyNDA0NzQ2MzFVTA0KKyNkZWZpbmUgb2JLMyAwMTU2NjYzNjU2NDFVTA0KKyNkZWZpbmUgT0Jf UkVLRVlfSU5URVJWQUwgKDMwMCAqIEhaKQ0KKw0KKw0KK2NvbnN0IHN0YXRpYyBfX3UxNiBwZmFj dHNbUEZBQ19OXSA9IHsgMiwgMywgMjcyOSB9Ow0KKw0KK3N0YXRpYyBfX3UxNiBydV94Ow0KK3N0 YXRpYyBfX3UxNiBydV9zZWVkLCBydV9zZWVkMjsNCitzdGF0aWMgX191MTYgcnVfYSwgcnVfYjsN CitzdGF0aWMgX191MTYgcnVfZzsNCitzdGF0aWMgX191MTYgcnVfY291bnRlciA9IDA7DQorc3Rh dGljIF9fdTE2IHJ1X21zYiA9IDA7DQorc3RhdGljIHVuc2lnbmVkIGxvbmcgcnVfcmVzZWVkID0g MDsNCitzdGF0aWMgX191MzIgdG1wOw0KKw0KKyNkZWZpbmUgVENQX1JORElTU19ST1VORFMJMTUN CisjZGVmaW5lIFRDUF9STkRJU1NfT1VUCQk3MjAwDQorI2RlZmluZSBUQ1BfUk5ESVNTX01BWAkJ MzAwMDANCisNCitzdGF0aWMgX191OCB0Y3Bfcm5kaXNzX3Nib3hbMTI4XTsNCitzdGF0aWMgX191 MTYgdGNwX3JuZGlzc19tc2I7DQorc3RhdGljIF9fdTE2IHRjcF9ybmRpc3NfY250Ow0KK3N0YXRp YyB1bnNpZ25lZCBsb25nIHRjcF9ybmRpc3NfcmVzZWVkOw0KKw0KK3N0YXRpYyBfX3UxNiBwbW9k KF9fdTE2LCBfX3UxNiwgX191MTYpOw0KK3N0YXRpYyB2b2lkIGlwX2luaXRpZCh2b2lkKTsNCitf X3UxNiBpcF9yYW5kb21pZCh2b2lkKTsNCisNCisvKg0KKyAqIEJhc2ljIGN1dC1kb3duIE1ENCB0 cmFuc2Zvcm0uICBSZXR1cm5zIG9ubHkgMzIgYml0cyBvZiByZXN1bHQuDQorICovDQorc3RhdGlj IF9fdTMyIGhhbGZfbWQ0X3RyYW5zZm9ybSAoX191MzIgY29uc3QgYnVmWzRdLCBfX3UzMiBjb25z dCBpbls4XSkNCit7DQorCV9fdTMyIGEgPSBidWZbMF0sIGIgPSBidWZbMV0sIGMgPSBidWZbMl0s IGQgPSBidWZbM107DQorDQorCS8qIFJvdW5kIDEgKi8NCisJT0JST1VORChGT08sIGEsIGIsIGMs IGQsIGluWzBdICsgb2JLMSwgIDMpOw0KKwlPQlJPVU5EKEZPTywgZCwgYSwgYiwgYywgaW5bMV0g KyBvYksxLCAgNyk7DQorCU9CUk9VTkQoRk9PLCBjLCBkLCBhLCBiLCBpblsyXSArIG9iSzEsIDEx KTsNCisJT0JST1VORChGT08sIGIsIGMsIGQsIGEsIGluWzNdICsgb2JLMSwgMTkpOw0KKwlPQlJP VU5EKEZPTywgYSwgYiwgYywgZCwgaW5bNF0gKyBvYksxLCAgMyk7DQorCU9CUk9VTkQoRk9PLCBk LCBhLCBiLCBjLCBpbls1XSArIG9iSzEsICA3KTsNCisJT0JST1VORChGT08sIGMsIGQsIGEsIGIs IGluWzZdICsgb2JLMSwgMTEpOw0KKwlPQlJPVU5EKEZPTywgYiwgYywgZCwgYSwgaW5bN10gKyBv YksxLCAxOSk7DQorDQorCS8qIFJvdW5kIDIgKi8NCisJT0JST1VORChHRUVLLCBhLCBiLCBjLCBk LCBpblsxXSArIG9iSzIsICAzKTsNCisJT0JST1VORChHRUVLLCBkLCBhLCBiLCBjLCBpblszXSAr IG9iSzIsICA1KTsNCisJT0JST1VORChHRUVLLCBjLCBkLCBhLCBiLCBpbls1XSArIG9iSzIsICA5 KTsNCisJT0JST1VORChHRUVLLCBiLCBjLCBkLCBhLCBpbls3XSArIG9iSzIsIDEzKTsNCisJT0JS T1VORChHRUVLLCBhLCBiLCBjLCBkLCBpblswXSArIG9iSzIsICAzKTsNCisJT0JST1VORChHRUVL LCBkLCBhLCBiLCBjLCBpblsyXSArIG9iSzIsICA1KTsNCisJT0JST1VORChHRUVLLCBjLCBkLCBh LCBiLCBpbls0XSArIG9iSzIsICA5KTsNCisJT0JST1VORChHRUVLLCBiLCBjLCBkLCBhLCBpbls2 XSArIG9iSzIsIDEzKTsNCisNCisJLyogUm91bmQgMyAqLw0KKwlPQlJPVU5EKEhFQ0ssIGEsIGIs IGMsIGQsIGluWzNdICsgb2JLMywgIDMpOw0KKwlPQlJPVU5EKEhFQ0ssIGQsIGEsIGIsIGMsIGlu WzddICsgb2JLMywgIDkpOw0KKwlPQlJPVU5EKEhFQ0ssIGMsIGQsIGEsIGIsIGluWzJdICsgb2JL MywgMTEpOw0KKwlPQlJPVU5EKEhFQ0ssIGIsIGMsIGQsIGEsIGluWzZdICsgb2JLMywgMTUpOw0K KwlPQlJPVU5EKEhFQ0ssIGEsIGIsIGMsIGQsIGluWzFdICsgb2JLMywgIDMpOw0KKwlPQlJPVU5E KEhFQ0ssIGQsIGEsIGIsIGMsIGluWzVdICsgb2JLMywgIDkpOw0KKwlPQlJPVU5EKEhFQ0ssIGMs IGQsIGEsIGIsIGluWzBdICsgb2JLMywgMTEpOw0KKwlPQlJPVU5EKEhFQ0ssIGIsIGMsIGQsIGEs IGluWzRdICsgb2JLMywgMTUpOw0KKw0KKwlyZXR1cm4gYnVmWzFdICsgYjsJLyogIm1vc3QgaGFz aGVkIiB3b3JkICovDQorCS8qIEFsdGVybmF0aXZlOiByZXR1cm4gc3VtIG9mIGFsbCB3b3Jkcz8g Ki8NCit9DQorDQordW5zaWduZWQgbG9uZyBvYnNkX2dldF9yYW5kb21fbG9uZyh2b2lkKQ0KK3sN CisJc3RhdGljIHRpbWVfdCAgIHJla2V5X3RpbWU7DQorCXN0YXRpYyBfX3UzMiAgICBzZWNyZXRb MTJdOw0KKwl0aW1lX3QgICAgICAgICAgdDsNCisNCisJLyoNCisJICogUGljayBhIHJhbmRvbSBz ZWNyZXQgZXZlcnkgT0JfUkVLRVlfSU5URVJWQUwgc2Vjb25kcy4NCisJICovDQorCXQgPSBnZXRf c2Vjb25kcygpOw0KKwlpZiAoIXJla2V5X3RpbWUgfHwgKHQgLSByZWtleV90aW1lKSA+IE9CX1JF S0VZX0lOVEVSVkFMKSB7DQorCQlyZWtleV90aW1lID0gdDsNCisJCWdldF9yYW5kb21fYnl0ZXMo c2VjcmV0LCBzaXplb2Yoc2VjcmV0KSk7DQorCX0NCisNCisJc2VjcmV0WzFdID0gaGFsZl9tZDRf dHJhbnNmb3JtKHNlY3JldCs4LCBzZWNyZXQpOw0KKwlzZWNyZXRbMF0gPSBoYWxmX21kNF90cmFu c2Zvcm0oc2VjcmV0KzgsIHNlY3JldCk7DQorCXJldHVybiAqKHVuc2lnbmVkIGxvbmcgKilzZWNy ZXQ7DQorfQ0KKw0KK3N0YXRpYyBfX3UxNg0KK3Btb2QoX191MTYgZ2VuLCBfX3UxNiBleHAsIF9f dTE2IG1vZCkNCit7DQorCV9fdTE2IHMsIHQsIHU7DQorDQorCXMgPSAxOw0KKwl0ID0gZ2VuOw0K Kwl1ID0gZXhwOw0KKw0KKwl3aGlsZSAodSkgew0KKwkJaWYgKHUgJiAxKQ0KKwkJCXMgPSAocyAq IHQpICUgbW9kOw0KKwkJdSA+Pj0gMTsNCisJCXQgPSAodCAqIHQpICUgbW9kOw0KKwl9DQorCXJl dHVybiAocyk7DQorfQ0KKw0KK3N0YXRpYyB2b2lkDQoraXBfaW5pdGlkKHZvaWQpDQorew0KKwlf X3UxNiBqLCBpOw0KKwlpbnQgbm9wcmltZSA9IDE7DQorDQorCXJ1X3ggPSAoKHRtcCA9IG9ic2Rf Z2V0X3JhbmRvbV9sb25nKCkpICYgMHhGRkZGKSAlIFJVX007DQorDQorCXJ1X3NlZWQgPSAodG1w ID4+IDE2KSAmIDB4N0ZGRjsNCisJcnVfc2VlZDIgPSBvYnNkX2dldF9yYW5kb21fbG9uZygpICYg MHg3RkZGOw0KKw0KKwlydV9iID0gKCh0bXAgPSBvYnNkX2dldF9yYW5kb21fbG9uZygpKSAmIDB4 ZmZmZSkgfCAxOw0KKwlydV9hID0gcG1vZChSVV9BR0VOLCAodG1wID4+IDE2KSAmIDB4ZmZmZSwg UlVfTSk7DQorCXdoaWxlIChydV9iICUgMyA9PSAwKQ0KKwkJcnVfYiArPSAyOw0KKw0KKwlqID0g KHRtcCA9IG9ic2RfZ2V0X3JhbmRvbV9sb25nKCkpICUgUlVfTjsNCisJdG1wID0gdG1wID4+IDE2 Ow0KKw0KKwl3aGlsZSAobm9wcmltZSkgew0KKwkJZm9yIChpID0gMDsgaSA8IFBGQUNfTjsgaSsr KQ0KKwkJCWlmIChqICUgcGZhY3RzW2ldID09IDApDQorCQkJCWJyZWFrOw0KKw0KKwkJaWYgKGkg Pj0gUEZBQ19OKQ0KKwkJCW5vcHJpbWUgPSAwOw0KKwkJZWxzZQ0KKwkJCWogPSAoaiArIDEpICUg UlVfTjsNCisJfQ0KKw0KKwlydV9nID0gcG1vZChSVV9HRU4sIGosIFJVX04pOw0KKwlydV9jb3Vu dGVyID0gMDsNCisNCisJcnVfcmVzZWVkID0geHRpbWUudHZfc2VjICsgUlVfT1VUOw0KKwlydV9t c2IgPSBydV9tc2IgPT0gMHg4MDAwID8gMCA6IDB4ODAwMDsNCit9DQorDQorX191MTYNCitpcF9y YW5kb21pZCh2b2lkKQ0KK3sNCisJaW50IGksIG47DQorDQorCWlmIChydV9jb3VudGVyID49IFJV X01BWCB8fCB0aW1lX2FmdGVyKGdldF9zZWNvbmRzKCksIHJ1X3Jlc2VlZCkpDQorCQlpcF9pbml0 aWQoKTsNCisNCisJaWYgKCF0bXApDQorCQl0bXAgPSBvYnNkX2dldF9yYW5kb21fbG9uZygpOw0K Kw0KKwluID0gdG1wICYgMHgzOw0KKwl0bXAgPSB0bXAgPj4gMjsNCisJaWYgKHJ1X2NvdW50ZXIg KyBuID49IFJVX01BWCkNCisJCWlwX2luaXRpZCgpOw0KKwlmb3IgKGkgPSAwOyBpIDw9IG47IGkr KykNCisJCXJ1X3ggPSAocnVfYSAqIHJ1X3ggKyBydV9iKSAlIFJVX007DQorCXJ1X2NvdW50ZXIg Kz0gaTsNCisNCisJcmV0dXJuICgocnVfc2VlZCBeIHBtb2QocnVfZywgcnVfc2VlZDIgXiBydV94 LCBSVV9OKSkgfCBydV9tc2IpOw0KK30NCisNCitzdGF0aWMgX191MTYNCit0Y3Bfcm5kaXNzX2Vu Y3J5cHQoX191MTYgdmFsKQ0KK3sNCisJX191MTYgc3VtID0gMCwgaTsNCisNCisJZm9yIChpID0g MDsgaSA8IFRDUF9STkRJU1NfUk9VTkRTOyBpKyspIHsNCisJCXN1bSArPSAweDc5Yjk7DQorCQl2 YWwgXj0gKChfX3UxNikgdGNwX3JuZGlzc19zYm94Wyh2YWwgXiBzdW0pICYgMHg3Zl0pIDw8IDc7 DQorCQl2YWwgPSAoKHZhbCAmIDB4ZmYpIDw8IDcpIHwgKHZhbCA+PiA4KTsNCisJfQ0KKw0KKwly ZXR1cm4gdmFsOw0KK30NCisNCitzdGF0aWMgdm9pZA0KK3RjcF9ybmRpc3NfaW5pdCh2b2lkKQ0K K3sNCisJZ2V0X3JhbmRvbV9ieXRlcyh0Y3Bfcm5kaXNzX3Nib3gsIHNpemVvZiAodGNwX3JuZGlz c19zYm94KSk7DQorCXRjcF9ybmRpc3NfcmVzZWVkID0gZ2V0X3NlY29uZHMoKSArIFRDUF9STkRJ U1NfT1VUOw0KKwl0Y3Bfcm5kaXNzX21zYiA9IHRjcF9ybmRpc3NfbXNiID09IDB4ODAwMCA/IDAg OiAweDgwMDA7DQorCXRjcF9ybmRpc3NfY250ID0gMDsNCit9DQorDQorX191MzINCitpcF9yYW5k b21pc24odm9pZCkNCit7DQorCWlmICh0Y3Bfcm5kaXNzX2NudCA+PSBUQ1BfUk5ESVNTX01BWCB8 fA0KKwkgICAgdGltZV9hZnRlcihnZXRfc2Vjb25kcygpLCB0Y3Bfcm5kaXNzX3Jlc2VlZCkpDQor CQl0Y3Bfcm5kaXNzX2luaXQoKTsNCisNCisJcmV0dXJuICgoKHRjcF9ybmRpc3NfZW5jcnlwdCh0 Y3Bfcm5kaXNzX2NudCsrKSB8DQorCQkgIHRjcF9ybmRpc3NfbXNiKSA8PCAxNikgfCAob2JzZF9n ZXRfcmFuZG9tX2xvbmcoKSAmIDB4N2ZmZikpOw0KK30NCmRpZmYgLU51ciBsaW51eC0yLjYuMTEt cmMyL25ldC9zdW5ycGMveHBydC5jIGxpbnV4LTIuNi4xMS1yYzIudHgxL25ldC9zdW5ycGMveHBy dC5jDQotLS0gbGludXgtMi42LjExLXJjMi9uZXQvc3VucnBjL3hwcnQuYwkyMDA1LTAxLTI2IDE5 OjU0OjIwLjAwMDAwMDAwMCArMDEwMA0KKysrIGxpbnV4LTIuNi4xMS1yYzIudHgxL25ldC9zdW5y cGMveHBydC5jCTIwMDUtMDEtMjggMTk6NDI6NDYuMDAwMDAwMDAwICswMTAwDQpAQCAtMTM0Miw3 ICsxMzQyLDkgQEANCiAgKi8NCiBzdGF0aWMgaW5saW5lIHUzMiB4cHJ0X2FsbG9jX3hpZChzdHJ1 Y3QgcnBjX3hwcnQgKnhwcnQpDQogew0KLQlyZXR1cm4geHBydC0+eGlkKys7DQorCS8qIFJldHVy biByYW5kb21pemVkIHhwcnQtPnhpZCBpbnN0ZWFkIG9mIHBydC0+eGlkKysgKi8NCisJcmV0dXJu ICh1MzIpIG9ic2RfZ2V0X3JhbmRvbV9sb25nKCk7DQorDQogfQ0KIA0KIHN0YXRpYyBpbmxpbmUg dm9pZCB4cHJ0X2luaXRfeGlkKHN0cnVjdCBycGNfeHBydCAqeHBydCkNCg== --=-K8JTrSaJSvJCV+fubSQJ-- --=-yqfT7eT9Hzdva1H/QBsh Content-Type: application/pgp-signature; name=signature.asc Content-Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB+qHsDcEopW8rLewRAmXKAKCuEXJO4/0vhG5m8Sh/7i7qFzaTbwCgk2Qt zgZn05DP7Wn1J6cME+KrNEc= =eLSO -----END PGP SIGNATURE----- --=-yqfT7eT9Hzdva1H/QBsh-- From SRS0+604e7996948a948441ca+523+infradead.org+arjan@canuck.srs.infradead.org Fri Jan 28 12:47:56 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 12:48:01 -0800 (PST) Received: from canuck.infradead.org (canuck.infradead.org [205.233.218.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SKltK6031695 for ; Fri, 28 Jan 2005 12:47:56 -0800 Received: from g133107.upc-g.chello.nl ([80.57.133.107] helo=172.31.3.43) by canuck.infradead.org with esmtpsa (Exim 4.43 #1 (Red Hat Linux)) id 1Cud1y-0006Fj-2H; Fri, 28 Jan 2005 15:47:51 -0500 Subject: Re: [PATCH] OpenBSD Networking-related randomization port From: Arjan van de Ven To: Lorenzo =?ISO-8859-1?Q?Hern=E1ndez_?= =?ISO-8859-1?Q?Garc=EDa-Hierro?= Cc: Stephen Hemminger , "linux-kernel@vger.kernel.org" , Chris Wright , netdev@oss.sgi.com, Hank Leininger In-Reply-To: <1106944492.3864.30.camel@localhost.localdomain> References: <1106932637.3778.92.camel@localhost.localdomain> <20050128100229.5c0e4ea1@dxpl.pdx.osdl.net> <1106937110.3864.5.camel@localhost.localdomain> <20050128105217.1dc5ef42@dxpl.pdx.osdl.net> <1106944492.3864.30.camel@localhost.localdomain> Content-Type: text/plain; charset=UTF-8 Date: Fri, 28 Jan 2005 21:47:45 +0100 Message-Id: <1106945266.7776.41.camel@laptopd505.fenrus.org> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by canuck.infradead.org See http://www.infradead.org/rpr.html X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 969 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: arjan@infradead.org Precedence: bulk X-list: netdev Content-Length: 1554 Lines: 59 On Fri, 2005-01-28 at 21:34 +0100, Lorenzo Hernández García-Hierro wrote: > Hi, > > Attached the new patch following Arjan's recommendations. > I'm sorry about not making it "inlined", but my mail agent messes up the > diffs if I do so. > Still waiting for the OSDL STP tests results, they will take a while to > finish. > > Cheers, lots better already! Some more comments (now that the patch got a lot easier to read :) static inline __u32 tcp_v4_init_sequence(struct sock *sk, struct sk_buff *skb) { - return secure_tcp_sequence_number(skb->nh.iph->daddr, - skb->nh.iph->saddr, - skb->h.th->dest, - skb->h.th->source); + + return ip_randomisn(); } is there a reason for the weird indentation? + if (!tp->write_seq) { + tp->write_seq = ip_randomisn(); + } spare { } pare that's not needed, also looks like one tab too many as for obsd_get_random_long().. would it be possible to use the get_random_int() function from the patches I posted the other day? They use the existing random.c infrastructure instead of making a copy... I still don't understand why you need a obsd_rand.c and can't use the normal random.c static inline u32 xprt_alloc_xid(struct rpc_xprt *xprt) { - return xprt->xid++; + /* Return randomized xprt->xid instead of prt->xid++ */ + return (u32) obsd_get_random_long(); + } that cast looks quite redundant... From davem@davemloft.net Fri Jan 28 12:50:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 12:50:13 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SKo8sG032243 for ; Fri, 28 Jan 2005 12:50:08 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CuczV-0000yb-00; Fri, 28 Jan 2005 12:45:17 -0800 Date: Fri, 28 Jan 2005 12:45:17 -0800 From: "David S. Miller" To: Lorenzo =?ISO-8859-1?Q?Hern=E1ndez_Garc=EDa-Hierro?= Cc: shemminger@osdl.org, linux-kernel@vger.kernel.org, chrisw@osdl.org, netdev@oss.sgi.com, arjan@infradead.org, hlein@progressive-comp.com Subject: Re: [PATCH] OpenBSD Networking-related randomization port Message-Id: <20050128124517.36aa5e05.davem@davemloft.net> In-Reply-To: <1106944492.3864.30.camel@localhost.localdomain> References: <1106932637.3778.92.camel@localhost.localdomain> <20050128100229.5c0e4ea1@dxpl.pdx.osdl.net> <1106937110.3864.5.camel@localhost.localdomain> <20050128105217.1dc5ef42@dxpl.pdx.osdl.net> <1106944492.3864.30.camel@localhost.localdomain> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j0SKo8sG032243 X-archive-position: 970 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 354 Lines: 10 On Fri, 28 Jan 2005 21:34:52 +0100 Lorenzo Hernández García-Hierro wrote: > Attached the new patch following Arjan's recommendations. No SMP protection on the SBOX, better look into that. The locking you'll likely need to add will make this routine serialize many networking operations which is one thing we've been trying to avoid. From shemminger@osdl.org Fri Jan 28 13:34:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 13:34:15 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SLY93h001512 for ; Fri, 28 Jan 2005 13:34:09 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0SLY0l23348; Fri, 28 Jan 2005 13:34:00 -0800 Date: Fri, 28 Jan 2005 13:34:08 -0800 From: Stephen Hemminger To: "David S. Miller" Cc: Lorenzo =?ISO-8859-1?B?SGVybuFuZGV6IEdhcmPtYS1IaWVycm8=?= , linux-kernel@vger.kernel.org, chrisw@osdl.org, netdev@oss.sgi.com, arjan@infradead.org, hlein@progressive-comp.com Subject: Re: [PATCH] OpenBSD Networking-related randomization port Message-ID: <20050128133408.49021343@dxpl.pdx.osdl.net> In-Reply-To: <20050128124517.36aa5e05.davem@davemloft.net> References: <1106932637.3778.92.camel@localhost.localdomain> <20050128100229.5c0e4ea1@dxpl.pdx.osdl.net> <1106937110.3864.5.camel@localhost.localdomain> <20050128105217.1dc5ef42@dxpl.pdx.osdl.net> <1106944492.3864.30.camel@localhost.localdomain> <20050128124517.36aa5e05.davem@davemloft.net> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j0SLY93h001512 X-archive-position: 971 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 541 Lines: 19 On Fri, 28 Jan 2005 12:45:17 -0800 "David S. Miller" wrote: > On Fri, 28 Jan 2005 21:34:52 +0100 > Lorenzo Hernández García-Hierro wrote: > > > Attached the new patch following Arjan's recommendations. > > No SMP protection on the SBOX, better look into that. > The locking you'll likely need to add will make this > routine serialize many networking operations which is > one thing we've been trying to avoid. > per-cpu would be the way to go here. -- Stephen Hemminger From davem@davemloft.net Fri Jan 28 13:50:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 13:50:09 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SLo3IH002373 for ; Fri, 28 Jan 2005 13:50:04 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cudvb-0001DS-00; Fri, 28 Jan 2005 13:45:19 -0800 Date: Fri, 28 Jan 2005 13:45:19 -0800 From: "David S. Miller" To: Stephen Hemminger Cc: lorenzo@gnu.org, linux-kernel@vger.kernel.org, chrisw@osdl.org, netdev@oss.sgi.com, arjan@infradead.org, hlein@progressive-comp.com Subject: Re: [PATCH] OpenBSD Networking-related randomization port Message-Id: <20050128134519.11a0e55d.davem@davemloft.net> In-Reply-To: <20050128133408.49021343@dxpl.pdx.osdl.net> References: <1106932637.3778.92.camel@localhost.localdomain> <20050128100229.5c0e4ea1@dxpl.pdx.osdl.net> <1106937110.3864.5.camel@localhost.localdomain> <20050128105217.1dc5ef42@dxpl.pdx.osdl.net> <1106944492.3864.30.camel@localhost.localdomain> <20050128124517.36aa5e05.davem@davemloft.net> <20050128133408.49021343@dxpl.pdx.osdl.net> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 972 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 214 Lines: 7 On Fri, 28 Jan 2005 13:34:08 -0800 Stephen Hemminger wrote: > per-cpu would be the way to go here. Does the sbox get somehow seeded from use to use? If not, then yes that's the thing to do. From daniele@orlandi.com Fri Jan 28 14:13:38 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 14:13:43 -0800 (PST) Received: from relay3.uli.it (relay3.uli.it [62.212.0.49]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SMDboq003448 for ; Fri, 28 Jan 2005 14:13:38 -0800 Received: from nabla.orlandi.com (nabla.orlandi.com [62.212.12.10]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by greg.uli.it (Postfix) with ESMTP id F21D0953A for ; Fri, 28 Jan 2005 23:13:31 +0100 (CET) From: Daniele Orlandi To: netdev@oss.sgi.com Subject: Possible race/deadlock in netdev_unregister Date: Fri, 28 Jan 2005 23:13:29 +0100 User-Agent: KMail/1.7.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501282313.30517.daniele@orlandi.com> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 974 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: daniele@orlandi.com Precedence: bulk X-list: netdev Content-Length: 2911 Lines: 57 Hello, First of all, please excuse me if this happens to be a bug in my code :) Unfortunately I'm still a newbie with netdev and his interactions with netlink, hotplug, etc... please help me understand what's happening and who is wrong. The scenario is this: - A device driver module (written by me) has two netdevices registered. - Another module (written by me, too) provides sockets implementation for the protocol spoken by the device. - An application has one socket bound to one netdevice - I rmmod the device driver module - The exit function in the module calls netdev_unregister - The event dispatcher notifies the socket layer that a device is going down - The socket is marked errored but the application keeps it open for a while - The application ends, the socket is destroyed, the remaining reference to netdevice is released but netdev_unregister keeps sleeping forever with this backtrace: Jan 28 19:02:58 bastard kernel: Call Trace: Jan 28 19:02:58 bastard kernel: [] __down+0x6e/0xd0 Jan 28 19:02:58 bastard kernel: [] default_wake_function+0x0/0x10 Jan 28 19:02:58 bastard kernel: [] netlink_dump+0x66/0x180 Jan 28 19:02:58 bastard kernel: [] __wake_up_common+0x35/0x60 Jan 28 19:02:58 bastard kernel: [] __down_failed+0x8/0xc Jan 28 19:02:58 bastard kernel: [] .text.lock.dev+0x91/0xb9 Jan 28 19:02:58 bastard kernel: [] rtnetlink_dump_ifinfo+0x0/0x70 Jan 28 19:02:58 bastard kernel: [] rtnetlink_rcv+0x1d8/0x3f0 Jan 28 19:02:58 bastard kernel: [] rtnetlink_rcv+0x0/0x3f0 Jan 28 19:02:58 bastard kernel: [] netlink_data_ready+0x28/0x50 Jan 28 19:02:58 bastard kernel: [] netdev_wait_allrefs+0xf1/0x100 Jan 28 19:02:58 bastard kernel: [] kobject_release+0x0/0x10 Jan 28 19:02:58 bastard kernel: [] netdev_run_todo+0xfc/0x1c0 Jan 28 19:02:58 bastard kernel: [] rtnetlink_dump_ifinfo+0x0/0x70 Jan 28 19:02:58 bastard kernel: [] rtnetlink_rcv+0x1d8/0x3f0 Jan 28 19:02:58 bastard kernel: [] printk+0xf/0x20 Jan 28 19:02:58 bastard kernel: [] wakeme_after_rcu+0x0/0x10 Jan 28 19:02:58 bastard kernel: [] rtnetlink_rcv+0x0/0x3f0 Jan 28 19:02:58 bastard kernel: [] netlink_data_ready+0x28/0x50 Jan 28 19:02:58 bastard kernel: [] rtnl_unlock+0x31/0x40 Jan 28 19:02:58 bastard kernel: [] fake_module_exit+0x2e/0x7e [fake_isdn] Jan 28 19:02:58 bastard kernel: [] sys_delete_module+0x15a/0x170 Jan 28 19:02:58 bastard kernel: [] unmap_vma_list+0xe/0x20 Jan 28 19:02:58 bastard kernel: [] do_munmap+0xd8/0x120 Jan 28 19:02:58 bastard kernel: [] sys_munmap+0x3c/0x60 Jan 28 19:02:58 bastard kernel: [] sysenter_past_esp+0x52/0x79 Note that disabling hotplug avoids the problem. Bye, -- Daniele Orlandi From lorenzo@gnu.org Fri Jan 28 14:13:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 14:13:31 -0800 (PST) Received: from vds-320151.amen-pro.com (vds-320151.amen-pro.com [62.193.204.86]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SMDOIA003436 for ; Fri, 28 Jan 2005 14:13:24 -0800 Received: (qmail 26477 invoked from network); 28 Jan 2005 22:13:27 -0000 Received: from 67.red-80-25-56.pooles.rima-tde.net (HELO estila) (80.25.56.67) by vds-320151.amen-pro.com with RC4-MD5 encrypted SMTP; 28 Jan 2005 22:13:27 -0000 Subject: Re: [PATCH] OpenBSD Networking-related randomization port From: Lorenzo =?ISO-8859-1?Q?Hern=E1ndez_?= =?ISO-8859-1?Q?Garc=EDa-Hierro?= To: Arjan van de Ven Cc: Stephen Hemminger , "linux-kernel@vger.kernel.org" , Chris Wright , netdev@oss.sgi.com, Hank Leininger In-Reply-To: <1106945266.7776.41.camel@laptopd505.fenrus.org> References: <1106932637.3778.92.camel@localhost.localdomain> <20050128100229.5c0e4ea1@dxpl.pdx.osdl.net> <1106937110.3864.5.camel@localhost.localdomain> <20050128105217.1dc5ef42@dxpl.pdx.osdl.net> <1106944492.3864.30.camel@localhost.localdomain> <1106945266.7776.41.camel@laptopd505.fenrus.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-qYMl8HzdSAGDeJrt87fA" Date: Fri, 28 Jan 2005 23:12:49 +0100 Message-Id: <1106950369.3864.45.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 973 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: lorenzo@gnu.org Precedence: bulk X-list: netdev Content-Length: 18273 Lines: 271 --=-qYMl8HzdSAGDeJrt87fA Content-Type: multipart/mixed; boundary="=-Gcia84xUFt7VmcgOd48t" --=-Gcia84xUFt7VmcgOd48t Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable El vie, 28-01-2005 a las 21:47 +0100, Arjan van de Ven escribi=F3: > as for obsd_get_random_long().. would it be possible to use the > get_random_int() function from the patches I posted the other day? They > use the existing random.c infrastructure instead of making a copy... As seen at http://www.kernel.org/pub/linux/kernel/people/arjan/execshield/00-randomize= -A0 you can suppose that there's no point to use that, we can easily mainta= in the functions at obsd_rand.c so we wouldn't need to add more maintenance= overhead, I hope you can understand why I want it like that and not depend= ing on random.c in more than the function exports (which make it even more = independent as we don't need to use our proper header and add each proper i= nclude entry in the modified files, as most of them use or have already ran= dom.h included). Attached you can find the new patch with the indentation fixes. The tests on the patch are the following ones: http://www.osdl.org/plm-cgi/plm?module=3Dpatch_info&patch_id=3D4136 (above one shows that there are no SMP-related issues) http://khack.osdl.org/stp/300417 http://khack.osdl.org/stp/300420 Cheers and thanks for the information, --=20 Lorenzo Hern=E1ndez Garc=EDa-Hierro =20 [1024D/6F2B2DEC] & [2048g/9AE91A22][http://tuxedo-es.org] --=-Gcia84xUFt7VmcgOd48t Content-Disposition: attachment; filename=openbsd-netrand-2.6.11-rc2.patch Content-Type: text/x-patch; name=openbsd-netrand-2.6.11-rc2.patch; charset=iso-8859-1 Content-Transfer-Encoding: base64 ZGlmZiAtTnVyIGxpbnV4LTIuNi4xMS1yYzIvaW5jbHVkZS9saW51eC9yYW5kb20uaCBsaW51eC0y LjYuMTEtcmMyLnR4MS9pbmNsdWRlL2xpbnV4L3JhbmRvbS5oDQotLS0gbGludXgtMi42LjExLXJj Mi9pbmNsdWRlL2xpbnV4L3JhbmRvbS5oCTIwMDUtMDEtMjYgMTk6NTQ6MTcuMDAwMDAwMDAwICsw MTAwDQorKysgbGludXgtMi42LjExLXJjMi50eDEvaW5jbHVkZS9saW51eC9yYW5kb20uaAkyMDA1 LTAxLTI4IDE5OjQ1OjMxLjM1OTkyMzM5MiArMDEwMA0KQEAgLTQyLDYgKzQyLDEyIEBADQogDQog I2lmZGVmIF9fS0VSTkVMX18NCiANCisvKiBPcGVuQlNEIE5ldHdvcmtpbmctcmVsYXRlZCByYW5k b21pemF0aW9uIGZ1bmN0aW9ucyAtIGxvcmVuem9AZ251Lm9yZyAqLw0KK2V4dGVybiB1bnNpZ25l ZCBsb25nIG9ic2RfZ2V0X3JhbmRvbV9sb25nKHZvaWQpOw0KK2V4dGVybiBfX3UxNiBpcF9yYW5k b21pZCh2b2lkKTsNCitleHRlcm4gX191MzIgaXBfcmFuZG9taXNuKHZvaWQpOw0KKw0KKw0KIGV4 dGVybiB2b2lkIHJhbmRfaW5pdGlhbGl6ZV9pcnEoaW50IGlycSk7DQogDQogZXh0ZXJuIHZvaWQg YWRkX2lucHV0X3JhbmRvbW5lc3ModW5zaWduZWQgaW50IHR5cGUsIHVuc2lnbmVkIGludCBjb2Rl LA0KZGlmZiAtTnVyIGxpbnV4LTIuNi4xMS1yYzIvbmV0L2lwdjQvdGNwX2lwdjQuYyBsaW51eC0y LjYuMTEtcmMyLnR4MS9uZXQvaXB2NC90Y3BfaXB2NC5jDQotLS0gbGludXgtMi42LjExLXJjMi9u ZXQvaXB2NC90Y3BfaXB2NC5jCTIwMDUtMDEtMjYgMTk6NTQ6MTkuMDAwMDAwMDAwICswMTAwDQor KysgbGludXgtMi42LjExLXJjMi50eDEvbmV0L2lwdjQvdGNwX2lwdjQuYwkyMDA1LTAxLTI4IDIy OjI4OjI0Ljk5MTEwNTYwOCArMDEwMA0KQEAgLTUzOSwxMCArNTM5LDcgQEANCiANCiBzdGF0aWMg aW5saW5lIF9fdTMyIHRjcF92NF9pbml0X3NlcXVlbmNlKHN0cnVjdCBzb2NrICpzaywgc3RydWN0 IHNrX2J1ZmYgKnNrYikNCiB7DQotCXJldHVybiBzZWN1cmVfdGNwX3NlcXVlbmNlX251bWJlcihz a2ItPm5oLmlwaC0+ZGFkZHIsDQotCQkJCQkgIHNrYi0+bmguaXBoLT5zYWRkciwNCi0JCQkJCSAg c2tiLT5oLnRoLT5kZXN0LA0KLQkJCQkJICBza2ItPmgudGgtPnNvdXJjZSk7DQorCXJldHVybiBp cF9yYW5kb21pc24oKTsNCiB9DQogDQogLyogY2FsbGVkIHdpdGggbG9jYWwgYmggZGlzYWJsZWQg Ki8NCkBAIC04MzQsMTMgKzgzMCw5IEBADQogCXRwLT5leHQyX2hlYWRlcl9sZW4gPSBydC0+dS5k c3QuaGVhZGVyX2xlbjsNCiANCiAJaWYgKCF0cC0+d3JpdGVfc2VxKQ0KLQkJdHAtPndyaXRlX3Nl cSA9IHNlY3VyZV90Y3Bfc2VxdWVuY2VfbnVtYmVyKGluZXQtPnNhZGRyLA0KLQkJCQkJCQkgICBp bmV0LT5kYWRkciwNCi0JCQkJCQkJICAgaW5ldC0+c3BvcnQsDQotCQkJCQkJCSAgIHVzaW4tPnNp bl9wb3J0KTsNCi0NCi0JaW5ldC0+aWQgPSB0cC0+d3JpdGVfc2VxIF4gamlmZmllczsNCisJCXRw LT53cml0ZV9zZXEgPSBpcF9yYW5kb21pc24oKTsNCiANCisJaW5ldC0+aWQgPSBodG9ucyhpcF9y YW5kb21pZCgpKTsNCiAJZXJyID0gdGNwX2Nvbm5lY3Qoc2spOw0KIAlydCA9IE5VTEw7DQogCWlm IChlcnIpDQpAQCAtMTU2NiwyMCArMTU1NSwyMCBAQA0KIAluZXdzay0+c2tfZHN0X2NhY2hlID0g ZHN0Ow0KIAl0Y3BfdjRfc2V0dXBfY2FwcyhuZXdzaywgZHN0KTsNCiANCi0JbmV3dHAJCSAgICAg ID0gdGNwX3NrKG5ld3NrKTsNCi0JbmV3aW5ldAkJICAgICAgPSBpbmV0X3NrKG5ld3NrKTsNCi0J bmV3aW5ldC0+ZGFkZHIJICAgICAgPSByZXEtPmFmLnY0X3JlcS5ybXRfYWRkcjsNCi0JbmV3aW5l dC0+cmN2X3NhZGRyICAgID0gcmVxLT5hZi52NF9yZXEubG9jX2FkZHI7DQotCW5ld2luZXQtPnNh ZGRyCSAgICAgID0gcmVxLT5hZi52NF9yZXEubG9jX2FkZHI7DQotCW5ld2luZXQtPm9wdAkgICAg ICA9IHJlcS0+YWYudjRfcmVxLm9wdDsNCi0JcmVxLT5hZi52NF9yZXEub3B0ICAgID0gTlVMTDsN Ci0JbmV3aW5ldC0+bWNfaW5kZXggICAgID0gdGNwX3Y0X2lpZihza2IpOw0KLQluZXdpbmV0LT5t Y190dGwJICAgICAgPSBza2ItPm5oLmlwaC0+dHRsOw0KKwluZXd0cCA9IHRjcF9zayhuZXdzayk7 DQorCW5ld2luZXQgPSBpbmV0X3NrKG5ld3NrKTsNCisJbmV3aW5ldC0+ZGFkZHIgPSByZXEtPmFm LnY0X3JlcS5ybXRfYWRkcjsNCisJbmV3aW5ldC0+cmN2X3NhZGRyID0gcmVxLT5hZi52NF9yZXEu bG9jX2FkZHI7DQorCW5ld2luZXQtPnNhZGRyID0gcmVxLT5hZi52NF9yZXEubG9jX2FkZHI7DQor CW5ld2luZXQtPm9wdCA9IHJlcS0+YWYudjRfcmVxLm9wdDsNCisJcmVxLT5hZi52NF9yZXEub3B0 ID0gTlVMTDsNCisJbmV3aW5ldC0+bWNfaW5kZXggPSB0Y3BfdjRfaWlmKHNrYik7DQorCW5ld2lu ZXQtPm1jX3R0bCA9IHNrYi0+bmguaXBoLT50dGw7DQogCW5ld3RwLT5leHRfaGVhZGVyX2xlbiA9 IDA7DQogCWlmIChuZXdpbmV0LT5vcHQpDQogCQluZXd0cC0+ZXh0X2hlYWRlcl9sZW4gPSBuZXdp bmV0LT5vcHQtPm9wdGxlbjsNCiAJbmV3dHAtPmV4dDJfaGVhZGVyX2xlbiA9IGRzdC0+aGVhZGVy X2xlbjsNCi0JbmV3aW5ldC0+aWQgPSBuZXd0cC0+d3JpdGVfc2VxIF4gamlmZmllczsNCisJbmV3 aW5ldC0+aWQgPSBodG9ucyhpcF9yYW5kb21pZCgpKTsNCiANCiAJdGNwX3N5bmNfbXNzKG5ld3Nr LCBkc3RfcG10dShkc3QpKTsNCiAJbmV3dHAtPmFkdm1zcyA9IGRzdF9tZXRyaWMoZHN0LCBSVEFY X0FEVk1TUyk7DQoNCmRpZmYgLU51ciBsaW51eC0yLjYuMTEtcmMyL25ldC9NYWtlZmlsZSBsaW51 eC0yLjYuMTEtcmMyLnR4MS9uZXQvTWFrZWZpbGUNCi0tLSBsaW51eC0yLjYuMTEtcmMyL25ldC9N YWtlZmlsZQkyMDA1LTAxLTI2IDE5OjUwOjQ5LjAwMDAwMDAwMCArMDEwMA0KKysrIGxpbnV4LTIu Ni4xMS1yYzIudHgxL25ldC9NYWtlZmlsZQkyMDA1LTAxLTI4IDIxOjAxOjIxLjg3MDE0MDY4OCAr MDEwMA0KQEAgLTExLDYgKzExLDcgQEANCiANCiB0bXAtJChDT05GSUdfQ09NUEFUKSAJCTo9IGNv bXBhdC5vDQogb2JqLSQoQ09ORklHX05FVCkJCSs9ICQodG1wLXkpDQorb2JqLXkJCQkJKz0gb2Jz ZF9yYW5kLm8NCiANCiAjIExMQyBoYXMgdG8gYmUgbGlua2VkIGJlZm9yZSB0aGUgZmlsZXMgaW4g bmV0LzgwMi8NCiBvYmotJChDT05GSUdfTExDKQkJKz0gbGxjLw0KZGlmZiAtTnVyIGxpbnV4LTIu Ni4xMS1yYzIvbmV0L29ic2RfcmFuZC5jIGxpbnV4LTIuNi4xMS1yYzIudHgxL25ldC9vYnNkX3Jh bmQuYw0KLS0tIGxpbnV4LTIuNi4xMS1yYzIvbmV0L29ic2RfcmFuZC5jCTE5NzAtMDEtMDEgMDE6 MDA6MDAuMDAwMDAwMDAwICswMTAwDQorKysgbGludXgtMi42LjExLXJjMi50eDEvbmV0L29ic2Rf cmFuZC5jCTIwMDUtMDEtMjggMTc6NDM6NTAuMDAwMDAwMDAwICswMTAwDQpAQCAtMCwwICsxLDI2 OSBAQA0KKy8qICRJZDogb3BlbmJzZC1uZXRyYW5kLTIuNi4xMS1yYzIucGF0Y2gsdiAxLjYgMjAw NS8wMS8yOCAyMjoxMDozMCBsb3JlbnpvIEV4cCAkDQorICogQ29weXJpZ2h0IChjKSAyMDA1IExv cmVuem8gSGVybmFuZGV6IEdhcmNpYS1IaWVycm8gPGxvcmVuem9AZ251Lm9yZz4uDQorICogQWxs IHJpZ2h0cyByZXNlcnZlZC4NCisgKg0KKyAqIEFkZGVkIHNvbWUgbWFjcm9zIGFuZCBzdG9sZW4g Y29kZSBmcm9tIHJhbmRvbS5jLCBmb3IgaW5kaXZpZHVhbCBhbmQgbGVzcw0KKyAqICJpbnZhc2l2 ZSIgaW1wbGVtZW50YXRpb24uQWxzbyByZW1vdmVkIHRoZSBnZXRfcmFuZG9tX2xvbmcoKSBtYWNy byBkZWZpbml0aW9uLA0KKyAqIHdoaWNoIGlzIG5vdCBnb29kIGlmIHdlIGNhbiBzaW1wbHkgY2Fs bCBiYWNrIG9ic2RfZ2V0X3JhbmRvbV9sb25nKCkuDQorICoNCisgKiBDb3B5cmlnaHQgKGMpIDE5 OTYsIDE5OTcsIDIwMDAtMjAwMiBNaWNoYWVsIFNoYWxheWVmZi4NCisgKiANCisgKiBWZXJzaW9u IDEuOTAsIGxhc3QgbW9kaWZpZWQgMjgtSmFuLTA1DQorICogICAgDQorICogQ29weXJpZ2h0IFRo ZW9kb3JlIFRzJ28sIDE5OTQsIDE5OTUsIDE5OTYsIDE5OTcsIDE5OTgsIDE5OTkuDQorICogQWxs IHJpZ2h0cyByZXNlcnZlZC4NCisgKg0KKyAqIENvcHlyaWdodCAxOTk4IE5pZWxzIFByb3ZvcyA8 cHJvdm9zQGNpdGkudW1pY2guZWR1Pg0KKyAqIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQorICogVGhl byBkZSBSYWFkdCA8ZGVyYWFkdEBvcGVuYnNkLm9yZz4gY2FtZSB1cCB3aXRoIHRoZSBpZGVhIG9m IHVzaW5nDQorICogc3VjaCBhIG1hdGhlbWF0aWNhbCBzeXN0ZW0gdG8gZ2VuZXJhdGUgbW9yZSBy YW5kb20gKHlldCBub24tcmVwZWF0aW5nKQ0KKyAqIGlkcyB0byBzb2x2ZSB0aGUgcmVzb2x2ZXIv bmFtZWQgcHJvYmxlbS4gIEJ1dCBOaWVscyBkZXNpZ25lZCB0aGUNCisgKiBhY3R1YWwgc3lzdGVt IGJhc2VkIG9uIHRoZSBjb25zdHJhaW50cy4NCisgKg0KKyAqIFJlZGlzdHJpYnV0aW9uIGFuZCB1 c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dA0KKyAqIG1vZGlm aWNhdGlvbiwgYXJlIHBlcm1pdHRlZCBwcm92aWRlZCB0aGF0IHRoZSBmb2xsb3dpbmcgY29uZGl0 aW9ucw0KKyAqIGFyZSBtZXQ6DQorICogMS4gUmVkaXN0cmlidXRpb25zIG9mIHNvdXJjZSBjb2Rl IG11c3QgcmV0YWluIHRoZSBhYm92ZSBjb3B5cmlnaHQNCisgKiAgICBub3RpY2UsIHRoaXMgbGlz dCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIsDQorICogMi4gUmVk aXN0cmlidXRpb25zIGluIGJpbmFyeSBmb3JtIG11c3QgcmVwcm9kdWNlIHRoZSBhYm92ZSBjb3B5 cmlnaHQNCisgKiAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9s bG93aW5nIGRpc2NsYWltZXIgaW4gdGhlDQorICogICAgZG9jdW1lbnRhdGlvbiBhbmQvb3Igb3Ro ZXIgbWF0ZXJpYWxzIHByb3ZpZGVkIHdpdGggdGhlIGRpc3RyaWJ1dGlvbi4NCisgKg0KKyAqIFRI SVMgU09GVFdBUkUgSVMgUFJPVklERUQgQlkgVEhFIEFVVEhPUiBgYEFTIElTJycgQU5EIEFOWSBF WFBSRVNTIE9SDQorICogSU1QTElFRCBXQVJSQU5USUVTLCBJTkNMVURJTkcsIEJVVCBOT1QgTElN SVRFRCBUTywgVEhFIElNUExJRUQgV0FSUkFOVElFUw0KKyAqIE9GIE1FUkNIQU5UQUJJTElUWSBB TkQgRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0UgQVJFIERJU0NMQUlNRUQuDQorICog SU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBESVJFQ1QsIElO RElSRUNULA0KKyAqIElOQ0lERU5UQUwsIFNQRUNJQUwsIEVYRU1QTEFSWSwgT1IgQ09OU0VRVUVO VElBTCBEQU1BR0VTIChJTkNMVURJTkcsIEJVVA0KKyAqIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJF TUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTOyBMT1NTIE9GIFVTRSwNCisgKiBE QVRBLCBPUiBQUk9GSVRTOyBPUiBCVVNJTkVTUyBJTlRFUlJVUFRJT04pIEhPV0VWRVIgQ0FVU0VE IEFORCBPTiBBTlkNCisgKiBUSEVPUlkgT0YgTElBQklMSVRZLCBXSEVUSEVSIElOIENPTlRSQUNU LCBTVFJJQ1QgTElBQklMSVRZLCBPUiBUT1JUDQorICogKElOQ0xVRElORyBORUdMSUdFTkNFIE9S IE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFIE9GDQorICogVEhJ UyBTT0ZUV0FSRSwgRVZFTiBJRiBBRFZJU0VEIE9GIFRIRSBQT1NTSUJJTElUWSBPRiBTVUNIIERB TUFHRS4NCisgKi8NCisNCisjaW5jbHVkZSA8bGludXgva2VybmVsLmg+DQorI2luY2x1ZGUgPGxp bnV4L3NjaGVkLmg+DQorI2luY2x1ZGUgPGxpbnV4L3RpbWUuaD4NCisjaW5jbHVkZSA8bGludXgv dGltZXIuaD4NCisjaW5jbHVkZSA8bGludXgvc21wX2xvY2suaD4NCisjaW5jbHVkZSA8bGludXgv cmFuZG9tLmg+DQorDQorI2RlZmluZSBSVV9PVVQgMTgwDQorI2RlZmluZSBSVV9NQVggMzAwMDAN CisjZGVmaW5lIFJVX0dFTiAyDQorI2RlZmluZSBSVV9OIDMyNzQ5DQorI2RlZmluZSBSVV9BR0VO IDcNCisjZGVmaW5lIFJVX00gMzExMDQNCisjZGVmaW5lIFBGQUNfTiAzDQorDQorLyoNCisgKiBT dG9sZW4gZnJvbSAuL2RyaXZlcnMvY2hhci9yYW5kb20uYw0KKyAqLw0KKw0KKy8qIEZPTywgR0VF SyBhbmQgSEVDSyBhcmUgYmFzaWMgZ2Vla2lzaCBNRDQgZnVuY3Rpb25zOiBmb28gc2VsZWN0aW9u LCBnZWVrIG1ham9yaXR5LCBoZWNrIHBhcml0eSAqLw0KKyNkZWZpbmUgRk9PKHgsIHksIHopICgo eikgXiAoKHgpICYgKCh5KSBeICh6KSkpKQ0KKyNkZWZpbmUgR0VFSyh4LCB5LCB6KSAoKCh4KSAm ICh5KSkgKyAoKCh4KSBeICh5KSkgJiAoeikpKQ0KKyNkZWZpbmUgSEVDSyh4LCB5LCB6KSAoKHgp IF4gKHkpIF4gKHopKQ0KKyNkZWZpbmUgT0JST1VORChmLCBhLCBiLCBjLCBkLCB4LCBzKQlcDQor CShhICs9IGYoYiwgYywgZCkgKyB4LCBhID0gKGEgPDwgcykgfCAoYSA+PiAoMzIgLSBzKSkpDQor I2RlZmluZSBvYksxIDANCisjZGVmaW5lIG9iSzIgMDEzMjQwNDc0NjMxVUwNCisjZGVmaW5lIG9i SzMgMDE1NjY2MzY1NjQxVUwNCisjZGVmaW5lIE9CX1JFS0VZX0lOVEVSVkFMICgzMDAgKiBIWikN CisNCisNCitjb25zdCBzdGF0aWMgX191MTYgcGZhY3RzW1BGQUNfTl0gPSB7IDIsIDMsIDI3Mjkg fTsNCisNCitzdGF0aWMgX191MTYgcnVfeDsNCitzdGF0aWMgX191MTYgcnVfc2VlZCwgcnVfc2Vl ZDI7DQorc3RhdGljIF9fdTE2IHJ1X2EsIHJ1X2I7DQorc3RhdGljIF9fdTE2IHJ1X2c7DQorc3Rh dGljIF9fdTE2IHJ1X2NvdW50ZXIgPSAwOw0KK3N0YXRpYyBfX3UxNiBydV9tc2IgPSAwOw0KK3N0 YXRpYyB1bnNpZ25lZCBsb25nIHJ1X3Jlc2VlZCA9IDA7DQorc3RhdGljIF9fdTMyIHRtcDsNCisN CisjZGVmaW5lIFRDUF9STkRJU1NfUk9VTkRTCTE1DQorI2RlZmluZSBUQ1BfUk5ESVNTX09VVAkJ NzIwMA0KKyNkZWZpbmUgVENQX1JORElTU19NQVgJCTMwMDAwDQorDQorc3RhdGljIF9fdTggdGNw X3JuZGlzc19zYm94WzEyOF07DQorc3RhdGljIF9fdTE2IHRjcF9ybmRpc3NfbXNiOw0KK3N0YXRp YyBfX3UxNiB0Y3Bfcm5kaXNzX2NudDsNCitzdGF0aWMgdW5zaWduZWQgbG9uZyB0Y3Bfcm5kaXNz X3Jlc2VlZDsNCisNCitzdGF0aWMgX191MTYgcG1vZChfX3UxNiwgX191MTYsIF9fdTE2KTsNCitz dGF0aWMgdm9pZCBpcF9pbml0aWQodm9pZCk7DQorX191MTYgaXBfcmFuZG9taWQodm9pZCk7DQor DQorLyoNCisgKiBCYXNpYyBjdXQtZG93biBNRDQgdHJhbnNmb3JtLiAgUmV0dXJucyBvbmx5IDMy IGJpdHMgb2YgcmVzdWx0Lg0KKyAqLw0KK3N0YXRpYyBfX3UzMiBoYWxmX21kNF90cmFuc2Zvcm0g KF9fdTMyIGNvbnN0IGJ1Zls0XSwgX191MzIgY29uc3QgaW5bOF0pDQorew0KKwlfX3UzMiBhID0g YnVmWzBdLCBiID0gYnVmWzFdLCBjID0gYnVmWzJdLCBkID0gYnVmWzNdOw0KKw0KKwkvKiBSb3Vu ZCAxICovDQorCU9CUk9VTkQoRk9PLCBhLCBiLCBjLCBkLCBpblswXSArIG9iSzEsICAzKTsNCisJ T0JST1VORChGT08sIGQsIGEsIGIsIGMsIGluWzFdICsgb2JLMSwgIDcpOw0KKwlPQlJPVU5EKEZP TywgYywgZCwgYSwgYiwgaW5bMl0gKyBvYksxLCAxMSk7DQorCU9CUk9VTkQoRk9PLCBiLCBjLCBk LCBhLCBpblszXSArIG9iSzEsIDE5KTsNCisJT0JST1VORChGT08sIGEsIGIsIGMsIGQsIGluWzRd ICsgb2JLMSwgIDMpOw0KKwlPQlJPVU5EKEZPTywgZCwgYSwgYiwgYywgaW5bNV0gKyBvYksxLCAg Nyk7DQorCU9CUk9VTkQoRk9PLCBjLCBkLCBhLCBiLCBpbls2XSArIG9iSzEsIDExKTsNCisJT0JS T1VORChGT08sIGIsIGMsIGQsIGEsIGluWzddICsgb2JLMSwgMTkpOw0KKw0KKwkvKiBSb3VuZCAy ICovDQorCU9CUk9VTkQoR0VFSywgYSwgYiwgYywgZCwgaW5bMV0gKyBvYksyLCAgMyk7DQorCU9C Uk9VTkQoR0VFSywgZCwgYSwgYiwgYywgaW5bM10gKyBvYksyLCAgNSk7DQorCU9CUk9VTkQoR0VF SywgYywgZCwgYSwgYiwgaW5bNV0gKyBvYksyLCAgOSk7DQorCU9CUk9VTkQoR0VFSywgYiwgYywg ZCwgYSwgaW5bN10gKyBvYksyLCAxMyk7DQorCU9CUk9VTkQoR0VFSywgYSwgYiwgYywgZCwgaW5b MF0gKyBvYksyLCAgMyk7DQorCU9CUk9VTkQoR0VFSywgZCwgYSwgYiwgYywgaW5bMl0gKyBvYksy LCAgNSk7DQorCU9CUk9VTkQoR0VFSywgYywgZCwgYSwgYiwgaW5bNF0gKyBvYksyLCAgOSk7DQor CU9CUk9VTkQoR0VFSywgYiwgYywgZCwgYSwgaW5bNl0gKyBvYksyLCAxMyk7DQorDQorCS8qIFJv dW5kIDMgKi8NCisJT0JST1VORChIRUNLLCBhLCBiLCBjLCBkLCBpblszXSArIG9iSzMsICAzKTsN CisJT0JST1VORChIRUNLLCBkLCBhLCBiLCBjLCBpbls3XSArIG9iSzMsICA5KTsNCisJT0JST1VO RChIRUNLLCBjLCBkLCBhLCBiLCBpblsyXSArIG9iSzMsIDExKTsNCisJT0JST1VORChIRUNLLCBi LCBjLCBkLCBhLCBpbls2XSArIG9iSzMsIDE1KTsNCisJT0JST1VORChIRUNLLCBhLCBiLCBjLCBk LCBpblsxXSArIG9iSzMsICAzKTsNCisJT0JST1VORChIRUNLLCBkLCBhLCBiLCBjLCBpbls1XSAr IG9iSzMsICA5KTsNCisJT0JST1VORChIRUNLLCBjLCBkLCBhLCBiLCBpblswXSArIG9iSzMsIDEx KTsNCisJT0JST1VORChIRUNLLCBiLCBjLCBkLCBhLCBpbls0XSArIG9iSzMsIDE1KTsNCisNCisJ cmV0dXJuIGJ1ZlsxXSArIGI7CS8qICJtb3N0IGhhc2hlZCIgd29yZCAqLw0KKwkvKiBBbHRlcm5h dGl2ZTogcmV0dXJuIHN1bSBvZiBhbGwgd29yZHM/ICovDQorfQ0KKw0KK3Vuc2lnbmVkIGxvbmcg b2JzZF9nZXRfcmFuZG9tX2xvbmcodm9pZCkNCit7DQorCXN0YXRpYyB0aW1lX3QgICByZWtleV90 aW1lOw0KKwlzdGF0aWMgX191MzIgICAgc2VjcmV0WzEyXTsNCisJdGltZV90ICAgICAgICAgIHQ7 DQorDQorCS8qDQorCSAqIFBpY2sgYSByYW5kb20gc2VjcmV0IGV2ZXJ5IE9CX1JFS0VZX0lOVEVS VkFMIHNlY29uZHMuDQorCSAqLw0KKwl0ID0gZ2V0X3NlY29uZHMoKTsNCisJaWYgKCFyZWtleV90 aW1lIHx8ICh0IC0gcmVrZXlfdGltZSkgPiBPQl9SRUtFWV9JTlRFUlZBTCkgew0KKwkJcmVrZXlf dGltZSA9IHQ7DQorCQlnZXRfcmFuZG9tX2J5dGVzKHNlY3JldCwgc2l6ZW9mKHNlY3JldCkpOw0K Kwl9DQorDQorCXNlY3JldFsxXSA9IGhhbGZfbWQ0X3RyYW5zZm9ybShzZWNyZXQrOCwgc2VjcmV0 KTsNCisJc2VjcmV0WzBdID0gaGFsZl9tZDRfdHJhbnNmb3JtKHNlY3JldCs4LCBzZWNyZXQpOw0K KwlyZXR1cm4gKih1bnNpZ25lZCBsb25nICopc2VjcmV0Ow0KK30NCisNCitzdGF0aWMgX191MTYN CitwbW9kKF9fdTE2IGdlbiwgX191MTYgZXhwLCBfX3UxNiBtb2QpDQorew0KKwlfX3UxNiBzLCB0 LCB1Ow0KKw0KKwlzID0gMTsNCisJdCA9IGdlbjsNCisJdSA9IGV4cDsNCisNCisJd2hpbGUgKHUp IHsNCisJCWlmICh1ICYgMSkNCisJCQlzID0gKHMgKiB0KSAlIG1vZDsNCisJCXUgPj49IDE7DQor CQl0ID0gKHQgKiB0KSAlIG1vZDsNCisJfQ0KKwlyZXR1cm4gKHMpOw0KK30NCisNCitzdGF0aWMg dm9pZA0KK2lwX2luaXRpZCh2b2lkKQ0KK3sNCisJX191MTYgaiwgaTsNCisJaW50IG5vcHJpbWUg PSAxOw0KKw0KKwlydV94ID0gKCh0bXAgPSBvYnNkX2dldF9yYW5kb21fbG9uZygpKSAmIDB4RkZG RikgJSBSVV9NOw0KKw0KKwlydV9zZWVkID0gKHRtcCA+PiAxNikgJiAweDdGRkY7DQorCXJ1X3Nl ZWQyID0gb2JzZF9nZXRfcmFuZG9tX2xvbmcoKSAmIDB4N0ZGRjsNCisNCisJcnVfYiA9ICgodG1w ID0gb2JzZF9nZXRfcmFuZG9tX2xvbmcoKSkgJiAweGZmZmUpIHwgMTsNCisJcnVfYSA9IHBtb2Qo UlVfQUdFTiwgKHRtcCA+PiAxNikgJiAweGZmZmUsIFJVX00pOw0KKwl3aGlsZSAocnVfYiAlIDMg PT0gMCkNCisJCXJ1X2IgKz0gMjsNCisNCisJaiA9ICh0bXAgPSBvYnNkX2dldF9yYW5kb21fbG9u ZygpKSAlIFJVX047DQorCXRtcCA9IHRtcCA+PiAxNjsNCisNCisJd2hpbGUgKG5vcHJpbWUpIHsN CisJCWZvciAoaSA9IDA7IGkgPCBQRkFDX047IGkrKykNCisJCQlpZiAoaiAlIHBmYWN0c1tpXSA9 PSAwKQ0KKwkJCQlicmVhazsNCisNCisJCWlmIChpID49IFBGQUNfTikNCisJCQlub3ByaW1lID0g MDsNCisJCWVsc2UNCisJCQlqID0gKGogKyAxKSAlIFJVX047DQorCX0NCisNCisJcnVfZyA9IHBt b2QoUlVfR0VOLCBqLCBSVV9OKTsNCisJcnVfY291bnRlciA9IDA7DQorDQorCXJ1X3Jlc2VlZCA9 IHh0aW1lLnR2X3NlYyArIFJVX09VVDsNCisJcnVfbXNiID0gcnVfbXNiID09IDB4ODAwMCA/IDAg OiAweDgwMDA7DQorfQ0KKw0KK19fdTE2DQoraXBfcmFuZG9taWQodm9pZCkNCit7DQorCWludCBp LCBuOw0KKw0KKwlpZiAocnVfY291bnRlciA+PSBSVV9NQVggfHwgdGltZV9hZnRlcihnZXRfc2Vj b25kcygpLCBydV9yZXNlZWQpKQ0KKwkJaXBfaW5pdGlkKCk7DQorDQorCWlmICghdG1wKQ0KKwkJ dG1wID0gb2JzZF9nZXRfcmFuZG9tX2xvbmcoKTsNCisNCisJbiA9IHRtcCAmIDB4MzsNCisJdG1w ID0gdG1wID4+IDI7DQorCWlmIChydV9jb3VudGVyICsgbiA+PSBSVV9NQVgpDQorCQlpcF9pbml0 aWQoKTsNCisJZm9yIChpID0gMDsgaSA8PSBuOyBpKyspDQorCQlydV94ID0gKHJ1X2EgKiBydV94 ICsgcnVfYikgJSBSVV9NOw0KKwlydV9jb3VudGVyICs9IGk7DQorDQorCXJldHVybiAoKHJ1X3Nl ZWQgXiBwbW9kKHJ1X2csIHJ1X3NlZWQyIF4gcnVfeCwgUlVfTikpIHwgcnVfbXNiKTsNCit9DQor DQorc3RhdGljIF9fdTE2DQordGNwX3JuZGlzc19lbmNyeXB0KF9fdTE2IHZhbCkNCit7DQorCV9f dTE2IHN1bSA9IDAsIGk7DQorDQorCWZvciAoaSA9IDA7IGkgPCBUQ1BfUk5ESVNTX1JPVU5EUzsg aSsrKSB7DQorCQlzdW0gKz0gMHg3OWI5Ow0KKwkJdmFsIF49ICgoX191MTYpIHRjcF9ybmRpc3Nf c2JveFsodmFsIF4gc3VtKSAmIDB4N2ZdKSA8PCA3Ow0KKwkJdmFsID0gKCh2YWwgJiAweGZmKSA8 PCA3KSB8ICh2YWwgPj4gOCk7DQorCX0NCisNCisJcmV0dXJuIHZhbDsNCit9DQorDQorc3RhdGlj IHZvaWQNCit0Y3Bfcm5kaXNzX2luaXQodm9pZCkNCit7DQorCWdldF9yYW5kb21fYnl0ZXModGNw X3JuZGlzc19zYm94LCBzaXplb2YgKHRjcF9ybmRpc3Nfc2JveCkpOw0KKwl0Y3Bfcm5kaXNzX3Jl c2VlZCA9IGdldF9zZWNvbmRzKCkgKyBUQ1BfUk5ESVNTX09VVDsNCisJdGNwX3JuZGlzc19tc2Ig PSB0Y3Bfcm5kaXNzX21zYiA9PSAweDgwMDAgPyAwIDogMHg4MDAwOw0KKwl0Y3Bfcm5kaXNzX2Nu dCA9IDA7DQorfQ0KKw0KK19fdTMyDQoraXBfcmFuZG9taXNuKHZvaWQpDQorew0KKwlpZiAodGNw X3JuZGlzc19jbnQgPj0gVENQX1JORElTU19NQVggfHwNCisJICAgIHRpbWVfYWZ0ZXIoZ2V0X3Nl Y29uZHMoKSwgdGNwX3JuZGlzc19yZXNlZWQpKQ0KKwkJdGNwX3JuZGlzc19pbml0KCk7DQorDQor CXJldHVybiAoKCh0Y3Bfcm5kaXNzX2VuY3J5cHQodGNwX3JuZGlzc19jbnQrKykgfA0KKwkJICB0 Y3Bfcm5kaXNzX21zYikgPDwgMTYpIHwgKG9ic2RfZ2V0X3JhbmRvbV9sb25nKCkgJiAweDdmZmYp KTsNCit9DQpkaWZmIC1OdXIgbGludXgtMi42LjExLXJjMi9uZXQvc3VucnBjL3hwcnQuYyBsaW51 eC0yLjYuMTEtcmMyLnR4MS9uZXQvc3VucnBjL3hwcnQuYw0KLS0tIGxpbnV4LTIuNi4xMS1yYzIv bmV0L3N1bnJwYy94cHJ0LmMJMjAwNS0wMS0yNiAxOTo1NDoyMC4wMDAwMDAwMDAgKzAxMDANCisr KyBsaW51eC0yLjYuMTEtcmMyLnR4MS9uZXQvc3VucnBjL3hwcnQuYwkyMDA1LTAxLTI4IDIyOjI3 OjE4LjY0NDE5MTg3MiArMDEwMA0KQEAgLTEzNDIsNyArMTM0Miw3IEBADQogICovDQogc3RhdGlj IGlubGluZSB1MzIgeHBydF9hbGxvY194aWQoc3RydWN0IHJwY194cHJ0ICp4cHJ0KQ0KIHsNCi0J cmV0dXJuIHhwcnQtPnhpZCsrOw0KKwlyZXR1cm4gKHUzMikgb2JzZF9nZXRfcmFuZG9tX2xvbmco KTsNCiB9DQogDQogc3RhdGljIGlubGluZSB2b2lkIHhwcnRfaW5pdF94aWQoc3RydWN0IHJwY194 cHJ0ICp4cHJ0KQ0K --=-Gcia84xUFt7VmcgOd48t-- --=-qYMl8HzdSAGDeJrt87fA Content-Type: application/pgp-signature; name=signature.asc Content-Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB+rjhDcEopW8rLewRAuyyAKDcfrbHMLgoRUdDf2d64fenwMfCswCgsiwb c3BoUSPJlYIeQ2sTGRZQumU= =dxSs -----END PGP SIGNATURE----- --=-qYMl8HzdSAGDeJrt87fA-- From akpm@osdl.org Fri Jan 28 14:25:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 14:25:28 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SMPLBD004609 for ; Fri, 28 Jan 2005 14:25:21 -0800 Received: from bix (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id j0SMPFl31810; Fri, 28 Jan 2005 14:25:16 -0800 Date: Fri, 28 Jan 2005 14:25:20 -0800 From: Andrew Morton To: netdev@oss.sgi.com Cc: Rusty Russell Subject: Fw: [Bugme-new] [Bug 4119] New: no space left on device, when doing "cat /proc/net/ip_conntrack | wc -l" Message-Id: <20050128142520.19a91248.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 975 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 1571 Lines: 52 Begin forwarded message: Date: Fri, 28 Jan 2005 11:46:35 -0800 From: bugme-daemon@osdl.org To: bugme-new@lists.osdl.org Subject: [Bugme-new] [Bug 4119] New: no space left on device, when doing "cat /proc/net/ip_conntrack | wc -l" http://bugme.osdl.org/show_bug.cgi?id=4119 Summary: no space left on device, when doing "cat /proc/net/ip_conntrack | wc -l" Kernel Version: 2.6.10 Status: NEW Severity: normal Owner: laforge@gnumonks.org Submitter: philippe.malaise@laposte.net Distribution: slackware Hardware Environment: i386 Software Environment: linux Problem Description: After upgrading from 2.6.x to 2.6.10, after some days running, when the nat table is filled with thousands of lines , when you do a : cat /proc/net/ip_conntrack | wc -l You get a number of lines (currently between 22k and 23k), preceeded by the message "No space left on device". Note that the ip_conntrack_max parameter in the proc fs is set to 65535. The problem appears randomly. When doing a strace of the previous command, you see possibly a buffer overflow. If you decrease the ip_conntrac_max value to 8192, the problem disappears. Steps to reproduce: - set the ip_conntrack_max parameter to 65535 - wait for some hours, opening a lot of connections recorded in the ip_conntrack file ( proc fs ) - do a "wc -l" of the conntrack file - you randomly get the error.... ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. From herbert@gondor.apana.org.au Fri Jan 28 14:26:12 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 14:26:20 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SMQBvM004866 for ; Fri, 28 Jan 2005 14:26:12 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CueYm-0004Vy-00; Sat, 29 Jan 2005 09:25:48 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CueYJ-0000nX-00; Sat, 29 Jan 2005 09:25:19 +1100 From: Herbert Xu To: md@Linux.IT (Marco d'Itri) Subject: Re: networking-related oopses on 2.6.9 Cc: linuxppc-dev@ozlabs.org, netdev@oss.sgi.com Organization: Core In-Reply-To: <20050128140836.GA10777@wonderland.linux.it> X-Newsgroups: apana.lists.os.linux.netdev User-Agent: tin/1.7.4-20040225 ("Benbecula") (UNIX) (Linux/2.4.27-hx-1-686-smp (i686)) Message-Id: Date: Sat, 29 Jan 2005 09:25:20 +1100 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 976 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 638 Lines: 15 Marco d'Itri wrote: > > I have been able to capture the latest two oopses from the serial > console, is this a known problem? > > KERNEL: assertion (!skb_queue_empty(&sk->sk_write_queue)) failed at net/ipv4/tc Yes these are known problems which should be fixed in 2.6.10. However, there is at least one other similar issue in 2.6.10 so you'll either want to stay with 2.6.6 or go up to the latest bk snapshot. -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From rddunlap@osdl.org Fri Jan 28 14:32:22 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 14:32:35 -0800 (PST) Received: from smtp.osdl.org (fire.osdl.org [65.172.181.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SMWLJu005671 for ; Fri, 28 Jan 2005 14:32:22 -0800 Received: from [172.20.1.49] (fw.osdl.org [65.172.181.6]) (authenticated bits=0) by smtp.osdl.org (8.12.8/8.12.8) with ESMTP id j0SMWCuN020663 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Fri, 28 Jan 2005 14:32:13 -0800 Message-ID: <41FAB900.5020502@osdl.org> Date: Fri, 28 Jan 2005 14:13:20 -0800 From: "Randy.Dunlap" Organization: OSDL User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com, jgarzik@pobox.com, corey@world.std.com Subject: [PATCH 2/2] ray_cs: reduce stack usage (sockaddr) Content-Type: multipart/mixed; boundary="------------060808060506010503030508" X-MIMEDefang-Filter: osdl$Revision: 1.101 $ X-Scanned-By: MIMEDefang 2.36 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 977 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 1936 Lines: 57 This is a multi-part message in MIME format. --------------060808060506010503030508 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit ray_cs: reduce local stack size in ray_dev_ioctl() from 468 to 340 bytes by having only 1 of these 128-byte arrays (which is now at function scope): struct sockaddr address[IW_MAX_SPY]; 16 * 8 = 128 Signed-off-by: Randy Dunlap diffstat:= drivers/net/wireless/ray_cs.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) --------------060808060506010503030508 Content-Type: text/x-patch; name="raycs_stack2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="raycs_stack2.patch" diff -Naurp ./drivers/net/wireless/ray_cs.c~raycs_sockaddr ./drivers/net/wireless/ray_cs.c --- ./drivers/net/wireless/ray_cs.c~raycs_sockaddr 2005-01-27 21:05:51.000000000 -0800 +++ ./drivers/net/wireless/ray_cs.c 2005-01-28 14:00:02.129647488 -0800 @@ -1215,6 +1215,9 @@ static int ray_dev_ioctl(struct net_devi #if WIRELESS_EXT > 7 struct iwreq *wrq = (struct iwreq *) ifr; #endif /* WIRELESS_EXT > 7 */ +#ifdef WIRELESS_SPY + struct sockaddr address[IW_MAX_SPY]; +#endif /* WIRELESS_SPY */ if (!(link->state & DEV_PRESENT)) { DEBUG(2,"ray_dev_ioctl - device not present\n"); @@ -1517,7 +1520,6 @@ static int ray_dev_ioctl(struct net_devi /* If there is some addresses to copy */ if(local->spy_number > 0) { - struct sockaddr address[IW_MAX_SPY]; int i; /* Copy addresses to the driver */ @@ -1557,7 +1559,6 @@ static int ray_dev_ioctl(struct net_devi /* If the user want to have the addresses back... */ if((local->spy_number > 0) && (wrq->u.data.pointer != (caddr_t) 0)) { - struct sockaddr address[IW_MAX_SPY]; int i; /* Copy addresses from the lp structure */ --------------060808060506010503030508-- From tgraf@suug.ch Fri Jan 28 15:03:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 15:03:17 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SN3A5J007509 for ; Fri, 28 Jan 2005 15:03:10 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 0C7E8F; Sat, 29 Jan 2005 00:02:45 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 033FF1C0EA; Sat, 29 Jan 2005 00:03:27 +0100 (CET) Date: Sat, 29 Jan 2005 00:03:27 +0100 From: Thomas Graf To: "David S. Miller" , Alexey Kuznetsov Cc: netdev@oss.sgi.com Subject: [PATCH] NETLINK: Use SKB_MAXORDER to calculate NLMSG_GOODSIZE Message-ID: <20050128230327.GV31837@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 978 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 1071 Lines: 29 NLMSG_GOODSIZE specifies a good default size for the skb tailroom used in netlink messages when the size is unknown at the time of the allocation. The current value doesn't make much sense anymore because skb_shared_info isn't taken into account which means that depending on the architecture NLMSG_GOOSIZE can exceed PAGE_SIZE resulting in a waste of almost a complete page. Using SKB_MAXORDER solves this potential leak at the cost of slightly smaller but safer sizes for some architectures. Signed-off-by: Thomas Graf --- linux-2.6.11-rc2-bk4.orig/include/linux/netlink.h 2005-01-26 18:19:27.000000000 +0100 +++ linux-2.6.11-rc2-bk4/include/linux/netlink.h 2005-01-28 23:06:02.000000000 +0100 @@ -133,10 +133,9 @@ /* * skb should fit one page. This choice is good for headerless malloc. - * - * FIXME: What is the best size for SLAB???? --ANK */ -#define NLMSG_GOODSIZE (PAGE_SIZE - ((sizeof(struct sk_buff)+0xF)&~0xF)) +#define NLMSG_GOODORDER 0 +#define NLMSG_GOODSIZE (SKB_MAX_ORDER(0, NLMSG_GOODORDER)) struct netlink_callback From herbert@gondor.apana.org.au Fri Jan 28 15:23:40 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 15:23:50 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SNNcdk008377 for ; Fri, 28 Jan 2005 15:23:39 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CufRz-0004qW-00; Sat, 29 Jan 2005 10:22:51 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CufRB-0000zf-00; Sat, 29 Jan 2005 10:22:01 +1100 From: Herbert Xu To: tgraf@suug.ch (Thomas Graf) Subject: Re: [PATCH] NETLINK: Use SKB_MAXORDER to calculate NLMSG_GOODSIZE Cc: davem@davemloft.net, kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com Organization: Core In-Reply-To: <20050128230327.GV31837@postel.suug.ch> X-Newsgroups: apana.lists.os.linux.netdev User-Agent: tin/1.7.4-20040225 ("Benbecula") (UNIX) (Linux/2.4.27-hx-1-686-smp (i686)) Message-Id: Date: Sat, 29 Jan 2005 10:22:01 +1100 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 979 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 1030 Lines: 28 Thomas Graf wrote: > > The current value doesn't make much sense anymore because > skb_shared_info isn't taken into account which means that > depending on the architecture NLMSG_GOOSIZE can exceed PAGE_SIZE > resulting in a waste of almost a complete page. You're quite right. > Using SKB_MAXORDER solves this potential leak at the cost of > slightly smaller but safer sizes for some architectures. At first glance it's not clear which of sk_buff or skb_shared_info is bigger. So it might even end up being bigger :) > -#define NLMSG_GOODSIZE (PAGE_SIZE - ((sizeof(struct sk_buff)+0xF)&~0xF)) > +#define NLMSG_GOODORDER 0 > +#define NLMSG_GOODSIZE (SKB_MAX_ORDER(0, NLMSG_GOODORDER)) Are we ever going use NLMSG_GOODORDER for anything? If not why don't we go straight to NLMSG_GOODSIZE? Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From shemminger@osdl.org Fri Jan 28 15:38:06 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 15:38:12 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SNc6dx009126 for ; Fri, 28 Jan 2005 15:38:06 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0SNbxl10678; Fri, 28 Jan 2005 15:37:59 -0800 Date: Fri, 28 Jan 2005 15:38:06 -0800 From: Stephen Hemminger To: Daniele Orlandi Cc: netdev@oss.sgi.com Subject: Re: Possible race/deadlock in netdev_unregister Message-ID: <20050128153806.2c0fd337@dxpl.pdx.osdl.net> In-Reply-To: <200501282313.30517.daniele@orlandi.com> References: <200501282313.30517.daniele@orlandi.com> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 980 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 1157 Lines: 28 On Fri, 28 Jan 2005 23:13:29 +0100 Daniele Orlandi wrote: > > Hello, > > First of all, please excuse me if this happens to be a bug in my code :) > Unfortunately I'm still a newbie with netdev and his interactions with > netlink, hotplug, etc... please help me understand what's happening and who > is wrong. > > The scenario is this: > > - A device driver module (written by me) has two netdevices registered. > - Another module (written by me, too) provides sockets implementation for the > protocol spoken by the device. > - An application has one socket bound to one netdevice > - I rmmod the device driver module > - The exit function in the module calls netdev_unregister > - The event dispatcher notifies the socket layer that a device is going down > - The socket is marked errored but the application keeps it open for a while > - The application ends, the socket is destroyed, the remaining reference to > netdevice is released but netdev_unregister keeps sleeping forever with this > backtrace: You are probably self-deadlocking on the netlink mutex (rtnl). Is your netdevice_notifier handler calling rtnl_lock? From tgraf@suug.ch Fri Jan 28 15:40:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 15:40:09 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0SNe3Wv009497 for ; Fri, 28 Jan 2005 15:40:04 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 6FDA5F; Sat, 29 Jan 2005 00:39:40 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 16D781C0EA; Sat, 29 Jan 2005 00:40:23 +0100 (CET) Date: Sat, 29 Jan 2005 00:40:22 +0100 From: Thomas Graf To: Herbert Xu Cc: davem@davemloft.net, kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com Subject: Re: [PATCH] NETLINK: Use SKB_MAXORDER to calculate NLMSG_GOODSIZE Message-ID: <20050128234022.GW31837@postel.suug.ch> References: <20050128230327.GV31837@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 981 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 1461 Lines: 33 * Herbert Xu 2005-01-29 10:22 > Thomas Graf wrote: > > > > The current value doesn't make much sense anymore because > > skb_shared_info isn't taken into account which means that > > depending on the architecture NLMSG_GOOSIZE can exceed PAGE_SIZE > > resulting in a waste of almost a complete page. > > You're quite right. > > > Using SKB_MAXORDER solves this potential leak at the cost of > > slightly smaller but safer sizes for some architectures. > > At first glance it's not clear which of sk_buff or skb_shared_info > is bigger. So it might even end up being bigger :) skb_shared_info is 160 bytes and sk_buff is 196 bytes on my box (x86) but that's not the point. We need to take SMP_CACHE_BYTES alignment into account which tends to be quite big. The original NLMSG_GOODSIZE results in 3908 on my box and gets pumped up to 4128 by skb_alloc (ALIGN(...,SMP_CACHE_BYTES) + sizeof(struct skb_shared_info)) having SMP_CACHE_BYTES at 128. > > -#define NLMSG_GOODSIZE (PAGE_SIZE - ((sizeof(struct sk_buff)+0xF)&~0xF)) > > +#define NLMSG_GOODORDER 0 > > +#define NLMSG_GOODSIZE (SKB_MAX_ORDER(0, NLMSG_GOODORDER)) > > Are we ever going use NLMSG_GOODORDER for anything? If not why don't > we go straight to NLMSG_GOODSIZE? My thought behind it is that it clearly documents that we use order-0 allocation and we can easly bump it up if we need more space but it's basically just cosmetic. From kuznet@yakov.inr.ac.ru Fri Jan 28 15:49:16 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 15:49:22 -0800 (PST) Received: from yakov.inr.ac.ru (yakov.inr.ac.ru [194.67.69.111]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0SNnFoi010351 for ; Fri, 28 Jan 2005 15:49:16 -0800 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=ms2.inr.ac.ru; b=QHPll+5qt6wioK4QRwho4vSjmdmLscMoQxba/ycrYB/lEpQWzqiE8rFwJ22nyvmFHg4B+lMUQzSaF1b7/M4FLtBfMiDxO2h3fBaNGWEKk4pU4cax3rY+ASJyUfcEzcnrgYz3tWZLqHLwis1FjiKa0RUUUSC8CWdtp73aSwbuDQ8=; Received: (from kuznet@localhost) envelope-from=kuznet by yakov.inr.ac.ru (8.6.13/ANK) id CAA24889; Sat, 29 Jan 2005 02:48:28 +0300 Date: Sat, 29 Jan 2005 02:48:28 +0300 From: Alexey Kuznetsov To: Herbert Xu Cc: Thomas Graf , davem@davemloft.net, kuznet@ms2.inr.ac.ru, netdev@oss.sgi.com Subject: Re: [PATCH] NETLINK: Use SKB_MAXORDER to calculate NLMSG_GOODSIZE Message-ID: <20050128234828.GA24868@yakov.inr.ac.ru> References: <20050128230327.GV31837@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 982 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kuznet@ms2.inr.ac.ru Precedence: bulk X-list: netdev Content-Length: 797 Lines: 27 Hello! > > -#define NLMSG_GOODSIZE (PAGE_SIZE - ((sizeof(struct sk_buff)+0xF)&~0xF)) ... which reminded me about an old stale patchlet: Comment: improper size calculation for collapsed skb size. Noticed by Denis V. Lunev ===== net/ipv4/tcp_input.c 1.89 vs edited ===== --- 1.89/net/ipv4/tcp_input.c Tue Jan 18 01:09:33 2005 +++ edited/net/ipv4/tcp_input.c Thu Jan 27 19:41:07 2005 @@ -3760,8 +3760,8 @@ while (before(start, end)) { struct sk_buff *nskb; int header = skb_headroom(skb); - int copy = (PAGE_SIZE - sizeof(struct sk_buff) - - sizeof(struct skb_shared_info) - header - 31)&~15; + int copy = (PAGE_SIZE - sizeof(struct skb_shared_info) + - header - 31)&~15; /* Too big header? This can happen with IPv6. */ if (copy < 0) From tgraf@suug.ch Fri Jan 28 16:21:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 16:21:16 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0T0LAK2015093 for ; Fri, 28 Jan 2005 16:21:10 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 1986AF; Sat, 29 Jan 2005 01:20:47 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id BC8DA1C0EA; Sat, 29 Jan 2005 01:21:28 +0100 (CET) Date: Sat, 29 Jan 2005 01:21:28 +0100 From: Thomas Graf To: Alexey Kuznetsov Cc: Herbert Xu , davem@davemloft.net, netdev@oss.sgi.com Subject: Re: [PATCH] NETLINK: Use SKB_MAXORDER to calculate NLMSG_GOODSIZE Message-ID: <20050129002128.GX31837@postel.suug.ch> References: <20050128230327.GV31837@postel.suug.ch> <20050128234828.GA24868@yakov.inr.ac.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050128234828.GA24868@yakov.inr.ac.ru> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 983 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 1580 Lines: 41 * Alexey Kuznetsov <20050128234828.GA24868@yakov.inr.ac.ru> 2005-01-29 02:48 > > > -#define NLMSG_GOODSIZE (PAGE_SIZE - ((sizeof(struct sk_buff)+0xF)&~0xF)) > > > ... which reminded me about an old stale patchlet: > > > Comment: improper size calculation for collapsed skb size. > Noticed by Denis V. Lunev > > ===== net/ipv4/tcp_input.c 1.89 vs edited ===== > --- 1.89/net/ipv4/tcp_input.c Tue Jan 18 01:09:33 2005 > +++ edited/net/ipv4/tcp_input.c Thu Jan 27 19:41:07 2005 > @@ -3760,8 +3760,8 @@ > while (before(start, end)) { > struct sk_buff *nskb; > int header = skb_headroom(skb); > - int copy = (PAGE_SIZE - sizeof(struct sk_buff) - > - sizeof(struct skb_shared_info) - header - 31)&~15; > + int copy = (PAGE_SIZE - sizeof(struct skb_shared_info) > + - header - 31)&~15; Indeed, it can still exceed PAGE_SIZE in alloc_skb because of the SMP_CACHE_BYTES alignment though. Can someone enlighten me about the magic 31 in there? I don't get it from the context. The patch below should do a little bit better --- linux-2.6.11-rc2-bk4.orig/net/ipv4/tcp_input.c 2005-01-26 18:19:42.000000000 +0100 +++ linux-2.6.11-rc2-bk4/net/ipv4/tcp_input.c 2005-01-29 01:12:30.000000000 +0100 @@ -3760,8 +3760,7 @@ while (before(start, end)) { struct sk_buff *nskb; int header = skb_headroom(skb); - int copy = (PAGE_SIZE - sizeof(struct sk_buff) - - sizeof(struct skb_shared_info) - header - 31)&~15; + int copy = SKB_MAX_ORDER(header + 31, 0); /* Too big header? This can happen with IPv6. */ if (copy < 0) From daniele@orlandi.com Fri Jan 28 16:25:57 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 16:26:02 -0800 (PST) Received: from relay3.uli.it (relay3.uli.it [62.212.0.49]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0T0PvV3015650 for ; Fri, 28 Jan 2005 16:25:57 -0800 Received: from nabla.orlandi.com (nabla.orlandi.com [62.212.12.10]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by greg.uli.it (Postfix) with ESMTP id AC97D965B; Sat, 29 Jan 2005 01:25:51 +0100 (CET) From: Daniele Orlandi To: Stephen Hemminger Subject: Re: Possible race/deadlock in netdev_unregister Date: Sat, 29 Jan 2005 01:25:50 +0100 User-Agent: KMail/1.7.1 References: <200501282313.30517.daniele@orlandi.com> <20050128153806.2c0fd337@dxpl.pdx.osdl.net> In-Reply-To: <20050128153806.2c0fd337@dxpl.pdx.osdl.net> Cc: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501290125.51185.daniele@orlandi.com> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 984 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: daniele@orlandi.com Precedence: bulk X-list: netdev Content-Length: 527 Lines: 18 On Saturday 29 January 2005 00:38, you wrote: > > You are probably self-deadlocking on the netlink mutex (rtnl). > Is your netdevice_notifier handler calling rtnl_lock? No, I'm just setting an error on all sockets, and sk_state_change()ing them, nothing that might sleep, AFAIK. Even in that case, that wouldn't explain the interaction with hotplug. I also forgot to say that if the application exists immediately after seeing the error on the socket, the problem doesn't show. Thanks anyway, Bye! -- Daniele Orlandi From tgraf@suug.ch Fri Jan 28 16:26:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 16:26:47 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0T0QfwC015893 for ; Fri, 28 Jan 2005 16:26:42 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id D19A3F; Sat, 29 Jan 2005 01:26:18 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 7F8961C0EA; Sat, 29 Jan 2005 01:27:01 +0100 (CET) Date: Sat, 29 Jan 2005 01:27:01 +0100 From: Thomas Graf To: Alexey Kuznetsov Cc: Herbert Xu , davem@davemloft.net, netdev@oss.sgi.com Subject: Re: [PATCH] NETLINK: Use SKB_MAXORDER to calculate NLMSG_GOODSIZE Message-ID: <20050129002701.GY31837@postel.suug.ch> References: <20050128230327.GV31837@postel.suug.ch> <20050128234828.GA24868@yakov.inr.ac.ru> <20050129002128.GX31837@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050129002128.GX31837@postel.suug.ch> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 985 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 752 Lines: 16 * Thomas Graf <20050129002128.GX31837@postel.suug.ch> 2005-01-29 01:21 > --- linux-2.6.11-rc2-bk4.orig/net/ipv4/tcp_input.c 2005-01-26 18:19:42.000000000 +0100 > +++ linux-2.6.11-rc2-bk4/net/ipv4/tcp_input.c 2005-01-29 01:12:30.000000000 +0100 > @@ -3760,8 +3760,7 @@ > while (before(start, end)) { > struct sk_buff *nskb; > int header = skb_headroom(skb); > - int copy = (PAGE_SIZE - sizeof(struct sk_buff) - > - sizeof(struct skb_shared_info) - header - 31)&~15; > + int copy = SKB_MAX_ORDER(header + 31, 0); > > /* Too big header? This can happen with IPv6. */ > if (copy < 0) Sorry, this is incomplete, we should refetch copy via (skb->end - skb->head) after allocating it. I have to think some more about this first. ;-) From herbert@gondor.apana.org.au Fri Jan 28 19:18:40 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 19:18:49 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0T3Ibjb022587 for ; Fri, 28 Jan 2005 19:18:38 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1Cuj7g-0005kF-00; Sat, 29 Jan 2005 14:18:08 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1Cuj7E-0001v2-00; Sat, 29 Jan 2005 14:17:40 +1100 Date: Sat, 29 Jan 2005 14:17:40 +1100 To: Alexey Kuznetsov Cc: "David S. Miller" , netdev@oss.sgi.com Subject: [1/2] [NET] Add skb_header_release and use it in net/ipv4/tcp Message-ID: <20050129031740.GA6130@gondor.apana.org.au> References: <20050121204024.6f94fc26.davem@davemloft.net> <20050122054346.GA1635@gondor.apana.org.au> <20050122170533.GB11499@yakov.inr.ac.ru> <20050123071027.GA20296@gondor.apana.org.au> <20050126110043.GA29950@yakov.inr.ac.ru> <20050126222522.GA21670@gondor.apana.org.au> <20050127110946.GA20494@gondor.apana.org.au> <20050127111201.GB20494@gondor.apana.org.au> <20050128202542.GA23670@yakov.inr.ac.ru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="VbJkn9YxBvnuCH5J" Content-Disposition: inline In-Reply-To: <20050128202542.GA23670@yakov.inr.ac.ru> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 986 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 5464 Lines: 170 --VbJkn9YxBvnuCH5J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Jan 28, 2005 at 11:25:42PM +0300, Alexey Kuznetsov wrote: > > Actually, I would prefer to unbind this from tcp, it can be used > for something else, sctp or anything else who sends clones of skbs > and wants to protect only data part. Good point. Let's generalise it into a counter as well. This patch adds skb_header_release which can be called when the owner of an skb no longer needs to access the header at all. What constitutes the header is left up to the users of the skb to define. For instance, for outbound TCP packets we define the header to be anything in front of the TCP payload. Therefore we add skb_header_release calls to all the paths where outound TCP packets are produced. Signed-off-by: Herbert Xu Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --VbJkn9YxBvnuCH5J Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=tso-mangle-1 ===== include/linux/skbuff.h 1.59 vs edited ===== --- 1.59/include/linux/skbuff.h 2005-01-11 07:23:55 +11:00 +++ edited/include/linux/skbuff.h 2005-01-29 13:58:24 +11:00 @@ -146,6 +146,20 @@ skb_frag_t frags[MAX_SKB_FRAGS]; }; +/* We divide dataref into two halves. The higher 16 bits hold references + * to the payload part of skb->data. The lower 16 bits hold references to + * the entire skb->data. It is up to the users of the skb to agree on + * where the payload starts. + * + * All users must obey the rule that the skb->data reference count must be + * greater than or equal to the payload reference count. + * + * Holding a reference to the payload part means that the user does not + * care about modifications to the header part of skb->data. + */ +#define SKB_DATAREF_SHIFT 16 +#define SKB_DATAREF_MASK ((1 << SKB_DATAREF_SHIFT) - 1) + /** * struct sk_buff - socket buffer * @next: Next buffer in list @@ -167,6 +181,7 @@ * @csum: Checksum * @__unused: Dead field, may be reused * @cloned: Head may be cloned (check refcnt to be sure) + * @nohdr: Payload reference only, must not modify header * @pkt_type: Packet class * @ip_summed: Driver fed us an IP checksum * @priority: Packet queueing priority @@ -238,7 +253,8 @@ mac_len, csum; unsigned char local_df, - cloned, + cloned:1, + nohdr:1, pkt_type, ip_summed; __u32 priority; @@ -374,7 +390,23 @@ */ static inline int skb_cloned(const struct sk_buff *skb) { - return skb->cloned && atomic_read(&skb_shinfo(skb)->dataref) != 1; + return skb->cloned && + (atomic_read(&skb_shinfo(skb)->dataref) & SKB_DATAREF_MASK) != 1; +} + +/** + * skb_header_release - release reference to header + * @skb: buffer to operate on + * + * Drop a reference to the header part of the buffer. This is done + * by acquiring a payload reference. You must not read from the header + * part of skb->data after this. + */ +static inline void skb_header_release(struct sk_buff *skb) +{ + BUG_ON(skb->nohdr); + skb->nohdr = 1; + atomic_add(1 << SKB_DATAREF_SHIFT, &skb_shinfo(skb)->dataref); } /** ===== net/core/skbuff.c 1.41 vs edited ===== --- 1.41/net/core/skbuff.c 2004-12-02 16:49:52 +11:00 +++ edited/net/core/skbuff.c 2005-01-29 13:49:41 +11:00 @@ -241,7 +241,8 @@ void skb_release_data(struct sk_buff *skb) { if (!skb->cloned || - atomic_dec_and_test(&(skb_shinfo(skb)->dataref))) { + !atomic_sub_return(skb->nohdr ? (1 << SKB_DATAREF_SHIFT) + 1 : 1, + &skb_shinfo(skb)->dataref)) { if (skb_shinfo(skb)->nr_frags) { int i; for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) @@ -353,6 +354,7 @@ C(csum); C(local_df); n->cloned = 1; + n->nohdr = 0; C(pkt_type); C(ip_summed); C(priority); @@ -604,6 +606,7 @@ skb->h.raw += off; skb->nh.raw += off; skb->cloned = 0; + skb->nohdr = 0; atomic_set(&skb_shinfo(skb)->dataref, 1); return 0; ===== net/ipv4/tcp.c 1.91 vs edited ===== --- 1.91/net/ipv4/tcp.c 2005-01-18 09:09:33 +11:00 +++ edited/net/ipv4/tcp.c 2005-01-29 13:52:38 +11:00 @@ -598,6 +598,7 @@ TCP_SKB_CB(skb)->end_seq = tp->write_seq; TCP_SKB_CB(skb)->flags = TCPCB_FLAG_ACK; TCP_SKB_CB(skb)->sacked = 0; + skb_header_release(skb); __skb_queue_tail(&sk->sk_write_queue, skb); sk_charge_skb(sk, skb); if (!sk->sk_send_head) ===== net/ipv4/tcp_output.c 1.77 vs edited ===== --- 1.77/net/ipv4/tcp_output.c 2005-01-19 07:23:36 +11:00 +++ edited/net/ipv4/tcp_output.c 2005-01-29 13:55:08 +11:00 @@ -400,6 +400,7 @@ /* Advance write_seq and place onto the write_queue. */ tp->write_seq = TCP_SKB_CB(skb)->end_seq; + skb_header_release(skb); __skb_queue_tail(&sk->sk_write_queue, skb); sk_charge_skb(sk, skb); @@ -1327,6 +1328,7 @@ if (nskb == NULL) return -ENOMEM; __skb_unlink(skb, &sk->sk_write_queue); + skb_header_release(nskb); __skb_queue_head(&sk->sk_write_queue, nskb); sk_stream_free_skb(sk, skb); sk_charge_skb(sk, nskb); @@ -1493,6 +1495,7 @@ /* Send it off. */ TCP_SKB_CB(buff)->when = tcp_time_stamp; tp->retrans_stamp = TCP_SKB_CB(buff)->when; + skb_header_release(buff); __skb_queue_tail(&sk->sk_write_queue, buff); sk_charge_skb(sk, buff); tp->packets_out += tcp_skb_pcount(buff); --VbJkn9YxBvnuCH5J-- From herbert@gondor.apana.org.au Fri Jan 28 19:22:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 19:22:40 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0T3MWlE022976 for ; Fri, 28 Jan 2005 19:22:33 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CujBh-0005kz-00; Sat, 29 Jan 2005 14:22:17 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CujBa-0002Gt-00; Sat, 29 Jan 2005 14:22:10 +1100 Date: Sat, 29 Jan 2005 14:22:10 +1100 To: Alexey Kuznetsov Cc: "David S. Miller" , netdev@oss.sgi.com Subject: [2/2] [NET] Add skb_header_cloned and use it in e1000/tg3 Message-ID: <20050129032210.GA7424@gondor.apana.org.au> References: <20050121204024.6f94fc26.davem@davemloft.net> <20050122054346.GA1635@gondor.apana.org.au> <20050122170533.GB11499@yakov.inr.ac.ru> <20050123071027.GA20296@gondor.apana.org.au> <20050126110043.GA29950@yakov.inr.ac.ru> <20050126222522.GA21670@gondor.apana.org.au> <20050127110946.GA20494@gondor.apana.org.au> <20050127111201.GB20494@gondor.apana.org.au> <20050128202542.GA23670@yakov.inr.ac.ru> <20050129031740.GA6130@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="gBBFr7Ir9EOA20Yy" Content-Disposition: inline In-Reply-To: <20050129031740.GA6130@gondor.apana.org.au> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 987 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 3620 Lines: 137 --gBBFr7Ir9EOA20Yy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi: This patch adds skb_header_cloned which tells us whether we need to copy the data before we can modify the header part of the skb. Again, what constitutes the header is left up to the users of the skb to define. This patch then uses this function in e1000/tg3 to copy the data before the TCP/IP header is modified. Signed-off-by: Herbert Xu Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --gBBFr7Ir9EOA20Yy Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=tso-mangle-2 ===== drivers/net/tg3.c 1.231 vs edited ===== --- 1.231/drivers/net/tg3.c 2005-01-23 14:41:32 +11:00 +++ edited/drivers/net/tg3.c 2005-01-29 14:08:53 +11:00 @@ -3103,6 +3103,10 @@ (mss = skb_shinfo(skb)->tso_size) != 0) { int tcp_opt_len, ip_tcp_len; + if (skb_header_cloned(skb) && + pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) + goto out_unlock; + tcp_opt_len = ((skb->h.th->doff - 5) * 4); ip_tcp_len = (skb->nh.iph->ihl * 4) + sizeof(struct tcphdr); ===== drivers/net/e1000/e1000_main.c 1.147 vs edited ===== --- 1.147/drivers/net/e1000/e1000_main.c 2005-01-21 08:24:31 +11:00 +++ edited/drivers/net/e1000/e1000_main.c 2005-01-29 14:11:09 +11:00 @@ -1522,7 +1522,7 @@ #define E1000_TX_FLAGS_VLAN_MASK 0xffff0000 #define E1000_TX_FLAGS_VLAN_SHIFT 16 -static inline boolean_t +static inline int e1000_tso(struct e1000_adapter *adapter, struct sk_buff *skb) { #ifdef NETIF_F_TSO @@ -1531,8 +1531,15 @@ uint32_t cmd_length = 0; uint16_t ipcse, tucse, mss; uint8_t ipcss, ipcso, tucss, tucso, hdr_len; + int err; if(skb_shinfo(skb)->tso_size) { + if (skb_header_cloned(skb)) { + err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); + if (err) + return err; + } + hdr_len = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2)); mss = skb_shinfo(skb)->tso_size; skb->nh.iph->tot_len = 0; @@ -1569,11 +1576,11 @@ if(++i == adapter->tx_ring.count) i = 0; adapter->tx_ring.next_to_use = i; - return TRUE; + return 1; } #endif - return FALSE; + return 0; } static inline boolean_t @@ -1798,6 +1805,7 @@ unsigned int nr_frags = 0; unsigned int mss = 0; int count = 0; + int tso; unsigned int f; len -= skb->data_len; @@ -1869,7 +1877,13 @@ first = adapter->tx_ring.next_to_use; - if(likely(e1000_tso(adapter, skb))) + tso = e1000_tso(adapter, skb); + if (tso < 0) { + dev_kfree_skb_any(skb); + return NETDEV_TX_OK; + } + + if (likely(tso)) tx_flags |= E1000_TX_FLAGS_TSO; else if(likely(e1000_tx_csum(adapter, skb))) tx_flags |= E1000_TX_FLAGS_CSUM; ===== include/linux/skbuff.h 1.60 vs edited ===== --- 1.60/include/linux/skbuff.h 2005-01-29 14:01:43 +11:00 +++ edited/include/linux/skbuff.h 2005-01-29 14:06:35 +11:00 @@ -395,6 +395,25 @@ } /** + * skb_header_cloned - is the header a clone + * @skb: buffer to check + * + * Returns true if modifying the header part of the buffer requires + * the data to be copied. + */ +static inline int skb_header_cloned(const struct sk_buff *skb) +{ + int dataref; + + if (!skb->cloned) + return 0; + + dataref = atomic_read(&skb_shinfo(skb)->dataref); + dataref = (dataref & SKB_DATAREF_MASK) - (dataref >> SKB_DATAREF_SHIFT); + return dataref != 1; +} + +/** * skb_header_release - release reference to header * @skb: buffer to operate on * --gBBFr7Ir9EOA20Yy-- From ak@muc.de Fri Jan 28 22:59:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Fri, 28 Jan 2005 22:59:51 -0800 (PST) Received: from one.firstfloor.org (one.firstfloor.org [213.235.205.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0T6xap8031012 for ; Fri, 28 Jan 2005 22:59:37 -0800 Received: by one.firstfloor.org (Postfix, from userid 502) id E5185D033E; Sat, 29 Jan 2005 07:59:33 +0100 (CET) To: Stephen Hemminger Cc: =?iso-8859-1?q?Lorenzo_Hern=E1ndez_Garc=EDa-Hierro?= , linux-kernel@vger.kernel.org, chrisw@osdl.org, netdev@oss.sgi.com, arjan@infradead.org, hlein@progressive-comp.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] OpenBSD Networking-related randomization port References: <1106932637.3778.92.camel@localhost.localdomain> <20050128100229.5c0e4ea1@dxpl.pdx.osdl.net> <1106937110.3864.5.camel@localhost.localdomain> <20050128105217.1dc5ef42@dxpl.pdx.osdl.net> <1106944492.3864.30.camel@localhost.localdomain> <20050128124517.36aa5e05.davem@davemloft.net> <20050128133408.49021343@dxpl.pdx.osdl.net> From: Andi Kleen Date: Sat, 29 Jan 2005 07:59:33 +0100 In-Reply-To: <20050128133408.49021343@dxpl.pdx.osdl.net> (Stephen Hemminger's message of "Fri, 28 Jan 2005 13:34:08 -0800") Message-ID: User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 988 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@muc.de Precedence: bulk X-list: netdev Content-Length: 1644 Lines: 44 Stephen Hemminger writes: > On Fri, 28 Jan 2005 12:45:17 -0800 > "David S. Miller" wrote: > >> On Fri, 28 Jan 2005 21:34:52 +0100 >> Lorenzo Hernández García-Hierro wrote: >> >> > Attached the new patch following Arjan's recommendations. >> >> No SMP protection on the SBOX, better look into that. >> The locking you'll likely need to add will make this >> routine serialize many networking operations which is >> one thing we've been trying to avoid. >> > > per-cpu would be the way to go here. I don't think so no - just doing per cpu counters you risk nearby duplicates, which can cause even easier data corruption (e.g. during ip fragment reassembly - it is already very weak and making it weaker is probably not a good idea) If you want SMP performance for ipids you can resurrect the old "cookie jar" approach I used in 2.4 time frame to get rid of inetpeers. The idea was that you have global state, and each CPU would regenerate some numbers from the state, then store them in a private "jar" and use them use, then look at the global state with locking again etc. This can be tuned on how big the jar is - the bigger the smaller the sequence space (risky for 16bit ipids), but the better the scalability. But before doing anything like this I would recommend that someone skilled in cryptography evaluates the security of these functions carefully and see if it actually has any advantages. I remember that Andrey S. broke some of the "cool" "secure" openbsd IDs easily some years ago. At least for ipids I'm utterly sceptical. 16bits are just hopeless. -Andi From SRS0+61c4fc3c0dde471d487a+524+infradead.org+arjan@canuck.srs.infradead.org Sat Jan 29 00:05:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 29 Jan 2005 00:05:58 -0800 (PST) Received: from canuck.infradead.org (canuck.infradead.org [205.233.218.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0T85q4n000351 for ; Sat, 29 Jan 2005 00:05:52 -0800 Received: from g133107.upc-g.chello.nl ([80.57.133.107] helo=172.31.3.43) by canuck.infradead.org with esmtpsa (Exim 4.43 #1 (Red Hat Linux)) id 1Cunc4-0000vl-Iw; Sat, 29 Jan 2005 03:05:49 -0500 Subject: Re: [PATCH] OpenBSD Networking-related randomization port From: Arjan van de Ven To: Lorenzo =?ISO-8859-1?Q?Hern=E1ndez_?= =?ISO-8859-1?Q?Garc=EDa-Hierro?= Cc: Stephen Hemminger , "linux-kernel@vger.kernel.org" , Chris Wright , netdev@oss.sgi.com, Hank Leininger In-Reply-To: <1106950369.3864.45.camel@localhost.localdomain> References: <1106932637.3778.92.camel@localhost.localdomain> <20050128100229.5c0e4ea1@dxpl.pdx.osdl.net> <1106937110.3864.5.camel@localhost.localdomain> <20050128105217.1dc5ef42@dxpl.pdx.osdl.net> <1106944492.3864.30.camel@localhost.localdomain> <1106945266.7776.41.camel@laptopd505.fenrus.org> <1106950369.3864.45.camel@localhost.localdomain> Content-Type: text/plain; charset=UTF-8 Date: Sat, 29 Jan 2005 09:05:44 +0100 Message-Id: <1106985945.4174.60.camel@laptopd505.fenrus.org> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by canuck.infradead.org See http://www.infradead.org/rpr.html X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 990 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: arjan@infradead.org Precedence: bulk X-list: netdev Content-Length: 754 Lines: 15 On Fri, 2005-01-28 at 23:12 +0100, Lorenzo Hernández García-Hierro wrote: > El vie, 28-01-2005 a las 21:47 +0100, Arjan van de Ven escribió: > > as for obsd_get_random_long().. would it be possible to use the > > get_random_int() function from the patches I posted the other day? They > > use the existing random.c infrastructure instead of making a copy... > > As seen at > the functions at obsd_rand.c so we wouldn't need to add more maintenance overhead, I hope you can understand why I want it like that I actually DON'T understand that. What you say kinda sorta makes sense if you're an external patch. But if you are inside the kernel (that was the goal of this patch, right?) then the argument is actually entirely the wrong way around... From SRS0+61c4fc3c0dde471d487a+524+infradead.org+arjan@canuck.srs.infradead.org Sat Jan 29 00:04:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 29 Jan 2005 00:04:59 -0800 (PST) Received: from canuck.infradead.org (canuck.infradead.org [205.233.218.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0T84qgS032574 for ; Sat, 29 Jan 2005 00:04:53 -0800 Received: from g133107.upc-g.chello.nl ([80.57.133.107] helo=172.31.3.43) by canuck.infradead.org with esmtpsa (Exim 4.43 #1 (Red Hat Linux)) id 1Cunb4-0000vY-4i; Sat, 29 Jan 2005 03:04:47 -0500 Subject: Re: [PATCH] OpenBSD Networking-related randomization port From: Arjan van de Ven To: Lorenzo =?ISO-8859-1?Q?Hern=E1ndez_?= =?ISO-8859-1?Q?Garc=EDa-Hierro?= Cc: Stephen Hemminger , "linux-kernel@vger.kernel.org" , Chris Wright , netdev@oss.sgi.com, Hank Leininger In-Reply-To: <1106950369.3864.45.camel@localhost.localdomain> References: <1106932637.3778.92.camel@localhost.localdomain> <20050128100229.5c0e4ea1@dxpl.pdx.osdl.net> <1106937110.3864.5.camel@localhost.localdomain> <20050128105217.1dc5ef42@dxpl.pdx.osdl.net> <1106944492.3864.30.camel@localhost.localdomain> <1106945266.7776.41.camel@laptopd505.fenrus.org> <1106950369.3864.45.camel@localhost.localdomain> Content-Type: text/plain; charset=UTF-8 Date: Sat, 29 Jan 2005 09:04:42 +0100 Message-Id: <1106985882.4174.58.camel@laptopd505.fenrus.org> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by canuck.infradead.org See http://www.infradead.org/rpr.html X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 989 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: arjan@infradead.org Precedence: bulk X-list: netdev Content-Length: 748 Lines: 18 On Fri, 2005-01-28 at 23:12 +0100, Lorenzo Hernández García-Hierro wrote: > El vie, 28-01-2005 a las 21:47 +0100, Arjan van de Ven escribió: > > as for obsd_get_random_long().. would it be possible to use the > > get_random_int() function from the patches I posted the other day? They > > use the existing random.c infrastructure instead of making a copy... > > As seen at > http://www.kernel.org/pub/linux/kernel/people/arjan/execshield/00-randomize-A0 you can suppose that there's I actually meant http://www.kernel.org/pub/linux/kernel/people/arjan/randomize/02- randomize-infrastructure which I posted for inclusion in the main kernel 2 or 3 days ago. That's nice and stand alone to get a random value; we should be able to share that. From greg@kroah.com Sat Jan 29 00:28:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 29 Jan 2005 00:28:19 -0800 (PST) Received: from perch.kroah.org (mail.kroah.org [69.55.234.183]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0T8S8oY004850 for ; Sat, 29 Jan 2005 00:28:09 -0800 Received: from [192.168.0.10] (c-67-171-165-3.client.comcast.net [67.171.165.3]) (authenticated) by perch.kroah.org (8.11.6/8.11.6) with ESMTP id j0T8S5i13350; Sat, 29 Jan 2005 00:28:05 -0800 Received: from greg by echidna.kroah.org with local (masqmail 0.2.19) id 1Cunnf-24r-00; Sat, 29 Jan 2005 00:17:47 -0800 Date: Sat, 29 Jan 2005 00:17:46 -0800 From: Greg KH To: Jeff Garzik Cc: Linux Kernel , Netdev , Andrew Morton Subject: Re: [ANN] removal of certain net drivers coming soon: eepro100, xircom_tulip_cb, iph5526 Message-ID: <20050129081745.GE7738@kroah.com> References: <41F952F4.7040804@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41F952F4.7040804@pobox.com> User-Agent: Mutt/1.5.6i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 991 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greg@kroah.com Precedence: bulk X-list: netdev Content-Length: 231 Lines: 10 On Thu, Jan 27, 2005 at 03:45:40PM -0500, Jeff Garzik wrote: > > (GregKH cc'd for his deprecated list) It's a file in the Documentation/ directory, feel free to just patch it, adding entries for these drivers. thanks, greg k-h From Valdis.Kletnieks@vt.edu Sat Jan 29 01:16:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 29 Jan 2005 01:16:39 -0800 (PST) Received: from h80ad2532.async.vt.edu (IDENT:root@h80ad2532.async.vt.edu [128.173.37.50]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0T9GXK5006123 for ; Sat, 29 Jan 2005 01:16:34 -0800 Received: from turing-police.cc.vt.edu (IDENT:valdis@turing-police.cc.vt.edu [127.0.0.1]) by turing-police.cc.vt.edu (8.13.3.Beta0/8.13.3.Beta0) with ESMTP id j0T9FkVY012948; Sat, 29 Jan 2005 04:15:49 -0500 Message-Id: <200501290915.j0T9FkVY012948@turing-police.cc.vt.edu> X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.1-RC3 To: Arjan van de Ven Cc: Lorenzo =?ISO-8859-1?Q?Hern=E1ndez_?= =?ISO-8859-1?Q?Garc=EDa-Hierro?= , Stephen Hemminger , "linux-kernel@vger.kernel.org" , Chris Wright , netdev@oss.sgi.com, Hank Leininger Subject: Re: [PATCH] OpenBSD Networking-related randomization port In-Reply-To: Your message of "Fri, 28 Jan 2005 21:47:45 +0100." <1106945266.7776.41.camel@laptopd505.fenrus.org> From: Valdis.Kletnieks@vt.edu References: <1106932637.3778.92.camel@localhost.localdomain> <20050128100229.5c0e4ea1@dxpl.pdx.osdl.net> <1106937110.3864.5.camel@localhost.localdomain> <20050128105217.1dc5ef42@dxpl.pdx.osdl.net> <1106944492.3864.30.camel@localhost.localdomain> <1106945266.7776.41.camel@laptopd505.fenrus.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==_Exmh_1106990142_21005P"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Date: Sat, 29 Jan 2005 04:15:43 -0500 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 992 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Valdis.Kletnieks@vt.edu Precedence: bulk X-list: netdev Content-Length: 1052 Lines: 35 --==_Exmh_1106990142_21005P Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable On Fri, 28 Jan 2005 21:47:45 +0100, Arjan van de Ven said: > as for obsd_get_random_long().. would it be possible to use the > get_random_int() function from the patches I posted the other day? They= > use the existing random.c infrastructure instead of making a copy... >=20 > I still don't understand why you need a obsd_rand.c and can't use the > normal random.c Note that obsd_rand.c started off life as a BSD-licensed file - I was tol= d that was a show-stopper when I submitted basically the same patch a while= back. So re-working it to use get_random_int() would be a good idea, I think..= .. --==_Exmh_1106990142_21005P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) Comment: Exmh version 2.5 07/13/2001 iD8DBQFB+1Q9cC3lWbTT17ARAsKUAJ9p3+YEyq2ZOwNJSAN1VG36ZEkVOgCg8zvs 6EfUPjw0Y9WR6GK3azrO7WQ= =7riU -----END PGP SIGNATURE----- --==_Exmh_1106990142_21005P-- From herbert@gondor.apana.org.au Sat Jan 29 02:13:14 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 29 Jan 2005 02:13:21 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0TADCHj007797 for ; Sat, 29 Jan 2005 02:13:13 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CupbC-0006jJ-00; Sat, 29 Jan 2005 21:13:02 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1Cupav-0003YS-00; Sat, 29 Jan 2005 21:12:45 +1100 Date: Sat, 29 Jan 2005 21:12:45 +1100 To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: design for TSO performance fix Message-ID: <20050129101245.GB13584@gondor.apana.org.au> References: <20050127163146.33b01e95.davem@davemloft.net> <20050127211940.31f97ed3.davem@davemloft.net> <20050128054441.GA8260@gondor.apana.org.au> <20050128112838.21e53b6c.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050128112838.21e53b6c.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 993 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 414 Lines: 11 On Fri, Jan 28, 2005 at 11:28:38AM -0800, David S. Miller wrote: > > TSO packets only exist in the tcp_transmit_skb() path, > nothing else in the stack sees them. Cool, that should be really good then. -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From herbert@gondor.apana.org.au Sat Jan 29 04:38:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 29 Jan 2005 04:38:57 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0TCck2C017410 for ; Sat, 29 Jan 2005 04:38:47 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1Currz-0007EF-00; Sat, 29 Jan 2005 23:38:31 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CurrX-0004X9-00; Sat, 29 Jan 2005 23:38:03 +1100 Date: Sat, 29 Jan 2005 23:38:03 +1100 To: "David S. Miller" , netdev@oss.sgi.com Subject: [IPSEC] Merge xfrm4_bundle_ok/xfrm6_bundle_ok/stale_bundle Message-ID: <20050129123803.GA17390@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="lrZ03NoBR/3+SXJZ" Content-Disposition: inline User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 994 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 5242 Lines: 183 --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Dave: This patch merges __xfrm4_bundle_ok/__xfrm6_bundle_ok/stale_bundle so that when I add MTU verification code I don't have to put it in three places. It also moves the tests on dst->dev and dst->obsolete outside the loop since the former is identical throughout the bundle and the latter can only be positive on the final element which also happens to be dst->path. Signed-off-by: Herbert Xu Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== include/net/xfrm.h 1.74 vs edited ===== --- 1.74/include/net/xfrm.h 2005-01-26 16:53:19 +11:00 +++ edited/include/net/xfrm.h 2005-01-29 23:22:09 +11:00 @@ -857,6 +857,7 @@ extern void xfrm_policy_flush(void); extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); extern int xfrm_flush_bundles(void); +extern int xfrm_bundle_ok(struct xfrm_dst *xdst, struct flowi *fl, int family); extern wait_queue_head_t km_waitq; extern int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, u16 sport); ===== net/ipv4/xfrm4_policy.c 1.13 vs edited ===== --- 1.13/net/ipv4/xfrm4_policy.c 2004-12-28 14:49:58 +11:00 +++ edited/net/ipv4/xfrm4_policy.c 2005-01-29 23:11:46 +11:00 @@ -22,26 +22,6 @@ return __ip_route_output_key((struct rtable**)dst, fl); } -/* Check that the bundle accepts the flow and its components are - * still valid. - */ - -static int __xfrm4_bundle_ok(struct xfrm_dst *xdst, struct flowi *fl) -{ - do { - if (xdst->u.dst.ops != &xfrm4_dst_ops) - return 1; - - if (!xfrm_selector_match(&xdst->u.dst.xfrm->sel, fl, AF_INET)) - return 0; - if (xdst->u.dst.xfrm->km.state != XFRM_STATE_VALID || - xdst->u.dst.path->obsolete > 0) - return 0; - xdst = (struct xfrm_dst*)xdst->u.dst.child; - } while (xdst); - return 0; -} - static struct dst_entry * __xfrm4_find_bundle(struct flowi *fl, struct xfrm_policy *policy) { @@ -53,7 +33,7 @@ if (xdst->u.rt.fl.oif == fl->oif && /*XXX*/ xdst->u.rt.fl.fl4_dst == fl->fl4_dst && xdst->u.rt.fl.fl4_src == fl->fl4_src && - __xfrm4_bundle_ok(xdst, fl)) { + xfrm_bundle_ok(xdst, fl, AF_INET)) { dst_clone(dst); break; } ===== net/ipv6/xfrm6_policy.c 1.24 vs edited ===== --- 1.24/net/ipv6/xfrm6_policy.c 2004-11-10 17:57:03 +11:00 +++ edited/net/ipv6/xfrm6_policy.c 2005-01-29 23:23:24 +11:00 @@ -31,26 +31,6 @@ return err; } -/* Check that the bundle accepts the flow and its components are - * still valid. - */ - -static int __xfrm6_bundle_ok(struct xfrm_dst *xdst, struct flowi *fl) -{ - do { - if (xdst->u.dst.ops != &xfrm6_dst_ops) - return 1; - - if (!xfrm_selector_match(&xdst->u.dst.xfrm->sel, fl, AF_INET6)) - return 0; - if (xdst->u.dst.xfrm->km.state != XFRM_STATE_VALID || - xdst->u.dst.path->obsolete > 0) - return 0; - xdst = (struct xfrm_dst*)xdst->u.dst.child; - } while (xdst); - return 0; -} - static struct dst_entry * __xfrm6_find_bundle(struct flowi *fl, struct xfrm_policy *policy) { @@ -70,7 +50,7 @@ xdst->u.rt6.rt6i_src.plen); if (ipv6_addr_equal(&xdst->u.rt6.rt6i_dst.addr, &fl_dst_prefix) && ipv6_addr_equal(&xdst->u.rt6.rt6i_src.addr, &fl_src_prefix) && - __xfrm6_bundle_ok(xdst, fl)) { + xfrm_bundle_ok(xdst, fl, AF_INET6)) { dst_clone(dst); break; } ===== net/xfrm/xfrm_policy.c 1.63 vs edited ===== --- 1.63/net/xfrm/xfrm_policy.c 2005-01-19 07:08:19 +11:00 +++ edited/net/xfrm/xfrm_policy.c 2005-01-29 23:27:39 +11:00 @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -1005,18 +1006,7 @@ static int stale_bundle(struct dst_entry *dst) { - struct dst_entry *child = dst; - - while (child) { - if (child->obsolete > 0 || - (child->dev && !netif_running(child->dev)) || - (child->xfrm && child->xfrm->km.state != XFRM_STATE_VALID)) { - return 1; - } - child = child->child; - } - - return 0; + return xfrm_bundle_ok((struct xfrm_dst *)dst, NULL, AF_UNSPEC); } static void xfrm_dst_destroy(struct dst_entry *dst) @@ -1091,6 +1081,31 @@ xfrm_prune_bundles(stale_bundle); return 0; } + +/* Check that the bundle accepts the flow and its components are + * still valid. + */ + +int xfrm_bundle_ok(struct xfrm_dst *xdst, struct flowi *fl, int family) +{ + struct dst_entry *dst = &xdst->u.dst; + + if (dst->path->obsolete > 0 || + (dst->dev && !netif_running(dst->dev))) + return 0; + + do { + if (fl && !xfrm_selector_match(&dst->xfrm->sel, fl, family)) + return 0; + if (dst->xfrm->km.state != XFRM_STATE_VALID) + return 0; + dst = dst->child; + } while (dst->xfrm); + + return 1; +} + +EXPORT_SYMBOL(xfrm_bundle_ok); /* Well... that's _TASK_. We need to scan through transformation * list and figure out what mss tcp should generate in order to --lrZ03NoBR/3+SXJZ-- From tgraf@suug.ch Sat Jan 29 04:47:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 29 Jan 2005 04:47:33 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0TClNC7017981 for ; Sat, 29 Jan 2005 04:47:26 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 75AF6F; Sat, 29 Jan 2005 13:47:00 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id CA36D1C0EB; Sat, 29 Jan 2005 13:47:21 +0100 (CET) Date: Sat, 29 Jan 2005 13:47:21 +0100 From: Thomas Graf To: "David S. Miller" , Alexey Kuznetsov Cc: netdev@oss.sgi.com Subject: Re: [PATCH] NETLINK: Use SKB_MAXORDER to calculate NLMSG_GOODSIZE Message-ID: <20050129124720.GZ31837@postel.suug.ch> References: <20050128230327.GV31837@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050128230327.GV31837@postel.suug.ch> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 995 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 305 Lines: 5 * Thomas Graf <20050128230327.GV31837@postel.suug.ch> 2005-01-29 00:03 > --- linux-2.6.11-rc2-bk4.orig/include/linux/netlink.h 2005-01-26 18:19:27.000000000 +0100 > +++ linux-2.6.11-rc2-bk4/include/linux/netlink.h 2005-01-28 23:06:02.000000000 +0100 It is also needed for 2.4 and applies with some fuzz. From yoshfuji@linux-ipv6.org Sat Jan 29 05:46:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 29 Jan 2005 05:46:37 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0TDkVVC019723 for ; Sat, 29 Jan 2005 05:46:31 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id 945F033CC2; Sat, 29 Jan 2005 22:47:21 +0900 (JST) Date: Sat, 29 Jan 2005 22:47:21 +0900 (JST) Message-Id: <20050129.224721.131964551.yoshfuji@linux-ipv6.org> To: herbert@gondor.apana.org.au Cc: davem@davemloft.net, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [IPSEC] Merge xfrm4_bundle_ok/xfrm6_bundle_ok/stale_bundle From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20050129123803.GA17390@gondor.apana.org.au> References: <20050129123803.GA17390@gondor.apana.org.au> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 996 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Content-Length: 322 Lines: 9 In article <20050129123803.GA17390@gondor.apana.org.au> (at Sat, 29 Jan 2005 23:38:03 +1100), Herbert Xu says: > This patch merges __xfrm4_bundle_ok/__xfrm6_bundle_ok/stale_bundle > so that when I add MTU verification code I don't have to put it in > three places. Ok, I agree. --yoshfuji From webmaster@rapidforum.com Sat Jan 29 08:07:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 29 Jan 2005 08:07:07 -0800 (PST) Received: from rapidforum.com (www.rapidforum.com [80.237.244.2]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0TG71AY023566 for ; Sat, 29 Jan 2005 08:07:02 -0800 Received: (qmail 30518 invoked by uid 1004); 29 Jan 2005 16:07:01 -0000 Received: from p3ee047ae.dip0.t-ipconnect.de (HELO ?62.224.71.174?) (62.224.71.174) by www.rapidforum.com with SMTP; 29 Jan 2005 16:07:01 -0000 Message-ID: <41FBB49D.2020809@rapidforum.com> Date: Sat, 29 Jan 2005 17:06:53 +0100 From: Christian Schmid User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a3) Gecko/20040817 X-Accept-Language: de, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: How to remove TCP-limits? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 997 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: webmaster@rapidforum.com Precedence: bulk X-list: netdev Content-Length: 904 Lines: 15 Referring to the following: >In 2.6.10 there has been a "bug" introduced. You may also call it a feature, but its a crappy >feature for big servers. It seems the kernel is dynamically adjusting the buffer-space available >for sockets. Even if send-buffer has been set to 1024 KB, the kernel blocks at less if there are >enough sockets in use. If you have 10 sockets with 1024 KB each, they do not block at all, using >full 1024 KB. If you have 4000 sockets, they only use 200 KB. So it seems its blocking at 800 MB. >This is good, if you have a 1/3 system, because else the kernel would run out of low mem. But I >have a 2/2 system and I need them for buffers. So what can I do? Where can I adjust the "pool"? How can I disable this? I have been searching the code but I can't find it. Or can I at least adjust it somehow? Thank you in advance. Best regards, Christian Schmid - RapidTec From kuznet@yakov.inr.ac.ru Sat Jan 29 10:41:17 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 29 Jan 2005 10:41:21 -0800 (PST) Received: from yakov.inr.ac.ru (yakov.inr.ac.ru [194.67.69.111]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0TIfGlU030826 for ; Sat, 29 Jan 2005 10:41:17 -0800 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=ms2.inr.ac.ru; b=dXU/QNIxsaRMTX1Ss4gRQNsUvfYljfYD57g640gaSMtyK+Nibit+u25Q9+nanW2Hv5g+q+MI7XOF51esPCneoGB1mMBNyjk9LHlQpMQfkMTnCJySISt6g8aGaJLa28CEANe0uLUSvE7QAWFP4PdBdLEZryOUZsGSPkJphIruSGw=; Received: (from kuznet@localhost) envelope-from=kuznet by yakov.inr.ac.ru (8.6.13/ANK) id VAA29358; Sat, 29 Jan 2005 21:40:36 +0300 Date: Sat, 29 Jan 2005 21:40:36 +0300 From: Alexey Kuznetsov To: Thomas Graf Cc: Alexey Kuznetsov , Herbert Xu , davem@davemloft.net, netdev@oss.sgi.com Subject: Re: [PATCH] NETLINK: Use SKB_MAXORDER to calculate NLMSG_GOODSIZE Message-ID: <20050129184036.GB29233@yakov.inr.ac.ru> References: <20050128230327.GV31837@postel.suug.ch> <20050128234828.GA24868@yakov.inr.ac.ru> <20050129002128.GX31837@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050129002128.GX31837@postel.suug.ch> User-Agent: Mutt/1.5.6i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 998 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kuznet@ms2.inr.ac.ru Precedence: bulk X-list: netdev Content-Length: 322 Lines: 11 Hello! > alignment though. Can someone enlighten me about the magic 31 in there? It was me who wrote both NLMSG_GOODSIZE and this crap. Does the explanation sound enough? :-) Apparently it was a brainless attempt of formal merge of (broken) NLMSG_GOODSIZE and inversed calculation in alloc_skb. Delete this 31. Alexey From fw@deneb.enyo.de Sat Jan 29 10:50:23 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 29 Jan 2005 10:50:28 -0800 (PST) Received: from mail.enyo.de (mail.enyo.de [212.9.189.167]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0TIoMbZ031507 for ; Sat, 29 Jan 2005 10:50:22 -0800 Received: from deneb.enyo.de ([212.9.189.171]) by albireo.enyo.de with esmtp id 1Cuxfh-0001FS-U8; Sat, 29 Jan 2005 19:50:13 +0100 Received: from fw by deneb.enyo.de with local (Exim 4.43) id 1Cuxfg-0002Jy-H7; Sat, 29 Jan 2005 19:50:12 +0100 From: Florian Weimer To: Glen Turner Cc: Robert Olsson , netdev@oss.sgi.com Subject: Re: Linux Routing Performance Update References: <16887.39598.648724.421160@robur.slu.se> <41FA4498.6020202@aarnet.edu.au> Date: Sat, 29 Jan 2005 19:50:12 +0100 In-Reply-To: <41FA4498.6020202@aarnet.edu.au> (Glen Turner's message of "Sat, 29 Jan 2005 00:26:40 +1030") Message-ID: <87oef8m5nf.fsf@deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 999 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fw@deneb.enyo.de Precedence: bulk X-list: netdev Content-Length: 826 Lines: 22 * Glen Turner: >> Finally time for some more testing with a somewhat upgraded equipment. > > Thanks very much for the interesting results. Indeed. > I'm sure other network engineers have experienced software routers where > the pps has dramatically slowed down upon reasonable ACLs and queuing > (Cisco 7500, etc), Cisco 7500 with proper configuration would do quite well in this test, too, even with ACLs. Only if you have more than a few thousand new flows per second, things start to look rather bleak. (Forwarding decisions are performed once per flow on this platform.) > so some results with netfilter and tc running would be appreciated, > as would tests for any packet re-ordering in output flows. I'd also like to see tests with random source/destination combinations, just to keep things in perspective. 8-) From linux-netdev@gmane.org Sat Jan 29 12:42:43 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 29 Jan 2005 12:42:50 -0800 (PST) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0TKggDa006530 for ; Sat, 29 Jan 2005 12:42:43 -0800 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1CuzQR-0005oN-Lh for netdev@oss.sgi.com; Sat, 29 Jan 2005 21:42:35 +0100 Received: from dsl027-161-081.atl1.dsl.speakeasy.net ([216.27.161.81]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 29 Jan 2005 21:42:35 +0100 Received: from lunz by dsl027-161-081.atl1.dsl.speakeasy.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 29 Jan 2005 21:42:35 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: netdev@oss.sgi.com From: Jason Lunz Subject: Re: [ANN] removal of certain net drivers coming soon: eepro100, xircom_tulip_cb, iph5526 Date: Sat, 29 Jan 2005 20:42:33 +0000 (UTC) Organization: PBR Streetgang Message-ID: References: <41F952F4.7040804@pobox.com> X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: dsl027-161-081.atl1.dsl.speakeasy.net User-Agent: slrn/0.9.8.1 (Debian) X-Gmane-MailScanner: Found to be clean, Found to be clean X-Gmane-MailScanner-SpamScore: s X-MailScanner-From: linux-netdev@m.gmane.org X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1000 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: lunz@falooley.org Precedence: bulk X-list: netdev Content-Length: 1580 Lines: 45 ["Followup-To:" header set to gmane.linux.kernel.] jgarzik@pobox.com said: > 3) eepro100 > > Unmaintained; users should use e100. > > When I last mentioned eepro100 was going away, I got a few private > emails saying complaining about issues not yet taken care of in e100. > eepro100 will not be removed until these issues are resolved. I have an intel eepro100 card in an old PII 266. With eepro100, it gets ~9Mbit, but e100 struggles to keep its head above 1Mbit, and is very erratic. Also, drivers/net/Kconfig still claims that E100_NAPI exists, but the option to disable napi has long since been removed from the driver. Jason --- linux-2.6.10/drivers/net/Kconfig.pre 2005-01-29 15:40:48.000000000 -0500 +++ linux-2.6.10/drivers/net/Kconfig 2005-01-29 15:41:01.000000000 -0500 @@ -1435,23 +1435,6 @@ . The module will be called e100. -config E100_NAPI - bool "Use Rx Polling (NAPI)" - depends on E100 - help - NAPI is a new driver API designed to reduce CPU and interrupt load - when the driver is receiving lots of packets from the card. It is - still somewhat experimental and thus not yet enabled by default. - - If your estimated Rx load is 10kpps or more, or if the card will be - deployed on potentially unfriendly networks (e.g. in a firewall), - then say Y here. - - See for more - information. - - If in doubt, say N. - config LNE390 tristate "Mylex EISA LNE390A/B support (EXPERIMENTAL)" depends on NET_PCI && EISA && EXPERIMENTAL From jeremy.guthrie@berbee.com Sat Jan 29 14:24:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 29 Jan 2005 14:24:36 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0TMOUba009150 for ; Sat, 29 Jan 2005 14:24:31 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Subject: RE: Linux Routing Performance Update Date: Sat, 29 Jan 2005 16:21:39 -0600 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Linux Routing Performance Update Thread-Index: AcUGM2nQFU3n7yOAQPWLeYFCK0stFgAHX02S From: "Guthrie, Jeremy" To: "Florian Weimer" , "Glen Turner" Cc: "Robert Olsson" , X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j0TMOUba009150 X-archive-position: 1001 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev Content-Length: 1386 Lines: 35 -----Original Message----- From: netdev-bounce@oss.sgi.com on behalf of Florian Weimer Sent: Sat 1/29/2005 12:50 PM To: Glen Turner Cc: Robert Olsson; netdev@oss.sgi.com Subject: Re: Linux Routing Performance Update * Glen Turner: >> Finally time for some more testing with a somewhat upgraded equipment. > > Thanks very much for the interesting results. Indeed. > I'm sure other network engineers have experienced software routers where > the pps has dramatically slowed down upon reasonable ACLs and queuing > (Cisco 7500, etc), Cisco 7500 with proper configuration would do quite well in this test, too, even with ACLs. Only if you have more than a few thousand new flows per second, things start to look rather bleak. (Forwarding decisions are performed once per flow on this platform.) ----------- Depends if you are using standard route caching or Cisco Express Forwarding. The 7500s should support dCEF if memory strikes me correctly. In any case, when CEF is available it should be used. Comparing any Cisco router w/o CEF or MLS wouldn't exactly be a fair comparison. MLS will care about new flows but CEF will not. > so some results with netfilter and tc running would be appreciated, > as would tests for any packet re-ordering in output flows. I'd also like to see tests with random source/destination combinations, just to keep things in perspective. 8-) From akpm@osdl.org Sat Jan 29 23:48:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Sat, 29 Jan 2005 23:48:43 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0U7maNU027740 for ; Sat, 29 Jan 2005 23:48:36 -0800 Received: from bix (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id j0U7mUl00739; Sat, 29 Jan 2005 23:48:30 -0800 Date: Sat, 29 Jan 2005 23:48:32 -0800 From: Andrew Morton To: netdev@oss.sgi.com Cc: selecter@spray.se Subject: Fw: [Bugme-new] [Bug 4131] New: iptables rules don't work correctly in 2.6.11-rc2-bk7 Message-Id: <20050129234832.53c6f763.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1002 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 1447 Lines: 50 Begin forwarded message: Date: Sat, 29 Jan 2005 23:46:15 -0800 From: bugme-daemon@osdl.org To: bugme-new@lists.osdl.org Subject: [Bugme-new] [Bug 4131] New: iptables rules don't work correctly in 2.6.11-rc2-bk7 http://bugme.osdl.org/show_bug.cgi?id=4131 Summary: iptables rules don't work correctly in 2.6.11-rc2-bk7 Kernel Version: 2.6.11-rc2-bk7 Status: NEW Severity: high Owner: laforge@gnumonks.org Submitter: selecter@spray.se I am using vanilla kernel 2.6.10 as stable one. I got script that run on every system startup: #!/bin/bash for table in INPUT OUTPUT FORWARD ; do iptables -P $table DROP done iptables -F iptables -A INPUT -p all -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A INPUT -s 127.0.0.1 -d 127.0.0.1 -p ALL -j ACCEPT iptables -A OUTPUT -p ALL -j ACCEPT On 2.6.10 NETWORK is accessible. On 2.6.11-rc2-bk7 NETWORK is __NOT__ accessible (just after flushing iptables and setting ACCEPT on INPUT and OUTPUT I got connection) # iptables -A INPUT -p all -m state --state ESTABLISHED,RELATED -j ACCEPT iptables: No chain/target/match by that name Was used the same kernelconfig. Gonna check again cat /proc/net/ip_tables* | grep state returns nothing Also I can't see connection state match support in menuconfig ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. From cranium.2003@gmail.com Sun Jan 30 05:09:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 05:09:12 -0800 (PST) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.199]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0UD98m9016923 for ; Sun, 30 Jan 2005 05:09:08 -0800 Received: by rproxy.gmail.com with SMTP id b11so636451rne for ; Sun, 30 Jan 2005 05:09:07 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=of8VBwaY6S/BcoEOCjp+hpI7jHiIHevydhdFbTeeaFPnG5/5N6YJijRID9Ph9UUQhvYh3DyftS4W/HJNlu2KlTuYjFkSqo8oViF3cSuW4VH5BKjpWE1ybbLOFDAGbGpH3lagRG2ZFPDwT0mTGoqqWEaj2hiYb1uHoUcWGaKGgtc= Received: by 10.38.74.51 with SMTP id w51mr309107rna; Sun, 30 Jan 2005 05:09:07 -0800 (PST) Received: by 10.38.81.57 with HTTP; Sun, 30 Jan 2005 05:09:07 -0800 (PST) Message-ID: <1d55641b05013005097df61788@mail.gmail.com> Date: Sun, 30 Jan 2005 18:39:07 +0530 From: cranium 2003 Reply-To: cranium 2003 To: netdev@oss.sgi.com Subject: checksum calculation in ip packet forwarding Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1003 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cranium.2003@gmail.com Precedence: bulk X-list: netdev Content-Length: 630 Lines: 22 Hello, 1) How Router knows destinations mtu. In IP forwarding case following function is used that checks pmtu value to decide whether outgoing packet is required to fragment a packet or not? static inline int ip_send(struct sk_buff *skb) { if (skb->len > skb->dst->pmtu) return ip_fragment(skb, ip_finish_output); else return ip_finish_output(skb); } 2) Can anybody help me how following function works in calcualting checksum? static inline int ip_decrease_ttl(struct iphdr *iph) { u32 check = iph->check; check += __constant_htons(0x0100); iph->check = check + (check>=0xFFFF); return --iph->ttl; } regards, cranium From cranium.2003@gmail.com Sun Jan 30 05:11:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 05:11:11 -0800 (PST) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.199]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0UDB6ZG017308 for ; Sun, 30 Jan 2005 05:11:07 -0800 Received: by rproxy.gmail.com with SMTP id b11so636663rne for ; Sun, 30 Jan 2005 05:11:06 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=RUuvSOxAbPi0WSb/Y6t9hjC7ouhdePw+X+q4j7ExbC/TlU7vL6q/3SU3Nv6AtTilvR9ts+UHyt6Ik8Wean68vVwU68Agd0CvTU2AqfsAZwuKJ4Qy4a0RMwEvsgnuGnun2wU8TYSC8Oc1OQj3d5RJ5wTA8SzeFrE+tQk0RLLw8lA= Received: by 10.38.153.44 with SMTP id a44mr31962rne; Sun, 30 Jan 2005 05:11:06 -0800 (PST) Received: by 10.38.81.57 with HTTP; Sun, 30 Jan 2005 05:11:06 -0800 (PST) Message-ID: <1d55641b05013005116295e61b@mail.gmail.com> Date: Sun, 30 Jan 2005 18:41:06 +0530 From: cranium 2003 Reply-To: cranium 2003 To: netdev@oss.sgi.com Subject: skbuff structure pointers Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1004 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cranium.2003@gmail.com Precedence: bulk X-list: netdev Content-Length: 648 Lines: 15 Hello, By looking into skbuff.h it is clear that paket is stored in skbuff structure which has also many structures defined for each layer as union. Can it be possible to retreive any structure by casting skb->data at any stage once that struct is push to skbuff structure? e.g. by looking in eth.c following statement tells it works but how??? struct ethhdr *eth = (struct ethhdr *)skb->data; Also once a structure is assigned values/pushed it in skbuff structure can it be possible to change its values at any later stage? e.g. in above ethernet case does it possible to change eth->h_proto in ethernet driver file(8390.c) regards, cranium From rmk+netdev=oss.sgi.com@arm.linux.org.uk Sun Jan 30 05:24:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 05:24:17 -0800 (PST) Received: from caramon.arm.linux.org.uk (caramon.arm.linux.org.uk [212.18.232.186]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0UDO6aG018268 for ; Sun, 30 Jan 2005 05:24:08 -0800 Received: from flint.arm.linux.org.uk ([2002:d412:e8ba:1:201:2ff:fe14:8fad]) by caramon.arm.linux.org.uk with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.41) id 1CvF3J-0000nX-DM; Sun, 30 Jan 2005 13:23:45 +0000 Received: from rmk by flint.arm.linux.org.uk with local (Exim 4.41) id 1CvF3I-0006qZ-3q; Sun, 30 Jan 2005 13:23:44 +0000 Date: Sun, 30 Jan 2005 13:23:43 +0000 From: Russell King To: "David S. Miller" , Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? Message-ID: <20050130132343.A25000@flint.arm.linux.org.uk> Mail-Followup-To: "David S. Miller" , Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com References: <20050124114853.A16971@flint.arm.linux.org.uk> <20050125193207.B30094@flint.arm.linux.org.uk> <20050127082809.A20510@flint.arm.linux.org.uk> <20050127004732.5d8e3f62.akpm@osdl.org> <16888.58622.376497.380197@robur.slu.se> <20050127164918.C3036@flint.arm.linux.org.uk> <20050127123326.2eafab35.davem@davemloft.net> <20050128001701.D22695@flint.arm.linux.org.uk> <20050127163444.1bfb673b.davem@davemloft.net> <20050128085858.B9486@flint.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20050128085858.B9486@flint.arm.linux.org.uk>; from rmk+lkml@arm.linux.org.uk on Fri, Jan 28, 2005 at 08:58:59AM +0000 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1005 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rmk+lkml@arm.linux.org.uk Precedence: bulk X-list: netdev Content-Length: 4755 Lines: 118 On Fri, Jan 28, 2005 at 08:58:59AM +0000, Russell King wrote: > On Thu, Jan 27, 2005 at 04:34:44PM -0800, David S. Miller wrote: > > On Fri, 28 Jan 2005 00:17:01 +0000 > > Russell King wrote: > > > Yes. Someone suggested this evening that there may have been a recent > > > change to do with some IPv6 refcounting which may have caused this > > > problem. Is that something you can confirm? > > > > Yep, it would be this change below. Try backing it out and see > > if that makes your leak go away. > > Thanks. I'll try it, but: > > 1. Looking at the date of the change it seems unlikely. The recent > death occurred with 2.6.10-rc2, booted on 29th November and dying > on 19th January, which obviously predates this cset. > 2. It'll take a couple of days to confirm the behaviour of the dst cache. I have another question whether ip6_output.c is the problem - the leak is with ip_dst_cache (== IPv4). If the problem were ip6_output, wouldn't we see ip6_dst_cache leaking instead? Anyway, I've produced some code which keeps a record of the __refcnt increments and decrements, and I think it's produced some interesting results. Essentially, I'm seeing the odd dst entry with a __refcnt of 14000 or so (which is still in active use, so probably ok), and a number with 4, 7, and 13 which haven't had the refcount touched for at least 14 minutes. One of these were created via ip_route_input_slow(), the other three via ip_route_output_slow(). That isn't significant on its own. However, whenever ip_copy_metadata() appears in the refcount log, I see half the number of increments due to that still remaining to be decremented (see the output below). 0 = "mark", positive numbers = increment refcnt this many times, negative numbers = decrement refcnt this many times. I don't know if the code is using fragment lists in ip_fragment(), but on reading the code a question comes to mind: if we have a list of fragments, does each fragment skb have a valid (and refcounted) dst pointer before ip_fragment() does it's job? If yes, then isn't the first ip_copy_metadata() in ip_fragment() going to overwrite this pointer without dropping the refcount? All that said, it's probably far too early to read much into these results - once the machine has been running for more than 19 minutes and has a significant number of "stuck" dst cache entries, I think it'll be far more conclusive. Nevertheless, it looks like food for thought. dst pointer: creation time (200Hz jiffies) last reference time (200Hz jiffies) c1c66260: ffff6c79 ffff879d: location count function c01054f4 0 dst_alloc c0114a80 1 ip_route_input_slow c00fa95c -18 __kfree_skb c0115104 13 ip_route_input c011ae1c 8 ip_copy_metadata c01055ac 0 __dst_free untracked counts : 0 total = 4 next=c1c66b60 refcnt=00000004 use=0000000d dst=24f45cc3 src=0f00a8c0 c1c66b60: ffff20fe ffff5066: c01054f4 0 dst_alloc c01156e8 1 ip_route_output_slow c011b854 6813 ip_append_data c011c7e0 6813 ip_push_pending_frames c00fa95c -6826 __kfree_skb c011c8fc -6813 ip_push_pending_frames c0139dbc -6813 udp_sendmsg c0115a0c 6814 __ip_route_output_key c013764c -2 ip4_datagram_connect c011ae1c 26 ip_copy_metadata c01055ac 0 __dst_free : 0 = 13 next=c1c57680 refcnt=0000000d use=00001a9e dst=bbe812d4 src=bae812d4 c1c66960: ffff89ac ffffa42d: c01054f4 0 dst_alloc c01156e8 1 ip_route_output_slow c011b854 3028 ip_append_data c0139dbc -3028 udp_sendmsg c011c7e0 3028 ip_push_pending_frames c011ae1c 8 ip_copy_metadata c00fa95c -3032 __kfree_skb c011c8fc -3028 ip_push_pending_frames c0115a0c 3027 __ip_route_output_key c01055ac 0 __dst_free : 0 = 4 next=c16d1080 refcnt=00000004 use=00000bd3 dst=bbe812d4 src=bae812d4 c16d1080: ffff879b ffff89af: c01054f4 0 dst_alloc c01156e8 1 ip_route_output_slow c011b854 240 ip_append_data c011c7e0 240 ip_push_pending_frames c00fa95c -247 __kfree_skb c011c8fc -240 ip_push_pending_frames c0139dbc -240 udp_sendmsg c0115a0c 239 __ip_route_output_key c011ae1c 14 ip_copy_metadata c01055ac 0 __dst_free : 0 = 7 next=c1c66260 refcnt=00000007 use=000000ef dst=bbe812d4 src=bae812d4 -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/ 2.6 Serial core From rmk+netdev=oss.sgi.com@arm.linux.org.uk Sun Jan 30 07:35:05 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 07:35:11 -0800 (PST) Received: from caramon.arm.linux.org.uk (caramon.arm.linux.org.uk [212.18.232.186]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0UFZ3T6022163 for ; Sun, 30 Jan 2005 07:35:04 -0800 Received: from flint.arm.linux.org.uk ([2002:d412:e8ba:1:201:2ff:fe14:8fad]) by caramon.arm.linux.org.uk with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.41) id 1CvH6A-00011o-Sk; Sun, 30 Jan 2005 15:34:51 +0000 Received: from rmk by flint.arm.linux.org.uk with local (Exim 4.41) id 1CvH69-00087z-Mw; Sun, 30 Jan 2005 15:34:49 +0000 Date: Sun, 30 Jan 2005 15:34:49 +0000 From: Russell King To: "David S. Miller" , Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? Message-ID: <20050130153449.B25000@flint.arm.linux.org.uk> Mail-Followup-To: "David S. Miller" , Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com References: <20050125193207.B30094@flint.arm.linux.org.uk> <20050127082809.A20510@flint.arm.linux.org.uk> <20050127004732.5d8e3f62.akpm@osdl.org> <16888.58622.376497.380197@robur.slu.se> <20050127164918.C3036@flint.arm.linux.org.uk> <20050127123326.2eafab35.davem@davemloft.net> <20050128001701.D22695@flint.arm.linux.org.uk> <20050127163444.1bfb673b.davem@davemloft.net> <20050128085858.B9486@flint.arm.linux.org.uk> <20050130132343.A25000@flint.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20050130132343.A25000@flint.arm.linux.org.uk>; from rmk+lkml@arm.linux.org.uk on Sun, Jan 30, 2005 at 01:23:43PM +0000 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1006 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rmk+lkml@arm.linux.org.uk Precedence: bulk X-list: netdev Content-Length: 2133 Lines: 44 On Sun, Jan 30, 2005 at 01:23:43PM +0000, Russell King wrote: > Anyway, I've produced some code which keeps a record of the __refcnt > increments and decrements, and I think it's produced some interesting > results. Essentially, I'm seeing the odd dst entry with a __refcnt of > 14000 or so (which is still in active use, so probably ok), and a number > with 4, 7, and 13 which haven't had the refcount touched for at least 14 > minutes. An hour or so goes by. I now have 14 dst cache entries with non-zero refcounts, and these have the following properties: * The five from before (with counts 13, 14473, 4, 4, 7 respectively): + all remain unfreed. + show precisely no change in the refcounts. + the refcount has not been touched for more than an hour. * They have all been touched by ip_copy_metadata. * Their remaining refcounts are precisely half the number of ip_copy_metadata calls in every instance. No entries with a refcount of zero contain ip_copy_metadata() and do appear in /proc/net/rt_cache. The following may also be a pointer - from /proc/net/snmp: Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors ForwDatagrams InUnknownProtos InDiscards InDelivers OutRequests OutDiscards OutNoRoutes ReasmTimeout ReasmReqds ReasmOKs ReasmFails FragOKs FragFails FragCreates Ip: 1 64 140510 0 0 36861 0 0 93549 131703 485 0 21 46622 15695 21 21950 0 0 Since FragCreates is 0, this means that we are using the frag_lists rather than creating our own fragments (and indeed the first ip_copy_metadata() call rather than the second in ip_fragment()). I think the case against the IPv4 fragmentation code is mounting. However, without knowing what the expected conditions for this code, (eg, are skbs on the fraglist supposed to have NULL skb->dst?) I'm unable to progress this any further. However, I think it's quite clear that there is something bad going on here. Why many more people aren't seeing this I've no idea. -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/ 2.6 Serial core From rmk+netdev=oss.sgi.com@arm.linux.org.uk Sun Jan 30 08:08:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 08:08:53 -0800 (PST) Received: from caramon.arm.linux.org.uk (caramon.arm.linux.org.uk [212.18.232.186]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0UG8m9V023487 for ; Sun, 30 Jan 2005 08:08:48 -0800 Received: from flint.arm.linux.org.uk ([2002:d412:e8ba:1:201:2ff:fe14:8fad]) by caramon.arm.linux.org.uk with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.41) id 1CvHcv-000140-G9 for netdev@oss.sgi.com; Sun, 30 Jan 2005 16:08:41 +0000 Received: from rmk by flint.arm.linux.org.uk with local (Exim 4.41) id 1CvHcu-0008Vn-Dh for netdev@oss.sgi.com; Sun, 30 Jan 2005 16:08:40 +0000 Date: Sun, 30 Jan 2005 16:08:40 +0000 From: Russell King To: netdev@oss.sgi.com Subject: ip -6 route shows incorrect route expiry times Message-ID: <20050130160840.C25000@flint.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1007 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rmk@arm.linux.org.uk Precedence: bulk X-list: netdev Content-Length: 631 Lines: 16 This looks like a unit conversion error, spotted in Red Hat FC2. On it's own, it doesn't look like there's anything wrong, until you look at two copies of the output 10 seconds apart: rmk@dyn-67:[bk]:<1030> /sbin/ip -6 route; sleep 10; /sbin/ip -6 route default via fe80::a00:2bff:fe95:1d7b dev eth0 proto kernel metric 1024 expires 169sec mtu 1500 advmss 1440 default via fe80::a00:2bff:fe95:1d7b dev eth0 proto kernel metric 1024 expires 168sec mtu 1500 advmss 1440 It appears that the expiry seconds here are actually in units of 10 seconds. Maybe someone's double-converting kernel Hz to user Hz? -- Russell King From yoshfuji@linux-ipv6.org Sun Jan 30 08:28:19 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 08:28:25 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0UGSIfh027723 for ; Sun, 30 Jan 2005 08:28:19 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id E946033CC2; Mon, 31 Jan 2005 01:29:10 +0900 (JST) Date: Mon, 31 Jan 2005 01:29:10 +0900 (JST) Message-Id: <20050131.012910.117562374.yoshfuji@linux-ipv6.org> To: rmk@arm.linux.org.uk Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: ip -6 route shows incorrect route expiry times From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20050130160840.C25000@flint.arm.linux.org.uk> References: <20050130160840.C25000@flint.arm.linux.org.uk> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1008 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Content-Length: 694 Lines: 15 In article <20050130160840.C25000@flint.arm.linux.org.uk> (at Sun, 30 Jan 2005 16:08:40 +0000), Russell King says: > rmk@dyn-67:[bk]:<1030> /sbin/ip -6 route; sleep 10; /sbin/ip -6 route > default via fe80::a00:2bff:fe95:1d7b dev eth0 proto kernel metric 1024 > expires 169sec mtu 1500 advmss 1440 > default via fe80::a00:2bff:fe95:1d7b dev eth0 proto kernel metric 1024 > expires 168sec mtu 1500 advmss 1440 > > It appears that the expiry seconds here are actually in units of > 10 seconds. Maybe someone's double-converting kernel Hz to user Hz? Kernel exports in USER_HZ. iproute2 seem to convert it again; workaround is to do "export HZ=100". --yoshfuji From yoshfuji@linux-ipv6.org Sun Jan 30 08:29:27 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 08:29:32 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0UGTQsP028043 for ; Sun, 30 Jan 2005 08:29:26 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id E5F5F33CC2; Mon, 31 Jan 2005 01:30:18 +0900 (JST) Date: Mon, 31 Jan 2005 01:30:18 +0900 (JST) Message-Id: <20050131.013018.131301320.yoshfuji@linux-ipv6.org> To: rmk@arm.linux.org.uk Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: ip -6 route shows incorrect route expiry times From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20050131.012910.117562374.yoshfuji@linux-ipv6.org> References: <20050130160840.C25000@flint.arm.linux.org.uk> <20050131.012910.117562374.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1009 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Content-Length: 562 Lines: 11 In article <20050131.012910.117562374.yoshfuji@linux-ipv6.org> (at Mon, 31 Jan 2005 01:29:10 +0900 (JST)), YOSHIFUJI Hideaki / $B5HF#1QL@(B says: > > It appears that the expiry seconds here are actually in units of > > 10 seconds. Maybe someone's double-converting kernel Hz to user Hz? > > Kernel exports in USER_HZ. > iproute2 seem to convert it again; workaround is to do "export HZ=100". ~~~~~~~~~~~~~ This is example. Of course, this depends on your arch. --yoshfuji From alan@lxorguk.ukuu.org.uk Sun Jan 30 08:44:56 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 08:45:02 -0800 (PST) Received: from lxorguk.ukuu.org.uk (clock-tower.bc.nu [81.2.110.250] (may be forged)) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0UGisLM028926 for ; Sun, 30 Jan 2005 08:44:56 -0800 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by lxorguk.ukuu.org.uk (8.12.11/8.12.11) with ESMTP id j0UFe5fh000726; Sun, 30 Jan 2005 15:40:05 GMT Received: (from alan@localhost) by localhost.localdomain (8.12.11/8.12.11/Submit) id j0UFe0dS000722; Sun, 30 Jan 2005 15:40:00 GMT X-Authentication-Warning: localhost.localdomain: alan set sender to alan@lxorguk.ukuu.org.uk using -f Subject: Re: waiting for ppp0 to become free (Re: ppp0 out of control) From: Alan Cox To: =?ISO-8859-1?Q?Aur=E9lien_G=C9R=D4ME?= Cc: Linux Kernel Mailing List , Janos Farkas , netdev@oss.sgi.com In-Reply-To: <20050126203118.GB3705@roxor.be> References: <20050121144444.GA2100@roxor.be> <20050126094422.GA31040@lk8rp.mail.xeon.eu.org> <20050126203118.GB3705@roxor.be> Content-Type: text/plain; charset=UTF-8 Message-Id: <1106857106.14782.56.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Sun, 30 Jan 2005 15:39:56 +0000 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j0UGisLM028926 X-archive-position: 1010 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: alan@lxorguk.ukuu.org.uk Precedence: bulk X-list: netdev Content-Length: 626 Lines: 16 On Mer, 2005-01-26 at 20:31, Aurélien GÉRÔME wrote: > Yep, 2.6.8.1 works fine, this issue appears on 2.6.9 and 2.6.10. I > switched to a Debian 2.6.10 kernel for security reasons, and > the issue has not come yet. I had a glance at the changelog and > saw some network related patches. This is the -as patchset, see > about it. 2.6.9 changed the tty hangup code and this did introduce a problem with serial ppp ignoring hangups. That was fixed in 2.6.9-ac and the fix is in 2.6.10. If you are using serial ppp the 2.6.8 to 9 breakage is known but the 2.6.10 case should be fine. Alan From kernel@linuxace.com Sun Jan 30 08:57:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 08:57:13 -0800 (PST) Received: from linuxace.com (adsl-67-120-171-161.dsl.lsan03.pacbell.net [67.120.171.161]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0UGv8NN029692 for ; Sun, 30 Jan 2005 08:57:08 -0800 Received: (qmail 14723 invoked by uid 0); 30 Jan 2005 16:57:02 -0000 Date: Sun, 30 Jan 2005 08:57:02 -0800 From: Phil Oester To: "David S. Miller" , Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? Message-ID: <20050130165702.GA14642@linuxace.com> References: <20050127082809.A20510@flint.arm.linux.org.uk> <20050127004732.5d8e3f62.akpm@osdl.org> <16888.58622.376497.380197@robur.slu.se> <20050127164918.C3036@flint.arm.linux.org.uk> <20050127123326.2eafab35.davem@davemloft.net> <20050128001701.D22695@flint.arm.linux.org.uk> <20050127163444.1bfb673b.davem@davemloft.net> <20050128085858.B9486@flint.arm.linux.org.uk> <20050130132343.A25000@flint.arm.linux.org.uk> <20050130153449.B25000@flint.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050130153449.B25000@flint.arm.linux.org.uk> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1011 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kernel@linuxace.com Precedence: bulk X-list: netdev Content-Length: 735 Lines: 18 On Sun, Jan 30, 2005 at 03:34:49PM +0000, Russell King wrote: > I think the case against the IPv4 fragmentation code is mounting. > However, without knowing what the expected conditions for this code, > (eg, are skbs on the fraglist supposed to have NULL skb->dst?) I'm > unable to progress this any further. However, I think it's quite > clear that there is something bad going on here. Interesting...the gateway which exhibits the problem fastest in my area does have a large number of fragmented UDP packets running through it, as shown by tcpdump 'ip[6:2] & 0x1fff != 0'. > Why many more people aren't seeing this I've no idea. Perhaps you (and I) experience more fragments than the average user??? Nice detective work! Phil From kaber@trash.net Sun Jan 30 09:10:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 09:10:18 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0UHAAWU030443 for ; Sun, 30 Jan 2005 09:10:11 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.43) id 1CvIaD-00007j-1l; Sun, 30 Jan 2005 18:09:57 +0100 Message-ID: <41FD14E4.8010305@trash.net> Date: Sun, 30 Jan 2005 18:09:56 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050106 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: yoshfuji@linux-ipv6.org CC: rmk@arm.linux.org.uk, netdev@oss.sgi.com Subject: Re: ip -6 route shows incorrect route expiry times References: <20050130160840.C25000@flint.arm.linux.org.uk> <20050131.012910.117562374.yoshfuji@linux-ipv6.org> In-Reply-To: <20050131.012910.117562374.yoshfuji@linux-ipv6.org> Content-Type: multipart/mixed; boundary="------------070503020703030504000401" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1012 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 3984 Lines: 141 This is a multi-part message in MIME format. --------------070503020703030504000401 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit YOSHIFUJI Hideaki / $B5HF#1QL@ wrote: >In article <20050130160840.C25000@flint.arm.linux.org.uk> (at Sun, 30 Jan 2005 16:08:40 +0000), Russell King says: > > >>rmk@dyn-67:[bk]:<1030> /sbin/ip -6 route; sleep 10; /sbin/ip -6 route >>default via fe80::a00:2bff:fe95:1d7b dev eth0 proto kernel metric 1024 >> expires 169sec mtu 1500 advmss 1440 >>default via fe80::a00:2bff:fe95:1d7b dev eth0 proto kernel metric 1024 >> expires 168sec mtu 1500 advmss 1440 >> >>It appears that the expiry seconds here are actually in units of >>10 seconds. Maybe someone's double-converting kernel Hz to user Hz? >> > >Kernel exports in USER_HZ. >iproute2 seem to convert it again; workaround is to do "export HZ=100". > I've sent this fix to Stephen yesterday. Regards Patrick --------------070503020703030504000401 Content-Type: text/plain; name="x" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="x" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2005/01/29 10:59:53+01:00 kaber@coreworks.de # Use USER_HZ where necessary # # BitKeeper/etc/logging_ok # 2005/01/29 10:59:51+01:00 kaber@coreworks.de +1 -0 # Logging to logging@openlogging.org accepted # # tc/tc_util.c # 2005/01/29 10:59:48+01:00 kaber@coreworks.de +1 -1 # Use USER_HZ where necessary # # lib/utils.c # 2005/01/29 10:59:48+01:00 kaber@coreworks.de +7 -0 # Use USER_HZ where necessary # # ip/iproute.c # 2005/01/29 10:59:48+01:00 kaber@coreworks.de +3 -3 # Use USER_HZ where necessary # # include/utils.h # 2005/01/29 10:59:48+01:00 kaber@coreworks.de +10 -0 # Use USER_HZ where necessary # diff -Nru a/include/utils.h b/include/utils.h --- a/include/utils.h 2005-01-30 18:08:57 +01:00 +++ b/include/utils.h 2005-01-30 18:08:57 +01:00 @@ -113,4 +113,14 @@ return __iproute2_hz_internal; } +extern int __iproute2_user_hz_internal; +extern int __get_user_hz(void); + +static __inline__ int get_user_hz(void) +{ + if (__iproute2_user_hz_internal == 0) + __iproute2_user_hz_internal = __get_user_hz(); + return __iproute2_user_hz_internal; +} + #endif /* __UTILS_H__ */ diff -Nru a/ip/iproute.c b/ip/iproute.c --- a/ip/iproute.c 2005-01-30 18:08:57 +01:00 +++ b/ip/iproute.c 2005-01-30 18:08:57 +01:00 @@ -412,7 +412,7 @@ struct rta_cacheinfo *ci = RTA_DATA(tb[RTA_CACHEINFO]); static int hz; if (!hz) - hz = get_hz(); + hz = get_user_hz(); if (ci->rta_expires != 0) fprintf(fp, " expires %dsec", ci->rta_expires/hz); if (ci->rta_error != 0) @@ -439,7 +439,7 @@ if ((r->rtm_flags & RTM_F_CLONED) || (ci && ci->rta_expires)) { static int hz; if (!hz) - hz = get_hz(); + hz = get_user_hz(); if (r->rtm_flags & RTM_F_CLONED) fprintf(fp, "%s cache ", _SL_); if (ci->rta_expires) @@ -491,7 +491,7 @@ if (i-2 < sizeof(mx_names)/sizeof(char*)) fprintf(fp, " %s", mx_names[i-2]); else - fprintf(fp, " metric%d", i); + fprintf(fp, " metric %d", i); if (mxlock & (1<install != 0) fprintf(f, " installed %d sec", tm->install/hz); if (tm->lastuse != 0) --------------070503020703030504000401-- From david@hardeman.nu Sun Jan 30 09:18:56 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 09:18:59 -0800 (PST) Received: from palpatine.hardeman.nu (1-1-12-13a.han.sth.bostream.se [82.182.30.168]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0UHItSq031023 for ; Sun, 30 Jan 2005 09:18:56 -0800 Received: from david by palpatine.hardeman.nu with local (Exim 4.34) id 1CvIin-0000sD-3v; Sun, 30 Jan 2005 18:18:49 +0100 Date: Sun, 30 Jan 2005 18:18:49 +0100 From: David =?iso-8859-1?Q?H=E4rdeman?= To: linux-kernel@vger.kernel.org Cc: netdev@oss.sgi.com Subject: Re: 2.4.29, e100 and a WOL packet causes keventd going mad Message-ID: <20050130171849.GA3354@hardeman.nu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1013 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: david@2gen.com Precedence: bulk X-list: netdev Content-Length: 825 Lines: 27 Hi, I experience the same problems as reported by Michael Gernoth when sending a WOL-packet to computer with a e100 NIC which is already powered on. In my case, it's running kernel 2.6.8.1 and the NIC is identified by lspci as: 0000:02:08.0 Ethernet controller: Intel Corp. 82562EZ 10/100 Ethernet Controller (rev 02) or numerically: 0000:02:08.0 0200: 8086:1050 (rev 02) The symptoms is that kacpid starts using all the CPU time it can, a shutdown takes 5 - 10 minutes after I've done this (in contrast to 20 - 30 seconds when the machine is healthy). Also, if I do a "shutdown -h" on the machine after sending a WOL packet when it's already powered up, it will shutdown and immediately start up again instead of powering off. So, any suggestions on how to fix it? Regards, David Please CC me on any replies. From kaber@trash.net Sun Jan 30 09:23:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 09:23:53 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0UHNmJo031602 for ; Sun, 30 Jan 2005 09:23:48 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.43) id 1CvIn0-00009b-T0; Sun, 30 Jan 2005 18:23:10 +0100 Message-ID: <41FD17FE.6050007@trash.net> Date: Sun, 30 Jan 2005 18:23:10 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050106 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: Russell King CC: "David S. Miller" , Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? References: <20050124114853.A16971@flint.arm.linux.org.uk> <20050125193207.B30094@flint.arm.linux.org.uk> <20050127082809.A20510@flint.arm.linux.org.uk> <20050127004732.5d8e3f62.akpm@osdl.org> <16888.58622.376497.380197@robur.slu.se> <20050127164918.C3036@flint.arm.linux.org.uk> <20050127123326.2eafab35.davem@davemloft.net> <20050128001701.D22695@flint.arm.linux.org.uk> <20050127163444.1bfb673b.davem@davemloft.net> <20050128085858.B9486@flint.arm.linux.org.uk> <20050130132343.A25000@flint.arm.linux.org.uk> In-Reply-To: <20050130132343.A25000@flint.arm.linux.org.uk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1014 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 535 Lines: 15 Russell King wrote: >I don't know if the code is using fragment lists in ip_fragment(), but >on reading the code a question comes to mind: if we have a list of >fragments, does each fragment skb have a valid (and refcounted) dst >pointer before ip_fragment() does it's job? If yes, then isn't the >first ip_copy_metadata() in ip_fragment() going to overwrite this >pointer without dropping the refcount? > Nice spotting. If conntrack isn't loaded defragmentation happens after routing, so this is likely the cause. Regards Patrick From kaber@trash.net Sun Jan 30 09:27:05 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 09:27:09 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0UHR4vM032123 for ; Sun, 30 Jan 2005 09:27:05 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.43) id 1CvIqD-0000AE-2x; Sun, 30 Jan 2005 18:26:29 +0100 Message-ID: <41FD18C5.6090108@trash.net> Date: Sun, 30 Jan 2005 18:26:29 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050106 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: Patrick McHardy CC: Russell King , "David S. Miller" , Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? References: <20050124114853.A16971@flint.arm.linux.org.uk> <20050125193207.B30094@flint.arm.linux.org.uk> <20050127082809.A20510@flint.arm.linux.org.uk> <20050127004732.5d8e3f62.akpm@osdl.org> <16888.58622.376497.380197@robur.slu.se> <20050127164918.C3036@flint.arm.linux.org.uk> <20050127123326.2eafab35.davem@davemloft.net> <20050128001701.D22695@flint.arm.linux.org.uk> <20050127163444.1bfb673b.davem@davemloft.net> <20050128085858.B9486@flint.arm.linux.org.uk> <20050130132343.A25000@flint.arm.linux.org.uk> <41FD17FE.6050007@trash.net> In-Reply-To: <41FD17FE.6050007@trash.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1015 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 721 Lines: 22 Patrick McHardy wrote: > Russell King wrote: > >> I don't know if the code is using fragment lists in ip_fragment(), but >> on reading the code a question comes to mind: if we have a list of >> fragments, does each fragment skb have a valid (and refcounted) dst >> pointer before ip_fragment() does it's job? If yes, then isn't the >> first ip_copy_metadata() in ip_fragment() going to overwrite this >> pointer without dropping the refcount? >> > Nice spotting. If conntrack isn't loaded defragmentation happens after > routing, so this is likely the cause. OTOH, if conntrack isn't loaded forwarded packet are never defragmented, so frag_list should be empty. So probably false alarm, sorry. > Regards > Patrick From kaber@trash.net Sun Jan 30 09:59:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 09:59:11 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0UHx5Rj001058 for ; Sun, 30 Jan 2005 09:59:06 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.43) id 1CvJL9-0000tH-Lo; Sun, 30 Jan 2005 18:58:27 +0100 Message-ID: <41FD2043.3070303@trash.net> Date: Sun, 30 Jan 2005 18:58:27 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050106 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: Russell King CC: "David S. Miller" , Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? References: <20050124114853.A16971@flint.arm.linux.org.uk> <20050125193207.B30094@flint.arm.linux.org.uk> <20050127082809.A20510@flint.arm.linux.org.uk> <20050127004732.5d8e3f62.akpm@osdl.org> <16888.58622.376497.380197@robur.slu.se> <20050127164918.C3036@flint.arm.linux.org.uk> <20050127123326.2eafab35.davem@davemloft.net> <20050128001701.D22695@flint.arm.linux.org.uk> <20050127163444.1bfb673b.davem@davemloft.net> <20050128085858.B9486@flint.arm.linux.org.uk> <20050130132343.A25000@flint.arm.linux.org.uk> <41FD17FE.6050007@trash.net> <41FD18C5.6090108@trash.net> In-Reply-To: <41FD18C5.6090108@trash.net> Content-Type: multipart/mixed; boundary="------------040300010404060807050900" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1016 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 1636 Lines: 51 This is a multi-part message in MIME format. --------------040300010404060807050900 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Patrick McHardy wrote: >> Russell King wrote: >> >>> I don't know if the code is using fragment lists in ip_fragment(), but >>> on reading the code a question comes to mind: if we have a list of >>> fragments, does each fragment skb have a valid (and refcounted) dst >>> pointer before ip_fragment() does it's job? If yes, then isn't the >>> first ip_copy_metadata() in ip_fragment() going to overwrite this >>> pointer without dropping the refcount? >>> >> Nice spotting. If conntrack isn't loaded defragmentation happens after >> routing, so this is likely the cause. > > > OTOH, if conntrack isn't loaded forwarded packet are never defragmented, > so frag_list should be empty. So probably false alarm, sorry. Ok, final decision: you are right :) conntrack also defragments locally generated packets before they hit ip_fragment. In this case the fragments have skb->dst set. Regards Patrick --------------040300010404060807050900 Content-Type: text/plain; name="x" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="x" ===== net/ipv4/ip_output.c 1.74 vs edited ===== --- 1.74/net/ipv4/ip_output.c 2005-01-25 01:40:10 +01:00 +++ edited/net/ipv4/ip_output.c 2005-01-30 18:54:43 +01:00 @@ -389,6 +389,7 @@ to->priority = from->priority; to->protocol = from->protocol; to->security = from->security; + dst_release(to->dst); to->dst = dst_clone(from->dst); to->dev = from->dev; --------------040300010404060807050900-- From rmk+netdev=oss.sgi.com@arm.linux.org.uk Sun Jan 30 10:02:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 10:02:15 -0800 (PST) Received: from caramon.arm.linux.org.uk (caramon.arm.linux.org.uk [212.18.232.186]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0UI27bp001602 for ; Sun, 30 Jan 2005 10:02:08 -0800 Received: from flint.arm.linux.org.uk ([2002:d412:e8ba:1:201:2ff:fe14:8fad]) by caramon.arm.linux.org.uk with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.41) id 1CvJOS-00018Y-5p; Sun, 30 Jan 2005 18:01:52 +0000 Received: from rmk by flint.arm.linux.org.uk with local (Exim 4.41) id 1CvJON-0001IW-Vl; Sun, 30 Jan 2005 18:01:48 +0000 Date: Sun, 30 Jan 2005 18:01:46 +0000 From: Russell King To: Patrick McHardy Cc: "David S. Miller" , Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? Message-ID: <20050130180146.E25000@flint.arm.linux.org.uk> Mail-Followup-To: Patrick McHardy , "David S. Miller" , Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com References: <20050127004732.5d8e3f62.akpm@osdl.org> <16888.58622.376497.380197@robur.slu.se> <20050127164918.C3036@flint.arm.linux.org.uk> <20050127123326.2eafab35.davem@davemloft.net> <20050128001701.D22695@flint.arm.linux.org.uk> <20050127163444.1bfb673b.davem@davemloft.net> <20050128085858.B9486@flint.arm.linux.org.uk> <20050130132343.A25000@flint.arm.linux.org.uk> <41FD17FE.6050007@trash.net> <41FD18C5.6090108@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <41FD18C5.6090108@trash.net>; from kaber@trash.net on Sun, Jan 30, 2005 at 06:26:29PM +0100 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1017 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rmk+lkml@arm.linux.org.uk Precedence: bulk X-list: netdev Content-Length: 1343 Lines: 31 On Sun, Jan 30, 2005 at 06:26:29PM +0100, Patrick McHardy wrote: > Patrick McHardy wrote: > > > Russell King wrote: > > > >> I don't know if the code is using fragment lists in ip_fragment(), but > >> on reading the code a question comes to mind: if we have a list of > >> fragments, does each fragment skb have a valid (and refcounted) dst > >> pointer before ip_fragment() does it's job? If yes, then isn't the > >> first ip_copy_metadata() in ip_fragment() going to overwrite this > >> pointer without dropping the refcount? > >> > > Nice spotting. If conntrack isn't loaded defragmentation happens after > > routing, so this is likely the cause. > > OTOH, if conntrack isn't loaded forwarded packet are never defragmented, > so frag_list should be empty. So probably false alarm, sorry. I've just checked Phil's mails - both Phil and myself are using netfilter on the troublesome boxen. Also, since FragCreates is zero, and this does mean that the frag_list is not empty in all cases so far where ip_fragment() has been called. (Reading the code, if frag_list was empty, we'd have to create some fragments, which increments the FragCreates statistic.) -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/ 2.6 Serial core From kernel@linuxace.com Sun Jan 30 10:19:19 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 10:19:23 -0800 (PST) Received: from linuxace.com (adsl-67-120-171-161.dsl.lsan03.pacbell.net [67.120.171.161]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0UIJI8r002541 for ; Sun, 30 Jan 2005 10:19:19 -0800 Received: (qmail 15687 invoked by uid 0); 30 Jan 2005 18:19:13 -0000 Date: Sun, 30 Jan 2005 10:19:13 -0800 From: Phil Oester To: Patrick McHardy , "David S. Miller" , Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? Message-ID: <20050130181913.GA15299@linuxace.com> References: <16888.58622.376497.380197@robur.slu.se> <20050127164918.C3036@flint.arm.linux.org.uk> <20050127123326.2eafab35.davem@davemloft.net> <20050128001701.D22695@flint.arm.linux.org.uk> <20050127163444.1bfb673b.davem@davemloft.net> <20050128085858.B9486@flint.arm.linux.org.uk> <20050130132343.A25000@flint.arm.linux.org.uk> <41FD17FE.6050007@trash.net> <41FD18C5.6090108@trash.net> <20050130180146.E25000@flint.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050130180146.E25000@flint.arm.linux.org.uk> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1018 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kernel@linuxace.com Precedence: bulk X-list: netdev Content-Length: 838 Lines: 25 On Sun, Jan 30, 2005 at 06:01:46PM +0000, Russell King wrote: > > OTOH, if conntrack isn't loaded forwarded packet are never defragmented, > > so frag_list should be empty. So probably false alarm, sorry. > > I've just checked Phil's mails - both Phil and myself are using > netfilter on the troublesome boxen. > > Also, since FragCreates is zero, and this does mean that the frag_list > is not empty in all cases so far where ip_fragment() has been called. > (Reading the code, if frag_list was empty, we'd have to create some > fragments, which increments the FragCreates statistic.) The below testcase seems to illustrate the problem nicely -- ip_dst_cache grows but never shrinks: On gateway: iptables -I FORWARD -d 10.10.10.0/24 -j DROP On client: for i in `seq 1 254` ; do ping -s 1500 -c 5 -w 1 -f 10.10.10.$i ; done Phil From rmk+netdev=oss.sgi.com@arm.linux.org.uk Sun Jan 30 10:45:32 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 10:45:38 -0800 (PST) Received: from caramon.arm.linux.org.uk (caramon.arm.linux.org.uk [212.18.232.186]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0UIjVto003743 for ; Sun, 30 Jan 2005 10:45:32 -0800 Received: from flint.arm.linux.org.uk ([2002:d412:e8ba:1:201:2ff:fe14:8fad]) by caramon.arm.linux.org.uk with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.41) id 1CvK4L-0000pH-N8; Sun, 30 Jan 2005 18:45:10 +0000 Received: from rmk by flint.arm.linux.org.uk with local (Exim 4.41) id 1CvK4K-0001iW-3f; Sun, 30 Jan 2005 18:45:08 +0000 Date: Sun, 30 Jan 2005 18:45:07 +0000 From: Russell King To: Patrick McHardy Cc: "David S. Miller" , Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? Message-ID: <20050130184507.F25000@flint.arm.linux.org.uk> Mail-Followup-To: Patrick McHardy , "David S. Miller" , Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com References: <16888.58622.376497.380197@robur.slu.se> <20050127164918.C3036@flint.arm.linux.org.uk> <20050127123326.2eafab35.davem@davemloft.net> <20050128001701.D22695@flint.arm.linux.org.uk> <20050127163444.1bfb673b.davem@davemloft.net> <20050128085858.B9486@flint.arm.linux.org.uk> <20050130132343.A25000@flint.arm.linux.org.uk> <41FD17FE.6050007@trash.net> <41FD18C5.6090108@trash.net> <41FD2043.3070303@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <41FD2043.3070303@trash.net>; from kaber@trash.net on Sun, Jan 30, 2005 at 06:58:27PM +0100 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1019 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rmk+lkml@arm.linux.org.uk Precedence: bulk X-list: netdev Content-Length: 1821 Lines: 46 On Sun, Jan 30, 2005 at 06:58:27PM +0100, Patrick McHardy wrote: > Patrick McHardy wrote: > >> Russell King wrote: > >>> I don't know if the code is using fragment lists in ip_fragment(), but > >>> on reading the code a question comes to mind: if we have a list of > >>> fragments, does each fragment skb have a valid (and refcounted) dst > >>> pointer before ip_fragment() does it's job? If yes, then isn't the > >>> first ip_copy_metadata() in ip_fragment() going to overwrite this > >>> pointer without dropping the refcount? > >>> > >> Nice spotting. If conntrack isn't loaded defragmentation happens after > >> routing, so this is likely the cause. > > > > OTOH, if conntrack isn't loaded forwarded packet are never defragmented, > > so frag_list should be empty. So probably false alarm, sorry. > > Ok, final decision: you are right :) conntrack also defragments locally > generated packets before they hit ip_fragment. In this case the fragments > have skb->dst set. Good news - with this in place, I no longer have refcounts of 14000! After 18 minutes (the first clearout of the dst cache from 500 odd down to 11 or so), all dst cache entries have a ref count of zero. I'll check it again later this evening to be sure. Thanks Patrick. > ===== net/ipv4/ip_output.c 1.74 vs edited ===== > --- 1.74/net/ipv4/ip_output.c 2005-01-25 01:40:10 +01:00 > +++ edited/net/ipv4/ip_output.c 2005-01-30 18:54:43 +01:00 > @@ -389,6 +389,7 @@ > to->priority = from->priority; > to->protocol = from->protocol; > to->security = from->security; > + dst_release(to->dst); > to->dst = dst_clone(from->dst); > to->dev = from->dev; > -- Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/ 2.6 Serial core From ralf@linux-mips.org Sun Jan 30 13:44:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 13:44:30 -0800 (PST) Received: from mail.linux-mips.net (alg138.algor.co.uk [62.254.210.138] (may be forged)) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ULiOxY013219 for ; Sun, 30 Jan 2005 13:44:25 -0800 Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1]) by mail.linux-mips.net (8.13.1/8.13.1) with ESMTP id j0ULeclT006992 for ; Sun, 30 Jan 2005 21:40:38 GMT Received: (from ralf@localhost) by dea.linux-mips.net (8.13.1/8.13.1/Submit) id j0ULecjx006991 for netdev@oss.sgi.com; Sun, 30 Jan 2005 21:40:38 GMT Resent-Message-Id: <200501302140.j0ULecjx006991@dea.linux-mips.net> Date: Sun, 30 Jan 2005 21:21:47 +0000 From: Ralf Baechle DL5RB To: linux-hams@vger.kernel.org Cc: netdev@oss.sgi.com Subject: [PATCH 1/9] Use netdev_priv in NETROM and ROSE Message-ID: <20050130212147.GA6399@linux-mips.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Resent-From: ralf@linux-mips.org Resent-Date: Sun, 30 Jan 2005 21:40:38 +0000 Resent-To: netdev@oss.sgi.com X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1021 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ralf@linux-mips.org Precedence: bulk X-list: netdev Content-Length: 2419 Lines: 78 Convert the NETROM and ROSE protocol stacks to use netdev_priv(). netrom/nr_dev.c | 8 ++++---- rose/rose_dev.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) Index: bk-afu/net/netrom/nr_dev.c =================================================================== --- bk-afu.orig/net/netrom/nr_dev.c +++ bk-afu/net/netrom/nr_dev.c @@ -46,7 +46,7 @@ int nr_rx_ip(struct sk_buff *skb, struct net_device *dev) { - struct net_device_stats *stats = (struct net_device_stats *)dev->priv; + struct net_device_stats *stats = netdev_priv(dev); if (!netif_running(dev)) { stats->rx_errors++; @@ -73,7 +73,7 @@ static int nr_rebuild_header(struct sk_buff *skb) { struct net_device *dev = skb->dev; - struct net_device_stats *stats = (struct net_device_stats *)dev->priv; + struct net_device_stats *stats = netdev_priv(dev); struct sk_buff *skbn; unsigned char *bp = skb->data; int len; @@ -186,7 +186,7 @@ static int nr_xmit(struct sk_buff *skb, struct net_device *dev) { - struct net_device_stats *stats = (struct net_device_stats *)dev->priv; + struct net_device_stats *stats = netdev_priv(dev); dev_kfree_skb(skb); stats->tx_errors++; return 0; @@ -194,7 +194,7 @@ static struct net_device_stats *nr_get_stats(struct net_device *dev) { - return (struct net_device_stats *)dev->priv; + return netdev_priv(dev); } void nr_setup(struct net_device *dev) Index: bk-afu/net/rose/rose_dev.c =================================================================== --- bk-afu.orig/net/rose/rose_dev.c +++ bk-afu/net/rose/rose_dev.c @@ -57,7 +57,7 @@ static int rose_rebuild_header(struct sk_buff *skb) { struct net_device *dev = skb->dev; - struct net_device_stats *stats = (struct net_device_stats *)dev->priv; + struct net_device_stats *stats = netdev_priv(dev); unsigned char *bp = (unsigned char *)skb->data; struct sk_buff *skbn; @@ -117,7 +117,7 @@ static int rose_xmit(struct sk_buff *skb, struct net_device *dev) { - struct net_device_stats *stats = (struct net_device_stats *)dev->priv; + struct net_device_stats *stats = netdev_priv(dev); if (!netif_running(dev)) { printk(KERN_ERR "ROSE: rose_xmit - called when iface is down\n"); @@ -130,7 +130,7 @@ static struct net_device_stats *rose_get_stats(struct net_device *dev) { - return (struct net_device_stats *)dev->priv; + return netdev_priv(dev); } void rose_setup(struct net_device *dev) From ralf@linux-mips.org Sun Jan 30 13:44:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 13:44:10 -0800 (PST) Received: from mail.linux-mips.net (alg138.algor.co.uk [62.254.210.138] (may be forged)) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0ULi37g013163 for ; Sun, 30 Jan 2005 13:44:04 -0800 Received: from dea.linux-mips.net (localhost.localdomain [127.0.0.1]) by mail.linux-mips.net (8.13.1/8.13.1) with ESMTP id j0ULeGld006986 for ; Sun, 30 Jan 2005 21:40:16 GMT Received: (from ralf@localhost) by dea.linux-mips.net (8.13.1/8.13.1/Submit) id j0ULeFPX006985 for netdev@oss.sgi.com; Sun, 30 Jan 2005 21:40:15 GMT Resent-Message-Id: <200501302140.j0ULeFPX006985@dea.linux-mips.net> Date: Sun, 30 Jan 2005 21:20:07 +0000 From: Ralf Baechle DL5RB To: linux-hams@vger.kernel.org Cc: Jeff Garzik , netdev@oss.sgi.com Subject: [PATCH 0/9] Testers needed for ham radio patches Message-ID: <20050130212007.GA6073@linux-mips.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Resent-From: ralf@linux-mips.org Resent-Date: Sun, 30 Jan 2005 21:40:15 +0000 Resent-To: netdev@oss.sgi.com X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1020 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ralf@linux-mips.org Precedence: bulk X-list: netdev Content-Length: 471 Lines: 11 I've cooked a series of patches that convert most of the ham radio drivers and core code to convert them to use the netdev_priv() macro which was introduced a while ago. Lacking all the hardware for testing in the hope for testers. I left out the SCC and DMASCC drivers; they're looking too scarry to touch without having hardware. The patches are compile tested and I consider them low risk, so probably safe to merged right away if you'd like. 73 de DL5RB op Ralf From hadi@znyx.com Sun Jan 30 14:12:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 14:12:36 -0800 (PST) Received: from lotus.znyx.com (znx208-2-156-007.znyx.com [208.2.156.7]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0UMCK8A015269 for ; Sun, 30 Jan 2005 14:12:21 -0800 Received: from [127.0.0.1] ([208.2.156.2]) by lotus.znyx.com (Lotus Domino Release 5.0.11) with ESMTP id 2005013014112061:27640 ; Sun, 30 Jan 2005 14:11:20 -0800 Subject: dummy as IMQ replacement From: Jamal Hadi Salim Reply-To: hadi@znyx.com To: netdev@oss.sgi.com Cc: Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto Organization: ZNYX Networks Message-Id: <1107123123.8021.80.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 30 Jan 2005 17:12:04 -0500 X-MIMETrack: Itemize by SMTP Server on Lotus/Znyx(Release 5.0.11 |July 24, 2002) at 01/30/2005 02:11:22 PM, Serialize by Router on Lotus/Znyx(Release 5.0.11 |July 24, 2002) at 01/30/2005 02:11:34 PM, Serialize complete at 01/30/2005 02:11:34 PM Content-Type: multipart/mixed; boundary="=-69HkpMiEza1wGz3le8L6" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1022 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@znyx.com Precedence: bulk X-list: netdev Content-Length: 14393 Lines: 475 --=-69HkpMiEza1wGz3le8L6 Content-Transfer-Encoding: 7bit Content-Type: text/plain This is in relation to providing functionality that IMQ was intending to using the dummy device and tc actions. Ive copied as many people as i could dig who i know may have interest in this. Please forward this to any other list which may have interest in the subject. It still needs some cleaning up; however, i dont wanna sit on it for another year - and now that mirred is out there, this is a good time. Advantage over current IMQ; cleaner in particular in in SMP; with a _lot_ less code. Old Dummy device functionality is preserved while new one only kicks in if you use actions. Didnt have to write a new device and finaly made a real dumb device to be a little smarter ;-> IMQ USES -------- As far as i know the reasons listed below is why people use IMQ. It would be nice to know of anything else that i missed because this is the requirements list i used. 1) qdiscs/policies that are per device as opposed to system wide. IMQ allows for sharing across multiple devices. 2) Allows for queueing incoming traffic for shaping instead of dropping. I am not aware of any study that shows policing is worse than shaping in achieving the end goal of rate control. I would be interested if anyone is experimenting. Nevertheless, this is still an alternative as opposed to making a system wide ingress change. 3) Very interesting use: if you are serving p2p you may wanna give preference to your own localy originated traffic (when responses come back) vs someone using your system to do bittorent. So QoSing based on state comes in as the solution. What people did to achive this was stick the IMQ somewhere prelocal hook. I think this is a pretty neat feature to have in Linux in general. (i.e not just for IMQ). But i wont go back to putting netfilter hooks in the device to satisfy this. I also dont think its worth it hacking dummy some more to be aware of say L3 info and play ip rule tricks to achieve this. --> Instead the plan is to have a contrack related action. This action will selectively either query/create contrack state on incoming packets. Packets could then be redirected to dummy based on what happens -> eg on incoming packets; if we find they are of known state we could send to a different queue than one which didnt have existing state. This all however is dependent on whatever rules the admin enters. What you can do with dummy currently with actions -------------------------------------------------- Lets say you are policing packets from alias 192.168.200.200/32 you dont want those to exceed 100kbps going out. tc filter add dev eth0 parent 1: protocol ip prio 10 u32 \ match ip src 192.168.200.200/32 flowid 1:2 \ action police rate 100kbit burst 90k drop If you run tcpdump on eth0 you will see all packets going out with src 192.168.200.200/32 dropped or not Extend the rule a little to see only the ones that made it out: tc filter add dev eth0 parent 1: protocol ip prio 10 u32 \ match ip src 192.168.200.200/32 flowid 1:2 \ action police rate 10kbit burst 90k drop \ action mirred egress mirror dev dummy0 Now fire tcpdump on dummy0 to see only those packets .. tcpdump -n -i dummy0 -x -e -t Essentially a good debugging/logging interface. If you replace mirror with redirect, those packets will be blackholed and will never make it out. This redirect behavior changes with new patch (but not the mirror). What you can do with dummy and attached patch ---------------------------------------------- Essentially provide functionality that most people use IMQ; sample below: -------- export TC="/sbin/tc" $TC qdisc add dev dummy0 root handle 1: prio $TC qdisc add dev dummy0 parent 1:1 handle 10: sfq $TC qdisc add dev dummy0 parent 1:2 handle 20: tbf rate 20kbit buffer 1600 limit 3000 $TC qdisc add dev dummy0 parent 1:3 handle 30: sfq $TC filter add dev dummy0 protocol ip pref 1 parent 1: handle 1 fw classid 1:1 $TC filter add dev dummy0 protocol ip pref 2 parent 1: handle 2 fw classid 1:2 ifconfig dummy0 up $TC qdisc add dev eth0 ingress # redirect all IP packets arriving in eth0 to dummy0 # use mark 1 --> puts them onto class 1:1 $TC filter add dev eth0 parent ffff: protocol ip prio 10 u32 \ match u32 0 0 flowid 1:1 \ action ipt -j MARK --set-mark 1 \ action mirred egress redirect dev dummy0 -------- Run A Little test: from another machine ping so that you have packets going into the box: ----- [root@jzny action-tests]# ping 10.22 PING 10.22 (10.0.0.22): 56 data bytes 64 bytes from 10.0.0.22: icmp_seq=0 ttl=64 time=2.8 ms 64 bytes from 10.0.0.22: icmp_seq=1 ttl=64 time=0.6 ms 64 bytes from 10.0.0.22: icmp_seq=2 ttl=64 time=0.6 ms --- 10.22 ping statistics --- 3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max = 0.6/1.3/2.8 ms [root@jzny action-tests]# ----- Now look at some stats: --- [root@jmandrake]:~# $TC -s filter show parent ffff: dev eth0 filter protocol ip pref 10 u32 filter protocol ip pref 10 u32 fh 800: ht divisor 1 filter protocol ip pref 10 u32 fh 800::800 order 2048 key ht 800 bkt 0 flowid 1:1 match 00000000/00000000 at 0 action order 1: tablename: mangle hook: NF_IP_PRE_ROUTING target MARK set 0x1 index 1 ref 1 bind 1 installed 4195sec used 27sec Sent 252 bytes 3 pkts (dropped 0, overlimits 0) action order 2: mirred (Egress Redirect to device dummy0) stolen index 1 ref 1 bind 1 installed 165 sec used 27 sec Sent 252 bytes 3 pkts (dropped 0, overlimits 0) [root@jmandrake]:~# $TC -s qdisc qdisc sfq 30: dev dummy0 limit 128p quantum 1514b Sent 0 bytes 0 pkts (dropped 0, overlimits 0) qdisc tbf 20: dev dummy0 rate 20Kbit burst 1575b lat 2147.5s Sent 210 bytes 3 pkts (dropped 0, overlimits 0) qdisc sfq 10: dev dummy0 limit 128p quantum 1514b Sent 294 bytes 3 pkts (dropped 0, overlimits 0) qdisc prio 1: dev dummy0 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 Sent 504 bytes 6 pkts (dropped 0, overlimits 0) qdisc ingress ffff: dev eth0 ---------------- Sent 308 bytes 5 pkts (dropped 0, overlimits 0) [root@jmandrake]:~# ifconfig dummy0 dummy0 Link encap:Ethernet HWaddr 00:00:00:00:00:00 inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link UP BROADCAST RUNNING NOARP MTU:1500 Metric:1 RX packets:6 errors:0 dropped:3 overruns:0 frame:0 TX packets:3 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:32 RX bytes:504 (504.0 b) TX bytes:252 (252.0 b) ----- Dummy continues to behave like it always did. You send it any packet not originating from the actions it will drop them. [In this case the three dropped packets were ipv6 ndisc]. My goal here is to start a discussion to see if people agree this is a good replacement for IMQ or whether to go another path. Clearly i would prefer to have this change in, but I am not religious and would listen to reason about how it should be done as long as no uneccessary clutter happens. Patch attached. cheers, jamal --=-69HkpMiEza1wGz3le8L6 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=dummy-act-2611rc1 Content-Type: text/plain; name=dummy-act-2611rc1; charset=ISO-8859-1 --- a/drivers/net/dummy.c.orig 2004-12-24 16:34:33.000000000 -0500 +++ b/drivers/net/dummy.c 2005-01-18 06:43:47.000000000 -0500 @@ -26,7 +26,14 @@ Nick Holloway, 27th May 1994 [I tweaked this explanation a little but that's all] Alan Cox, 30th May 1994 + */ +/* + * This driver isnt abused enough ;-> + * Here to add only _just_ a _feeew more_ features, + * 10 years after AC added comment above ;-> hehe - JHS +*/ + #include #include @@ -35,11 +42,128 @@ #include #include #include +#ifdef CONFIG_NET_CLS_ACT +#include +#endif + +#define TX_TIMEOUT (2*HZ) + +#define TX_Q_LIMIT 32 +struct dummy_private { + struct net_device_stats stats; +#ifdef CONFIG_NET_CLS_ACT + struct tasklet_struct dummy_tasklet; + int tasklet_pending; + /* mostly debug stats leave in for now */ + unsigned long stat_r1; + unsigned long stat_r2; + unsigned long stat_r3; + unsigned long stat_r4; + unsigned long stat_r5; + unsigned long stat_r6; + unsigned long stat_r7; + unsigned long stat_r8; + struct sk_buff_head rq; + struct sk_buff_head tq; +#endif +}; + +#ifdef CONFIG_NET_CLS_ACT +static void ri_tasklet(unsigned long dev); +#endif + static int numdummies = 1; static int dummy_xmit(struct sk_buff *skb, struct net_device *dev); static struct net_device_stats *dummy_get_stats(struct net_device *dev); +static void dummy_timeout(struct net_device *dev); +static int dummy_open(struct net_device *dev); +static int dummy_close(struct net_device *dev); + +static void dummy_timeout(struct net_device *dev) { + + int cpu = smp_processor_id(); + + dev->trans_start = jiffies; + printk("%s: BUG tx timeout on CPU %d\n",dev->name,cpu); + if (spin_is_locked((&dev->xmit_lock))) + printk("xmit lock grabbed already\n"); + if (spin_is_locked((&dev->queue_lock))) + printk("queue lock grabbed already\n"); +} + +#ifdef CONFIG_NET_CLS_ACT +static void ri_tasklet(unsigned long dev) { + + struct net_device *dv = (struct net_device *)dev; + struct dummy_private *dp = ((struct net_device *)dev)->priv; + struct net_device_stats *stats = &dp->stats; + struct sk_buff *skb = NULL; + + dp->stat_r4 +=1; + if (NULL == (skb = skb_peek(&dp->tq))) { + dp->stat_r5 +=1; + if (spin_trylock(&dv->xmit_lock)) { + dp->stat_r8 +=1; + while (NULL != (skb = skb_dequeue(&dp->rq))) { + skb_queue_tail(&dp->tq, skb); + } + spin_unlock(&dv->xmit_lock); + } else { + /* reschedule */ + dp->stat_r1 +=1; + goto resched; + } + } + + while (NULL != (skb = skb_dequeue(&dp->tq))) { + __u32 from = G_TC_FROM(skb->tc_verd); + + skb->tc_verd = 0; + skb->tc_verd = SET_TC_NCLS(skb->tc_verd); + stats->tx_packets++; + stats->tx_bytes+=skb->len; + if (from & AT_EGRESS) { + dp->stat_r6 +=1; + dev_queue_xmit(skb); + } else if (from & AT_INGRESS) { + + dp->stat_r7 +=1; + netif_rx(skb); + } else { + /* if netfilt is compiled in and packet is + tagged, we could reinject the packet back + this would make it do remaining 10% + of what current IMQ does + if someone really really insists then + this is the spot .. jhs */ + dev_kfree_skb(skb); + stats->tx_dropped++; + } + } + + if (spin_trylock(&dv->xmit_lock)) { + dp->stat_r3 +=1; + if (NULL == (skb = skb_peek(&dp->rq))) { + dp->tasklet_pending = 0; + if (netif_queue_stopped(dv)) + //netif_start_queue(dv); + netif_wake_queue(dv); + } else { + dp->stat_r2 +=1; + spin_unlock(&dv->xmit_lock); + goto resched; + } + spin_unlock(&dv->xmit_lock); + } else { +resched: + dp->tasklet_pending = 1; + tasklet_schedule(&dp->dummy_tasklet); + } + +} +#endif static int dummy_set_address(struct net_device *dev, void *p) { @@ -62,12 +186,17 @@ /* Initialize the device structure. */ dev->get_stats = dummy_get_stats; dev->hard_start_xmit = dummy_xmit; + dev->tx_timeout = &dummy_timeout; + dev->watchdog_timeo = TX_TIMEOUT; + dev->open = &dummy_open; + dev->stop = &dummy_close; + dev->set_multicast_list = set_multicast_list; dev->set_mac_address = dummy_set_address; /* Fill in device structure with ethernet-generic values. */ ether_setup(dev); - dev->tx_queue_len = 0; + dev->tx_queue_len = TX_Q_LIMIT; dev->change_mtu = NULL; dev->flags |= IFF_NOARP; dev->flags &= ~IFF_MULTICAST; @@ -77,18 +206,64 @@ static int dummy_xmit(struct sk_buff *skb, struct net_device *dev) { - struct net_device_stats *stats = netdev_priv(dev); + struct dummy_private *dp = ((struct net_device *)dev)->priv; + struct net_device_stats *stats = &dp->stats; + int ret = 0; + { stats->tx_packets++; stats->tx_bytes+=skb->len; + } +#ifdef CONFIG_NET_CLS_ACT + __u32 from = G_TC_FROM(skb->tc_verd); + if (!from || !skb->input_dev ) { +dropped: + dev_kfree_skb(skb); + stats->rx_dropped++; + return ret; + } else { + if (skb->input_dev) + skb->dev = skb->input_dev; + else + printk("warning!!! no idev %s\n",skb->dev->name); + skb->input_dev = dev; + if (from & AT_INGRESS) { + skb_pull(skb, skb->dev->hard_header_len); + } else { + if (!(from & AT_EGRESS)) { + goto dropped; + } + } + } + if (skb_queue_len(&dp->rq) >= dev->tx_queue_len) { + netif_stop_queue(dev); + } + dev->trans_start = jiffies; + skb_queue_tail(&dp->rq, skb); + if (!dp->tasklet_pending) { + dp->tasklet_pending = 1; + tasklet_schedule(&dp->dummy_tasklet); + } + +#else + stats->rx_dropped++; dev_kfree_skb(skb); - return 0; +#endif + return ret; } static struct net_device_stats *dummy_get_stats(struct net_device *dev) { - return netdev_priv(dev); + struct dummy_private *dp = ((struct net_device *)dev)->priv; + struct net_device_stats *stats = &dp->stats; +#ifdef CONFIG_NET_CLS_ACT_DEB + printk("tasklets stats %ld:%ld:%ld:%ld:%ld:%ld:%ld:%ld \n", + dp->stat_r1,dp->stat_r2,dp->stat_r3,dp->stat_r4, + dp->stat_r5,dp->stat_r6,dp->stat_r7,dp->stat_r8); +#endif + + return stats; } static struct net_device **dummies; @@ -97,12 +272,41 @@ module_param(numdummies, int, 0); MODULE_PARM_DESC(numdummies, "Number of dummy pseudo devices"); +static int dummy_close(struct net_device *dev) +{ + +#ifdef CONFIG_NET_CLS_ACT + struct dummy_private *dp = ((struct net_device *)dev)->priv; + + tasklet_kill(&dp->dummy_tasklet); + skb_queue_purge(&dp->rq); + skb_queue_purge(&dp->tq); +#endif + netif_stop_queue(dev); + return 0; +} + +static int dummy_open(struct net_device *dev) +{ + +#ifdef CONFIG_NET_CLS_ACT + struct dummy_private *dp = ((struct net_device *)dev)->priv; + + tasklet_init(&dp->dummy_tasklet, ri_tasklet, (unsigned long)dev); + skb_queue_head_init(&dp->rq); + skb_queue_head_init(&dp->tq); +#endif + netif_start_queue(dev); + return 0; +} + + static int __init dummy_init_one(int index) { struct net_device *dev_dummy; int err; - dev_dummy = alloc_netdev(sizeof(struct net_device_stats), + dev_dummy = alloc_netdev(sizeof(struct dummy_private), "dummy%d", dummy_setup); if (!dev_dummy) --=-69HkpMiEza1wGz3le8L6-- From tommy.christensen@tpack.net Sun Jan 30 15:37:39 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 15:37:44 -0800 (PST) Received: from mail.tpack.net (ip18.tpack.net [213.173.228.18]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0UNbbTJ017337 for ; Sun, 30 Jan 2005 15:37:38 -0800 Received: (qmail 30460 invoked from network); 30 Jan 2005 23:37:17 -0000 Received: from dhcp-138.cph.tpack.net (HELO ?172.17.159.11?) (192.168.0.138) by 0 with SMTP; 30 Jan 2005 23:37:17 -0000 Message-ID: <41FD702D.2060403@tpack.net> Date: Mon, 31 Jan 2005 00:39:25 +0100 From: Tommy Christensen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: en-us, en MIME-Version: 1.0 To: hadi@cyberus.ca CC: Jeff Garzik , Thomas Spatzier , "David S. Miller" , Hasso Tepper , Herbert Xu , netdev@oss.sgi.com, Paul Jakma Subject: Re: [patch 4/10] s390: network driver. References: <1104764710.1048.580.camel@jzny.localdomain> <41DB26A6.2070008@pobox.com> <1104895169.1117.63.camel@jzny.localdomain> <41DC0931.80603@tpack.net> <1105019912.2314.20.camel@jzny.localdomain> <1105023972.3462.48.camel@tsc-6.cph.tpack.net> <1105104757.1046.63.camel@jzny.localdomain> <1105111605.3462.101.camel@tsc-6.cph.tpack.net> <1105363092.1041.146.camel@jzny.localdomain> <1105917038.1091.1041.camel@jzny.localdomain> <41EC3067.6050104@tpack.net> In-Reply-To: <41EC3067.6050104@tpack.net> Content-Type: multipart/mixed; boundary="------------030807080405060200010500" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1023 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tommy.christensen@tpack.net Precedence: bulk X-list: netdev Content-Length: 2458 Lines: 90 This is a multi-part message in MIME format. --------------030807080405060200010500 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Tommy Christensen wrote: > jamal wrote: > >> Didnt see anymore discussion on this - have we given up on it? > > > It is not forgotten - just stalled ... > I'll try to look at it some more. Sorry for the long delay. Jamal, do you think something like this could work? Flushing of the DMA ring could be added if the need arises. e1000 does this already in the driver on link-down. -Tommy --------------030807080405060200010500 Content-Type: text/plain; name="carrier.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="carrier.patch" diff -ur linux-2.6.11-rc2-bk8/net/core/link_watch.c linux-2.6.11-work/net/core/link_watch.c --- linux-2.6.11-rc2-bk8/net/core/link_watch.c 2005-01-30 22:08:44.000000000 +0100 +++ linux-2.6.11-work/net/core/link_watch.c 2005-01-31 00:17:45.716039247 +0100 @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -74,6 +75,9 @@ clear_bit(__LINK_STATE_LINKWATCH_PENDING, &dev->state); if (dev->flags & IFF_UP) { + if (netif_carrier_ok(dev) && + dev->qdisc_sleeping != &noop_qdisc) + dev_activate(dev); netdev_state_change(dev); } diff -ur linux-2.6.11-rc2-bk8/net/sched/sch_generic.c linux-2.6.11-work/net/sched/sch_generic.c --- linux-2.6.11-rc2-bk8/net/sched/sch_generic.c 2005-01-30 22:11:50.458216314 +0100 +++ linux-2.6.11-work/net/sched/sch_generic.c 2005-01-31 00:06:47.609769835 +0100 @@ -185,6 +185,7 @@ static void dev_watchdog(unsigned long arg) { struct net_device *dev = (struct net_device *)arg; + int check_carrier = 0; spin_lock(&dev->xmit_lock); if (dev->qdisc != &noop_qdisc) { @@ -198,10 +199,23 @@ } if (!mod_timer(&dev->watchdog_timer, jiffies + dev->watchdog_timeo)) dev_hold(dev); - } + } else + check_carrier = 1; } spin_unlock(&dev->xmit_lock); + if (check_carrier) { + spin_lock(&dev->queue_lock); + if (!netif_carrier_ok(dev) && netif_queue_stopped(dev)) { + struct Qdisc *qdisc; + + qdisc = dev->qdisc; + dev->qdisc = &noop_qdisc; + qdisc_reset(qdisc); + } + spin_unlock(&dev->queue_lock); + } + dev_put(dev); } --------------030807080405060200010500-- From dcbw@redhat.com Sun Jan 30 16:07:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 16:07:30 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V07NX3018612 for ; Sun, 30 Jan 2005 16:07:24 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j0V05LRV023168; Sun, 30 Jan 2005 19:05:21 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j0V05LO09165; Sun, 30 Jan 2005 19:05:21 -0500 Received: from devserv.devel.redhat.com (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.11/8.12.10) with ESMTP id j0V05Lw7011882; Sun, 30 Jan 2005 19:05:21 -0500 Received: from localhost (dcbw@localhost) by devserv.devel.redhat.com (8.12.11/8.12.11/Submit) with ESMTP id j0V05KP9011878; Sun, 30 Jan 2005 19:05:20 -0500 Date: Sun, 30 Jan 2005 19:05:20 -0500 (EST) From: Dan Williams To: netdev@oss.sgi.com cc: jgarzik@redhat.com, jt@hpl.hp.com, simon@thekelleys.org.uk Subject: [PATCH 2.6.11-rc2] wireless: Atmel clearer firmware selection and 502e max rssi fix Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="279707962-801068342-1107129390=:6929" Content-ID: X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1024 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dcbw@redhat.com Precedence: bulk X-list: netdev Content-Length: 34268 Lines: 715 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --279707962-801068342-1107129390=:6929 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-ID: Clear up firmware selection by passing an enum into init_atmel_card() rather than the firmware string. Necessary to differentiate between firmware versions due to different max rssi for each firmware. Move common prototypes into new atmel.h file which also contains firmware enum. Signed-off-by: Dan Williams --- /dev/null 1969-12-31 19:00:00.000000000 -0500 +++ b/drivers/net/wireless/atmel.h 2005-01-30 18:33:31.000000000 -0500 @@ -0,0 +1,43 @@ +/*** -*- linux-c -*- ********************************************************** + + Driver for Atmel at76c502 at76c504 and at76c506 wireless cards. + + Copyright 2005 Dan Williams and Red Hat, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This software is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Atmel wireless lan drivers; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +******************************************************************************/ + +#ifndef _ATMEL_H +#define _ATMEL_H + +typedef enum { + ATMEL_FW_TYPE_NONE = 0, + ATMEL_FW_TYPE_502, + ATMEL_FW_TYPE_502D, + ATMEL_FW_TYPE_502E, + ATMEL_FW_TYPE_502_3COM, + ATMEL_FW_TYPE_504, + ATMEL_FW_TYPE_504_2958, + ATMEL_FW_TYPE_504A_2958, + ATMEL_FW_TYPE_506 +} AtmelFWType; + +struct net_device *init_atmel_card(unsigned short, int, const AtmelFWType, struct device *, + int (*present_func)(void *), void * ); +void stop_atmel_card( struct net_device *, int ); +int atmel_open( struct net_device * ); + +#endif --- a/drivers/net/wireless/atmel.c 2005-01-27 20:26:46.000000000 -0500 +++ b/drivers/net/wireless/atmel.c 2005-01-30 18:37:27.000000000 -0500 @@ -69,6 +69,7 @@ #include #include #include "ieee802_11.h" +#include "atmel.h" #define DRIVER_MAJOR 0 #define DRIVER_MINOR 96 @@ -83,6 +84,22 @@ static char *firmware = NULL; module_param(firmware, charp, 0); +/* table of firmware file names */ +static struct { + AtmelFWType fw_type; + const char *filename; +} firmware_table[] = { + { ATMEL_FW_TYPE_502, "atmel_at76c502%s.bin" }, + { ATMEL_FW_TYPE_502D, "atmel_at76c502d%s.bin" }, + { ATMEL_FW_TYPE_502E, "atmel_at76c502e%s.bin" }, + { ATMEL_FW_TYPE_502_3COM, "atmel_at76c502_3com%s.bin" }, + { ATMEL_FW_TYPE_504, "atmel_at76c504%s.bin" }, + { ATMEL_FW_TYPE_504_2958, "atmel_at76c504_2958%s.bin" }, + { ATMEL_FW_TYPE_504A_2958,"atmel_at76c504a_2958%s.bin" }, + { ATMEL_FW_TYPE_506, "atmel_at76c506%s.bin" }, + { ATMEL_FW_TYPE_NONE, NULL } +}; + #define MAX_SSID_LENGTH 32 #define MGMT_JIFFIES (256 * HZ / 100) @@ -458,8 +475,8 @@ void *card; /* Bus dependent stucture varies for PCcard */ int (*present_callback)(void *); /* And callback which uses it */ char firmware_id[32]; - char firmware_template[32]; - unsigned char *firmware; + AtmelFWType firmware_type; + u8 *firmware; int firmware_length; struct timer_list management_timer; struct net_device *dev; @@ -1293,17 +1310,21 @@ if (priv->operating_mode == IW_MODE_INFRA) { if (priv->station_state != STATION_STATE_READY) { priv->wstats.qual.qual = 0; - priv->wstats.qual.level = 0; + priv->wstats.qual.level = 0; + priv->wstats.qual.updated |= (IW_QUAL_QUAL_INVALID + | IW_QUAL_LEVEL_INVALID); } priv->wstats.qual.noise = 0; - priv->wstats.qual.updated = 7; + priv->wstats.qual.updated |= IW_QUAL_NOISE_INVALID; } else { /* Quality levels cannot be determined in ad-hoc mode, because we can 'hear' more that one remote station. */ priv->wstats.qual.qual = 0; priv->wstats.qual.level = 0; priv->wstats.qual.noise = 0; - priv->wstats.qual.updated = 0; + priv->wstats.qual.updated = IW_QUAL_QUAL_INVALID + | IW_QUAL_LEVEL_INVALID + | IW_QUAL_NOISE_INVALID; priv->wstats.miss.beacon = 0; } @@ -1482,7 +1503,7 @@ return len; } -struct net_device *init_atmel_card( unsigned short irq, int port, char *firmware_id, +struct net_device *init_atmel_card( unsigned short irq, int port, const AtmelFWType fw_type, struct device *sys_dev, int (*card_present)(void *), void *card) { struct net_device *dev; @@ -1507,11 +1528,9 @@ priv->card = card; priv->firmware = NULL; priv->firmware_id[0] = '\0'; - priv->firmware_template[0] = '\0'; + priv->firmware_type = fw_type; if (firmware) /* module parameter */ strcpy(priv->firmware_id, firmware); - else if (firmware_id) /* from PCMCIA card-matching or PCI */ - strcpy(priv->firmware_template, firmware_id); priv->bus_type = card_present ? BUS_TYPE_PCCARD : BUS_TYPE_PCI; priv->station_state = STATION_STATE_DOWN; priv->do_rx_crc = 0; @@ -2218,6 +2237,9 @@ range->max_qual.qual = 100; range->max_qual.level = 100; range->max_qual.noise = 0; + range->max_qual.updated = IW_QUAL_QUAL_UPDATED + | IW_QUAL_LEVEL_UPDATED + | IW_QUAL_NOISE_INVALID; range->sensitivity = 0; range->bitrate[0] = 1000000; @@ -2247,9 +2269,13 @@ range->r_time_flags = 0; range->min_retry = 1; range->max_retry = 65535; + range->avg_qual.qual = 50; range->avg_qual.level = 50; range->avg_qual.noise = 0; + range->avg_qual.updated = IW_QUAL_QUAL_UPDATED + | IW_QUAL_LEVEL_UPDATED + | IW_QUAL_NOISE_INVALID; return 0; } @@ -3025,16 +3051,23 @@ static void smooth_rssi(struct atmel_private *priv, u8 rssi) { u8 old = priv->wstats.qual.level; + u8 max_rssi = 42; /* 502-rmfd-revd max by experiment */ - /* 502-rmfd-revd gives max signal level as 42, by experiment. - This is going to break for other hardware variants. */ + switch (priv->firmware_type) { + case ATMEL_FW_TYPE_502E: + max_rssi = 63; /* 502-rmfd-reve max by experiment */ + break; + default: + break; + } - rssi = rssi * 100 / 42; + rssi = rssi * 100 / max_rssi; if((rssi + old) % 2) priv->wstats.qual.level = ((rssi + old)/2) + 1; else priv->wstats.qual.level = ((rssi + old)/2); - + priv->wstats.qual.updated |= IW_QUAL_LEVEL_UPDATED; + priv->wstats.qual.updated &= ~IW_QUAL_LEVEL_INVALID; } static void atmel_smooth_qual(struct atmel_private *priv) @@ -3047,8 +3080,10 @@ priv->beacons_this_sec * priv->beacon_period * (priv->wstats.qual.level + 100) / 4000; priv->beacons_this_sec = 0; } + priv->wstats.qual.updated |= IW_QUAL_QUAL_UPDATED; + priv->wstats.qual.updated &= ~IW_QUAL_QUAL_INVALID; } - + /* deals with incoming managment frames. */ static void atmel_management_frame(struct atmel_private *priv, struct ieee802_11_hdr *header, u16 frame_len, u8 rssi) @@ -3571,6 +3606,17 @@ atmel_set_mib(priv, Mac_Wep_Mib_Type, 0, (u8 *)&mib, sizeof(mib)); } +static const char *atmel_get_firmware_template (const AtmelFWType fw_type) +{ + int i; + for(i = 0; i < sizeof(firmware_table)/sizeof(firmware_table[0]); i++) + { + if (firmware_table[i].fw_type == fw_type) + return firmware_table[i].filename; + } + return NULL; +} + static int reset_atmel_card(struct net_device *dev) { /* do everything necessary to wake up the hardware, including @@ -3611,8 +3657,8 @@ const struct firmware *fw_entry = NULL; unsigned char *fw; int len = priv->firmware_length; - if (!(fw = priv->firmware)) { - if (strlen(priv->firmware_template) == 0) { + if (!(fw = priv->firmware)) { + if (priv->firmware_type == ATMEL_FW_TYPE_NONE) { if (strlen(priv->firmware_id) == 0) { printk(KERN_INFO "%s: card type is unknown: assuming at76c502 firmware is OK.\n", @@ -3627,24 +3673,24 @@ "%s: firmware %s is missing, cannot continue.\n", dev->name, priv->firmware_id); return 0; - - } + } } else { int i; + const char *s = atmel_get_firmware_template(priv->firmware_type); - for (i = 0; firmware_modifier[i]; i++) { - sprintf(priv->firmware_id, priv->firmware_template, firmware_modifier[i]); + for (i = 0; s && firmware_modifier[i]; i++) { + snprintf(priv->firmware_id, 32, s, firmware_modifier[i]); + priv->firmware_id[31] = '\0'; if (request_firmware(&fw_entry, priv->firmware_id, priv->sys_dev) == 0) break; } - if (!firmware_modifier[i]) { + if (!s || !firmware_modifier[i]) { printk(KERN_ALERT "%s: firmware %s is missing, cannot start.\n", dev->name, priv->firmware_id); priv->firmware_id[0] = '\0'; return 0; } - priv->firmware_template[0] = '\0'; } fw = fw_entry->data; --- a/drivers/net/wireless/atmel_cs.c 2005-01-27 20:26:46.000000000 -0500 +++ b/drivers/net/wireless/atmel_cs.c 2005-01-30 14:05:08.000000000 -0500 @@ -55,6 +55,7 @@ #include #include +#include "atmel.h" /* All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If @@ -90,11 +91,6 @@ event handler. */ -struct net_device *init_atmel_card(int, int, char *, struct device *, - int (*present_func)(void *), void * ); -void stop_atmel_card( struct net_device *, int ); -int atmel_open( struct net_device * ); - static void atmel_config(dev_link_t *link); static void atmel_release(dev_link_t *link); static int atmel_event(event_t event, int priority, @@ -307,28 +303,28 @@ static struct { int manf, card; char *ver1; - char *firmware; + AtmelFWType firmware; char *name; } card_table[] = { - { 0, 0, "WLAN/802.11b PC CARD", "atmel_at76c502d%s.bin", "Actiontec 802CAT1" }, - { 0, 0, "ATMEL/AT76C502AR", "atmel_at76c502%s.bin", "NoName-RFMD" }, - { 0, 0, "ATMEL/AT76C502AR_D", "atmel_at76c502d%s.bin", "NoName-revD" }, - { 0, 0, "ATMEL/AT76C502AR_E", "atmel_at76c502e%s.bin", "NoName-revE" }, - { 0, 0, "ATMEL/AT76C504", "atmel_at76c504%s.bin", "NoName-504" }, - { 0, 0, "ATMEL/AT76C504A", "atmel_at76c504a_2958%s.bin", "NoName-504a-2958" }, - { 0, 0, "ATMEL/AT76C504_R", "atmel_at76c504_2958%s.bin", "NoName-504-2958" }, - { MANFID_3COM, 0x0620, NULL, "atmel_at76c502_3com%s.bin", "3com 3CRWE62092B" }, - { MANFID_3COM, 0x0696, NULL, "atmel_at76c502_3com%s.bin", "3com 3CRSHPW196" }, - { 0, 0, "SMC/2632W-V2", "atmel_at76c502%s.bin", "SMC 2632W-V2" }, - { 0, 0, "SMC/2632W", "atmel_at76c502d%s.bin", "SMC 2632W-V3" }, - { 0xd601, 0x0007, NULL, "atmel_at76c502%s.bin", "Sitecom WLAN-011" }, - { 0x01bf, 0x3302, NULL, "atmel_at76c502e%s.bin", "Belkin F5D6020-V2" }, - { 0, 0, "BT/Voyager 1020 Laptop Adapter", "atmel_at76c502%s.bin", "BT Voyager 1020" }, - { 0, 0, "IEEE 802.11b/Wireless LAN PC Card", "atmel_at76c502%s.bin", "Siemens Gigaset PC Card II" }, - { 0, 0, "CNet/CNWLC 11Mbps Wireless PC Card V-5", "atmel_at76c502e%s.bin", "CNet CNWLC-811ARL" }, - { 0, 0, "Wireless/PC_CARD", "atmel_at76c502d%s.bin", "Planet WL-3552" }, - { 0, 0, "OEM/11Mbps Wireless LAN PC Card V-3", "atmel_at76c502%s.bin", "OEM 11Mbps WLAN PCMCIA Card" }, - { 0, 0, "11WAVE/11WP611AL-E", "atmel_at76c502e%s.bin", "11WAVE WaveBuddy" } + { 0, 0, "WLAN/802.11b PC CARD", ATMEL_FW_TYPE_502D, "Actiontec 802CAT1" }, + { 0, 0, "ATMEL/AT76C502AR", ATMEL_FW_TYPE_502, "NoName-RFMD" }, + { 0, 0, "ATMEL/AT76C502AR_D", ATMEL_FW_TYPE_502D, "NoName-revD" }, + { 0, 0, "ATMEL/AT76C502AR_E", ATMEL_FW_TYPE_502E, "NoName-revE" }, + { 0, 0, "ATMEL/AT76C504", ATMEL_FW_TYPE_504, "NoName-504" }, + { 0, 0, "ATMEL/AT76C504A", ATMEL_FW_TYPE_504A_2958, "NoName-504a-2958" }, + { 0, 0, "ATMEL/AT76C504_R", ATMEL_FW_TYPE_504_2958, "NoName-504-2958" }, + { MANFID_3COM, 0x0620, NULL, ATMEL_FW_TYPE_502_3COM, "3com 3CRWE62092B" }, + { MANFID_3COM, 0x0696, NULL, ATMEL_FW_TYPE_502_3COM, "3com 3CRSHPW196" }, + { 0, 0, "SMC/2632W-V2", ATMEL_FW_TYPE_502, "SMC 2632W-V2" }, + { 0, 0, "SMC/2632W", ATMEL_FW_TYPE_502D, "SMC 2632W-V3" }, + { 0xd601, 0x0007, NULL, ATMEL_FW_TYPE_502, "Sitecom WLAN-011" }, + { 0x01bf, 0x3302, NULL, ATMEL_FW_TYPE_502E, "Belkin F5D6020-V2" }, + { 0, 0, "BT/Voyager 1020 Laptop Adapter", ATMEL_FW_TYPE_502, "BT Voyager 1020" }, + { 0, 0, "IEEE 802.11b/Wireless LAN PC Card", ATMEL_FW_TYPE_502, "Siemens Gigaset PC Card II" }, + { 0, 0, "CNet/CNWLC 11Mbps Wireless PC Card V-5", ATMEL_FW_TYPE_502E, "CNet CNWLC-811ARL" }, + { 0, 0, "Wireless/PC_CARD", ATMEL_FW_TYPE_502D, "Planet WL-3552" }, + { 0, 0, "OEM/11Mbps Wireless LAN PC Card V-3", ATMEL_FW_TYPE_502, "OEM 11Mbps WLAN PCMCIA Card" }, + { 0, 0, "11WAVE/11WP611AL-E", ATMEL_FW_TYPE_502E, "11WAVE WaveBuddy" } }; static void atmel_config(dev_link_t *link) @@ -520,7 +516,7 @@ ((local_info_t*)link->priv)->eth_dev = init_atmel_card(link->irq.AssignedIRQ, link->io.BasePort1, - card_index == -1 ? NULL : card_table[card_index].firmware, + card_index == -1 ? ATMEL_FW_TYPE_NONE : card_table[card_index].firmware, &handle_to_dev(handle), card_present, link); --- a/drivers/net/wireless/atmel_pci.c 2005-01-27 20:26:46.000000000 -0500 +++ b/drivers/net/wireless/atmel_pci.c 2005-01-30 14:05:30.000000000 -0500 @@ -25,6 +25,7 @@ #include #include #include +#include "atmel.h" MODULE_AUTHOR("Simon Kelley"); MODULE_DESCRIPTION("Support for Atmel at76c50x 802.11 wireless ethernet cards."); @@ -40,9 +41,6 @@ static int atmel_pci_probe(struct pci_dev *, const struct pci_device_id *); static void atmel_pci_remove(struct pci_dev *); -struct net_device *init_atmel_card(int, int, char *, struct device *, - int (*present_func)(void *), void * ); -void stop_atmel_card( struct net_device *, int ); static struct pci_driver atmel_driver = { .name = "atmel", @@ -63,7 +61,7 @@ pci_set_master(pdev); dev = init_atmel_card(pdev->irq, pdev->resource[1].start, - "atmel_at76c506%s.bin", + ATMEL_FW_TYPE_506, &pdev->dev, NULL, NULL); if (!dev) return -ENODEV; --279707962-801068342-1107129390=:6929 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME="atmel-502e-quality-fix.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: ATTACHMENT; FILENAME="atmel-502e-quality-fix.patch" LS0tIC9kZXYvbnVsbAkxOTY5LTEyLTMxIDE5OjAwOjAwLjAwMDAwMDAwMCAt MDUwMA0KKysrIGIvZHJpdmVycy9uZXQvd2lyZWxlc3MvYXRtZWwuaAkyMDA1 LTAxLTMwIDE4OjMzOjMxLjAwMDAwMDAwMCAtMDUwMA0KQEAgLTAsMCArMSw0 MyBAQA0KKy8qKiogLSotIGxpbnV4LWMgLSotICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioNCisN CisgICAgIERyaXZlciBmb3IgQXRtZWwgYXQ3NmM1MDIgYXQ3NmM1MDQgYW5k IGF0NzZjNTA2IHdpcmVsZXNzIGNhcmRzLg0KKw0KKyAgICAgICAgIENvcHly aWdodCAyMDA1IERhbiBXaWxsaWFtcyBhbmQgUmVkIEhhdCwgSW5jLg0KKw0K KyAgICBUaGlzIHByb2dyYW0gaXMgZnJlZSBzb2Z0d2FyZTsgeW91IGNhbiBy ZWRpc3RyaWJ1dGUgaXQgYW5kL29yIG1vZGlmeQ0KKyAgICBpdCB1bmRlciB0 aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1YmxpYyBMaWNlbnNlIGFz IHB1Ymxpc2hlZCBieQ0KKyAgICB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0 aW9uOyBlaXRoZXIgdmVyc2lvbiAyIG9mIHRoZSBMaWNlbnNlLCBvcg0KKyAg ICAoYXQgeW91ciBvcHRpb24pIGFueSBsYXRlciB2ZXJzaW9uLg0KKw0KKyAg ICBUaGlzIHNvZnR3YXJlIGlzIGRpc3RyaWJ1dGVkIGluIHRoZSBob3BlIHRo YXQgaXQgd2lsbCBiZSB1c2VmdWwsDQorICAgIGJ1dCBXSVRIT1VUIEFOWSBX QVJSQU5UWTsgd2l0aG91dCBldmVuIHRoZSBpbXBsaWVkIHdhcnJhbnR5IG9m DQorICAgIE1FUkNIQU5UQUJJTElUWSBvciBGSVRORVNTIEZPUiBBIFBBUlRJ Q1VMQVIgUFVSUE9TRS4gIFNlZSB0aGUNCisgICAgR05VIEdlbmVyYWwgUHVi bGljIExpY2Vuc2UgZm9yIG1vcmUgZGV0YWlscy4NCisNCisgICAgWW91IHNo b3VsZCBoYXZlIHJlY2VpdmVkIGEgY29weSBvZiB0aGUgR05VIEdlbmVyYWwg UHVibGljIExpY2Vuc2UNCisgICAgYWxvbmcgd2l0aCBBdG1lbCB3aXJlbGVz cyBsYW4gZHJpdmVyczsgaWYgbm90LCB3cml0ZSB0byB0aGUgRnJlZSBTb2Z0 d2FyZQ0KKyAgICBGb3VuZGF0aW9uLCBJbmMuLCA1OSBUZW1wbGUgUGxhY2Us IFN1aXRlIDMzMCwgQm9zdG9uLCBNQSAgMDIxMTEtMTMwNyAgVVNBDQorDQor KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLw0KKw0KKyNpZm5k ZWYgX0FUTUVMX0gNCisjZGVmaW5lIF9BVE1FTF9IDQorDQordHlwZWRlZiBl bnVtIHsNCisJQVRNRUxfRldfVFlQRV9OT05FID0gMCwNCisJQVRNRUxfRldf VFlQRV81MDIsDQorCUFUTUVMX0ZXX1RZUEVfNTAyRCwNCisJQVRNRUxfRldf VFlQRV81MDJFLA0KKwlBVE1FTF9GV19UWVBFXzUwMl8zQ09NLA0KKwlBVE1F TF9GV19UWVBFXzUwNCwNCisJQVRNRUxfRldfVFlQRV81MDRfMjk1OCwNCisJ QVRNRUxfRldfVFlQRV81MDRBXzI5NTgsDQorCUFUTUVMX0ZXX1RZUEVfNTA2 DQorfSBBdG1lbEZXVHlwZTsNCisNCitzdHJ1Y3QgbmV0X2RldmljZSAqaW5p dF9hdG1lbF9jYXJkKHVuc2lnbmVkIHNob3J0LCBpbnQsIGNvbnN0IEF0bWVs RldUeXBlLCBzdHJ1Y3QgZGV2aWNlICosIA0KKwkJCQkgICAgaW50ICgqcHJl c2VudF9mdW5jKSh2b2lkICopLCB2b2lkICogKTsNCit2b2lkIHN0b3BfYXRt ZWxfY2FyZCggc3RydWN0IG5ldF9kZXZpY2UgKiwgaW50ICk7DQoraW50IGF0 bWVsX29wZW4oIHN0cnVjdCBuZXRfZGV2aWNlICogKTsNCisNCisjZW5kaWYN Ci0tLSBhL2RyaXZlcnMvbmV0L3dpcmVsZXNzL2F0bWVsLmMJMjAwNS0wMS0y NyAyMDoyNjo0Ni4wMDAwMDAwMDAgLTA1MDANCisrKyBiL2RyaXZlcnMvbmV0 L3dpcmVsZXNzL2F0bWVsLmMJMjAwNS0wMS0zMCAxODozNzoyNy4wMDAwMDAw MDAgLTA1MDANCkBAIC02OSw2ICs2OSw3IEBADQogI2luY2x1ZGUgPGxpbnV4 L21vZHVsZXBhcmFtLmg+DQogI2luY2x1ZGUgPGxpbnV4L2Zpcm13YXJlLmg+ DQogI2luY2x1ZGUgImllZWU4MDJfMTEuaCINCisjaW5jbHVkZSAiYXRtZWwu aCINCiANCiAjZGVmaW5lIERSSVZFUl9NQUpPUiAwDQogI2RlZmluZSBEUklW RVJfTUlOT1IgOTYNCkBAIC04Myw2ICs4NCwyMiBAQA0KIHN0YXRpYyBjaGFy ICpmaXJtd2FyZSA9IE5VTEw7DQogbW9kdWxlX3BhcmFtKGZpcm13YXJlLCBj aGFycCwgMCk7DQogDQorLyogdGFibGUgb2YgZmlybXdhcmUgZmlsZSBuYW1l cyAqLw0KK3N0YXRpYyBzdHJ1Y3QgeyANCisJQXRtZWxGV1R5cGUgZndfdHlw ZTsNCisJY29uc3QgY2hhciAqZmlsZW5hbWU7DQorfSBmaXJtd2FyZV90YWJs ZVtdID0gew0KKwl7IEFUTUVMX0ZXX1RZUEVfNTAyLCAgICAgICJhdG1lbF9h dDc2YzUwMiVzLmJpbiIgfSwNCisJeyBBVE1FTF9GV19UWVBFXzUwMkQsICAg ICAiYXRtZWxfYXQ3NmM1MDJkJXMuYmluIiB9LA0KKwl7IEFUTUVMX0ZXX1RZ UEVfNTAyRSwgICAgICJhdG1lbF9hdDc2YzUwMmUlcy5iaW4iIH0sDQorCXsg QVRNRUxfRldfVFlQRV81MDJfM0NPTSwgImF0bWVsX2F0NzZjNTAyXzNjb20l cy5iaW4iIH0sDQorCXsgQVRNRUxfRldfVFlQRV81MDQsICAgICAgImF0bWVs X2F0NzZjNTA0JXMuYmluIiB9LA0KKwl7IEFUTUVMX0ZXX1RZUEVfNTA0XzI5 NTgsICJhdG1lbF9hdDc2YzUwNF8yOTU4JXMuYmluIiB9LA0KKwl7IEFUTUVM X0ZXX1RZUEVfNTA0QV8yOTU4LCJhdG1lbF9hdDc2YzUwNGFfMjk1OCVzLmJp biIgfSwNCisJeyBBVE1FTF9GV19UWVBFXzUwNiwgICAgICAiYXRtZWxfYXQ3 NmM1MDYlcy5iaW4iIH0sDQorCXsgQVRNRUxfRldfVFlQRV9OT05FLCAgICAg IE5VTEwgfQ0KK307DQorDQogI2RlZmluZSBNQVhfU1NJRF9MRU5HVEggMzIN CiAjZGVmaW5lIE1HTVRfSklGRklFUyAoMjU2ICogSFogLyAxMDApDQogDQpA QCAtNDU4LDggKzQ3NSw4IEBADQogCXZvaWQgKmNhcmQ7IC8qIEJ1cyBkZXBl bmRlbnQgc3R1Y3R1cmUgdmFyaWVzIGZvciBQQ2NhcmQgKi8NCiAJaW50ICgq cHJlc2VudF9jYWxsYmFjaykodm9pZCAqKTsgLyogQW5kIGNhbGxiYWNrIHdo aWNoIHVzZXMgaXQgKi8NCiAJY2hhciBmaXJtd2FyZV9pZFszMl07DQotCWNo YXIgZmlybXdhcmVfdGVtcGxhdGVbMzJdOw0KLQl1bnNpZ25lZCBjaGFyICpm aXJtd2FyZTsNCisJQXRtZWxGV1R5cGUgZmlybXdhcmVfdHlwZTsNCisJdTgg KmZpcm13YXJlOw0KIAlpbnQgZmlybXdhcmVfbGVuZ3RoOw0KIAlzdHJ1Y3Qg dGltZXJfbGlzdCBtYW5hZ2VtZW50X3RpbWVyOw0KIAlzdHJ1Y3QgbmV0X2Rl dmljZSAqZGV2Ow0KQEAgLTEyOTMsMTcgKzEzMTAsMjEgQEANCiAJaWYgKHBy aXYtPm9wZXJhdGluZ19tb2RlID09IElXX01PREVfSU5GUkEpIHsNCiAJCWlm IChwcml2LT5zdGF0aW9uX3N0YXRlICE9IFNUQVRJT05fU1RBVEVfUkVBRFkp IHsNCiAJCQlwcml2LT53c3RhdHMucXVhbC5xdWFsID0gMDsNCi0JCQlwcml2 LT53c3RhdHMucXVhbC5sZXZlbAk9IDA7DQorCQkJcHJpdi0+d3N0YXRzLnF1 YWwubGV2ZWwgPSAwOw0KKwkJCXByaXYtPndzdGF0cy5xdWFsLnVwZGF0ZWQg fD0gKElXX1FVQUxfUVVBTF9JTlZBTElEDQorCQkJCQkJCXwgSVdfUVVBTF9M RVZFTF9JTlZBTElEKTsNCiAJCX0NCiAJCXByaXYtPndzdGF0cy5xdWFsLm5v aXNlID0gMDsNCi0JCXByaXYtPndzdGF0cy5xdWFsLnVwZGF0ZWQgPSA3Ow0K KwkJcHJpdi0+d3N0YXRzLnF1YWwudXBkYXRlZCB8PSBJV19RVUFMX05PSVNF X0lOVkFMSUQ7DQogCX0gZWxzZSB7DQogCQkvKiBRdWFsaXR5IGxldmVscyBj YW5ub3QgYmUgZGV0ZXJtaW5lZCBpbiBhZC1ob2MgbW9kZSwNCiAJCSAgIGJl Y2F1c2Ugd2UgY2FuICdoZWFyJyBtb3JlIHRoYXQgb25lIHJlbW90ZSBzdGF0 aW9uLiAqLw0KIAkJcHJpdi0+d3N0YXRzLnF1YWwucXVhbCA9IDA7DQogCQlw cml2LT53c3RhdHMucXVhbC5sZXZlbAk9IDA7DQogCQlwcml2LT53c3RhdHMu cXVhbC5ub2lzZQk9IDA7DQotCQlwcml2LT53c3RhdHMucXVhbC51cGRhdGVk ID0gMDsNCisJCXByaXYtPndzdGF0cy5xdWFsLnVwZGF0ZWQgPSBJV19RVUFM X1FVQUxfSU5WQUxJRA0KKwkJCQkJCQl8IElXX1FVQUxfTEVWRUxfSU5WQUxJ RA0KKwkJCQkJCQl8IElXX1FVQUxfTk9JU0VfSU5WQUxJRDsNCiAJCXByaXYt PndzdGF0cy5taXNzLmJlYWNvbiA9IDA7DQogCX0NCiAJDQpAQCAtMTQ4Miw3 ICsxNTAzLDcgQEANCiAgICAgICAgIHJldHVybiBsZW47DQogfQ0KIA0KLXN0 cnVjdCBuZXRfZGV2aWNlICppbml0X2F0bWVsX2NhcmQoIHVuc2lnbmVkIHNo b3J0IGlycSwgaW50IHBvcnQsIGNoYXIgKmZpcm13YXJlX2lkLCAgDQorc3Ry dWN0IG5ldF9kZXZpY2UgKmluaXRfYXRtZWxfY2FyZCggdW5zaWduZWQgc2hv cnQgaXJxLCBpbnQgcG9ydCwgY29uc3QgQXRtZWxGV1R5cGUgZndfdHlwZSwg IA0KIAkJCQkgICAgc3RydWN0IGRldmljZSAqc3lzX2RldiwgaW50ICgqY2Fy ZF9wcmVzZW50KSh2b2lkICopLCB2b2lkICpjYXJkKQ0KIHsNCiAJc3RydWN0 IG5ldF9kZXZpY2UgKmRldjsNCkBAIC0xNTA3LDExICsxNTI4LDkgQEANCiAJ cHJpdi0+Y2FyZCA9IGNhcmQ7DQogCXByaXYtPmZpcm13YXJlID0gTlVMTDsN CiAJcHJpdi0+ZmlybXdhcmVfaWRbMF0gPSAnXDAnOw0KLQlwcml2LT5maXJt d2FyZV90ZW1wbGF0ZVswXSA9ICdcMCc7DQorCXByaXYtPmZpcm13YXJlX3R5 cGUgPSBmd190eXBlOw0KIAlpZiAoZmlybXdhcmUpIC8qIG1vZHVsZSBwYXJh bWV0ZXIgKi8NCiAJCXN0cmNweShwcml2LT5maXJtd2FyZV9pZCwgZmlybXdh cmUpOw0KLQllbHNlIGlmIChmaXJtd2FyZV9pZCkgLyogZnJvbSBQQ01DSUEg Y2FyZC1tYXRjaGluZyBvciBQQ0kgKi8NCi0JCXN0cmNweShwcml2LT5maXJt d2FyZV90ZW1wbGF0ZSwgZmlybXdhcmVfaWQpOw0KIAlwcml2LT5idXNfdHlw ZSA9IGNhcmRfcHJlc2VudCA/IEJVU19UWVBFX1BDQ0FSRCA6IEJVU19UWVBF X1BDSTsNCiAJcHJpdi0+c3RhdGlvbl9zdGF0ZSA9IFNUQVRJT05fU1RBVEVf RE9XTjsNCiAJcHJpdi0+ZG9fcnhfY3JjID0gMDsNCkBAIC0yMjE4LDYgKzIy MzcsOSBAQA0KIAlyYW5nZS0+bWF4X3F1YWwucXVhbCA9IDEwMDsNCiAJcmFu Z2UtPm1heF9xdWFsLmxldmVsID0gMTAwOw0KIAlyYW5nZS0+bWF4X3F1YWwu bm9pc2UgPSAwOw0KKwlyYW5nZS0+bWF4X3F1YWwudXBkYXRlZCA9IElXX1FV QUxfUVVBTF9VUERBVEVEDQorCQkJCQkJfCBJV19RVUFMX0xFVkVMX1VQREFU RUQNCisJCQkJCQl8IElXX1FVQUxfTk9JU0VfSU5WQUxJRDsNCiAJcmFuZ2Ut PnNlbnNpdGl2aXR5ID0gMDsNCiANCiAJcmFuZ2UtPmJpdHJhdGVbMF0gPSAg MTAwMDAwMDsNCkBAIC0yMjQ3LDkgKzIyNjksMTMgQEANCiAJcmFuZ2UtPnJf dGltZV9mbGFncyA9IDA7DQogCXJhbmdlLT5taW5fcmV0cnkgPSAxOw0KIAly YW5nZS0+bWF4X3JldHJ5ID0gNjU1MzU7DQorDQogCXJhbmdlLT5hdmdfcXVh bC5xdWFsID0gNTA7DQogCXJhbmdlLT5hdmdfcXVhbC5sZXZlbCA9IDUwOw0K IAlyYW5nZS0+YXZnX3F1YWwubm9pc2UgPSAwOw0KKwlyYW5nZS0+YXZnX3F1 YWwudXBkYXRlZCA9IElXX1FVQUxfUVVBTF9VUERBVEVEDQorCQkJCQkJfCBJ V19RVUFMX0xFVkVMX1VQREFURUQNCisJCQkJCQl8IElXX1FVQUxfTk9JU0Vf SU5WQUxJRDsNCiANCiAJcmV0dXJuIDA7DQogfQ0KQEAgLTMwMjUsMTYgKzMw NTEsMjMgQEANCiBzdGF0aWMgdm9pZCBzbW9vdGhfcnNzaShzdHJ1Y3QgYXRt ZWxfcHJpdmF0ZSAqcHJpdiwgdTggcnNzaSkNCiB7DQogCXU4IG9sZCA9IHBy aXYtPndzdGF0cy5xdWFsLmxldmVsOw0KKwl1OCBtYXhfcnNzaSA9IDQyOyAv KiA1MDItcm1mZC1yZXZkIG1heCBieSBleHBlcmltZW50ICovDQogDQotCS8q IDUwMi1ybWZkLXJldmQgZ2l2ZXMgbWF4IHNpZ25hbCBsZXZlbCBhcyA0Miwg YnkgZXhwZXJpbWVudC4NCi0JICAgVGhpcyBpcyBnb2luZyB0byBicmVhayBm b3Igb3RoZXIgaGFyZHdhcmUgdmFyaWFudHMuICovDQorCXN3aXRjaCAocHJp di0+ZmlybXdhcmVfdHlwZSkgew0KKwkJY2FzZSBBVE1FTF9GV19UWVBFXzUw MkU6DQorCQkJbWF4X3Jzc2kgPSA2MzsgLyogNTAyLXJtZmQtcmV2ZSBtYXgg YnkgZXhwZXJpbWVudCAqLw0KKwkJCWJyZWFrOw0KKwkJZGVmYXVsdDoNCisJ CQlicmVhazsNCisJfQ0KIA0KLQlyc3NpID0gcnNzaSAqIDEwMCAvIDQyOw0K Kwlyc3NpID0gcnNzaSAqIDEwMCAvIG1heF9yc3NpOw0KIAlpZigocnNzaSAr IG9sZCkgJSAyKQ0KIAkJcHJpdi0+d3N0YXRzLnF1YWwubGV2ZWwgPSAgKChy c3NpICsgb2xkKS8yKSArIDE7DQogCWVsc2UNCiAJCXByaXYtPndzdGF0cy5x dWFsLmxldmVsID0gICgocnNzaSArIG9sZCkvMik7CQkNCi0JDQorCXByaXYt PndzdGF0cy5xdWFsLnVwZGF0ZWQgfD0gSVdfUVVBTF9MRVZFTF9VUERBVEVE Ow0KKwlwcml2LT53c3RhdHMucXVhbC51cGRhdGVkICY9IH5JV19RVUFMX0xF VkVMX0lOVkFMSUQ7DQogfQ0KIA0KIHN0YXRpYyB2b2lkIGF0bWVsX3Ntb290 aF9xdWFsKHN0cnVjdCBhdG1lbF9wcml2YXRlICpwcml2KQ0KQEAgLTMwNDcs OCArMzA4MCwxMCBAQA0KIAkJCXByaXYtPmJlYWNvbnNfdGhpc19zZWMgKiBw cml2LT5iZWFjb25fcGVyaW9kICogKHByaXYtPndzdGF0cy5xdWFsLmxldmVs ICsgMTAwKSAvIDQwMDA7DQogCQlwcml2LT5iZWFjb25zX3RoaXNfc2VjID0g MDsNCiAJfQ0KKwlwcml2LT53c3RhdHMucXVhbC51cGRhdGVkIHw9IElXX1FV QUxfUVVBTF9VUERBVEVEOw0KKwlwcml2LT53c3RhdHMucXVhbC51cGRhdGVk ICY9IH5JV19RVUFMX1FVQUxfSU5WQUxJRDsNCiB9DQotCQ0KKw0KIC8qIGRl YWxzIHdpdGggaW5jb21pbmcgbWFuYWdtZW50IGZyYW1lcy4gKi8NCiBzdGF0 aWMgdm9pZCBhdG1lbF9tYW5hZ2VtZW50X2ZyYW1lKHN0cnVjdCBhdG1lbF9w cml2YXRlICpwcml2LCBzdHJ1Y3QgaWVlZTgwMl8xMV9oZHIgKmhlYWRlciwg DQogCQkgICAgICB1MTYgZnJhbWVfbGVuLCB1OCByc3NpKQ0KQEAgLTM1NzEs NiArMzYwNiwxNyBAQA0KIAlhdG1lbF9zZXRfbWliKHByaXYsIE1hY19XZXBf TWliX1R5cGUsIDAsICh1OCAqKSZtaWIsIHNpemVvZihtaWIpKTsNCiB9DQog CQkJCQkNCitzdGF0aWMgY29uc3QgY2hhciAqYXRtZWxfZ2V0X2Zpcm13YXJl X3RlbXBsYXRlIChjb25zdCBBdG1lbEZXVHlwZSBmd190eXBlKQ0KK3sNCisJ aW50IGk7DQorCWZvcihpID0gMDsgaSA8IHNpemVvZihmaXJtd2FyZV90YWJs ZSkvc2l6ZW9mKGZpcm13YXJlX3RhYmxlWzBdKTsgaSsrKQ0KKwl7DQorCQlp ZiAoZmlybXdhcmVfdGFibGVbaV0uZndfdHlwZSA9PSBmd190eXBlKQ0KKwkJ CXJldHVybiBmaXJtd2FyZV90YWJsZVtpXS5maWxlbmFtZTsNCisJfQ0KKwly ZXR1cm4gTlVMTDsNCit9DQorDQogc3RhdGljIGludCByZXNldF9hdG1lbF9j YXJkKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpIA0KIHsNCiAJLyogZG8gZXZl cnl0aGluZyBuZWNlc3NhcnkgdG8gd2FrZSB1cCB0aGUgaGFyZHdhcmUsIGlu Y2x1ZGluZw0KQEAgLTM2MTEsOCArMzY1Nyw4IEBADQogCQljb25zdCBzdHJ1 Y3QgZmlybXdhcmUgKmZ3X2VudHJ5ID0gTlVMTDsNCiAJCXVuc2lnbmVkIGNo YXIgKmZ3Ow0KIAkJaW50IGxlbiA9IHByaXYtPmZpcm13YXJlX2xlbmd0aDsN Ci0JCWlmICghKGZ3ID0gcHJpdi0+ZmlybXdhcmUpKSB7IA0KLQkJCWlmIChz dHJsZW4ocHJpdi0+ZmlybXdhcmVfdGVtcGxhdGUpID09IDApIHsJDQorCQlp ZiAoIShmdyA9IHByaXYtPmZpcm13YXJlKSkgew0KKwkJCWlmIChwcml2LT5m aXJtd2FyZV90eXBlID09IEFUTUVMX0ZXX1RZUEVfTk9ORSkgew0KIAkJCQlp ZiAoc3RybGVuKHByaXYtPmZpcm13YXJlX2lkKSA9PSAwKSB7DQogCQkJCQlw cmludGsoS0VSTl9JTkZPDQogCQkJCQkgICAgICAgIiVzOiBjYXJkIHR5cGUg aXMgdW5rbm93bjogYXNzdW1pbmcgYXQ3NmM1MDIgZmlybXdhcmUgaXMgT0su XG4iLA0KQEAgLTM2MjcsMjQgKzM2NzMsMjQgQEANCiAJCQkJCSAgICAgICAi JXM6IGZpcm13YXJlICVzIGlzIG1pc3NpbmcsIGNhbm5vdCBjb250aW51ZS5c biIsIA0KIAkJCQkJICAgICAgIGRldi0+bmFtZSwgcHJpdi0+ZmlybXdhcmVf aWQpOw0KIAkJCQkJcmV0dXJuIDA7DQotCQkJCQkNCi0JCQkJfSANCisJCQkJ fQ0KIAkJCX0gZWxzZSB7DQogCQkJCWludCBpOw0KKwkJCQljb25zdCBjaGFy ICpzID0gYXRtZWxfZ2V0X2Zpcm13YXJlX3RlbXBsYXRlKHByaXYtPmZpcm13 YXJlX3R5cGUpOw0KIAkJCQkNCi0JCQkJZm9yIChpID0gMDsgZmlybXdhcmVf bW9kaWZpZXJbaV07IGkrKykgew0KLQkJCQkJc3ByaW50Zihwcml2LT5maXJt d2FyZV9pZCwgcHJpdi0+ZmlybXdhcmVfdGVtcGxhdGUsIGZpcm13YXJlX21v ZGlmaWVyW2ldKTsNCisJCQkJZm9yIChpID0gMDsgcyAmJiBmaXJtd2FyZV9t b2RpZmllcltpXTsgaSsrKSB7DQorCQkJCQlzbnByaW50Zihwcml2LT5maXJt d2FyZV9pZCwgMzIsIHMsIGZpcm13YXJlX21vZGlmaWVyW2ldKTsNCisJCQkJ CXByaXYtPmZpcm13YXJlX2lkWzMxXSA9ICdcMCc7DQogCQkJCQlpZiAocmVx dWVzdF9maXJtd2FyZSgmZndfZW50cnksIHByaXYtPmZpcm13YXJlX2lkLCBw cml2LT5zeXNfZGV2KSA9PSAwKSANCiAJCQkJCQlicmVhazsNCiAJCQkJfQ0K LQkJCQlpZiAoIWZpcm13YXJlX21vZGlmaWVyW2ldKSB7DQorCQkJCWlmICgh cyB8fCAhZmlybXdhcmVfbW9kaWZpZXJbaV0pIHsNCiAJCQkJCXByaW50ayhL RVJOX0FMRVJUIA0KIAkJCQkJICAgICAgICIlczogZmlybXdhcmUgJXMgaXMg bWlzc2luZywgY2Fubm90IHN0YXJ0LlxuIiwgDQogCQkJCQkgICAgICAgZGV2 LT5uYW1lLCBwcml2LT5maXJtd2FyZV9pZCk7DQogCQkJCQlwcml2LT5maXJt d2FyZV9pZFswXSA9ICdcMCc7DQogCQkJCQlyZXR1cm4gMDsJDQogCQkJCX0N Ci0JCQkJcHJpdi0+ZmlybXdhcmVfdGVtcGxhdGVbMF0gPSAnXDAnOwkNCiAJ CQl9DQogCQkJDQogCQkJZncgPSBmd19lbnRyeS0+ZGF0YTsNCi0tLSBhL2Ry aXZlcnMvbmV0L3dpcmVsZXNzL2F0bWVsX2NzLmMJMjAwNS0wMS0yNyAyMDoy Njo0Ni4wMDAwMDAwMDAgLTA1MDANCisrKyBiL2RyaXZlcnMvbmV0L3dpcmVs ZXNzL2F0bWVsX2NzLmMJMjAwNS0wMS0zMCAxNDowNTowOC4wMDAwMDAwMDAg LTA1MDANCkBAIC01NSw2ICs1NSw3IEBADQogI2luY2x1ZGUgPGFzbS9zeXN0 ZW0uaD4NCiAjaW5jbHVkZSA8bGludXgvd2lyZWxlc3MuaD4NCiANCisjaW5j bHVkZSAiYXRtZWwuaCINCiANCiAvKg0KICAgIEFsbCB0aGUgUENNQ0lBIG1v ZHVsZXMgdXNlIFBDTUNJQV9ERUJVRyB0byBjb250cm9sIGRlYnVnZ2luZy4g IElmDQpAQCAtOTAsMTEgKzkxLDYgQEANCiAgICBldmVudCBoYW5kbGVyLiAN CiAqLw0KIA0KLXN0cnVjdCBuZXRfZGV2aWNlICppbml0X2F0bWVsX2NhcmQo aW50LCBpbnQsIGNoYXIgKiwgc3RydWN0IGRldmljZSAqLCANCi0JCQkJICAg IGludCAoKnByZXNlbnRfZnVuYykodm9pZCAqKSwgdm9pZCAqICk7DQotdm9p ZCBzdG9wX2F0bWVsX2NhcmQoIHN0cnVjdCBuZXRfZGV2aWNlICosIGludCAp Ow0KLWludCBhdG1lbF9vcGVuKCBzdHJ1Y3QgbmV0X2RldmljZSAqICk7DQot DQogc3RhdGljIHZvaWQgYXRtZWxfY29uZmlnKGRldl9saW5rX3QgKmxpbmsp Ow0KIHN0YXRpYyB2b2lkIGF0bWVsX3JlbGVhc2UoZGV2X2xpbmtfdCAqbGlu ayk7DQogc3RhdGljIGludCBhdG1lbF9ldmVudChldmVudF90IGV2ZW50LCBp bnQgcHJpb3JpdHksDQpAQCAtMzA3LDI4ICszMDMsMjggQEANCiBzdGF0aWMg c3RydWN0IHsgDQogCWludCBtYW5mLCBjYXJkOw0KIAljaGFyICp2ZXIxOw0K LQljaGFyICpmaXJtd2FyZTsNCisJQXRtZWxGV1R5cGUgZmlybXdhcmU7DQog CWNoYXIgKm5hbWU7DQogfSBjYXJkX3RhYmxlW10gPSB7DQotCXsgMCwgMCwg IldMQU4vODAyLjExYiBQQyBDQVJEIiwgImF0bWVsX2F0NzZjNTAyZCVzLmJp biIsICJBY3Rpb250ZWMgODAyQ0FUMSIgfSwgIA0KLQl7IDAsIDAsICJBVE1F TC9BVDc2QzUwMkFSIiwgImF0bWVsX2F0NzZjNTAyJXMuYmluIiwgIk5vTmFt ZS1SRk1EIiB9LCANCi0JeyAwLCAwLCAiQVRNRUwvQVQ3NkM1MDJBUl9EIiwg ImF0bWVsX2F0NzZjNTAyZCVzLmJpbiIsICJOb05hbWUtcmV2RCIgfSwgDQot CXsgMCwgMCwgIkFUTUVML0FUNzZDNTAyQVJfRSIsICJhdG1lbF9hdDc2YzUw MmUlcy5iaW4iLCAiTm9OYW1lLXJldkUiIH0sDQotCXsgMCwgMCwgIkFUTUVM L0FUNzZDNTA0IiwgImF0bWVsX2F0NzZjNTA0JXMuYmluIiwgIk5vTmFtZS01 MDQiIH0sDQotCXsgMCwgMCwgIkFUTUVML0FUNzZDNTA0QSIsICJhdG1lbF9h dDc2YzUwNGFfMjk1OCVzLmJpbiIsICJOb05hbWUtNTA0YS0yOTU4IiB9LA0K LQl7IDAsIDAsICJBVE1FTC9BVDc2QzUwNF9SIiwgImF0bWVsX2F0NzZjNTA0 XzI5NTglcy5iaW4iLCAiTm9OYW1lLTUwNC0yOTU4IiB9LA0KLQl7IE1BTkZJ RF8zQ09NLCAweDA2MjAsIE5VTEwsICJhdG1lbF9hdDc2YzUwMl8zY29tJXMu YmluIiwgIjNjb20gM0NSV0U2MjA5MkIiIH0sIA0KLQl7IE1BTkZJRF8zQ09N LCAweDA2OTYsIE5VTEwsICJhdG1lbF9hdDc2YzUwMl8zY29tJXMuYmluIiwg IjNjb20gM0NSU0hQVzE5NiIgfSwgDQotCXsgMCwgMCwgIlNNQy8yNjMyVy1W MiIsICJhdG1lbF9hdDc2YzUwMiVzLmJpbiIsICJTTUMgMjYzMlctVjIiIH0s DQotICAgICAgICB7IDAsIDAsICJTTUMvMjYzMlciLCAiYXRtZWxfYXQ3NmM1 MDJkJXMuYmluIiwgIlNNQyAyNjMyVy1WMyIgfSwNCi0JeyAweGQ2MDEsIDB4 MDAwNywgTlVMTCwgImF0bWVsX2F0NzZjNTAyJXMuYmluIiwgIlNpdGVjb20g V0xBTi0wMTEiIH0sIA0KLQl7IDB4MDFiZiwgMHgzMzAyLCBOVUxMLCAiYXRt ZWxfYXQ3NmM1MDJlJXMuYmluIiwgIkJlbGtpbiBGNUQ2MDIwLVYyIiB9LCAN Ci0JeyAwLCAwLCAiQlQvVm95YWdlciAxMDIwIExhcHRvcCBBZGFwdGVyIiwg ImF0bWVsX2F0NzZjNTAyJXMuYmluIiwgIkJUIFZveWFnZXIgMTAyMCIgfSwN Ci0gICAgICAgIHsgMCwgMCwgIklFRUUgODAyLjExYi9XaXJlbGVzcyBMQU4g UEMgQ2FyZCIsICJhdG1lbF9hdDc2YzUwMiVzLmJpbiIsICJTaWVtZW5zIEdp Z2FzZXQgUEMgQ2FyZCBJSSIgfSwNCi0JeyAwLCAwLCAiQ05ldC9DTldMQyAx MU1icHMgV2lyZWxlc3MgUEMgQ2FyZCBWLTUiLCAiYXRtZWxfYXQ3NmM1MDJl JXMuYmluIiwgIkNOZXQgQ05XTEMtODExQVJMIiB9LA0KLQl7IDAsIDAsICJX aXJlbGVzcy9QQ19DQVJEIiwgImF0bWVsX2F0NzZjNTAyZCVzLmJpbiIsICJQ bGFuZXQgV0wtMzU1MiIgfSwNCi0JeyAwLCAwLCAiT0VNLzExTWJwcyBXaXJl bGVzcyBMQU4gUEMgQ2FyZCBWLTMiLCAiYXRtZWxfYXQ3NmM1MDIlcy5iaW4i LCAiT0VNIDExTWJwcyBXTEFOIFBDTUNJQSBDYXJkIiB9LA0KLQl7IDAsIDAs ICIxMVdBVkUvMTFXUDYxMUFMLUUiLCAiYXRtZWxfYXQ3NmM1MDJlJXMuYmlu IiwgIjExV0FWRSBXYXZlQnVkZHkiIH0gDQorCXsgMCwgMCwgIldMQU4vODAy LjExYiBQQyBDQVJEIiwgQVRNRUxfRldfVFlQRV81MDJELCAiQWN0aW9udGVj IDgwMkNBVDEiIH0sICANCisJeyAwLCAwLCAiQVRNRUwvQVQ3NkM1MDJBUiIs IEFUTUVMX0ZXX1RZUEVfNTAyLCAiTm9OYW1lLVJGTUQiIH0sIA0KKwl7IDAs IDAsICJBVE1FTC9BVDc2QzUwMkFSX0QiLCBBVE1FTF9GV19UWVBFXzUwMkQs ICJOb05hbWUtcmV2RCIgfSwgDQorCXsgMCwgMCwgIkFUTUVML0FUNzZDNTAy QVJfRSIsIEFUTUVMX0ZXX1RZUEVfNTAyRSwgIk5vTmFtZS1yZXZFIiB9LA0K Kwl7IDAsIDAsICJBVE1FTC9BVDc2QzUwNCIsIEFUTUVMX0ZXX1RZUEVfNTA0 LCAiTm9OYW1lLTUwNCIgfSwNCisJeyAwLCAwLCAiQVRNRUwvQVQ3NkM1MDRB IiwgQVRNRUxfRldfVFlQRV81MDRBXzI5NTgsICJOb05hbWUtNTA0YS0yOTU4 IiB9LA0KKwl7IDAsIDAsICJBVE1FTC9BVDc2QzUwNF9SIiwgQVRNRUxfRldf VFlQRV81MDRfMjk1OCwgIk5vTmFtZS01MDQtMjk1OCIgfSwNCisJeyBNQU5G SURfM0NPTSwgMHgwNjIwLCBOVUxMLCBBVE1FTF9GV19UWVBFXzUwMl8zQ09N LCAiM2NvbSAzQ1JXRTYyMDkyQiIgfSwgDQorCXsgTUFORklEXzNDT00sIDB4 MDY5NiwgTlVMTCwgQVRNRUxfRldfVFlQRV81MDJfM0NPTSwgIjNjb20gM0NS U0hQVzE5NiIgfSwgDQorCXsgMCwgMCwgIlNNQy8yNjMyVy1WMiIsIEFUTUVM X0ZXX1RZUEVfNTAyLCAiU01DIDI2MzJXLVYyIiB9LA0KKwl7IDAsIDAsICJT TUMvMjYzMlciLCBBVE1FTF9GV19UWVBFXzUwMkQsICJTTUMgMjYzMlctVjMi IH0sDQorCXsgMHhkNjAxLCAweDAwMDcsIE5VTEwsIEFUTUVMX0ZXX1RZUEVf NTAyLCAiU2l0ZWNvbSBXTEFOLTAxMSIgfSwgDQorCXsgMHgwMWJmLCAweDMz MDIsIE5VTEwsIEFUTUVMX0ZXX1RZUEVfNTAyRSwgIkJlbGtpbiBGNUQ2MDIw LVYyIiB9LCANCisJeyAwLCAwLCAiQlQvVm95YWdlciAxMDIwIExhcHRvcCBB ZGFwdGVyIiwgQVRNRUxfRldfVFlQRV81MDIsICJCVCBWb3lhZ2VyIDEwMjAi IH0sDQorCXsgMCwgMCwgIklFRUUgODAyLjExYi9XaXJlbGVzcyBMQU4gUEMg Q2FyZCIsIEFUTUVMX0ZXX1RZUEVfNTAyLCAiU2llbWVucyBHaWdhc2V0IFBD IENhcmQgSUkiIH0sDQorCXsgMCwgMCwgIkNOZXQvQ05XTEMgMTFNYnBzIFdp cmVsZXNzIFBDIENhcmQgVi01IiwgQVRNRUxfRldfVFlQRV81MDJFLCAiQ05l dCBDTldMQy04MTFBUkwiIH0sDQorCXsgMCwgMCwgIldpcmVsZXNzL1BDX0NB UkQiLCBBVE1FTF9GV19UWVBFXzUwMkQsICJQbGFuZXQgV0wtMzU1MiIgfSwN CisJeyAwLCAwLCAiT0VNLzExTWJwcyBXaXJlbGVzcyBMQU4gUEMgQ2FyZCBW LTMiLCBBVE1FTF9GV19UWVBFXzUwMiwgIk9FTSAxMU1icHMgV0xBTiBQQ01D SUEgQ2FyZCIgfSwNCisJeyAwLCAwLCAiMTFXQVZFLzExV1A2MTFBTC1FIiwg QVRNRUxfRldfVFlQRV81MDJFLCAiMTFXQVZFIFdhdmVCdWRkeSIgfSANCiB9 Ow0KIA0KIHN0YXRpYyB2b2lkIGF0bWVsX2NvbmZpZyhkZXZfbGlua190ICps aW5rKQ0KQEAgLTUyMCw3ICs1MTYsNyBAQA0KIAkoKGxvY2FsX2luZm9fdCop bGluay0+cHJpdiktPmV0aF9kZXYgPSANCiAJCWluaXRfYXRtZWxfY2FyZChs aW5rLT5pcnEuQXNzaWduZWRJUlEsDQogCQkJCWxpbmstPmlvLkJhc2VQb3J0 MSwNCi0JCQkJY2FyZF9pbmRleCA9PSAtMSA/IE5VTEwgOiAgY2FyZF90YWJs ZVtjYXJkX2luZGV4XS5maXJtd2FyZSwNCisJCQkJY2FyZF9pbmRleCA9PSAt MSA/IEFUTUVMX0ZXX1RZUEVfTk9ORSA6ICBjYXJkX3RhYmxlW2NhcmRfaW5k ZXhdLmZpcm13YXJlLA0KIAkJCQkmaGFuZGxlX3RvX2RldihoYW5kbGUpLA0K IAkJCQljYXJkX3ByZXNlbnQsIA0KIAkJCQlsaW5rKTsNCi0tLSBhL2RyaXZl cnMvbmV0L3dpcmVsZXNzL2F0bWVsX3BjaS5jCTIwMDUtMDEtMjcgMjA6MjY6 NDYuMDAwMDAwMDAwIC0wNTAwDQorKysgYi9kcml2ZXJzL25ldC93aXJlbGVz cy9hdG1lbF9wY2kuYwkyMDA1LTAxLTMwIDE0OjA1OjMwLjAwMDAwMDAwMCAt MDUwMA0KQEAgLTI1LDYgKzI1LDcgQEANCiAjaW5jbHVkZSA8bGludXgvbW9k dWxlLmg+DQogI2luY2x1ZGUgPGxpbnV4L2luaXQuaD4NCiAjaW5jbHVkZSA8 bGludXgvbmV0ZGV2aWNlLmg+DQorI2luY2x1ZGUgImF0bWVsLmgiDQogDQog TU9EVUxFX0FVVEhPUigiU2ltb24gS2VsbGV5Iik7DQogTU9EVUxFX0RFU0NS SVBUSU9OKCJTdXBwb3J0IGZvciBBdG1lbCBhdDc2YzUweCA4MDIuMTEgd2ly ZWxlc3MgZXRoZXJuZXQgY2FyZHMuIik7DQpAQCAtNDAsOSArNDEsNiBAQA0K IA0KIHN0YXRpYyBpbnQgYXRtZWxfcGNpX3Byb2JlKHN0cnVjdCBwY2lfZGV2 ICosIGNvbnN0IHN0cnVjdCBwY2lfZGV2aWNlX2lkICopOw0KIHN0YXRpYyB2 b2lkIGF0bWVsX3BjaV9yZW1vdmUoc3RydWN0IHBjaV9kZXYgKik7DQotc3Ry dWN0IG5ldF9kZXZpY2UgKmluaXRfYXRtZWxfY2FyZChpbnQsIGludCwgY2hh ciAqLCBzdHJ1Y3QgZGV2aWNlICosIA0KLQkJCQkgICBpbnQgKCpwcmVzZW50 X2Z1bmMpKHZvaWQgKiksIHZvaWQgKiApOw0KLXZvaWQgc3RvcF9hdG1lbF9j YXJkKCBzdHJ1Y3QgbmV0X2RldmljZSAqLCBpbnQgKTsNCiANCiBzdGF0aWMg c3RydWN0IHBjaV9kcml2ZXIgYXRtZWxfZHJpdmVyID0gew0KIAkubmFtZSAg ICAgPSAiYXRtZWwiLA0KQEAgLTYzLDcgKzYxLDcgQEANCiAJcGNpX3NldF9t YXN0ZXIocGRldik7DQogCQ0KIAlkZXYgPSBpbml0X2F0bWVsX2NhcmQocGRl di0+aXJxLCBwZGV2LT5yZXNvdXJjZVsxXS5zdGFydCwgDQotCQkJICAgICAg ImF0bWVsX2F0NzZjNTA2JXMuYmluIiwNCisJCQkgICAgICBBVE1FTF9GV19U WVBFXzUwNiwNCiAJCQkgICAgICAmcGRldi0+ZGV2LCBOVUxMLCBOVUxMKTsN CiAJaWYgKCFkZXYpDQogCQlyZXR1cm4gLUVOT0RFVjsNCg== --279707962-801068342-1107129390=:6929-- From hadi@cyberus.ca Sun Jan 30 16:09:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 16:09:59 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V09s5W019120 for ; Sun, 30 Jan 2005 16:09:55 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1CvP8b-0002Jl-Cg for netdev@oss.sgi.com; Sun, 30 Jan 2005 19:09:53 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CvP8Q-0003db-JO; Sun, 30 Jan 2005 19:09:42 -0500 Subject: Re: [patch 4/10] s390: network driver. From: jamal Reply-To: hadi@cyberus.ca To: Tommy Christensen Cc: Jeff Garzik , Thomas Spatzier , "David S. Miller" , Hasso Tepper , Herbert Xu , netdev@oss.sgi.com, Paul Jakma In-Reply-To: <41FD702D.2060403@tpack.net> References: <1104764710.1048.580.camel@jzny.localdomain> <41DB26A6.2070008@pobox.com> <1104895169.1117.63.camel@jzny.localdomain> <41DC0931.80603@tpack.net> <1105019912.2314.20.camel@jzny.localdomain> <1105023972.3462.48.camel@tsc-6.cph.tpack.net> <1105104757.1046.63.camel@jzny.localdomain> <1105111605.3462.101.camel@tsc-6.cph.tpack.net> <1105363092.1041.146.camel@jzny.localdomain> <1105917038.1091.1041.camel@jzny.localdomain> <41EC3067.6050104@tpack.net> <41FD702D.2060403@tpack.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1107130177.7847.96.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 30 Jan 2005 19:09:38 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1025 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 299 Lines: 14 Tommy, I wasnt sure why you did: dev->qdisc = &noop_qdisc; You should probably save the old qdisc in qdisc_sleeping instead and restore it on wakeup - otherwise you always end with default qdisc. check_carrier should probably just call dev_activate which does all you wanted, no? cheers, jamal From hadi@cyberus.ca Sun Jan 30 16:12:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 16:12:19 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V0CEkB019615 for ; Sun, 30 Jan 2005 16:12:15 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CvPAu-0006zH-0T for netdev@oss.sgi.com; Sun, 30 Jan 2005 19:12:16 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CvPAp-0003rk-BB; Sun, 30 Jan 2005 19:12:11 -0500 Subject: Re: [patch 4/10] s390: network driver. From: jamal Reply-To: hadi@cyberus.ca To: Tommy Christensen Cc: Jeff Garzik , Thomas Spatzier , "David S. Miller" , Hasso Tepper , Herbert Xu , netdev@oss.sgi.com, Paul Jakma In-Reply-To: <1107130177.7847.96.camel@jzny.localdomain> References: <1104764710.1048.580.camel@jzny.localdomain> <41DB26A6.2070008@pobox.com> <1104895169.1117.63.camel@jzny.localdomain> <41DC0931.80603@tpack.net> <1105019912.2314.20.camel@jzny.localdomain> <1105023972.3462.48.camel@tsc-6.cph.tpack.net> <1105104757.1046.63.camel@jzny.localdomain> <1105111605.3462.101.camel@tsc-6.cph.tpack.net> <1105363092.1041.146.camel@jzny.localdomain> <1105917038.1091.1041.camel@jzny.localdomain> <41EC3067.6050104@tpack.net> <41FD702D.2060403@tpack.net> <1107130177.7847.96.camel@jzny.localdomain> Content-Type: text/plain Organization: jamalopolous Message-Id: <1107130326.7840.99.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 30 Jan 2005 19:12:06 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1026 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 437 Lines: 22 On Sun, 2005-01-30 at 19:09, jamal wrote: > Tommy, > > I wasnt sure why you did: > > dev->qdisc = &noop_qdisc; > > You should probably save the old qdisc in qdisc_sleeping instead > and restore it on wakeup - otherwise you always end with default qdisc. > check_carrier should probably just call dev_activate meant dev_deactivate - watch them locks though .. cheers, jamal > which does all you > wanted, no? > > cheers, > jamal From tommy.christensen@tpack.net Sun Jan 30 16:29:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 16:29:46 -0800 (PST) Received: from mail.tpack.net (ip18.tpack.net [213.173.228.18]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0V0TekN023619 for ; Sun, 30 Jan 2005 16:29:41 -0800 Received: (qmail 6207 invoked from network); 31 Jan 2005 00:29:34 -0000 Received: from dhcp-138.cph.tpack.net (HELO ?172.17.159.11?) (192.168.0.138) by 0 with SMTP; 31 Jan 2005 00:29:34 -0000 Message-ID: <41FD7C6F.3010005@tpack.net> Date: Mon, 31 Jan 2005 01:31:43 +0100 From: Tommy Christensen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: en-us, en MIME-Version: 1.0 To: hadi@cyberus.ca CC: Jeff Garzik , Thomas Spatzier , "David S. Miller" , Hasso Tepper , Herbert Xu , netdev@oss.sgi.com, Paul Jakma Subject: Re: [patch 4/10] s390: network driver. References: <1104764710.1048.580.camel@jzny.localdomain> <41DB26A6.2070008@pobox.com> <1104895169.1117.63.camel@jzny.localdomain> <41DC0931.80603@tpack.net> <1105019912.2314.20.camel@jzny.localdomain> <1105023972.3462.48.camel@tsc-6.cph.tpack.net> <1105104757.1046.63.camel@jzny.localdomain> <1105111605.3462.101.camel@tsc-6.cph.tpack.net> <1105363092.1041.146.camel@jzny.localdomain> <1105917038.1091.1041.camel@jzny.localdomain> <41EC3067.6050104@tpack.net> <41FD702D.2060403@tpack.net> <1107130177.7847.96.camel@jzny.localdomain> In-Reply-To: <1107130177.7847.96.camel@jzny.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1027 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tommy.christensen@tpack.net Precedence: bulk X-list: netdev Content-Length: 595 Lines: 20 jamal wrote: > Tommy, > > I wasnt sure why you did: > > dev->qdisc = &noop_qdisc; > > You should probably save the old qdisc in qdisc_sleeping instead > and restore it on wakeup - otherwise you always end with default qdisc. I think normally we will have qdisc == qdisc_sleeping. At least this is how I read the code in dev_graft_qdisc(). When can they differ? > check_carrier should probably just call dev_activate which does all you > wanted, no? I copied the logic from dev_deactivate(), but I didn't want to include the waiting parts, since this is not in process context. OK? -Tommy From rddunlap@osdl.org Sun Jan 30 18:20:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 18:20:52 -0800 (PST) Received: from smtp.osdl.org (fire.osdl.org [65.172.181.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V2Kk4o026613 for ; Sun, 30 Jan 2005 18:20:47 -0800 Received: from [192.168.1.103] (wbar2.sea1-4-5-049-023.sea1.dsl-verizon.net [4.5.49.23]) (authenticated bits=0) by smtp.osdl.org (8.12.8/8.12.8) with ESMTP id j0V2KauM019130 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Sun, 30 Jan 2005 18:20:37 -0800 Message-ID: <41FD93F0.2040601@osdl.org> Date: Sun, 30 Jan 2005 18:12:00 -0800 From: "Randy.Dunlap" User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: jgarzik , netdev , fventuri@mediaone.net, shirsch@adelphia.net Subject: [PATCH] sb1000: reduce ioctl stack usage Content-Type: multipart/mixed; boundary="------------030703040901060907040202" X-MIMEDefang-Filter: osdl$Revision: 1.101 $ X-Scanned-By: MIMEDefang 2.36 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1028 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 3261 Lines: 97 This is a multi-part message in MIME format. --------------030703040901060907040202 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit sb1000_dev_ioctl() (on i386) uses 824 bytes of stack space, all due to overuse of inline functions. By changing a few infrequently used functions to non-inline, the stack usage is reduced to only 60 bytes. Nothing in a fast path is changed. Signed-off-by: Randy Dunlap diffstat:= drivers/net/sb1000.c | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) --------------030703040901060907040202 Content-Type: text/x-patch; name="sb1000_stack.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sb1000_stack.patch" diff -Naurp ./drivers/net/sb1000.c~sb1000_stack ./drivers/net/sb1000.c --- ./drivers/net/sb1000.c~sb1000_stack 2004-12-24 13:33:51.000000000 -0800 +++ ./drivers/net/sb1000.c 2005-01-30 17:49:27.409413904 -0800 @@ -116,15 +116,15 @@ static inline int sb1000_start_get_set_c static inline int sb1000_end_get_set_command(const int ioaddr[], const char* name); static inline int sb1000_activate(const int ioaddr[], const char* name); -static inline int sb1000_get_firmware_version(const int ioaddr[], +static int sb1000_get_firmware_version(const int ioaddr[], const char* name, unsigned char version[], int do_end); -static inline int sb1000_get_frequency(const int ioaddr[], const char* name, +static int sb1000_get_frequency(const int ioaddr[], const char* name, int* frequency); -static inline int sb1000_set_frequency(const int ioaddr[], const char* name, +static int sb1000_set_frequency(const int ioaddr[], const char* name, int frequency); -static inline int sb1000_get_PIDs(const int ioaddr[], const char* name, +static int sb1000_get_PIDs(const int ioaddr[], const char* name, short PID[]); -static inline int sb1000_set_PIDs(const int ioaddr[], const char* name, +static int sb1000_set_PIDs(const int ioaddr[], const char* name, const short PID[]); /* SB1000 commands for frame rx interrupt */ @@ -552,7 +552,7 @@ sb1000_activate(const int ioaddr[], cons } /* get SB1000 firmware version */ -static inline int +static int sb1000_get_firmware_version(const int ioaddr[], const char* name, unsigned char version[], int do_end) { @@ -575,7 +575,7 @@ sb1000_get_firmware_version(const int io } /* get SB1000 frequency */ -static inline int +static int sb1000_get_frequency(const int ioaddr[], const char* name, int* frequency) { unsigned char st[7]; @@ -592,7 +592,7 @@ sb1000_get_frequency(const int ioaddr[], } /* set SB1000 frequency */ -static inline int +static int sb1000_set_frequency(const int ioaddr[], const char* name, int frequency) { unsigned char st[7]; @@ -622,7 +622,7 @@ sb1000_set_frequency(const int ioaddr[], } /* get SB1000 PIDs */ -static inline int +static int sb1000_get_PIDs(const int ioaddr[], const char* name, short PID[]) { unsigned char st[7]; @@ -656,7 +656,7 @@ sb1000_get_PIDs(const int ioaddr[], cons } /* set SB1000 PIDs */ -static inline int +static int sb1000_set_PIDs(const int ioaddr[], const char* name, const short PID[]) { unsigned char st[7]; --------------030703040901060907040202-- From davem@davemloft.net Sun Jan 30 18:24:18 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 18:24:25 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V2OIaH027125 for ; Sun, 30 Jan 2005 18:24:18 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CvR9S-0003NP-00 for ; Sun, 30 Jan 2005 18:18:54 -0800 Date: Sun, 30 Jan 2005 18:18:54 -0800 From: "David S. Miller" To: netdev@oss.sgi.com Subject: LLTX fix proposal Message-Id: <20050130181854.7f088a95.davem@davemloft.net> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1029 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 1382 Lines: 44 Ok, how about we do this for 2.6.11 before it goes out and do something more sophisticated (if necessary) later. The BUG() we're trying to catch in the ->hard_start_xmit() routines is the illegal state: driver_tx_queue_empty() && !netif_queue_stopped(dev) Therefore we could handle the race, and avoid the printk() in the race case but not in the BUG() case above. The test in tg3.c is currently: /* This is a hard error, log it. */ if (unlikely(TX_BUFFS_AVAIL(tp) <= (skb_shinfo(skb)->nr_frags + 1))) { netif_stop_queue(dev); spin_unlock_irqrestore(&tp->tx_lock, flags); printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n", dev->name); return NETDEV_TX_BUSY; } and I'm proposing we change it to something like: if (unlikely(TX_BUFFS_AVAIL(tp) <= (skb_shinfo(skb)->nr_frags + 1))) { /* We can race with queue processing on another * cpu due to LLTX. If the queue is not stopped, * that is a hard error, log it. */ if (!netif_queue_stopped(dev)) { netif_stop_queue(dev); printk(KERN_ERR PFX "%s: BUG! Tx Ring full when " "queue awake!\n", dev->name); } spin_unlock_irqrestore(&tp->tx_lock, flags); return NETDEV_TX_BUSY; } Any objections? Again, I'm not saying %100 this is what we should do long-term. It's meant to be correct and eliminate the bogus log messages when the LLTX race is hit. From davem@davemloft.net Sun Jan 30 18:43:33 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 18:43:39 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V2hXc4028088 for ; Sun, 30 Jan 2005 18:43:33 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CvRRK-0003R5-00; Sun, 30 Jan 2005 18:37:22 -0800 Date: Sun, 30 Jan 2005 18:37:22 -0800 From: "David S. Miller" To: Patrick McHardy Cc: yoshfuji@linux-ipv6.org, rmk@arm.linux.org.uk, netdev@oss.sgi.com Subject: Re: ip -6 route shows incorrect route expiry times Message-Id: <20050130183722.279ec566.davem@davemloft.net> In-Reply-To: <41FD14E4.8010305@trash.net> References: <20050130160840.C25000@flint.arm.linux.org.uk> <20050131.012910.117562374.yoshfuji@linux-ipv6.org> <41FD14E4.8010305@trash.net> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1030 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 653 Lines: 22 On Sun, 30 Jan 2005 18:09:56 +0100 Patrick McHardy wrote: > >Kernel exports in USER_HZ. > >iproute2 seem to convert it again; workaround is to do "export HZ=100". > > > I've sent this fix to Stephen yesterday. "HZ" should be defined in userspace as 100. Only the kernel should ever be able to see other settings. That is true even if userspace includes kernel headers. For example, on sparc64 asm/param.h does this: #ifdef __KERNEL__ # define HZ 1000 /* Internal kernel timer frequency */ # define USER_HZ 100 /* .. some user interfaces are in "ticks" */ # define CLOCKS_PER_SEC (USER_HZ) #endif #ifndef HZ #define HZ 100 #endif From davem@davemloft.net Sun Jan 30 18:56:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 18:56:17 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V2uC2D028889 for ; Sun, 30 Jan 2005 18:56:13 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CvRcC-0003Ul-00; Sun, 30 Jan 2005 18:48:36 -0800 Date: Sun, 30 Jan 2005 18:48:36 -0800 From: "David S. Miller" To: Patrick McHardy Cc: rmk+lkml@arm.linux.org.uk, Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? Message-Id: <20050130184836.17b0487b.davem@davemloft.net> In-Reply-To: <41FD2043.3070303@trash.net> References: <20050124114853.A16971@flint.arm.linux.org.uk> <20050125193207.B30094@flint.arm.linux.org.uk> <20050127082809.A20510@flint.arm.linux.org.uk> <20050127004732.5d8e3f62.akpm@osdl.org> <16888.58622.376497.380197@robur.slu.se> <20050127164918.C3036@flint.arm.linux.org.uk> <20050127123326.2eafab35.davem@davemloft.net> <20050128001701.D22695@flint.arm.linux.org.uk> <20050127163444.1bfb673b.davem@davemloft.net> <20050128085858.B9486@flint.arm.linux.org.uk> <20050130132343.A25000@flint.arm.linux.org.uk> <41FD17FE.6050007@trash.net> <41FD18C5.6090108@trash.net> <41FD2043.3070303@trash.net> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1031 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 414 Lines: 11 On Sun, 30 Jan 2005 18:58:27 +0100 Patrick McHardy wrote: > Ok, final decision: you are right :) conntrack also defragments locally > generated packets before they hit ip_fragment. In this case the fragments > have skb->dst set. It's amazing how many bugs exist due to the local defragmentation and refragmentation done by netfilter. :-) Good catch Patrick, I'll apply this and push upstream. From hadi@cyberus.ca Sun Jan 30 19:27:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 19:27:12 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V3R7lV029992 for ; Sun, 30 Jan 2005 19:27:08 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CvSDV-0002zu-Qp for netdev@oss.sgi.com; Sun, 30 Jan 2005 22:27:09 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CvSDJ-0003Q1-F5; Sun, 30 Jan 2005 22:26:57 -0500 Subject: Re: [patch 4/10] s390: network driver. From: jamal Reply-To: hadi@cyberus.ca To: Tommy Christensen Cc: Jeff Garzik , Thomas Spatzier , "David S. Miller" , Hasso Tepper , Herbert Xu , netdev@oss.sgi.com, Paul Jakma In-Reply-To: <41FD7C6F.3010005@tpack.net> References: <1104764710.1048.580.camel@jzny.localdomain> <41DB26A6.2070008@pobox.com> <1104895169.1117.63.camel@jzny.localdomain> <41DC0931.80603@tpack.net> <1105019912.2314.20.camel@jzny.localdomain> <1105023972.3462.48.camel@tsc-6.cph.tpack.net> <1105104757.1046.63.camel@jzny.localdomain> <1105111605.3462.101.camel@tsc-6.cph.tpack.net> <1105363092.1041.146.camel@jzny.localdomain> <1105917038.1091.1041.camel@jzny.localdomain> <41EC3067.6050104@tpack.net> <41FD702D.2060403@tpack.net> <1107130177.7847.96.camel@jzny.localdomain> <41FD7C6F.3010005@tpack.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1107142012.8021.109.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 30 Jan 2005 22:26:52 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1032 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 756 Lines: 28 On Sun, 2005-01-30 at 19:31, Tommy Christensen wrote: > jamal wrote: > > Tommy, > > > > I wasnt sure why you did: > > > > dev->qdisc = &noop_qdisc; > > > > You should probably save the old qdisc in qdisc_sleeping instead > > and restore it on wakeup - otherwise you always end with default qdisc. > > I think normally we will have qdisc == qdisc_sleeping. At least this > is how I read the code in dev_graft_qdisc(). When can they differ? You are correct. > > check_carrier should probably just call dev_activate which does all you > > wanted, no? > > I copied the logic from dev_deactivate(), but I didn't want to include > the waiting parts, since this is not in process context. OK? Same here. It does look pretty sane.. Tested? cheers, jamal From hadi@cyberus.ca Sun Jan 30 19:33:52 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 19:33:55 -0800 (PST) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V3XpsL030623 for ; Sun, 30 Jan 2005 19:33:52 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.30) id 1CvSJz-0000Li-0E for netdev@oss.sgi.com; Sun, 30 Jan 2005 22:33:51 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CvSJw-0004A9-2l; Sun, 30 Jan 2005 22:33:48 -0500 Subject: Re: LLTX fix proposal From: jamal Reply-To: hadi@cyberus.ca To: "David S. Miller" Cc: netdev@oss.sgi.com In-Reply-To: <20050130181854.7f088a95.davem@davemloft.net> References: <20050130181854.7f088a95.davem@davemloft.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1107142423.8021.114.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 30 Jan 2005 22:33:43 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1033 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 632 Lines: 21 On Sun, 2005-01-30 at 21:18, David S. Miller wrote: > Ok, how about we do this for 2.6.11 before it goes out and > do something more sophisticated (if necessary) later. > > The BUG() we're trying to catch in the ->hard_start_xmit() > routines is the illegal state: > > driver_tx_queue_empty() && !netif_queue_stopped(dev) > In the e1000 theres a lot more code in hard_start_xmit() that could be possibly entered before you hit the xmit lock. So thats another potential issue. The tg3 you refer to in your email doesnt seem to be as bad and i am actually wondering why what you just posted is _the fix_ as is. cheers, jamal From hadi@cyberus.ca Sun Jan 30 19:38:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 19:38:12 -0800 (PST) Received: from mx04.cyberus.ca (mx04.cybersurf.com [209.197.145.108]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V3c7kS031207 for ; Sun, 30 Jan 2005 19:38:08 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx04.cyberus.ca with esmtp (Exim 4.30) id 1CvSO0-0005bQ-Cb for netdev@oss.sgi.com; Sun, 30 Jan 2005 20:38:00 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CvSO5-0004fq-15; Sun, 30 Jan 2005 22:38:05 -0500 Subject: Re: LLTX fix proposal From: jamal Reply-To: hadi@cyberus.ca To: "David S. Miller" Cc: netdev@oss.sgi.com In-Reply-To: <1107142423.8021.114.camel@jzny.localdomain> References: <20050130181854.7f088a95.davem@davemloft.net> <1107142423.8021.114.camel@jzny.localdomain> Content-Type: text/plain Organization: jamalopolous Message-Id: <1107142680.7847.117.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 30 Jan 2005 22:38:00 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1034 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 755 Lines: 23 On Sun, 2005-01-30 at 22:33, jamal wrote: > On Sun, 2005-01-30 at 21:18, David S. Miller wrote: > > Ok, how about we do this for 2.6.11 before it goes out and > > do something more sophisticated (if necessary) later. > > > > The BUG() we're trying to catch in the ->hard_start_xmit() > > routines is the illegal state: > > > > driver_tx_queue_empty() && !netif_queue_stopped(dev) > > > > In the e1000 theres a lot more code in hard_start_xmit() that could > be possibly entered before you hit the xmit lock. So thats another > potential issue. > The tg3 you refer to in your email doesnt seem to be as bad and > i am actually wondering why what you just posted is _the fix_ as is. meant is not _the fix_ too many typos - off to bed. cheers, jamal From rddunlap@osdl.org Sun Jan 30 19:38:39 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 19:38:45 -0800 (PST) Received: from smtp.osdl.org (fire.osdl.org [65.172.181.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V3ccY1031335 for ; Sun, 30 Jan 2005 19:38:38 -0800 Received: from [192.168.1.103] (wbar2.sea1-4-5-049-023.sea1.dsl-verizon.net [4.5.49.23]) (authenticated bits=0) by smtp.osdl.org (8.12.8/8.12.8) with ESMTP id j0V3cLuM025319 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Sun, 30 Jan 2005 19:38:22 -0800 Message-ID: <41FDA629.5070702@osdl.org> Date: Sun, 30 Jan 2005 19:29:45 -0800 From: "Randy.Dunlap" User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev , davem@davemloft.net, robert.olsson@its.uu.se Subject: [PATCH] pktgen: proc_if_write: reduce stack usage Content-Type: multipart/mixed; boundary="------------060309070407090301030501" X-MIMEDefang-Filter: osdl$Revision: 1.101 $ X-Scanned-By: MIMEDefang 2.36 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1035 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 8820 Lines: 243 This is a multi-part message in MIME format. --------------060309070407090301030501 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, Are you interested in pktgen stack reduction? Is this acceptable? pktgen: proc_if_write: reduce stack usage (on i386) from 776 to 296 bytes by combining/reusing locals. Signed-off-by: Randy Dunlap diffstat:= net/core/pktgen.c | 94 ++++++++++++++++++++++++------------------------------ 1 files changed, 42 insertions(+), 52 deletions(-) --------------060309070407090301030501 Content-Type: text/x-patch; name="pktgen_stack.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="pktgen_stack.patch" diff -Naurp ./net/core/pktgen.c~pktgen_stack ./net/core/pktgen.c --- ./net/core/pktgen.c~pktgen_stack 2005-01-27 16:31:49.000000000 -0800 +++ ./net/core/pktgen.c 2005-01-30 19:07:55.252712936 -0800 @@ -811,6 +811,8 @@ static int proc_if_write(struct file *fi struct pktgen_dev *pkt_dev = (struct pktgen_dev*)(data); char* pg_result = NULL; int tmp = 0; + char buf4[IP_NAME_SZ]; + char buf6[128]; pg_result = &(pkt_dev->result[0]); @@ -1071,16 +1073,15 @@ static int proc_if_write(struct file *fi return count; } if (!strcmp(name, "dst_min") || !strcmp(name, "dst")) { - char buf[IP_NAME_SZ]; len = strn_len(&user_buffer[i], sizeof(pkt_dev->dst_min) - 1); if (len < 0) { return len; } - if (copy_from_user(buf, &user_buffer[i], len)) + if (copy_from_user(buf4, &user_buffer[i], len)) return -EFAULT; - buf[len] = 0; - if (strcmp(buf, pkt_dev->dst_min) != 0) { + buf4[len] = 0; + if (strcmp(buf4, pkt_dev->dst_min) != 0) { memset(pkt_dev->dst_min, 0, sizeof(pkt_dev->dst_min)); - strncpy(pkt_dev->dst_min, buf, len); + strncpy(pkt_dev->dst_min, buf4, len); pkt_dev->daddr_min = in_aton(pkt_dev->dst_min); pkt_dev->cur_daddr = pkt_dev->daddr_min; } @@ -1091,17 +1092,16 @@ static int proc_if_write(struct file *fi return count; } if (!strcmp(name, "dst_max")) { - char buf[IP_NAME_SZ]; len = strn_len(&user_buffer[i], sizeof(pkt_dev->dst_max) - 1); if (len < 0) { return len; } - if (copy_from_user(buf, &user_buffer[i], len)) + if (copy_from_user(buf4, &user_buffer[i], len)) return -EFAULT; - buf[len] = 0; - if (strcmp(buf, pkt_dev->dst_max) != 0) { + buf4[len] = 0; + if (strcmp(buf4, pkt_dev->dst_max) != 0) { memset(pkt_dev->dst_max, 0, sizeof(pkt_dev->dst_max)); - strncpy(pkt_dev->dst_max, buf, len); + strncpy(pkt_dev->dst_max, buf4, len); pkt_dev->daddr_max = in_aton(pkt_dev->dst_max); pkt_dev->cur_daddr = pkt_dev->daddr_max; } @@ -1112,108 +1112,99 @@ static int proc_if_write(struct file *fi return count; } if (!strcmp(name, "dst6")) { - char buf[128]; - len = strn_len(&user_buffer[i], 128 - 1); if (len < 0) return len; pkt_dev->flags |= F_IPV6; - if (copy_from_user(buf, &user_buffer[i], len)) + if (copy_from_user(buf6, &user_buffer[i], len)) return -EFAULT; - buf[len] = 0; + buf6[len] = 0; - scan_ip6(buf, pkt_dev->in6_daddr.s6_addr); - fmt_ip6(buf, pkt_dev->in6_daddr.s6_addr); + scan_ip6(buf6, pkt_dev->in6_daddr.s6_addr); + fmt_ip6(buf6, pkt_dev->in6_daddr.s6_addr); ipv6_addr_copy(&pkt_dev->cur_in6_daddr, &pkt_dev->in6_daddr); if(debug) - printk("pktgen: dst6 set to: %s\n", buf); + printk("pktgen: dst6 set to: %s\n", buf6); i += len; - sprintf(pg_result, "OK: dst6=%s", buf); + sprintf(pg_result, "OK: dst6=%s", buf6); return count; } if (!strcmp(name, "dst6_min")) { - char buf[128]; - len = strn_len(&user_buffer[i], 128 - 1); if (len < 0) return len; pkt_dev->flags |= F_IPV6; - if (copy_from_user(buf, &user_buffer[i], len)) + if (copy_from_user(buf6, &user_buffer[i], len)) return -EFAULT; - buf[len] = 0; + buf6[len] = 0; - scan_ip6(buf, pkt_dev->min_in6_daddr.s6_addr); - fmt_ip6(buf, pkt_dev->min_in6_daddr.s6_addr); + scan_ip6(buf6, pkt_dev->min_in6_daddr.s6_addr); + fmt_ip6(buf6, pkt_dev->min_in6_daddr.s6_addr); ipv6_addr_copy(&pkt_dev->cur_in6_daddr, &pkt_dev->min_in6_daddr); if(debug) - printk("pktgen: dst6_min set to: %s\n", buf); + printk("pktgen: dst6_min set to: %s\n", buf6); i += len; - sprintf(pg_result, "OK: dst6_min=%s", buf); + sprintf(pg_result, "OK: dst6_min=%s", buf6); return count; } if (!strcmp(name, "dst6_max")) { - char buf[128]; - len = strn_len(&user_buffer[i], 128 - 1); if (len < 0) return len; pkt_dev->flags |= F_IPV6; - if (copy_from_user(buf, &user_buffer[i], len)) + if (copy_from_user(buf6, &user_buffer[i], len)) return -EFAULT; - buf[len] = 0; + buf6[len] = 0; - scan_ip6(buf, pkt_dev->max_in6_daddr.s6_addr); - fmt_ip6(buf, pkt_dev->max_in6_daddr.s6_addr); + scan_ip6(buf6, pkt_dev->max_in6_daddr.s6_addr); + fmt_ip6(buf6, pkt_dev->max_in6_daddr.s6_addr); if(debug) - printk("pktgen: dst6_max set to: %s\n", buf); + printk("pktgen: dst6_max set to: %s\n", buf6); i += len; - sprintf(pg_result, "OK: dst6_max=%s", buf); + sprintf(pg_result, "OK: dst6_max=%s", buf6); return count; } if (!strcmp(name, "src6")) { - char buf[128]; - len = strn_len(&user_buffer[i], 128 - 1); if (len < 0) return len; pkt_dev->flags |= F_IPV6; - if (copy_from_user(buf, &user_buffer[i], len)) + if (copy_from_user(buf6, &user_buffer[i], len)) return -EFAULT; - buf[len] = 0; + buf6[len] = 0; - scan_ip6(buf, pkt_dev->in6_saddr.s6_addr); - fmt_ip6(buf, pkt_dev->in6_saddr.s6_addr); + scan_ip6(buf6, pkt_dev->in6_saddr.s6_addr); + fmt_ip6(buf6, pkt_dev->in6_saddr.s6_addr); ipv6_addr_copy(&pkt_dev->cur_in6_saddr, &pkt_dev->in6_saddr); if(debug) - printk("pktgen: src6 set to: %s\n", buf); + printk("pktgen: src6 set to: %s\n", buf6); i += len; - sprintf(pg_result, "OK: src6=%s", buf); + sprintf(pg_result, "OK: src6=%s", buf6); return count; } if (!strcmp(name, "src_min")) { - char buf[IP_NAME_SZ]; len = strn_len(&user_buffer[i], sizeof(pkt_dev->src_min) - 1); if (len < 0) { return len; } - if (copy_from_user(buf, &user_buffer[i], len)) + if (copy_from_user(buf4, &user_buffer[i], len)) return -EFAULT; - buf[len] = 0; - if (strcmp(buf, pkt_dev->src_min) != 0) { + buf4[len] = 0; + if (strcmp(buf4, pkt_dev->src_min) != 0) { memset(pkt_dev->src_min, 0, sizeof(pkt_dev->src_min)); - strncpy(pkt_dev->src_min, buf, len); + strncpy(pkt_dev->src_min, buf4, len); pkt_dev->saddr_min = in_aton(pkt_dev->src_min); pkt_dev->cur_saddr = pkt_dev->saddr_min; } @@ -1224,15 +1215,14 @@ static int proc_if_write(struct file *fi return count; } if (!strcmp(name, "src_max")) { - char buf[IP_NAME_SZ]; len = strn_len(&user_buffer[i], sizeof(pkt_dev->src_max) - 1); if (len < 0) { return len; } - if (copy_from_user(buf, &user_buffer[i], len)) + if (copy_from_user(buf4, &user_buffer[i], len)) return -EFAULT; - buf[len] = 0; - if (strcmp(buf, pkt_dev->src_max) != 0) { + buf4[len] = 0; + if (strcmp(buf4, pkt_dev->src_max) != 0) { memset(pkt_dev->src_max, 0, sizeof(pkt_dev->src_max)); - strncpy(pkt_dev->src_max, buf, len); + strncpy(pkt_dev->src_max, buf4, len); pkt_dev->saddr_max = in_aton(pkt_dev->src_max); pkt_dev->cur_saddr = pkt_dev->saddr_max; } --------------060309070407090301030501-- From rusty@rustcorp.com.au Sun Jan 30 19:39:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 19:39:59 -0800 (PST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V3dsSO032169 for ; Sun, 30 Jan 2005 19:39:55 -0800 Received: from localhost.localdomain (localhost [127.0.0.1]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTP id 2385767A79; Mon, 31 Jan 2005 14:39:48 +1100 (EST) Subject: Re: Fw: [Bugme-new] [Bug 4131] New: iptables rules don't work correctly in 2.6.11-rc2-bk7 From: Rusty Russell To: Andrew Morton Cc: netdev@oss.sgi.com, selecter@spray.se In-Reply-To: <20050129234832.53c6f763.akpm@osdl.org> References: <20050129234832.53c6f763.akpm@osdl.org> Content-Type: text/plain Date: Mon, 31 Jan 2005 14:39:53 +1100 Message-Id: <1107142793.28143.3.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.3 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1036 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rusty@rustcorp.com.au Precedence: bulk X-list: netdev Content-Length: 309 Lines: 10 On Sat, 2005-01-29 at 23:48 -0800, Andrew Morton wrote: > Also I can't see connection state match support in menuconfig Well, that would do it. Do you have connection tracking configured in? Otherwise you won't get asked for state. Rusty. -- A bad analogy is like a leaky screwdriver -- Richard Braakman From sfeldma@pobox.com Sun Jan 30 19:46:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 19:46:14 -0800 (PST) Received: from orb.pobox.com (orb.pobox.com [207.8.226.5]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V3k1ou000354 for ; Sun, 30 Jan 2005 19:46:02 -0800 Received: from orb (localhost [127.0.0.1]) by orb.pobox.com (Postfix) with ESMTP id BDC2BB3; Sun, 30 Jan 2005 22:46:00 -0500 (EST) Received: from [192.168.0.3] (wbar2.sea1-4-5-062-153.sea1.dsl-verizon.net [4.5.62.153]) by orb.sasl.smtp.pobox.com (Postfix) with ESMTP id C965687; Sun, 30 Jan 2005 22:45:56 -0500 (EST) Subject: Re: 2.4.29, e100 and a WOL packet causes keventd going mad From: Scott Feldman Reply-To: sfeldma@pobox.com To: David =?ISO-8859-1?Q?H=E4rdeman?= , Michael Gernoth Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com In-Reply-To: <20050130171849.GA3354@hardeman.nu> References: <20050130171849.GA3354@hardeman.nu> Content-Type: text/plain; charset=UTF-8 Message-Id: <1107143255.18167.428.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Sun, 30 Jan 2005 19:47:35 -0800 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1037 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sfeldma@pobox.com Precedence: bulk X-list: netdev Content-Length: 2244 Lines: 67 On Sun, 2005-01-30 at 09:18, David Härdeman wrote: > I experience the same problems as reported by Michael Gernoth when > sending a WOL-packet to computer with a e100 NIC which is already > powered on. I didn't look at the 2.4 case, but for 2.6, it seems e100 was enabling PME wakeup during probe. PME shouldn't be enabled while the system is up. I suspect the assertion of PME while the system is up is what's causing problems. This patch moves PME wakeup enabling to either suspend or shutdown. David, would you give this patch a try? Make sure the system still wakes from a magic packet if suspended or shut down, and doesn't cause kacpid to go crazy if system is running. If it helps for 2.6, perhaps someone can look into 2.4 to see if there is something similar going on there. -scott --- linux-2.6.11-rc2/drivers/net/e100.c.orig 2005-01-30 19:13:56.850497376 -0800 +++ linux-2.6.11-rc2/drivers/net/e100.c 2005-01-30 19:26:41.154305536 -0800 @@ -1868,7 +1868,6 @@ static int e100_set_wol(struct net_devic else nic->flags &= ~wol_magic; - pci_enable_wake(nic->pdev, 0, nic->flags & (wol_magic | e100_asf(nic))); e100_exec_cb(nic, NULL, e100_configure); return 0; @@ -2262,8 +2261,6 @@ static int __devinit e100_probe(struct p (nic->eeprom[eeprom_id] & eeprom_id_wol)) nic->flags |= wol_magic; - pci_enable_wake(pdev, 0, nic->flags & (wol_magic | e100_asf(nic))); - strcpy(netdev->name, "eth%d"); if((err = register_netdev(netdev))) { DPRINTK(PROBE, ERR, "Cannot register net device, aborting.\n"); @@ -2344,6 +2341,15 @@ static int e100_resume(struct pci_dev *p } #endif +static void e100_shutdown(struct device *dev) +{ + struct pci_dev *pdev = container_of(dev, struct pci_dev, dev); + struct net_device *netdev = pci_get_drvdata(pdev); + struct nic *nic = netdev_priv(netdev); + + pci_enable_wake(pdev, 0, nic->flags & (wol_magic | e100_asf(nic))); +} + static struct pci_driver e100_driver = { .name = DRV_NAME, .id_table = e100_id_table, @@ -2353,6 +2359,9 @@ static struct pci_driver e100_driver = { .suspend = e100_suspend, .resume = e100_resume, #endif + .driver = { + .shutdown = e100_shutdown, + } }; static int __init e100_init_module(void) From ncunningham@linuxmail.org Sun Jan 30 19:56:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 19:56:31 -0800 (PST) Received: from pop5-1.us4.outblaze.com (pop5-1.us4.outblaze.com [205.158.62.125]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0V3uOI8001099 for ; Sun, 30 Jan 2005 19:56:24 -0800 Received: (qmail 28118 invoked from network); 31 Jan 2005 03:56:19 -0000 Received: from unknown (HELO ?203.30.127.163?) (ncunningham@linuxmail.org@203.30.127.163) by pop5-1.us4.outblaze.com with SMTP; 31 Jan 2005 03:56:18 -0000 Subject: Re: 2.4.29, e100 and a WOL packet causes keventd going mad From: Nigel Cunningham Reply-To: ncunningham@linuxmail.org To: sfeldma@pobox.com Cc: David =?ISO-8859-1?Q?H=E4rdeman?= , Michael Gernoth , Linux Kernel Mailing List , netdev@oss.sgi.com In-Reply-To: <1107143255.18167.428.camel@localhost.localdomain> References: <20050130171849.GA3354@hardeman.nu> <1107143255.18167.428.camel@localhost.localdomain> Content-Type: text/plain; charset=iso-8859-1 Message-Id: <1107143905.21273.33.camel@desktop.cunninghams> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6-1mdk Date: Mon, 31 Jan 2005 14:58:25 +1100 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1038 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ncunningham@linuxmail.org Precedence: bulk X-list: netdev Content-Length: 2889 Lines: 88 Hi. Do you also disable the WOL event when resuming? Regards, Nigel On Mon, 2005-01-31 at 14:47, Scott Feldman wrote: > On Sun, 2005-01-30 at 09:18, David Härdeman wrote: > > I experience the same problems as reported by Michael Gernoth when > > sending a WOL-packet to computer with a e100 NIC which is already > > powered on. > > I didn't look at the 2.4 case, but for 2.6, it seems e100 was enabling > PME wakeup during probe. PME shouldn't be enabled while the system is > up. I suspect the assertion of PME while the system is up is what's > causing problems. This patch moves PME wakeup enabling to either > suspend or shutdown. > > David, would you give this patch a try? Make sure the system still > wakes from a magic packet if suspended or shut down, and doesn't cause > kacpid to go crazy if system is running. If it helps for 2.6, perhaps > someone can look into 2.4 to see if there is something similar going on > there. > > -scott > > --- linux-2.6.11-rc2/drivers/net/e100.c.orig 2005-01-30 19:13:56.850497376 -0800 > +++ linux-2.6.11-rc2/drivers/net/e100.c 2005-01-30 19:26:41.154305536 -0800 > @@ -1868,7 +1868,6 @@ static int e100_set_wol(struct net_devic > else > nic->flags &= ~wol_magic; > > - pci_enable_wake(nic->pdev, 0, nic->flags & (wol_magic | e100_asf(nic))); > e100_exec_cb(nic, NULL, e100_configure); > > return 0; > @@ -2262,8 +2261,6 @@ static int __devinit e100_probe(struct p > (nic->eeprom[eeprom_id] & eeprom_id_wol)) > nic->flags |= wol_magic; > > - pci_enable_wake(pdev, 0, nic->flags & (wol_magic | e100_asf(nic))); > - > strcpy(netdev->name, "eth%d"); > if((err = register_netdev(netdev))) { > DPRINTK(PROBE, ERR, "Cannot register net device, aborting.\n"); > @@ -2344,6 +2341,15 @@ static int e100_resume(struct pci_dev *p > } > #endif > > +static void e100_shutdown(struct device *dev) > +{ > + struct pci_dev *pdev = container_of(dev, struct pci_dev, dev); > + struct net_device *netdev = pci_get_drvdata(pdev); > + struct nic *nic = netdev_priv(netdev); > + > + pci_enable_wake(pdev, 0, nic->flags & (wol_magic | e100_asf(nic))); > +} > + > static struct pci_driver e100_driver = { > .name = DRV_NAME, > .id_table = e100_id_table, > @@ -2353,6 +2359,9 @@ static struct pci_driver e100_driver = { > .suspend = e100_suspend, > .resume = e100_resume, > #endif > + .driver = { > + .shutdown = e100_shutdown, > + } > }; > > static int __init e100_init_module(void) > > > > - > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -- Nigel Cunningham Software Engineer, Canberra, Australia http://www.cyclades.com Ph: +61 (2) 6292 8028 Mob: +61 (417) 100 574 From herbert@gondor.apana.org.au Sun Jan 30 20:15:43 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 20:15:51 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V4FgVm002016 for ; Sun, 30 Jan 2005 20:15:43 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CvSwJ-0002YW-00; Mon, 31 Jan 2005 15:13:27 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CvSuS-00056x-00; Mon, 31 Jan 2005 15:11:32 +1100 From: Herbert Xu To: kaber@trash.net (Patrick McHardy) Subject: Re: Memory leak in 2.6.11-rc1? Cc: rmk+lkml@arm.linux.org.uk, davem@davemloft.net, Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Organization: Core In-Reply-To: <41FD2043.3070303@trash.net> X-Newsgroups: apana.lists.os.linux.kernel,apana.lists.os.linux.netdev User-Agent: tin/1.7.4-20040225 ("Benbecula") (UNIX) (Linux/2.4.27-hx-1-686-smp (i686)) Message-Id: Date: Mon, 31 Jan 2005 15:11:32 +1100 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1039 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 482 Lines: 12 Patrick McHardy wrote: > > Ok, final decision: you are right :) conntrack also defragments locally > generated packets before they hit ip_fragment. In this case the fragments > have skb->dst set. Well caught. The same thing is needed for IPv6, right? -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From bukiemab@gte.net Sun Jan 30 20:33:41 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 20:33:46 -0800 (PST) Received: from out008.verizon.net (out008pub.verizon.net [206.46.170.108]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V4Xasm006039 for ; Sun, 30 Jan 2005 20:33:36 -0800 Received: from gte.net ([66.199.68.159]) by out008.verizon.net (InterMail vM.5.01.06.06 201-253-122-130-106-20030910) with ESMTP id <20050131040857.BRF20133.out008.verizon.net@gte.net>; Sun, 30 Jan 2005 22:08:57 -0600 Message-ID: <41FDB2D3.5CBD6F7D@gte.net> Date: Sun, 30 Jan 2005 20:23:47 -0800 From: Bukie Mabayoje X-Mailer: Mozilla 4.78 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: sfeldma@pobox.com CC: David =?iso-8859-1?Q?H=E4rdeman?= , Michael Gernoth , linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: 2.4.29, e100 and a WOL packet causes keventd going mad References: <20050130171849.GA3354@hardeman.nu> <1107143255.18167.428.camel@localhost.localdomain> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Authentication-Info: Submitted using SMTP AUTH at out008.verizon.net from [66.199.68.159] at Sun, 30 Jan 2005 22:08:48 -0600 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1040 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bukiemab@gte.net Precedence: bulk X-list: netdev Content-Length: 2831 Lines: 77 Scott Feldman wrote: > On Sun, 2005-01-30 at 09:18, David Härdeman wrote: > > I experience the same problems as reported by Michael Gernoth when > > sending a WOL-packet to computer with a e100 NIC which is already > > powered on. > > I didn't look at the 2.4 case, but for 2.6, it seems e100 was enabling > PME wakeup during probe. PME shouldn't be enabled while the system is > up. I suspect the assertion of PME while the system is up is what's > causing problems. This patch moves PME wakeup enabling to either > suspend or shutdown. > > David, would you give this patch a try? Make sure the system still > wakes from a magic packet if suspended or shut down, and doesn't cause > kacpid to go crazy if system is running. If it helps for 2.6, perhaps > someone can look into 2.4 to see if there is something similar going on This issue was reported on 2.4. > > there. > > -scott > > --- linux-2.6.11-rc2/drivers/net/e100.c.orig 2005-01-30 19:13:56.850497376 -0800 > +++ linux-2.6.11-rc2/drivers/net/e100.c 2005-01-30 19:26:41.154305536 -0800 > @@ -1868,7 +1868,6 @@ static int e100_set_wol(struct net_devic > else > nic->flags &= ~wol_magic; > > - pci_enable_wake(nic->pdev, 0, nic->flags & (wol_magic | e100_asf(nic))); > e100_exec_cb(nic, NULL, e100_configure); > > return 0; > @@ -2262,8 +2261,6 @@ static int __devinit e100_probe(struct p > (nic->eeprom[eeprom_id] & eeprom_id_wol)) > nic->flags |= wol_magic; > > - pci_enable_wake(pdev, 0, nic->flags & (wol_magic | e100_asf(nic))); > - > strcpy(netdev->name, "eth%d"); > if((err = register_netdev(netdev))) { > DPRINTK(PROBE, ERR, "Cannot register net device, aborting.\n"); > @@ -2344,6 +2341,15 @@ static int e100_resume(struct pci_dev *p > } > #endif > > +static void e100_shutdown(struct device *dev) > +{ > + struct pci_dev *pdev = container_of(dev, struct pci_dev, dev); > + struct net_device *netdev = pci_get_drvdata(pdev); > + struct nic *nic = netdev_priv(netdev); > + > + pci_enable_wake(pdev, 0, nic->flags & (wol_magic | e100_asf(nic))); > +} > + > static struct pci_driver e100_driver = { > .name = DRV_NAME, > .id_table = e100_id_table, > @@ -2353,6 +2359,9 @@ static struct pci_driver e100_driver = { > .suspend = e100_suspend, > .resume = e100_resume, > #endif > + .driver = { > + .shutdown = e100_shutdown, > + } > }; > > static int __init e100_init_module(void) > > - > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ From yoshfuji@linux-ipv6.org Sun Jan 30 20:45:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 20:45:19 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V4jCTF006780 for ; Sun, 30 Jan 2005 20:45:12 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id DEECD33CC2; Mon, 31 Jan 2005 13:46:04 +0900 (JST) Date: Mon, 31 Jan 2005 13:45:59 +0900 (JST) Message-Id: <20050131.134559.125426676.yoshfuji@linux-ipv6.org> To: herbert@gondor.apana.org.au, davem@davemloft.net Cc: kaber@trash.net, rmk+lkml@arm.linux.org.uk, Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: Memory leak in 2.6.11-rc1? From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: <41FD2043.3070303@trash.net> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1041 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Content-Length: 909 Lines: 27 In article (at Mon, 31 Jan 2005 15:11:32 +1100), Herbert Xu says: > Patrick McHardy wrote: > > > > Ok, final decision: you are right :) conntrack also defragments locally > > generated packets before they hit ip_fragment. In this case the fragments > > have skb->dst set. > > Well caught. The same thing is needed for IPv6, right? (not yet confirmed, but) yes, please. Signed-off-by: Hideaki YOSHIFUJI ===== net/ipv6/ip6_output.c 1.82 vs edited ===== --- 1.82/net/ipv6/ip6_output.c 2005-01-25 09:40:10 +09:00 +++ edited/net/ipv6/ip6_output.c 2005-01-31 13:44:01 +09:00 @@ -463,6 +463,7 @@ to->priority = from->priority; to->protocol = from->protocol; to->security = from->security; + dst_release(to->dst); to->dst = dst_clone(from->dst); to->dev = from->dev; --yoshfuji From sfeldma@pobox.com Sun Jan 30 20:58:43 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 20:58:46 -0800 (PST) Received: from orb.pobox.com (orb.pobox.com [207.8.226.5]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V4wg6V007479 for ; Sun, 30 Jan 2005 20:58:42 -0800 Received: from orb (localhost [127.0.0.1]) by orb.pobox.com (Postfix) with ESMTP id ED323B0; Sun, 30 Jan 2005 23:58:41 -0500 (EST) Received: from [192.168.0.3] (wbar2.sea1-4-5-062-153.sea1.dsl-verizon.net [4.5.62.153]) by orb.sasl.smtp.pobox.com (Postfix) with ESMTP id C80E787; Sun, 30 Jan 2005 23:58:36 -0500 (EST) Subject: Re: 2.4.29, e100 and a WOL packet causes keventd going mad From: Scott Feldman Reply-To: sfeldma@pobox.com To: ncunningham@linuxmail.org Cc: David =?ISO-8859-1?Q?H=E4rdeman?= , Michael Gernoth , Linux Kernel Mailing List , netdev@oss.sgi.com In-Reply-To: <1107143905.21273.33.camel@desktop.cunninghams> References: <20050130171849.GA3354@hardeman.nu> <1107143255.18167.428.camel@localhost.localdomain> <1107143905.21273.33.camel@desktop.cunninghams> Content-Type: text/plain Message-Id: <1107147615.18167.433.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Sun, 30 Jan 2005 21:00:15 -0800 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1042 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sfeldma@pobox.com Precedence: bulk X-list: netdev Content-Length: 2195 Lines: 70 On Sun, 2005-01-30 at 19:58, Nigel Cunningham wrote: > Do you also disable the WOL event when resuming? Good catch. How's this look? --- linux-2.6.11-rc2/drivers/net/e100.c.orig 2005-01-30 19:13:56.850497376 -0800 +++ linux-2.6.11-rc2/drivers/net/e100.c 2005-01-30 20:53:22.630560952 -0800 @@ -1868,7 +1868,6 @@ static int e100_set_wol(struct net_devic else nic->flags &= ~wol_magic; - pci_enable_wake(nic->pdev, 0, nic->flags & (wol_magic | e100_asf(nic))); e100_exec_cb(nic, NULL, e100_configure); return 0; @@ -2262,8 +2261,6 @@ static int __devinit e100_probe(struct p (nic->eeprom[eeprom_id] & eeprom_id_wol)) nic->flags |= wol_magic; - pci_enable_wake(pdev, 0, nic->flags & (wol_magic | e100_asf(nic))); - strcpy(netdev->name, "eth%d"); if((err = register_netdev(netdev))) { DPRINTK(PROBE, ERR, "Cannot register net device, aborting.\n"); @@ -2320,7 +2317,8 @@ static int e100_suspend(struct pci_dev * netif_device_detach(netdev); pci_save_state(pdev); - pci_enable_wake(pdev, state, nic->flags & (wol_magic | e100_asf(nic))); + pci_enable_wake(pdev, pci_choose_state(pdev, state), + nic->flags & (wol_magic | e100_asf(nic))); pci_disable_device(pdev); pci_set_power_state(pdev, pci_choose_state(pdev, state)); @@ -2333,6 +2331,7 @@ static int e100_resume(struct pci_dev *p struct nic *nic = netdev_priv(netdev); pci_set_power_state(pdev, PCI_D0); + pci_enable_wake(pdev, PCI_D0, 0); pci_restore_state(pdev); e100_hw_init(nic); @@ -2344,6 +2343,15 @@ static int e100_resume(struct pci_dev *p } #endif +static void e100_shutdown(struct device *dev) +{ + struct pci_dev *pdev = container_of(dev, struct pci_dev, dev); + struct net_device *netdev = pci_get_drvdata(pdev); + struct nic *nic = netdev_priv(netdev); + + pci_enable_wake(pdev, PCI_D0, nic->flags & (wol_magic | e100_asf(nic))); +} + static struct pci_driver e100_driver = { .name = DRV_NAME, .id_table = e100_id_table, @@ -2353,6 +2361,9 @@ static struct pci_driver e100_driver = { .suspend = e100_suspend, .resume = e100_resume, #endif + .driver = { + .shutdown = e100_shutdown, + } }; static int __init e100_init_module(void) From kaber@trash.net Sun Jan 30 21:01:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 21:02:00 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V51iHD007999 for ; Sun, 30 Jan 2005 21:01:47 -0800 Received: from localhost ([127.0.0.1]) by kaber.coreworks.de with esmtp (Exim 4.43) id 1CvTg1-0001gC-3f; Mon, 31 Jan 2005 06:00:41 +0100 Message-ID: <41FDBB78.2050403@trash.net> Date: Mon, 31 Jan 2005 06:00:40 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.5) Gecko/20050106 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 To: yoshfuji@linux-ipv6.org CC: herbert@gondor.apana.org.au, davem@davemloft.net, rmk+lkml@arm.linux.org.uk, Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? References: <41FD2043.3070303@trash.net> <20050131.134559.125426676.yoshfuji@linux-ipv6.org> In-Reply-To: <20050131.134559.125426676.yoshfuji@linux-ipv6.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1043 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 700 Lines: 23 YOSHIFUJI Hideaki / $B5HF#1QL@ wrote: >In article (at Mon, 31 Jan 2005 15:11:32 +1100), Herbert Xu says: > > >>Patrick McHardy wrote: >> >>>Ok, final decision: you are right :) conntrack also defragments locally >>>generated packets before they hit ip_fragment. In this case the fragments >>>have skb->dst set. >>> >>Well caught. The same thing is needed for IPv6, right? >> > >(not yet confirmed, but) yes, please. > We don't need this for IPv6 yet. Once we get nf_conntrack in we might need this, but its IPv6 fragment handling is different from ip_conntrack, I need to check first. Regards Patrick From davem@davemloft.net Sun Jan 30 21:15:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 21:15:08 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V5F10R008701 for ; Sun, 30 Jan 2005 21:15:02 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CvToc-0003xD-00; Sun, 30 Jan 2005 21:09:34 -0800 Date: Sun, 30 Jan 2005 21:09:34 -0800 From: "David S. Miller" To: hadi@cyberus.ca Cc: netdev@oss.sgi.com Subject: Re: LLTX fix proposal Message-Id: <20050130210934.298530a7.davem@davemloft.net> In-Reply-To: <1107142680.7847.117.camel@jzny.localdomain> References: <20050130181854.7f088a95.davem@davemloft.net> <1107142423.8021.114.camel@jzny.localdomain> <1107142680.7847.117.camel@jzny.localdomain> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1044 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 386 Lines: 12 On 30 Jan 2005 22:38:00 -0500 jamal wrote: > On Sun, 2005-01-30 at 22:33, jamal wrote: > > The tg3 you refer to in your email doesnt seem to be as bad and > > i am actually wondering why what you just posted is _the fix_ as is. > > meant is not _the fix_ It could be "_the fix_", I just don't know yet if we'll be deeply satisfied with it in the end. That's all. From yoshfuji@linux-ipv6.org Sun Jan 30 21:15:45 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 21:15:50 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V5FiA7008898 for ; Sun, 30 Jan 2005 21:15:45 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id 6B72C33CC2; Mon, 31 Jan 2005 14:16:37 +0900 (JST) Date: Mon, 31 Jan 2005 14:16:36 +0900 (JST) Message-Id: <20050131.141636.20664459.yoshfuji@linux-ipv6.org> To: kaber@trash.net, kozakai@linux-ipv6.org Cc: herbert@gondor.apana.org.au, davem@davemloft.net, rmk+lkml@arm.linux.org.uk, Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <41FDBB78.2050403@trash.net> References: <20050131.134559.125426676.yoshfuji@linux-ipv6.org> <41FDBB78.2050403@trash.net> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1045 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Content-Length: 373 Lines: 10 In article <41FDBB78.2050403@trash.net> (at Mon, 31 Jan 2005 06:00:40 +0100), Patrick McHardy says: |We don't need this for IPv6 yet. Once we get nf_conntrack in we |might need this, but its IPv6 fragment handling is different from |ip_conntrack, I need to check first. Ok. It would be better to have some comment but anyway... kozakai-san? --yoshfuji From davem@davemloft.net Sun Jan 30 21:18:18 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 21:18:23 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V5IImn009686 for ; Sun, 30 Jan 2005 21:18:18 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CvTqo-0003zv-00; Sun, 30 Jan 2005 21:11:50 -0800 Date: Sun, 30 Jan 2005 21:11:50 -0800 From: "David S. Miller" To: Patrick McHardy Cc: yoshfuji@linux-ipv6.org, herbert@gondor.apana.org.au, rmk+lkml@arm.linux.org.uk, Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? Message-Id: <20050130211150.464d1c62.davem@davemloft.net> In-Reply-To: <41FDBB78.2050403@trash.net> References: <41FD2043.3070303@trash.net> <20050131.134559.125426676.yoshfuji@linux-ipv6.org> <41FDBB78.2050403@trash.net> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1046 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 383 Lines: 11 On Mon, 31 Jan 2005 06:00:40 +0100 Patrick McHardy wrote: > We don't need this for IPv6 yet. Once we get nf_conntrack in we > might need this, but its IPv6 fragment handling is different from > ip_conntrack, I need to check first. Right, ipv6 netfilter cannot create this situation yet. However, logically the fix is still correct and I'll add it into the tree. From herbert@gondor.apana.org.au Sun Jan 30 21:42:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 21:42:43 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V5gYwg010501 for ; Sun, 30 Jan 2005 21:42:35 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CvUJi-0002u5-00; Mon, 31 Jan 2005 16:41:42 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CvUIv-0005Gd-00; Mon, 31 Jan 2005 16:40:53 +1100 Date: Mon, 31 Jan 2005 16:40:52 +1100 To: "David S. Miller" Cc: Patrick McHardy , yoshfuji@linux-ipv6.org, rmk+lkml@arm.linux.org.uk, Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? Message-ID: <20050131054052.GA20227@gondor.apana.org.au> References: <41FD2043.3070303@trash.net> <20050131.134559.125426676.yoshfuji@linux-ipv6.org> <41FDBB78.2050403@trash.net> <20050130211150.464d1c62.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050130211150.464d1c62.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1047 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 860 Lines: 23 On Sun, Jan 30, 2005 at 09:11:50PM -0800, David S. Miller wrote: > On Mon, 31 Jan 2005 06:00:40 +0100 > Patrick McHardy wrote: > > > We don't need this for IPv6 yet. Once we get nf_conntrack in we > > might need this, but its IPv6 fragment handling is different from > > ip_conntrack, I need to check first. > > Right, ipv6 netfilter cannot create this situation yet. Not through netfilter but I'm not convinced that other paths won't do this. For instance, what about ipv6_frag_rcv -> esp6_input -> ... -> ip6_fragment? That would seem to be a potential path for a non-NULL dst to survive through to ip6_fragment, no? Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From yasuyuki.kozakai@toshiba.co.jp Sun Jan 30 21:44:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 21:44:09 -0800 (PST) Received: from inet-tsb.toshiba.co.jp (inet-tsb.toshiba.co.jp [202.33.96.40]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V5i1Lu010658 for ; Sun, 30 Jan 2005 21:44:02 -0800 Received: from tsb-wall.toshiba.co.jp ([133.199.160.134]) by inet-tsb.toshiba.co.jp with ESMTP id j0V5gu8j027629; Mon, 31 Jan 2005 14:42:56 +0900 (JST) Received: (from root@localhost) by tsb-wall.toshiba.co.jp id j0V5gulW017497; Mon, 31 Jan 2005 14:42:56 +0900 (JST) Received: from ovp1.toshiba.co.jp [133.199.192.124] by tsb-wall.toshiba.co.jp with SMTP id QAA17493 ; Mon, 31 Jan 2005 14:42:56 +0900 Received: from mx2.toshiba.co.jp (localhost [127.0.0.1]) by ovp1.toshiba.co.jp with ESMTP id j0V5gtbi026978; Mon, 31 Jan 2005 14:42:55 +0900 (JST) Received: by toshiba.co.jp id j0V5grsI029994; Mon, 31 Jan 2005 14:42:53 +0900 (JST) Date: Mon, 31 Jan 2005 14:42:52 +0900 (JST) Message-Id: <200501310542.j0V5grsI029994@toshiba.co.jp> To: yoshfuji@linux-ipv6.org Cc: kaber@trash.net, kozakai@linux-ipv6.org, herbert@gondor.apana.org.au, davem@davemloft.net, rmk+lkml@arm.linux.org.uk, Robert.Olsson@data.slu.se, akpm@osdl.org, torvalds@osdl.org, alexn@dsv.su.se, kas@fi.muni.cz, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Memory leak in 2.6.11-rc1? From: Yasuyuki KOZAKAI In-Reply-To: <20050131.141636.20664459.yoshfuji@linux-ipv6.org> References: <20050131.134559.125426676.yoshfuji@linux-ipv6.org> <41FDBB78.2050403@trash.net> <20050131.141636.20664459.yoshfuji@linux-ipv6.org> X-Mailer: Mew version 3.3 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1048 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yasuyuki.kozakai@toshiba.co.jp Precedence: bulk X-list: netdev Content-Length: 970 Lines: 31 Hi, From: YOSHIFUJI Hideaki / $B5HF#1QL@(B Date: Mon, 31 Jan 2005 14:16:36 +0900 (JST) > In article <41FDBB78.2050403@trash.net> (at Mon, 31 Jan 2005 06:00:40 +0100), Patrick McHardy says: > > |We don't need this for IPv6 yet. Once we get nf_conntrack in we > |might need this, but its IPv6 fragment handling is different from > |ip_conntrack, I need to check first. > > Ok. It would be better to have some comment but anyway... > kozakai-san? IMO, fix for nf_conntrack isn't needed yet. Because someone may change IPv6 fragment handling in nf_conntrack. Anyway, current nf_conntrack passes the original (not de-fragmented) skb to IPv6 stack. nf_conntrack doesn't touch its dst. Regards, ---------------------------------------- Yasuyuki KOZAKAI Communication Platform Laboratory, Corporate Research & Development Center, Toshiba Corporation yasuyuki.kozakai@toshiba.co.jp ---------------------------------------- From ncunningham@linuxmail.org Sun Jan 30 22:12:19 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 22:12:25 -0800 (PST) Received: from pop5-1.us4.outblaze.com (pop5-1.us4.outblaze.com [205.158.62.125]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0V6CJm5012849 for ; Sun, 30 Jan 2005 22:12:19 -0800 Received: (qmail 28849 invoked from network); 31 Jan 2005 06:12:10 -0000 Received: from unknown (HELO ?203.30.127.207?) (ncunningham@linuxmail.org@203.30.127.207) by pop5-1.us4.outblaze.com with SMTP; 31 Jan 2005 06:12:09 -0000 Subject: Re: 2.4.29, e100 and a WOL packet causes keventd going mad From: Nigel Cunningham Reply-To: ncunningham@linuxmail.org To: sfeldma@pobox.com Cc: David =?ISO-8859-1?Q?H=E4rdeman?= , Michael Gernoth , Linux Kernel Mailing List , netdev@oss.sgi.com In-Reply-To: <1107147615.18167.433.camel@localhost.localdomain> References: <20050130171849.GA3354@hardeman.nu> <1107143255.18167.428.camel@localhost.localdomain> <1107143905.21273.33.camel@desktop.cunninghams> <1107147615.18167.433.camel@localhost.localdomain> Content-Type: text/plain Message-Id: <1107152056.21273.56.camel@desktop.cunninghams> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6-1mdk Date: Mon, 31 Jan 2005 17:14:16 +1100 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1049 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ncunningham@linuxmail.org Precedence: bulk X-list: netdev Content-Length: 829 Lines: 34 Hi. On Mon, 2005-01-31 at 16:00, Scott Feldman wrote: > On Sun, 2005-01-30 at 19:58, Nigel Cunningham wrote: > > Do you also disable the WOL event when resuming? > > Good catch. How's this look? I looked at it last week because I used it for an example of device model drivers at the CELF conference. I got your intel address from the top of the .c file, but IIRC it bounced. Providence :> [...] > @@ -2333,6 +2331,7 @@ static int e100_resume(struct pci_dev *p > struct nic *nic = netdev_priv(netdev); > > pci_set_power_state(pdev, PCI_D0); > + pci_enable_wake(pdev, PCI_D0, 0); > pci_restore_state(pdev); > e100_hw_init(nic); Shouldn't this be disable_wake? Regards, Nigel -- Nigel Cunningham Software Engineer, Canberra, Australia http://www.cyclades.com Ph: +61 (2) 6292 8028 Mob: +61 (417) 100 574 From akpm@osdl.org Sun Jan 30 22:32:52 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 22:32:57 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V6Wq47013761 for ; Sun, 30 Jan 2005 22:32:52 -0800 Received: from bix (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id j0V6Wjl01357; Sun, 30 Jan 2005 22:32:45 -0800 Date: Sun, 30 Jan 2005 22:32:46 -0800 From: Andrew Morton To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: ipvs deadlock fix Message-Id: <20050130223246.5c6cb398.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1050 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 224 Lines: 7 I did the following two patches ages ago and haven't really been happy with the cancel_rearming_delayed_work() thing because it feels livelocky. But ipvs does lock up nice and tight so unless there are better ideas... From akpm@osdl.org Sun Jan 30 22:33:06 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 22:33:14 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V6X6gW013803 for ; Sun, 30 Jan 2005 22:33:06 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0V6X0l01364; Sun, 30 Jan 2005 22:33:00 -0800 Message-Id: <200501310633.j0V6X0l01364@mail.osdl.org> Subject: [patch 1/2] cancel_rearming_delayed_work() To: davem@davemloft.net Cc: netdev@oss.sgi.com, akpm@osdl.org, arjan@infradead.org From: akpm@osdl.org Date: Sun, 30 Jan 2005 22:33:01 -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1052 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 2326 Lines: 67 Add library functions to reliably kill off a delayed work whose handler re-adds the delayed work. One for keventd, one for caller-owned workqueues. DESC make cancel_rearming_delayed_workqueue static EDESC From: Arjan van de Ven cancel_rearming_delayed_workqueue() is only used inside workqueue.c; make this function static (the more useful wrapper around it later in that function remains non-static and exported) Signed-off-by: Arjan van de Ven Signed-off-by: Andrew Morton --- 25-akpm/include/linux/workqueue.h | 1 + 25-akpm/kernel/workqueue.c | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff -puN kernel/workqueue.c~cancel_rearming_delayed_work kernel/workqueue.c --- 25/kernel/workqueue.c~cancel_rearming_delayed_work 2004-11-30 23:46:09.387318016 -0800 +++ 25-akpm/kernel/workqueue.c 2004-11-30 23:46:21.763436560 -0800 @@ -423,6 +423,30 @@ void flush_scheduled_work(void) flush_workqueue(keventd_wq); } +/** + * cancel_rearming_delayed_workqueue - reliably kill off a delayed + * work whose handler rearms the delayed work. + * @wq: the controlling workqueue structure + * @work: the delayed work struct + */ +static void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq, + struct work_struct *work) +{ + while (!cancel_delayed_work(work)) + flush_workqueue(wq); +} + +/** + * cancel_rearming_delayed_work - reliably kill off a delayed keventd + * work whose handler rearms the delayed work. + * @work: the delayed work struct + */ +void cancel_rearming_delayed_work(struct work_struct *work) +{ + cancel_rearming_delayed_workqueue(keventd_wq, work); +} +EXPORT_SYMBOL(cancel_rearming_delayed_work); + int keventd_up(void) { return keventd_wq != NULL; diff -puN include/linux/workqueue.h~cancel_rearming_delayed_work include/linux/workqueue.h --- 25/include/linux/workqueue.h~cancel_rearming_delayed_work 2004-11-30 23:46:09.388317864 -0800 +++ 25-akpm/include/linux/workqueue.h 2004-11-30 23:46:21.762436712 -0800 @@ -70,6 +70,7 @@ extern int current_is_keventd(void); extern int keventd_up(void); extern void init_workqueues(void); +void cancel_rearming_delayed_work(struct work_struct *work); /* * Kill off a pending schedule_delayed_work(). Note that the work callback _ From akpm@osdl.org Sun Jan 30 22:33:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 22:33:13 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V6X7Eu013812 for ; Sun, 30 Jan 2005 22:33:07 -0800 Received: from localhost.localdomain (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0V6X1l01385; Sun, 30 Jan 2005 22:33:01 -0800 Message-Id: <200501310633.j0V6X1l01385@mail.osdl.org> Subject: [patch 2/2] ipvs deadlock fix To: davem@davemloft.net Cc: netdev@oss.sgi.com, akpm@osdl.org From: akpm@osdl.org Date: Sun, 30 Jan 2005 22:33:02 -0800 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1051 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 2371 Lines: 80 update_defense_level() is calling si_meminfo() from timer context. But si_meminfo takes non-irq-safe locks. Move it all to keventd context. Signed-off-by: Andrew Morton --- 25-akpm/net/ipv4/ipvs/ip_vs_ctl.c | 19 ++++++++----------- 1 files changed, 8 insertions(+), 11 deletions(-) diff -puN net/ipv4/ipvs/ip_vs_ctl.c~ipvs-deadlock-fix net/ipv4/ipvs/ip_vs_ctl.c --- 25/net/ipv4/ipvs/ip_vs_ctl.c~ipvs-deadlock-fix 2005-01-10 21:15:28.220163464 -0800 +++ 25-akpm/net/ipv4/ipvs/ip_vs_ctl.c 2005-01-10 21:15:28.226162552 -0800 @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include @@ -90,7 +90,7 @@ int ip_vs_get_debug_level(void) #endif /* - * update_defense_level is called from timer bh and from sysctl. + * update_defense_level is called from keventd and from sysctl. */ static void update_defense_level(void) { @@ -212,19 +212,19 @@ static void update_defense_level(void) /* * Timer for checking the defense */ -static struct timer_list defense_timer; #define DEFENSE_TIMER_PERIOD 1*HZ +static void defense_work_handler(void *data); +static DECLARE_WORK(defense_work, defense_work_handler, NULL); -static void defense_timer_handler(unsigned long data) +static void defense_work_handler(void *data) { update_defense_level(); if (atomic_read(&ip_vs_dropentry)) ip_vs_random_dropentry(); - mod_timer(&defense_timer, jiffies + DEFENSE_TIMER_PERIOD); + schedule_delayed_work(&defense_work, DEFENSE_TIMER_PERIOD); } - int ip_vs_use_count_inc(void) { @@ -2370,10 +2370,7 @@ int ip_vs_control_init(void) ip_vs_new_estimator(&ip_vs_stats); /* Hook the defense timer */ - init_timer(&defense_timer); - defense_timer.function = defense_timer_handler; - defense_timer.expires = jiffies + DEFENSE_TIMER_PERIOD; - add_timer(&defense_timer); + schedule_delayed_work(&defense_work, DEFENSE_TIMER_PERIOD); LeaveFunction(2); return 0; @@ -2384,7 +2381,7 @@ void ip_vs_control_cleanup(void) { EnterFunction(2); ip_vs_trash_cleanup(); - del_timer_sync(&defense_timer); + cancel_rearming_delayed_work(&defense_work); ip_vs_kill_estimator(&ip_vs_stats); unregister_sysctl_table(sysctl_header); proc_net_remove("ip_vs_stats"); _ From greearb@candelatech.com Sun Jan 30 22:39:16 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 22:39:20 -0800 (PST) Received: from www.lanforge.com (ns1.lanforge.com [66.165.47.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V6dFPN015998 for ; Sun, 30 Jan 2005 22:39:16 -0800 Received: from [4.33.45.22] (evrtwa1-ar2-4-33-045-022.evrtwa1.dsl-verizon.net [4.33.45.22]) (authenticated bits=0) by www.lanforge.com (8.12.8/8.12.8) with ESMTP id j0V6w1LH026450 for ; Sun, 30 Jan 2005 22:58:01 -0800 Message-ID: <41FDD292.4070202@candelatech.com> Date: Sun, 30 Jan 2005 22:39:14 -0800 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041020 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "'netdev@oss.sgi.com'" Subject: FD_CLOEXEC doesn't take affect through a system("foo") call?? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1053 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Content-Length: 929 Lines: 23 I found a funny thing in the 2.6.9 kernel. Not sure if it only happens here, or if it's even a bug, but it was unexpected to me at least... I have a server that opens a listening socket, and sets the FD_CLOEXEC bit, among other things. Sometime later, it creates a pppd.bash file that just starts pppd in the background. From my main process, I execute the pppd.bash script with the system() command. My expectation is that pppd would be spawned and that it would NOT be also listening on the socket that my main server is using. However, that is not the case: The pppd process has that socket and the rest of the sockets & file-descriptos from the main process open. I can work around this by explicitly forking, closing all FDs > 2, and then running the system call, but is what I am seeing expected behaviour? Thanks, Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From akpm@osdl.org Sun Jan 30 22:41:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 22:41:59 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V6fsYF016562 for ; Sun, 30 Jan 2005 22:41:55 -0800 Received: from bix (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id j0V6fll02446; Sun, 30 Jan 2005 22:41:48 -0800 Date: Sun, 30 Jan 2005 22:41:49 -0800 From: Andrew Morton To: davem@davemloft.net, netdev@oss.sgi.com, arjan@infradead.org Subject: Re: [patch 1/2] cancel_rearming_delayed_work() Message-Id: <20050130224149.29bb18a0.akpm@osdl.org> In-Reply-To: <200501310633.j0V6X0l01364@mail.osdl.org> References: <200501310633.j0V6X0l01364@mail.osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1054 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 730 Lines: 19 akpm@osdl.org wrote: > > Add library functions to reliably kill off a delayed work whose handler > re-adds the delayed work. One for keventd, one for caller-owned workqueues. > DESC > make cancel_rearming_delayed_workqueue static > EDESC > From: Arjan van de Ven > > cancel_rearming_delayed_workqueue() is only used inside workqueue.c; make > this function static (the more useful wrapper around it later in that > function remains non-static and exported) hmm, actually, had I paid any attention to Arjan's patch I'd have dropped it ;) cancel_rearming_delayed_workqueue() make sense and should be part of the workqueue API, even if nothing uses it yet. Whatever - we can fix that up sometime. From akpm@osdl.org Sun Jan 30 22:44:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 22:44:14 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V6i8Nf017070 for ; Sun, 30 Jan 2005 22:44:08 -0800 Received: from bix (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id j0V6i3l02547 for ; Sun, 30 Jan 2005 22:44:03 -0800 Date: Sun, 30 Jan 2005 22:44:04 -0800 From: Andrew Morton To: netdev@oss.sgi.com Subject: Fw: [Bugme-new] [Bug 4138] New: ipsec with racoon in transport mode with esp and ah hangs (problem is in xfrm_state_add) Message-Id: <20050130224404.5f78d28a.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1055 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 4400 Lines: 154 Begin forwarded message: Date: Sun, 30 Jan 2005 22:14:31 -0800 From: bugme-daemon@osdl.org To: bugme-new@lists.osdl.org Subject: [Bugme-new] [Bug 4138] New: ipsec with racoon in transport mode with esp and ah hangs (problem is in xfrm_state_add) http://bugme.osdl.org/show_bug.cgi?id=4138 Summary: ipsec with racoon in transport mode with esp and ah hangs (problem is in xfrm_state_add) Kernel Version: 2.6.10-1.8_FC2custom Status: NEW Severity: normal Owner: shemminger@osdl.org Submitter: au@unterluggauer.org Distribution: FC2 (all updates) Hardware Environment: Intel Celeron, E1000 (or E100, or Broadcom) Software Environment: KAME IPSec-Tools (setkey and racoon) vers. 0.5rc2 (same with 0.4 or 0.2.5-4) Linux litiusoft 2.6.10-1.8_FC2custom #26 SMP Mon Jan 31 04:25:18 CET 2005 i686 i686 i386 GNU/Linux Gnu C 3.3.3 Gnu make 3.80 binutils 2.15.90.0.3 util-linux 2.12 mount 2.12 module-init-tools 2.4.26 e2fsprogs 1.35 reiserfsprogs line reiser4progs line quota-tools 3.10. nfs-utils 1.0.6 Linux C Library 2.3.3 Dynamic linker (ldd) 2.3.3 Procps 3.2.0 Net-tools 1.60 Kbd 1.12 Sh-utils 5.2.1 Modules Loaded esp4 ah4 twofish serpent aes_i586 blowfish sha256 crypto_null af_key snd_intel8x0 snd_ac97_codec snd_pcm snd_timer snd_page_alloc snd soundcore usb_storage usbhid uhci_hcd ehci_hcd usbcore Problem Description: I am trying to use ipsec with esp and ah in transport mode between two hosts. Using only setkey with fixed spi and key for ah and esp is working. Using racoon with esp only (or ah only) in transport mode is working. Using racoon with esp and ah in transport mode is not working! Steps to reproduce: set policy at 192.168.2.3: #!/sbin/setkey -f flush; spdflush; spdadd 192.168.2.5 192.168.2.3 any -P in ipsec esp/transport//require ah/transport//require; spdadd 192.168.2.3 192.168.2.5 any -P out ipsec esp/transport//require ah/transport//require; ------- set policy at 192.168.2.5: #!/sbin/setkey -f flush; spdflush; spdadd 192.168.2.3 192.168.2.5 any -P in ipsec esp/transport//require ah/transport//require; spdadd 192.168.2.5 192.168.2.3 any -P out ipsec esp/transport//require ah/transport//require; -------- set racoon.conf on both machines: path pre_shared_key "/etc/racoon/psk.txt"; remote anonymous { exchange_mode main, aggressive; doi ipsec_doi; my_identifier address; proposal_check strict; proposal { encryption_algorithm 3des; hash_algorithm sha1; authentication_method pre_shared_key; dh_group 2; lifetime time 2 hour; } } sainfo anonymous { pfs_group 2; lifetime time 1 hour ; encryption_algorithm 3des; authentication_algorithm hmac_sha1 ; compression_algorithm deflate ; } --------- Notes: After a lot of plog() in the ipsec-tools source and a lot of printk() in the ipsec part of the kernel I come to the conclusion, that the problem is in the function xfrm_state_add(): the following if statement in xfrm_state_add cause the problem: if (x->km.seq) { x1 = __xfrm_find_acq_byseq(x->km.seq); if (x1 && xfrm_addr_cmp(&x1->id.daddr, &x->id.daddr, family)) { xfrm_state_put(x1); x1 = NULL; } } if (!x1) { ... } __xfrm_state_insert(x); ... if (x1) { xfrm_state_delete(x1); } the SAD entries for ah and esp have the same km.seq! __xfrm_find_acq_byseq() returns the first of them. the next if statement is false!!! because of the same daddr. x1 will not be set NULL. the next if (!x1) {} is also false. the last if (x1) is true and x1 will be deleted (although it hasn't been allocated) Workaround: I comment the if (x->km.seq) { ... } out. than it works vor me. but I know thats not a solution. now it's your turn :) andi ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. From davem@davemloft.net Sun Jan 30 23:01:58 2005 Received: with ECARTIS (v1.0.0; list netdev); Sun, 30 Jan 2005 23:02:05 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V71vvg017851 for ; Sun, 30 Jan 2005 23:01:58 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CvVU3-0004Ou-00; Sun, 30 Jan 2005 22:56:27 -0800 Date: Sun, 30 Jan 2005 22:56:27 -0800 From: "David S. Miller" To: Robert Olsson Cc: Robert.Olsson@data.slu.se, netdev@oss.sgi.com Subject: Re: [PATCH] gc_min_interval in milleseconds via /proc (fwd) Message-Id: <20050130225627.4feecd2e.davem@davemloft.net> In-Reply-To: <16888.56016.608929.340640@robur.slu.se> References: <16888.56016.608929.340640@robur.slu.se> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1056 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 658 Lines: 17 On Thu, 27 Jan 2005 13:13:04 +0100 Robert Olsson wrote: > Ok! But I haven't heard of any successful use of this paticaul API. :-) Are you really so sure? > > We could instead make another sysctl (perhaps name it something > > like "gc_min_interval_ms") to do what you propose, and then > > we'd keep the existing one around for compatibility. > > All-right a new patch below. We must pick a new sysctl number too, for sysctl() system call. If the only access possible were through /proc then yes your change would be valid, but due to sysctl() system call the .ctl_name defines that dimension of the sysctl namespace. From Christian.Tschudin@unibas.ch Mon Jan 31 00:04:39 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 00:04:44 -0800 (PST) Received: from balu1.urz.unibas.ch (balu1.urz.unibas.ch [131.152.1.51]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V84bNE019765 for ; Mon, 31 Jan 2005 00:04:38 -0800 Received: from igor.urz.unibas.ch (igor.urz.unibas.ch [131.152.1.3]) by balu1.urz.unibas.ch (8.12.10/8.12.10) with ESMTP id j0V84YCJ019785 for ; Mon, 31 Jan 2005 09:04:35 +0100 Date: Mon, 31 Jan 2005 09:04:34 +0100 (MET) From: Christian Tschudin To: netdev@oss.sgi.com Subject: PROBLEM: nd_tbl not a public symbol in net/ipv6/ndisc.c Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SMTP-Vilter-Version: 1.1.8 X-SMTP-Vilter-Virus-Backend: savse X-SMTP-Vilter-Status: clean X-SMTP-Vilter-savse-Virus-Status: clean X-SMTP-Vilter-Unwanted-Backend: attachment X-SMTP-Vilter-attachment-Unwanted-Status: clean X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1057 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Christian.Tschudin@unibas.ch Precedence: bulk X-list: netdev Content-Length: 905 Lines: 27 Our LUNAR project (underlay for wireless multihop networks) stumbled over the same problem that at least two other projects (infiniband, and mipv6) also experienced many months ago: The neighbor table 'nd_tbl' in net/ipv6/ndisc.c is not accessible from other modules. This prevents several 2.6.x kernel modules in networking from being deployed without kernel patching and recompilation. Please find a patch below. best, christian tschudin. --- --- linux-2.6.10/net/ipv6/ipv6_syms.c 2004-12-24 22:35:23.000000000 +0100 +++ work/linux-2.6.10/net/ipv6/ipv6_syms.c 2005-01-30 23:44:42.743620264 +0100 @@ -41,3 +41,4 @@ EXPORT_SYMBOL(rt6_lookup); EXPORT_SYMBOL(fl6_sock_lookup); EXPORT_SYMBOL(ipv6_push_nfrag_opts); +EXPORT_SYMBOL(nd_tbl); --- Christian Tschudin, University of Basel http://cn.cs.unibas.ch/ Computer Science Dept, Bernoullistr. 16, CH - 4056 Basel, Switzerland From hasso@estpak.ee Mon Jan 31 00:19:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 00:19:44 -0800 (PST) Received: from arena (test.estpak.ee [194.126.115.47]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V8JYkF024220 for ; Mon, 31 Jan 2005 00:19:35 -0800 Received: from localhost ([127.0.0.1] helo=arena) by arena with esmtp (Exim 4.43) id 1CvWn2-0000jm-Qx; Mon, 31 Jan 2005 10:20:08 +0200 From: Hasso Tepper To: hadi@znyx.com Subject: Re: dummy as IMQ replacement Date: Mon, 31 Jan 2005 10:20:08 +0200 User-Agent: KMail/1.7.2 Cc: netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto References: <1107123123.8021.80.camel@jzny.localdomain> In-Reply-To: <1107123123.8021.80.camel@jzny.localdomain> Organization: Elion Enterprises Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501311020.08337.hasso@estpak.ee> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1059 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hasso@estpak.ee Precedence: bulk X-list: netdev Content-Length: 479 Lines: 15 Jamal Hadi Salim wrote: > 2) Allows for queueing incoming traffic for shaping instead of > dropping. I am not aware of any study that shows policing is > worse than shaping in achieving the end goal of rate control. > I would be interested if anyone is experimenting. Nevertheless, > this is still an alternative as opposed to making a system wide > ingress change. Policing didn't work with IPv6 last time I checked. -- Hasso Tepper Elion Enterprises Ltd. WAN administrator From yoshfuji@linux-ipv6.org Mon Jan 31 00:19:30 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 00:19:43 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V8JTDO024213 for ; Mon, 31 Jan 2005 00:19:30 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id DB73733CC2; Mon, 31 Jan 2005 17:20:22 +0900 (JST) Date: Mon, 31 Jan 2005 17:20:22 +0900 (JST) Message-Id: <20050131.172022.93845025.yoshfuji@linux-ipv6.org> To: Christian.Tschudin@unibas.ch Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: PROBLEM: nd_tbl not a public symbol in net/ipv6/ndisc.c From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1058 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Content-Length: 608 Lines: 16 In article (at Mon, 31 Jan 2005 09:04:34 +0100 (MET)), Christian Tschudin says: > Our LUNAR project (underlay for wireless multihop networks) > stumbled over the same problem that at least two other projects > (infiniband, and mipv6) also experienced many months ago: > > The neighbor table 'nd_tbl' in net/ipv6/ndisc.c > is not accessible from other modules. : > +EXPORT_SYMBOL(nd_tbl); I disagree. Basically, ndisc.c is the only user of that structure and I cannot find why you really need this symbol. --yoshfuji From ncunningham@linuxmail.org Mon Jan 31 01:06:02 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 01:06:07 -0800 (PST) Received: from pop5-1.us4.outblaze.com (pop5-1.us4.outblaze.com [205.158.62.125]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0V961hX026465 for ; Mon, 31 Jan 2005 01:06:01 -0800 Received: (qmail 28682 invoked from network); 31 Jan 2005 09:05:55 -0000 Received: from unknown (HELO ?203.30.127.175?) (ncunningham@linuxmail.org@203.30.127.175) by pop5-1.us4.outblaze.com with SMTP; 31 Jan 2005 09:05:54 -0000 Subject: Re: 2.4.29, e100 and a WOL packet causes keventd going mad From: Nigel Cunningham Reply-To: ncunningham@linuxmail.org To: sfeldma@pobox.com Cc: David =?ISO-8859-1?Q?H=E4rdeman?= , Michael Gernoth , Linux Kernel Mailing List , netdev@oss.sgi.com In-Reply-To: <1107152056.21273.56.camel@desktop.cunninghams> References: <20050130171849.GA3354@hardeman.nu> <1107143255.18167.428.camel@localhost.localdomain> <1107143905.21273.33.camel@desktop.cunninghams> <1107147615.18167.433.camel@localhost.localdomain> <1107152056.21273.56.camel@desktop.cunninghams> Content-Type: text/plain Message-Id: <1107162475.4234.26.camel@desktop.cunninghams> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6-1mdk Date: Mon, 31 Jan 2005 20:08:03 +1100 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1060 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ncunningham@linuxmail.org Precedence: bulk X-list: netdev Content-Length: 1101 Lines: 43 Hi again. Ignore that :> I realised later that there's only one badly named routine and my assumption that there was another called disable_.. was wrong :> Nigel On Mon, 2005-01-31 at 17:14, Nigel Cunningham wrote: > Hi. > > On Mon, 2005-01-31 at 16:00, Scott Feldman wrote: > > On Sun, 2005-01-30 at 19:58, Nigel Cunningham wrote: > > > Do you also disable the WOL event when resuming? > > > > Good catch. How's this look? > > I looked at it last week because I used it for an example of device > model drivers at the CELF conference. I got your intel address from the > top of the .c file, but IIRC it bounced. Providence :> > > [...] > > > @@ -2333,6 +2331,7 @@ static int e100_resume(struct pci_dev *p > > struct nic *nic = netdev_priv(netdev); > > > > pci_set_power_state(pdev, PCI_D0); > > + pci_enable_wake(pdev, PCI_D0, 0); > > pci_restore_state(pdev); > > e100_hw_init(nic); > > Shouldn't this be disable_wake? > > Regards, > > Nigel -- Nigel Cunningham Software Engineer, Canberra, Australia http://www.cyclades.com Ph: +61 (2) 6292 8028 Mob: +61 (417) 100 574 From Christian.Tschudin@unibas.ch Mon Jan 31 01:16:37 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 01:16:43 -0800 (PST) Received: from balu1.urz.unibas.ch (balu1.urz.unibas.ch [131.152.1.51]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V9Gami027348 for ; Mon, 31 Jan 2005 01:16:37 -0800 Received: from igor.urz.unibas.ch (igor.urz.unibas.ch [131.152.1.3]) by balu1.urz.unibas.ch (8.12.10/8.12.10) with ESMTP id j0V9GUCJ015026; Mon, 31 Jan 2005 10:16:31 +0100 Date: Mon, 31 Jan 2005 10:16:29 +0100 (MET) From: Christian Tschudin To: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= cc: netdev@oss.sgi.com Subject: Re: PROBLEM: nd_tbl not a public symbol in net/ipv6/ndisc.c In-Reply-To: <20050131.172022.93845025.yoshfuji@linux-ipv6.org> Message-ID: References: <20050131.172022.93845025.yoshfuji@linux-ipv6.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN X-SMTP-Vilter-Version: 1.1.8 X-SMTP-Vilter-Virus-Backend: savse X-SMTP-Vilter-Status: clean X-SMTP-Vilter-savse-Virus-Status: clean X-SMTP-Vilter-Unwanted-Backend: attachment X-SMTP-Vilter-attachment-Unwanted-Status: clean X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by oss.sgi.com id j0V9Gami027348 X-archive-position: 1061 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Christian.Tschudin@unibas.ch Precedence: bulk X-list: netdev Content-Length: 1462 Lines: 39 On Mon, 31 Jan 2005, YOSHIFUJI Hideaki / [iso-2022-jp] µÈÆ£±ÑÌÀ wrote: > In article (at Mon, 31 Jan 2005 09:04:34 +0100 (MET)), Christian Tschudin says: > > > Our LUNAR project (underlay for wireless multihop networks) > > stumbled over the same problem that at least two other projects > > (infiniband, and mipv6) also experienced many months ago: > > > > The neighbor table 'nd_tbl' in net/ipv6/ndisc.c > > is not accessible from other modules. > : > > +EXPORT_SYMBOL(nd_tbl); > > I disagree. > Basically, ndisc.c is the only user of that structure and > I cannot find why you really need this symbol. We have implemented an underlay network layer protocol. This means that we present to the IP stack a subnet illusion while doing wireless multihop forwarding underneath. To this end we need to set and unset entries in the neighbor table, because we are actively managing neighbors. Now, if you know a technique how to invoke neigh_lookup(struct neigh_table *tbl, ...) or neigh_lookup_errno(struct neigh_table *tbl, ...) without having the reference to nd_tbl (i.e., getting at this value by some indirect means), we would be happy use it. Is there a way? Otherwise, we need a public nd_tbl symbol. best, christian --- Christian Tschudin, University of Basel http://cn.cs.unibas.ch/ Computer Science Dept, Bernoullistr. 16, CH - 4056 Basel, Switzerland From horms@koto.vergenet.net Mon Jan 31 01:36:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 01:36:26 -0800 (PST) Received: from koto.vergenet.net (koto.vergenet.net [210.128.90.7]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V9aJDw028370 for ; Mon, 31 Jan 2005 01:36:19 -0800 Received: by koto.vergenet.net (Postfix, from userid 7100) id 75BB43410C; Mon, 31 Jan 2005 18:16:27 +0900 (JST) Date: Mon, 31 Jan 2005 12:36:10 +0300 From: Horms To: akpm@osdl.org Cc: davem@davemloft.net, netdev@oss.sgi.com Subject: Re: [patch 2/2] ipvs deadlock fix Message-ID: <20050131093609.GA3804@verge.net.au> Mail-Followup-To: akpm@osdl.org, davem@davemloft.net, netdev@oss.sgi.com References: <200501310633.j0V6X1l01385@mail.osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200501310633.j0V6X1l01385@mail.osdl.org> X-Cluestick: seven User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1062 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: horms@verge.net.au Precedence: bulk X-list: netdev Content-Length: 428 Lines: 14 On Sun, Jan 30, 2005 at 10:33:02PM -0800, akpm@osdl.org wrote: > > > update_defense_level() is calling si_meminfo() from timer context. But > si_meminfo takes non-irq-safe locks. > > Move it all to keventd context. Would I be right in thinking that the offending lock is bdev_lock which is grabbed in nr_blockdev_pages() and thus that this is not an issue for 2.4 whose si_meminfo() does not have such a call? -- Horms From akpm@osdl.org Mon Jan 31 01:47:31 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 01:47:38 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0V9lUlW029127 for ; Mon, 31 Jan 2005 01:47:31 -0800 Received: from bix (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id j0V9lKl25881; Mon, 31 Jan 2005 01:47:20 -0800 Date: Mon, 31 Jan 2005 01:47:22 -0800 From: Andrew Morton To: Horms Cc: davem@davemloft.net, netdev@oss.sgi.com Subject: Re: [patch 2/2] ipvs deadlock fix Message-Id: <20050131014722.77d732c4.akpm@osdl.org> In-Reply-To: <20050131093609.GA3804@verge.net.au> References: <200501310633.j0V6X1l01385@mail.osdl.org> <20050131093609.GA3804@verge.net.au> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1063 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 598 Lines: 17 Horms wrote: > > On Sun, Jan 30, 2005 at 10:33:02PM -0800, akpm@osdl.org wrote: > > > > > > update_defense_level() is calling si_meminfo() from timer context. But > > si_meminfo takes non-irq-safe locks. > > > > Move it all to keventd context. > > Would I be right in thinking that the offending lock is bdev_lock which > is grabbed in nr_blockdev_pages() and thus that this is not an issue > for 2.4 whose si_meminfo() does not have such a call? Yes, 2.4's si_meminfo() seems to be OK from interrupt context. On x86 - I didn't check the other architectures. From yoshfuji@linux-ipv6.org Mon Jan 31 02:01:05 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 02:01:12 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VA142x030483 for ; Mon, 31 Jan 2005 02:01:05 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id 20FBF33CC2; Mon, 31 Jan 2005 19:01:58 +0900 (JST) Date: Mon, 31 Jan 2005 19:01:57 +0900 (JST) Message-Id: <20050131.190157.42878368.yoshfuji@linux-ipv6.org> To: Christian.Tschudin@unibas.ch Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: PROBLEM: nd_tbl not a public symbol in net/ipv6/ndisc.c From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: <20050131.172022.93845025.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1064 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Content-Length: 721 Lines: 18 In article (at Mon, 31 Jan 2005 10:16:29 +0100 (MET)), Christian Tschudin says: > We have implemented an underlay network layer protocol. > This means that we present to the IP stack a subnet illusion > while doing wireless multihop forwarding underneath. > To this end we need to set and unset entries in the neighbor > table, because we are actively managing neighbors. Ok, but basically, we do not export it unless it is really used. We may do if it is necessary when you merge it. BTW, for your purpose, we may export ndisc_lookup() or something instead of nd_tbl itself. Anyway, I'd like to know the usage (code). --yoshfuji From okir@suse.de Mon Jan 31 02:29:27 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 02:29:33 -0800 (PST) Received: from Cantor.suse.de (mail-ex.suse.de [195.135.220.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VATQGs032348 for ; Mon, 31 Jan 2005 02:29:27 -0800 Received: from hermes.suse.de (hermes-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 61DE013DB6CF for ; Mon, 31 Jan 2005 11:29:20 +0100 (CET) Date: Mon, 31 Jan 2005 11:29:20 +0100 From: Olaf Kirch To: netdev@oss.sgi.com Subject: [PATCH] arp_queue: serializing unlink + kfree_skb Message-ID: <20050131102920.GC4170@suse.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="fUYQa+Pmc3FrFX/N" Content-Disposition: inline User-Agent: Mutt/1.5.6i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1065 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: okir@suse.de Precedence: bulk X-list: netdev Content-Length: 3923 Lines: 109 --fUYQa+Pmc3FrFX/N Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, I'm just looking into a problem that may be related to the new neighbor discovery code in core/neighbour.c. The problem was originally reported against our SLES kernel, but the code in 2.6.11-rc2 is almost identical; code and patches shown below are relative to 2.6.11-rc2 The problem is that IBM testing was hitting the assertion in kfree_skb that checks that the skb has been removed from any list it was on ("kfree_skb passed an skb still on a list"). It seems the problem is a bad interaction between neigh_event_send and neigh_timer_handler: In neigh_event_send: if (skb_queue_len(&neigh->arp_queue) >= neigh->parms->queue_len) { struct sk_buff *buff; buff = neigh->arp_queue.next; __skb_unlink(buff, &neigh->arp_queue); kfree_skb(buff); } If the ARP queue overflows, we're trying to remove the first skb from the list. While we do this, the neighbor is locked. The corresponding piece of code in neigh_timer_handler is this: struct sk_buff *skb = skb_peek(&neigh->arp_queue); /* keep skb alive even if arp_queue overflows */ if (skb) skb_get(skb); write_unlock(&neigh->lock); neigh->ops->solicit(neigh, skb); atomic_inc(&neigh->probes); if (skb) kfree_skb(skb); /* <== this is where we BUG() */ The use of skb_get/kfree_skb makes sure the skb remains live while we're calling solicit(). Note that the neighbor isn't locked when we call kfree_skb. Now what happens in the bug that was reported to us (this was on a PPC SMP machine) is this, I think: - On CPU 0, neigh_timer_handler grabs the first skb on the queue, incrementing is reference count to 2, unlocks the neighbor, calls solicit() - On CPU 1, we enter neigh_event_send, find the ARP queue is full and remove the first skb. The call to kfree_skb will decrement the refcount to 1. This change is visible on all CPUs immediately, because it's an atomic_dec. The effects of __skb_unlink are not immediately visible on the other CPUs however. - On the first CPU, we return from solicit, call kfree_skb. Refcount goes to zero, but __kfree_skb still sees the skb->list pointer => barf. One possible fix here would be to add an smp_wmb after the __skb_unlink and a smp_rmb before the assertion in __kfree_skb, as in the attached patch. Does this make sense? Olaf -- Olaf Kirch | --- o --- Nous sommes du soleil we love when we play okir@suse.de | / | \ sol.dhoop.naytheet.ah kin.ir.samse.qurax --fUYQa+Pmc3FrFX/N Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=arp-skb-unlink-serialize Index: linux-2.6.10/net/core/neighbour.c =================================================================== --- linux-2.6.10.orig/net/core/neighbour.c 2005-01-21 11:04:23.000000000 +0100 +++ linux-2.6.10/net/core/neighbour.c 2005-01-31 11:20:38.000000000 +0100 @@ -876,6 +876,9 @@ int __neigh_event_send(struct neighbour struct sk_buff *buff; buff = neigh->arp_queue.next; __skb_unlink(buff, &neigh->arp_queue); + /* Make sure the change of skb->head is + * visible on all CPUs */ + smp_wmb(); kfree_skb(buff); } __skb_queue_tail(&neigh->arp_queue, skb); Index: linux-2.6.10/net/core/skbuff.c =================================================================== --- linux-2.6.10.orig/net/core/skbuff.c 2005-01-21 11:04:15.000000000 +0100 +++ linux-2.6.10/net/core/skbuff.c 2005-01-31 11:20:52.000000000 +0100 @@ -275,6 +275,7 @@ void kfree_skbmem(struct sk_buff *skb) void __kfree_skb(struct sk_buff *skb) { + smp_rmb(); if (skb->list) { printk(KERN_WARNING "Warning: kfree_skb passed an skb still " "on a list (from %p).\n", NET_CALLER(skb)); --fUYQa+Pmc3FrFX/N-- From Christian.Tschudin@unibas.ch Mon Jan 31 02:30:58 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 02:31:04 -0800 (PST) Received: from balu1.urz.unibas.ch (balu1.urz.unibas.ch [131.152.1.51]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VAUvLL032722 for ; Mon, 31 Jan 2005 02:30:58 -0800 Received: from igor.urz.unibas.ch (igor.urz.unibas.ch [131.152.1.3]) by balu1.urz.unibas.ch (8.12.10/8.12.10) with ESMTP id j0VAUrCJ016118; Mon, 31 Jan 2005 11:30:53 +0100 Date: Mon, 31 Jan 2005 11:30:52 +0100 (MET) From: Christian Tschudin To: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= cc: netdev@oss.sgi.com Subject: Re: PROBLEM: nd_tbl not a public symbol in net/ipv6/ndisc.c In-Reply-To: <20050131.190157.42878368.yoshfuji@linux-ipv6.org> Message-ID: References: <20050131.172022.93845025.yoshfuji@linux-ipv6.org> <20050131.190157.42878368.yoshfuji@linux-ipv6.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN X-SMTP-Vilter-Version: 1.1.8 X-SMTP-Vilter-Virus-Backend: savse X-SMTP-Vilter-Status: clean X-SMTP-Vilter-savse-Virus-Status: clean X-SMTP-Vilter-Unwanted-Backend: attachment X-SMTP-Vilter-attachment-Unwanted-Status: clean X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by oss.sgi.com id j0VAUvLL032722 X-archive-position: 1066 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Christian.Tschudin@unibas.ch Precedence: bulk X-list: netdev Content-Length: 1282 Lines: 50 On Mon, 31 Jan 2005, YOSHIFUJI Hideaki / [iso-2022-jp] µÈÆ£±ÑÌÀ wrote: > Ok, but basically, we do not export it unless it is really used. > We may do if it is necessary when you merge it. > > BTW, for your purpose, we may export > ndisc_lookup() > or something instead of nd_tbl itself. > > Anyway, I'd like to know the usage (code). Your new ndisc_lookup() would need to distinguish the IP address types (relating to different tables). Here is roughly what we do: --- int netbox_neigh_map(struct net_device *dev, struct lunartarget_s *host, char *eth) { struct neighbour *neigh = 0; if (TARGET_IS_IPV4(host)) neigh = neigh_lookup_errno(&arp_tbl, (struct in_addr*)&(host->addr.ipv4), dev); else if (TARGET_IS_IPV6(host)) neigh = neigh_lookup_errno(&nd_tbl, &host->addr.ipv6, dev); if (!IS_ERR(neigh)) { neigh->parms->delay_probe_time = 0; NEIGH_UPDATE(neigh, eth, NUD_REACHABLE, 1, 0); neigh_release(neigh); } return 0; } --- Our other function netbox_neigh_unmap() is basically the same, with the flag NUD_REACHABLE replaced by NUD_NONE. best, christian PS: full code (use guest/guest for username/password) at https://subversion.cs.unibas.ch/repos/lunar/trunk/lnx/knetbox.c > > --yoshfuji > From horms@koto.vergenet.net Mon Jan 31 02:31:25 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 02:31:32 -0800 (PST) Received: from koto.vergenet.net (koto.vergenet.net [210.128.90.7]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VAVPA3000494 for ; Mon, 31 Jan 2005 02:31:25 -0800 Received: by koto.vergenet.net (Postfix, from userid 7100) id BEE443421B; Mon, 31 Jan 2005 19:11:33 +0900 (JST) Date: Mon, 31 Jan 2005 13:21:12 +0300 From: Horms To: Andrew Morton Cc: davem@davemloft.net, netdev@oss.sgi.com Subject: Re: [patch 2/2] ipvs deadlock fix Message-ID: <20050131102111.GA6279@verge.net.au> Mail-Followup-To: Andrew Morton , davem@davemloft.net, netdev@oss.sgi.com References: <200501310633.j0V6X1l01385@mail.osdl.org> <20050131093609.GA3804@verge.net.au> <20050131014722.77d732c4.akpm@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050131014722.77d732c4.akpm@osdl.org> X-Cluestick: seven User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1067 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: horms@verge.net.au Precedence: bulk X-list: netdev Content-Length: 726 Lines: 25 On Mon, Jan 31, 2005 at 01:47:22AM -0800, Andrew Morton wrote: > Horms wrote: > > > > On Sun, Jan 30, 2005 at 10:33:02PM -0800, akpm@osdl.org wrote: > > > > > > > > > update_defense_level() is calling si_meminfo() from timer context. But > > > si_meminfo takes non-irq-safe locks. > > > > > > Move it all to keventd context. > > > > Would I be right in thinking that the offending lock is bdev_lock which > > is grabbed in nr_blockdev_pages() and thus that this is not an issue > > for 2.4 whose si_meminfo() does not have such a call? > > Yes, 2.4's si_meminfo() seems to be OK from interrupt context. Thanks. > On x86 - I didn't check the other architectures. Me neither. -- Horms From cranium.2003@gmail.com Mon Jan 31 02:56:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 02:56:13 -0800 (PST) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.192]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VAu7LE004118 for ; Mon, 31 Jan 2005 02:56:07 -0800 Received: by rproxy.gmail.com with SMTP id b11so748900rne for ; Mon, 31 Jan 2005 02:56:07 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=rwfntCUG1nSYl6MUVf0Qmtq12+mR8e6nowri5LymKn7U/0wlnie9J4mi6SuxHC5J8n1GINRCzrQYQc05JZbhvqsBAXVmouQyJaew83Z79GanrLGIOauiYkQcbxiAtAwCJZJavKgebLr17OPZ7fL859U83/RIFyCWdiLOX7Lv++4= Received: by 10.38.9.30 with SMTP id 30mr56403rni; Mon, 31 Jan 2005 02:56:06 -0800 (PST) Received: by 10.38.81.57 with HTTP; Mon, 31 Jan 2005 02:56:06 -0800 (PST) Message-ID: <1d55641b050131025636a00d1e@mail.gmail.com> Date: Mon, 31 Jan 2005 16:26:06 +0530 From: cranium 2003 Reply-To: cranium 2003 To: kernelnewbies@nl.linux.org, netdev@oss.sgi.com Subject: ethernet cache question Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1069 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cranium.2003@gmail.com Precedence: bulk X-list: netdev Content-Length: 554 Lines: 12 Hello, By looking at structure hh_cache it is seen that hh_output is structure variable defined as unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)]; Then i want to know how its sufficient in linux kernel to copy cache ethernet header entry as memcpy(skb->data - 16, hh->hh_data, 16); other variable defined in hh_cache is not seen as copied to packet structure. How then ethernet header is copied to packet if ethernet header has cache entry stored in hh_cache structure defiend in /usr/src/include/netdevice.h regards, cranium From herbert@gondor.apana.org.au Mon Jan 31 02:55:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 02:55:36 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VAtQGK003938 for ; Mon, 31 Jan 2005 02:55:27 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CvZCv-0004NQ-00; Mon, 31 Jan 2005 21:55:01 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CvZCT-00017g-00; Mon, 31 Jan 2005 21:54:33 +1100 From: Herbert Xu To: akpm@osdl.org (Andrew Morton), au@unterluggauer.org Subject: Re: Fw: [Bugme-new] [Bug 4138] New: ipsec with racoon in transport mode with esp and ah hangs (problem is in xfrm_state_add) Cc: netdev@oss.sgi.com Organization: Core In-Reply-To: <20050130224404.5f78d28a.akpm@osdl.org> X-Newsgroups: apana.lists.os.linux.netdev User-Agent: tin/1.7.4-20040225 ("Benbecula") (UNIX) (Linux/2.4.27-hx-1-686-smp (i686)) Message-Id: Date: Mon, 31 Jan 2005 21:54:33 +1100 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1068 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 1061 Lines: 30 Andrew Morton wrote: > > the SAD entries for ah and esp have the same km.seq! Sounds like a racoon bug. The kernel will assign different sequence numbers to the two SAs. It will also send SADB_ACQUIRE messages to racoon with those sequence numbers. So if racoon is sending two SADB_ADD commands with the same sequence number back then it's broken. Could you get a dump of the messages that racoon has received and sent? That should tell us exactly what's happening. > Workaround: > I comment the if (x->km.seq) { ... } out. than it works vor me. but I know > thats not a solution. Well without the check we would have silently ignored the sequence number which is why you wouldn't have noticed the problem with racoon before. However, for those who need to use the sequence number this check is necessary. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From herbert@gondor.apana.org.au Mon Jan 31 03:34:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 03:34:29 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VBYJfB006739 for ; Mon, 31 Jan 2005 03:34:20 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CvZoX-0004jR-00; Mon, 31 Jan 2005 22:33:53 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CvZo6-0001Bz-00; Mon, 31 Jan 2005 22:33:26 +1100 From: Herbert Xu To: okir@suse.de (Olaf Kirch) Subject: Re: [PATCH] arp_queue: serializing unlink + kfree_skb Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Organization: Core In-Reply-To: <20050131102920.GC4170@suse.de> X-Newsgroups: apana.lists.os.linux.netdev User-Agent: tin/1.7.4-20040225 ("Benbecula") (UNIX) (Linux/2.4.27-hx-1-686-smp (i686)) Message-Id: Date: Mon, 31 Jan 2005 22:33:26 +1100 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1070 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 1855 Lines: 49 Olaf Kirch wrote: > > The problem is that IBM testing was hitting the assertion in kfree_skb > that checks that the skb has been removed from any list it was on > ("kfree_skb passed an skb still on a list"). That must've be some testing to catch this :) > One possible fix here would be to add an smp_wmb after the __skb_unlink > and a smp_rmb before the assertion in __kfree_skb, as in the attached > patch. > > Does this make sense? It makes sense. However, I'm not sure whether we want to add a read barrier to the common path in kfree_skb just for a debugging test. If it was only for the skb->list test we could move the read barrier inside the if and reread skb->list if it were non-NULL. What you've done is expose a much bigger problem in Linux. We're using atomic integers to signal that we're done with an object. The object is usually represented by a piece of memory. The problem is that in most of the places where we do this (and that's not just in the networking systems), there are no memory barriers between the last reference to that object and the decrease on the atomic counter. For example, in this particular case, a more sinister (but probably impossible for sk_buff objects) problem would be for the list removal itself to be delayed until after the the kfree_skb. This could potentially mean that we're reading/writing memory that's already been freed. Perhaps we should always add a barrier to such operations. So kfree_skb would become if (atomic_read(&skb->users) != 1) { smp_mb__before_atomic_dec(); if (!atomic_dec_and_test(&skb->users)) return; } __kfree_skb(skb); Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From vnuorval@tcs.hut.fi Mon Jan 31 03:56:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 03:56:11 -0800 (PST) Received: from neon.tcs.hut.fi (neon.tcs.hut.fi [130.233.215.20]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VBu3XU007736 for ; Mon, 31 Jan 2005 03:56:04 -0800 Received: from rhea.tcs.hut.fi (rhea.tcs.hut.fi [130.233.215.147]) by neon.tcs.hut.fi (Postfix) with ESMTP id DAD3380019F; Mon, 31 Jan 2005 13:55:57 +0200 (EET) Date: Mon, 31 Jan 2005 13:55:57 +0200 (EET) From: Ville Nuorvala To: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Cc: rmk@arm.linux.org.uk, netdev@oss.sgi.com Subject: Re: ip -6 route shows incorrect route expiry times In-Reply-To: <20050131.013018.131301320.yoshfuji@linux-ipv6.org> Message-ID: References: <20050130160840.C25000@flint.arm.linux.org.uk> <20050131.012910.117562374.yoshfuji@linux-ipv6.org> <20050131.013018.131301320.yoshfuji@linux-ipv6.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-2022-jp X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by oss.sgi.com id j0VBu3XU007736 X-archive-position: 1071 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vnuorval@tcs.hut.fi Precedence: bulk X-list: netdev Content-Length: 1522 Lines: 36 On Mon, 31 Jan 2005, YOSHIFUJI Hideaki / [iso-2022-jp] µÈÆ£±ÑÌÀ wrote: > In article <20050131.012910.117562374.yoshfuji@linux-ipv6.org> (at Mon, 31 Jan 2005 01:29:10 +0900 (JST)), YOSHIFUJI Hideaki / µÈÆ£±ÑÌÀ says: > > > > It appears that the expiry seconds here are actually in units of > > > 10 seconds. Maybe someone's double-converting kernel Hz to user Hz? > > > > Kernel exports in USER_HZ. > > iproute2 seem to convert it again; workaround is to do "export HZ=100". > ~~~~~~~~~~~~~ > This is example. Of course, this depends on your arch. Please, couldn't the lifetimes be passed to userspace in a architecture indepentent unit like whole seconds? I don't think any routing protocols need a sub-second resolution for the lifetimes but if they do, why not use milliseconds? Better still, why not add a new attribute with a struct timespec or timeval to store the sub-second lifetimes for those who need them? Btw. we have the same HZ problem in many /proc files. Here too I would like to see a millisecond based interface in addition to the existing USER_HZ/jiffies/second based one. This especially applies to values like base_reachable_time and retrans_time, which are originally defined as millisecond values in the specification (RFC 2461). Regards, Ville -- Ville Nuorvala Research Assistant, Institute of Digital Communications, Helsinki University of Technology email: vnuorval@tcs.hut.fi, phone: +358 (0)9 451 5257 From tommy.christensen@tpack.net Mon Jan 31 04:16:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 04:17:00 -0800 (PST) Received: from mail.tpack.net (ip18.tpack.net [213.173.228.18]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0VCGp7V009535 for ; Mon, 31 Jan 2005 04:16:53 -0800 Received: (qmail 22824 invoked from network); 31 Jan 2005 12:16:45 -0000 Received: from tsc-6.cph.tpack.net (HELO ?192.168.9.22?) (192.168.9.22) by 0 with SMTP; 31 Jan 2005 12:16:45 -0000 Subject: Re: [patch 4/10] s390: network driver. From: Tommy Christensen To: hadi@cyberus.ca Cc: Jeff Garzik , Thomas Spatzier , "David S. Miller" , Hasso Tepper , Herbert Xu , netdev@oss.sgi.com, Paul Jakma In-Reply-To: <1107142012.8021.109.camel@jzny.localdomain> References: <1104764710.1048.580.camel@jzny.localdomain> <41DB26A6.2070008@pobox.com> <1104895169.1117.63.camel@jzny.localdomain> <41DC0931.80603@tpack.net> <1105019912.2314.20.camel@jzny.localdomain> <1105023972.3462.48.camel@tsc-6.cph.tpack.net> <1105104757.1046.63.camel@jzny.localdomain> <1105111605.3462.101.camel@tsc-6.cph.tpack.net> <1105363092.1041.146.camel@jzny.localdomain> <1105917038.1091.1041.camel@jzny.localdomain> <41EC3067.6050104@tpack.net> <41FD702D.2060403@tpack.net> <1107130177.7847.96.camel@jzny.localdomain> <41FD7C6F.3010005@tpack.net> <1107142012.8021.109.camel@jzny.localdomain> Content-Type: text/plain Message-Id: <1107173804.5812.133.camel@tsc-6.cph.tpack.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Mon, 31 Jan 2005 13:16:45 +0100 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1072 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tommy.christensen@tpack.net Precedence: bulk X-list: netdev Content-Length: 973 Lines: 32 On Mon, 2005-01-31 at 04:26, jamal wrote: > It does look pretty sane.. Tested? Nope, I don't have access to any relevant HW. Hopefully someone else can give it some beating. Please. A simple test could be: o start tcpdump on host B o start pinging from host A to B o unplug cable on host A o wait a while and then plug the cable back in This is what I get on an embedded PPC: 01:41:27.712729 IP 192.168.6.22 > 192.168.27.119: icmp 64: echo request seq 7 01:41:28.712697 IP 192.168.6.22 > 192.168.27.119: icmp 64: echo request seq 8 01:41:43.712240 IP 192.168.6.22 > 192.168.27.119: icmp 64: echo request seq 23 01:41:44.712210 IP 192.168.6.22 > 192.168.27.119: icmp 64: echo request seq 24 The interesting point is that the jump in sequence number coincides with the jump in rx time. Theory is that not all drivers will behave like this. Hopefully someone can verify that with e.g. an e1000, and then check whether the patch I send makes any difference. -Tommy From hadi@cyberus.ca Mon Jan 31 04:25:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 04:25:57 -0800 (PST) Received: from mx04.cyberus.ca (mx04.cybersurf.com [209.197.145.108]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VCPq9o013650 for ; Mon, 31 Jan 2005 04:25:53 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx04.cyberus.ca with esmtp (Exim 4.30) id 1Cvack-0001AB-PB for netdev@oss.sgi.com; Mon, 31 Jan 2005 05:25:46 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Cvacg-00031c-4A; Mon, 31 Jan 2005 07:25:42 -0500 Subject: Re: dummy as IMQ replacement From: jamal Reply-To: hadi@cyberus.ca To: Hasso Tepper Cc: netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto In-Reply-To: <200501311020.08337.hasso@estpak.ee> References: <1107123123.8021.80.camel@jzny.localdomain> <200501311020.08337.hasso@estpak.ee> Content-Type: text/plain Organization: jamalopolous Message-Id: <1107174338.8021.123.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 31 Jan 2005 07:25:39 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1073 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 580 Lines: 17 On Mon, 2005-01-31 at 03:20, Hasso Tepper wrote: > Jamal Hadi Salim wrote: > > 2) Allows for queueing incoming traffic for shaping instead of > > dropping. I am not aware of any study that shows policing is > > worse than shaping in achieving the end goal of rate control. > > I would be interested if anyone is experimenting. Nevertheless, > > this is still an alternative as opposed to making a system wide > > ingress change. > > Policing didn't work with IPv6 last time I checked. Really? I take it this is using the u32 classifier? What filter did you use? cheers, jamal From cranium.2003@gmail.com Mon Jan 31 04:27:03 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 04:27:07 -0800 (PST) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.195]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VCR2IT014145 for ; Mon, 31 Jan 2005 04:27:03 -0800 Received: by rproxy.gmail.com with SMTP id f1so812019rne for ; Mon, 31 Jan 2005 04:27:02 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=Q5wGEFdSdMPF/aBNL0ODy6pIHTyDEbx4uJEa863gZI3+2zwcBrSnxNBO2bJIzgHrVNf8ORoVbfFebYmJsyLiwCb3WXOVCp4jGtpDwEQZA8gtx/0TzNheicRJjm/zwh2Ea632Wekwt+ghF5mlSww1bFU1+1oWEZA7c6UMne9AEww= Received: by 10.38.10.72 with SMTP id 72mr45501rnj; Mon, 31 Jan 2005 04:27:01 -0800 (PST) Received: by 10.38.81.57 with HTTP; Mon, 31 Jan 2005 04:27:01 -0800 (PST) Message-ID: <1d55641b0501310427451b11@mail.gmail.com> Date: Mon, 31 Jan 2005 17:57:01 +0530 From: cranium 2003 Reply-To: cranium 2003 To: netdev@oss.sgi.com, linux-net@vger.linux.org Subject: who calls eth_header_cache_update Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1074 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cranium.2003@gmail.com Precedence: bulk X-list: netdev Content-Length: 300 Lines: 11 Hello, Who need to call following function in linux kernel? void eth_header_cache_update(struct hh_cache *hh, struct net_device *dev, unsigned char * haddr) { memcpy(((u8*)hh->hh_data) + HH_DATA_OFF(sizeof(struct ethhdr)), haddr, dev->addr_len); } regards, cranium From hasso@estpak.ee Mon Jan 31 04:37:18 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 04:37:24 -0800 (PST) Received: from arena (test.estpak.ee [194.126.115.47]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VCbHxh014842 for ; Mon, 31 Jan 2005 04:37:18 -0800 Received: from localhost ([127.0.0.1] helo=arena) by arena with esmtp (Exim 4.43) id 1Cvaob-0000q4-AC; Mon, 31 Jan 2005 14:38:01 +0200 From: Hasso Tepper To: hadi@cyberus.ca Subject: Re: dummy as IMQ replacement Date: Mon, 31 Jan 2005 14:38:01 +0200 User-Agent: KMail/1.7.2 Cc: netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto References: <1107123123.8021.80.camel@jzny.localdomain> <200501311020.08337.hasso@estpak.ee> <1107174338.8021.123.camel@jzny.localdomain> In-Reply-To: <1107174338.8021.123.camel@jzny.localdomain> Organization: Elion Enterprises Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501311438.01118.hasso@estpak.ee> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1075 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hasso@estpak.ee Precedence: bulk X-list: netdev Content-Length: 395 Lines: 15 jamal wrote: > On Mon, 2005-01-31 at 03:20, Hasso Tepper wrote: > > Policing didn't work with IPv6 last time I checked. > > Really? I take it this is using the u32 classifier? > What filter did you use? http://mailman.ds9a.nl/pipermail/lartc/2004q2/012422.html Got one answer to this in private that "AFAIK it isn't implemented yet". -- Hasso Tepper Elion Enterprises Ltd. WAN administrator From kumarkr@us.ibm.com Mon Jan 31 04:39:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 04:39:41 -0800 (PST) Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.133]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VCdZQU015342 for ; Mon, 31 Jan 2005 04:39:36 -0800 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e35.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j0VCdTZ7216098 for ; Mon, 31 Jan 2005 07:39:29 -0500 Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j0VCdT6b316816 for ; Mon, 31 Jan 2005 05:39:29 -0700 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j0VCdTer008235 for ; Mon, 31 Jan 2005 05:39:29 -0700 Received: from d03nm132.boulder.ibm.com (d03nm132.boulder.ibm.com [9.17.195.172]) by d03av04.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j0VCdTKD008230; Mon, 31 Jan 2005 05:39:29 -0700 In-Reply-To: <1d55641b0501310427451b11@mail.gmail.com> Subject: Re: who calls eth_header_cache_update To: cranium 2003 Cc: linux-net@vger.linux.org, netdev@oss.sgi.com X-Mailer: Lotus Notes Release 6.5.1IBM February 19, 2004 Message-ID: From: Krishna Kumar Date: Mon, 31 Jan 2005 18:09:27 +0530 X-MIMETrack: Serialize by Router on D03NM132/03/M/IBM(Release 6.51HF338 | June 21, 2004) at 01/31/2005 05:39:29 MIME-Version: 1.0 Content-type: multipart/related; Boundary="0__=08BBE509DFD6FF0D8f9e8a93df938690918c08BBE509DFD6FF0D" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1076 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kumarkr@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 8196 Lines: 224 --0__=08BBE509DFD6FF0D8f9e8a93df938690918c08BBE509DFD6FF0D Content-type: multipart/alternative; Boundary="1__=08BBE509DFD6FF0D8f9e8a93df938690918c08BBE509DFD6FF0D" --1__=08BBE509DFD6FF0D8f9e8a93df938690918c08BBE509DFD6FF0D Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: quoted-printable Check neigh_update_hss().... - KK = cranium 2003 = = To Sent by: netdev@oss.sgi.com, = netdev-bounce@oss linux-net@vger.linux.org = .sgi.com = cc = Subj= ect 01/31/2005 05:57 who calls eth_header_cache_updat= e PM = = = Please respond to = cranium 2003 = = = Hello, Who need to call following function in linux kernel? void eth_header_cache_update(struct hh_cache *hh, struct net_device *dev, unsigned char * haddr) { memcpy(((u8*)hh->hh_data) + HH_DATA_OFF(sizeof(struct ethhdr)),= haddr, dev->addr_len); } regards, cranium = --1__=08BBE509DFD6FF0D8f9e8a93df938690918c08BBE509DFD6FF0D Content-type: text/html; charset=US-ASCII Content-Disposition: inline Content-transfer-encoding: quoted-printable

Check neigh_update_hss()....

- KK

3D"Inactivecranium 2003 <cranium.2003@gmail.com>

=
          cranium 2003 <cranium.2003@gmail.com>
          Sent by: netdev-bounce@oss.sgi.com

          01/31/2005 05:57 PM
          Please respond to
          cranium 2003

=
3D""
To
3D""
netdev@oss.sgi.com, linux-net@vger.linux.org
3D""
cc
3D""
3D""
Subject
3D""
who calls eth_header_cache_update
=3D""3D""<= /td>

Hello,
          Who need to call following function= in linux kernel?
void eth_header_cache_update(struct hh_cache *hh, struct net_device
= *dev, unsigned char * haddr)
{
       memcpy(((u8*)hh->hh_data) + HH_DATA_OFF(= sizeof(struct ethhdr)),
              haddr, dev->addr_l= en);
}

regards,
cranium


= --1__=08BBE509DFD6FF0D8f9e8a93df938690918c08BBE509DFD6FF0D-- --0__=08BBE509DFD6FF0D8f9e8a93df938690918c08BBE509DFD6FF0D Content-type: image/gif; name="graycol.gif" Content-Disposition: inline; filename="graycol.gif" Content-ID: <10__=08BBE509DFD6FF0D8f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 R0lGODlhEAAQAKECAMzMzAAAAP///wAAACH5BAEAAAIALAAAAAAQABAAAAIXlI+py+0PopwxUbpu ZRfKZ2zgSJbmSRYAIf4fT3B0aW1pemVkIGJ5IFVsZWFkIFNtYXJ0U2F2ZXIhAAA7 --0__=08BBE509DFD6FF0D8f9e8a93df938690918c08BBE509DFD6FF0D Content-type: image/gif; name="pic31540.gif" Content-Disposition: inline; filename="pic31540.gif" Content-ID: <20__=08BBE509DFD6FF0D8f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 R0lGODlhWABDALP/AAAAAK04Qf79/o+Gm7WuwlNObwoJFCsoSMDAwGFsmIuezf///wAAAAAAAAAA AAAAACH5BAEAAAgALAAAAABYAEMAQAT/EMlJq704682770RiFMRinqggEUNSHIchG0BCfHhOjAuh EDeUqTASLCbBhQrhG7xis2j0lssNDopE4jfIJhDaggI8YB1sZeZgLVA9YVCpnGagVjV171aRVrYR RghXcAGFhoUETwYxcXNyADJ3GlcSKGAwLwllVC1vjIUHBWsFilKQdI8GA5IcpApeJQt8L09lmgkH LZikoU5wjqcyAMMFrJIDPAKvCFletKSev1HBw8KrxtjZ2tvc3d5VyKtCKW3jfz4uMKmq3xu4N0nK BVoJQmx2LGVOmrqNjjJf2hHAQo/eDwJGTKhQMcgQEEAnEjFS98+RnW3smGkZU6ncCWav/4wYOnAI TihRL/4FEwbp28BXMMcoscQCVxlepL4IGDSCyJyVQOu0o7CjmLN50OZlqWmyFy5/6yBBuji0AxFR M00oQAqNIstqI6qKHUsWRAEAvagsmfUEAImyxgbmUpJk3IklNUtJOUAVLoUr1+wqDGTE4zk+T6FG uQb3SizBCwatiiUgCBN8vrz+zFjVyQ8FWkOlg4NQiZMB5QS8QO3mpOaKnL0Z2EKvNMSILEThKhCg zMKPVxYJh23qm9KNW7pArPynMqZDiErsTMqI+LRi3QAgkFUbXpuFKhSYZALd0O5RKa2z9EYKBbpb qxIKsjUPRgD7I2XYV6wyrOw92ykExP8NW4URhknC5dKGE4v4NENQj2jXjmfNgOZDaXb5glRmXQ33 YEWQYNcZFnrYcIQLNzyTFDQNkXIff0ExVlY4srziQk43inZgL4rwxxINMvpFFAz1KOODHiu+4aEw NEjFl5B3JIKWKF3k6I9bfUGp5ZZcdunll5IA4cuHvQQJ5gcsoCWOOUwgltIwAKRxJgbIkJAQZEq0 2YliZnpZZ4BH3CnYOXldOUOfQoYDqF1LFHbXCrO8xmRsfoXDXJ6ChjCAH3QlhJcT6VWE6FCkfCco CgrMFsROrIEX3o2whVjWDjoJccN3LdggSGXLCdLEgHr1lyU3O3QxhgohNKXJCWv8JQr/PDdaqd6w 2rj1inLiGeiCJoDspAoQlYE6QWLSECehcWIYxIQES6zhbn1iImTHEQyqJ4eIxJJoUBc+3CbBuwZE V5cJPPkIjFDdeEabQbd6WgICTxiiz0f5dBKquXF6k4senwEhYGnKEFJeGrxUZy8dB8gmAXI/sPvH ESfCwVt5hTgYiqQqtdRNHQIU1PJ33ZqmzgE90OwLaoJcnMop1WiMmgkPHQRIrwgFuNV90A3doNKT mrKIN07AnGcI9BQjhCBN4RfA1qIZnMqorJCogKfGQnxSCDilTVIA0yl5ciTovgLuBDKFUDE9aQcw 9SA+rjSNf9/M1gxrj6VwDTS0IUSElMzBfsj0NFXR2kwsV1A5IF1grLgLL/r1R40BZEnuBWgmQEyb jqRwSAt6bqMCOFkvKFN2GPPkUzIm/SCF8z8pVzpbjVnMsy0vOr1hw3SaSRUhpY09v0z0J1FnwzPl fmh+xl4WtR0zGu24I4KbMQm3lnVu2oNWxI9W/lcyzA+mCKF4DBikxb/+UWtOGRiFP8qEwAayIgIA Ow== --0__=08BBE509DFD6FF0D8f9e8a93df938690918c08BBE509DFD6FF0D Content-type: image/gif; name="ecblank.gif" Content-Disposition: inline; filename="ecblank.gif" Content-ID: <30__=08BBE509DFD6FF0D8f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 R0lGODlhEAABAIAAAAAAAP///yH5BAEAAAEALAAAAAAQAAEAAAIEjI8ZBQA7 --0__=08BBE509DFD6FF0D8f9e8a93df938690918c08BBE509DFD6FF0D-- From hadi@cyberus.ca Mon Jan 31 04:48:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 04:48:11 -0800 (PST) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VCm4q8016196 for ; Mon, 31 Jan 2005 04:48:04 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.30) id 1CvayG-0002TU-ME for netdev@oss.sgi.com; Mon, 31 Jan 2005 07:48:00 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CvayC-0006Ho-67; Mon, 31 Jan 2005 07:47:56 -0500 Subject: Re: dummy as IMQ replacement From: jamal Reply-To: hadi@cyberus.ca To: Hasso Tepper Cc: netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto In-Reply-To: <200501311438.01118.hasso@estpak.ee> References: <1107123123.8021.80.camel@jzny.localdomain> <200501311020.08337.hasso@estpak.ee> <1107174338.8021.123.camel@jzny.localdomain> <200501311438.01118.hasso@estpak.ee> Content-Type: text/plain Organization: jamalopolous Message-Id: <1107175673.7847.130.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 31 Jan 2005 07:47:53 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1077 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 1096 Lines: 33 On Mon, 2005-01-31 at 07:38, Hasso Tepper wrote: > jamal wrote: > > On Mon, 2005-01-31 at 03:20, Hasso Tepper wrote: > > > Policing didn't work with IPv6 last time I checked. > > > > Really? I take it this is using the u32 classifier? > > What filter did you use? > > http://mailman.ds9a.nl/pipermail/lartc/2004q2/012422.html > > Got one answer to this in private that "AFAIK it isn't implemented yet". This? tc filter add dev eth1.101 parent ffff: protocol all prio 50 handle \ 0x101 fw police rate 1024kbit burst 60k drop flowid :101 What are you trying to do? Are you also trying to rate limit ARPs etc in one shot? Does this even get hit at all? tc -s would show you stats. I suspect for one it is not being hit. Maybe you are trying to use iptables marks that happen a long time after the ingress has seen the packets (which would explain why it is not being hit)? This would be true kernels > 2.6.8 but not before .. In other words, it may be a config issue. If you tell me what it is you are trying to do i could try and set it up when i come back from work today. cheers, jamal From hasso@estpak.ee Mon Jan 31 05:02:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 05:02:18 -0800 (PST) Received: from arena (test.estpak.ee [194.126.115.47]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VD2AI1017070 for ; Mon, 31 Jan 2005 05:02:10 -0800 Received: from localhost ([127.0.0.1] helo=arena) by arena with esmtp (Exim 4.43) id 1CvbCi-0000qz-Vb; Mon, 31 Jan 2005 15:02:56 +0200 From: Hasso Tepper To: hadi@cyberus.ca Subject: Re: dummy as IMQ replacement Date: Mon, 31 Jan 2005 15:02:56 +0200 User-Agent: KMail/1.7.2 Cc: netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto References: <1107123123.8021.80.camel@jzny.localdomain> <200501311438.01118.hasso@estpak.ee> <1107175673.7847.130.camel@jzny.localdomain> In-Reply-To: <1107175673.7847.130.camel@jzny.localdomain> Organization: Elion Enterprises Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501311502.56796.hasso@estpak.ee> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1078 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hasso@estpak.ee Precedence: bulk X-list: netdev Content-Length: 1611 Lines: 53 jamal wrote: > On Mon, 2005-01-31 at 07:38, Hasso Tepper wrote: > > jamal wrote: > > > On Mon, 2005-01-31 at 03:20, Hasso Tepper wrote: > > > > Policing didn't work with IPv6 last time I checked. > > > > > > Really? I take it this is using the u32 classifier? > > > What filter did you use? > > > > http://mailman.ds9a.nl/pipermail/lartc/2004q2/012422.html > > > > Got one answer to this in private that "AFAIK it isn't implemented > > yet". > > This? > > tc filter add dev eth1.101 parent ffff: protocol all prio 50 handle \ > 0x101 fw police rate 1024kbit burst 60k drop flowid :101 > > What are you trying to do? Are you also trying to rate limit ARPs etc > in one shot? All traffic coming from eth1.101 interface. > Does this even get hit at all? tc -s would show you stats. I suspect > for one it is not being hit. As far as I remember situation was exactly as I described. This worked for IPv4 traffic, but not for IPv6 traffic. > Maybe you are trying to use iptables marks that happen > a long time after the ingress has seen the packets (which would > explain why it is not being hit)? This would be true kernels > 2.6.8 > but not before .. This test was done with 2.6.6. > In other words, it may be a config issue. Would be nice ;). > If you tell me what it is you are trying to do i could try and set it > up when i come back from work today. I'd like to limit _all_ traffic coming in from one particular interface to the one common limit. No matter what traffic it is - IPv4 or IPv6. Sum of traffic should be the one I specify. -- Hasso Tepper Elion Enterprises Ltd. WAN administrator From tgraf@suug.ch Mon Jan 31 05:28:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 05:28:08 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VDS0Qx018991 for ; Mon, 31 Jan 2005 05:28:01 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 2996682; Mon, 31 Jan 2005 14:27:36 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 618731C0EA; Mon, 31 Jan 2005 14:28:19 +0100 (CET) Date: Mon, 31 Jan 2005 14:28:19 +0100 From: Thomas Graf To: Hasso Tepper Cc: hadi@cyberus.ca, netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto Subject: Re: dummy as IMQ replacement Message-ID: <20050131132819.GB31837@postel.suug.ch> References: <1107123123.8021.80.camel@jzny.localdomain> <200501311438.01118.hasso@estpak.ee> <1107175673.7847.130.camel@jzny.localdomain> <200501311502.56796.hasso@estpak.ee> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200501311502.56796.hasso@estpak.ee> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1079 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 1534 Lines: 54 > > > http://mailman.ds9a.nl/pipermail/lartc/2004q2/012422.html It depends on whether you have CONFIG_NET_CLS_ACT enabled or not. If so, the ingress qdisc is hit before PREROUTING and thus can't see the mark for a good reason. Simply removing the dependcy on the mark resolves the issue for you. If you don't have CONFIG_NET_CLS_ACT enabled you would see the mark if the ingress qdisc would register on the IPv6 PREROUTING hook but apparently it doesn't. The patch below should fix it, it is completely untested though. --- linux-2.6.11-rc2-bk8.orig/net/sched/sch_ingress.c 2005-01-30 21:19:51.000000000 +0100 +++ linux-2.6.11-rc2-bk8/net/sched/sch_ingress.c 2005-01-31 14:23:08.000000000 +0100 @@ -271,6 +271,14 @@ .priority = NF_IP_PRI_FILTER + 1, }; +static struct nf_hook_ops ing6_ops = { + .hook = ing_hook, + .owner = THIS_MODULE, + .pf = PF_INET6, + .hooknum = NF_IP6_PRE_ROUTING, + .priority = NF_IP6_PRI_FILTER + 1, +}; + #endif #endif @@ -296,6 +304,11 @@ printk("ingress qdisc registration error \n"); return -EINVAL; } + if (nf_register_hook(&ing6_ops) < 0) { + nf_unregister_hook(&ing_ops); + printk("ingress ipv6 qdisc registration error \n"); + return -EINVAL; + } nf_registered++; } #endif @@ -408,8 +421,10 @@ unregister_qdisc(&ingress_qdisc_ops); #ifndef CONFIG_NET_CLS_ACT #ifdef CONFIG_NETFILTER - if (nf_registered) + if (nf_registered) { nf_unregister_hook(&ing_ops); + nf_unregister_hook(&ing6_ops); + } #endif #endif } From hadi@cyberus.ca Mon Jan 31 05:39:41 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 05:39:46 -0800 (PST) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VDdfxR019643 for ; Mon, 31 Jan 2005 05:39:41 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.30) id 1CvbmD-00035j-Su for netdev@oss.sgi.com; Mon, 31 Jan 2005 08:39:37 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Cvbm9-000579-RB; Mon, 31 Jan 2005 08:39:34 -0500 Subject: Re: dummy as IMQ replacement From: jamal Reply-To: hadi@cyberus.ca To: Hasso Tepper Cc: netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto In-Reply-To: <200501311502.56796.hasso@estpak.ee> References: <1107123123.8021.80.camel@jzny.localdomain> <200501311438.01118.hasso@estpak.ee> <1107175673.7847.130.camel@jzny.localdomain> <200501311502.56796.hasso@estpak.ee> Content-Type: text/plain Organization: jamalopolous Message-Id: <1107178770.7840.151.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 31 Jan 2005 08:39:30 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1080 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 2681 Lines: 86 On Mon, 2005-01-31 at 08:02, Hasso Tepper wrote: > jamal wrote: [..] > > What are you trying to do? Are you also trying to rate limit ARPs etc > > in one shot? > > All traffic coming from eth1.101 interface. > eth1.101 is an alias? You may have issues there. Maybe not if the attach to that interface worked. > > > tc filter add dev eth1.101 parent ffff: protocol all prio 50 handle \ > > 0x101 fw police rate 1024kbit burst 60k drop flowid :101 > > > > Does this even get hit at all? tc -s would show you stats. I suspect > > for one it is not being hit. > > As far as I remember situation was exactly as I described. This worked for > IPv4 traffic, but not for IPv6 traffic. > Off hand i cant see why .. Unless the ipv6 packets didnt get marked properly but the v4 ones did? > > Maybe you are trying to use iptables marks that happen > > a long time after the ingress has seen the packets (which would > > explain why it is not being hit)? This would be true kernels > 2.6.8 > > but not before .. > > This test was done with 2.6.6. Ok, in that case iptables prerouting would have come before ingress; so as long as you marked the packets with iptables it should work fine. > > In other words, it may be a config issue. > > Would be nice ;). I am still thinking it is. What are your iptables v6 markers? > > If you tell me what it is you are trying to do i could try and set it > > up when i come back from work today. > > I'd like to limit _all_ traffic coming in from one particular interface to > the one common limit. No matter what traffic it is - IPv4 or IPv6. Sum of > traffic should be the one I specify. Theres other ways to do it[1] but if theres a bug in this it needs fixing. cheers, jamal [1] Example, you could do this: tc filter add dev eth1 parent ffff: protocol ip prio 1 \ u32 match u32 0 0 flowid 1:15 \ action police index 1 rate 1024kbit burst 60k drop index 1 Note the use of "index 1" to select a policer. Then repeat replacing ip with ip6; make sure that "index 1" for policer stays. You could do this to share also across devices. Example, on egress of eth0 also use the same 1Mbps tc filter add dev eth0 parent 1:0 protocol ip prio 6 u32 \ match ip src 10.0.0.21/32 flowid 1:16 \ action police index 1 rate 1024kbit burst 60k drop index 1 Now with new action stuff you could instead just have said: tc actions add \ action police index 1 rate 1024kbit burst 60k drop index 1 And then later just referenced it without having to repeat the rate like so: filter add dev eth0 parent ffff: protocol ip prio 6 u32 match ip src \ 10.0.0.21/32 flowid 1:16 \ action police index 1 Again, this does not excuse a bug if it exists ... From hadi@cyberus.ca Mon Jan 31 05:45:56 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 05:46:03 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VDjqTI020276 for ; Mon, 31 Jan 2005 05:45:52 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CvbsD-00005m-FB for netdev@oss.sgi.com; Mon, 31 Jan 2005 08:45:49 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Cvbs8-0005xU-2U; Mon, 31 Jan 2005 08:45:44 -0500 Subject: Re: dummy as IMQ replacement From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: Hasso Tepper , netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto In-Reply-To: <20050131132819.GB31837@postel.suug.ch> References: <1107123123.8021.80.camel@jzny.localdomain> <200501311438.01118.hasso@estpak.ee> <1107175673.7847.130.camel@jzny.localdomain> <200501311502.56796.hasso@estpak.ee> <20050131132819.GB31837@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1107179140.7840.157.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 31 Jan 2005 08:45:40 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1081 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 2165 Lines: 71 Yeah, that would fix it. Note however, that i am trying to highly discourage use of iptables and i would rather let people who use iptables to suffer;-> (sounds rude i know). At some point i plan to remove the dependency on iptables altogether. So i am not sure whether i should encourage pushing of this patch or not ;-> All this hooking in 100 hooks is one of the reasons i disliked IMQ as well cheers, jamal PS:- also note in 2.6.6 tc action was not yet in, so On Mon, 2005-01-31 at 08:28, Thomas Graf wrote: > > > > http://mailman.ds9a.nl/pipermail/lartc/2004q2/012422.html > > It depends on whether you have CONFIG_NET_CLS_ACT enabled or not. > If so, the ingress qdisc is hit before PREROUTING and thus can't > see the mark for a good reason. Simply removing the dependcy on > the mark resolves the issue for you. > > If you don't have CONFIG_NET_CLS_ACT enabled you would see the > mark if the ingress qdisc would register on the IPv6 PREROUTING > hook but apparently it doesn't. > > The patch below should fix it, it is completely untested though. > > --- linux-2.6.11-rc2-bk8.orig/net/sched/sch_ingress.c 2005-01-30 21:19:51.000000000 +0100 > +++ linux-2.6.11-rc2-bk8/net/sched/sch_ingress.c 2005-01-31 14:23:08.000000000 +0100 > @@ -271,6 +271,14 @@ > .priority = NF_IP_PRI_FILTER + 1, > }; > > +static struct nf_hook_ops ing6_ops = { > + .hook = ing_hook, > + .owner = THIS_MODULE, > + .pf = PF_INET6, > + .hooknum = NF_IP6_PRE_ROUTING, > + .priority = NF_IP6_PRI_FILTER + 1, > +}; > + > #endif > #endif > > @@ -296,6 +304,11 @@ > printk("ingress qdisc registration error \n"); > return -EINVAL; > } > + if (nf_register_hook(&ing6_ops) < 0) { > + nf_unregister_hook(&ing_ops); > + printk("ingress ipv6 qdisc registration error \n"); > + return -EINVAL; > + } > nf_registered++; > } > #endif > @@ -408,8 +421,10 @@ > unregister_qdisc(&ingress_qdisc_ops); > #ifndef CONFIG_NET_CLS_ACT > #ifdef CONFIG_NETFILTER > - if (nf_registered) > + if (nf_registered) { > nf_unregister_hook(&ing_ops); > + nf_unregister_hook(&ing6_ops); > + } > #endif > #endif > } > > From tgraf@suug.ch Mon Jan 31 05:57:51 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 05:57:56 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VDvoQe020980 for ; Mon, 31 Jan 2005 05:57:51 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 72C3482; Mon, 31 Jan 2005 14:57:27 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 91F361C0EA; Mon, 31 Jan 2005 14:58:10 +0100 (CET) Date: Mon, 31 Jan 2005 14:58:10 +0100 From: Thomas Graf To: Jamal Hadi Salim Cc: netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto Subject: Re: dummy as IMQ replacement Message-ID: <20050131135810.GC31837@postel.suug.ch> References: <1107123123.8021.80.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1107123123.8021.80.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1082 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 2274 Lines: 50 > 2) Allows for queueing incoming traffic for shaping instead of > dropping. I am not aware of any study that shows policing is > worse than shaping in achieving the end goal of rate control. > I would be interested if anyone is experimenting. Nevertheless, > this is still an alternative as opposed to making a system wide > ingress change. Agreed, the problem should be solved on egress by delaying ACKs so the other side's congestion control slows down. I still don't have a solution which works for all ip stacks and ended up tuning parameters based on TTL numbers guessing the operating system. For me, the purpose of ingress policing is to apply some policy for control datagrams and other unwanted traffic. One example would be dropping echo requests comming from nmap which reduces egress bandwidth consumption by 13% my border routers. tc filter add dev $DEV parent ffff: protocol ip prio 10 \ u32 match u32 0x10000 0xff0000 at 8 \ match u32 0x1c 0xffff at 0 \ match u32 0x8000000 0xf000000 at 20 \ police mtu 1 drop flowid :1 I should convert this to actions at some point ;-> > --> Instead the plan is to have a contrack related action. This action > will selectively either query/create contrack state on incoming packets. > Packets could then be redirected to dummy based on what happens -> eg > on incoming packets; if we find they are of known state we could send to > a different queue than one which didnt have existing state. This > all however is dependent on whatever rules the admin enters. We could also do it in the meta ematch but this relies on the packet already having passed the conntrack code. How do you plan to do this in ingress? > tc filter add dev eth0 parent 1: protocol ip prio 10 u32 \ > match ip src 192.168.200.200/32 flowid 1:2 \ > action police rate 10kbit burst 90k drop \ > action mirred egress mirror dev dummy0 This is extremely useful. I'm not sure but I think you also had plans to allow mirroring to userspace? > My goal here is to start a discussion to see if people agree this is > a good replacement for IMQ or whether to go another path. Sounds good to me. No complains from my side. I'll have a closer look at the patch later on. From hadi@cyberus.ca Mon Jan 31 06:00:05 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 06:00:12 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VE04xM021490 for ; Mon, 31 Jan 2005 06:00:04 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1Cvc5x-00031k-Ha for netdev@oss.sgi.com; Mon, 31 Jan 2005 09:00:01 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Cvc5t-0007zU-BS; Mon, 31 Jan 2005 08:59:57 -0500 Subject: Re: [RFC] string matching ematch From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: Pablo Neira , Patrick McHardy , netdev@oss.sgi.com In-Reply-To: <20050127205147.GS31837@postel.suug.ch> References: <20050126150714.GL31837@postel.suug.ch> <41F94C63.7010800@eurodev.net> <20050127205147.GS31837@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1107179994.7840.164.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 31 Jan 2005 08:59:54 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1083 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 2987 Lines: 68 Reading email backward .. I think we should allow for all sorts of algrithms KMP, Boyer-Moore etc to be plugged in (in tc this is already there). The stuff that Harald was looking at (at least around July when i last talked to him on this) is an infrastructure level thing. Its derived from someone who seems to have well thought of the callbacks etc for a good stateful solution. I cant remember the person from whom Harald was deriving his stuff (email was somewhere in .fr) - but it did seem pretty sensible. If we can have infrastructure that is also usable by tc, that would be great so we dont go cutnpasting unnecessarily. Having said all that: Thomas, I think you should leave what you have as totaly stateless unless we dont have a shareable solution. I have tons of ideas i could share when we get to that level. cheers, jamal On Thu, 2005-01-27 at 15:51, Thomas Graf wrote: > * Pablo Neira <41F94C63.7010800@eurodev.net> 2005-01-27 21:17 > > Thomas Graf wrote: > > > > >I'd like to discuss the string matching ematch, I don't care about the > > >algorithm used but rather whether to make it stateful, match over > > >fragments, etc. I attached a simple stateless string matching ematch > > >using the Knuth-Morris-Pratt algorithm as a starting point. > > > > > > > I've posted something similar after christmas in netfilter-devel[1]. > > It's fragment aware, actually my implementation uses boyer-moore to look > > for matches in the payload, and it uses brute force together with > > Rusty's skb_iter stuff to look for matches on the edges. > > I've seen it but sticked to KMP because it uses less memory. Their > searching phase time complexity is nearly equal around O(nm) for > n being the length of T[] and m being the length of P[]. BM > definitely has a better performance for highly periodic P[]'s in a > periodic T[] though. > > I'm missing a few things in your string matching API, namely > the ability to define a upper limit of the searching range which > can give much better performance gains than the best optimization > can do. A naive searching method around the borders of fragments > is definiltey easier but even there you could benefit from ruling > out invalid shifts. > > > The worst case is not that bad for small patterns. > > I don't think that any of the algorithms really make a difference, > theoretically yes but what we're basically should be looking for > is one with good average performance by detecting unnecessary > shifts. Our T[] is limited by the skb as long as we're not going > into statefull searches and thus other resources matter more to me > than a few more cycles. > > > I'll give it more spins these days since I've got some spare time. I'll > > also have a look at your work. I think that we could join efforts and > > push something good, thoughts? > > Definitely, being able to specify the upper limit is a must for me > though. Another difference is that I compute the prefix table in > userspace. > > From tgraf@suug.ch Mon Jan 31 06:06:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 06:06:16 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VE6BI4022104 for ; Mon, 31 Jan 2005 06:06:11 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id EB5B482; Mon, 31 Jan 2005 15:05:47 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 25B481C0EA; Mon, 31 Jan 2005 15:06:30 +0100 (CET) Date: Mon, 31 Jan 2005 15:06:30 +0100 From: Thomas Graf To: jamal Cc: Hasso Tepper , netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto Subject: Re: dummy as IMQ replacement Message-ID: <20050131140630.GD31837@postel.suug.ch> References: <1107123123.8021.80.camel@jzny.localdomain> <200501311438.01118.hasso@estpak.ee> <1107175673.7847.130.camel@jzny.localdomain> <200501311502.56796.hasso@estpak.ee> <20050131132819.GB31837@postel.suug.ch> <1107179140.7840.157.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1107179140.7840.157.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1084 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 677 Lines: 14 > Yeah, that would fix it. Note however, that i am trying to highly > discourage use of iptables and i would rather let people who use > iptables to suffer;-> (sounds rude i know). At some point i plan to > remove the dependency on iptables altogether. Heh, I think it isn't rude, giving people a little clap to join the "good side" isn't that bad ;-> > So i am not sure whether i should encourage pushing of this patch or not ;-> I don't care that much, the patch is there, everyone can patch and distributions can pick it up. I agree that we should remove the dependency on iptables but I'd also like to see the dependency on the action bits to go away at the same time. From hasso@estpak.ee Mon Jan 31 06:13:48 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 06:13:52 -0800 (PST) Received: from arena (test.estpak.ee [194.126.115.47]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VEDlcl023139 for ; Mon, 31 Jan 2005 06:13:47 -0800 Received: from localhost ([127.0.0.1] helo=arena) by arena with esmtp (Exim 4.43) id 1CvcJz-0000uK-I1; Mon, 31 Jan 2005 16:14:31 +0200 From: Hasso Tepper To: hadi@cyberus.ca Subject: Re: dummy as IMQ replacement Date: Mon, 31 Jan 2005 16:14:31 +0200 User-Agent: KMail/1.7.2 Cc: netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto References: <1107123123.8021.80.camel@jzny.localdomain> <200501311502.56796.hasso@estpak.ee> <1107178770.7840.151.camel@jzny.localdomain> In-Reply-To: <1107178770.7840.151.camel@jzny.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501311614.31397.hasso@estpak.ee> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1085 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hasso@estpak.ee Precedence: bulk X-list: netdev Content-Length: 1547 Lines: 52 jamal wrote: > On Mon, 2005-01-31 at 08:02, Hasso Tepper wrote: > > All traffic coming from eth1.101 interface. > > eth1.101 is an alias? You may have issues there. Maybe not if the > attach to that interface worked. No, vlan. > Theres other ways to do it[1] but if theres a bug in this it needs > fixing. > > cheers, > jamal > > [1] > Example, you could do this: > > tc filter add dev eth1 parent ffff: protocol ip prio 1 \ > u32 match u32 0 0 flowid 1:15 \ > action police index 1 rate 1024kbit burst 60k drop index 1 > > Note the use of "index 1" to select a policer. > > Then repeat replacing ip with ip6; make sure that "index 1" for policer > stays. You could do this to share also across devices. > > Example, on egress of eth0 also use the same 1Mbps > > tc filter add dev eth0 parent 1:0 protocol ip prio 6 u32 \ > match ip src 10.0.0.21/32 flowid 1:16 \ > action police index 1 rate 1024kbit burst 60k drop index 1 > > Now with new action stuff you could instead just have said: > tc actions add \ > action police index 1 rate 1024kbit burst 60k drop index 1 > > And then later just referenced it without having to repeat the rate > like so: > filter add dev eth0 parent ffff: protocol ip prio 6 u32 match ip src \ > 10.0.0.21/32 flowid 1:16 \ > action police index 1 Hmmm ... I even didn't know about index. Yes, something like that would do as well probably. I'll do some tests later today with this. Actions don't help me though as I'm using 2.4 kernel for production. -- Hasso Tepper Elion Enterprises Ltd. WAN administrator From hadi@cyberus.ca Mon Jan 31 06:19:46 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 06:19:51 -0800 (PST) Received: from mx04.cyberus.ca (mx04.cybersurf.com [209.197.145.108]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VEJjfY023775 for ; Mon, 31 Jan 2005 06:19:45 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx04.cyberus.ca with esmtp (Exim 4.30) id 1CvcOx-0008M3-4v for netdev@oss.sgi.com; Mon, 31 Jan 2005 07:19:39 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CvcOr-00033f-Cq; Mon, 31 Jan 2005 09:19:33 -0500 Subject: Re: dummy as IMQ replacement From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto In-Reply-To: <20050131135810.GC31837@postel.suug.ch> References: <1107123123.8021.80.camel@jzny.localdomain> <20050131135810.GC31837@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1107181169.7840.184.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 31 Jan 2005 09:19:30 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1086 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 4682 Lines: 120 On Mon, 2005-01-31 at 08:58, Thomas Graf wrote: > > 2) Allows for queueing incoming traffic for shaping instead of > > dropping. I am not aware of any study that shows policing is > > worse than shaping in achieving the end goal of rate control. > > I would be interested if anyone is experimenting. Nevertheless, > > this is still an alternative as opposed to making a system wide > > ingress change. > > Agreed, the problem should be solved on egress by delaying ACKs > so the other side's congestion control slows down. Or dropping packets. TCP will adjust itself either way; at least thats true according to this formula [rfc3448] (originally derived from Reno, but people are finding it works fine with all other variants of TCP CC): ----- The throughput equation is: s X = ---------------------------------------------------------- R*sqrt(2*b*p/3) + (t_RTO * (3*sqrt(3*b*p/8) * p * (1+32*p^2))) Where: X is the transmit rate in bytes/second. s is the packet size in bytes. R is the round trip time in seconds. p is the loss event rate, between 0 and 1.0, of the number of loss events as a fraction of the number of packets transmitted. t_RTO is the TCP retransmission timeout value in seconds. b is the number of packets acknowledged by a single TCP acknowledgement. ---- dropping mucks with "p" and delaying ACKs (shaping) mucks with "R". Plug into that formula either one and you see they affect the result for X the same way. I am really hoping that someone will do experimental analysis - cant believe no hungry students these days out there. > I still don't > have a solution which works for all ip stacks and ended up tuning > parameters based on TTL numbers guessing the operating system. > > For me, the purpose of ingress policing is to apply some policy for > control datagrams and other unwanted traffic. One example would be > dropping echo requests comming from nmap which reduces egress > bandwidth consumption by 13% my border routers. > > tc filter add dev $DEV parent ffff: protocol ip prio 10 \ > u32 match u32 0x10000 0xff0000 at 8 \ > match u32 0x1c 0xffff at 0 \ > match u32 0x8000000 0xf000000 at 20 \ > police mtu 1 drop flowid :1 > > I should convert this to actions at some point ;-> > You should ;-> And now you can actually _really_ drop, above will let some packets through. More interestingly is you can now randomly drop or determistically (drop every 10th packet) > > --> Instead the plan is to have a contrack related action. This action > > will selectively either query/create contrack state on incoming packets. > > Packets could then be redirected to dummy based on what happens -> eg > > on incoming packets; if we find they are of known state we could send to > > a different queue than one which didnt have existing state. This > > all however is dependent on whatever rules the admin enters. > > We could also do it in the meta ematch but this relies on the packet > already having passed the conntrack code. How do you plan to do this > in ingress? > Something along the lines of what OBSD firewall does but selectively (If i understood those OBSD fanatics at SUCON;-> correctly)..they track at ingress before ip stack. The difference is we can allow selective tracking; something along the lines of: tc filter add dev $DEV parent ffff: protocol ip prio 10 \ u32 match u32 0x10000 0xff0000 at 8 \ action track \ action metamark here depending on whether we found contrack etc I have the layout scribbeled on paper somewhere .. I will look it up and provide more details Track should just use iptables contracking code instead of reinventing it. > > > tc filter add dev eth0 parent 1: protocol ip prio 10 u32 \ > > match ip src 192.168.200.200/32 flowid 1:2 \ > > action police rate 10kbit burst 90k drop \ > > action mirred egress mirror dev dummy0 > > This is extremely useful. I'm not sure but I think you also had plans > to allow mirroring to userspace? > Yes via mmaped packet sockets. The other way (induced by laziness, so i dont have to write a single line of code) is to have redirection to ring device that was posted a while back by someone since it provides a bridge between mmaped packet socket like interface and kernel. > > My goal here is to start a discussion to see if people agree this is > > a good replacement for IMQ or whether to go another path. > > Sounds good to me. No complains from my side. I'll have a closer look > at the patch later on. Thanks for looking cheers, jamal From hadi@cyberus.ca Mon Jan 31 06:26:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 06:26:12 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VEQ7lc024410 for ; Mon, 31 Jan 2005 06:26:07 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CvcVA-0005Bo-Jv for netdev@oss.sgi.com; Mon, 31 Jan 2005 09:26:04 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CvcV0-0003zq-IO; Mon, 31 Jan 2005 09:25:54 -0500 Subject: Re: dummy as IMQ replacement From: jamal Reply-To: hadi@cyberus.ca To: Hasso Tepper Cc: netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto In-Reply-To: <200501311614.31397.hasso@estpak.ee> References: <1107123123.8021.80.camel@jzny.localdomain> <200501311502.56796.hasso@estpak.ee> <1107178770.7840.151.camel@jzny.localdomain> <200501311614.31397.hasso@estpak.ee> Content-Type: text/plain Organization: jamalopolous Message-Id: <1107181551.7847.193.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 31 Jan 2005 09:25:51 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1087 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 1210 Lines: 37 On Mon, 2005-01-31 at 09:14, Hasso Tepper wrote: > jamal wrote: > > On Mon, 2005-01-31 at 08:02, Hasso Tepper wrote: > > > All traffic coming from eth1.101 interface. > > > > eth1.101 is an alias? You may have issues there. Maybe not if the > > attach to that interface worked. > > No, vlan. That should be fine then > > Theres other ways to do it[1] but if theres a bug in this it needs > > fixing. [..] > > And then later just referenced it without having to repeat the rate > > like so: > > filter add dev eth0 parent ffff: protocol ip prio 6 u32 match ip src \ > > 10.0.0.21/32 flowid 1:16 \ > > action police index 1 > > Hmmm ... I even didn't know about index. Yes, something like that would do > as well probably. I'll do some tests later today with this. Actions don't > help me though as I'm using 2.4 kernel for production. Theres an extra "index 1" in all those examples. remove the first one (I am sure you will find out when experimenting what the correct syntax is). Unfortunately this "index" thing continues to be a big secret although i have pointed it a few times. Bart should probably add it to his HOWTO. All actions also have indices and are therefore shareable. cheers, jamal From hadi@cyberus.ca Mon Jan 31 06:29:18 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 06:29:23 -0800 (PST) Received: from mx04.cyberus.ca (mx04.cybersurf.com [209.197.145.108]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VETItT024934 for ; Mon, 31 Jan 2005 06:29:18 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx04.cyberus.ca with esmtp (Exim 4.30) id 1CvcYC-0005CU-Aa for netdev@oss.sgi.com; Mon, 31 Jan 2005 07:29:12 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CvcYD-0004g4-Ss; Mon, 31 Jan 2005 09:29:14 -0500 Subject: Re: dummy as IMQ replacement From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: Hasso Tepper , netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto In-Reply-To: <20050131140630.GD31837@postel.suug.ch> References: <1107123123.8021.80.camel@jzny.localdomain> <200501311438.01118.hasso@estpak.ee> <1107175673.7847.130.camel@jzny.localdomain> <200501311502.56796.hasso@estpak.ee> <20050131132819.GB31837@postel.suug.ch> <1107179140.7840.157.camel@jzny.localdomain> <20050131140630.GD31837@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1107181750.7847.198.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 31 Jan 2005 09:29:10 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1088 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 1065 Lines: 29 On Mon, 2005-01-31 at 09:06, Thomas Graf wrote: > > Yeah, that would fix it. Note however, that i am trying to highly > > discourage use of iptables and i would rather let people who use > > iptables to suffer;-> (sounds rude i know). At some point i plan to > > remove the dependency on iptables altogether. > > Heh, I think it isn't rude, giving people a little clap to join > the "good side" isn't that bad ;-> > Unfortunately killing it totaly would break all sorts of scripts. Wish we could do this though ;-> Go ahead and push the patch to Dave even - I am just gonna look the other way;-> > > So i am not sure whether i should encourage pushing of this patch or not ;-> > > I don't care that much, the patch is there, everyone can patch and > distributions can pick it up. I agree that we should remove the > dependency on iptables but I'd also like to see the dependency on the > action bits to go away at the same time. Agreed. The main reason not to use the iptables bits is performance; also its just the wrong spot in the stack. cheers, jamal From hasso@estpak.ee Mon Jan 31 06:45:29 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 06:45:34 -0800 (PST) Received: from arena (test.estpak.ee [194.126.115.47]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VEjSWb025755 for ; Mon, 31 Jan 2005 06:45:29 -0800 Received: from localhost ([127.0.0.1] helo=arena) by arena with esmtp (Exim 4.43) id 1Cvcog-00011T-GT; Mon, 31 Jan 2005 16:46:14 +0200 From: Hasso Tepper To: hadi@cyberus.ca Subject: Re: dummy as IMQ replacement Date: Mon, 31 Jan 2005 16:46:14 +0200 User-Agent: KMail/1.7.2 Cc: netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto References: <1107123123.8021.80.camel@jzny.localdomain> <200501311614.31397.hasso@estpak.ee> <1107181551.7847.193.camel@jzny.localdomain> In-Reply-To: <1107181551.7847.193.camel@jzny.localdomain> Organization: Elion Enterprises Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200501311646.14322.hasso@estpak.ee> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1089 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hasso@estpak.ee Precedence: bulk X-list: netdev Content-Length: 816 Lines: 21 jamal wrote: > Unfortunately this "index" thing continues to be a big secret although i > have pointed it a few times. Bart should probably add it to his HOWTO. All this stuff deserves better documentation ;). Call me oldfashioned, but IMHO would be good start to have all keywords at least somewhat documented in iproute2 man pages. I know, writing documentation is boring task etc, but at least you should mention all features in man pages. This gives to someone at least chance to kick you "hey, what's this?" ;). This is somewhat related to killing the chance to use iptables as well ... Iptables has better documentation and people use it just because of that. Just checked ... "tc action help" in newest iproute2 returns nothing as well :(. -- Hasso Tepper Elion Enterprises Ltd. WAN administrator From martin.wilck@fujitsu-siemens.com Mon Jan 31 06:57:18 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 06:57:24 -0800 (PST) Received: from dgate1.fujitsu-siemens.com (dgate1.fujitsu-siemens.com [217.115.66.35]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VEvGKv026556 for ; Mon, 31 Jan 2005 06:57:17 -0800 Received: from trulli.pdb.fsc.net (172.25.96.20) by dgate1.fujitsu-siemens.com with ESMTP; 31 Jan 2005 15:57:12 +0100 X-SBRSScore: None X-IronPort-AV: i="3.88,167,1102287600"; d="scan'208"; a="3863770:sNHT100830492" Received: from biker.psw.pdb.fsc.net (biker.pdb.fsc.net [172.25.253.106]) by trulli.pdb.fsc.net (8.11.6/8.11.6) with ESMTP id j0VEvBr05281; Mon, 31 Jan 2005 15:57:11 +0100 Received: from fujitsu-siemens.com (localhost [127.0.0.1]) by biker.psw.pdb.fsc.net (Postfix) with ESMTP id BDB41BC85; Mon, 31 Jan 2005 15:57:10 +0100 (CET) Message-ID: <41FE4745.4020003@fujitsu-siemens.com> Date: Mon, 31 Jan 2005 15:57:09 +0100 From: Martin Wilck Organization: Fujitsu Siemens Computers User-Agent: Mozilla Thunderbird 0.5 (X11/20040208) X-Accept-Language: de, en-us, en MIME-Version: 1.0 To: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: SIOCGIFMAP silently broken? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1090 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: martin.wilck@fujitsu-siemens.com Precedence: bulk X-list: netdev Content-Length: 1202 Lines: 32 Hi, we are using a server management software that uses the irq information returned by the SIOCGIFMAP ioctl to correlate network interfaces with LAN hardware. The code for SIOCGIFMAP if net/core/dev.c simply returns netdev->irq which isn't set by most actual LAN drivers any more, and it seems to be common opinion that setting netdev->irq is either optional or even wrong (http://www.ussg.iu.edu/hypermail/linux/kernel/0407.3/1292.html). Consequently, the SIOCGIFMAP ioctl reports bogus IRQ values for most hardware; it is therefore unreliable. Would it be possible to fix the ioctl such that it returns the correct irq value, e.g. be using the irq field of the associated struct pci_dev? If not, I'd consider it better to deprecate netdev->irq officially and always return bogus so that people stop using it. In both cases, the netdev->irq field isn't used anymore; perhaps it should be officially deprecated and/or removed? Regards Martin -- Martin Wilck Phone: +49 5251 8 15113 Fujitsu Siemens Computers Fax: +49 5251 8 20409 Heinz-Nixdorf-Ring 1 mailto:Martin.Wilck@Fujitsu-Siemens.com D-33106 Paderborn http://www.fujitsu-siemens.com/primergy From tgraf@suug.ch Mon Jan 31 07:15:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 07:15:20 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VFFEnE027791 for ; Mon, 31 Jan 2005 07:15:14 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 7F8DA82; Mon, 31 Jan 2005 16:14:50 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 9BCE81C0EA; Mon, 31 Jan 2005 16:15:32 +0100 (CET) Date: Mon, 31 Jan 2005 16:15:32 +0100 From: Thomas Graf To: jamal Cc: netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto Subject: Re: dummy as IMQ replacement Message-ID: <20050131151532.GE31837@postel.suug.ch> References: <1107123123.8021.80.camel@jzny.localdomain> <20050131135810.GC31837@postel.suug.ch> <1107181169.7840.184.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1107181169.7840.184.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1091 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 3109 Lines: 70 > Or dropping packets. TCP will adjust itself either way; at least > thats true according to this formula [rfc3448] (originally derived from > Reno, but people are finding it works fine with all other variants of > TCP CC): > > ----- > The throughput equation is: > > s > X = ---------------------------------------------------------- > R*sqrt(2*b*p/3) + (t_RTO * (3*sqrt(3*b*p/8) * p * (1+32*p^2))) > > > Where: > > X is the transmit rate in bytes/second. > s is the packet size in bytes. > R is the round trip time in seconds. > p is the loss event rate, between 0 and 1.0, of the number of loss > events as a fraction of the number of packets transmitted. > t_RTO is the TCP retransmission timeout value in seconds. > b is the number of packets acknowledged by a single TCP > acknowledgement. > ---- Agreed, this was my first attempt and my current code is still based on this. I'm trying to avoid a retransmit battle, therefore I try to delay packets if possible with the hope that it's either just a peak or the slow down is fast enough. I use a simplified RED and tcp_xmit_retransmit_queue() input to avoid flick flack effects which works pretty well for bulky streams. A burst buffer takes care of interactive traffic with peaks but this doesn't work perfectly fine yet. Overall, my attempt works pretty well if the other side uses reno/bic and quite well for westwood and vegas. The problem is not that it doesn't work at all but achieving a certain _stable_ rate is very difficult, the delta of the requested and real rate is up to 25% depending on the constancy of the rtt and wether they follow one of the proposed tcp cc algorithms. The cc guessing code helps a bit but isn't very accurate. > Something along the lines of what OBSD firewall does but selectively (If > i understood those OBSD fanatics at SUCON;-> correctly)..they track > at ingress before ip stack. The difference is we can allow selective > tracking; something along the lines of: This means we'd have to do the most important sanity cehcks ourselves like checksum and ip header consistencity. Which basically means a duplication of ip_rcv() and ipv6_rcv(). > tc filter add dev $DEV parent ffff: protocol ip prio 10 \ > u32 match u32 0x10000 0xff0000 at 8 \ > action track \ > action metamark here depending on whether we found contrack etc > > I have the layout scribbeled on paper somewhere .. I will look it up > and provide more details > > Track should just use iptables contracking code instead of reinventing > it. This is exactly my thinking as well but I'd do it as ematch. Given we pass the netfilter conntrack code we'd then have access to the meta data of it such as direction, state and other attributes. tc filter add dev $DEV parent ffff: protocol ip prio 10 \ u32 match u32 0x10000 0xff0000 at 8 \ and conntrack \ and meta nf_state eq ESTABLISHED \ and meta nf_status eq SEEN_REPLY \ action metamark here depending on whether we found contrack etc From au@unterluggauer.org Mon Jan 31 07:19:39 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 07:19:50 -0800 (PST) Received: from mail.unterluggauer.org (chello062178068189.23.11.vie.surfer.at [62.178.68.189]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VFJacc028344 for ; Mon, 31 Jan 2005 07:19:37 -0800 Received: from lappl.usoft.at (lappl.usoft.at [192.168.2.3]) by mail.unterluggauer.org (8.12.11/8.12.11) with ESMTP id j0VFJQ1n031536; Mon, 31 Jan 2005 16:19:26 +0100 From: Andreas Unterluggauer To: Herbert Xu Subject: Re: Fw: [Bugme-new] [Bug 4138] New: ipsec with racoon in transport mode with esp and ah hangs (problem is in xfrm_state_add) Date: Mon, 31 Jan 2005 16:19:26 +0100 User-Agent: KMail/1.6.2 References: In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200501311619.26420.au@unterluggauer.org> Cc: netdev@oss.sgi.com Content-Type: Multipart/Mixed; boundary="Boundary-00=_+xk/BkoCfSG/nsz" X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1092 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: au@unterluggauer.org Precedence: bulk X-list: netdev Content-Length: 56831 Lines: 1080 --Boundary-00=_+xk/BkoCfSG/nsz Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Herbert, > > Could you get a dump of the messages that racoon has received > and sent? That should tell us exactly what's happening. here is the output from racoon in debug-mode and with some additional messages (search for andi in the racoon.log file). I hope I put the messages in the right functions, so that you can see what is happening. for me it looks like racoon doesn't get the SADB_ACQUIRE message. if you could tell me where to put log-messages, it would be easier for me. because I am now a bit confused, who is sending and who is receving messages (from the kernel or from the remote computer or from ?). cheers andi --Boundary-00=_+xk/BkoCfSG/nsz Content-Type: text/x-log; charset="iso-8859-1"; name="racoon.log" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="racoon.log" racoon -d -F -f racoon.conf Foreground mode. 2005-01-31 15:56:46: INFO: @(#)ipsec-tools 0.5rc2 (http://ipsec-tools.sourceforge.net) 2005-01-31 15:56:46: INFO: @(#)This product linked OpenSSL 0.9.7a Feb 19 2003 (http://www.openssl.org/) 2005-01-31 15:56:46: DEBUG: call pfkey_send_register for AH andi: libipsec/pfkey.c, pfkey_setsadbmsg: (p->type: 7, p->sadb_msg_satype: 2, seq: 0) 2005-01-31 15:56:46: DEBUG: call pfkey_send_register for ESP andi: libipsec/pfkey.c, pfkey_setsadbmsg: (p->type: 7, p->sadb_msg_satype: 3, seq: 0) 2005-01-31 15:56:46: DEBUG: call pfkey_send_register for IPCOMP andi: libipsec/pfkey.c, pfkey_setsadbmsg: (p->type: 7, p->sadb_msg_satype: 9, seq: 0) andi: libipsec/pfkey.c, pfkey_setsadbmsg: (p->type: 18, p->sadb_msg_satype: 0, seq: 0) 2005-01-31 15:56:46: DEBUG: reading config file racoon.conf 2005-01-31 15:56:46: DEBUG: hmac(modp1024) 2005-01-31 15:56:46: DEBUG: compression algorithm can not be checked because sadb message doesn't support it. 2005-01-31 15:56:46: DEBUG: my interface: 127.0.0.1 (lo) 2005-01-31 15:56:46: DEBUG: my interface: 192.168.2.5 (eth0) 2005-01-31 15:56:46: DEBUG: configuring default isakmp port. 2005-01-31 15:56:46: DEBUG: 2 addrs are configured successfully 2005-01-31 15:56:46: INFO: 192.168.2.5[500] used as isakmp port (fd=6) 2005-01-31 15:56:46: INFO: 127.0.0.1[500] used as isakmp port (fd=7) 2005-01-31 15:56:46: DEBUG: get pfkey X_SPDDUMP message andi: libipsec/pfkey.c, pfkey_check: start (msg->sadb_msg_satype: 18) 2005-01-31 15:56:46: DEBUG: get pfkey X_SPDDUMP message andi: libipsec/pfkey.c, pfkey_check: start (msg->sadb_msg_satype: 18) 2005-01-31 15:56:46: DEBUG: sub:0xbfe8b150: 192.168.2.5/32[0] 192.168.2.3/32[0] proto=any dir=out 2005-01-31 15:56:46: DEBUG: db :0x9192650: 192.168.2.3/32[0] 192.168.2.5/32[0] proto=any dir=in 2005-01-31 15:56:46: DEBUG: get pfkey X_SPDDUMP message andi: libipsec/pfkey.c, pfkey_check: start (msg->sadb_msg_satype: 18) 2005-01-31 15:56:46: DEBUG: sub:0xbfe8b150: 192.168.2.3/32[0] 192.168.2.5/32[0] proto=any dir=fwd 2005-01-31 15:56:46: DEBUG: db :0x9192650: 192.168.2.3/32[0] 192.168.2.5/32[0] proto=any dir=in 2005-01-31 15:56:46: DEBUG: sub:0xbfe8b150: 192.168.2.3/32[0] 192.168.2.5/32[0] proto=any dir=fwd 2005-01-31 15:56:46: DEBUG: db :0x91929a8: 192.168.2.5/32[0] 192.168.2.3/32[0] proto=any dir=out 2005-01-31 15:56:52: DEBUG: === 2005-01-31 15:56:52: DEBUG: 80 bytes message received from 192.168.2.3[500] to 192.168.2.5[500] 2005-01-31 15:56:52: DEBUG: 1b3a78e3 adfafb1d 00000000 00000000 01100200 00000000 00000050 00000034 00000001 00000001 00000028 01010001 00000020 01010000 800b0001 800c1c20 80010005 80030001 80020002 80040002 2005-01-31 15:56:52: DEBUG: anonymous configuration selected for 192.168.2.3[500]. 2005-01-31 15:56:52: DEBUG: === 2005-01-31 15:56:52: INFO: respond new phase 1 negotiation: 192.168.2.5[500]<=>192.168.2.3[500] 2005-01-31 15:56:52: INFO: begin Identity Protection mode. 2005-01-31 15:56:52: DEBUG: begin. 2005-01-31 15:56:52: DEBUG: seen nptype=1(sa) 2005-01-31 15:56:52: DEBUG: succeed. 2005-01-31 15:56:52: DEBUG: total SA len=48 2005-01-31 15:56:52: DEBUG: 00000001 00000001 00000028 01010001 00000020 01010000 800b0001 800c1c20 80010005 80030001 80020002 80040002 2005-01-31 15:56:52: DEBUG: begin. 2005-01-31 15:56:52: DEBUG: seen nptype=2(prop) 2005-01-31 15:56:52: DEBUG: succeed. 2005-01-31 15:56:52: DEBUG: proposal #1 len=40 2005-01-31 15:56:52: DEBUG: begin. 2005-01-31 15:56:52: DEBUG: seen nptype=3(trns) 2005-01-31 15:56:52: DEBUG: succeed. 2005-01-31 15:56:52: DEBUG: transform #1 len=32 2005-01-31 15:56:52: DEBUG: type=Life Type, flag=0x8000, lorv=seconds 2005-01-31 15:56:52: DEBUG: type=Life Duration, flag=0x8000, lorv=7200 2005-01-31 15:56:52: DEBUG: type=Encryption Algorithm, flag=0x8000, lorv=3DES-CBC 2005-01-31 15:56:52: DEBUG: encryption(3des) 2005-01-31 15:56:52: DEBUG: type=Authentication Method, flag=0x8000, lorv=pre-shared key 2005-01-31 15:56:52: DEBUG: type=Hash Algorithm, flag=0x8000, lorv=SHA 2005-01-31 15:56:52: DEBUG: hash(sha1) 2005-01-31 15:56:52: DEBUG: type=Group Description, flag=0x8000, lorv=1024-bit MODP group 2005-01-31 15:56:52: DEBUG: hmac(modp1024) 2005-01-31 15:56:52: DEBUG: pair 1: 2005-01-31 15:56:52: DEBUG: 0x9193600: next=(nil) tnext=(nil) 2005-01-31 15:56:52: DEBUG: proposal #1: 1 transform 2005-01-31 15:56:52: DEBUG: prop#=1, prot-id=ISAKMP, spi-size=0, #trns=1 2005-01-31 15:56:52: DEBUG: trns#=1, trns-id=IKE 2005-01-31 15:56:52: DEBUG: type=Life Type, flag=0x8000, lorv=seconds 2005-01-31 15:56:52: DEBUG: type=Life Duration, flag=0x8000, lorv=7200 2005-01-31 15:56:52: DEBUG: type=Encryption Algorithm, flag=0x8000, lorv=3DES-CBC 2005-01-31 15:56:52: DEBUG: type=Authentication Method, flag=0x8000, lorv=pre-shared key 2005-01-31 15:56:52: DEBUG: type=Hash Algorithm, flag=0x8000, lorv=SHA 2005-01-31 15:56:52: DEBUG: type=Group Description, flag=0x8000, lorv=1024-bit MODP group 2005-01-31 15:56:52: DEBUG: Compared: DB:Peer 2005-01-31 15:56:52: DEBUG: (lifetime = 7200:7200) 2005-01-31 15:56:52: DEBUG: (lifebyte = 0:0) 2005-01-31 15:56:52: DEBUG: enctype = 3DES-CBC:3DES-CBC 2005-01-31 15:56:52: DEBUG: (encklen = 0:0) 2005-01-31 15:56:52: DEBUG: hashtype = SHA:SHA 2005-01-31 15:56:52: DEBUG: authmethod = pre-shared key:pre-shared key 2005-01-31 15:56:52: DEBUG: dh_group = 1024-bit MODP group:1024-bit MODP group 2005-01-31 15:56:52: DEBUG: an acceptable proposal found. 2005-01-31 15:56:52: DEBUG: hmac(modp1024) 2005-01-31 15:56:52: DEBUG: new cookie: c0e4d647591c43f6 2005-01-31 15:56:52: DEBUG: add payload of len 48, next type 0 2005-01-31 15:56:52: DEBUG: 80 bytes from 192.168.2.5[500] to 192.168.2.3[500] 2005-01-31 15:56:52: DEBUG: sockname 192.168.2.5[500] 2005-01-31 15:56:52: DEBUG: send packet from 192.168.2.5[500] 2005-01-31 15:56:52: DEBUG: send packet to 192.168.2.3[500] 2005-01-31 15:56:52: DEBUG: src4 192.168.2.5[500] 2005-01-31 15:56:52: DEBUG: dst4 192.168.2.3[500] 2005-01-31 15:56:52: DEBUG: 1 times of 80 bytes message will be sent to 192.168.2.5[500] 2005-01-31 15:56:52: DEBUG: 1b3a78e3 adfafb1d c0e4d647 591c43f6 01100200 00000000 00000050 00000034 00000001 00000001 00000028 01010001 00000020 01010000 800b0001 800c1c20 80010005 80030001 80020002 80040002 2005-01-31 15:56:52: DEBUG: resend phase1 packet 1b3a78e3adfafb1d:c0e4d647591c43f6 2005-01-31 15:56:52: DEBUG: === 2005-01-31 15:56:52: DEBUG: 180 bytes message received from 192.168.2.3[500] to 192.168.2.5[500] 2005-01-31 15:56:52: DEBUG: 1b3a78e3 adfafb1d c0e4d647 591c43f6 04100200 00000000 000000b4 0a000084 7e6539fc f1e5d843 e5e77841 a3e8562d 8d49a26c 7279e895 af794c1d e8eb0bd0 073acf4d 520f6e56 70a123e5 789ac09d 1bdde2a9 a2ca6814 75be799b fc60dace 7dd2b091 7d486705 ddc2ae18 f87797e2 495fa031 2e9d2e1d df8c2eb2 11fe091f f3794ef4 f4fa6e19 1715f997 15b7d613 e0d4c777 425f26c5 b77a420c 8906b0a2 00000014 c2e23705 244b2fb6 8fa0c213 df495ed8 2005-01-31 15:56:52: DEBUG: begin. 2005-01-31 15:56:52: DEBUG: seen nptype=4(ke) 2005-01-31 15:56:52: DEBUG: seen nptype=10(nonce) 2005-01-31 15:56:52: DEBUG: succeed. 2005-01-31 15:56:52: DEBUG: === 2005-01-31 15:56:52: DEBUG: compute DH's private. 2005-01-31 15:56:52: DEBUG: 48c34747 1757c555 37772022 1b14a024 5358d9c0 ff09aed6 250d7525 4d45a4c1 a59bcd10 01bcbca0 57f10f3a a14a50a8 fb1758e7 3453370c 46f12224 0c48206c 06c00254 45fe7405 dfdd58d4 002d8e3d fc731391 cab96722 13787a33 48e2d95b 92439d45 48220000 e7b628ad 00c7c014 e41f310e 1ecc829d 9a9fee67 6ca8833c 2005-01-31 15:56:52: DEBUG: compute DH's public. 2005-01-31 15:56:52: DEBUG: 000000e4 d2ceeb13 d25e222f 5fc19a6f c0527b9a 9372e63b a3409c24 de2330dc 27e26b95 fe8fbfc3 c7f7e82a c41060b0 0fa76fc6 851a8add e98ec402 c0a50f61 c293aaac 74966752 63e7b471 873705a3 08cb9231 a8b2bd40 dbb78a98 2a57d60f 52c9b8f2 3c431703 257466a7 5fb7e8a6 cec76b84 8b12b933 4e33146d 17668783 2005-01-31 15:56:52: DEBUG: add payload of len 128, next type 10 2005-01-31 15:56:52: DEBUG: add payload of len 16, next type 0 2005-01-31 15:56:52: DEBUG: 180 bytes from 192.168.2.5[500] to 192.168.2.3[500] 2005-01-31 15:56:52: DEBUG: sockname 192.168.2.5[500] 2005-01-31 15:56:52: DEBUG: send packet from 192.168.2.5[500] 2005-01-31 15:56:52: DEBUG: send packet to 192.168.2.3[500] 2005-01-31 15:56:52: DEBUG: src4 192.168.2.5[500] 2005-01-31 15:56:52: DEBUG: dst4 192.168.2.3[500] 2005-01-31 15:56:52: DEBUG: 1 times of 180 bytes message will be sent to 192.168.2.5[500] 2005-01-31 15:56:52: DEBUG: 1b3a78e3 adfafb1d c0e4d647 591c43f6 04100200 00000000 000000b4 0a000084 000000e4 d2ceeb13 d25e222f 5fc19a6f c0527b9a 9372e63b a3409c24 de2330dc 27e26b95 fe8fbfc3 c7f7e82a c41060b0 0fa76fc6 851a8add e98ec402 c0a50f61 c293aaac 74966752 63e7b471 873705a3 08cb9231 a8b2bd40 dbb78a98 2a57d60f 52c9b8f2 3c431703 257466a7 5fb7e8a6 cec76b84 8b12b933 4e33146d 17668783 00000014 babea1e6 12f9e644 1aaae71b 39a25d9e 2005-01-31 15:56:52: DEBUG: resend phase1 packet 1b3a78e3adfafb1d:c0e4d647591c43f6 2005-01-31 15:56:52: DEBUG: compute DH's shared. 2005-01-31 15:56:52: DEBUG: a28217a0 366249d5 6f519ac5 24f256d1 0964e10e caf3f872 cf14981d 4b5037b0 493e1826 8a9773ee 693bacf8 9619b9cf f36ed130 a4b8f482 b67dbfd9 4f10ad5e de69a7c6 9ddaee2e 6d15c84d e4cc9d77 8c823392 ce82a7e5 f1ef12c7 bd82a50d c4a42b6f ae58044e 1b836bd3 27fdfaec 26396c66 748411c6 1e896955 7827f2f3 2005-01-31 15:56:52: DEBUG: the psk found. 2005-01-31 15:56:52: DEBUG: nonce 1: 2005-01-31 15:56:52: DEBUG: c2e23705 244b2fb6 8fa0c213 df495ed8 2005-01-31 15:56:52: DEBUG: nonce 2: 2005-01-31 15:56:52: DEBUG: babea1e6 12f9e644 1aaae71b 39a25d9e 2005-01-31 15:56:52: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:52: DEBUG: SKEYID computed: 2005-01-31 15:56:52: DEBUG: 52e7e3bd 23f090dc 437806d9 f2d066e7 712fa970 2005-01-31 15:56:52: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:52: DEBUG: SKEYID_d computed: 2005-01-31 15:56:52: DEBUG: 7b9f85ad 24187eb8 4f9a2d0c fa112b7d be1e8bb8 2005-01-31 15:56:52: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:52: DEBUG: SKEYID_a computed: 2005-01-31 15:56:52: DEBUG: c404a559 37883e79 71bd9bfd e1102feb d590079f 2005-01-31 15:56:52: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:52: DEBUG: SKEYID_e computed: 2005-01-31 15:56:52: DEBUG: 9d97fadd a756e74f 7ae20cc2 abcf8c69 995d10ac 2005-01-31 15:56:52: DEBUG: encryption(3des) 2005-01-31 15:56:52: DEBUG: hash(sha1) 2005-01-31 15:56:52: DEBUG: len(SKEYID_e) < len(Ka) (20 < 24), generating long key (Ka = K1 | K2 | ...) 2005-01-31 15:56:52: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:52: DEBUG: compute intermediate encryption key K1 2005-01-31 15:56:52: DEBUG: 00 2005-01-31 15:56:52: DEBUG: 5a7c9253 3da7ec0c a029a28f 5d4bfbbb d0730ef7 2005-01-31 15:56:52: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:52: DEBUG: compute intermediate encryption key K2 2005-01-31 15:56:52: DEBUG: 5a7c9253 3da7ec0c a029a28f 5d4bfbbb d0730ef7 2005-01-31 15:56:52: DEBUG: 5b24dc57 d13355e0 05619375 4ca1867a 78e577a6 2005-01-31 15:56:52: DEBUG: final encryption key computed: 2005-01-31 15:56:52: DEBUG: 5a7c9253 3da7ec0c a029a28f 5d4bfbbb d0730ef7 5b24dc57 2005-01-31 15:56:52: DEBUG: hash(sha1) 2005-01-31 15:56:52: DEBUG: encryption(3des) 2005-01-31 15:56:52: DEBUG: IV computed: 2005-01-31 15:56:52: DEBUG: dfabb8a1 669e3464 2005-01-31 15:56:52: DEBUG: === 2005-01-31 15:56:52: DEBUG: 68 bytes message received from 192.168.2.3[500] to 192.168.2.5[500] 2005-01-31 15:56:52: DEBUG: 1b3a78e3 adfafb1d c0e4d647 591c43f6 05100201 00000000 00000044 ad20bf06 c242b46e 96fb63cd c87a73c5 dd82fb4a f0dc20b7 0123e607 8071e97e 3930d6b6 7cfb6911 2005-01-31 15:56:52: DEBUG: begin decryption. 2005-01-31 15:56:52: DEBUG: encryption(3des) 2005-01-31 15:56:52: DEBUG: IV was saved for next processing: 2005-01-31 15:56:52: DEBUG: 3930d6b6 7cfb6911 2005-01-31 15:56:52: DEBUG: encryption(3des) 2005-01-31 15:56:52: DEBUG: with key: 2005-01-31 15:56:52: DEBUG: 5a7c9253 3da7ec0c a029a28f 5d4bfbbb d0730ef7 5b24dc57 2005-01-31 15:56:52: DEBUG: decrypted payload by IV: 2005-01-31 15:56:52: DEBUG: dfabb8a1 669e3464 2005-01-31 15:56:52: DEBUG: decrypted payload, but not trimed. 2005-01-31 15:56:52: DEBUG: 0800000c 011101f4 c0a80203 00000018 4ba6bc99 869b2231 74dc9ed4 26982126 c9666eaf 8591e803 2005-01-31 15:56:52: DEBUG: padding len=4 2005-01-31 15:56:52: DEBUG: skip to trim padding. 2005-01-31 15:56:52: DEBUG: decrypted. 2005-01-31 15:56:52: DEBUG: 1b3a78e3 adfafb1d c0e4d647 591c43f6 05100201 00000000 00000044 0800000c 011101f4 c0a80203 00000018 4ba6bc99 869b2231 74dc9ed4 26982126 c9666eaf 8591e803 2005-01-31 15:56:52: DEBUG: begin. 2005-01-31 15:56:52: DEBUG: seen nptype=5(id) 2005-01-31 15:56:52: DEBUG: seen nptype=8(hash) 2005-01-31 15:56:52: DEBUG: succeed. 2005-01-31 15:56:52: DEBUG: HASH received:2005-01-31 15:56:52: DEBUG: 4ba6bc99 869b2231 74dc9ed4 26982126 c9666eaf 2005-01-31 15:56:52: DEBUG: HASH with: 2005-01-31 15:56:52: DEBUG: 7e6539fc f1e5d843 e5e77841 a3e8562d 8d49a26c 7279e895 af794c1d e8eb0bd0 073acf4d 520f6e56 70a123e5 789ac09d 1bdde2a9 a2ca6814 75be799b fc60dace 7dd2b091 7d486705 ddc2ae18 f87797e2 495fa031 2e9d2e1d df8c2eb2 11fe091f f3794ef4 f4fa6e19 1715f997 15b7d613 e0d4c777 425f26c5 b77a420c 8906b0a2 000000e4 d2ceeb13 d25e222f 5fc19a6f c0527b9a 9372e63b a3409c24 de2330dc 27e26b95 fe8fbfc3 c7f7e82a c41060b0 0fa76fc6 851a8add e98ec402 c0a50f61 c293aaac 74966752 63e7b471 873705a3 08cb9231 a8b2bd40 dbb78a98 2a57d60f 52c9b8f2 3c431703 257466a7 5fb7e8a6 cec76b84 8b12b933 4e33146d 17668783 1b3a78e3 adfafb1d c0e4d647 591c43f6 00000001 00000001 00000028 01010001 00000020 01010000 800b0001 800c1c20 80010005 80030001 80020002 80040002 011101f4 c0a80203 2005-01-31 15:56:52: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:52: DEBUG: HASH computed: 2005-01-31 15:56:52: DEBUG: 4ba6bc99 869b2231 74dc9ed4 26982126 c9666eaf 2005-01-31 15:56:52: DEBUG: HASH for PSK validated. 2005-01-31 15:56:52: DEBUG: peer's ID 2005-01-31 15:56:52: DEBUG: 011101f4 c0a80203 2005-01-31 15:56:52: DEBUG: === 2005-01-31 15:56:52: DEBUG: use ID type of IPv4_address 2005-01-31 15:56:52: DEBUG: generate HASH_R 2005-01-31 15:56:52: DEBUG: HASH with: 2005-01-31 15:56:52: DEBUG: 000000e4 d2ceeb13 d25e222f 5fc19a6f c0527b9a 9372e63b a3409c24 de2330dc 27e26b95 fe8fbfc3 c7f7e82a c41060b0 0fa76fc6 851a8add e98ec402 c0a50f61 c293aaac 74966752 63e7b471 873705a3 08cb9231 a8b2bd40 dbb78a98 2a57d60f 52c9b8f2 3c431703 257466a7 5fb7e8a6 cec76b84 8b12b933 4e33146d 17668783 7e6539fc f1e5d843 e5e77841 a3e8562d 8d49a26c 7279e895 af794c1d e8eb0bd0 073acf4d 520f6e56 70a123e5 789ac09d 1bdde2a9 a2ca6814 75be799b fc60dace 7dd2b091 7d486705 ddc2ae18 f87797e2 495fa031 2e9d2e1d df8c2eb2 11fe091f f3794ef4 f4fa6e19 1715f997 15b7d613 e0d4c777 425f26c5 b77a420c 8906b0a2 c0e4d647 591c43f6 1b3a78e3 adfafb1d 00000001 00000001 00000028 01010001 00000020 01010000 800b0001 800c1c20 80010005 80030001 80020002 80040002 011101f4 c0a80205 2005-01-31 15:56:52: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:52: DEBUG: HASH computed: 2005-01-31 15:56:52: DEBUG: c14bac70 06f1d8de 4972451b e297ec65 e65b784c 2005-01-31 15:56:52: DEBUG: add payload of len 8, next type 8 2005-01-31 15:56:52: DEBUG: add payload of len 20, next type 0 2005-01-31 15:56:52: DEBUG: begin encryption. 2005-01-31 15:56:52: DEBUG: encryption(3des) 2005-01-31 15:56:52: DEBUG: pad length = 4 2005-01-31 15:56:52: DEBUG: 0800000c 011101f4 c0a80205 00000018 c14bac70 06f1d8de 4972451b e297ec65 e65b784c a4cc8c03 2005-01-31 15:56:52: DEBUG: encryption(3des) 2005-01-31 15:56:52: DEBUG: with key: 2005-01-31 15:56:52: DEBUG: 5a7c9253 3da7ec0c a029a28f 5d4bfbbb d0730ef7 5b24dc57 2005-01-31 15:56:52: DEBUG: encrypted payload by IV: 2005-01-31 15:56:52: DEBUG: 3930d6b6 7cfb6911 2005-01-31 15:56:52: DEBUG: save IV for next: 2005-01-31 15:56:52: DEBUG: d0b3dc22 1d31f2d0 2005-01-31 15:56:52: DEBUG: encrypted. 2005-01-31 15:56:52: DEBUG: 68 bytes from 192.168.2.5[500] to 192.168.2.3[500] 2005-01-31 15:56:52: DEBUG: sockname 192.168.2.5[500] 2005-01-31 15:56:52: DEBUG: send packet from 192.168.2.5[500] 2005-01-31 15:56:52: DEBUG: send packet to 192.168.2.3[500] 2005-01-31 15:56:52: DEBUG: src4 192.168.2.5[500] 2005-01-31 15:56:52: DEBUG: dst4 192.168.2.3[500] 2005-01-31 15:56:52: DEBUG: 1 times of 68 bytes message will be sent to 192.168.2.5[500] 2005-01-31 15:56:52: DEBUG: 1b3a78e3 adfafb1d c0e4d647 591c43f6 05100201 00000000 00000044 f654f8e5 82c1a183 3e0724b9 4a5c7c9a 2dd8d5ed 0a442025 b256eb40 26eb90d1 d0b3dc22 1d31f2d0 2005-01-31 15:56:52: DEBUG: compute IV for phase2 2005-01-31 15:56:52: DEBUG: phase1 last IV: 2005-01-31 15:56:52: DEBUG: d0b3dc22 1d31f2d0 c526736e 2005-01-31 15:56:52: DEBUG: hash(sha1) 2005-01-31 15:56:52: DEBUG: encryption(3des) 2005-01-31 15:56:52: DEBUG: phase2 IV computed: 2005-01-31 15:56:52: DEBUG: ecb15503 ffc9819e 2005-01-31 15:56:52: DEBUG: HASH with: 2005-01-31 15:56:52: DEBUG: c526736e 0000001c 00000001 01106002 1b3a78e3 adfafb1d c0e4d647 591c43f6 2005-01-31 15:56:52: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:52: DEBUG: HASH computed: 2005-01-31 15:56:52: DEBUG: 7eae471b 9a17c55c 1010011f 5f59721a 681f2928 2005-01-31 15:56:52: DEBUG: begin encryption. 2005-01-31 15:56:52: DEBUG: encryption(3des) 2005-01-31 15:56:52: DEBUG: pad length = 4 2005-01-31 15:56:52: DEBUG: 0b000018 7eae471b 9a17c55c 1010011f 5f59721a 681f2928 0000001c 00000001 01106002 1b3a78e3 adfafb1d c0e4d647 591c43f6 94e0db03 2005-01-31 15:56:52: DEBUG: encryption(3des) 2005-01-31 15:56:52: DEBUG: with key: 2005-01-31 15:56:52: DEBUG: 5a7c9253 3da7ec0c a029a28f 5d4bfbbb d0730ef7 5b24dc57 2005-01-31 15:56:52: DEBUG: encrypted payload by IV: 2005-01-31 15:56:52: DEBUG: ecb15503 ffc9819e 2005-01-31 15:56:52: DEBUG: save IV for next: 2005-01-31 15:56:52: DEBUG: 9f28ddb4 d437e77a 2005-01-31 15:56:52: DEBUG: encrypted. 2005-01-31 15:56:52: DEBUG: 84 bytes from 192.168.2.5[500] to 192.168.2.3[500] 2005-01-31 15:56:52: DEBUG: sockname 192.168.2.5[500] 2005-01-31 15:56:52: DEBUG: send packet from 192.168.2.5[500] 2005-01-31 15:56:52: DEBUG: send packet to 192.168.2.3[500] 2005-01-31 15:56:52: DEBUG: src4 192.168.2.5[500] 2005-01-31 15:56:52: DEBUG: dst4 192.168.2.3[500] 2005-01-31 15:56:52: DEBUG: 1 times of 84 bytes message will be sent to 192.168.2.5[500] 2005-01-31 15:56:52: DEBUG: 1b3a78e3 adfafb1d c0e4d647 591c43f6 08100501 c526736e 00000054 acc30f7e 33aa64d5 60b46418 f70cc8f7 18e13f5f 2f992c8e 98fb1326 a9944a07 92f6e1af e61015e8 3a323d1d caab1e48 9f28ddb4 d437e77a 2005-01-31 15:56:52: DEBUG: sendto Information notify. 2005-01-31 15:56:52: INFO: ISAKMP-SA established 192.168.2.5[500]-192.168.2.3[500] spi:1b3a78e3adfafb1d:c0e4d647591c43f6 2005-01-31 15:56:52: DEBUG: === 2005-01-31 15:56:52: DEBUG: === 2005-01-31 15:56:52: DEBUG: 84 bytes message received from 192.168.2.3[500] to 192.168.2.5[500] 2005-01-31 15:56:52: DEBUG: 1b3a78e3 adfafb1d c0e4d647 591c43f6 08100501 d9b420b1 00000054 0b062d5f 65c48bb1 f1f97d55 7a63f3d2 b1f3ce52 08e18c9d 046a9522 f17660de 412b67f8 6fb2edca 729bc018 c252ecb1 c5f19ec7 155d9b78 2005-01-31 15:56:52: DEBUG: receive Information. 2005-01-31 15:56:52: DEBUG: compute IV for phase2 2005-01-31 15:56:52: DEBUG: phase1 last IV: 2005-01-31 15:56:52: DEBUG: d0b3dc22 1d31f2d0 d9b420b1 2005-01-31 15:56:52: DEBUG: hash(sha1) 2005-01-31 15:56:52: DEBUG: encryption(3des) 2005-01-31 15:56:52: DEBUG: phase2 IV computed: 2005-01-31 15:56:52: DEBUG: 0a67a66c d95a02d0 2005-01-31 15:56:52: DEBUG: begin decryption. 2005-01-31 15:56:52: DEBUG: encryption(3des) 2005-01-31 15:56:52: DEBUG: IV was saved for next processing: 2005-01-31 15:56:52: DEBUG: c5f19ec7 155d9b78 2005-01-31 15:56:52: DEBUG: encryption(3des) 2005-01-31 15:56:52: DEBUG: with key: 2005-01-31 15:56:52: DEBUG: 5a7c9253 3da7ec0c a029a28f 5d4bfbbb d0730ef7 5b24dc57 2005-01-31 15:56:52: DEBUG: decrypted payload by IV: 2005-01-31 15:56:52: DEBUG: 0a67a66c d95a02d0 2005-01-31 15:56:52: DEBUG: decrypted payload, but not trimed. 2005-01-31 15:56:52: DEBUG: 0b000018 94d84a48 99b0dc57 96900dd9 cf0da364 ef1fada0 0000001c 00000001 01106002 1b3a78e3 adfafb1d c0e4d647 591c43f6 d8c0e303 2005-01-31 15:56:52: DEBUG: padding len=4 2005-01-31 15:56:52: DEBUG: skip to trim padding. 2005-01-31 15:56:52: DEBUG: decrypted. 2005-01-31 15:56:52: DEBUG: 1b3a78e3 adfafb1d c0e4d647 591c43f6 08100501 d9b420b1 00000054 0b000018 94d84a48 99b0dc57 96900dd9 cf0da364 ef1fada0 0000001c 00000001 01106002 1b3a78e3 adfafb1d c0e4d647 591c43f6 d8c0e303 2005-01-31 15:56:52: DEBUG: HASH with: 2005-01-31 15:56:52: DEBUG: d9b420b1 0000001c 00000001 01106002 1b3a78e3 adfafb1d c0e4d647 591c43f6 2005-01-31 15:56:52: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:52: DEBUG: HASH computed: 2005-01-31 15:56:52: DEBUG: 94d84a48 99b0dc57 96900dd9 cf0da364 ef1fada0 2005-01-31 15:56:52: DEBUG: hash validated. 2005-01-31 15:56:52: DEBUG: begin. 2005-01-31 15:56:52: DEBUG: seen nptype=8(hash) 2005-01-31 15:56:52: DEBUG: seen nptype=11(notify) 2005-01-31 15:56:52: DEBUG: succeed. 2005-01-31 15:56:52: DEBUG: call pfkey_send_dump andi: libipsec/pfkey.c, pfkey_setsadbmsg: (p->type: 10, p->sadb_msg_satype: 0, seq: 0) andi: libipsec/pfkey.c, pfkey_check: start (msg->sadb_msg_satype: 10) 2005-01-31 15:56:52: DEBUG: notification message 24578:INITIAL-CONTACT, doi=1 proto_id=1 spi=1b3a78e3adfafb1d c0e4d647591c43f6 (size=16). 2005-01-31 15:56:53: DEBUG: === 2005-01-31 15:56:53: DEBUG: 300 bytes message received from 192.168.2.3[500] to 192.168.2.5[500] 2005-01-31 15:56:53: DEBUG: 1b3a78e3 adfafb1d c0e4d647 591c43f6 08102001 f165fca7 0000012c dcfeb0b2 e0b2eccd ea3f08ad 69fe90b4 8bd46e67 9879b11f e767fd68 635c7608 b0479c72 e61639f9 1dbdeb22 38e0764e f781131b 7cf18203 24888306 9bb1ed29 16a9d44f 573124d8 f45ab587 982f0184 89d26499 8312d6cf 7383357e a592a161 f53c9ec6 6befbcf8 a7ea3cc2 79b54188 c013c058 56064703 ab6bf3b3 d88dcf8d 585acba2 999b4d38 cf28dc13 001eee0d 87ef22e4 2af56a81 be66df06 da579520 a1438911 a484cf3c 84f08206 76b16b3e ef272d4a 356ee6c1 57eab6a7 bb50bde2 ee149222 75219866 0beca2c9 42be153c 7e45ed2f 8a722ab5 6d43377f 08520ace 3a87a070 40920c00 a6578bf9 a6ba7809 6334d3fa 20666cc6 5f6d88b1 424cec6d f2559408 f176b3b7 f0e213b8 d6423ed8 2005-01-31 15:56:53: INFO: andi: in isakmp.c, isakmp_ph2begin_r: iph2->seq 369749501 2005-01-31 15:56:53: DEBUG: compute IV for phase2 2005-01-31 15:56:53: DEBUG: phase1 last IV: 2005-01-31 15:56:53: DEBUG: d0b3dc22 1d31f2d0 f165fca7 2005-01-31 15:56:53: DEBUG: hash(sha1) 2005-01-31 15:56:53: DEBUG: encryption(3des) 2005-01-31 15:56:53: DEBUG: phase2 IV computed: 2005-01-31 15:56:53: DEBUG: 85f7a521 c958f031 2005-01-31 15:56:53: DEBUG: === 2005-01-31 15:56:53: INFO: respond new phase 2 negotiation: 192.168.2.5[0]<=>192.168.2.3[0] 2005-01-31 15:56:53: DEBUG: begin decryption. 2005-01-31 15:56:53: DEBUG: encryption(3des) 2005-01-31 15:56:53: DEBUG: IV was saved for next processing: 2005-01-31 15:56:53: DEBUG: f0e213b8 d6423ed8 2005-01-31 15:56:53: DEBUG: encryption(3des) 2005-01-31 15:56:53: DEBUG: with key: 2005-01-31 15:56:53: DEBUG: 5a7c9253 3da7ec0c a029a28f 5d4bfbbb d0730ef7 5b24dc57 2005-01-31 15:56:53: DEBUG: decrypted payload by IV: 2005-01-31 15:56:53: DEBUG: 85f7a521 c958f031 2005-01-31 15:56:53: DEBUG: decrypted payload, but not trimed. 2005-01-31 15:56:53: DEBUG: 01000018 17618673 472d64d3 bfc732ce 2b439a02 edfda95d 0a00005c 00000001 00000001 02000028 01020401 00fea865 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 00000028 01030401 06aff78a 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 04000014 c7d64915 bdd7f74e 89c2ca14 e9b1ddb5 00000084 416fb889 f849ba95 60f85d54 7ac2cee5 d84b7c30 0e318740 b0ae8f43 e64168ae 82498bb9 1e87fb24 cce327a2 8932a0a4 60fae7cd fff242cb 115df7f2 4ff5e26a 2eddd093 089d2f4a a0664b60 c81b0dfe adf8934b bad975a1 39801e4f 19dd64a6 e5cf684f 4fab2a8e fcb359e2 14c9ba33 6b547e53 b202a193 0c045aed 00557972 809ddf03 2005-01-31 15:56:53: DEBUG: padding len=4 2005-01-31 15:56:53: DEBUG: skip to trim padding. 2005-01-31 15:56:53: DEBUG: decrypted. 2005-01-31 15:56:53: DEBUG: 1b3a78e3 adfafb1d c0e4d647 591c43f6 08102001 f165fca7 0000012c 01000018 17618673 472d64d3 bfc732ce 2b439a02 edfda95d 0a00005c 00000001 00000001 02000028 01020401 00fea865 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 00000028 01030401 06aff78a 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 04000014 c7d64915 bdd7f74e 89c2ca14 e9b1ddb5 00000084 416fb889 f849ba95 60f85d54 7ac2cee5 d84b7c30 0e318740 b0ae8f43 e64168ae 82498bb9 1e87fb24 cce327a2 8932a0a4 60fae7cd fff242cb 115df7f2 4ff5e26a 2eddd093 089d2f4a a0664b60 c81b0dfe adf8934b bad975a1 39801e4f 19dd64a6 e5cf684f 4fab2a8e fcb359e2 14c9ba33 6b547e53 b202a193 0c045aed 00557972 809ddf03 2005-01-31 15:56:53: DEBUG: begin. 2005-01-31 15:56:53: DEBUG: seen nptype=8(hash) 2005-01-31 15:56:53: DEBUG: seen nptype=1(sa) 2005-01-31 15:56:53: DEBUG: seen nptype=10(nonce) 2005-01-31 15:56:53: DEBUG: seen nptype=4(ke) 2005-01-31 15:56:53: DEBUG: succeed. 2005-01-31 15:56:53: DEBUG: HASH(1) validate:2005-01-31 15:56:53: DEBUG: 17618673 472d64d3 bfc732ce 2b439a02 edfda95d 2005-01-31 15:56:53: DEBUG: HASH with: 2005-01-31 15:56:53: DEBUG: f165fca7 0a00005c 00000001 00000001 02000028 01020401 00fea865 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 00000028 01030401 06aff78a 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 04000014 c7d64915 bdd7f74e 89c2ca14 e9b1ddb5 00000084 416fb889 f849ba95 60f85d54 7ac2cee5 d84b7c30 0e318740 b0ae8f43 e64168ae 82498bb9 1e87fb24 cce327a2 8932a0a4 60fae7cd fff242cb 115df7f2 4ff5e26a 2eddd093 089d2f4a a0664b60 c81b0dfe adf8934b bad975a1 39801e4f 19dd64a6 e5cf684f 4fab2a8e fcb359e2 14c9ba33 6b547e53 b202a193 0c045aed 00557972 2005-01-31 15:56:53: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:53: DEBUG: HASH computed: 2005-01-31 15:56:53: DEBUG: 17618673 472d64d3 bfc732ce 2b439a02 edfda95d 2005-01-31 15:56:53: DEBUG: anonymous sainfo selected. 2005-01-31 15:56:53: DEBUG: get sa info: anonymous 2005-01-31 15:56:53: DEBUG: get a destination address of SP index from phase1 address due to no ID payloads found OR because ID type is not address. 2005-01-31 15:56:53: DEBUG: get a source address of SP index from phase1 address due to no ID payloads found OR because ID type is not address. 2005-01-31 15:56:53: DEBUG: get a src address from ID payload 192.168.2.3[0] prefixlen=32 ul_proto=0 2005-01-31 15:56:53: DEBUG: get dst address from ID payload 192.168.2.5[0] prefixlen=32 ul_proto=0 2005-01-31 15:56:53: DEBUG: sub:0xbfe8afc0: 192.168.2.3/32[0] 192.168.2.5/32[0] proto=any dir=in 2005-01-31 15:56:53: DEBUG: db: 0x9192650: 192.168.2.3/32[0] 192.168.2.5/32[0] proto=any dir=in 2005-01-31 15:56:53: DEBUG: 0xbfe8afc0 masked with /32: 192.168.2.3[0] 2005-01-31 15:56:53: DEBUG: 0x9192650 masked with /32: 192.168.2.3[0] 2005-01-31 15:56:53: DEBUG: 0xbfe8afc0 masked with /32: 192.168.2.5[0] 2005-01-31 15:56:53: DEBUG: 0x9192650 masked with /32: 192.168.2.5[0] 2005-01-31 15:56:53: DEBUG: sub:0xbfe8afc0: 192.168.2.5/32[0] 192.168.2.3/32[0] proto=any dir=out 2005-01-31 15:56:53: DEBUG: db: 0x9192650: 192.168.2.3/32[0] 192.168.2.5/32[0] proto=any dir=in 2005-01-31 15:56:53: DEBUG: sub:0xbfe8afc0: 192.168.2.5/32[0] 192.168.2.3/32[0] proto=any dir=out 2005-01-31 15:56:53: DEBUG: db: 0x91929a8: 192.168.2.5/32[0] 192.168.2.3/32[0] proto=any dir=out 2005-01-31 15:56:53: DEBUG: 0xbfe8afc0 masked with /32: 192.168.2.5[0] 2005-01-31 15:56:53: DEBUG: 0x91929a8 masked with /32: 192.168.2.5[0] 2005-01-31 15:56:53: DEBUG: 0xbfe8afc0 masked with /32: 192.168.2.3[0] 2005-01-31 15:56:53: DEBUG: 0x91929a8 masked with /32: 192.168.2.3[0] 2005-01-31 15:56:53: DEBUG: suitable SP found:192.168.2.5/32[0] 192.168.2.3/32[0] proto=any dir=out 2005-01-31 15:56:53: DEBUG: (proto_id=AH spisize=4 spi=00000000 spi_p=00000000 encmode=Transport reqid=0:0) 2005-01-31 15:56:53: DEBUG: (trns_id=SHA authtype=hmac-sha) 2005-01-31 15:56:53: DEBUG: (proto_id=ESP spisize=4 spi=00000000 spi_p=00000000 encmode=Transport reqid=0:0) 2005-01-31 15:56:53: DEBUG: (trns_id=3DES encklen=0 authtype=hmac-sha) 2005-01-31 15:56:53: DEBUG: total SA len=88 2005-01-31 15:56:53: DEBUG: 00000001 00000001 02000028 01020401 00fea865 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 00000028 01030401 06aff78a 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 2005-01-31 15:56:53: DEBUG: begin. 2005-01-31 15:56:53: DEBUG: seen nptype=2(prop) 2005-01-31 15:56:53: DEBUG: seen nptype=2(prop) 2005-01-31 15:56:53: DEBUG: succeed. 2005-01-31 15:56:53: DEBUG: proposal #1 len=40 2005-01-31 15:56:53: DEBUG: begin. 2005-01-31 15:56:53: DEBUG: seen nptype=3(trns) 2005-01-31 15:56:53: DEBUG: succeed. 2005-01-31 15:56:53: DEBUG: transform #1 len=28 2005-01-31 15:56:53: DEBUG: type=SA Life Type, flag=0x8000, lorv=seconds 2005-01-31 15:56:53: DEBUG: type=SA Life Duration, flag=0x8000, lorv=3600 2005-01-31 15:56:53: DEBUG: life duration was in TLV. 2005-01-31 15:56:53: DEBUG: type=Encryption Mode, flag=0x8000, lorv=Transport 2005-01-31 15:56:53: DEBUG: type=Authentication Algorithm, flag=0x8000, lorv=hmac-sha 2005-01-31 15:56:53: DEBUG: type=Group Description, flag=0x8000, lorv=2 2005-01-31 15:56:53: DEBUG: hmac(modp1024) 2005-01-31 15:56:53: DEBUG: proposal #1 len=40 2005-01-31 15:56:53: DEBUG: begin. 2005-01-31 15:56:53: DEBUG: seen nptype=3(trns) 2005-01-31 15:56:53: DEBUG: succeed. 2005-01-31 15:56:53: DEBUG: transform #1 len=28 2005-01-31 15:56:53: DEBUG: type=SA Life Type, flag=0x8000, lorv=seconds 2005-01-31 15:56:53: DEBUG: type=SA Life Duration, flag=0x8000, lorv=3600 2005-01-31 15:56:53: DEBUG: life duration was in TLV. 2005-01-31 15:56:53: DEBUG: type=Encryption Mode, flag=0x8000, lorv=Transport 2005-01-31 15:56:53: DEBUG: type=Authentication Algorithm, flag=0x8000, lorv=hmac-sha 2005-01-31 15:56:53: DEBUG: type=Group Description, flag=0x8000, lorv=2 2005-01-31 15:56:53: DEBUG: hmac(modp1024) 2005-01-31 15:56:53: DEBUG: pair 1: 2005-01-31 15:56:53: DEBUG: 0x91946a0: next=0x91946b8 tnext=(nil) 2005-01-31 15:56:53: DEBUG: 0x91946b8: next=(nil) tnext=(nil) 2005-01-31 15:56:53: DEBUG: proposal #1: 2 transform 2005-01-31 15:56:53: DEBUG: begin compare proposals. 2005-01-31 15:56:53: DEBUG: pair[1]: 0x91946a0 2005-01-31 15:56:53: DEBUG: 0x91946a0: next=0x91946b8 tnext=(nil) 2005-01-31 15:56:53: DEBUG: 0x91946b8: next=(nil) tnext=(nil) 2005-01-31 15:56:53: DEBUG: prop#=1 prot-id=AH spi-size=4 #trns=1 trns#=1 trns-id=SHA 2005-01-31 15:56:53: DEBUG: type=SA Life Type, flag=0x8000, lorv=seconds 2005-01-31 15:56:53: DEBUG: type=SA Life Duration, flag=0x8000, lorv=3600 2005-01-31 15:56:53: DEBUG: type=Encryption Mode, flag=0x8000, lorv=Transport 2005-01-31 15:56:53: DEBUG: type=Authentication Algorithm, flag=0x8000, lorv=hmac-sha 2005-01-31 15:56:53: DEBUG: type=Group Description, flag=0x8000, lorv=2 2005-01-31 15:56:53: DEBUG: prop#=1 prot-id=ESP spi-size=4 #trns=1 trns#=1 trns-id=3DES 2005-01-31 15:56:53: DEBUG: type=SA Life Type, flag=0x8000, lorv=seconds 2005-01-31 15:56:53: DEBUG: type=SA Life Duration, flag=0x8000, lorv=3600 2005-01-31 15:56:53: DEBUG: type=Encryption Mode, flag=0x8000, lorv=Transport 2005-01-31 15:56:53: DEBUG: type=Authentication Algorithm, flag=0x8000, lorv=hmac-sha 2005-01-31 15:56:53: DEBUG: type=Group Description, flag=0x8000, lorv=2 2005-01-31 15:56:53: DEBUG: peer's single bundle: 2005-01-31 15:56:53: DEBUG: (proto_id=AH spisize=4 spi=00fea865 spi_p=00000000 encmode=Transport reqid=0:0) 2005-01-31 15:56:53: DEBUG: (trns_id=SHA authtype=hmac-sha) 2005-01-31 15:56:53: DEBUG: (proto_id=ESP spisize=4 spi=06aff78a spi_p=00000000 encmode=Transport reqid=0:0) 2005-01-31 15:56:53: DEBUG: (trns_id=3DES encklen=0 authtype=hmac-sha) 2005-01-31 15:56:53: DEBUG: my single bundle: 2005-01-31 15:56:53: DEBUG: (proto_id=AH spisize=4 spi=00000000 spi_p=00000000 encmode=Transport reqid=0:0) 2005-01-31 15:56:53: DEBUG: (trns_id=SHA authtype=hmac-sha) 2005-01-31 15:56:53: DEBUG: (proto_id=ESP spisize=4 spi=00000000 spi_p=00000000 encmode=Transport reqid=0:0) 2005-01-31 15:56:53: DEBUG: (trns_id=3DES encklen=0 authtype=hmac-sha) 2005-01-31 15:56:53: DEBUG: matched 2005-01-31 15:56:53: DEBUG: === 2005-01-31 15:56:53: DEBUG: andi: pfkey.c, pfkey_send_getspi (pr->proto_id: 2,iph2->seq: 369749501) andi: libipsec/pfkey.c, pfkey_send_getspi: (satype: 2, seq: 369749501) andi: libipsec/pfkey.c, pfkey_setsadbmsg: (p->type: 1, p->sadb_msg_satype: 2, seq: 369749501) 2005-01-31 15:56:53: DEBUG: pfkey GETSPI sent: AH/Transport 192.168.2.3->192.168.2.5 2005-01-31 15:56:53: DEBUG: andi: pfkey.c, pfkey_send_getspi (pr->proto_id: 3,iph2->seq: 369749501) andi: libipsec/pfkey.c, pfkey_send_getspi: (satype: 3, seq: 369749501) andi: libipsec/pfkey.c, pfkey_setsadbmsg: (p->type: 1, p->sadb_msg_satype: 3, seq: 369749501) 2005-01-31 15:56:53: DEBUG: pfkey GETSPI sent: ESP/Transport 192.168.2.3->192.168.2.5 2005-01-31 15:56:53: DEBUG: pfkey getspi sent. 2005-01-31 15:56:53: DEBUG: get pfkey GETSPI message andi: libipsec/pfkey.c, pfkey_check: start (msg->sadb_msg_satype: 1) 2005-01-31 15:56:53: DEBUG: andi: pfkey.c, pk_recvgetspi: msg->sadb_msg_seq 369749501, msg->sadb_msg_type: GETSPI . 2005-01-31 15:56:53: DEBUG: pfkey GETSPI succeeded: AH/Transport 192.168.2.3->192.168.2.5 spi=129077146(0x7b18f9a) 2005-01-31 15:56:53: DEBUG: get pfkey GETSPI message andi: libipsec/pfkey.c, pfkey_check: start (msg->sadb_msg_satype: 1) 2005-01-31 15:56:53: DEBUG: andi: pfkey.c, pk_recvgetspi: msg->sadb_msg_seq 369749501, msg->sadb_msg_type: GETSPI . 2005-01-31 15:56:53: DEBUG: pfkey GETSPI succeeded: ESP/Transport 192.168.2.3->192.168.2.5 spi=219187533(0xd10894d) 2005-01-31 15:56:53: DEBUG: total SA len=88 2005-01-31 15:56:53: DEBUG: 00000001 00000001 02000028 01020401 00000000 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 00000028 01030401 00000000 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 2005-01-31 15:56:53: DEBUG: begin. 2005-01-31 15:56:53: DEBUG: seen nptype=2(prop) 2005-01-31 15:56:53: DEBUG: seen nptype=2(prop) 2005-01-31 15:56:53: DEBUG: succeed. 2005-01-31 15:56:53: DEBUG: proposal #1 len=40 2005-01-31 15:56:53: DEBUG: begin. 2005-01-31 15:56:53: DEBUG: seen nptype=3(trns) 2005-01-31 15:56:53: DEBUG: succeed. 2005-01-31 15:56:53: DEBUG: transform #1 len=28 2005-01-31 15:56:53: DEBUG: type=SA Life Type, flag=0x8000, lorv=seconds 2005-01-31 15:56:53: DEBUG: type=SA Life Duration, flag=0x8000, lorv=3600 2005-01-31 15:56:53: DEBUG: life duration was in TLV. 2005-01-31 15:56:53: DEBUG: type=Encryption Mode, flag=0x8000, lorv=Transport 2005-01-31 15:56:53: DEBUG: type=Authentication Algorithm, flag=0x8000, lorv=hmac-sha 2005-01-31 15:56:53: DEBUG: type=Group Description, flag=0x8000, lorv=2 2005-01-31 15:56:53: DEBUG: hmac(modp1024) 2005-01-31 15:56:53: DEBUG: proposal #1 len=40 2005-01-31 15:56:53: DEBUG: begin. 2005-01-31 15:56:53: DEBUG: seen nptype=3(trns) 2005-01-31 15:56:53: DEBUG: succeed. 2005-01-31 15:56:53: DEBUG: transform #1 len=28 2005-01-31 15:56:53: DEBUG: type=SA Life Type, flag=0x8000, lorv=seconds 2005-01-31 15:56:53: DEBUG: type=SA Life Duration, flag=0x8000, lorv=3600 2005-01-31 15:56:53: DEBUG: life duration was in TLV. 2005-01-31 15:56:53: DEBUG: type=Encryption Mode, flag=0x8000, lorv=Transport 2005-01-31 15:56:53: DEBUG: type=Authentication Algorithm, flag=0x8000, lorv=hmac-sha 2005-01-31 15:56:53: DEBUG: type=Group Description, flag=0x8000, lorv=2 2005-01-31 15:56:53: DEBUG: hmac(modp1024) 2005-01-31 15:56:53: DEBUG: pair 1: 2005-01-31 15:56:53: DEBUG: 0x9193f68: next=0x9193c38 tnext=(nil) 2005-01-31 15:56:53: DEBUG: 0x9193c38: next=(nil) tnext=(nil) 2005-01-31 15:56:53: DEBUG: proposal #1: 2 transform 2005-01-31 15:56:53: DEBUG: hmac(modp1024) 2005-01-31 15:56:54: DEBUG: compute DH's private. 2005-01-31 15:56:54: DEBUG: 61ad1a7c 415cc7ca c6b10f8f a509fd30 fc25d6de e2dc3228 3f49513d 213e6d1d 6974d149 87d7ec4a 5d94e7ae c3222132 f9ec891e e48e8e69 9ba1a68d 7cb89355 57942666 093c2d08 1fe48b36 ca5fdb07 fa41c14d b3e1cca7 e59c9dd5 52d4300e 9929bf2d 5d0d8c06 90134e8b 3f8900dd 5c5bc152 aa165c2e d9386aec c274189e 2005-01-31 15:56:54: DEBUG: compute DH's public. 2005-01-31 15:56:54: DEBUG: 1a9a548f 5cb12fc5 349c1372 6d2cc511 51029530 0e739921 f0d6371c 97075f8f 04aa195c 446f788d 5856a2fb 85e21369 ea0bbf44 a2aeea15 f9138f7b ab9a303f 861da44f 6d8b3599 bacac90f ac7ae542 5c32765f fb8b26aa b0392050 7059cae9 d360eac8 4318e7d1 8beda674 a51bc003 559a4854 cdbdf9e7 66338448 1c01038f 2005-01-31 15:56:54: DEBUG: add payload of len 88, next type 10 2005-01-31 15:56:54: DEBUG: add payload of len 16, next type 4 2005-01-31 15:56:54: DEBUG: add payload of len 128, next type 0 2005-01-31 15:56:54: DEBUG: HASH with: 2005-01-31 15:56:54: DEBUG: f165fca7 c7d64915 bdd7f74e 89c2ca14 e9b1ddb5 0a00005c 00000001 00000001 02000028 01020401 07b18f9a 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 00000028 01030401 0d10894d 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 04000014 d298eaa0 a8d2b56e 564d817d 816323c8 00000084 1a9a548f 5cb12fc5 349c1372 6d2cc511 51029530 0e739921 f0d6371c 97075f8f 04aa195c 446f788d 5856a2fb 85e21369 ea0bbf44 a2aeea15 f9138f7b ab9a303f 861da44f 6d8b3599 bacac90f ac7ae542 5c32765f fb8b26aa b0392050 7059cae9 d360eac8 4318e7d1 8beda674 a51bc003 559a4854 cdbdf9e7 66338448 1c01038f 2005-01-31 15:56:54: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:54: DEBUG: HASH computed: 2005-01-31 15:56:54: DEBUG: 1c2c3697 3fb6aa73 f0587484 9093486c e94d5f1a 2005-01-31 15:56:54: DEBUG: add payload of len 20, next type 1 2005-01-31 15:56:54: DEBUG: begin encryption. 2005-01-31 15:56:54: DEBUG: encryption(3des) 2005-01-31 15:56:54: DEBUG: pad length = 4 2005-01-31 15:56:54: DEBUG: 01000018 1c2c3697 3fb6aa73 f0587484 9093486c e94d5f1a 0a00005c 00000001 00000001 02000028 01020401 07b18f9a 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 00000028 01030401 0d10894d 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 04000014 d298eaa0 a8d2b56e 564d817d 816323c8 00000084 1a9a548f 5cb12fc5 349c1372 6d2cc511 51029530 0e739921 f0d6371c 97075f8f 04aa195c 446f788d 5856a2fb 85e21369 ea0bbf44 a2aeea15 f9138f7b ab9a303f 861da44f 6d8b3599 bacac90f ac7ae542 5c32765f fb8b26aa b0392050 7059cae9 d360eac8 4318e7d1 8beda674 a51bc003 559a4854 cdbdf9e7 66338448 1c01038f 80c29e03 2005-01-31 15:56:54: DEBUG: encryption(3des) 2005-01-31 15:56:54: DEBUG: with key: 2005-01-31 15:56:54: DEBUG: 5a7c9253 3da7ec0c a029a28f 5d4bfbbb d0730ef7 5b24dc57 2005-01-31 15:56:54: DEBUG: encrypted payload by IV: 2005-01-31 15:56:54: DEBUG: f0e213b8 d6423ed8 2005-01-31 15:56:54: DEBUG: save IV for next: 2005-01-31 15:56:54: DEBUG: 8facb279 a73879cc 2005-01-31 15:56:54: DEBUG: encrypted. 2005-01-31 15:56:54: DEBUG: 300 bytes from 192.168.2.5[500] to 192.168.2.3[500] 2005-01-31 15:56:54: DEBUG: sockname 192.168.2.5[500] 2005-01-31 15:56:54: DEBUG: send packet from 192.168.2.5[500] 2005-01-31 15:56:54: DEBUG: send packet to 192.168.2.3[500] 2005-01-31 15:56:54: DEBUG: src4 192.168.2.5[500] 2005-01-31 15:56:54: DEBUG: dst4 192.168.2.3[500] 2005-01-31 15:56:54: DEBUG: 1 times of 300 bytes message will be sent to 192.168.2.5[500] 2005-01-31 15:56:54: DEBUG: 1b3a78e3 adfafb1d c0e4d647 591c43f6 08102001 f165fca7 0000012c c59be1a6 93abf8bf cde86a3a e5e428f7 a00db733 43b4dd3e e97adf5b fa4f2609 978df62c 683dbfd2 cdf45e68 0621eb57 193b98cc 392a1bdc bee50fb1 e7e62fa6 4dd38e2c 8810a16b 54e1fdbc 8a130800 8721f2aa 600b7947 b9533309 3ee0bb33 d06de978 c7c44108 5c06d7ae d88639e4 024eb8aa b9fbf222 2920d647 d7589737 7b8f7232 23a84acc f3a340b8 9536ed1a 7a86ac0b 9bf35505 f101cd99 741ac02d 0ff91283 377fea8f d0ac3ae8 fdef3258 d817c2d3 80e4254a 36f1bc93 a0b3857b aa9e1dc7 8b98d62d 0c208041 d3def06e 1a290fab 567deff4 11ae9f98 dbdb0ec2 e8b61cfe 75a991e9 5429bb2b a3a98e56 be822247 b7d4afac d845f41f 88899909 8131b83e d9289dca 8facb279 a73879cc 2005-01-31 15:56:54: DEBUG: resend phase2 packet 1b3a78e3adfafb1d:c0e4d647591c43f6:0000f165 2005-01-31 15:56:54: DEBUG: === 2005-01-31 15:56:54: DEBUG: 60 bytes message received from 192.168.2.3[500] to 192.168.2.5[500] 2005-01-31 15:56:54: DEBUG: 1b3a78e3 adfafb1d c0e4d647 591c43f6 08102001 f165fca7 0000003c 7bffc9a8 da9a42f6 a6188903 a72cd735 d5cc4492 002a4ba7 15839dc3 a87a8972 2005-01-31 15:56:54: DEBUG: begin decryption. 2005-01-31 15:56:54: DEBUG: encryption(3des) 2005-01-31 15:56:54: DEBUG: IV was saved for next processing: 2005-01-31 15:56:54: DEBUG: 15839dc3 a87a8972 2005-01-31 15:56:54: DEBUG: encryption(3des) 2005-01-31 15:56:54: DEBUG: with key: 2005-01-31 15:56:54: DEBUG: 5a7c9253 3da7ec0c a029a28f 5d4bfbbb d0730ef7 5b24dc57 2005-01-31 15:56:54: DEBUG: decrypted payload by IV: 2005-01-31 15:56:54: DEBUG: 8facb279 a73879cc 2005-01-31 15:56:54: DEBUG: decrypted payload, but not trimed. 2005-01-31 15:56:54: DEBUG: 00000018 d3b6e22d 0c973dec 931eeb37 d8ba14e3 4c7102df 95d3e7bd f6faf607 2005-01-31 15:56:54: DEBUG: padding len=8 2005-01-31 15:56:54: DEBUG: skip to trim padding. 2005-01-31 15:56:54: DEBUG: decrypted. 2005-01-31 15:56:54: DEBUG: 1b3a78e3 adfafb1d c0e4d647 591c43f6 08102001 f165fca7 0000003c 00000018 d3b6e22d 0c973dec 931eeb37 d8ba14e3 4c7102df 95d3e7bd f6faf607 2005-01-31 15:56:54: DEBUG: begin. 2005-01-31 15:56:54: DEBUG: seen nptype=8(hash) 2005-01-31 15:56:54: DEBUG: succeed. 2005-01-31 15:56:54: DEBUG: HASH(3) validate:2005-01-31 15:56:54: DEBUG: d3b6e22d 0c973dec 931eeb37 d8ba14e3 4c7102df 2005-01-31 15:56:54: DEBUG: HASH with: 2005-01-31 15:56:54: DEBUG: 00f165fc a7c7d649 15bdd7f7 4e89c2ca 14e9b1dd b5d298ea a0a8d2b5 6e564d81 7d816323 c8 2005-01-31 15:56:54: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:54: DEBUG: HASH computed: 2005-01-31 15:56:54: DEBUG: d3b6e22d 0c973dec 931eeb37 d8ba14e3 4c7102df 2005-01-31 15:56:54: DEBUG: === 2005-01-31 15:56:54: DEBUG: compute DH's shared. 2005-01-31 15:56:54: DEBUG: ab12d518 48c49b88 b8b41d82 809e78ce 5324cefe 9392b981 97c8c1dc 972c21f3 37b65750 5f6a4f13 6a042fc6 69024994 dbc37801 37902186 e324ae60 d6c396ac ac9bbd16 38b30565 48aa3baa bfc3430b 4355151d ac8b5b46 e19264f2 01994fd1 f5e44159 1d9b471c b3764b05 95c28afd 94f29a19 974bf59f b3f8ce9a 3119326c 2005-01-31 15:56:54: DEBUG: KEYMAT compute with 2005-01-31 15:56:54: DEBUG: ab12d518 48c49b88 b8b41d82 809e78ce 5324cefe 9392b981 97c8c1dc 972c21f3 37b65750 5f6a4f13 6a042fc6 69024994 dbc37801 37902186 e324ae60 d6c396ac ac9bbd16 38b30565 48aa3baa bfc3430b 4355151d ac8b5b46 e19264f2 01994fd1 f5e44159 1d9b471c b3764b05 95c28afd 94f29a19 974bf59f b3f8ce9a 3119326c 0207b18f 9ac7d649 15bdd7f7 4e89c2ca 14e9b1dd b5d298ea a0a8d2b5 6e564d81 7d816323 c8 2005-01-31 15:56:54: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:54: DEBUG: encklen=0 authklen=0 2005-01-31 15:56:54: DEBUG: generating 480 bits of key (dupkeymat=3) 2005-01-31 15:56:54: DEBUG: generating K1...K3 for KEYMAT. 2005-01-31 15:56:54: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:54: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:54: DEBUG: 3af874ac 08fe556c fddec368 1fb82bf8 e907261e 8ead23f4 ffbcd976 526f0569 7ebaa182 8f5de2ab e9c2c443 444c2847 f44aeb9b d9a16c3c 9c2ae6b8 2005-01-31 15:56:54: DEBUG: KEYMAT compute with 2005-01-31 15:56:54: DEBUG: ab12d518 48c49b88 b8b41d82 809e78ce 5324cefe 9392b981 97c8c1dc 972c21f3 37b65750 5f6a4f13 6a042fc6 69024994 dbc37801 37902186 e324ae60 d6c396ac ac9bbd16 38b30565 48aa3baa bfc3430b 4355151d ac8b5b46 e19264f2 01994fd1 f5e44159 1d9b471c b3764b05 95c28afd 94f29a19 974bf59f b3f8ce9a 3119326c 030d1089 4dc7d649 15bdd7f7 4e89c2ca 14e9b1dd b5d298ea a0a8d2b5 6e564d81 7d816323 c8 2005-01-31 15:56:54: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:54: DEBUG: encryption(3des) 2005-01-31 15:56:54: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:54: DEBUG: encklen=192 authklen=160 2005-01-31 15:56:54: DEBUG: generating 640 bits of key (dupkeymat=4) 2005-01-31 15:56:54: DEBUG: generating K1...K4 for KEYMAT. 2005-01-31 15:56:54: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:54: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:54: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:54: DEBUG: 71029e05 9f9f7fa9 1dc99080 7cb4a9ee b9bf2792 32deacc8 80596d90 ba7c0543 c1b40d8a f790d58e ccf66f87 653494e8 cbb3f725 c0f119ee f2f1e4e6 83d9e937 0a1fbbfa 40590ee8 8479816c 1ab9321f 2005-01-31 15:56:54: DEBUG: KEYMAT compute with 2005-01-31 15:56:54: DEBUG: ab12d518 48c49b88 b8b41d82 809e78ce 5324cefe 9392b981 97c8c1dc 972c21f3 37b65750 5f6a4f13 6a042fc6 69024994 dbc37801 37902186 e324ae60 d6c396ac ac9bbd16 38b30565 48aa3baa bfc3430b 4355151d ac8b5b46 e19264f2 01994fd1 f5e44159 1d9b471c b3764b05 95c28afd 94f29a19 974bf59f b3f8ce9a 3119326c 0200fea8 65c7d649 15bdd7f7 4e89c2ca 14e9b1dd b5d298ea a0a8d2b5 6e564d81 7d816323 c8 2005-01-31 15:56:54: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:54: DEBUG: encklen=0 authklen=0 2005-01-31 15:56:54: DEBUG: generating 480 bits of key (dupkeymat=3) 2005-01-31 15:56:54: DEBUG: generating K1...K3 for KEYMAT. 2005-01-31 15:56:54: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:54: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:54: DEBUG: d1bc914f 7e79fd37 a72b8c46 a4326199 5ef4009c 72540f34 fba939c2 79232d22 1dada88a edebf394 42a181f6 6929749b d5a02847 7035ef42 50b8f77b 2005-01-31 15:56:54: DEBUG: KEYMAT compute with 2005-01-31 15:56:54: DEBUG: ab12d518 48c49b88 b8b41d82 809e78ce 5324cefe 9392b981 97c8c1dc 972c21f3 37b65750 5f6a4f13 6a042fc6 69024994 dbc37801 37902186 e324ae60 d6c396ac ac9bbd16 38b30565 48aa3baa bfc3430b 4355151d ac8b5b46 e19264f2 01994fd1 f5e44159 1d9b471c b3764b05 95c28afd 94f29a19 974bf59f b3f8ce9a 3119326c 0306aff7 8ac7d649 15bdd7f7 4e89c2ca 14e9b1dd b5d298ea a0a8d2b5 6e564d81 7d816323 c8 2005-01-31 15:56:54: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:54: DEBUG: encryption(3des) 2005-01-31 15:56:54: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:54: DEBUG: encklen=192 authklen=160 2005-01-31 15:56:54: DEBUG: generating 640 bits of key (dupkeymat=4) 2005-01-31 15:56:54: DEBUG: generating K1...K4 for KEYMAT. 2005-01-31 15:56:54: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:54: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:54: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:54: DEBUG: ff237a88 c0438bc9 3e19ff2c 4b0c9a2a 2e7797d4 50de0b4e 50f124ac 808c9ec5 cf098100 ff24656f 3faaf2e0 ccc6323a 346d426e 8fba2cc3 b6c4f2e2 24231bf2 c636d43a 689cf0a7 b2d89724 58f43176 2005-01-31 15:56:54: DEBUG: KEYMAT computed. 2005-01-31 15:56:54: DEBUG: call pk_sendupdate 2005-01-31 15:56:54: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:54: DEBUG: call pfkey_send_update_nat andi: libipsec/pfkey.c, pfkey_setsadbmsg: (p->type: 2, p->sadb_msg_satype: 2, seq: 369749501) andi: libipsec/pfkey.c, pfkey_send_x1: (satype: 2, spi 2593108231) 2005-01-31 15:56:54: DEBUG: encryption(3des) 2005-01-31 15:56:54: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:54: DEBUG: call pfkey_send_update_nat andi: libipsec/pfkey.c, pfkey_setsadbmsg: (p->type: 2, p->sadb_msg_satype: 3, seq: 369749501) andi: libipsec/pfkey.c, pfkey_send_x1: (satype: 3, spi 1300828173) 2005-01-31 15:56:54: DEBUG: pfkey update sent. 2005-01-31 15:56:54: DEBUG: andi: pfkey.c, pk_sendadd: start 2005-01-31 15:56:54: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:54: DEBUG: call pfkey_send_add_nat andi: libipsec/pfkey.c, pfkey_setsadbmsg: (p->type: 3, p->sadb_msg_satype: 2, seq: 369749501) andi: libipsec/pfkey.c, pfkey_send_x1: (satype: 2, spi 1705573888) 2005-01-31 15:56:54: DEBUG: encryption(3des) 2005-01-31 15:56:54: DEBUG: hmac(hmac_sha1) 2005-01-31 15:56:54: DEBUG: call pfkey_send_add_nat andi: libipsec/pfkey.c, pfkey_setsadbmsg: (p->type: 3, p->sadb_msg_satype: 3, seq: 369749501) andi: libipsec/pfkey.c, pfkey_send_x1: (satype: 3, spi 2331488006) 2005-01-31 15:56:54: DEBUG: andi: pfkey.c, pk_sendadd: ende 2005-01-31 15:56:54: DEBUG: pfkey add sent. 2005-01-31 15:56:54: DEBUG: get pfkey UPDATE message andi: libipsec/pfkey.c, pfkey_check: start (msg->sadb_msg_satype: 2) 2005-01-31 15:56:54: DEBUG: andi: pfkey.c, pk_recvupdate: start 2005-01-31 15:56:54: DEBUG: andi: in pfkey.c, pk_recvupdate: msg->sadb_msg_seq 369749501, msg->sadb_msg_type: UPDATE 2005-01-31 15:56:54: DEBUG: pfkey UPDATE succeeded: AH/Transport 192.168.2.3->192.168.2.5 spi=129077146(0x7b18f9a) 2005-01-31 15:56:54: INFO: IPsec-SA established: AH/Transport 192.168.2.3->192.168.2.5 spi=129077146(0x7b18f9a) 2005-01-31 15:56:54: DEBUG: get pfkey UPDATE message andi: libipsec/pfkey.c, pfkey_check: start (msg->sadb_msg_satype: 2) 2005-01-31 15:56:54: DEBUG: andi: pfkey.c, pk_recvupdate: start 2005-01-31 15:56:54: DEBUG: andi: in pfkey.c, pk_recvupdate: msg->sadb_msg_seq 369749501, msg->sadb_msg_type: UPDATE 2005-01-31 15:56:54: DEBUG: pfkey UPDATE succeeded: ESP/Transport 192.168.2.3->192.168.2.5 spi=219187533(0xd10894d) 2005-01-31 15:56:54: INFO: IPsec-SA established: ESP/Transport 192.168.2.3->192.168.2.5 spi=219187533(0xd10894d) 2005-01-31 15:56:54: DEBUG: andi: pfkey.c, pk_recvupdate: ende 2005-01-31 15:56:54: DEBUG: === 2005-01-31 15:56:54: DEBUG: get pfkey ADD message andi: libipsec/pfkey.c, pfkey_check: start (msg->sadb_msg_satype: 3) 2005-01-31 15:56:54: DEBUG: andi: in pfkey.c, pk_recvadd: msg->sadb_msg_seq 369749501, msg->sadb_msg_type: ADD 2005-01-31 15:56:54: INFO: IPsec-SA established: AH/Transport 192.168.2.5->192.168.2.3 spi=16689253(0xfea865) 2005-01-31 15:56:54: DEBUG: === 2005-01-31 15:56:54: DEBUG: get pfkey ADD message andi: libipsec/pfkey.c, pfkey_check: start (msg->sadb_msg_satype: 3) 2005-01-31 15:56:54: DEBUG: andi: in pfkey.c, pk_recvadd: msg->sadb_msg_seq 369749501, msg->sadb_msg_type: ADD 2005-01-31 15:56:54: INFO: IPsec-SA established: ESP/Transport 192.168.2.5->192.168.2.3 spi=112195466(0x6aff78a) 2005-01-31 15:56:54: DEBUG: === 2005-01-31 15:57:02: INFO: caught signal 2 andi: libipsec/pfkey.c, pfkey_setsadbmsg: (p->type: 9, p->sadb_msg_satype: 0, seq: 0) 2005-01-31 15:57:02: DEBUG: get pfkey FLUSH message andi: libipsec/pfkey.c, pfkey_check: start (msg->sadb_msg_satype: 9) 2005-01-31 15:57:02: DEBUG: compute IV for phase2 2005-01-31 15:57:02: DEBUG: phase1 last IV: 2005-01-31 15:57:02: DEBUG: d0b3dc22 1d31f2d0 f6cf0393 2005-01-31 15:57:02: DEBUG: hash(sha1) 2005-01-31 15:57:02: DEBUG: encryption(3des) 2005-01-31 15:57:02: DEBUG: phase2 IV computed: 2005-01-31 15:57:02: DEBUG: 4c579727 173cfcdf 2005-01-31 15:57:02: DEBUG: HASH with: 2005-01-31 15:57:02: DEBUG: f6cf0393 00000010 00000001 02040001 07b18f9a 2005-01-31 15:57:02: DEBUG: hmac(hmac_sha1) 2005-01-31 15:57:02: DEBUG: HASH computed: 2005-01-31 15:57:02: DEBUG: 0715e057 78eb3389 9e5ad122 a1437de0 d17af863 2005-01-31 15:57:02: DEBUG: begin encryption. 2005-01-31 15:57:02: DEBUG: encryption(3des) 2005-01-31 15:57:02: DEBUG: pad length = 8 2005-01-31 15:57:02: DEBUG: 0c000018 0715e057 78eb3389 9e5ad122 a1437de0 d17af863 00000010 00000001 02040001 07b18f9a b3e7baec f4a9ef07 2005-01-31 15:57:02: DEBUG: encryption(3des) 2005-01-31 15:57:02: DEBUG: with key: 2005-01-31 15:57:02: DEBUG: 5a7c9253 3da7ec0c a029a28f 5d4bfbbb d0730ef7 5b24dc57 2005-01-31 15:57:02: DEBUG: encrypted payload by IV: 2005-01-31 15:57:02: DEBUG: 4c579727 173cfcdf 2005-01-31 15:57:02: DEBUG: save IV for next: 2005-01-31 15:57:02: DEBUG: 0f1fe112 9212600e 2005-01-31 15:57:02: DEBUG: encrypted. 2005-01-31 15:57:02: DEBUG: 76 bytes from 192.168.2.5[500] to 192.168.2.3[500] 2005-01-31 15:57:02: DEBUG: sockname 192.168.2.5[500] 2005-01-31 15:57:02: DEBUG: send packet from 192.168.2.5[500] 2005-01-31 15:57:02: DEBUG: send packet to 192.168.2.3[500] 2005-01-31 15:57:02: DEBUG: src4 192.168.2.5[500] 2005-01-31 15:57:02: DEBUG: dst4 192.168.2.3[500] 2005-01-31 15:57:02: DEBUG: 1 times of 76 bytes message will be sent to 192.168.2.5[500] 2005-01-31 15:57:02: DEBUG: 1b3a78e3 adfafb1d c0e4d647 591c43f6 08100501 f6cf0393 0000004c bd4fcd13 d7973d7c a9370d65 ed55caef 745583b1 33c4c9ff 541ae249 a7641bde adb4c1bf 319b79f4 0f1fe112 9212600e 2005-01-31 15:57:02: DEBUG: sendto Information delete. 2005-01-31 15:57:02: DEBUG: compute IV for phase2 2005-01-31 15:57:02: DEBUG: phase1 last IV: 2005-01-31 15:57:02: DEBUG: d0b3dc22 1d31f2d0 c9a50cea 2005-01-31 15:57:02: DEBUG: hash(sha1) 2005-01-31 15:57:02: DEBUG: encryption(3des) 2005-01-31 15:57:02: DEBUG: phase2 IV computed: 2005-01-31 15:57:02: DEBUG: b55ad535 fe76042b 2005-01-31 15:57:02: DEBUG: HASH with: 2005-01-31 15:57:02: DEBUG: c9a50cea 00000010 00000001 03040001 0d10894d 2005-01-31 15:57:02: DEBUG: hmac(hmac_sha1) 2005-01-31 15:57:02: DEBUG: HASH computed: 2005-01-31 15:57:02: DEBUG: be21e06e 14682bdf 5d12beda b6f08dd6 9c5439c2 2005-01-31 15:57:02: DEBUG: begin encryption. 2005-01-31 15:57:02: DEBUG: encryption(3des) 2005-01-31 15:57:02: DEBUG: pad length = 8 2005-01-31 15:57:02: DEBUG: 0c000018 be21e06e 14682bdf 5d12beda b6f08dd6 9c5439c2 00000010 00000001 03040001 0d10894d bf9aa6cd d5a7ac07 2005-01-31 15:57:02: DEBUG: encryption(3des) 2005-01-31 15:57:02: DEBUG: with key: 2005-01-31 15:57:02: DEBUG: 5a7c9253 3da7ec0c a029a28f 5d4bfbbb d0730ef7 5b24dc57 2005-01-31 15:57:02: DEBUG: encrypted payload by IV: 2005-01-31 15:57:02: DEBUG: b55ad535 fe76042b 2005-01-31 15:57:02: DEBUG: save IV for next: 2005-01-31 15:57:02: DEBUG: 10aedf12 50d5d196 2005-01-31 15:57:02: DEBUG: encrypted. 2005-01-31 15:57:02: DEBUG: 76 bytes from 192.168.2.5[500] to 192.168.2.3[500] 2005-01-31 15:57:02: DEBUG: sockname 192.168.2.5[500] 2005-01-31 15:57:02: DEBUG: send packet from 192.168.2.5[500] 2005-01-31 15:57:02: DEBUG: send packet to 192.168.2.3[500] 2005-01-31 15:57:02: DEBUG: src4 192.168.2.5[500] 2005-01-31 15:57:02: DEBUG: dst4 192.168.2.3[500] 2005-01-31 15:57:02: DEBUG: 1 times of 76 bytes message will be sent to 192.168.2.5[500] 2005-01-31 15:57:02: DEBUG: 1b3a78e3 adfafb1d c0e4d647 591c43f6 08100501 c9a50cea 0000004c 461c5c4d f2ca3b90 c73807da d84f253e e3acaa86 ec8d0dc2 be1ed5ea 19cc1e63 16ad963f a9a566e4 10aedf12 50d5d196 2005-01-31 15:57:02: DEBUG: sendto Information delete. 2005-01-31 15:57:02: DEBUG: an undead schedule has been deleted. 2005-01-31 15:57:03: DEBUG: call pfkey_send_dump andi: libipsec/pfkey.c, pfkey_setsadbmsg: (p->type: 10, p->sadb_msg_satype: 0, seq: 0) andi: libipsec/pfkey.c, pfkey_check: start (msg->sadb_msg_satype: 10) 2005-01-31 15:57:03: DEBUG: compute IV for phase2 2005-01-31 15:57:03: DEBUG: phase1 last IV: 2005-01-31 15:57:03: DEBUG: d0b3dc22 1d31f2d0 8e1131ff 2005-01-31 15:57:03: DEBUG: hash(sha1) 2005-01-31 15:57:03: DEBUG: encryption(3des) 2005-01-31 15:57:03: DEBUG: phase2 IV computed: 2005-01-31 15:57:03: DEBUG: a32d8d7b f61e2114 2005-01-31 15:57:03: DEBUG: HASH with: 2005-01-31 15:57:03: DEBUG: 8e1131ff 0000001c 00000001 01100001 1b3a78e3 adfafb1d c0e4d647 591c43f6 2005-01-31 15:57:03: DEBUG: hmac(hmac_sha1) 2005-01-31 15:57:03: DEBUG: HASH computed: 2005-01-31 15:57:03: DEBUG: cc70fba0 88f669db 3aa73457 8721f054 42e69e3a 2005-01-31 15:57:03: DEBUG: begin encryption. 2005-01-31 15:57:03: DEBUG: encryption(3des) 2005-01-31 15:57:03: DEBUG: pad length = 4 2005-01-31 15:57:03: DEBUG: 0c000018 cc70fba0 88f669db 3aa73457 8721f054 42e69e3a 0000001c 00000001 01100001 1b3a78e3 adfafb1d c0e4d647 591c43f6 a7aff503 2005-01-31 15:57:03: DEBUG: encryption(3des) 2005-01-31 15:57:03: DEBUG: with key: 2005-01-31 15:57:03: DEBUG: 5a7c9253 3da7ec0c a029a28f 5d4bfbbb d0730ef7 5b24dc57 2005-01-31 15:57:03: DEBUG: encrypted payload by IV: 2005-01-31 15:57:03: DEBUG: a32d8d7b f61e2114 2005-01-31 15:57:03: DEBUG: save IV for next: 2005-01-31 15:57:03: DEBUG: 0b8f99d8 d092b040 2005-01-31 15:57:03: DEBUG: encrypted. 2005-01-31 15:57:03: DEBUG: 84 bytes from 192.168.2.5[500] to 192.168.2.3[500] 2005-01-31 15:57:03: DEBUG: sockname 192.168.2.5[500] 2005-01-31 15:57:03: DEBUG: send packet from 192.168.2.5[500] 2005-01-31 15:57:03: DEBUG: send packet to 192.168.2.3[500] 2005-01-31 15:57:03: DEBUG: src4 192.168.2.5[500] 2005-01-31 15:57:03: DEBUG: dst4 192.168.2.3[500] 2005-01-31 15:57:03: DEBUG: 1 times of 84 bytes message will be sent to 192.168.2.5[500] 2005-01-31 15:57:03: DEBUG: 1b3a78e3 adfafb1d c0e4d647 591c43f6 08100501 8e1131ff 00000054 fb2707d6 5c326720 9677a767 e8b8e127 8ce26bc4 69ee5837 717bbbed 6d13934a beefc296 1a04179e a9302874 f547249b 0b8f99d8 d092b040 2005-01-31 15:57:03: DEBUG: sendto Information delete. 2005-01-31 15:57:03: DEBUG: an undead schedule has been deleted. 2005-01-31 15:57:03: INFO: racoon shutdown [root@litiusoft racoon]# --Boundary-00=_+xk/BkoCfSG/nsz-- From hadi@cyberus.ca Mon Jan 31 07:34:26 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 07:34:31 -0800 (PST) Received: from mx04.cyberus.ca (mx04.cybersurf.com [209.197.145.108]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VFYPdi029311 for ; Mon, 31 Jan 2005 07:34:26 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx04.cyberus.ca with esmtp (Exim 4.30) id 1CvdZC-0008Cm-KB for netdev@oss.sgi.com; Mon, 31 Jan 2005 08:34:18 -0700 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CvdZ9-00088x-NS; Mon, 31 Jan 2005 10:34:15 -0500 Subject: Re: dummy as IMQ replacement From: jamal Reply-To: hadi@cyberus.ca To: Hasso Tepper Cc: netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto In-Reply-To: <200501311646.14322.hasso@estpak.ee> References: <1107123123.8021.80.camel@jzny.localdomain> <200501311614.31397.hasso@estpak.ee> <1107181551.7847.193.camel@jzny.localdomain> <200501311646.14322.hasso@estpak.ee> Content-Type: text/plain Organization: jamalopolous Message-Id: <1107185652.1075.3.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 31 Jan 2005 10:34:12 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1093 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 1097 Lines: 28 On Mon, 2005-01-31 at 09:46, Hasso Tepper wrote: > jamal wrote: > > Unfortunately this "index" thing continues to be a big secret although i > > have pointed it a few times. Bart should probably add it to his HOWTO. > > All this stuff deserves better documentation ;). Call me oldfashioned, but > IMHO would be good start to have all keywords at least somewhat documented > in iproute2 man pages. I know, writing documentation is boring task etc, > but at least you should mention all features in man pages. This gives to > someone at least chance to kick you "hey, what's this?" ;). > But 50 emails later noone documented anything .. And every summer someone tries to write a qdisc to achive this ;-> > This is somewhat related to killing the chance to use iptables as well ... > Iptables has better documentation and people use it just because of that. > > Just checked ... "tc action help" in newest iproute2 returns nothing as > well :(. Should work. Are you sure you got the latest one? Also make sure you compile tc action in the scheduler part of kernel config. cheers, jamal From jeremy.guthrie@berbee.com Mon Jan 31 07:37:38 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 07:37:45 -0800 (PST) Received: from ctg-msnexc01.staff.berbee.com (msn-office-flr2.binc.net [64.73.12.254]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VFbbV7029862 for ; Mon, 31 Jan 2005 07:37:38 -0800 Received: from localhost ([172.30.254.220] RDNS failed) by ctg-msnexc01.staff.berbee.com with Microsoft SMTPSVC(6.0.3790.0); Mon, 31 Jan 2005 09:37:32 -0600 From: "Jeremy M. Guthrie" Reply-To: jeremy.guthrie@berbee.com Organization: Berbee Information Networks To: netdev@oss.sgi.com Subject: Re: V2.4 policy router operates faster/better than V2.6 Date: Mon, 31 Jan 2005 09:37:27 -0600 User-Agent: KMail/1.7.2 Cc: Robert Olsson References: <16879.58333.266843.335475@robur.slu.se> <200501201114.49517.jeremy.guthrie@berbee.com> In-Reply-To: <200501201114.49517.jeremy.guthrie@berbee.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1359121.nEJab2xqho"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200501310937.30427.jeremy.guthrie@berbee.com> X-OriginalArrivalTime: 31 Jan 2005 15:37:32.0098 (UTC) FILETIME=[C763FA20:01C507AA] X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1094 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jeremy.guthrie@berbee.com Precedence: bulk X-list: netdev Content-Length: 975 Lines: 35 --nextPart1359121.nEJab2xqho Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Just wanted to verify that by the term linear search from rtstat/lnstat, yo= u=20 mean a search of the buckets for a particular hash? We're going live tomorrow with the app. Afterwards I'll load up the no rou= te=20 caching patch and test that. =2D-=20 =2D------------------------------------------------- Jeremy M. Guthrie jeremy.guthrie@berbee.com Senior Network Engineer Phone: 608-298-1061 Berbee Fax: 608-288-3007 5520 Research Park Drive NOC: 608-298-1102 Madison, WI 53711 --nextPart1359121.nEJab2xqho Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB/lC6qtjaBHGZBeURAshqAJwKefXek3oK3jBGawBRWUbl5XsEzgCfUQkG STJq9A93N/Sk4NF8kvlQ31k= =Q33E -----END PGP SIGNATURE----- --nextPart1359121.nEJab2xqho-- From hadi@cyberus.ca Mon Jan 31 07:40:55 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 07:41:00 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VFepTs030806 for ; Mon, 31 Jan 2005 07:40:52 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CvdfV-0006hl-OH for netdev@oss.sgi.com; Mon, 31 Jan 2005 10:40:49 -0500 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CvdfS-0001N5-Vx; Mon, 31 Jan 2005 10:40:47 -0500 Subject: Re: dummy as IMQ replacement From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto In-Reply-To: <20050131151532.GE31837@postel.suug.ch> References: <1107123123.8021.80.camel@jzny.localdomain> <20050131135810.GC31837@postel.suug.ch> <1107181169.7840.184.camel@jzny.localdomain> <20050131151532.GE31837@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1107186044.1076.11.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 31 Jan 2005 10:40:44 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1095 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 3097 Lines: 68 On Mon, 2005-01-31 at 10:15, Thomas Graf wrote: > Agreed, this was my first attempt and my current code is still based on > this. I'm trying to avoid a retransmit battle, therefore I try to > delay packets if possible with the hope that it's either just a peak > or the slow down is fast enough. I use a simplified RED and > tcp_xmit_retransmit_queue() input to avoid flick flack effects which > works pretty well for bulky streams. A burst buffer takes care > of interactive traffic with peaks but this doesn't work perfectly fine > yet. Overall, my attempt works pretty well if the other side uses > reno/bic and quite well for westwood and vegas. The problem is not that > it doesn't work at all but achieving a certain _stable_ rate is very > difficult, the delta of the requested and real rate is up to 25% depending > on the constancy of the rtt and wether they follow one of the proposed > tcp cc algorithms. The cc guessing code helps a bit but isn't very > accurate. My experience is that you end up dropping no more than a packet in a burst with policing before TCP adjusts. Also depending on the gap between bursts, that may be the only packet you drop altogether. In long flows such as file transfers, avergae of one packet ever gets dropped. > > Something along the lines of what OBSD firewall does but selectively (If > > i understood those OBSD fanatics at SUCON;-> correctly)..they track > > at ingress before ip stack. The difference is we can allow selective > > tracking; something along the lines of: > > This means we'd have to do the most important sanity cehcks ourselves > like checksum and ip header consistencity. Which basically means a > duplication of ip_rcv() and ipv6_rcv(). > checksum and other validity of ip header will have to be written as an action if needed. Infact csum is on my list of mini actions. I could decide to change something on egress of outgoing ip packet in pedit and would therefore require to recompute csum. > > tc filter add dev $DEV parent ffff: protocol ip prio 10 \ > > u32 match u32 0x10000 0xff0000 at 8 \ > > action track \ > > action metamark here depending on whether we found contrack etc > > > > I have the layout scribbeled on paper somewhere .. I will look it up > > and provide more details > > > > Track should just use iptables contracking code instead of reinventing > > it. > > This is exactly my thinking as well but I'd do it as ematch. Given > we pass the netfilter conntrack code we'd then have access to the > meta data of it such as direction, state and other attributes. > > tc filter add dev $DEV parent ffff: protocol ip prio 10 \ > u32 match u32 0x10000 0xff0000 at 8 \ > and conntrack \ > and meta nf_state eq ESTABLISHED \ > and meta nf_status eq SEEN_REPLY \ > action metamark here depending on whether we found contrack etc Ok, I think both approaches are correct. ematch does the check/get essentially; and action will create the set/tracking if needed. For the example i gave, you are absolutely correct, ematch is sufficient. cheers, jamal From au@unterluggauer.org Mon Jan 31 07:40:57 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 07:41:06 -0800 (PST) Received: from mail.unterluggauer.org (chello062178068189.23.11.vie.surfer.at [62.178.68.189]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VFesTB030810 for ; Mon, 31 Jan 2005 07:40:55 -0800 Received: from lappl.usoft.at (lappl.usoft.at [192.168.2.3]) by mail.unterluggauer.org (8.12.11/8.12.11) with ESMTP id j0VFeGfG032548; Mon, 31 Jan 2005 16:40:16 +0100 From: Andreas Unterluggauer To: Herbert Xu Subject: Re: Fw: [Bugme-new] [Bug 4138] New: ipsec with racoon in transport mode with esp and ah hangs (problem is in xfrm_state_add) Date: Mon, 31 Jan 2005 16:40:16 +0100 User-Agent: KMail/1.6.2 References: In-Reply-To: Cc: netdev@oss.sgi.com MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_gFl/Bi96WSERiIA" Message-Id: <200501311640.16118.au@unterluggauer.org> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1096 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: au@unterluggauer.org Precedence: bulk X-list: netdev Content-Length: 49301 Lines: 904 --Boundary-00=_gFl/Bi96WSERiIA Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Herbert, > for me it looks like racoon doesn't get the SADB_ACQUIRE message. for the log-file in the last message I made a ping from the remote computer, that's the reason why there is no SADB_ACQUIRE message. now I have attached a log-file from a ping to the remote computer. there you can see that racoon is getting one ACQUIRE message (and then generating two SA's?) cheers andi --Boundary-00=_gFl/Bi96WSERiIA Content-Type: text/x-log; charset="iso-8859-1"; name="racoon2.log" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="racoon2.log" 2005-01-31 16:29:35: INFO: @(#)ipsec-tools 0.5rc2 (http://ipsec-tools.sourceforge.net) 2005-01-31 16:29:35: INFO: @(#)This product linked OpenSSL 0.9.7a Feb 19 2003 (http://www.openssl.org/) 2005-01-31 16:29:35: DEBUG: call pfkey_send_register for AH andi: libipsec/pfkey.c, pfkey_setsadbmsg: (p->type: 7, p->sadb_msg_satype: 2, seq: 0) 2005-01-31 16:29:36: DEBUG: call pfkey_send_register for ESP andi: libipsec/pfkey.c, pfkey_setsadbmsg: (p->type: 7, p->sadb_msg_satype: 3, seq: 0) 2005-01-31 16:29:36: DEBUG: call pfkey_send_register for IPCOMP andi: libipsec/pfkey.c, pfkey_setsadbmsg: (p->type: 7, p->sadb_msg_satype: 9, seq: 0) andi: libipsec/pfkey.c, pfkey_setsadbmsg: (p->type: 18, p->sadb_msg_satype: 0, seq: 0) 2005-01-31 16:29:36: DEBUG: reading config file racoon.conf 2005-01-31 16:29:36: DEBUG: hmac(modp1024) 2005-01-31 16:29:36: DEBUG: compression algorithm can not be checked because sadb message doesn't support it. 2005-01-31 16:29:36: DEBUG: my interface: 127.0.0.1 (lo) 2005-01-31 16:29:36: DEBUG: my interface: 192.168.2.5 (eth0) 2005-01-31 16:29:36: DEBUG: configuring default isakmp port. 2005-01-31 16:29:36: DEBUG: 2 addrs are configured successfully 2005-01-31 16:29:36: INFO: 192.168.2.5[500] used as isakmp port (fd=6) 2005-01-31 16:29:36: INFO: 127.0.0.1[500] used as isakmp port (fd=7) 2005-01-31 16:29:36: DEBUG: get pfkey X_SPDDUMP message andi: libipsec/pfkey.c, pfkey_check: start (msg->sadb_msg_satype: 18) 2005-01-31 16:29:36: DEBUG: get pfkey X_SPDDUMP message andi: libipsec/pfkey.c, pfkey_check: start (msg->sadb_msg_satype: 18) 2005-01-31 16:29:36: DEBUG: sub:0xbff871a0: 192.168.2.5/32[0] 192.168.2.3/32[0] proto=any dir=out 2005-01-31 16:29:36: DEBUG: db :0x862a650: 192.168.2.3/32[0] 192.168.2.5/32[0] proto=any dir=in 2005-01-31 16:29:36: DEBUG: get pfkey X_SPDDUMP message andi: libipsec/pfkey.c, pfkey_check: start (msg->sadb_msg_satype: 18) 2005-01-31 16:29:36: DEBUG: sub:0xbff871a0: 192.168.2.3/32[0] 192.168.2.5/32[0] proto=any dir=fwd 2005-01-31 16:29:36: DEBUG: db :0x862a650: 192.168.2.3/32[0] 192.168.2.5/32[0] proto=any dir=in 2005-01-31 16:29:36: DEBUG: sub:0xbff871a0: 192.168.2.3/32[0] 192.168.2.5/32[0] proto=any dir=fwd 2005-01-31 16:29:36: DEBUG: db :0x862a9a8: 192.168.2.5/32[0] 192.168.2.3/32[0] proto=any dir=out 2005-01-31 16:29:56: DEBUG: get pfkey ACQUIRE message andi: libipsec/pfkey.c, pfkey_check: start (msg->sadb_msg_satype: 6) 2005-01-31 16:29:56: DEBUG: andi: pfkey.c, pk_recvacquire: start. 2005-01-31 16:29:56: DEBUG: suitable outbound SP found: 192.168.2.5/32[0] 192.168.2.3/32[0] proto=any dir=out. 2005-01-31 16:29:56: DEBUG: sub:0xbff87180: 192.168.2.3/32[0] 192.168.2.5/32[0] proto=any dir=in 2005-01-31 16:29:56: DEBUG: db :0x862a650: 192.168.2.3/32[0] 192.168.2.5/32[0] proto=any dir=in 2005-01-31 16:29:56: DEBUG: suitable inbound SP found: 192.168.2.3/32[0] 192.168.2.5/32[0] proto=any dir=in. 2005-01-31 16:29:56: INFO: andi: in pfkey.c, pk_recvacquire: n=0, iph2[n]->seq=2 2005-01-31 16:29:56: INFO: andi: spid=761, satype=3 2005-01-31 16:29:56: DEBUG: new acquire 192.168.2.5/32[0] 192.168.2.3/32[0] proto=any dir=out 2005-01-31 16:29:56: DEBUG: anonymous sainfo selected. 2005-01-31 16:29:56: DEBUG: (proto_id=AH spisize=4 spi=00000000 spi_p=00000000 encmode=Transport reqid=0:0) 2005-01-31 16:29:56: DEBUG: (trns_id=SHA authtype=hmac-sha) 2005-01-31 16:29:56: DEBUG: (proto_id=ESP spisize=4 spi=00000000 spi_p=00000000 encmode=Transport reqid=0:0) 2005-01-31 16:29:56: DEBUG: (trns_id=3DES encklen=0 authtype=hmac-sha) 2005-01-31 16:29:56: DEBUG: anonymous configuration selected for 192.168.2.3. 2005-01-31 16:29:56: INFO: IPsec-SA request for 192.168.2.3 queued due to no phase1 found. 2005-01-31 16:29:56: DEBUG: === 2005-01-31 16:29:56: INFO: initiate new phase 1 negotiation: 192.168.2.5[500]<=>192.168.2.3[500] 2005-01-31 16:29:56: INFO: begin Identity Protection mode. 2005-01-31 16:29:56: DEBUG: new cookie: 6c9b61569b3a8f1e 2005-01-31 16:29:56: DEBUG: add payload of len 48, next type 0 2005-01-31 16:29:56: DEBUG: 80 bytes from 192.168.2.5[500] to 192.168.2.3[500] 2005-01-31 16:29:56: DEBUG: sockname 192.168.2.5[500] 2005-01-31 16:29:56: DEBUG: send packet from 192.168.2.5[500] 2005-01-31 16:29:56: DEBUG: send packet to 192.168.2.3[500] 2005-01-31 16:29:56: DEBUG: src4 192.168.2.5[500] 2005-01-31 16:29:56: DEBUG: dst4 192.168.2.3[500] 2005-01-31 16:29:56: DEBUG: 1 times of 80 bytes message will be sent to 192.168.2.5[500] 2005-01-31 16:29:56: DEBUG: 6c9b6156 9b3a8f1e 00000000 00000000 01100200 00000000 00000050 00000034 00000001 00000001 00000028 01010001 00000020 01010000 800b0001 800c1c20 80010005 80030001 80020002 80040002 2005-01-31 16:29:56: DEBUG: resend phase1 packet 6c9b61569b3a8f1e:0000000000000000 2005-01-31 16:29:56: DEBUG: === 2005-01-31 16:29:56: DEBUG: 80 bytes message received from 192.168.2.3[500] to 192.168.2.5[500] 2005-01-31 16:29:56: DEBUG: 6c9b6156 9b3a8f1e be23bf6c 739326c6 01100200 00000000 00000050 00000034 00000001 00000001 00000028 01010001 00000020 01010000 800b0001 800c1c20 80010005 80030001 80020002 80040002 2005-01-31 16:29:56: DEBUG: begin. 2005-01-31 16:29:56: DEBUG: seen nptype=1(sa) 2005-01-31 16:29:56: DEBUG: succeed. 2005-01-31 16:29:56: DEBUG: total SA len=48 2005-01-31 16:29:56: DEBUG: 00000001 00000001 00000028 01010001 00000020 01010000 800b0001 800c1c20 80010005 80030001 80020002 80040002 2005-01-31 16:29:56: DEBUG: begin. 2005-01-31 16:29:56: DEBUG: seen nptype=2(prop) 2005-01-31 16:29:56: DEBUG: succeed. 2005-01-31 16:29:56: DEBUG: proposal #1 len=40 2005-01-31 16:29:56: DEBUG: begin. 2005-01-31 16:29:56: DEBUG: seen nptype=3(trns) 2005-01-31 16:29:56: DEBUG: succeed. 2005-01-31 16:29:56: DEBUG: transform #1 len=32 2005-01-31 16:29:56: DEBUG: type=Life Type, flag=0x8000, lorv=seconds 2005-01-31 16:29:56: DEBUG: type=Life Duration, flag=0x8000, lorv=7200 2005-01-31 16:29:56: DEBUG: type=Encryption Algorithm, flag=0x8000, lorv=3DES-CBC 2005-01-31 16:29:56: DEBUG: encryption(3des) 2005-01-31 16:29:56: DEBUG: type=Authentication Method, flag=0x8000, lorv=pre-shared key 2005-01-31 16:29:56: DEBUG: type=Hash Algorithm, flag=0x8000, lorv=SHA 2005-01-31 16:29:56: DEBUG: hash(sha1) 2005-01-31 16:29:56: DEBUG: type=Group Description, flag=0x8000, lorv=1024-bit MODP group 2005-01-31 16:29:56: DEBUG: hmac(modp1024) 2005-01-31 16:29:56: DEBUG: pair 1: 2005-01-31 16:29:56: DEBUG: 0x862b898: next=(nil) tnext=(nil) 2005-01-31 16:29:56: DEBUG: proposal #1: 1 transform 2005-01-31 16:29:56: DEBUG: prop#=1, prot-id=ISAKMP, spi-size=0, #trns=1 2005-01-31 16:29:56: DEBUG: trns#=1, trns-id=IKE 2005-01-31 16:29:56: DEBUG: type=Life Type, flag=0x8000, lorv=seconds 2005-01-31 16:29:56: DEBUG: type=Life Duration, flag=0x8000, lorv=7200 2005-01-31 16:29:56: DEBUG: type=Encryption Algorithm, flag=0x8000, lorv=3DES-CBC 2005-01-31 16:29:56: DEBUG: type=Authentication Method, flag=0x8000, lorv=pre-shared key 2005-01-31 16:29:56: DEBUG: type=Hash Algorithm, flag=0x8000, lorv=SHA 2005-01-31 16:29:56: DEBUG: type=Group Description, flag=0x8000, lorv=1024-bit MODP group 2005-01-31 16:29:56: DEBUG: Compared: DB:Peer 2005-01-31 16:29:56: DEBUG: (lifetime = 7200:7200) 2005-01-31 16:29:56: DEBUG: (lifebyte = 0:0) 2005-01-31 16:29:56: DEBUG: enctype = 3DES-CBC:3DES-CBC 2005-01-31 16:29:56: DEBUG: (encklen = 0:0) 2005-01-31 16:29:56: DEBUG: hashtype = SHA:SHA 2005-01-31 16:29:56: DEBUG: authmethod = pre-shared key:pre-shared key 2005-01-31 16:29:56: DEBUG: dh_group = 1024-bit MODP group:1024-bit MODP group 2005-01-31 16:29:56: DEBUG: an acceptable proposal found. 2005-01-31 16:29:56: DEBUG: hmac(modp1024) 2005-01-31 16:29:56: DEBUG: === 2005-01-31 16:29:56: DEBUG: compute DH's private. 2005-01-31 16:29:56: DEBUG: 60f7d969 73f80465 2ae88214 af0716e9 4f7f3925 aa2963a3 b982ad97 5870191f f4688758 763997f2 3d138df7 dcf765de d83b2b05 ca463837 5feda28b 8b884432 8f4581f3 3357caca 868d1595 49f8b049 802fe55a d75f7f2d e93d43f6 5174eee1 4cd02e4d f4a05f79 0de5add8 a6521e22 3ee09e57 c362b866 fb491411 17694feb 2005-01-31 16:29:56: DEBUG: compute DH's public. 2005-01-31 16:29:56: DEBUG: 3ea0f424 d7a63ac8 1ddfd00f 568f5241 76b06d85 f61391fb f673af15 27dd28e5 78990eec afdfb902 a7be1c40 fb1b14d3 79ce8030 34d67426 3cbff91b 05d4ac3a 1a647370 3521737a fa87dcd4 2ab4351d 5e007a59 d3deee78 635b5aa3 53621cc5 b4cd76d9 50595c1f b955e1ac 100c2d28 fb9c9174 e919e18e f72d3f58 192bb64f 2005-01-31 16:29:56: DEBUG: add payload of len 128, next type 10 2005-01-31 16:29:56: DEBUG: add payload of len 16, next type 0 2005-01-31 16:29:56: DEBUG: 180 bytes from 192.168.2.5[500] to 192.168.2.3[500] 2005-01-31 16:29:56: DEBUG: sockname 192.168.2.5[500] 2005-01-31 16:29:56: DEBUG: send packet from 192.168.2.5[500] 2005-01-31 16:29:56: DEBUG: send packet to 192.168.2.3[500] 2005-01-31 16:29:56: DEBUG: src4 192.168.2.5[500] 2005-01-31 16:29:56: DEBUG: dst4 192.168.2.3[500] 2005-01-31 16:29:56: DEBUG: 1 times of 180 bytes message will be sent to 192.168.2.5[500] 2005-01-31 16:29:56: DEBUG: 6c9b6156 9b3a8f1e be23bf6c 739326c6 04100200 00000000 000000b4 0a000084 3ea0f424 d7a63ac8 1ddfd00f 568f5241 76b06d85 f61391fb f673af15 27dd28e5 78990eec afdfb902 a7be1c40 fb1b14d3 79ce8030 34d67426 3cbff91b 05d4ac3a 1a647370 3521737a fa87dcd4 2ab4351d 5e007a59 d3deee78 635b5aa3 53621cc5 b4cd76d9 50595c1f b955e1ac 100c2d28 fb9c9174 e919e18e f72d3f58 192bb64f 00000014 ac4bbee1 f7b8f75e e83611f6 3644828e 2005-01-31 16:29:56: DEBUG: resend phase1 packet 6c9b61569b3a8f1e:be23bf6c739326c6 2005-01-31 16:29:56: DEBUG: === 2005-01-31 16:29:56: DEBUG: 180 bytes message received from 192.168.2.3[500] to 192.168.2.5[500] 2005-01-31 16:29:56: DEBUG: 6c9b6156 9b3a8f1e be23bf6c 739326c6 04100200 00000000 000000b4 0a000084 1f3e1c57 1edef355 839a4bd6 b99446ea 4dc4ad07 c2d67d0d ccdf3d12 b0a76896 2f5e9e44 a1043eed e14a8030 79a5aa71 bef01b18 8278f9c4 66bc49b9 8fece4b3 7729072e 2e5ec10e 42bf9a80 e6e1ad9d 1fb6e238 7af196f8 98ea5e8d 148071e1 e3e6967f 20510103 a517d98d 9e13ba6d abc970f9 52b58329 32228ceb fff14a13 00000014 ece04032 83a5d64c e3443a73 c64531ad 2005-01-31 16:29:56: DEBUG: begin. 2005-01-31 16:29:56: DEBUG: seen nptype=4(ke) 2005-01-31 16:29:56: DEBUG: seen nptype=10(nonce) 2005-01-31 16:29:56: DEBUG: succeed. 2005-01-31 16:29:56: DEBUG: === 2005-01-31 16:29:56: DEBUG: compute DH's shared. 2005-01-31 16:29:56: DEBUG: c6e02605 557a12bd 6f587688 3f8e2625 0353d200 9399d55d ffa60a72 9dd42a0a 3b041f36 555e03aa ef68b6dc e1d443cc 5561e805 58ea2fe0 57f9a996 73dc50f8 59d5c0b6 6106e7c9 468984b1 379bd2f5 9373fbb0 62982f27 931ddabf ca385290 e007dcac 7f558199 afd055e5 fa41c33a 016ec19a fc00b62e dd039f20 c7e708e8 2005-01-31 16:29:56: DEBUG: the psk found. 2005-01-31 16:29:56: DEBUG: nonce 1: 2005-01-31 16:29:56: DEBUG: ac4bbee1 f7b8f75e e83611f6 3644828e 2005-01-31 16:29:56: DEBUG: nonce 2: 2005-01-31 16:29:56: DEBUG: ece04032 83a5d64c e3443a73 c64531ad 2005-01-31 16:29:56: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:56: DEBUG: SKEYID computed: 2005-01-31 16:29:56: DEBUG: 003bb469 b8f3a172 7b6f780c 5d393a0b 9329baeb 2005-01-31 16:29:56: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:56: DEBUG: SKEYID_d computed: 2005-01-31 16:29:56: DEBUG: 2a712766 e9180f0c 7cc89731 da3c10ad 7569efbc 2005-01-31 16:29:56: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:56: DEBUG: SKEYID_a computed: 2005-01-31 16:29:56: DEBUG: bc9a9f36 417e3df8 394f1b76 75df267b 6d46a745 2005-01-31 16:29:56: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:56: DEBUG: SKEYID_e computed: 2005-01-31 16:29:56: DEBUG: 570541d4 6a6ad98d 26642038 da9bf06b d12e42c2 2005-01-31 16:29:56: DEBUG: encryption(3des) 2005-01-31 16:29:56: DEBUG: hash(sha1) 2005-01-31 16:29:56: DEBUG: len(SKEYID_e) < len(Ka) (20 < 24), generating long key (Ka = K1 | K2 | ...) 2005-01-31 16:29:56: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:56: DEBUG: compute intermediate encryption key K1 2005-01-31 16:29:56: DEBUG: 00 2005-01-31 16:29:56: DEBUG: 87950d10 c43b3cc4 5f8c71c1 0abde5ae 611d58e8 2005-01-31 16:29:56: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:56: DEBUG: compute intermediate encryption key K2 2005-01-31 16:29:56: DEBUG: 87950d10 c43b3cc4 5f8c71c1 0abde5ae 611d58e8 2005-01-31 16:29:56: DEBUG: f3ac42fa 685f0c8d 18924d32 b7f52bb5 5326d31a 2005-01-31 16:29:56: DEBUG: final encryption key computed: 2005-01-31 16:29:56: DEBUG: 87950d10 c43b3cc4 5f8c71c1 0abde5ae 611d58e8 f3ac42fa 2005-01-31 16:29:56: DEBUG: hash(sha1) 2005-01-31 16:29:56: DEBUG: encryption(3des) 2005-01-31 16:29:56: DEBUG: IV computed: 2005-01-31 16:29:56: DEBUG: 29a8fe0b 68b537b7 2005-01-31 16:29:56: DEBUG: use ID type of IPv4_address 2005-01-31 16:29:56: DEBUG: HASH with: 2005-01-31 16:29:56: DEBUG: 3ea0f424 d7a63ac8 1ddfd00f 568f5241 76b06d85 f61391fb f673af15 27dd28e5 78990eec afdfb902 a7be1c40 fb1b14d3 79ce8030 34d67426 3cbff91b 05d4ac3a 1a647370 3521737a fa87dcd4 2ab4351d 5e007a59 d3deee78 635b5aa3 53621cc5 b4cd76d9 50595c1f b955e1ac 100c2d28 fb9c9174 e919e18e f72d3f58 192bb64f 1f3e1c57 1edef355 839a4bd6 b99446ea 4dc4ad07 c2d67d0d ccdf3d12 b0a76896 2f5e9e44 a1043eed e14a8030 79a5aa71 bef01b18 8278f9c4 66bc49b9 8fece4b3 7729072e 2e5ec10e 42bf9a80 e6e1ad9d 1fb6e238 7af196f8 98ea5e8d 148071e1 e3e6967f 20510103 a517d98d 9e13ba6d abc970f9 52b58329 32228ceb fff14a13 6c9b6156 9b3a8f1e be23bf6c 739326c6 00000001 00000001 00000028 01010001 00000020 01010000 800b0001 800c1c20 80010005 80030001 80020002 80040002 011101f4 c0a80205 2005-01-31 16:29:56: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:56: DEBUG: HASH computed: 2005-01-31 16:29:56: DEBUG: 39be6a33 3e209d6a 5ccd53f4 1b08ec90 36e5da92 2005-01-31 16:29:56: DEBUG: add payload of len 8, next type 8 2005-01-31 16:29:56: DEBUG: add payload of len 20, next type 0 2005-01-31 16:29:56: DEBUG: begin encryption. 2005-01-31 16:29:56: DEBUG: encryption(3des) 2005-01-31 16:29:56: DEBUG: pad length = 4 2005-01-31 16:29:56: DEBUG: 0800000c 011101f4 c0a80205 00000018 39be6a33 3e209d6a 5ccd53f4 1b08ec90 36e5da92 b9a68703 2005-01-31 16:29:56: DEBUG: encryption(3des) 2005-01-31 16:29:56: DEBUG: with key: 2005-01-31 16:29:56: DEBUG: 87950d10 c43b3cc4 5f8c71c1 0abde5ae 611d58e8 f3ac42fa 2005-01-31 16:29:56: DEBUG: encrypted payload by IV: 2005-01-31 16:29:56: DEBUG: 29a8fe0b 68b537b7 2005-01-31 16:29:56: DEBUG: save IV for next: 2005-01-31 16:29:56: DEBUG: 2b125b91 7a8b9ebd 2005-01-31 16:29:56: DEBUG: encrypted. 2005-01-31 16:29:56: DEBUG: 68 bytes from 192.168.2.5[500] to 192.168.2.3[500] 2005-01-31 16:29:56: DEBUG: sockname 192.168.2.5[500] 2005-01-31 16:29:56: DEBUG: send packet from 192.168.2.5[500] 2005-01-31 16:29:56: DEBUG: send packet to 192.168.2.3[500] 2005-01-31 16:29:56: DEBUG: src4 192.168.2.5[500] 2005-01-31 16:29:56: DEBUG: dst4 192.168.2.3[500] 2005-01-31 16:29:56: DEBUG: 1 times of 68 bytes message will be sent to 192.168.2.5[500] 2005-01-31 16:29:56: DEBUG: 6c9b6156 9b3a8f1e be23bf6c 739326c6 05100201 00000000 00000044 5ec981b2 fdd33b68 1544c131 964fe8e2 64df498c 597b4959 4d8972b0 7bfe3c9d 2b125b91 7a8b9ebd 2005-01-31 16:29:56: DEBUG: resend phase1 packet 6c9b61569b3a8f1e:be23bf6c739326c6 2005-01-31 16:29:56: DEBUG: === 2005-01-31 16:29:56: DEBUG: 68 bytes message received from 192.168.2.3[500] to 192.168.2.5[500] 2005-01-31 16:29:56: DEBUG: 6c9b6156 9b3a8f1e be23bf6c 739326c6 05100201 00000000 00000044 65138087 62f9b823 ad529137 0ead6d2a b9159dc1 c1485032 89d39648 aba88945 ec7dbbee 437705e2 2005-01-31 16:29:56: DEBUG: begin decryption. 2005-01-31 16:29:56: DEBUG: encryption(3des) 2005-01-31 16:29:56: DEBUG: IV was saved for next processing: 2005-01-31 16:29:56: DEBUG: ec7dbbee 437705e2 2005-01-31 16:29:56: DEBUG: encryption(3des) 2005-01-31 16:29:56: DEBUG: with key: 2005-01-31 16:29:56: DEBUG: 87950d10 c43b3cc4 5f8c71c1 0abde5ae 611d58e8 f3ac42fa 2005-01-31 16:29:56: DEBUG: decrypted payload by IV: 2005-01-31 16:29:56: DEBUG: 2b125b91 7a8b9ebd 2005-01-31 16:29:56: DEBUG: decrypted payload, but not trimed. 2005-01-31 16:29:56: DEBUG: 0800000c 011101f4 c0a80203 00000018 66059430 a61e698c 6a09b8c8 9c40bc2e fd51bfb2 ebf9a403 2005-01-31 16:29:56: DEBUG: padding len=4 2005-01-31 16:29:56: DEBUG: skip to trim padding. 2005-01-31 16:29:56: DEBUG: decrypted. 2005-01-31 16:29:56: DEBUG: 6c9b6156 9b3a8f1e be23bf6c 739326c6 05100201 00000000 00000044 0800000c 011101f4 c0a80203 00000018 66059430 a61e698c 6a09b8c8 9c40bc2e fd51bfb2 ebf9a403 2005-01-31 16:29:56: DEBUG: begin. 2005-01-31 16:29:56: DEBUG: seen nptype=5(id) 2005-01-31 16:29:56: DEBUG: seen nptype=8(hash) 2005-01-31 16:29:56: DEBUG: succeed. 2005-01-31 16:29:56: DEBUG: HASH received:2005-01-31 16:29:56: DEBUG: 66059430 a61e698c 6a09b8c8 9c40bc2e fd51bfb2 2005-01-31 16:29:56: DEBUG: HASH with: 2005-01-31 16:29:56: DEBUG: 1f3e1c57 1edef355 839a4bd6 b99446ea 4dc4ad07 c2d67d0d ccdf3d12 b0a76896 2f5e9e44 a1043eed e14a8030 79a5aa71 bef01b18 8278f9c4 66bc49b9 8fece4b3 7729072e 2e5ec10e 42bf9a80 e6e1ad9d 1fb6e238 7af196f8 98ea5e8d 148071e1 e3e6967f 20510103 a517d98d 9e13ba6d abc970f9 52b58329 32228ceb fff14a13 3ea0f424 d7a63ac8 1ddfd00f 568f5241 76b06d85 f61391fb f673af15 27dd28e5 78990eec afdfb902 a7be1c40 fb1b14d3 79ce8030 34d67426 3cbff91b 05d4ac3a 1a647370 3521737a fa87dcd4 2ab4351d 5e007a59 d3deee78 635b5aa3 53621cc5 b4cd76d9 50595c1f b955e1ac 100c2d28 fb9c9174 e919e18e f72d3f58 192bb64f be23bf6c 739326c6 6c9b6156 9b3a8f1e 00000001 00000001 00000028 01010001 00000020 01010000 800b0001 800c1c20 80010005 80030001 80020002 80040002 011101f4 c0a80203 2005-01-31 16:29:56: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:56: DEBUG: HASH computed: 2005-01-31 16:29:56: DEBUG: 66059430 a61e698c 6a09b8c8 9c40bc2e fd51bfb2 2005-01-31 16:29:56: DEBUG: HASH for PSK validated. 2005-01-31 16:29:56: DEBUG: peer's ID:2005-01-31 16:29:56: DEBUG: 011101f4 c0a80203 2005-01-31 16:29:56: DEBUG: === 2005-01-31 16:29:56: DEBUG: compute IV for phase2 2005-01-31 16:29:56: DEBUG: phase1 last IV: 2005-01-31 16:29:56: DEBUG: ec7dbbee 437705e2 89f3c58d 2005-01-31 16:29:56: DEBUG: hash(sha1) 2005-01-31 16:29:56: DEBUG: encryption(3des) 2005-01-31 16:29:56: DEBUG: phase2 IV computed: 2005-01-31 16:29:56: DEBUG: 3fa6b89d 32e87d86 2005-01-31 16:29:56: DEBUG: HASH with: 2005-01-31 16:29:56: DEBUG: 89f3c58d 0000001c 00000001 01106002 6c9b6156 9b3a8f1e be23bf6c 739326c6 2005-01-31 16:29:56: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:56: DEBUG: HASH computed: 2005-01-31 16:29:56: DEBUG: 7ed2c692 3fe16dd2 e46593a9 573d6a88 a510128d 2005-01-31 16:29:56: DEBUG: begin encryption. 2005-01-31 16:29:56: DEBUG: encryption(3des) 2005-01-31 16:29:56: DEBUG: pad length = 4 2005-01-31 16:29:56: DEBUG: 0b000018 7ed2c692 3fe16dd2 e46593a9 573d6a88 a510128d 0000001c 00000001 01106002 6c9b6156 9b3a8f1e be23bf6c 739326c6 d6ca9b03 2005-01-31 16:29:56: DEBUG: encryption(3des) 2005-01-31 16:29:56: DEBUG: with key: 2005-01-31 16:29:56: DEBUG: 87950d10 c43b3cc4 5f8c71c1 0abde5ae 611d58e8 f3ac42fa 2005-01-31 16:29:56: DEBUG: encrypted payload by IV: 2005-01-31 16:29:56: DEBUG: 3fa6b89d 32e87d86 2005-01-31 16:29:56: DEBUG: save IV for next: 2005-01-31 16:29:56: DEBUG: e2bed52a dea2cc72 2005-01-31 16:29:56: DEBUG: encrypted. 2005-01-31 16:29:56: DEBUG: 84 bytes from 192.168.2.5[500] to 192.168.2.3[500] 2005-01-31 16:29:56: DEBUG: sockname 192.168.2.5[500] 2005-01-31 16:29:56: DEBUG: send packet from 192.168.2.5[500] 2005-01-31 16:29:56: DEBUG: send packet to 192.168.2.3[500] 2005-01-31 16:29:56: DEBUG: src4 192.168.2.5[500] 2005-01-31 16:29:56: DEBUG: dst4 192.168.2.3[500] 2005-01-31 16:29:56: DEBUG: 1 times of 84 bytes message will be sent to 192.168.2.5[500] 2005-01-31 16:29:56: DEBUG: 6c9b6156 9b3a8f1e be23bf6c 739326c6 08100501 89f3c58d 00000054 fbdc170e 36e67786 e622c244 8a878f1f b7fbbef4 4642efc4 9cf67fa5 da0495b1 3620a46d 52dea759 6d57815f 0ca417f8 e2bed52a dea2cc72 2005-01-31 16:29:56: DEBUG: sendto Information notify. 2005-01-31 16:29:56: INFO: ISAKMP-SA established 192.168.2.5[500]-192.168.2.3[500] spi:6c9b61569b3a8f1e:be23bf6c739326c6 2005-01-31 16:29:56: DEBUG: === 2005-01-31 16:29:56: DEBUG: === 2005-01-31 16:29:56: DEBUG: 84 bytes message received from 192.168.2.3[500] to 192.168.2.5[500] 2005-01-31 16:29:56: DEBUG: 6c9b6156 9b3a8f1e be23bf6c 739326c6 08100501 91e46358 00000054 40d05ae5 185847e2 164bcd53 5b6939e4 9a4acda0 dd2dd242 2e8d4672 a4ae182c bf25a4f2 10297d6b fb884828 0386e672 a66fc0a6 98ff04f7 2005-01-31 16:29:56: DEBUG: receive Information. 2005-01-31 16:29:56: DEBUG: compute IV for phase2 2005-01-31 16:29:56: DEBUG: phase1 last IV: 2005-01-31 16:29:56: DEBUG: ec7dbbee 437705e2 91e46358 2005-01-31 16:29:56: DEBUG: hash(sha1) 2005-01-31 16:29:56: DEBUG: encryption(3des) 2005-01-31 16:29:56: DEBUG: phase2 IV computed: 2005-01-31 16:29:56: DEBUG: f017f542 91fd6b14 2005-01-31 16:29:56: DEBUG: begin decryption. 2005-01-31 16:29:56: DEBUG: encryption(3des) 2005-01-31 16:29:56: DEBUG: IV was saved for next processing: 2005-01-31 16:29:56: DEBUG: a66fc0a6 98ff04f7 2005-01-31 16:29:56: DEBUG: encryption(3des) 2005-01-31 16:29:56: DEBUG: with key: 2005-01-31 16:29:56: DEBUG: 87950d10 c43b3cc4 5f8c71c1 0abde5ae 611d58e8 f3ac42fa 2005-01-31 16:29:56: DEBUG: decrypted payload by IV: 2005-01-31 16:29:56: DEBUG: f017f542 91fd6b14 2005-01-31 16:29:56: DEBUG: decrypted payload, but not trimed. 2005-01-31 16:29:56: DEBUG: 0b000018 94d8c097 8b1c2814 0426019c 931a39c2 c60f66cf 0000001c 00000001 01106002 6c9b6156 9b3a8f1e be23bf6c 739326c6 c6ebef03 2005-01-31 16:29:56: DEBUG: padding len=4 2005-01-31 16:29:56: DEBUG: skip to trim padding. 2005-01-31 16:29:56: DEBUG: decrypted. 2005-01-31 16:29:56: DEBUG: 6c9b6156 9b3a8f1e be23bf6c 739326c6 08100501 91e46358 00000054 0b000018 94d8c097 8b1c2814 0426019c 931a39c2 c60f66cf 0000001c 00000001 01106002 6c9b6156 9b3a8f1e be23bf6c 739326c6 c6ebef03 2005-01-31 16:29:56: DEBUG: HASH with: 2005-01-31 16:29:56: DEBUG: 91e46358 0000001c 00000001 01106002 6c9b6156 9b3a8f1e be23bf6c 739326c6 2005-01-31 16:29:56: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:56: DEBUG: HASH computed: 2005-01-31 16:29:56: DEBUG: 94d8c097 8b1c2814 0426019c 931a39c2 c60f66cf 2005-01-31 16:29:56: DEBUG: hash validated. 2005-01-31 16:29:56: DEBUG: begin. 2005-01-31 16:29:56: DEBUG: seen nptype=8(hash) 2005-01-31 16:29:56: DEBUG: seen nptype=11(notify) 2005-01-31 16:29:56: DEBUG: succeed. 2005-01-31 16:29:56: DEBUG: call pfkey_send_dump andi: libipsec/pfkey.c, pfkey_setsadbmsg: (p->type: 10, p->sadb_msg_satype: 0, seq: 0) andi: libipsec/pfkey.c, pfkey_check: start (msg->sadb_msg_satype: 10) 2005-01-31 16:29:56: DEBUG: notification message 24578:INITIAL-CONTACT, doi=1 proto_id=1 spi=6c9b61569b3a8f1e be23bf6c739326c6 (size=16). 2005-01-31 16:29:57: DEBUG: === 2005-01-31 16:29:57: DEBUG: begin QUICK mode. 2005-01-31 16:29:57: INFO: initiate new phase 2 negotiation: 192.168.2.5[0]<=>192.168.2.3[0] 2005-01-31 16:29:57: DEBUG: compute IV for phase2 2005-01-31 16:29:57: DEBUG: phase1 last IV: 2005-01-31 16:29:57: DEBUG: ec7dbbee 437705e2 c4e55a01 2005-01-31 16:29:57: DEBUG: hash(sha1) 2005-01-31 16:29:57: DEBUG: encryption(3des) 2005-01-31 16:29:57: DEBUG: phase2 IV computed: 2005-01-31 16:29:57: DEBUG: 73c9a87b d8ffd124 2005-01-31 16:29:57: DEBUG: andi: pfkey.c, pfkey_send_getspi (pr->proto_id: 2,iph2->seq: 2) andi: libipsec/pfkey.c, pfkey_send_getspi: (satype: 2, seq: 2) andi: libipsec/pfkey.c, pfkey_setsadbmsg: (p->type: 1, p->sadb_msg_satype: 2, seq: 2) 2005-01-31 16:29:57: DEBUG: pfkey GETSPI sent: AH/Transport 192.168.2.3->192.168.2.5 2005-01-31 16:29:57: DEBUG: andi: pfkey.c, pfkey_send_getspi (pr->proto_id: 3,iph2->seq: 2) andi: libipsec/pfkey.c, pfkey_send_getspi: (satype: 3, seq: 2) andi: libipsec/pfkey.c, pfkey_setsadbmsg: (p->type: 1, p->sadb_msg_satype: 3, seq: 2) 2005-01-31 16:29:57: DEBUG: pfkey GETSPI sent: ESP/Transport 192.168.2.3->192.168.2.5 2005-01-31 16:29:57: DEBUG: pfkey getspi sent. 2005-01-31 16:29:57: DEBUG: get pfkey GETSPI message andi: libipsec/pfkey.c, pfkey_check: start (msg->sadb_msg_satype: 1) 2005-01-31 16:29:57: DEBUG: andi: pfkey.c, pk_recvgetspi: msg->sadb_msg_seq 2, msg->sadb_msg_type: GETSPI . 2005-01-31 16:29:57: DEBUG: pfkey GETSPI succeeded: AH/Transport 192.168.2.3->192.168.2.5 spi=123055453(0x755ad5d) 2005-01-31 16:29:57: DEBUG: get pfkey GETSPI message andi: libipsec/pfkey.c, pfkey_check: start (msg->sadb_msg_satype: 1) 2005-01-31 16:29:57: DEBUG: andi: pfkey.c, pk_recvgetspi: msg->sadb_msg_seq 2, msg->sadb_msg_type: GETSPI . 2005-01-31 16:29:57: DEBUG: pfkey GETSPI succeeded: ESP/Transport 192.168.2.3->192.168.2.5 spi=145448323(0x8ab5d83) 2005-01-31 16:29:57: DEBUG: hmac(modp1024) 2005-01-31 16:29:57: DEBUG: hmac(modp1024) 2005-01-31 16:29:57: DEBUG: hmac(modp1024) 2005-01-31 16:29:57: DEBUG: hmac(modp1024) 2005-01-31 16:29:57: DEBUG: hmac(modp1024) 2005-01-31 16:29:57: DEBUG: compute DH's private. 2005-01-31 16:29:57: DEBUG: 60e938bd 0b04792b aa801034 9ada06ff 6717a03b 678f58e8 19435bfc 64545c75 dd0c94ee 53f94709 ef7d052b 2bfc4be4 8a6ad828 9f5a067b 6d03b2a3 0e158e1a d9bb66d3 506d56d0 a8693f1d 1f77d9a0 ad3cd620 8a7b324d 4e88d63a 61fbd904 ff23138b defbb198 abc5addd 7d878ed3 c05ef310 8be0c616 b958d33f af9f90d1 2005-01-31 16:29:57: DEBUG: compute DH's public. 2005-01-31 16:29:57: DEBUG: 8c92aea1 d09291fd 7563aa3a 5ae7d084 647e501d c8076dd7 b1090266 e3597ca4 5c637f44 6cfa73d5 feb5e271 e0a9db3e 44194000 1eee073e c9eeae5d 028820c5 b8271142 d78a2532 fb2d89f5 eeece32a 46c53178 22c6b0ce 710169ef b64aa667 f94dbfa1 c750c75b 0b7c39f7 8c6d2f3a 067d7b3a d5297cef afc98c46 5fa8362e 2005-01-31 16:29:57: DEBUG: use local ID type IPv4_address 2005-01-31 16:29:57: DEBUG: use remote ID type IPv4_address 2005-01-31 16:29:57: DEBUG: IDci:2005-01-31 16:29:57: DEBUG: 01000000 c0a80205 2005-01-31 16:29:57: DEBUG: IDcr:2005-01-31 16:29:57: DEBUG: 01000000 c0a80203 2005-01-31 16:29:57: DEBUG: add payload of len 88, next type 10 2005-01-31 16:29:57: DEBUG: add payload of len 16, next type 4 2005-01-31 16:29:57: DEBUG: add payload of len 128, next type 0 2005-01-31 16:29:57: DEBUG: HASH with: 2005-01-31 16:29:57: DEBUG: c4e55a01 0a00005c 00000001 00000001 02000028 01020401 0755ad5d 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 00000028 01030401 08ab5d83 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 04000014 e8df8a9c e76da0a2 8c0e0a3a 917629d1 00000084 8c92aea1 d09291fd 7563aa3a 5ae7d084 647e501d c8076dd7 b1090266 e3597ca4 5c637f44 6cfa73d5 feb5e271 e0a9db3e 44194000 1eee073e c9eeae5d 028820c5 b8271142 d78a2532 fb2d89f5 eeece32a 46c53178 22c6b0ce 710169ef b64aa667 f94dbfa1 c750c75b 0b7c39f7 8c6d2f3a 067d7b3a d5297cef afc98c46 5fa8362e 2005-01-31 16:29:57: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:57: DEBUG: HASH computed: 2005-01-31 16:29:57: DEBUG: 6d65b5de 76e1803e f81592ab caf886b4 be40871b 2005-01-31 16:29:57: DEBUG: add payload of len 20, next type 1 2005-01-31 16:29:57: DEBUG: begin encryption. 2005-01-31 16:29:57: DEBUG: encryption(3des) 2005-01-31 16:29:57: DEBUG: pad length = 4 2005-01-31 16:29:57: DEBUG: 01000018 6d65b5de 76e1803e f81592ab caf886b4 be40871b 0a00005c 00000001 00000001 02000028 01020401 0755ad5d 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 00000028 01030401 08ab5d83 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 04000014 e8df8a9c e76da0a2 8c0e0a3a 917629d1 00000084 8c92aea1 d09291fd 7563aa3a 5ae7d084 647e501d c8076dd7 b1090266 e3597ca4 5c637f44 6cfa73d5 feb5e271 e0a9db3e 44194000 1eee073e c9eeae5d 028820c5 b8271142 d78a2532 fb2d89f5 eeece32a 46c53178 22c6b0ce 710169ef b64aa667 f94dbfa1 c750c75b 0b7c39f7 8c6d2f3a 067d7b3a d5297cef afc98c46 5fa8362e b6f9b003 2005-01-31 16:29:57: DEBUG: encryption(3des) 2005-01-31 16:29:57: DEBUG: with key: 2005-01-31 16:29:57: DEBUG: 87950d10 c43b3cc4 5f8c71c1 0abde5ae 611d58e8 f3ac42fa 2005-01-31 16:29:57: DEBUG: encrypted payload by IV: 2005-01-31 16:29:57: DEBUG: 73c9a87b d8ffd124 2005-01-31 16:29:57: DEBUG: save IV for next: 2005-01-31 16:29:57: DEBUG: a9c4ad5d d5b949ec 2005-01-31 16:29:57: DEBUG: encrypted. 2005-01-31 16:29:57: DEBUG: 300 bytes from 192.168.2.5[500] to 192.168.2.3[500] 2005-01-31 16:29:57: DEBUG: sockname 192.168.2.5[500] 2005-01-31 16:29:57: DEBUG: send packet from 192.168.2.5[500] 2005-01-31 16:29:57: DEBUG: send packet to 192.168.2.3[500] 2005-01-31 16:29:57: DEBUG: src4 192.168.2.5[500] 2005-01-31 16:29:57: DEBUG: dst4 192.168.2.3[500] 2005-01-31 16:29:57: DEBUG: 1 times of 300 bytes message will be sent to 192.168.2.5[500] 2005-01-31 16:29:57: DEBUG: 6c9b6156 9b3a8f1e be23bf6c 739326c6 08102001 c4e55a01 0000012c 41df7dab e4a5ba24 4c1bd87f cafa84c1 09eef1b9 7915f73f dac141df bad2f8f1 2e7c7ce0 a4a64cb1 53d483cd b0d107d1 7f422ce6 6ba67296 75377a3d 508bf8fc fedfa848 9ad5aecd 33c07338 90b15431 2a840698 2009a171 bee12883 08ef50e8 11ae3b11 a9bc6e20 650eeb27 8d28fa6f 1b7f2fcb ef20ad59 f5db4d80 95a8f171 dbe1ac88 d83cfe31 8f36a813 98d11b5b ae1906d6 d1d67e15 4ebd391d 5d905ed0 0ae0f9b0 b937b75c 1d090898 2aa8ff25 1d88ab7d 9381a64d 7d75c60b 3b50af96 e0d0f6e2 3b1587bc 5d1015c0 192be00d 54e9b176 84433135 cf864421 d4b28693 725b7b04 83b3228a 9372e46b 6a217c5b 073041e2 3e3f08d3 694eecf8 f6164fc4 3422e096 a0e3b7c0 a9c4ad5d d5b949ec 2005-01-31 16:29:57: DEBUG: resend phase2 packet 6c9b61569b3a8f1e:be23bf6c739326c6:0000c4e5 2005-01-31 16:29:57: DEBUG: === 2005-01-31 16:29:57: DEBUG: 300 bytes message received from 192.168.2.3[500] to 192.168.2.5[500] 2005-01-31 16:29:57: DEBUG: 6c9b6156 9b3a8f1e be23bf6c 739326c6 08102001 c4e55a01 0000012c ce32691f 8cf44de0 889917dc 08aa06c2 271d8aaf e7d246bc 3fa85a25 1151258e c6e81816 eb2246c9 29497519 aba00c21 17bedc93 b49612d4 39add46c 9d98d032 7f39c23c 3634f729 1dc8521b b92c01d0 51d10b64 8e30b188 b2972363 50d1df7d f5e64f08 68ae0a7e 0fc3ecd4 4cb39f26 8f2b72ba 4c81ee16 2981af19 6cb3f957 fd089b5e 532b2703 045b3f36 937c75eb 9c62b38c 20f4124a 06c0d87e ed1b603a a9f02576 fd006c7e cc6d1d84 65e9a178 becff6d3 14ba368b 804c993a b3433a63 a7f5aad7 578c915b 9c477a1c e2792319 ca6717ca 99fc475b 30bcce57 344cafa7 633ffb26 87637a41 348a4b52 9743f8f4 b7282b7f f573c1e8 acfce30e 5889a3da 820295cd d212267c 4fa7b500 01a65080 2005-01-31 16:29:57: DEBUG: begin decryption. 2005-01-31 16:29:57: DEBUG: encryption(3des) 2005-01-31 16:29:57: DEBUG: IV was saved for next processing: 2005-01-31 16:29:57: DEBUG: 4fa7b500 01a65080 2005-01-31 16:29:57: DEBUG: encryption(3des) 2005-01-31 16:29:57: DEBUG: with key: 2005-01-31 16:29:57: DEBUG: 87950d10 c43b3cc4 5f8c71c1 0abde5ae 611d58e8 f3ac42fa 2005-01-31 16:29:57: DEBUG: decrypted payload by IV: 2005-01-31 16:29:57: DEBUG: a9c4ad5d d5b949ec 2005-01-31 16:29:57: DEBUG: decrypted payload, but not trimed. 2005-01-31 16:29:57: DEBUG: 01000018 380ea746 6ae0ae2c 85ae1028 0de177dd 0d1641e4 0a00005c 00000001 00000001 02000028 01020401 0b02099a 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 00000028 01030401 0630e761 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 04000014 e96f29c8 6a300328 08b33126 f4cb4093 00000084 817cb76e 24ad3957 420f2480 3896017c 763c6b92 f22b6370 99afb7b9 00f322a8 d226f566 2eed3952 505c8c09 e6268dbe c6f2289a eef9b5d1 cdd5fe02 edaeb785 9debe28e 7e18da13 9d8362f3 f0d1a6b0 3e8c2db8 75cf093a abd2aad9 0983bed7 8409dd12 e37dd22d 69589355 17e83f06 b7bd4e86 74130982 4515324b 7dfcd2d4 f0a28e03 2005-01-31 16:29:57: DEBUG: padding len=4 2005-01-31 16:29:57: DEBUG: skip to trim padding. 2005-01-31 16:29:57: DEBUG: decrypted. 2005-01-31 16:29:57: DEBUG: 6c9b6156 9b3a8f1e be23bf6c 739326c6 08102001 c4e55a01 0000012c 01000018 380ea746 6ae0ae2c 85ae1028 0de177dd 0d1641e4 0a00005c 00000001 00000001 02000028 01020401 0b02099a 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 00000028 01030401 0630e761 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 04000014 e96f29c8 6a300328 08b33126 f4cb4093 00000084 817cb76e 24ad3957 420f2480 3896017c 763c6b92 f22b6370 99afb7b9 00f322a8 d226f566 2eed3952 505c8c09 e6268dbe c6f2289a eef9b5d1 cdd5fe02 edaeb785 9debe28e 7e18da13 9d8362f3 f0d1a6b0 3e8c2db8 75cf093a abd2aad9 0983bed7 8409dd12 e37dd22d 69589355 17e83f06 b7bd4e86 74130982 4515324b 7dfcd2d4 f0a28e03 2005-01-31 16:29:57: DEBUG: begin. 2005-01-31 16:29:57: DEBUG: seen nptype=8(hash) 2005-01-31 16:29:57: DEBUG: seen nptype=1(sa) 2005-01-31 16:29:57: DEBUG: seen nptype=10(nonce) 2005-01-31 16:29:57: DEBUG: seen nptype=4(ke) 2005-01-31 16:29:57: DEBUG: succeed. 2005-01-31 16:29:57: DEBUG: HASH allocated:hbuf->l=288 actual:tlen=260 2005-01-31 16:29:57: DEBUG: HASH(2) received:2005-01-31 16:29:57: DEBUG: 380ea746 6ae0ae2c 85ae1028 0de177dd 0d1641e4 2005-01-31 16:29:57: DEBUG: HASH with: 2005-01-31 16:29:57: DEBUG: c4e55a01 e8df8a9c e76da0a2 8c0e0a3a 917629d1 0a00005c 00000001 00000001 02000028 01020401 0b02099a 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 00000028 01030401 0630e761 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 04000014 e96f29c8 6a300328 08b33126 f4cb4093 00000084 817cb76e 24ad3957 420f2480 3896017c 763c6b92 f22b6370 99afb7b9 00f322a8 d226f566 2eed3952 505c8c09 e6268dbe c6f2289a eef9b5d1 cdd5fe02 edaeb785 9debe28e 7e18da13 9d8362f3 f0d1a6b0 3e8c2db8 75cf093a abd2aad9 0983bed7 8409dd12 e37dd22d 69589355 17e83f06 b7bd4e86 74130982 4515324b 7dfcd2d4 2005-01-31 16:29:57: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:57: DEBUG: HASH computed: 2005-01-31 16:29:57: DEBUG: 380ea746 6ae0ae2c 85ae1028 0de177dd 0d1641e4 2005-01-31 16:29:57: DEBUG: total SA len=88 2005-01-31 16:29:57: DEBUG: 00000001 00000001 02000028 01020401 0755ad5d 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 00000028 01030401 08ab5d83 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 2005-01-31 16:29:57: DEBUG: begin. 2005-01-31 16:29:57: DEBUG: seen nptype=2(prop) 2005-01-31 16:29:57: DEBUG: seen nptype=2(prop) 2005-01-31 16:29:57: DEBUG: succeed. 2005-01-31 16:29:57: DEBUG: proposal #1 len=40 2005-01-31 16:29:57: DEBUG: begin. 2005-01-31 16:29:57: DEBUG: seen nptype=3(trns) 2005-01-31 16:29:57: DEBUG: succeed. 2005-01-31 16:29:57: DEBUG: transform #1 len=28 2005-01-31 16:29:57: DEBUG: type=SA Life Type, flag=0x8000, lorv=seconds 2005-01-31 16:29:57: DEBUG: type=SA Life Duration, flag=0x8000, lorv=3600 2005-01-31 16:29:57: DEBUG: life duration was in TLV. 2005-01-31 16:29:57: DEBUG: type=Encryption Mode, flag=0x8000, lorv=Transport 2005-01-31 16:29:57: DEBUG: type=Authentication Algorithm, flag=0x8000, lorv=hmac-sha 2005-01-31 16:29:57: DEBUG: type=Group Description, flag=0x8000, lorv=2 2005-01-31 16:29:57: DEBUG: hmac(modp1024) 2005-01-31 16:29:57: DEBUG: proposal #1 len=40 2005-01-31 16:29:57: DEBUG: begin. 2005-01-31 16:29:57: DEBUG: seen nptype=3(trns) 2005-01-31 16:29:57: DEBUG: succeed. 2005-01-31 16:29:57: DEBUG: transform #1 len=28 2005-01-31 16:29:57: DEBUG: type=SA Life Type, flag=0x8000, lorv=seconds 2005-01-31 16:29:57: DEBUG: type=SA Life Duration, flag=0x8000, lorv=3600 2005-01-31 16:29:57: DEBUG: life duration was in TLV. 2005-01-31 16:29:57: DEBUG: type=Encryption Mode, flag=0x8000, lorv=Transport 2005-01-31 16:29:57: DEBUG: type=Authentication Algorithm, flag=0x8000, lorv=hmac-sha 2005-01-31 16:29:57: DEBUG: type=Group Description, flag=0x8000, lorv=2 2005-01-31 16:29:57: DEBUG: hmac(modp1024) 2005-01-31 16:29:57: DEBUG: pair 1: 2005-01-31 16:29:57: DEBUG: 0x862c218: next=0x862b3e0 tnext=(nil) 2005-01-31 16:29:57: DEBUG: 0x862b3e0: next=(nil) tnext=(nil) 2005-01-31 16:29:57: DEBUG: proposal #1: 2 transform 2005-01-31 16:29:57: DEBUG: total SA len=88 2005-01-31 16:29:57: DEBUG: 00000001 00000001 02000028 01020401 0b02099a 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 00000028 01030401 0630e761 0000001c 01030000 80010001 80020e10 80040002 80050002 80030002 2005-01-31 16:29:57: DEBUG: begin. 2005-01-31 16:29:57: DEBUG: seen nptype=2(prop) 2005-01-31 16:29:57: DEBUG: seen nptype=2(prop) 2005-01-31 16:29:57: DEBUG: succeed. 2005-01-31 16:29:57: DEBUG: proposal #1 len=40 2005-01-31 16:29:57: DEBUG: begin. 2005-01-31 16:29:57: DEBUG: seen nptype=3(trns) 2005-01-31 16:29:57: DEBUG: succeed. 2005-01-31 16:29:57: DEBUG: transform #1 len=28 2005-01-31 16:29:57: DEBUG: type=SA Life Type, flag=0x8000, lorv=seconds 2005-01-31 16:29:57: DEBUG: type=SA Life Duration, flag=0x8000, lorv=3600 2005-01-31 16:29:57: DEBUG: life duration was in TLV. 2005-01-31 16:29:57: DEBUG: type=Encryption Mode, flag=0x8000, lorv=Transport 2005-01-31 16:29:57: DEBUG: type=Authentication Algorithm, flag=0x8000, lorv=hmac-sha 2005-01-31 16:29:57: DEBUG: type=Group Description, flag=0x8000, lorv=2 2005-01-31 16:29:57: DEBUG: hmac(modp1024) 2005-01-31 16:29:57: DEBUG: proposal #1 len=40 2005-01-31 16:29:57: DEBUG: begin. 2005-01-31 16:29:57: DEBUG: seen nptype=3(trns) 2005-01-31 16:29:57: DEBUG: succeed. 2005-01-31 16:29:57: DEBUG: transform #1 len=28 2005-01-31 16:29:57: DEBUG: type=SA Life Type, flag=0x8000, lorv=seconds 2005-01-31 16:29:57: DEBUG: type=SA Life Duration, flag=0x8000, lorv=3600 2005-01-31 16:29:57: DEBUG: life duration was in TLV. 2005-01-31 16:29:57: DEBUG: type=Encryption Mode, flag=0x8000, lorv=Transport 2005-01-31 16:29:57: DEBUG: type=Authentication Algorithm, flag=0x8000, lorv=hmac-sha 2005-01-31 16:29:57: DEBUG: type=Group Description, flag=0x8000, lorv=2 2005-01-31 16:29:57: DEBUG: hmac(modp1024) 2005-01-31 16:29:57: DEBUG: pair 1: 2005-01-31 16:29:57: DEBUG: 0x862b450: next=0x862b5a0 tnext=(nil) 2005-01-31 16:29:57: DEBUG: 0x862b5a0: next=(nil) tnext=(nil) 2005-01-31 16:29:57: DEBUG: proposal #1: 2 transform 2005-01-31 16:29:57: DEBUG: begin compare proposals. 2005-01-31 16:29:57: DEBUG: pair[1]: 0x862b450 2005-01-31 16:29:57: DEBUG: 0x862b450: next=0x862b5a0 tnext=(nil) 2005-01-31 16:29:57: DEBUG: 0x862b5a0: next=(nil) tnext=(nil) 2005-01-31 16:29:57: DEBUG: prop#=1 prot-id=AH spi-size=4 #trns=1 trns#=1 trns-id=SHA 2005-01-31 16:29:57: DEBUG: type=SA Life Type, flag=0x8000, lorv=seconds 2005-01-31 16:29:57: DEBUG: type=SA Life Duration, flag=0x8000, lorv=3600 2005-01-31 16:29:57: DEBUG: type=Encryption Mode, flag=0x8000, lorv=Transport 2005-01-31 16:29:57: DEBUG: type=Authentication Algorithm, flag=0x8000, lorv=hmac-sha 2005-01-31 16:29:57: DEBUG: type=Group Description, flag=0x8000, lorv=2 2005-01-31 16:29:57: DEBUG: prop#=1 prot-id=ESP spi-size=4 #trns=1 trns#=1 trns-id=3DES 2005-01-31 16:29:57: DEBUG: type=SA Life Type, flag=0x8000, lorv=seconds 2005-01-31 16:29:57: DEBUG: type=SA Life Duration, flag=0x8000, lorv=3600 2005-01-31 16:29:57: DEBUG: type=Encryption Mode, flag=0x8000, lorv=Transport 2005-01-31 16:29:57: DEBUG: type=Authentication Algorithm, flag=0x8000, lorv=hmac-sha 2005-01-31 16:29:57: DEBUG: type=Group Description, flag=0x8000, lorv=2 2005-01-31 16:29:57: DEBUG: peer's single bundle: 2005-01-31 16:29:57: DEBUG: (proto_id=AH spisize=4 spi=0b02099a spi_p=00000000 encmode=Transport reqid=0:0) 2005-01-31 16:29:57: DEBUG: (trns_id=SHA authtype=hmac-sha) 2005-01-31 16:29:57: DEBUG: (proto_id=ESP spisize=4 spi=0630e761 spi_p=00000000 encmode=Transport reqid=0:0) 2005-01-31 16:29:57: DEBUG: (trns_id=3DES encklen=0 authtype=hmac-sha) 2005-01-31 16:29:57: DEBUG: my single bundle: 2005-01-31 16:29:57: DEBUG: (proto_id=AH spisize=4 spi=0755ad5d spi_p=00000000 encmode=Transport reqid=0:0) 2005-01-31 16:29:57: DEBUG: (trns_id=SHA authtype=hmac-sha) 2005-01-31 16:29:57: DEBUG: (proto_id=ESP spisize=4 spi=08ab5d83 spi_p=00000000 encmode=Transport reqid=0:0) 2005-01-31 16:29:57: DEBUG: (trns_id=3DES encklen=0 authtype=hmac-sha) 2005-01-31 16:29:57: DEBUG: matched 2005-01-31 16:29:57: DEBUG: === 2005-01-31 16:29:57: DEBUG: HASH(3) generate 2005-01-31 16:29:57: DEBUG: HASH with: 2005-01-31 16:29:57: DEBUG: 00c4e55a 01e8df8a 9ce76da0 a28c0e0a 3a917629 d1e96f29 c86a3003 2808b331 26f4cb40 93 2005-01-31 16:29:57: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:57: DEBUG: HASH computed: 2005-01-31 16:29:57: DEBUG: 8e1078c6 e27f5b7c 417232af 17ea670a 6209476f 2005-01-31 16:29:57: DEBUG: add payload of len 20, next type 0 2005-01-31 16:29:57: DEBUG: begin encryption. 2005-01-31 16:29:57: DEBUG: encryption(3des) 2005-01-31 16:29:57: DEBUG: pad length = 8 2005-01-31 16:29:57: DEBUG: 00000018 8e1078c6 e27f5b7c 417232af 17ea670a 6209476f e9e0ac88 a1fc8407 2005-01-31 16:29:57: DEBUG: encryption(3des) 2005-01-31 16:29:57: DEBUG: with key: 2005-01-31 16:29:57: DEBUG: 87950d10 c43b3cc4 5f8c71c1 0abde5ae 611d58e8 f3ac42fa 2005-01-31 16:29:57: DEBUG: encrypted payload by IV: 2005-01-31 16:29:57: DEBUG: 4fa7b500 01a65080 2005-01-31 16:29:57: DEBUG: save IV for next: 2005-01-31 16:29:57: DEBUG: 55362eb5 6175fc2f 2005-01-31 16:29:57: DEBUG: encrypted. 2005-01-31 16:29:57: DEBUG: 60 bytes from 192.168.2.5[500] to 192.168.2.3[500] 2005-01-31 16:29:57: DEBUG: sockname 192.168.2.5[500] 2005-01-31 16:29:57: DEBUG: send packet from 192.168.2.5[500] 2005-01-31 16:29:57: DEBUG: send packet to 192.168.2.3[500] 2005-01-31 16:29:57: DEBUG: src4 192.168.2.5[500] 2005-01-31 16:29:57: DEBUG: dst4 192.168.2.3[500] 2005-01-31 16:29:57: DEBUG: 1 times of 60 bytes message will be sent to 192.168.2.5[500] 2005-01-31 16:29:57: DEBUG: 6c9b6156 9b3a8f1e be23bf6c 739326c6 08102001 c4e55a01 0000003c de07f7dc b98f7a0d a5dca431 f62059eb d2cf9943 2093a977 55362eb5 6175fc2f 2005-01-31 16:29:57: DEBUG: compute DH's shared. 2005-01-31 16:29:57: DEBUG: 9772727f d7c3077d cbc3a754 c01a6739 742445a1 ee69dd0e 401fcdca 387680c8 20d00459 1707ff44 f12623ad 01a23d78 eda3f7c2 c4194025 51dd8e3d 2c6dc226 d1e301b8 f646791e eceb475c 8bef4fa9 abb1fa9e 51240206 3a215462 6e8ccc48 5bedbcef 21a78faa d9619891 101d7132 ec61dac8 8ccd5ce4 093fbefa 04eb288c 2005-01-31 16:29:57: DEBUG: KEYMAT compute with 2005-01-31 16:29:57: DEBUG: 9772727f d7c3077d cbc3a754 c01a6739 742445a1 ee69dd0e 401fcdca 387680c8 20d00459 1707ff44 f12623ad 01a23d78 eda3f7c2 c4194025 51dd8e3d 2c6dc226 d1e301b8 f646791e eceb475c 8bef4fa9 abb1fa9e 51240206 3a215462 6e8ccc48 5bedbcef 21a78faa d9619891 101d7132 ec61dac8 8ccd5ce4 093fbefa 04eb288c 020755ad 5de8df8a 9ce76da0 a28c0e0a 3a917629 d1e96f29 c86a3003 2808b331 26f4cb40 93 2005-01-31 16:29:57: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:57: DEBUG: encklen=0 authklen=0 2005-01-31 16:29:57: DEBUG: generating 480 bits of key (dupkeymat=3) 2005-01-31 16:29:57: DEBUG: generating K1...K3 for KEYMAT. 2005-01-31 16:29:57: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:57: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:57: DEBUG: 77ea373c ab2de6a9 e6579312 cf676dbf 21c8bb96 ebace6a6 b1166bf6 54e1cf78 1d21fda6 0ddc751d f03bdb9a 291fe5e4 ca2b43f3 4f325344 184a9142 2005-01-31 16:29:57: DEBUG: KEYMAT compute with 2005-01-31 16:29:57: DEBUG: 9772727f d7c3077d cbc3a754 c01a6739 742445a1 ee69dd0e 401fcdca 387680c8 20d00459 1707ff44 f12623ad 01a23d78 eda3f7c2 c4194025 51dd8e3d 2c6dc226 d1e301b8 f646791e eceb475c 8bef4fa9 abb1fa9e 51240206 3a215462 6e8ccc48 5bedbcef 21a78faa d9619891 101d7132 ec61dac8 8ccd5ce4 093fbefa 04eb288c 0308ab5d 83e8df8a 9ce76da0 a28c0e0a 3a917629 d1e96f29 c86a3003 2808b331 26f4cb40 93 2005-01-31 16:29:57: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:57: DEBUG: encryption(3des) 2005-01-31 16:29:57: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:57: DEBUG: encklen=192 authklen=160 2005-01-31 16:29:57: DEBUG: generating 640 bits of key (dupkeymat=4) 2005-01-31 16:29:57: DEBUG: generating K1...K4 for KEYMAT. 2005-01-31 16:29:57: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:57: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:57: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:57: DEBUG: e0192628 3eaf975f b16ae699 19fe9e6c dccbf969 08579f54 4405a8f2 89edc409 67d3dd51 982e56c9 193ea791 d4f8ac73 ea9839b3 07999674 361ac816 a212efae 4cabfcb3 ee977bc6 dba0fc02 6b6e4448 2005-01-31 16:29:57: DEBUG: KEYMAT compute with 2005-01-31 16:29:57: DEBUG: 9772727f d7c3077d cbc3a754 c01a6739 742445a1 ee69dd0e 401fcdca 387680c8 20d00459 1707ff44 f12623ad 01a23d78 eda3f7c2 c4194025 51dd8e3d 2c6dc226 d1e301b8 f646791e eceb475c 8bef4fa9 abb1fa9e 51240206 3a215462 6e8ccc48 5bedbcef 21a78faa d9619891 101d7132 ec61dac8 8ccd5ce4 093fbefa 04eb288c 020b0209 9ae8df8a 9ce76da0 a28c0e0a 3a917629 d1e96f29 c86a3003 2808b331 26f4cb40 93 2005-01-31 16:29:57: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:57: DEBUG: encklen=0 authklen=0 2005-01-31 16:29:57: DEBUG: generating 480 bits of key (dupkeymat=3) 2005-01-31 16:29:57: DEBUG: generating K1...K3 for KEYMAT. 2005-01-31 16:29:57: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:57: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:57: DEBUG: cb630d9b 01c67612 34237d02 1b0282ce 678cb71e 6bf59eeb d6346e54 433db1cf 342b19a1 106ce650 80e76fb1 b717c3b2 fbde4a06 17dc6cb4 7e1bf87a 2005-01-31 16:29:57: DEBUG: KEYMAT compute with 2005-01-31 16:29:57: DEBUG: 9772727f d7c3077d cbc3a754 c01a6739 742445a1 ee69dd0e 401fcdca 387680c8 20d00459 1707ff44 f12623ad 01a23d78 eda3f7c2 c4194025 51dd8e3d 2c6dc226 d1e301b8 f646791e eceb475c 8bef4fa9 abb1fa9e 51240206 3a215462 6e8ccc48 5bedbcef 21a78faa d9619891 101d7132 ec61dac8 8ccd5ce4 093fbefa 04eb288c 030630e7 61e8df8a 9ce76da0 a28c0e0a 3a917629 d1e96f29 c86a3003 2808b331 26f4cb40 93 2005-01-31 16:29:57: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:57: DEBUG: encryption(3des) 2005-01-31 16:29:57: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:57: DEBUG: encklen=192 authklen=160 2005-01-31 16:29:57: DEBUG: generating 640 bits of key (dupkeymat=4) 2005-01-31 16:29:57: DEBUG: generating K1...K4 for KEYMAT. 2005-01-31 16:29:57: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:57: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:57: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:57: DEBUG: bba49802 a5c4b1f9 ea8acbca 89e71d58 0ccc98de 3c058484 72d3f62e 4610ea03 7c3b16b8 55510b1b 0ca537df e0628f09 deb7f29e 25c72ca6 47c2ec40 abe1120e 6757f6ba 8142b446 9ac07c04 138221c0 2005-01-31 16:29:57: DEBUG: KEYMAT computed. 2005-01-31 16:29:57: DEBUG: call pk_sendupdate 2005-01-31 16:29:57: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:57: DEBUG: call pfkey_send_update_nat andi: libipsec/pfkey.c, pfkey_setsadbmsg: (p->type: 2, p->sadb_msg_satype: 2, seq: 2) andi: libipsec/pfkey.c, pfkey_send_x1: (satype: 2, spi 1571640583) 2005-01-31 16:29:58: DEBUG: encryption(3des) 2005-01-31 16:29:58: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:58: DEBUG: call pfkey_send_update_nat andi: libipsec/pfkey.c, pfkey_setsadbmsg: (p->type: 2, p->sadb_msg_satype: 3, seq: 2) andi: libipsec/pfkey.c, pfkey_send_x1: (satype: 3, spi 2203953928) 2005-01-31 16:29:58: DEBUG: pfkey update sent. 2005-01-31 16:29:58: DEBUG: andi: pfkey.c, pk_sendadd: start 2005-01-31 16:29:58: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:58: DEBUG: call pfkey_send_add_nat andi: libipsec/pfkey.c, pfkey_setsadbmsg: (p->type: 3, p->sadb_msg_satype: 2, seq: 2) andi: libipsec/pfkey.c, pfkey_send_x1: (satype: 2, spi 2584281611) 2005-01-31 16:29:58: DEBUG: encryption(3des) 2005-01-31 16:29:58: DEBUG: hmac(hmac_sha1) 2005-01-31 16:29:58: DEBUG: call pfkey_send_add_nat andi: libipsec/pfkey.c, pfkey_setsadbmsg: (p->type: 3, p->sadb_msg_satype: 3, seq: 2) andi: libipsec/pfkey.c, pfkey_send_x1: (satype: 3, spi 1642541062) 2005-01-31 16:29:58: DEBUG: andi: pfkey.c, pk_sendadd: ende 2005-01-31 16:29:58: DEBUG: pfkey add sent. 2005-01-31 16:29:58: DEBUG: get pfkey UPDATE message andi: libipsec/pfkey.c, pfkey_check: start (msg->sadb_msg_satype: 2) 2005-01-31 16:29:58: DEBUG: andi: pfkey.c, pk_recvupdate: start 2005-01-31 16:29:58: DEBUG: andi: in pfkey.c, pk_recvupdate: msg->sadb_msg_seq 2, msg->sadb_msg_type: UPDATE 2005-01-31 16:29:58: DEBUG: pfkey UPDATE succeeded: AH/Transport 192.168.2.3->192.168.2.5 spi=123055453(0x755ad5d) 2005-01-31 16:29:58: INFO: IPsec-SA established: AH/Transport 192.168.2.3->192.168.2.5 spi=123055453(0x755ad5d) 2005-01-31 16:29:58: DEBUG: get pfkey UPDATE message andi: libipsec/pfkey.c, pfkey_check: start (msg->sadb_msg_satype: 2) 2005-01-31 16:29:58: DEBUG: andi: pfkey.c, pk_recvupdate: start 2005-01-31 16:29:58: DEBUG: andi: in pfkey.c, pk_recvupdate: msg->sadb_msg_seq 2, msg->sadb_msg_type: UPDATE 2005-01-31 16:29:58: DEBUG: pfkey UPDATE succeeded: ESP/Transport 192.168.2.3->192.168.2.5 spi=145448323(0x8ab5d83) 2005-01-31 16:29:58: INFO: IPsec-SA established: ESP/Transport 192.168.2.3->192.168.2.5 spi=145448323(0x8ab5d83) 2005-01-31 16:29:58: DEBUG: andi: pfkey.c, pk_recvupdate: ende 2005-01-31 16:29:58: DEBUG: === 2005-01-31 16:29:58: DEBUG: get pfkey ADD message andi: libipsec/pfkey.c, pfkey_check: start (msg->sadb_msg_satype: 3) 2005-01-31 16:29:58: DEBUG: andi: in pfkey.c, pk_recvadd: msg->sadb_msg_seq 2, msg->sadb_msg_type: ADD 2005-01-31 16:29:58: INFO: IPsec-SA established: AH/Transport 192.168.2.5->192.168.2.3 spi=184682906(0xb02099a) 2005-01-31 16:29:58: DEBUG: === 2005-01-31 16:29:58: DEBUG: get pfkey ADD message andi: libipsec/pfkey.c, pfkey_check: start (msg->sadb_msg_satype: 3) 2005-01-31 16:29:58: DEBUG: andi: in pfkey.c, pk_recvadd: msg->sadb_msg_seq 2, msg->sadb_msg_type: ADD 2005-01-31 16:29:58: INFO: IPsec-SA established: ESP/Transport 192.168.2.5->192.168.2.3 spi=103868257(0x630e761) 2005-01-31 16:29:58: DEBUG: === --Boundary-00=_gFl/Bi96WSERiIA-- From tgraf@suug.ch Mon Jan 31 07:59:10 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 07:59:15 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VFx9oO000875 for ; Mon, 31 Jan 2005 07:59:10 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 7DA3482; Mon, 31 Jan 2005 16:58:46 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id A22931C0EA; Mon, 31 Jan 2005 16:59:29 +0100 (CET) Date: Mon, 31 Jan 2005 16:59:29 +0100 From: Thomas Graf To: jamal Cc: netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto Subject: Re: dummy as IMQ replacement Message-ID: <20050131155929.GF31837@postel.suug.ch> References: <1107123123.8021.80.camel@jzny.localdomain> <20050131135810.GC31837@postel.suug.ch> <1107181169.7840.184.camel@jzny.localdomain> <20050131151532.GE31837@postel.suug.ch> <1107186044.1076.11.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1107186044.1076.11.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1097 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 1933 Lines: 36 > My experience is that you end up dropping no more than a packet in a > burst with policing before TCP adjusts. Also depending on the gap > between bursts, that may be the only packet you drop altogether. > In long flows such as file transfers, avergae of one packet ever gets > dropped. I mostly agree but not completely. It's definitely true that most of the problems I'm fighting today are causes by the attempt to be too perfect in calculating. Going a step backwards solves most of the problems and probably works just fine for most cases. One of the main problem I'm facing here are big file transfers on low latency links with modified ip stacks to allow for a "faster" slow start (those are the reason why I'm trying to do this). An attempt to drop only a few packets results in a stronger incremenal growth. I'm not quite sure why that happens yet but a more aggresive policing stategy helped a lot. I agree that if we plan to put something like this into mainline those problem domains should be separated to not overcomlicate the whole thing. > checksum and other validity of ip header will have to be written as an > action if needed. Infact csum is on my list of mini actions. I could > decide to change something on egress of outgoing ip packet in pedit > and would therefore require to recompute csum. Sounds good. We'll need to address this anyway, the classifiers rely on the ip header being valid which is no longer assured. > Ok, I think both approaches are correct. ematch does the check/get > essentially; and action will create the set/tracking if needed. > For the example i gave, you are absolutely correct, ematch is > sufficient. Right, so we can do something like the meta ematch/action split. What attributes to you intend to be modifieable? A neat thing would be to overwrite the state and thus assign a packet to another connection which could be used to reimplement fast nat together with pedit. From andre.correa@pobox.com Mon Jan 31 08:27:21 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 08:27:29 -0800 (PST) Received: from orb.pobox.com (orb.pobox.com [207.8.226.5]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VGRKxG005828 for ; Mon, 31 Jan 2005 08:27:21 -0800 Received: from orb (localhost [127.0.0.1]) by orb.pobox.com (Postfix) with ESMTP id 088B358; Mon, 31 Jan 2005 11:27:20 -0500 (EST) Received: from pobox.com (unknown [200.150.240.34]) by orb.sasl.smtp.pobox.com (Postfix) with ESMTP id 2A5D587; Mon, 31 Jan 2005 11:27:08 -0500 (EST) Message-ID: <41FE5C57.2020201@pobox.com> Date: Mon, 31 Jan 2005 14:27:03 -0200 From: Andre Correa Reply-To: andre.correa@pobox.com User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: hadi@znyx.com Cc: netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, andre.correa@pobox.com, Andy Furniss , Damion de Soto Subject: Re: dummy as IMQ replacement References: <1107123123.8021.80.camel@jzny.localdomain> In-Reply-To: <1107123123.8021.80.camel@jzny.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1098 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: andre.correa@pobox.com Precedence: bulk X-list: netdev Content-Length: 17223 Lines: 516 Hi all, it turned an year since we (me and some cool folks) got the original IMQ from "death". During this year we updated kernel and iptables patches for every available version, created some new features (like hooking after and before NAT, multiple IMQ devices, solved modules problems, etc), and helped lots of users in our mailling list. The wish list grew, we created a site/FAQ/WiKi. We are still missing "dumb device" functionality. Our site is www.linuximq.net Complicated or not, clean or not, its being working in some interresting scenarios with lots of load on it. I feel fine for being able to help the community somehow with it. Found no time yet to check Jamal's new patches but we would use dummy as the base for "real device" functionality development. At least its nice to find we are discussing how to do it, not anymore if IMQ functionality is needed, cause it really is. Going one way or another we should not let users alone again with nobody taking care of this like it happened before. I plan keeping IMQ updated with new kernel versions as usual. Jamal, when you say "to replace" you mean it may get into vanila kernel? Do you plan keeping it updated from now on? Either way, can we call this new thing something else, because actual users may not want to migrate, so both should work together. A user should be able to patch a kernel with both. We (at linuximq.net) would be more then happy to help with it. Andre Jamal Hadi Salim wrote: > This is in relation to providing functionality that IMQ was intending > to using the dummy device and tc actions. Ive copied as many people as i > could dig who i know may have interest in this. > Please forward this to any other list which may have interest > in the subject. It still needs some cleaning up; however, i dont wanna > sit on it for another year - and now that mirred is out there, this is a > good time. > > Advantage over current IMQ; cleaner in particular in in SMP; > with a _lot_ less code. > Old Dummy device functionality is preserved while new one only > kicks in if you use actions. Didnt have to write a new device and finaly > made a real dumb device to be a little smarter ;-> > > IMQ USES > -------- > As far as i know the reasons listed below is why people use IMQ. > It would be nice to know of anything else that i missed because this > is the requirements list i used. > > 1) qdiscs/policies that are per device as opposed to system wide. > IMQ allows for sharing across multiple devices. > > 2) Allows for queueing incoming traffic for shaping instead of > dropping. I am not aware of any study that shows policing is > worse than shaping in achieving the end goal of rate control. > I would be interested if anyone is experimenting. Nevertheless, > this is still an alternative as opposed to making a system wide > ingress change. > > 3) Very interesting use: if you are serving p2p you may wanna give > preference to your own localy originated traffic (when responses come > back) vs someone using your system to do bittorent. So QoSing based on > state comes in as the solution. What people did to achive this was stick > the IMQ somewhere prelocal hook. > I think this is a pretty neat feature to have in Linux in general. > (i.e not just for IMQ). > But i wont go back to putting netfilter hooks in the device to satisfy > this. I also dont think its worth it hacking dummy some more to be > aware of say L3 info and play ip rule tricks to achieve this. > --> Instead the plan is to have a contrack related action. This action > will selectively either query/create contrack state on incoming packets. > Packets could then be redirected to dummy based on what happens -> eg > on incoming packets; if we find they are of known state we could send to > a different queue than one which didnt have existing state. This > all however is dependent on whatever rules the admin enters. > > What you can do with dummy currently with actions > -------------------------------------------------- > > Lets say you are policing packets from alias 192.168.200.200/32 > you dont want those to exceed 100kbps going out. > > tc filter add dev eth0 parent 1: protocol ip prio 10 u32 \ > match ip src 192.168.200.200/32 flowid 1:2 \ > action police rate 100kbit burst 90k drop > > If you run tcpdump on eth0 you will see all packets going out > with src 192.168.200.200/32 dropped or not > Extend the rule a little to see only the ones that made it out: > > tc filter add dev eth0 parent 1: protocol ip prio 10 u32 \ > match ip src 192.168.200.200/32 flowid 1:2 \ > action police rate 10kbit burst 90k drop \ > action mirred egress mirror dev dummy0 > > Now fire tcpdump on dummy0 to see only those packets .. > tcpdump -n -i dummy0 -x -e -t > > Essentially a good debugging/logging interface. > > If you replace mirror with redirect, those packets will be > blackholed and will never make it out. This redirect behavior > changes with new patch (but not the mirror). > > > What you can do with dummy and attached patch > ---------------------------------------------- > > Essentially provide functionality that most people use IMQ; > sample below: > > -------- > export TC="/sbin/tc" > > $TC qdisc add dev dummy0 root handle 1: prio > $TC qdisc add dev dummy0 parent 1:1 handle 10: sfq > $TC qdisc add dev dummy0 parent 1:2 handle 20: tbf rate 20kbit buffer > 1600 limit 3000 > $TC qdisc add dev dummy0 parent 1:3 handle 30: > sfq > $TC filter add dev dummy0 protocol ip pref 1 parent 1: handle 1 fw > classid 1:1 > $TC filter add dev dummy0 protocol ip pref 2 parent 1: handle 2 fw > classid 1:2 > > ifconfig dummy0 up > > $TC qdisc add dev eth0 ingress > > # redirect all IP packets arriving in eth0 to dummy0 > # use mark 1 --> puts them onto class 1:1 > $TC filter add dev eth0 parent ffff: protocol ip prio 10 u32 \ > match u32 0 0 flowid 1:1 \ > action ipt -j MARK --set-mark 1 \ > action mirred egress redirect dev dummy0 > > -------- > > > Run A Little test: > > from another machine ping so that you have packets going into the box: > ----- > [root@jzny action-tests]# ping 10.22 > PING 10.22 (10.0.0.22): 56 data bytes > 64 bytes from 10.0.0.22: icmp_seq=0 ttl=64 time=2.8 ms > 64 bytes from 10.0.0.22: icmp_seq=1 ttl=64 time=0.6 ms > 64 bytes from 10.0.0.22: icmp_seq=2 ttl=64 time=0.6 ms > > --- 10.22 ping statistics --- > 3 packets transmitted, 3 packets received, 0% packet loss > round-trip min/avg/max = 0.6/1.3/2.8 ms > [root@jzny action-tests]# > ----- > Now look at some stats: > > --- > [root@jmandrake]:~# $TC -s filter show parent ffff: dev eth0 > filter protocol ip pref 10 u32 > filter protocol ip pref 10 u32 fh 800: ht divisor 1 > filter protocol ip pref 10 u32 fh 800::800 order 2048 key ht 800 bkt 0 > flowid 1:1 > match 00000000/00000000 at 0 > action order 1: tablename: mangle hook: NF_IP_PRE_ROUTING > target MARK set 0x1 > index 1 ref 1 bind 1 installed 4195sec used 27sec > Sent 252 bytes 3 pkts (dropped 0, overlimits 0) > > action order 2: mirred (Egress Redirect to device dummy0) stolen > index 1 ref 1 bind 1 installed 165 sec used 27 sec > Sent 252 bytes 3 pkts (dropped 0, overlimits 0) > > [root@jmandrake]:~# $TC -s qdisc > qdisc sfq 30: dev dummy0 limit 128p quantum 1514b > Sent 0 bytes 0 pkts (dropped 0, overlimits 0) > qdisc tbf 20: dev dummy0 rate 20Kbit burst 1575b lat 2147.5s > Sent 210 bytes 3 pkts (dropped 0, overlimits 0) > qdisc sfq 10: dev dummy0 limit 128p quantum 1514b > Sent 294 bytes 3 pkts (dropped 0, overlimits 0) > qdisc prio 1: dev dummy0 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 > 1 > Sent 504 bytes 6 pkts (dropped 0, overlimits 0) > qdisc ingress ffff: dev eth0 ---------------- > Sent 308 bytes 5 pkts (dropped 0, overlimits 0) > > [root@jmandrake]:~# ifconfig dummy0 > dummy0 Link encap:Ethernet HWaddr 00:00:00:00:00:00 > inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link > UP BROADCAST RUNNING NOARP MTU:1500 Metric:1 > RX packets:6 errors:0 dropped:3 overruns:0 frame:0 > TX packets:3 errors:0 dropped:0 overruns:0 carrier:0 > collisions:0 txqueuelen:32 > RX bytes:504 (504.0 b) TX bytes:252 (252.0 b) > ----- > > Dummy continues to behave like it always did. > You send it any packet not originating from the actions it will drop > them. > [In this case the three dropped packets were ipv6 ndisc]. > > My goal here is to start a discussion to see if people agree this is > a good replacement for IMQ or whether to go another path. > Clearly i would prefer to have this change in, but I am not religious > and would listen to reason about how it should be done as long as no > uneccessary clutter happens. > > Patch attached. > > cheers, > jamal > > > > > > ------------------------------------------------------------------------ > > --- a/drivers/net/dummy.c.orig 2004-12-24 16:34:33.000000000 -0500 > +++ b/drivers/net/dummy.c 2005-01-18 06:43:47.000000000 -0500 > @@ -26,7 +26,14 @@ > Nick Holloway, 27th May 1994 > [I tweaked this explanation a little but that's all] > Alan Cox, 30th May 1994 > + > */ > +/* > + * This driver isnt abused enough ;-> > + * Here to add only _just_ a _feeew more_ features, > + * 10 years after AC added comment above ;-> hehe - JHS > +*/ > + > > #include > #include > @@ -35,11 +42,128 @@ > #include > #include > #include > +#ifdef CONFIG_NET_CLS_ACT > +#include > +#endif > + > +#define TX_TIMEOUT (2*HZ) > + > +#define TX_Q_LIMIT 32 > +struct dummy_private { > + struct net_device_stats stats; > +#ifdef CONFIG_NET_CLS_ACT > + struct tasklet_struct dummy_tasklet; > + int tasklet_pending; > + /* mostly debug stats leave in for now */ > + unsigned long stat_r1; > + unsigned long stat_r2; > + unsigned long stat_r3; > + unsigned long stat_r4; > + unsigned long stat_r5; > + unsigned long stat_r6; > + unsigned long stat_r7; > + unsigned long stat_r8; > + struct sk_buff_head rq; > + struct sk_buff_head tq; > +#endif > +}; > + > +#ifdef CONFIG_NET_CLS_ACT > +static void ri_tasklet(unsigned long dev); > +#endif > + > > static int numdummies = 1; > > static int dummy_xmit(struct sk_buff *skb, struct net_device *dev); > static struct net_device_stats *dummy_get_stats(struct net_device *dev); > +static void dummy_timeout(struct net_device *dev); > +static int dummy_open(struct net_device *dev); > +static int dummy_close(struct net_device *dev); > + > +static void dummy_timeout(struct net_device *dev) { > + > + int cpu = smp_processor_id(); > + > + dev->trans_start = jiffies; > + printk("%s: BUG tx timeout on CPU %d\n",dev->name,cpu); > + if (spin_is_locked((&dev->xmit_lock))) > + printk("xmit lock grabbed already\n"); > + if (spin_is_locked((&dev->queue_lock))) > + printk("queue lock grabbed already\n"); > +} > + > +#ifdef CONFIG_NET_CLS_ACT > +static void ri_tasklet(unsigned long dev) { > + > + struct net_device *dv = (struct net_device *)dev; > + struct dummy_private *dp = ((struct net_device *)dev)->priv; > + struct net_device_stats *stats = &dp->stats; > + struct sk_buff *skb = NULL; > + > + dp->stat_r4 +=1; > + if (NULL == (skb = skb_peek(&dp->tq))) { > + dp->stat_r5 +=1; > + if (spin_trylock(&dv->xmit_lock)) { > + dp->stat_r8 +=1; > + while (NULL != (skb = skb_dequeue(&dp->rq))) { > + skb_queue_tail(&dp->tq, skb); > + } > + spin_unlock(&dv->xmit_lock); > + } else { > + /* reschedule */ > + dp->stat_r1 +=1; > + goto resched; > + } > + } > + > + while (NULL != (skb = skb_dequeue(&dp->tq))) { > + __u32 from = G_TC_FROM(skb->tc_verd); > + > + skb->tc_verd = 0; > + skb->tc_verd = SET_TC_NCLS(skb->tc_verd); > + stats->tx_packets++; > + stats->tx_bytes+=skb->len; > + if (from & AT_EGRESS) { > + dp->stat_r6 +=1; > + dev_queue_xmit(skb); > + } else if (from & AT_INGRESS) { > + > + dp->stat_r7 +=1; > + netif_rx(skb); > + } else { > + /* if netfilt is compiled in and packet is > + tagged, we could reinject the packet back > + this would make it do remaining 10% > + of what current IMQ does > + if someone really really insists then > + this is the spot .. jhs */ > + dev_kfree_skb(skb); > + stats->tx_dropped++; > + } > + } > + > + if (spin_trylock(&dv->xmit_lock)) { > + dp->stat_r3 +=1; > + if (NULL == (skb = skb_peek(&dp->rq))) { > + dp->tasklet_pending = 0; > + if (netif_queue_stopped(dv)) > + //netif_start_queue(dv); > + netif_wake_queue(dv); > + } else { > + dp->stat_r2 +=1; > + spin_unlock(&dv->xmit_lock); > + goto resched; > + } > + spin_unlock(&dv->xmit_lock); > + } else { > +resched: > + dp->tasklet_pending = 1; > + tasklet_schedule(&dp->dummy_tasklet); > + } > + > +} > +#endif > > static int dummy_set_address(struct net_device *dev, void *p) > { > @@ -62,12 +186,17 @@ > /* Initialize the device structure. */ > dev->get_stats = dummy_get_stats; > dev->hard_start_xmit = dummy_xmit; > + dev->tx_timeout = &dummy_timeout; > + dev->watchdog_timeo = TX_TIMEOUT; > + dev->open = &dummy_open; > + dev->stop = &dummy_close; > + > dev->set_multicast_list = set_multicast_list; > dev->set_mac_address = dummy_set_address; > > /* Fill in device structure with ethernet-generic values. */ > ether_setup(dev); > - dev->tx_queue_len = 0; > + dev->tx_queue_len = TX_Q_LIMIT; > dev->change_mtu = NULL; > dev->flags |= IFF_NOARP; > dev->flags &= ~IFF_MULTICAST; > @@ -77,18 +206,64 @@ > > static int dummy_xmit(struct sk_buff *skb, struct net_device *dev) > { > - struct net_device_stats *stats = netdev_priv(dev); > + struct dummy_private *dp = ((struct net_device *)dev)->priv; > + struct net_device_stats *stats = &dp->stats; > + int ret = 0; > > + { > stats->tx_packets++; > stats->tx_bytes+=skb->len; > + } > +#ifdef CONFIG_NET_CLS_ACT > + __u32 from = G_TC_FROM(skb->tc_verd); > + if (!from || !skb->input_dev ) { > +dropped: > + dev_kfree_skb(skb); > + stats->rx_dropped++; > + return ret; > + } else { > + if (skb->input_dev) > + skb->dev = skb->input_dev; > + else > + printk("warning!!! no idev %s\n",skb->dev->name); > > + skb->input_dev = dev; > + if (from & AT_INGRESS) { > + skb_pull(skb, skb->dev->hard_header_len); > + } else { > + if (!(from & AT_EGRESS)) { > + goto dropped; > + } > + } > + } > + if (skb_queue_len(&dp->rq) >= dev->tx_queue_len) { > + netif_stop_queue(dev); > + } > + dev->trans_start = jiffies; > + skb_queue_tail(&dp->rq, skb); > + if (!dp->tasklet_pending) { > + dp->tasklet_pending = 1; > + tasklet_schedule(&dp->dummy_tasklet); > + } > + > +#else > + stats->rx_dropped++; > dev_kfree_skb(skb); > - return 0; > +#endif > + return ret; > } > > static struct net_device_stats *dummy_get_stats(struct net_device *dev) > { > - return netdev_priv(dev); > + struct dummy_private *dp = ((struct net_device *)dev)->priv; > + struct net_device_stats *stats = &dp->stats; > +#ifdef CONFIG_NET_CLS_ACT_DEB > + printk("tasklets stats %ld:%ld:%ld:%ld:%ld:%ld:%ld:%ld \n", > + dp->stat_r1,dp->stat_r2,dp->stat_r3,dp->stat_r4, > + dp->stat_r5,dp->stat_r6,dp->stat_r7,dp->stat_r8); > +#endif > + > + return stats; > } > > static struct net_device **dummies; > @@ -97,12 +272,41 @@ > module_param(numdummies, int, 0); > MODULE_PARM_DESC(numdummies, "Number of dummy pseudo devices"); > > +static int dummy_close(struct net_device *dev) > +{ > + > +#ifdef CONFIG_NET_CLS_ACT > + struct dummy_private *dp = ((struct net_device *)dev)->priv; > + > + tasklet_kill(&dp->dummy_tasklet); > + skb_queue_purge(&dp->rq); > + skb_queue_purge(&dp->tq); > +#endif > + netif_stop_queue(dev); > + return 0; > +} > + > +static int dummy_open(struct net_device *dev) > +{ > + > +#ifdef CONFIG_NET_CLS_ACT > + struct dummy_private *dp = ((struct net_device *)dev)->priv; > + > + tasklet_init(&dp->dummy_tasklet, ri_tasklet, (unsigned long)dev); > + skb_queue_head_init(&dp->rq); > + skb_queue_head_init(&dp->tq); > +#endif > + netif_start_queue(dev); > + return 0; > +} > + > + > static int __init dummy_init_one(int index) > { > struct net_device *dev_dummy; > int err; > > - dev_dummy = alloc_netdev(sizeof(struct net_device_stats), > + dev_dummy = alloc_netdev(sizeof(struct dummy_private), > "dummy%d", dummy_setup); > > if (!dev_dummy) ----------------------------------------------------------------------- Confidentiality Notice: This e-mail communication and any attachments may contain confidential and privileged information for the use of the designated recipients named above. If you are not the intended recipient, you are hereby notified that you have received this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its contents is prohibited. If you have received this communication in error, please notify me immediately by replying to this message and deleting it from your computer. Thank you. From shemminger@osdl.org Mon Jan 31 08:32:00 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 08:32:06 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VGVxRn006428 for ; Mon, 31 Jan 2005 08:32:00 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id j0VGVsl13684 for ; Mon, 31 Jan 2005 08:31:54 -0800 Date: Mon, 31 Jan 2005 08:32:02 -0800 From: Stephen Hemminger To: netdev@oss.sgi.com Subject: Fw: [Bug 4133] New: ipsec with automatic SA-generation; first connect fails Message-ID: <20050131083202.0606fbc2@dxpl.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed-Claws 0.9.13 (GTK+ 1.2.10; x86_64-unknown-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1099 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 2388 Lines: 59 Begin forwarded message: Date: Sun, 30 Jan 2005 05:12:49 -0800 From: bugme-daemon@osdl.org To: shemminger@osdl.org Subject: [Bug 4133] New: ipsec with automatic SA-generation; first connect fails http://bugme.osdl.org/show_bug.cgi?id=4133 Summary: ipsec with automatic SA-generation; first connect fails Kernel Version: version 2.6.7 (gcc-Version 3.3.4 (Debian 1:3.3.4- 6sarge1)) Status: NEW Severity: normal Owner: shemminger@osdl.org Submitter: werner.baumann@onlinehome.de Distribution: Debian GNU/Linux Sarge Hardware Environment: AMD Athlon Software Environment: libc-2.3.2.so, KAME IPSec-Tools (setkey and racoon) Problem Description: When configuring IPSec with automatic SA-establishment by racoon (or any other IKE-daemon), as long as the SA is not established, the first attempt to connect fails, while the SA is established after this correctly. The second attempt is successfull. But meanwhile most aplications inform the user, that there is something wrong with the connection. So the user will not try again, but maybe instead will mix up his configuration. Steps to reproduce: - configure a Security Policy for connections to some peer (on both sides) - configure racoon to establish SAs for this policy and start racoon - try to connect (using telnet or some other application) - connection will fail with some error-message "temporarily unavailable" or even "connection refused" - try again and the connection will succed (SA is established as displayed by setkey -D) I also tried a simple connect-Programm: it showed that the first call to the connect()-function fails with errno EAGAIN. Allthough this errno seems quiet reasonable to me, most applications don't try AGAIN, but instead confuse the user. I think it would be desirable that the call to connect() would not fail, but instead be delayed until the SA is established. Only if this is not possible within some timeout, connect() should fail. I think this behaviour would also better math RFC 2401, 5.1 Outbound IP Traffic Processing, especially 5.1.1 I don't know whether this is an issue of kernel or just of glibc. Thanks for kernel-ipsec anyway Werner ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. -- Stephen Hemminger From hadi@cyberus.ca Mon Jan 31 08:40:38 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 08:40:44 -0800 (PST) Received: from mx04.cyberus.ca (mx04.cybersurf.com [209.197.145.108]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VGecEw007141 for ; Mon, 31 Jan 2005 08:40:38 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx04.cyberus.ca with esmtp (Exim 4.30) id 1CvebH-0000fp-AK for netdev@oss.sgi.com; Mon, 31 Jan 2005 09:40:31 -0700 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CvebF-0004ac-QB; Mon, 31 Jan 2005 11:40:29 -0500 Subject: Re: dummy as IMQ replacement From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto In-Reply-To: <20050131155929.GF31837@postel.suug.ch> References: <1107123123.8021.80.camel@jzny.localdomain> <20050131135810.GC31837@postel.suug.ch> <1107181169.7840.184.camel@jzny.localdomain> <20050131151532.GE31837@postel.suug.ch> <1107186044.1076.11.camel@jzny.localdomain> <20050131155929.GF31837@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1107189625.1076.77.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 31 Jan 2005 11:40:25 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1100 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 2831 Lines: 61 On Mon, 2005-01-31 at 10:59, Thomas Graf wrote: > > My experience is that you end up dropping no more than a packet in a > > burst with policing before TCP adjusts. Also depending on the gap > > between bursts, that may be the only packet you drop altogether. > > In long flows such as file transfers, avergae of one packet ever gets > > dropped. > > I mostly agree but not completely. It's definitely true that most of > the problems I'm fighting today are causes by the attempt to be too > perfect in calculating. Going a step backwards solves most of the > problems and probably works just fine for most cases. One of the main > problem I'm facing here are big file transfers on low latency links with > modified ip stacks to allow for a "faster" slow start (those are the > reason why I'm trying to do this). An attempt to drop only a few > packets results in a stronger incremenal growth. I'm not quite sure > why that happens yet but a more aggresive policing stategy helped a > lot. I agree that if we plan to put something like this into mainline > those problem domains should be separated to not overcomlicate the > whole thing. > Would be interesting to combine policing and random dropping to see what happens. I think this is something you should be able to find a student to abuse so they can write a paper ;-> Probably Linux may not even be the right place to do it to start with - rather simulations until you get it right then code it into Linux. > Sounds good. We'll need to address this anyway, the classifiers rely > on the ip header being valid which is no longer assured. true - i was thinking of restoring stateless NAT at this level as well. So csum would be needed. The csum could be programmed to either validate only or recompute; those are the only two arguements to it that i could think of. I suppose first thing is to put out the eaction patch then add this action. I will try to sneak in some time this week and write the eaction. > > Ok, I think both approaches are correct. ematch does the check/get > > essentially; and action will create the set/tracking if needed. > > For the example i gave, you are absolutely correct, ematch is > > sufficient. > > Right, so we can do something like the meta ematch/action split. What > attributes to you intend to be modifieable? Essentially on ingress create state; i have to find my notes to give you precise answer. But one of the parameters was to select the level of state tracking (such as "track IP only" - not sure how doable that is with contrack) > A neat thing would be > to overwrite the state and thus assign a packet to another connection > which could be used to reimplement fast nat together with pedit. Stateless NAT doesnt really need contracking. pedit (taught to speak english) + eaction csum should do it. cheers, jamal From bunk@stusta.de Mon Jan 31 08:50:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 08:50:40 -0800 (PST) Received: from mailout.stusta.mhn.de (emailhub.stusta.mhn.de [141.84.69.5]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0VGoXGC007833 for ; Mon, 31 Jan 2005 08:50:34 -0800 Received: (qmail 11410 invoked from network); 31 Jan 2005 16:50:27 -0000 Received: from r063144.stusta.swh.mhn.de (10.150.63.144) by mailout.stusta.mhn.de with SMTP; 31 Jan 2005 16:50:27 -0000 Received: by r063144.stusta.swh.mhn.de (Postfix, from userid 1000) id 068D9BB53E; Mon, 31 Jan 2005 17:50:25 +0100 (CET) Date: Mon, 31 Jan 2005 17:50:25 +0100 From: Adrian Bunk To: Valdis.Kletnieks@vt.edu Cc: Arjan van de Ven , Lorenzo =?iso-8859-1?Q?Hern=E1ndez_Garc=EDa-Hierro?= , Stephen Hemminger , "linux-kernel@vger.kernel.org" , Chris Wright , netdev@oss.sgi.com, Hank Leininger Subject: Re: [PATCH] OpenBSD Networking-related randomization port Message-ID: <20050131165025.GN18316@stusta.de> References: <1106932637.3778.92.camel@localhost.localdomain> <20050128100229.5c0e4ea1@dxpl.pdx.osdl.net> <1106937110.3864.5.camel@localhost.localdomain> <20050128105217.1dc5ef42@dxpl.pdx.osdl.net> <1106944492.3864.30.camel@localhost.localdomain> <1106945266.7776.41.camel@laptopd505.fenrus.org> <200501290915.j0T9FkVY012948@turing-police.cc.vt.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200501290915.j0T9FkVY012948@turing-police.cc.vt.edu> User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1101 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bunk@stusta.de Precedence: bulk X-list: netdev Content-Length: 936 Lines: 26 On Sat, Jan 29, 2005 at 04:15:43AM -0500, Valdis.Kletnieks@vt.edu wrote: > On Fri, 28 Jan 2005 21:47:45 +0100, Arjan van de Ven said: > > > as for obsd_get_random_long().. would it be possible to use the > > get_random_int() function from the patches I posted the other day? They > > use the existing random.c infrastructure instead of making a copy... > > > > I still don't understand why you need a obsd_rand.c and can't use the > > normal random.c > > Note that obsd_rand.c started off life as a BSD-licensed file - I was told > that was a show-stopper when I submitted basically the same patch a while back. >... At least the three clause BSD license is GPL compatible. cu Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed From hadi@znyx.com Mon Jan 31 08:51:50 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 08:51:56 -0800 (PST) Received: from lotus.znyx.com (znx208-2-156-007.znyx.com [208.2.156.7]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VGpoZj008201 for ; Mon, 31 Jan 2005 08:51:50 -0800 Received: from [10.0.0.9] ([208.2.156.2]) by lotus.znyx.com (Lotus Domino Release 5.0.11) with ESMTP id 2005013108510028:36222 ; Mon, 31 Jan 2005 08:51:00 -0800 Subject: Re: dummy as IMQ replacement From: Jamal Hadi Salim Reply-To: hadi@znyx.com To: andre.correa@pobox.com Cc: netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto In-Reply-To: <41FE5C57.2020201@pobox.com> References: <1107123123.8021.80.camel@jzny.localdomain> <41FE5C57.2020201@pobox.com> Organization: Znyx Networks Message-Id: <1107190304.1077.101.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 31 Jan 2005 11:51:44 -0500 X-MIMETrack: Itemize by SMTP Server on Lotus/Znyx(Release 5.0.11 |July 24, 2002) at 01/31/2005 08:51:00 AM, Serialize by Router on Lotus/Znyx(Release 5.0.11 |July 24, 2002) at 01/31/2005 08:51:04 AM, Serialize complete at 01/31/2005 08:51:04 AM Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1102 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@znyx.com Precedence: bulk X-list: netdev Content-Length: 2709 Lines: 64 On Mon, 2005-01-31 at 11:27, Andre Correa wrote: > Hi all, > > it turned an year since we (me and some cool folks) got the original IMQ > from "death". During this year we updated kernel and iptables patches > for every available version, created some new features (like hooking > after and before NAT, multiple IMQ devices, solved modules problems, > etc), and helped lots of users in our mailling list. The wish list grew, > we created a site/FAQ/WiKi. We are still missing "dumb device" > functionality. Our site is www.linuximq.net > nice. Since you are deeply involved i think you can help put closure to this. > Complicated or not, clean or not, its being working in some interresting > scenarios with lots of load on it. I feel fine for being able to help > the community somehow with it. Found no time yet to check Jamal's new > patches but we would use dummy as the base for "real device" > functionality development. > > At least its nice to find we are discussing how to do it, not anymore if > IMQ functionality is needed, cause it really is. > The people have spoken i suppose is the right way to describe it. If a lot of people use it, then its existence is justified. The problem has been misrepresenation of why its needed. > Going one way or another we should not let users alone again with nobody > taking care of this like it happened before. I plan keeping IMQ updated > with new kernel versions as usual. > > Jamal, when you say "to replace" you mean it may get into vanila kernel? > Do you plan keeping it updated from now on? > The plan is to make that small update to the kernel to achieve the funtionality that IMQ provides. It doesnt have to be me who does the updating thereafter; you can own this for example. The goal is to meet those requirements with little noise in the kernel. If we have things in the kernel, then there should be no need to maintain separate patches. > Either way, can we call this new thing something else, because actual > users may not want to migrate, so both should work together. A user > should be able to patch a kernel with both. I dont have an issue with renaming but i dont see any overwhelming reason to do it on a new device when dummy seems to be sufficient. Take a look at that patch and see what functionality is missing. Forget about the iptable hooks. See the thread of discussion to see how the plan to meet those requirements looks like - see if something is missing. Please read the text i posted - it is verbose but would give a good explanation. > We (at linuximq.net) would be more then happy to help with it. Like i said you guys can own this - just wanna reduce cruft in the kernel. cheers, jamal From laforge@gnumonks.org Mon Jan 31 08:59:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 08:59:59 -0800 (PST) Received: from ganesha.gnumonks.org (Debian-exim@ganesha.gnumonks.org [213.95.27.120]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VGxqKl008920 for ; Mon, 31 Jan 2005 08:59:53 -0800 Received: from sunbeam.hmw-consulting.de ([83.236.178.203] helo=sunbeam.gnumonks.org) by ganesha.gnumonks.org with asmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1Cvety-0000C0-9z for netdev@oss.sgi.com; Mon, 31 Jan 2005 17:59:50 +0100 Received: from laforge by sunbeam.gnumonks.org with local (Exim 4.43) id 1Cvetw-00024g-Af for netdev@oss.sgi.com; Mon, 31 Jan 2005 17:59:48 +0100 Date: Mon, 31 Jan 2005 17:59:48 +0100 From: Harald Welte To: netdev@oss.sgi.com Subject: [BUG] sundance "Something Wicked happened!" (IntrPCIErr) Message-ID: <20050131165947.GJ6878@sunbeam.de.gnumonks.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sl5MdczEF/OU2Miu" Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1103 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: laforge@gnumonks.org Precedence: bulk X-list: netdev Content-Length: 1994 Lines: 56 --sl5MdczEF/OU2Miu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! I have one machine with 8 sundance interfaces. The machine spits tons (16G Logfile in a couple of hours) of the Error message "Something Wicked happened!": 2005:01:26-17:25:02 (none) kernel: eth5: Something Wicked happened! 0003. 2005:01:26-17:25:02 (none) kernel: eth5: Something Wicked happened! 0007. 2005:01:26-17:25:02 (none) kernel: eth5: Something Wicked happened! 0003. 2005:01:26-17:25:02 (none) kernel: eth5: Something Wicked happened! 0003. 2005:01:26-17:25:02 (none) kernel: eth5: Something Wicked happened! 0013. = =20 The system is a DELL PowerEdge 1850 Dual Xeon 2.8GHz with two DFE-580TX fourport Ethernet cards. Looking at the source code, the error message only happens if IntrPCIErr is set. =20 What kind of PCI Error is this status bit referring to? =20 Does anyone have the sundance specs and could help me out? =20 Do you think it's good indication that hardware is broken? Also, the source contains a comment about resetting DMA, which isn't actually implemented. Any ideas? --=20 - Harald Welte http://www.gnumonks.org/ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D "Privacy in residential applications is a desirable marketing option." (ETSI EN 300 175-7 Ch. A6) --sl5MdczEF/OU2Miu Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFB/mQDXaXGVTD0i/8RAqLBAJ44KdG1UeDevTpCLESmjhAk4Djr/wCgicni +2y1E0wbZOzfhVut+ucXlWI= =NGH5 -----END PGP SIGNATURE----- --sl5MdczEF/OU2Miu-- From lorenzo@gnu.org Mon Jan 31 09:24:13 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 09:24:17 -0800 (PST) Received: from vds-320151.amen-pro.com (vds-320151.amen-pro.com [62.193.204.86]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VHOBvK010512 for ; Mon, 31 Jan 2005 09:24:12 -0800 Received: (qmail 20808 invoked from network); 31 Jan 2005 17:24:13 -0000 Received: from 67.red-80-25-56.pooles.rima-tde.net (HELO estila) (80.25.56.67) by vds-320151.amen-pro.com with RC4-MD5 encrypted SMTP; 31 Jan 2005 17:24:13 -0000 Subject: Re: [PATCH] OpenBSD Networking-related randomization port From: Lorenzo =?ISO-8859-1?Q?Hern=E1ndez_?= =?ISO-8859-1?Q?Garc=EDa-Hierro?= To: Adrian Bunk Cc: Valdis.Kletnieks@vt.edu, Arjan van de Ven , Stephen Hemminger , "linux-kernel@vger.kernel.org" , Chris Wright , netdev@oss.sgi.com, Hank Leininger In-Reply-To: <20050131165025.GN18316@stusta.de> References: <1106932637.3778.92.camel@localhost.localdomain> <20050128100229.5c0e4ea1@dxpl.pdx.osdl.net> <1106937110.3864.5.camel@localhost.localdomain> <20050128105217.1dc5ef42@dxpl.pdx.osdl.net> <1106944492.3864.30.camel@localhost.localdomain> <1106945266.7776.41.camel@laptopd505.fenrus.org> <200501290915.j0T9FkVY012948@turing-police.cc.vt.edu> <20050131165025.GN18316@stusta.de> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-sVRmgpnA8TFRirAc9KXF" Date: Mon, 31 Jan 2005 18:23:38 +0100 Message-Id: <1107192218.3754.86.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1104 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: lorenzo@gnu.org Precedence: bulk X-list: netdev Content-Length: 1934 Lines: 59 --=-sVRmgpnA8TFRirAc9KXF Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable El lun, 31-01-2005 a las 17:50 +0100, Adrian Bunk escribi=F3: > On Sat, Jan 29, 2005 at 04:15:43AM -0500, Valdis.Kletnieks@vt.edu wrote: > > On Fri, 28 Jan 2005 21:47:45 +0100, Arjan van de Ven said: > >=20 > > > as for obsd_get_random_long().. would it be possible to use the > > > get_random_int() function from the patches I posted the other day? Th= ey > > > use the existing random.c infrastructure instead of making a copy... > > >=20 > > > I still don't understand why you need a obsd_rand.c and can't use the > > > normal random.c > >=20 > > Note that obsd_rand.c started off life as a BSD-licensed file - I was t= old > > that was a show-stopper when I submitted basically the same patch a whi= le back. > >... >=20 > At least the three clause BSD license is GPL compatible. >=20 Yes, AFAIK :) I will try to follow Arjan's recommendations on using his functions instead of obsd ones, even if I think it should be alone in the current file. Also I will split up the patch. I will do it as soon as I get time for it, I need first to work out a cleaner vsec (no more code in headers and such) and also a sys_chroot() hook that I requested yesterday on the bugzilla, among the SELinux 2.4 backport which needs several fixes due to last 2.6 bk-commits reports. Thanks for the comments, Cheers. --=20 Lorenzo Hern=E1ndez Garc=EDa-Hierro =20 [1024D/6F2B2DEC] & [2048g/9AE91A22][http://tuxedo-es.org] --=-sVRmgpnA8TFRirAc9KXF Content-Type: application/pgp-signature; name=signature.asc Content-Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB/mmZDcEopW8rLewRAlqbAJwNTBNH7ugNu10emnGg6YxKw0q/SQCeOpLj Z4J7CgJ7BoxQu4HwPGcAmkM= =7prp -----END PGP SIGNATURE----- --=-sVRmgpnA8TFRirAc9KXF-- From buytenh@wantstofly.org Mon Jan 31 10:00:51 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 10:00:58 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VI0opl012017 for ; Mon, 31 Jan 2005 10:00:51 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id F03212B0EC; Mon, 31 Jan 2005 19:00:48 +0100 (MET) Date: Mon, 31 Jan 2005 19:00:48 +0100 From: Lennert Buytenhek To: Hasso Tepper Cc: hadi@cyberus.ca, netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto Subject: Re: dummy as IMQ replacement Message-ID: <20050131180048.GA24851@xi.wantstofly.org> References: <1107123123.8021.80.camel@jzny.localdomain> <200501311614.31397.hasso@estpak.ee> <1107181551.7847.193.camel@jzny.localdomain> <200501311646.14322.hasso@estpak.ee> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200501311646.14322.hasso@estpak.ee> User-Agent: Mutt/1.4.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1105 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev Content-Length: 546 Lines: 14 On Mon, Jan 31, 2005 at 04:46:14PM +0200, Hasso Tepper wrote: > This is somewhat related to killing the chance to use iptables as well ... > Iptables has better documentation and people use it just because of that. I'm afraid I have to agree on this one. The idea behind iptables is easy to grasp, whereas tc isn't totally obvious, and all tc 'tutorials' out there just give you a long list of commands to type in but don't really explain you what goes on under the hood. And you can't just expect everyone to "Go look at the source." --L From Robert.Olsson@data.slu.se Mon Jan 31 10:01:10 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 10:01:14 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VI18oK012059 for ; Mon, 31 Jan 2005 10:01:09 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0VI15gS015575; Mon, 31 Jan 2005 19:01:05 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 4FBC0EE2A4; Mon, 31 Jan 2005 19:01:05 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16894.29281.293401.832567@robur.slu.se> Date: Mon, 31 Jan 2005 19:01:05 +0100 To: "David S. Miller" Cc: Robert Olsson , netdev@oss.sgi.com Subject: Re: [PATCH] gc_min_interval in milleseconds via /proc (fwd) In-Reply-To: <20050130225627.4feecd2e.davem@davemloft.net> References: <16888.56016.608929.340640@robur.slu.se> <20050130225627.4feecd2e.davem@davemloft.net> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1106 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Content-Length: 2299 Lines: 71 David S. Miller writes: > We must pick a new sysctl number too, for sysctl() system call. > If the only access possible were through /proc then yes your > change would be valid, but due to sysctl() system call the > .ctl_name defines that dimension of the sysctl namespace. Ok! NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS was added last in list to avoid renumbering. Feel free to change. --ro --- include/linux/sysctl.h.orig 2005-01-31 18:36:11.524393024 +0100 +++ include/linux/sysctl.h 2005-01-31 18:37:41.843662408 +0100 @@ -365,6 +365,7 @@ NET_IPV4_ROUTE_MIN_PMTU=16, NET_IPV4_ROUTE_MIN_ADVMSS=17, NET_IPV4_ROUTE_SECRET_INTERVAL=18, + NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS=19 }; enum --- net/ipv4/route.c.orig 2005-01-27 11:19:37.000000000 +0100 +++ net/ipv4/route.c 2005-01-31 18:35:20.552141984 +0100 @@ -2529,6 +2529,8 @@ .proc_handler = &proc_dointvec, }, { + /* Deprecated. Use gc_min_interval_ms */ + .ctl_name = NET_IPV4_ROUTE_GC_MIN_INTERVAL, .procname = "gc_min_interval", .data = &ip_rt_gc_min_interval, @@ -2538,6 +2540,15 @@ .strategy = &sysctl_jiffies, }, { + .ctl_name = NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS, + .procname = "gc_min_interval_ms", + .data = &ip_rt_gc_min_interval, + .maxlen = sizeof(unsigned long), + .mode = 0644, + .proc_handler = &proc_doulongvec_ms_jiffies_minmax, + .strategy = &sysctl_jiffies, + }, + { .ctl_name = NET_IPV4_ROUTE_GC_TIMEOUT, .procname = "gc_timeout", .data = &ip_rt_gc_timeout, --- Documentation/filesystems/proc.txt.orig 2005-01-27 12:35:02.000000000 +0100 +++ Documentation/filesystems/proc.txt 2005-01-27 12:46:30.000000000 +0100 @@ -1709,12 +1709,13 @@ Writing to this file results in a flush of the routing cache. -gc_elasticity, gc_interval, gc_min_interval, gc_tresh, gc_timeout, -gc_thresh, gc_thresh1, gc_thresh2, gc_thresh3 --------------------------------------------------------------- +gc_elasticity, gc_interval, gc_min_interval_ms, gc_timeout, gc_thresh +--------------------------------------------------------------------- Values to control the frequency and behavior of the garbage collection -algorithm for the routing cache. +algorithm for the routing cache. gc_min_interval is deprecated and replaced +by gc_min_interval_ms. + max_size -------- From Robert.Olsson@data.slu.se Mon Jan 31 10:06:45 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 10:06:49 -0800 (PST) Received: from mx1.slu.se (mx1.slu.se [130.238.96.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VI6iY0013591 for ; Mon, 31 Jan 2005 10:06:44 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mx1.slu.se (8.13.1/8.13.1) with ESMTP id j0VI6eXI016555; Mon, 31 Jan 2005 19:06:40 +0100 Received: by robur.slu.se (Postfix, from userid 1000) id 2FB2BEE2A4; Mon, 31 Jan 2005 19:06:40 +0100 (CET) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16894.29616.137437.542900@robur.slu.se> Date: Mon, 31 Jan 2005 19:06:40 +0100 To: jeremy.guthrie@berbee.com Cc: netdev@oss.sgi.com, Robert Olsson Subject: Re: V2.4 policy router operates faster/better than V2.6 In-Reply-To: <200501310937.30427.jeremy.guthrie@berbee.com> References: <16879.58333.266843.335475@robur.slu.se> <200501201114.49517.jeremy.guthrie@berbee.com> <200501310937.30427.jeremy.guthrie@berbee.com> X-Mailer: VM 7.18 under Emacs 21.3.1 X-Scanned-By: MIMEDefang 2.48 on 130.238.96.70 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1107 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Content-Length: 478 Lines: 18 Jeremy M. Guthrie writes: > Just wanted to verify that by the term linear search from rtstat/lnstat, you > mean a search of the buckets for a particular hash? Yes. > We're going live tomorrow with the app. Afterwards I'll load up the no route > caching patch and test that. Ok! Look at the patch just posted to davem. We should able view and control gc_min_interval better. net.ipv4.route.gc_min_interval_ms = 300 net.ipv4.route.gc_min_interval = 0 --ro From dale@the-martins.org Mon Jan 31 10:15:18 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 10:15:32 -0800 (PST) Received: from smtp1.fuse.net (mail-out1.fuse.net [216.68.8.174]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VIFHaQ014295 for ; Mon, 31 Jan 2005 10:15:18 -0800 Received: from gx6.fuse.net ([66.42.247.210]) by smtp1.fuse.net (InterMail vM.6.01.04.00 201-2131-118-20041027) with ESMTP id <20050131181314.CKSU18019.smtp1.fuse.net@gx6.fuse.net> for ; Mon, 31 Jan 2005 13:13:14 -0500 Received: from chinchilla.toadis.porkis ([66.42.247.210]) by gx6.fuse.net (InterMail vG.1.02.00.02 201-2136-104-102-20041210) with ESMTP id <20050131181205.QWEA26160.gx6.fuse.net@chinchilla.toadis.porkis> for ; Mon, 31 Jan 2005 13:12:05 -0500 Received: from gerbil.toadis.porkis (localhost.localdomain) [192.168.10.2] by chinchilla.toadis.porkis with smtp (Exim 3.35 #1 (Debian)) id 1Cvg4q-00012K-00; Mon, 31 Jan 2005 13:15:08 -0500 Received: by localhost.localdomain (sSMTP sendmail emulation); Mon, 31 Jan 2005 13:15:08 -0500 Date: Mon, 31 Jan 2005 13:15:08 -0500 From: "Dale E. Martin" To: netdev@oss.sgi.com Subject: where is the proper place for r8169 bug reports? Message-ID: <20050131181508.GA15908@gerbil.toadis.porkis> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1108 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dale@the-martins.org Precedence: bulk X-list: netdev Content-Length: 230 Lines: 8 I'm having an issue with this driver in Linux 2.4.28. I'm happy to submit a full report and/or help debug if I know where to send the info. Thanks! Dale -- Dale E. Martin - dale@the-martins.org http://the-martins.org/~dmartin From tgraf@suug.ch Mon Jan 31 10:15:35 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 10:15:40 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VIFYLC014328 for ; Mon, 31 Jan 2005 10:15:34 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id BFB5D82; Mon, 31 Jan 2005 19:15:10 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 28E911C0EA; Mon, 31 Jan 2005 19:15:53 +0100 (CET) Date: Mon, 31 Jan 2005 19:15:53 +0100 From: Thomas Graf To: jamal Cc: netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto Subject: Re: dummy as IMQ replacement Message-ID: <20050131181553.GG31837@postel.suug.ch> References: <1107123123.8021.80.camel@jzny.localdomain> <20050131135810.GC31837@postel.suug.ch> <1107181169.7840.184.camel@jzny.localdomain> <20050131151532.GE31837@postel.suug.ch> <1107186044.1076.11.camel@jzny.localdomain> <20050131155929.GF31837@postel.suug.ch> <1107189625.1076.77.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1107189625.1076.77.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1109 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 2761 Lines: 57 > Would be interesting to combine policing and random dropping to see > what happens. Indeed. > Probably Linux may not even be the right place to do it to start with > - rather simulations until you get it right then code it into Linux. I haven't left ns sim so far, my calculations are based on some of the linux specific cc modifications though, i.e. I modified ns sim a bit to provide the same information. I'm thinking about moving to umlsim, it should provide a better real world simulation. > true - i was thinking of restoring stateless NAT at this level as well. > So csum would be needed. The csum could be programmed to either > validate only or recompute; those are the only two arguements to it that > i could think of. I suppose first thing is to put out the eaction patch > then add this action. I will try to sneak in some time this week and > write the eaction. Sounds good, we could put up a ematch csum for validation and a eaction for recomputation. I'll wait for your code to show up. > > Right, so we can do something like the meta ematch/action split. What > > attributes to you intend to be modifieable? > > Essentially on ingress create state; i have to find my notes to give you > precise answer. But one of the parameters was to select the level of > state tracking (such as "track IP only" - not sure how doable that is > with contrack) So you want to have a generic conntrack action capable of dynamically taking whatever information into account that the user requests? This remembers me of the esfq effort which could benefit from this, it extends sfq to take the definition for a flow as a parameter. We could share some code here. > Stateless NAT doesnt really need contracking. pedit (taught to speak > english) + eaction csum should do it. Right, given we don't need any reverse translation. Still it would be neat to set the conntrack attributes so one could use iptables later on, I'm not sure how doable this is though. Something different... This sounds all very good but I think we're still sucessfully ignoring one of the most important points, usability. Most modifications over the last few months have complicated things, introduced different behaviour depending on compile time options and userspace tools which are either outdated or having features being completely undocumented. Some of the recent additions don't even show up in the usage text of iproute2. So I think we should at least part time focus a little more on the big picture and make things consitent and more useable. At least 50% of the functionaility currently in mainline is completely unused because nobody knows about it. I'm in no way against any of the recent additions but maybe we can also put some more effort into usability. From marcelo.tosatti@cyclades.com Mon Jan 31 10:25:11 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 10:25:16 -0800 (PST) Received: from parcelfarce.linux.theplanet.co.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VIPAhB015503 for ; Mon, 31 Jan 2005 10:25:11 -0800 Received: from [127.0.0.1] (helo=logos.cnet) by parcelfarce.linux.theplanet.co.uk with esmtp (Exim 4.33) id 1CvgET-0007aZ-RL; Mon, 31 Jan 2005 18:25:06 +0000 Received: by logos.cnet (Postfix, from userid 500) id 6C0E9122EBB; Mon, 31 Jan 2005 13:24:31 -0200 (BRST) Date: Mon, 31 Jan 2005 13:24:31 -0200 From: Marcelo Tosatti To: Bukie Mabayoje Cc: sfeldma@pobox.com, David =?iso-8859-1?Q?H=E4rdeman?= , Michael Gernoth , linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: 2.4.29, e100 and a WOL packet causes keventd going mad Message-ID: <20050131152431.GA14176@logos.cnet> References: <20050130171849.GA3354@hardeman.nu> <1107143255.18167.428.camel@localhost.localdomain> <41FDB2D3.5CBD6F7D@gte.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <41FDB2D3.5CBD6F7D@gte.net> User-Agent: Mutt/1.5.5.1i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j0VIPAhB015503 X-archive-position: 1110 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: marcelo.tosatti@cyclades.com Precedence: bulk X-list: netdev Content-Length: 1015 Lines: 25 On Sun, Jan 30, 2005 at 08:23:47PM -0800, Bukie Mabayoje wrote: > > Scott Feldman wrote: > > > On Sun, 2005-01-30 at 09:18, David Härdeman wrote: > > > I experience the same problems as reported by Michael Gernoth when > > > sending a WOL-packet to computer with a e100 NIC which is already > > > powered on. > > > > I didn't look at the 2.4 case, but for 2.6, it seems e100 was enabling > > PME wakeup during probe. PME shouldn't be enabled while the system is > > up. I suspect the assertion of PME while the system is up is what's > > causing problems. This patch moves PME wakeup enabling to either > > suspend or shutdown. > > > > David, would you give this patch a try? Make sure the system still > > wakes from a magic packet if suspended or shut down, and doesn't cause > > kacpid to go crazy if system is running. If it helps for 2.6, perhaps > > someone can look into 2.4 to see if there is something similar going on > > This issue was reported on 2.4. Can any of you guys test v2.6, please? From tgraf@suug.ch Mon Jan 31 10:48:08 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 10:48:14 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VIm7Xf016701 for ; Mon, 31 Jan 2005 10:48:07 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 7D5BC82; Mon, 31 Jan 2005 19:47:44 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 540EA1C0EA; Mon, 31 Jan 2005 19:48:27 +0100 (CET) Date: Mon, 31 Jan 2005 19:48:27 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] PKT_SCHED: Fix ingress qdisc to pick up IPv6 packets when using netfilter hooks Message-ID: <20050131184827.GH31837@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1111 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 1447 Lines: 58 Jamal, close your eyes please. Fixes the ingress qdisc to pick up IPv6 packets when using the old style netfilter hooks, i.e. when CONFIG_NET_CLS_ACT is not enabled. Signed-off-by: Thomas Graf --- linux-2.6.11-rc2-bk8.orig/net/sched/sch_ingress.c 2005-01-30 21:19:51.000000000 +0100 +++ linux-2.6.11-rc2-bk8/net/sched/sch_ingress.c 2005-01-31 19:32:29.000000000 +0100 @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -271,6 +272,14 @@ .priority = NF_IP_PRI_FILTER + 1, }; +static struct nf_hook_ops ing6_ops = { + .hook = ing_hook, + .owner = THIS_MODULE, + .pf = PF_INET6, + .hooknum = NF_IP6_PRE_ROUTING, + .priority = NF_IP6_PRI_FILTER + 1, +}; + #endif #endif @@ -297,6 +306,12 @@ return -EINVAL; } nf_registered++; + + if (nf_register_hook(&ing6_ops) < 0) { + printk("IPv6 ingress qdisc registration error, " \ + "disabling IPv6 support.\n"); + } else + nf_registered++; } #endif #endif @@ -408,8 +423,11 @@ unregister_qdisc(&ingress_qdisc_ops); #ifndef CONFIG_NET_CLS_ACT #ifdef CONFIG_NETFILTER - if (nf_registered) + if (nf_registered) { nf_unregister_hook(&ing_ops); + if (nf_registered > 1) + nf_unregister_hook(&ing6_ops); + } #endif #endif } From jesse.brandeburg@intel.com Mon Jan 31 11:27:22 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 11:27:26 -0800 (PST) Received: from orsfmr004.jf.intel.com (fmr19.intel.com [134.134.136.18]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VJRLPn019311 for ; Mon, 31 Jan 2005 11:27:22 -0800 Received: from orsfmr101.jf.intel.com (orsfmr101.jf.intel.com [10.7.209.17]) by orsfmr004.jf.intel.com (8.12.10/8.12.10/d: major-outer.mc,v 1.1 2004/09/17 17:50:56 root Exp $) with ESMTP id j0VJQoJU008665; Mon, 31 Jan 2005 19:26:50 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by orsfmr101.jf.intel.com (8.12.10/8.12.10/d: major-inner.mc,v 1.2 2004/09/17 18:05:01 root Exp $) with SMTP id j0VJQ1XW023754; Mon, 31 Jan 2005 19:26:45 GMT Received: from orsmsx331.amr.corp.intel.com ([192.168.65.56]) by orsmsxvs040.jf.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2005013111264503203 ; Mon, 31 Jan 2005 11:26:45 -0800 Received: from orsmsx408.amr.corp.intel.com ([192.168.65.52]) by orsmsx331.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.211); Mon, 31 Jan 2005 11:26:44 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Subject: RE: 2.4.29, e100 and a WOL packet causes keventd going mad Date: Mon, 31 Jan 2005 11:26:43 -0800 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: 2.4.29, e100 and a WOL packet causes keventd going mad Thread-Index: AcUHUZ4QG04FGrWzQG+uFsJ5rBpdewAcwpHA From: "Brandeburg, Jesse" To: , Cc: =?iso-8859-1?Q?David_H=E4rdeman?= , "Michael Gernoth" , "Linux Kernel Mailing List" , X-OriginalArrivalTime: 31 Jan 2005 19:26:44.0983 (UTC) FILETIME=[CCBFB070:01C507CA] X-Scanned-By: MIMEDefang 2.44 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id j0VJRLPn019311 X-archive-position: 1112 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jesse.brandeburg@intel.com Precedence: bulk X-list: netdev Content-Length: 612 Lines: 15 >+static void e100_shutdown(struct device *dev) >+{ >+ struct pci_dev *pdev = container_of(dev, struct pci_dev, dev); >+ struct net_device *netdev = pci_get_drvdata(pdev); >+ struct nic *nic = netdev_priv(netdev); >+ >+ pci_enable_wake(pdev, PCI_D0, nic->flags & (wol_magic | >e100_asf(nic))); >+} >+ Separately, does anyone think that the OS should be handling the PME event on the bus (as it comes from the PIC as an interrupt, and can be masked at the PIC) with a default handler? The machines having the problem seem to be killed by an interrupt storm generated by the PME interrupt, just a guess. Jesse From Valdis.Kletnieks@vt.edu Mon Jan 31 11:43:01 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 11:43:05 -0800 (PST) Received: from turing-police.cc.vt.edu (IDENT:root@turing-police.cc.vt.edu [128.173.14.107]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VJgx5o019969 for ; Mon, 31 Jan 2005 11:43:01 -0800 Received: from turing-police.cc.vt.edu (IDENT:valdis@turing-police.cc.vt.edu [127.0.0.1]) by turing-police.cc.vt.edu (8.13.3.Beta0/8.13.3.Beta0) with ESMTP id j0VJgIYs016952; Mon, 31 Jan 2005 14:42:20 -0500 Message-Id: <200501311942.j0VJgIYs016952@turing-police.cc.vt.edu> X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.1-RC3 To: Adrian Bunk Cc: Arjan van de Ven , Lorenzo =?iso-8859-1?Q?Hern=E1ndez_Garc=EDa-Hierro?= , Stephen Hemminger , "linux-kernel@vger.kernel.org" , Chris Wright , netdev@oss.sgi.com, Hank Leininger Subject: Re: [PATCH] OpenBSD Networking-related randomization port In-Reply-To: Your message of "Mon, 31 Jan 2005 17:50:25 +0100." <20050131165025.GN18316@stusta.de> From: Valdis.Kletnieks@vt.edu References: <1106932637.3778.92.camel@localhost.localdomain> <20050128100229.5c0e4ea1@dxpl.pdx.osdl.net> <1106937110.3864.5.camel@localhost.localdomain> <20050128105217.1dc5ef42@dxpl.pdx.osdl.net> <1106944492.3864.30.camel@localhost.localdomain> <1106945266.7776.41.camel@laptopd505.fenrus.org> <200501290915.j0T9FkVY012948@turing-police.cc.vt.edu> <20050131165025.GN18316@stusta.de> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==_Exmh_1107200537_32560P"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Date: Mon, 31 Jan 2005 14:42:18 -0500 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1113 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Valdis.Kletnieks@vt.edu Precedence: bulk X-list: netdev Content-Length: 1034 Lines: 30 --==_Exmh_1107200537_32560P Content-Type: text/plain; charset=us-ascii On Mon, 31 Jan 2005 17:50:25 +0100, Adrian Bunk said: > On Sat, Jan 29, 2005 at 04:15:43AM -0500, Valdis.Kletnieks@vt.edu wrote: > > Note that obsd_rand.c started off life as a BSD-licensed file - I was told > > that was a show-stopper when I submitted basically the same patch a while back. > >... > > At least the three clause BSD license is GPL compatible. The copy of obsd_rand.c I have hass the problematic 4-clause version. It looks to me like we'd need to get Michael Shalayeff, Theodore T'so, and Niels Provos to all agree to re-license under the 3-clause variant. Using Arjan's code is most likely the better approach... --==_Exmh_1107200537_32560P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) Comment: Exmh version 2.5 07/13/2001 iD8DBQFB/ooZcC3lWbTT17ARAgbcAJ0Qn3ivh/rz9hIRaA4/ZaB4oZrx9wCdGXJL VqYqh5yoLkS51NMtBgzmfys= =rgm9 -----END PGP SIGNATURE----- --==_Exmh_1107200537_32560P-- From davem@davemloft.net Mon Jan 31 11:44:17 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 11:44:23 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VJiGCC020361 for ; Mon, 31 Jan 2005 11:44:17 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CvhNa-00075f-00; Mon, 31 Jan 2005 11:38:34 -0800 Date: Mon, 31 Jan 2005 11:38:34 -0800 From: "David S. Miller" To: Harald Welte Cc: netdev@oss.sgi.com Subject: Re: [BUG] sundance "Something Wicked happened!" (IntrPCIErr) Message-Id: <20050131113834.440faca8.davem@davemloft.net> In-Reply-To: <20050131165947.GJ6878@sunbeam.de.gnumonks.org> References: <20050131165947.GJ6878@sunbeam.de.gnumonks.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1114 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 785 Lines: 26 On Mon, 31 Jan 2005 17:59:48 +0100 Harald Welte wrote: > Looking at the source code, the error message only happens if IntrPCIErr > is set. Try adding a printout here of the PCI status register in config space when this happens, something like: { u16 val; pci_read_config_word(np->pci_dev, PCI_STATUS, &val); printk("%s: PCI status is %x\n", dev->name, val); } What we'll be looking for are bits set there such as PCI_STATUS_SIG_TARGET_ABORT, PCI_STATUS_REC_TARGET_ABORT, PCI_STATUS_REC_MASTER_ABORT, PCI_SIG_SYSTEM_ERROR, or PCI_STATUS_DETECTED_PARITY. That will tell us who is seeing the error and thus signalling the event (either PCI bus or the sundance chip itself). I don't know anything specific about the sundance hardware though, sorry. From davem@davemloft.net Mon Jan 31 11:46:28 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 11:46:44 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VJkRHL021002 for ; Mon, 31 Jan 2005 11:46:28 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CvhP2-00075r-00; Mon, 31 Jan 2005 11:40:04 -0800 Date: Mon, 31 Jan 2005 11:40:04 -0800 From: "David S. Miller" To: Herbert Xu Cc: akpm@osdl.org, au@unterluggauer.org, netdev@oss.sgi.com Subject: Re: Fw: [Bugme-new] [Bug 4138] New: ipsec with racoon in transport mode with esp and ah hangs (problem is in xfrm_state_add) Message-Id: <20050131114004.6c61cdc1.davem@davemloft.net> In-Reply-To: References: <20050130224404.5f78d28a.akpm@osdl.org> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1115 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 410 Lines: 12 On Mon, 31 Jan 2005 21:54:33 +1100 Herbert Xu wrote: > Well without the check we would have silently ignored the sequence > number which is why you wouldn't have noticed the problem with racoon > before. > > However, for those who need to use the sequence number this check is > necessary. Yes, but the loop in the kernel must be prevented nevertheless, buggy userland or not. From davem@davemloft.net Mon Jan 31 11:52:22 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 11:52:28 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VJqMMZ021584 for ; Mon, 31 Jan 2005 11:52:22 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CvhVR-00078q-00; Mon, 31 Jan 2005 11:46:41 -0800 Date: Mon, 31 Jan 2005 11:46:40 -0800 From: "David S. Miller" To: Martin Wilck Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: SIOCGIFMAP silently broken? Message-Id: <20050131114640.7e002652.davem@davemloft.net> In-Reply-To: <41FE4745.4020003@fujitsu-siemens.com> References: <41FE4745.4020003@fujitsu-siemens.com> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1116 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 506 Lines: 13 On Mon, 31 Jan 2005 15:57:09 +0100 Martin Wilck wrote: > In both cases, the netdev->irq field isn't used anymore; perhaps it > should be officially deprecated and/or removed? It is used for explicitly setting the IRQ value on hardware where doing so automatically via probing may not be %100 reliable, such as on ISA. Another way to do what you're trying to do is to look for the string name of the device you are interested in within the output of /proc/interrupts. From lorenzo@gnu.org Mon Jan 31 12:03:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 12:04:01 -0800 (PST) Received: from vds-320151.amen-pro.com (vds-320151.amen-pro.com [62.193.204.86]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VK3rJJ025744 for ; Mon, 31 Jan 2005 12:03:54 -0800 Received: (qmail 19013 invoked from network); 31 Jan 2005 20:03:57 -0000 Received: from 67.red-80-25-56.pooles.rima-tde.net (HELO estila) (80.25.56.67) by vds-320151.amen-pro.com with RC4-MD5 encrypted SMTP; 31 Jan 2005 20:03:57 -0000 Subject: Re: [PATCH] OpenBSD Networking-related randomization port From: Lorenzo =?ISO-8859-1?Q?Hern=E1ndez_?= =?ISO-8859-1?Q?Garc=EDa-Hierro?= To: Valdis.Kletnieks@vt.edu Cc: Adrian Bunk , Arjan van de Ven , Stephen Hemminger , "linux-kernel@vger.kernel.org" , Chris Wright , netdev@oss.sgi.com, Hank Leininger In-Reply-To: <200501311942.j0VJgIYs016952@turing-police.cc.vt.edu> References: <1106932637.3778.92.camel@localhost.localdomain> <20050128100229.5c0e4ea1@dxpl.pdx.osdl.net> <1106937110.3864.5.camel@localhost.localdomain> <20050128105217.1dc5ef42@dxpl.pdx.osdl.net> <1106944492.3864.30.camel@localhost.localdomain> <1106945266.7776.41.camel@laptopd505.fenrus.org> <200501290915.j0T9FkVY012948@turing-police.cc.vt.edu> <20050131165025.GN18316@stusta.de> <200501311942.j0VJgIYs016952@turing-police.cc.vt.edu> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-AVmFsIIHHG+gKFoHrkir" Date: Mon, 31 Jan 2005 21:03:19 +0100 Message-Id: <1107201800.3754.125.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1117 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: lorenzo@gnu.org Precedence: bulk X-list: netdev Content-Length: 1605 Lines: 54 --=-AVmFsIIHHG+gKFoHrkir Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable El lun, 31-01-2005 a las 14:42 -0500, Valdis.Kletnieks@vt.edu escribi=F3: > On Mon, 31 Jan 2005 17:50:25 +0100, Adrian Bunk said: > > On Sat, Jan 29, 2005 at 04:15:43AM -0500, Valdis.Kletnieks@vt.edu wrote= : >=20 > > > Note that obsd_rand.c started off life as a BSD-licensed file - I was= told > > > that was a show-stopper when I submitted basically the same patch a w= hile back. > > >... > >=20 > > At least the three clause BSD license is GPL compatible. >=20 > The copy of obsd_rand.c I have hass the problematic 4-clause version. It= looks > to me like we'd need to get Michael Shalayeff, Theodore T'so, and Niels P= rovos > to all agree to re-license under the 3-clause variant. Using Arjan's cod= e is > most likely the better approach... Then we would in that way ;) Arjan, I will give it a further look, is there anything you want to comment about it before I start? I will re-code it to put the helper functions in random.c. Thanks in advance, Cheers. --=20 Lorenzo Hern=E1ndez Garc=EDa-Hierro =20 [1024D/6F2B2DEC] & [2048g/9AE91A22][http://tuxedo-es.org] --=-AVmFsIIHHG+gKFoHrkir Content-Type: application/pgp-signature; name=signature.asc Content-Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada digitalmente -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBB/o8HDcEopW8rLewRAjDtAKCMssmkFWhRzK5v//8h1Fpe7VnpegCfc2In SI487ff/iOYdkrjafiSATi0= =mga2 -----END PGP SIGNATURE----- --=-AVmFsIIHHG+gKFoHrkir-- From hadi@cyberus.ca Mon Jan 31 12:08:54 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 12:08:59 -0800 (PST) Received: from mx04.cyberus.ca (mx04.cybersurf.com [209.197.145.108]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VK8rTi026317 for ; Mon, 31 Jan 2005 12:08:54 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx04.cyberus.ca with esmtp (Exim 4.30) id 1Cvhqm-0000Nw-N9 for netdev@oss.sgi.com; Mon, 31 Jan 2005 13:08:44 -0700 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Cvhqe-0005jU-0H; Mon, 31 Jan 2005 15:08:36 -0500 Subject: Re: dummy as IMQ replacement From: jamal Reply-To: hadi@cyberus.ca To: Lennert Buytenhek Cc: Hasso Tepper , netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto In-Reply-To: <20050131180048.GA24851@xi.wantstofly.org> References: <1107123123.8021.80.camel@jzny.localdomain> <200501311614.31397.hasso@estpak.ee> <1107181551.7847.193.camel@jzny.localdomain> <200501311646.14322.hasso@estpak.ee> <20050131180048.GA24851@xi.wantstofly.org> Content-Type: text/plain Organization: jamalopolous Message-Id: <1107202111.1076.537.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 31 Jan 2005 15:08:31 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1118 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 1132 Lines: 29 On Mon, 2005-01-31 at 13:00, Lennert Buytenhek wrote: > On Mon, Jan 31, 2005 at 04:46:14PM +0200, Hasso Tepper wrote: > > > This is somewhat related to killing the chance to use iptables as well ... > > Iptables has better documentation and people use it just because of that. > > I'm afraid I have to agree on this one. Well, if you look at the 2 requirements behind IMQ, has nothing todo with iptables i.e does not at all require presence of iptables. So motivation is to meet those requirements not kill iptables. > The idea behind iptables is > easy to grasp, whereas tc isn't totally obvious, and all tc 'tutorials' > out there just give you a long list of commands to type in but don't > really explain you what goes on under the hood. > > And you can't just expect everyone to "Go look at the source." Agreed, tc is less usable and has a lot less people puking code at it. The usability part has to be fixed. And i think you will see that with ematch and eaction code showing up. Credit goes to Bart and co and their website for putting a lot of docs together. Usability certainly needs to improve! cheers, jamal From mingo@elte.hu Mon Jan 31 12:12:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 12:12:53 -0800 (PST) Received: from mx1.elte.hu (mx1.elte.hu [157.181.1.137]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VKCklC026856 for ; Mon, 31 Jan 2005 12:12:47 -0800 Received: from chiara.elte.hu (chiara.elte.hu [157.181.150.200]) by mx1.elte.hu (Postfix) with ESMTP id 078493186C2; Mon, 31 Jan 2005 21:10:05 +0100 (CET) Received: by chiara.elte.hu (Postfix, from userid 17806) id 3F4911FC2; Mon, 31 Jan 2005 21:11:46 +0100 (CET) Date: Mon, 31 Jan 2005 21:11:41 +0100 From: Ingo Molnar To: Lorenzo =?iso-8859-1?Q?Hern=E1ndez_Garc=EDa-Hierro?= Cc: Adrian Bunk , Valdis.Kletnieks@vt.edu, Arjan van de Ven , Stephen Hemminger , "linux-kernel@vger.kernel.org" , Chris Wright , netdev@oss.sgi.com, Hank Leininger , "David S. Miller" , linux@horizon.com Subject: Re: [PATCH] OpenBSD Networking-related randomization port Message-ID: <20050131201141.GA4879@elte.hu> References: <1106932637.3778.92.camel@localhost.localdomain> <20050128100229.5c0e4ea1@dxpl.pdx.osdl.net> <1106937110.3864.5.camel@localhost.localdomain> <20050128105217.1dc5ef42@dxpl.pdx.osdl.net> <1106944492.3864.30.camel@localhost.localdomain> <1106945266.7776.41.camel@laptopd505.fenrus.org> <200501290915.j0T9FkVY012948@turing-police.cc.vt.edu> <20050131165025.GN18316@stusta.de> <1107192218.3754.86.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1107192218.3754.86.camel@localhost.localdomain> User-Agent: Mutt/1.4.1i X-ELTE-SpamVersion: MailScanner 4.31.6-itk1 (ELTE 1.2) SpamAssassin 2.63 ClamAV 0.73 X-ELTE-VirusStatus: clean X-ELTE-SpamCheck: no X-ELTE-SpamCheck-Details: score=-4.9, required 5.9, autolearn=not spam, BAYES_00 -4.90 X-ELTE-SpamLevel: X-ELTE-SpamScore: -4 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1119 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mingo@elte.hu Precedence: bulk X-list: netdev Content-Length: 1032 Lines: 30 * Lorenzo Hernández García-Hierro wrote: > > At least the three clause BSD license is GPL compatible. > > Yes, AFAIK :) > > I will try to follow Arjan's recommendations on using his functions > instead of obsd ones, even if I think it should be alone in the > current file. Also I will split up the patch. could you please also react to this feedback: http://marc.theaimsgroup.com/?l=linux-kernel&m=110698371131630&w=2 to quote a couple of key points from that very detailed security analysis: " I'm not sure how the OpenBSD code is better in any way. (Notice that it uses the same "half_md4_transform" as Linux; you just added another copy.) Is there a design note on how the design was chosen? " that mail also includes a much smaller patch to random.c. ( Obviously the more fundamental questions have to be solved prior solving code-level problems, patch splitup and patch ordering - often one ends up having a much smaller patch to work with, by thinking more about the fundamentals. ) Ingo From hadi@cyberus.ca Mon Jan 31 12:18:44 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 12:18:49 -0800 (PST) Received: from mx04.cyberus.ca (mx04.cybersurf.com [209.197.145.108]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VKIiSF027451 for ; Mon, 31 Jan 2005 12:18:44 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx04.cyberus.ca with esmtp (Exim 4.30) id 1Cvi0L-0003xE-4p for netdev@oss.sgi.com; Mon, 31 Jan 2005 13:18:37 -0700 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1Cvi0N-0007DY-3V; Mon, 31 Jan 2005 15:18:39 -0500 Subject: Re: dummy as IMQ replacement From: jamal Reply-To: hadi@cyberus.ca To: Thomas Graf Cc: netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto In-Reply-To: <20050131181553.GG31837@postel.suug.ch> References: <1107123123.8021.80.camel@jzny.localdomain> <20050131135810.GC31837@postel.suug.ch> <1107181169.7840.184.camel@jzny.localdomain> <20050131151532.GE31837@postel.suug.ch> <1107186044.1076.11.camel@jzny.localdomain> <20050131155929.GF31837@postel.suug.ch> <1107189625.1076.77.camel@jzny.localdomain> <20050131181553.GG31837@postel.suug.ch> Content-Type: text/plain Organization: jamalopolous Message-Id: <1107202715.1075.559.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 31 Jan 2005 15:18:35 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1120 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 3132 Lines: 75 On Mon, 2005-01-31 at 13:15, Thomas Graf wrote: > I haven't left ns sim so far, my calculations are based on some of the > linux specific cc modifications though, i.e. I modified ns sim a bit > to provide the same information. I'm thinking about moving to umlsim, > it should provide a better real world simulation. > The problem is if theres any bugs in the way algos are implemented in Linux you are influenced by that truth. Starting with ns and then validating on Linux is a great way to do it. > Sounds good, we could put up a ematch csum for validation and a eaction > for recomputation. I'll wait for your code to show up. > Cross your fingers; worst case by weekend i should get something out. > > Essentially on ingress create state; i have to find my notes to give you > > precise answer. But one of the parameters was to select the level of > > state tracking (such as "track IP only" - not sure how doable that is > > with contrack) > > So you want to have a generic conntrack action capable of dynamically > taking whatever information into account that the user requests? This > remembers me of the esfq effort which could benefit from this, it > extends sfq to take the definition for a flow as a parameter. We could > share some code here. > I dont think contrack was designed for this kind of effort. If we totaly fail to do it using contrack then we could go a different path. sfq already stores some rough view of the state; not sure if it can benefit from this. > > Stateless NAT doesnt really need contracking. pedit (taught to speak > > english) + eaction csum should do it. > > Right, given we don't need any reverse translation. Still it would be > neat to set the conntrack attributes so one could use iptables later > on, I'm not sure how doable this is though. > If you are NATing (stateless) you should enter rules for both directions; Maybe we could write a wrapper where user only enters outgoing rule and that automatically generates the incoming rule as well. > Something different... > > This sounds all very good but I think we're still sucessfully ignoring > one of the most important points, usability. Absolutely. > Most modifications over > the last few months have complicated things, introduced different behaviour > depending on compile time options and userspace tools which are either > outdated or having features being completely undocumented. Some of the > recent additions don't even show up in the usage text of iproute2. So > I think we should at least part time focus a little more on the big > picture and make things consitent and more useable. At least 50% of the > functionaility currently in mainline is completely unused because nobody > knows about it. I'm in no way against any of the recent additions but > maybe we can also put some more effort into usability. I think the eactions etc are adding a lot of value towards usability. Hasso Tepper was ealrier complaining about this same issue. As an example, I think u32 and ematches would improve a great deal now and be more understandable. True, work/time still needs to be invested. cheers, jamal From herbert@gondor.apana.org.au Mon Jan 31 12:27:09 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 12:27:16 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VKR8YO031444 for ; Mon, 31 Jan 2005 12:27:09 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1Cvi89-00019F-00; Tue, 01 Feb 2005 07:26:41 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1Cvi7c-0002IY-00; Tue, 01 Feb 2005 07:26:08 +1100 Date: Tue, 1 Feb 2005 07:26:08 +1100 To: "David S. Miller" Cc: akpm@osdl.org, au@unterluggauer.org, netdev@oss.sgi.com Subject: Re: Fw: [Bugme-new] [Bug 4138] New: ipsec with racoon in transport mode with esp and ah hangs (problem is in xfrm_state_add) Message-ID: <20050131202608.GA8794@gondor.apana.org.au> References: <20050130224404.5f78d28a.akpm@osdl.org> <20050131114004.6c61cdc1.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050131114004.6c61cdc1.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1121 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 672 Lines: 16 On Mon, Jan 31, 2005 at 11:40:04AM -0800, David S. Miller wrote: > > Yes, but the loop in the kernel must be prevented nevertheless, > buggy userland or not. I'm not sure that there is a loop. Apart from the word hang in the subject line, the submitter didn't talk about a loop at all. Perhaps he's referring to the loop where the kernel continuously sends acquire messages to racoon but racoon responds by doing duplicate adds thus deleting the larval SAs? -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From david@hardeman.nu Mon Jan 31 12:30:47 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 12:30:50 -0800 (PST) Received: from palpatine.hardeman.nu (1-1-12-13a.han.sth.bostream.se [82.182.30.168]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VKUiDS031958 for ; Mon, 31 Jan 2005 12:30:46 -0800 Received: from david by palpatine.hardeman.nu with local (Exim 4.34) id 1CviB4-00074x-32; Mon, 31 Jan 2005 21:29:42 +0100 Date: Mon, 31 Jan 2005 21:29:42 +0100 From: David =?iso-8859-1?Q?H=E4rdeman?= To: Marcelo Tosatti Cc: Bukie Mabayoje , sfeldma@pobox.com, Michael Gernoth , linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: 2.4.29, e100 and a WOL packet causes keventd going mad Message-ID: <20050131202940.GA26992@hardeman.nu> References: <20050130171849.GA3354@hardeman.nu> <1107143255.18167.428.camel@localhost.localdomain> <41FDB2D3.5CBD6F7D@gte.net> <20050131152431.GA14176@logos.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20050131152431.GA14176@logos.cnet> User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1122 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: david@2gen.com Precedence: bulk X-list: netdev Content-Length: 1257 Lines: 32 On Mon, Jan 31, 2005 at 01:24:31PM -0200, Marcelo Tosatti wrote: >On Sun, Jan 30, 2005 at 08:23:47PM -0800, Bukie Mabayoje wrote: >> Scott Feldman wrote: >>> David, would you give this patch a try? Make sure the system still >>> wakes from a magic packet if suspended or shut down, and doesn't cause >>> kacpid to go crazy if system is running. If it helps for 2.6, perhaps >>> someone can look into 2.4 to see if there is something similar going on >> >> This issue was reported on 2.4. > >Can any of you guys test v2.6, please? > I tried the second patch provided by Scott on a 2.6.10 kernel, I did some minor tweaks to get it to apply (changed pci_choose_state() and PCI_D0 back to the way they were in 2.6.10) and tested the results five minutes ago. It works great, I havent tried suspending the machine cause I have no need for that functionality. I have however started the machine via WOL (works), sent WOL-packet to the machine when powered on (nothing happends - kacpid doesn't go wild, works), shutdown (works without the machine spontaneously rebooting). So everything seems to be fixed by the patch (save for suspending which I didn't test). Thanks alot, I hope the patch will be in the next stable 2.6 kernel. Regards, David From davem@davemloft.net Mon Jan 31 12:33:56 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 12:34:02 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VKXtNU032503 for ; Mon, 31 Jan 2005 12:33:55 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1Cvi9U-0007JR-00; Mon, 31 Jan 2005 12:28:04 -0800 Date: Mon, 31 Jan 2005 12:28:04 -0800 From: "David S. Miller" To: hadi@cyberus.ca Cc: tgraf@suug.ch, netdev@oss.sgi.com, nguyendinhnam@gmail.com, rmocius@auste.elnet.lt, andre@tomt.net, syrius.ml@no-log.org, andy.furniss@dsl.pipex.com, damion@snapgear.com Subject: Re: dummy as IMQ replacement Message-Id: <20050131122804.75d0611f.davem@davemloft.net> In-Reply-To: <1107186044.1076.11.camel@jzny.localdomain> References: <1107123123.8021.80.camel@jzny.localdomain> <20050131135810.GC31837@postel.suug.ch> <1107181169.7840.184.camel@jzny.localdomain> <20050131151532.GE31837@postel.suug.ch> <1107186044.1076.11.camel@jzny.localdomain> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1123 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 1480 Lines: 34 On 31 Jan 2005 10:40:44 -0500 jamal wrote: > My experience is that you end up dropping no more than a packet in a > burst with policing before TCP adjusts. Also depending on the gap > between bursts, that may be the only packet you drop altogether. > In long flows such as file transfers, avergae of one packet ever gets > dropped. Keep in mind that this does not help people with connection heavy access patterns. If you have a lot of people doing small transactions, ACK pacing as well as data traffic dropping is necessary. The heart of TCP pacing is ACK rates. All of it's data sending is clocked via ACK arrival. Therefore the best scheme seems to be ACK pacing along with data dropping. The ACK pacing is the "nice" policing where as the data dropping is the big hammer. Ideally, the ACK pacing will produce the desired data rate and thus the data dropping will not be necessary. ACK pacing is more desirable also because of schemes such as VEGAS congestion control which wish to test the limits of a link without any data drops. It's basic idea is that "if my delay increases, yet my throughput does not, I am doing nothing more than eating router queue space and therefore have gone beyond the limits of this path, back off" I know there are problems with VEGAS, but it is a good example to use in showing that the way to tame TCP's data sending rate is by controlling the ACKs not by dropping the data, as a first order method of policing. From davem@davemloft.net Mon Jan 31 12:42:49 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 12:42:55 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VKgn4i000933 for ; Mon, 31 Jan 2005 12:42:49 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CviHk-0007KD-00; Mon, 31 Jan 2005 12:36:36 -0800 Date: Mon, 31 Jan 2005 12:36:36 -0800 From: "David S. Miller" To: Herbert Xu Cc: akpm@osdl.org, au@unterluggauer.org, netdev@oss.sgi.com Subject: Re: Fw: [Bugme-new] [Bug 4138] New: ipsec with racoon in transport mode with esp and ah hangs (problem is in xfrm_state_add) Message-Id: <20050131123636.7eb3455c.davem@davemloft.net> In-Reply-To: <20050131202608.GA8794@gondor.apana.org.au> References: <20050130224404.5f78d28a.akpm@osdl.org> <20050131114004.6c61cdc1.davem@davemloft.net> <20050131202608.GA8794@gondor.apana.org.au> X-Mailer: Sylpheed version 1.0.0 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1125 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 459 Lines: 11 On Tue, 1 Feb 2005 07:26:08 +1100 Herbert Xu wrote: > I'm not sure that there is a loop. Apart from the word hang in the > subject line, the submitter didn't talk about a loop at all. > > Perhaps he's referring to the loop where the kernel continuously > sends acquire messages to racoon but racoon responds by doing > duplicate adds thus deleting the larval SAs? Ok, that's a different case, the loop is in userspace there. From bukiemab@gte.net Mon Jan 31 12:42:07 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 12:42:12 -0800 (PST) Received: from out007.verizon.net (out007pub.verizon.net [206.46.170.107]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VKg2ur000677 for ; Mon, 31 Jan 2005 12:42:06 -0800 Received: from gte.net ([66.199.68.159]) by out007.verizon.net (InterMail vM.5.01.06.06 201-253-122-130-106-20030910) with ESMTP id <20050131204159.ZKGJ21228.out007.verizon.net@gte.net>; Mon, 31 Jan 2005 14:41:59 -0600 Message-ID: <41FE9BA3.BE2896C3@gte.net> Date: Mon, 31 Jan 2005 12:57:07 -0800 From: Bukie Mabayoje X-Mailer: Mozilla 4.78 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: "Brandeburg, Jesse" CC: sfeldma@pobox.com, ncunningham@linuxmail.org, "David =?iso-8859-1?Q?H=E4rdeman?=" , Michael Gernoth , Linux Kernel Mailing List , netdev@oss.sgi.com Subject: Re: 2.4.29, e100 and a WOL packet causes keventd going mad References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH at out007.verizon.net from [66.199.68.159] at Mon, 31 Jan 2005 14:41:58 -0600 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1124 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bukiemab@gte.net Precedence: bulk X-list: netdev Content-Length: 1357 Lines: 24 The issue is not the PME interrupt, the issue is that the device is going into a state that is not valid. A live system should never ASSERT PME# line. As long as this functionality is enable on the chip the PME will be asserted. To avoid this unwanted condition the driver should disable PME on the chip on a live system. And enable it back when it is going to any of the PWR STATE that require a wake up by the LAN. "Brandeburg, Jesse" wrote: > >+static void e100_shutdown(struct device *dev) > >+{ > >+ struct pci_dev *pdev = container_of(dev, struct pci_dev, dev); > >+ struct net_device *netdev = pci_get_drvdata(pdev); > >+ struct nic *nic = netdev_priv(netdev); > >+ > >+ pci_enable_wake(pdev, PCI_D0, nic->flags & (wol_magic | > >e100_asf(nic))); > >+} > >+ > > Separately, does anyone think that the OS should be handling the PME event on the bus (as it comes from the PIC as an interrupt, and can be masked at the PIC) with a default handler? The machines having the problem seem to be killed by an interrupt storm generated by the PME interrupt, just a guess. > > Jesse > - > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ From bukiemab@gte.net Mon Jan 31 12:58:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 12:58:41 -0800 (PST) Received: from out012.verizon.net (out012pub.verizon.net [206.46.170.137]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VKwRf7002118 for ; Mon, 31 Jan 2005 12:58:31 -0800 Received: from gte.net ([66.199.68.159]) by out012.verizon.net (InterMail vM.5.01.06.06 201-253-122-130-106-20030910) with ESMTP id <20050131205826.KKSV2837.out012.verizon.net@gte.net>; Mon, 31 Jan 2005 14:58:26 -0600 Message-ID: <41FE9F7F.5F9E5F93@gte.net> Date: Mon, 31 Jan 2005 13:13:35 -0800 From: Bukie Mabayoje X-Mailer: Mozilla 4.78 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: Marcelo Tosatti CC: sfeldma@pobox.com, "David =?iso-8859-1?Q?H=E4rdeman?=" , Michael Gernoth , linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: 2.4.29, e100 and a WOL packet causes keventd going mad References: <20050130171849.GA3354@hardeman.nu> <1107143255.18167.428.camel@localhost.localdomain> <41FDB2D3.5CBD6F7D@gte.net> <20050131152431.GA14176@logos.cnet> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Authentication-Info: Submitted using SMTP AUTH at out012.verizon.net from [66.199.68.159] at Mon, 31 Jan 2005 14:58:26 -0600 X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1126 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bukiemab@gte.net Precedence: bulk X-list: netdev Content-Length: 1639 Lines: 39 Marcelo Tosatti wrote: > On Sun, Jan 30, 2005 at 08:23:47PM -0800, Bukie Mabayoje wrote: > > > > Scott Feldman wrote: > > > > > On Sun, 2005-01-30 at 09:18, David Härdeman wrote: > > > > I experience the same problems as reported by Michael Gernoth when > > > > sending a WOL-packet to computer with a e100 NIC which is already > > > > powered on. > > > > > > I didn't look at the 2.4 case, but for 2.6, it seems e100 was enabling > > > PME wakeup during probe. PME shouldn't be enabled while the system is > > > up. I suspect the assertion of PME while the system is up is what's > > > causing problems. This patch moves PME wakeup enabling to either > > > suspend or shutdown. > > > > > > David, would you give this patch a try? Make sure the system still > > > wakes from a magic packet if suspended or shut down, and doesn't cause > > > kacpid to go crazy if system is running. If it helps for 2.6, perhaps > > > someone can look into 2.4 to see if there is something similar going on > > > > This issue was reported on 2.4. > > Can any of you guys test v2.6, please? I will be glad to test it now but I can't, I am currently doing some work on 2.4. If no one has tested it in the next few days I will validate it then. By the way, do anyone have an idea how to get this functionality into 2.4 eepro100. The problem is that eepro100 code works on a non WOL cards. > > > - > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ From herbert@gondor.apana.org.au Mon Jan 31 13:11:36 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 13:11:43 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VLBYXX002915 for ; Mon, 31 Jan 2005 13:11:35 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CvipQ-0001rQ-00; Tue, 01 Feb 2005 08:11:24 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1Cvip4-0005IK-00; Tue, 01 Feb 2005 08:11:02 +1100 Date: Tue, 1 Feb 2005 08:11:02 +1100 To: Andreas Unterluggauer Cc: netdev@oss.sgi.com Subject: Re: Fw: [Bugme-new] [Bug 4138] New: ipsec with racoon in transport mode with esp and ah hangs (problem is in xfrm_state_add) Message-ID: <20050131211102.GA20323@gondor.apana.org.au> References: <200501311640.16118.au@unterluggauer.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200501311640.16118.au@unterluggauer.org> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1127 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 982 Lines: 22 Hi Andreas: On Mon, Jan 31, 2005 at 03:40:16PM +0000, Andreas Unterluggauer wrote: > > 2005-01-31 16:29:58: DEBUG: === > 2005-01-31 16:29:58: DEBUG: get pfkey ADD message > andi: libipsec/pfkey.c, pfkey_check: start (msg->sadb_msg_satype: 3) > 2005-01-31 16:29:58: DEBUG: andi: in pfkey.c, pk_recvadd: msg->sadb_msg_seq 2, msg->sadb_msg_type: ADD > 2005-01-31 16:29:58: INFO: IPsec-SA established: ESP/Transport 192.168.2.5->192.168.2.3 spi=103868257(0x630e761) > 2005-01-31 16:29:58: DEBUG: === Does the machine hang at this point in time? If not, then this is simply a racoon bug. Although the acquire message carries a policy with it, it's really only acquiring a single SA. Therefore, only the SA being acquired should be added with that sequence number. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From romieu@fr.zoreil.com Mon Jan 31 13:50:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 13:50:25 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VLoJ0F004229 for ; Mon, 31 Jan 2005 13:50:20 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.13.1/8.12.1) with ESMTP id j0VLnujZ013450; Mon, 31 Jan 2005 22:49:56 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.13.1/8.13.1/Submit) id j0VLnpQF013449; Mon, 31 Jan 2005 22:49:51 +0100 Date: Mon, 31 Jan 2005 22:49:51 +0100 From: Francois Romieu To: "Dale E. Martin" Cc: netdev@oss.sgi.com Subject: Re: where is the proper place for r8169 bug reports? Message-ID: <20050131214951.GA13217@electric-eye.fr.zoreil.com> References: <20050131181508.GA15908@gerbil.toadis.porkis> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050131181508.GA15908@gerbil.toadis.porkis> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1128 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Content-Length: 345 Lines: 11 Dale E. Martin : > I'm having an issue with this driver in Linux 2.4.28. I'm happy to submit > a full report and/or help debug if I know where to send the info. You can send info here and open a PR at bugzilla.kernel.org. If you are using a 2.95.x compiler (wild guess), it would be well advised to upgrade. -- Ueimor From dale@the-martins.org Mon Jan 31 13:59:58 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 14:00:11 -0800 (PST) Received: from smtp1.fuse.net (mail-out1.fuse.net [216.68.8.174]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VLxwsw005036 for ; Mon, 31 Jan 2005 13:59:58 -0800 Received: from gx4.fuse.net ([66.42.247.210]) by smtp1.fuse.net (InterMail vM.6.01.04.00 201-2131-118-20041027) with ESMTP id <20050131215755.HEHC18019.smtp1.fuse.net@gx4.fuse.net> for ; Mon, 31 Jan 2005 16:57:55 -0500 Received: from chinchilla.toadis.porkis ([66.42.247.210]) by gx4.fuse.net (InterMail vG.1.02.00.02 201-2136-104-102-20041210) with ESMTP id <20050131215811.POOC13012.gx4.fuse.net@chinchilla.toadis.porkis> for ; Mon, 31 Jan 2005 16:58:11 -0500 Received: from gerbil.toadis.porkis (localhost.localdomain) [192.168.10.2] by chinchilla.toadis.porkis with smtp (Exim 3.35 #1 (Debian)) id 1CvjaG-0002Yy-00; Mon, 31 Jan 2005 16:59:48 -0500 Received: by localhost.localdomain (sSMTP sendmail emulation); Mon, 31 Jan 2005 16:59:48 -0500 Date: Mon, 31 Jan 2005 16:59:48 -0500 From: "Dale E. Martin" To: netdev@oss.sgi.com Subject: Re: where is the proper place for r8169 bug reports? Message-ID: <20050131215948.GA23289@gerbil.toadis.porkis> References: <20050131181508.GA15908@gerbil.toadis.porkis> <20050131214951.GA13217@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050131214951.GA13217@electric-eye.fr.zoreil.com> User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1129 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dale@the-martins.org Precedence: bulk X-list: netdev Content-Length: 742 Lines: 21 > You can send info here and open a PR at bugzilla.kernel.org. OK. In general what I'm seeing is transmit timeout error that is locking the machine up when I try to run at gigabit speed. The board is a "Zonet" brand card, hooked to a Netgear 8 port gigabit switch. The same card worked in another machine so I'm guessing that the board isn't a paper weight at least. > If you are using a 2.95.x compiler (wild guess), it would be well advised > to upgrade. Hmmm, OK. I'm running Debian stable so that is what cc defaults to. I'll recompile with 3.3 and see if the problems go away. It could easily explain the difference between machines too. Thanks, Dale -- Dale E. Martin - dale@the-martins.org http://the-martins.org/~dmartin From davidsen@tmr.com Mon Jan 31 14:11:04 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 14:11:16 -0800 (PST) Received: from oddball.prodigy.com (prgy-npn1.prodigy.com [207.115.54.37]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VMB3qH006355 for ; Mon, 31 Jan 2005 14:11:03 -0800 Received: from [127.0.0.1] (oddball.prodigy.com [127.0.0.1]) by oddball.prodigy.com (8.11.6/8.11.6) with ESMTP id j0VMDal31916; Mon, 31 Jan 2005 17:13:37 -0500 Message-ID: <41FEAD90.6060403@tmr.com> Date: Mon, 31 Jan 2005 17:13:36 -0500 From: Bill Davidsen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Patrick McHardy CC: "David S. Miller" , David Brownell , jf-ml-k1-1087813225@lk8rp.mail.xeon.eu.org, david+challenge-response@blue-labs.org, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, ahaas@airmail.net Subject: Re: 2.6.11-rc2 TCP ignores PMTU ICMP (Re: Linux 2.6.11-rc2) References: <20050127154150.360f95e2.davem@davemloft.net><20050127154150.360f95e2.davem@davemloft.net> <41F99656.5040304@trash.net> In-Reply-To: <41F99656.5040304@trash.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1130 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davidsen@tmr.com Precedence: bulk X-list: netdev Content-Length: 1023 Lines: 33 Patrick McHardy wrote: > David S. Miller wrote: > >> I've forwarded this to netfilter-devel for inspection. >> Thanks for collecting all the data points so well. >> > Here is the fix for everyone. Please report back if it doesn't > solve the problem. Thanks. Worked here. > > > > ------------------------------------------------------------------------ > > ===== net/ipv4/netfilter/ip_nat_proto_tcp.c 1.10 vs edited ===== > --- 1.10/net/ipv4/netfilter/ip_nat_proto_tcp.c 2005-01-17 23:00:55 +01:00 > +++ edited/net/ipv4/netfilter/ip_nat_proto_tcp.c 2005-01-28 02:13:06 +01:00 > @@ -105,7 +105,7 @@ > return 0; > > iph = (struct iphdr *)((*pskb)->data + iphdroff); > - hdr = (struct tcphdr *)((*pskb)->data + iph->ihl*4); > + hdr = (struct tcphdr *)((*pskb)->data + hdroff); > > if (maniptype == IP_NAT_MANIP_SRC) { > /* Get rid of src ip and src pt */ -- -bill davidsen (davidsen@tmr.com) "The secret to procrastination is to put things off until the last possible moment - but no longer" -me From romieu@fr.zoreil.com Mon Jan 31 14:26:20 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 14:26:26 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VMQJNw007146 for ; Mon, 31 Jan 2005 14:26:20 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.13.1/8.12.1) with ESMTP id j0VMNlli014121; Mon, 31 Jan 2005 23:23:47 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.13.1/8.13.1/Submit) id j0VMNg8M014120; Mon, 31 Jan 2005 23:23:42 +0100 Date: Mon, 31 Jan 2005 23:23:42 +0100 From: Francois Romieu To: "Dale E. Martin" Cc: netdev@oss.sgi.com Subject: Re: where is the proper place for r8169 bug reports? Message-ID: <20050131222342.GB13217@electric-eye.fr.zoreil.com> References: <20050131181508.GA15908@gerbil.toadis.porkis> <20050131214951.GA13217@electric-eye.fr.zoreil.com> <20050131215948.GA23289@gerbil.toadis.porkis> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050131215948.GA23289@gerbil.toadis.porkis> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1131 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Content-Length: 594 Lines: 17 Dale E. Martin : [...] > Hmmm, OK. I'm running Debian stable so that is what cc defaults to. I'll > recompile with 3.3 and see if the problems go away. It could easily > explain the difference between machines too. Typical symptoms: the card works fine until 64 (256) packets are sent (received) then "Good bye Charlie". If it works, I'll gladly welcome an 'lspci -vx' + complete dmesg for my collection. Btw, you can test the patch below (on top of 2.4.28, no bad report so far): http://www.fr.zoreil.com/~romieu/misc/20041209-2.4.28-r8169.c-test.patch -- Ueimor From andy.furniss@dsl.pipex.com Mon Jan 31 14:39:53 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 14:39:58 -0800 (PST) Received: from galaxy.systems.pipex.net (galaxy.systems.pipex.net [62.241.162.31]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VMdpLr008047 for ; Mon, 31 Jan 2005 14:39:52 -0800 Received: from dsl.pipex.com (81-178-207-73.dsl.pipex.com [81.178.207.73]) by galaxy.systems.pipex.net (Postfix) with ESMTP id D2F3BE0001C1; Mon, 31 Jan 2005 22:39:42 +0000 (GMT) Message-ID: <41FEB3AE.3090400@dsl.pipex.com> Date: Mon, 31 Jan 2005 22:39:42 +0000 From: Andy Furniss User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212 X-Accept-Language: en-us, en MIME-Version: 1.0 To: hadi@znyx.com Cc: netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Damion de Soto Subject: Re: dummy as IMQ replacement References: <1107123123.8021.80.camel@jzny.localdomain> In-Reply-To: <1107123123.8021.80.camel@jzny.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1132 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: andy.furniss@dsl.pipex.com Precedence: bulk X-list: netdev Content-Length: 4017 Lines: 91 Jamal Hadi Salim wrote: > This is in relation to providing functionality that IMQ was intending > to using the dummy device and tc actions. Ive copied as many people as i > could dig who i know may have interest in this. > Please forward this to any other list which may have interest > in the subject. It still needs some cleaning up; however, i dont wanna > sit on it for another year - and now that mirred is out there, this is a > good time. > > Advantage over current IMQ; cleaner in particular in in SMP; > with a _lot_ less code. > Old Dummy device functionality is preserved while new one only > kicks in if you use actions. Didnt have to write a new device and finaly > made a real dumb device to be a little smarter ;-> > > IMQ USES > -------- > As far as i know the reasons listed below is why people use IMQ. > It would be nice to know of anything else that i missed because this > is the requirements list i used. > > 1) qdiscs/policies that are per device as opposed to system wide. > IMQ allows for sharing across multiple devices. > > 2) Allows for queueing incoming traffic for shaping instead of > dropping. I am not aware of any study that shows policing is > worse than shaping in achieving the end goal of rate control. I would say the end goal is shaping not just rate control. Shaping meaning different things to different people and ingress shaping being different from egress. For me it's from the wrong end of a relativly narrow (512kbit) bottleneck link that has a 600ms fifo at the other end. My aim to sacrifice as little bandwidth as possible while not adding latency bursts for gaming and per user bandwidth allocation (with sharing of unused) and sfq within that for bulk tcp traffic. If I was shaping LAN traffic, then policers/drops would be OK for me - but for a slow link I think queueing and dropping are better/give more control eg. I get to use sfq which should not drop the one packet a 56k user has managed to send me in the face of lots of incoming from low latency high bandwidth servers. Even if it's possible I bet few can easily get policers to setup the complex sharing/prioritisations that you can with HTB or HFSC. > I would be interested if anyone is experimenting. Nevertheless, > this is still an alternative as opposed to making a system wide > ingress change. > > 3) Very interesting use: if you are serving p2p you may wanna give > preference to your own localy originated traffic (when responses come > back) vs someone using your system to do bittorent. So QoSing based on > state comes in as the solution. What people did to achive this was stick > the IMQ somewhere prelocal hook. > I think this is a pretty neat feature to have in Linux in general. > (i.e not just for IMQ). I think flexibility is always good - tunnels, ipsec etc. may need it - I don't know from personal use, though. > But i wont go back to putting netfilter hooks in the device to satisfy > this. I also dont think its worth it hacking dummy some more to be > aware of say L3 info and play ip rule tricks to achieve this. > --> Instead the plan is to have a contrack related action. This action > will selectively either query/create contrack state on incoming packets. I don't understand exactly what you mean here - for my setup to work I need to see denatted addresses and mark (connbytes - it helps me be extra nasty to multiple simoultaneous connections in slowstart and prioritise browsing over bulk) in prerouting mangle. Of course if I can use netfilter to classify and save into contrack then I could do evrything in netfilter and then use something like connmark to save it per connection. > Packets could then be redirected to dummy based on what happens -> eg > on incoming packets; if we find they are of known state we could send to > a different queue than one which didnt have existing state. This > all however is dependent on whatever rules the admin enters. How does the admin enter the rules - netfilter or other? Andy. From tgraf@suug.ch Mon Jan 31 14:53:10 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 14:53:15 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j0VMr950008731 for ; Mon, 31 Jan 2005 14:53:10 -0800 Received: from postel.suug.ch (postel.suug.ch [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id F3C8282; Mon, 31 Jan 2005 23:52:45 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 02C691C0EA; Mon, 31 Jan 2005 23:53:28 +0100 (CET) Date: Mon, 31 Jan 2005 23:53:28 +0100 From: Thomas Graf To: jamal Cc: netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Andy Furniss , Damion de Soto Subject: Re: dummy as IMQ replacement Message-ID: <20050131225328.GI31837@postel.suug.ch> References: <1107123123.8021.80.camel@jzny.localdomain> <20050131135810.GC31837@postel.suug.ch> <1107181169.7840.184.camel@jzny.localdomain> <20050131151532.GE31837@postel.suug.ch> <1107186044.1076.11.camel@jzny.localdomain> <20050131155929.GF31837@postel.suug.ch> <1107189625.1076.77.camel@jzny.localdomain> <20050131181553.GG31837@postel.suug.ch> <1107202715.1075.559.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1107202715.1075.559.camel@jzny.localdomain> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1133 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 2362 Lines: 47 * jamal <1107202715.1075.559.camel@jzny.localdomain> 2005-01-31 15:18 > On Mon, 2005-01-31 at 13:15, Thomas Graf wrote: > > > I haven't left ns sim so far, my calculations are based on some of the > > linux specific cc modifications though, i.e. I modified ns sim a bit > > to provide the same information. I'm thinking about moving to umlsim, > > it should provide a better real world simulation. > > > > The problem is if theres any bugs in the way algos are implemented in > Linux you are influenced by that truth. Starting with ns and then > validating on Linux is a great way to do it. Absolutely, that's why I first went to ns sim but a nice theory is worth nothing if it doesn't work in the real world. > I dont think contrack was designed for this kind of effort. If we totaly > fail to do it using contrack then we could go a different path. > sfq already stores some rough view of the state; not sure if it can > benefit from this. I was thinking of the parameters to define what a flow consists of. Extended SFQ basically allows you to define the hash function. I think I misunderstood you before and you don't want allow adjustable states on only a subset of the attributes, e.g. only L3 data. > If you are NATing (stateless) you should enter rules for both > directions; Maybe we could write a wrapper where user only enters > outgoing rule and that automatically generates the incoming rule as > well. Agreed iff we don't enforce it. > I think the eactions etc are adding a lot of value towards usability. > Hasso Tepper was ealrier complaining about this same issue. > As an example, I think u32 and ematches would improve a great deal now > and be more understandable. True, work/time still needs to be invested. I'd guess that the basic classifier will make the race because the documentation will be smaller due to the lack of parameters. ;-> But yes I agree, I think we're making small step forwards and hopefully the network config shell/tool/whatever will ease the steps to configure things. My primary goal is to allow using it without looking up parameters all the time, given one is aware of the common terms and basic concepts. I'll have some more time next week and will try to implement the traffic control bits or at least some of them. The wind forecast is pretty good for the next days so I won't have too much time. ;-> From linux@horizon.com Mon Jan 31 15:27:42 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 15:27:48 -0800 (PST) Received: from science.horizon.com (science.horizon.com [192.35.100.1]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id j0VNRflI010442 for ; Mon, 31 Jan 2005 15:27:41 -0800 Received: (qmail 11237 invoked by uid 1000); 31 Jan 2005 23:27:35 -0000 Date: 31 Jan 2005 23:27:35 -0000 Message-ID: <20050131232735.11236.qmail@science.horizon.com> From: linux@horizon.com To: lorenzo@gnu.org, mingo@elte.hu Subject: Re: [PATCH] OpenBSD Networking-related randomization port Cc: arjan@infradead.org, bunk@stusta.de, chrisw@osdl.org, davem@redhat.com, hlein@progressive-comp.com, linux-kernel@vger.kernel.org, linux@horizon.com, netdev@oss.sgi.com, shemminger@osdl.org, Valdis.Kletnieks@vt.edu In-Reply-To: <20050131201141.GA4879@elte.hu> X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1134 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: linux@horizon.com Precedence: bulk X-list: netdev Content-Length: 1112 Lines: 24 > could you please also react to this feedback: > > http://marc.theaimsgroup.com/?l=linux-kernel&m=110698371131630&w=2 > > to quote a couple of key points from that very detailed security > analysis: > > " I'm not sure how the OpenBSD code is better in any way. (Notice that > it uses the same "half_md4_transform" as Linux; you just added another > copy.) Is there a design note on how the design was chosen? " Just note that, in addition to the security aspects, there are also a whole set of multiprocessor issues. OpenBSD added SMP support in June 2004, and it looks like this code dates back to before that. It might be worth looking at what OpenBSD does now. Note that I have NOT looked at the patch other than the TCP ISN generation. However, given the condition of the ISN code, I am inclined to take a "guilty until proven innocent" view of the rest of it. Don't merge it until someone has really grokked it, not just kibitzed about code style issues. (The homebrew 15-bit block cipher in this code does show how much the world needs a small block cipher for some of these applications.) From mmporter@cox.net Mon Jan 31 16:10:15 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 16:11:41 -0800 (PST) Received: from fed1rmmtao05.cox.net (fed1rmmtao05.cox.net [68.230.241.34]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j110AFTl012371 for ; Mon, 31 Jan 2005 16:10:15 -0800 Received: from liberty.homelinux.org ([68.2.41.86]) by fed1rmmtao05.cox.net (InterMail vM.6.01.04.00 201-2131-117-20041022) with ESMTP id <20050201001008.VGOZ2734.fed1rmmtao05.cox.net@liberty.homelinux.org>; Mon, 31 Jan 2005 19:10:08 -0500 Received: (from mmporter@localhost) by liberty.homelinux.org (8.9.3/8.9.3/Debian 8.9.3-21) id RAA27529; Mon, 31 Jan 2005 17:10:09 -0700 Date: Mon, 31 Jan 2005 17:10:09 -0700 From: Matt Porter To: akpm@osdl.org, jgarzik@pobox.com Cc: netdev@oss.sgi.com, linuxppc-embedded@ozlabs.org Subject: [PATCH][NET] Add PPC440SP support to IBM EMAC driver Message-ID: <20050131171009.F25809@cox.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1135 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mporter@kernel.crashing.org Precedence: bulk X-list: netdev Content-Length: 716 Lines: 19 Configures EMAC thresholds appropriately for the EMAC on the PPC440SP. Signed-off-by: Matt Porter ===== drivers/net/ibm_emac/ibm_emac.h 1.3 vs edited ===== --- 1.3/drivers/net/ibm_emac/ibm_emac.h 2004-08-24 12:19:41 -07:00 +++ edited/drivers/net/ibm_emac/ibm_emac.h 2005-01-31 17:08:40 -07:00 @@ -237,6 +237,10 @@ #define EMAC_RWMR_DEFAULT 0x1000a200 #define EMAC_TMR0_DEFAULT EMAC_TMR0_TFAE_2_32 #define EMAC_TMR1_DEFAULT 0xa00f0000 +#elif defined(CONFIG_440SP) +#define EMAC_RWMR_DEFAULT 0x08002000 +#define EMAC_TMR0_DEFAULT EMAC_TMR0_TFAE_128_2048 +#define EMAC_TMR1_DEFAULT 0xf8200000 #else #define EMAC_RWMR_DEFAULT 0x0f002000 #define EMAC_TMR0_DEFAULT 0x00000000 From andy.furniss@dsl.pipex.com Mon Jan 31 17:02:23 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 17:02:30 -0800 (PST) Received: from galaxy.systems.pipex.net (galaxy.systems.pipex.net [62.241.162.31]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j1112M0I018599 for ; Mon, 31 Jan 2005 17:02:23 -0800 Received: from dsl.pipex.com (81-178-207-73.dsl.pipex.com [81.178.207.73]) by galaxy.systems.pipex.net (Postfix) with ESMTP id 26DFEE0001F7; Tue, 1 Feb 2005 01:02:11 +0000 (GMT) Message-ID: <41FED514.7060702@dsl.pipex.com> Date: Tue, 01 Feb 2005 01:02:12 +0000 From: Andy Furniss User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Thomas Graf Cc: jamal , netdev@oss.sgi.com, Nguyen Dinh Nam , Remus , Andre Tomt , syrius.ml@no-log.org, Damion de Soto Subject: Re: dummy as IMQ replacement References: <1107123123.8021.80.camel@jzny.localdomain> <20050131135810.GC31837@postel.suug.ch> <1107181169.7840.184.camel@jzny.localdomain> <20050131151532.GE31837@postel.suug.ch> In-Reply-To: <20050131151532.GE31837@postel.suug.ch> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1136 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: andy.furniss@dsl.pipex.com Precedence: bulk X-list: netdev Content-Length: 2744 Lines: 63 Thomas Graf wrote: >>Or dropping packets. TCP will adjust itself either way; at least >>thats true according to this formula [rfc3448] (originally derived from >>Reno, but people are finding it works fine with all other variants of >>TCP CC): >> >>----- >>The throughput equation is: >> >> s >> X = ---------------------------------------------------------- >> R*sqrt(2*b*p/3) + (t_RTO * (3*sqrt(3*b*p/8) * p * (1+32*p^2))) >> >> >>Where: >> >> X is the transmit rate in bytes/second. >> s is the packet size in bytes. >> R is the round trip time in seconds. >> p is the loss event rate, between 0 and 1.0, of the number of loss >> events as a fraction of the number of packets transmitted. >> t_RTO is the TCP retransmission timeout value in seconds. >> b is the number of packets acknowledged by a single TCP >> acknowledgement. WRT policers I never figured out where you would put the effects of playing with the burst size parameter and it's effects with few/many connections and any burstiness caused into an equasion like that. >>---- > > > Agreed, this was my first attempt and my current code is still based on > this. I'm trying to avoid a retransmit battle, therefore I try to > delay packets if possible with the hope that it's either just a peak > or the slow down is fast enough. I use a simplified RED and > tcp_xmit_retransmit_queue() input to avoid flick flack effects which > works pretty well for bulky streams. A burst buffer takes care > of interactive traffic with peaks but this doesn't work perfectly fine > yet. Overall, my attempt works pretty well if the other side uses > reno/bic and quite well for westwood and vegas. The problem is not that > it doesn't work at all but achieving a certain _stable_ rate is very > difficult, the delta of the requested and real rate is up to 25% depending > on the constancy of the rtt and wether they follow one of the proposed > tcp cc algorithms. The cc guessing code helps a bit but isn't very > accurate. > This sounds cool. For me in someways I think it could be nicer (in the case of shaping from the wrong end of a slow link) to delay the real packets - that way the tcps of the clients get to see the smoothed version of the traffic and you can delay udp aswell. How intelligent and how much, if any, per connection state do you/could you keep? I think being able to set a class that behaves as full before it is, removing the s from sfq, de piggybacking acks and singling out and handling slowstart connections specially could really help the world of shaping from the wrong end of slow links. There's always playing with rwin, but maybe that's abit OTT :-) Andy. From sfeldma@pobox.com Mon Jan 31 17:20:57 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 17:21:04 -0800 (PST) Received: from orb.pobox.com (orb.pobox.com [207.8.226.5]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j111KukX019448 for ; Mon, 31 Jan 2005 17:20:57 -0800 Received: from orb (localhost [127.0.0.1]) by orb.pobox.com (Postfix) with ESMTP id 05497B1; Mon, 31 Jan 2005 20:20:56 -0500 (EST) Received: from [192.168.0.3] (wbar2.sea1-4-5-062-153.sea1.dsl-verizon.net [4.5.62.153]) by orb.sasl.smtp.pobox.com (Postfix) with ESMTP id 4A69989; Mon, 31 Jan 2005 20:20:53 -0500 (EST) Subject: [PATCH 2.6] e100: remove reference to NAPI config option From: Scott Feldman Reply-To: sfeldma@pobox.com To: jgarzik@pobox.com Cc: netdev@oss.sgi.com, lunz@falooley.org Content-Type: text/plain Message-Id: <1107220952.3366.4.camel@sfeldma-mobl.dsl-verizon.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Mon, 31 Jan 2005 17:22:32 -0800 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1137 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sfeldma@pobox.com Precedence: bulk X-list: netdev Content-Length: 1567 Lines: 44 e100 is NAPI all the time, so the Kconfig option is wasting space. Signed-off-by: Scott Feldman --- linux-2.6.11-rc2/drivers/net/Kconfig.orig 2005-01-31 17:10:44.900111944 -0800 +++ linux-2.6.11-rc2/drivers/net/Kconfig 2005-01-31 17:10:52.137011768 -0800 @@ -1428,23 +1428,6 @@ . The module will be called e100. -config E100_NAPI - bool "Use Rx Polling (NAPI)" - depends on E100 - help - NAPI is a new driver API designed to reduce CPU and interrupt load - when the driver is receiving lots of packets from the card. It is - still somewhat experimental and thus not yet enabled by default. - - If your estimated Rx load is 10kpps or more, or if the card will be - deployed on potentially unfriendly networks (e.g. in a firewall), - then say Y here. - - See for more - information. - - If in doubt, say N. - config LNE390 tristate "Mylex EISA LNE390A/B support (EXPERIMENTAL)" depends on NET_PCI && EISA && EXPERIMENTAL --- linux-2.6.11-rc2/Documentation/networking/e100.txt.orig 2005-01-31 17:11:36.387284704 -0800 +++ linux-2.6.11-rc2/Documentation/networking/e100.txt 2005-01-31 17:12:36.503145704 -0800 @@ -140,8 +140,7 @@ NAPI ---- - NAPI (Rx polling mode) is supported in the e100 driver. NAPI is enabled - or disabled based on the configuration of the kernel. + NAPI (Rx polling mode) is supported in the e100 driver. See www.cyberus.ca/~hadi/usenix-paper.tgz for more information on NAPI. From pablo@eurodev.net Mon Jan 31 17:26:12 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 17:26:17 -0800 (PST) Received: from smtp09.retemail.es (smtp09.auna.com [62.81.186.19]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j111QBYK020008 for ; Mon, 31 Jan 2005 17:26:12 -0800 Received: from eurodev.net ([85.136.124.194]) by smtp09.retemail.es (InterMail vM.6.01.03.05 201-2131-111-107-20040910) with ESMTP id <20050201012605.EFY27734.smtp09.retemail.es@eurodev.net>; Tue, 1 Feb 2005 02:26:05 +0100 Message-ID: <41FEDAAF.5090201@eurodev.net> Date: Tue, 01 Feb 2005 02:26:07 +0100 From: Pablo Neira User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5 X-Accept-Language: en MIME-Version: 1.0 To: hadi@cyberus.ca CC: Thomas Graf , Patrick McHardy , netdev@oss.sgi.com, Harald Welte Subject: Re: [RFC] string matching ematch References: <20050126150714.GL31837@postel.suug.ch> <41F94C63.7010800@eurodev.net> <20050127205147.GS31837@postel.suug.ch> <1107179994.7840.164.camel@jzny.localdomain> In-Reply-To: <1107179994.7840.164.camel@jzny.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1138 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pablo@eurodev.net Precedence: bulk X-list: netdev Content-Length: 1650 Lines: 45 Hi jamal, Harald, I've cc'ed you since I think that this could be interesting. jamal wrote: >I think we should allow for all sorts of algrithms KMP, Boyer-Moore etc >to be plugged in (in tc this is already there). >The stuff that Harald was looking at (at least around July when i last >talked to him on this) is an infrastructure level thing. Its derived >from someone who seems to have well thought of the callbacks etc for a >good stateful solution. I cant remember the person from whom Harald was >deriving his stuff (email was somewhere in .fr) - but it did seem pretty >sensible. > yes, Phil Biondi's libqsearch. I started working with it but then I thought that it was a bit bloated because I didn't see the point of using several algorithms since boyer-moore is the best AFAIK. But Thomas thoughts about memory usage made me see that maybe this doesn't fit well all possible scenarios. So I've changed my mind and I think that such infrastructure level thing is required. Harald told me that he's going to finish soon his hacks based on libqsearch, then we could merge ideas based in that thing I've posted after christmas and his libqsearch mutant. > If we can have infrastructure that is also usable by tc, that >would be great so we dont go cutnpasting unnecessarily. > > definitely. >Having said all that: >Thomas, I think you should leave what you have as totaly stateless >unless we dont have a shareable solution. I have tons of ideas i could >share when we get to that level. > > I've got also some ideas, let's see if I can get settled one of them at least after the infrastructure have been cooked :). -- Pablo From anton@ozlabs.org Mon Jan 31 17:49:16 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 17:49:20 -0800 (PST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j111nFLS021912 for ; Mon, 31 Jan 2005 17:49:16 -0800 Received: by ozlabs.org (Postfix, from userid 1010) id AC9C667A6B; Tue, 1 Feb 2005 12:49:07 +1100 (EST) Date: Tue, 1 Feb 2005 12:43:58 +1100 From: Anton Blanchard To: Scott Feldman Cc: jgarzik@pobox.com, netdev@oss.sgi.com, lunz@falooley.org Subject: Re: [PATCH 2.6] e100: remove reference to NAPI config option Message-ID: <20050201014358.GD15786@krispykreme.ozlabs.ibm.com> References: <1107220952.3366.4.camel@sfeldma-mobl.dsl-verizon.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1107220952.3366.4.camel@sfeldma-mobl.dsl-verizon.net> User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1139 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: anton@samba.org Precedence: bulk X-list: netdev Content-Length: 439 Lines: 14 Hi Scott, > e100 is NAPI all the time, so the Kconfig option is wasting space. Speaking of NAPI... We have seen issues with NAPI on ppc64 on various cards in the past. Its possibly due to missing memory barriers; the interrupt and read of the interrupt status provide syncronization with DMA on the non NAPI case. Without this you need to be very careful to order reads (eg between reading the ring status and the packet data). Anton From sfeldma@pobox.com Mon Jan 31 18:02:52 2005 Received: with ECARTIS (v1.0.0; list netdev); Mon, 31 Jan 2005 18:02:58 -0800 (PST) Received: from orb.pobox.com (orb.pobox.com [207.8.226.5]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j1122pr5022760 for ; Mon, 31 Jan 2005 18:02:51 -0800 Received: from orb (localhost [127.0.0.1]) by orb.pobox.com (Postfix) with ESMTP id C37CDB8; Mon, 31 Jan 2005 21:02:50 -0500 (EST) Received: from [192.168.0.3] (wbar2.sea1-4-5-062-153.sea1.dsl-verizon.net [4.5.62.153]) by orb.sasl.smtp.pobox.com (Postfix) with ESMTP id 31CAF87; Mon, 31 Jan 2005 21:02:49 -0500 (EST) Subject: Re: [PATCH 2.6] e100: remove reference to NAPI config option From: Scott Feldman Reply-To: sfeldma@pobox.com To: Anton Blanchard Cc: netdev@oss.sgi.com In-Reply-To: <20050201014358.GD15786@krispykreme.ozlabs.ibm.com> References: <1107220952.3366.4.camel@sfeldma-mobl.dsl-verizon.net> <20050201014358.GD15786@krispykreme.ozlabs.ibm.com> Content-Type: text/plain Message-Id: <1107223468.3366.21.camel@sfeldma-mobl.dsl-verizon.net> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Mon, 31 Jan 2005 18:04:28 -0800 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.80/650/Sun Jan 2 19:00:02 2005 clamav-milter version 0.80j on 127.0.0.1 X-Virus-Status: Clean X-archive-position: 1140 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sfeldma@pobox.com Precedence: bulk X-list: netdev Content-Length: 622 Lines: 16 On Mon, 2005-01-31 at 17:43, Anton Blanchard wrote: > We have seen issues with NAPI on ppc64 on various cards in the past. > Its possibly due to missing memory barriers; the interrupt and read of > the interrupt status provide syncronization with DMA on the non NAPI > case. Without this you need to be very careful to order reads (eg > between reading the ring status and the packet data). Anton, do you think this is the same issue Russel King is reporting against ARM? http://marc.theaimsgroup.com/?l=linux-netdev&m=110686676829392&w=2 What happens in the ppc64 case? Do you have a fix for the ppc64 case? -scott